Zone directory structure
Each zone has its own directory underscripts/zones/. A fully scripted zone typically contains:
Zone.lua and IDs.lua.
IDs.lua — zone-local constants
IDs.lua defines the zones[xi.zone.<NAME>] table for a zone. This is the standard way to reference text message IDs, NPC entity IDs, and mob entity IDs without hardcoding magic numbers.
Zone.lua — zone handlers
Zone.lua returns a zoneObject table with handler functions. All handlers are optional; omit any that are not needed.
NPC scripts
Each NPC file innpcs/ returns a local entity table with handler functions. The file name must match the NPC’s in-game name.
NPC handler reference
DefaultActions.lua — default NPC dialogue
The interaction framework automatically lowers the priority of default NPC responses so that quest/mission dialogue always takes precedence. Default actions are defined inDefaultActions.lua using the action table shorthand:
Any NPC listed in
DefaultActions.lua does not need its own file in npcs/ unless it also participates in quests, missions, or other logic.Trigger areas
Zones can define 3D trigger regions that fireonTriggerAreaEnter and onTriggerAreaLeave. Registered in onInitialize:
onTriggerAreaEnter as triggerArea:getTriggerAreaID().