This trigger will fire when a mobile attempts to enter a room. There are two modes that are important to distinguish between. The first mode is "status only" mode, this means the script should only return true or false, and not perform any other actions. The other mode is the actual attempt to enter the destination. The "status only" mode is usually invoked internally by the mud engine to see if the move is viable before attempting it. In the other mode if your script prevents entry by returning false, then it should also echo some kind of message to the creature attempting to enter the target room. Your script should handle both modes. The following variables are of interest for this trigger:
@n - The mobile that wants to enter the room.
@o - The same as @i if the trigger owner is an object.
@direction - One of north, south, east, west, up, or down.
@fromRoom - The room from which the mobile wants to leave.
@toRoom - The room to which the mobile wants to go.
@statusOnly - 1 for "status only" mode, 0 for normal mode.
Your script must return a 1 or a 0 (or equivalent). Any value that does not evaluate to true, will prevent the mobile from entering the destination room. |