From 52872c743fbe240b7d4e1bc9140b1d63c0efdcf0 Mon Sep 17 00:00:00 2001 From: blinkysc <37940565+blinkysc@users.noreply.github.com> Date: Sun, 1 Mar 2026 10:51:07 -0600 Subject: [PATCH] fix(Core/Scripts): Fix Shifting Naaru Sliver not applying Limitless Power (#24952) Co-authored-by: blinkysc --- src/server/scripts/Spells/spell_item.cpp | 45 +++++++++--------------- 1 file changed, 16 insertions(+), 29 deletions(-) diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index 6c14b0563..a94ee8382 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -655,23 +655,11 @@ class spell_item_lil_phylactery : public AuraScript } }; +// 45042 - Power Circle (Shifting Naaru Sliver base aura) class spell_item_shifting_naaru_silver : public AuraScript { PrepareAuraScript(spell_item_shifting_naaru_silver); - void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) - { - if (GetTarget() == GetCaster()) - if (Aura* aur = GetTarget()->AddAura(45044 /*Limitless Power*/, GetTarget())) - aur->SetDuration(GetDuration()); - } - - void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) - { - if (Aura* aur = GetTarget()->GetAura(45044 /*Limitless Power*/, GetTarget()->GetGUID())) - aur->SetDuration(0); - } - void OnBaseRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { GetUnitOwner()->RemoveDynObject(45043); @@ -679,13 +667,7 @@ class spell_item_shifting_naaru_silver : public AuraScript void Register() override { - if (m_scriptSpellId == 45043) - { - OnEffectApply += AuraEffectApplyFn(spell_item_shifting_naaru_silver::OnApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); - AfterEffectRemove += AuraEffectRemoveFn(spell_item_shifting_naaru_silver::OnRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); - } - else - AfterEffectRemove += AuraEffectRemoveFn(spell_item_shifting_naaru_silver::OnBaseRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + AfterEffectRemove += AuraEffectRemoveFn(spell_item_shifting_naaru_silver::OnBaseRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); } }; @@ -4879,7 +4861,7 @@ class spell_item_ultrasafe_transporter : public SpellScript } }; -// 45043 - Power Circle (Mage T5 Set Bonus) +// 45043 - Power Circle (Shifting Naaru Sliver) class spell_item_power_circle : public AuraScript { PrepareAuraScript(spell_item_power_circle); @@ -4889,23 +4871,28 @@ class spell_item_power_circle : public AuraScript return ValidateSpellInfo({ SPELL_LIMITLESS_POWER }); } - void OnAuraInit() + bool CheckCaster(Unit* target) { - Unit* caster = GetCaster(); - if (!caster) - return; - - caster->CastSpell(caster, SPELL_LIMITLESS_POWER, true); + return target->GetGUID() == GetCasterGUID(); } - void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + GetTarget()->CastSpell(GetTarget(), SPELL_LIMITLESS_POWER, true); + if (Aura* buff = GetTarget()->GetAura(SPELL_LIMITLESS_POWER)) + buff->SetDuration(GetDuration()); + } + + void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { GetTarget()->RemoveAurasDueToSpell(SPELL_LIMITLESS_POWER); } void Register() override { - AfterEffectRemove += AuraEffectRemoveFn(spell_item_power_circle::HandleRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + DoCheckAreaTarget += AuraCheckAreaTargetFn(spell_item_power_circle::CheckCaster); + AfterEffectApply += AuraEffectApplyFn(spell_item_power_circle::OnApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + AfterEffectRemove += AuraEffectRemoveFn(spell_item_power_circle::OnRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); } };