From dff4934dd160c5b27c7805f91bb2c109de3eaa46 Mon Sep 17 00:00:00 2001 From: Gonzalo Date: Thu, 25 Sep 2025 18:35:18 -0300 Subject: [PATCH 1/3] Fix: Prevent priests in Spirit of Redemption form from using mana This change modifies the `HasManaValue::Calculate()` function in `src/strategy/values/StatsValues.cpp`. Previously, priests in Spirit of Redemption form (angel form when dead) could still attempt to use mana-restoring actions like drinking water, which is illogical since they cannot use mana in that form. This fix adds a check for the Spirit of Redemption aura (spell ID 20711) to prevent mana usage: - If the target has the Spirit of Redemption aura, the function returns false - This prevents priests in angel form from attempting to drink water or use other mana-restoring actions - Improves bot behavior realism by respecting the limitations of the Spirit of Redemption form This change works in conjunction with the previous fix that prevents non-mana-using classes from attempting to restore mana, creating a more comprehensive solution for mana management. --- src/strategy/values/StatsValues.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/strategy/values/StatsValues.cpp b/src/strategy/values/StatsValues.cpp index 2c87ec72..1208c567 100644 --- a/src/strategy/values/StatsValues.cpp +++ b/src/strategy/values/StatsValues.cpp @@ -119,6 +119,9 @@ bool HasManaValue::Calculate() Unit* target = GetTarget(); if (!target) return false; + + if (target->HasAura(20711)) // Spirit of Redemption + return false; return target->GetPower(POWER_MANA); } From 06e45300e10c16d829cfddc62171ac71d02395a1 Mon Sep 17 00:00:00 2001 From: bash <31279994+hermensbas@users.noreply.github.com> Date: Wed, 1 Oct 2025 23:45:28 +0200 Subject: [PATCH 2/3] Added const --- src/strategy/values/StatsValues.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/strategy/values/StatsValues.cpp b/src/strategy/values/StatsValues.cpp index 1208c567..9a121816 100644 --- a/src/strategy/values/StatsValues.cpp +++ b/src/strategy/values/StatsValues.cpp @@ -4,10 +4,13 @@ */ #include "StatsValues.h" - #include "Playerbots.h" #include "ServerFacade.h" +namespace { + constexpr uint32 PRIEST_SPIRIT_OF_REDEMPTION_SPELL_ID = 20711u; +} + Unit* HealthValue::GetTarget() { AiObjectContext* ctx = AiObject::context; @@ -120,7 +123,7 @@ bool HasManaValue::Calculate() if (!target) return false; - if (target->HasAura(20711)) // Spirit of Redemption + if (target->HasAura(PRIEST_SPIRIT_OF_REDEMPTION_SPELL_ID)) return false; return target->GetPower(POWER_MANA); From 31b19aabc76cf8dd9107e0d814f2ac6e52dbc266 Mon Sep 17 00:00:00 2001 From: bash <31279994+hermensbas@users.noreply.github.com> Date: Thu, 2 Oct 2025 01:28:30 +0200 Subject: [PATCH 3/3] Minor correction, scope was to big. --- src/strategy/values/StatsValues.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/strategy/values/StatsValues.cpp b/src/strategy/values/StatsValues.cpp index 9a121816..5b1e62f6 100644 --- a/src/strategy/values/StatsValues.cpp +++ b/src/strategy/values/StatsValues.cpp @@ -7,10 +7,6 @@ #include "Playerbots.h" #include "ServerFacade.h" -namespace { - constexpr uint32 PRIEST_SPIRIT_OF_REDEMPTION_SPELL_ID = 20711u; -} - Unit* HealthValue::GetTarget() { AiObjectContext* ctx = AiObject::context; @@ -122,7 +118,8 @@ bool HasManaValue::Calculate() Unit* target = GetTarget(); if (!target) return false; - + + constexpr uint32 PRIEST_SPIRIT_OF_REDEMPTION_SPELL_ID = 20711u; if (target->HasAura(PRIEST_SPIRIT_OF_REDEMPTION_SPELL_ID)) return false;