protected override void OnTarget(Mobile from, object target)
        {
            if (m_Deed.Deleted || m_Deed.RootParent != from)
            {
                return;
            }

            if (target is HouseSign)
            {
                HouseSign item = (HouseSign)target;
                BaseHouse bh   = item.m_Owner;

                if (bh.DecayLevel != DecayLevel.IDOC)
                {
                    from.SendMessage("This house is not in danger of collapsing.");
                }
                else
                {
                    if (!BaseHouse.HasAccountHouse(from))
                    {
                        //clear the current house info and do the transfer
                        bh.RemoveKeys(bh.Owner);

                        bh.Owner = from;
                        bh.Bans.Clear();
                        bh.Friends.Clear();
                        bh.CoOwners.Clear();
                        bh.ChangeLocks(from);
                        bh.LastTraded = DateTime.Now;
                        bh.RefreshDecay();

                        from.SendMessage("You are now the proud owner of this IDOC.  The house has been refreshed.");

                        m_Deed.Delete();                         // Delete the deed
                    }
                    else
                    {
                        from.SendMessage("You cannot own another house at this time.");
                    }
                }
            }
            else
            {
                from.SendMessage("You must target a house sign!");
            }
        }
Beispiel #2
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            if (m_House.Deleted)
            {
                return;
            }

            Mobile from = sender.Mobile;

            bool isCombatRestricted = m_House.IsCombatRestricted(from);

            bool isOwner   = m_House.IsOwner(from);
            bool isCoOwner = isOwner || m_House.IsCoOwner(from);
            bool isFriend  = isCoOwner || m_House.IsFriend(from);

            if (isCombatRestricted)
            {
                isFriend = isCoOwner = isOwner = false;
            }

            if (!isFriend || !from.Alive)
            {
                return;
            }

            Item sign = m_House.Sign;

            if (sign == null || from.Map != sign.Map || !from.InRange(sign.GetWorldLocation(), 18))
            {
                return;
            }

            switch (info.ButtonID)
            {
            case 1:                     // Rename sign
            {
                from.Prompt = new RenamePrompt(m_House);
                from.SendLocalizedMessage(501302);                           // What dost thou wish the sign to say?

                break;
            }

            case 2:                     // List of co-owners
            {
                from.CloseGump(typeof(HouseGump));
                from.CloseGump(typeof(HouseListGump));
                from.CloseGump(typeof(HouseRemoveGump));
                from.SendGump(new HouseListGump(1011275, m_House.CoOwners, m_House, false));

                break;
            }

            case 3:                     // Add co-owner
            {
                if (isOwner)
                {
                    from.SendLocalizedMessage(501328);                               // Target the person you wish to name a co-owner of your household.
                    from.Target = new CoOwnerTarget(true, m_House);
                }
                else
                {
                    from.SendLocalizedMessage(501327);                               // Only the house owner may add Co-owners.
                }

                break;
            }

            case 4:                     // Remove co-owner
            {
                if (isOwner)
                {
                    from.CloseGump(typeof(HouseGump));
                    from.CloseGump(typeof(HouseListGump));
                    from.CloseGump(typeof(HouseRemoveGump));
                    from.SendGump(new HouseRemoveGump(1011274, m_House.CoOwners, m_House, false));
                }
                else
                {
                    from.SendLocalizedMessage(501329);                               // Only the house owner may remove co-owners.
                }

                break;
            }

            case 5:                     // Clear co-owners
            {
                if (isOwner)
                {
                    if (m_House.CoOwners != null)
                    {
                        m_House.CoOwners.Clear();
                    }

                    from.SendLocalizedMessage(501333);                               // All co-owners have been removed from this house.
                }
                else
                {
                    from.SendLocalizedMessage(501330);                               // Only the house owner may remove co-owners.
                }

                break;
            }

            case 6:                     // List friends
            {
                from.CloseGump(typeof(HouseGump));
                from.CloseGump(typeof(HouseListGump));
                from.CloseGump(typeof(HouseRemoveGump));
                from.SendGump(new HouseListGump(1011273, m_House.Friends, m_House, false));

                break;
            }

            case 7:                     // Add friend
            {
                if (isCoOwner)
                {
                    from.SendLocalizedMessage(501317);                               // Target the person you wish to name a friend of your household.
                    from.Target = new HouseFriendTarget(true, m_House);
                }
                else
                {
                    from.SendLocalizedMessage(501316);                               // Only the house owner may add friends.
                }

                break;
            }

            case 8:                     // Remove friend
            {
                if (isCoOwner)
                {
                    from.CloseGump(typeof(HouseGump));
                    from.CloseGump(typeof(HouseListGump));
                    from.CloseGump(typeof(HouseRemoveGump));
                    from.SendGump(new HouseRemoveGump(1011272, m_House.Friends, m_House, false));
                }
                else
                {
                    from.SendLocalizedMessage(501318);                               // Only the house owner may remove friends.
                }

                break;
            }

            case 9:                     // Clear friends
            {
                if (isCoOwner)
                {
                    if (m_House.Friends != null)
                    {
                        m_House.Friends.Clear();
                    }

                    from.SendLocalizedMessage(501332);                               // All friends have been removed from this house.
                }
                else
                {
                    from.SendLocalizedMessage(501319);                               // Only the house owner may remove friends.
                }

                break;
            }

            case 10:                               // Ban
            {
                from.SendLocalizedMessage(501325); // Target the individual to ban from this house.
                from.Target = new HouseBanTarget(true, m_House);

                break;
            }

            case 11:                               // Eject
            {
                from.SendLocalizedMessage(501326); // Target the individual to eject from this house.
                from.Target = new HouseKickTarget(m_House);

                break;
            }

            case 12:                     // List bans
            {
                from.CloseGump(typeof(HouseGump));
                from.CloseGump(typeof(HouseListGump));
                from.CloseGump(typeof(HouseRemoveGump));
                from.SendGump(new HouseListGump(1011271, m_House.Bans, m_House, true));

                break;
            }

            case 13:                     // Remove ban
            {
                from.CloseGump(typeof(HouseGump));
                from.CloseGump(typeof(HouseListGump));
                from.CloseGump(typeof(HouseRemoveGump));
                from.SendGump(new HouseRemoveGump(1011269, m_House.Bans, m_House, true));

                break;
            }

            case 14:                     // Transfer ownership
            {
                if (isOwner)
                {
                    from.SendLocalizedMessage(501309);                               // Target the person to whom you wish to give this house.
                    from.Target = new HouseOwnerTarget(m_House);
                }
                else
                {
                    from.SendLocalizedMessage(501310);                               // Only the house owner may do this.
                }

                break;
            }

            case 15:                     // Demolish house
            {
                if (isOwner)
                {
                    from.CloseGump(typeof(HouseDemolishGump));
                    from.SendGump(new HouseDemolishGump(from, m_House));
                }

                else
                {
                    from.SendLocalizedMessage(501320);                               // Only the house owner may do this.
                }

                break;
            }

            case 16:                     // Change locks
            {
                if (m_House.Public)
                {
                    from.SendLocalizedMessage(501669);                              // Public houses are always unlocked.
                }
                else
                {
                    if (isOwner)
                    {
                        m_House.RemoveKeys(from);
                        m_House.ChangeLocks(from);

                        from.SendLocalizedMessage(501306);                                   // The locks on your front door have been changed, and new master keys have been placed in your bank and your backpack.
                    }
                    else
                    {
                        from.SendLocalizedMessage(501303);                                   // Only the house owner may change the house locks.
                    }
                }

                break;
            }

            case 17:                     // Declare public/private
            {
                if (isOwner)
                {
                    if (m_House.Public && m_House.PlayerVendors.Count > 0)
                    {
                        from.SendLocalizedMessage(501887);                                   // You have vendors working out of this building. It cannot be declared private until there are no vendors in place.
                        break;
                    }

                    m_House.Public = !m_House.Public;
                    if (!m_House.Public)
                    {
                        m_House.ChangeLocks(from);

                        from.SendLocalizedMessage(501888);                                   // This house is now private.
                        from.SendLocalizedMessage(501306);                                   // The locks on your front door have been changed, and new master keys have been placed in your bank and your backpack.
                    }
                    else
                    {
                        m_House.RemoveKeys(from);
                        m_House.RemoveLocks();
                        from.SendLocalizedMessage(501886);                                  //This house is now public. Friends of the house my now have vendors working out of this building.
                    }
                }
                else
                {
                    from.SendLocalizedMessage(501307);                               // Only the house owner may do this.
                }

                break;
            }

            case 18:                     // Change type
            {
                if (isOwner)
                {
                    if (m_House.Public && info.Switches.Length > 0)
                    {
                        int index = info.Switches[0] - 1;

                        if (index >= 0 && index < 53)
                        {
                            m_House.ChangeSignType(2980 + (index * 2));
                        }
                    }
                }
                else
                {
                    from.SendLocalizedMessage(501307);                               // Only the house owner may do this.
                }

                break;
            }
            }
        }
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            if (m_House.Deleted)
            {
                return;
            }

            Mobile from = sender.Mobile;

            bool isCombatRestricted = m_House.IsCombatRestricted(from);

            bool isOwner   = m_House.IsOwner(from);
            bool isCoOwner = isOwner || m_House.IsCoOwner(from);
            bool isFriend  = isCoOwner || m_House.IsFriend(from);

            if (isCombatRestricted)
            {
                isFriend = isCoOwner = isOwner = false;
            }

            if (!isFriend || !from.Alive)
            {
                return;
            }

            Item sign = m_House.Sign;

            if (sign == null || from.Map != sign.Map || !from.InRange(sign.GetWorldLocation(), 18))
            {
                return;
            }

            switch (info.ButtonID)
            {
            case 1:                     // Rename sign
            {
                from.Prompt = new RenamePrompt(m_House);
                from.SendMessage("Digite o nome da casa");     // What dost thou wish the sign to say?

                break;
            }

            case 2:                     // List of co-owners
            {
                from.CloseGump(typeof(HouseGump));
                from.CloseGump(typeof(HouseListGump));
                from.CloseGump(typeof(HouseRemoveGump));
                from.SendGump(new HouseListGump(1011275, m_House.CoOwners, m_House, false));

                break;
            }

            case 3:                     // Add co-owner
            {
                if (isOwner)
                {
                    //from.SendLocalizedMessage( 501328 ); // Target the person you wish to name a co-owner of your household.
                    from.SendMessage("Selecione a pessoa para ser Sócio da casa");
                    from.Target = new CoOwnerTarget(true, m_House);
                }
                else
                {
                    from.SendMessage("Apenas o Dono da Casa pode adicionar Sócios");
                    //from.SendLocalizedMessage( 501327 ); // Only the house owner may add Co-owners.
                }

                break;
            }

            case 4:                     // Remove co-owner
            {
                if (isOwner)
                {
                    from.CloseGump(typeof(HouseGump));
                    from.CloseGump(typeof(HouseListGump));
                    from.CloseGump(typeof(HouseRemoveGump));
                    from.SendGump(new HouseRemoveGump(1011274, m_House.CoOwners, m_House, false));
                }
                else
                {
                    from.SendMessage("Apenas o Dono da Casa pode remover Sócios");
                    //from.SendLocalizedMessage( 501329 ); // Only the house owner may remove co-owners.
                }

                break;
            }

            case 5:                     // Clear co-owners
            {
                if (isOwner)
                {
                    if (m_House.CoOwners != null)
                    {
                        m_House.CoOwners.Clear();
                    }

                    //from.SendLocalizedMessage( 501333 ); // All co-owners have been removed from this house.
                    from.SendMessage("Todos os Sócios da Casa foram removidos.");
                }
                else
                {
                    from.SendMessage("Apenas o Dono da Casa pode remover Sócios");
                    //from.SendLocalizedMessage( 501330 ); // Only the house owner may remove co-owners.
                }

                break;
            }

            case 6:                     // List friends
            {
                from.CloseGump(typeof(HouseGump));
                from.CloseGump(typeof(HouseListGump));
                from.CloseGump(typeof(HouseRemoveGump));
                from.SendGump(new HouseListGump(1011273, m_House.Friends, m_House, false));

                break;
            }

            case 7:                     // Add friend
            {
                if (isCoOwner)
                {
                    from.SendMessage("Selecione a pessoa para ser Amigo na casa");
                    //from.SendLocalizedMessage( 501317 ); // Target the person you wish to name a friend of your household.
                    from.Target = new HouseFriendTarget(true, m_House);
                }
                else
                {
                    //from.SendMessage("Apenas o Dono da Casa pode adicionar Amigos");
                    from.SendLocalizedMessage(501316);                               // Only the house owner may add friends.
                }

                break;
            }

            case 8:                     // Remove friend
            {
                if (isCoOwner)
                {
                    from.CloseGump(typeof(HouseGump));
                    from.CloseGump(typeof(HouseListGump));
                    from.CloseGump(typeof(HouseRemoveGump));
                    from.SendGump(new HouseRemoveGump(1011272, m_House.Friends, m_House, false));
                }
                else
                {
                    from.SendMessage("Apenas o Dono da Casa pode remover Amigos");
                    //from.SendLocalizedMessage( 501318 ); // Only the house owner may remove friends.
                }

                break;
            }

            case 9:                     // Clear friends
            {
                if (isCoOwner)
                {
                    if (m_House.Friends != null)
                    {
                        m_House.Friends.Clear();
                    }

                    from.SendMessage("Todos os Amigos da Casa foram removidos.");
                    //from.SendLocalizedMessage( 501332 ); // All friends have been removed from this house.
                }
                else
                {
                    from.SendMessage("Apenas o Dono da Casa pode remover Amigos");
                    //from.SendLocalizedMessage( 501319 ); // Only the house owner may remove friends.
                }

                break;
            }

            case 10:                     // Ban
            {
                from.SendMessage("Selecione a pessoa que você deseja Banir da Casa");
                //from.SendLocalizedMessage( 501325 ); // Target the individual to ban from this house.
                from.Target = new HouseBanTarget(true, m_House);

                break;
            }

            case 11:                     // Eject
            {
                from.SendMessage("Selecione a pessoa que você deseja Kickar da Casa");
                from.SendLocalizedMessage(501326);                           // Target the individual to eject from this house.
                from.Target = new HouseKickTarget(m_House);

                break;
            }

            case 12:                     // List bans
            {
                from.CloseGump(typeof(HouseGump));
                from.CloseGump(typeof(HouseListGump));
                from.CloseGump(typeof(HouseRemoveGump));
                from.SendGump(new HouseListGump(1011271, m_House.Bans, m_House, true));

                break;
            }

            case 13:                     // Remove ban
            {
                from.CloseGump(typeof(HouseGump));
                from.CloseGump(typeof(HouseListGump));
                from.CloseGump(typeof(HouseRemoveGump));
                from.SendGump(new HouseRemoveGump(1011269, m_House.Bans, m_House, true));

                break;
            }

            case 14:                     // Transfer ownership
            {
                if (isOwner)
                {
                    from.SendMessage("Selecione a pessoa que você deseja Transferir a Casa");
                    //from.SendLocalizedMessage( 501309 ); // Target the person to whom you wish to give this house.
                    from.Target = new HouseOwnerTarget(m_House);
                }
                else
                {
                    from.SendMessage("Apenas o dono da Casa pode realizar esta acao");
                    //from.SendLocalizedMessage( 501310 ); // Only the house owner may do this.
                }

                break;
            }

            case 15:                     // Demolish house
            {
                if (isOwner)
                {
                    if (!Guilds.Guild.NewGuildSystem && m_House.FindGuildstone() != null)
                    {
                        from.SendMessage("Voce nao pode demolir a casa com uma GuildStone dentro");
                        //from.SendLocalizedMessage( 501389 ); // You cannot redeed a house with a guildstone inside.
                    }
                    else
                    {
                        from.CloseGump(typeof(HouseDemolishGump));
                        from.SendGump(new HouseDemolishGump(from, m_House));
                    }
                }
                else
                {
                    from.SendMessage("Apenas o dono da Casa pode realizar esta acao");
                    //from.SendLocalizedMessage( 501320 ); // Only the house owner may do this.
                }

                break;
            }

            case 16:                     // Change locks
            {
                if (m_House.Public)
                {
                    from.SendMessage("Casas publicas ficam sempre abertas");
                    //from.SendLocalizedMessage( 501669 );// Public houses are always unlocked.
                }
                else
                {
                    if (isOwner)
                    {
                        m_House.RemoveKeys(from);
                        m_House.ChangeLocks(from);

                        from.SendMessage("As fechaduras foram trocas. Uma copia da chave foi colocada na sua Mochila e outra em seu Banco");
                        //from.SendLocalizedMessage( 501306 ); // The locks on your front door have been changed, and new master keys have been placed in your bank and your backpack.
                    }
                    else
                    {
                        from.SendMessage("Apenas o Dono da Casa pode trocar as fechaduras");
                        //from.SendLocalizedMessage( 501303 ); // Only the house owner may change the house locks.
                    }
                }

                break;
            }

            case 17:                     // Declare public/private
            {
                if (isOwner)
                {
                    if (m_House.Public && m_House.PlayerVendors.Count > 0)
                    {
                        from.SendMessage("Existem vendedores na sua casa. Voce nao pode torna-la privada neste momento.");
                        //from.SendLocalizedMessage( 501887 ); // You have vendors working out of this building. It cannot be declared private until there are no vendors in place.
                        break;
                    }

                    m_House.Public = !m_House.Public;
                    if (!m_House.Public)
                    {
                        m_House.ChangeLocks(from);

                        from.SendMessage("Sua Casa agora foi definida como Privada");
                        from.SendMessage("As fechaduras foram trocas. Uma copia da chave foi colocada na sua Mochila e outra em seu Banco");
                        //from.SendLocalizedMessage( 501888 ); // This house is now private.
                        //from.SendLocalizedMessage( 501306 ); // The locks on your front door have been changed, and new master keys have been placed in your bank and your backpack.
                    }
                    else
                    {
                        m_House.RemoveKeys(from);
                        m_House.RemoveLocks();

                        from.SendMessage("Sua Casa agora é Publica. Amigos podem adicionar vendedores nesta casa");
                        //from.SendLocalizedMessage( 501886 );//This house is now public. Friends of the house my now have vendors working out of this building.
                    }
                }
                else
                {
                    from.SendMessage("Apenas o dono da Casa pode realizar esta acao");
                    //from.SendLocalizedMessage( 501307 ); // Only the house owner may do this.
                }

                break;
            }

            case 18:                     // Change type
            {
                if (isOwner)
                {
                    if (m_House.Public && info.Switches.Length > 0)
                    {
                        int index = info.Switches[0] - 1;

                        if (index >= 0 && index < 53)
                        {
                            m_House.ChangeSignType(2980 + (index * 2));
                        }
                    }
                }
                else
                {
                    from.SendMessage("Apenas o dono da Casa pode realizar esta acao");
                    //from.SendLocalizedMessage( 501307 ); // Only the house owner may do this.
                }

                break;
            }
            }
        }
Beispiel #4
0
        public static void ProcessResponse( Mobile from, BaseHouse house, int type, int index, ArrayList vendorList, HouseGumpPage page )
        {
            if ( house.Deleted )
                return;

            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 = isFriend = false;

            if ( !from.CheckAlive() )
                return;

            Item sign = house.Sign;

            if ( sign == null || from.Map != sign.Map || !from.InRange( sign.GetWorldLocation(), 18 ) )
                return;

            HouseFoundation foundation = house as HouseFoundation;
            bool isCustomizable = ( foundation != null );

            if ( page == HouseGumpPage.Vendors )
            {
                if ( index >= 0 && index < vendorList.Count )
                {
                    PlayerVendor vendor = (PlayerVendor) vendorList[index];

                    if ( !vendor.CanInteractWith( from, false ) )
                        return;

                    if ( from.Map != sign.Map || !from.InRange( sign, 5 ) )
                        from.SendLocalizedMessage( 1062429 ); // You must be within five paces of the house sign to use this option.
                    else if ( vendor.IsOwner( from ) )
                        vendor.SendOwnerGump( from );
                    else
                        vendor.OpenBackpack( from );
                }

                return;
            }

            if ( !isFriend )
                return;

            switch ( type )
            {
                case 0:
                    {
                        switch ( index )
                        {
                            case 0: // Banish
                                {
                                    if ( house.Public )
                                    {
                                        from.SendLocalizedMessage( 501325 ); // Target the individual to ban from this house.
                                        from.Target = new HouseBanTarget( true, house );
                                    }

                                    break;
                                }
                            case 1: // Lift Ban
                                {
                                    if ( house.Public )
                                        from.SendGump( new HouseGump( HouseGumpPage.RemoveBan, from, house ) );

                                    break;
                                }
                            case 2: // Grant Access
                                {
                                    if ( !house.Public )
                                    {
                                        from.SendLocalizedMessage( 1060711 ); // Target the person you would like to grant access to.
                                        from.Target = new HouseAccessTarget( house );
                                    }

                                    break;
                                }
                            case 3: // Revoke Access
                                {
                                    if ( !house.Public )
                                        from.SendGump( new HouseGump( HouseGumpPage.RemoveAccess, from, house ) );

                                    break;
                                }
                        }

                        break;
                    }
                case 1:
                    {
                        HouseGumpPage gpage;

                        switch ( index )
                        {
                            case 0:
                                gpage = HouseGumpPage.Information;
                                break;
                            case 1:
                                gpage = HouseGumpPage.Security;
                                break;
                            case 2:
                                gpage = HouseGumpPage.Storage;
                                break;
                            case 3:
                                gpage = HouseGumpPage.Customize;
                                break;
                            case 4:
                                gpage = HouseGumpPage.Ownership;
                                break;
                            default:
                                return;
                        }

                        from.SendGump( new HouseGump( gpage, from, house ) );
                        break;
                    }
                case 3:
                    {
                        switch ( index )
                        {
                            case 0: // View Co-Owner List
                                {
                                    if ( isCoOwner )
                                        from.SendGump( new HouseGump( HouseGumpPage.ListCoOwner, from, house ) );

                                    break;
                                }
                            case 1: // Add a Co-Owner
                                {
                                    if ( isOwner )
                                    {
                                        from.SendLocalizedMessage( 501328 ); // Target the person you wish to name a co-owner of your household.
                                        from.Target = new CoOwnerTarget( true, house );
                                    }

                                    break;
                                }
                            case 2: // Remove a Co-Owner
                                {
                                    if ( isOwner )
                                        from.SendGump( new HouseGump( HouseGumpPage.RemoveCoOwner, from, house ) );

                                    break;
                                }
                            case 3: // Clear Co-Owner List
                                {
                                    if ( isOwner )
                                        from.SendGump( new WarningGump( 1060635, 30720, 1060736, 32512, 420, 280, new WarningGumpCallback( ClearCoOwners_Callback ), house ) );

                                    break;
                                }
                            case 4: // View Friends List
                                {
                                    from.SendGump( new HouseGump( HouseGumpPage.ListFriend, from, house ) );

                                    break;
                                }
                            case 5: // Add a Friend
                                {
                                    if ( isCoOwner )
                                    {
                                        from.SendLocalizedMessage( 501317 ); // Target the person you wish to name a friend of your household.
                                        from.Target = new HouseFriendTarget( true, house );
                                    }

                                    break;
                                }
                            case 6: // Remove a Friend
                                {
                                    if ( isCoOwner )
                                        from.SendGump( new HouseGump( HouseGumpPage.RemoveFriend, from, house ) );

                                    break;
                                }
                            case 7: // Clear Friend List
                                {
                                    if ( isCoOwner )
                                        from.SendGump( new WarningGump( 1060635, 30720, 1018039, 32512, 420, 280, new WarningGumpCallback( ClearFriends_Callback ), house ) );

                                    break;
                                }
                            case 8: // View Ban List
                                {
                                    from.SendGump( new HouseGump( HouseGumpPage.ListBan, from, house ) );

                                    break;
                                }
                            case 9: // Clear Ban List
                                {
                                    from.SendGump( new WarningGump( 1060635, 30720, 1060753, 32512, 420, 280, new WarningGumpCallback( ClearBans_Callback ), house ) );

                                    break;
                                }
                            case 10: // View Access List
                                {
                                    from.SendGump( new HouseGump( HouseGumpPage.ListAccess, from, house ) );

                                    break;
                                }
                            case 11: // Clear Access List
                                {
                                    from.SendGump( new WarningGump( 1060635, 30720, 1061842, 32512, 420, 280, new WarningGumpCallback( ClearAccess_Callback ), house ) );

                                    break;
                                }
                            case 12: // Make Private
                                {
                                    if ( isOwner )
                                    {
                                        if ( house.PlayerVendors.Count > 0 )
                                        {
                                            // You have vendors working out of this building. It cannot be declared private until there are no vendors in place.
                                            from.SendGump( new NoticeGump( 1060637, 30720, 501887, 32512, 320, 180, new NoticeGumpCallback( PublicPrivateNotice_Callback ), house ) );
                                            break;
                                        }

                                        if ( house.VendorRentalContracts.Count > 0 )
                                        {
                                            // You cannot currently take this action because you have vendor contracts locked down in your home.  You must remove them first.
                                            from.SendGump( new NoticeGump( 1060637, 30720, 1062351, 32512, 320, 180, new NoticeGumpCallback( PublicPrivateNotice_Callback ), house ) );
                                            break;
                                        }

                                        house.Public = false;

                                        house.ChangeLocks( from );

                                        // This house is now private.
                                        from.SendGump( new NoticeGump( 1060637, 30720, 501888, 32512, 320, 180, new NoticeGumpCallback( PublicPrivateNotice_Callback ), house ) );

                                        Region r = house.Region;
                                        List<Mobile> list = r.GetMobiles();

                                        for ( int i = 0; i < list.Count; ++i )
                                        {
                                            Mobile m = list[i];

                                            if ( !house.HasAccess( m ) && house.IsInside( m ) )
                                                m.Location = house.BanLocation;
                                        }
                                    }

                                    break;
                                }
                            case 13: // Make Public
                                {
                                    if ( isOwner )
                                    {
                                        house.Public = true;

                                        house.RemoveKeys( from );
                                        house.RemoveLocks();

                                        // This house is now public. The owner may now place vendors and vendor rental contracts.
                                        from.SendGump( new NoticeGump( 1060637, 30720, 501886, 32512, 320, 180, new NoticeGumpCallback( PublicPrivateNotice_Callback ), house ) );

                                        Region r = house.Region;
                                        List<Mobile> list = r.GetMobiles();

                                        for ( int i = 0; i < list.Count; ++i )
                                        {
                                            Mobile m = list[i];

                                            if ( house.IsBanned( m ) && house.IsInside( m ) )
                                                m.Location = house.BanLocation;
                                        }
                                    }

                                    break;
                                }
                        }

                        break;
                    }
                case 5:
                    {
                        switch ( index )
                        {
                            case 0: // Convert Into Customizable House
                                {
                                    if ( isOwner && !isCustomizable )
                                    {
                                        if ( house.HasRentedVendors )
                                        {
                                            // You cannot perform this action while you still have vendors rented out in this house.
                                            from.SendGump( new NoticeGump( 1060637, 30720, 1062395, 32512, 320, 180, new NoticeGumpCallback( CustomizeNotice_Callback ), house ) );
                                        }
                                        else
                                        {
                                            HousePlacementEntry e = house.ConvertEntry;

                                            if ( e != null )
                                            {
                                                /* You are about to turn your house into a customizable house.
                                                * You will be refunded the value of this house, and then be charged the cost of the equivalent customizable dirt lot.
                                                * All of your possessions in the house will be transported to a Moving Crate.
                                                * Deed-based house add-ons will be converted back into deeds.
                                                * Vendors and barkeeps will also be stored in the Moving Crate.
                                                * Your house will be leveled to its foundation, and you will be able to build new walls, windows, doors, and stairs.
                                                * Are you sure you wish to continue?
                                                */
                                                from.SendGump( new WarningGump( 1060635, 30720, 1060013, 32512, 420, 280, new WarningGumpCallback( ConvertHouse_Callback ), house ) );
                                            }
                                        }
                                    }

                                    break;
                                }
                            case 1: // Customize This House
                                {
                                    if ( isOwner && isCustomizable )
                                    {
                                        if ( house.HasRentedVendors )
                                        {
                                            // You cannot perform this action while you still have vendors rented out in this house.
                                            from.SendGump( new NoticeGump( 1060637, 30720, 1062395, 32512, 320, 180, new NoticeGumpCallback( CustomizeNotice_Callback ), house ) );
                                        }
                                        else
                                        {
                                            foundation.BeginCustomize( from );
                                        }
                                    }

                                    break;
                                }
                            case 2: // Relocate Moving Crate
                                {
                                    MovingCrate crate = house.MovingCrate;

                                    if ( isOwner && crate != null )
                                    {
                                        if ( !house.IsInside( from ) )
                                        {
                                            from.SendLocalizedMessage( 502092 ); // You must be in your house to do this.
                                        }
                                        else
                                        {
                                            crate.MoveToWorld( from.Location, from.Map );
                                            crate.RestartTimer();
                                        }
                                    }

                                    break;
                                }
                            case 3: // Change House Sign
                                {
                                    if ( isOwner && house.Public )
                                        from.SendGump( new HouseGump( HouseGumpPage.ChangeSign, from, house ) );

                                    break;
                                }
                            case 4: // Change House Sign Hanger
                                {
                                    if ( isOwner && isCustomizable )
                                        from.SendGump( new HouseGump( HouseGumpPage.ChangeHanger, from, house ) );

                                    break;
                                }
                            case 5: // Change Signpost
                                {
                                    if ( isOwner && isCustomizable && foundation.Signpost != null )
                                        from.SendGump( new HouseGump( HouseGumpPage.ChangePost, from, house ) );

                                    break;
                                }
                            case 6: // Change Foundation Style
                                {
                                    if ( isOwner && isCustomizable )
                                        from.SendGump( new HouseGump( HouseGumpPage.ChangeFoundation, from, house ) );

                                    break;
                                }
                            case 7: // Rename House
                                {
                                    if ( isCoOwner )
                                        from.Prompt = new RenamePrompt( house );

                                    break;
                                }
                        }

                        break;
                    }
                case 6:
                    {
                        switch ( index )
                        {
                            case 0: // Demolish
                                {
                                    if ( isOwner && house.MovingCrate == null )
                                    {
                                        if ( house.FindGuildstone() != null )
                                            from.SendLocalizedMessage( 501389 ); // You cannot redeed a house with a guildstone inside.
                                        else
                                            from.SendGump( new HouseDemolishGump( from, house ) );
                                    }

                                    break;
                                }
                            case 1: // Trade House
                                {
                                    if ( isOwner )
                                    {
                                        if ( house.HasPersonalVendors )
                                        {
                                            from.SendLocalizedMessage( 1062467 ); // You cannot trade this house while you still have personal vendors inside.
                                        }
                                        else if ( house.DecayLevel == DecayLevel.DemolitionPending )
                                        {
                                            from.SendLocalizedMessage( 1005321 ); // This house has been marked for demolition, and it cannot be transferred.
                                        }
                                        else
                                        {
                                            from.SendLocalizedMessage( 501309 ); // Target the person to whom you wish to give this house.
                                            from.Target = new HouseOwnerTarget( house );
                                        }
                                    }

                                    break;
                                }
                            case 2: // Make Primary
                                {
                                    break;
                                }
                        }

                        break;
                    }
                case 7:
                    {
                        if ( isOwner && isCustomizable && index >= 0 && index < m_HangerNumbers.Length )
                        {
                            Item hanger = foundation.SignHanger;

                            if ( hanger != null )
                                hanger.ItemID = m_HangerNumbers[index];

                            from.SendGump( new HouseGump( HouseGumpPage.Customize, from, house ) );
                        }

                        break;
                    }
                case 8:
                    {
                        if ( isOwner && isCustomizable )
                        {
                            FoundationType newType;

                            switch ( index )
                            {
                                case 0:
                                    newType = FoundationType.DarkWood;
                                    break;
                                case 1:
                                    newType = FoundationType.LightWood;
                                    break;
                                case 2:
                                    newType = FoundationType.Dungeon;
                                    break;
                                case 3:
                                    newType = FoundationType.Brick;
                                    break;
                                case 4:
                                    newType = FoundationType.Stone;
                                    break;
                                case 5:
                                    newType = FoundationType.ElvenStone;
                                    break;
                                case 6:
                                    newType = FoundationType.ElvenWood;
                                    break;
                                case 7:
                                    newType = FoundationType.ElvenSimple;
                                    break;
                                case 8:
                                    newType = FoundationType.ElvenPlain;
                                    break;
                                case 9:
                                    newType = FoundationType.Crystal;
                                    break;
                                case 10:
                                    newType = FoundationType.Shadow;
                                    break;
                                case 11:
                                    newType = FoundationType.GargishGreenMarble;
                                    break;
                                case 12:
                                    newType = FoundationType.GargishTwoToneStone;
                                    break;
                                default:
                                    return;
                            }

                            foundation.Type = newType;

                            DesignState state = foundation.BackupState;
                            HouseFoundation.ApplyFoundation( newType, state.Components );
                            state.OnRevised();

                            state = foundation.DesignState;
                            HouseFoundation.ApplyFoundation( newType, state.Components );
                            state.OnRevised();

                            state = foundation.CurrentState;
                            HouseFoundation.ApplyFoundation( newType, state.Components );
                            state.OnRevised();

                            foundation.Delta( ItemDelta.Update );

                            from.SendGump( new HouseGump( HouseGumpPage.Customize, from, house ) );
                        }

                        break;
                    }
                case 9:
                    {
                        if ( isOwner && house.Public && index >= 0 && index < 54 )
                        {
                            house.ChangeSignType( 2980 + ( index * 2 ) );
                            from.SendGump( new HouseGump( HouseGumpPage.Customize, from, house ) );
                        }

                        break;
                    }
                case 10:
                    {
                        if ( isOwner && vendorList != null && index >= 0 && index < vendorList.Count )
                        {
                            house.RemoveCoOwner( from, (Mobile) vendorList[index] );

                            if ( house.CoOwners.Count > 0 )
                                from.SendGump( new HouseGump( HouseGumpPage.RemoveCoOwner, from, house ) );
                            else
                                from.SendGump( new HouseGump( HouseGumpPage.Security, from, house ) );
                        }

                        break;
                    }
                case 11:
                    {
                        if ( isCoOwner && vendorList != null && index >= 0 && index < vendorList.Count )
                        {
                            house.RemoveFriend( from, (Mobile) vendorList[index] );

                            if ( house.Friends.Count > 0 )
                                from.SendGump( new HouseGump( HouseGumpPage.RemoveFriend, from, house ) );
                            else
                                from.SendGump( new HouseGump( HouseGumpPage.Security, from, house ) );
                        }

                        break;
                    }
                case 12:
                    {
                        if ( vendorList != null && index >= 0 && index < vendorList.Count )
                        {
                            house.RemoveBan( from, (Mobile) vendorList[index] );

                            if ( house.Bans.Count > 0 )
                                from.SendGump( new HouseGump( HouseGumpPage.RemoveBan, from, house ) );
                            else
                                from.SendGump( new HouseGump( HouseGumpPage.Security, from, house ) );
                        }

                        break;
                    }
                case 13:
                    {
                        if ( vendorList != null && index >= 0 && index < vendorList.Count )
                        {
                            house.RemoveAccess( from, (Mobile) vendorList[index] );

                            if ( house.Access.Count > 0 )
                                from.SendGump( new HouseGump( HouseGumpPage.RemoveAccess, from, house ) );
                            else
                                from.SendGump( new HouseGump( HouseGumpPage.Security, from, house ) );
                        }

                        break;
                    }
                case 14:
                    {
                        if ( isOwner && isCustomizable && index >= 0 && index < m_PostNumbers.Length )
                        {
                            foundation.SignpostGraphic = m_PostNumbers[index];
                            foundation.CheckSignpost();

                            from.SendGump( new HouseGump( HouseGumpPage.Customize, from, house ) );
                        }

                        break;
                    }
            }
        }