Exemplo n.º 1
0
        public virtual void Negate(Mobile m)
        {
            if (m == null || m.Deleted)
            {
                return;
            }

            SpellUtility.NegateAllEffects(m);

            if (DebugMode || m.AccessLevel <= AccessLevel.Counselor)
            {
                m.RevealingAction();
                m.DisruptiveAction();
            }

            if (m.Target != null)
            {
                m.Target.Cancel(m, TargetCancelType.Overriden);
            }

            m.Spell = null;

            if (m.Combatant != null)
            {
#if ServUO
                // ReSharper disable once RedundantCast
                var c = m.Combatant as Mobile;
#else
                var c = m.Combatant;
#endif

                if (c != null && c.Combatant == m)
                {
                    c.Combatant = null;
                    c.Warmode   = false;
                }

                m.Combatant = null;
            }

            if (m.Aggressed != null)
            {
                m.Aggressed.Clear();
            }

            if (m.Aggressors != null)
            {
                m.Aggressors.Clear();
            }

            if (m.Warmode && !m.InRegion(BattleRegion))
            {
                m.Warmode = false;
            }

            m.Criminal = false;

            m.Delta(MobileDelta.Noto);

            if ((DebugMode || m.AccessLevel <= AccessLevel.Counselor) && m.InRegion(BattleRegion))
            {
                m.Items.ForEachReverse(o => InvalidateItem(m, o));
            }
        }
Exemplo n.º 2
0
 public static SpellInfo GetSpellInfo(this ISpell s)
 {
     return(SpellUtility.GetSpellInfo(s));
 }