View Single Post
  #9  
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