Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Core/Spells: fix wintergrasp water being applied to players. small co…

…destyle fix
  • Loading branch information...
commit cce8b56a2671b8c5655f45f58d5d877a6fdd60e9 1 parent d9451ce
@kandera kandera authored
View
3  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');
View
67 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();
}

4 comments on commit cce8b56

@Toshik

Can't it be done more generic way, instead of specific spell script?
Conditions, for example?

@kandera

no. currently we dont check creature types for spells cast on the caster. i need @QAston to not be away so i can figure out why this was for

@Vincent-Michael
Collaborator

is hack :-/

@kandera

nope. currently this is the only spell that does this and there is NO other way to get it working without breaking everything. once @QAston gets back we can figure out a better way to solve this

Please sign in to comment.
Something went wrong with that request. Please try again.