mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
Unholy DK
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -37,4 +37,12 @@ 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);
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user