Resource icon

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

No permission to download
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:
/// <summary>
        ///     Bank box layer.
        /// </summary>
        Bank = 0x1D,
       
        NewBank = 0x1E, // don't forget the comma

        /// <summary>
        ///     Last valid layer. Equivalent to <c>Layer.Bank</c>.
        /// </summary>
        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:
case 0x0002: // *bank*
                            {
                                e.Handled = true;

                                if (e.Mobile.Criminal)
                                {
                                    // Thou art a criminal and cannot access thy bank box.
                                    vendor.Say(500378);
                                    break;
                                }
       
                                // begin edit
                                if (e.Mobile.Region != null && e.Mobile.Region.IsPartOf("Cove"))
                                {
                                    PlayerMobile pm = (PlayerMobile)e.Mobile;
                                    pm.BankBoxNew.Open();
                                    pm.SendMessage("Opening cove bank");
                                }
                                else
                                    e.Mobile.BankBox.Open();
                                // end edit
                            }
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:
private BankBoxNew m_NewBankBox;

        [CommandProperty(AccessLevel.GameMaster)]
        public BankBoxNew BankBoxNew
        {
            get
            {
                if (m_NewBankBox != null && !m_NewBankBox.Deleted && m_NewBankBox.Parent == this)
                {
                    return m_NewBankBox;
                }

                m_NewBankBox = FindItemOnLayer(Layer.NewBank) as BankBoxNew;

                if (m_NewBankBox == null)
                {
                    AddItem(m_NewBankBox = new BankBoxNew(this));
                }

                return m_NewBankBox;
            }
        }
-Now find the method Move around line 1600
-add this before that method
Code:
public BankBoxNew FindNewBankNoCreate()
        {
            if (m_NewBankBox != null && !m_NewBankBox.Deleted && m_NewBankBox.Parent == this)
            {
                return m_NewBankBox;
            }

            m_NewBankBox = FindItemOnLayer(Layer.NewBank) as BankBoxNew;

            return m_NewBankBox;
        }
-Now edit Move method, add this to the top of it
Code:
BankBoxNew box = FindNewBankNoCreate();

            if (box != null && box.Opened)
            {
                box.Close();
            }
- 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.
  • Like
Reactions: Sareus
Author
zerodowned
Downloads
34
Views
34
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from zerodowned