Extend the single-source-of-truth cleanup to the whole Spell.dbc record
layout. 40 local constexpr offset copies across 16 files (spell/, totem/,
lossofcontrol/, macro/, aura/) redefined field offsets that belong in
Offsets.h: name (0x1E0), icon (0x1D4), effect (0xF4), rank (0x204),
effect implicit targets (0x148/0x154), powerType (0x7C), manaCost (0x80),
rangeIndex (0x90), castingTimeIndex (0x48), maxLevel (0x6C), spellLevel
(0x74), manaCostPercent (0x270).
Add the ones Offsets.h lacked as OFF_SPELL_RECORD_* and repoint every
local use to the Offsets:: constant, deleting the duplicates. Purely
mechanical and behavior-preserving -- every local value already matched
the canonical (verified before repointing). SpellIcon.dbc / SpellRange.dbc
sub-record offsets (0x04/0x08) stay local; they are different structs.
The repo was internally inconsistent: the LICENSE file is GPL v3 but every
src/ header carried the LGPL v3 notice and the README said "LGPL v3 or
later". LGPL was also the wrong fit — this is an injected mod plus a
bundled addon, not a library other code links against, so LGPL's linking
exception buys nothing.
It's also required: src/voicechat/Tts.cpp is ported from awesome_wotlk's
VoiceChat.cpp, which is GPL v3, and a derivative of GPL code cannot be
relicensed under more permissive terms. Dependencies stay compatible —
MinHook (BSD-2) and the nampower-mirrored packet shapes (BSD) are
GPL-compatible, and SAPI is covered by the system-library exception.
Swept "GNU Lesser General Public License" -> "GNU General Public License"
across all 257 src/ headers and changed the README license line to match
the GPL v3 LICENSE file. Comment-only; no build impact.
Hoists the macro-parser hook + long-line guard + per-line walk out
of Spell::CastNoToggle into a new Spell::MacroPrimarySpell module
that dispatches to (prefix, extractor) pairs registered by feature
modules. The body walk now visits each line once and checks every
registered prefix at each position; extractors only parse args
after a matched prefix.
Registers a pattern for C_Spell.CastAtCursor(<spellID>) so macros
like `/run C_Spell.CastAtCursor(10)` get tagged with the spellID
the same way `/cast Blizzard` does, driving action-bar cooldown
overlays and auto-repeat highlight in pfUI etc.
Two callers were duplicating the spellIdentifier-resolution pattern
(number / hyperlink / name) and the NameToSpellID_t typedef:
src/spell/Cooldown.cpp → full pipeline via SpellIDFromLink +
ResolveSpellID + NameToSpellID_t
src/spell/CastNoToggle.cpp → NameToSpellID_t + ResolveNameViaEngine
helper for the macro-parser hook
Consolidated into Spell::Arg (new spell/Arg.h + Arg.cpp), parallel
to Item::Arg. Same `Resolved { spellID, name }` shape, same
strstr("spell:") link-parse approach. Three exports:
Spell::Arg::Resolve(L, idx) → Resolved
Spell::Arg::ResolveSpellID(L, idx) → int (auto-name-lookup)
Spell::Arg::NameToSpellID(name) → int (standalone)
C_Spell.GetSpellCooldown sheds the local SpellIDFromLink /
ResolveSpellID helpers; CastNoToggle sheds the duplicate typedef
plus its ResolveNameViaEngine wrapper. Net -50 lines, single place
to extend when we want to add link/name parsing to other C_Spell.*
endpoints later.
Verified: GetSpellCooldown still works for number, link, and name
inputs; CastSpellNoToggle macro-tag path still works.