From 739f864411e23012f1712cb36352c6e89be85fcd Mon Sep 17 00:00:00 2001 From: Flekz Date: Sat, 23 Sep 2023 22:44:15 +0100 Subject: [PATCH] Add cc strategy to shaman bots --- playerbot/AiFactory.cpp | 12 +- .../shaman/ElementalShamanStrategy.cpp | 162 ++++++++++++++-- .../strategy/shaman/ElementalShamanStrategy.h | 43 +++++ .../shaman/EnhancementShamanStrategy.cpp | 174 ++++++++++++++++-- .../shaman/EnhancementShamanStrategy.h | 43 +++++ .../shaman/RestorationShamanStrategy.cpp | 138 ++++++++++++++ .../shaman/RestorationShamanStrategy.h | 43 +++++ playerbot/strategy/shaman/ShamanActions.h | 36 ++++ .../strategy/shaman/ShamanAiObjectContext.cpp | 31 ++++ playerbot/strategy/shaman/ShamanStrategy.cpp | 168 ++++++++++++++--- playerbot/strategy/shaman/ShamanStrategy.h | 31 ++++ 11 files changed, 827 insertions(+), 54 deletions(-) diff --git a/playerbot/AiFactory.cpp b/playerbot/AiFactory.cpp index 668f6db8e..c67ca149f 100644 --- a/playerbot/AiFactory.cpp +++ b/playerbot/AiFactory.cpp @@ -363,7 +363,7 @@ void AiFactory::AddDefaultCombatStrategies(Player* player, PlayerbotAI* const fa { if (tab == 0) { - combatEngine->addStrategies("elemental", "aoe", "bmana", "threat", "flee", "ranged", NULL); + combatEngine->addStrategies("elemental", "aoe", "cc", "bmana", "threat", "flee", "ranged", NULL); } else if (tab == 2) { @@ -371,7 +371,7 @@ void AiFactory::AddDefaultCombatStrategies(Player* player, PlayerbotAI* const fa } else { - combatEngine->addStrategies("enhancement", "aoe", "bdps", "threat", "close", NULL); + combatEngine->addStrategies("enhancement", "aoe", "cc", "bdps", "threat", "close", NULL); } combatEngine->addStrategies("dps assist", "cure", "totems", "buff", "boost", NULL); @@ -511,7 +511,7 @@ void AiFactory::AddDefaultCombatStrategies(Player* player, PlayerbotAI* const fa if (player->getClass() == CLASS_SHAMAN && tab == 2) { - combatEngine->addStrategies("elemental", "aoe", NULL); + combatEngine->addStrategies("elemental", "aoe", "cc", NULL); } if (player->getClass() == CLASS_PALADIN && tab == 0) @@ -587,7 +587,7 @@ void AiFactory::AddDefaultCombatStrategies(Player* player, PlayerbotAI* const fa if (player->getClass() == CLASS_SHAMAN && tab == 2) { - combatEngine->addStrategies("elemental", "aoe", NULL); + combatEngine->addStrategies("elemental", "aoe", "cc", NULL); } if (player->getClass() == CLASS_DRUID && tab == 2) @@ -654,7 +654,7 @@ void AiFactory::AddDefaultNonCombatStrategies(Player* player, PlayerbotAI* const { if (tab == 0) { - nonCombatEngine->addStrategies("elemental", "bmana", "aoe", NULL); + nonCombatEngine->addStrategies("elemental", "bmana", "aoe", "cc", NULL); } else if (tab == 2) { @@ -662,7 +662,7 @@ void AiFactory::AddDefaultNonCombatStrategies(Player* player, PlayerbotAI* const } else { - nonCombatEngine->addStrategies("enhancement", "bdps", NULL); + nonCombatEngine->addStrategies("enhancement", "bdps", "aoe", "cc", NULL); } nonCombatEngine->addStrategies("dps assist", "cure", "totems", "buff", "boost", NULL); diff --git a/playerbot/strategy/shaman/ElementalShamanStrategy.cpp b/playerbot/strategy/shaman/ElementalShamanStrategy.cpp index 7e2c70fe4..b958a76d7 100644 --- a/playerbot/strategy/shaman/ElementalShamanStrategy.cpp +++ b/playerbot/strategy/shaman/ElementalShamanStrategy.cpp @@ -45,10 +45,6 @@ void ElementalShamanStrategy::InitCombatTriggers(std::list& trigge { ShamanStrategy::InitCombatTriggers(triggers); - triggers.push_back(new TriggerNode( - "frost shock snare", - NextAction::array(0, new NextAction("frost shock", ACTION_HIGH), NULL))); - triggers.push_back(new TriggerNode( "shock", NextAction::array(0, new NextAction("earth shock", ACTION_NORMAL), NULL))); @@ -191,6 +187,56 @@ void ElementalShamanAoeRaidStrategy::InitNonCombatTriggers(std::list& triggers) +{ + ShamanCcStrategy::InitCombatTriggers(triggers); + + triggers.push_back(new TriggerNode( + "frost shock snare", + NextAction::array(0, new NextAction("frost shock", ACTION_HIGH), NULL))); +} + +void ElementalShamanCcStrategy::InitNonCombatTriggers(std::list& triggers) +{ + ShamanCcStrategy::InitNonCombatTriggers(triggers); +} + +void ElementalShamanCcPveStrategy::InitCombatTriggers(std::list& triggers) +{ + ElementalShamanCcStrategy::InitCombatTriggers(triggers); + ShamanCcPveStrategy::InitCombatTriggers(triggers); +} + +void ElementalShamanCcPveStrategy::InitNonCombatTriggers(std::list& triggers) +{ + ElementalShamanCcStrategy::InitNonCombatTriggers(triggers); + ShamanCcPveStrategy::InitNonCombatTriggers(triggers); +} + +void ElementalShamanCcPvpStrategy::InitCombatTriggers(std::list& triggers) +{ + ElementalShamanCcStrategy::InitCombatTriggers(triggers); + ShamanCcPvpStrategy::InitCombatTriggers(triggers); +} + +void ElementalShamanCcPvpStrategy::InitNonCombatTriggers(std::list& triggers) +{ + ElementalShamanCcStrategy::InitNonCombatTriggers(triggers); + ShamanCcPvpStrategy::InitNonCombatTriggers(triggers); +} + +void ElementalShamanCcRaidStrategy::InitCombatTriggers(std::list& triggers) +{ + ElementalShamanCcStrategy::InitCombatTriggers(triggers); + ShamanCcRaidStrategy::InitCombatTriggers(triggers); +} + +void ElementalShamanCcRaidStrategy::InitNonCombatTriggers(std::list& triggers) +{ + ElementalShamanCcStrategy::InitNonCombatTriggers(triggers); + ShamanCcRaidStrategy::InitNonCombatTriggers(triggers); +} + void ElementalShamanCureStrategy::InitCombatTriggers(std::list& triggers) { ShamanCureStrategy::InitCombatTriggers(triggers); @@ -423,10 +469,6 @@ void ElementalShamanStrategy::InitCombatTriggers(std::list& trigge { ShamanStrategy::InitCombatTriggers(triggers); - triggers.push_back(new TriggerNode( - "frost shock snare", - NextAction::array(0, new NextAction("frost shock", ACTION_HIGH), NULL))); - triggers.push_back(new TriggerNode( "shock", NextAction::array(0, new NextAction("earth shock", ACTION_NORMAL), NULL))); @@ -569,6 +611,56 @@ void ElementalShamanAoeRaidStrategy::InitNonCombatTriggers(std::list& triggers) +{ + ShamanCcStrategy::InitCombatTriggers(triggers); + + triggers.push_back(new TriggerNode( + "frost shock snare", + NextAction::array(0, new NextAction("frost shock", ACTION_HIGH), NULL))); +} + +void ElementalShamanCcStrategy::InitNonCombatTriggers(std::list& triggers) +{ + ShamanCcStrategy::InitNonCombatTriggers(triggers); +} + +void ElementalShamanCcPveStrategy::InitCombatTriggers(std::list& triggers) +{ + ElementalShamanCcStrategy::InitCombatTriggers(triggers); + ShamanCcPveStrategy::InitCombatTriggers(triggers); +} + +void ElementalShamanCcPveStrategy::InitNonCombatTriggers(std::list& triggers) +{ + ElementalShamanCcStrategy::InitNonCombatTriggers(triggers); + ShamanCcPveStrategy::InitNonCombatTriggers(triggers); +} + +void ElementalShamanCcPvpStrategy::InitCombatTriggers(std::list& triggers) +{ + ElementalShamanCcStrategy::InitCombatTriggers(triggers); + ShamanCcPvpStrategy::InitCombatTriggers(triggers); +} + +void ElementalShamanCcPvpStrategy::InitNonCombatTriggers(std::list& triggers) +{ + ElementalShamanCcStrategy::InitNonCombatTriggers(triggers); + ShamanCcPvpStrategy::InitNonCombatTriggers(triggers); +} + +void ElementalShamanCcRaidStrategy::InitCombatTriggers(std::list& triggers) +{ + ElementalShamanCcStrategy::InitCombatTriggers(triggers); + ShamanCcRaidStrategy::InitCombatTriggers(triggers); +} + +void ElementalShamanCcRaidStrategy::InitNonCombatTriggers(std::list& triggers) +{ + ElementalShamanCcStrategy::InitNonCombatTriggers(triggers); + ShamanCcRaidStrategy::InitNonCombatTriggers(triggers); +} + void ElementalShamanCureStrategy::InitCombatTriggers(std::list& triggers) { ShamanCureStrategy::InitCombatTriggers(triggers); @@ -801,10 +893,6 @@ void ElementalShamanStrategy::InitCombatTriggers(std::list& trigge { ShamanStrategy::InitCombatTriggers(triggers); - triggers.push_back(new TriggerNode( - "frost shock snare", - NextAction::array(0, new NextAction("frost shock", ACTION_HIGH), NULL))); - triggers.push_back(new TriggerNode( "shock", NextAction::array(0, new NextAction("earth shock", ACTION_NORMAL), NULL))); @@ -947,6 +1035,56 @@ void ElementalShamanAoeRaidStrategy::InitNonCombatTriggers(std::list& triggers) +{ + ShamanCcStrategy::InitCombatTriggers(triggers); + + triggers.push_back(new TriggerNode( + "frost shock snare", + NextAction::array(0, new NextAction("frost shock", ACTION_HIGH), NULL))); +} + +void ElementalShamanCcStrategy::InitNonCombatTriggers(std::list& triggers) +{ + ShamanCcStrategy::InitNonCombatTriggers(triggers); +} + +void ElementalShamanCcPveStrategy::InitCombatTriggers(std::list& triggers) +{ + ElementalShamanCcStrategy::InitCombatTriggers(triggers); + ShamanCcPveStrategy::InitCombatTriggers(triggers); +} + +void ElementalShamanCcPveStrategy::InitNonCombatTriggers(std::list& triggers) +{ + ElementalShamanCcStrategy::InitNonCombatTriggers(triggers); + ShamanCcPveStrategy::InitNonCombatTriggers(triggers); +} + +void ElementalShamanCcPvpStrategy::InitCombatTriggers(std::list& triggers) +{ + ElementalShamanCcStrategy::InitCombatTriggers(triggers); + ShamanCcPvpStrategy::InitCombatTriggers(triggers); +} + +void ElementalShamanCcPvpStrategy::InitNonCombatTriggers(std::list& triggers) +{ + ElementalShamanCcStrategy::InitNonCombatTriggers(triggers); + ShamanCcPvpStrategy::InitNonCombatTriggers(triggers); +} + +void ElementalShamanCcRaidStrategy::InitCombatTriggers(std::list& triggers) +{ + ElementalShamanCcStrategy::InitCombatTriggers(triggers); + ShamanCcRaidStrategy::InitCombatTriggers(triggers); +} + +void ElementalShamanCcRaidStrategy::InitNonCombatTriggers(std::list& triggers) +{ + ElementalShamanCcStrategy::InitNonCombatTriggers(triggers); + ShamanCcRaidStrategy::InitNonCombatTriggers(triggers); +} + void ElementalShamanCureStrategy::InitCombatTriggers(std::list& triggers) { ShamanCureStrategy::InitCombatTriggers(triggers); diff --git a/playerbot/strategy/shaman/ElementalShamanStrategy.h b/playerbot/strategy/shaman/ElementalShamanStrategy.h index 9981c123a..5b16fb142 100644 --- a/playerbot/strategy/shaman/ElementalShamanStrategy.h +++ b/playerbot/strategy/shaman/ElementalShamanStrategy.h @@ -107,6 +107,49 @@ namespace ai void InitNonCombatTriggers(std::list& triggers) override; }; + class ElementalShamanCcStrategy : public ShamanCcStrategy + { + public: + ElementalShamanCcStrategy(PlayerbotAI* ai) : ShamanCcStrategy(ai) {} + + protected: + virtual void InitCombatTriggers(std::list& triggers) override; + virtual void InitNonCombatTriggers(std::list& triggers) override; + }; + + class ElementalShamanCcPveStrategy : public ElementalShamanCcStrategy + { + public: + ElementalShamanCcPveStrategy(PlayerbotAI* ai) : ElementalShamanCcStrategy(ai) {} + string getName() override { return "cc elemental pve"; } + + private: + void InitCombatTriggers(std::list& triggers) override; + void InitNonCombatTriggers(std::list& triggers) override; + }; + + class ElementalShamanCcPvpStrategy : public ElementalShamanCcStrategy + { + public: + ElementalShamanCcPvpStrategy(PlayerbotAI* ai) : ElementalShamanCcStrategy(ai) {} + string getName() override { return "cc elemental pvp"; } + + private: + void InitCombatTriggers(std::list& triggers) override; + void InitNonCombatTriggers(std::list& triggers) override; + }; + + class ElementalShamanCcRaidStrategy : public ElementalShamanCcStrategy + { + public: + ElementalShamanCcRaidStrategy(PlayerbotAI* ai) : ElementalShamanCcStrategy(ai) {} + string getName() override { return "cc elemental raid"; } + + private: + void InitCombatTriggers(std::list& triggers) override; + void InitNonCombatTriggers(std::list& triggers) override; + }; + class ElementalShamanCureStrategy : public ShamanCureStrategy { public: diff --git a/playerbot/strategy/shaman/EnhancementShamanStrategy.cpp b/playerbot/strategy/shaman/EnhancementShamanStrategy.cpp index cfd996b2c..ceb26f785 100644 --- a/playerbot/strategy/shaman/EnhancementShamanStrategy.cpp +++ b/playerbot/strategy/shaman/EnhancementShamanStrategy.cpp @@ -51,10 +51,6 @@ void EnhancementShamanStrategy::InitCombatTriggers(std::list& trig { ShamanStrategy::InitCombatTriggers(triggers); - triggers.push_back(new TriggerNode( - "frost shock snare", - NextAction::array(0, new NextAction("frost shock", ACTION_HIGH), NULL))); - triggers.push_back(new TriggerNode( "shock", NextAction::array(0, new NextAction("earth shock", ACTION_NORMAL), NULL))); @@ -205,6 +201,60 @@ void EnhancementShamanAoeRaidStrategy::InitNonCombatTriggers(std::list& triggers) +{ + ShamanCcStrategy::InitCombatTriggers(triggers); + + triggers.push_back(new TriggerNode( + "frost shock snare", + NextAction::array(0, new NextAction("frost shock", ACTION_HIGH), NULL))); +} + +void EnhancementShamanCcStrategy::InitNonCombatTriggers(std::list& triggers) +{ + ShamanCcStrategy::InitNonCombatTriggers(triggers); +} + +void EnhancementShamanCcPveStrategy::InitCombatTriggers(std::list& triggers) +{ + EnhancementShamanCcStrategy::InitCombatTriggers(triggers); + ShamanCcPveStrategy::InitCombatTriggers(triggers); +} + +void EnhancementShamanCcPveStrategy::InitNonCombatTriggers(std::list& triggers) +{ + EnhancementShamanCcStrategy::InitNonCombatTriggers(triggers); + ShamanCcPveStrategy::InitNonCombatTriggers(triggers); +} + +void EnhancementShamanCcPvpStrategy::InitCombatTriggers(std::list& triggers) +{ + EnhancementShamanCcStrategy::InitCombatTriggers(triggers); + ShamanCcPvpStrategy::InitCombatTriggers(triggers); + + triggers.push_back(new TriggerNode( + "enemy out of melee", + NextAction::array(0, new NextAction("throw grenade", ACTION_INTERRUPT), NULL))); +} + +void EnhancementShamanCcPvpStrategy::InitNonCombatTriggers(std::list& triggers) +{ + EnhancementShamanCcStrategy::InitNonCombatTriggers(triggers); + ShamanCcPvpStrategy::InitNonCombatTriggers(triggers); +} + +void EnhancementShamanCcRaidStrategy::InitCombatTriggers(std::list& triggers) +{ + EnhancementShamanCcStrategy::InitCombatTriggers(triggers); + ShamanCcRaidStrategy::InitCombatTriggers(triggers); +} + +void EnhancementShamanCcRaidStrategy::InitNonCombatTriggers(std::list& triggers) +{ + EnhancementShamanCcStrategy::InitNonCombatTriggers(triggers); + ShamanCcRaidStrategy::InitNonCombatTriggers(triggers); +} + void EnhancementShamanCureStrategy::InitCombatTriggers(std::list& triggers) { ShamanCureStrategy::InitCombatTriggers(triggers); @@ -437,10 +487,6 @@ void EnhancementShamanStrategy::InitCombatTriggers(std::list& trig { ShamanStrategy::InitCombatTriggers(triggers); - triggers.push_back(new TriggerNode( - "frost shock snare", - NextAction::array(0, new NextAction("frost shock", ACTION_HIGH), NULL))); - triggers.push_back(new TriggerNode( "shock", NextAction::array(0, new NextAction("earth shock", ACTION_NORMAL), NULL))); @@ -591,6 +637,60 @@ void EnhancementShamanAoeRaidStrategy::InitNonCombatTriggers(std::list& triggers) +{ + ShamanCcStrategy::InitCombatTriggers(triggers); + + triggers.push_back(new TriggerNode( + "frost shock snare", + NextAction::array(0, new NextAction("frost shock", ACTION_HIGH), NULL))); +} + +void EnhancementShamanCcStrategy::InitNonCombatTriggers(std::list& triggers) +{ + ShamanCcStrategy::InitNonCombatTriggers(triggers); +} + +void EnhancementShamanCcPveStrategy::InitCombatTriggers(std::list& triggers) +{ + EnhancementShamanCcStrategy::InitCombatTriggers(triggers); + ShamanCcPveStrategy::InitCombatTriggers(triggers); +} + +void EnhancementShamanCcPveStrategy::InitNonCombatTriggers(std::list& triggers) +{ + EnhancementShamanCcStrategy::InitNonCombatTriggers(triggers); + ShamanCcPveStrategy::InitNonCombatTriggers(triggers); +} + +void EnhancementShamanCcPvpStrategy::InitCombatTriggers(std::list& triggers) +{ + EnhancementShamanCcStrategy::InitCombatTriggers(triggers); + ShamanCcPvpStrategy::InitCombatTriggers(triggers); + + triggers.push_back(new TriggerNode( + "enemy out of melee", + NextAction::array(0, new NextAction("throw grenade", ACTION_INTERRUPT), NULL))); +} + +void EnhancementShamanCcPvpStrategy::InitNonCombatTriggers(std::list& triggers) +{ + EnhancementShamanCcStrategy::InitNonCombatTriggers(triggers); + ShamanCcPvpStrategy::InitNonCombatTriggers(triggers); +} + +void EnhancementShamanCcRaidStrategy::InitCombatTriggers(std::list& triggers) +{ + EnhancementShamanCcStrategy::InitCombatTriggers(triggers); + ShamanCcRaidStrategy::InitCombatTriggers(triggers); +} + +void EnhancementShamanCcRaidStrategy::InitNonCombatTriggers(std::list& triggers) +{ + EnhancementShamanCcStrategy::InitNonCombatTriggers(triggers); + ShamanCcRaidStrategy::InitNonCombatTriggers(triggers); +} + void EnhancementShamanCureStrategy::InitCombatTriggers(std::list& triggers) { ShamanCureStrategy::InitCombatTriggers(triggers); @@ -823,10 +923,6 @@ void EnhancementShamanStrategy::InitCombatTriggers(std::list& trig { ShamanStrategy::InitCombatTriggers(triggers); - triggers.push_back(new TriggerNode( - "frost shock snare", - NextAction::array(0, new NextAction("frost shock", ACTION_HIGH), NULL))); - triggers.push_back(new TriggerNode( "shock", NextAction::array(0, new NextAction("earth shock", ACTION_NORMAL), NULL))); @@ -977,6 +1073,60 @@ void EnhancementShamanAoeRaidStrategy::InitNonCombatTriggers(std::list& triggers) +{ + ShamanCcStrategy::InitCombatTriggers(triggers); + + triggers.push_back(new TriggerNode( + "frost shock snare", + NextAction::array(0, new NextAction("frost shock", ACTION_HIGH), NULL))); +} + +void EnhancementShamanCcStrategy::InitNonCombatTriggers(std::list& triggers) +{ + ShamanCcStrategy::InitNonCombatTriggers(triggers); +} + +void EnhancementShamanCcPveStrategy::InitCombatTriggers(std::list& triggers) +{ + EnhancementShamanCcStrategy::InitCombatTriggers(triggers); + ShamanCcPveStrategy::InitCombatTriggers(triggers); +} + +void EnhancementShamanCcPveStrategy::InitNonCombatTriggers(std::list& triggers) +{ + EnhancementShamanCcStrategy::InitNonCombatTriggers(triggers); + ShamanCcPveStrategy::InitNonCombatTriggers(triggers); +} + +void EnhancementShamanCcPvpStrategy::InitCombatTriggers(std::list& triggers) +{ + EnhancementShamanCcStrategy::InitCombatTriggers(triggers); + ShamanCcPvpStrategy::InitCombatTriggers(triggers); + + triggers.push_back(new TriggerNode( + "enemy out of melee", + NextAction::array(0, new NextAction("throw grenade", ACTION_INTERRUPT), NULL))); +} + +void EnhancementShamanCcPvpStrategy::InitNonCombatTriggers(std::list& triggers) +{ + EnhancementShamanCcStrategy::InitNonCombatTriggers(triggers); + ShamanCcPvpStrategy::InitNonCombatTriggers(triggers); +} + +void EnhancementShamanCcRaidStrategy::InitCombatTriggers(std::list& triggers) +{ + EnhancementShamanCcStrategy::InitCombatTriggers(triggers); + ShamanCcRaidStrategy::InitCombatTriggers(triggers); +} + +void EnhancementShamanCcRaidStrategy::InitNonCombatTriggers(std::list& triggers) +{ + EnhancementShamanCcStrategy::InitNonCombatTriggers(triggers); + ShamanCcRaidStrategy::InitNonCombatTriggers(triggers); +} + void EnhancementShamanCureStrategy::InitCombatTriggers(std::list& triggers) { ShamanCureStrategy::InitCombatTriggers(triggers); diff --git a/playerbot/strategy/shaman/EnhancementShamanStrategy.h b/playerbot/strategy/shaman/EnhancementShamanStrategy.h index 2b53b7c04..06fea713f 100644 --- a/playerbot/strategy/shaman/EnhancementShamanStrategy.h +++ b/playerbot/strategy/shaman/EnhancementShamanStrategy.h @@ -107,6 +107,49 @@ namespace ai void InitNonCombatTriggers(std::list& triggers) override; }; + class EnhancementShamanCcStrategy : public ShamanCcStrategy + { + public: + EnhancementShamanCcStrategy(PlayerbotAI* ai) : ShamanCcStrategy(ai) {} + + protected: + virtual void InitCombatTriggers(std::list& triggers) override; + virtual void InitNonCombatTriggers(std::list& triggers) override; + }; + + class EnhancementShamanCcPveStrategy : public EnhancementShamanCcStrategy + { + public: + EnhancementShamanCcPveStrategy(PlayerbotAI* ai) : EnhancementShamanCcStrategy(ai) {} + string getName() override { return "cc enhancement pve"; } + + private: + void InitCombatTriggers(std::list& triggers) override; + void InitNonCombatTriggers(std::list& triggers) override; + }; + + class EnhancementShamanCcPvpStrategy : public EnhancementShamanCcStrategy + { + public: + EnhancementShamanCcPvpStrategy(PlayerbotAI* ai) : EnhancementShamanCcStrategy(ai) {} + string getName() override { return "cc enhancement pvp"; } + + private: + void InitCombatTriggers(std::list& triggers) override; + void InitNonCombatTriggers(std::list& triggers) override; + }; + + class EnhancementShamanCcRaidStrategy : public EnhancementShamanCcStrategy + { + public: + EnhancementShamanCcRaidStrategy(PlayerbotAI* ai) : EnhancementShamanCcStrategy(ai) {} + string getName() override { return "cc enhancement raid"; } + + private: + void InitCombatTriggers(std::list& triggers) override; + void InitNonCombatTriggers(std::list& triggers) override; + }; + class EnhancementShamanCureStrategy : public ShamanCureStrategy { public: diff --git a/playerbot/strategy/shaman/RestorationShamanStrategy.cpp b/playerbot/strategy/shaman/RestorationShamanStrategy.cpp index baec0f51b..ddea357de 100644 --- a/playerbot/strategy/shaman/RestorationShamanStrategy.cpp +++ b/playerbot/strategy/shaman/RestorationShamanStrategy.cpp @@ -256,6 +256,52 @@ void RestorationShamanAoeRaidStrategy::InitNonCombatTriggers(std::list& triggers) +{ + ShamanCcStrategy::InitCombatTriggers(triggers); +} + +void RestorationShamanCcStrategy::InitNonCombatTriggers(std::list& triggers) +{ + ShamanCcStrategy::InitNonCombatTriggers(triggers); +} + +void RestorationShamanCcPveStrategy::InitCombatTriggers(std::list& triggers) +{ + RestorationShamanCcStrategy::InitCombatTriggers(triggers); + ShamanCcPveStrategy::InitCombatTriggers(triggers); +} + +void RestorationShamanCcPveStrategy::InitNonCombatTriggers(std::list& triggers) +{ + RestorationShamanCcStrategy::InitNonCombatTriggers(triggers); + ShamanCcPveStrategy::InitNonCombatTriggers(triggers); +} + +void RestorationShamanCcPvpStrategy::InitCombatTriggers(std::list& triggers) +{ + RestorationShamanCcStrategy::InitCombatTriggers(triggers); + ShamanCcPvpStrategy::InitCombatTriggers(triggers); +} + +void RestorationShamanCcPvpStrategy::InitNonCombatTriggers(std::list& triggers) +{ + RestorationShamanCcStrategy::InitNonCombatTriggers(triggers); + ShamanCcPvpStrategy::InitNonCombatTriggers(triggers); +} + +void RestorationShamanCcRaidStrategy::InitCombatTriggers(std::list& triggers) +{ + RestorationShamanCcStrategy::InitCombatTriggers(triggers); + ShamanCcRaidStrategy::InitCombatTriggers(triggers); +} + +void RestorationShamanCcRaidStrategy::InitNonCombatTriggers(std::list& triggers) +{ + RestorationShamanCcStrategy::InitNonCombatTriggers(triggers); + ShamanCcRaidStrategy::InitNonCombatTriggers(triggers); +} + void RestorationShamanCureStrategy::InitCombatTriggers(std::list& triggers) { ShamanCureStrategy::InitCombatTriggers(triggers); @@ -665,6 +711,52 @@ void RestorationShamanAoeRaidStrategy::InitNonCombatTriggers(std::list& triggers) +{ + ShamanCcStrategy::InitCombatTriggers(triggers); +} + +void RestorationShamanCcStrategy::InitNonCombatTriggers(std::list& triggers) +{ + ShamanCcStrategy::InitNonCombatTriggers(triggers); +} + +void RestorationShamanCcPveStrategy::InitCombatTriggers(std::list& triggers) +{ + RestorationShamanCcStrategy::InitCombatTriggers(triggers); + ShamanCcPveStrategy::InitCombatTriggers(triggers); +} + +void RestorationShamanCcPveStrategy::InitNonCombatTriggers(std::list& triggers) +{ + RestorationShamanCcStrategy::InitNonCombatTriggers(triggers); + ShamanCcPveStrategy::InitNonCombatTriggers(triggers); +} + +void RestorationShamanCcPvpStrategy::InitCombatTriggers(std::list& triggers) +{ + RestorationShamanCcStrategy::InitCombatTriggers(triggers); + ShamanCcPvpStrategy::InitCombatTriggers(triggers); +} + +void RestorationShamanCcPvpStrategy::InitNonCombatTriggers(std::list& triggers) +{ + RestorationShamanCcStrategy::InitNonCombatTriggers(triggers); + ShamanCcPvpStrategy::InitNonCombatTriggers(triggers); +} + +void RestorationShamanCcRaidStrategy::InitCombatTriggers(std::list& triggers) +{ + RestorationShamanCcStrategy::InitCombatTriggers(triggers); + ShamanCcRaidStrategy::InitCombatTriggers(triggers); +} + +void RestorationShamanCcRaidStrategy::InitNonCombatTriggers(std::list& triggers) +{ + RestorationShamanCcStrategy::InitNonCombatTriggers(triggers); + ShamanCcRaidStrategy::InitNonCombatTriggers(triggers); +} + void RestorationShamanCureStrategy::InitCombatTriggers(std::list& triggers) { ShamanCureStrategy::InitCombatTriggers(triggers); @@ -1090,6 +1182,52 @@ void RestorationShamanAoeRaidStrategy::InitNonCombatTriggers(std::list& triggers) +{ + ShamanCcStrategy::InitCombatTriggers(triggers); +} + +void RestorationShamanCcStrategy::InitNonCombatTriggers(std::list& triggers) +{ + ShamanCcStrategy::InitNonCombatTriggers(triggers); +} + +void RestorationShamanCcPveStrategy::InitCombatTriggers(std::list& triggers) +{ + RestorationShamanCcStrategy::InitCombatTriggers(triggers); + ShamanCcPveStrategy::InitCombatTriggers(triggers); +} + +void RestorationShamanCcPveStrategy::InitNonCombatTriggers(std::list& triggers) +{ + RestorationShamanCcStrategy::InitNonCombatTriggers(triggers); + ShamanCcPveStrategy::InitNonCombatTriggers(triggers); +} + +void RestorationShamanCcPvpStrategy::InitCombatTriggers(std::list& triggers) +{ + RestorationShamanCcStrategy::InitCombatTriggers(triggers); + ShamanCcPvpStrategy::InitCombatTriggers(triggers); +} + +void RestorationShamanCcPvpStrategy::InitNonCombatTriggers(std::list& triggers) +{ + RestorationShamanCcStrategy::InitNonCombatTriggers(triggers); + ShamanCcPvpStrategy::InitNonCombatTriggers(triggers); +} + +void RestorationShamanCcRaidStrategy::InitCombatTriggers(std::list& triggers) +{ + RestorationShamanCcStrategy::InitCombatTriggers(triggers); + ShamanCcRaidStrategy::InitCombatTriggers(triggers); +} + +void RestorationShamanCcRaidStrategy::InitNonCombatTriggers(std::list& triggers) +{ + RestorationShamanCcStrategy::InitNonCombatTriggers(triggers); + ShamanCcRaidStrategy::InitNonCombatTriggers(triggers); +} + void RestorationShamanCureStrategy::InitCombatTriggers(std::list& triggers) { ShamanCureStrategy::InitCombatTriggers(triggers); diff --git a/playerbot/strategy/shaman/RestorationShamanStrategy.h b/playerbot/strategy/shaman/RestorationShamanStrategy.h index 34b1a2208..ff9029e91 100644 --- a/playerbot/strategy/shaman/RestorationShamanStrategy.h +++ b/playerbot/strategy/shaman/RestorationShamanStrategy.h @@ -105,6 +105,49 @@ namespace ai void InitNonCombatTriggers(std::list& triggers) override; }; + class RestorationShamanCcStrategy : public ShamanCcStrategy + { + public: + RestorationShamanCcStrategy(PlayerbotAI* ai) : ShamanCcStrategy(ai) {} + + protected: + virtual void InitCombatTriggers(std::list& triggers) override; + virtual void InitNonCombatTriggers(std::list& triggers) override; + }; + + class RestorationShamanCcPveStrategy : public RestorationShamanCcStrategy + { + public: + RestorationShamanCcPveStrategy(PlayerbotAI* ai) : RestorationShamanCcStrategy(ai) {} + string getName() override { return "cc restoration pve"; } + + private: + void InitCombatTriggers(std::list& triggers) override; + void InitNonCombatTriggers(std::list& triggers) override; + }; + + class RestorationShamanCcPvpStrategy : public RestorationShamanCcStrategy + { + public: + RestorationShamanCcPvpStrategy(PlayerbotAI* ai) : RestorationShamanCcStrategy(ai) {} + string getName() override { return "cc restoration pvp"; } + + private: + void InitCombatTriggers(std::list& triggers) override; + void InitNonCombatTriggers(std::list& triggers) override; + }; + + class RestorationShamanCcRaidStrategy : public RestorationShamanCcStrategy + { + public: + RestorationShamanCcRaidStrategy(PlayerbotAI* ai) : RestorationShamanCcStrategy(ai) {} + string getName() override { return "cc restoration raid"; } + + private: + void InitCombatTriggers(std::list& triggers) override; + void InitNonCombatTriggers(std::list& triggers) override; + }; + class RestorationShamanCureStrategy : public ShamanCureStrategy { public: diff --git a/playerbot/strategy/shaman/ShamanActions.h b/playerbot/strategy/shaman/ShamanActions.h index 9f24028e8..1f7f5ca61 100644 --- a/playerbot/strategy/shaman/ShamanActions.h +++ b/playerbot/strategy/shaman/ShamanActions.h @@ -523,6 +523,10 @@ namespace ai strategiesToUpdate.emplace_back(BotState::BOT_STATE_COMBAT, "aoe elemental pve", strategiesRequired); strategiesToUpdate.emplace_back(BotState::BOT_STATE_NON_COMBAT, "aoe elemental pve", strategiesRequired); + strategiesRequired = { "elemental", "cc" }; + strategiesToUpdate.emplace_back(BotState::BOT_STATE_COMBAT, "cc elemental pve", strategiesRequired); + strategiesToUpdate.emplace_back(BotState::BOT_STATE_NON_COMBAT, "cc elemental pve", strategiesRequired); + strategiesRequired = { "elemental", "cure" }; strategiesToUpdate.emplace_back(BotState::BOT_STATE_COMBAT, "cure elemental pve", strategiesRequired); strategiesToUpdate.emplace_back(BotState::BOT_STATE_NON_COMBAT, "cure elemental pve", strategiesRequired); @@ -549,6 +553,10 @@ namespace ai strategiesToUpdate.emplace_back(BotState::BOT_STATE_COMBAT, "aoe enhancement pve", strategiesRequired); strategiesToUpdate.emplace_back(BotState::BOT_STATE_NON_COMBAT, "aoe enhancement pve", strategiesRequired); + strategiesRequired = { "enhancement", "cc" }; + strategiesToUpdate.emplace_back(BotState::BOT_STATE_COMBAT, "cc enhancement pve", strategiesRequired); + strategiesToUpdate.emplace_back(BotState::BOT_STATE_NON_COMBAT, "cc enhancement pve", strategiesRequired); + strategiesRequired = { "enhancement", "cure" }; strategiesToUpdate.emplace_back(BotState::BOT_STATE_COMBAT, "cure enhancement pve", strategiesRequired); strategiesToUpdate.emplace_back(BotState::BOT_STATE_NON_COMBAT, "cure enhancement pve", strategiesRequired); @@ -574,6 +582,10 @@ namespace ai strategiesRequired = { "restoration", "aoe" }; strategiesToUpdate.emplace_back(BotState::BOT_STATE_COMBAT, "aoe restoration pve", strategiesRequired); strategiesToUpdate.emplace_back(BotState::BOT_STATE_NON_COMBAT, "aoe restoration pve", strategiesRequired); + + strategiesRequired = { "restoration", "cc" }; + strategiesToUpdate.emplace_back(BotState::BOT_STATE_COMBAT, "cc restoration pve", strategiesRequired); + strategiesToUpdate.emplace_back(BotState::BOT_STATE_NON_COMBAT, "cc restoration pve", strategiesRequired); strategiesRequired = { "restoration", "cure" }; strategiesToUpdate.emplace_back(BotState::BOT_STATE_COMBAT, "cure restoration pve", strategiesRequired); @@ -612,6 +624,10 @@ namespace ai strategiesToUpdate.emplace_back(BotState::BOT_STATE_COMBAT, "aoe elemental pvp", strategiesRequired); strategiesToUpdate.emplace_back(BotState::BOT_STATE_NON_COMBAT, "aoe elemental pvp", strategiesRequired); + strategiesRequired = { "elemental", "cc" }; + strategiesToUpdate.emplace_back(BotState::BOT_STATE_COMBAT, "cc elemental pvp", strategiesRequired); + strategiesToUpdate.emplace_back(BotState::BOT_STATE_NON_COMBAT, "cc elemental pvp", strategiesRequired); + strategiesRequired = { "elemental", "cure" }; strategiesToUpdate.emplace_back(BotState::BOT_STATE_COMBAT, "cure elemental pvp", strategiesRequired); strategiesToUpdate.emplace_back(BotState::BOT_STATE_NON_COMBAT, "cure elemental pvp", strategiesRequired); @@ -638,6 +654,10 @@ namespace ai strategiesToUpdate.emplace_back(BotState::BOT_STATE_COMBAT, "aoe enhancement pvp", strategiesRequired); strategiesToUpdate.emplace_back(BotState::BOT_STATE_NON_COMBAT, "aoe enhancement pvp", strategiesRequired); + strategiesRequired = { "enhancement", "cc" }; + strategiesToUpdate.emplace_back(BotState::BOT_STATE_COMBAT, "cc enhancement pvp", strategiesRequired); + strategiesToUpdate.emplace_back(BotState::BOT_STATE_NON_COMBAT, "cc enhancement pvp", strategiesRequired); + strategiesRequired = { "enhancement", "cure" }; strategiesToUpdate.emplace_back(BotState::BOT_STATE_COMBAT, "cure enhancement pvp", strategiesRequired); strategiesToUpdate.emplace_back(BotState::BOT_STATE_NON_COMBAT, "cure enhancement pvp", strategiesRequired); @@ -664,6 +684,10 @@ namespace ai strategiesToUpdate.emplace_back(BotState::BOT_STATE_COMBAT, "aoe restoration pvp", strategiesRequired); strategiesToUpdate.emplace_back(BotState::BOT_STATE_NON_COMBAT, "aoe restoration pvp", strategiesRequired); + strategiesRequired = { "restoration", "cc" }; + strategiesToUpdate.emplace_back(BotState::BOT_STATE_COMBAT, "cc elemental pvp", strategiesRequired); + strategiesToUpdate.emplace_back(BotState::BOT_STATE_NON_COMBAT, "cc elemental pvp", strategiesRequired); + strategiesRequired = { "restoration", "cure" }; strategiesToUpdate.emplace_back(BotState::BOT_STATE_COMBAT, "cure restoration pvp", strategiesRequired); strategiesToUpdate.emplace_back(BotState::BOT_STATE_NON_COMBAT, "cure restoration pvp", strategiesRequired); @@ -701,6 +725,10 @@ namespace ai strategiesToUpdate.emplace_back(BotState::BOT_STATE_COMBAT, "aoe elemental raid", strategiesRequired); strategiesToUpdate.emplace_back(BotState::BOT_STATE_NON_COMBAT, "aoe elemental raid", strategiesRequired); + strategiesRequired = { "elemental", "cc" }; + strategiesToUpdate.emplace_back(BotState::BOT_STATE_COMBAT, "cc elemental raid", strategiesRequired); + strategiesToUpdate.emplace_back(BotState::BOT_STATE_NON_COMBAT, "cc elemental raid", strategiesRequired); + strategiesRequired = { "elemental", "cure" }; strategiesToUpdate.emplace_back(BotState::BOT_STATE_COMBAT, "cure elemental raid", strategiesRequired); strategiesToUpdate.emplace_back(BotState::BOT_STATE_NON_COMBAT, "cure elemental raid", strategiesRequired); @@ -727,6 +755,10 @@ namespace ai strategiesToUpdate.emplace_back(BotState::BOT_STATE_COMBAT, "aoe enhancement raid", strategiesRequired); strategiesToUpdate.emplace_back(BotState::BOT_STATE_NON_COMBAT, "aoe enhancement raid", strategiesRequired); + strategiesRequired = { "enhancement", "cc" }; + strategiesToUpdate.emplace_back(BotState::BOT_STATE_COMBAT, "cc enhancement raid", strategiesRequired); + strategiesToUpdate.emplace_back(BotState::BOT_STATE_NON_COMBAT, "cc enhancement raid", strategiesRequired); + strategiesRequired = { "enhancement", "cure" }; strategiesToUpdate.emplace_back(BotState::BOT_STATE_COMBAT, "cure enhancement raid", strategiesRequired); strategiesToUpdate.emplace_back(BotState::BOT_STATE_NON_COMBAT, "cure enhancement raid", strategiesRequired); @@ -753,6 +785,10 @@ namespace ai strategiesToUpdate.emplace_back(BotState::BOT_STATE_COMBAT, "aoe restoration raid", strategiesRequired); strategiesToUpdate.emplace_back(BotState::BOT_STATE_NON_COMBAT, "aoe restoration raid", strategiesRequired); + strategiesRequired = { "restoration", "cc" }; + strategiesToUpdate.emplace_back(BotState::BOT_STATE_COMBAT, "cc restoration raid", strategiesRequired); + strategiesToUpdate.emplace_back(BotState::BOT_STATE_NON_COMBAT, "cc restoration raid", strategiesRequired); + strategiesRequired = { "restoration", "cure" }; strategiesToUpdate.emplace_back(BotState::BOT_STATE_COMBAT, "cure restoration raid", strategiesRequired); strategiesToUpdate.emplace_back(BotState::BOT_STATE_NON_COMBAT, "cure restoration raid", strategiesRequired); diff --git a/playerbot/strategy/shaman/ShamanAiObjectContext.cpp b/playerbot/strategy/shaman/ShamanAiObjectContext.cpp index 5aa5cd5e2..df00ba4c9 100644 --- a/playerbot/strategy/shaman/ShamanAiObjectContext.cpp +++ b/playerbot/strategy/shaman/ShamanAiObjectContext.cpp @@ -18,6 +18,7 @@ namespace ai StrategyFactoryInternal() { creators["aoe"] = &shaman::StrategyFactoryInternal::aoe; + creators["cc"] = &shaman::StrategyFactoryInternal::cc; creators["cure"] = &shaman::StrategyFactoryInternal::cure; creators["buff"] = &shaman::StrategyFactoryInternal::buff; creators["boost"] = &shaman::StrategyFactoryInternal::boost; @@ -27,6 +28,7 @@ namespace ai private: static Strategy* aoe(PlayerbotAI* ai) { return new AoePlaceholderStrategy(ai); } + static Strategy* cc(PlayerbotAI* ai) { return new CcPlaceholderStrategy(ai); } static Strategy* cure(PlayerbotAI* ai) { return new CurePlaceholderStrategy(ai); } static Strategy* buff(PlayerbotAI* ai) { return new BuffPlaceholderStrategy(ai); } static Strategy* boost(PlayerbotAI* ai) { return new BoostPlaceholderStrategy(ai); } @@ -62,6 +64,34 @@ namespace ai static Strategy* aoe_enhancement_raid(PlayerbotAI* ai) { return new EnhancementShamanAoeRaidStrategy(ai); } }; + class CcSituationStrategyFactoryInternal : public NamedObjectContext + { + public: + CcSituationStrategyFactoryInternal() : NamedObjectContext(false, true) + { + creators["cc elemental pve"] = &shaman::CcSituationStrategyFactoryInternal::cc_elemental_pve; + creators["cc elemental pvp"] = &shaman::CcSituationStrategyFactoryInternal::cc_elemental_pvp; + creators["cc elemental raid"] = &shaman::CcSituationStrategyFactoryInternal::cc_elemental_raid; + creators["cc restoration pve"] = &shaman::CcSituationStrategyFactoryInternal::cc_restoration_pve; + creators["cc restoration pvp"] = &shaman::CcSituationStrategyFactoryInternal::cc_restoration_pvp; + creators["cc restoration raid"] = &shaman::CcSituationStrategyFactoryInternal::cc_restoration_raid; + creators["cc enhancement pve"] = &shaman::CcSituationStrategyFactoryInternal::cc_enhancement_pve; + creators["cc enhancement pvp"] = &shaman::CcSituationStrategyFactoryInternal::cc_enhancement_pvp; + creators["cc enhancement raid"] = &shaman::CcSituationStrategyFactoryInternal::cc_enhancement_raid; + } + + private: + static Strategy* cc_elemental_pve(PlayerbotAI* ai) { return new ElementalShamanCcPveStrategy(ai); } + static Strategy* cc_elemental_pvp(PlayerbotAI* ai) { return new ElementalShamanCcPvpStrategy(ai); } + static Strategy* cc_elemental_raid(PlayerbotAI* ai) { return new ElementalShamanCcRaidStrategy(ai); } + static Strategy* cc_restoration_pve(PlayerbotAI* ai) { return new RestorationShamanCcPveStrategy(ai); } + static Strategy* cc_restoration_pvp(PlayerbotAI* ai) { return new RestorationShamanCcPvpStrategy(ai); } + static Strategy* cc_restoration_raid(PlayerbotAI* ai) { return new RestorationShamanCcRaidStrategy(ai); } + static Strategy* cc_enhancement_pve(PlayerbotAI* ai) { return new EnhancementShamanCcPveStrategy(ai); } + static Strategy* cc_enhancement_pvp(PlayerbotAI* ai) { return new EnhancementShamanCcPvpStrategy(ai); } + static Strategy* cc_enhancement_raid(PlayerbotAI* ai) { return new EnhancementShamanCcRaidStrategy(ai); } + }; + class CureSituationStrategyFactoryInternal : public NamedObjectContext { public: @@ -619,6 +649,7 @@ ShamanAiObjectContext::ShamanAiObjectContext(PlayerbotAI* ai) : AiObjectContext( strategyContexts.Add(new ai::shaman::AirTotemStrategyFactoryInternal()); strategyContexts.Add(new ai::shaman::TotemsSituationStrategyFactoryInternal()); strategyContexts.Add(new ai::shaman::AoeSituationStrategyFactoryInternal()); + strategyContexts.Add(new ai::shaman::CcSituationStrategyFactoryInternal()); strategyContexts.Add(new ai::shaman::CureSituationStrategyFactoryInternal()); strategyContexts.Add(new ai::shaman::ClassStrategyFactoryInternal()); strategyContexts.Add(new ai::shaman::ClassSituationStrategyFactoryInternal()); diff --git a/playerbot/strategy/shaman/ShamanStrategy.cpp b/playerbot/strategy/shaman/ShamanStrategy.cpp index b5fd7e7d5..3d6a8c082 100644 --- a/playerbot/strategy/shaman/ShamanStrategy.cpp +++ b/playerbot/strategy/shaman/ShamanStrategy.cpp @@ -50,14 +50,6 @@ void ShamanStrategy::InitCombatTriggers(std::list& triggers) triggers.push_back(new TriggerNode( "purge", NextAction::array(0, new NextAction("purge", ACTION_DISPEL), NULL))); - - triggers.push_back(new TriggerNode( - "wind shear", - NextAction::array(0, new NextAction("wind shear", ACTION_INTERRUPT), NULL))); - - triggers.push_back(new TriggerNode( - "wind shear on enemy healer", - NextAction::array(0, new NextAction("wind shear on enemy healer", ACTION_INTERRUPT), NULL))); } void ShamanStrategy::InitNonCombatTriggers(std::list& triggers) @@ -191,6 +183,54 @@ void ShamanAoeRaidStrategy::InitNonCombatTriggers(std::list& trigg AoeRaidStrategy::InitNonCombatTriggers(triggers); } +void ShamanCcStrategy::InitCombatTriggers(std::list& triggers) +{ + CcStrategy::InitCombatTriggers(triggers); + + triggers.push_back(new TriggerNode( + "wind shear", + NextAction::array(0, new NextAction("wind shear", ACTION_INTERRUPT), NULL))); + + triggers.push_back(new TriggerNode( + "wind shear on enemy healer", + NextAction::array(0, new NextAction("wind shear on enemy healer", ACTION_INTERRUPT), NULL))); +} + +void ShamanCcStrategy::InitNonCombatTriggers(std::list& triggers) +{ + CcStrategy::InitNonCombatTriggers(triggers); +} + +void ShamanCcPvpStrategy::InitCombatTriggers(std::list& triggers) +{ + CcPvpStrategy::InitCombatTriggers(triggers); +} + +void ShamanCcPvpStrategy::InitNonCombatTriggers(std::list& triggers) +{ + CcPvpStrategy::InitNonCombatTriggers(triggers); +} + +void ShamanCcPveStrategy::InitCombatTriggers(std::list& triggers) +{ + CcPveStrategy::InitCombatTriggers(triggers); +} + +void ShamanCcPveStrategy::InitNonCombatTriggers(std::list& triggers) +{ + CcPveStrategy::InitNonCombatTriggers(triggers); +} + +void ShamanCcRaidStrategy::InitCombatTriggers(std::list& triggers) +{ + CcRaidStrategy::InitCombatTriggers(triggers); +} + +void ShamanCcRaidStrategy::InitNonCombatTriggers(std::list& triggers) +{ + CcRaidStrategy::InitNonCombatTriggers(triggers); +} + void ShamanCureStrategy::InitCombatTriggers(std::list& triggers) { CureStrategy::InitCombatTriggers(triggers); @@ -486,14 +526,6 @@ void ShamanStrategy::InitCombatTriggers(std::list& triggers) triggers.push_back(new TriggerNode( "purge", NextAction::array(0, new NextAction("purge", ACTION_DISPEL), NULL))); - - triggers.push_back(new TriggerNode( - "wind shear", - NextAction::array(0, new NextAction("wind shear", ACTION_INTERRUPT), NULL))); - - triggers.push_back(new TriggerNode( - "wind shear on enemy healer", - NextAction::array(0, new NextAction("wind shear on enemy healer", ACTION_INTERRUPT), NULL))); } void ShamanStrategy::InitNonCombatTriggers(std::list& triggers) @@ -631,6 +663,54 @@ void ShamanAoeRaidStrategy::InitNonCombatTriggers(std::list& trigg AoeRaidStrategy::InitNonCombatTriggers(triggers); } +void ShamanCcStrategy::InitCombatTriggers(std::list& triggers) +{ + CcStrategy::InitCombatTriggers(triggers); + + triggers.push_back(new TriggerNode( + "wind shear", + NextAction::array(0, new NextAction("wind shear", ACTION_INTERRUPT), NULL))); + + triggers.push_back(new TriggerNode( + "wind shear on enemy healer", + NextAction::array(0, new NextAction("wind shear on enemy healer", ACTION_INTERRUPT), NULL))); +} + +void ShamanCcStrategy::InitNonCombatTriggers(std::list& triggers) +{ + CcStrategy::InitNonCombatTriggers(triggers); +} + +void ShamanCcPvpStrategy::InitCombatTriggers(std::list& triggers) +{ + CcPvpStrategy::InitCombatTriggers(triggers); +} + +void ShamanCcPvpStrategy::InitNonCombatTriggers(std::list& triggers) +{ + CcPvpStrategy::InitNonCombatTriggers(triggers); +} + +void ShamanCcPveStrategy::InitCombatTriggers(std::list& triggers) +{ + CcPveStrategy::InitCombatTriggers(triggers); +} + +void ShamanCcPveStrategy::InitNonCombatTriggers(std::list& triggers) +{ + CcPveStrategy::InitNonCombatTriggers(triggers); +} + +void ShamanCcRaidStrategy::InitCombatTriggers(std::list& triggers) +{ + CcRaidStrategy::InitCombatTriggers(triggers); +} + +void ShamanCcRaidStrategy::InitNonCombatTriggers(std::list& triggers) +{ + CcRaidStrategy::InitNonCombatTriggers(triggers); +} + void ShamanCureStrategy::InitCombatTriggers(std::list& triggers) { CureStrategy::InitCombatTriggers(triggers); @@ -935,14 +1015,6 @@ void ShamanStrategy::InitCombatTriggers(std::list& triggers) "purge", NextAction::array(0, new NextAction("purge", ACTION_DISPEL), NULL))); - triggers.push_back(new TriggerNode( - "wind shear", - NextAction::array(0, new NextAction("wind shear", ACTION_INTERRUPT), NULL))); - - triggers.push_back(new TriggerNode( - "wind shear on enemy healer", - NextAction::array(0, new NextAction("wind shear on enemy healer", ACTION_INTERRUPT), NULL))); - if (sRandomPlayerbotMgr.IsRandomBot(ai->GetBot())) { triggers.push_back(new TriggerNode( @@ -1097,6 +1169,54 @@ void ShamanAoeRaidStrategy::InitNonCombatTriggers(std::list& trigg AoeRaidStrategy::InitNonCombatTriggers(triggers); } +void ShamanCcStrategy::InitCombatTriggers(std::list& triggers) +{ + CcStrategy::InitCombatTriggers(triggers); + + triggers.push_back(new TriggerNode( + "wind shear", + NextAction::array(0, new NextAction("wind shear", ACTION_INTERRUPT), NULL))); + + triggers.push_back(new TriggerNode( + "wind shear on enemy healer", + NextAction::array(0, new NextAction("wind shear on enemy healer", ACTION_INTERRUPT), NULL))); +} + +void ShamanCcStrategy::InitNonCombatTriggers(std::list& triggers) +{ + CcStrategy::InitNonCombatTriggers(triggers); +} + +void ShamanCcPvpStrategy::InitCombatTriggers(std::list& triggers) +{ + CcPvpStrategy::InitCombatTriggers(triggers); +} + +void ShamanCcPvpStrategy::InitNonCombatTriggers(std::list& triggers) +{ + CcPvpStrategy::InitNonCombatTriggers(triggers); +} + +void ShamanCcPveStrategy::InitCombatTriggers(std::list& triggers) +{ + CcPveStrategy::InitCombatTriggers(triggers); +} + +void ShamanCcPveStrategy::InitNonCombatTriggers(std::list& triggers) +{ + CcPveStrategy::InitNonCombatTriggers(triggers); +} + +void ShamanCcRaidStrategy::InitCombatTriggers(std::list& triggers) +{ + CcRaidStrategy::InitCombatTriggers(triggers); +} + +void ShamanCcRaidStrategy::InitNonCombatTriggers(std::list& triggers) +{ + CcRaidStrategy::InitNonCombatTriggers(triggers); +} + void ShamanCureStrategy::InitCombatTriggers(std::list& triggers) { CureStrategy::InitCombatTriggers(triggers); diff --git a/playerbot/strategy/shaman/ShamanStrategy.h b/playerbot/strategy/shaman/ShamanStrategy.h index 7cf52e434..b74b8b38b 100644 --- a/playerbot/strategy/shaman/ShamanStrategy.h +++ b/playerbot/strategy/shaman/ShamanStrategy.h @@ -80,6 +80,37 @@ namespace ai static void InitNonCombatTriggers(std::list& triggers); }; + class ShamanCcStrategy : public CcStrategy + { + public: + ShamanCcStrategy(PlayerbotAI* ai) : CcStrategy(ai) {} + + protected: + virtual void InitCombatTriggers(std::list& triggers) override; + virtual void InitNonCombatTriggers(std::list& triggers) override; + }; + + class ShamanCcPvpStrategy : public CcPvpStrategy + { + public: + static void InitCombatTriggers(std::list& triggers); + static void InitNonCombatTriggers(std::list& triggers); + }; + + class ShamanCcPveStrategy : public CcPveStrategy + { + public: + static void InitCombatTriggers(std::list& triggers); + static void InitNonCombatTriggers(std::list& triggers); + }; + + class ShamanCcRaidStrategy : public CcRaidStrategy + { + public: + static void InitCombatTriggers(std::list& triggers); + static void InitNonCombatTriggers(std::list& triggers); + }; + class ShamanBuffStrategy : public BuffStrategy { public: