Unholy DK

This commit is contained in:
Yunfan Li
2024-04-08 22:09:26 +08:00
parent 6b49af345f
commit a9c3236e35
5 changed files with 30 additions and 15 deletions

View File

@@ -224,10 +224,10 @@ class CastDeathCoilAction : public CastSpellAction
CastDeathCoilAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "death coil") { }
};
class CastBloodBoilAction : public CastBuffSpellAction
class CastBloodBoilAction : public CastSpellAction
{
public:
CastBloodBoilAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "blood boil") { }
CastBloodBoilAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "blood boil") { }
};
class CastDeathAndDecayAction : public CastSpellAction

View File

@@ -87,6 +87,7 @@ class DeathKnightTriggerFactoryInternal : public NamedObjectContext<Trigger>
creators["unbreakable armor"] = &DeathKnightTriggerFactoryInternal::unbreakable_armor;
creators["high blood rune"] = &DeathKnightTriggerFactoryInternal::high_blood_rune;
creators["freezing fog"] = &DeathKnightTriggerFactoryInternal::freezing_fog;
creators["no desolation"] = &DeathKnightTriggerFactoryInternal::no_desolation;
}
private:
@@ -110,7 +111,7 @@ class DeathKnightTriggerFactoryInternal : public NamedObjectContext<Trigger>
static Trigger* unbreakable_armor(PlayerbotAI* botAI) { return new UnbreakableArmorTrigger(botAI); }
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); }
};
class DeathKnightAiObjectContextInternal : public NamedObjectContext<Action>

View File

@@ -3,6 +3,7 @@
*/
#include "DKTriggers.h"
#include "GenericTriggers.h"
#include "Playerbots.h"
#include "SharedDefines.h"
#include <string>
@@ -32,4 +33,8 @@ bool PestilenceTrigger::IsActive() {
bool HighBloodRuneTrigger::IsActive() {
// bot->Say(std::to_string(bot->GetBaseRune(0)) + "_" + std::to_string(bot->GetRuneCooldown(0)) + " " + std::to_string(bot->GetBaseRune(1)) + "_" + std::to_string(bot->GetRuneCooldown(1)), LANG_UNIVERSAL);
return !bot->GetRuneCooldown(0) && !bot->GetRuneCooldown(1);
}
bool DesolationTrigger::IsActive() {
return bot->HasAura(66817) && HasAuraTrigger::IsActive();
}

View File

@@ -139,4 +139,11 @@ class FreezingFogTrigger : public HasAuraTrigger
FreezingFogTrigger(PlayerbotAI* botAI) : HasAuraTrigger(botAI, "freezing fog") { }
};
class DesolationTrigger : public HasAuraTrigger
{
public:
DesolationTrigger(PlayerbotAI* botAI) : HasAuraTrigger(botAI, "desolation") { }
bool IsActive() override;
};
#endif

View File

@@ -34,7 +34,7 @@ class UnholyDKStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
static ActionNode* death_strike([[maybe_unused]] PlayerbotAI* botAI)
{
return new ActionNode("death strike",
/*P*/ NextAction::array(0, new NextAction("blood presence"), nullptr),
/*P*/ NextAction::array(0, new NextAction("unholy presence"), nullptr),
/*A*/ nullptr,
/*C*/ nullptr);
}
@@ -42,7 +42,7 @@ class UnholyDKStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
static ActionNode* corpse_explosion([[maybe_unused]] PlayerbotAI* botAI)
{
return new ActionNode("corpse explosion",
/*P*/ NextAction::array(0, new NextAction("blood presence"), nullptr),
/*P*/ NextAction::array(0, new NextAction("unholy presence"), nullptr),
/*A*/ nullptr,
/*C*/ nullptr);
}
@@ -50,14 +50,14 @@ class UnholyDKStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
static ActionNode* scourge_strike([[maybe_unused]] PlayerbotAI* botAI)
{
return new ActionNode("scourge strike",
/*P*/ NextAction::array(0, new NextAction("blood presence"), nullptr),
/*P*/ NextAction::array(0, new NextAction("unholy presence"), nullptr),
/*A*/ nullptr,
/*C*/ nullptr);
}
static ActionNode* icy_touch([[maybe_unused]] PlayerbotAI* botAI)
{
return new ActionNode("icy touch",
/*P*/ NextAction::array(0, new NextAction("blood presence"), nullptr),
/*P*/ NextAction::array(0, new NextAction("unholy presence"), nullptr),
/*A*/ nullptr,
/*C*/ nullptr);
}
@@ -72,13 +72,14 @@ UnholyDKStrategy::UnholyDKStrategy(PlayerbotAI* botAI) : GenericDKStrategy(botAI
NextAction** UnholyDKStrategy::getDefaultActions()
{
return NextAction::array(0,
new NextAction("scourge strike", ACTION_DEFAULT + 0.8f),
new NextAction("blood strike", ACTION_DEFAULT + 0.7f),
new NextAction("ghoul frenzy", ACTION_DEFAULT + 0.6f),
new NextAction("summon gargoyle", ACTION_DEFAULT + 0.5f),
new NextAction("death coil", ACTION_DEFAULT + 0.4f),
new NextAction("plague strike", ACTION_DEFAULT + 0.3f),
new NextAction("icy touch", ACTION_DEFAULT + 0.2f),
// new NextAction("scourge strike", ACTION_DEFAULT + 0.8f),
new NextAction("death and decay", ACTION_DEFAULT + 0.8),
new NextAction("ghoul frenzy", ACTION_DEFAULT + 0.7f),
new NextAction("blood boil", ACTION_DEFAULT + 0.6f),
new NextAction("icy touch", ACTION_DEFAULT + 0.5f),
new NextAction("plague strike", ACTION_DEFAULT + 0.4f),
new NextAction("summon gargoyle", ACTION_DEFAULT + 0.3f),
new NextAction("death coil", ACTION_DEFAULT + 0.2f),
new NextAction("horn of winter", ACTION_DEFAULT + 0.1f),
new NextAction("melee", ACTION_DEFAULT),
nullptr);
@@ -89,7 +90,8 @@ void UnholyDKStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
GenericDKStrategy::InitTriggers(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_EMERGENCY + 1), 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)));
}
void UnholyDKAoeStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)