Appearance
sdk.creatures
Creature classify + packet cache (skull, party, type, summoner, icons, outfit). Kind matches Game Engine/CreatureCatalog.cpp ClassifyKind, then the live TCreature.kind byte when applyCreatureData has remapped protobuf 0/1/2/5/7 onto compact 0..4 (player/monster/npc/summon-own/summon-other).
lua
local M = require("sdk.creatures")Constants
Lua 5.4 has no enums — these are integer (or string) fields on the module.
| Name | Value | Summary |
|---|---|---|
KIND_PLAYER | 0 | — |
KIND_MONSTER | 1 | — |
KIND_NPC | 2 | — |
KIND_SUMMON_OWN | 3 | — |
KIND_SUMMON_OTHER | 4 | — |
SKULL_NONE | 0 | — |
SKULL_YELLOW | 1 | — |
SKULL_GREEN | 2 | — |
SKULL_WHITE | 3 | — |
SKULL_RED | 4 | — |
SKULL_BLACK | 5 | — |
PARTY_NONE | 0 | Raw TCreature.party / CreatureData.party byte. Official client writes it without a fromInt remap (unlike skull 0..5). |
PARTY_INVITED | 1 | — |
PARTY_INVITE_OTHER | 2 | — |
PARTY_MEMBER | 3 | — |
PARTY_LEADER | 4 | — |
PARTY_MEMBER_SHARED | 5 | — |
PARTY_LEADER_SHARED | 6 | — |
PARTY_MEMBER_NO_SHARED_BLINK | 7 | — |
PARTY_LEADER_NO_SHARED_BLINK | 8 | — |
PARTY_MEMBER_NO_SHARED | 9 | — |
PARTY_LEADER_NO_SHARED | 10 | — |
PARTY_GRAY | 11 | — |
ICON_TYPE_QUEST | 0 | applyCreatureData packs QUEST as 0 (id) and MODIFIER as 1 (value). |
ICON_TYPE_MODIFIER | 1 | — |
ICON_TYPE_MARK_BORDER | 2 | CreatureMarks oneof case: 2 = CreatureMarkBorder, 3 = CreatureMarkIsAttacked. |
ICON_TYPE_MARK_ATTACKED | 3 | — |
PLAYER_BAND | 0x40000000 | — |
compact_kind
function · compact_kind(proto)
Map proto kind 0/1/2/5/7 (or already-compact 0..4) to KIND_*.
classify
function · classify(id, name, local_id, live_kind)
self / npc / monster / player. Catalog NPC names beat a live kind of 1 (Guide Luke). Player-band ids are not "kind 0 = player" — that byte is often unset.
kind_of
function · kind_of(creature, local_id)
Player object or raw {id,name,kind,local_id}. Same labels as classify.
note
function · note(ev)
Merge one inbound creature event into the packet cache (skull, party, kind, outfit).
get
function · get(id)
Cached packet fields for id, or nil if never noted.
forget
function · forget(id)
Drop the cache row; does not mark the creature gone.
mark_gone
function · mark_gone(id)
DeleteOnMap: remember the id so stale TCreatureStore rows are not fought.
mark_present
function · mark_present(id)
Clear the gone bit when MoveCreature / health proves the id is still on the map.
is_gone
function · is_gone(id)
True after DeleteOnMap until mark_present or reset.
reset
function · reset()
Drop cache and gone set (login / session end).
enrich
function · enrich(data)
Fill missing skull/party/kind/… on a live creature row from the packet cache.