diff --git a/data/sql/updates/pending_db_world/rev_1661691696095705000.sql b/data/sql/updates/pending_db_world/rev_1661691696095705000.sql new file mode 100644 index 000000000..5260f4cc3 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1661691696095705000.sql @@ -0,0 +1,4 @@ +-- +DELETE FROM `spell_script_names` WHERE `spell_id`=21848; +INSERT INTO `spell_script_names` VALUES +(21848,'spell_item_snowman'); diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index 3c2984212..9eeaeb14e 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -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); }