Unholy DK

This commit is contained in:
Yunfan Li
2024-04-10 19:10:47 +08:00
parent d01953d2e0
commit 9eb9fd3a7d
4 changed files with 31 additions and 10 deletions

View File

@@ -88,6 +88,7 @@ class DeathKnightTriggerFactoryInternal : public NamedObjectContext<Trigger>
creators["high blood rune"] = &DeathKnightTriggerFactoryInternal::high_blood_rune;
creators["freezing fog"] = &DeathKnightTriggerFactoryInternal::freezing_fog;
creators["no desolation"] = &DeathKnightTriggerFactoryInternal::no_desolation;
creators["death and decay cooldown"] = &DeathKnightTriggerFactoryInternal::death_and_decay_cooldown;
}
private:
@@ -112,6 +113,8 @@ class DeathKnightTriggerFactoryInternal : public NamedObjectContext<Trigger>
static Trigger* high_blood_rune(PlayerbotAI* botAI) { return new HighBloodRuneTrigger(botAI); }
static Trigger* freezing_fog(PlayerbotAI* botAI) { return new FreezingFogTrigger(botAI); }
static Trigger* no_desolation(PlayerbotAI* botAI) { return new DesolationTrigger(botAI); }
static Trigger* death_and_decay_cooldown(PlayerbotAI* botAI) { return new DeathAndDecayCooldownTrigger(botAI); }
};
class DeathKnightAiObjectContextInternal : public NamedObjectContext<Action>

View File

@@ -38,3 +38,11 @@ bool HighBloodRuneTrigger::IsActive() {
bool DesolationTrigger::IsActive() {
return bot->HasAura(66817) && !botAI->HasAura("desolation", GetTarget(), false, true, -1, true);
}
bool DeathAndDecayCooldownTrigger::IsActive() {
uint32 spellId = AI_VALUE2(uint32, "spell id", name);
if (!spellId)
return true;
return bot->HasSpellCooldown(spellId);
}

View File

@@ -146,4 +146,11 @@ class DesolationTrigger : public BuffTrigger
bool IsActive() override;
};
class DeathAndDecayCooldownTrigger : public SpellCooldownTrigger
{
public:
DeathAndDecayCooldownTrigger(PlayerbotAI* botAI) : SpellCooldownTrigger(botAI, "death and decay") { }
bool IsActive() override;
};
#endif

View File

@@ -72,16 +72,11 @@ UnholyDKStrategy::UnholyDKStrategy(PlayerbotAI* botAI) : GenericDKStrategy(botAI
NextAction** UnholyDKStrategy::getDefaultActions()
{
return NextAction::array(0,
// new NextAction("scourge strike", ACTION_DEFAULT + 0.8f),
new NextAction("death and decay", ACTION_DEFAULT + 0.9f),
new NextAction("ghoul frenzy", ACTION_DEFAULT + 0.8f),
new NextAction("icy touch", ACTION_DEFAULT + 0.7f),
new NextAction("blood boil", ACTION_DEFAULT + 0.6f),
new NextAction("blood strike", ACTION_DEFAULT + 0.5f),
new NextAction("plague strike", ACTION_DEFAULT + 0.4f),
new NextAction("horn of winter", ACTION_DEFAULT + 0.3f),
new NextAction("summon gargoyle", ACTION_DEFAULT + 0.2f),
new NextAction("death coil", ACTION_DEFAULT + 0.1f),
new NextAction("death and decay", ACTION_DEFAULT + 1.0f),
new NextAction("scourge strike", ACTION_DEFAULT + 0.8f),
new NextAction("horn of winter", ACTION_DEFAULT + 0.6f),
new NextAction("summon gargoyle", ACTION_DEFAULT + 0.4f),
new NextAction("death coil", ACTION_DEFAULT + 0.2f),
new NextAction("melee", ACTION_DEFAULT),
nullptr);
}
@@ -93,6 +88,14 @@ void UnholyDKStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
// triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction(, ACTION_NORMAL + 2), nullptr)));
triggers.push_back(new TriggerNode("critical health", NextAction::array(0, new NextAction("death pact", ACTION_HIGH + 5), nullptr)));
triggers.push_back(new TriggerNode("no desolation", NextAction::array(0, new NextAction("blood strike", ACTION_HIGH + 4), nullptr)));
triggers.push_back(new TriggerNode("death and decay cooldown",
NextAction::array(0,
new NextAction("ghoul frenzy", ACTION_DEFAULT + 5.0f),
new NextAction("scourge strike", ACTION_DEFAULT + 4.0f),
new NextAction("blood boil", ACTION_NORMAL + 3.0f),
new NextAction("icy touch", ACTION_NORMAL + 2.0f),
new NextAction("plague strike", ACTION_NORMAL + 1.0f),
nullptr)));
}
void UnholyDKAoeStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)