Skip to content

sdk.packet

Catalog lookup + enqueue for uncovered protocol ops. Resolve by name (TalkMessage / GameclientMessageTalk), never by RVA. Nested objects (ObjectPosition, ObjectIdentifier) are not packets; write their live vtable the same way. Do not hard-code catalog counts: the IDA-generated inbound table is refreshed whenever the client protocol moves.

lua
local M = require("sdk.packet")

Constants

Lua 5.4 has no enums — these are integer (or string) fields on the module.

NameValueSummary
TALK_PRIVATE_FROM4
TALK_PRIVATE_TO5
TALK_GM_PRIVATE_FROM15
TALK_GM_PRIVATE_TO16
STASH_STOW_ITEM0StashAction (type 40). Recovered from GameclientMessageStashAction serialize: field 1 action (varint +40), field 2 ObjectPosition* (+24), field 3 ObjectIdentifier* (+32), field 4 count (varint +44), field 5 extra (+48). Canary codes: 0 stow item, 1 stow container, 2 stow stack, 3 withdraw.
STASH_STOW_CONTAINER1
STASH_STOW_STACK2
STASH_WITHDRAW3
QUICK_LOOT_SINGLE0Official proto: SINGLE_CORPSE=0, AREA_AT_CORPSE=1, AREA_AT_PLAYER=2
QUICK_LOOT_AREA_CORPSE1
QUICK_LOOT_AREA_PLAYER2
FIGHT_OFFENSIVE1
FIGHT_BALANCED2
FIGHT_DEFENSIVE3
CHASE_STAND0
CHASE_FOLLOW1
PVP_DOVE0
PVP_WHITE1
PVP_YELLOW2
PVP_RED3

get

function · get(name)

Returns table|nil: spec { name, rtti, type, va, rva, enqueue_rva }

Parameters

NameTypeSummary
namestringcatalog name or type id (TalkMessage, GameclientMessageTalk, 150)

Returns

TypeSummary
table|nilspec { name, rtti, type, va, rva, enqueue_rva }
string|nilerr packet not in catalog

list

function · list()

All outbound catalog rows.

supported

function · supported(name)

True when the type has a generated enqueue helper.

schema

function · schema(name)

1:1 TcParseTable row for an outbound or inbound type. Prefer catalog names (TalkMessage, SeekInContainer) so the client twin wins over the server one.

fields

function · fields(name)

Recovered schema fields for a packet name.

help

function · help(name)

Usage text: send line, RTTI, and every recovered field.

enqueue

function · enqueue(spec, queue, msg)

Enqueue a built message via the catalog helper. Do not pass an RVA.

identifier

function · identifier(item_id)

ObjectIdentifier nested message for an item id.

inventoryPos

function · inventoryPos(slot)

ObjectPosition case 2 (inventory slot 1..10).

containerPos

function · containerPos(container, slot)

ObjectPosition case 3 (container + slot).

objectPos

function · objectPos(nested, type_id)

Low-level ObjectPosition with an explicit type tag.

coordinate

function · coordinate(x, y, z)

Coordinate nested message.

worldmapPos

function · worldmapPos(x, y, z, stackpos)

ObjectPosition case 1 (worldmap). Never use this for inventory.

fromLoc

function · fromLoc(loc)

ObjectPosition from an SDK location table.

moveObject

function · moveObject(from, to, item_id, count)

MoveObject from one location to another.

talk

function · talk(text, opts)

TalkMessage (type 150). mode 1=say, 2=whisper, 5=private-to, 12=NPC.

Parameters

NameTypeSummary
textstring
optstable|nilmode, receiver, channel

Returns

TypeSummary
boolean|nilok
string|nilerr

privateMessage

function · privateMessage(receiver, text)

Private talk to a character name.

useOnCreature

function · useOnCreature(item_id, loc, creature_id)

Use an item on a creature.

useObject

function · useObject(item_id, loc)

Use an item at a location.

buy

function · buy(item_id, count, opts)

BuyObject while an NPC trade is open.

stash

function · stash(action, pos, item_id, stackpos, count)

Stash stow/withdraw action.

sell

function · sell(item_id, count)

SellObject while an NPC trade is open.

greet

function · greet(creature_id)

Greet a creature id.

attack

function · attack(target)

Attack a creature id or Player.

follow

function · follow(target)

Follow a creature id or Player.

identAndPos

function · identAndPos(item_id, loc)

Pair an identifier with an ObjectPosition.

quickLoot

function · quickLoot(opts)

Official quick-loot (single, area corpse, or area player).

cancel

function · cancel()

Cancel the current action.

quitGame

function · quitGame()

Request logout / quit game.

setTactics

function · setTactics(opts)

Set fight/chase/secure/pvp tactics.

equipObject

function · equipObject(item_id)

Equip an item id (ammo to a worn quiver uses inventory case 2).

closeContainer

function · closeContainer(container)

Close a container id.

new

function · new(name)

Allocate an exact-size generated message object for advanced packets. The caller fills IDA-recovered offsets with these writers, then calls send(). Prefer the named helpers below whenever one exists.

upContainer

function · upContainer(container)

Open the parent of a container.

openParentContainer

function · openParentContainer()

Open-parent using the current container context.

seekInContainer

function · seekInContainer(container, index, category)

Seek/paginate a container.

useTwoObjects

function · useTwoObjects(from_id, from_loc, to_id, to_loc)

Use one object on another.

rotate

function · rotate(dir)

Turn to a direction.

send

function · send(name, values)

Fill scalar / string fields from the recovered schema and enqueue. Nested msg/rep fields still need a named helper (talk, moveObject, ...). Presence uses (1 << hasbit) from TcParseTable, not (1 << (field_no - 1)).

Parameters

NameTypeSummary
namestringcatalog or RTTI name
valuestable&lt;string,any>|nil

Arcane SDK catalog generated from scripts/sdk