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!

help with level system

MrBurston

Traveler
ok im running my server on 2.3 (compiled for .net 4) and im having some problems with my level system.

it will not let me change any exp tag in props

and for some reason when you level it does not set the exp back to 0....

when i dont comment out lines 142 - 154 it works but does not call the function to reset exp to 0

Code:
            while (pm.Exp >= pm.LevelAt && pm.Level != pm.LevelCap)
            {
                if (set.AccumulativeExp)
                    return;
 
                int newexp = 0;
 
                if (pm.Exp > pm.LevelAt)
                  newexp = pm.Exp - pm.LevelAt;
 
                pm.Exp = newexp;
                TimesLeveled++;
            }


when i dont comment out the lines i get an error on line 150

Code:
newexp = pm.Exp - pm.LevelAt;

about it cant change a 'double' to 'int'

if i change line 147 to double it loads but crashes when ever someone levels up.

Code:
int newexp = 0;


any help would be great :)
 
Top