Synthesize modern's per-form-change event by hooking the engine's
bonus-action-bar refresh helper at 0x004E4FC0 — fires every relevant
UNIT_BYTES_1 broadcast plus once at post-login. Cached-byte gate on
descriptor[+0x212] filters out the recomputes for non-form bytes
(standstate, etc.) the same helper handles. Sentinel -1 for "player
not resolvable yet" distinguishes early-login transients from real
"left a form" transitions.
Vanilla 1.12 only has UPDATE_SHAPESHIFT_FORMS (plural — list-changed).
`expirationTime` now reads from the engine's player-buff table at
`0x00BC6040` (same data path `GetPlayerBuffTimeLeft` uses) when the
unit is the local player. Other units still report 0 — the server
only broadcasts cast/duration for the local player's own auras.
Verified that the engine's ms tickcount matches Lua's GetTime() *
1000, so `expirationMs * 0.001` lands directly on the GetTime
timeline with no epoch reconciliation needed.
`duration` looks up `Spell.dbc.m_durationIndex` (+0x78) →
SpellDuration.dbc and applies the `(effLevel - spellBaseLevel) *
perLevel + base` scaling the engine uses internally, capped at max.
Populated for any unit (the base duration is identical regardless of
who's affected); talent / glyph extensions aren't included here since
those are caster-side and already baked into `expirationTime` on the
caster's side.
First attempt had the wrong field offset for spellID in the buff
table — read +0x0C (untalented rank, returned by Script_GetPlayerBuff
as its second result) instead of +0x04 (the actual spellID, used by
Script_GetPlayerBuffTexture to look up Spell.dbc). Fixed before this
commit.
This unblocks `buff.lua` bookkeeping (the bid-tracking ring-buffer
exists only to compensate for the missing time data) — addons can
now use modern UnitAuras semantics directly.
Adds the GameTooltip row entry in the README + a per-method section
in docs/API.md covering the tooltip shape, localization behavior
(Blizzard FrameXML globals with English fallbacks), and the
storage-format change that persists itemID alongside GUID per slot
to support naming missing items.
Reorders all 30 top-level sections (and the matching Contents TOC
groups) by case-insensitive name. Done via a one-shot Python script
that sliced the file by ## headers and reassembled in sorted order
— no content edits, every per-section sub-bullet and prose block
preserved verbatim.
Also adds the Hooks TOC group that was missing entirely. The Hooks
section existed in the body but had no TOC bullet pointing at it.
Sub-bullet count is unchanged before/after (188 ### subsections),
confirming nothing was dropped during the reshuffle.
Adds README + docs/API.md entries for the two new functions, plus a
correction to the UseHearthstone entry — it still described the old
Script_UseContainerItem dispatch after the 30b3d91 refactor that
routed it through FUN_ITEM_USE directly.
The GetActionInfo entry calls out the known gap: the 0x40000000
non-macro branch surfaces type "item" but nil for the id, since
extracting the itemID from the bag-action hash struct needs more
reversing than landed in 509fbfe.
Vanilla 1.12 registers GetCVar/SetCVar/RegisterCVar/GetCVarDefault
and RunScript only on the in-game FrameScript engine; GlueXML had
no way to reach them. Mirroring is pointer-aliasing — same Script_*
C functions registered on glue via RegisterGlueFunction. CVar
storage is process-global so writes from either state are visible
on the other. C_CVar.GetCVarBool (our existing polyfill) gets a
GlueModuleAutoRegister alongside the existing in-game one.
The single addon driving the C_CharacterList.* bindings moved off
them; keeping the engine-hook surface live for a feature nobody
calls is dead weight. Snapshot record layout, hook target, and the
"why memory-only" rationale all land in TODO #95 so another DLL
can pick it up without re-deriving any of it.
README CharacterList row gains a GlueXML-only callout for the two new
globals plus their persistence path. docs/API.md gets a dedicated
subsection under CharacterList covering scope (glue Lua state, not
in-world), the API surface, the shared ClassicAPI.txt storage layout,
a usage example, and a brief how-it-works note pointing at
FUN_0046ABB0.
Six functions matching the retail namespace:
- GetItemInfo(slot) reads the 28-byte merchant entry directly.
- GetBuybackItemID(slot) walks buyback storage → player invMgr →
CGItem instance block. No GetBuybackItemLink roundtrip.
- GetNumJunkItems / SellAllJunkItems iterate bags via the existing
ResolveBag helper and read quality from the ItemStats cache.
- IsMerchantItemRefundable / IsSellAllJunkEnabled stub to false /
true to match retail's API contract in a version that has no
refund mechanic or sell-junk-disabled setting.
SellAllJunkItems calls the engine's internal MerchantSellItem
dispatcher (CMSG_SELL_ITEM) directly rather than going through
Script_UseContainerItem. The dispatcher uses an irregular fastcall
(count in ECX, four stack args, EDX ignored); a dummy EDX in the
typedef forces MSVC to lay the args out the callee expects.
Sells are deferred one per frame via the shared WorldTick
subscriber. Burst-sending 10 CMSG_SELL_ITEM packets in one frame
consistently dropped the 2nd-to-last sell (verified empirically).
Spreading them across frames matches the cadence of click-by-
click selling.
GetNumJunkItems also returns 0 away from a merchant frame to
match retail's contract — the count is meant as a "what would the
sell button do right now" signal, not a passive inventory query.
Includes a small refactor: factored GUID→CGItem resolution out of
EquipmentSet::Locations into Item::Location::ResolveByGUID so it's
shared cleanly between modules, and renamed VAR_MERCHANT_FLAG_A/B
to VAR_MERCHANT_NPC_GUID_LO/HI now that the semantic is decoded.
Cursor-clearing-when-holding-junk left as TODO #93.
C_Item.EquipItemByName (explicit slot) and C_EquipmentSet.UseEquipmentSet
now call the engine's own swap primitive directly. No cursor touch,
2-cycles resolve atomically in one server packet.