Пример #1
0
		public InstanceRegion( PeerlessInstance instance )
			: base( null, instance.Map, Region.Find( instance.EntranceLocation, instance.Map ), instance.RegionBounds )
		{
			m_Owner = instance;

			Register();
		}
Пример #2
0
        public InstanceEnterGate( PeerlessInstance instance, List<Mobile> allowedPlayers )
            : base(0xF6C)
        {
            m_Instance = instance;
            m_AllowedPlayers = allowedPlayers;

            Movable = false;
            Hue = 0x484;
            Light = LightType.Circle300;

            Timer.DelayCall( TimeSpan.FromMinutes( 1.0 ), new TimerCallback( Delete ) );
        }
Пример #3
0
        public void Validate()
        {
            if (m_KeyExpireTimer != null)
            {
                m_KeyExpireTimer.Stop();
            }

            foreach (PeerlessKeyBrazier brazier in m_Braziers)
            {
                if (!Validate(brazier))
                {
                    m_KeyExpireTimer = Timer.DelayCall(TimeSpan.FromMinutes(1.0), delegate { Clear(false); });
                    return;
                }
            }

            List <Mobile> party = GetParty(m_Summoner);
            List <Mobile> invalid;

            if (!ValidateMembers(party, out invalid))
            {
                m_Summoner.SendLocalizedMessage(1113574); // Your party cannot join the queue because the following members have already registered with another group:

                foreach (Mobile m in invalid)
                {
                    m_Summoner.SendMessage(m.Name);
                }

                Clear(true);
            }
            else
            {
                PeerlessInstance instance = AcquireEmptyInstance();

                if (instance == null)
                {
                    m_PartyQueue.Enqueue(party);

                    m_Summoner.SendLocalizedMessage(1113575); // Your party has been successfully added to the queue for this instance.
                }
                else
                {
                    instance.Activate();

                    new InstanceEnterGate(instance, party).MoveToWorld(new Point3D(X, Y, Z + 5), Map);
                }

                Clear(false);
            }
        }
Пример #4
0
        public ConfirmJoinInstanceGump( PeerlessInstance instance )
            : base(50, 50)
        {
            m_Instance = instance;

            AddPage( 0 );

            AddBackground( 0, 0, 240, 135, 0x2422 );

            AddHtmlLocalized( 15, 15, 210, 75, 1072525, 0x0, false, false ); // <CENTER>Are you sure you want to teleport <BR>your party to an unknown area?</CENTER>

            AddButton( 160, 95, 0xF7, 0xF8, 1, GumpButtonType.Reply, 0 );
            AddButton( 90, 95, 0xF2, 0xF1, 0, GumpButtonType.Reply, 0 );
        }
Пример #5
0
        private PeerlessInstance AcquireEmptyInstance()
        {
            for (var index = 0; index < m_Instances.Count; index++)
            {
                PeerlessInstance instance = m_Instances[index];

                if (instance.State == InstanceState.Available)
                {
                    return(instance);
                }
            }

            return(null);
        }
Пример #6
0
        public override void OnAfterDelete()
        {
            base.OnAfterDelete();

            Clear(false);

            if (m_KeyExpireTimer != null)
            {
                m_KeyExpireTimer.Stop();
            }

            for (var index = 0; index < m_Instances.Count; index++)
            {
                PeerlessInstance instance = m_Instances[index];

                instance.OnDelete();
            }
        }
Пример #7
0
        public void OnFreeInstance(PeerlessInstance instance)
        {
            if (m_PartyQueue.Count > 0)
            {
                List <Mobile> party = m_PartyQueue.Dequeue();

                instance.Activate();

                foreach (Mobile member in party)
                {
                    if (member.Region.IsPartOf("Stygian Abyss"))
                    {
                        member.SendGump(new RejoinInstanceGump(instance, OfferGumpTitle, OfferGumpDesc));

                        Timer.DelayCall(TimeSpan.FromMinutes(1.0), delegate { member.CloseGump(typeof(RejoinInstanceGump)); });
                    }
                }
            }
        }
Пример #8
0
		public RejoinInstanceGump( PeerlessInstance instance, int titleCliloc, int msgCliloc )
			: base( 340, 340 )
		{
			/* Not sure if the gump structure is the same as OSI, but this is better than nothing */

			m_Instance = instance;

			AddPage( 0 );

			AddBackground( 0, 0, 291, 99, 0x13BE );
			AddImageTiled( 5, 6, 280, 20, 0xA40 );

			AddHtmlLocalized( 9, 8, 280, 20, titleCliloc, 0x7FFF, false, false );

			AddImageTiled( 5, 31, 280, 40, 0xA40 );

			AddHtmlLocalized( 9, 35, 272, 40, msgCliloc, 0x7FFF, false, false );

			AddButton( 215, 73, 0xFB7, 0xFB8, 1, GumpButtonType.Reply, 0 );
			AddHtmlLocalized( 250, 75, 65, 20, 1006044, 0x7FFF, false, false ); // OK

			AddButton( 5, 73, 0xFB1, 0xFB2, 0, GumpButtonType.Reply, 0 );
			AddHtmlLocalized( 40, 75, 100, 20, 1060051, 0x7FFF, false, false ); // CANCEL
		}
Пример #9
0
 public SliceTimer(PeerlessInstance instance)
     : base(TimeSpan.FromSeconds(1.0), TimeSpan.FromSeconds(1.0))
 {
     m_Instance = instance;
 }
Пример #10
0
        public void OnFreeInstance( PeerlessInstance instance )
        {
            if ( m_PartyQueue.Count > 0 )
            {
                List<Mobile> party = m_PartyQueue.Dequeue();

                instance.Activate();

                foreach ( Mobile member in party )
                {
                    if ( member.Region.IsPartOf( "Stygian Abyss" ) )
                    {
                        member.SendGump( new RejoinInstanceGump( instance, OfferGumpTitle, OfferGumpDesc ) );

                        Timer.DelayCall( TimeSpan.FromMinutes( 1.0 ), new TimerCallback(
                            delegate { member.CloseGump( typeof( RejoinInstanceGump ) ); } ) );
                    }
                }
            }
        }
Пример #11
0
		public SliceTimer( PeerlessInstance instance )
			: base( TimeSpan.FromSeconds( 1.0 ), TimeSpan.FromSeconds( 1.0 ) )
		{
			m_Instance = instance;
		}