ID:142962
 
Code:
if(usr.level>=50&&usr.level<100)
var/hup = rand(8,20)
var/rup = rand(3,10)
var/aup = rand(2,6)
usr.level += 1
usr.exp = 0
usr.maxexp += rand(5,20)
usr.maxhealth += hup
usr.health=usr.maxhealth
usr.maxreiatsu += rup
usr.reiatsu=usr.maxreiatsu
usr.matk += aup
usr.atk=usr.matk
usr<<"<center><font size=3><br><br>--------------------<br><br>LEVEL UP<br><br>Level [usr.level]<br>Health + [hup]<br>Reiatsu + [rup]<br>Attack + [aup]<br><br>--------------------<br><br></font size></center>"
if(usr.level>=100&&usr.level<300)
var/hup = rand(10,30)
var/rup = rand(5,20)
var/aup = rand(5,10)
usr.level += 1
usr.exp = 0
usr.maxexp += rand(10,40)
usr.maxhealth += hup
usr.health=usr.maxhealth
usr.maxreiatsu += rup
usr.reiatsu=usr.maxreiatsu
usr.matk += aup
usr.atk=usr.matk
usr<<"<center><font size=3><br><br>--------------------<br><br>LEVEL UP<br><br>Level [usr.level]<br>Health + [hup]<br>Reiatsu + [rup]<br>Attack + [aup]<br><br>--------------------<br><br></font size></center>"
usr.Lt()

mob/proc
Lt()
if(src.level == 100&&src.race=="Shinigami")
src.maxhealth=round(src.maxhealth*1.05)
src.health = src.maxhealth
src.maxreiatsu=round(src.maxreiatsu*1.05)
src.reiatsu = src.maxreiatsu
src.matk=round(src.matk*1.05)
src.atk = src.matk
src<< "Congratulations, you are now of Lieutenant level."


Problem description:
So I have two problems which probably resulted as me just not being careful.

Problem 1: Whenever you achieve level 100, you get two levels. You instantly levelup twice whenever you hit 100.

Problem 2: The whole Lieutenant thing doesn't work.
First of all, every single instance of usr in that proc needs to be changed to src. Or, just remove usr, because src is the default. usr has no place in procs.

Next, you've got this:

if(level < 100)
level += 1
if(level >= 100)
level += 1


Clearly, at level 99, the first if() statement is triggered, setting level to 100, then the second one is triggered, setting level to 101. You have to change the if()s to else if()s, or, even better, change your proc so that only the things that are DIFFERENT go within the if() statements. IE:

var/hup
var/rup
var/aup
var/eup
if(level < 100)
hup = rand(8,20)
rup = rand(3,10)
aup = rand(2,6)
eup = rand(5,20)
else if(level >= 100)
hup = rand(10,30)
rup = rand(5,20)
aup = rand(5,10)
eup = rand(10,40)

h += hup
r += rup
a += aup
e += eup

level += 1
src << "U LEVAL UPP"


As for your problem with Lt()... you're calling it only AFTER level has been changed from 100 to 101.
In response to Garthor
Okay, so everything's fixed except for the Lt().

I didn't quite understand what you were saying.
In response to GohanIdz
You are calling it only after level is 101.
In response to Garthor
Ah, I see now. Fixed.

Thanks man ^_^