public static bool TryGetGroupGump(BaseCreature bc, SpeechEventArgs e)
{
bc.DebugSay("Checking to see if someone wants to see my group...");
bool wasNamed = false;
string[] speech = e.Speech.ToLower().Split(' ');
string[] listenerName = bc.Name.ToLower().Split(' ');
foreach (string word in speech)
{
foreach (string name in listenerName)
{
if (word == name)
{
wasNamed = true;
continue;
}
}
if (wasNamed)
continue;
}
if (e.Mobile is PlayerMobile && wasNamed && (e.Speech.ToLower().Contains("group") && e.Speech.ToLower().Contains("your")))
{
PlayerMobile pm = e.Mobile as PlayerMobile;
if (HasGroup(bc))
{
if (IsGroupLeader(bc, pm))
return true;
else if (bc is Soldier && (bc as Soldier).Government != null && !(bc as Soldier).Government.Deleted)
{
if (CustomGuildStone.IsGuildOfficer(pm, (bc as Soldier).Government))
return true;
}
else if (bc.Controlled && bc.ControlMaster != null && bc.ControlMaster == pm)
{
return true;
}
return false;
}
else
{
if (bc.Controlled && bc.ControlMaster != null && bc.ControlMaster == pm)
{
pm.SendMessage(bc.Name + " has no group.");
}
if (bc is Soldier && (bc as Soldier).Government != null && !(bc as Soldier).Government.Deleted)
{
if (CustomGuildStone.IsGuildOfficer(pm, (bc as Soldier).Government))
pm.SendMessage(bc.Name + " has no group.");
}
return false;
}
}
else
return false;
}