RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Bank Storage Increase Deeds

KoNNaN

Knight
And here is the removed text.

I pulled the idea from an old thread on this forum and put it into action.

Credits
- Me for making the system.
- Lord Greywolf for showing the guy how to go about it in the old thread I found.

Description
With these deeds, a player can increase the number of items their bank account will hold. I liked this idea better, so it makes for a good reward, instead of making it a global setting for everyone.

Installation
This does require some core mods to PlayerMobile.cs and to LoginStats.cs. Always make a backup before you start modding core files! I have tested this system extensively and it works great.

Step 1: Open PlayerMobile.cs


Find

Code:
private List<Mobile> m_AllFollowers;
Add after it
Code:
private int m_BonusBankSlots;
Find
Code:
public int StepsTaken
{
    get { return m_StepsTaken; }
    set { m_StepsTaken = value; }
}
Add after it
Code:
[CommandProperty(AccessLevel.GameMaster)]
        public int BonusBankSlots
        {
            get { return m_BonusBankSlots; }
            set { m_BonusBankSlots = value; }
        }
Find
Code:
 public override void Deserialize(GenericReader reader)
Now, let me explain something - so you do not jack up your saves. Below this method are a set of cases. You are going to have to add a new case to the top. In my case, the last one was -

Code:
case 29:
{
  m_VASTotalMonsterFame = reader.ReadInt();
  goto case 28;
}
So, your next case would be case 30, and the goto would be goto case 29. Like so.

Code:
case 30:
{
  m_BonusBankSlots = reader.ReadInt();
  goto case 29;
}
And now the one that has to be in this order. If it is not, you will break your saves when you restart. Fair warning.

Find
Code:
writer.Write((int)29); // version
That 29 represents the last case before my mods. I need to change this to reflect the current last case.

Code:
writer.Write((int)30); // version
Then, DIRECTLY AFTER this (remember I said it has to be in order), add this line.

Code:
writer.Write(m_BonusBankSlots);
Step 2: Open LoginStats.cs (found in Scripts/Misc/)

In the EventSink_Login( LoginEventArgs e ), we are going to modify the players bank storage, based on how many deeds he/she has used. As yours may vary with mine, I will post my entire method, so you will get the idea.

Code:
private static void EventSink_Login( LoginEventArgs e )
        {
            if (e.Mobile != null && e.Mobile is PlayerMobile)
            {
                PlayerMobile pm = e.Mobile as PlayerMobile;
 
                if (pm.Young)
                { BroadcastMessage( AccessLevel.Counselor, 43, "A young player has logged in: [{0}]", pm.Name ); }
 
                if (e.Mobile.BankBox != null)  //supports adding extra bank slots via deed
                {
                    if( pm.BonusBankSlots >= 10 )  //we do not use deeds less than 20 anyways.  Fail safe.
                    {
                        e.Mobile.BankBox.MaxItems = 125 + pm.BonusBankSlots;
                    }
                    else
                    {
                        e.Mobile.BankBox.MaxItems = 125;
                    }
                }
            }
        }


Step 3: Drop my scripts into your customs folder, or anywhere in Scripts for that matter.

I have included below, deeds for increasing the amount of space for players. Distribute them as you wish.

25, 50, and 100 item increases are included in the script.

Enjoy, hope you like it :)
 

bazspeed

Sorceror
And here is the removed text.
Hi, I wonder if you could help me out here a little. tried adding your loginstats scripts. But getting a shed loads of errors. I have edited the loginstats before and not sure where i should add yours.

Code:
private static void EventSink_Login( LoginEventArgs args )
        {
            int userCount = NetState.Instances.Count;
            int itemCount = World.Items.Count;
            int mobileCount = World.Mobiles.Count;
 
            Mobile m = args.Mobile;
 
            m.SendMessage( "Welcome, {0}! There {1} currently {2} user{3} online, with {4} item{5} and {6} mobile{7} in the world.",
                args.Mobile.Name,
                userCount == 1 ? "is" : "are",
                userCount, userCount == 1 ? "" : "s",
                itemCount, itemCount == 1 ? "" : "s",
                mobileCount, mobileCount == 1 ? "" : "s" );
               
            #region CheckName
            if (!CharacterCreation.CheckDupe(m, m.Name) && m.AccessLevel == AccessLevel.Player)
            {
                m.CantWalk = true;
                m.SendGump( new NameChangeGump( m) );
             
            }
            #endregion
        }
    }
 
Top