ID:146150
 
Code:
mob
proc
deathcheck()
if(src.hp <= 0)
view() << "[src] has been killed by [usr]!"
usr.exp += src.expgive
usr.Gold += src.goldgive
if(src.client)
if(src.goldgive == 0)
usr.goldgive += 30
world << "[usr] now has a bounty of [usr.goldgive] on his head!"
else
usr.Gold += src.goldgive
world << "[usr] has collected the bounty from [src]'s head! ([src.goldgive] gold)"
src.goldgive = 0
src.hp = src.MaxHp
src.Move(locate(73,172,1))
else
del(src)


Problem description: The problem is, that monsters get bountys on their heads too, and when a monster kills someone. they get their bounties removed! Even though i made an If(src.client) there >_<;

Biggest problem with this proc?

mob
proc
deathcheck()
if(src.hp <= 0)
//view() << "[src] has been killed by [usr]!"
// usr.exp += src.expgive
// usr.Gold += src.goldgive
if(src.client)
if(src.goldgive == 0)
// usr.goldgive += 30
// world << "[usr] now has a bounty of [usr.goldgive] on his head!"
else
// usr.Gold += src.goldgive
// world << "[usr] has collected the bounty from [src]'s head! ([src.goldgive] gold)"
src.goldgive = 0
src.hp = src.MaxHp
src.Move(locate(73,172,1))
else
del(src)


You have usr slain all through the code. Read up on Lummox JR's Dream Tutor usr Unfriendly Guide. I don't mean scan through a couple of paragraphs.. read through the whole thing. And read it thoroughly. =)

Therefor, you'd want to start your proc like so:

mob
proc
deathcheck(attacker)
if(src.hp <= 0)
if(ismob(attacker))
var/mob/M = attacker
M.exp += src.expgive
// etc. etc.
In response to Sinyc
I can't get it to work like that, my monsters just don't die now.
I have to edit my attack, too, right? ><;
In response to Takaru
Now the fighting is completely screwed and wont work. >_<

mob
verb/Attack(mob/M in oview(1))
set category = "Actions"
var/quickness = src.spd - M.dex
if(M.client)
if(quickness <= 0)
src << "[M] Dodges your attack easily"
M << "[src] Tried to attack you, but you dodged!"
else
var/damage = src.str - M.def
M.hp -= damage
src <<"You attack [M] for [damage]!"
M <<"You got attacked by [src], for [damage] damage!"
M.deathcheck()
src.Levelup()
else
if(quickness <= 0)
src << "[M] Dodges your attack easily"
M << "[src] Tried to attack you, but you dodged!"
else
var/damage = src.str - M.def
M.hp -= damage
src <<"You attack [M] for [damage]!"
M <<"You got attacked by [src], for [damage] damage!"
M.deathcheck()
src.Levelup()
proc
Fight(mob/M)
var/quickness = src.spd - M.dex
if(quickness <= 0)
src << "[M] Dodges your attack easily"
M << "[src] Tried to attack you, but you dodged!"
else
var/damage = src.str - M.def
if(damage <= 0)
src << "You are too weak to hurt this opponent!"
M << "[src] is too weak to hurt you!."
else
M.hp -= damage
src << "You attack [M] for [damage] HP!"
M << "[src] attacks you for [damage] HP!"
M.deathcheck(src)
mob
proc
mgoldexp(mob/M)
M.exp += src.expgive
M.Gold += src.goldgive
mob
proc
bounty(mob/M)
if(src.goldgive == 0)
M.goldgive += 30
world << "[M] now has a bounty of [M.goldgive] on his head!"
else
M.Gold += src.goldgive
world << "[M] has collected the bounty from [src]'s head! ([src.goldgive] gold)"
src.goldgive = 0
mob
proc
deathcheck(attacker)
if(src.hp <= 0)
if(ismob(attacker))
var/mob/M = attacker
view() << "[src] has been killed by [M]!"
M.exp += src.expgive
M.Gold += src.goldgive
if(src.client)
bounty()
src.Move(locate(73,172,1))
src.hp = src.MaxHp
else
del(src)
// etc. etc.

I can't figure out what the problem is