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 to Change: StatCap, SkillCap, Skill Gaining Difficulty and Stats Gaining Difficulty

Ademir José

Wanderer
First of all I want to Thank to: Arvoreen, daat99 and m309(those who helped me).
and the Threads:
http://www.runuo.com/community/threads/how-to-change-max-skills-cap.64295/
http://www.runuo.com/community/threads/how-to-change-stat-cap.99905/
http://www.runuo.com/community/threads/skill-gaining.493624/
http://www.runuo.com/community/threads/stats-gaining-dificulty.519428/#post-3904342

StatCap and SkillCap:
Code:
1) open the: PlayerMobile.cs
 
around line: 1333~1369 you will see:
 
            get
            {
                if( Core.ML && this.AccessLevel == AccessLevel.Player )
                    return Math.Min( base.Str, 150 );
 
                return base.Str;
            }
            set
            {
                base.Str = value;
            }
        }
 
        [CommandProperty( AccessLevel.GameMaster )]
        public override int Int
        {
            get
            {
                if( Core.ML && this.AccessLevel == AccessLevel.Player )
                    return Math.Min( base.Int, 150 );
 
                return base.Int;
            }
            set
            {
                base.Int = value;
            }
        }
 
        [CommandProperty( AccessLevel.GameMaster )]
        public override int Dex
        {
            get
            {
                if( Core.ML && this.AccessLevel == AccessLevel.Player )
                    return Math.Min( base.Dex, 150 );
 
                return base.Dex;
            }
 
Change the "150" to the max stats you want that the skills can "grow".
Exemple: If a player trains Hidding he will gain +Dex until 150, if you change this to 10000,
the player will be able to get his Dex until 10000 when he uses hidding.
 
End of "1)"
 
--------------------------------------------------------------------------------------------------
 
2) open: CharacterCreation.cs
around line: 651~654 you will see:
 
            //newChar.Hue = Utility.ClipSkinHue( args.Hue & 0x3FFF ) | 0x8000;
            newChar.Hue = newChar.Race.ClipSkinHue( args.Hue & 0x3FFF ) | 0x8000;
 
            newChar.Hunger = 20;
 
            bool young = false;
 
below the "newChar.Hunger = 20;" you will have to put "newChar.StatCap = 30000" and "newChar.Skills.Cap = 100000;"
 
so it will looks like:
            //newChar.Hue = Utility.ClipSkinHue( args.Hue & 0x3FFF ) | 0x8000;
            newChar.Hue = newChar.Race.ClipSkinHue( args.Hue & 0x3FFF ) | 0x8000;
 
            newChar.Hunger = 20;
 
                        newChar.StatCap = 30000;
                        newChar.Skills.Cap = 100000;
 
            bool young = false;
 
The "30000" and "100000" will be your shard's caps, so be free to change it.
PS: at newChar.Skills.Cap remember that you have to put 1000 to 100.0.
 
 
Now you have to open SkillCheck.cs:
around line: 282~289 you will see:
            switch ( stat )
            {
                case Stat.Str: return ( from.StrLock == StatLockType.Up && from.RawStr < 10000 );
                case Stat.Dex: return ( from.DexLock == StatLockType.Up && from.RawDex < 10000 );
                case Stat.Int: return ( from.IntLock == StatLockType.Up && from.RawInt < 10000 );
            }
change the "10000" to the max each stat can grow.
Exemple: the max str is 10000 if you change to 37, the players will only be
able to get 37 of str.
 
End of 2)


Stats Gaining Difficulty and Skills Gaining Difficulty:
Code:
Open: SkillCheck.cs
Around line: 9~12 you will see:
        private static readonly bool AntiMacroCode = !Core.ML;        //Change this to false to disable anti-macro code
Change "!Core.ML" to "false" for the players be able to macro.
 
 
Around line: 129~137 you will see:
            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 /= 2;
 
 
            gc *= skill.Info.GainFactor;
 
Change the "2" of these two "gc /= 2;" to the difficulty you want that the skills grows.
Being: 10 harder than 2.
Exemple: "gc /= 10;" the players will need to do more repetitions to get +0.1.(hardshard)
"gc /= 1.4;" the players will need to do less repetitions to get +0.1.(easyshard)
 
 
Around line: 344~347 you will see:
        private static TimeSpan m_StatGainDelay = TimeSpan.FromMinutes( 15.0 );
        private static TimeSpan m_PetStatGainDelay = TimeSpan.FromMinutes( 5.0 );
Change the 15.0 to the time(in minutes) that the players will gain another stat after gaining one.
Exemple: change to "1.0" and the player that uses BS will gain +1Str, if he keeps using BS he will only gain
another STR after 1.0 minute(respecting the Difficulty to grow(next step))
 
 
Around line: 247~258 you will see:
            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 );
            }
        }
 
Change the 33.3 to the difficulty you want that the Stats grows.
Being: 20.0 easier than 33.3.
Exemple: if you put 1.1 the players will always gain +1 Dex, Int or Str
when they use a Skill(respecting only the time between the gains)
 

Metman

Wanderer
Have this chanced recently? I am just learning C# and even worse extremely new to RunUO. I found this tutorial and thought it was a good place to start. Learning how the players are built and what they start with etc. etc. However, when I tried to add the two lines:
Code:
                            newChar.StatCap = 275;
                            newChar.Skills.Cap = 72000;

I get this when I compile starting RunUO:

Code:
Scripts: Compiling C# scripts...failed (1 errors, 0 warnings)
Errors:
 + Misc/CharacterCreation.cs:
    CS0103: Line 71: The name 'newChar' does not exist in the current context

Any suggestions? Am I missing something somewhere?
 

ArisBB

Sorceror
find this
Code:
if ( newChar == null )
{
Console.WriteLine( "Login: {0}: Character creation failed, account full", state );
return;
}

and down you put this...
Code:
newChar.StatCap = 275;
                        newChar.SkillsCap = 72000;

my is:
Code:
Mobile newChar = CreateMobile( args.Account as Account );
 
if ( newChar == null )
{
Console.WriteLine( "Login: {0}: Character creation failed, account full", state );
return;
}
 
args.Mobile = newChar;
m_Mobile = newChar;
 
newChar.Player = true;
newChar.AccessLevel = args.Account.AccessLevel;
newChar.Female = args.Female;
//newChar.Body = newChar.Female ? 0x191 : 0x190;
 
if( Core.Expansion >= args.Race.RequiredExpansion )
newChar.Race = args.Race;//Sets body
else
newChar.Race = Race.DefaultRace;
 
//newChar.Hue = Utility.ClipSkinHue( args.Hue & 0x3FFF ) | 0x8000;
newChar.Hue = newChar.Race.ClipSkinHue( args.Hue & 0x3FFF ) | 0x8000;
 
newChar.Hunger = 20;
 
                        newChar.StatCap = 3000; //aris - inexistente
                        newChar.SkillsCap = 100000; //aris - inexistente

note that you use "newChar.Skills.Cap", i belive that you will got a error... im using "newChar.SkillsCap"
 

Metman

Wanderer
Wow. Usually its the comma that gets me...
Thank you for pointing out the obvious. I missed it more times than I care to confess.

Now to solve my .CanFly errors....

Thanks again.
 
Top