Core/Spells: Allow negative values for SPELL_AURA_OBS_MOD_POWER
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user