diff options
| author | Natureknight <vallez8244@gmail.com> | 2014-12-28 16:54:41 +0000 |
|---|---|---|
| committer | Nayd <dnpd.dd@gmail.com> | 2014-12-28 16:54:41 +0000 |
| commit | e8955cf6ddddd6953340c2ceeb3b5b4a98d57c90 (patch) | |
| tree | 4cddd8b111e81db7bce6324026f581d305456b33 /src | |
| parent | 32d9a71a4219ea353950979a2491e7879b7fa79a (diff) | |
Scripts/Spells: Death Grip should not be castable while jumping/falling and should have 8-30 yards range in PvP instead of 0-30 yards
Closes #13499
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/scripts/Spells/spell_dk.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index 929ffe60364..b007dcddc03 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -1644,6 +1644,44 @@ class spell_dk_will_of_the_necropolis : public SpellScriptLoader } }; +// 49576 - Death Grip Initial +class spell_dk_death_grip_initial : public SpellScriptLoader +{ +public: + spell_dk_death_grip_initial() : SpellScriptLoader("spell_dk_death_grip_initial") { } + + class spell_dk_death_grip_initial_SpellScript : public SpellScript + { + PrepareSpellScript(spell_dk_death_grip_initial_SpellScript); + + SpellCastResult CheckCast() + { + Unit* caster = GetCaster(); + // Death Grip should not be castable while jumping/falling + if (caster->HasUnitState(UNIT_STATE_JUMPING) || caster->HasUnitMovementFlag(MOVEMENTFLAG_FALLING)) + return SPELL_FAILED_MOVING; + + // Patch 3.3.3 (2010-03-23): Minimum range has been changed to 8 yards in PvP. + Unit* target = GetExplTargetUnit(); + if (target && target->GetTypeId() == TYPEID_PLAYER) + if (caster->GetDistance(target) < 8.f) + return SPELL_FAILED_TOO_CLOSE; + + return SPELL_CAST_OK; + } + + void Register() + { + OnCheckCast += SpellCheckCastFn(spell_dk_death_grip_initial_SpellScript::CheckCast); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_dk_death_grip_initial_SpellScript(); + } +}; + void AddSC_deathknight_spell_scripts() { new spell_dk_anti_magic_shell_raid(); @@ -1673,4 +1711,5 @@ void AddSC_deathknight_spell_scripts() new spell_dk_spell_deflection(); new spell_dk_vampiric_blood(); new spell_dk_will_of_the_necropolis(); + new spell_dk_death_grip_initial(); } |
