aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/updates/world/2012_04_03_00_world_spell_script_names.sql3
-rw-r--r--src/server/scripts/Spells/spell_generic.cpp67
2 files changed, 51 insertions, 19 deletions
diff --git a/sql/updates/world/2012_04_03_00_world_spell_script_names.sql b/sql/updates/world/2012_04_03_00_world_spell_script_names.sql
new file mode 100644
index 00000000000..e296ed55d53
--- /dev/null
+++ b/sql/updates/world/2012_04_03_00_world_spell_script_names.sql
@@ -0,0 +1,3 @@
+DELETE FROM `spell_script_names` WHERE `spell_id` = 36444;
+INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
+(36444, 'spell_gen_wg_water'); \ No newline at end of file
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();
}