Social Fields - torilmud/docs GitHub Wiki

General Social File Fields

These are the general fields for social commands. The PATH type has a few special commands listed towards the bottom of the page.

MOB:

Format: MOB: [vnum] [social type]

Lists the vnum of the mob that will perform, and the type of social the entry refers to, be it LIST, PATH, PERIODIC, TIMED, or TRIGGER.

FLAG:

Format: FLAG: [value] [description]

This flag value specifies the conditions under which the action will be performed, as well as the target of the action. The bit values are additive:

Flag Bit Value Description
NON_COMBAT_ONLY 1 Trigger is ignored if the mob is in combat.
COMBAT_ONLY 2 Trigger is ignored if the mob is NOT in combat.
USE_INITIATOR 4 Targets the pc or mob who performed the cmd.
USE_SELF 8 Targets itself.
USE_TARGET 16 Targets whoever the mob is fighting at the moment.
DIRECTED 32 Only triggers if the cmd was aimed at the mob.
FROM_MOB 128 Only triggers if the cmd comes from a mob.
  • Note: The way the flags work, targeting flags cannot be used in conjunction with wands effectively, because the arguments pass as Command -> USE_TARGET -> Arguments effectively resulting in 'use' 'pc name' 'wand name'

CHANCE:

Format: CHANCE: [value]

The chance that the action will be performed. The chance works by specifying a number, then the computer rolls a random number between 0 and the number you picked, and if it picks 0, the command is performed. So, a chance of 0 means it always happens, 1 = 50% of the time the action will happen, 2 = 33%, and so on.

DELAY:

Format: DELAY: [value]

This sets the delay (in ticks) before the action is performed. 4 ticks = 1 second, so multiply the number of seconds you want the mob to delay by 4. For example, putting "20" in this field would result in the mob delaying for 5 seconds. Note that for social chains the delay is always counted from the moment the first action is performed, not the last action.

HOUR:

Format: HOUR: [value]

The mud hour to trigger on. Valid hours are 0-23.

TRIGGER:

Format: TRIGGER: [command #]

The command number of the trigger.

ACTION:

Format: ACTION: [command #]

The command number of the action to be performed

Arguments/Parameters

These are the arguments for the action to be performed. Basically, whatever you put in here is appended to the end of the command. For example, if the Action was "say", you would type in the message here, resulting in "say [message]". If the Action was "cast", you would type in "'spell name'" here, resulting in "cast '[spell name]'". You can also specify another mob for a target in here, for example, if the Action was "poke" and the argument was "captain", the final command would be "poke captain". See the examples on each social type for more details. ANSI color is allowed in this field, and it may take up as many lines as you need. This field is followed by a ~ on the following line.

DONE

Format: DONE

Signifies the end of the current entry.

Path Specific Fields

These fields are specific to the Path type of social.

ID:

Format: ID: [number]

Specifies the ID number of the Path as it relates to this MOB. Every path that you define for a specific mob must have a unique ID as this is how you will call the path from a TRIGGER or PERIODIC. If the PATH is meant to be an automatic patrol, set the ID to '0'. Otherwise, it must be a positive number. Paths with an ID greater than zero will NOT activate until they are called from another command.

TYPE:

Format: TYPE: [number]

This field specifies the type of PATH. Use the number of the path type below.

  • PATHTYPE_SINGLE: 1
    • This is a one-way path - the mob will move from the start room to the end room in order, and then stop moving.
  • PATHTYPE_ROUND: 2
    • This is a two-way (roundtrip) path. The mob will move from the start room to the end room in order, and then go back the way he came, repeating indefinitely.
  • PATHTYPE_LOOP: 3
    • This path ends at the same room it begins in, and then starts over, continuing indefinitely. This is useful for patrols that move in a square pattern where the beginning is also the end.
  • PATHTYPE_SEEK: 4
    • This path type is a little different. In SEEK you define only the target room you want the mob to go to. The mob will then track to that room via the shortest route possible, and then stop moving.

ROOMS:

Format: ROOMS: [comma separated list of room vnums]

This field is the meat of the PATH. In this field, list every room vnum in the path IN ORDER, from start to finish. These are the rooms that the MOB will travel through. List each room vnum separated by a space all on one line. Note that PATHTYPE_SEEK only requires one room in this field - the room to seek to.

  • There is currently a maximum of 50 rooms per path, speak to a coder if you need more.

DIRS:

Format: DIRS: [comma separated list of directions]

In this field, list the direction numbers (0-5) required to move through the rooms you listed in the ROOMS: field. The directions need to be in order and correspond to the rooms above, or the path will not work. Note that there should always be one less direction than rooms, as their is no direction required for the final room (since the mob stops there). Also, PATHTYPE_SEEK requires only a 0 on this line.