Ejemplo n.º 1
0
        public HouseSurveyCategoryGump(Mobile from, HouseSurveyTool tool) : base(50, 50)
        {
            m_From = from;
            m_Tool = tool;

            from.CloseGump(typeof(HouseSurveyCategoryGump));
            from.CloseGump(typeof(HouseSurveyListGump));

            AddPage(0);

            AddBackground(0, 0, 270, 145, 5054);

            AddImageTiled(10, 10, 250, 125, 2624);
            AddAlphaRegion(10, 10, 250, 125);

            AddHtmlLocalized(10, 10, 250, 20, 1060239, LabelColor, false, false);               // <CENTER>HOUSE PLACEMENT TOOL</CENTER>

            AddButton(10, 110, 4017, 4019, 0, GumpButtonType.Reply, 0);
            AddHtmlLocalized(45, 110, 150, 20, 3000363, LabelColor, false, false);               // Close

            AddButton(10, 40, 4005, 4007, 1, GumpButtonType.Reply, 0);
            AddHtmlLocalized(45, 40, 200, 20, 1060390, LabelColor, false, false);               // Classic Houses

            AddButton(10, 60, 4005, 4007, 2, GumpButtonType.Reply, 0);
            AddHtmlLocalized(45, 60, 200, 20, 1060391, LabelColor, false, false);               // 2-Story Customizable Houses

            AddButton(10, 80, 4005, 4007, 3, GumpButtonType.Reply, 0);
            AddHtmlLocalized(45, 80, 200, 20, 1060392, LabelColor, false, false);               // 3-Story Customizable Houses
        }
Ejemplo n.º 2
0
        public NewHouseSurveyTarget(HouseSurveyTool tool, HouseSurveyEntry[] entries, HouseSurveyEntry entry) : base(entry.MultiID, entry.Offset)
        {
            m_Tool = tool;

            Range = 14;

            m_Entries = entries;
            m_Entry   = entry;
        }
Ejemplo n.º 3
0
        public bool OnPlacement(Mobile from, HouseSurveyTool tool, Point3D p)
        {
            if (!from.CheckAlive() || from.Backpack == null || tool == null || tool.UsesRemaining == 0 || !tool.IsChildOf(from.Backpack))
            {
                return(false);
            }

            if (SurveyPreviewHouse.PreviewHouseList.Contains(from))
            {
                from.SendMessage("You are already previewing a potential house location.");
                return(false);
            }

            ArrayList            toMove;
            Point3D              center = new Point3D(p.X - m_Offset.X, p.Y - m_Offset.Y, p.Z - m_Offset.Z);
            HousePlacementResult res    = HousePlacement.Check(from, m_MultiID, center, out toMove);

            switch (res)
            {
            case HousePlacementResult.Valid:
            {
                from.SendMessage("This is valid terrain to place a house.");                           // This is a valid location.

                SurveyPreviewHouse prev = new SurveyPreviewHouse(m_MultiID, from);

                MultiComponentList mcl = prev.Components;

                prev.MoveToWorld(center, from.Map);

                string message = "You have found valid terrain to place a house.  This preview will stay visible for 20 seconds.<BR><BR>Press OKAY to stop previewing this house.";

                from.SendGump(new NoticeGump(1060635, 30720, message, 0xFFC000, 420, 280, new NoticeGumpCallback(SurveyNotice_Callback), prev));

                return(true);
            }

            case HousePlacementResult.BadItem:
            case HousePlacementResult.BadLand:
            case HousePlacementResult.BadStatic:
            case HousePlacementResult.BadRegionHidden:
            case HousePlacementResult.NoSurface:
            {
                from.SendLocalizedMessage(1043287);                           // The house could not be created here.  Either something is blocking the house, or the house would not be on valid terrain.
                break;
            }

            case HousePlacementResult.BadRegion:
            {
                from.SendLocalizedMessage(501265);                           // Housing cannot be created in this area.
                break;
            }

            case HousePlacementResult.BadRegionTemp:
            {
                from.SendLocalizedMessage(501270);                           //Lord British has decreed a 'no build' period, thus you cannot build this house at this time.
                break;
            }
            }

            return(false);
        }
Ejemplo n.º 4
0
        public HouseSurveyListGump(Mobile from, HouseSurveyTool tool, HouseSurveyEntry[] entries) : base(50, 50)
        {
            m_From    = from;
            m_Tool    = tool;
            m_Entries = entries;

            from.CloseGump(typeof(HouseSurveyCategoryGump));
            from.CloseGump(typeof(HouseSurveyListGump));

            AddPage(0);

            AddBackground(0, 0, 520, 420, 5054);

            AddImageTiled(10, 10, 500, 20, 2624);
            AddAlphaRegion(10, 10, 500, 20);

            AddHtmlLocalized(10, 10, 500, 20, 1060239, LabelColor, false, false);               // <CENTER>HOUSE PLACEMENT TOOL</CENTER>

            AddImageTiled(10, 40, 500, 20, 2624);
            AddAlphaRegion(10, 40, 500, 20);

            AddHtmlLocalized(50, 40, 225, 20, 1060235, LabelColor, false, false);               // House Description
            AddHtmlLocalized(275, 40, 75, 20, 1060236, LabelColor, false, false);               // Storage
            AddHtmlLocalized(350, 40, 75, 20, 1060237, LabelColor, false, false);               // Lockdowns
            //AddHtmlLocalized( 425, 40, 75, 20, 1060034, LabelColor, false, false ); // Cost

            AddImageTiled(10, 70, 500, 280, 2624);
            AddAlphaRegion(10, 70, 500, 280);

            AddImageTiled(10, 360, 500, 20, 2624);
            AddAlphaRegion(10, 360, 500, 20);

            //AddHtmlLocalized( 10, 360, 250, 20, 1060645, LabelColor, false, false ); // Bank Balance:
            //AddLabel( 250, 360, LabelHue, Banker.GetBalance( from ).ToString() );

            AddImageTiled(10, 390, 500, 20, 2624);
            AddAlphaRegion(10, 390, 500, 20);

            AddButton(10, 390, 4017, 4019, 0, GumpButtonType.Reply, 0);
            AddHtmlLocalized(50, 390, 100, 20, 3000363, LabelColor, false, false);               // Close

            for (int i = 0; i < entries.Length; ++i)
            {
                int page  = 1 + (i / 14);
                int index = i % 14;

                if (index == 0)
                {
                    if (page > 1)
                    {
                        AddButton(450, 390, 4005, 4007, 0, GumpButtonType.Page, page);
                        AddHtmlLocalized(400, 390, 100, 20, 3000406, LabelColor, false, false);                           // Next
                    }

                    AddPage(page);

                    if (page > 1)
                    {
                        AddButton(200, 390, 4014, 4016, 0, GumpButtonType.Page, page - 1);
                        AddHtmlLocalized(250, 390, 100, 20, 3000405, LabelColor, false, false);                           // Previous
                    }
                }

                HouseSurveyEntry entry = entries[i];

                int y = 70 + (index * 20);

                AddButton(10, y, 4005, 4007, 1 + i, GumpButtonType.Reply, 0);
                AddHtmlLocalized(50, y, 225, 20, entry.Description, LabelColor, false, false);
                AddLabel(275, y, LabelHue, entry.Storage.ToString());
                AddLabel(350, y, LabelHue, entry.Lockdowns.ToString());
                AddLabel(425, y, LabelHue, entry.Cost.ToString());
            }
        }
Ejemplo n.º 5
0
		public bool OnPlacement( Mobile from, HouseSurveyTool tool, Point3D p )
		{
			if ( !from.CheckAlive() || from.Backpack == null || tool == null || tool.UsesRemaining == 0 || !tool.IsChildOf( from.Backpack )  )
				return false;

			if ( SurveyPreviewHouse.PreviewHouseList.Contains( from ) )
			{
				from.SendMessage( "You are already previewing a potential house location." );
				return false;
			}

			ArrayList toMove;
			Point3D center = new Point3D( p.X - m_Offset.X, p.Y - m_Offset.Y, p.Z - m_Offset.Z );
			HousePlacementResult res = HousePlacement.Check( from, m_MultiID, center, out toMove, false );

			switch ( res )
			{
				case HousePlacementResult.Valid:
				{
					from.SendMessage( "This is valid terrain to place a house." ); // This is a valid location.

					SurveyPreviewHouse prev = new SurveyPreviewHouse( m_MultiID, from );

					MultiComponentList mcl = prev.Components;

					prev.MoveToWorld( center, from.Map );

					string message = "You have found valid terrain to place a house.  This preview will stay visible for 20 seconds.<BR><BR>Press OKAY to stop previewing this house.";

					from.SendGump( new NoticeGump( 1060635, 30720, message, 0xFFC000, 420, 280, new NoticeGumpCallback( SurveyNotice_Callback ), prev ) );

					return true;
				}
                case HousePlacementResult.MobileBlocking:
                {
                    from.SendMessage("There is somebody in the way, and you can't place on top of them!");
                    break;
                }
                case HousePlacementResult.ItemBlocking:
                {
                    from.SendMessage("There is an item in the way, and you can't place on top of them!");
                    break;
                }
				case HousePlacementResult.BadItem:
				case HousePlacementResult.BadLand:
				case HousePlacementResult.BadStatic:
				case HousePlacementResult.BadRegionHidden:
				case HousePlacementResult.NoSurface:
				{
					from.SendLocalizedMessage( 1043287 ); // The house could not be created here.  Either something is blocking the house, or the house would not be on valid terrain.
					break;
				}
				case HousePlacementResult.BadRegion:
				{
					from.SendLocalizedMessage( 501265 ); // Housing cannot be created in this area.
					break;
				}
				case HousePlacementResult.BadRegionTemp:
				{
					from.SendLocalizedMessage( 501270 ); //Lord British has decreed a 'no build' period, thus you cannot build this house at this time.
					break;
				}
			}

			return false;
		}
Ejemplo n.º 6
0
		public NewHouseSurveyTarget( HouseSurveyTool tool, HouseSurveyEntry[] entries, HouseSurveyEntry entry ) : base( entry.MultiID, entry.Offset )
		{
			m_Tool = tool;

			Range = 14;

			m_Entries = entries;
			m_Entry = entry;
		}
Ejemplo n.º 7
0
		public HouseSurveyListGump( Mobile from, HouseSurveyTool tool, HouseSurveyEntry[] entries ) : base( 50, 50 )
		{
			m_From = from;
			m_Tool = tool;
			m_Entries = entries;

			from.CloseGump( typeof( HouseSurveyCategoryGump ) );
			from.CloseGump( typeof( HouseSurveyListGump ) );

			AddPage( 0 );

			AddBackground( 0, 0, 520, 420, 5054 );

			AddImageTiled( 10, 10, 500, 20, 2624 );
			AddAlphaRegion( 10, 10, 500, 20 );

			AddHtmlLocalized( 10, 10, 500, 20, 1060239, LabelColor, false, false ); // <CENTER>HOUSE PLACEMENT TOOL</CENTER>

			AddImageTiled( 10, 40, 500, 20, 2624 );
			AddAlphaRegion( 10, 40, 500, 20 );

			AddHtmlLocalized( 50, 40, 225, 20, 1060235, LabelColor, false, false ); // House Description
			AddHtmlLocalized( 275, 40, 75, 20, 1060236, LabelColor, false, false ); // Storage
			AddHtmlLocalized( 350, 40, 75, 20, 1060237, LabelColor, false, false ); // Lockdowns
			//AddHtmlLocalized( 425, 40, 75, 20, 1060034, LabelColor, false, false ); // Cost

			AddImageTiled( 10, 70, 500, 280, 2624 );
			AddAlphaRegion( 10, 70, 500, 280 );

			AddImageTiled( 10, 360, 500, 20, 2624 );
			AddAlphaRegion( 10, 360, 500, 20 );

			//AddHtmlLocalized( 10, 360, 250, 20, 1060645, LabelColor, false, false ); // Bank Balance:
			//AddLabel( 250, 360, LabelHue, Banker.GetBalance( from ).ToString() );

			AddImageTiled( 10, 390, 500, 20, 2624 );
			AddAlphaRegion( 10, 390, 500, 20 );

			AddButton( 10, 390, 4017, 4019, 0, GumpButtonType.Reply, 0 );
			AddHtmlLocalized( 50, 390, 100, 20, 3000363, LabelColor, false, false ); // Close

			for ( int i = 0; i < entries.Length; ++i )
			{
				int page = 1 + (i / 14);
				int index = i % 14;

				if ( index == 0 )
				{
					if ( page > 1 )
					{
						AddButton( 450, 390, 4005, 4007, 0, GumpButtonType.Page, page );
						AddHtmlLocalized( 400, 390, 100, 20, 3000406, LabelColor, false, false ); // Next
					}

					AddPage( page );

					if ( page > 1 )
					{
						AddButton( 200, 390, 4014, 4016, 0, GumpButtonType.Page, page - 1 );
						AddHtmlLocalized( 250, 390, 100, 20, 3000405, LabelColor, false, false ); // Previous
					}
				}

				HouseSurveyEntry entry = entries[i];

				int y = 70 + (index * 20);

				AddButton( 10, y, 4005, 4007, 1 + i, GumpButtonType.Reply, 0 );
				AddHtmlLocalized( 50, y, 225, 20, entry.Description, LabelColor, false, false );
				AddLabel( 275, y, LabelHue, entry.Storage.ToString() );
				AddLabel( 350, y, LabelHue, entry.Lockdowns.ToString() );
				AddLabel( 425, y, LabelHue, entry.Cost.ToString() );
			}
		}
Ejemplo n.º 8
0
		public HouseSurveyCategoryGump( Mobile from, HouseSurveyTool tool ) : base( 50, 50 )
		{
			m_From = from;
			m_Tool = tool;

			from.CloseGump( typeof( HouseSurveyCategoryGump ) );
			from.CloseGump( typeof( HouseSurveyListGump ) );

			AddPage( 0 );

			AddBackground( 0, 0, 270, 145, 5054 );

			AddImageTiled( 10, 10, 250, 125, 2624 );
			AddAlphaRegion( 10, 10, 250, 125 );

			AddHtmlLocalized( 10, 10, 250, 20, 1060239, LabelColor, false, false ); // <CENTER>HOUSE PLACEMENT TOOL</CENTER>

			AddButton( 10, 110, 4017, 4019, 0, GumpButtonType.Reply, 0 );
			AddHtmlLocalized( 45, 110, 150, 20, 3000363, LabelColor, false, false ); // Close

			AddButton( 10, 40, 4005, 4007, 1, GumpButtonType.Reply, 0 );
			AddHtmlLocalized( 45, 40, 200, 20, 1060390, LabelColor, false, false ); // Classic Houses

			AddButton( 10, 60, 4005, 4007, 2, GumpButtonType.Reply, 0 );
			AddHtmlLocalized( 45, 60, 200, 20, 1060391, LabelColor, false, false ); // 2-Story Customizable Houses

			AddButton( 10, 80, 4005, 4007, 3, GumpButtonType.Reply, 0 );
			AddHtmlLocalized( 45, 80, 200, 20, 1060392, LabelColor, false, false ); // 3-Story Customizable Houses
		}