mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-14 09:39:11 +00:00
fix(Core/Spells): Script Scourge Banner (#17523)
* fix(Core/Spells): Script Scourge Banner * correct statecheck
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user