ID:173161
 
ok how do i set it up for a mob? heres some code that i thought worked but doesnt

    bug             //new prototype
icon = 'bug.dmi' //override the parent's icon, which was 'person.dmi'
HP = 60 //define a new variable called HP, with a value of 20
MP = 5 //define a new variable called MP, with a value of 5
AGI = 1 //define a new variable called AGI, with a value of 1
ATK = 5 //define a new variable called ATK, with a value of 5
EXP = 100 //define a new variable called EXP, with a value of 100
exp_max = 100 //define a new variable called exp_max, with a valure of 100
CHA = 1 //define a new variable called CHA, with a value of 1
DEF = 5 //define a new variable called DEF, with a value of 5
LEA = 1 //define a new variable called LEA, with a value of 1
LUK = 1 //define a new variable called LUK, with a value of 1
INT = 1 //define a new variable called INT, with a value of 1
STR = 5 //define a new variable called STR, with a value of 5
WIS = 1 //define a new variable called WIS, with a value of 1


And then the attack code

    verb
attack(mob/M as mob in oview(1))
if (M.HP <= 0) //if M's HP are at or below 0...
usr << "[M] is already dead!"
del(src)
if (M.HP <- 0)
usr << "[M] is already dead!"
del(src)
else //otherwise...
usr << "You attack [M]!"
oview() << "[usr] attacks [M]!"
var/damage = rand(150,1500)
world << "[damage] damage dealt out!"
M.HP -= damage
usr.EXP += M.EXP
usr.exp_max += 100
M.DeathCheck()
del(M)
DeathCheck()
if (HP <= 0)
world << "[src] dies!"
world << "[usr] gains [EXP]!"
del(M)
del(src) //delete whatever just died


And now the levelup code

mob/proc/Check_Level()
if(src.EXP >= src.exp_max)
src.Level_Up()
return
mob/proc/Level_Up()
src.level += 1 // I added in the level and HP for ex
src.HP += rand(20,100)
src.MP += rand(10, 50)
src.AGI += rand(1, 10)
src.ATK += rand(1, 10)
src.CHA += rand(1, 10)
src.DEF += rand(1, 10)
src.LEA += rand(1, 10)
src.LUK += rand(1, 10)
src.INT += rand(1, 10)
src.STR += rand(1, 10)
src.WIS += rand(1, 10)


This all work out good yeah? just need mob fix to get XP
been tweakin it myself and still cant get it to work.... anyone want to help out there??
I think a lot of people have said this in the past, but you need to explain the problem in a little better detail. Giving a code sample is good, but you still need the explanation of the problem.

As far as the mobs go, I'm not sure. But, if you haven't declared it as a mob then it wont be a mob. Like with your procs.

mob/proc/Check_Level()
...


Try adding the 'mob/' to your 'bug', otherwise it wont be considered a mob by the code, hence it wont work.

mob/bug
...


Anyway, I'm not sure whether this is what you're looking for, but I'm somewhat new to the forums. Although I have spent a rather large amount of time 'messing' with DM. I haven't much experience with helping other people, either, so I hope I helped some.