In response to The ComEdiAn
Best response
The ComEdiAn wrote:
>
> mob
> proc
> deathcheck(mob.killer)
> if(src.hp <= 0)
> view() << "[src] dies!"
> src.hp = 10
> src.Move(locate(1,1,1))
> else
> killer<<"You Killed a [src]! Gained [src.Xp] EXP
> killer.exp += 10
> killer.levelup()
> del src
>
>


Uhm, with this the player receives exp (and the NPC is deleted) if the damage is NOT enough to kill... O_o
The "else" shouldn't be there.
BTW, why mob.killer? Shouldn't it be mob/killer instead?

This made me take notice of something in the original code anyway: what is the sense of giving 10HP back to the NPC and move it to 1,1,1 if it has to be deleted after two lines?
In response to Kccmt
mob
proc
deathcheck(mob/killer)
if(src.hp <= 0)
view() << "[src] dies!"
killer.exp += 10
del(src)
killer.levelup()


so something like this would work
In response to The ComEdiAn
wow thank you guys, I just realized how prolonged that code was, thank you very much. And i will look at some more tutorials so im not such a nuisance ^^
In response to Filthynate
Filthynate wrote:
wow thank you guys, I just realized how prolonged that code was, thank you very much. And i will look at some more tutorials so im not such a nuisance ^^

hmm still not working, now the mob wont even die... maybe ebecause the variable killer hasnt been assigned? Ill try that.

mob
proc
deathcheck()
if(src.hp <= 0)
view() << "[src] dies!"
usr.exp += 10
usr.levelup()
del(src)

this was the one that did it, and with a few edits to the actual levelup() script, it now works perfectly. once an enemy dies the usr gets 10 exp, once it hits 100 the needed exp doubles and you str doubles. thanks!
Page: 1 2