Vote for Our Mud on TMC!











help > hooks > pre death
---

Hook Name :         pre_death
Called From :       /obj/living/death.c
Resolution Method : HOOK_OR

Sample Header :

int my_pre_death(string tag, object ob, int dam, int type,
                 object killer)

Arguments :

tag - "pre_death"
ob - The living object that's about to die
dam - The amount of damage being done
type - The damage type (FIRE, VORPAL, etc)
killer - The guy who will get credit for the kill

Return Value : 1 to prevent death, 0 to allow it.

Description :

When a living critter is about to die, this hook is called in that
critter.

If any pre_death hooks return 1, then the death is cancelled.

Note that if the death is cancelled, no automatic message will be
displayed, and no damage will be assigned to the not-actually-dying
victim. If you want any of these, you should take care of them
yourself in the hook-handling function.

See also:

post_death
---

Last modified : 28-April-2002, Alexi