MONSTER_DIED(L)
NAME
monster_died - called when a monster dies
SYNOPSIS
int monster_died(object monster);
LOCATION
Can be placed anywhere as long as monster is configured to
call that place for it.
RETURN VALUE
A true value may mean two things:
If real_dead_ob is set and monster_died is called in it, it means
the object does not actually die. No experience is rewarded.
If dead_ob is set and monster_died is called in it, then the
attacker gains experience from defeating the monster, but the
monster is not destructed (though a corpse is created).
A zero value does nothing.
DESCRIPTION
If either dead_ob or real_dead_ob (or both) are set, then this
function is called. For real_dead_ob (a Padrone hack that is
specific to Nanny), it is called when a monster is 'about' to die:
that is, when it has received enough damage to put it below 0
hit points but has not performed the calculations yet and has
not died. As stated above, a true value prevents it from dying.
The other case, when dead_ob is set, the monster has technically
died. Experience has been rewarded, everything calculated and
finished except for the destruction of the monster. As per above,
a true value prevents the latter.
They are called in the following context:
if( dead_ob ) dead_ob->monster_died(this_object());
if( real_dead_ob ) real_dead_ob->monster_died(this_object());
NOTES
To prevent a monster from dying, use Padrone's 'real_second_life'
hack. The original version is left in mainly for compatibility.
this_player() should return the killer of the monster if nothing
funny occurs.
EXAMPLES
In a priest monster:
reset(arg) {
...
set_real_dead_ob(this_object());
...
}
monster_died(poor_monster) {
if( command("drink potion of healing", poor_monster) )
return 1;
}
In this example, the monster will not die until it runs out of
potions of healing.
SEE ALSO
set_dead_ob(L), set_real_dead_ob(L), second_life(L),
real_second_life(L), hit_player(L)
Help topics available:
You are guest number 163 since December 2019.
This file was last modified: June 2000.