----Mob Triggers---- ----Obj Triggers---- ----Room Triggers----
Random Global Global
Command Random Random
Speech Command Command
Act Sit Speech
Death Leave Enter
Greet Greet Drop
Greet-All Get Leave
Entry Drop Door
Receive Give Reset
Fight Wear Call
Hit Percent Door  
Leave Speech  
Leave All Consume  
Door Load  
Load Timer  
Call Remove  
Kill Start  
  Quit  
  Attack  
  Attacked  
  Install  
  Call  
  Enter  
  DestroyRepair  

Mob Scripts
Covers all scripts that are attached to mobs.
Random Has a chance to run every second.
Argument N/A
Num Arg (0..100) Percent chance of executing every second .
Return Value N/A
Variables N/A
Notes:
Random scripts do not run if players are not present in the zone, unless the Global trigger flag is set. Charmed mobs do not run Random triggers.
Command This trigger is checked whenever a character types a command, before attempting to execute the command as a normal MUD command, when in the same room of the mob with this script.
Argument May be either * or a series of commands, command pairs (see below).
Num Arg 0 - Anyone present may trigger the script.
1 - Only the character the script is attached to may trigger it.
Return Value 0 - The command will be passed through to the command interpreter.
1 - (Default) The command will not be processed any further.
-1 - The command will not be processed any further, and hide will not be broken.
Variables actor - The character typing the command.
cmd - The command typed. If the match was a command pair, it is the whole version of the command.
arg - The argument typed after the command.
Notes:
If the argument is * then all commands will be matched (does not work on staff).
Command pairs are a single command, enclosed in double quotes, comprised of the most abbreviated form, and then the complete form, of the command. For example:
"n north" "w west" "ent enter"
Speech This trigger is checked whenever someone says something around a mob with this trigger.
Argument * to react to all speech, or a list of phrases or words to be matched (see Num Arg).
Num Arg 0 - Argument is an exact phrase to match.
1 - Argument is a list of words, or list of phrases in double-quotes, to match.
Return Value N/A
Variables actor - The character typing the command.
speech - The complete text spoken by the actor.
Notes:
Charmed or sleeping mobs do not run speech triggers. Mobs do not react to their own speech.
Act This trigger is runs when Argument is a substring of a string of text that a mob sees. Most, but not all, text is seen by mobs.
Argument * to react to all events, or a list of phrases or words to be matched (see Num Arg).
Num Arg 0 - Argument is an exact phrase to match.
1 - Argument is a list of words, or list of phrases in double-quotes, to match.
Return Value N/A
Variables actor - The primary character of the text. Not always present.
victim - The secondary character of the text. Not always present.
object - The primary object of the text. Not always present.
target - The secondary object of the text. Not always present.
arg - A special variable fragment of the text.
Notes:
Charmed mobs do not run Act triggers.
If you have a specific question whether text is visible, feel free to ask an admin.
Death This trigger is checked when a mobile dies.
Argument N/A
Num Arg N/A
Return Value 0 - Suppress the death cry (only on mobiles).
1 - (Default) The death cry occurs as normal.
Variables actor - The character who killed this mob, if there is one.
Notes:
Death triggers execute during death, after kill triggers, but before the corpse is created. Death scripts cannot wait or delay .
Greet This trigger is checked whenever a character (PC OR NPC) that the mob can see enters the room.
Argument N/A
Num Arg Percent chance of the script executing.
Return Value N/A
Variables actor - The character entering the room.
direction - The direction the character entered from.
Notes:
Greet triggers execute before the character enters the room.
Greet-All This trigger is checked whenever a character (PC OR NPC) enters the room, even if the mobile cannot see the actor.
Argument N/A
Num Arg Percent chance of the script executing.
Return Value N/A
Variables actor - The character entering the room.
direction - The direction the character entered from.
Notes:
Greet-All triggers execute before the character enters the room.
Entry This trigger is executed every time the character it's attached to enters a room.
Argument N/A
Num Arg Percent chance of the script executing.
Return Value N/A
Variables N/A
Notes:
N/A
Receive This trigger is executed every time the mob receives an obj.
Argument N/A
Num Arg Percent chance of the script executing.
Return Value 0 - The object will not be transfered to the mob.
1 - (Default) The object will be transfered.
Variables actor - The character giving the object.
object - The object being given.
Notes:
N/A
Fight This trigger is executed after each round of battle.
Argument N/A
Num Arg Percent chance of the script executing.
Return Value N/A
Variables actor - The character the mob is fighting.
Notes:
N/A
HitPrcnt This trigger is executed after each round of combat where the mob's hitpoint percentage is below the NARG.
Argument N/A
Num Arg The percentage of hitpoints the mob must be below for the script to execute.
Return Value N/A
Variables actor - The character the mob is fighting.
Notes:
N/A
Leave This trigger is checked whenever a character (PC OR NPC) that the mob can see leaves the room.
Argument N/A
Num Arg The percent chance of the script executing.
Return Value N/A
Variables actor - The character leaving the room.
direction - The direction the character leaves to.
Notes:
N/A
Leave-All This trigger is checked whenever a character (PC OR NPC) that the mob can see leaves the room, whether the mob can see the character or not..
Argument N/A
Num Arg The percent chance of the script executing.
Return Value 0 - The person
Variables actor - The character leaving the room.
direction - The direction the character leaves to.
Notes:
N/A
Door This trigger is checked whenever a character the mob can see "uses" a door in the room.
Argument N/A
Num Arg The percent chance of the script executing.
Return Value 0 - The action is not performed on the door.
Variables actor - The character using the command.
direction - The direction of the door being used.
cmd - The command being used on the door (open, close, lock, etc).
Notes:
N/A
Load This trigger is checked whenever the mob/object is loaded into the game.
Argument N/A
Num Arg The percent chance of the script executing.
Return Value N/A
Variables N/A
Notes:
N/A
Call This trigger is executed whenever another script uses the call command.
Argument Name of the function (what the other script "calls").
Num Arg The percent chance of the script executing.
Return Value N/A
Variables result - Stored in the script that 'calls' this function.
caller - The entity which called the script.
arg - Arguments passed in the call command (words after the "argument").
Notes:
N/A
Kill This trigger is executed when the character it is attached to kills another character.
Argument N/A
Num Arg N/A
Return Value N/A
Variables victim - The character the mob is fighting.
caller - The entity which called the script.
arg - Arguments passed in the call command (words after the "argument").
Notes:
N/A

Object Scripts
Covers all scripts that are attached to objects.
Global This is not a trigger by itself, but is to be used with the random trigger. A trigger which is global is checked even if there are no PCs in the same zone as the object.
Argument N/A
Num Arg N/A
Return Value N/A
Variables N/A
Notes:
N/A
Random Has a chance to run every second.
Argument N/A
Num Arg (0..100) Percent chance of executing every second .
Return Value N/A
Variables N/A
Notes:
Random scripts do not run if players are not present in the zone, unless the Global trigger flag is set. Charmed mobs do not run Random triggers.
Command This trigger is checked whenever a character types a command, before attempting to execute the command as a normal MUD command, around the object with this trigger.
Argument Command name(s), pairs (ie: "w west") , or "*" (catch-all).
Num Arg 1 - Object must be worn.
2 - Object must be in character's inventory.
3 - Object must be either worn or in character's invenotry.
4 - Object must be in the room of the character.
7 - Object must be either worn, in the character's inventory, or in the character's room.
Return Value 0 - The command will work as normal, as if it was passed to the MUD's command interpreter.
Variables actor - The character using the command.
arg - Extra words typed after the command.
cmd - The command typed (if the command is in a pair, "cmd" will be the whole command).
Notes:
N/A
Sit This trigger is checked whenever someone sits on the object.
Argument N/A
Num Arg (0..100) Percent chance of executing.
Return Value 0 - Character will not sit on the object.
Variables actor - The character who is trying to sit.
Notes:
N/A
Leave This trigger is checked whenever someone leaves the room of the object.
Argument N/A
Num Arg (0..100) Percent chance of executing.
Return Value 0 - Character will not leave the room.
Variables actor - The character who is trying to leave the room.
direction - The direction the character is leaving in.
Notes:
N/A
Greet This trigger is checked whenever someone enters the room of the object.
Argument N/A
Num Arg (0..100) Percent chance of executing.
Return Value N/A
Variables actor - The character entering the room.
direction - The direction the character entered from.
Notes:
N/A
Get This trigger is checked whenever the object is picked up.
Argument N/A
Num Arg (0..100) Percent chance of executing.
Return Value 0 - The object is not picked up.
Variables actor - The character trying to pick up the object.
Notes:
N/A
Drop This trigger is checked whenever a character attempts to drop the object.
Argument N/A
Num Arg (0..100) Percent chance of executing.
Return Value 0 - The object is not dropped.
Variables actor - The character trying to drop the object.
Notes:
N/A
Give This trigger is checked whenever someone attempts to give away the object.
Argument N/A
Num Arg (0..100) Percent chance of executing.
Return Value 0 - The object is not given.
Variables actor - The character attempting to give the object.
victim - The character recieving the object.
Notes:
N/A
Wear This trigger is checked whenever a character attempts to wear the object.
Argument N/A
Num Arg 0 - When this object is worn.
1 - When this object is worn and the chracter attempts to wear something.
2 - When this object is in the character's inventory and something is worn.
4 - When this object is in the character's room and the character wears something.
Return Value 0 - The object is not worn.
Variables actor - The character attempting to wear the object.
object - The object being worn.
Notes:
N/A
Door This trigger is checked whenever a character "uses" a door in the room with the object.
Argument N/A
Num Arg (0..100) Percent chance of executing.
Return Value 0 - The action is not done to the door.
Variables actor - The character using the door.
direction - The direction of the door being used.
cmd - The action being done on the door (open, close, look, etc).
Notes:
N/A
Speech This trigger is executed whenever a character says something in the room of this object.
Argument The phrase or word list to be matched.
Num Arg 1 - The object must be worn to execute.
2 - The object must be in the character's inventory to execute.
4 - The object must be in the same room as the character to execute.
8 - The argument is a list of words to match (otherwise it is a phrase to match).
NOTE: - These can be added together so the object can work in multiple ways.
Return Value N/A
Variables actor - The character speaking.
speech - The text being said.
Notes:
N/A
Consume This trigger is checked whenever someone eats or drinks an object.
Argument N/A
Num Arg (0..100) Percent chance of executing.
Return Value 0 - The character cannot eat/drink the object.
Variables actor - The character consuming the object.
Notes:
N/A
Load This trigger is checked whenever the object is loaded into the game.
Argument N/A
Num Arg (0..100) Percent chance of executing.
Return Value N/A
Variables N/A
Notes:
N/A
Timer This trigger is checked whenever the object's timer reaches 0.
Argument N/A
Num Arg N/A
Return Value N/A
Variables N/A
Notes:
N/A
Remove This trigger is checked whenever a character removes an object.
Argument N/A
Num Arg 0 - When this object is removed.
1 - When this object is worn and the character attempts to remove something.
2 - When this object is in the character's inventory and something is removed.
4 - When this object is in the character's room and the character removes something.
Return Value 0 - The object will not be removed.
Variables actor - The character attempting to remove the object.
object - The object being removed.
Notes:
N/A
Start This trigger is checked for all of a player's objects whenever the player enters the game.
Argument N/A
Num Arg (0..100) Percent chance of executing.
Return Value N/A
Variables N/A
Notes:
N/A
Quit This trigger is checked for all of a player's objects whenever the player quits the game.
Argument N/A
Num Arg (0..100) Percent chance of executing.
Return Value N/A
Variables N/A
Notes:
N/A
Attack This trigger is checked whenever the character makes a successful hit against a target in combat.
Argument N/A
Num Arg 1 - The object must be in the character's equipment for it to be used.
2 - The object must be in the character's inventory.
4 - The object must be in the same room as the character.
7 - The object is in the character's equipment, inventory, OR room.
8 - Triggered even on misses.
0 - Only triggered if the obect is the weapon.
Return Value 1 - No other attack triggers are called.
Variables actor - The character attacking.
victim - The character that is hit.
weapon - The weapon that sucessfully hit, if any.
Notes:
N/A
Attacked This trigger is checked whenever the character is hit in combat.
Argument N/A
Num Arg 1 - The object must be in the character's equipment for it to be used.
2 - The object must be in the character's inventory.
4 - The object must be in the same room as the character.
8 - Even if a miss.
Return Value N/A
Variables actor - The character attacking.
victim - The character that is hit.
weapon - The weapon that sucessfully hit, if any.
Notes:
N/A
Install This trigger is checked whenever the object is being installed.
Argument N/A
Num Arg 0 - The trigger only runs if the object is an installable.
1 - The trigger only runs if the object is the installed object.
Return Value N/A
Variables actor - The character installing the object.
installed - The object loaded upon successful installation, or 0.
skillroll - The actor's skillroll based on the object's skill.
Notes:
N/A
Call This trigger is executed whenever another script uses the call command.
Argument Name of the function (whatever the script "calls").
Num Arg N/A
Return Value N/A
Variables caller - The entity that called the script.
arg - Arguments passed in the call command (words after the "argument").
Notes:
N/A
Enter This trigger is checked whenever someone enters the room containing this object.
Argument N/A
Num Arg (0..100) Percent chance of executing.
Return Value 0 - The character will not enter the room.
Variables actor - The character entering the room.
direction - The direction entered from.
Notes:
N/A
DestroyRepair This trigger is executed whenever someone attempts to destroy or repair an object.
Argument N/A
Num Arg 0 - Triggers on destroy.
1 - Triggers on repair.
Return Value 0 - The normal destroy/repair command executes.
non-0 - The normal destroy/repair command does not execute.
Variables N/A
Notes:
N/A

Room Scripts
Covers all scripts that are attached to rooms.
Global This is not a trigger by itself, but is to be used with the random trigger. A trigger which is global is checked even if there are no PCs in the same zone as the object.
Argument N/A
Num Arg N/A
Return Value N/A
Variables N/A
Notes:
N/A
Random Has a chance to run every second.
Argument (0..100) Percent chance of executing.
Num Arg N/A
Return Value N/A
Variables N/A
Notes:
N/A
Command This trigger is checked whenever a character types a command, before attempting to execute the command as a normal MUD command, around the object with this trigger.
Argument Command name(s), pairs (ie: "w west") , or "*" (catch-all).
Num Arg N/A
Return Value 0 - The command will work as normal.
Variables actor - The character using the command.
arg - Extra words typed after the command.
cmd - The command typed (if command is in a pair, cmd will be the whole command).
Notes:
N/A
Speech This trigger is checked whenever someone says something in the room.
Argument The phrase or word list to be matched.
Num Arg 0 - The argument is a phrase to match.
1 - The argument is a list of words, any of which will trigger the script.
Return Value N/A
Variables actor - The character speaking.
speech - The text spoken.
Notes:
N/A
Enter This trigger is checked whenever (just before) someone enters the room.
Argument N/A
Num Arg (0..100) Percent chance of executing.
Return Value 0 - The character will not enter the room.
Non-0 - The character will enter the room.
Variables actor - The character entering the room.
direction - The direction the character is entering from.
Notes:
N/A
Drop This trigger is checked whenever (just before) a character attempts to drop something in the room.
Argument N/A
Num Arg (0..100) Percent chance of executing.
Return Value 0 - The object will not be dropped.
Non-0 - The object will be dropped.
Variables actor - The character dropping the object.
object - The object being dropped.
Notes:
N/A
Leave This trigger is checked whenever someone leaves the room.
Argument N/A
Num Arg (0..100) Percent chance of executing.
Return Value 0 - The person will not leave the room.
Variables actor - The character leaving the room.
direction - The direction the character is going.
Notes:
N/A
Door This trigger is checked whenever someone "uses" a door in the room.
Argument N/A
Num Arg (0..100) Percent chance of executing.
Return Value 0 - The action is not done to the door.
Variables actor - The character using the door.
direction - The direction of the door being used.
cmd - The action being done to the door (open, close, lock, etc).
Notes:
N/A
Reset This trigger is checked whenever the zone is reset.
Argument N/A
Num Arg (0..100) Percent chance of executing.
Return Value N/A
Variables N/A
Notes:
N/A
Call This trigger is executed whenever another script uses the call command.
Argument Name of the function (whatever the script "calls").
Num Arg N/A
Return Value Stored in caller's result variable.
Variables caller - The entity that called the script.
arg - Arguments passed in the call command (words after the "argument").
cmd - The action being done to the door (open, close, lock, etc).
Notes:
N/A
Topic revision: r23 - 27 Aug 2010 - 19:01:09 - FearItself
 
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback