Go Back   RunUO - Ultima Online Emulation > RunUO > Custom Script Release Archive

Custom Script Release Archive This is a pre-script database archive of what our users had released.

 
 
Thread Tools Display Modes
Old 04-26-2006, 03:35 AM   #1 (permalink)
Forum Expert
 
RoninGT's Avatar
 
Join Date: Oct 2002
Location: Evansville, IN
Age: 27
Posts: 943
Send a message via ICQ to RoninGT
Default 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
Attached Files
File Type: cs SetCharactersSlots.cs (1.9 KB, 136 views)
File Type: cs SetHouseSlots.cs (1.8 KB, 173 views)
__________________
Let me out i am stuck in your pocket!

Last edited by RoninGT; 04-28-2006 at 05:08 AM.
RoninGT is offline  
Old 04-26-2006, 10:23 AM   #2 (permalink)
Tru
Forum Expert
 
Tru's Avatar
 
Join Date: Jan 2003
Location: California
Age: 39
Posts: 3,260
Default

Cool thanks RoninGT glad to see you back and submitting scripts again.
Tru is offline  
Old 04-26-2006, 10:55 AM   #3 (permalink)
Forum Expert
 
Iomega0318's Avatar
 
Join Date: Feb 2005
Location: Dirt City,TX
Age: 21
Posts: 608
Send a message via ICQ to Iomega0318 Send a message via AIM to Iomega0318 Send a message via MSN to Iomega0318 Send a message via Yahoo to Iomega0318
Default

wow this is going in on my next reboot thanx for the time you spent on this
__________________
-Lichking-
"I believe in Christianity as I believe in the sun...
not because I see it but because by it I see everything else."
C.S. Lewis

Heed what I say, for it shall be mentioned only once.

Iomega0318 is offline  
Old 04-26-2006, 11:10 AM   #4 (permalink)
Forum Novice
 
Join Date: Dec 2005
Posts: 133
Default

::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
nacrom is offline  
Old 04-27-2006, 10:03 PM   #5 (permalink)
Forum Expert
 
Iomega0318's Avatar
 
Join Date: Feb 2005
Location: Dirt City,TX
Age: 21
Posts: 608
Send a message via ICQ to Iomega0318 Send a message via AIM to Iomega0318 Send a message via MSN to Iomega0318 Send a message via Yahoo to Iomega0318
Default

wow I have tested this out and must say I am impressed it works like a charm thanx for submitting it
__________________
-Lichking-
"I believe in Christianity as I believe in the sun...
not because I see it but because by it I see everything else."
C.S. Lewis

Heed what I say, for it shall be mentioned only once.

Iomega0318 is offline  
Old 04-28-2006, 02:45 AM   #6 (permalink)
Tru
Forum Expert
 
Tru's Avatar
 
Join Date: Jan 2003
Location: California
Age: 39
Posts: 3,260
Default

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
Attached Files
File Type: rar New Rewards.rar (1.6 KB, 69 views)
Tru is offline  
Old 04-28-2006, 05:02 AM   #7 (permalink)
Forum Expert
 
RoninGT's Avatar
 
Join Date: Oct 2002
Location: Evansville, IN
Age: 27
Posts: 943
Send a message via ICQ to RoninGT
Default

Quote:
Originally Posted by Tru
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.
__________________
Let me out i am stuck in your pocket!

Last edited by RoninGT; 04-28-2006 at 05:04 AM.
RoninGT is offline  
Old 04-28-2006, 06:22 AM   #8 (permalink)
Forum Expert
 
Shadow1980's Avatar
 
Join Date: Mar 2005
Location: York, UK
Age: 28
Posts: 708
Default

Quote:
Originally Posted by Tru
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).
__________________
Shadow1980
Game Reviews, Jokes and Rants from real People
Shadow1980 is offline  
Old 04-28-2006, 10:55 AM   #9 (permalink)
Tru
Forum Expert
 
Tru's Avatar
 
Join Date: Jan 2003
Location: California
Age: 39
Posts: 3,260
Default

Quote:
Originally Posted by Shadow1980
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.
Tru is offline  
Old 04-28-2006, 01:29 PM   #10 (permalink)
Forum Expert
 
Shadow1980's Avatar
 
Join Date: Mar 2005
Location: York, UK
Age: 28
Posts: 708
Default

Quote:
Originally Posted by Tru
You can't have a house transfered to you if you are at your limit.
Ah good. I know it was an easy to answer question, but I never used more then 1 house at all
__________________
Shadow1980
Game Reviews, Jokes and Rants from real People
Shadow1980 is offline  
 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5