mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Auras: Ensure aura target of SPELL_AURA_TRIGGER_SPELL_ON_POWER_PCT has required power type
Closes #30669
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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()))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user