From 9c4147c964e9c31bf1fb1e2c970dfdd62695e874 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Fri, 7 Jan 2022 16:50:44 -0500 Subject: [PATCH] Scripts/Spells: Fix chain lightning energize (elemental) Port From (https://github.com/TrinityCore/TrinityCore/commit/47d8b17e9f6766ade424027d4cdaf46eb0beb488) --- Source/Scripts/Spells/Shaman.cs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/Source/Scripts/Spells/Shaman.cs b/Source/Scripts/Spells/Shaman.cs index 578cf39ad..e095d8c29 100644 --- a/Source/Scripts/Spells/Shaman.cs +++ b/Source/Scripts/Spells/Shaman.cs @@ -31,6 +31,7 @@ namespace Scripts.Spells.Shaman { public const uint AncestralGuidance = 108281; public const uint AncestralGuidanceHeal = 114911; + public const uint ChainLightningEnergize = 195897; public const uint ChainedHeal = 70809; public const uint CrashLightningCleave = 187878; public const uint EarthShieldHeal = 204290; @@ -168,6 +169,29 @@ namespace Scripts.Spells.Shaman } } + [Script] // 188443 - Chain lightning + class spell_sha_chain_lightning : SpellScript + { + public override bool Validate(SpellInfo spellInfo) + { + return ValidateSpellInfo(SpellIds.ChainLightningEnergize, SpellIds.MaelstromController) + && Global.SpellMgr.GetSpellInfo(SpellIds.MaelstromController, Difficulty.None).GetEffects().Count > 4; + } + + void HandleScript(uint effIndex) + { + AuraEffect energizeAmount = GetCaster().GetAuraEffect(SpellIds.MaelstromController, 4); + if (energizeAmount != null) + GetCaster().CastSpell(GetCaster(), SpellIds.ChainLightningEnergize, new CastSpellExtraArgs(energizeAmount) + .AddSpellMod(SpellValueMod.BasePoint0, (int)(energizeAmount.GetAmount() * GetUnitTargetCountForEffect(0)))); + } + + public override void Register() + { + OnEffectLaunch.Add(new EffectHandler(HandleScript, 0, SpellEffectName.SchoolDamage)); + } + } + [Script] // 187874 - Crash Lightning class spell_sha_crash_lightning : SpellScript {