ID:163066
 
Would this work if i made the gain after lvl 100 = 0?
mob/proc
LevelUp(mob/Player/M)
if(usr.Class=="Knight")
if(usr.Exp>=usr.ExpNeed)
usr.Level += 1
usr.Power += rand(3,5) * usr.Level
usr.Mana_Power += rand(9,12) * usr.Level
usr.HP += rand(3,5) * usr.Level
usr.MaxHP += rand(4,7) * usr.Level
usr.ExpNeed += src.Level * 23
usr.HP = usr.MaxHP
world << "<b> [usr.name] the [usr.Class] has leveled up to [usr.Level]"
world << "<b> Stats: Power: [Power] HP: [usr.HP]/[usr.MaxHP]"
if(usr.Level== 100)
usr.Exp += 0
usr.ExpNeed = 0
usr.Level += 0
usr.Power += 0
usr.Mana_Power += 0
usr.HP += 0
usr.MaxHP += 0
usr.MP += 0
usr.MaxMP += 0
usr.ExpNeed += 0
usr.HP = usr.MaxHP
else
return

oh and if this does work at least give me credit if u use it. i did write the dang code lol. its only right. although i had help from the RPG Tutorial.
Ok lets say max level is 50
mob/proc
LevelUp(mob/Player/M)
if(usr.Class=="Knight")
if(usr.Exp>=usr.ExpNeed)
usr.Level += 1
usr.Power += rand(3,5) * usr.Level
usr.Mana_Power += rand(9,12) * usr.Level
usr.HP += rand(3,5) * usr.Level
usr.MaxHP += rand(4,7) * usr.Level
usr.ExpNeed += src.Level * 23
usr.HP = usr.MaxHP
world << "<b> [usr.name] the [usr.Class] has leveled up to [usr.Level]"
world << "<b> Stats: Power: [Power] HP: [usr.HP]/[usr.MaxHP]"
if(usr.Level>= 100)//You used == insted of >= , == means equals exactly where as >= meas above or equals. This way if their level is 101 they still cant level up any further
usr.Exp += 0
usr.ExpNeed = 0
usr.Level += 0
usr.Power += 0
usr.Mana_Power += 0
usr.HP += 0
usr.MaxHP += 0
usr.MP += 0
usr.MaxMP += 0
usr.ExpNeed += 0
usr.HP = usr.MaxHP
else
return
In response to Lt. Pain
see i did that but while i was testing it would still lvl after 100
In response to Tijinn
ill try again.
Tijinn wrote:
Would this work if i made the gain after lvl 100 = 0?
mob/proc
LevelUp(mob/Player/M)
if(usr.Class=="Knight")
if(usr.Exp>=usr.ExpNeed)
if(usr.Level>= 100)
usr<<"You have reach your highest lv or w/e"
return
else
usr.Level += 1
usr.Power += rand(3,5) * usr.Level
usr.Mana_Power += rand(9,12) * usr.Level
usr.HP += rand(3,5) * usr.Level
usr.MaxHP += rand(4,7) * usr.Level
usr.ExpNeed += src.Level * 23
usr.HP = usr.MaxHP
world << "<b> [usr.name] the [usr.Class] has leveled up to [usr.Level]"
world << "<b> Stats: Power: [Power] HP: [usr.HP]/[usr.MaxHP]"
In response to Nidaime Hokage
lol how would that work. it would only say you reached the highest lvl after 100 and u would keep leveling. but ill test it out.
In response to Lt. Pain
Lt. Pain wrote:
Ok lets say max level is 50
mob/proc
LevelUp(mob/Player/M)
if(usr.Class=="Knight")
if(usr.Exp>=usr.ExpNeed && usr.ExpNeed!=0)
usr.Level += 1
usr.Power += rand(3,5) * usr.Level
usr.Mana_Power += rand(9,12) * usr.Level
usr.HP += rand(3,5) * usr.Level
usr.MaxHP += rand(4,7) * usr.Level
usr.ExpNeed += src.Level * 23
usr.HP = usr.MaxHP
world << "<b> [usr.name] the [usr.Class] has leveled up to [usr.Level]"
world << "<b> Stats: Power: [Power] HP: [usr.HP]/[usr.MaxHP]"
if(usr.Level>= 100)//You used == insted of >= , == means equals exactly where as >= meas above or equals. This way if their level is 101 they still cant level up any further
usr.Exp += 0
usr.ExpNeed = 0
usr.Level += 0
usr.Power += 0
usr.Mana_Power += 0
usr.HP += 0
usr.MaxHP += 0
usr.MP += 0
usr.MaxMP += 0
usr.ExpNeed += 0
usr.HP = usr.MaxHP
else
return

I made a SMALL change in your code. By setting exp and expneed both to 0 you have made a great test for being at max level but if exp == expneed you would continue to level. Just added a test for the 0.
In response to Tijinn
var
maxlevel = 100
mob
proc
level_up()
if(Exp>=ExpNeed)
ExpNeed += (Level * 23)
Exp = 0
if((level+1) <= maxlevel)
switch(Class)
if("Knight")
// class based stat ups here
else
src << "you are at your max level, your level will keep going up as a mark to your skill but you will not get any stronger."
level++
return