From c4fa1a27ea196e4526edf5a9534b6179c0e62149 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Sun, 27 Feb 2022 13:50:16 -0500 Subject: [PATCH] Scripts/Spells: Fix mage Flame On talent Port From (https://github.com/TrinityCore/TrinityCore/commit/d8efda4ff335ce6252f32e1736b1f99d443bce7b) --- Source/Scripts/Spells/Mage.cs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/Source/Scripts/Spells/Mage.cs b/Source/Scripts/Spells/Mage.cs index 42e76f4d5..ae6ab9767 100644 --- a/Source/Scripts/Spells/Mage.cs +++ b/Source/Scripts/Spells/Mage.cs @@ -17,6 +17,7 @@ using Framework.Constants; using Framework.Dynamic; +using Game.DataStorage; using Game.Entities; using Game.Groups; using Game.Maps; @@ -47,6 +48,7 @@ namespace Scripts.Spells.Mage public const uint DradonhawkForm = 32818; public const uint EverwarmSocks = 320913; public const uint FingersOfFrost = 44544; + public const uint FireBlast = 108853; public const uint Firestarter = 205026; public const uint FrostNova = 122; public const uint GiraffeForm = 32816; @@ -508,6 +510,28 @@ namespace Scripts.Spells.Mage } } + // 205029 - Flame On + class spell_mage_flame_on : AuraScript + { + public override bool Validate(SpellInfo spellInfo) + { + return ValidateSpellInfo(SpellIds.FireBlast) + && CliDB.SpellCategoryStorage.HasRecord(Global.SpellMgr.GetSpellInfo(SpellIds.FireBlast, Difficulty.None).ChargeCategoryId) + && spellInfo.GetEffects().Count > 2; + } + + void CalculateAmount(AuraEffect aurEff, ref int amount, ref bool canBeRecalculated) + { + canBeRecalculated = false; + amount = -(int)MathFunctions.GetPctOf(GetEffectInfo(2).CalcValue() * Time.InMilliseconds, CliDB.SpellCategoryStorage.LookupByKey(Global.SpellMgr.GetSpellInfo(SpellIds.FireBlast, Difficulty.None).ChargeCategoryId).ChargeRecoveryTime); + } + + public override void Register() + { + DoEffectCalcAmount.Add(new EffectCalcAmountHandler(CalculateAmount, 1, AuraType.ChargeRecoveryMultiplier)); + } + } + [Script] // 11426 - Ice Barrier class spell_mage_ice_barrier : AuraScript {