Mob ActionsQuick links:Actions OverviewMob actions exist to allow builders to personalize mobs, giving them things to do besides sit around waiting to be killed by money hungry players. Mobs can use most commands that players can, although making a mob do something like 'who' just doesn't get you anywhere. The few commands mob's can't use are safeguarded so that they won't crash the system, although you may spend some time trying to figure out why this mob is not doing anything. There are 6 parts to a mob action. These are:
If the appropriate trigger is set, it then checks to see if the person who acted should be reacted to. The phrase is checked with some phrases, to see if the command typed matches when the mob should react. If all these conditions are met, the chance is checked. If it is successful the mob performs the action, if the mob is in the appropriate state to react to this action. Mobs can perform actions in one of 2 ways. They can either act directly (the default most of the time) or can react 'delayed'. If they react delayed, it means the next time the mob is checked for movement, etc. Rather than do a generic mob thing, it will perform the next action in its list of delayed actions. Mobs reacting to themselves or other mobs are ALWAYS set to delay, so as not to risk causing infinite mob reaction loops. Some mob events are targeted. They are directed at a 'victim'. Others are not targeted, as the mob won't know whom in the room to target when the action is performed. Any given mob can have as many actions defined as you want, but each additional action does cost CPU cycles. Moderation is the key, use what is necessary but don't be frivolous. Mob TriggersEach trigger is a flag set in the action. The trigger is activated when the mob does something, or someone in the room does something that the mob can see.
Mob ConditionsConditions are requirements for the action to execute. They give more control over the circumstances which cause the trigger to happen. Many conditions work as groups. For instance, Day and Night are grouped. If None of the group members are set, then that group is ignored. If any of the group members are set, then all the conditions of that group are active. At least one entry of NPC/PC/IMM/criminal group must be selected for triggers with a target.
PhraseThe phrases were defined under their respective triggers. If you leave phrase blank with one of those triggers, the mob will react to ALL instances of that trigger. If the trigger flag 'specific phrase' is set then the mob will only react if the phrase matches the input exactly. ChanceThis is a % chance that the action will be performed. Only one action is ever performed on a given trigger. Having 2 actions at 50% both keying on a trigger will give a 50% chance of the first action going off, if it doesn't go off, a 50% chance of the other action going off, and an overall 25% chance of no actions going off. StateThe state of an action allows complex paths of action to be possible. An action with state of 0 will always be performed, and will set the mob's state to 0. An action with state of 9999 will always be performed, but not alter the mob's state. If the state of an action is set to any other number, the mob will only react when the mob is in that state. A mob's state is set with the 'mobact state' action. This allows a mob to react to one trigger, changing its state. ActionThis is what the mob will do. For the most part, you write this field as if you were the mob, executing one command at a time. Each line of the action field is processed separately, as a separate command. In addition, multiple commands can be specified on the same line by separating them with semicolons. Any line ending with a / will be continued on the next line - in this way, you can enter commands longer than the text wrapper allows. LML tags can be used withing the body of an action, but, there are definate problems with this. First, the first and last lines of the action have to be <LML> and </LML>. Secondly, LML auto-wraps the resulting text. As mob action processing uses line breaks to designate different commands, you will have to work very hard to make sure that the wrapped line breaks fall where needed. Finally, tags only work in actions where there is a character triggering the action. Update, Init, Enter, Leave, and Zone Reset actions won't process LML tags. Within the action text, three characters will be replaced if possible.
Mobact CommandThis is a command a mob can use with a trigger to accomplish something it couldn't normally do. Used in the right situations, this enables a mob to kill someone who surrenders to it, to create items in reaction to an event, or to do a restore effect. Mobact uses 'subcommands' which allow the mob to do many things with just one command. Charmed mobs lose their access to this command. Mobact subcommandsmobact affstrip target spellnameThis removes all traces of a named spell from the target.mobact charm target durationThis makes the mob a charmie of the target for the duration specified.mobact clearThis clears the mob's queue of pending commands to be processed.mobact consume item / AllThis allows the mob to remove an item it is carrying (or all the items it is carrying) from the game without any message.mobact deduct amount victimThis deducts amount silver from the victim. It will deduct as much as possible, and consider itself successful if it gets as much as it asked for.mobact delayThis makes the mob process the remained of an action in delay mode, rather than immediate mode. It does nothing if the action is already delayed.mobact echo textThis echos text to the room.mobact extractThis removes the mob from the game without any messages. Don't ever use this without a delay.mobact forgetThis clears all of a mob's memories.mobact freeze victim secondsThis places a freeze on the victim's input for a number of seconds. If no time is specified, 3 seconds is the default.mobact ifSee Help IFmobact interpret victim commandMakes the victim execute the command as if they had typed it.mobact langteach language victimThis teaches a language to a player. The player must have a practice to spend.mobact loadmob vnumThis creates a mob with the specified vnum and puts it in the room with the acting mob. There is no message.mobact loadobj vnumThis creates an object with the specified vnum. If it can be carried, it is put in the mob's inventory, otherwise it is put in the room. There is no message.mobact objtrigger object victimThis sends an object trigger to the specified object, with the victim as the actor.mobact peaceThis stops all combat in the room. It removes aggressiveness from mobs as well.mobact pecho victim textThis echos text to the victim.mobact reaction reaction victimThis sets the mob's reaction to a victim. Reaction ranges from 100 to -100, where 100 is best friends, and -100 is attack on sight.mobact recho victim textThis echos text to everyone in the room except the victim.mobact remember victimThis sets the mob's action memory to the specified victim. This can be accessed in the action parsing with the '_' replacement.mobact restore victimThis restores a character. If no name is specified, the mob restores itself.mobact run vnum argumentThe mob runs the specified lensc program.mobact scatter...The mob uses the scatter command. See help scatter.mobact signal vnum argumentThe mob sends the argument text to the running lensc program with the specified vnum. Only the mob that started the program may signal to that program.mobact seize object victimThis takes an item from a victim and gives it to the mob. There is no message.mobact set practices/trains numberThis is used to set the mob's pracpractices or trains. This is useful because the mob's practices are the extra-reset 1 and trains are extra-reset 2 for use with th various spec_funcs.mobact setspec specnameThis sets the mob's spec_func to the specified function. If an invalid name is given, it is cleared. (so, "none" clears it.)mobact slay victimThis slays a victim outright.mobact state numberThis sets the mob's state field to the specified value.mobact timer item timeThis sets the extract timer on an item in the mob's inventory to the time indicated, in minutes.mobact trans ALL/victim vnum (hidden)This transfers a player, or all players, to a specified location. There is no message, but, the players will see that they were moved unless hidden is specified,mobact trigger actor phraseThis sends a trigger action to the room. The actor for this new trigger is specified in this command, it is not the mob executing this command.mobact unseenThis toggles a special state, in which anything the mob does is unseen. Executing this command once puts the mob in that state, a second time, removes that state.mobact vehicle vehicle actionPerforms one of the following vehicle actions:
mobact zonequest victim prior state new stateThis changes the zonequest state of the victim, for the zone the area that the player is in. The player must be in the prior state, and is moved to the new state. New state is typically a number, but can be done - indicating that the player receives the quest award.Back to top Samples
|