Substitution Sequences

Substitution Sequences is the npcGenerator equivalent of the World of Warcraft substitution sequences, which replace occurrences of "%t" by the target.

Thus, adding one of the available commands to a string, will cause it to be replaced by a valid option (during printing.) For example, "meeting a %randomRace" could result in "meeting a Tauren". An issue with this is that it can also result in "meeting a Orc", which despite the Orcish nature of it, is incorrect.

Because the outcome is decided during printing, printing the above several times, will return different results every time. This will likely change in the future.

Commands
The following commands are supported. Currently, in 0.x.x, due to limitations %randomClass will only generate classes that are available to the race, age, gender and faith of the current npc. (Internally it uses the generateRandomClass function, which generates one based on the characterTemplate in use.)
 * %class
 * %faith
 * %fear
 * %gender
 * %race
 * %randomClass
 * %randomRace
 * %randomGender
 * %tribe
 * %xhe
 * %xim
 * %xir

Functionality
Substitution Strings are located in core/substitutionStrings.lua and provides the following function: In addition the results for "%fear" is located in this file, but this is likely to change.
 * processSubstitutionString

The functions for "%xhe", "%xir", "%xim" are located in core/util.lua, but this is likely to change in the future.