Files
mod-playerbots/src/strategy/dungeons/wotlk/utgardekeep/UtgardeKeepTriggers.cpp
Bobblybook dd73fe8a90 Dungeon botAI bugfixes
- Utgarde Keep (Keleseth): Bots continue combat correctly after killing a frost tomb
- Utgarde Keep (Dalronn & Skarvald): Bots continue combat correctly after killing Dalronn
- Utgarde Keep (Ingvar): Tank correctly avoids Dark Smash in second phase
- Oculus (Drake combat): Bots more consistently attack the drakes in the air when flying around
- Halls of Lightning (Bjarngrim): Bots no longer acquire priority targets until in combat
2024-11-05 19:11:24 +11:00

84 lines
2.3 KiB
C++

#include "Playerbots.h"
#include "UtgardeKeepTriggers.h"
#include "AiObject.h"
#include "AiObjectContext.h"
bool KelesethFrostTombTrigger::IsActive()
{
GuidVector members = AI_VALUE(GuidVector, "group members");
for (auto& member : members)
{
Unit* unit = botAI->GetUnit(member);
if (unit && unit->HasAura(SPELL_FROST_TOMB))
{
return true;
}
}
return false;
}
bool DalronnDpsTrigger::IsActive()
{
Unit* boss = AI_VALUE2(Unit*, "find target", "dalronn the controller");
if (!boss || !boss->isTargetableForAttack()) { return false; }
// This doesn't cause issues with healers currently and they will continue to heal even when included here
return !botAI->IsTank(bot);
}
bool IngvarStaggeringRoarTrigger::IsActive()
{
Unit* boss = AI_VALUE2(Unit*, "find target", "ingvar the plunderer");
if (!boss) { return false; }
if (boss->FindCurrentSpellBySpellId(SPELL_STAGGERING_ROAR))
{
return true;
}
return false;
}
bool IngvarDreadfulRoarTrigger::IsActive()
{
Unit* boss = AI_VALUE2(Unit*, "find target", "ingvar the plunderer");
if (!boss) { return false; }
if (boss->FindCurrentSpellBySpellId(SPELL_DREADFUL_ROAR))
{
return true;
}
return false;
}
bool IngvarSmashTankTrigger::IsActive()
{
Unit* boss = AI_VALUE2(Unit*, "find target", "ingvar the plunderer");
if (!boss || !botAI->IsTank(bot)) { return false; }
if (boss->FindCurrentSpellBySpellId(SPELL_SMASH) ||
boss->FindCurrentSpellBySpellId(SPELL_DARK_SMASH))
{
return true;
}
return false;
}
bool IngvarSmashTankReturnTrigger::IsActive()
{
Unit* boss = AI_VALUE2(Unit*, "find target", "ingvar the plunderer");
// if (!boss || !botAI->IsTank(bot) || boss->HasUnitState(UNIT_STATE_CASTING))
// Ignore casting state as Ingvar will sometimes chain-cast a roar after a smash..
// We don't want this to prevent our tank from repositioning properly.
if (!boss || !botAI->IsTank(bot)) { return false; }
return true;
}
bool NotBehindIngvarTrigger::IsActive()
{
Unit* boss = AI_VALUE2(Unit*, "find target", "ingvar the plunderer");
if (!boss || botAI->IsTank(bot)) { return false; }
return AI_VALUE2(bool, "behind", "current target");
}