diff options
| author | Nayd <dnpd.dd@gmail.com> | 2015-02-02 02:06:48 +0000 |
|---|---|---|
| committer | Nayd <dnpd.dd@gmail.com> | 2015-02-02 02:06:48 +0000 |
| commit | 9d1e64159f4cc5ac418f9fb2cac5aeb29435586e (patch) | |
| tree | c23d1ed3ff70b16f597ac73dbd46243b79433fcb /src | |
| parent | 86f7f47b58e4e044cd9a9171d83863dd8f99d91c (diff) | |
(1) 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
(cherry picked from commit e8955cf6ddddd6953340c2ceeb3b5b4a98d57c90)
Conflicts:
sql/updates/world/2014_12_28_01_world.sql
(2) Scripts/Spells: Adding overrides Death Grip Initial.
Thanks @Goatform
(cherry picked from commit bb002803bc0cd0283db0873e9a12db43a82ca30b)
(3) Scripts/Spells: Move death grip from DB
Moves death grip from DB to spellscript for clarity and to reduce confusion in future.
(cherry picked from commit 77887ab32ff4d703dbc618b5cab364f02582c5e7)
Conflicts:
sql/updates/world/2014_12_28_03_world.sql
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/scripts/Spells/spell_dk.cpp | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index 65b25564401..7b2459ee1bf 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -46,6 +46,7 @@ enum DeathKnightSpells SPELL_DK_DEATH_COIL_BARRIER = 115635, SPELL_DK_DEATH_COIL_DAMAGE = 47632, SPELL_DK_DEATH_COIL_HEAL = 47633, + SPELL_DK_DEATH_GRIP = 49560, SPELL_DK_DEATH_STRIKE_HEAL = 45470, SPELL_DK_ENHANCED_DEATH_COIL = 157343, SPELL_DK_FROST_FEVER = 55095, @@ -1119,6 +1120,50 @@ 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 HandleDummy(SpellEffIndex /*effIndex*/) + { + GetCaster()->CastSpell(GetHitUnit(), SPELL_DK_DEATH_GRIP, true); + } + + void Register() override + { + OnCheckCast += SpellCheckCastFn(spell_dk_death_grip_initial_SpellScript::CheckCast); + OnEffectHitTarget += SpellEffectFn(spell_dk_death_grip_initial_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const override + { + return new spell_dk_death_grip_initial_SpellScript(); + } +}; + void AddSC_deathknight_spell_scripts() { new spell_dk_anti_magic_shell(); @@ -1143,4 +1188,5 @@ void AddSC_deathknight_spell_scripts() new spell_dk_unholy_blight(); new spell_dk_vampiric_blood(); new spell_dk_will_of_the_necropolis(); + new spell_dk_death_grip_initial(); } |
