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); } }
protected override void OnTick() { BaseGuard.Spawn(m_Focus, m_Focus, 1, true); }