Proc:Self Destruct

From WikiName
Jump to: navigation, search

Overview

The self_destruct procedure allows builders to create mobiles that self destruct when certain conditions occur. Any items on the mobile are placed in room 10 (RAID Junk Room) when the mobile is destroyed.


Here is a list of keys that the procedure will use:

Key Default Description
TRIGGERS <none> A colon separated list of the triggers that will cause the mobile to self destruct. Supported values are:

EMPTY_ROOM - No mortal PCs in the room
EMPTY_AREA - No mortal PCs in the area
AREA_RESET - Area reset trigger

DELAY_SECONDS 0 The amount of time that the trigger must be activated before the mobile is destroyed. The game checks the trigger state approximately every 10 seconds.
TRIGGER_STARTED_ROOM_MSG No message. The message that is displayed to players in the room when the mobile's trigger is first activated. Given the current list of supported triggers, this is only something than an immortal or familiar might see.
TRIGGER_STOPPED_ROOM_MSG No message. The message that is displayed to players in the room when the mobile's trigger is first deactivated. This would be when a player renters a room or area that was previously empty.
DESTRUCT_ROOM_MSG No message. The message that is displayed to players in the room when the mobile is destroyed. Given the current list of supported triggers, this is only something than an immortal or familiar might see.


Example

addproc <mobile> self_destruct

setproc <mobile> # TRIGGERS EMPTY_ROOM
setproc <mobile> # DELAY_SECONDS 60
setproc <mobile> # TRIGGER_STARTED_ROOM_MSG $n looks around nervously.
setproc <mobile> # TRIGGER_STOPPED_ROOM_MSG $n lets out a sigh of relief.
setproc <mobile> # DESTRUCT_ROOM_MSG $n explodes into a cloud of dust.
setproc <mobile> # PROC_ENABLED 1