示例#1
0
        internal void SpawnReferee(Rectangle2D area)
        {
            int     minX    = area.Start.X;
            int     maxX    = area.End.X - 2;
            int     minY    = area.Start.Y;
            int     maxY    = area.End.Y - 2;
            int     Z       = JoinMap.GetAverageZ(area.X, area.Y);
            Referee referee = new Referee();

            referee.MoveToWorld(new Point3D(Utility.RandomMinMax(minX, maxX), Utility.RandomMinMax(minY, maxY), Z), JoinMap);
            referee.PublicOverheadMessage(MessageType.Regular, 906, true, "Get a move on!");
            referee.IsInEvent = true;
        }
示例#2
0
        public void SpawnMobile(Mobile m)
        {
            for (int i = 0; i < m_Areas.Count; ++i)
            {
                int mobCount            = 0;
                IPooledEnumerable eable = JoinMap.GetMobilesInBounds(m_Areas[i]);

                foreach (Mobile mob in eable)
                {
                    if (Contestants.Contains(mob) && mob.Alive)
                    {
                        mobCount++;
                    }
                }

                eable.Free();

                if (mobCount <= 1)     //Found an available area
                {
                    if (mobCount == 1) //Start area fight timer
                    {
                        Timer t;
                        m_MatchTimers.TryGetValue(m_Areas[i], out t);

                        if (t != null)
                        {
                            t.Stop();
                            m_MatchTimers.Remove(m_Areas[i]);
                        }

                        t = Contestants.Count > 2 ? new MatchTimer(this, m_Areas[i], false) : new MatchTimer(this, m_Areas[i], true);
                        t.Start();
                        m_MatchTimers.Add(m_Areas[i], t);
                    }

                    m.MoveToWorld(new Point3D(m_Areas[i].Start, JoinMap.GetAverageZ(m_Areas[i].X, m_Areas[i].Y)), JoinMap);
                    m.LocalOverheadMessage(MessageType.Regular, 38, true, string.Format("Fight will begin in {0} seconds!", FightDelayInSecs));
                    Fighting.Add(m);
                    FixPlayer(m);
                    new StartFightTimer(this, m).Start();
                    break;
                }
            }
        }