Ejemplo n.º 1
0
        private SpellMissType ProcessSpellHit(Unit target)
        {
            if (SpellInfo.Speed > 0 && target.IsImmuneToSpell(SpellInfo, Caster))
            {
                return(SpellMissType.Immune);
            }

            for (int effectIndex = 0; effectIndex < SpellInfo.Effects.Count; effectIndex++)
            {
                SpellInfo.Effects[effectIndex].Handle(this, effectIndex, target, SpellEffectHandleMode.HitStart);
            }

            return(SpellMissType.None);
        }
            internal SpellMissType SpellHitResult(Unit victim, SpellInfo spellInfo, bool canReflect = false)
            {
                if (victim.IsImmuneToSpell(spellInfo, unit))
                {
                    return(SpellMissType.Immune);
                }

                if (unit == victim)
                {
                    return(SpellMissType.None);
                }

                // all positive spells can`t miss
                if (spellInfo.IsPositive && !unit.IsHostileTo(victim))
                {
                    return(SpellMissType.None);
                }

                return(SpellMissType.None);
            }