From d05929b862cbf6002797e96f241928fed1105741 Mon Sep 17 00:00:00 2001 From: avarishd <46330494+avarishd@users.noreply.github.com> Date: Sat, 18 Nov 2023 15:18:10 +0200 Subject: [PATCH] fix(Scripts/ShadowLabs): Script Mark of Malice (#17773) --- .../rev_1700298804472938000.sql | 3 ++ .../instance_shadow_labyrinth.cpp | 33 +++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1700298804472938000.sql diff --git a/data/sql/updates/pending_db_world/rev_1700298804472938000.sql b/data/sql/updates/pending_db_world/rev_1700298804472938000.sql new file mode 100644 index 000000000..760e0095e --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1700298804472938000.sql @@ -0,0 +1,3 @@ +-- Mark of Malice +DELETE FROM `spell_script_names` WHERE `spell_id`=33493 AND `ScriptName`='spell_mark_of_malice'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES (33493, 'spell_mark_of_malice'); diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/instance_shadow_labyrinth.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/instance_shadow_labyrinth.cpp index ec49b1d16..ebef16e7b 100644 --- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/instance_shadow_labyrinth.cpp +++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/instance_shadow_labyrinth.cpp @@ -99,7 +99,40 @@ public: }; }; +// 33493 - Mark of Malice +enum MarkOfMalice +{ + SPELL_MARK_OF_MALICE_TRIGGERED = 33494 +}; + +class spell_mark_of_malice : public AuraScript +{ + PrepareAuraScript(spell_mark_of_malice); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_MARK_OF_MALICE_TRIGGERED }); + } + + void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& /*eventInfo*/) + { + PreventDefaultAction(); + if (GetCharges() > 1) + { + return; + } + + GetTarget()->CastSpell(GetTarget(), SPELL_MARK_OF_MALICE_TRIGGERED, true); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_mark_of_malice::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } +}; + void AddSC_instance_shadow_labyrinth() { new instance_shadow_labyrinth(); + RegisterSpellScript(spell_mark_of_malice); }