예제 #1
0
        /// <summary>
        /// Get Event Ready to start fresh again.
        /// </summary>
        public void InitializeEvent()
        {
            //load players into dueling system
            if (ParticipateRegion != null)
            {
                foreach (Mobile pm in ParticipateRegion.GetPlayers())
                {
                    if (pm is PlayerMobile && pm.AccessLevel == AccessLevel.Player)
                    {
                        CleanPlayer((PlayerMobile)pm);
                        m_DuelList.Add(pm);
                    }
                }
            }

            //if there are not at least 4 players (default), close duel and kick all the players.
            if (m_DuelList.Count < m_MinimumDuelers)
            {
                //tell the players there was not enough players for the pvp event
                string text = "There was not enough players for this PVP Event.";
                World.Broadcast(m_BroadcastHue, true, String.Format("{0}", text));

                //clear participant region over to the viewing region with gate
                if (ParticipateRegion != null)
                {
                    foreach (Mobile pm in m_DuelList)
                    {
                        pm.MoveToWorld(m_LostLocation, m_MapLocation);
                    }
                }

                //clear the duellist
                m_DuelList.Clear();

                //close the event
                CloseEvent();

                return;
            }

            //everything is fine, start the tourney
            m_DuelList.Clear();
            StartNewRound();
        }
예제 #2
0
        /// <summary>
        /// Send message to people in the 2 regions
        /// </summary>
        /// <param name="message">a string message to send</param>
        public void BroadCastMessage(string message)
        {
            m_BroadcastList.Clear();

            //grab players in ParticipateRegion
            if (ParticipateRegion != null)
            {
                foreach (Mobile pm in ParticipateRegion.GetPlayers())
                {
                    if (pm is PlayerMobile)
                    {
                        CleanPlayer((PlayerMobile)pm);
                        m_BroadcastList.Add(pm);
                    }
                }
            }

            //grab players in SpectatorRegion
            if (SpectatorRegion != null)
            {
                foreach (Mobile pm in SpectatorRegion.GetPlayers())
                {
                    if (pm is PlayerMobile)
                    {
                        CleanPlayer((PlayerMobile)pm);
                        m_BroadcastList.Add(pm);
                    }
                }
            }

            //Send themt he message
            foreach (Mobile m in m_BroadcastList)
            {
                if (m != null)
                {
                    m.SendMessage(55, message);
                }
            }
        }