Core/Spells: Allow negative values for SPELL_AURA_OBS_MOD_POWER

This commit is contained in:
ModoX
2025-07-26 15:14:11 +02:00
parent 534990b102
commit 6c51b005c2
@@ -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);
}