fix(Core/Spells): Script Scourge Banner (#17523)

* fix(Core/Spells): Script Scourge Banner

* correct statecheck
This commit is contained in:
avarishd
2023-10-17 00:13:54 +03:00
committed by GitHub
parent bac4a67c0c
commit e30718db36
2 changed files with 28 additions and 0 deletions

View File

@@ -5023,6 +5023,30 @@ class spell_gen_valthalak_amulet : public SpellScript
}
};
enum ScourgeBanner
{
GO_COMMAND_TENT = 176210,
};
class spell_gen_planting_scourge_banner : public SpellScript
{
PrepareSpellScript(spell_gen_planting_scourge_banner)
SpellCastResult CheckCast()
{
if (GameObject* tent = GetCaster()->FindNearestGameObject(GO_COMMAND_TENT, 20.0f))
if (tent->GetGoState() != GO_STATE_READY) // If tent is burned down
return SPELL_CAST_OK;
return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW;
}
void Register() override
{
OnCheckCast += SpellCheckCastFn(spell_gen_planting_scourge_banner::CheckCast);
}
};
void AddSC_generic_spell_scripts()
{
RegisterSpellScript(spell_silithyst);
@@ -5172,4 +5196,5 @@ void AddSC_generic_spell_scripts()
RegisterSpellScript(spell_gen_spirit_of_competition_participant);
RegisterSpellScript(spell_gen_spirit_of_competition_winner);
RegisterSpellScript(spell_gen_valthalak_amulet);
RegisterSpellScript(spell_gen_planting_scourge_banner);
}