Skip to main content
Combat calculations in LandSandBoat are split across several files in scripts/globals/combat/ and the top-level globals. The C++ core drives the attack loop and calls into Lua for damage, effects, and hit logic.

Combat module overview

Physical damage formula

From physical_utilities.lua:
  • D — base weapon damage
  • fSTR — STR-derived bonus (level-dependent)
  • WSC — weapon skill coefficient (stat * alpha)
  • fTP — TP multiplier
  • pDIF — attack vs. defense ratio with caps per weapon type
xi.combat.physical.pDifWeaponCapTable defines the pre-ratio and final pDIF caps per weapon skill type:

Weapon skills

scripts/globals/weaponskills.lua provides all shared weapon skill calculations. Individual weapon skill scripts in scripts/actions/weaponskills/ call these helpers.

Key functions

A weapon skill script defines a wsParams table and calls the calculation:

Shadow absorption

Shadow (Utsusemi) and Blink absorption is handled automatically in weaponskills.lua. Utsusemi is checked first; if it has shadows it absorbs and reduces by one. Blink has an 80% chance to absorb if Utsusemi is already down:

Mob skills

scripts/globals/mobskills.lua provides calculation routines for monster TP moves. Individual mob skill scripts live in scripts/actions/mobskills/.

Enums

Mob skill script structure

Skillchains

Skillchain properties are defined in physical_utilities.lua as a table mapping xi.skillchainType values to their elemental resonance arrays:

Magic hit rate

scripts/globals/combat/magic_hit_rate.lua exposes:
This is called by spell scripts, blue magic, and mob magical skills.