Core/Auras: Ensure aura target of SPELL_AURA_TRIGGER_SPELL_ON_POWER_PCT has required power type

Closes #30669
This commit is contained in:
Shauren
2025-02-05 20:35:13 +01:00
parent 9201c0f035
commit fc54ae79a9
2 changed files with 8 additions and 1 deletions

View File

@@ -9876,6 +9876,9 @@ void Unit::TriggerOnPowerChangeAuras(Powers power, int32 oldVal, int32 newVal)
if (effect->GetAuraType() == SPELL_AURA_TRIGGER_SPELL_ON_POWER_PCT)
{
int32 maxPower = GetMaxPower(power);
if (!maxPower)
continue;
oldValueCheck = GetPctOf(oldVal, maxPower);
newValueCheck = GetPctOf(newVal, maxPower);
}

View File

@@ -5327,7 +5327,11 @@ void AuraEffect::HandleTriggerSpellOnPowerPercent(AuraApplication const* aurApp,
int32 effectAmount = GetAmount();
uint32 triggerSpell = GetSpellEffectInfo().TriggerSpell;
float powerAmountPct = GetPctOf(target->GetPower(Powers(GetMiscValue())), target->GetMaxPower(Powers(GetMiscValue())));
int32 maxPower = target->GetMaxPower(Powers(GetMiscValue()));
if (!maxPower)
return;
float powerAmountPct = GetPctOf(target->GetPower(Powers(GetMiscValue())), maxPower);
switch (AuraTriggerOnPowerChangeDirection(GetMiscValueB()))
{