ID:262776
 
Code:
mob
proc
Level()
if(usr.EXP >= usr.maxEXP)
usr.EXP = 0
usr.maxEXP += usr.maxEXP * 1.2
usr.Level += 1
if(usr.Level >= usr.maxLevel)
usr.Level += 0
usr.HP += rand(20,75)
usr.MP += rand(10,35)
usr.Attack += rand(1,5)
usr.Defense += rand(1,5)
usr.Magic_Attack += rand(1,5)
usr.Resistance += rand(1,5)
usr.Fire_Skill += rand(1,5)
usr.Ice_Skill += rand(1,5)
usr.Wind_Skill += rand(1,5)
usr.Thunder_Skill += rand(1,5)
usr.Earth_Skill += rand(1,5)
usr.Light_Skill += rand(1,5)
usr.Darkness_Skill += rand(1,5)
usr << "You gained a level!"
usr << "Your HP is now [usr.HP]!"
usr << "Your MP is now [usr.MP]!"
usr << "Your Attack is now [usr.Attack]!"
usr << "Your Defense is now [usr.Defense]!"
usr << "Your Magic Attack is now [usr.Magic_Attack]!"
usr << "Your Resistance is now [usr.Resistance]!"
usr << "Your Fire Skill is now [usr.Fire_Skill]!"
usr << "Your Ice Skill is now [usr.Ice_Skill]!"
usr << "Your Wind Skill is now [usr.Wind_Skill]!"
usr << "Your Thunder Skill is now [usr.Thunder_Skill]!"
usr << "Your Earth Skill is now [usr.Earth_Skill]!"
usr << "Your Light Skill is now [usr.Light_Skill]!"
usr << "Your Darkness Skill is now [usr.Darkness_Skill]!"
if(usr.Level >= usr.maxLevel)
usr.Level += 0

mob
bug
Fire_Dragon_Weakling
icon= 'Monsters.dmi'
icon_state = "Fire Dragon Weakling"
New()
..()

walk_rand(rand(1,30))
Del()
usr.EXP += 65
if(usr.Level >= 20)
usr.EXP +=0


Problem description:
the experience just keeps increasing even when the maxEXP is reached(which is 200 at this point) also the level doesn't increase and the EXP doesn't reset once the maxEXP is reached. Why?

No put usr in proc. Ungh.

Lummox JR
Just a suggestion, but for the section:
                usr << "You gained a level!"
usr << "Your HP is now [usr.HP]!"
usr << "Your MP is now [usr.MP]!"
usr << "Your Attack is now [usr.Attack]!"
usr << "Your Defense is now [usr.Defense]!"
usr << "Your Magic Attack is now [usr.Magic_Attack]!"
usr << "Your Resistance is now [usr.Resistance]!"
usr << "Your Fire Skill is now [usr.Fire_Skill]!"
usr << "Your Ice Skill is now [usr.Ice_Skill]!"
usr << "Your Wind Skill is now [usr.Wind_Skill]!"
usr << "Your Thunder Skill is now [usr.Thunder_Skill]!"
usr << "Your Earth Skill is now [usr.Earth_Skill]!"
usr << "Your Light Skill is now [usr.Light_Skill]!"
usr << "Your Darkness Skill is now [usr.Darkness_Skill]!"

It may be better to use a browser window. All of that showing up in the regular text area would be slighly overwhelming, especially if it's multiplayer and people are talking.
In response to Lummox JR
still wont work even with usr changed to src
In response to Pyro_dragons
That's because src isn't always what it needs to be changed to.
In response to Popisfizzy
still need help plz
In response to Pyro_dragons
It would be useful to see the updated code. :P
In response to Popisfizzy
just take the old code and make the usr src

mob
proc
Level()
if(src.EXP >= src.maxEXP)
src.EXP = 0
src.maxEXP += src.maxEXP * 1.2
src.Level += 1
src.HP += rand(20,75)
src.MP += rand(10,35)
src.Attack += rand(1,5)
src.Defense += rand(1,5)
src.Magic_Attack += rand(1,5)
src.Resistance += rand(1,5)
src.Fire_Skill += rand(1,5)
src.Ice_Skill += rand(1,5)
src.Wind_Skill += rand(1,5)
src.Thunder_Skill += rand(1,5)
src.Earth_Skill += rand(1,5)
src.Light_Skill += rand(1,5)
src.Darkness_Skill += rand(1,5)
usr << "You gained a level!"
usr << "Your HP is now [src.HP]!"
usr << "Your MP is now [src.MP]!"
usr << "Your Attack is now [src.Attack]!"
usr << "Your Defense is now [src.Defense]!"
usr << "Your Magic Attack is now [src.Magic_Attack]!"
usr << "Your Resistance is now [src.Resistance]!"
usr << "Your Fire Skill is now [src.Fire_Skill]!"
usr << "Your Ice Skill is now [src.Ice_Skill]!"
usr << "Your Wind Skill is now [src.Wind_Skill]!"
usr << "Your Thunder Skill is now [src.Thunder_Skill]!"
usr << "Your Earth Skill is now [src.Earth_Skill]!"
usr << "Your Light Skill is now [src.Light_Skill]!"
usr << "Your Darkness Skill is now [src.Darkness_Skill]!"
if(src.Level >= src.maxLevel)
src.Level += 0
In response to Pyro_dragons
mob
proc
Level(mob/M)
if(M.EXP >= M.maxEXP)
M.EXP = 0
M.maxEXP += M.maxEXP * 1.2
M.Level += 1
M.HP += rand(20,75)
M.MP += rand(10,35)
M.Attack += rand(1,5)
M.Defense += rand(1,5)
M.Magic_Attack += rand(1,5)
M.Resistance += rand(1,5)
M.Fire_Skill += rand(1,5)
M.Ice_Skill += rand(1,5)
M.Wind_Skill += rand(1,5)
M.Thunder_Skill += rand(1,5)
M.Earth_Skill += rand(1,5)
M.Light_Skill += rand(1,5)
M.Darkness_Skill += rand(1,5)
M << "You gained a level!"
M << browse("Your HP is now [src.HP]!<br>Your MP is now [src.MP]!<br>Your Attack is now [src.Attack]!<br>Your Defense is now [src.Defense]!<br>Your Magic Attack is now [src.Magic_Attack]!<br>Your Resistance is now [src.Resistance]!<br>Your Fire Skill is now [src.Fire_Skill]!<br>Your Ice Skill is now [src.Ice_Skill]!<br>Your Wind Skill is now [src.Wind_Skill]!<br>Your Thunder Skill is now [src.Thunder_Skill]!<br>Your Earth Skill is now [src.Earth_Skill]!<br>Your Light Skill is now [src.Light_Skill]!<br>Your Darkness Skill is now [src.Darkness_Skill]!","window=Skills")
//That part is to make it easier to read
if(M.Level >= M.maxLevel)
M.Level += 0

I believe that should work. The browse will make a browser window show up, which should be a lot easier to read.
I think the problem lies in the Del() proc. As Lummox said, "No put usr in proc. Ungh."
mob
bug
Fire_Dragon_Weakling
icon= 'Monsters.dmi'
icon_state = "Fire Dragon Weakling"
New()
..()

walk_rand(rand(1,30))
Del(mob/M)
M.EXP += 65
if(M.Level >= 20)
M.EXP +=0


Then when del()ing the mob in DeathCheck() or Attack() or whatever, pass the player as an argument. But don't use usr!!!
In response to Popisfizzy
Augh. That's totally wrong. He was right to change usr to src. Adding an argument to the proc is useless. Notice how many times you have to use M.something here? That's because the mob leveling up should also be src. It is. So you just basically complicated the crap out of this without providing a solution.

Lummox JR
In response to Lummox JR
ok, then what should it look like then?
In response to Pyro_dragons
also your not calling usr.Level() when you kill it ^_^ so it never runs.
In response to Zmadpeter
it still no work.

mob
proc
Level(mob/src)
if(src.EXP >= src.maxEXP)
src.EXP = 0
src.maxEXP += src.maxEXP * 1.2
src.Level += 1
src.HP += rand(20,75)
src.MP += rand(10,35)
src.Attack += rand(1,5)
src.Defense += rand(1,5)
src.Magic_Attack += rand(1,5)
src.Resistance += rand(1,5)
src.Fire_Skill += rand(1,5)
src.Ice_Skill += rand(1,5)
src.Wind_Skill += rand(1,5)
src.Thunder_Skill += rand(1,5)
src.Earth_Skill += rand(1,5)
src.Light_Skill += rand(1,5)
src.Darkness_Skill += rand(1,5)
usr << "You gained a level!"
usr << "Your HP is now [src.HP]!"
usr << "Your MP is now [src.MP]!"
usr << "Your Attack is now [src.Attack]!"
usr << "Your Defense is now [src.Defense]!"
usr << "Your Magic Attack is now [src.Magic_Attack]!"
usr << "Your Resistance is now [src.Resistance]!"
usr << "Your Fire Skill is now [src.Fire_Skill]!"
usr << "Your Ice Skill is now [src.Ice_Skill]!"
usr << "Your Wind Skill is now [src.Wind_Skill]!"
usr << "Your Thunder Skill is now [src.Thunder_Skill]!"
usr << "Your Earth Skill is now [src.Earth_Skill]!"
usr << "Your Light Skill is now [src.Light_Skill]!"
usr << "Your Darkness Skill is now [src.Darkness_Skill]!"
if(src.Level >= src.maxLevel)
src.Level += 0

mob
bug
Fire_Dragon_Weakling
icon= 'Monsters.dmi'
icon_state = "Fire Dragon Weakling"
HP = 100
Defense = 5
Attack = 15
Del(mob/bug)
Level()
if(src.Level >= 20)
usr.EXP +=0
else
src.EXP += 65


it still wont increse the level and reset the EXP and increase the maxEXP and everything else its supposed to do. help plz