Commit graph

1457 commits

Author SHA1 Message Date
Kelsi
170ff1597c fix: prefetch item info for trade slot items in SMSG_TRADE_STATUS_EXTENDED
After parsing the peer's trade window state, query item info for all
occupied slots so item names display immediately rather than showing
'Item 12345' until the cache is populated on the next frame.
2026-03-11 00:46:11 -07:00
Kelsi
06facc0060 feat: implement trade window UI with item slots and gold offering
Previously trade only showed an accept/decline popup with no way to
actually offer items or gold. This commit adds the complete trade flow:

Packets:
- CMSG_SET_TRADE_ITEM (tradeSlot, bag, bagSlot) — add item to slot
- CMSG_CLEAR_TRADE_ITEM (tradeSlot) — remove item from slot
- CMSG_SET_TRADE_GOLD (uint64 copper) — set gold offered
- CMSG_UNACCEPT_TRADE — unaccept without cancelling
- SMSG_TRADE_STATUS_EXTENDED parser — updates trade slot/gold state

State:
- TradeSlot struct: itemId, displayId, stackCount, bag, bagSlot
- myTradeSlots_/peerTradeSlots_ arrays (6 slots each)
- myTradeGold_/peerTradeGold_ (copper)
- resetTradeState() helper clears all state on cancel/complete/close

UI (renderTradeWindow):
- Two-column layout: my offer | peer offer
- Each column shows 6 item slots with item names
- Double-click own slot to remove; right-click empty slot to open
  backpack picker popup
- Gold input field (copper, Enter to set)
- Accept Trade / Cancel buttons
- Window close button triggers cancel trade
2026-03-11 00:44:07 -07:00
Kelsi
7c5d688c00 fix: show area name in SMSG_ZONE_UNDER_ATTACK system message
Replace the raw area ID in the zone-under-attack message with the
resolved area name from the zone manager, matching retail WoW behavior
('Hillsbrad Foothills is under attack!' instead of 'area 267').
2026-03-11 00:36:40 -07:00
Kelsi
eaf827668a fix: parse SMSG_QUESTUPDATE_ADD_PVP_KILL and update quest log kill counts
Previously only displayed a chat message without updating the quest
tracker. Now parses the full packet (guid+questId+count+reqCount),
stores progress under entry-key 0 in killCounts, and shows a progress
message matching the format used for creature kills.

Handles both WotLK (4-field) and Classic (3-field, no reqCount) variants
with fallback to the existing killCounts or killObjectives for reqCount.
2026-03-11 00:34:23 -07:00
Kelsi
77ce54833a feat: add quest kill objective indicator (⚔) to unit nameplates
Yellow crossed-swords icon appears to the right of the unit name when
the creature's entry is an incomplete kill objective in a tracked quest.
Updated icon is suppressed once the kill count is satisfied.

Uses unit->getEntry() (Unit subclass method) rather than the base
Entity pointer, matching how questKillEntries keys are stored.
2026-03-11 00:29:35 -07:00
Kelsi
72a16a2427 fix: clear gossip/quest POI markers on map change (SMSG_NEW_WORLD)
Quest POI markers are map-specific. Clearing gossipPois_ on world entry
prevents stale markers from previous maps being displayed on the new map.
Quest POIs will be re-fetched as the quest log re-queries on the new map.
2026-03-11 00:24:35 -07:00
Kelsi
2ee0934653 fix: remove quest POI minimap markers when quest is abandoned
When abandonQuest() removes a quest from the log, also remove any
gossipPoi markers tagged with that questId (data field) so stale
objective markers don't linger on the minimap.
2026-03-11 00:21:33 -07:00
Kelsi
ef0e171da5 fix: deduplicate quest POI markers on repeated queries and fix LOG_DEBUG ordering
Remove existing POI markers for a quest before adding new ones (using the
data field as questId tag) so repeated CMSG_QUEST_POI_QUERY calls don't
accumulate duplicate markers. Also fix LOG_DEBUG to appear before the move.
2026-03-11 00:20:31 -07:00
Kelsi
6f5bdb2e91 feat: implement WotLK quest POI query to show objective locations on minimap
Send CMSG_QUEST_POI_QUERY alongside each CMSG_QUEST_QUERY (WotLK only,
gated by questLogStride == 5 and opcode availability). Parse the response
to extract POI region centroids and add them as GossipPoi markers so the
existing minimap rendering shows quest objective locations as cyan diamonds.

Each quest POI region is reduced to its centroid point; markers for the
current map only are shown. This gives players visual guidance for where
to go for active quests directly on the minimap.
2026-03-11 00:18:23 -07:00
Kelsi
12aa5e01b6 fix: correct game-object quest objective handling and item count fallback
- SMSG_QUESTUPDATE_ADD_KILL: use absolute value of npcOrGoId when looking
  up required count from killObjectives (negative values = game objects)
- applyPackedKillCountsFromFields: same fix — use abs(npcOrGoId) as map key
  so GO objective counts are stored with the correct entry key
- SMSG_QUESTUPDATE_ADD_ITEM: also match quests via itemObjectives when
  requiredItemCounts is not yet populated (race at quest accept time)
- Quest log and minimap sidebar: fall back to GO name cache for entries
  that return empty from getCachedCreatureName (interact/loot objectives)
2026-03-11 00:13:09 -07:00
Kelsi
e64b566d72 fix: correct TBC quest objective parsing and show creature names in quest log
SMSG_QUEST_QUERY_RESPONSE uses 40 fixed uint32 fields + 4 strings for both
Classic/Turtle and TBC, but the isClassicLayout flag was only set for stride-3
expansions (Classic/Turtle). TBC (stride 4) was incorrectly using the WotLK
55-field path, causing objective parsing to fail.

- Extend isClassicLayout to cover stride <= 4 (includes TBC)
- Refactor extractQuestQueryObjectives to try both layouts with fallback,
  matching the robustness of pickBestQuestQueryTexts
- Pre-fetch creature/GO/item name queries when quest objectives are parsed
  so names are ready before the player opens the quest log
- Quest log detail view: show creature names instead of raw entry IDs for
  kill objectives, and show required count (x/y) for item objectives
2026-03-11 00:05:05 -07:00
Kelsi
73439a4457 feat: restore quest kill counts from update fields using parsed objectives
Parse kill/item objectives from SMSG_QUEST_QUERY_RESPONSE binary data:
- extractQuestQueryObjectives() scans past the fixed integer header and
  variable-length strings to reach the 4 entity + 6 item objective entries
  (using known offsets: 40 fields for Classic/TBC, 55 for WotLK)
- Objectives stored in QuestLogEntry.killObjectives / itemObjectives arrays
- After storing, applyPackedKillCountsFromFields() reads 6-bit packed counts
  from update-field slots (stride+2 / stride+3) and populates killCounts
  using the parsed creature/GO entry IDs as keys

This means on login, quests that were in progress show correct kill count
progress (e.g. "2/5 Defias Bandits killed") without waiting for the first
server SMSG_QUESTUPDATE_ADD_KILL notification.
2026-03-10 23:52:18 -07:00
Kelsi
7e55d21cdd feat: read quest completion state from update fields on login and mid-session
resyncQuestLogFromServerSlots now reads the state field (slot*stride+1)
alongside the quest ID field, and marks quest.complete=true when the
server reports QuestStatus=1 (complete/ready-to-turn-in). Previously,
quests that were already complete before login would remain incorrectly
marked as incomplete until SMSG_QUESTUPDATE_COMPLETE fired, which only
happens when objectives are NEWLY completed during the session.

applyQuestStateFromFields() is a lightweight companion called from both
the CREATE and VALUES update handlers that applies the same state-field
check to already-tracked quests mid-session, catching the case where
the last objective completes via an update-field delta rather than the
dedicated quest-complete packet.

Works across all expansion strides (Classic stride=3, TBC stride=4,
WotLK stride=5); guarded against stride<2 (no state field available).
2026-03-10 23:33:38 -07:00
Kelsi
3a7ff71262 fix: use expansion-aware explored zone count to prevent fog-of-war corruption
Classic 1.12 and Turtle WoW have only 64 PLAYER_EXPLORED_ZONES uint32
fields (zone IDs pack into 2048 bits). TBC and WotLK use 128 (needed for
Outland/Northrend zone IDs up to bit 4095).

The hardcoded PLAYER_EXPLORED_ZONES_COUNT=128 caused extractExploredZoneFields
to read 64 extra fields beyond the actual zone block in Classic/Turtle —
consuming PLAYER_REST_STATE_EXPERIENCE, PLAYER_FIELD_COINAGE, and character-
points fields as zone flags. On the world map, this could mark zones as
explored based on random bit patterns in those unrelated fields.

Add `exploredZonesCount()` virtual method to PacketParsers (default=128,
Classic/Turtle override=64) and use it in extractExploredZoneFields to
limit reads to the correct block and zero-fill remaining slots.
2026-03-10 23:18:16 -07:00
Kelsi
1b55ebb387 fix: correct PLAYER_REST_STATE_EXPERIENCE wire indices for all expansions
The REST_STATE_EXPERIENCE field was erroneously set to the same index as
PLAYER_SKILL_INFO_START in all four expansion JSON files, causing the
rested XP tracker to read the first skill slot ID as the rested XP value.

Correct indices derived from layout: EXPLORED_ZONES_START + 128 zone
fields (or 64 for Classic) immediately precede PLAYER_FIELD_COINAGE, with
REST_STATE_EXPERIENCE in the one slot between them.

- WotLK: 636 → 1169  (1041 + 128 = 1169, before COINAGE=1170)
- Classic: 718 → 1175 (1111 + 64 = 1175, before COINAGE=1176)
- TBC: 928 → 1440    (1312 + 128 = 1440, before COINAGE=1441)
- Turtle: 718 → 1175 (same as Classic layout)
2026-03-10 23:14:18 -07:00
Kelsi
99de1fa3e5 feat: track UNIT_FIELD_STAT0-4 from server update fields for accurate character stats
Add UNIT_FIELD_STAT0-4 (STR/AGI/STA/INT/SPI) to the UF enum and wire up
per-expansion indices in all four expansion JSON files (WotLK: 84-88,
Classic/Turtle: 138-142, TBC: 159-163). Read the values in both CREATE
and VALUES player update handlers and store in playerStats_[5].

renderStatsPanel now uses the server-authoritative totals when available,
falling back to the previous 20+level estimate only if the server hasn't
sent UNIT_FIELD_STAT* yet. Item-query bonuses are still shown as (+N)
alongside the server total for both paths.
2026-03-10 23:08:15 -07:00
Kelsi
d95abfb607 feat: propagate OBJECT_FIELD_SCALE_X through creature and GO spawn pipeline
Reads OBJECT_FIELD_SCALE_X (field 4, cross-expansion) from CREATE_OBJECT
update fields and passes it through the full creature and game object spawn
chain: game_handler callbacks → pending spawn structs → async load results
→ createInstance() calls. This gives boss giants, gnomes, children, and
other non-unit-scale NPCs correct visual size, and ensures scaled GOs
(e.g. large treasure chests, oversized plants) render at the server-specified
scale rather than always at 1.0.

- Added OBJECT_FIELD_SCALE_X to UF enum and all expansion update_fields.json
- Added float scale to CreatureSpawnCallback and GameObjectSpawnCallback
- Propagated scale through PendingCreatureSpawn, PreparedCreatureModel,
  PendingGameObjectSpawn, PreparedGameObjectWMO
- Used scale in charRenderer/m2Renderer/wmoRenderer createInstance() calls
- Sanity-clamped raw float to [0.01, 100.0] range before use
2026-03-10 22:45:47 -07:00
Kelsi
b658743e94 feat: highlight required level in item tooltips when player is under-level
Display 'Requires Level N' in red when the player does not meet the
item's level requirement, and in normal colour when they do. Applies
to both equipped-item and bag-item tooltip paths.
2026-03-10 22:27:04 -07:00
Kelsi
00a939a733 fix: world map exploration fallback when server mask is unavailable
When the server has not sent SMSG_INIT_WORLD_STATES or the mask is
empty, fall back to locally-accumulated explored zones tracked by
player position. The local set is cleared when a real server mask
arrives so it doesn't persist stale data.
2026-03-10 22:27:00 -07:00
Kelsi
6928b8ddf6 feat: desaturate quest markers for trivial (gray) quests
Trivial/low-level quests now show gray '!' / '?' markers instead of
yellow, matching the in-game distinction between available and trivial
quests. Add grayscale parameter to QuestMarkerRenderer::setMarker and
the push-constant block; application sets grayscale=1.0 for trivial
markers and 0.0 for all others.
2026-03-10 22:26:56 -07:00
Kelsi
19eb7a1fb7 fix: animation stutter, resolution crash, memory cap, spell tooltip hints, GO collision
- Animation stutter: skip playAnimation(Run) for the local player in the
  server movement callback — the player renderer state machine already manages
  it; resetting animTime on every movement packet caused visible stutter
- Resolution crash: reorder swapchain recreation so old swapchain is only
  destroyed after confirming the new build succeeded; add null-swapchain
  guard in beginFrame to survive the retry window
- Memory cap: reduce cache budget from 80% uncapped to 50% hard-capped at
  16 GB to prevent excessive RAM use on high-memory systems
- Spell tooltip: suppress "Drag to action bar / Double-click to cast" hints
  when the tooltip is shown from the action bar (showUsageHints=false)
- M2 collision: add watermelon/melon/squash/gourd to foliage (no-collision);
  exclude chair/bench/stool/seat/throne from smallSolidProp so invisible chair
  bounding boxes no longer trap the player
2026-03-10 22:26:50 -07:00
Kelsi
8f2974b17c feat: add standalone LFG group-found popup (renderLfgProposalPopup)
Shows a centered modal when LfgState::Proposal is active regardless of
whether the Dungeon Finder window is open, matching WoW behaviour where
the accept/decline prompt always appears over the game world.
Mirrors the BG invite popup pattern; buttons call lfgAcceptProposal().
2026-03-10 21:40:21 -07:00
Kelsi
7c8bda0907 fix: suppress wchar_t '>= 0' tautological comparison warning on arm64
On Windows arm64, wchar_t is unsigned so 'wc >= 0' is always true
and GCC/Clang emit -Wtype-limits. Drop the redundant lower bound
check — only the upper bound 'wc <= 0x7f' is needed.
2026-03-10 21:34:54 -07:00
Kelsi
b4469b1577 fix: correct buff bar and quest tracker vertical positions
- Buff bar was at Y=140 which overlaps the minimap (Y=10 to Y=210);
  moved to Y=215 (just below minimap bottom edge) with 8 icons per row
- Quest tracker moved from Y=200 (inside minimap area) to Y=320 to
  leave space for up to 3 rows of buffs between minimap and tracker
- Both are right-anchored and no longer conflict with the minimap or
  each other in typical usage (up to ~20 active auras)
2026-03-10 21:32:58 -07:00
Kelsi
a7474b96cf fix: move buff bar to top-right, split buffs/debuffs, raise aura cap to 40
- Relocates buff bar from top-left Y=145 (overlapping party frames) to
  top-right (screenW - barW - 10, 140) where it doesn't conflict with
  party/raid frames anchored on the left side
- Increases max shown auras from 16 to 40 (WotLK supports 48 slots)
- Two-pass rendering: buffs shown first, debuffs below with a spacing gap
  between them; both still use green/red borders for visual distinction
- Widens row to 12 icons for better horizontal use of screen space
2026-03-10 21:29:47 -07:00
Kelsi
5fbeb7938c feat: right-click context menu for party member frames
Right-clicking a party member name in the 5-man party frame opens
a context menu with: Target, Set Focus, Whisper, Trade, Inspect.
- Whisper switches chat type to WHISPER and pre-fills the target name
- Trade calls GameHandler::initiateTrade(guid)
- Inspect sets target then calls GameHandler::inspectTarget()
- Uses BeginPopupContextItem tied to the Selectable widget
2026-03-10 21:27:26 -07:00
Kelsi
bc18fb7c3e feat: leader crown and LFG role indicators in party/raid frames
- Party frames: gold star prefix and gold name color for group leader;
  LFG role badges [T]/[H]/[D] shown inline after member name
- Raid frames: leader name rendered in gold with a corner star marker;
  role letter (T/H/D) drawn in bottom-right corner of each compact cell;
  uses partyData.leaderGuid already present in the function scope
- Minimap party dots already use gold for leader (unchanged)
2026-03-10 21:24:40 -07:00
Kelsi
4a445081d8 feat: latency indicator, BG queue status, and ToT improvements
- Add latency indicator below minimap (color-coded: green/yellow/orange/red)
  using the lastLatency value measured via CMSG_PING/SMSG_PONG
- Add BG queue status indicator below minimap when in WAIT_QUEUE
  (abbreviated name: AV/WSG/AB/EotS etc.)
- Target-of-Target frame: add level display and click-to-target support
- Expose getLatencyMs() accessor on GameHandler
2026-03-10 21:19:42 -07:00
Kelsi
8ab83987f1 feat: focus target frame with health/power bars and cast bar
Add a compact focus target frame on the right side of the screen
when the player has a focus target set via /focus.

- Shows [Focus] label, name (colored by hostility/level diff), level
- HP bar with green→yellow→red coloring; power bar with type colors
- Cast bar showing spell name and remaining time when focus is casting
- Clicking the frame targets the focus entity
- Clears automatically when focus is lost (/clearfocus)
2026-03-10 21:15:24 -07:00
Kelsi
a7a559cdcc feat: battleground invitation popup with countdown timer
Replace the text-only "/join to enter" message with an interactive
popup that shows the BG name, a live countdown progress bar, and
Enter/Leave Queue buttons.

- Parse STATUS_WAIT_JOIN timeout from SMSG_BATTLEFIELD_STATUS
- Store inviteReceivedTime (steady_clock) on the queue slot
- BgQueueSlot moved to public section so UI can read invite details
- Add declineBattlefield() that sends CMSG_BATTLEFIELD_PORT(action=0)
- acceptBattlefield() optimistically sets statusId=3 to dismiss popup
- renderBgInvitePopup: colored countdown bar (green→yellow→red),
  named BG (Alterac Valley, Warsong Gulch, etc.), auto-dismisses on expiry
2026-03-10 21:12:28 -07:00
Kelsi
4986308581 feat: rich item tooltips in vendor and loot-roll windows
- Vendor window: replace manual stat-only tooltip with full renderItemTooltip
  (now shows bind type, slot, weapon stats, armor, extra stats, spell effects,
  flavor text, and sell price — consistent with inventory)
- Loot-roll popup: add item icon and hover tooltip via renderItemTooltip
- Loot-roll: pre-fetch item info via queryItemInfo when roll prompt appears
2026-03-10 20:59:02 -07:00
Kelsi
6275a45ec0 feat: achievement name in toast, parse earned achievements, loot item tooltips
- Parse SMSG_ALL_ACHIEVEMENT_DATA on login to populate earnedAchievements_ set
- Pass achievement name through callback so toast shows name instead of ID
- Add renderItemTooltip(ItemQueryResponseData) overload for loot/non-inventory contexts
- Loot window now shows full item tooltip on hover (stats, sell price, bind type, etc.)
2026-03-10 20:53:21 -07:00
Kelsi
984decd664 fix: pre-fetch quest reward item info when quest details packet arrives
When SMSG_QUESTGIVER_QUEST_DETAILS is received (quest accept dialog),
immediately query item info for all rewardChoiceItems and rewardItems.
This ensures item names and icons are cached before the offer-reward
dialog opens on turn-in, eliminating the "Item {id}" placeholder that
appeared when the dialog opened before item queries completed.
2026-03-10 20:39:49 -07:00
Kelsi
b87b6cee0f fix: add ParentAreaNum/MapID to AreaTable DBC layout for world map exploration
AreaTable["ParentAreaNum"] was missing from all expansion DBC layouts,
causing getUInt32(i, 0xFFFFFFFF) to return 0 for every area's parent.
This made childBitsByParent keyed by 0 instead of the actual parent area
IDs, so sub-zone explore bits were never associated with their parent zones
on the world map.

Result: newly explored sub-zones (e.g. Stormwind Keep) would not reveal
their parent continent zones (Stormwind City) because the zone's exploreBits
only included the direct zone bit, not sub-zone bits.

Fix: add "MapID": 1, "ParentAreaNum": 2 to all expansion AreaTable layouts.
2026-03-10 20:35:42 -07:00
Kelsi
2b9f216dae fix: rest state detection and minimap north-up orientation
- WotLK opcode 0x21E is aliased to both SMSG_SET_REST_START and
  SMSG_QUEST_FORCE_REMOVE. In WotLK, treat as SET_REST_START (non-zero
  = entering rest area, zero = leaving); Classic/TBC treat as quest removal.
- PLAYER_BYTES_2 rest state byte: change from `& 0x01` to `!= 0` to also
  detect REST_TYPE_IN_CITY (value 2), not just REST_TYPE_IN_TAVERN (1).
- Minimap arrow: server orientation (π/2=North) needed conversion to
  minimap arrow space (0=North). Subtract π/2 in both render paths so
  arrow points North when player faces North.
2026-03-10 20:29:55 -07:00
Kelsi
28550dbc99 fix: reduce GO fallback hit radius to prevent invisible chair click-lock
Fallback sphere for GameObjects without a loaded renderer instance was 2.5f,
causing invisible/unloaded chairs in Goldshire Inn to be accidentally targeted
during camera right-drag. This sent CMSG_GAMEOBJ_USE which set server stand
state to SIT, trapping the player until a stand-up packet was sent.

Reduce fallback radius to 1.2f and height offset to 1.0f so only deliberate
close-range direct clicks register on unloaded GO geometry.
2026-03-10 19:59:23 -07:00
Kelsi
564a286282 fix: stand-up-on-move and nameplate position tracking
Camera controller / sitting:
- Any movement key (WASD/QE/Space) pressed while sitting now clears the
  sitting flag immediately, matching WoW's sit-to-stand-on-move behaviour
- Added StandUpCallback: when the player stands up via local input the
  callback fires setStandState(0) → CMSG_STAND_STATE_CHANGE(STAND) so
  the server releases the sit lock and restores normal movement
- Fixes character getting stuck in sit state after accidentally
  right-clicking a chair GO in Goldshire Inn (or similar)

Nameplates:
- Use getRenderPositionForGuid() (renderer visual position) as primary
  source for nameplate anchor, falling back to entity X/Y/Z only when
  no render instance exists yet; keeps health bars in sync with the
  rendered model instead of the parallel entity interpolator
2026-03-10 19:49:33 -07:00
Kelsi
48d15fc653 fix: quest markers, level-up effect, and emote loop
- renderer: construct QuestMarkerRenderer via make_unique (was never
  instantiated, causing getQuestMarkerRenderer() to always return null
  and all quest-marker updates to be silently skipped)
- m2_renderer: add "levelup" to effectByName so LevelUp.m2 is treated
  as a spell effect (additive blend, no collision, particle-dominated)
- renderer: auto-cancel non-looping emote animations when they reach
  end-of-sequence, transitioning player back to IDLE state
2026-03-10 19:41:01 -07:00
Kelsi
34bab8edd6 feat: use rich spell tooltip for buff/debuff frame icons
Some checks are pending
Build / Build (arm64) (push) Waiting to run
Build / Build (x86-64) (push) Waiting to run
Build / Build (macOS arm64) (push) Waiting to run
Build / Build (windows-arm64) (push) Waiting to run
Build / Build (windows-x86-64) (push) Waiting to run
Security / CodeQL (C/C++) (push) Waiting to run
Security / Semgrep (push) Waiting to run
Security / Sanitizer Build (ASan/UBSan) (push) Waiting to run
Player buff bar and target debuff bar icons now show full spell tooltip
(school, cost, cast time, range, description) on hover, matching the
action bar and spellbook. Falls back to plain spell name if DBC is not
loaded. Remaining aura duration is shown below the spell body.
2026-03-10 19:33:25 -07:00
Kelsi
caf0d18393 feat: show rich spell tooltip on action bar hover
Expose SpellbookScreen::renderSpellInfoTooltip() as a public method,
then use it in the action bar slot tooltip. Action bar spell tooltips
now show the same full tooltip as the spellbook: spell school (colored),
mana/rage/energy cost, cast time, range, cooldown, and description.

Falls back to a plain spell name if DBC data is not yet loaded.
Hearthstone location note is appended after the rich body.
Cooldown text moved inside each branch for consistent styling.
2026-03-10 19:31:46 -07:00
Kelsi
7bbf2c7769 refactor: improve quest offer reward item display
- Use getQualityColor() for consistent quality coloring (choice+fixed)
- Show item icons for fixed rewards (previously text-only)
- Replace useless "Reward option" tooltip with real item name+description
- Render icon before selectable label (not after) for choice rewards
- Call ensureItemInfo for all reward items to trigger async fetch
- Use structured bindings (C++17) to unify icon+color resolution
2026-03-10 19:25:26 -07:00
Kelsi
bae3477c94 feat: display spell school in spellbook tooltip
Load SchoolMask (TBC/WotLK bitmask) or SchoolEnum (Classic/Turtle 0-6
enum, converted to mask via 1<<N) from Spell.dbc into SpellInfo.

renderSpellTooltip now shows the spell school name (Holy/Fire/Nature/
Frost/Shadow/Arcane) in the appropriate school color between the spell
rank and resource cost. Physical school is suppressed as it is the
implied default. Multi-school spells display both names separated by /.

WotLK DBC fallback path uses field 225 for SchoolMask.
2026-03-10 19:22:48 -07:00
Kelsi
458a95ae8e refactor: use quality colors and hover tooltips for quest reward items
Replace flat white coloring with item quality colors and add hover tooltips
showing item name (quality-colored) and description for quest acceptance window.
Extract renderQuestRewardItem lambda to eliminate code duplication between
choice and fixed reward item rendering.
2026-03-10 19:12:43 -07:00
Kelsi
1ff48259cc feat: display quest reward items in quest details acceptance window
Parse and store reward items (choice and fixed) from SMSG_QUESTGIVER_QUEST_DETAILS
in both WotLK (QuestDetailsParser) and TBC/Classic (TbcPacketParsers) parsers.
Show item icons, names, and counts in the quest acceptance dialog alongside XP/money.
Move QuestRewardItem before QuestDetailsData in header to fix forward-reference.
2026-03-10 19:05:34 -07:00
Kelsi
9f8a0907c4 feat: add spell stats to TBC and Turtle WoW DBC layouts
TBC 2.4.3: TBC added 7 fields after position 5 vs Classic 1.12, giving
a consistent +7 offset for all fields in the middle/upper range. Derive
CastingTimeIndex (22), PowerType (35), ManaCost (36), and RangeIndex (40)
from the verified Classic positions (15/28/29/33) using this offset.
This enables mana cost, cast time, and range display in the TBC spellbook.

Turtle WoW: Inherits Classic 1.12.1 Spell.dbc field layout. Add
CastingTimeIndex (15), PowerType (28), ManaCost (29), RangeIndex (33),
and SpellRange.MaxRange (2) matching Classic 1.12. Enables spell stat
display for Turtle WoW players.

Also update README: pet action bar (10 slots, icons, autocast tinting).
2026-03-10 18:55:01 -07:00
Kelsi
373dbbf95d fix: use authoritative autocast state for pet action bar and correct tooltip labels
- Use isPetSpellAutocast() instead of parsing the slot value high byte for
  autocast detection; the authoritative source is the SMSG_PET_SPELLS spell
  list activeFlags, not the action bar slot value.
- Fix tooltip mapping: actionId==2 maps to "Follow", actionId==5 to "Attack",
  others to "Stay" (removed erroneous duplicate Follow case for actionId==4).
- Update spellbook comment: TBC Spell.dbc has ~220+ fields (not ~167).
2026-03-10 18:37:05 -07:00
Kelsi
2e38a9af65 feat: add pet action bar to pet frame UI
Show the 10 SMSG_PET_SPELLS action slots as clickable icon/text buttons
in the pet frame. Spell slots with icons render as ImageButtons; built-in
commands (Attack/Follow/Stay) render as text buttons. Autocast-on slots
are tinted green. Clicking a spell slot sends CMSG_PET_ACTION with the
current target GUID; built-in commands send without a target. Tooltips
show the spell name on hover.
2026-03-10 18:26:02 -07:00
Kelsi
53d144c51e fix: expansion-aware SpellRange.dbc loading and Classic spell tooltip fields
SpellRange.dbc layout fix:
- Classic 1.12 uses field 2 (MaxRange), TBC/WotLK use field 4 (MaxRangeHostile)
- Add SpellRange layout to each expansion's dbc_layouts.json
- Replace hardcoded field 5 with layout-driven lookup in SpellRange loading
- Corrects previously wrong range values in WotLK spellbook tooltips

Classic 1.12 Spell.dbc field additions:
- Add CastingTimeIndex=15, PowerType=28, ManaCost=29, RangeIndex=33 to
  classic/dbc_layouts.json so Classic spellbook shows mana cost, cast time,
  and range in tooltips

Trainer fieldCount guard:
- Lower Trainer::loadSpellNameCache() Spell.dbc fieldCount threshold from
  154 to 148 so Classic trainers correctly resolve spell names from Spell.dbc
2026-03-10 18:09:21 -07:00
Kelsi
2f3f9f1a21 fix: enable Classic/Turtle Spell.dbc loading and add WotLK optional spell fields to layout
Lower fieldCount threshold from 154→148 so Classic 1.12 and Turtle WoW Spell.dbc
(148 fields, Tooltip at index 147) are accepted by the spellbook loader instead of
being silently skipped.

Add PowerType/ManaCost/CastingTimeIndex/RangeIndex to the WotLK dbc_layouts.json
Spell section so mana cost, cast time, and range continue to display correctly when
the DBC layout path is active (the old hardcoded-index fallback path is now bypassed
since layout-path loads spell names first and spellData.empty() is no longer true).
2026-03-10 17:53:17 -07:00
Kelsi
fcb133dbbe fix: guard optional DBC field reads against out-of-bounds indices for Classic/TBC
When expansion DBC layouts lack PowerType/ManaCost/CastingTimeIndex/RangeIndex,
default to UINT32_MAX instead of WotLK hardcoded indices to prevent reading wrong
data from Classic/TBC Spell.dbc files. tryLoad now skips any field index >= fieldCount.
2026-03-10 17:41:05 -07:00