fix(Scripts/Spells): Properly handle spellclick flag for Lightwell. (#12505)

This commit is contained in:
UltraNix
2022-08-01 22:13:27 +02:00
committed by GitHub
parent 2809d68b1d
commit 7327a55b05

View File

@@ -428,9 +428,26 @@ class spell_pri_lightwell_renew : public AuraScript
}
}
void HandleUpdateSpellclick(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (Unit* caster = GetCaster())
{
if (Player* player = GetTarget()->ToPlayer())
{
UpdateData data;
WorldPacket packet;
caster->BuildValuesUpdateBlockForPlayer(&data, player);
data.BuildPacket(&packet);
player->SendDirectMessage(&packet);
}
}
}
void Register() override
{
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_pri_lightwell_renew::CalculateAmount, EFFECT_0, SPELL_AURA_PERIODIC_HEAL);
AfterEffectApply += AuraEffectApplyFn(spell_pri_lightwell_renew::HandleUpdateSpellclick, EFFECT_0, SPELL_AURA_PERIODIC_HEAL, AURA_EFFECT_HANDLE_REAL);
AfterEffectRemove += AuraEffectRemoveFn(spell_pri_lightwell_renew::HandleUpdateSpellclick, EFFECT_0, SPELL_AURA_PERIODIC_HEAL, AURA_EFFECT_HANDLE_REAL);
}
};