From 889a55aa824031a7c8e89b8e9d39c28d6dfd3789 Mon Sep 17 00:00:00 2001 From: Hondacrx Date: Wed, 20 Aug 2025 22:18:09 -0400 Subject: [PATCH] Core/Spells: Allow negative values for SPELL_AURA_OBS_MOD_POWER Port From (https://github.com/TrinityCore/TrinityCore/commit/6c51b005c26d57ff70cc479e71a6e227f717e1fd) --- Source/Game/Spells/Auras/AuraEffect.cs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Source/Game/Spells/Auras/AuraEffect.cs b/Source/Game/Spells/Auras/AuraEffect.cs index 97f4d9f81..33ce72c5b 100644 --- a/Source/Game/Spells/Auras/AuraEffect.cs +++ b/Source/Game/Spells/Auras/AuraEffect.cs @@ -5575,19 +5575,22 @@ namespace Game.Spells return; } - // don't regen when permanent aura target has full power - if (GetBase().IsPermanent() && target.GetPower(powerType) == target.GetMaxPower(powerType)) - return; + // don't regen when permanent aura and limit is already reached + if (GetBase().IsPermanent()) + { + if ((target.GetPower(powerType) == target.GetMaxPower(powerType) && GetAmount() > 0) + || (target.GetPower(powerType) == 0 && GetAmount() < 0)) + return; + } - // ignore negative values (can be result apply spellmods to aura damage - int amount = Math.Max(GetAmount(), 0) * target.GetMaxPower(powerType) / 100; + int amount = GetAmount() * target.GetMaxPower(powerType) / 100; SpellPeriodicAuraLogInfo pInfo = new(this, (uint)amount, (uint)amount, 0, 0, 0, 0.0f, false); int gain = target.ModifyPower(powerType, amount); if (caster != null) - target.GetThreatManager().ForwardThreatForAssistingMe(caster, gain * 0.5f, GetSpellInfo(), true); + target.GetThreatManager().ForwardThreatForAssistingMe(caster, Math.Abs(gain * 0.5f), GetSpellInfo(), true); target.SendPeriodicAuraLog(pInfo); }