Triggers are fairly easy to add, but this basic list should hold for most needs. Their names, argument list syntaxes, examples, and translation into more articulate English are given below: Remember, if this is a new mobprog to "addmp" before the syntaxes below or if you want to change an existing mobprog to "edit # [new trigger] [argument (if needed)>]

 

ACT act [string] 

The argument is a phrase, a text string. The trigger is activated whenever the phrase is contained in the act() message.
 Most general trigger. Applies to almost every event which happens in the mud. Basically this will trigger on almost everything you'll ever want. Output of "say", "shout" and "emote" do not trigger this event.

SPEECH speech [arg]

This is only triggered when the phrase is contained in a message which has been said by a PC in the same room as the mob. The PC restriction is not necessary, but makes infinite loops between two talking mobiles impossible. It also makes it impossible for two NPC's to stand and discuss the weather, however.

Example: speech gnomes gnome stupid
Event will be triggered when any of the above words (gnome, gnomes, or stupid) are in the message. Specific phrases can be triggered by putting the words in quotes, as displayed below.

Example2: speech 'Gnomes are stupid'
The event will only be triggered if the player says the phrase exactly as what's in the quotes.

Example3: speech p Gnomes are stupid
The letter "p" signals that the message is to be a phrase, and thus replaces the need for quotes. This should work with anything that needs a phrase in it, such as an act_prog.

RANDOM random [number] 

The argument is a number betweeen 0 and 99 inclusive.

This trigger is checked at each PULSE_MOBILE and if the argument is greater than a percentage roll the trigger is activated. This will happen even if there is no PC in the room with the mob, but there must be players in the same area. It is useful to give mobiles a bit of a personality. For instance a janitor who stops to spit tobacco, or complain about the hours, or wonder why there are no woman janitors on muds, or a fido which barks or growls or pees on the curb is much more alive than one which just sits there scavenging. Note that this trigger is checked only when there are players in the area.

Example: random 60
Event will be triggered 60% of the time.

GREET/GREET ALL greet [ number] 
allgreet [ number] 

Again a percentage argument.

GREET: Whenever someone enters the room with the mobile, and the mobile can  see the person enter, this is checked. Good for shopkeepers who want to welcome customers, or for pseudo-aggressive mobiles which need to discriminate on who they attack. Greet trigger activates only when the mobile is not busy (fighting, sitting, sleeping etc.). If you want to be sure to catch all players, use "allgreet".

Example: greet 70
Will greet visible targets who enter the room 70 percent of the time.

ALLGREET: Like greet, but it can be triggered even if the mobile didn't see the arrival (i.e. sneak, invis, etc.) or is busy. Most useful for faking teleport rooms or for impassable guardians.

Example: allgreet 80
Program will be triggered 80% of the time when the target enters the room.

ENTRY entry [number] 

Again a percentage argument.

The opposite of greet trigger. Whenever the mobile itself enters a new room, this can be triggered. Useful for looking around, or waving or other things that real PCs do when they arrive at a crowded room. IMPORTANT: In an entry program, the mobile can only refer to a random pc ($r in if checks) -- there's no way to know how many PCs exist in the room the mobile enters!

Example: entry 30
Program will be triggered 30 percent of the time when the MOB with the program enters a room.

GIVE give [arg] 

This is triggered whenever something is given to the mobile. Best used for quests. Since the first successful trigger is the only one of this type which is processed, having an "all" argument in the script at the end of the MOBprogram list is essentially a default response.

Example: give all
The event will be triggered when any object is given to the MOB.

Example2: give dwarven axe battleaxe
Event will be triggered only when an object whose keyword's match those listed exactly.

NOTE: It is generally a good idea to mpjunk the item after the MOB receives it, so that the players don't steal the object from the mob to make the trigger go off again.

FIGHT fight [number] 

The argument is a percentage.

Useful for giving mobiles combat attitude. It is checked every round when the mobile is fighting. Can be used to cast spells, curse at the opponent, or whatever. Only the first successful one will be processed to save time. Also, this means that the mobile won't get lucky and 1. curse, cast a fireball and 2. spit on the player, cast another fireball in the same pulse. This should usually be set fairly low, unless you want to spam the players. (25% and below is about right most of the time)

Example: fight 12
Every round there will be a 12% chance of the trigger going off.

HIT POINT PERCENTAGE hitprcnt [number]

The argument is a percentage.

NOTE: Is activated each round when the mobile is fighting. It checks to see if the hitpoints of the mobile are below the given percentage. Multiple hitprcnt triggers should be listed in increasing order of percent since a 40% will always be activated before a 20% and, only the first successful trigger is performed.

Example: hitprcnt 75
Action will be triggered when the mobile is at 75% of its maximum hitpoints.

DEATH death [number] 

The argument is a percent once again.

NOTE: When the mobile dies, if the random percentage is less than the argument the mobile performs the MOBprogram commands rather than the usual death_cry() sequence. This is done before the corpse is made, so the commands can be considered the mobiles last gasp. It could perhaps destroy the items it was holding , or create some , or cast a spell on the killer and the room, or even goto a new location and die there (with a text message, the corpse would seem to vanish) The position of the mobile is set to STANDING, and so it can do all the normal commands, without worrying about being DEAD. However, even if the mobile restores itself to full hitpoints, it will still die. This is not a way to immortal mobiles. However, the last thing this mobile does could be to goto some vacant room, load a fresh version of itself, drop all its items, force the new mobile to get all the items and wear them, send the new mobile back to the character who killed it and force the new mobile to attack that character. Along with a text message which said the mobile restored itself, this might be a convincing effect. (Note that your kitten could turn into a dragon this way too).

Example: death 45
Action will be trigged 45% of the time when the MOB dies.

NOTE: You cannot supply a target during these as you would for a fight_prog. E.g.: You cannot have the MOB cast fireball on a player before it dies.

NOTE: No MOBprograms will be successful when the mobile is charmed (since it has no self volition, it should act like it has none) to protect mobiles which are given special powers from being implemented by a player