Special events
ScriptSpecialEvent · 16-bit little-endian word, operand of
Run a special event
Script instructions · Virtual machine
Some effects are too specific for the general instructions: a lightning strike, a level gain, a resurrection, a new party member. The script asks for them with this number, which selects one of seven fixed routines. Values above 6 run no routine.1
typedef enum ScriptSpecialEvent {
SCRIPT_SPECIAL_EVENT_LIGHTNING = 0, /* Draw a lightning column four times in the scene view. */
SCRIPT_SPECIAL_EVENT_SELECT_CHARACTER = 1, /* Ask for a party member; its slot (or 99) becomes the run variable. */
SCRIPT_SPECIAL_EVENT_LEVEL_GAIN = 2, /* Raise each class of the run variable's character by one level. */
SCRIPT_SPECIAL_EVENT_RESURRECTION = 3, /* Ask for a dead member or a set of remains to bring back. */
SCRIPT_SPECIAL_EVENT_RECRUIT_NPC_4 = 4, /* Make room and add character preset 4 to the party. */
SCRIPT_SPECIAL_EVENT_REMOVE_QUEST_ITEMS = 5, /* Delete the party's ITEM_TYPE_QUEST_ITEM items with values 5 and 6. */
SCRIPT_SPECIAL_EVENT_RELOAD_WALL_GRAPHICS = 6 /* Reload the level's VCN wall graphics. */
} ScriptSpecialEvent;
The instruction page gives each routine's exact behavior, its use in the reference scripts and what remains unknown. The run variable is the value read back by conditions; see condition expression tokens.
Sources
Locations refer to the game executable reference.