|
|
|
|
|
%kill()
Aliases | %kill( ) |
---|
Parameters | entity @source, mobile @target, string @deathType = other, boolean @preemptable = 1 |
---|
|
Immediately kills the @target and performs usual death related activity such as corpse creation, death scream, and experience penalty. The @source may be null or a pointer to the thing responsible for the death. If the @preemptable parameter evaluates to true (default behaviour) then scripts in the room will have a chance to preempt the death of the @target and possibly save it from death. If death fails then 0 is returned. If the death is successful then a pointer to the corpse is returned or, if no corpse (summoned creatures), then 1 is returned. The @deathType value should be set to the type of death. The following are currently supported death types:
airLack - this occurs when the mobile drowns
damage - this generally occurs in combat
deathtrap - sucker hit a deathtrap
fall - this occurs when fly wear off
gladiator - gladiator mode death
noPenalty - no panalty death (noobs usually)
pkill - killed by another player
rebirth - player has enabled rebirth
slay - npcslay or one of the other slay commands
sunlight - this occurs when vampires get roasted in the sun
waterLack - this occurs when a waterOnly mobile is out of water
You are not confined to this list. You can create any value you want. The value is used by preempt death triggers to determine if the trigger should preempt a given death.
Example:
%nact( "You chop $N's head off with one fell swing of your sword.", \ 0, @self, null, @victim, actorOnly )
%nact( "$n chops $N's head off with one fell swing of $s sword.", \ 0, @self, null, @victim, skipPair )
%nact( "$n chops your head off with one fell swing of $s sword.", \ 0, @self, null, @victim, victimOnly )
if( !(@corpse = %kill( @self, @victim, "damage" )) ) { tell @victim Saved this time, but I'll get you yet! } else if( %isItem( @corpse ) ) { get all @corpse } endif |
|
|
|
|
|
|
|