diff options
| author | Vincent-Michael <Vincent_Michael@gmx.de> | 2012-05-15 12:41:00 +0200 |
|---|---|---|
| committer | Vincent-Michael <Vincent_Michael@gmx.de> | 2012-05-15 12:41:00 +0200 |
| commit | 68bfe8c831c107ccdd43475ed2a89b7848b6ab32 (patch) | |
| tree | a6742a1cbcc399a34a4cc4c51991bbcb08b3ec4b | |
| parent | b72c690905d6dc650b6322c0054cd3faa85c80ea (diff) | |
Core/Spell: Fix not using Shadowstep while rooted
| -rw-r--r-- | sql/updates/world/2012_05_15_00_world_spell_script_names.sql | 3 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_rogue.cpp | 29 |
2 files changed, 32 insertions, 0 deletions
diff --git a/sql/updates/world/2012_05_15_00_world_spell_script_names.sql b/sql/updates/world/2012_05_15_00_world_spell_script_names.sql new file mode 100644 index 00000000000..980aceff519 --- /dev/null +++ b/sql/updates/world/2012_05_15_00_world_spell_script_names.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `spell_id`=36554; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(36554,'spell_rog_shadowstep'); diff --git a/src/server/scripts/Spells/spell_rogue.cpp b/src/server/scripts/Spells/spell_rogue.cpp index 3a4132f62fe..a315f867e34 100644 --- a/src/server/scripts/Spells/spell_rogue.cpp +++ b/src/server/scripts/Spells/spell_rogue.cpp @@ -386,6 +386,34 @@ class spell_rog_deadly_poison : public SpellScriptLoader } }; +class spell_rog_shadowstep : public SpellScriptLoader +{ + public: + spell_rog_shadowstep() : SpellScriptLoader("spell_rog_shadowstep") { } + + class spell_rog_shadowstep_SpellScript : public SpellScript + { + PrepareSpellScript(spell_rog_shadowstep_SpellScript); + + SpellCastResult CheckCast() + { + if (GetCaster()->HasUnitState(UNIT_STATE_ROOT)) + return SPELL_FAILED_ROOTED; + return SPELL_CAST_OK; + } + + void Register() + { + OnCheckCast += SpellCheckCastFn(spell_rog_shadowstep_SpellScript::CheckCast); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_rog_shadowstep_SpellScript(); + } +}; + void AddSC_rogue_spell_scripts() { new spell_rog_cheat_death(); @@ -394,4 +422,5 @@ void AddSC_rogue_spell_scripts() new spell_rog_prey_on_the_weak(); new spell_rog_shiv(); new spell_rog_deadly_poison(); + new spell_rog_shadowstep(); } |
