Periodics

Periodic - Format

MOB: [vnum] TIMED
FLAG: [Flag Value]
CHANCE: [Chance]
DELAY: [Delay]
ACTION: [Reply Cmd#]
[Arguments/Parameters]
~
DONE

Example - Periodic

This example shows a child, who cries to herself approximately once every 30 seconds, while not in combat.

MOB: 91404 PERIODIC
FLAG: 9 ;; NOT_IN_COMBAT + USE_SELF
CHANCE: 2 ;; 33% Chance, or approx. once/30s
DELAY: 4 ;; Delay of 1 second (4 ticks)
ACTION: 53 ;; cry
~
DONE

This next example is of a multiple command periodic action. Same child, except this time, she picks her nose, smiles, then says "yummy".

Note the delays - it's important to set subsequent actions at a higher delay, otherwise they'll all go off at the same time. The delay in the subsequent commands is based from the moment the whole chain started, NOT the time since the last command. In this example, there's a half a second delay between each subsequent command. Also, the chance field is ignored for subsequent commands, as they are all dependent on the first action in the chain. In other words, if the first action goes off, so will all the other commands chained to it.

MOB: 91100 PERIODIC
FLAG: 9 ;; NOT_IN_COMBAT + USE_SELF
CHANCE: 2 ;; 33% Chance, or approx. once/30s
DELAY: 4 ;; Delay of 1 second (4 ticks)
ACTION: 337 ;; Nose
~
FLAG: 1 ;; NOT_IN_COMBAT
CHANCE: 0 ;; N/A
DELAY: 6 ;; Delay of 1.5 seconds (6 ticks)
ACTION: 23 ;; Smile
~
FLAG: 1 ;; NOT_IN_COMBAT
CHANCE: 0 ;; N/A
DELAY: 8 ;; Delay of 2 seconds (8 ticks)
ACTION: 17 ;; Say
Yummy!
~
DONE