From d8aee90419cfe645c97a963f0d7ed2a3f2f6157f Mon Sep 17 00:00:00 2001 From: hondacrx Date: Wed, 4 May 2022 10:49:01 -0400 Subject: [PATCH] Scripts/Spells: Fix shaman Undulation talent Port From (https://github.com/TrinityCore/TrinityCore/commit/d5bb799f27f2604741af2de8db07b2871d37b378) --- Source/Scripts/Spells/Shaman.cs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/Source/Scripts/Spells/Shaman.cs b/Source/Scripts/Spells/Shaman.cs index 497e90121..5ca6ecf46 100644 --- a/Source/Scripts/Spells/Shaman.cs +++ b/Source/Scripts/Spells/Shaman.cs @@ -1547,6 +1547,31 @@ namespace Scripts.Spells.Shaman } } + [Script] // 200071 - Undulation + class spell_sha_undulation_passive : AuraScript + { + byte _castCounter = 1; // first proc happens after two casts, then one every 3 casts + + public override bool Validate(SpellInfo spellInfo) + { + return ValidateSpellInfo(SpellIds.UndulationProc); + } + + void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo) + { + if (++_castCounter == 3) + { + GetTarget().CastSpell(GetTarget(), SpellIds.UndulationProc, true); + _castCounter = 0; + } + } + + public override void Register() + { + OnEffectProc.Add(new EffectProcHandler(HandleProc, 0, AuraType.Dummy)); + } + } + [Script] // 33757 - Windfury Weapon class spell_sha_windfury_weapon : SpellScript {