Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Bots

Development::Bots Forum for bots.

Reply
 
Thread Tools Display Modes
  #1  
Old 12-18-2012, 12:48 PM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

what exactly do you see happening?

is everyone in the group using the command for their bots?
Reply With Quote
  #2  
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
  #3  
Old 12-19-2012, 10:20 PM
dfusion111
Fire Beetle
 
Join Date: Jun 2010
Posts: 15
Default

Thanks, Ill try this when I get a chance.
Reply With Quote
  #4  
Old 12-20-2012, 03:55 PM
dfusion111
Fire Beetle
 
Join Date: Jun 2010
Posts: 15
Default

Unfortunately it didn't work...

The problem is with the cleric bots mainly. Its like the ai ignores the fact they are guarding and moves them into range to cast a healing spell. When the combat ends, they remain in that spot guarding. Its only during combat, but only when 2 bots are in the group. The bot guards fine as long as its the only bot in the group, as far as I can tell, players told me they only had the 1 bot and a couple players and this happened, but I cant repeat that. It seems to work fine as long as its the only bot in the group. As soon as I add a 2nd bot, say a rog, and it becomes engaged in combat, the cleric bot moves into range, ignoring its command to guard. Before it would stay put, not caring if we are out of range dying, only when moved into its casting range would it start healing. I don't think the problem is in the command itself, but in the ai where it is casting a spell and checking the range, moving them into range(and ignoring the guard command) but I cant seem to find it.
Reply With Quote
  #5  
Old 12-20-2012, 06:37 PM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

oh, ok. that's because there is no check for GetFollowID() in the out of combat part of Bot::AI_Process(). if you want to keep a bot from doing anything at all when told to guard, until given another command, you can add the stuff in red here:

Code:
// AI Processing for the Bot object
void Bot::AI_Process() {
    _ZP(Mob_BOT_Process);

    if(!IsAIControlled() || !GetFollowID())
        return;
Reply With Quote
  #6  
Old 12-20-2012, 06:57 PM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

or... you can add the lines in red here:

Code:
// AI Processing for the Bot object
void Bot::AI_Process() {
    _ZP(Mob_BOT_Process);

    if(!IsAIControlled())
        return;

    int8 botClass = GetClass();
    uint8 botLevel = GetLevel();

    if(IsCasting() && (botClass != BARD))
        return;

    // A bot wont start its AI if not grouped
    if(!GetBotOwner() || !IsGrouped()) {
        return;
    }

    if(GetAppearance() == eaDead)
        return;

    Mob* BotOwner = GetBotOwner();

    // The bots need an owner
    if(!BotOwner)
        return;

    try {
        if(BotOwner->CastToClient()->IsDead()) {
            SetTarget(0);
            SetBotOwner(0);
            return;
        }
    }
    catch(...) {
        SetTarget(0);
        SetBotOwner(0);
        return;
    }
    
    if(!GetFollowID()) {
        if(GetArchetype() != ARCHETYPE_MELEE) {
            if (GetManaPercent() < 100)
                BotMeditate(true);
            else
                BotMeditate(false);
        }
        return;
    }
this should cause any bot that isn't pure melee to meditate if they are set to guard and have less than 100% mana. code compiled, but otherwise untested.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 02:52 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3