Files
mod-playerbots/src/strategy/deathknight/DKTriggers.cpp
Yunfan Li f20d3aea6c Unholy dk
2024-09-06 20:29:56 +08:00

66 lines
1.7 KiB
C++

/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
* and/or modify it under version 2 of the License, or (at your option), any later version.
*/
#include "DKTriggers.h"
#include <string>
#include "GenericTriggers.h"
#include "Playerbots.h"
#include "SharedDefines.h"
bool DKPresenceTrigger::IsActive()
{
Unit* target = GetTarget();
return !botAI->HasAura("blood presence", target) && !botAI->HasAura("unholy presence", target) &&
!botAI->HasAura("frost presence", target);
}
bool PestilenceGlyphTrigger::IsActive()
{
if (!SpellTrigger::IsActive())
{
return false;
}
if (!bot->HasAura(63334))
{
return false;
}
Aura* blood_plague = botAI->GetAura("blood plague", GetTarget(), true, true);
Aura* frost_fever = botAI->GetAura("frost fever", GetTarget(), true, true);
if ((blood_plague && blood_plague->GetDuration() <= 3000) || (frost_fever && frost_fever->GetDuration() <= 3000))
{
return true;
}
return false;
}
bool HighBloodRuneTrigger::IsActive()
{
return !bot->GetRuneCooldown(0) && !bot->GetRuneCooldown(1);
}
bool HighFrostRuneTrigger::IsActive()
{
return !bot->GetRuneCooldown(2) && !bot->GetRuneCooldown(3);
}
bool HighUnholyRuneTrigger::IsActive()
{
return !bot->GetRuneCooldown(4) && !bot->GetRuneCooldown(5);
}
bool DesolationTrigger::IsActive()
{
return bot->HasAura(66817) && BuffTrigger::IsActive();
}
bool DeathAndDecayCooldownTrigger::IsActive()
{
uint32 spellId = AI_VALUE2(uint32, "spell id", name);
if (!spellId)
return true;
return bot->GetSpellCooldownDelay(spellId) >= 3000;
}