Resource icon

Code How To: Visual Guide To Make Skillgain Harder At Certain Skill Level

Hey guys, I know this has always troubled me in the past, so I decided to make a guide on how to make skillgain slower (or faster) at certain skill levels.

Some shards (like mine) have skillgain rates slower when you reach higher levels. This is a guide to do just that without actually having a curve.

First thing is first. Open Scripts > Misc > SkillCheck.cs

Find the Method:
public static bool CheckSkill( Mobile from, Skill skill, object amObj, double chance )

Right underneath that method, you should see this block of code.

			if ( from.Skills.Cap == 0 )
				return false;

			bool success = ( chance >= Utility.RandomDouble() );
			double gc = (double)(from.Skills.Cap - from.Skills.Total) / from.Skills.Cap;
			gc += ( skill.Cap - skill.Base ) / skill.Cap;
			gc /= 2;

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

Underneath gc /=3;
You can put the following code: (don't worry, I'll explain what it does and show you the percentages)

			//Slower Gain For Higher Skill Levels
               		 if (from.Alive && skill.Base > 70)
                   		 gc /= 2;

                	if (from.Alive && skill.Base > 80)
                    		gc /= 2;

               		if (from.Alive && skill.Base > 90)
                    		gc /= 2;

What this does is cut the chance to succesfully obtain a skillgain in half.

If you want to see the skillgain percentage yourself, simply put the following code right before
the bottom of the CheckSkill Method.

Like this:

            		Console.WriteLine("GC = {0}", gc);

			return success;

Doing this will constantly display numbers in your console.
GC = Gain Chance
The percentage you see in the pictures below tell you while using the skill, the percentage that you will actually get a skillgain.
So the first picture is about a 40% chance to gain while using the skill.

Here's a picture of my skillgain at 60 skill.


Here's a picture of my skillgain at 70.1 skill.


Here's a picture of my skillgain at 80.1 skill.


Here's a picture of my skillgain at 90.1 skill.


As you can see, every time I hit a different tier of skill as posted in the script,
it cuts the chance to gain in skill in half.

You can change the values how you see fit for how you want your shard's skillgain to be at different skill levels.

Hope this helped some people.

First release
Last update
0.00 star(s) 0 ratings

More resources from Punkte