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!

FS Accounting Mods

RoninGT

Sorceror
FS Accounting Mods

This is a script i came up with to limit char slots and housing slots per account rather than make it server wide. This way i can reward players with a 6th char slot or a 2nd, 3rd, whatever house slot. Very simple edits to some distros and a few new commands.

The following is the edits needed for your distros.

ALWAYS BACKUP YOUR FILES BEFORE EDITING OR DELETING!!!

Open your Account.cs and find

Code:
		/// <summary>
		/// Gets the maximum amount of characters allowed to be created on this account. Values other than 1, 5, or 6 are not supported.
		/// </summary>
		public int Limit
		{

Add Above...

Code:
		public int GetCharSlots()
		{
                        int chars = Convert.ToInt32( this.GetTag("maxChars") );

			if ( chars > 1 && chars < 5 || chars > 6 || chars < 1 )
				chars = 5;

			return chars;
		}
Where it says chars = 5; you can change that to your servers default amount.

Also find...

Code:
		public int Limit
		{
			get{ return 5; }
		}

Change this to...

Code:
		public int Limit
		{
			get{ return GetCharSlots(); }
		}

Close and save Account.cs

Open your BaseHouse.cs and find...

Code:
		public static bool HasHouse( Mobile m )
		{

Add above...

Code:
		public static int GetHouseSlots( Mobile m )
		{
			Account acct = m.Account as Account;

                        int houses = Convert.ToInt32( acct.GetTag("maxHouses") );

			if ( houses < 1 )
				houses = 1;

			int trueSlots = houses - 1;

			return trueSlots;
		}
Where it says houses = 1; You can change this to your servers default amount. However make it one over your default.

Also find...

Code:
		public static bool HasHouse( Mobile m )
		{
			if ( m == null )
				return false;

			ArrayList list = (ArrayList)m_Table[m];

			if ( list == null )
				return false;

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

				if ( !h.Deleted )
					return true;
			}

			return false;
		}

Change it to...

Code:
		public static bool HasHouse( Mobile m )
		{
			if ( m == null )
				return false;

			ArrayList list = (ArrayList)m_Table[m];

			if ( list == null )
				return false;

			for ( int i = GetHouseSlots( m ); i < list.Count; ++i )
			{
				BaseHouse h = (BaseHouse)list[i];

				if ( !h.Deleted )
					return true;
			}

			return false;
		}

Close and Save BaseHouse.cs

Open CharacterCreation.cs and find...

Code:
			//CityInfo city = GetStartLocation( args, young );
			CityInfo city = new CityInfo( "Britain", "Sweet Dreams Inn", 1496, 1628, 10, Map.Felucca );

Add above...

Code:
			Account acct = newChar.Account as Account;
 
                        int houses = Convert.ToInt32( acct.GetTag("maxHouses") ); 
                        int chars = Convert.ToInt32( acct.GetTag("maxChars") ); 

			if ( houses <= 1 )
				acct.SetTag( "maxHouses", "1" );

			if ( chars <= 5 )
				acct.SetTag( "maxChars", "5" );

Here you can also set what you want your servers starting char and house slots to be per account. ( Default: Houses 1, Chars 5 )

Once you have done that download the below commands, [SetCharSlots ## [SetHouseSlots ## target that player, It will set the accounts slots. Also remember that you can only have 1, 5, or 6 char slots. The system will not let you make anything other than that but for those who dont know and wonder why you can make an account have 3, Its nothing you can do to change this, This is based on the UO Client its self.

You can always set up items (Reward Deeds, Etc) to give players their extra slots rather than the commands. Or a quest reward. You get the idea.

Remember thou that in Account.cs, BaseHouse.cs where you find the chars = 5; and houses = 1; you should change these values to your servers starting about. So when a vet player (Account made before installing this) trys to place a house they will be limited to the servers defaults, Unless you have changed thier slots :)

ATTN: You may also wish to disable house decay in BaseHouse.cs, Or edit it so you dont get a penaltiy for multi houses.


I hope you guys enjoy.

Ronin
 

Attachments

  • SetCharactersSlots.cs
    1.9 KB · Views: 186
  • SetHouseSlots.cs
    1.8 KB · Views: 238

nacrom

Wanderer
::is jsut awstruck:: i love this idea, thanks Ronin.

this will work perfectly into the RP aspect of my shard where only Builder class characters can build building and now they can get an extra slot or 2 to build buildings and transfer them without losing their personal housing slots.

100+ Karma for ya on this script
 

Tru

Knight
Heres scrolls from the commands and edits below (in other words you need the edits at the very least)
I use them for Vet rewards.
Tested should work fine.
House Slot Scroll is set to 2 houses
 

Attachments

  • New Rewards.rar
    1.6 KB · Views: 112

RoninGT

Sorceror
Tru said:
Heres scrolls from the commands and edits below (in other words you need the edits at the very least)
I use them for Vet rewards.
Tested should work fine.
House Slot Scroll is set to 2 houses

Nice man, Thanks for sharing

Ronin

EDIT: on a side note. Someone wanted me to post the edited distros for use with WinMerge (Got a pm) i have not forgotten you ill add them later today.
 

Shadow1980

Wanderer
Tru said:
Heres scrolls from the commands and edits below (in other words you need the edits at the very least)
I use them for Vet rewards.
Tested should work fine.
House Slot Scroll is set to 2 houses

Just something I thought about a minute ago, I have no way of testing this right now so perhaps you could enlighten me :)

If person A uses the house slot scroll and places a second house, and then transfers the house to person B who didn't use the scroll, person A would then be able to place a second house again. This would make person A able to supply as many people as he wishes with extra houses or is transfering houses correctly limited as well?
As I said I haven't had a chance to check myself right now, and it is most likely correctly limited, but it is something that could otherwise be an issue.

Thank's for sharding your scroll (And thanks to Ronin for this system, it is nice to see you back mate).
 

Tru

Knight
Shadow1980 said:
Just something I thought about a minute ago, I have no way of testing this right now so perhaps you could enlighten me :)

If person A uses the house slot scroll and places a second house, and then transfers the house to person B who didn't use the scroll, person A would then be able to place a second house again. This would make person A able to supply as many people as he wishes with extra houses or is transfering houses correctly limited as well?
As I said I haven't had a chance to check myself right now, and it is most likely correctly limited, but it is something that could otherwise be an issue.

Thank's for sharding your scroll (And thanks to Ronin for this system, it is nice to see you back mate).
You can't have a house transfered to you if you are at your limit.
 

jayates

Sorceror
Wow... this post was several years ago. I am trying to set up this house slot script. I modified the BaseHouse.cs script as the file says. Then added in the script SetHouseSlots.cs and got an error stating: The type or namespace name 'CommandEventArgs" could not be found. Not sure what happened? I am using RunUO 2.2 and patched to 7.0.29.3. Help....
 
Top