Ejemplo n.º 1
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.º 2
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.");
            }
        }