Core/Spells: remove holy shock and death coil (dk) from checkcast and add them to the checkcast of the spell script. also check if unit is in front for damage spell of death coil (dk) Closes #6027
This commit is contained in:
1 parent
9e6a5593bd
commit
7688c7609f
3 files changed
+31
-17
No files matched your search
@@ -750,6 +750,23 @@ class spell_dk_death_coil : public SpellScriptLoader
|
||||
}
|
||||
}
|
||||
|
||||
SpellCastResult CheckCast()
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
if (Unit* target = GetExplTargetUnit())
|
||||
{
|
||||
if (!caster->IsFriendlyTo(target) && !caster->isInFront(target))
|
||||
return SPELL_FAILED_UNIT_NOT_INFRONT;
|
||||
|
||||
if (target->IsFriendlyTo(caster) && target->GetCreatureType() != CREATURE_TYPE_UNDEAD)
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
}
|
||||
else
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
|
||||
return SPELL_CAST_OK;
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_dk_death_coil_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
|
||||
Reference in new issue
Block a user