145 Commits

Author SHA1 Message Date
Kelsi
403216ac2f Fix classic combat desync and separate attack intent from confirmed combat
Combat state/UI:

- Split attack intent from server-confirmed auto attack in GameHandler.

- Add explicit combat state helpers (intent, confirmed, combat-with-target).

- Update player/target frame and renderer in-combat indicators to use confirmed combat.

- Add intent-only visual state in UI to avoid false combat feedback.

Animation correctness:

- Correct combat-ready animation IDs to canonical ready stances (22/23/24/25).

- Remove hit/wound-like stance behavior caused by incorrect ready IDs.

Classic/TBC/Turtle melee reliability:

- Tighten melee sync while attack intent is active: faster swing resend, tighter facing threshold, and faster facing cadence for classic-like expansions.

- Send immediate movement heartbeat after facing corrections and during stationary melee sync windows.

- Handle melee error opcodes explicitly (NOTINRANGE/BADFACING/NOTSTANDING/CANT_ATTACK) and immediately resync facing/swing where appropriate.

- On ATTACKSTOP with persistent intent, immediately reassert ATTACKSWING.

- Increase movement heartbeat cadence during active classic-like melee intent.

Server compatibility/anti-cheat stability:

- Restrict legacy force-movement/speed/teleport ACK behavior for classic-like flows to avoid unsolicited order acknowledgements.

- Preserve local movement state updates while preventing bad-order ACK noise.
2026-02-20 03:38:12 -08:00
Kelsi
0eef8fda15 Combat fix: restore reliable melee hits via movement/state sync
Resolved a melee desync where attacks could fail unless constantly moving through target.

Movement opcode handling:

- In 0x006B compatibility path, prefer compressed-move batch detection before weather alias routing.

- Route 0x006B payloads shaped like SMSG_COMPRESSED_MOVES sub-packets to handleCompressedMoves().

Root/unroot state synchronization:

- Added handling for SMSG_FORCE_MOVE_ROOT and SMSG_FORCE_MOVE_UNROOT.

- Added handleForceMoveRootState() to apply server-authoritative ROOT flag locally.

- Send CMSG_FORCE_MOVE_ROOT_ACK / CMSG_FORCE_MOVE_UNROOT_ACK with current movement payload and counter.

Melee facing stability:

- Added periodic facing sync during auto-attack (MSG_MOVE_SET_FACING) when angular drift to target exceeds threshold.

- Keeps server front-arc/facing checks aligned while stationary meleeing.

Noise reduction / stream hygiene:

- Consume optional legacy/system packets safely: SMSG_FRIEND_LIST, SMSG_IGNORE_LIST, SMSG_ADDON_INFO, SMSG_EXPECTED_SPAM_RECORDS.

Validation:

- Rebuilt successfully with cmake --build build -j32.
2026-02-20 03:14:48 -08:00
Kelsi
32ca09ab30 Opcode tables: sync Classic/WotLK to canonical headers and expand logical mapping coverage
Classic: synchronized Data/expansions/classic/opcodes.json to /home/k/Desktop/classicopcodes.h with exact symbol/value parity (0 missing, 0 mismatches).

WotLK: synchronized Data/expansions/wotlk/opcodes.json to /home/k/Desktop/azerothcoreOpcodes.h and aligned symbol names to AzerothCore naming.

Logical opcode layer: expanded include/game/opcode_table.hpp and src/game/opcode_table.cpp to include missing canonical opcode symbols required by synced tables, and removed legacy alias fallback block so canonical names are used directly.

Gameplay/handler updates included from ongoing fixes: duel/taxi stale opcode cleanup, level-up/sound handling adjustments, and related parser/packet references updated to match canonical opcode identifiers.

Validated by successful full build: cmake --build build -j32.
2026-02-20 02:50:59 -08:00
Kelsi
82d104b9ec Fix movement/warden packet noise and party kill opcode mapping 2026-02-20 02:19:17 -08:00
Kelsi
cd0fda2e28 Handle SMSG_NOTIFICATION (0x1CB) for vanilla/Turtle WoW welcome messages 2026-02-20 00:28:51 -08:00
Kelsi
2a019bf337 Add bag bar drag-to-reorder, fix three wrong WotLK opcodes
Bag bar: left-click drag bags to swap positions using CMSG_SWAP_ITEM
with INVENTORY_SLOT_BAG_0 (255). Local optimistic swap for instant
feedback. Camera controller now respects ImGui WantCaptureMouse.
Vendor auto-open bags only triggers once per session.

Fix opcodes: CMSG_GAMEOBJECT_USE 0x01B→0x0B1 (typo caused
SMSG_FORCEACTIONSHOW spam), CMSG_CANCEL_AURA 0x033→0x136,
SMSG_SELL_ITEM 0x1A4→0x1A1.
2026-02-19 22:34:22 -08:00
Kelsi
c71d774005 Add Warrior Charge ability with ribbon trail visual effect
Implements charge rush-to-target for spell IDs 100/6178/11578 with
smoothstep lerp movement, vertical red-orange ribbon trail, dust puffs,
client-side range validation, and sound fallback chain.
2026-02-19 21:13:13 -08:00
Kelsi
5125c241c4 Add 3D level-up effect using LevelUp.m2 spell model
Replace 2D screen-space ding rings with real WoW LevelUp.m2 particle/geometry
effect. Fix FBlock particle color parsing (C3Vector floats, not CImVector bytes)
which was producing blue/red instead of golden yellow. Spell effect models bypass
particle dampeners, glow sprite conversion, Mod→Additive blend override, and all
collision (floor/wall/camera) to prevent camera zoom-in. Other players' level-ups
trigger the 3D effect at their position with group chat notification. F7 hotkey
for testing.
2026-02-19 20:36:25 -08:00
Kelsi
96c680e4f2 Fix armor stat in character stats panel via UNIT_FIELD_RESISTANCES
The character stats panel was showing Armor: 0 because summing armor
from item query responses is fragile (depends on correct BuyCount/damage
block parsing). Instead, read the server-authoritative total armor
directly from UNIT_FIELD_RESISTANCES (physical resistance, index 0)
in the player entity update fields.

Added UNIT_FIELD_RESISTANCES to the UF enum and all four expansion
JSON files with correct wire indices:
  WotLK 3.3.5a: 99   (NPC_FLAGS=82 + emotestate + stat×5 + posstat×5 + negstat×5)
  TBC 2.4.3:   185   (NPC_FLAGS=168 + same relative layout)
  Classic 1.12: 154  (NPC_FLAGS=147 + emotestate + stat×5, no posstat/negstat)
  Turtle WoW:  154   (same as Classic)

Stats panel uses server armor when > 0, falls back to summed item-query
armor otherwise. Armor rating resets to 0 on world entry and is updated
from both CREATE_OBJECT and VALUES update blocks.
2026-02-19 17:45:09 -08:00
Kelsi
5d84679b56 Smooth other-player movement with velocity dead reckoning
Previously other players jittered because the entity sat frozen at its
destination between movement packets, then snapped to the new start
position on the next packet (stop-pop-stop-pop at ~10 Hz).

Entity interpolation now tracks a smoothed velocity and dead-reckons
past the end of each packet window, so the entity keeps gliding at the
estimated speed until the next server update arrives. Movement stops
only after two consecutive intervals with no new packet (entity has
genuinely stopped).

Also replaced the raw packet-delta duration with an exponential moving
average (EMA) per player. A single slow or fast packet no longer spikes
the playback speed; the EMA converges on the actual send rate (~100 ms)
and absorbs jitter without adding a fixed input-latency penalty.
2026-02-19 16:45:39 -08:00
Kelsi
c2f55ceca6 Fix item destroy packet format and wire destroy confirmation UI 2026-02-19 06:34:06 -08:00
Kelsi
854ac57f37 Stabilize buyback flow and single-row buyback UI
- keep vendor buyback as one-item LIFO row in vendor window

- add robust pending buyback tracking with wire slot probing (74..85)

- recover from stale optimistic sell/buyback entries and refresh vendor list

- keep buy packet construction branch-compatible (direct packet build)
2026-02-19 05:48:40 -08:00
Kelsi
2958006d88 Fix buyback request flow and prune temporary diagnostics
- implement vendor buyback state in GameHandler (buyback item list + pending sell tracking)

- send CMSG_BUYBACK_ITEM with WotLK/AzerothCore absolute buyback slot (74 + ui index)

- consume 0x46A/0x480 vendor side-channel packets safely without relying on token slot mapping

- keep sell/buy failure handling synced with buyback list and chat errors

- remove temporary packet hex/trace logging used during buyback debugging
2026-02-19 05:28:13 -08:00
Kelsi
1a1a2096aa Clean README mentions and finalize current gameplay/UI fixes 2026-02-19 03:31:49 -08:00
Kelsi
2856070957 Handle SMSG_QUESTGIVER_QUEST_LIST (0x185) for questgiver flows 2026-02-19 02:53:44 -08:00
Kelsi
ebc61e2bb3 Fix quest turn-in flow and WoW quest text placeholders 2026-02-19 01:12:14 -08:00
Kelsi
d18cbc37ca Remove temporary quest query diagnostics 2026-02-19 00:59:46 -08:00
Kelsi
10a694a72f Stabilize quest log details loading and turn-in item sync 2026-02-19 00:56:24 -08:00
Kelsi
bb2ecb8150 Fix quest log titles and full-row selection behavior 2026-02-19 00:30:21 -08:00
Kelsi
46e2c711c8 Tie opcode handlers into movement, quest log, and world state caches 2026-02-18 23:30:38 -08:00
Kelsi
91dc18276f Make chest looting robust with unconditional GO loot + timed retry 2026-02-18 04:13:26 -08:00
Kelsi
6dc111f13f Fix loot money notifications fallback and chest loot trigger 2026-02-18 04:11:00 -08:00
Kelsi
56c309b27d Fix quest item loot parsing and quest item progress tracking
- add SMSG_QUESTUPDATE_ADD_ITEM logical opcode mapping (0x197)
- handle quest item progress updates in GameHandler
- parse quest-item section in SMSG_LOOT_RESPONSE (regular + quest items)
- add quest item progress storage in quest log entries
- show tracked kill/item progress in Quest Log UI
2026-02-18 04:06:14 -08:00
Kelsi
73e7c86621 Update opcode data and movement integration docs/code 2026-02-18 03:18:22 -08:00
Kelsi
7fd999a3b8 Implement SMSG_WEATHER and wire real game state (map ID, weather, underwater) to lighting system 2026-02-17 17:59:41 -08:00
Kelsi
6ab8ea9ae5 Add level-up ding animation with cheer emote and test button
- Trigger ding when UNIT_FIELD_LEVEL increases for player: plays LevelUp sound,
  cheer emote animation, and shows screen overlay
- renderDingEffect(): 3 expanding golden rings + "LEVEL X!" / "DING!" text
  drawn via ImDrawList foreground (3s duration, fades out last 0.8s)
- triggerDing() wires sound (UiSoundManager::playLevelUp) + emote + overlay
- LevelUpCallback in GameHandler fires on genuine level increase (newLevel > oldLevel)
- "Test: Level Up" button in escape menu triggers ding at current player level
2026-02-17 17:23:42 -08:00
Kelsi
d87cba20cb Add auto loot setting to gameplay settings
Checkbox in Settings > Gameplay > Loot section. When enabled, all items
are automatically sent CMSG_AUTOSTORE_LOOT_ITEM on loot response (same
as right-click looting each item). Gold always auto-loots regardless.
Setting persists in settings.cfg as auto_loot=0/1.
2026-02-17 16:31:00 -08:00
Kelsi
e77d0a3827 Fix auto-attack stalling after SMSG_ATTACKSTOP and remove stale comments
Re-send CMSG_ATTACKSWING every second while auto-attacking so combat
resumes automatically when the server pauses the attack loop (out of
range, etc). Previously the client kept autoAttacking=true but never
re-engaged, requiring the player to manually right-click again.

Also remove leftover single-player/offline references from comments.
2026-02-17 15:37:02 -08:00
Kelsi
be424919e4 Fix WAV decode cache and spell lookup performance
- audio_engine.cpp: cache key was based on vector pointer address, not
  content — cache never hit since each asset load produces a new
  allocation. Replace with FNV-1a over head+tail bytes + size, giving
  correct content-based identity at O(1) cost. Add 256-entry cap with
  eviction to prevent unbounded growth over long sessions.

- game_handler.hpp/cpp, spellbook_screen, game_screen: knownSpells was
  a std::vector with O(n) std::find lookups scattered across packet
  handlers and UI code. Switch to std::unordered_set for O(1) insert,
  erase, and membership checks. Update all push_back/erase-remove/find
  call sites to use set operations.
2026-02-17 15:13:54 -08:00
Kelsi
7952d73740 Handle SMSG_CHARACTER_LOGIN_FAILED (0x041) for AzerothCore/Playerbot compatibility
Previously this opcode was unrecognised and silently dropped, leaving the
client stuck in ENTERING_WORLD with no feedback when the server rejected a
login (duplicate session, world down, disabled race/class, etc.). Now we
decode the LoginFailureReason byte, reset state to CHAR_LIST_RECEIVED so
the player can retry, and surface a red error message on the character screen
via the new CharLoginFailCallback. Also adds isError colour support to
CharacterScreen::setStatus so failures show in red and successes in green.
2026-02-17 13:59:29 -08:00
Kelsi
5ea41df8b5 Fix NPC textures, bag item interactions, and Classic item query parsing
Rebuild creature display lookups after expansion-specific DBC layout loads
(was using WotLK defaults before turtle layout was available). Add full
drag-and-drop support for bag items with server-side CMSG_SWAP_ITEM packets.
Add Classic-specific SMSG_ITEM_QUERY_SINGLE_RESPONSE parser for Vanilla
format differences (fewer damage types, no scaling stats, no Flags2).
2026-02-17 01:00:04 -08:00
Kelsi
97ea390969 Suppress login bind point message and auto-join Local channel
Only show "Your home has been set" when the player actively changes their
bind point (via innkeeper), not on the initial login sync from the server.
Add "Local" to the auto-join channel list for Turtle WoW compatibility,
with a settings checkbox and persistence.
2026-02-16 21:16:25 -08:00
Kelsi
1d1bc36ebf Implement bank, guild bank, and auction house systems
Add 27 new opcodes, packet builders/parsers, handler methods, inventory
extension with 28 bank slots + 7 bank bags, and UI windows for personal
bank, guild bank (6 tabs x 98 slots), and auction house (browse/sell/bid).
Fix Classic gossip parser to omit boxMoney/boxText fields not present in
Vanilla protocol, fix gossip icon labels with text-based NPC type detection,
and add Turtle WoW opcode mappings for bank and auction interactions.
2026-02-16 21:11:18 -08:00
Kelsi
2ece1bf1cf Add guild features, fix channel joining, and improve whisper reply
Guild: add disband, leader transfer, public/officer note commands with
roster context menu showing rank names and officer notes column. Auto-refresh
roster after guild events.

Channels: fix city/region channels not working by accepting SMSG_CHANNEL_NOTIFY
during ENTERING_WORLD state (server auto-joins before VERIFY_WORLD) and handling
PLAYER_ALREADY_MEMBER notification.

Whisper: /r now switches to whisper tab and sets target to last sender,
matching WoW behavior.

Camera: extend WMO collision raycasting to work outside WMOs too.
2026-02-16 20:16:14 -08:00
Kelsi
e13e1064d4 Implement mailbox interaction and expansion-aware mail system
Fix mailbox right-click (transposed CMSG_GAMEOBJECT_USE opcode, missing
mail opcodes in Turtle WoW JSON, decorative GO type filtering). Add
expansion-aware mail packet handling via PacketParsers: Classic format
(single item, no msgSize prefix, Vanilla field order) vs WotLK format
(attachment arrays, enchant slots). Fix CMSG_MAIL_TAKE_ITEM and
CMSG_MAIL_DELETE for Vanilla (no trailing fields). Add pulsing "New
Mail" indicator below minimap, SMSG_RECEIVED_MAIL and
MSG_QUERY_NEXT_MAIL_TIME handlers, and async sender name backfill.
2026-02-16 18:46:44 -08:00
Kelsi
27d6150ecb Add mailbox system and fix logging performance stutter
Implement full mail send/receive: SMSG_SHOW_MAILBOX, CMSG_GET_MAIL_LIST,
SMSG_MAIL_LIST_RESULT, CMSG_SEND_MAIL, SMSG_SEND_MAIL_RESULT, mail take
money/item/delete/mark-as-read, and inbox/compose UI windows.

Fix periodic stuttering in Stormwind caused by synchronous per-line disk
flushes in the logger — remove fileStream.flush() and std::endl, downgrade
high-volume per-packet/per-model/per-texture LOG_INFO to LOG_DEBUG.
2026-02-15 14:00:41 -08:00
Kelsi
b76527c2f7 Add MCLQ water, TaxiPathNode transports, and vanilla M2 particles
- Parse MCLQ sub-chunks in vanilla ADTs for water rendering (WotLK uses MH2O)
- Load TaxiPathNode.dbc for MO_TRANSPORT world-coordinate paths (vanilla boats)
- Parse data[] from SMSG_GAMEOBJECT_QUERY_RESPONSE (taxiPathId for transports)
- Support vanilla M2 particle emitters (504-byte struct, different from WotLK 476)
- Add character preview texture diagnostic logging
- Fix disconnect handling on character screen (show error only when no chars)
2026-02-14 20:20:43 -08:00
Kelsi
35d91ebfe1 Clear game handler DBC caches on expansion switch
Add resetDbcCaches() to GameHandler to clear stale spell name, skill,
taxi, and talent caches when switching expansions. Called from
reloadExpansionData() so switching servers (e.g. WotLK to Turtle)
reloads DBC data instead of using stale entries from the previous
expansion.
2026-02-14 19:27:35 -08:00
Kelsi
57ceb96275 Fix Warden module loading pipeline and HASH_REQUEST response
Fix critical skip/copy parsing bug where source pointer advanced for
both skip and copy sections (skip has no source data). Implement real
relocations using delta-encoded offsets. Strip RSA signature before
zlib decompression. Load module when download completes and cache to
disk. Add empirical hash testing against CR entries and compute
SHA1(moduleImage) response with SHA1Randx key derivation for any seed.
2026-02-14 19:20:32 -08:00
Kelsi
6b392a5dd8 Add chat channels, chat settings, and fix missing chat text
Fix WotLK chat parser not stripping null terminators from messages,
fix channel message local echo missing channelName, expand default
channels to General/Trade/LocalDefense/LookingForGroup with
configurable auto-join, add Classic packet format for join/leave
channel, display channel index prefix in chat, and add Chat settings
tab with timestamps, font size, and auto-join toggles.
2026-02-14 18:27:59 -08:00
Kelsi
02cba6c227 Fix empty chat messages and /dismount on Classic/Turtle
Chat: renderTextWithLinks now properly handles |cAARRGGBB color codes
that aren't item links (e.g. colored player names), rendering the text
in the specified color instead of discarding it.

Dismount: Classic/Vanilla lacks CMSG_CANCEL_MOUNT_AURA (TBC+ opcode).
Track mount aura spell ID when mountDisplayId changes, then use
CMSG_CANCEL_AURA as fallback on expansions without the dedicated opcode.
2026-02-14 16:42:47 -08:00
Kelsi
48128c93f6 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
cff95be8d7 Add clickable item links in chat with stat tooltips
Parse WoW item link format (|cXXXXXXXX|Hitem:ENTRY:...|h[Name]|h|r)
in chat messages. Item names render in quality color, hover shows
tooltip with slot type, armor, and stats. Shift-click inserts the
item link into the chat input. Automatically queries server for
item info on first encounter.
2026-02-14 15:58:54 -08:00
Kelsi
a3366931be Fix naked players and NPC gear textures
Default PLAYER_VISIBLE_ITEM layout to known WotLK 3.3.5a values
(base=284, stride=2) so equipment reads work immediately without
waiting for heuristic detection. Add equipment texture compositing
for humanoid NPCs over baked body textures using ItemDisplayInfo.dbc
region lookups (texture-only, no geoset changes to avoid invisibility).
2026-02-14 15:43:09 -08:00
Kelsi
2d1b2b0539 Resolve emote text from DBC for other players' text emotes
Load third-person emote text templates (othersTarget/othersNoTarget)
from EmotesText.dbc fields 3 and 7 alongside existing sender text.
Build reverse lookup map from dbcId to EmoteInfo for incoming
SMSG_TEXT_EMOTE resolution. Other players now show proper emote
descriptions like "Player dances with Target" instead of generic
"Player performs an emote" text.
2026-02-14 15:11:43 -08:00
Kelsi
190fdd6126 Fix guild roster, /who, /inspect, and character preview bugs
Guild O tab: fallback to character guildId when guildName_ not yet
queried, re-query guild info on roster open. /who: add missing
stringCount field and fix maxLevel default (0→100). /inspect: add
SMSG_INSPECT_TALENT opcode (0x3F4) and rewrite parser for WotLK
PackedGUID+talent format. Character preview: reset all tracking
variables in setAssetManager() to force model reload on login.
2026-02-14 15:05:18 -08:00
Kelsi
a3ae03606b Add chat tabs, networked text emotes, channel system, and chat bubbles
Chat tabs filter messages into General/Combat/Whispers/Trade tabs. Text
emotes now send CMSG_TEXT_EMOTE to server and display incoming emotes
from other players. Channel system auto-joins General/Trade on login with
/join, /leave, and /1-/9 shortcuts. Chat bubbles render as ImGui overlays
above entities for SAY/YELL messages with fade-out animation.
2026-02-14 14:30:09 -08:00
Kelsi
858164791b Load WoW.exe PE image for Warden MEM_CHECK responses
Parse PE sections from WoW.exe into a flat virtual memory image so
MEM_CHECK returns real binary contents instead of zeros. Also mocks
KUSER_SHARED_DATA (0x7FFE026C) with Windows 7 version info.
2026-02-14 02:00:15 -08:00
Kelsi
e168a7cdd1 Fix vanilla spell casting and bag contents
Vanilla CMSG_CAST_SPELL target mask is uint16 (not uint32 like WotLK),
the extra 2 bytes were corrupting packets. Also implement full bag
content tracking: extract container slot GUIDs from CONTAINER update
objects, set proper bag sizes, and populate bag items in inventory
rebuild.
2026-02-13 22:14:34 -08:00
Kelsi
6fac60641b Fix vanilla M2 animations, movement packets, and DBC locale
- Parse vanilla M2 animation tracks (flat arrays with M2Range indices)
  instead of skipping them, fixing T-pose on all vanilla models
- Use C4Quaternion (float[4]) for vanilla bone rotations instead of
  CompressedQuat (int16[4]) which produced garbage transforms
- Fix vanilla M2 attachment struct size (48 bytes, not 40) so weapons
  attach to correct bones instead of model origin
- Route movement packets through expansion-specific packet parsers
  instead of hardcoded WotLK format, fixing server-side position sync
- Fix Spell.dbc field indices for classic/turtle (Name=120, Rank=129,
  IconID=117) - were pointing to Portuguese locale column (+7 offset)
- Change guild roster keybind from J to O (WoW default)
- Add guild opcodes for all expansions
2026-02-13 21:39:48 -08:00