Пример #1
0
        public static void Spawn(Mobile caller, Mobile target, int amount, bool onlyAdditional)
        {
            if (target == null || target.Deleted)
            {
                return;
            }

            foreach (Mobile m in target.GetMobilesInRange(15))
            {
                if (m is BaseGuard)
                {
                    BaseGuard g = (BaseGuard)m;

                    if (g.Focus == null) // idling
                    {
                        g.Focus = target;

                        --amount;
                    }
                    else if (g.Focus == target && !onlyAdditional)
                    {
                        --amount;
                    }
                }
            }

            while (amount-- > 0)
            {
                caller.Region.MakeGuard(target);
            }
        }
Пример #2
0
 protected override void OnTick()
 {
     BaseGuard.Spawn(m_Focus, m_Focus, 1, true);
 }