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!

[RunUO 2.0 RC2] - Another Customizable SkillCheck.cs

the_hopkins

Wanderer
[RunUO 2.0 RC2] - Another Customizable SkillCheck.cs

A while back I downloaded a customizable skillcheck.cs by Goury that let you set the rate of skill gain individually for each skill. Upon starting fresh with RC2, I was going to install it, but saw that some people were having problems with stat gain. Devinticus released a version for RC2, but the rar file is corrupt, and some people were saying they were having trouble with stat gain on that one as well anyway. Plus Goury's original version altered the base GainFactor of the skills to change the rate of gain. I have no idea if anything else relies upon GainFactor, but I don't like the idea of changing it, so I decided to rewrite the script myself.

This one uses an array to store the skill gain rates rather than changing GainFactor. It doesn't have quite as complex a calculation system as Goury's, actually sticking to the original formula for the most part.

The changes are all in SkillCheck.cs:

Find:
Code:
	public class SkillCheck
	{
		private static readonly bool AntiMacroCode = !Core.ML;		//Change this to false to disable anti-macro code

		public static TimeSpan AntiMacroExpire = TimeSpan.FromMinutes( 5.0 ); //How long do we remember targets/locations?
		public const int Allowance = 3;	//How many times may we use the same location/target for gain
		private const int LocationSize = 5; //The size of eeach location, make this smaller so players dont have to move as far
Directly underneath add:
Code:
[COLOR="Olive"]		private static double[] SkillGainRate = new double[55];
		private static double SkillDivider1 = 10;
		private static double SkillDivider2 = 5;
		private static double StrDivider = 8;
		private static double DexDivider = 8;
		private static double IntDivider = 8;
[/COLOR]
Find:
Code:
		public static void Initialize()
		{
			Mobile.SkillCheckLocationHandler = new SkillCheckLocationHandler( Mobile_SkillCheckLocation );
			Mobile.SkillCheckDirectLocationHandler = new SkillCheckDirectLocationHandler( Mobile_SkillCheckDirectLocation );

			Mobile.SkillCheckTargetHandler = new SkillCheckTargetHandler( Mobile_SkillCheckTarget );
			Mobile.SkillCheckDirectTargetHandler = new SkillCheckDirectTargetHandler( Mobile_SkillCheckDirectTarget );
and add the following directly beneath:
Code:
[COLOR="Olive"]			//Scales gain rates proportionally
			SkillGainRate[0] = 1.0;// Alchemy = 0, 
			SkillGainRate[1] = 1.0;// Anatomy = 1, 
			SkillGainRate[2] = 1.0;// AnimalLore = 2, 
			SkillGainRate[3] = 1.0;// ItemID = 3, 
			SkillGainRate[4] = 1.0;// ArmsLore = 4, 
			SkillGainRate[5] = 1.0;// Parry = 5, 
			SkillGainRate[6] = 1.0;// Begging = 6, 
			SkillGainRate[7] = 1.0;// Blacksmith = 7, 
			SkillGainRate[8] = 1.0;// Fletching = 8, 
			SkillGainRate[9] = 1.0;// Peacemaking = 9, 
			SkillGainRate[10] = 1.0;// Camping = 10, 
			SkillGainRate[11] = 1.0;// Carpentry = 11, 
			SkillGainRate[12] = 1.0;// Cartography = 12, 
			SkillGainRate[13] = 1.0;// Cooking = 13, 
			SkillGainRate[14] = 1.0;// DetectHidden = 14, 
			SkillGainRate[15] = 1.0;// Discordance = 15, 
			SkillGainRate[16] = 1.0;// EvalInt = 16, 
			SkillGainRate[17] = 1.0;// Healing = 17, 
			SkillGainRate[18] = 1.0;// Fishing = 18, 
			SkillGainRate[19] = 1.0;// Forensics = 19, 
			SkillGainRate[20] = 1.0;// Herding = 20, 
			SkillGainRate[21] = 1.0;// Hiding = 21, 
			SkillGainRate[22] = 1.0;// Provocation = 22, 
			SkillGainRate[23] = 1.0;// Inscribe = 23, 
			SkillGainRate[24] = 1.0;// Lockpicking = 24, 
			SkillGainRate[25] = 1.0;// Magery = 25, 
			SkillGainRate[26] = 1.0;// MagicResist = 26, 
			SkillGainRate[27] = 1.0;// Tactics = 27, 
			SkillGainRate[28] = 1.0;// Snooping = 28, 
			SkillGainRate[29] = 1.0;// Musicianship = 29, 
			SkillGainRate[30] = 1.0;// Poisoning = 30 
			SkillGainRate[31] = 1.0;// Archery = 31 
			SkillGainRate[32] = 1.0;// SpiritSpeak = 32 
			SkillGainRate[33] = 1.0;// Stealing = 33 
			SkillGainRate[34] = 1.0;// Tailoring = 34 
			SkillGainRate[35] = 1.0;// AnimalTaming = 35 
			SkillGainRate[36] = 1.0;// TasteID = 36 
			SkillGainRate[37] = 1.2;// Tinkering = 37 
			SkillGainRate[38] = 1.0;// Tracking = 38 



			SkillGainRate[39] = 1.0;// Veterinary = 39 
			SkillGainRate[40] = 1.0;// Swords = 40 
			SkillGainRate[41] = 1.0;// Macing = 41 
			SkillGainRate[42] = 1.0;// Fencing = 42 
			SkillGainRate[43] = 1.0;// Wrestling = 43 
			SkillGainRate[44] = 1.0;// Lumberjacking = 44 
			SkillGainRate[45] = 0.6;// Mining = 45 
			SkillGainRate[46] = 1.0;// Meditation = 46 
			SkillGainRate[47] = 1.0;// Stealth = 47 
			SkillGainRate[48] = 1.0;// RemoveTrap = 48 
			SkillGainRate[49] = 1.0;// Necromancy = 49 
			SkillGainRate[50] = 1.0;// Focus = 50 
			SkillGainRate[51] = 1.0;// Chivalry = 51
			SkillGainRate[52] = 1.0;// Bushido = 52
			SkillGainRate[53] = 1.0;// Ninjitsu = 53
			SkillGainRate[54] = 1.0;// SpellWeaving = 54
[/COLOR]
Find:
Code:
			gc += ( skill.Cap - skill.Base ) / skill.Cap;
			gc /= 2;

			gc += ( 1.0 - chance ) * ( success ? 0.5 : (Core.AOS ? 0.0 : 0.2) );
			gc /= 2;

			gc *= skill.Info.GainFactor;
Replace with:
Code:
[COLOR="Olive"]			gc += ( skill.Cap - skill.Base ) / skill.Cap;
			gc /= SkillDivider1;

			gc += ( 1.0 - chance ) * ( success ? 0.5 : (Core.AOS ? 0.0 : 0.2) );
			gc /= SkillDivider2;

			gc *= SkillGainRate[skill.Info.SkillID];
[/COLOR]
Find:
Code:
				if ( from.StrLock == StatLockType.Up && (info.StrGain / 33.3) > Utility.RandomDouble() )
					GainStat( from, Stat.Str );
				else if ( from.DexLock == StatLockType.Up && (info.DexGain / 33.3) > Utility.RandomDouble() )
					GainStat( from, Stat.Dex );
				else if ( from.IntLock == StatLockType.Up && (info.IntGain / 33.3) > Utility.RandomDouble() )
					GainStat( from, Stat.Int );
Replace with:
Code:
[COLOR="Olive"]				if ( from.StrLock == StatLockType.Up && (info.StrGain / StrDivider) > Utility.RandomDouble() )
					GainStat( from, Stat.Str );
				else if ( from.DexLock == StatLockType.Up && (info.DexGain / DexDivider) > Utility.RandomDouble() )
					GainStat( from, Stat.Dex );
				else if ( from.IntLock == StatLockType.Up && (info.IntGain / IntDivider) > Utility.RandomDouble() )
					GainStat( from, Stat.Int );
[/COLOR]

And you're done. I've included a modded distro SkillCheck.cs, as well as an Excel file to make it easier to visualize what changing the values will do for you. Apologies for the ugliness of the spreadsheet; visual design is definitely not one of my talents. You can edit any of the variables introduced in this mod to see what results the changes have. They're the red text on a blue background. The spreadsheet is locked to prevent accidental changes to the formulas; only those variables that you can set in Skillcheck.cs may be edited. If you're going to make changes to the formulas in SkillCheck.cs and would like to update the spreadsheet to see your changes, simply unprotect it. The password is "password" (no quotes).:cool:

I just compiled and started my shard with no errors on a skillcheck.cs that I modded from distro following the above directions. Nevertheless, I haven't tested that one extensively (my default skillcheck.cs is rather heavily modded), so please don't hate me if you have errors. Particularly, if you've made any changes, any changes at all to the default RunUO installation, DON'T DRAG AND DROP THE INCLUDED SKILLCHECK.CS OVER YOUR OLD ONE. In addition, if you don't have RunUO 2.0 RC2, then DON'T DRAG AND DROP THE INCLUDED SKILLCHECK.CS OVER YOUR OLD ONE.:D

I highly recommend also adding the changes made at this post as well, for even greater customizable goodness. I've made a few changes to his code, but I don't want to hijack his mod, so I won't post it here. It's definitely worth looking at, though.
 

Attachments

  • SkillCheck Spreadsheet.zip
    11.4 KB · Views: 111
  • SkillCheck.cs
    12.8 KB · Views: 91

Thilgon

Sorceror
uhm 2 months too late maybe...

but... first of all, i couldn't open the speadsheet (not everyone has microsoft office :p)...
second, what are the lower and higher value you can set in it? (like, 1.0 is the slower? or what else?)
 

Edge386

Wanderer
I know this thread is almost ancient but I just started tinkering with this script revision and wanted to post info here for those who may find it useful. Openoffice.org offers a program called Calc that is free and does everything that Excel can do.

The higher the value in GCDivider the harder it is to gain in that skill. Although at the default settings shown in this thread (10, 5 respectively), although much higher than the RunUO default of 2, 2 does not appear to slow down gains at all.

I'm wondering how to remove the slower skill gain rate based on how close you are to the total skills cap and make individual skill gains slow down the closer you are to the individual skill cap. Does that make sense?

Also, I've only seen an adjustment for stat gains based on time but I can't seem to find where you can adjust the chance for stat gain based on skill success. Or which skills raise what stats.
 
Top