From 96cc0daea6eaa91782ec9b5e34766705dd533529 Mon Sep 17 00:00:00 2001 From: ThePenguinMan96 Date: Mon, 14 Jul 2025 01:15:11 -0700 Subject: [PATCH] Hunter/Warlock AoE Fix (#1440) Hello everyone, This fixes these two classes so they respond to the command "co -aoe" and "co +aoe". This also fixes the survival hunter so that trap weave is not a default strategy - they will not walk into melee anymore. --- src/AiFactory.cpp | 16 ++++++++-------- .../hunter/BeastMasteryHunterStrategy.cpp | 9 --------- src/strategy/hunter/BeastMasteryHunterStrategy.h | 8 -------- src/strategy/hunter/GenericHunterStrategy.cpp | 10 ++++++++++ src/strategy/hunter/GenericHunterStrategy.h | 10 ++++++++++ src/strategy/hunter/HunterAiObjectContext.cpp | 8 ++------ .../hunter/MarksmanshipHunterStrategy.cpp | 9 --------- src/strategy/hunter/MarksmanshipHunterStrategy.h | 8 -------- src/strategy/hunter/SurvivalHunterStrategy.cpp | 9 --------- src/strategy/hunter/SurvivalHunterStrategy.h | 8 -------- .../warlock/AfflictionWarlockStrategy.cpp | 12 ------------ src/strategy/warlock/AfflictionWarlockStrategy.h | 8 -------- .../warlock/DemonologyWarlockStrategy.cpp | 13 ------------- src/strategy/warlock/DemonologyWarlockStrategy.h | 9 --------- .../warlock/DestructionWarlockStrategy.cpp | 13 ------------- .../warlock/DestructionWarlockStrategy.h | 9 --------- src/strategy/warlock/GenericWarlockStrategy.cpp | 13 +++++++++++++ src/strategy/warlock/GenericWarlockStrategy.h | 9 +++++++++ src/strategy/warlock/WarlockAiObjectContext.cpp | 9 ++------- 19 files changed, 54 insertions(+), 136 deletions(-) diff --git a/src/AiFactory.cpp b/src/AiFactory.cpp index 08cdc9a3..7c18070b 100644 --- a/src/AiFactory.cpp +++ b/src/AiFactory.cpp @@ -368,13 +368,13 @@ void AiFactory::AddDefaultCombatStrategies(Player* player, PlayerbotAI* const fa break; case CLASS_HUNTER: if (tab == 0) // Beast Mastery - engine->addStrategiesNoInit("bm", "bm aoe", nullptr); + engine->addStrategiesNoInit("bm", nullptr); else if (tab == 1) // Marksmanship - engine->addStrategiesNoInit("mm", "mm aoe", nullptr); + engine->addStrategiesNoInit("mm", nullptr); else if (tab == 2) // Survival - engine->addStrategiesNoInit("surv", "surv aoe", "trap weave", nullptr); + engine->addStrategiesNoInit("surv", nullptr); - engine->addStrategiesNoInit("cc", "dps assist", nullptr); + engine->addStrategiesNoInit("cc", "dps assist", "aoe", nullptr); break; case CLASS_ROGUE: if (tab == ROGUE_TAB_ASSASSINATION || tab == ROGUE_TAB_SUBTLETY) @@ -388,13 +388,13 @@ void AiFactory::AddDefaultCombatStrategies(Player* player, PlayerbotAI* const fa break; case CLASS_WARLOCK: if (tab == 0) // Affliction - engine->addStrategiesNoInit("affli", "affli aoe", "curse of agony", nullptr); + engine->addStrategiesNoInit("affli", "curse of agony", nullptr); else if (tab == 1) // Demonology - engine->addStrategiesNoInit("demo", "demo aoe", "curse of agony", "meta melee", nullptr); + engine->addStrategiesNoInit("demo", "curse of agony", "meta melee", nullptr); else if (tab == 2) // Destruction - engine->addStrategiesNoInit("destro", "destro aoe", "curse of elements", nullptr); + engine->addStrategiesNoInit("destro", "curse of elements", nullptr); - engine->addStrategiesNoInit("cc", "dps assist", nullptr); + engine->addStrategiesNoInit("cc", "dps assist", "aoe", nullptr); break; case CLASS_DEATH_KNIGHT: diff --git a/src/strategy/hunter/BeastMasteryHunterStrategy.cpp b/src/strategy/hunter/BeastMasteryHunterStrategy.cpp index 787f95b4..44827cb7 100644 --- a/src/strategy/hunter/BeastMasteryHunterStrategy.cpp +++ b/src/strategy/hunter/BeastMasteryHunterStrategy.cpp @@ -67,12 +67,3 @@ void BeastMasteryHunterStrategy::InitTriggers(std::vector& trigger triggers.push_back(new TriggerNode("no stings", NextAction::array(0, new NextAction("serpent sting", 17.0f), nullptr))); triggers.push_back(new TriggerNode("serpent sting on attacker", NextAction::array(0, new NextAction("serpent sting on attacker", 16.5f), nullptr))); } - -// ===== AoE Strategy, 2/3+ enemies ===== -BeastMasteryHunterAoeStrategy::BeastMasteryHunterAoeStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI) {} - -void BeastMasteryHunterAoeStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back(new TriggerNode("medium aoe", NextAction::array(0, new NextAction("volley", 22.0f), nullptr))); - triggers.push_back(new TriggerNode("light aoe", NextAction::array(0, new NextAction("multi-shot", 21.0f), nullptr))); -} diff --git a/src/strategy/hunter/BeastMasteryHunterStrategy.h b/src/strategy/hunter/BeastMasteryHunterStrategy.h index 78e99214..9f55d14c 100644 --- a/src/strategy/hunter/BeastMasteryHunterStrategy.h +++ b/src/strategy/hunter/BeastMasteryHunterStrategy.h @@ -21,12 +21,4 @@ public: NextAction** getDefaultActions() override; }; -class BeastMasteryHunterAoeStrategy : public CombatStrategy -{ -public: - BeastMasteryHunterAoeStrategy(PlayerbotAI* botAI); - - void InitTriggers(std::vector& triggers) override; - std::string const getName() override { return "bm aoe"; } -}; #endif diff --git a/src/strategy/hunter/GenericHunterStrategy.cpp b/src/strategy/hunter/GenericHunterStrategy.cpp index 4c4763f9..7b7f59a3 100644 --- a/src/strategy/hunter/GenericHunterStrategy.cpp +++ b/src/strategy/hunter/GenericHunterStrategy.cpp @@ -131,6 +131,16 @@ void GenericHunterStrategy::InitTriggers(std::vector& triggers) new NextAction("flee", 34.0f), nullptr))); } +// ===== AoE Strategy, 2/3+ enemies ===== +AoEHunterStrategy::AoEHunterStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI) {} + +void AoEHunterStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back(new TriggerNode("medium aoe", NextAction::array(0, new NextAction("volley", 22.0f), nullptr))); + triggers.push_back( + new TriggerNode("light aoe", NextAction::array(0, new NextAction("multi-shot", 21.0f), nullptr))); +} + void HunterBoostStrategy::InitTriggers(std::vector& triggers) { } diff --git a/src/strategy/hunter/GenericHunterStrategy.h b/src/strategy/hunter/GenericHunterStrategy.h index ea4f2b9c..b5fb1dbf 100644 --- a/src/strategy/hunter/GenericHunterStrategy.h +++ b/src/strategy/hunter/GenericHunterStrategy.h @@ -21,6 +21,16 @@ public: uint32 GetType() const override { return CombatStrategy::GetType() | STRATEGY_TYPE_RANGED | STRATEGY_TYPE_DPS; } }; + +class AoEHunterStrategy : public CombatStrategy +{ +public: + AoEHunterStrategy(PlayerbotAI* botAI); + + void InitTriggers(std::vector& triggers) override; + std::string const getName() override { return "aoe"; } +}; + class HunterBoostStrategy : public Strategy { public: diff --git a/src/strategy/hunter/HunterAiObjectContext.cpp b/src/strategy/hunter/HunterAiObjectContext.cpp index 35c94813..b8e2e41f 100644 --- a/src/strategy/hunter/HunterAiObjectContext.cpp +++ b/src/strategy/hunter/HunterAiObjectContext.cpp @@ -28,9 +28,7 @@ public: creators["bm"] = &HunterStrategyFactoryInternal::beast_mastery; creators["mm"] = &HunterStrategyFactoryInternal::marksmanship; creators["surv"] = &HunterStrategyFactoryInternal::survival; - creators["bm aoe"] = &HunterStrategyFactoryInternal::beast_mastery_aoe; - creators["mm aoe"] = &HunterStrategyFactoryInternal::marksmanship_aoe; - creators["surv aoe"] = &HunterStrategyFactoryInternal::survival_aoe; + creators["aoe"] = &HunterStrategyFactoryInternal::aoe; } private: @@ -42,9 +40,7 @@ private: static Strategy* beast_mastery(PlayerbotAI* botAI) { return new BeastMasteryHunterStrategy(botAI); } static Strategy* marksmanship(PlayerbotAI* botAI) { return new MarksmanshipHunterStrategy(botAI); } static Strategy* survival(PlayerbotAI* botAI) { return new SurvivalHunterStrategy(botAI); } - static Strategy* beast_mastery_aoe(PlayerbotAI* botAI) { return new BeastMasteryHunterAoeStrategy(botAI); } - static Strategy* marksmanship_aoe(PlayerbotAI* botAI) { return new MarksmanshipHunterAoeStrategy(botAI); } - static Strategy* survival_aoe(PlayerbotAI* botAI) { return new SurvivalHunterAoeStrategy(botAI); } + static Strategy* aoe(PlayerbotAI* botAI) { return new AoEHunterStrategy(botAI); } }; class HunterBuffStrategyFactoryInternal : public NamedObjectContext diff --git a/src/strategy/hunter/MarksmanshipHunterStrategy.cpp b/src/strategy/hunter/MarksmanshipHunterStrategy.cpp index f9619656..61736dbc 100644 --- a/src/strategy/hunter/MarksmanshipHunterStrategy.cpp +++ b/src/strategy/hunter/MarksmanshipHunterStrategy.cpp @@ -72,12 +72,3 @@ void MarksmanshipHunterStrategy::InitTriggers(std::vector& trigger triggers.push_back(new TriggerNode("no stings", NextAction::array(0, new NextAction("serpent sting", 17.0f), nullptr))); triggers.push_back(new TriggerNode("serpent sting on attacker", NextAction::array(0, new NextAction("serpent sting on attacker", 16.5f), nullptr))); } - -// ===== AoE Strategy, 2/3+ enemies ===== -MarksmanshipHunterAoeStrategy::MarksmanshipHunterAoeStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI) {} - -void MarksmanshipHunterAoeStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back(new TriggerNode("medium aoe", NextAction::array(0, new NextAction("volley", 22.0f), nullptr))); - triggers.push_back(new TriggerNode("light aoe", NextAction::array(0, new NextAction("multi-shot", 21.0f), nullptr))); -} diff --git a/src/strategy/hunter/MarksmanshipHunterStrategy.h b/src/strategy/hunter/MarksmanshipHunterStrategy.h index 83a24cef..f079225c 100644 --- a/src/strategy/hunter/MarksmanshipHunterStrategy.h +++ b/src/strategy/hunter/MarksmanshipHunterStrategy.h @@ -21,12 +21,4 @@ public: NextAction** getDefaultActions() override; }; -class MarksmanshipHunterAoeStrategy : public CombatStrategy -{ -public: - MarksmanshipHunterAoeStrategy(PlayerbotAI* botAI); - - void InitTriggers(std::vector& triggers) override; - std::string const getName() override { return "mm aoe"; } -}; #endif diff --git a/src/strategy/hunter/SurvivalHunterStrategy.cpp b/src/strategy/hunter/SurvivalHunterStrategy.cpp index 475db2dd..e121b3ed 100644 --- a/src/strategy/hunter/SurvivalHunterStrategy.cpp +++ b/src/strategy/hunter/SurvivalHunterStrategy.cpp @@ -80,12 +80,3 @@ void SurvivalHunterStrategy::InitTriggers(std::vector& triggers) triggers.push_back(new TriggerNode("no stings", NextAction::array(0, new NextAction("serpent sting", 15.5f), nullptr))); triggers.push_back(new TriggerNode("serpent sting on attacker", NextAction::array(0, new NextAction("serpent sting on attacker", 15.0f), nullptr))); } - -// ===== AoE Strategy, 2/3+ enemies ===== -SurvivalHunterAoeStrategy::SurvivalHunterAoeStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI) {} - -void SurvivalHunterAoeStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back(new TriggerNode("medium aoe", NextAction::array(0, new NextAction("volley", 22.0f), nullptr))); - triggers.push_back(new TriggerNode("light aoe", NextAction::array(0, new NextAction("multi-shot", 21.0f), nullptr))); -} diff --git a/src/strategy/hunter/SurvivalHunterStrategy.h b/src/strategy/hunter/SurvivalHunterStrategy.h index 73eadb06..eaa77136 100644 --- a/src/strategy/hunter/SurvivalHunterStrategy.h +++ b/src/strategy/hunter/SurvivalHunterStrategy.h @@ -21,12 +21,4 @@ public: NextAction** getDefaultActions() override; }; -class SurvivalHunterAoeStrategy : public CombatStrategy -{ -public: - SurvivalHunterAoeStrategy(PlayerbotAI* botAI); - - void InitTriggers(std::vector& triggers) override; - std::string const getName() override { return "surv aoe"; } -}; #endif diff --git a/src/strategy/warlock/AfflictionWarlockStrategy.cpp b/src/strategy/warlock/AfflictionWarlockStrategy.cpp index 0561febc..62628f59 100644 --- a/src/strategy/warlock/AfflictionWarlockStrategy.cpp +++ b/src/strategy/warlock/AfflictionWarlockStrategy.cpp @@ -80,15 +80,3 @@ void AfflictionWarlockStrategy::InitTriggers(std::vector& triggers triggers.push_back(new TriggerNode("enemy too close for spell", NextAction::array(0, new NextAction("flee", 39.0f), nullptr))); } - -// ===== AoE Strategy, 3+ enemies ===== -AfflictionWarlockAoeStrategy::AfflictionWarlockAoeStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI) {} - -void AfflictionWarlockAoeStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back(new TriggerNode("medium aoe", NextAction::array(0, - new NextAction("shadowflame", 22.5f), - new NextAction("seed of corruption on attacker", 22.0f), - new NextAction("seed of corruption", 21.5f), - new NextAction("rain of fire", 21.0f), nullptr))); -} diff --git a/src/strategy/warlock/AfflictionWarlockStrategy.h b/src/strategy/warlock/AfflictionWarlockStrategy.h index 64910596..316998a7 100644 --- a/src/strategy/warlock/AfflictionWarlockStrategy.h +++ b/src/strategy/warlock/AfflictionWarlockStrategy.h @@ -21,12 +21,4 @@ public: NextAction** getDefaultActions() override; }; -class AfflictionWarlockAoeStrategy : public CombatStrategy -{ -public: - AfflictionWarlockAoeStrategy(PlayerbotAI* botAI); - - void InitTriggers(std::vector& triggers) override; - std::string const getName() override { return "affli aoe"; } -}; #endif diff --git a/src/strategy/warlock/DemonologyWarlockStrategy.cpp b/src/strategy/warlock/DemonologyWarlockStrategy.cpp index 25a80f67..68ad396e 100644 --- a/src/strategy/warlock/DemonologyWarlockStrategy.cpp +++ b/src/strategy/warlock/DemonologyWarlockStrategy.cpp @@ -92,19 +92,6 @@ void DemonologyWarlockStrategy::InitTriggers(std::vector& triggers triggers.push_back(new TriggerNode("meta melee flee check", NextAction::array(0, new NextAction("flee", 39.0f), nullptr))); } -// ===== AoE Strategy, 3+ enemies ===== -DemonologyWarlockAoeStrategy::DemonologyWarlockAoeStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI) {} - -void DemonologyWarlockAoeStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back(new TriggerNode("medium aoe", NextAction::array(0, - new NextAction("immolation aura", 26.0f), - new NextAction("shadowflame", 22.5f), - new NextAction("seed of corruption on attacker", 22.0f), - new NextAction("seed of corruption", 21.5f), - new NextAction("rain of fire", 21.0f), nullptr))); -} - // Combat strategy to run to melee for Immolation Aura // Enabled by default for the Demonology spec // To enable, type "co +meta melee" diff --git a/src/strategy/warlock/DemonologyWarlockStrategy.h b/src/strategy/warlock/DemonologyWarlockStrategy.h index 59519271..18b18524 100644 --- a/src/strategy/warlock/DemonologyWarlockStrategy.h +++ b/src/strategy/warlock/DemonologyWarlockStrategy.h @@ -21,15 +21,6 @@ public: NextAction** getDefaultActions() override; }; -class DemonologyWarlockAoeStrategy : public CombatStrategy -{ -public: - DemonologyWarlockAoeStrategy(PlayerbotAI* botAI); - - void InitTriggers(std::vector& triggers) override; - std::string const getName() override { return "demo aoe"; } -}; - class MetaMeleeAoeStrategy : public CombatStrategy { public: diff --git a/src/strategy/warlock/DestructionWarlockStrategy.cpp b/src/strategy/warlock/DestructionWarlockStrategy.cpp index de9efeb8..87de5daf 100644 --- a/src/strategy/warlock/DestructionWarlockStrategy.cpp +++ b/src/strategy/warlock/DestructionWarlockStrategy.cpp @@ -87,16 +87,3 @@ void DestructionWarlockStrategy::InitTriggers(std::vector& trigger triggers.push_back(new TriggerNode("enemy too close for spell", NextAction::array(0, new NextAction("flee", 39.0f), nullptr))); } - -// ===== AoE Strategy, 3+ enemies ===== -DestructionWarlockAoeStrategy::DestructionWarlockAoeStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI) {} - -void DestructionWarlockAoeStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back(new TriggerNode("medium aoe", NextAction::array(0, - new NextAction("shadowfury", 23.0f), - new NextAction("shadowflame", 22.5f), - new NextAction("seed of corruption on attacker", 22.0f), - new NextAction("seed of corruption", 21.5f), - new NextAction("rain of fire", 21.0f), nullptr))); -} diff --git a/src/strategy/warlock/DestructionWarlockStrategy.h b/src/strategy/warlock/DestructionWarlockStrategy.h index 3df8c01c..ed96f0c6 100644 --- a/src/strategy/warlock/DestructionWarlockStrategy.h +++ b/src/strategy/warlock/DestructionWarlockStrategy.h @@ -21,13 +21,4 @@ public: NextAction** getDefaultActions() override; }; -class DestructionWarlockAoeStrategy : public CombatStrategy -{ -public: - DestructionWarlockAoeStrategy(PlayerbotAI* botAI); - - void InitTriggers(std::vector& triggers) override; - std::string const getName() override { return "destro aoe"; } -}; - #endif diff --git a/src/strategy/warlock/GenericWarlockStrategy.cpp b/src/strategy/warlock/GenericWarlockStrategy.cpp index 9ad266d4..df8265c7 100644 --- a/src/strategy/warlock/GenericWarlockStrategy.cpp +++ b/src/strategy/warlock/GenericWarlockStrategy.cpp @@ -47,6 +47,19 @@ void GenericWarlockStrategy::InitTriggers(std::vector& triggers) triggers.push_back(new TriggerNode("devour magic cleanse", NextAction::array(0, new NextAction("devour magic cleanse", 50.0f), nullptr))); } +// ===== AoE Strategy, 3+ enemies ===== + +void AoEWarlockStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back(new TriggerNode("medium aoe", NextAction::array(0, + new NextAction("immolation aura", 26.0f), + new NextAction("shadowfury", 23.0f), + new NextAction("shadowflame", 22.5f), + new NextAction("seed of corruption on attacker", 22.0f), + new NextAction("seed of corruption", 21.5f), + new NextAction("rain of fire", 21.0f), nullptr))); +} + void WarlockBoostStrategy::InitTriggers(std::vector& triggers) { // Placeholder for future boost triggers diff --git a/src/strategy/warlock/GenericWarlockStrategy.h b/src/strategy/warlock/GenericWarlockStrategy.h index a1ab80ca..22b59db7 100644 --- a/src/strategy/warlock/GenericWarlockStrategy.h +++ b/src/strategy/warlock/GenericWarlockStrategy.h @@ -21,6 +21,15 @@ public: uint32 GetType() const override { return CombatStrategy::GetType() | STRATEGY_TYPE_RANGED | STRATEGY_TYPE_DPS; } }; +class AoEWarlockStrategy : public CombatStrategy +{ +public: + AoEWarlockStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI) {} + + std::string const getName() override { return "aoe"; } + void InitTriggers(std::vector& triggers) override; +}; + class WarlockBoostStrategy : public Strategy { public: diff --git a/src/strategy/warlock/WarlockAiObjectContext.cpp b/src/strategy/warlock/WarlockAiObjectContext.cpp index fa1e895d..155ded9f 100644 --- a/src/strategy/warlock/WarlockAiObjectContext.cpp +++ b/src/strategy/warlock/WarlockAiObjectContext.cpp @@ -30,12 +30,9 @@ public: creators["pet"] = &WarlockStrategyFactoryInternal::pet; creators["spellstone"] = &WarlockStrategyFactoryInternal::spellstone; creators["firestone"] = &WarlockStrategyFactoryInternal::firestone; - creators["affli aoe"] = &WarlockStrategyFactoryInternal::affliction_aoe; - creators["demo aoe"] = &WarlockStrategyFactoryInternal::demonology_aoe; - creators["destro aoe"] = &WarlockStrategyFactoryInternal::destruction_aoe; creators["meta melee"] = &WarlockStrategyFactoryInternal::meta_melee_aoe; creators["tank"] = &WarlockStrategyFactoryInternal::tank; - + creators["aoe"] = &WarlockStrategyFactoryInternal::aoe; } private: @@ -46,11 +43,9 @@ private: static Strategy* pet(PlayerbotAI* botAI) { return new WarlockPetStrategy(botAI); } static Strategy* spellstone(PlayerbotAI* botAI) { return new UseSpellstoneStrategy(botAI); } static Strategy* firestone(PlayerbotAI* botAI) { return new UseFirestoneStrategy(botAI); } - static Strategy* affliction_aoe(PlayerbotAI* botAI) { return new AfflictionWarlockAoeStrategy(botAI); } - static Strategy* demonology_aoe(PlayerbotAI* botAI) { return new DemonologyWarlockAoeStrategy(botAI); } - static Strategy* destruction_aoe(PlayerbotAI* botAI) { return new DestructionWarlockAoeStrategy(botAI); } static Strategy* meta_melee_aoe(PlayerbotAI* botAI) { return new MetaMeleeAoeStrategy(botAI); } static Strategy* tank(PlayerbotAI* botAI) { return new TankWarlockStrategy(botAI); } + static Strategy* aoe(PlayerbotAI* botAI) { return new AoEWarlockStrategy(botAI); } }; class WarlockCombatStrategyFactoryInternal : public NamedObjectContext