From 1a137dadde3ca9cb6499523321408f93a772149c Mon Sep 17 00:00:00 2001 From: Kitzunu <24550914+Kitzunu@users.noreply.github.com> Date: Wed, 10 Feb 2021 23:53:30 +0100 Subject: [PATCH] fix(Core/Script): Startup error in spell_bwl_shadowflame (#4474) --- .../BlackwingLair/instance_blackwing_lair.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/instance_blackwing_lair.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/instance_blackwing_lair.cpp index 2e8eb0614..5d0d81777 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/instance_blackwing_lair.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/instance_blackwing_lair.cpp @@ -287,6 +287,12 @@ public: } }; +enum ShadowFlame +{ + SPELL_ONYXIA_SCALE_CLOAK = 22683, + SPELL_SHADOW_FLAME_DOT = 22682 +}; + // 22539 - Shadowflame (used in Blackwing Lair) class spell_bwl_shadowflame : public SpellScriptLoader { @@ -297,17 +303,22 @@ public: { PrepareSpellScript(spell_bwl_shadowflame_SpellScript); + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_ONYXIA_SCALE_CLOAK, SPELL_SHADOW_FLAME_DOT }); + } + void HandleEffectScriptEffect(SpellEffIndex /*effIndex*/) { // If the victim of the spell does not have "Onyxia Scale Cloak" - add the Shadow Flame DoT (22682) if (Unit* victim = GetHitUnit()) - if(!victim->HasAura(22683)) - victim->AddAura(22682, victim); + if (!victim->HasAura(SPELL_ONYXIA_SCALE_CLOAK)) + victim->AddAura(SPELL_SHADOW_FLAME_DOT, victim); } - void Register() + void Register() override { - OnEffectHitTarget += SpellEffectFn(spell_bwl_shadowflame_SpellScript::HandleEffectScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + OnEffectHitTarget += SpellEffectFn(spell_bwl_shadowflame_SpellScript::HandleEffectScriptEffect, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE); } };