public HousePlacementCategoryGump( Mobile from, HousePlacementTool tool ) : base( 50, 50 ) { m_From = from; m_Tool = tool; from.CloseGump( typeof( HousePlacementCategoryGump ) ); from.CloseGump( typeof( HousePlacementListGump ) ); 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 }
public NewHousePlacementTarget( HousePlacementEntry[] entries, HousePlacementEntry entry, HousePlacementTool o ) : base( entry.MultiID, entry.Offset ) { Range = 14; m_Tool = o; m_Entries = entries; m_Entry = entry; }
public bool OnPlacement( Mobile from, Point3D p, HousePlacementTool tool ) { m_Tool = tool; if ( !from.CheckAlive() ) 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: { if ( from.AccessLevel < AccessLevel.GameMaster && BaseHouse.HasAccountHouse( from ) ) { from.SendLocalizedMessage( 501271 ); // You already own a house, you may not place another! } else { from.SendLocalizedMessage( 1011576 ); // This is a valid location. PreviewHouse prev = new PreviewHouse( m_MultiID ); MultiComponentList mcl = prev.Components; Point3D banLoc = new Point3D( center.X + mcl.Min.X, center.Y + mcl.Max.Y + 1, center.Z ); for ( int i = 0; i < mcl.List.Length; ++i ) { MultiTileEntry entry = mcl.List[i]; int itemID = entry.m_ItemID & 0x3FFF; if ( itemID >= 0xBA3 && itemID <= 0xC0E ) { banLoc = new Point3D( center.X + entry.m_OffsetX, center.Y + entry.m_OffsetY, center.Z ); break; } } for ( int i = 0; i < toMove.Count; ++i ) { object o = toMove[i]; if ( o is Mobile ) ((Mobile)o).Location = banLoc; else if ( o is Item ) ((Item)o).Location = banLoc; } prev.MoveToWorld( center, from.Map ); /* You are about to place a new house. * Placing this house will condemn any and all of your other houses that you may have. * All of your houses on all shards will be affected. * * In addition, you will not be able to place another house or have one transferred to you for one (1) real-life week. * * Once you accept these terms, these effects cannot be reversed. * Re-deeding or transferring your new house will not uncondemn your other house(s) nor will the one week timer be removed. * * If you are absolutely certain you wish to proceed, click the button next to OKAY below. * If you do not wish to trade for this house, click CANCEL. */ from.SendGump( new WarningGump( 1060635, 30720, 1049583, 32512, 420, 280, new WarningGumpCallback( PlacementWarning_Callback ), prev ) ); return true; } 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; } } return false; }
public HousePlacementListGump( Mobile from, HousePlacementEntry[] entries, HousePlacementTool o ) : base( 50, 50 ) { m_Tool = o; m_From = from; m_Entries = entries; from.CloseGump( typeof( HousePlacementCategoryGump ) ); from.CloseGump( typeof( HousePlacementListGump ) ); 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 } } HousePlacementEntry 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() ); } }