diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server/scripts/Spells/spell_generic.cpp | 67 |
1 files changed, 48 insertions, 19 deletions
diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 929206dec05..41d1c24c517 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -1234,30 +1234,30 @@ class spell_gen_magic_rooster : public SpellScriptLoader class spell_gen_allow_cast_from_item_only : public SpellScriptLoader { -public: - spell_gen_allow_cast_from_item_only() : SpellScriptLoader("spell_gen_allow_cast_from_item_only") { } - - class spell_gen_allow_cast_from_item_only_SpellScript : public SpellScript - { - PrepareSpellScript(spell_gen_allow_cast_from_item_only_SpellScript); + public: + spell_gen_allow_cast_from_item_only() : SpellScriptLoader("spell_gen_allow_cast_from_item_only") { } - SpellCastResult CheckRequirement() + class spell_gen_allow_cast_from_item_only_SpellScript : public SpellScript { - if (!GetCastItem()) - return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW; - return SPELL_CAST_OK; - } + PrepareSpellScript(spell_gen_allow_cast_from_item_only_SpellScript); - void Register() + SpellCastResult CheckRequirement() + { + if (!GetCastItem()) + return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW; + return SPELL_CAST_OK; + } + + void Register() + { + OnCheckCast += SpellCheckCastFn(spell_gen_allow_cast_from_item_only_SpellScript::CheckRequirement); + } + }; + + SpellScript* GetSpellScript() const { - OnCheckCast += SpellCheckCastFn(spell_gen_allow_cast_from_item_only_SpellScript::CheckRequirement); + return new spell_gen_allow_cast_from_item_only_SpellScript(); } - }; - - SpellScript* GetSpellScript() const - { - return new spell_gen_allow_cast_from_item_only_SpellScript(); - } }; enum Launch @@ -2590,6 +2590,34 @@ class spell_gen_ds_flush_knockback : public SpellScriptLoader } }; +class spell_gen_wg_water : public SpellScriptLoader +{ + public: + spell_gen_wg_water() : SpellScriptLoader("spell_gen_wg_water") {} + + class spell_gen_wg_water_SpellScript : public SpellScript + { + PrepareSpellScript(spell_gen_wg_water_SpellScript); + + SpellCastResult CheckCast() + { + if (!GetSpellInfo()->CheckTargetCreatureType(GetTargetUnit())) + return SPELL_FAILED_DONT_REPORT; + return SPELL_CAST_OK; + } + + void Register() + { + OnCheckCast += SpellCheckCastFn(spell_gen_wg_water_SpellScript::CheckCast); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_gen_wg_water_SpellScript(); + } +}; + void AddSC_generic_spell_scripts() { new spell_gen_absorb0_hitlimit1(); @@ -2640,4 +2668,5 @@ void AddSC_generic_spell_scripts() new spell_gen_tournament_pennant(); new spell_gen_chaos_blast(); new spell_gen_ds_flush_knockback(); + new spell_gen_wg_water(); } |