From 121d35b1551795dff67bd43984efbee43b1acd15 Mon Sep 17 00:00:00 2001 From: Andrew <47818697+Nyeriah@users.noreply.github.com> Date: Thu, 24 Oct 2024 06:41:48 -0300 Subject: [PATCH] fix(Scripts/BlackTemple): Apply Shadow Prison spell immunities (#20272) * fix(Scripts/BlackTemple): Apply Shadow Prison spell immunities * Delete rev_1729660470785757300.sql --- .../Outland/BlackTemple/boss_illidan.cpp | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp index c40ea1c5d..4c8ef364b 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp @@ -1524,6 +1524,27 @@ class spell_illidan_shadow_prison : public SpellScript } }; +class spell_illidan_shadow_prison_aura : public AuraScript +{ + PrepareAuraScript(spell_illidan_shadow_prison_aura); + + void HandleOnEffectApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) + { + GetTarget()->ApplySpellImmune(GetId(), IMMUNITY_SCHOOL, aurEff->GetMiscValue(), true); + } + + void HandleOnEffectRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) + { + GetTarget()->ApplySpellImmune(GetId(), IMMUNITY_SCHOOL, aurEff->GetMiscValue(), false); + } + + void Register() override + { + OnEffectApply += AuraEffectApplyFn(spell_illidan_shadow_prison_aura::HandleOnEffectApply, EFFECT_1, SPELL_AURA_DAMAGE_IMMUNITY, AURA_EFFECT_HANDLE_REAL); + OnEffectRemove += AuraEffectRemoveFn(spell_illidan_shadow_prison_aura::HandleOnEffectRemove, EFFECT_1, SPELL_AURA_DAMAGE_IMMUNITY, AURA_EFFECT_HANDLE_REAL); + } +}; + class spell_illidan_demon_transform1_aura : public AuraScript { PrepareAuraScript(spell_illidan_demon_transform1_aura); @@ -1714,7 +1735,7 @@ void AddSC_boss_illidan() RegisterSpellAndAuraScriptPair(spell_illidan_parasitic_shadowfiend_trigger, spell_illidan_parasitic_shadowfiend_trigger_aura); RegisterSpellScript(spell_illidan_glaive_throw); RegisterSpellScript(spell_illidan_tear_of_azzinoth_summon_channel_aura); - RegisterSpellScript(spell_illidan_shadow_prison); + RegisterSpellAndAuraScriptPair(spell_illidan_shadow_prison, spell_illidan_shadow_prison_aura); RegisterSpellScript(spell_illidan_demon_transform1_aura); RegisterSpellScript(spell_illidan_demon_transform2_aura); RegisterSpellScript(spell_illidan_flame_burst);