Core/Auras: Ensure aura target of SPELL_AURA_TRIGGER_SPELL_ON_POWER_PCT has required power type
Port From (https://github.com/TrinityCore/TrinityCore/commit/fc54ae79a95bc162bd0ceec199561af873576a23)
This commit is contained in:
@@ -764,6 +764,9 @@ namespace Game.Entities
|
|||||||
if (effect.GetAuraType() == AuraType.TriggerSpellOnPowerPct)
|
if (effect.GetAuraType() == AuraType.TriggerSpellOnPowerPct)
|
||||||
{
|
{
|
||||||
int maxPower = GetMaxPower(power);
|
int maxPower = GetMaxPower(power);
|
||||||
|
if (maxPower == 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
oldValueCheck = MathFunctions.GetPctOf(oldVal, maxPower);
|
oldValueCheck = MathFunctions.GetPctOf(oldVal, maxPower);
|
||||||
newValueCheck = MathFunctions.GetPctOf(newVal, maxPower);
|
newValueCheck = MathFunctions.GetPctOf(newVal, maxPower);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4886,7 +4886,11 @@ namespace Game.Spells
|
|||||||
|
|
||||||
int effectAmount = GetAmount();
|
int effectAmount = GetAmount();
|
||||||
uint triggerSpell = GetSpellEffectInfo().TriggerSpell;
|
uint triggerSpell = GetSpellEffectInfo().TriggerSpell;
|
||||||
float powerAmountPct = MathFunctions.GetPctOf(target.GetPower((PowerType)GetMiscValue()), target.GetMaxPower((PowerType)GetMiscValue()));
|
int maxPower = target.GetMaxPower((PowerType)GetMiscValue());
|
||||||
|
if (maxPower == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
float powerAmountPct = MathFunctions.GetPctOf(target.GetPower((PowerType)GetMiscValue()), maxPower);
|
||||||
|
|
||||||
switch ((AuraTriggerOnPowerChangeDirection)GetMiscValueB())
|
switch ((AuraTriggerOnPowerChangeDirection)GetMiscValueB())
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user