From 108eeea327b50a157c503da42b05b59003a1ffac Mon Sep 17 00:00:00 2001 From: aquadeus <95978183+aquadeus@users.noreply.github.com> Date: Tue, 28 Dec 2021 21:18:50 +0100 Subject: [PATCH] Scripts/Spells: Fix shaman talent Nature's Guardian proc (#27482) --- ...1_12_28_01_world_shaman_natures_guardian.sql | 3 +++ src/server/scripts/Spells/spell_shaman.cpp | 17 +++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 sql/updates/world/master/2021_12_28_01_world_shaman_natures_guardian.sql diff --git a/sql/updates/world/master/2021_12_28_01_world_shaman_natures_guardian.sql b/sql/updates/world/master/2021_12_28_01_world_shaman_natures_guardian.sql new file mode 100644 index 00000000000..6e40c3bd439 --- /dev/null +++ b/sql/updates/world/master/2021_12_28_01_world_shaman_natures_guardian.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_sha_natures_guardian'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(30884, 'spell_sha_natures_guardian'); diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index 77d2b665bb4..830c275bfd4 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -1002,6 +1002,22 @@ class spell_sha_liquid_magma_totem : public SpellScript } }; +// 30884 - Nature's Guardian +class spell_sha_natures_guardian : public AuraScript +{ + PrepareAuraScript(spell_sha_natures_guardian); + + bool CheckProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + return eventInfo.GetActionTarget()->HealthBelowPct(aurEff->GetAmount()); + } + + void Register() override + { + DoCheckEffectProc += AuraCheckEffectProcFn(spell_sha_natures_guardian::CheckProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL); + } +}; + // 210621 - Path of Flames Spread class spell_sha_path_of_flames_spread : public SpellScript { @@ -1392,6 +1408,7 @@ void AddSC_shaman_spell_scripts() RegisterSpellScript(spell_sha_lightning_bolt); RegisterSpellScript(spell_sha_lightning_bolt_overload); RegisterSpellScript(spell_sha_liquid_magma_totem); + RegisterAuraScript(spell_sha_natures_guardian); RegisterSpellScript(spell_sha_path_of_flames_spread); RegisterAuraScript(spell_sha_tidal_waves); RegisterAuraScript(spell_sha_t3_6p_bonus);