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!

How do I change skill and stat gain rates and/or anti-macro?

Ashenfall

Wanderer
How do I change skill and stat gain rates and/or anti-macro?

UPDATED 10/01/03

*DISCLAIMER!!!*
This turtorial was written to demonstrate ways in which skill and stat gain rates can be adjusted, as well as the workings of the anti-macro code. The built-in system is not what everybody wants, so you may find this guide useful when attemting to adjust individual skills or overall gain rates. The methods that are explained here may not be what you want on your shard, but it should give you an idea of how to adjust things to your own liking.

Before attemting anything in this tutorial, you should be slightly familiar with C# programming techniques.


Almost all skill and statgain calcualtion are handled by a file called "skillcheck.cs" in the \runuo\scripts\misc folder. It is my suggestion that you save this file to your \custom\misc folder once you have edited it, so that it's easier to deal with during beta upgrades.

I've included the skillcheck.cs that I currently run on my server. I have gone through it and added several lines of commented code. (denoted by the // marks) I've also made several modifications that make skillgain work the way I want it to work. By reading through the comments in the scirpt, you may gain some insight into how you can modify skillcheck.cs to work the way YOU want it to work. Please note... the debugging lines that were added that look like this:
[code:1]
//from.SendMessage( 0x35, "TOTAL Skills Base GC is {0}", gc ); // Debugging
[/code:1]
By uncommenting those lines, you can see ingame what the actual values of the variables are that control the gain system. Using those will allow you to adjust the system to use precisely what numbers you want it to.

Good luck, and feel free to post whatver questions or concerns you have regarding this script in the script discussion forum.





[code:1]
//This script was heavily modified by Ashenfall of The Mystic Lands shard. Feel free to do with it what you wish, but as with all
//Third-party scripts, make sure you understand what you are loading into your server BEFORE you load it in.
using System;
using Server;
using Server.Mobiles;

namespace Server.Misc
{
public class SkillCheck
{
private const bool AntiMacroCode = true; //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
private static bool[] UseAntiMacro = new bool[]
{
// true if this skill uses the anti-macro code, false if it does not
false,// Alchemy = 0,
true,// Anatomy = 1,
true,// AnimalLore = 2,
true,// ItemID = 3,
true,// ArmsLore = 4,
false,// Parry = 5,
true,// Begging = 6,
false,// Blacksmith = 7,
false,// Fletching = 8,
true,// Peacemaking = 9,
true,// Camping = 10,
false,// Carpentry = 11,
false,// Cartography = 12,
false,// Cooking = 13,
true,// DetectHidden = 14,
true,// Discordance = 15,
true,// EvalInt = 16,
true,// Healing = 17,
true,// Fishing = 18,
true,// Forensics = 19,
true,// Herding = 20,
true,// Hiding = 21,
true,// Provocation = 22,
false,// Inscribe = 23,
true,// Lockpicking = 24,
true,// Magery = 25,
true,// MagicResist = 26,
false,// Tactics = 27,
true,// Snooping = 28,
true,// Musicianship = 29,
true,// Poisoning = 30,
false,// Archery = 31,
true,// SpiritSpeak = 32,
true,// Stealing = 33,
false,// Tailoring = 34,
true,// AnimalTaming = 35,
true,// TasteID = 36,
false,// Tinkering = 37,
true,// Tracking = 38,
true,// Veterinary = 39,
false,// Swords = 40,
false,// Macing = 41,
false,// Fencing = 42,
false,// Wrestling = 43,
true,// Lumberjacking = 44,
true,// Mining = 45,
true,// Meditation = 46,
true,// Stealth = 47,
true,// RemoveTrap = 48,
true,// Necromancy = 49,
false,// Focus = 50,
true,// Chivalry = 51
};

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 );

SkillInfo.Table[0].GainFactor = 1;// Alchemy = 0,
SkillInfo.Table[1].GainFactor = .8;// Anatomy = 1,
SkillInfo.Table[2].GainFactor = 1;// AnimalLore = 2,
SkillInfo.Table[3].GainFactor = 1;// ItemID = 3,
SkillInfo.Table[4].GainFactor = 1;// ArmsLore = 4,
SkillInfo.Table[5].GainFactor = .8;// Parry = 5,
SkillInfo.Table[6].GainFactor = 1;// Begging = 6,
SkillInfo.Table[7].GainFactor = 1;// Blacksmith = 7,
SkillInfo.Table[8].GainFactor = 1;// Fletching = 8,
SkillInfo.Table[9].GainFactor = 1;// Peacemaking = 9,
SkillInfo.Table[10].GainFactor = 1;// Camping = 10,
SkillInfo.Table[11].GainFactor = 1;// Carpentry = 11,
SkillInfo.Table[12].GainFactor = 1;// Cartography = 12,
SkillInfo.Table[13].GainFactor = 1;// Cooking = 13,
SkillInfo.Table[14].GainFactor = 1;// DetectHidden = 14,
SkillInfo.Table[15].GainFactor = 1;// Discordance = 15,
SkillInfo.Table[16].GainFactor = 1;// EvalInt = 16,
SkillInfo.Table[17].GainFactor = 1;// Healing = 17,
SkillInfo.Table[18].GainFactor = 1;// Fishing = 18,
SkillInfo.Table[19].GainFactor = 1;// Forensics = 19,
SkillInfo.Table[20].GainFactor = 1;// Herding = 20,
SkillInfo.Table[21].GainFactor = 1.1;// Hiding = 21,
SkillInfo.Table[22].GainFactor = 1;// Provocation = 22,
SkillInfo.Table[23].GainFactor = 1;// Inscribe = 23,
SkillInfo.Table[24].GainFactor = 1;// Lockpicking = 24,
SkillInfo.Table[25].GainFactor = .5;// Magery = 25,
SkillInfo.Table[26].GainFactor = 1.5;// MagicResist = 26,
SkillInfo.Table[27].GainFactor = .85;// Tactics = 27,
SkillInfo.Table[28].GainFactor = 1;// Snooping = 28,
SkillInfo.Table[29].GainFactor = 1;// Musicianship = 29,
SkillInfo.Table[30].GainFactor = 1;// Poisoning = 30
SkillInfo.Table[31].GainFactor = 1;// Archery = 31
SkillInfo.Table[32].GainFactor = 1;// SpiritSpeak = 32
SkillInfo.Table[33].GainFactor = 1.2;// Stealing = 33
SkillInfo.Table[34].GainFactor = 1;// Tailoring = 34
SkillInfo.Table[35].GainFactor = 1.1;// AnimalTaming = 35
SkillInfo.Table[36].GainFactor = 1;// TasteID = 36
SkillInfo.Table[37].GainFactor = 1;// Tinkering = 37
SkillInfo.Table[38].GainFactor = 1;// Tracking = 38
SkillInfo.Table[39].GainFactor = 1;// Veterinary = 39
SkillInfo.Table[40].GainFactor = .8;// Swords = 40
SkillInfo.Table[41].GainFactor = .8;// Macing = 41
SkillInfo.Table[42].GainFactor = .75;// Fencing = 42
SkillInfo.Table[43].GainFactor = .8;// Wrestling = 43
SkillInfo.Table[44].GainFactor = .8;// Lumberjacking = 44
SkillInfo.Table[45].GainFactor = .75;// Mining = 45
SkillInfo.Table[46].GainFactor = .4;// Meditation = 46
SkillInfo.Table[47].GainFactor = 1;// Stealth = 47
SkillInfo.Table[48].GainFactor = 1;// RemoveTrap = 48
SkillInfo.Table[49].GainFactor = 1;// Necromancy = 49
SkillInfo.Table[50].GainFactor = .6;// Focus = 50
SkillInfo.Table[51].GainFactor = 1;// Chivalry = 51
}

public static bool Mobile_SkillCheckLocation( Mobile from, SkillName skillName, double minSkill, double maxSkill )
{
Skill skill = from.Skills[skillName];

if ( skill == null )
return false;

double value = skill.Value;

if ( value < minSkill )
return false; // Too difficult
else if ( value >= maxSkill )
return true; // No challenge

double chance = (value - minSkill) / (maxSkill - minSkill);

Point2D loc = new Point2D( from.Location.X / LocationSize, from.Location.Y / LocationSize );
return CheckSkill( from, skill, loc, chance );
}

public static bool Mobile_SkillCheckDirectLocation( Mobile from, SkillName skillName, double chance )
{
Skill skill = from.Skills[skillName];

if ( skill == null )
return false;

if ( chance < 0.0 )
return false; // Too difficult
else if ( chance >= 1.0 )
return true; // No challenge

Point2D loc = new Point2D( from.Location.X / LocationSize, from.Location.Y / LocationSize );
return CheckSkill( from, skill, loc, chance );
}

public static bool CheckSkill( Mobile from, Skill skill, object amObj, double chance )
{
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 : 0.2 );
//gc /= 2; //Makes it twice as hard to gain
//gc /= 3; //3X as hard to gain
//gc /= 0.5; //Twice as easy to gain

gc *= skill.Info.GainFactor; //Pulls the Gainfactor info from above section


if ( skill.Base > 35.0 )
gc /= 1.5;

else if ( skill.Base > 50.0 )
gc /= 2;

else if ( skill.Base > 70.0 )
gc /= 3;

else if ( skill.Base > 85.0 )
gc /= 4;

else if ( skill.Base > 95.0 )
gc /= 5;

if ( gc < 0.01 )
gc = 0.01;

if ( from.Alive && ( ( gc >= Utility.RandomDouble() && AllowGain( from, skill, amObj ) ) || skill.Base < 10.0 ) )
Gain( from, skill );

return success;
}

public static bool Mobile_SkillCheckTarget( Mobile from, SkillName skillName, object target, double minSkill, double maxSkill )
{
Skill skill = from.Skills[skillName];

if ( skill == null )
return false;

double value = skill.Value;

if ( value < minSkill )
return false; // Too difficult
else if ( value >= maxSkill )
return true; // No challenge

double chance = (value - minSkill) / (maxSkill - minSkill);

return CheckSkill( from, skill, target, chance );
}

public static bool Mobile_SkillCheckDirectTarget( Mobile from, SkillName skillName, object target, double chance )
{
Skill skill = from.Skills[skillName];

if ( skill == null )
return false;

if ( chance < 0.0 )
return false; // Too difficult
else if ( chance >= 1.0 )
return true; // No challenge

return CheckSkill( from, skill, target, chance );
}

private static bool AllowGain( Mobile from, Skill skill, object obj )
{
if ( from is PlayerMobile && AntiMacroCode && UseAntiMacro[skill.Info.SkillID] )
return ((PlayerMobile)from).AntiMacroCheck( skill, obj );
else
return true;
}

public enum Stat { Str, Dex, Int }

public static void Gain( Mobile from, Skill skill )
{
if ( from.Region is Regions.Jail )
return;

if ( skill.SkillName == SkillName.Focus && from is BaseCreature )
return;

if ( skill.Base < skill.Cap && skill.Lock == SkillLock.Up )
{
int toGain = 1;

if ( skill.Base <= 10.0 )
toGain = Utility.Random( 4 ) + 1;

Skills skills = from.Skills;

if ( ( skills.Total / skills.Cap ) >= Utility.RandomDouble() )//( skills.Total >= skills.Cap )
{
for ( int i = 0; i < skills.Length; ++i )
{
Skill toLower = skills;

if ( toLower != skill && toLower.Lock == SkillLock.Down && toLower.BaseFixedPoint >= toGain )
{
toLower.BaseFixedPoint -= toGain;
break;
}
}
}

if ( (skills.Total + toGain) <= skills.Cap )
{
skill.BaseFixedPoint += toGain;
}
}

if ( skill.Lock == SkillLock.Up )
{
SkillInfo info = skill.Info;
//double statcalc = (double) ( from.StatCap - from.RawStatTotal ) / from.StatCap;
double statscalar = 1;//( (1 - statcalc) * 2.0 ) + 1;
//from.SendMessage( 0x35, "statcalc is {0}", statcalc ); // Debugging
//from.SendMessage( 0x35, "statscalar is {0}", statscalar ); // Debugging
if ( from.StrLock == StatLockType.Up && (info.StrGain / 30.0) > ( ( Utility.RandomDouble() ) * statscalar ) )
GainStat( from, Stat.Str );
else if ( from.DexLock == StatLockType.Up && (info.DexGain / 30.0) > ( ( Utility.RandomDouble() ) * statscalar ) )
GainStat( from, Stat.Dex );
else if ( from.IntLock == StatLockType.Up && (info.IntGain / 30.0) > ( ( Utility.RandomDouble() ) * statscalar ) )
GainStat( from, Stat.Int );
}
}

public static bool CanLower( Mobile from, Stat stat )
{
switch ( stat )
{
case Stat.Str: return ( from.StrLock == StatLockType.Down && from.RawStr > 10 );
case Stat.Dex: return ( from.DexLock == StatLockType.Down && from.RawDex > 10 );
case Stat.Int: return ( from.IntLock == StatLockType.Down && from.RawInt > 10 );
}

return false;
}

public static bool CanRaise( Mobile from, Stat stat )
{
if ( !(from is BaseCreature && ((BaseCreature)from).Controled) )
{
if ( from.RawStatTotal >= from.StatCap )
return false;
}

switch ( stat )
{
case Stat.Str: return ( from.StrLock == StatLockType.Up && from.RawStr < 125 );
case Stat.Dex: return ( from.DexLock == StatLockType.Up && from.RawDex < 125 );
case Stat.Int: return ( from.IntLock == StatLockType.Up && from.RawInt < 125 );
}

return false;
}

public static void IncreaseStat( Mobile from, Stat stat, bool atrophy )
{
atrophy = atrophy || (from.RawStatTotal >= from.StatCap);

switch ( stat )
{
case Stat.Str:
{
if ( atrophy )
{
if ( CanLower( from, Stat.Dex ) && (from.RawDex < from.RawInt || !CanLower( from, Stat.Int )) )
--from.RawDex;
else if ( CanLower( from, Stat.Int ) )
--from.RawInt;
}

if ( CanRaise( from, Stat.Str ) )
++from.RawStr;

break;
}
case Stat.Dex:
{
if ( atrophy )
{
if ( CanLower( from, Stat.Str ) && (from.RawStr < from.RawInt || !CanLower( from, Stat.Int )) )
--from.RawStr;
else if ( CanLower( from, Stat.Int ) )
--from.RawInt;
}

if ( CanRaise( from, Stat.Dex ) )
++from.RawDex;

break;
}
case Stat.Int:
{
if ( atrophy )
{
if ( CanLower( from, Stat.Str ) && (from.RawStr < from.RawDex || !CanLower( from, Stat.Dex )) )
--from.RawStr;
else if ( CanLower( from, Stat.Dex ) )
--from.RawDex;
}

if ( CanRaise( from, Stat.Int ) )
++from.RawInt;

break;
}
}
}

private static TimeSpan m_StatGainDelay = TimeSpan.FromMinutes( 8.0 );

public static void GainStat( Mobile from, Stat stat )
{
if ( (from.LastStatGain + m_StatGainDelay) >= DateTime.Now )
return;

from.LastStatGain = DateTime.Now;

bool atrophy = ( (from.RawStatTotal / (double)from.StatCap) >= Utility.RandomDouble() );

IncreaseStat( from, stat, atrophy );
}
}
}
[/code:1]






The following are some specific examples. With each, experiment until you find what you like.


1. Skillgain is too hard! I want to make all skills easier to gain.

In the script, search for
[code:1]
gc += ( 1.0 - chance ) * ( success ? 0.5 : 0.2 );
gc /= 2;
[/code:1]
That gc /= 2; is what you're interested in. That cuts your chance to gain in half. Try replacing the 2 with other numbers like:
[code:1]
gc /= 1;//Gainchance divided by 1
[/code:1]
or
[code:1]
gc /= .5;//Gainchance divided by .5 (gainchance multiplied by 2)
[/code:1]

2. Skillgain is too easy! I want to make all skills harder to gain.

As in the above example, search the script for:
[code:1]
gc += ( 1.0 - chance ) * ( success ? 0.5 : 0.2 );
gc /= 2;
[/code:1]
That gc /= 2; is what you're interested in. That cuts your chance to gain in half. Try replacing the 2 with other numbers like:
[code:1]
gc /= 4;//Gainchance divided by 4
[/code:1]
or
[code:1]
gc /= 8;//Gainchance divided by 8
[/code:1]
You can make the gain as hard as you wish just by increasing that number. A few lines later in the script, there is a limiter...
[code:1]
if ( gc < 0.01 )
gc = 0.01;
[/code:1]
That makes it so that they always have a 1% chance of gaining, no matter how bad you mess up the math in the previous steps.

#3. I want a specific skill to be harder / easier to gain. How do I change that?
You can change what a skill "initializes" at in the "public static void Initialize()" section. Most skills initialize with a value of 1.0 by default. This 1.0 is multipled into your gain chances through the following line:
[code:1]
gc *= skill.Info.GainFactor;
[/code:1]
Normally, when the Gainfactor initializes at 1.0, this line makes no change to the skillgain computation. To change this Gainfactor value for specific skills, look for the following in your script:
[code:1]
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 );
}
[/code:1]
That's the initialize method. You need to add entries into this method for each skill you want to change. It may be easiest for you to copy and paste the following over your initialize method:
[code:1]
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 );

SkillInfo.Table[0].GainFactor = 1;// Alchemy = 0,
SkillInfo.Table[1].GainFactor = .8;// Anatomy = 1,
SkillInfo.Table[2].GainFactor = 1;// AnimalLore = 2,
SkillInfo.Table[3].GainFactor = 1;// ItemID = 3,
SkillInfo.Table[4].GainFactor = 1;// ArmsLore = 4,
SkillInfo.Table[5].GainFactor = .8;// Parry = 5,
SkillInfo.Table[6].GainFactor = 1;// Begging = 6,
SkillInfo.Table[7].GainFactor = 1;// Blacksmith = 7,
SkillInfo.Table[8].GainFactor = 1;// Fletching = 8,
SkillInfo.Table[9].GainFactor = 1;// Peacemaking = 9,
SkillInfo.Table[10].GainFactor = 1;// Camping = 10,
SkillInfo.Table[11].GainFactor = 1;// Carpentry = 11,
SkillInfo.Table[12].GainFactor = 1;// Cartography = 12,
SkillInfo.Table[13].GainFactor = 1;// Cooking = 13,
SkillInfo.Table[14].GainFactor = 1;// DetectHidden = 14,
SkillInfo.Table[15].GainFactor = 1;// Discordance = 15,
SkillInfo.Table[16].GainFactor = 1;// EvalInt = 16,
SkillInfo.Table[17].GainFactor = 1;// Healing = 17,
SkillInfo.Table[18].GainFactor = 1;// Fishing = 18,
SkillInfo.Table[19].GainFactor = 1;// Forensics = 19,
SkillInfo.Table[20].GainFactor = 1;// Herding = 20,
SkillInfo.Table[21].GainFactor = 1.1;// Hiding = 21,
SkillInfo.Table[22].GainFactor = 1;// Provocation = 22,
SkillInfo.Table[23].GainFactor = 1;// Inscribe = 23,
SkillInfo.Table[24].GainFactor = 1;// Lockpicking = 24,
SkillInfo.Table[25].GainFactor = .5;// Magery = 25,
SkillInfo.Table[26].GainFactor = 1.5;// MagicResist = 26,
SkillInfo.Table[27].GainFactor = .85;// Tactics = 27,
SkillInfo.Table[28].GainFactor = 1;// Snooping = 28,
SkillInfo.Table[29].GainFactor = 1;// Musicianship = 29,
SkillInfo.Table[30].GainFactor = 1;// Poisoning = 30
SkillInfo.Table[31].GainFactor = 1;// Archery = 31
SkillInfo.Table[32].GainFactor = 1;// SpiritSpeak = 32
SkillInfo.Table[33].GainFactor = 1.2;// Stealing = 33
SkillInfo.Table[34].GainFactor = 1;// Tailoring = 34
SkillInfo.Table[35].GainFactor = 1.1;// AnimalTaming = 35
SkillInfo.Table[36].GainFactor = 1;// TasteID = 36
SkillInfo.Table[37].GainFactor = 1;// Tinkering = 37
SkillInfo.Table[38].GainFactor = 1;// Tracking = 38
SkillInfo.Table[39].GainFactor = 1;// Veterinary = 39
SkillInfo.Table[40].GainFactor = .8;// Swords = 40
SkillInfo.Table[41].GainFactor = .8;// Macing = 41
SkillInfo.Table[42].GainFactor = .75;// Fencing = 42
SkillInfo.Table[43].GainFactor = .8;// Wrestling = 43
SkillInfo.Table[44].GainFactor = .8;// Lumberjacking = 44
SkillInfo.Table[45].GainFactor = .75;// Mining = 45
SkillInfo.Table[46].GainFactor = .4;// Meditation = 46
SkillInfo.Table[47].GainFactor = 1;// Stealth = 47
SkillInfo.Table[48].GainFactor = 1;// RemoveTrap = 48
SkillInfo.Table[49].GainFactor = 1;// Necromancy = 49
SkillInfo.Table[50].GainFactor = .6;// Focus = 50
SkillInfo.Table[51].GainFactor = 1;// Chivalry = 51
}
[/code:1]
Lets look at a single line that was added, and interpret it:
[code:1]SkillInfo.Table[46].GainFactor = .4;// Meditation = 46[/code:1]
That sets the initialized GainFactor to .4 for the meditation skill. When my character uses meditation, the script multiplies my gain chances by .4, which makes it harder for me to gain meditation.
[code:1]SkillInfo.Table[26].GainFactor = 1.5;// MagicResist = 26,[/code:1]
When my character checks magic resist, my chances of gaining are multiplied by 1.5, making it easier for me to gain Magic Resistance.

#4. How do I turn off this anti-macro garbage?

Looks for the following right at the beginning of the script:
[code:1]
private const bool AntiMacroCode = true;
[/code:1]
Change that "true;" to "false;" and your server will no longer use anti-macro code.

#5. What if I only want to turn off/on anti-macro for a single skill?
Following that
[code:1]private const bool AntiMacroCode = true;[/code:1]
statement area series of lines detailing whether anti-macro is enabled for each skill. Change the setting for each skill to true if you want to enable anti-macro for that skill.

#6. Stat gain sux! How do I change that?
All the way down near the end of the script is a section that looks like this:
[code:1]if ( skill.Lock == SkillLock.Up )
{
SkillInfo info = skill.Info;

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 );
}[/code:1]
That's the section you want to play with. Perhaps the easiest way to modify stat gain overall, is to change the 33.3's. Let's look through a single computation:
[code:1]if ( from.StrLock == StatLockType.Up && (info.StrGain / 33.3) > Utility.RandomDouble() )
GainStat( from, Stat.Str );[/code:1]
Translated, that means:
[code:1]If the skill is not locked (arrow up), and the skill's info.StrGain number divided by 33.3 is greater than a number from .00 to .99, then gain in that stat.[/code:1]
Let's look at an example...
I'm training in Lumberjacking. Let's say that lumberjacking's info.StrGain is 3. The math goes something like this:
3/33.3 > (.00 to .99)
.09 > (.00 to .99)
That's roughly a 10% chance to gain a stat on a successful skillcheck.
If I wanted to increase my odds at getting statgains across the board, I'd change those 33.3's to something like 25.0. Let's do the math again...
3/25 > (.00 to .99)
.12 > (.00 to .99)
That's roughly a 13% chance. Experiment, and see what works best for you.

#7. No matter what I do, I can't gain stats faster than once every 15 minutes. Why is that?

At the very end of the skillcheck.cs script, there's a section that look slike this:
[code:1]private static TimeSpan m_StatGainDelay = TimeSpan.FromMinutes( 15.0 );[/code:1]
Change that 15.0 to whatver number of minutes you like.
 

Phantom

Knight
kylesicool15 said:
138 errors
hmm
A. Thank god for backups
B. Get your shit straight

Your the "idiot" that used something from the Archive from over a 2 years ago.

In the future, DO NOT USE SHIT FROM THE ARCHIVE FORUM.

Don't freaking attack people's scripts that left RunUO 2 years ago.
 

Phantom

Knight
+S@mael+ said:
So this tutorial is no good? I was lookin for something like this, plz direct me:confused:


Why would you reply to a 2 year old thread, where the only reply, was done by an idiot who didn't pay attention and replied 3 months ago?

If you want help make a new thread.
 
Top