From 0e9fb5946b9e7bc1ef3bc86ab50367a30b85d78d Mon Sep 17 00:00:00 2001 From: Andrew <47818697+Nyeriah@users.noreply.github.com> Date: Mon, 23 Sep 2024 10:21:30 -0300 Subject: [PATCH] =?UTF-8?q?fix(Scripts/BlackTemple):=20Fix=20Fatal=20Attra?= =?UTF-8?q?ction=20not=20being=20removed=20if=20t=E2=80=A6=20(#20021)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix(Scripts/BlackTemple): Fix Fatal Attraction not being removed if targets move apart --- .../scripts/Outland/BlackTemple/boss_mother_shahraz.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp b/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp index 830447c8d..31bf70168 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp @@ -235,7 +235,13 @@ class spell_mother_shahraz_fatal_attraction_dummy : public SpellScript bool Validate(SpellInfo const* /*spellInfo*/) override { - return ValidateSpellInfo({ SPELL_FATAL_ATTRACTION_DAMAGE }); + return ValidateSpellInfo({ SPELL_FATAL_ATTRACTION_DAMAGE, SPELL_FATAL_ATTRACTION_AURA }); + } + + void FilterTargets(std::list& targets) + { + if (targets.empty()) + GetCaster()->RemoveAurasDueToSpell(SPELL_FATAL_ATTRACTION_AURA); } void HandleDummy(SpellEffIndex /*effIndex*/) @@ -255,6 +261,7 @@ class spell_mother_shahraz_fatal_attraction_dummy : public SpellScript void Register() override { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_mother_shahraz_fatal_attraction_dummy::FilterTargets, EFFECT_ALL, TARGET_UNIT_SRC_AREA_ALLY); OnEffectHitTarget += SpellEffectFn(spell_mother_shahraz_fatal_attraction_dummy::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } };