From 9d1e64159f4cc5ac418f9fb2cac5aeb29435586e Mon Sep 17 00:00:00 2001 From: Nayd Date: Mon, 2 Feb 2015 02:06:48 +0000 Subject: (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 --- src/server/scripts/Spells/spell_dk.cpp | 46 ++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) (limited to 'src/server/scripts/Spells') 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(); } -- cgit v1.2.3