scripts/globals/ are loaded automatically at server start. They define shared constants, helper functions, and server-lifecycle hooks that all zone, quest, mob, and item scripts can use.
server.lua — server lifecycle hooks
server.lua — server lifecycle hooks
scripts/globals/server.lua defines the xi.server hooks called by the C++ core at key moments.xi.server.setExplorerMoogles(moogleId) hides or shows explorer moogle NPCs based on the EXPLORER_MOOGLE_LV server setting.player.lua — player creation and login
player.lua — player creation and login
scripts/globals/player.lua handles character creation (xi.player.charCreate) and the login event. It gives new characters their starting equipment, job gear, key items, and nation ring based on their chosen race, nation, and job.npc_util.lua — NPC helper functions
npc_util.lua — NPC helper functions
npcUtil is a globally available table of utility functions for NPC scripts. Its functions handle the most common NPC tasks.Item givingshop.lua — shop helper functions
shop.lua — shop helper functions
scripts/globals/shop.lua provides functions for sending shop menus to players.xi.shop.generalGuildStock contains the pre-defined stock tables for all crafting guilds, keyed by xi.skill.*.treasure.lua — treasure chests and coffers
treasure.lua — treasure chests and coffers
scripts/globals/treasure.lua manages the treasure chest and coffer system. It handles key type resolution, loot tables per zone, trap/mimic chances, and respawn timers. Zone-specific loot is defined inside the file indexed by xi.zone.*.mobs.lua — global mob utilities
mobs.lua — global mob utilities
scripts/globals/mobs.lua provides the global mob death hook and the lottery/placeholder NM spawning system.params for phOnDespawn supports: immediate, dayOnly, nightOnly, noPosUpdate, doNotEnablePhSpawn, and spawnPoints.magic.lua — magic calculation helpers
magic.lua — magic calculation helpers
scripts/globals/magic.lua provides shared functions for cure calculations, hit-rate helpers, and final magic damage adjustments.Other notable globals
| File | Purpose |
|---|---|
ability.lua | Job ability damage adjustment helpers |
bluemagic.lua | Blue magic physical/magical calculation routines |
weaponskills.lua | All weaponskill damage calculations |
mobskills.lua | Mob TP move calculations |
magicburst.lua | Magic burst multiplier logic |
conquest.lua | Conquest update handling |
battlefield.lua | Battlefield instance helpers |
pathfind.lua | NPC pathfinding utilities |
mixins.lua | Mixin loader for shared mob behaviors |