354 Commits
Author SHA1 Message Date
Brues a51225cb84 ranged auto-attack: detect via SPELL_ATTR_AUTO_REPEAT bit
Drop the hardcoded {75, 5019} ID list in favor of testing
Spell.dbc.Attributes bit 1. Auto Shot (Attr=0x00050012) and Shoot
wand (Attr=0x00000012) share that bit; on-next-swing Heroic Strike
and other ranged spells don't. Future-proofs against private
servers adding new auto-repeating spells.
v1.0.2
2026-05-26 00:34:11 -05:00
Brues 6969fa77d1 create spellbook section 2026-05-26 00:24:10 -05:00
Brues 74b3765683 auto attack check spells 2026-05-26 00:19:28 -05:00
Brues 10df3f11c2 C_Spell.SpellHasRange 2026-05-26 00:12:47 -05:00
Brues e2d7b0f555 C_Spell.IsSelfBuff 2026-05-26 00:05:43 -05:00
Brues 209a57a8d6 C_Spell.GetSpellSubtext 2026-05-26 00:02:04 -05:00
Brues acb0456610 C_Spell.GetSchoolString 2026-05-25 23:58:10 -05:00
Brues e47f3aacb2 C_Spell.DoesSpellExist 2026-05-25 23:49:29 -05:00
Brues d718530a7a GetItemUniquenessByID 2026-05-25 23:42:10 -05:00
Brues 55d4e1856f GetStackCount/GetItemUniqueness 2026-05-25 23:37:39 -05:00
Brues 68771506a8 IsInRaid/IsInGroup 2026-05-25 23:37:14 -05:00
Brues d0dc8c1965 generate notes for new releases 2026-05-25 15:13:04 -05:00
Brues 54e503d1dd InCombatLockdown just returns false now v1.0.1 2026-05-25 14:59:00 -05:00
Brues 0d5c392c20 C_Map.GetBestMapForUnit 2026-05-25 00:20:53 -05:00
Brues da183c3f9a Update API.md 2026-05-24 19:38:27 -05:00
Brues 4a78208c6a corrected GetInstanceInfo shape. added mapid 2026-05-24 19:37:52 -05:00
Brues f61c014973 GetInstanceInfo 2026-05-24 19:33:54 -05:00
Brues 9a66f8176c upload individual files as well v1.0.0 2026-05-24 18:44:25 -05:00
Brues e571c5ec5d restructure output zip 2026-05-24 18:27:54 -05:00
Brues df31e390ba workflow now generates a zip 2026-05-24 18:21:55 -05:00
Brues cfd7e12e20 Register external/minhook as submodule
The .gitmodules entry existed but the gitlink was never staged,
so CI checkouts had an empty external/minhook directory.
2026-05-24 17:09:02 -05:00
Brues 9453de0f28 fixed tag 2026-05-24 17:06:45 -05:00
Brues 7dfccfd10d set CLASSIC_API_VERSION 2026-05-24 17:03:35 -05:00
Brues 7bed05462d Create release.yml 2026-05-24 16:59:36 -05:00
Brues b066aec1e9 LockItem/UnlockItem 2026-05-24 16:38:13 -05:00
Brues db20ce1278 islocked fixed 2026-05-24 16:21:15 -05:00
Brues 9fd85287fa C_Container.MoveItem 2026-05-24 15:51:37 -05:00
Brues 56f56f5faf moved C_Container functions to their own folder 2026-05-24 15:36:49 -05:00
Brues 08494b1a48 C_Container.SwapItems 2026-05-24 15:26:54 -05:00
Brues 7f3c27dc5d add links to the readme 2026-05-24 15:03:07 -05:00
Brues 38f1be96ff GameTooltip:GetOwner() 2026-05-24 01:38:28 -05:00
Brues 554dec2718 Update README.md 2026-05-23 16:38:16 -05:00
Brues 1e410162e0 PLAYER_EQUIPMENT_CHANGED investigation 2026-05-23 03:27:18 -05:00
Brues 44adfb8183 Class Colors: set a to 1 2026-05-23 03:26:05 -05:00
Brues 49b2bd8829 UnitPower / UnitPowerMax / UnitPowerType + Enum.PowerType 2026-05-22 21:26:47 -05:00
Brues 74aa23480b GetAverageItemLevel 2026-05-22 20:38:21 -05:00
Brues 3b360a8246 RegisterNewSlashCommand 2026-05-22 19:56:44 -05:00
Brues 2b19de518b C_UnitAuras.GetAuraDataBySpellName 2026-05-22 19:14:17 -05:00
Brues 889116c6b0 QUEST_TURNED_IN 2026-05-22 16:41:06 -05:00
Brues 8734030ebe C_QuestLog.IsQuestDataCachedByID 2026-05-22 01:40:03 -05:00
Brues dabb65a220 HEARTHSTONE_BOUND event 2026-05-22 01:20:31 -05:00
Brues 07aaf283e3 GetQuestLogLeaderBoardID 2026-05-22 01:17:56 -05:00
Brues 85f5023f3d GameTooltip:GetGameObject / HasGameObject 2026-05-22 00:12:38 -05:00
Brues 6feb62f884 GetInventoryItemsForSlot
Modern accessor for "all items in inventory that can equip in
slot N". Walks equipment 1..19 + bags 0..4; for each item whose
m_inventoryType passes the slot-compatibility check, inserts
returnTable[packedLocation] = itemLink. Uses the same packed
ItemLocation encoding as C_EquipmentSet.GetItemLocations.

Compatibility check is a single bitwise AND against a static
invType → slotMask table — same shape and values as 3.3.5's at
DAT_00A2D288 (decoded from its Script_GetInventoryItemsForSlot
chain via FUN_007082B0). Two adjustments for vanilla:

  INVTYPE_2HWEAPON       → mainhand only (no titanic grip)
  INVTYPE_WEAPONMAINHAND → mainhand only
  INVTYPE_WEAPONOFFHAND  → offhand only

3.3.5's table allowed either-hand for those three because of
later-expansion mechanics.

Implementation gotcha: Item::Location::ResolveBag does
SetTop(L, 0) internally (it needs to set up the engine's
PackBagSlot expected stack shape), which clobbers our returnTable
at slot 2. Fix: anchor the table in the Lua registry under a
private key, collect items into a std::vector during the walk,
then rebuild the stack and populate. Registry slot is cleaned up
before return.

Bank items aren't included — vanilla's GetItemBySlot gates bank
slots on a banker GUID that's only set while the bank window is
open; modern WoW behaves the same way.

The transmogrify arg is accepted and ignored. Stock 1.12 has no
transmog system to query, and the modern flag's effect (broader
cross-eligibility for visual swaps) reduces to the regular equip
check. Private servers (Turtle WoW etc.) layer their own transmog
systems on top of vanilla; if any of those exposes its rules
through addon-readable engine state we'd plumb the flag through,
but we don't know of any such hook today.
2026-05-21 22:08:15 -05:00
Brues 8b5c670963 C_Item.GetItemSetID / GetItemSetIDByID / GetItemSetInfo
Three new accessors for the equipment-set system that vanilla
exposes only partially:

  GetItemSetIDByID(itemID)       — modern's 16th GetItemInfo return.
  GetItemSetID(itemLocation)     — same, by ItemLocation table.
  GetItemSetInfo(setID)          — full ItemSet.dbc row as a table.

The "what set is this item in" path reads ItemStats_C::m_itemSet
at +0x1C0 (field position derived from VanillaHelpers's struct +
verified-offset arithmetic against the already-confirmed
m_bagFamily at +0x1D0). Cache-miss-warm pattern matches the other
*ByID readers (RequestLoadItemDataByID + listen for
GET_ITEM_INFO_RECEIVED).

GetItemSetInfo reads ItemSet.dbc directly — record layout decoded
from the per-record loader at FUN_0057BBA0:

  +0x00 ID                      +0x6C  SetSpellID[8]
  +0x04 Name[8]  (8 locales!)   +0x8C  SetThreshold[8]
  +0x24 unknown                 +0xAC  RequiredSkill
  +0x28 ItemID[17]              +0xB0  RequiredSkillRank

180-byte stride, 45 columns. ItemSet has only 8 locale slots (vs
Spell.dbc / ChrRaces.dbc's 9), so the name read clamps the global
VAR_LOCALE_INDEX to [0..7] to avoid reading past the locale array
into the unrelated +0x24 field.

Return table: { setID, name, items[], bonuses[{spellID, threshold}],
requiredSkill, requiredSkillRank }. Verified against Magister's
Regalia (setID 181): 8 items, 4 bonuses at thresholds 2/4/6/8.
2026-05-21 17:47:46 -05:00
Brues 24b0153287 C_Spell.GetSpellReagents + fix Spell.dbc reagent offsets
Returns the spell's reagent list as an array of {itemID, count}
tables, one entry per non-empty reagent slot. Reads directly from
Spell.dbc; stops at the first empty slot, matching the engine's
own tooltip reagent loop.

Discovered while implementing that the reagent offsets we had in
Offsets.h were wrong:

  Old: OFF_SPELL_REAGENT_ID = 0x110, OFF_SPELL_REAGENT_COUNT = 0x130
  New: OFF_SPELL_REAGENT_ID = 0xA8,  OFF_SPELL_REAGENT_COUNT = 0xC8

The old values came from a CMaNGOS-style SpellEntry schema that
doesn't match 1.12.1's actual record layout for reagent fields.
Verified empirically by decompiling BuildSpellTooltip (0x0052E610) —
its reagent loop iterates `localRec + 0x2A` (dword arithmetic =
byte +0xA8) as itemIDs and indexes [+8] (= byte +0xC8) for counts.
We already had a separate OFF_SPELL_RECORD_REAGENTS = 0xA8 entry
used by the tradeskill/craft scrapers (correct value), so it was
silently inconsistent — they were reading the same field by two
different names, one of which was wrong.

Fixed latent IsUsableSpell bug as a side effect: the reagent gate
was reading zeros from +0x110 / +0x130 and concluding "no reagents
required" for every spell. Now correctly returns (false, false) for
spells whose reagent the player doesn't have in their bags.
Verified: GetSpellReagents(23028) = {{itemID=17020, count=1}};
IsUsableSpell(23028)=1 with Arcane Powder in inventory.

Consolidated: removed the now-duplicate OFF_SPELL_RECORD_REAGENTS
alias; tradeskill scraper points at the canonical OFF_SPELL_REAGENT_ID.
2026-05-21 16:12:13 -05:00
Brues 58c1d4e43d Item inventory location globals are part of the addon 2026-05-21 15:22:30 -05:00
Brues bb45d84620 UnitInRange
Returns (inRange, checkedRange) — 40-yard healing-range check
matching modern's shape. Reuses the CGObject::GetPosition vtable
virtual at slot 5 (offset 0x14) that Script_CheckInteractDistance
uses, just with a fixed 1600.0 squared-distance threshold.

Two notable behaviors:

  UnitInRange("player") → (false, false). Documented Blizzard quirk
  carried over from modern — the function is meant for "is *another*
  unit in range" checks, querying yourself is meaningless. Short-
  circuited before the position read so checkedRange=false is
  unambiguous.

  checkedRange=false when the unit's position can't be obtained:
  unresolvable tokens, empty party/raid slots, raid members in a
  different zone, target with nothing targeted, etc. The position
  virtual returns null in those cases.

Vtable shape verified via the bytes at 0x0048BACF / 0x0048BADC
(both unit and player calls pass an out-buffer to vtable[+0x14] —
Ghidra's decomp dropped the player-call buffer push from the
output).
2026-05-21 15:17:02 -05:00
Brues da86cd46e3 GetItemCooldown / C_Container.GetItemCooldown
Direct-by-ID item cooldown query. Returns (startTime, duration,
enable) — the same multi-return shape 1.12's
GetContainerItemCooldown(bag, slot) uses — without requiring a
physical slot reference.

Routes through FUN_ITEM_QUERY_COOLDOWN at 0x006E2ED0, which looks up
the item's ItemStats_C record, finds the slot with trigger=ON_USE
(OFF_ITEMSTATS_SPELL_TRIGGER[i] == 0), and queries that spell's
cooldown via the shared FUN_006E13E0 against the player-spell
cooldown manager. The "ON_USE spell's cooldown" interpretation is
how the engine itself surfaces item cooldowns to addons.

Calling-convention gotcha worth flagging: Ghidra labels the first
arg as uint*, but the ItemStats cache lookup uses the integer both
as a hash key and as the cached-entry field-0 match target (which
is a uint*-typed slot), so the decomp inherits the pointer typing.
The actual fastcall value is the itemID itself — passing &itemID
makes ItemStats interpret the stack address as the lookup key and
the call silently fails. Verified via the Hearthstone (6948) test:
&itemID returned (0, 0, 0); passing itemID directly returns
(732120.014, 3600, 1) after use.

GetItemCooldown(itemInfo) accepts itemID / link / numeric string /
name via the shared Item::Arg helper. C_Container.GetItemCooldown
also accepts links because the shared helper extracts them for
free, even though modern's spec says links aren't accepted.
2026-05-21 15:00:46 -05:00
Brues 478006ab15 taint is a 2.0 concept 2026-05-21 14:34:46 -05:00