From 7830bfa0a33bd87570ea828d8502f7dd9b50f3a8 Mon Sep 17 00:00:00 2001 From: Ovahlord Date: Mon, 9 Jul 2018 03:50:38 +0200 Subject: [PATCH] Core/Spells: fixed Static Shock talent --- .../custom/custom_2018_07_09_01_world.sql | 7 ++++ src/server/scripts/Spells/spell_shaman.cpp | 33 +++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 sql/updates/world/custom/custom_2018_07_09_01_world.sql diff --git a/sql/updates/world/custom/custom_2018_07_09_01_world.sql b/sql/updates/world/custom/custom_2018_07_09_01_world.sql new file mode 100644 index 00000000000..e049ead62d4 --- /dev/null +++ b/sql/updates/world/custom/custom_2018_07_09_01_world.sql @@ -0,0 +1,7 @@ +DELETE FROM `spell_proc` WHERE `SpellId`= -51525; +INSERT INTO `spell_proc` (`SpellId`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `ProcFlags`, `SpellTypeMask`, `SpellPhaseMask`, `HitMask`, `AttributesMask`, `Cooldown`, `Charges`, `Chance`) VALUES +(-51525, 11, 0x00000000, 0x01000010, 0x00020000 | 0x00000004, 0, 1, 1, 0, 0, 0, 0, 0); + +DELETE FROM `spell_script_names` WHERE `ScriptName`= 'spell_sha_static_shock'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(-51525, 'spell_sha_static_shock'); diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index 85579f6fe7a..d60f60f3a4f 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -1951,6 +1951,38 @@ class spell_sha_unleash_elements : public SpellScript } }; +// -51525 - Static Shock +class spell_sha_static_shock : public AuraScript +{ + PrepareAuraScript(spell_sha_static_shock); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_SHAMAN_LIGHTNING_SHIELD_DAMAGE }); + } + + bool CheckProc(ProcEventInfo& eventInfo) + { + return eventInfo.GetActor()->HasAura(SPELL_SHAMAN_LIGHTNING_SHIELD); + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + + Unit* caster = eventInfo.GetActor(); + Unit* target = eventInfo.GetProcTarget(); + + caster->CastSpell(target, SPELL_SHAMAN_LIGHTNING_SHIELD_DAMAGE, true, nullptr, aurEff); + } + + void Register() override + { + DoCheckProc += AuraCheckProcFn(spell_sha_static_shock::CheckProc); + OnEffectProc += AuraEffectProcFn(spell_sha_static_shock::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } +}; + void AddSC_shaman_spell_scripts() { new spell_sha_ancestral_awakening(); @@ -1987,6 +2019,7 @@ void AddSC_shaman_spell_scripts() new spell_sha_nature_guardian(); new spell_sha_resurgence(); new spell_sha_rolling_thunder(); + RegisterAuraScript(spell_sha_static_shock); new spell_sha_telluric_currents(); new spell_sha_thunderstorm(); new spell_sha_tidal_waves();