diff options
author | ModoX <moardox@gmail.com> | 2025-07-26 15:10:26 +0200 |
---|---|---|
committer | ModoX <moardox@gmail.com> | 2025-07-26 15:14:11 +0200 |
commit | 6c51b005c26d57ff70cc479e71a6e227f717e1fd (patch) | |
tree | e266d818b87ca82e1a51bfe88dc40a183d697636 | |
parent | 534990b10289ae66ebb4029874179eb35160a069 (diff) |
Core/Spells: Allow negative values for SPELL_AURA_OBS_MOD_POWER
-rw-r--r-- | src/server/game/Spells/Auras/SpellAuraEffects.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 70ee3420928..37be9a553c7 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -6004,12 +6004,14 @@ void AuraEffect::HandleObsModPowerAuraTick(Unit* target, Unit* caster) const return; } - // don't regen when permanent aura target has full power - if (GetBase()->IsPermanent() && target->GetPower(powerType) == target->GetMaxPower(powerType)) + // 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 - uint32 amount = std::max(GetAmount(), 0) * target->GetMaxPower(powerType) /100; + } + int32 amount = GetAmount() * target->GetMaxPower(powerType) / 100; TC_LOG_DEBUG("spells.aura.effect", "PeriodicTick: {} energize {} for {} dmg inflicted by {}", GetCasterGUID().ToString(), target->GetGUID().ToString(), amount, GetId()); @@ -6017,7 +6019,7 @@ void AuraEffect::HandleObsModPowerAuraTick(Unit* target, Unit* caster) const int32 gain = target->ModifyPower(powerType, amount); if (caster) - target->GetThreatManager().ForwardThreatForAssistingMe(caster, float(gain)*0.5f, GetSpellInfo(), true); + target->GetThreatManager().ForwardThreatForAssistingMe(caster, std::abs(float(gain) * 0.5f), GetSpellInfo(), true); target->SendPeriodicAuraLog(&pInfo); } |