mod-playerbots/src/strategy/dungeons/wotlk/gundrak/GundrakMultipliers.cpp
Bobblybook e3cb8e9377 Dungeon strat improvements (GD & UP)
- Slad'ran (Gun'Drak): DPS will now kill snake wraps
- King Ymiron (Utgarde Pinnacle): Bots will stop attack during Bane. This still needs work, sometimes if they are mid-cast they will still let it finish and blow everyone up
2024-11-10 01:54:42 +11:00

63 lines
1.6 KiB
C++

#include "GundrakMultipliers.h"
#include "GundrakActions.h"
#include "GenericSpellActions.h"
#include "ChooseTargetActions.h"
#include "MovementActions.h"
#include "GundrakTriggers.h"
#include "Action.h"
float SladranMultiplier::GetValue(Action* action)
{
Unit* boss = AI_VALUE2(Unit*, "find target", "slad'ran");
if (!boss) { return 1.0f; }
if (boss->FindCurrentSpellBySpellId(SPELL_POISON_NOVA))
{
if (dynamic_cast<MovementAction*>(action) && !dynamic_cast<AvoidPoisonNovaAction*>(action))
{
return 0.0f;
}
}
if (!botAI->IsDps(bot)) { return 1.0f; }
if (action->getThreatType() == Action::ActionThreatType::Aoe)
{
return 0.0f;
}
Unit* snakeWrap = nullptr;
GuidVector targets = AI_VALUE(GuidVector, "possible targets no los");
for (auto& target : targets)
{
Unit* unit = botAI->GetUnit(target);
if (unit && unit->GetEntry() == NPC_SNAKE_WRAP)
{
snakeWrap = unit;
break;
}
}
// Prevent auto-target acquisition during snake wraps
if (snakeWrap && dynamic_cast<DpsAssistAction*>(action))
{
return 0.0f;
}
return 1.0f;
}
float GaldarahMultiplier::GetValue(Action* action)
{
Unit* boss = AI_VALUE2(Unit*, "find target", "gal'darah");
if (!boss) { return 1.0f; }
if (boss->HasAura(SPELL_WHIRLING_SLASH))
{
if (dynamic_cast<MovementAction*>(action) && !dynamic_cast<AvoidWhirlingSlashAction*>(action))
{
return 0.0f;
}
}
return 1.0f;
}