From 82d3e3d8f4b29b6efd06ef523e6b6fd83a78a7cc Mon Sep 17 00:00:00 2001 From: hondacrx Date: Sun, 2 Jan 2022 19:34:49 -0500 Subject: [PATCH] Scripts/Spells: Fix Incanters Flow Port From (https://github.com/TrinityCore/TrinityCore/commit/da8d6b5180a586f2cbf8ea4e859a1d5336ea8336) --- Source/Scripts/Spells/Mage.cs | 41 +++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/Source/Scripts/Spells/Mage.cs b/Source/Scripts/Spells/Mage.cs index 41d65a530..aebecd57f 100644 --- a/Source/Scripts/Spells/Mage.cs +++ b/Source/Scripts/Spells/Mage.cs @@ -52,6 +52,7 @@ namespace Scripts.Spells.Mage public const uint IceBarrier = 11426; public const uint IceBlock = 45438; public const uint Ignite = 12654; + public const uint IncantersFlow = 116267; public const uint LivingBombExplosion = 44461; public const uint LivingBombPeriodic = 217694; public const uint ManaSurge = 37445; @@ -649,6 +650,46 @@ namespace Scripts.Spells.Mage } } + [Script] // 1463 - Incanter's Flow + class spell_mage_incanters_flow : AuraScript + { + sbyte modifier = 1; + + public override bool Validate(SpellInfo spellInfo) + { + return ValidateSpellInfo(SpellIds.IncantersFlow); + } + + void HandlePeriodicTick(AuraEffect aurEff) + { + // Incanter's flow should not cycle out of combat + if (!GetTarget().IsInCombat()) + return; + + Aura aura = GetTarget().GetAura(SpellIds.IncantersFlow); + if (aura != null) + { + uint stacks = aura.GetStackAmount(); + + // Force always to values between 1 and 5 + if ((modifier == -1 && stacks == 1) || (modifier == 1 && stacks == 5)) + { + modifier *= -1; + return; + } + + aura.ModStackAmount(modifier); + } + else + GetTarget().CastSpell(GetTarget(), SpellIds.IncantersFlow, true); + } + + public override void Register() + { + OnEffectPeriodic.Add(new EffectPeriodicHandler(HandlePeriodicTick, 0, AuraType.PeriodicDummy)); + } + } + [Script] // 44457 - Living Bomb class spell_mage_living_bomb : SpellScript {