Example #1
0
        public bool CanStartInvasion(PlayerMobile from)
        {
            if (m_InvasionRegionBounds.Height == 0 || m_InvasionRegionBounds.Width == 0)
            {
                from.SendMessage("InvasionRegionBounds does not appear to be set.");
                return(false);
            }

            if (m_InvasionMap == null)
            {
                from.SendMessage("InvasionMap does not appear to be set.");
                return(false);
            }

            if (m_InvasionOriginatesFrom.X == 0 || m_InvasionOriginatesFrom.Y == 0)
            {
                from.SendMessage("InvasionOriginatesFrom does not appear to be set.");
                return(false);
            }

            if (m_InvasionLocationTarget.X == 0 || m_InvasionLocationTarget.Y == 0)
            {
                from.SendMessage("InvasionLocationTarget does not appear to be set.");
                return(false);
            }

            if (m_RegisteredInvasionRegion == null)
            {
                m_RegisteredInvasionRegion = new InvasionRegion(this);
            }

            m_RegisteredInvasionRegion.Register();
            if (Region.Find(m_InvasionOriginatesFrom, m_InvasionMap) != m_RegisteredInvasionRegion)
            {
                from.SendMessage("InvasionOriginatesFrom must be a point in the invasion region.");
                return(false);
            }

            if (Region.Find(m_InvasionLocationTarget, m_InvasionMap) != m_RegisteredInvasionRegion)
            {
                from.SendMessage("InvasionLocationTarget must be a point in the invasion region.");
                return(false);
            }
            m_RegisteredInvasionRegion.Unregister();

            if (m_RequiredKillCount == 0)
            {
                from.SendMessage("RequiredKillCount does not appear to be set.");
                return(false);
            }

            if (m_SpawnDensity == 0)
            {
                from.SendMessage("SpawnDensity does not appear to be set.");
                return(false);
            }

            from.SendMessage("Invasion Started!");
            return(true);
        }
Example #2
0
        public void StartInvasion()
        {
            if (m_SpawnList == null)
            {
                m_SpawnList = new List <InvasionSpawn>();
            }
            if (m_RegisteredInvasionRegion == null)
            {
                m_RegisteredInvasionRegion = new InvasionRegion(this);
            }
            if (m_Players == null)
            {
                m_Players = new Dictionary <PlayerMobile, int>();
            }

            m_InvasionStarted = true;
            InvasionEventSink.OnInvasionStarted(new InvasionEventSink.InvasionStartedEventArgs(this));
        }