From the NannyMUD documentation
2000-12-30
kill_hook - Kill hooks
The hook code resides in /obj/hook.c. It is inherited into /obj/living_function, and supported from there.
Any object can use hooks.
kill_hook block_kill_hook
The hooks are called when the player, monster or object is about to kill something. The block_kill_hook allows you to prevent the death of the dying player/monster. You do so by returning 1 from the function.
It is the object doing the damage which the hook is called in!
The hook is called in ONE of: + this_player(), + query_attack(), + query_alt_attack(), + previous_object(). This means if this_player() is not defined it calls query_attack(), and if that wasn't defined either it goes to query_alt_attack() and so on. But ONLY one call will be done.
Anyone might have done anything to the corpse, so make sure to check everything and everything.
attack_hook in hooks/attack_hook
die_hook in hooks/die_hook die_hook in std/line/line_control die_hook in std/misc/kill_logger die_hook in std/misc/logger
hit_player_hook in hooks/hit_player_hook
NAME
kill_hook - Kill hookSYNTAX
void kill_hook(mixed arr, object killer)DESCRIPTION
The kill hook is called when the player, monster or object is about to kill something. The arguments to the hook are as follows: ({ The monster dying., The object doing the damage., The corpse. }), The object doing the killing.NOTE
Note that 'the monster dying' can be zero.NOTE
Note that 'the object doing the damage' can be zero.NOTE
Note that 'the corpse' can be zero. It should be in the environment and contain all objects from the dying monster, but it might be elsewhere and might not contain all objects.
FUNCTION
NAME
block_kill_hook - Block kill hookSYNTAX
int block_kill_hook(mixed arr, object killer)DESCRIPTION
The block_kill_hook is called when the player, monster or object is about to kill something. The hook allows you to prevent the death of the dying player/monster. You do so by returning 1 from the function. The arguments to the hook are as follows: ({ The damage being done., The monster dying., The object doing the damage., The ignore_flag. }), The object doing the killing.RETURN VALUES
int, if 1 then the player/monster will not dieNOTE
Note that 'the monster dying' can be zero.NOTE
Note that 'the object doing the damage' can be zero.NOTE
If the ignore-flag is used, you need an EXTREMELY good reason to prevent the death.