From eaa82ac612aca3afd67bb7487361d60638cdaa5b Mon Sep 17 00:00:00 2001 From: Ovahlord Date: Mon, 13 May 2019 00:44:24 +0200 Subject: [PATCH] Core/Spells: fixed Glyph of Lightning Shield --- .../custom/custom_2019_05_13_00_world.sql | 3 +++ src/server/scripts/Spells/spell_shaman.cpp | 24 ++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 sql/updates/world/custom/custom_2019_05_13_00_world.sql diff --git a/sql/updates/world/custom/custom_2019_05_13_00_world.sql b/sql/updates/world/custom/custom_2019_05_13_00_world.sql new file mode 100644 index 00000000000..2562df686d9 --- /dev/null +++ b/sql/updates/world/custom/custom_2019_05_13_00_world.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_sha_lightning_shield'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(324, 'spell_sha_lightning_shield'); diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index c42bcb984f6..5d338f78ecc 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -104,7 +104,8 @@ enum ShamanSpellIcons SHAMAN_ICON_ID_SHAMAN_LAVA_FLOW = 3087, SHAMAN_ICON_ID_CLEANSING_WATERS = 2020, SHAMAN_ICON_ID_BLESSING_OF_THE_ETERNALS = 3157, - SHAMAN_ICON_ID_FULMINATION = 2010 + SHAMAN_ICON_ID_FULMINATION = 2010, + SHAMAN_ICON_ID_GLYPH_OF_LIGHTNING_SHIELD = 19 }; enum MiscSpells @@ -2047,6 +2048,26 @@ class spell_sha_earthquake_damage : public SpellScript } }; +// 324 - Lightning Shield +class spell_sha_lightning_shield : public AuraScript +{ + PrepareAuraScript(spell_sha_lightning_shield); + + bool CheckProc(ProcEventInfo& /*eventInfo*/) + { + if (GetTarget()->GetDummyAuraEffect(SPELLFAMILY_SHAMAN, SHAMAN_ICON_ID_GLYPH_OF_LIGHTNING_SHIELD, EFFECT_0)) + if (GetCharges() == 3) + SetCharges(GetCharges() + 1); + + return true; + } + + void Register() override + { + DoCheckProc += AuraCheckProcFn(spell_sha_lightning_shield::CheckProc); + } +}; + void AddSC_shaman_spell_scripts() { new spell_sha_ancestral_awakening(); @@ -2082,6 +2103,7 @@ void AddSC_shaman_spell_scripts() new spell_sha_lava_lash(); new spell_sha_lava_surge(); new spell_sha_lava_surge_proc(); + RegisterAuraScript(spell_sha_lightning_shield); new spell_sha_mana_tide_totem(); new spell_sha_nature_guardian(); new spell_sha_resurgence();