Mob script structure
Mob scripts live in themobs/ subdirectory of a zone folder. A mob script file returns a local entity table with handler functions and configuration tables.
Mob handler reference
Placeholder (PH) and lottery NM system
The PH system usesentity.phList and xi.mob.phOnDespawn to spawn lottery NMs when a placeholder mob dies.
phList format
Hooking phOnDespawn
In the placeholder mob’s own script or inZone.lua, call xi.mob.phOnDespawn from the placeholder’s onDespawn:
NM spawn point randomization
Whenentity.spawnPoints is defined, the framework calls xi.mob.updateNMSpawnPoint automatically on the NM’s pop to choose a random position from the table.
You can also call it manually or supply an override table:
Global mob death hook
scripts/globals/mobs.lua defines xi.mob.onMobDeathEx, which is called by the core for every mob death:
Mob entity API
Themob object is a CBaseEntity (same as players and NPCs) with additional mob-specific methods:
Mob skills
Mob skill scripts live inscripts/actions/mobskills/. They are linked to mobs through the SQL mob_skill_lists table rather than in the Lua file itself.
SQL relationship
Mob behavior is driven by two key SQL tables:
The Lua
entity table in mobs/ supplements and overrides these SQL values for named mobs and NMs.