mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 18:36:31 +01:00
(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 commite8955cf6dd) Conflicts: sql/updates/world/2014_12_28_01_world.sql (2) Scripts/Spells: Adding overrides Death Grip Initial. Thanks @Goatform (cherry picked from commitbb002803bc) (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 commit77887ab32f) Conflicts: sql/updates/world/2014_12_28_03_world.sql
This commit is contained in:
5
sql/updates/world/2015_02_02_00_world.sql
Normal file
5
sql/updates/world/2015_02_02_00_world.sql
Normal 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;
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user