From 82db30868b18bc47cc035b616d1fd86d9d90e222 Mon Sep 17 00:00:00 2001 From: Andrew <47818697+Nyeriah@users.noreply.github.com> Date: Mon, 19 Aug 2024 23:17:17 -0300 Subject: [PATCH] fix(Scripts/BlackTemple): Fatal Attraction (#19641) * Fix it not being cast if no valid targets are available * Apply Patch 2.2 nerfs --- .../rev_1723778762924716800.sql | 2 + .../BlackTemple/boss_mother_shahraz.cpp | 39 ++++++------------- 2 files changed, 13 insertions(+), 28 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1723778762924716800.sql diff --git a/data/sql/updates/pending_db_world/rev_1723778762924716800.sql b/data/sql/updates/pending_db_world/rev_1723778762924716800.sql new file mode 100644 index 000000000..96e26fafd --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1723778762924716800.sql @@ -0,0 +1,2 @@ +-- +DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_mother_shahraz_fatal_attraction_aura'; diff --git a/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp b/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp index 634699d89..043e71ebc 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp @@ -208,8 +208,6 @@ class spell_mother_shahraz_fatal_attraction : public SpellScript void FilterTargets(std::list& targets) { targets.remove_if(Acore::UnitAuraCheck(true, SPELL_SABER_LASH_IMMUNITY)); - if (targets.size() <= 1) - FinishCast(SPELL_FAILED_DONT_REPORT); } void SetDest(SpellDestination& dest) @@ -249,12 +247,17 @@ class spell_mother_shahraz_fatal_attraction_dummy : public SpellScript void HandleDummy(SpellEffIndex /*effIndex*/) { - if (Unit* target = GetHitUnit()) - { - target->CastSpell(target, SPELL_FATAL_ATTRACTION_DAMAGE, true); - if (AuraEffect* aurEff = target->GetAuraEffect(SPELL_FATAL_ATTRACTION_AURA, EFFECT_1)) - aurEff->SetAmount(aurEff->GetTickNumber()); - } + if (Unit* caster = GetCaster()) + if (AuraEffect* aurEff = caster->GetAuraEffect(SPELL_FATAL_ATTRACTION_AURA, EFFECT_1)) + { + if (aurEff->GetTickNumber() <= 2) + { + int32 damage = 1000 * aurEff->GetTickNumber(); + caster->CastCustomSpell(caster, SPELL_FATAL_ATTRACTION_DAMAGE, &damage, 0, 0, true); + } + else + caster->CastSpell(caster, SPELL_FATAL_ATTRACTION_DAMAGE, true); + } } void Register() override @@ -263,25 +266,6 @@ class spell_mother_shahraz_fatal_attraction_dummy : public SpellScript } }; -class spell_mother_shahraz_fatal_attraction_aura : public AuraScript -{ - PrepareAuraScript(spell_mother_shahraz_fatal_attraction_aura); - - void Update(AuraEffect const* effect) - { - if (effect->GetTickNumber() > uint32(effect->GetAmount() + 1)) - { - PreventDefaultAction(); - SetDuration(0); - } - } - - void Register() override - { - OnEffectPeriodic += AuraEffectPeriodicFn(spell_mother_shahraz_fatal_attraction_aura::Update, EFFECT_1, SPELL_AURA_PERIODIC_TRIGGER_SPELL); - } -}; - void AddSC_boss_mother_shahraz() { RegisterBlackTempleCreatureAI(boss_mother_shahraz); @@ -290,6 +274,5 @@ void AddSC_boss_mother_shahraz() RegisterSpellScript(spell_mother_shahraz_saber_lash_aura); RegisterSpellScript(spell_mother_shahraz_fatal_attraction); RegisterSpellScript(spell_mother_shahraz_fatal_attraction_dummy); - RegisterSpellScript(spell_mother_shahraz_fatal_attraction_aura); }