From 7ae4b85c43d7cc5909e3778f5f76833c960250e7 Mon Sep 17 00:00:00 2001 From: Skjalf <47818697+Nyeriah@users.noreply.github.com> Date: Sun, 18 Jun 2023 11:54:05 -0300 Subject: [PATCH] =?UTF-8?q?fix(Scripts/HellfireRamparts):=20Fix=20Gargolma?= =?UTF-8?q?r=20Retalliation=20procs=20with=20=E2=80=A6=20(#16585)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix(Scripts/HellfireRamparts): Fix Gargolmar Retalliation procs with targets behind him --- .../rev_1687098356342753500.sql | 4 ++++ .../boss_watchkeeper_gargolmar.cpp | 21 +++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1687098356342753500.sql diff --git a/data/sql/updates/pending_db_world/rev_1687098356342753500.sql b/data/sql/updates/pending_db_world/rev_1687098356342753500.sql new file mode 100644 index 000000000..fe07a55ef --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1687098356342753500.sql @@ -0,0 +1,4 @@ +-- +DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_gargolmar_retalliation' AND `spell_id` = 22857; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(22857, 'spell_gargolmar_retalliation'); diff --git a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_watchkeeper_gargolmar.cpp b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_watchkeeper_gargolmar.cpp index 4718cc6fb..91a59b4f6 100644 --- a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_watchkeeper_gargolmar.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_watchkeeper_gargolmar.cpp @@ -144,7 +144,28 @@ private: }; +class spell_gargolmar_retalliation : public AuraScript +{ + PrepareAuraScript(spell_gargolmar_retalliation); + + bool CheckProc(ProcEventInfo& eventInfo) + { + if (!eventInfo.GetActor() || !eventInfo.GetProcTarget()) + { + return false; + } + + return GetTarget()->isInFront(eventInfo.GetActor(), M_PI); + } + + void Register() override + { + DoCheckProc += AuraCheckProcFn(spell_gargolmar_retalliation::CheckProc); + } +}; + void AddSC_boss_watchkeeper_gargolmar() { RegisterHellfireRampartsCreatureAI(boss_watchkeeper_gargolmar); + RegisterSpellScript(spell_gargolmar_retalliation); }