fix(Core/Scripts): Fix Shifting Naaru Sliver not applying Limitless Power (#24952)

Co-authored-by: blinkysc <blinkysc@users.noreply.github.com>
This commit is contained in:
blinkysc
2026-03-01 10:51:07 -06:00
committed by GitHub
parent ce643ce1ca
commit 52872c743f

View File

@@ -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);
}
};