mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 01:08:35 +00:00
Added more checks to death grip
This commit is contained in:
@@ -1545,12 +1545,16 @@ class spell_dk_death_grip : public SpellScriptLoader
|
||||
{
|
||||
PrepareSpellScript(spell_dk_death_grip_SpellScript);
|
||||
|
||||
SpellCastResult CheckPvPRange()
|
||||
SpellCastResult CheckCast()
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
if (Unit* target = GetExplTargetUnit())
|
||||
if (target->GetTypeId() == TYPEID_PLAYER && caster->GetExactDist(target) < 8.0f) // xinef: should be 8.0f, but we have to add target size (1.5f)
|
||||
return SPELL_FAILED_TOO_CLOSE;
|
||||
Unit* target = GetExplTargetUnit();
|
||||
|
||||
if (target->GetTypeId() == TYPEID_PLAYER && caster->GetExactDist(target) < 8.0f) // xinef: should be 8.0f, but we have to add target size (1.5f)
|
||||
return SPELL_FAILED_TOO_CLOSE;
|
||||
|
||||
if (caster->HasUnitState(UNIT_STATE_JUMPING) || caster->HasUnitMovementFlag(MOVEMENTFLAG_FALLING))
|
||||
return SPELL_FAILED_MOVING;
|
||||
|
||||
return SPELL_CAST_OK;
|
||||
}
|
||||
@@ -1560,13 +1564,21 @@ class spell_dk_death_grip : public SpellScriptLoader
|
||||
Unit* caster = GetCaster();
|
||||
Unit* target = GetHitUnit();
|
||||
Unit* baseTarget = GetExplTargetUnit();
|
||||
Creature* targetCreature;
|
||||
|
||||
if (caster != target)
|
||||
{
|
||||
caster->CastSpell(target, 49560, true);
|
||||
const SpellInfo* spellInfo = sSpellMgr->GetSpellInfo(1766); // Rogue kick
|
||||
if (!target->IsImmunedToSpellEffect(spellInfo, EFFECT_0))
|
||||
target->InterruptNonMeleeSpells(true);
|
||||
{
|
||||
if (targetCreature->isWorldBoss() || targetCreature->IsDungeonBoss())
|
||||
{
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
caster->CastSpell(target, 49560, true);
|
||||
const SpellInfo* spellInfo = sSpellMgr->GetSpellInfo(1766); // Rogue kick
|
||||
if (!target->IsImmunedToSpellEffect(spellInfo, EFFECT_0))
|
||||
target->InterruptNonMeleeSpells(true);
|
||||
}
|
||||
}
|
||||
else
|
||||
baseTarget->CastSpell(caster, 49560, true);
|
||||
|
||||
Reference in New Issue
Block a user