From 8b1250f219463062f685aa495cc309c73eca0ab2 Mon Sep 17 00:00:00 2001 From: dillyns <49765217+dillyns@users.noreply.github.com> Date: Fri, 12 Jun 2026 16:05:55 -0400 Subject: [PATCH] Remove hardcoded "mana potion" actions from Druid, Mage, and Spriest (#2430) ## Pull Request Description Currently, a mage druid or shadow priest bot would use a mana potion without the "potions" strategy if Innervate, Evocation, or Disperse were unavailable. Removes hardcoded calls to "mana potion". Mana potions should be used with the potions strategy only. ## Feature Evaluation - Describe the **minimum logic** required to achieve the intended behavior. - Describe the **processing cost** when this logic executes across many bots. ## How to Test the Changes Create a druid, mage, or shadow priest bot and make sure they do not have the potions strategy (co -potions). Make sure the bot has a mana potion in their inventory. Get them to go out of mana. They should not use the potion. Add the potions strategy (co +potions). They should now use the potion on the "low mana" trigger like everyone else. ## Impact Assessment - Does this change increase per-bot/per-tick processing or risk scaling poorly with thousands of bots? - - [x] No, not at all - - [ ] Minimal impact (**explain below**) - - [ ] Moderate impact (**explain below**) - Does this change modify default bot behavior? - - [x] No - - [ ] Yes (**explain why**) - Does this change add new decision branches or increase maintenance complexity? - - [x] No - - [ ] Yes (**explain below**) ## AI Assistance Was AI assistance used while working on this change? - - [ ] No - - [x] Yes (**explain below**) Claude was used to search for any instances of mana potion usage outside of the potions strategy. ## Final Checklist - - [x] Stability is not compromised. - - [x] Performance impact is understood, tested, and acceptable. - - [x] Added logic complexity is justified and explained. - - [x] Any new bot dialogue lines are translated. - - [x] Documentation updated if needed (Conf comments, WiKi commands). ## Notes for Reviewers --- src/Ai/Base/Strategy/UsePotionsStrategy.cpp | 2 +- src/Ai/Class/Druid/Strategy/GenericDruidStrategy.cpp | 9 --------- src/Ai/Class/Mage/Strategy/GenericMageStrategy.cpp | 10 ---------- .../Strategy/ShadowPriestStrategyActionNodeFactory.h | 8 -------- 4 files changed, 1 insertion(+), 28 deletions(-) diff --git a/src/Ai/Base/Strategy/UsePotionsStrategy.cpp b/src/Ai/Base/Strategy/UsePotionsStrategy.cpp index 27f690cf1..8696784ff 100644 --- a/src/Ai/Base/Strategy/UsePotionsStrategy.cpp +++ b/src/Ai/Base/Strategy/UsePotionsStrategy.cpp @@ -32,5 +32,5 @@ void UsePotionsStrategy::InitTriggers(std::vector& triggers) triggers.push_back(new TriggerNode( "critical health", { NextAction("healthstone", ACTION_MEDIUM_HEAL + 1) })); triggers.push_back( - new TriggerNode("low mana", { NextAction("mana potion", ACTION_EMERGENCY) })); + new TriggerNode("medium mana", { NextAction("mana potion", ACTION_EMERGENCY) })); } diff --git a/src/Ai/Class/Druid/Strategy/GenericDruidStrategy.cpp b/src/Ai/Class/Druid/Strategy/GenericDruidStrategy.cpp index d5e7b9f40..7393f7c51 100644 --- a/src/Ai/Class/Druid/Strategy/GenericDruidStrategy.cpp +++ b/src/Ai/Class/Druid/Strategy/GenericDruidStrategy.cpp @@ -24,7 +24,6 @@ public: creators["entangling roots on cc"] = &entangling_roots_on_cc; creators["cyclone on cc"] = &cyclone_on_cc; creators["hibernate on cc"] = &hibernate_on_cc; - creators["innervate"] = &innervate; } private: @@ -107,14 +106,6 @@ private: /*A*/ {}, /*C*/ {}); } - - static ActionNode* innervate([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("innervate", - /*P*/ {}, - /*A*/ { NextAction("mana potion") }, - /*C*/ {}); - } }; GenericDruidStrategy::GenericDruidStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI) diff --git a/src/Ai/Class/Mage/Strategy/GenericMageStrategy.cpp b/src/Ai/Class/Mage/Strategy/GenericMageStrategy.cpp index 36b594ce9..9277cb651 100644 --- a/src/Ai/Class/Mage/Strategy/GenericMageStrategy.cpp +++ b/src/Ai/Class/Mage/Strategy/GenericMageStrategy.cpp @@ -28,7 +28,6 @@ public: creators["frostbolt"] = &frostbolt; creators["frostfire bolt"] = &frostfire_bolt; creators["scorch"] = &scorch; - creators["evocation"] = &evocation; creators["remove curse"] = &remove_curse; creators["remove curse on party"] = &remove_curse_on_party; creators["fireball"] = &fireball; @@ -59,14 +58,6 @@ private: /*C*/ {}); } - static ActionNode* evocation([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("evocation", - /*P*/ {}, - /*A*/ { NextAction("mana potion") }, - /*C*/ {}); - } - static ActionNode* remove_curse([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode("remove curse", @@ -127,7 +118,6 @@ void GenericMageStrategy::InitTriggers(std::vector& triggers) else if (bot->HasSpell(SPELL_CONJURE_MANA_AGATE)) triggers.push_back(new TriggerNode("high mana", { NextAction("use mana agate", 90.0f) })); - triggers.push_back(new TriggerNode("medium mana", { NextAction("mana potion", 90.0f) })); triggers.push_back(new TriggerNode("low mana", { NextAction("evocation", 90.0f) })); // Counterspell / Spellsteal Triggers diff --git a/src/Ai/Class/Priest/Strategy/ShadowPriestStrategyActionNodeFactory.h b/src/Ai/Class/Priest/Strategy/ShadowPriestStrategyActionNodeFactory.h index 4efcc6f6a..27528be68 100644 --- a/src/Ai/Class/Priest/Strategy/ShadowPriestStrategyActionNodeFactory.h +++ b/src/Ai/Class/Priest/Strategy/ShadowPriestStrategyActionNodeFactory.h @@ -17,7 +17,6 @@ public: ShadowPriestStrategyActionNodeFactory() { creators["mind blast"] = &mind_blast; - creators["dispersion"] = &dispersion; creators["mind flay"] = &mind_flay; creators["smite"] = &smite; } @@ -47,13 +46,6 @@ private: /*C*/ {}); } - static ActionNode* dispersion([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("dispersion", - /*P*/ {}, - /*A*/ { NextAction("mana potion") }, - /*C*/ {}); - } }; #endif