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!

Level System 3

Gm Safen

Sorceror
I use run2 I have used her scripts and he doesn't take exp the pg if he builds something, I have tried only him with the metals and not from exp
 

Scifer_12

Wanderer
good job on the level system works grate, but i wanted to ann a skill ball every time u level could u give me the proper code for this plz
 

R-T-B

Wanderer
Out of curiosity, are all the fixes you went through here integrated into those first files you posted?
 

Ki Frost

Sorceror
R-T-B;722041 said:
Out of curiosity, are all the fixes you went through here integrated into those first files you posted?

There is no reset file in the package.
There is no JUST kills exp setting.
There is no option to turn off accumulative exp.

Kills not giving Exp was fixed.


If/When i update this system those three things will be added, along with.

Less PlayerMobile Edits.
An Exp Bar that works (auto refreshes)
Scales Added to the craft section (maybe)
and probably some different packaging.(maybe)
(Like, One with just classic, one with just enviroment, one with just pvp, one with just kills, and one with all.)
 
hopefully you will also have a nifty upgrade file to let us folks with the 3.0 version be able to upgrade easily lol. i ain't installed yet but will be either tonight before i goto sleep or first thing in the morning.

wait it is the morning lol ok afternoon
 
ok everything works perfectly only one thing i would like to change and not exactly sure where i change it at.

to make people gain levels slower! all i killed was a few harpies and headless ones and a couple gazers and i jumped to level 178 did the first level of covetous. sorry but that was WAYYYYYY too fast. i wanna slow it down to where they kill a regular dragon = 1538 xp and it dont auto level them! i didnt even know i was gaining levels till i did a mouse over lol

just to test i killed a dragon at level 35 and now i am level 49 so i didnt just gain one level i gained 14 levels off a regular dragon!
gained 1 level at level 49 which put me to 50?
 
LordHogFred;695104 said:
Go to the LevelHandler.cs and find the DoLevel section.

Find this part of the section:
Code:
            for (int i = 1; pm.Exp >= pm.ToLevel; i++)
            {

And add this underneath:
Code:
int curlv = pm.Level + 1;

Then after that you will need to make various if statements like:
Code:
//Level 1 Exp
if ( curlv = 1 )
pm.ToLevel = 100;

//Level 2 Exp
else if ( curlv = 2 )
pm.ToLevel - 200;

etc, etc

Hope that helps you :).

after doing this i get these errors when i try to load up many many of these as i set it up for 36 levels and i set the levels up exactly like they are in D&D 2.0
Code:
RunUO - [www.runuo.com] Version 2.0, Build 2357.32527
Core: Running on .NET Framework Version 2.0.50727
Core: Optimizing for 2 processors
Scripts: Compiling C# scripts...failed (1 errors, 0 warnings)
Errors:
 + custom/other/Level System - 3/Level System 3/Core/Level Handler.CS:
    CS0029: Line 185: Cannot implicitly convert type 'int' to 'bool'
    CS0029: Line 189: Cannot implicitly convert type 'int' to 'bool'
    CS0201: Line 190: Only assignment, call, increment, decrement, and new objec
t expressions can be used as a statement
    CS0029: Line 193: Cannot implicitly convert type 'int' to 'bool'
    CS0029: Line 197: Cannot implicitly convert type 'int' to 'bool'
    CS0201: Line 198: Only assignment, call, increment, decrement, and new objec
t expressions can be used as a statement
    CS0029: Line 201: Cannot implicitly convert type 'int' to 'bool'
    CS0029: Line 205: Cannot implicitly convert type 'int' to 'bool'
    CS0201: Line 206: Only assignment, call, increment, decrement, and new objec
t expressions can be used as a statement
    CS0029: Line 209: Cannot implicitly convert type 'int' to 'bool'
    CS0029: Line 213: Cannot implicitly convert type 'int' to 'bool'
    CS0201: Line 214: Only assignment, call, increment, decrement, and new objec
t expressions can be used as a statement
    CS0029: Line 217: Cannot implicitly convert type 'int' to 'bool'
    CS0029: Line 221: Cannot implicitly convert type 'int' to 'bool'
    CS0201: Line 222: Only assignment, call, increment, decrement, and new objec
t expressions can be used as a statement
    CS0029: Line 225: Cannot implicitly convert type 'int' to 'bool'
    CS0029: Line 229: Cannot implicitly convert type 'int' to 'bool'
    CS0201: Line 230: Only assignment, call, increment, decrement, and new objec
t expressions can be used as a statement
    CS0029: Line 233: Cannot implicitly convert type 'int' to 'bool'
    CS0029: Line 237: Cannot implicitly convert type 'int' to 'bool'
    CS0201: Line 238: Only assignment, call, increment, decrement, and new objec
t expressions can be used as a statement
    CS0029: Line 241: Cannot implicitly convert type 'int' to 'bool'
    CS0029: Line 245: Cannot implicitly convert type 'int' to 'bool'
    CS0201: Line 246: Only assignment, call, increment, decrement, and new objec
t expressions can be used as a statement
    CS0029: Line 249: Cannot implicitly convert type 'int' to 'bool'
    CS0029: Line 253: Cannot implicitly convert type 'int' to 'bool'
    CS0201: Line 254: Only assignment, call, increment, decrement, and new objec
t expressions can be used as a statement
    CS0029: Line 257: Cannot implicitly convert type 'int' to 'bool'
    CS0029: Line 261: Cannot implicitly convert type 'int' to 'bool'
    CS0201: Line 262: Only assignment, call, increment, decrement, and new objec
t expressions can be used as a statement
    CS0029: Line 265: Cannot implicitly convert type 'int' to 'bool'
    CS0029: Line 269: Cannot implicitly convert type 'int' to 'bool'
    CS0201: Line 270: Only assignment, call, increment, decrement, and new objec
t expressions can be used as a statement
    CS0029: Line 273: Cannot implicitly convert type 'int' to 'bool'
    CS0029: Line 277: Cannot implicitly convert type 'int' to 'bool'
    CS0201: Line 278: Only assignment, call, increment, decrement, and new objec
t expressions can be used as a statement
    CS0029: Line 281: Cannot implicitly convert type 'int' to 'bool'
    CS0029: Line 285: Cannot implicitly convert type 'int' to 'bool'
    CS0201: Line 286: Only assignment, call, increment, decrement, and new objec
t expressions can be used as a statement
    CS0029: Line 289: Cannot implicitly convert type 'int' to 'bool'
    CS0029: Line 293: Cannot implicitly convert type 'int' to 'bool'
    CS0201: Line 294: Only assignment, call, increment, decrement, and new objec
t expressions can be used as a statement
    CS0029: Line 297: Cannot implicitly convert type 'int' to 'bool'
    CS0029: Line 301: Cannot implicitly convert type 'int' to 'bool'
    CS0201: Line 302: Only assignment, call, increment, decrement, and new objec
t expressions can be used as a statement
    CS0029: Line 305: Cannot implicitly convert type 'int' to 'bool'
    CS0029: Line 309: Cannot implicitly convert type 'int' to 'bool'
    CS0201: Line 310: Only assignment, call, increment, decrement, and new objec
t expressions can be used as a statement
    CS0029: Line 313: Cannot implicitly convert type 'int' to 'bool'
    CS0029: Line 317: Cannot implicitly convert type 'int' to 'bool'
    CS0201: Line 318: Only assignment, call, increment, decrement, and new objec
t expressions can be used as a statement
    CS0029: Line 321: Cannot implicitly convert type 'int' to 'bool'
    CS0029: Line 325: Cannot implicitly convert type 'int' to 'bool'
    CS0201: Line 326: Only assignment, call, increment, decrement, and new objec
t expressions can be used as a statement
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.

oh yeah here is that section of coding lol

Code:
        public static void DoLevel(Mobile klr, Configured c)
        {
            PlayerMobile pm = klr as PlayerMobile;
            LevelHandler lh = new LevelHandler();

            double lvls = 0;

            for (int i = 1; pm.Exp >= pm.ToLevel; i++)
            {
			int curlv = pm.Level + 1;
			
			//Level 1 Exp
			if ( curlv = 1 )
			pm.ToLevel = 1;

			//Level 2 Exp
			else if ( curlv = 2 )
			pm.ToLevel - 2000;

			//Level 3 Exp
			if ( curlv = 3 )
			pm.ToLevel = 4000;

			//Level 4 Exp
			else if ( curlv = 4 )
			pm.ToLevel - 8000;
			
			//Level 5 Exp
			if ( curlv = 5 )
			pm.ToLevel = 16000;

			//Level 6 Exp
			else if ( curlv = 6 )
			pm.ToLevel - 32000;

			//Level 7 Exp
			if ( curlv = 7 )
			pm.ToLevel = 64000;

			//Level 8 Exp
			else if ( curlv = 8 )
			pm.ToLevel - 125000;
			
			//Level 9 Exp
			if ( curlv = 9 )
			pm.ToLevel = 250000;

			//Level 10 Exp
			else if ( curlv = 10 )
			pm.ToLevel - 500000;

			//Level 11 Exp
			if ( curlv = 11 )
			pm.ToLevel = 750000;

			//Level 12 Exp
			else if ( curlv = 12 )
			pm.ToLevel - 1000000;
			
			//Level 13 Exp
			if ( curlv = 13 )
			pm.ToLevel = 1250000;

			//Level 14 Exp
			else if ( curlv = 14 )
			pm.ToLevel - 1500000;

			//Level 15 Exp
			if ( curlv = 15 )
			pm.ToLevel = 1750000;

			//Level 16 Exp
			else if ( curlv = 16 )
			pm.ToLevel - 2000000;
			
			//Level 17 Exp
			if ( curlv = 17 )
			pm.ToLevel = 2250000;

			//Level 18 Exp
			else if ( curlv = 18 )
			pm.ToLevel - 2500000;

			//Level 19 Exp
			if ( curlv = 19 )
			pm.ToLevel = 2750000;

			//Level 20 Exp
			else if ( curlv = 20 )
			pm.ToLevel - 3000000;
			
			//Level 21 Exp
			if ( curlv = 21 )
			pm.ToLevel = 3500000;

			//Level 22 Exp
			else if ( curlv = 22 )
			pm.ToLevel - 4000000;

			//Level 23 Exp
			if ( curlv = 23 )
			pm.ToLevel = 4500000;

			//Level 24 Exp
			else if ( curlv = 24 )
			pm.ToLevel - 5000000;
			
			//Level 25 Exp
			if ( curlv = 25 )
			pm.ToLevel = 5500000;

			//Level 26 Exp
			else if ( curlv = 26 )
			pm.ToLevel - 6000000;

			//Level 27 Exp
			if ( curlv = 27 )
			pm.ToLevel = 6500000;

			//Level 28 Exp
			else if ( curlv = 28 )
			pm.ToLevel - 7000000;
			
			//Level 29 Exp
			if ( curlv = 29 )
			pm.ToLevel = 7500000;

			//Level 30 Exp
			else if ( curlv = 30 )
			pm.ToLevel - 8000000;

			//Level 31 Exp
			if ( curlv = 31 )
			pm.ToLevel = 8500000;

			//Level 32 Exp
			else if ( curlv = 32 )
			pm.ToLevel - 9000000;
			
			//Level 33 Exp
			if ( curlv = 33 )
			pm.ToLevel = 9500000;

			//Level 34 Exp
			else if ( curlv = 34 )
			pm.ToLevel - 10000000;

			//Level 35 Exp
			if ( curlv = 35 )
			pm.ToLevel = 10500000;

			//Level 36 Exp
			else if ( curlv = 36 )
			pm.ToLevel - 11000000;

                // i is now times leveled.

                pm.ToLevel += 50 + (pm.Level * 2);
 

Ki Frost

Sorceror
yo.

couple questions first.

What system is enabled?
Did you do the mod to the file for kill exp only?
How much exp do you gain for killing a dragon?
Are you using advanced skill exp?
Are you using Advanced Kill exp?

also, whats wrong with your code is in your if statments you only have one ='s sign.

ifs are setup like

if (this == that)
that = new;

the statment in the if uses 2 ='s and the statment below it only uses 1(hope that makes some since.)
 
actuall i tried the 2 == and that broguht up errors also granted not as many. i and using ALL the systems. and teh second advanced one. i beielvie i posted how much i gained on killing a dragon.some where around 1538 i think. i gained a total of 14 levels!

here are the errors i am getting after changing everything to == and =

Code:
Errors:
 + custom/other/Level System - 3/Level System 3/Core/Level Handler.CS:
    CS0201: Line 190: Only assignment, call, increment, decrement, and new objec
t expressions can be used as a statement
    CS0201: Line 198: Only assignment, call, increment, decrement, and new objec
t expressions can be used as a statement
    CS0201: Line 206: Only assignment, call, increment, decrement, and new objec
t expressions can be used as a statement
    CS0201: Line 214: Only assignment, call, increment, decrement, and new objec
t expressions can be used as a statement
    CS0201: Line 222: Only assignment, call, increment, decrement, and new objec
t expressions can be used as a statement
    CS0201: Line 230: Only assignment, call, increment, decrement, and new objec
t expressions can be used as a statement
    CS0201: Line 238: Only assignment, call, increment, decrement, and new objec
t expressions can be used as a statement
    CS0201: Line 246: Only assignment, call, increment, decrement, and new objec
t expressions can be used as a statement
    CS0201: Line 254: Only assignment, call, increment, decrement, and new objec
t expressions can be used as a statement
    CS0201: Line 262: Only assignment, call, increment, decrement, and new objec
t expressions can be used as a statement
    CS0201: Line 270: Only assignment, call, increment, decrement, and new objec
t expressions can be used as a statement
    CS0201: Line 278: Only assignment, call, increment, decrement, and new objec
t expressions can be used as a statement
    CS0201: Line 286: Only assignment, call, increment, decrement, and new objec
t expressions can be used as a statement
    CS0201: Line 294: Only assignment, call, increment, decrement, and new objec
t expressions can be used as a statement
    CS0201: Line 302: Only assignment, call, increment, decrement, and new objec
t expressions can be used as a statement
    CS0201: Line 310: Only assignment, call, increment, decrement, and new objec
t expressions can be used as a statement
    CS0201: Line 318: Only assignment, call, increment, decrement, and new objec
t expressions can be used as a statement
    CS0201: Line 326: Only assignment, call, increment, decrement, and new objec
t expressions can be used as a statement
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.

here is the code being used during those errors. (i thought after looking at some other if statements that is why i changed those lol)

Code:
        public static void DoLevel(Mobile klr, Configured c)
        {
            PlayerMobile pm = klr as PlayerMobile;
            LevelHandler lh = new LevelHandler();

            double lvls = 0;

            for (int i = 1; pm.Exp >= pm.ToLevel; i++)
            {
			int curlv = pm.Level + 1;
			
			//Level 1 Exp
			if ( curlv == 1 )
			pm.ToLevel = 1;

			//Level 2 Exp
			if ( curlv == 2 )
			pm.ToLevel - 2000;

			//Level 3 Exp
			if ( curlv == 3 )
			pm.ToLevel = 4000;

			//Level 4 Exp
			if ( curlv == 4 )
			pm.ToLevel - 8000;
			
			//Level 5 Exp
			if ( curlv == 5 )
			pm.ToLevel = 16000;

			//Level 6 Exp
			if ( curlv == 6 )
			pm.ToLevel - 32000;

			//Level 7 Exp
			if ( curlv == 7 )
			pm.ToLevel = 64000;

			//Level 8 Exp
			if ( curlv == 8 )
			pm.ToLevel - 125000;
			
			//Level 9 Exp
			if ( curlv == 9 )
			pm.ToLevel = 250000;

			//Level 10 Exp
			if ( curlv == 10 )
			pm.ToLevel - 500000;

			//Level 11 Exp
			if ( curlv == 11 )
			pm.ToLevel = 750000;

			//Level 12 Exp
			if ( curlv == 12 )
			pm.ToLevel - 1000000;
			
			//Level 13 Exp
			if ( curlv == 13 )
			pm.ToLevel = 1250000;

			//Level 14 Exp
			if ( curlv == 14 )
			pm.ToLevel - 1500000;

			//Level 15 Exp
			if ( curlv == 15 )
			pm.ToLevel = 1750000;

			//Level 16 Exp
			if ( curlv == 16 )
			pm.ToLevel - 2000000;
			
			//Level 17 Exp
			if ( curlv == 17 )
			pm.ToLevel = 2250000;

			//Level 18 Exp
			if ( curlv == 18 )
			pm.ToLevel - 2500000;

			//Level 19 Exp
			if ( curlv == 19 )
			pm.ToLevel = 2750000;

			//Level 20 Exp
			if ( curlv == 20 )
			pm.ToLevel - 3000000;
			
			//Level 21 Exp
			if ( curlv == 21 )
			pm.ToLevel = 3500000;

			//Level 22 Exp
			if ( curlv == 22 )
			pm.ToLevel - 4000000;

			//Level 23 Exp
			if ( curlv == 23 )
			pm.ToLevel = 4500000;

			//Level 24 Exp
			if ( curlv == 24 )
			pm.ToLevel - 5000000;
			
			//Level 25 Exp
			if ( curlv == 25 )
			pm.ToLevel = 5500000;

			//Level 26 Exp
			if ( curlv == 26 )
			pm.ToLevel - 6000000;

			//Level 27 Exp
			if ( curlv == 27 )
			pm.ToLevel = 6500000;

			//Level 28 Exp
			if ( curlv == 28 )
			pm.ToLevel - 7000000;
			
			//Level 29 Exp
			if ( curlv == 29 )
			pm.ToLevel = 7500000;

			//Level 30 Exp
			if ( curlv == 30 )
			pm.ToLevel - 8000000;

			//Level 31 Exp
			if ( curlv == 31 )
			pm.ToLevel = 8500000;

			//Level 32 Exp
			if ( curlv == 32 )
			pm.ToLevel - 9000000;
			
			//Level 33 Exp
			if ( curlv == 33 )
			pm.ToLevel = 9500000;

			//Level 34 Exp
			if ( curlv == 34 )
			pm.ToLevel - 10000000;

			//Level 35 Exp
			if ( curlv == 35 )
			pm.ToLevel = 10500000;

			//Level 36 Exp
			if ( curlv == 36 )
			pm.ToLevel - 11000000;

                // i is now times leveled.

here is the part out of the config file

Code:
        public bool PetKillGivesExp = true;     //When players pet kills something player gets exp
        public bool CraftGivesExp = true;       //A sucessful craft gives players exp.
        public bool PartyExpShare = true;       //Do parties share exp?
        public bool PartySplitExp = true;       //if parties share exp do they split it evenly?
        //EX: kill gives 30xp 3 people in party each person gets 10 xp, even split.

        public bool AdvancedSkillExp = false;   //Only fighting skills give exp?
        public bool AdvancedExp = true;        // Use tables to give exp off of killed.
 

Ki Frost

Sorceror
it seems every other one of your pm.ToLevel ='s is pm.ToLevel '-' wich is incorrect, if you ARE wanting to subtract that amount it would be -= not just -, if you ARNT then change them to ='s and go from there.

If you are using the tables as your exp option then to tone down the exp given just open your LevelHandler.cs (i think, its been a while since ive actually looked. :/) and find the table that a "dragon" can be found in. and change the exp given to a smaller amount.
 
actually after i posted that i noticed it and fixed the - back ito a = still not sure how that happened. lol tired i guess. and i am recompiling it right now. ill edit this in a minute to let ya know how it goers

ok it compiled now to give it a test run :D granted it deleted ALL playermobiles :( thankfully im the only one on it right now lol

ok appears to be working correct let me prop a weapon up real quick and have my level 2 char after killing some things take a dragon on and see how it goes
 
well it definatly buffed out the dragons..... i was doing over 4k dam a hit and it still managed to kill me in 2 hits with the dragon at lv 57 lol

ok there is definatly a problem tho

i restarted my server and it wants me to delete the player.mobiles again cant have that everytime i reboot. here is the exception it threw me.

Code:
RunUO - [www.runuo.com] Version 2.0, Build 2357.32527
Core: Running on .NET Framework Version 2.0.50727
Core: Optimizing for 2 processors
Scripts: Compiling C# scripts...done (cached)
Scripts: Compiling VB.NET scripts...no files found.
Scripts: Verifying...done (2634 items, 562 mobiles)
Regions: Loading...done
World: Loading...An error was encountered while loading a saved object
 - Type: Server.Mobiles.PlayerMobile
 - Serial: 0x00000500
Delete the object? (y/n)
After pressing return an exception will be thrown and the server will terminate

Error:
System.Exception: Load failed (items=False, mobiles=True, guilds=False, type=Ser
ver.Mobiles.PlayerMobile, serial=0x00000500) ---> System.ArgumentOutOfRangeExcep
tion: Ticks must be between DateTime.MinValue.Ticks and DateTime.MaxValue.Ticks.

Parameter name: ticks
   at System.DateTime..ctor(Int64 ticks)
   at Server.BinaryFileReader.ReadDateTime()
   at Server.Mobiles.PlayerMobile.Deserialize(GenericReader reader)
   at Server.World.Load()
   --- End of inner exception stack trace ---
   at Server.World.Load()
   at Server.ScriptCompiler.Compile(Boolean debug)
   at Server.Core.Main(String[] args)
This exception is fatal, press return to exit
 
ummmmm ok this is weird as hell now my server is constantly restartign itself. any clues? i deleted my saves and started over and now it is staying loaded. something it must ot of liked lol ok it either aint liking hte dragon or someting else is worng it is now locking up when i kill hte dragon wont even send a error it just freeses

ok ifi use the command kill it don't lock up but if i kill it normally it locks up and that is with ANY creature i kill
 

Ki Frost

Sorceror
the reason it wants you to delete all mobs on startup every time is because you have either a bad serialize or deserialize in your PM. From what it sounds like you have one of them out of order from the other.

if you have one like
Level
Exp
NextLevel
Ect.
Ect.

you have to have the other one exactly like it.

for your lock up problem, im not to sure.... you may want to download the reset file (its in this thread somewhere... either end-ish of page one or start-ish on page 2) and follow the directions for it. After you do those 2 things, and if its still freezing, then its more than likely something else that you did...
 
i might not of merged the files correctly. i also have gd13's sickness,hunting, and auction scripts which heavily moddified the files. specially the basecreature and playermobile. So either it aint compatable with them OR i didn't merge them right one of the two. the way i did the serial stuff is i just copied and pasted that way it would be right lol. here is a copy of my playermobile and basecreature. can ya let me know if you see a problem?

oh yeah i had to change the case 26 to 27 cause gd13's effect system uses the case 26 also.
 
ok it wouldn't let me just paste the code so lets try it this way
 

Attachments

  • BaseCreature.cs
    122.7 KB · Views: 34
  • PlayerMobile.cs
    159.8 KB · Views: 34
  • Level Handler.CS
    9.7 KB · Views: 42

Ki Frost

Sorceror
ok, 2 problems in your pm.

one is that when you changed the case from 26 to 27 you didnt change the goto number. It should be 26 not 25.

Code:
                case 27:
                    {
                        m_Level = reader.ReadInt();
                        m_MaxLevel = reader.ReadInt();
                        m_Exp = reader.ReadInt();
                        m_ToLevel = reader.ReadInt();
                        m_kxp = reader.ReadInt();

                        [COLOR="Green"]goto case 26;[/COLOR] [COLOR="DarkRed"]//goto case 25;[/COLOR]
                    }

another one is that you have 2 ints that define "version" (though i dont know if this causes any problems.)

Code:
            writer.Write((int)27); // version

            //Level System
            writer.Write((int)m_Level);
            writer.Write((int)m_MaxLevel);
            writer.Write((int)m_Exp);
            writer.Write((int)m_ToLevel);
            writer.Write((int)m_kxp);
            //End Level System

/*GD13_HS_Start_6*/
			[COLOR="DarkRed"]//writer.Write( (int) 26 ); // version[/COLOR]

			writer.Write( (int)m_HuntMode );
			writer.Write( (int)m_HuntRank );
so, put the //'s infront of the things in red (like i did) or remove them, and then go from there.


also, when posting information multiple times, use the edit button on your post ;)
 
Top