public HouseGumpAOS( HouseGumpPageAOS page, Mobile from, BaseHouse house ) : base( 50, 40 ) { m_House = house; m_Page = page; from.CloseGump( typeof( HouseGumpAOS ) ); //from.CloseGump( typeof( HouseListGump ) ); //from.CloseGump( typeof( HouseRemoveGump ) ); bool isCombatRestricted = house.IsCombatRestricted( from ); bool isOwner = house.IsOwner( from ); bool isCoOwner = isOwner || house.IsCoOwner( from ); bool isFriend = isCoOwner || house.IsFriend( from ); if ( isCombatRestricted ) isFriend = isCoOwner = isOwner = false; AddPage( 0 ); if ( isFriend || page == HouseGumpPageAOS.Vendors ) { AddBackground( 0, 0, 420, page != HouseGumpPageAOS.Vendors ? 440 : 420, 5054 ); AddImageTiled( 10, 10, 400, 100, 2624 ); AddAlphaRegion( 10, 10, 400, 100 ); AddImageTiled( 10, 120, 400, 260, 2624 ); AddAlphaRegion( 10, 120, 400, 260 ); AddImageTiled( 10, 390, 400, page != HouseGumpPageAOS.Vendors ? 40 : 20, 2624 ); AddAlphaRegion( 10, 390, 400, page != HouseGumpPageAOS.Vendors ? 40 : 20 ); AddButtonLabeled( 250, page != HouseGumpPageAOS.Vendors ? 410 : 390, 0, 1060675 ); // CLOSE } AddImage( 10, 10, 100 ); if ( m_House.Sign != null ) { ArrayList lines = Wrap( m_House.Sign.GetName() ); if ( lines != null ) { for ( int i = 0, y = (114 - (lines.Count * 14)) / 2; i < lines.Count; ++i, y += 14 ) { string s = (string)lines[i]; AddLabel( 10 + ((160 - (s.Length * 8)) / 2), y, 0, s ); } } } if ( page == HouseGumpPageAOS.Vendors ) { AddHtmlLocalized( 10, 120, 400, 20, 1062428, LabelColor, false, false ); // <CENTER>SHOPS</CENTER> AddList( house.AvailableVendorsFor( from ), 1, false, false, from ); return; } if ( !isFriend ) return; if ( house != null ) { AddButtonLabeled( 10, 390, GetButtonID( 0, 0 ), 1060674 ); // Banish AddButtonLabeled( 10, 410, GetButtonID( 0, 1 ), 1011261 ); // Lift a Ban } /*Zycron else { AddButtonLabeled( 10, 390, GetButtonID( 0, 2 ), 1060676 ); // Grant Access AddButtonLabeled( 10, 410, GetButtonID( 0, 3 ), 1060677 ); // Revoke Access } Zycron*/ AddPageButton( 150, 10, GetButtonID( 1, 0 ), 1060668, HouseGumpPageAOS.Information ); AddPageButton( 150, 30, GetButtonID( 1, 1 ), 1060669, HouseGumpPageAOS.Security ); AddPageButton( 150, 50, GetButtonID( 1, 2 ), 1060670, HouseGumpPageAOS.Storage ); AddPageButton( 150, 70, GetButtonID( 1, 3 ), 1060671, HouseGumpPageAOS.Customize ); AddPageButton( 150, 90, GetButtonID( 1, 4 ), 1060672, HouseGumpPageAOS.Ownership ); switch ( page ) { case HouseGumpPageAOS.Information: { AddHtmlLocalized( 20, 130, 200, 20, 1011242, LabelColor, false, false ); // Owned By: AddLabel( 210, 130, LabelHue, GetOwnerName() ); AddHtmlLocalized( 20, 170, 380, 20, 1018032, SelectedColor, false, false ); // This house is properly placed. AddHtmlLocalized( 20, 190, 380, 20, 1018035, SelectedColor, false, false ); // This house is of modern design. AddHtmlLocalized( 20, 210, 380, 20, (house is HouseFoundation) ? 1060681 : 1060680, SelectedColor, false, false ); // This is a (pre | custom)-built house. AddHtmlLocalized( 20, 230, 380, 20, house.Public ? 1060678 : 1060679, SelectedColor, false, false ); // This house is (private | open to the public). switch ( house.DecayType ) { case DecayType.Ageless: case DecayType.AutoRefresh: { AddHtmlLocalized( 20, 250, 380, 20, 1062209, SelectedColor, false, false ); // This house is <a href = "?ForceTopic97">Automatically</a> refreshed. break; } case DecayType.ManualRefresh: { AddHtmlLocalized( 20, 250, 380, 20, 1062208, SelectedColor, false, false ); // This house is <a href = "?ForceTopic97">Grandfathered</a>. break; } case DecayType.Condemned: { AddHtmlLocalized( 20, 250, 380, 20, 1062207, WarningColor, false, false ); // This house is <a href = "?ForceTopic97">Condemned</a>. break; } } AddHtmlLocalized( 20, 290, 200, 20, 1060692, SelectedColor, false, false ); // Built On: AddLabel( 250, 290, LabelHue, GetDateTime( house.BuiltOn ) ); AddHtmlLocalized( 20, 310, 200, 20, 1060693, SelectedColor, false, false ); // Last Traded: AddLabel( 250, 310, LabelHue, GetDateTime( house.LastTraded ) ); AddHtmlLocalized( 20, 330, 200, 20, 1061793, SelectedColor, false, false ); // House Value AddLabel( 250, 330, LabelHue, house.Price.ToString() ); AddHtmlLocalized( 20, 360, 300, 20, 1011241, SelectedColor, false, false ); // Number of visits this building has had: AddLabel( 350, 360, LabelHue, house.Visits.ToString() ); break; } case HouseGumpPageAOS.Security: { AddButtonLabeled( 10, 130, GetButtonID( 3, 0 ), 1011266, isCoOwner ); // View Co-Owner List AddButtonLabeled( 10, 150, GetButtonID( 3, 1 ), 1011267, isOwner ); // Add a Co-Owner AddButtonLabeled( 10, 170, GetButtonID( 3, 2 ), 1018036, isOwner ); // Remove a Co-Owner AddButtonLabeled( 10, 190, GetButtonID( 3, 3 ), 1011268, isOwner ); // Clear Co-Owner List AddButtonLabeled( 10, 220, GetButtonID( 3, 4 ), 1011243 ); // View Friends List AddButtonLabeled( 10, 240, GetButtonID( 3, 5 ), 1011244, isCoOwner ); // Add a Friend AddButtonLabeled( 10, 260, GetButtonID( 3, 6 ), 1018037, isCoOwner ); // Remove a Friend AddButtonLabeled( 10, 280, GetButtonID( 3, 7 ), 1011245, isCoOwner ); // Clear Friend List if ( house.Public ) { AddButtonLabeled( 10, 310, GetButtonID( 3, 8 ), 1011260 ); // View Ban List AddButtonLabeled( 10, 330, GetButtonID( 3, 9 ), 1060698 ); // Clear Ban List AddButtonLabeled( 210, 130, GetButtonID( 3, 12 ), 1060695, isOwner ); // Change to Private AddHtmlLocalized( 245, 150, 240, 20, 1060694, SelectedColor, false, false ); // Change to Public } else { AddButtonLabeled( 10, 310, GetButtonID( 3, 8 ), 1011260 ); // View Ban List AddButtonLabeled( 10, 330, GetButtonID( 3, 9 ), 1060698 ); // Clear Ban List AddButtonLabeled(210, 170, GetButtonID(3, 14), 1011247); // Change the house locks AddHtmlLocalized( 245, 130, 240, 20, 1060695, SelectedColor, false, false ); // Change to Private AddButtonLabeled( 210, 150, GetButtonID( 3, 13 ), 1060694, isOwner ); // Change to Public } break; } case HouseGumpPageAOS.Storage: { AddHtmlLocalized( 10, 130, 400, 20, 1060682, LabelColor, false, false ); // <CENTER>HOUSE STORAGE SUMMARY</CENTER> // This is not as OSI; storage changes not yet implemented /*AddHtmlLocalized( 10, 170, 275, 20, 1011237, LabelColor, false, false ); // Number of locked down items: AddLabel( 310, 170, LabelHue, m_House.LockDownCount.ToString() ); AddHtmlLocalized( 10, 190, 275, 20, 1011238, LabelColor, false, false ); // Maximum locked down items: AddLabel( 310, 190, LabelHue, m_House.MaxLockDowns.ToString() ); AddHtmlLocalized( 10, 210, 275, 20, 1011239, LabelColor, false, false ); // Number of secure containers: AddLabel( 310, 210, LabelHue, m_House.SecureCount.ToString() ); AddHtmlLocalized( 10, 230, 275, 20, 1011240, LabelColor, false, false ); // Maximum number of secure containers: AddLabel( 310, 230, LabelHue, m_House.MaxSecures.ToString() );*/ int fromSecures, fromVendors, fromLockdowns, fromMovingCrate; int maxSecures = house.GetAosMaxSecures(); int curSecures = house.GetAosCurSecures( out fromSecures, out fromVendors, out fromLockdowns, out fromMovingCrate ); int maxLockdowns = house.GetAosMaxLockdowns(); int curLockdowns = house.GetAosCurLockdowns(); int bonusStorage = (int)((house.BonusStorageScalar * 100)-100); if( bonusStorage > 0 ) { AddHtmlLocalized( 10, 150, 300, 20, 1072519, LabelColor, false, false ); // Increased Storage AddLabel( 310, 150, LabelHue, String.Format( "{0}%", bonusStorage ) ); } AddHtmlLocalized( 10, 170, 300, 20, 1060683, LabelColor, false, false ); // Maximum Secure Storage AddLabel( 310, 170, LabelHue, maxSecures.ToString() ); AddHtmlLocalized( 10, 190, 300, 20, 1060685, LabelColor, false, false ); // Used by Moving Crate AddLabel( 310, 190, LabelHue, fromMovingCrate.ToString() ); AddHtmlLocalized( 10, 210, 300, 20, 1060686, LabelColor, false, false ); // Used by Lockdowns AddLabel( 310, 210, LabelHue, fromLockdowns.ToString() ); if ( BaseHouse.NewVendorSystem ) { AddHtmlLocalized( 10, 230, 300, 20, 1060688, LabelColor, false, false ); // Used by Secure Containers AddLabel( 310, 230, LabelHue, fromSecures.ToString() ); AddHtmlLocalized( 10, 250, 300, 20, 1060689, LabelColor, false, false ); // Available Storage AddLabel( 310, 250, LabelHue, Math.Max( maxSecures - curSecures, 0 ).ToString() ); AddHtmlLocalized( 10, 290, 300, 20, 1060690, LabelColor, false, false ); // Maximum Lockdowns AddLabel( 310, 290, LabelHue, maxLockdowns.ToString() ); AddHtmlLocalized( 10, 310, 300, 20, 1060691, LabelColor, false, false ); // Available Lockdowns AddLabel( 310, 310, LabelHue, Math.Max( maxLockdowns - curLockdowns, 0 ).ToString() ); int maxVendors = house.GetNewVendorSystemMaxVendors(); int vendors = house.PlayerVendors.Count + house.VendorRentalContracts.Count; AddHtmlLocalized( 10, 350, 300, 20, 1062391, LabelColor, false, false ); // Vendor Count AddLabel( 310, 350, LabelHue, vendors.ToString() + " / " + maxVendors.ToString() ); } else { AddHtmlLocalized( 10, 230, 300, 20, 1060687, LabelColor, false, false ); // Used by Vendors AddLabel( 310, 230, LabelHue, fromVendors.ToString() ); AddHtmlLocalized( 10, 250, 300, 20, 1060688, LabelColor, false, false ); // Used by Secure Containers AddLabel( 310, 250, LabelHue, fromSecures.ToString() ); AddHtmlLocalized( 10, 270, 300, 20, 1060689, LabelColor, false, false ); // Available Storage AddLabel( 310, 270, LabelHue, Math.Max( maxSecures - curSecures, 0 ).ToString() ); AddHtmlLocalized( 10, 330, 300, 20, 1060690, LabelColor, false, false ); // Maximum Lockdowns AddLabel( 310, 330, LabelHue, maxLockdowns.ToString() ); AddHtmlLocalized( 10, 350, 300, 20, 1060691, LabelColor, false, false ); // Available Lockdowns AddLabel( 310, 350, LabelHue, Math.Max( maxLockdowns - curLockdowns, 0 ).ToString() ); } break; } case HouseGumpPageAOS.Customize: { bool isCustomizable = isOwner && ( house is HouseFoundation ); AddButtonLabeled( 10, 120, GetButtonID( 5, 0 ), 1060759, isOwner && !isCustomizable && ( house.ConvertEntry != null ) ); // Convert Into Customizable House AddButtonLabeled( 10, 160, GetButtonID( 5, 1 ), 1060765, isOwner && isCustomizable ); // Customize This House AddButtonLabeled( 10, 180, GetButtonID( 5, 2 ), 1060760, isOwner && house.MovingCrate != null ); // Relocate Moving Crate AddButtonLabeled( 10, 210, GetButtonID( 5, 3 ), 1060761, isOwner && house.Public ); // Change House Sign AddButtonLabeled( 10, 230, GetButtonID( 5, 4 ), 1060762, isOwner && isCustomizable ); // Change House Sign Hanger AddButtonLabeled( 10, 250, GetButtonID( 5, 5 ), 1060763, isOwner && isCustomizable && ( ((HouseFoundation)house).Signpost != null ) ); // Change Signpost AddButtonLabeled( 10, 280, GetButtonID( 5, 6 ), 1062004, isOwner && isCustomizable ); // Change Foundation Style AddButtonLabeled( 10, 310, GetButtonID( 5, 7 ), 1060764, isCoOwner ); // Rename House break; } case HouseGumpPageAOS.Ownership: { AddButtonLabeled( 10, 130, GetButtonID( 6, 0 ), 1061794, isOwner && house.MovingCrate == null && house.InternalizedVendors.Count == 0 ); // Demolish House AddButtonLabeled( 10, 150, GetButtonID( 6, 1 ), 1061797, isOwner ); // Trade House AddButtonLabeled( 10, 190, GetButtonID( 6, 2 ), 1061798, false ); // Make Primary break; } case HouseGumpPageAOS.ChangeHanger: { for ( int i = 0; i < m_HangerNumbers.Length; ++i ) { int x = 50 + ((i % 3) * 100); int y = 180 + ((i / 3) * 80); AddButton( x, y, 4005, 4007, GetButtonID( 7, i ), GumpButtonType.Reply, 0 ); AddItem( x + 20, y, m_HangerNumbers[i] ); } break; } case HouseGumpPageAOS.ChangeFoundation: { for ( int i = 0; i < m_FoundationNumbers.Length; ++i ) { int x = 15 + ((i % 5) * 80); int y = 180 + ((i / 5) * 100); AddButton( x, y, 4005, 4007, GetButtonID( 8, i ), GumpButtonType.Reply, 0 ); AddItem( x + 25, y, m_FoundationNumbers[i] ); } break; } case HouseGumpPageAOS.ChangeSign: { int index = 0; if ( _HouseSigns.Count == 0 ) { // Add standard signs for ( int i = 0; i < 54; ++i ) { _HouseSigns.Add( 2980 + ( i * 2 ) ); } // Add library and beekeeper signs ( ML ) _HouseSigns.Add( 2966 ); _HouseSigns.Add( 3140 ); } int signsPerPage = Core.ML ? 24 : 18; int totalSigns = Core.ML ? 56 : 54; int pages = (int) Math.Ceiling( (double) totalSigns / signsPerPage ); for ( int i = 0; i < pages; ++i ) { AddPage( i + 1 ); AddButton( 10, 360, 4005, 4007, 0, GumpButtonType.Page, ((i + 1) % pages ) + 1 ); for ( int j = 0; j < signsPerPage && totalSigns - ( signsPerPage * i ) - j > 0; ++j ) { int x = 30 + ((j % 6) * 60); int y = 130 + ((j / 6) * 60); AddButton( x, y, 4005, 4007, GetButtonID( 9, index ), GumpButtonType.Reply, 0 ); AddItem( x + 20, y, _HouseSigns[index++] ); } } break; } case HouseGumpPageAOS.RemoveCoOwner: { AddHtmlLocalized( 10, 120, 400, 20, 1060730, LabelColor, false, false ); // <CENTER>CO-OWNER LIST</CENTER> AddList( house.CoOwners, 10, false, true, from ); break; } case HouseGumpPageAOS.ListCoOwner: { AddHtmlLocalized( 10, 120, 400, 20, 1060730, LabelColor, false, false ); // <CENTER>CO-OWNER LIST</CENTER> AddList( house.CoOwners, -1, false, true, from ); break; } case HouseGumpPageAOS.RemoveFriend: { AddHtmlLocalized( 10, 120, 400, 20, 1060731, LabelColor, false, false ); // <CENTER>FRIENDS LIST</CENTER> AddList( house.Friends, 11, false, true, from ); break; } case HouseGumpPageAOS.ListFriend: { AddHtmlLocalized( 10, 120, 400, 20, 1060731, LabelColor, false, false ); // <CENTER>FRIENDS LIST</CENTER> AddList( house.Friends, -1, false, true, from ); break; } case HouseGumpPageAOS.RemoveBan: { AddHtmlLocalized( 10, 120, 400, 20, 1060733, LabelColor, false, false ); // <CENTER>BAN LIST</CENTER> AddList( house.Bans, 12, true, true, from ); break; } case HouseGumpPageAOS.ListBan: { AddHtmlLocalized( 10, 120, 400, 20, 1060733, LabelColor, false, false ); // <CENTER>BAN LIST</CENTER> AddList( house.Bans, -1, true, true, from ); break; } /*Zycron case HouseGumpPageAOS.RemoveAccess: { AddHtmlLocalized( 10, 120, 400, 20, 1060732, LabelColor, false, false ); // <CENTER>ACCESS LIST</CENTER> AddList( house.Access, 13, false, true, from ); break; } case HouseGumpPageAOS.ListAccess: { AddHtmlLocalized( 10, 120, 400, 20, 1060732, LabelColor, false, false ); // <CENTER>ACCESS LIST</CENTER> AddList( house.Access, -1, false, true, from ); break; } Zycron*/ case HouseGumpPageAOS.ChangePost: { int index = 0; for ( int i = 0; i < 2; ++i ) { AddPage( i + 1 ); AddButton( 10, 360, 4005, 4007, 0, GumpButtonType.Page, ((i + 1) % 2) + 1 ); for ( int j = 0; j < 16 && index < m_PostNumbers.Length; ++j ) { int x = 15 + ((j % 8) * 50); int y = 130 + ((j / 8) * 110); AddButton( x, y, 4005, 4007, GetButtonID( 14, index ), GumpButtonType.Reply, 0 ); AddItem( x + 10, y, m_PostNumbers[index++] ); } } break; } } }
public HouseGumpAOS( HouseGumpPageAOS page, Mobile from, BaseHouse house ) : base(50, 40) { m_House = house; m_Page = page; from.CloseGump( typeof( HouseGumpAOS ) ); //from.CloseGump( typeof( HouseListGump ) ); //from.CloseGump( typeof( HouseRemoveGump ) ); bool isCombatRestricted = house.IsCombatRestricted( from ); bool isOwner = house.IsOwner( from ); bool isCoOwner = isOwner || house.IsCoOwner( from ); bool isFriend = isCoOwner || house.IsFriend( from ); if ( isCombatRestricted ) isFriend = isCoOwner = isOwner = false; AddPage( 0 ); if ( isFriend || page == HouseGumpPageAOS.Vendors ) { AddBackground(0, 0, 420, page != HouseGumpPageAOS.Vendors ? 440 : 420, 9270); AddImageTiled( 10, 10, 400, 100, 2624 ); //AddAlphaRegion( 10, 10, 400, 100 ); AddImageTiled( 10, 120, 400, 260, 2624 ); //AddAlphaRegion( 10, 120, 400, 260 ); AddImageTiled( 10, 390, 400, page != HouseGumpPageAOS.Vendors ? 40 : 20, 2624 ); //AddAlphaRegion( 10, 390, 400, page != HouseGumpPageAOS.Vendors ? 40 : 20 ); AddButtonLabeled( 250, page != HouseGumpPageAOS.Vendors ? 410 : 390, 0, "Fechar", true ); // CLOSE } AddImage( 10, 10, 100 ); if ( m_House.Sign != null ) { ArrayList lines = Wrap( m_House.Sign.GetName() ); if ( lines != null ) { for ( int i = 0, y = (114 - (lines.Count * 14)) / 2; i < lines.Count; ++i, y += 14 ) { string s = (string)lines[i]; AddLabel( 10 + ((160 - (s.Length * 8)) / 2), y, 0, s ); } } } if ( page == HouseGumpPageAOS.Vendors ) { AddHtmlLocalized( 10, 120, 400, 20, 1062428, LabelColor, false, false ); // <CENTER>SHOPS</CENTER> AddList( house.AvailableVendorsFor( from ), 1, false, false, from ); return; } if ( !isFriend ) return; if ( house.Public ) { AddButtonLabeled( 10, 390, GetButtonID( 0, 0 ), "Banir", true); // Banish AddButtonLabeled(10, 410, GetButtonID(0, 1), "Remover Ban", true); // Lift a Ban } else { AddButtonLabeled(10, 390, GetButtonID(0, 2), "Permitir Acesso", true); // Grant Access AddButtonLabeled(10, 410, GetButtonID(0, 3), "Remover Acesso", true); // Revoke Access } AddPageButton( 150, 10, GetButtonID( 1, 0 ), "INFORMAÇÕES", HouseGumpPageAOS.Information ); AddPageButton( 150, 30, GetButtonID( 1, 1 ), "SEGURANÇA", HouseGumpPageAOS.Security ); AddPageButton( 150, 50, GetButtonID( 1, 2 ), "SECURES", HouseGumpPageAOS.Storage ); AddPageButton( 150, 70, GetButtonID( 1, 3 ), "CUSTOMIZAR", HouseGumpPageAOS.Customize ); AddPageButton( 150, 90, GetButtonID( 1, 4 ), "TRANSFERIR", HouseGumpPageAOS.Ownership ); switch ( page ) { case HouseGumpPageAOS.Information: { //AddHtmlLocalized( 20, 130, 200, 20, 1011242, LabelColor, false, false ); // Owned By: AddHtml(20, 130, 200, 20, "Dono: " + GetOwnerName(), false, false); // Owned By: //AddLabel( 210, 130, LabelHue, GetOwnerName() ); AddHtml(20, 170, 380, 20, "Esta casa está colocada corretamente", false, false); // This house is properly placed. AddHtml(20, 190, 380, 20, "Esta casa é de estilo moderno", false, false); // This house is of modern design. AddHtml(20, 210, 380, 20, (house is HouseFoundation) ? "Esta é uma casa customizada" : "Esta é uma casa pré-moldada", false, false); // This is a (pre | custom)-built house. //AddHtmlLocalized(20, 230, 380, 20, house.Public ? "" : 1060679, SelectedColor, false, false); // This house is (private | open to the public). AddHtml(20, 230, 380, 20, house.Public ? "Esta casa é pública" : "Esta casa é restrita", false, false); // This house is (private | open to the public). switch ( house.DecayType ) { case DecayType.Ageless: case DecayType.AutoRefresh: { AddHtml(20, 250, 380, 20, "Esta casa tem Refresh Automático", false, false); // This house is <a href = "?ForceTopic97">Automatically</a> refreshed. break; } case DecayType.ManualRefresh: { AddHtml(20, 250, 380, 20, "Esta casa necessita de Refresh a cada 30 dias", false, false); // This house is <a href = "?ForceTopic97">Grandfathered</a>. break; } case DecayType.Condemned: { AddHtml(20, 250, 380, 20, "Esta casa está condenada", false, false); // This house is <a href = "?ForceTopic97">Condemned</a>. break; } } AddHtml(20, 290, 200, 20, "Construída em", false, false); // Built On: AddLabel( 250, 290, LabelHue, GetDateTime( house.BuiltOn ) ); AddHtml(20, 310, 200, 20, "Última negociação", false, false); // Last Traded: AddLabel( 250, 310, LabelHue, GetDateTime( house.LastTraded ) ); AddHtml(20, 330, 200, 20, "Valor da casa", false, false); // House Value AddLabel( 250, 330, LabelHue, house.Price.ToString() ); AddHtml(20, 360, 300, 20, "Número de visitas a esta casa", false, false); // Number of visits this building has had: AddLabel( 350, 360, LabelHue, house.Visits.ToString() ); break; } case HouseGumpPageAOS.Security: { //AddButtonLabeled( 10, 130, GetButtonID( 3, 0 ), 1011266, isCoOwner ); // View Co-Owner List //AddButtonLabeled( 10, 150, GetButtonID( 3, 1 ), 1011267, isOwner ); // Add a Co-Owner //AddButtonLabeled( 10, 170, GetButtonID( 3, 2 ), 1018036, isOwner ); // Remove a Co-Owner //AddButtonLabeled( 10, 190, GetButtonID( 3, 3 ), 1011268, isOwner ); // Clear Co-Owner List AddButtonLabeled(10, 130, GetButtonID(3, 0), "Lista de Sócios", isCoOwner); // View Co-Owner List AddButtonLabeled(10, 150, GetButtonID(3, 1), "Adicionar Sócio", isOwner); // Add a Co-Owner AddButtonLabeled(10, 170, GetButtonID(3, 2), "Remover Sócio", isOwner); // Remove a Co-Owner AddButtonLabeled(10, 190, GetButtonID(3, 3), "Limpar Lista de Sócios", isOwner); // Clear Co-Owner List //AddButtonLabeled( 10, 220, GetButtonID( 3, 4 ), 1011243 ); // View Friends List //AddButtonLabeled( 10, 240, GetButtonID( 3, 5 ), 1011244, isCoOwner ); // Add a Friend //AddButtonLabeled( 10, 260, GetButtonID( 3, 6 ), 1018037, isCoOwner ); // Remove a Friend //AddButtonLabeled( 10, 280, GetButtonID( 3, 7 ), 1011245, isCoOwner ); // Clear Friend List AddButtonLabeled(10, 220, GetButtonID(3, 4), "Lista de Amigos", true); // View Friends List AddButtonLabeled(10, 240, GetButtonID(3, 5), "Adicionar Amigo", isCoOwner); // Add a Friend AddButtonLabeled(10, 260, GetButtonID(3, 6), "Remover Amigo", isCoOwner); // Remove a Friend AddButtonLabeled(10, 280, GetButtonID(3, 7), "Limpar Lista de Amigos", isCoOwner); // Clear Friend List if ( house.Public ) { //AddButtonLabeled( 10, 310, GetButtonID( 3, 8 ), 1011260 ); // View Ban List //AddButtonLabeled( 10, 330, GetButtonID( 3, 9 ), 1060698 ); // Clear Ban List //AddButtonLabeled( 210, 130, GetButtonID( 3, 12 ), 1060695, isOwner ); // Change to Private //AddHtmlLocalized( 245, 150, 240, 20, 1060694, SelectedColor, false, false ); // Change to Public AddButtonLabeled(10, 310, GetButtonID(3, 8), "Lista de Bans", true); // View Ban List AddButtonLabeled(10, 330, GetButtonID(3, 9), "Limpar Lista de Bans", true); // Clear Ban List AddButtonLabeled(210, 130, GetButtonID(3, 12), "Tornar Casa Privada", isOwner); // Change to Private AddHtml(245, 150, 240, 20, "Tornar Casa Pública", false, false); // Change to Public } else { //AddButtonLabeled( 10, 310, GetButtonID( 3, 10 ), 1060699 ); // View Access List //AddButtonLabeled( 10, 330, GetButtonID( 3, 11 ), 1060700 ); // Clear Access List //AddHtmlLocalized( 245, 130, 240, 20, 1060695, SelectedColor, false, false ); // Change to Private //AddButtonLabeled( 210, 150, GetButtonID( 3, 13 ), 1060694, isOwner ); // Change to Public AddButtonLabeled(10, 310, GetButtonID(3, 10), "Lista de Acessos", true); // View Access List AddButtonLabeled(10, 330, GetButtonID(3, 11), "Limpar Lista de Acessos", true); // Clear Access List AddHtml(245, 130, 240, 20, "Tornar Casa Privada", false, false); // Change to Private AddButtonLabeled(210, 150, GetButtonID(3, 13), "Tornar Casa Pública", isOwner); // Change to Public } break; } case HouseGumpPageAOS.Storage: { AddHtmlLocalized( 10, 130, 400, 20, 1060682, LabelColor, false, false ); // <CENTER>HOUSE STORAGE SUMMARY</CENTER> // This is not as OSI; storage changes not yet implemented /*AddHtmlLocalized( 10, 170, 275, 20, 1011237, LabelColor, false, false ); // Number of locked down items: AddLabel( 310, 170, LabelHue, m_House.LockDownCount.ToString() ); AddHtmlLocalized( 10, 190, 275, 20, 1011238, LabelColor, false, false ); // Maximum locked down items: AddLabel( 310, 190, LabelHue, m_House.MaxLockDowns.ToString() ); AddHtmlLocalized( 10, 210, 275, 20, 1011239, LabelColor, false, false ); // Number of secure containers: AddLabel( 310, 210, LabelHue, m_House.SecureCount.ToString() ); AddHtmlLocalized( 10, 230, 275, 20, 1011240, LabelColor, false, false ); // Maximum number of secure containers: AddLabel( 310, 230, LabelHue, m_House.MaxSecures.ToString() );*/ int fromSecures, fromVendors, fromLockdowns, fromMovingCrate; int maxSecures = house.GetAosMaxSecures(); int curSecures = house.GetAosCurSecures( out fromSecures, out fromVendors, out fromLockdowns, out fromMovingCrate ); int maxLockdowns = house.GetAosMaxLockdowns(); int curLockdowns = house.GetAosCurLockdowns(); int bonusStorage = (int)((house.BonusStorageScalar * 100)-100); //if( bonusStorage > 0 ) //{ // //AddHtmlLocalized( 10, 150, 300, 20, 1072519, LabelColor, false, false ); // Increased Storage // AddLabel( 310, 150, LabelHue, String.Format( "{0}%", bonusStorage ) ); //} //AddHtmlLocalized( 10, 170, 300, 20, 1060683, LabelColor, false, false ); // Maximum Secure Storage AddHtml(10, 170, 300, 20, "Maximo de Secures", false, false); // Maximum Secure Storage AddLabel( 310, 170, LabelHue, maxSecures.ToString() ); //AddHtmlLocalized( 10, 190, 300, 20, 1060685, LabelColor, false, false ); // Used by Moving Crate AddHtml(10, 190, 300, 20, "Utilizado por Itens Moveis", false, false); // Used by Moving Crate AddLabel( 310, 190, LabelHue, fromMovingCrate.ToString() ); //AddHtmlLocalized( 10, 210, 300, 20, 1060686, LabelColor, false, false ); // Used by Lockdowns AddHtml(10, 210, 300, 20, "Utilizado por Lockdowns", false, false); // Used by Lockdowns AddLabel( 310, 210, LabelHue, fromLockdowns.ToString() ); if ( BaseHouse.NewVendorSystem ) { //AddHtmlLocalized( 10, 230, 300, 20, 1060688, LabelColor, false, false ); // Used by Secure Containers AddHtml(10, 230, 300, 20, "Utilizado por Secures Containers", false, false); // Used by Secure Containers AddLabel( 310, 230, LabelHue, fromSecures.ToString() ); //AddHtmlLocalized( 10, 250, 300, 20, 1060689, LabelColor, false, false ); // Available Storage AddHtml(10, 250, 300, 20, "Storages Disponíveis", false, false); // Available Storage AddLabel( 310, 250, LabelHue, Math.Max( maxSecures - curSecures, 0 ).ToString() ); //AddHtmlLocalized( 10, 290, 300, 20, 1060690, LabelColor, false, false ); // Maximum Lockdowns AddHtml(10, 290, 300, 20, "Máximo de Lockdowns", false, false); // Maximum Lockdowns AddLabel( 310, 290, LabelHue, maxLockdowns.ToString() ); //AddHtmlLocalized( 10, 310, 300, 20, 1060691, LabelColor, false, false ); // Available Lockdowns AddHtml(10, 310, 300, 20, "Lockdowns Disponíveis", false, false); // Available Lockdowns AddLabel( 310, 310, LabelHue, Math.Max( maxLockdowns - curLockdowns, 0 ).ToString() ); int maxVendors = house.GetNewVendorSystemMaxVendors(); int vendors = house.PlayerVendors.Count + house.VendorRentalContracts.Count; //AddHtmlLocalized( 10, 350, 300, 20, 1062391, LabelColor, false, false ); // Vendor Count AddHtml(10, 350, 300, 20, "Total Vendors", false, false); // Vendor Count AddLabel( 310, 350, LabelHue, vendors.ToString() + " / " + maxVendors.ToString() ); } else { //AddHtmlLocalized( 10, 230, 300, 20, 1060687, LabelColor, false, false ); // Used by Vendors AddHtml(10, 230, 300, 20, "Utilizado por Vendors", false, false); // Used by Vendors AddLabel( 310, 230, LabelHue, fromVendors.ToString() ); //AddHtmlLocalized( 10, 250, 300, 20, 1060688, LabelColor, false, false ); // Used by Secure Containers AddHtml(10, 250, 300, 20, "Utilizado por Secure Containers", false, false); // Used by Secure Containers AddLabel( 310, 250, LabelHue, fromSecures.ToString() ); //AddHtmlLocalized( 10, 270, 300, 20, 1060689, LabelColor, false, false ); // Available Storage AddHtml(10, 270, 300, 20, "Storages Disponíveis", false, false); // Available Storage AddLabel( 310, 270, LabelHue, Math.Max( maxSecures - curSecures, 0 ).ToString() ); //AddHtmlLocalized( 10, 330, 300, 20, 1060690, LabelColor, false, false ); // Maximum Lockdowns AddHtml(10, 330, 300, 20, "Máximo de Lockdowns", false, false); // Maximum Lockdowns AddLabel( 310, 330, LabelHue, maxLockdowns.ToString() ); //AddHtmlLocalized( 10, 350, 300, 20, 1060691, LabelColor, false, false ); // Available Lockdowns AddHtml(10, 350, 300, 20, "Lockdowns Disponíveis", false, false); // Available Lockdowns AddLabel( 310, 350, LabelHue, Math.Max( maxLockdowns - curLockdowns, 0 ).ToString() ); } break; } case HouseGumpPageAOS.Customize: { bool isCustomizable = isOwner && ( house is HouseFoundation ); //AddButtonLabeled(10, 120, GetButtonID(5, 0), "Transformar em Casa Custom", isOwner && !isCustomizable && (house.ConvertEntry != null)); // Convert Into Customizable House //AddButtonLabeled(10, 160, GetButtonID(5, 1), "Customizar Casa", isOwner && isCustomizable); // Customize This House //AddButtonLabeled(10, 180, GetButtonID(5, 2), 1060760, isOwner && house.MovingCrate != null); // Relocate Moving Crate AddButtonLabeled(10, 120, GetButtonID(5, 10), "Tornar um Cofre Seguro", isOwner || isCoOwner); AddButtonLabeled(10, 140, GetButtonID(5, 11), "Destrancar um Cofre", isOwner || isCoOwner); AddButtonLabeled(10, 160, GetButtonID(5, 12), "Trancar Item", isOwner || isCoOwner); AddButtonLabeled(10, 180, GetButtonID(5, 13), "Destrancar Item", isOwner || isCoOwner); //AddButtonLabeled(10, 230, GetButtonID( 5, 3 ), "Mudar Placa", isOwner); // Change House Sign AddButtonLabeled(10, 230, GetButtonID(5, 7), "Renomear Casa", isCoOwner); // Rename House //AddButtonLabeled( 10, 270, GetButtonID( 5, 4 ), "Mudar Assinatura", isOwner); // Change House Sign Hanger //AddButtonLabeled(10, 250, GetButtonID(5, 5), 1060763, isOwner && isCustomizable && (((HouseFoundation)house).Signpost != null)); // Change Signpost //AddButtonLabeled(10, 280, GetButtonID(5, 6), 1062004, isOwner && isCustomizable); // Change Foundation Style break; } case HouseGumpPageAOS.Ownership: { AddButtonLabeled( 10, 130, GetButtonID( 6, 0 ), "Demolir Casa", isOwner && house.MovingCrate == null && house.InternalizedVendors.Count == 0 ); // Demolish House AddButtonLabeled( 10, 150, GetButtonID( 6, 1 ), "Transferir Casa", isOwner ); // Trade House AddButtonLabeled( 10, 190, GetButtonID( 6, 2 ), "Definir como casa primária", false ); // Make Primary break; } case HouseGumpPageAOS.ChangeHanger: { for ( int i = 0; i < m_HangerNumbers.Length; ++i ) { int x = 50 + ((i % 3) * 100); int y = 180 + ((i / 3) * 80); AddButton( x, y, 4005, 4007, GetButtonID( 7, i ), GumpButtonType.Reply, 0 ); AddItem( x + 20, y, m_HangerNumbers[i] ); } break; } case HouseGumpPageAOS.ChangeFoundation: { for ( int i = 0; i < m_FoundationNumbers.Length; ++i ) { int x = 15 + ((i % 5) * 80); int y = 180 + ((i / 5) * 100); AddButton( x, y, 4005, 4007, GetButtonID( 8, i ), GumpButtonType.Reply, 0 ); AddItem( x + 25, y, m_FoundationNumbers[i] ); } break; } case HouseGumpPageAOS.ChangeSign: { int index = 0; if ( _HouseSigns.Count == 0 ) { // Add standard signs for ( int i = 0; i < 54; ++i ) { _HouseSigns.Add( 2980 + ( i * 2 ) ); } // Add library and beekeeper signs ( ML ) _HouseSigns.Add( 2966 ); _HouseSigns.Add( 3140 ); } int signsPerPage = Core.ML ? 24 : 18; int totalSigns = Core.ML ? 56 : 54; int pages = (int) Math.Ceiling( (double) totalSigns / signsPerPage ); for ( int i = 0; i < pages; ++i ) { AddPage( i + 1 ); AddButton( 10, 360, 4005, 4007, 0, GumpButtonType.Page, ((i + 1) % pages ) + 1 ); for ( int j = 0; j < signsPerPage && totalSigns - ( signsPerPage * i ) - j > 0; ++j ) { int x = 30 + ((j % 6) * 60); int y = 130 + ((j / 6) * 60); AddButton( x, y, 4005, 4007, GetButtonID( 9, index ), GumpButtonType.Reply, 0 ); AddItem( x + 20, y, _HouseSigns[index++] ); } } break; } case HouseGumpPageAOS.RemoveCoOwner: { //AddHtmlLocalized( 10, 120, 400, 20, 1060730, LabelColor, false, false ); // <CENTER>CO-OWNER LIST</CENTER> AddHtml(10, 120, 400, 20, "<CENTER>LISTA DE SÓCIOS</CENTER>", false, false); // <CENTER>CO-OWNER LIST</CENTER> AddList( house.CoOwners, 10, false, true, from ); break; } case HouseGumpPageAOS.ListCoOwner: { //AddHtmlLocalized( 10, 120, 400, 20, 1060730, LabelColor, false, false ); // <CENTER>CO-OWNER LIST</CENTER> AddHtml(10, 120, 400, 20, "<CENTER>LISTA DE SÓCIOS</CENTER>", false, false); // <CENTER>CO-OWNER LIST</CENTER> AddList( house.CoOwners, -1, false, true, from ); break; } case HouseGumpPageAOS.RemoveFriend: { //AddHtmlLocalized( 10, 120, 400, 20, 1060731, LabelColor, false, false ); // <CENTER>FRIENDS LIST</CENTER> AddHtml(10, 120, 400, 20, "<CENTER>LISTA DE AMIGOS</CENTER>", false, false); // <CENTER>FRIENDS LIST</CENTER> AddList( house.Friends, 11, false, true, from ); break; } case HouseGumpPageAOS.ListFriend: { //AddHtmlLocalized( 10, 120, 400, 20, 1060731, LabelColor, false, false ); // <CENTER>FRIENDS LIST</CENTER> AddHtml(10, 120, 400, 20, "<CENTER>LISTA DE AMIGOS</CENTER>", false, false); // <CENTER>FRIENDS LIST</CENTER> AddList( house.Friends, -1, false, true, from ); break; } case HouseGumpPageAOS.RemoveBan: { //AddHtmlLocalized( 10, 120, 400, 20, 1060733, LabelColor, false, false ); // <CENTER>BAN LIST</CENTER> AddHtml(10, 120, 400, 20, "<CENTER>LISTA DE BANS</CENTER>", false, false); // <CENTER>BAN LIST</CENTER> AddList( house.Bans, 12, true, true, from ); break; } case HouseGumpPageAOS.ListBan: { //AddHtmlLocalized( 10, 120, 400, 20, 1060733, LabelColor, false, false ); // <CENTER>BAN LIST</CENTER> AddHtml(10, 120, 400, 20, "<CENTER>LISTA DE BANS</CENTER>", false, false); // <CENTER>BAN LIST</CENTER> AddList( house.Bans, -1, true, true, from ); break; } case HouseGumpPageAOS.RemoveAccess: { //AddHtmlLocalized( 10, 120, 400, 20, 1060732, LabelColor, false, false ); // <CENTER>ACCESS LIST</CENTER> AddHtml(10, 120, 400, 20, "<CENTER>LISTA DE ACESSOS</CENTER>", false, false); // <CENTER>ACCESS LIST</CENTER> AddList(house.Access, 13, false, true, from); break; } case HouseGumpPageAOS.ListAccess: { //AddHtmlLocalized( 10, 120, 400, 20, 1060732, LabelColor, false, false ); // <CENTER>ACCESS LIST</CENTER> AddHtml(10, 120, 400, 20, "<CENTER>LISTA DE ACESSOS</CENTER>", false, false); // <CENTER>ACCESS LIST</CENTER> AddList( house.Access, -1, false, true, from ); break; } case HouseGumpPageAOS.ChangePost: { int index = 0; for ( int i = 0; i < 2; ++i ) { AddPage( i + 1 ); AddButton( 10, 360, 4005, 4007, 0, GumpButtonType.Page, ((i + 1) % 2) + 1 ); for ( int j = 0; j < 16 && index < m_PostNumbers.Length; ++j ) { int x = 15 + ((j % 8) * 50); int y = 130 + ((j / 8) * 110); AddButton( x, y, 4005, 4007, GetButtonID( 14, index ), GumpButtonType.Reply, 0 ); AddItem( x + 10, y, m_PostNumbers[index++] ); } } break; } } }