1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Separate Bank Boxes - required scripts and a How To v.1

Create one or multiple bank boxes that are separate from each other

  1. zerodowned
    Requirements:
    Requires making a small change to the Core file Item.cs and some changes to non-Core scripts
    The other day I remembered someone on RunUO asking about creating bank boxes that are separate from each other.
    Items put into your bank in Britain, would only be accessible at the brit bank.

    I also remembered someone saying [ Vorspire I believe ] that you can create new layers on a player.

    Uses:
    That's up to you. Separate bank boxes in different towns, maps, or whatever.

    How To:
    -Open Item.cs in the Server file
    -At the top of the file you'll see: public enum Layer : byte
    -Go to the end of section and we want to add a new layer. As long as we add it before the LastValid layer, and update LastValid to the same number as the last layer we're adding there will be no issues.
    Code (C#):
    1. /// <summary>
    2.         ///     Bank box layer.
    3.         /// </summary>
    4.         Bank = 0x1D,
    5.        
    6.         NewBank = 0x1E, // don't forget the comma
    7.  
    8.         /// <summary>
    9.         ///     Last valid layer. Equivalent to <c>Layer.Bank</c>.
    10.         /// </summary>
    11.         LastValid = 0x1E //0x1D
    - Now save and compile the core

    Next download the attached file and drop wherever you want in Scripts file.

    Last step is editing Banker.cs
    -Around line 395 you'll see: case 0x0002: // *bank*
    -You'll need to know how/where/when the new bank box will be used to make this edit.
    Here's how I did it for testing
    Code (C#):
    1. case 0x0002: // *bank*
    2.                             {
    3.                                 e.Handled = true;
    4.  
    5.                                 if (e.Mobile.Criminal)
    6.                                 {
    7.                                     // Thou art a criminal and cannot access thy bank box.
    8.                                     vendor.Say(500378);
    9.                                     break;
    10.                                 }
    11.        
    12.                                 // begin edit
    13.                                 if (e.Mobile.Region != null && e.Mobile.Region.IsPartOf("Cove"))
    14.                                 {
    15.                                     PlayerMobile pm = (PlayerMobile)e.Mobile;
    16.                                     pm.BankBoxNew.Open();
    17.                                     pm.SendMessage("Opening cove bank");
    18.                                 }
    19.                                 else
    20.                                     e.Mobile.BankBox.Open();
    21.                                 // end edit
    22.                             }
    Now edits to PlayerMobile
    -Doesn't really matter where this is added but I put it after private double m_GauntletPoints; around line 240
    -add this section
    Code (C#):
    1. private BankBoxNew m_NewBankBox;
    2.  
    3.         [CommandProperty(AccessLevel.GameMaster)]
    4.         public BankBoxNew BankBoxNew
    5.         {
    6.             get
    7.             {
    8.                 if (m_NewBankBox != null && !m_NewBankBox.Deleted && m_NewBankBox.Parent == this)
    9.                 {
    10.                     return m_NewBankBox;
    11.                 }
    12.  
    13.                 m_NewBankBox = FindItemOnLayer(Layer.NewBank) as BankBoxNew;
    14.  
    15.                 if (m_NewBankBox == null)
    16.                 {
    17.                     AddItem(m_NewBankBox = new BankBoxNew(this));
    18.                 }
    19.  
    20.                 return m_NewBankBox;
    21.             }
    22.         }
    -Now find the method Move around line 1600
    -add this before that method
    Code (C#):
    1. public BankBoxNew FindNewBankNoCreate()
    2.         {
    3.             if (m_NewBankBox != null && !m_NewBankBox.Deleted && m_NewBankBox.Parent == this)
    4.             {
    5.                 return m_NewBankBox;
    6.             }
    7.  
    8.             m_NewBankBox = FindItemOnLayer(Layer.NewBank) as BankBoxNew;
    9.  
    10.             return m_NewBankBox;
    11.         }
    -Now edit Move method, add this to the top of it
    Code (C#):
    1. BankBoxNew box = FindNewBankNoCreate();
    2.  
    3.             if (box != null && box.Opened)
    4.             {
    5.                 box.Close();
    6.             }
    - Now the new bankbox will also close when the player moves.

    That's all :)
    I've tested this to be sure it saves items across saves/restarts.

    If you want gold and checks to be added to players balance when dropped in the new BB, you'll need to edit those files.