Skip to main content
Every piece of game content in LandSandBoat is driven by Lua scripts. NPCs, quests, missions, monsters, spells, abilities, and items all run through scripts loaded from the 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:

C++ and Lua bindings

LandSandBoat uses sol2 to expose C++ objects to Lua. The binding definitions live in src/map/lua/. Each major game object has its own binding file:
Methods on these objects are called with the colon syntax in Lua:

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.