Ejemplo n.º 1
0
		public ConfirmTentPlacementGump( Mobile owner, TentAddon tent, TentFlap flap, TentBedroll roll, SecureTentChest chest, Rectangle2D bounds )
			: base( 10, 10 )
		{
			m_Owner = owner;
			m_Tent = tent;
			m_Flap = flap;
			m_Bedroll = roll;
			m_Chest = chest;
			m_RegionBounds = bounds;

			Closable = false;
			Disposable = false;
			Resizable = false;
			Dragable = true;

			AddPage( 1 );
			AddBackground( 10, 10, 325, 305, 9250 );
			AddImageTiled( 25, 25, 295, 11, 50 );
			AddLabel( 90, 35, 0, "Confirm Tent Placement" );

			AddButton( 35, 275, 4020, 4022, 0, GumpButtonType.Reply, 1 ); //Cancel
			AddButton( 280, 275, 4023, 4025, 1, GumpButtonType.Reply, 1 ); //Ok

			AddHtml( 27, 75, 290, 200, String.Format( "<center>You are about to place a travel tent.</center><br> Within, you will find a bedroll "
													 + "and a secure wooden chest.<br> To repack your tent, or to logout safely, double-click "
													 + "your bedroll. When doing so, please make sure that all items are removed from the chest."
													 + "<br> Please press okay to continue, or press cancel to stop tent placement." ), false, false );
		}
Ejemplo n.º 2
0
		public TentValidator( Mobile owner, TentAddon tent, TentBedroll bedroll, SecureTentChest chest, TravelTentRegion region, Rectangle2D bounds )
			: base( 0x12B3 )
		{
			Name = "travel tent validator";
			Movable = false;
			Visible = false;

			m_Owner = owner;
			m_Tent = tent;
			m_Bedroll = bedroll;
			m_Chest = chest;
			m_Region = region;
			m_Bounds = bounds;
		}
Ejemplo n.º 3
0
		public override void OnDoubleClick( Mobile from )
		{
			Point2D start = new Point2D( from.X - 3, from.Y - 3 );
			Point2D end = new Point2D( from.X + 3, from.Y + 3 );

			m_Bounds = new Rectangle2D( start, end );

			if( !IsChildOf( from.Backpack ) )
			{
				from.SendLocalizedMessage( 1042001 ); //That must be in your pack to use it.
			}
			else if( AlreadyOwnTent( from ) )
			{
				from.SendMessage( "You already have a tent established." );
			}
			else if( from.HasGump( typeof( ConfirmTentPlacementGump ) ) )
			{
				from.CloseGump( typeof( ConfirmTentPlacementGump ) );
			}
			else if( from.Combatant != null )
			{
				from.SendMessage( "You can't place a tent while fighting!" );
			}
			else if( VerifyPlacement( from, m_Bounds ) )
			{
				TentAddon tent = new TentAddon();
				tent.MoveToWorld( new Point3D( from.X, from.Y, from.Z ), from.Map );

				TentFlap flap = new TentFlap( from, this );
				flap.MoveToWorld( new Point3D( from.X + 2, from.Y, from.Z ), from.Map );

				SecureTentChest chest = new SecureTentChest( from );
				chest.MoveToWorld( new Point3D( from.X - 1, from.Y - 2, from.Z ), from.Map );

				TentBedroll roll = new TentBedroll( from, tent, flap, chest );
				roll.MoveToWorld( new Point3D( from.X, from.Y + 1, from.Z ), from.Map );

				from.SendGump( new ConfirmTentPlacementGump( from, tent, flap, roll, chest, m_Bounds ) );

				this.Delete();
			}
			else
			{
				from.SendMessage( "You cannot place a tent in this area." );
			}
		}
Ejemplo n.º 4
0
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();

			if( version >= 1 )
			{
				m_Owner = reader.ReadMobile();
				m_Tent = reader.ReadItem() as TentAddon;
				m_Bedroll = reader.ReadItem() as TentBedroll;
				m_Chest = reader.ReadItem() as SecureTentChest;
				m_Bounds = reader.ReadRect2D();

				if( m_Owner != null && m_Chest != null && m_Tent != null )
					m_Region = new TravelTentRegion( m_Owner, m_Chest, m_Tent.Map, m_Bounds, 16 );
			}
		}
Ejemplo n.º 5
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            if (version >= 1)
            {
                m_Owner   = reader.ReadMobile();
                m_Tent    = reader.ReadItem() as TentAddon;
                m_Bedroll = reader.ReadItem() as TentBedroll;
                m_Chest   = reader.ReadItem() as SecureTentChest;
                m_Bounds  = reader.ReadRect2D();

                if (m_Owner != null && m_Chest != null && m_Tent != null)
                {
                    m_Region = new TravelTentRegion(m_Owner, m_Chest, m_Tent.Map, m_Bounds, 16);
                }
            }
        }
Ejemplo n.º 6
0
		public TentManagementGump( Mobile owner, TentBedroll bedroll )
			: base( 10, 10 )
		{
			m_Owner = owner;
			m_Bedroll = bedroll;

			Closable = true;
			Disposable = true;
			Dragable = true;

			AddPage( 1 );
			AddBackground( 10, 10, 295, 290, 9250 );
			AddImageTiled( 25, 25, 265, 11, 50 );
			AddLabel( 80, 35, 0, "Travel Tent Management" );

			AddButton( 35, 260, 4020, 4022, 0, GumpButtonType.Reply, 1 ); //Cancel
			AddButton( 250, 260, 4023, 4025, 1, GumpButtonType.Reply, 1 ); //Ok

			AddRadio( 35, 125, 210, 211, false, 2 );
			AddLabel( 65, 125, 0, "Deconstruct Tent" );

			AddRadio( 35, 170, 210, 211, false, 3 );
			AddLabel( 65, 170, 0, "Safe Logout" );
		}