act: |
An 'act' trigger allows a mob to respond to actions in the room such as socials, or room echos from many commands. In ROM mobprogs, 'act' was widely used to catch social output. The need for 'act' triggers is reduced in v3 due to being able to trap command input in room progs. However, it still has its uses. |
|
Note that some mud actions output messages to mobs in the room only, specificaly so that act progs can be triggered. If you have to capture act messages on a command that does not echo anything to the room, and roomprogs won't meet your need for whatever reason, contact Lasher to discuss adding mob-only output to the command. A good example of mob only output is when a player drops an item in a room. |
|
Syntax to add: add act [prog id] "trigger phrase" |
|
|
bribe: |
A 'bribe' trigger allows a mob to respond only when given a minimum amount of gold. |
|
Syntax to add: add bribe [prog id] [min gold] |
|
|
death: |
A 'death' trigger gives a mob a percentage chance to run a lua program upon death, before its corpse is created and it is removed from the game. Death triggers are often used to randomly load a piece of equipment or transfer a character to the next part of an area quest. |
|
Syntax to add: add death [prog id] [percent chance] |
|
|
delay: |
A 'delay' trigger has a percentage chance to run after a mob executes an adddelay(seconds) statement from another prog. Usually a delay prog looks for a previously remembered char before continuing. |
|
Syntax to add: add delay [prog id] [percent] |
|
|
entry: |
An 'entry' trigger is executed when a mob moves, not a player. Exit triggers are commonly used to keep a specific mob within a small group of rooms, or on a wandering guard to attack as it enters. |
|
Syntax to add: add entry [prog id] [percent chance] |
|
|
exall: |
An 'exall' trigger runs when a player moves in a specific direction. N,E,S,W,U,D correspond to 0 through 5 for directions. Unlike 'exit' triggers, 'exall' triggers fire even if the mob is busy, and visibility is ignored. |
|
Syntax to add: add exall [prog id] [dir] |
|
|
exit: |
An 'exit' trigger runs when a player moves in a specific direction. N,E,S,W,U,D correspond to 0 through 5 for directions. For 'exit' triggers to fire, the mob must not be occupied and must be able to see the player. |
|
Syntax to add: add exit [prog id] [dir] |
|
|
fight: |
A 'fight' trigger gives a random chance for the program to be executed while the mob is actually in combat. Often used to cast spells, summon helpers or run away. |
|
Syntax to add: add fight [prog id] [percent chance] |
|
|
give: |
A 'give' trigger caused the program to run when a mobile is given either a specific items, or if the last argument is 'all', any item. The item given to the mob is variable 'obj' in Lua and all functions that use an obj type variable can be applied to it. 'All' is commonly used with give triggers to cause the mob to return items other than those it is specifically interested in. |
|
Syntax to add: add give [prog id] [objkey, or, "all"] |
|
|
grall: |
A 'grall' trigger adds a percentage chance to run a lua program when a player enters the room. The chance to trigger takes place regardless of the mob's current condition or whether or not the mob can see the player. |
|
Syntax to add: add grall [prog id] [percent chance] |
|
|
greet: |
A 'greet' trigger adds a percentage chance to run a lua program when a player enters the room. The mob must not already be busy/sleeping and must be able to see the player for a chance to trigger the prog. See 'grall' for other options. |
|
Syntax to add: add greet [prog id] [percent chance] |
|
|
hpcnt: |
A 'hpcnt' trigger causes a program to run when the mobile is in combat and its hit points fall below the percentage given. |
|
Syntax to add: add hpcnt [prog id] [percent hp] |
|
|
kill: |
A 'kill' trigger adds a percentage chance to run a lua program when someone initiates combat with the mob. Usually used to stop combat or summon help. The academy guards have a 'kill' prog that transfers away anyone not level 201. |
|
Syntax to add: add kill [prog id] [percent chance] |
|
|
listen: |
A 'listen' trigger has a percent chance to execute when a player uses the listen command on a mob. |
|
Syntax to add: add listen [prog id] [percent] |
|
|
random: |
A 'random' trigger sets an event to run a program on a mob. For compatibility with old mobprogs, a 100% random runs, on average, every 3 seconds. 50% runs every 6 seconds etc. |
|
Note that with random progs, the prog is triggered without a player causing it, so 'ch' is not defined. Random triggers usually cause a mob to echo or do something not involving another player, or find a random player in the room using randchar(). |
|
Syntax to add: add random [prog id] [percent] |
|
|
speech: |
speechexact: |
A 'speech' trigger allows a prog to be called when the player says something. Speechexact requires the exact phrase to be entered whereas 'speech' will trigger if any part of the player's speech contains the trigger phrase. |
|
There is a special case to 'speech' triggers - if the trigger phrase is set to 'all', the prog will be triggered on any speech in the room and what was actually said will be available in lua as a string using the variable 'charg'. Regular speech triggers are always checked before an 'all' trigger so they can be mixed. More than one 'all' trigger is pointless. |
|
Syntax to add: add speech [prog id] [trigger phrase] |
Syntax to add: add speechexact [prog id] [trigger phrase] |
|
|
tell: |
tellexact: |
A 'tell' trigger allows a prog to be called when the player sends a tell to the mob. Tellexact requires the exact phrase to be entered whereas 'tell' will trigger if any part of the player's tell contains the trigger phrase. |
|
There is a special case to 'tell' triggers - if the trigger phrase is set to 'all', the prog will be triggered on any tell to the mob and what was actually sent will be available in lua as a string using the variable 'charg'. This is how the academy decides whether or not you answer correctly during the quiz sections. |
|
Syntax to add: add tell [prog id] [trigger phrase] |
Syntax to add: add tellexact [prog id] [trigger phrase] |
|
|
transfer: |
A 'transfer' trigger executes when a player is transfered into the room by another lua prog. Greet/grall progs are not triggered by transfer, this trigger type is used instead. Note that imm transfers, portals, etc do not run transfer triggers - only transfer from within another prog. |
|
Syntax to add: add transfer [prog id] [percent] |
|
|
timer: |
A 'timer' trigger sets a trigger to run a program on a mob every X number of seconds. Timer triggers are similar to 'Random' triggers but the time is fixed. |
|
Note that with timer progs, the prog is triggered without a player causing it, so 'ch' is not defined. Timer triggers are useful to combine with mobdata (saves over a reboot) and the time commands to set a specific time at some point in the future then check periodically is that timer has expired. See the section on Timers in the Lua Howto page for an example. |
|
Syntax to add: add timer [prog id] [seconds] (cannot set a timer for less than 60 seconds) |
|
|