Skip to main content

Zone directory structure

Each zone has its own directory under scripts/zones/. A fully scripted zone typically contains:
Not every zone has all directories. Simpler zones may only have 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.
All NPC and zone scripts load this table via:

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 in npcs/ 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 in DefaultActions.lua using the action table shorthand:
See actions and handlers for the full shorthand syntax.
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 fire onTriggerAreaEnter and onTriggerAreaLeave. Registered in onInitialize:
The trigger area ID is passed to onTriggerAreaEnter as triggerArea:getTriggerAreaID().