mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-13 17:09:08 +00:00
Warlock overhaul (#1397)
This is a complete overhaul of the warlock class, making 3 new strategies (affliction, demonology, and destruction), as well as finishing the warlock tank strategy (shadow ward and searing pain). It also includes a soulstone fix, where the bots can change who they soulstone based on the non-combat strategies you set for them. It also includes a self-resurrect action and trigger that allows the bots to resurrect using a soulstone or reincarnation. Many other skills were added to finish out the warlock skillset.
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
#include "GenericWarlockStrategy.h"
|
||||
|
||||
#include "Strategy.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
class GenericWarlockStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
|
||||
@@ -12,28 +12,22 @@ class GenericWarlockStrategyActionNodeFactory : public NamedObjectFactory<Action
|
||||
public:
|
||||
GenericWarlockStrategyActionNodeFactory()
|
||||
{
|
||||
// creators["summon voidwalker"] = &summon_voidwalker;
|
||||
creators["banish"] = &banish;
|
||||
creators["banish on cc"] = &banish_on_cc;
|
||||
creators["fear on cc"] = &fear_on_cc;
|
||||
creators["spell lock"] = &spell_lock;
|
||||
creators["devour magic purge"] = &devour_magic_purge;
|
||||
creators["devour magic cleanse"] = &devour_magic_cleanse;
|
||||
}
|
||||
|
||||
private:
|
||||
// static ActionNode* summon_voidwalker([[maybe_unused]] PlayerbotAI* botAI)
|
||||
//{
|
||||
// return new ActionNode ("summon voidwalker",
|
||||
/*P*/ // nullptr,
|
||||
/*A*/ // NextAction::array(0, new NextAction("drain soul"), nullptr),
|
||||
/*C*/ // nullptr);
|
||||
//}
|
||||
static ActionNode* banish([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("banish",
|
||||
/*P*/ nullptr,
|
||||
/*A*/ NextAction::array(0, new NextAction("fear"), nullptr),
|
||||
/*C*/ nullptr);
|
||||
}
|
||||
static ActionNode* banish_on_cc(PlayerbotAI*) { return new ActionNode("banish on cc", nullptr, nullptr, nullptr); }
|
||||
static ActionNode* fear_on_cc(PlayerbotAI*) { return new ActionNode("fear on cc", nullptr, nullptr, nullptr); }
|
||||
static ActionNode* spell_lock(PlayerbotAI*) { return new ActionNode("spell lock", nullptr, nullptr, nullptr); }
|
||||
static ActionNode* devour_magic_purge(PlayerbotAI*) { return new ActionNode("devour magic purge", nullptr, nullptr, nullptr); }
|
||||
static ActionNode* devour_magic_cleanse(PlayerbotAI*) { return new ActionNode("devour magic cleanse", nullptr, nullptr, nullptr); }
|
||||
};
|
||||
|
||||
GenericWarlockStrategy::GenericWarlockStrategy(PlayerbotAI* botAI) : RangedCombatStrategy(botAI)
|
||||
GenericWarlockStrategy::GenericWarlockStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI)
|
||||
{
|
||||
actionNodeFactories.Add(new GenericWarlockStrategyActionNodeFactory());
|
||||
}
|
||||
@@ -42,28 +36,38 @@ NextAction** GenericWarlockStrategy::getDefaultActions() { return NextAction::ar
|
||||
|
||||
void GenericWarlockStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
RangedCombatStrategy::InitTriggers(triggers);
|
||||
CombatStrategy::InitTriggers(triggers);
|
||||
|
||||
// triggers.push_back(new TriggerNode("shadow trance", NextAction::array(0, new NextAction("shadow bolt", 20.0f),
|
||||
// nullptr))); triggers.push_back(new TriggerNode("low health", NextAction::array(0, new NextAction("drain
|
||||
// life", 40.0f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("low mana", NextAction::array(0, new NextAction("life tap", ACTION_EMERGENCY + 5), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("target critical health", NextAction::array(0, new NextAction("drain soul", 30.0f), nullptr)));
|
||||
// triggers.push_back(new TriggerNode("immolate", NextAction::array(0, new NextAction("immolate", 13.0f), new
|
||||
// NextAction("conflagrate", 13.0f), nullptr))); triggers.push_back(new TriggerNode("enemy too close for spell",
|
||||
// NextAction::array(0, new NextAction("flee", 49.0f), NULL)));
|
||||
triggers.push_back(new TriggerNode("low mana", NextAction::array(0, new NextAction("life tap", ACTION_EMERGENCY + 5), nullptr)));
|
||||
triggers.push_back(new TriggerNode("medium threat", NextAction::array(0, new NextAction("soulshatter", 55.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("spell lock", NextAction::array(0, new NextAction("spell lock", ACTION_INTERRUPT), nullptr)));
|
||||
triggers.push_back(new TriggerNode("devour magic purge", NextAction::array(0, new NextAction("devour magic purge", ACTION_DISPEL), nullptr)));
|
||||
triggers.push_back(new TriggerNode("devour magic cleanse", NextAction::array(0, new NextAction("devour magic cleanse", ACTION_DISPEL), nullptr)));
|
||||
}
|
||||
|
||||
void WarlockBoostStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(
|
||||
new TriggerNode("amplify curse", NextAction::array(0, new NextAction("amplify curse", 41.0f), nullptr)));
|
||||
// Placeholder for future boost triggers
|
||||
}
|
||||
|
||||
void WarlockPetStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
// Placeholder for future pet triggers
|
||||
}
|
||||
|
||||
void WarlockCcStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("banish", NextAction::array(0, new NextAction("banish on cc", 32.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("fear", NextAction::array(0, new NextAction("fear on cc", 33.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("banish", NextAction::array(0, new NextAction("banish on cc", 33.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("fear", NextAction::array(0, new NextAction("fear on cc", 32.0f), nullptr)));
|
||||
}
|
||||
|
||||
// Combat strategy for using Curse of the Elements
|
||||
// Enabling this will turn off their use of Curse of Agony
|
||||
// Enabled by default for the Destruction spec
|
||||
// To enable, type "co +curse of elements"
|
||||
// To disable, type "co -curse of elements"
|
||||
|
||||
void WarlockCurseOfTheElementsStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("curse of the elements", NextAction::array(0, new NextAction("curse of the elements", 30.0f), nullptr)));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user