diff --git a/src/PlayerbotAI.cpp b/src/PlayerbotAI.cpp index fe4cf4b4..5869747c 100644 --- a/src/PlayerbotAI.cpp +++ b/src/PlayerbotAI.cpp @@ -1423,12 +1423,21 @@ void PlayerbotAI::DoNextAction(bool min) master = newMaster; botAI->SetMaster(newMaster); botAI->ResetStrategies(); - botAI->ChangeStrategy("+follow", BOT_STATE_NON_COMBAT); + + if (!bot->InBattleground()) + { + botAI->ChangeStrategy("+follow", BOT_STATE_NON_COMBAT); - if (botAI->GetMaster() == botAI->GetGroupMaster()) - botAI->TellMaster("Hello, I follow you!"); + if (botAI->GetMaster() == botAI->GetGroupMaster()) + botAI->TellMaster("Hello, I follow you!"); + else + botAI->TellMaster(!urand(0, 2) ? "Hello!" : "Hi!"); + } else - botAI->TellMaster(!urand(0, 2) ? "Hello!" : "Hi!"); + { + // we're in a battleground, stay with the pack and focus on objective + botAI->ChangeStrategy("-follow", BOT_STATE_NON_COMBAT); + } } } diff --git a/src/strategy/actions/FollowActions.cpp b/src/strategy/actions/FollowActions.cpp index 814010a2..5302748d 100644 --- a/src/strategy/actions/FollowActions.cpp +++ b/src/strategy/actions/FollowActions.cpp @@ -100,6 +100,10 @@ bool FollowAction::isUseful() bool FollowAction::CanDeadFollow(Unit* target) { + // In battleground, wait for spirit healer + if (bot->InBattleground() && !bot->IsAlive()) + return false; + // Move to corpse when dead and player is alive or not a ghost. if (!bot->IsAlive() && (target->IsAlive() || !target->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST))) return false; diff --git a/src/strategy/actions/ReleaseSpiritAction.cpp b/src/strategy/actions/ReleaseSpiritAction.cpp index 929ce403..554c0ce4 100644 --- a/src/strategy/actions/ReleaseSpiritAction.cpp +++ b/src/strategy/actions/ReleaseSpiritAction.cpp @@ -19,8 +19,14 @@ bool ReleaseSpiritAction::Execute(Event event) { if (bot->IsAlive()) { - botAI->TellMasterNoFacing("I am not dead, will wait here"); - botAI->ChangeStrategy("-follow,+stay", BOT_STATE_NON_COMBAT); + if (!bot->InBattleground()) + { + botAI->TellMasterNoFacing("I am not dead, will wait here"); + // -follow in bg is overwriten each tick with +follow + // +stay in bg causes stuttering effect as bot is cycled between +stay and +follow each tick + botAI->ChangeStrategy("-follow,+stay", BOT_STATE_NON_COMBAT); + } + return false; }