Attack(mob/M as mob in oview(1))
var/damage = usr.str - M.def
usr<<"You attack [M] for [damage] damage!"
oview()<<"[usr] attacks [M] for [damage] damage!"
M.HP -= damage
M.Death()
mob/proc
Death()
if(src.type == /mob/player)
PlayerDie()
else
if(src.HP <= 0)
range() << "[src] has been killed by [usr]!"
src.overlays -= 'characters.dmi'
usr.Exp += 5
del(src)
PlayerDie()
if (src.HP <= 0)
view() << "[src] has been killed"
src.loc = locate(7,5,1)
src.HP = src.MAXHP
src.MP = src.MAXHP
mob
proc
Check(mob/player)
if(src.Exp>=usr.NExp)
src.LevelUp()
mob/proc
LevelUp(mob/player)
if(src.class=="Skeleton")
if(src.Exp>=src.NExp)
src.Level += 1
src.MAXHP += rand(2,5) * src.Level
src.MAXMP += rand (4,10) * src.Level
src.str += rand (2,4) * src.Level
src.def += rand (2,7) * src.Level
src.NExp += src.Level * 35
src.HP = src.MAXHP
if(src.class=="Pigmonster")
if(src.Exp>=src.NExp)
src.Level +=1
src.MAXHP += rand(5,10) * src.Level
src.MAXMP += 0
src.str += rand (5,10) * src.Level
src.def += rand (3,8) * src.Level
src.NExp += src.Level * 45
src.HP = src.MAXHP
if(src.class=="Slime")
if(src.Exp>=src.NExp)
src.Level +=1
src.MAXHP += rand(3,7) * src.Level
src.MAXMP += rand(3,7) * src.Level
src.str += rand (3,7) * src.Level
src.def += rand (3,7) *src.Level
src.NExp += src.Level * 15
src.HP = src.MAXHP
Problem description: The attaking is working fine, and so is the the death for monster, even the experiance going to the player is fine! But the Exp just goes over the needed and the player does not level up! Please help.