Commit Graph
139 Commits
Author SHA1 Message Date
Brues dcb00701fd GetShapeshiftFormID 2026-05-21 04:04:01 -05:00
Brues b0f1b9910b GetMacroSpell 2026-05-21 00:25:20 -05:00
Brues 1d05f59261 GetMirrorTimerInfo(index) / GetMirrorTimerProgress(label) 2026-05-20 23:49:20 -05:00
Brues 1b01f3fcc9 Removed patches these functions were introduced 2026-05-20 23:04:26 -05:00
Brues fc2010340e UnitTokenFromGUID 2026-05-20 22:40:19 -05:00
Brues e2a18d196c swapped GetUnitGUID arg return order 2026-05-20 22:16:21 -05:00
Brues 753080e267 GameTooltip:GetUnitGUID() / GameTooltip:HasUnit() 2026-05-20 22:08:50 -05:00
Brues 8e51b56b5b typo 2026-05-20 21:42:54 -05:00
Brues 57c5f7a90b QUEST_ACCEPTED 2026-05-20 17:02:41 -05:00
Brues 9b452823b2 Update API.md 2026-05-20 01:29:22 -05:00
Brues 232eaed1f1 GetClassicExpansionLevel 2026-05-19 18:30:13 -05:00
Brues 12c708b55a GetQuestIDForLogIndex 2026-05-19 17:32:53 -05:00
Brues ba28c4cad5 Populate AuraData duration + expirationTime for player auras
`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.
2026-05-18 23:26:40 -05:00
Brues 86047d2fbd Document GameTooltip:SetEquipmentSet
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.
2026-05-18 15:19:19 -05:00
Brues 084cc81ca8 Sort docs/API.md sections alphabetically
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.
2026-05-18 14:29:52 -05:00
Brues d6ddc0020d Document GetActionInfo and UseItemByName
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.
2026-05-18 14:24:50 -05:00
Brues ddd96b587e Expose CVar bindings and RunScript on the glue Lua state
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.
2026-05-17 23:15:23 -05:00
Brues 2a7cbe2e59 Remove C_CharacterList; preserve recovery notes in TODO #95
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.
2026-05-17 21:23:09 -05:00
Brues af414cd162 Document GetSavedCharacterOrder / SetSavedCharacterOrder
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.
2026-05-17 03:23:36 -05:00
Brues ca4294492e CastSpellNoToggle 2026-05-17 02:03:51 -05:00
Brues 4c880c5ac0 C_Reputation.GetFactionDataByIndex(factionSortIndex) 2026-05-16 16:39:43 -05:00
Brues a7aa28f620 moved GetQuestIDFromLogIndex into the C_QuestLog namespace 2026-05-16 15:57:38 -05:00
Brues b0f7f4a2f0 GameTooltip:HasItem() / GameTooltip:HasSpell() 2026-05-16 14:44:57 -05:00
Brues e0f71d2be1 C_Item.GetItemSellPrice(itemLocation) / C_Item.GetItemSellPriceByID(item) 2026-05-16 14:26:56 -05:00
Brues 9a92089ab7 C_MerchantFrame: GetItemInfo, GetBuybackItemID, junk handling
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.
2026-05-16 02:08:02 -05:00
Brues 5330c46e1d C_PlayerCache.GetPlayerInfoByName 2026-05-15 15:29:36 -05:00
Brues addef29adc Bypass Script_GetCVar, return nil for cvars that don't exist
tested on anniversary
2026-05-15 14:30:13 -05:00
Brues b84b651e61 got rid of non-namespaced GetCVarBool(cvar) 2026-05-15 14:20:25 -05:00
Brues a9905df9e1 UnitClassBase 2026-05-15 13:32:46 -05:00
Brues bcae4e7216 C_CreatureInfo.GetCreatureID 2026-05-15 13:06:09 -05:00
Brues fd5105c2d7 C_SpellBook.GetSpellSkillLine(spellID) 2026-05-15 02:15:05 -05:00
Brues 96af9c20fc C_SpellBook.GetSpellLevelLearned and C_SpellBook.GetCurrentLevelSpells([level]) 2026-05-15 01:26:11 -05:00
Brues 42f1c94bb9 C_Item.GetWeaponEnchantInfo() 2026-05-15 00:35:25 -05:00
Brues 8dc3ff4e8f GetCVarBool 2026-05-15 00:26:25 -05:00
Brues ee84019c85 IsHarmfulSpell(spell) / IsHelpfulSpell(spell) 2026-05-15 00:09:33 -05:00
Brues fa3547be31 UnitStandState 2026-05-14 23:21:43 -05:00
Brues 83a3298115 cursor-free equip via FUN_005E0C40
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.
2026-05-14 22:32:13 -05:00
brues-code 37658f706d 25306 is actually rank 12 2026-05-14 20:51:38 -05:00
brues-code f91db9a31a Update API.md
use better item as example for :GetItem()
2026-05-14 20:49:58 -05:00
Brues a22a6b7b82 GameTooltip:GetItem() 2026-05-14 20:44:32 -05:00
Brues 5c0ed1b6a1 includeUses fixed for GetItemCount 2026-05-14 20:15:53 -05:00
Brues f8a84d7cf9 C_AddOns fixes 2026-05-14 15:08:40 -05:00
Brues f6d6e020f3 C_GossipInfo 2026-05-14 13:51:20 -05:00
Brues 4833e3a1ad Update API.md 2026-05-14 13:12:38 -05:00
Brues 96a4edaaa1 Fixed _TURNING and added GLOBAL_MOUSE_ 2026-05-14 12:52:22 -05:00
Brues ae3243d54d TURNING/LOOKING events 2026-05-14 11:46:21 -05:00
Brues d1dd0e3227 C_Timer 2026-05-14 01:24:44 -05:00
Brues de86b80a05 GetUnitSpeed(unit) 2026-05-14 00:01:06 -05:00
Brues 26bb220a45 moved all playercache functions to C_PlayerCache 2026-05-13 23:38:59 -05:00
Brues 9ab3be45f7 GUID consolidation 2026-05-13 23:25:59 -05:00