(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 e8955cf6dd)

Conflicts:
	sql/updates/world/2014_12_28_01_world.sql

(2) Scripts/Spells: Adding overrides Death Grip Initial.

Thanks @Goatform
(cherry picked from commit bb002803bc)

(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 77887ab32f)

Conflicts:
	sql/updates/world/2014_12_28_03_world.sql
This commit is contained in:
Nayd
2015-02-02 02:06:48 +00:00
parent 86f7f47b58
commit 9d1e64159f
2 changed files with 51 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
DELETE FROM `spell_script_names` WHERE `spell_id`=49576;
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(49576, 'spell_dk_death_grip_initial');
DELETE FROM `spell_linked_spell` WHERE `spell_trigger` = 49576;

View File

@@ -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();
}