fix(Core/Scripts): ScriptEffect Frog Kiss (#17482)

This commit is contained in:
avarishd
2023-10-21 15:15:20 +03:00
committed by GitHub
parent b281988dbc
commit 228f6635c0
2 changed files with 33 additions and 1 deletions

View File

@@ -918,7 +918,8 @@ public:
player->AddAura(SPELL_WARTS, player);
else
{
DoCast(player, SPELL_FROG_KISS); // Removes SPELL_WARTSBGONE_LIP_BALM
// Removes SPELL_WARTSBGONE_LIP_BALM
player->CastSpell(player, SPELL_FROG_KISS, true);
if (me->GetEntry() == NPC_LAKE_FROG)
{
@@ -1298,6 +1299,30 @@ public:
}
};
// 62536 - Frog Kiss
class spell_frog_kiss : public SpellScript
{
PrepareSpellScript(spell_frog_kiss);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_WARTSBGONE_LIP_BALM });
}
void HandleScript(SpellEffIndex /*effIndex*/)
{
if (Player* target = GetHitPlayer())
{
target->RemoveAurasDueToSpell(SPELL_WARTSBGONE_LIP_BALM);
}
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_frog_kiss::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
void AddSC_grizzly_hills()
{
// Theirs
@@ -1319,4 +1344,5 @@ void AddSC_grizzly_hills()
new spell_warhead_fuse();
RegisterSpellScript(spell_q12227_outhouse_groans);
RegisterSpellScript(spell_q12227_camera_shake);
RegisterSpellScript(spell_frog_kiss);
}