scripts/ directory. The C++ server core handles networking, the game loop, and low-level entity management; Lua handles all game logic on top of that.
The xi namespace
All server-side Lua code lives under the global xi table. Sub-namespaces group related constants and functions:
| Namespace | Contents |
|---|---|
xi.settings | Server configuration values (rates, toggles) |
xi.zone | Zone ID constants (xi.zone.NORTHERN_SAN_DORIA, etc.) |
xi.item | Item ID constants |
xi.ki | Key item ID constants |
xi.magic | Magic spell constants and calculation helpers |
xi.mob | Mob scripting helpers and NM spawn utilities |
xi.shop | Shop display helpers |
xi.player | Player creation and login hooks |
xi.server | Server lifecycle hooks |
xi.effect | Status effect constants |
xi.mod | Modifier constants (stats, rates) |
xi.skill | Skill type constants |
xi.job | Job constants |
xi.race | Race constants |
xi.nation | Nation constants |
xi.questLog | Quest log area constants |
xi.quest.id | Quest ID sub-tables (e.g., xi.quest.id.sandoria) |
xi.questStatus | Quest status constants (QUEST_AVAILABLE, etc.) |
C++ and Lua bindings
LandSandBoat uses sol2 to expose C++ objects to Lua. The binding definitions live insrc/map/lua/. Each major game object has its own binding file:
Directory structure
Global scripts
Server hooks, npcUtil, shop, treasure, and other globally loaded modules.
Zones and NPCs
Zone structure, IDs.lua, Zone.lua handlers, NPC script patterns.
Interaction framework
The quest/mission section and action system.
Quests and missions
Quest containers, variables, status constants, and registration.
Actions and handlers
All action types, modifiers, table shorthand, and handler signatures.
Combat scripting
Weapon skills, mob skills, physical damage calculations.
Spells and abilities
Spell scripts, magic calculations, blue magic, job abilities.
Item scripting
Item use handlers, trade checks, item utility functions.
Mob scripting
Mob handlers, NM spawn systems, placeholder lists, mob skill scripting.