fix(Scripts/Item): Winter Veil Disguise Kit cannot be used during pre… (#12883)

...paration phase.
This commit is contained in:
UltraNix
2022-09-07 02:38:50 +02:00
committed by GitHub
parent e13dfb8d32
commit 0ae93c1c94
2 changed files with 31 additions and 0 deletions

View File

@@ -3676,6 +3676,32 @@ class spell_item_mirrens_drinking_hat : public SpellScript
}
};
class spell_item_snowman : public SpellScript
{
PrepareSpellScript(spell_item_snowman);
SpellCastResult CheckCast()
{
if (Player* caster = GetCaster()->ToPlayer())
{
if (Battleground* bg = caster->GetBattleground())
{
if (bg->GetStatus() == STATUS_WAIT_JOIN)
{
return SPELL_FAILED_NOT_READY;
}
}
}
return SPELL_CAST_OK;
}
void Register() override
{
OnCheckCast += SpellCheckCastFn(spell_item_snowman::CheckCast);
}
};
void AddSC_item_spell_scripts()
{
RegisterSpellScript(spell_item_massive_seaforium_charge);
@@ -3789,4 +3815,5 @@ void AddSC_item_spell_scripts()
RegisterSpellScript(spell_item_recall);
RegisterSpellScript(spell_item_wraith_scythe_drain_life);
RegisterSpellScript(spell_item_mirrens_drinking_hat);
RegisterSpellScript(spell_item_snowman);
}