View Single Post
  #5  
Old 12-18-2012, 04:22 PM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

the only thing i can see that would be causing an issue is that not all bot owners are using the command, as it currently checks for ownership here:

Code:
if(botGroupMember && botGroupMember->GetBotOwnerCharacterID() == client->CharacterID()) {
if you want the group leader to be able to issue the command to all bots in the group, regardless of ownership, you should be able to use this instead:

Code:
void Bot::BotGroupOrderGuard(Group* group, Client* client)
{
    if (!client || !group)
        return;

    Mob* leader = group->GetLeader();
    int32   cid = client->CharacterID();

    for (int i = 0; i < MAX_GROUP_MEMBERS; i++)
    {
        if (!group->members[i] || !group->members[i]->IsBot())
            continue;

        Bot*   bot = group->members[i]->CastToBot();
        uint32 oid = bot->GetBotOwnerCharacterID();

        // verify command was issued by bot owner or group leader
        if (cid != oid && client->CastToMob() != leader)
            continue;

        bot->SetFollowID(0);
        bot->WipeHateList();
        bot->Say("Guarding here.");

        if (!bot->HasPet() || !bot->GetPet())
            continue;
        bot->GetPet()->WipeHateList();
    }
}
it looks like the #bot botgroup guard command may have unexpected results when you have a bot-only group whose members are owned by more than one client as well, but that's probably a fairly rare occurrence.
Reply With Quote