diff --git a/Source/Framework/Constants/Spells/SpellAuraConst.cs b/Source/Framework/Constants/Spells/SpellAuraConst.cs index 84ab8d920..bc0a9649f 100644 --- a/Source/Framework/Constants/Spells/SpellAuraConst.cs +++ b/Source/Framework/Constants/Spells/SpellAuraConst.cs @@ -444,7 +444,7 @@ namespace Framework.Constants ModBattlePetXpPct = 420, ModAbsorbEffectsDonePct = 421, // NYI ModAbsorbEffectsTakenPct = 422, //NYI - Unk423 = 423, + ModManaCostPct = 423, CasterIgnoreLos = 424, //NYI Unk425 = 425, Unk426 = 426, diff --git a/Source/Game/Entities/StatSystem.cs b/Source/Game/Entities/StatSystem.cs index dec833bd7..1fc05b283 100644 --- a/Source/Game/Entities/StatSystem.cs +++ b/Source/Game/Entities/StatSystem.cs @@ -931,6 +931,8 @@ namespace Game.Entities } return Math.Max(resistMech, 0); } + + public void ApplyModManaCostMultiplier(float manaCostMultiplier, bool apply) { ApplyModUpdateFieldValue(m_values.ModifyValue(m_unitData).ModifyValue(m_unitData.ManaCostMultiplier), manaCostMultiplier, apply); } public void ApplyModManaCostModifier(SpellSchools school, int mod, bool apply) { ApplyModUpdateFieldValue(ref m_values.ModifyValue(m_unitData).ModifyValue(m_unitData.ManaCostModifier, (int)school), mod, apply); } } diff --git a/Source/Game/Spells/Auras/AuraEffect.cs b/Source/Game/Spells/Auras/AuraEffect.cs index 0da90fb6c..4b7057935 100644 --- a/Source/Game/Spells/Auras/AuraEffect.cs +++ b/Source/Game/Spells/Auras/AuraEffect.cs @@ -3461,6 +3461,15 @@ namespace Game.Spells } } + [AuraEffectHandler(AuraType.ModManaCostPct)] + void HandleModManaCostPct(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply) + { + if (!mode.HasAnyFlag(AuraEffectHandleModes.ChangeAmountMask | AuraEffectHandleModes.Stat)) + return; + + aurApp.GetTarget().ApplyModManaCostMultiplier(GetAmount() / 100.0f, apply); + } + [AuraEffectHandler(AuraType.ModPowerDisplay)] void HandleAuraModPowerDisplay(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply) { diff --git a/Source/Game/Spells/SpellInfo.cs b/Source/Game/Spells/SpellInfo.cs index 9b514538e..60418a986 100644 --- a/Source/Game/Spells/SpellInfo.cs +++ b/Source/Game/Spells/SpellInfo.cs @@ -2773,9 +2773,6 @@ namespace Game.Spells flatMod += eff.GetAmount(); } - if (power.PowerType == PowerType.Mana) - flatMod *= (int)(1.0f + caster.m_unitData.ManaCostMultiplier); // this is wrong - powerCost += flatMod; } @@ -2842,7 +2839,9 @@ namespace Game.Spells powerCost += MathFunctions.CalculatePct(powerCost, eff.GetAmount()); } - if (power.PowerType == PowerType.Health) + if (power.PowerType == PowerType.Mana) + powerCost = (int)((float)powerCost * (1.0f + caster.m_unitData.ManaCostMultiplier)); + else if (power.PowerType == PowerType.Health) { healthCost += powerCost; continue;