Research:Dialogue and Messages

Text defines
Text defines in Morrowind are special strings within dialogue and message boxes, that are replaced at run time. For dialogue, they begin with %, and for message boxes, they start with ^. Any character can follow a sequence, so if "%pcrace" is "Redguard", "%pcraces" is "Redguards". % (or ^ in messageboxes) followed by any global variable will be replaced with the value of that variable. All sequences are case insensitive. Built in defines are evaluated before global variables, so if there is a global variable pcnamea = 50, "^pcnamea" will be the name of the character followed by a, not 50. Global variables with a % or ^ in them do not behave sensibly (as might be expected). Global variables with names that are partially contained in other global names (eg. testglobal and testglobala) work correctly (i.e "^testglobala" does not give the value of testglobal followed by a).

List of defines
The following only work in dialogue (empty in messageboxes):

Dialogue global variables
Crime-related global script variables are set every time the player enters dialogue with an NPC:

CrimeGoldDiscount
if bounty == 0: CrimeGoldDiscount = 0 else: CrimeGoldDiscount = max(1, fCrimeGoldDiscountMult * bounty)

CrimeGoldTurnIn
if bounty == 0: CrimeGoldTurnIn = 0 else: CrimeGoldTurnIn = max(1, fCrimeGoldTurnInMult * bounty)

PCHasCrimeGold
PCHasCrimeGold = 1 if player can afford bounty (before any discount), 0 if not

PCHasGoldDiscount
PCHasGoldDiscount = 1 if player can afford bounty (with thief discount), 0 if not

PCHasTurnIn
PCHasTurnIn = 1 if player can afford bounty (with turn-in discount), 0 if not