Fixed setting and unsetting of m_spellModTakingSpell

Port From (https://github.com/TrinityCore/TrinityCore/commit/fb5c07ffe8d72d32a2c47cfa41dfb3a952160b72)
This commit is contained in:
hondacrx
2019-08-17 13:04:19 -04:00
parent f2f8afb7a4
commit 1e4b1366c2
4 changed files with 25 additions and 38 deletions
+3 -3
View File
@@ -2749,7 +2749,7 @@ namespace Game.Spells
return RecoveryTime > CategoryRecoveryTime ? RecoveryTime : CategoryRecoveryTime;
}
public List<SpellPowerCost> CalcPowerCost(Unit caster, SpellSchoolMask schoolMask)
public List<SpellPowerCost> CalcPowerCost(Unit caster, SpellSchoolMask schoolMask, Spell spell = null)
{
List<SpellPowerCost> costs = new List<SpellPowerCost>();
@@ -2857,9 +2857,9 @@ namespace Game.Spells
if (modOwner)
{
if (power.OrderIndex == 0)
modOwner.ApplySpellMod(Id, SpellModOp.Cost, ref powerCost);
modOwner.ApplySpellMod(Id, SpellModOp.Cost, ref powerCost, spell);
else if (power.OrderIndex == 1)
modOwner.ApplySpellMod(Id, SpellModOp.SpellCost2, ref powerCost);
modOwner.ApplySpellMod(Id, SpellModOp.SpellCost2, ref powerCost, spell);
}
if (!caster.IsControlledByPlayer() && MathFunctions.fuzzyEq(power.PowerCostPct, 0.0f) && SpellLevel != 0)