aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.cpp14
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);
}