mirror of
https://github.com/brues-code/ClassicAPI.git
synced 2026-11-16 16:10:36 +00:00
Cast/channel info for the local player with full timing, plus channel spellID/name/texture for any unit. Vanilla stores no cast times anywhere readable (confirmed via the cross-binary technique: 3.3.5 reads them from per-unit CGUnit fields that don't exist in 1.12), so the player's cast/channel start/end are self-tracked on WorldTick: - cast: VAR_CURRENT_CAST_SPELL 0->nonzero transition stamps startMs = now (FUN_OS_TICKCOUNT_MS) and endMs = now + effective cast time. The cast time comes from the engine's own helper FUN_006e3340 (base + level scaling + cast-time SpellMod op 10 + the caster's haste/cast-speed multiplier), the same one the engine cast-start uses -- so end time matches the cast bar, e.g. a talented Frostbolt reads 2.5s not 3.0s. Instant casts (cast time 0) and channels are filtered out. - channel: player's broadcast UNIT_FIELD_CHANNEL_SPELL (+0x228), endMs = now + SpellDuration base ms. FUN_OS_TICKCOUNT_MS shares GetTime()'s epoch (x0.001), so startMs/endMs feed addon progress math directly. Other units: channel info from the broadcast +0x228 field (no times, since per-unit start isn't tracked); regular casts return nil (no vanilla data -- remote casts are transient spell-visual objects, not a queryable record). isTradeskill is real: the spell's SPELL_ATTR_TRADESPELL flag (Attributes bit 0x20). Remaining placeholders: castID/castBarID nil, notInterruptible false, delayTimeMs 0. Verified in-game: Blizzard channel 8s, Conjure Food cast 3s, talented Frostbolt 2.5s, correct icons/spellIDs, GetTime()*1000 between start/end; isTradeskill true for Rough Blasting Powder (Engineering). Docs: API.md sections + README Spell row; TODO #68 marked done.