From the NannyMUD documentation

LAST CHANGE

2000-12-30

NAME

        kill_hook - Kill hooks

LOCATION

    The hook code resides in /obj/hook.c. It is inherited into
    /obj/living_function, and supported from there.

AVAILABILITY

    Any object can use hooks.

FUNCTIONS

OTHER FUNCTIONS

    kill_hook
    block_kill_hook

DESCRIPTION

    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.

NOTE

    It is the object doing the damage which the hook is called in!

NOTE

    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.

NOTE

    Anyone might have done anything to the corpse, so make sure
    to check everything and everything.

SEE ALSO

        attack_hook in hooks/attack_hook

SEE ALSO

        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

SEE ALSO

        hit_player_hook in hooks/hit_player_hook

FUNCTION


NAME

        kill_hook - Kill hook

SYNTAX

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 hook

SYNTAX

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 die

NOTE

    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.