Commit graph

20 commits

Author SHA1 Message Date
Kelsi
e9ce062112 fix: restore correct CharSections.dbc field indices for character textures
PR #19 (572bb4ef) swapped CharSections.dbc field indices, placing
Texture1-3 at fields 4-6 and VariationIndex/ColorIndex at 8-9. Binary
analysis of the actual DBC files (Classic, TBC, Turtle — all identical
layout, no WotLK-specific override) confirms the correct order is:

  Field 4 = VariationIndex
  Field 5 = ColorIndex
  Field 6 = Texture1 (string)
  Field 7 = Texture2 (string)
  Field 8 = Texture3 (string)
  Field 9 = Flags

With the wrong indices, VariationIndex/ColorIndex reads returned string
offsets (garbage values that never matched), so all CharSections lookups
failed silently — producing white untextured character models at the
login screen and in-world.

Fixes all 4 expansion JSON layouts, hardcoded fallbacks in
character_preview.cpp, application.cpp, and character_create_screen.cpp.
Also handles the single-layer edge case (body skin only, no face/underwear)
by loading the texture directly instead of skipping compositing.
2026-03-22 15:22:25 -07:00
Paul
572bb4ef36 fix preview white textutes 2026-03-22 21:38:56 +03:00
Kelsi
279b4de09a feat: color cast bars green/red by spell interruptibility from Spell.dbc
Load AttributesEx from Spell.dbc for all expansions (Classic/TBC/WotLK/
Turtle). Check SPELL_ATTR_EX_NOT_INTERRUPTIBLE (bit 4 = 0x10) to classify
each cast as interruptible or not when SMSG_SPELL_START arrives.

Target frame and nameplate cast bars now use:
- Green: spell can be interrupted by Kick/Counterspell/Pummel etc.
- Red: spell is immune to interrupt (boss abilities, instant-cast effects)
Both colors pulse faster at >80% completion to signal the closing window.

Adds GameHandler::isSpellInterruptible() and UnitCastState::interruptible.
2026-03-17 19:43:19 -07:00
Kelsi
315adfbe93 feat: implement SMSG_PLAY_SPELL_VISUAL with SpellVisual DBC chain lookup
Parse SMSG_PLAY_SPELL_VISUAL (casterGuid + visualId) and spawn a
transient M2 spell effect at the caster's world position.

DBC chain: SpellVisual.dbc → SpellVisualKit.dbc → SpellVisualEffectName.dbc
Lookup priority: CastKit.SpecialEffect0, fallback to MissileModel.
Models are lazy-loaded and cached by path; instances auto-expire after 3.5s.
DBC layouts added to all four expansion layout files (Classic/TBC/WotLK/Turtle).
2026-03-17 18:23:05 -07:00
Kelsi
81b95b4af7 feat: resolve title names from CharTitles.dbc in SMSG_TITLE_EARNED
Previously SMSG_TITLE_EARNED only showed the numeric bit index.
Now it lazy-loads CharTitles.dbc and formats the full title string
with the player's name (e.g. "Title earned: Commander Kelsi!").

- Add CharTitles layout to WotLK (TitleBit=36) and TBC (TitleBit=20) layouts
- loadTitleNameCache() maps each titleBit to its English title string
- SMSG_TITLE_EARNED substitutes %s placeholder with local player's name
- Falls back to "Title earned (bit N)!" if DBC is unavailable
2026-03-12 19:05:54 -07:00
Kelsi
48f12d9ca8 feat: parse item set ID and display set name in item tooltip via ItemSet.dbc 2026-03-12 12:35:56 -07:00
Kelsi
d48e4fb7c3 feat: resolve enchant names from SpellItemEnchantment.dbc in inspect window 2026-03-12 12:32:19 -07:00
Kelsi
d817e4144c feat: debuff dispel-type border coloring in buff bar
Read DispelType from Spell.dbc (new field in all expansion DBC layouts)
and use it to color debuff icon borders: magic=blue, curse=purple,
disease=brown, poison=green, other=red. Buffs remain green-bordered.
Adds getSpellDispelType() to GameHandler for lazy cache lookup.
2026-03-12 06:55:16 -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
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
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
d4ea416dd6 Fix spell cast audio to use correct magic school from Spell.dbc
Previously all player spell casts played ARCANE school sounds regardless
of the actual spell school. Now loadSpellNameCache() reads SchoolMask
(bitmask, TBC/WotLK) or SchoolEnum (Vanilla/Classic) from Spell.dbc and
stores it in SpellNameEntry. handleSpellStart/handleSpellGo look up the
spell's school and select the correct MagicSchool for cast sounds.

DBC field indices: WotLK SchoolMask=225 (verified), TBC=215, Classic/Turtle
SchoolEnum=1 (Vanilla enum 0-6 converted to bitmask).
2026-03-09 19:24:09 -07:00
Kelsi
b8f1f15eb4 Fix CharSections.dbc field layout for classic/tbc/turtle expansions
The binary DBC files for all expansions use the same field ordering
(VariationIndex=4, ColorIndex=5, Texture1=6), but classic/tbc/turtle
dbc_layouts.json had swapped texture and variation/color fields, causing
all skin/face/hair/underwear lookups to fail. Also adds generalized
NxN texture scaling and a second video to README.
2026-02-17 03:18:01 -08:00
Kelsi
0ef4af9c99 Fix CharSections DBC layout and Warden SHA1 hash computation
CharSections fields were mapped incorrectly (Variation/Color at 4-5,
textures at 6-8) — corrected to textures at 4-6, Flags at 7,
Variation at 8, Color at 9. Fixed in both dbc_layout.cpp and all
expansion JSON configs. Also fix Warden HASH_REQUEST to SHA1 over
seed+moduleImage instead of just seed.
2026-02-14 18:35:08 -08:00
Kelsi
8282583b9a Fix equipment textures: correct DBC field indices and stop texture cycling
Binary ItemDisplayInfo.dbc has 23 fields with texture components at
14-21, not 15-22. The previous "fix" shifted all fields by +1 which
read wrong columns and broke both player and NPC equipment rendering.

Also fix local player texture cycling: rebuildOnlineInventory() was
called on every item query response (including for other players),
unconditionally setting onlineEquipDirty_ which triggered redundant
texture recompositing. Now tracks previous equipment displayInfoIds
and only sets dirty when they actually change.

Unified all 3 equipment texture code paths (local player, other
players, NPCs) to use the DBC layout system with correct field 14
base index.
2026-02-14 16:33:24 -08:00
Kelsi
148f63cffe Fix off-by-one in ItemDisplayInfo texture component fields
Texture regions are at DBC fields 15-22, not 14-21. Field 14 is
HelmetGeosetVis[1] (uint32), and getString() on it returned random
strings from the DBC string block, causing garbled textures on
players and missing leg textures on other characters.
2026-02-14 15:54:23 -08:00
Kelsi
3675721016 Improve equipment texture performance and accuracy
Cache composite textures by input key so identical NPC equipment
combos share one GPU texture. Use DBC layout system for
ItemDisplayInfo texture component fields instead of hardcoded
indices (cross-expansion support). Selective player equipment
re-emission on item query response instead of broadcasting to
all players.
2026-02-14 15:48:58 -08:00
Kelsi
58d8b88721 Fix inspect spam and emote text lookup for other players
Two bugs fixed:
1. SMSG_INSPECT_RESULTS (0x115) was falling through to the inspect
   handler, but this opcode is not the real inspect response. Removed
   the case so only SMSG_INSPECT_TALENT (0x3F4) triggers the handler.
2. EmotesText DBC layout was missing "ID" field in all 4 expansion
   JSON files, causing operator[] to return 0xFFFFFFFF instead of 0.
   This broke the dbcId reverse lookup, so other players' emotes
   always fell back to generic "performs an emote" text. Added ID
   and OthersTargetTextID/OthersNoTargetTextID to all layouts.
2026-02-14 15:23:32 -08:00
Kelsi
886f4daf2e Add per-expansion asset overlay system and fix CharSections DBC layout
Expansion overlays allow each expansion to supplement the base asset data
via an assetManifest field in expansion.json, loaded at priority 50 (below
HD packs). The asset extractor gains --reference-manifest for delta-only
extraction. Also fixes CharSections field indices (VariationIndex=4,
ColorIndex=5, Texture1=6) across all DBC layout references.
2026-02-14 00:00:26 -08:00
Kelsi
7092844b5e Add multi-expansion support with data-driven protocol layer
Replace hardcoded WotLK protocol constants with a data-driven architecture
supporting Classic 1.12.1, TBC 2.4.3, and WotLK 3.3.5a. Each expansion
has JSON profiles for opcodes, update fields, and DBC layouts, plus C++
polymorphic packet parsers for binary format differences (movement flags,
speed fields, transport data, spline format, char enum layout).

Key components:
- ExpansionRegistry: scans Data/expansions/*/expansion.json at startup
- OpcodeTable: logical enum <-> wire values loaded from JSON
- UpdateFieldTable: field indices loaded from JSON per expansion
- DBCLayout: schema-driven DBC field lookups replacing magic numbers
- PacketParsers: WotLK/TBC/Classic parsers with correct flag positions
- Multi-manifest AssetManager: layered manifests with priority ordering
- HDPackManager: overlay texture packs with expansion compatibility
- Auth screen expansion picker replacing hardcoded version dropdown
2026-02-12 22:56:36 -08:00