diff --git a/src/Ai/Class/Warrior/Action/WarriorActions.cpp b/src/Ai/Class/Warrior/Action/WarriorActions.cpp index 20a42c219..b30c1a38b 100644 --- a/src/Ai/Class/Warrior/Action/WarriorActions.cpp +++ b/src/Ai/Class/Warrior/Action/WarriorActions.cpp @@ -5,6 +5,7 @@ #include "WarriorActions.h" +#include "AiFactory.h" #include "Playerbots.h" bool CastBerserkerRageAction::isPossible() @@ -36,6 +37,27 @@ bool CastBerserkerRageAction::isUseful() bool CastSunderArmorAction::isUseful() { + Group* group = bot->GetGroup(); + if (!group) + return false; + + if (!botAI->IsTank(bot, false)) + { + for (GroupReference* ref = group->GetFirstMember(); ref; ref = ref->next()) + { + Player* member = ref->GetSource(); + if (!member || member == bot || !member->IsAlive() || !member->IsInWorld() || + member->GetMapId() != bot->GetMapId()) + { + continue; + } + + if (member->getClass() == CLASS_WARRIOR && + botAI->IsTank(member, false)) + return false; + } + } + Aura* aura = botAI->GetAura("sunder armor", GetTarget(), false, true); return !aura || aura->GetStackAmount() < 5 || aura->GetDuration() <= 6000; } diff --git a/src/Ai/Class/Warrior/Strategy/ArmsWarriorStrategy.cpp b/src/Ai/Class/Warrior/Strategy/ArmsWarriorStrategy.cpp index bbae89d20..193aab1d7 100644 --- a/src/Ai/Class/Warrior/Strategy/ArmsWarriorStrategy.cpp +++ b/src/Ai/Class/Warrior/Strategy/ArmsWarriorStrategy.cpp @@ -112,6 +112,7 @@ std::vector ArmsWarriorStrategy::getDefaultActions() return { NextAction("bladestorm", ACTION_DEFAULT + 0.2f), NextAction("mortal strike", ACTION_DEFAULT + 0.1f), + NextAction("sunder armor", ACTION_DEFAULT + 0.05f), NextAction("melee", ACTION_DEFAULT) }; }