ID:261405
Feb 21 2002, 8:09 pm
|
|
Can someone please explain to me how you would set it so that if a mob kills another it gains all the gold that it held? Thank you
|
This is one way:
mob/proc/deathcheck(mob/M) |
In response to Nadrew
|
|
Just a friendly suggestion, I would recommend dividing up the amount of gold taken from PCs. I had that in my game too and when someone lost all their gold it can really make the game unenjoyable trying to get it all back. If you want a system to divide the money up and make it a whole number use the code below.
LJR takegold = M:gold/3; goldtaken = round(takegold) |
mob/verb/Attack(mob/M)
//do attack stuff
M.DeathCheck(src)
mob/proc/DeathCheck(killer)
for(var/obj/gold/O in src)
O.Move(killer)
or if it's a var...
mob/proc/DeathCheck(killer)
killer.gold += src.gold
src.gold = 0