Commit graph

203 commits

Author SHA1 Message Date
kelsi davis
2e81167b8e Fix missing closing brace in update() function
The if (state == WorldState::IN_WORLD) block was missing its closing brace.
This was introduced during the large SP removal when methods were deleted with sed.

Now: 450 open, 450 close (balanced)
2026-02-07 00:12:39 -08:00
kelsi davis
180b78d106 Fix compilation errors from single-player removal
- Fixed corrupted header (removed orphaned code fragment)
- Restored NPC callbacks needed for online animations
  - NpcDeathCallback, NpcRespawnCallback, NpcSwingCallback
  - These were incorrectly removed as "SP-only" but are used for animations in online mode
- Removed calls to deleted methods:
  - getItemTemplateName, getItemTemplateQuality (used fallback in loot window)
  - notifyInventoryChanged, notifyEquipmentChanged (SP persistence markers)
- Removed hearthstone single-player handling (now uses server)

All online features preserved. Code should now compile.
2026-02-07 00:00:06 -08:00
kelsi davis
45fd9a2faa Remove backup file 2026-02-06 23:52:25 -08:00
kelsi davis
99d5f9a33a Remove single-player mode to focus on multiplayer
Removed all single-player/offline mode functionality:
- Removed ~2,200 lines of SQLite database code
- Removed 11 public SP methods from GameHandler
- Removed SP member variables and state flags
- Removed SP UI elements (auth screen button, game settings)
- Removed SQLite3 build dependency
- Deleted docs/single-player.md
- Updated documentation (README, FEATURES, CHANGELOG)

Files modified:
- src/game/game_handler.cpp: 2,852 lines (down from 4,921)
- include/game/game_handler.hpp: Removed SP API
- src/core/application.cpp/hpp: Removed startSinglePlayer()
- src/ui/*: Removed SP UI logic
- CMakeLists.txt: Removed SQLite3

All online multiplayer features preserved and tested.
2026-02-06 23:52:16 -08:00
kelsi davis
3079b69ba8 Update documentation to reflect current implementation and features
- Expand README.md with complete feature list (quests, vendors, combat, spells, inventory, etc.)
- Update Controls section with comprehensive keybindings organized by category
- Rewrite docs/quickstart.md from "TODO" state to reflect all working features
- Enhance docs/architecture.md with detailed system descriptions and current capabilities
- Add CHANGELOG.md documenting 50+ recent commits grouped by feature area
- Add FEATURES.md with 100+ documented features across 8 major categories
- Update technical details with architecture, networking, and asset loading info
2026-02-06 22:39:45 -08:00
Kelsi
5cc3d9645c Fix vendor buying and add quest turn-in flow
CMSG_BUY_ITEM was missing the trailing uint8 bag field, causing the
server to silently drop undersized packets. Add handlers for
SMSG_QUESTGIVER_REQUEST_ITEMS and SMSG_QUESTGIVER_OFFER_REWARD with
UI windows for quest completion and reward selection.
2026-02-06 21:50:15 -08:00
Kelsi
6296c32a47 Simplify spellbook tabs to class specialties + General
Only SkillLine category 7 (Class) gets its own tab, giving the 3 spec tabs
(e.g. Discipline/Holy/Shadow for Priest). Weapon skills, racials, professions,
and utility spells all go into the General tab.
2026-02-06 21:27:34 -08:00
Kelsi
848f419ac4 Fix spell cast error messages, action bar drag-drop, and player name display
- Rewrite SpellCastResult enum to match AzerothCore 3.3.5a values (was misaligned, showing wrong error messages like "Not while trading" instead of "Unit not in front")
- Fix spellbook-to-action-bar drag-drop by using ImGuiHoveredFlags_AllowWhenBlockedByActiveItem for cross-window hover detection
- Fix player frame showing wrong character name by looking up activeCharacterGuid instead of always using characters[0]
- Clear playerNameCache on disconnect to prevent stale names across sessions
2026-02-06 21:25:35 -08:00
Kelsi
b9dfce3c66 Fix M2 particle emitter crash: correct struct size, FBlock format, and add safety caps
The particle emitter parser had three bugs causing OOM crashes during loading:
- Struct size was 496 bytes instead of correct WotLK 476 (0x1DC), misaligning multi-emitter models
- FBlocks were read as 20-byte M2TrackDisk instead of 16-byte FBlockDisk (no interp/seq prefix)
- parseAnimTrack had no cap on sequence count, allowing garbage data to allocate billions of entries
2026-02-06 21:13:06 -08:00
Kelsi
104a9d0898 Enable M2 particle emitters with correct WotLK struct parsing and overflow guards 2026-02-06 20:57:02 -08:00
Kelsi
12fb879e1a Fix stale player model persisting across logins by clearing character state on logout 2026-02-06 20:49:17 -08:00
Kelsi
836a629513 Organize spellbook tabs by skill line specialty using SkillLine.dbc and SkillLineAbility.dbc 2026-02-06 20:40:17 -08:00
Kelsi
d4d5a22685 Fix spellbook drag-drop onto action bar by detecting mouse release over slot 2026-02-06 20:36:29 -08:00
Kelsi
2fae698f48 Use Selectable for spellbook rows to properly consume clicks and prevent window dragging 2026-02-06 20:34:20 -08:00
Kelsi
ec63037543 Prevent spellbook window from moving during spell drag and escaping screen bounds 2026-02-06 20:29:59 -08:00
Kelsi
37d6298b72 Fix action bar click-to-cast and add spellbook drag-and-drop
Left-click on action bar slots now casts spells/uses items instead of starting a drag. Right-click-drag rearranges slots. Spells can be dragged from the spellbook directly onto the action bar, replacing the old "Assign to" button row.
2026-02-06 20:27:01 -08:00
Kelsi
4e2cf0af8e Add UI opacity slider to settings window
Adds an Interface section with a UI Opacity slider (20-100%) that controls the transparency of all ImGui UI elements via the global style alpha.
2026-02-06 20:19:39 -08:00
Kelsi
7054699d21 Re-query quest giver status after accepting or completing quests
After accepting a quest, re-query the NPC so its marker updates from ! to ?. After completing a quest, re-query all nearby quest NPCs so markers refresh. Also remove completed quests from the log instead of just marking them.
2026-02-06 20:16:38 -08:00
Kelsi
2889e412b3 Send CMSG_QUESTGIVER_STATUS_QUERY when quest NPCs spawn
The server only sends quest status packets in response to client queries. Send the query for each NPC with the questgiver flag (0x02) when it enters view so the ! and ? markers actually appear.
2026-02-06 20:13:28 -08:00
Kelsi
e6a80c68c1 Add quest markers (! and ?) above NPCs and on minimap
Parse SMSG_QUESTGIVER_STATUS and SMSG_QUESTGIVER_STATUS_MULTIPLE packets to track per-NPC quest status, render yellow/gray ! and ? markers in 3D world space above NPC heads with distance-based scaling, and show corresponding dots on the minimap.
2026-02-06 20:10:10 -08:00
Kelsi
7d1e733b45 Clear gossip options and quests before parsing to prevent duplicates on re-open 2026-02-06 19:55:32 -08:00
Kelsi
ac699de412 Fix PLAYER_FIELD_COINAGE to correct index 1170 2026-02-06 19:53:52 -08:00
Kelsi
01a326b186 Fix online selling: CMSG_SELL_ITEM count as uint32, read coinage from field 1219, handle sell/inventory errors 2026-02-06 19:50:22 -08:00
Kelsi
0a26eef154 Send CMSG_LOOT_MONEY for online gold looting and replace action bar right-click removal with drag-to-ground 2026-02-06 19:24:44 -08:00
Kelsi
affb5f4f04 Add item support for action bar with drag-from-inventory and key/click use
Allow picking up consumables from inventory and dropping them onto action bar
slots. Items display their icon or name, can be used via click or hotkey
(1-0,-,=), and cleared with right-click. Adds useItemById to find and use
items from backpack by item ID.
2026-02-06 19:17:35 -08:00
Kelsi
40c016ccdb Fix online equipment slot mapping, auto-equip packet, and backpack slot offsets
Correct PLAYER_FIELD_INV_SLOT_HEAD default from 322 to 324 (UNIT_END+0xB0)
which was shifting every equipment slot by one position. Fix auto-detection
to validate against known 3.3.5a base. Change CMSG_AUTOEQUIP_ITEM to send
uint8 bag+slot instead of uint64 GUID, and add slot offset 23 for backpack
items in both auto-equip and use-item packets.
2026-02-06 19:13:38 -08:00
Kelsi
e38c0213e4 Fix online item GUID resolution, async terrain loading, and inventory enrichment
Enrich online inventory from local DB when server data is incomplete, add
resolveOnlineItemGuid fallback for sell/equip/use, use async enqueueTile for
initial terrain load, improve walk/run animation fallbacks, clear target on
loot close, and broaden equipability detection to include armor/subclass.
2026-02-06 18:52:28 -08:00
Kelsi
db4a40a4e6 Avoid online loading hang on stalled terrain streaming 2026-02-06 18:40:09 -08:00
Kelsi
fdc614902b Fix online interactions, UI, and inventory sync 2026-02-06 18:34:45 -08:00
Kelsi
7436420cd1 Add player death handling, race-aware faction hostility, and all-race texture support
- Death screen with "Release Spirit" button sends CMSG_REPOP_REQUEST
- Detect player death/resurrection via health updates (VALUES and CREATE)
- Faction hostility map now built per-character race instead of hardcoded Human
- CharSections.dbc texture lookup enabled for all races (was Human-only)
- Fallback texture paths use race folder names instead of hardcoded Human
- Player name in unit frame is clickable for self-targeting
2026-02-06 17:27:20 -08:00
Kelsi
046111d037 Fix faction hostility using Faction.dbc base reputation for neutral-flagged hostile mobs
FactionTemplate entries like FT[7] (Defias) have all-zero group flags but are
hostile via their parent Faction.dbc base reputation. Load Faction.dbc, check
ReputationBase for Human race mask, and mark factions with negative base rep
as hostile. Also add symmetric group check and fix Faction.dbc field offsets
(ReputationRaceMask at fields 2-5, ReputationBase at fields 10-13).
2026-02-06 17:15:46 -08:00
Kelsi
d7a26ed3c5 Fix Monster faction group bit: use 8 (Monster) not 4 (Horde)
FactionGroupMask bits are 1=Player, 2=Alliance, 4=Horde, 8=Monster.
The hostility check was using bit 4 (Horde) to detect monsters, causing
all hostile mobs to appear friendly/green.
2026-02-06 17:01:00 -08:00
Kelsi
2859c95372 Make killXp public for level-based mob coloring in UI 2026-02-06 16:53:09 -08:00
Kelsi
81166346ef Fix respawned corpse movement, faction hostility, and add WoW-canonical mob level colors
Reset NPC animation to idle when health goes from 0 to >0 (respawn), prevent
dead NPCs from being moved by server movement packets. Fix faction hostility
to check factionGroup Monster bit and individual enemy arrays, not just
enemyGroup. Add level-based mob coloring: grey (no XP), green (easy), yellow
(even), orange (hard), red (very hard) for target frame and selection circle.
2026-02-06 16:47:07 -08:00
Kelsi
2aa8187562 Fix camera orbit, deselect, chat formatting, loot/vendor bugs, critter hostility, and character screen
Smooth idle camera orbit without jump at loop boundary, click empty space to
deselect target, auto-target when attacked, fix critter hostility so neutral
factions aren't flagged red, add armor/stats to item templates, fix loot
iterator invalidation, show item template names as fallback, position drop
confirmation at cursor, remove [SYSTEM] chat prefix, show NPC names in monster
say/yell, and prevent auto-login on character select screen.
2026-02-06 16:40:44 -08:00
Kelsi
caeb6f56f7 Fix hair/vendor/loot bugs, revamp spellbook with tabs and icons, clean up action bar, add talent placeholder
- Fix white hair: always override M2 type-6 texture with DBC hair texture when available
- Fix vendor sell: add sellPrice to ItemDef/ItemTemplateRow, use directly instead of empty cache
- Fix empty loot: skip loot window when corpse has no items and no gold
- Revamp spellbook (P key): tabbed UI (General/Active/Passive), spell icons from SpellIcon.dbc, rank text
- Clean up action bar: only auto-populate Attack and Hearthstone, rest assigned via spellbook
- Add talent placeholder (N key): 3-tab window with level/talent point display
- Fix ffplay cleanup: non-blocking waitpid with SIGKILL fallback to prevent orphaned audio processes
- Fix pre-existing getQualityColor visibility for loot window rendering
2026-02-06 16:04:25 -08:00
Kelsi
2ddef93f52 Fix spell targeting, item query parsing, loot UI, hair/skin textures, and attack animations
Fix spell cast target fallback using selected target instead of no-op tautology.
Fix SMSG_ITEM_QUERY_SINGLE_RESPONSE to always read 10 stat pairs (server sends
all 10 regardless of statsCount), fixing misaligned armor/stat reads. Fix XP gain
parser to read float groupRate + uint8 RAF instead of bogus uint32 groupBonus.
Add item icons and quality-colored names to loot window. Use actual character
appearance bytes for CharSections.dbc skin/face/hair lookups instead of hardcoded
defaults. Add weapon-type-aware attack animation selection (2H prioritizes anim 18).
Add readable spell cast failure messages and vendor sell hint.
2026-02-06 15:41:29 -08:00
Kelsi
f0aad5e97f Fix spline parsing, hair texture, and popup window positioning
Restore unconditional verticalAccel/effectStartTime reads in spline parser
with pointCount safety cap at 256. Load player hair texture from
CharSections.dbc instead of hardcoded path, and restrict render fallback
to not apply skin composite to hair batches. Change loot/gossip/vendor
windows to re-center on each open via ImGuiCond_Appearing.
2026-02-06 15:18:50 -08:00
Kelsi
aa11ffda72 Fix terrain streaming loop and auto-select single realm/character
Use getRemainingTileCount (pending + readyQueue) and processAllReadyTiles
to prevent loading screen from exiting before tiles are finalized. Auto-select
realm and character when only one is available.
2026-02-06 14:56:26 -08:00
Kelsi
81d712121e Add loading screen to online mode, fix ImGui frame conflict, truncate log on start
Online world entry now shows a progress bar during character model,
terrain, and tile streaming. Fixed loading screen crash from calling
ImGui::NewFrame while a frame was already in progress. Log file is
now truncated on each launch instead of appending.
2026-02-06 14:49:53 -08:00
Kelsi
6f33392155 Add progress bar to loading screen and handle resize during loading
Loading screen now shows a gold progress bar with percentage and status
text. All loading steps poll SDL events for window resize and quit.
2026-02-06 14:43:18 -08:00
Kelsi
a0c24e70f9 Load creature display DBC lookups at startup instead of first spawn
Moves buildCreatureDisplayLookups() from lazy init on first creature
spawn to eagerly run after asset manager init, eliminating a 133s hang.
2026-02-06 14:37:31 -08:00
Kelsi
a09bea5e1e Add spell icons to action bar from SpellIcon.dbc
Load spell icons via Spell.dbc field 133 (SpellIconID) -> SpellIcon.dbc
(icon path) -> BLP texture from Interface\Icons\. Icons are cached as GL
textures and rendered with ImageButton, with cooldown text overlaid on the
icon. Falls back to truncated spell name text for missing icons.
2026-02-06 14:30:54 -08:00
Kelsi
394e91cd9e Add character screen model preview, item icons, stats panel, and fix targeting bugs
Enhanced the C-key character screen with a 3-column layout featuring a 3D
character model preview (with drag-to-rotate), item icons loaded from BLP
textures via ItemDisplayInfo.dbc, and a stats panel showing base + equipment
bonuses. Fixed selection circle clipping under terrain by adding a Z offset,
and corrected faction hostility logic that was wrongly marking hostile mobs
as friendly.
2026-02-06 14:24:38 -08:00
Kelsi
7128ea1417 Restructure inventory UI, add vendor selling, camera intro on all spawns, and quest log
Split inventory into bags-only (B key) and character screen (C key). Vendor window
auto-opens bags with sell prices on hover and right-click to sell. Add camera intro
pan on all login/spawn/teleport/hearthstone events and idle orbit after 2 minutes.
Add quest log UI, SMSG_MONSTER_MOVE handling, deferred creature spawn queue, and
creature fade-in/movement interpolation for online mode.
2026-02-06 13:47:03 -08:00
Kelsi
a4a39c7f0f Fix quest details parser, ImGui ID conflict, and gossip reopen guard
Quest details parser now reads all 6 choice + 4 reward item slots
(matching AzerothCore's fixed-size arrays) with bounds checking at
every step. Use loop index for quest ImGui IDs instead of questId to
avoid conflicts. Don't reopen gossip window while quest details are
showing.
2026-02-06 12:08:47 -08:00
Kelsi
67a3da3bae Add quest details dialog, fix vendor UI, suppress both-button clicks
Parse SMSG_QUESTGIVER_QUEST_DETAILS and show quest text with Accept/
Decline buttons. Vendor window now shows item names with quality colors,
stat tooltips on hover, player money, and closes properly via X button.
Suppress left/right-click targeting and interaction when the other mouse
button is held (both-button run forward).
2026-02-06 11:59:51 -08:00
Kelsi
60be428250 Add quest opcodes, fix gossip select packet, and NPC combat animations
Fix CMSG_GOSSIP_SELECT_OPTION missing menuId field (was causing
ByteBufferException). Add 12 quest opcodes and clickable quest items in
gossip dialog. NPC attack/death animation callbacks now work for both
single-player and server-spawned creatures, and SMSG_ATTACKERSTATEUPDATE
triggers NPC swing animations.
2026-02-06 11:45:35 -08:00
Kelsi
b5336d784a Fix movement packet format: write fallTime unconditionally
AzerothCore's ReadMovementInfo always reads fallTime regardless of flags.
Also write all four jump fields together when FALLING (remove nested
FALLINGFAR check), and use real millisecond timestamps via steady_clock.
2026-02-06 09:14:22 -08:00
Kelsi
3043cc5203 Fix loot and gossip opcode values for 3.3.5a
Corrected CMSG_AUTOSTORE_LOOT_ITEM (0x162→0x108), CMSG_LOOT_RELEASE
(0x15E→0x15F), SMSG_LOOT_REMOVED (0x163→0x162), SMSG_LOOT_MONEY_NOTIFY
(0x164→0x163), and gossip opcodes (CMSG_GOSSIP_HELLO 0x17C→0x17B,
CMSG_GOSSIP_SELECT_OPTION 0x17E→0x17C, SMSG_GOSSIP_COMPLETE 0x17F→0x17E).
Added missing CMSG_LOOT_MONEY (0x15E).
2026-02-06 09:14:16 -08:00