Appearance
sdk.data
Catalogs. Official client map.dat / staticdata.dat win over Canary. NPCs and towns come from sdk/data/_client_npcs.lua (JSON decode of client/npcs.json). Canary _*.lua is the fallback when the client extract is missing. Spec: docs/superpowers/specs/2026-08-21-sharptibia-data-design.md
lua
local M = require("sdk.data")Constants
Lua 5.4 has no enums — these are integer (or string) fields on the module.
| Name | Value | Summary |
|---|---|---|
map | {} | Static catalog lookups return nil, "unknown" when loaded but unmatched, and nil, "data miss" when the backing catalog is unavailable. Returned rows are shared read-only catalog objects; callers should not mutate them. |
item
function · item(q)
Returns table|nil: row
Parameters
| Name | Type | Summary |
|---|---|---|
q | number|string | id or name |
Returns
| Type | Summary |
|---|---|
table|nil | row |
string|nil | err one of: data miss, unknown |
items
function · items(name: string): ItemCatalogRow[]?, ErrorMessage?
Static catalog lookups return nil, "unknown" when loaded but unmatched, and nil, "data miss" when the backing catalog is unavailable. Returned rows are shared read-only catalog objects; callers should not mutate them.
Parameters
| Name | Type | Summary |
|---|---|---|
name | string | — |
Returns
| Type | Summary |
|---|---|
ItemCatalogRow[]?, ErrorMessage? | — |
interaction
function · interaction(query: ItemId|string): table?, ErrorMessage?
Static catalog lookups return nil, "unknown" when loaded but unmatched, and nil, "data miss" when the backing catalog is unavailable. Returned rows are shared read-only catalog objects; callers should not mutate them.
Parameters
| Name | Type | Summary |
|---|---|---|
query | ItemId|string | — |
Returns
| Type | Summary |
|---|---|
table?, ErrorMessage? | — |
spell
function · spell(query: integer|string): SpellCatalogRow?, ErrorMessage?
Static catalog lookups return nil, "unknown" when loaded but unmatched, and nil, "data miss" when the backing catalog is unavailable. Returned rows are shared read-only catalog objects; callers should not mutate them.
Parameters
| Name | Type | Summary |
|---|---|---|
query | integer|string | — |
Returns
| Type | Summary |
|---|---|
SpellCatalogRow?, ErrorMessage? | — |
spells_by_id
function · spells_by_id(id)
Return every spell associated with a server spell id. Use exact words/name for action selection; numeric delay ids can be ambiguous.
Parameters
| Name | Type | Summary |
|---|---|---|
id | number|string | — |
Returns
| Type | Summary |
|---|---|
table[]|nil | spells |
string|nil | err |
spellsById
alias · spellsById = spells_by_id
Same as spells_by_id.
Alias
Same as spells_by_id.
quest
function · quest(query: integer|string): CatalogRow?, ErrorMessage?
Static catalog lookups return nil, "unknown" when loaded but unmatched, and nil, "data miss" when the backing catalog is unavailable. Returned rows are shared read-only catalog objects; callers should not mutate them.
Parameters
| Name | Type | Summary |
|---|---|---|
query | integer|string | — |
Returns
| Type | Summary |
|---|---|
CatalogRow?, ErrorMessage? | — |
town
function · town(query: integer|string): CatalogRow?, ErrorMessage?
Static catalog lookups return nil, "unknown" when loaded but unmatched, and nil, "data miss" when the backing catalog is unavailable. Returned rows are shared read-only catalog objects; callers should not mutate them.
Parameters
| Name | Type | Summary |
|---|---|---|
query | integer|string | — |
Returns
| Type | Summary |
|---|---|
CatalogRow?, ErrorMessage? | — |
house
function · house(query: integer|string): CatalogRow?, ErrorMessage?
Static catalog lookups return nil, "unknown" when loaded but unmatched, and nil, "data miss" when the backing catalog is unavailable. Returned rows are shared read-only catalog objects; callers should not mutate them.
Parameters
| Name | Type | Summary |
|---|---|---|
query | integer|string | — |
Returns
| Type | Summary |
|---|---|
CatalogRow?, ErrorMessage? | — |
monster
function · monster(query: integer|string): CatalogRow?, ErrorMessage?
Static catalog lookups return nil, "unknown" when loaded but unmatched, and nil, "data miss" when the backing catalog is unavailable. Returned rows are shared read-only catalog objects; callers should not mutate them.
Parameters
| Name | Type | Summary |
|---|---|---|
query | integer|string | — |
Returns
| Type | Summary |
|---|---|
CatalogRow?, ErrorMessage? | — |
monster_spawns
function · monster_spawns(query: integer|string): Position[]?, ErrorMessage?
Static catalog lookups return nil, "unknown" when loaded but unmatched, and nil, "data miss" when the backing catalog is unavailable. Returned rows are shared read-only catalog objects; callers should not mutate them.
Parameters
| Name | Type | Summary |
|---|---|---|
query | integer|string | — |
Returns
| Type | Summary |
|---|---|
Position[]?, ErrorMessage? | — |
npc
function · npc(query: integer|string): CatalogRow?, ErrorMessage?
Static catalog lookups return nil, "unknown" when loaded but unmatched, and nil, "data miss" when the backing catalog is unavailable. Returned rows are shared read-only catalog objects; callers should not mutate them.
Parameters
| Name | Type | Summary |
|---|---|---|
query | integer|string | — |
Returns
| Type | Summary |
|---|---|
CatalogRow?, ErrorMessage? | — |
npcs_by_role
function · npcs_by_role(role: string): CatalogRow[]
Static catalog lookups return nil, "unknown" when loaded but unmatched, and nil, "data miss" when the backing catalog is unavailable. Returned rows are shared read-only catalog objects; callers should not mutate them.
Parameters
| Name | Type | Summary |
|---|---|---|
role | string | — |
Returns
| Type | Summary |
|---|---|
CatalogRow[] | — |
vocation
function · vocation(query: integer|string): CatalogRow?, ErrorMessage?
Static catalog lookups return nil, "unknown" when loaded but unmatched, and nil, "data miss" when the backing catalog is unavailable. Returned rows are shared read-only catalog objects; callers should not mutate them.
Parameters
| Name | Type | Summary |
|---|---|---|
query | integer|string | — |
Returns
| Type | Summary |
|---|---|
CatalogRow?, ErrorMessage? | — |
classes
function · classes(): CatalogRow[]
Static catalog lookups return nil, "unknown" when loaded but unmatched, and nil, "data miss" when the backing catalog is unavailable. Returned rows are shared read-only catalog objects; callers should not mutate them.
Returns
| Type | Summary |
|---|---|
CatalogRow[] | — |
class_spells
function · class_spells(query: integer|string): SpellCatalogRow[]?, ErrorMessage?
Static catalog lookups return nil, "unknown" when loaded but unmatched, and nil, "data miss" when the backing catalog is unavailable. Returned rows are shared read-only catalog objects; callers should not mutate them.
Parameters
| Name | Type | Summary |
|---|---|---|
query | integer|string | — |
Returns
| Type | Summary |
|---|---|
SpellCatalogRow[]?, ErrorMessage? | — |
combat_skills
function · combat_skills(): table?, ErrorMessage?
Static catalog lookups return nil, "unknown" when loaded but unmatched, and nil, "data miss" when the backing catalog is unavailable. Returned rows are shared read-only catalog objects; callers should not mutate them.
Returns
| Type | Summary |
|---|---|
table?, ErrorMessage? | — |
outfit
function · outfit(query: integer|string): CatalogRow?, ErrorMessage?
Static catalog lookups return nil, "unknown" when loaded but unmatched, and nil, "data miss" when the backing catalog is unavailable. Returned rows are shared read-only catalog objects; callers should not mutate them.
Parameters
| Name | Type | Summary |
|---|---|---|
query | integer|string | — |
Returns
| Type | Summary |
|---|---|
CatalogRow?, ErrorMessage? | — |
mount
function · mount(query: integer|string): CatalogRow?, ErrorMessage?
Static catalog lookups return nil, "unknown" when loaded but unmatched, and nil, "data miss" when the backing catalog is unavailable. Returned rows are shared read-only catalog objects; callers should not mutate them.
Parameters
| Name | Type | Summary |
|---|---|---|
query | integer|string | — |
Returns
| Type | Summary |
|---|---|
CatalogRow?, ErrorMessage? | — |
find
function · find(query: integer|string): DataFindResult?, ErrorMessage?
Static catalog lookups return nil, "unknown" when loaded but unmatched, and nil, "data miss" when the backing catalog is unavailable. Returned rows are shared read-only catalog objects; callers should not mutate them.
Parameters
| Name | Type | Summary |
|---|---|---|
query | integer|string | — |
Returns
| Type | Summary |
|---|---|
DataFindResult?, ErrorMessage? | — |
bankers
function · bankers(): string[]
Static catalog lookups return nil, "unknown" when loaded but unmatched, and nil, "data miss" when the backing catalog is unavailable. Returned rows are shared read-only catalog objects; callers should not mutate them.
Returns
| Type | Summary |
|---|---|
string[] | — |
travel
function · travel(): table[]
Static catalog lookups return nil, "unknown" when loaded but unmatched, and nil, "data miss" when the backing catalog is unavailable. Returned rows are shared read-only catalog objects; callers should not mutate them.
Returns
| Type | Summary |
|---|---|
table[] | — |
manifest
function · manifest(): table?
Static catalog lookups return nil, "unknown" when loaded but unmatched, and nil, "data miss" when the backing catalog is unavailable. Returned rows are shared read-only catalog objects; callers should not mutate them.
Returns
| Type | Summary |
|---|---|
table? | — |
catalog
function · catalog(): table?, ErrorMessage?
Static catalog lookups return nil, "unknown" when loaded but unmatched, and nil, "data miss" when the backing catalog is unavailable. Returned rows are shared read-only catalog objects; callers should not mutate them.
Returns
| Type | Summary |
|---|---|
table?, ErrorMessage? | — |