Commit graph

1980 commits

Author SHA1 Message Date
Kelsi
c0ffca68f2 feat: track and display WotLK server-authoritative combat stats
Adds update field tracking for WotLK secondary combat statistics:
- UNIT_FIELD_ATTACK_POWER / RANGED_ATTACK_POWER (fields 123, 126)
- PLAYER_DODGE/PARRY/BLOCK/CRIT_PERCENTAGE (fields 1025-1029)
- PLAYER_RANGED_CRIT_PERCENTAGE, PLAYER_SPELL_CRIT_PERCENTAGE1 (1030, 1032)
- PLAYER_FIELD_COMBAT_RATING_1 (25 slots at 1231, hit/expertise/haste/etc.)

Both CREATE_OBJECT and VALUES update paths now populate these fields.
The Character screen Stats tab shows them when received from the server,
with graceful fallback when not available (Classic/TBC expansions).

Field indices verified against AzerothCore 3.3.5a UpdateFields.h.
2026-03-13 08:35:18 -07:00
Kelsi
ea7b276125 refactor: use gameHandler.getMapName in instance lockout window
Replaces the static local Map.dbc cache in renderInstanceLockoutsWindow()
with the existing GameHandler::getMapName() accessor, eliminating duplicate
DBC loading. Moves getMapName declaration to public interface.
2026-03-13 08:23:43 -07:00
Kelsi
75139aca77 feat: display LFG dungeon name in DungeonFinder UI status banner
Extend the LFGDungeons.dbc name lookup to the Dungeon Finder window UI:
- Queued state: "In queue for Culling of Stratholme (1:23)"
- Proposal state: "Group found for Halls of Lightning!"
- InDungeon state: "In dungeon (Utgarde Pinnacle)"
- FinishedDungeon state: "Culling of Stratholme complete"
- Proposal accept banner: "A group has been found for <dungeon>!"
All states fall back gracefully when DBC name is unavailable.
2026-03-13 08:16:59 -07:00
Kelsi
ed02f5872a feat: show LFG dungeon name in Dungeon Finder queue messages
Add LFGDungeons.dbc cache (loadLfgDungeonDbc / getLfgDungeonName) and
use it to enrich three LFG chat messages in WotLK:
- handleLfgJoinResult: "Joined the queue for Culling of Stratholme."
- handleLfgProposalUpdate case 1: "Group found for Halls of Lightning!"
- handleLfgProposalUpdate case 2: "A group has been found for ... Accept or decline."
Falls back to generic text when DBC is unavailable or dungeon ID unknown.
2026-03-13 08:14:47 -07:00
Kelsi
59e29e2988 feat: show taxi destination name in flight messages
Replace generic "Taxi: requesting flight..." and "Flight started." with
"Requesting flight to [node name]..." and "Flight to [node name] started."
using the already-loaded taxiNodes_ map. Falls back to generic text when
the node name is unavailable.
2026-03-13 08:05:16 -07:00
Kelsi
9fe2ef381c feat: use zone name in battlefield entry invite message
Replace raw bfZoneId integer with getAreaName() lookup in
SMSG_BATTLEFIELD_MGR_ENTRY_INVITE so players see "Wintergrasp"
instead of "zone 4197" in the invitation prompt.
2026-03-13 08:00:46 -07:00
Kelsi
a9835f6873 feat: show force-kill notification and resolve Meeting Stone zone name 2026-03-13 07:54:02 -07:00
Kelsi
8cac557f86 feat: notify player when dungeon difficulty changes 2026-03-13 07:42:40 -07:00
Kelsi
ee3c12b2c0 feat: announce weather changes in chat (rain/snow/storm/clear) 2026-03-13 07:39:41 -07:00
Kelsi
67e4497945 feat: improve arena team event messages and add vote kick feedback 2026-03-13 07:37:40 -07:00
Kelsi
90c88d7ecd feat: show equipment set name in save confirmation
SMSG_EQUIPMENT_SET_SAVED: parse the set index and GUID, look up the
matching set name from equipmentSets_, and show
"Equipment set \"<name>\" saved." instead of the generic message.
Falls back to "Equipment set saved." when the set is not yet in the
local cache (e.g. first save before SMSG_EQUIPMENT_SET_LIST arrives).
2026-03-13 07:31:44 -07:00
Kelsi
d2f2d6db72 fix: distinguish auction owner notification action types
SMSG_AUCTION_OWNER_NOTIFICATION action field was ignored — all events
showed "has sold!" regardless. Now:
  - action 0 (won/sold): "Your auction of <item> has sold!"
  - action 1 (expired):  "Your auction of <item> has expired."
  - action 2 (bid placed): "A bid has been placed on your auction of <item>."
2026-03-13 07:27:01 -07:00
Kelsi
0a41ef7285 feat: improve player feedback for purchases, friend status, and instance entry
- SMSG_BUY_ITEM: show "Purchased: <item name> x<count>" confirmation
  using pendingBuyItemId_ set at buy time (fallback to "item #N")
- handleFriendStatus: look up name from contacts_ (populated by
  SMSG_FRIEND_LIST) before playerNameCache, reducing "Unknown" fallbacks
  for online/offline/removed notifications
- Channel member list: also check playerNameCache when entity manager
  has no name, reducing "(unknown)" placeholders
- setFocus: use Unit::getName() (covers NPCs too) + playerNameCache
  fallback instead of Player-only cast
- SMSG_INSTANCE_LOCK_WARNING_QUERY: show dungeon name + difficulty +
  remaining time when auto-accepting a saved instance re-entry
2026-03-13 07:20:58 -07:00
Kelsi
2be793cfba feat: improve calendar lockout and char rename messages
- SMSG_CALENDAR_RAID_LOCKOUT_ADDED: show dungeon name (from Map.dbc)
  and difficulty label (Normal/Heroic/25-Man/25-Man Heroic)
- SMSG_CALENDAR_RAID_LOCKOUT_REMOVED: show dungeon name instead of raw
  map ID; now emits a chat message (was silent/LOG_DEBUG only)
- SMSG_CHAR_RENAME: map result codes 1-7 to human-readable strings
  ("Name already in use.", "Name too short.", etc.) instead of
  "Character rename failed (error N)."
2026-03-13 07:14:40 -07:00
Kelsi
2c72d8462d feat: add map name lookups and improve instance/RAF/misc feedback
- Add getMapName() helper backed by Map.dbc (parallel to getAreaName)
- SMSG_RAID_INSTANCE_MESSAGE: show dungeon name instead of raw map ID
- SMSG_INSTANCE_RESET: show dungeon name instead of raw map ID
- SMSG_INSTANCE_RESET_FAILED: show dungeon name instead of raw map ID
- SMSG_EQUIPMENT_SET_SAVED: show "Equipment set saved." confirmation
- SMSG_PROPOSE_LEVEL_GRANT: show mentor name offering a level grant (RAF)
- SMSG_REFER_A_FRIEND_EXPIRED: show link-expired message
- SMSG_REFER_A_FRIEND_FAILURE: show reason-mapped error message
- SMSG_REPORT_PVP_AFK_RESULT: show success/failure feedback
- SMSG_QUEST_CONFIRM_ACCEPT: add playerNameCache fallback for sharer name
2026-03-13 07:10:10 -07:00
Kelsi
28ce441214 feat: add missing player feedback for level-up, pet spells, and pet name errors
- SMSG_LEVELUP_INFO: show \"You have reached level N!\" chat message on level-up
  (was only calling the UI ding callback without any chat notification)
- SMSG_PET_LEARNED_SPELL: show \"Your pet has learned X.\" with spell name lookup
  (was LOG_DEBUG only)
- SMSG_PET_NAME_INVALID: show \"That pet name is invalid.\"
  (was silently consumed)
2026-03-13 07:02:20 -07:00
Kelsi
8e67a41983 fix: show battleground names instead of IDs in SMSG_BATTLEFIELD_STATUS messages
Replace raw \"Battleground #2\" with proper names (Warsong Gulch, Arathi Basin,
Eye of the Storm, Strand of the Ancients, Isle of Conquest, arena names, etc.)
for all three expansions' BG type ID space.
2026-03-13 06:59:02 -07:00
Kelsi
20b59c9d63 fix: correct LFG vote kick result logic and show item names in dungeon rewards
- handleLfgBootProposalUpdate: was using myAnswer (player's own vote) to determine
  if the boot passed — should use bootVotes >= votesNeeded instead. Player who voted
  yes would see "passed" even if the vote failed, and vice versa.
- handleLfgPlayerReward: look up item name from item cache instead of showing
  raw "item #12345" for dungeon reward items
2026-03-13 06:56:37 -07:00
Kelsi
cf88a960f4 feat: add missing SMSG_CHANNEL_NOTIFY feedback for 12 unhandled notification types
Previously, PLAYER_NOT_FOUND, ANNOUNCEMENTS_ON/OFF, MODERATION_ON/OFF,
PLAYER_BANNED, PLAYER_UNBANNED, PLAYER_NOT_BANNED, INVITE, WRONG_FACTION,
INVITE_WRONG_FACTION, NOT_MODERATED, PLAYER_INVITED, and PLAYER_INVITE_BANNED
all fell silently to the default log-only path. Now each shows an appropriate
system message in chat.
2026-03-13 06:48:12 -07:00
Kelsi
9216a6da28 fix: show zone names in hearthstone bind messages, add playerNameCache to duel challenger
- SMSG_BINDPOINTUPDATE: show zone name in \"Your home has been set to X.\" (was just \"Your home has been set.\")
- SMSG_PLAYERBOUND: replace \"map N, zone N\" raw IDs with zone name lookup
- SMSG_BINDER_CONFIRM: suppress redundant \"This innkeeper is now your home location.\" since SMSG_PLAYERBOUND fires immediately after with zone context
- SMSG_DUEL_REQUESTED: add playerNameCache fallback before hex GUID for challenger name
2026-03-13 06:46:56 -07:00
Kelsi
ecc02595de fix: improve guild command result messages and suppress repeated guild name announcements
- Map GuildCommandError codes to human-readable strings instead of showing raw
  error numbers (e.g. \"error 4\" → \"No player named X is online.\")
- Handle errorCode==0 for QUIT command: show \"You have left the guild.\" and
  clear guild state (name, ranks, roster) — previously silent
- Handle errorCode==0 for CREATE and INVITE commands with appropriate messages
- Substitute %s-style error messages with the player name from data.name
- Suppress repeated \"Guild: <Name>\" chat message on every SMSG_GUILD_QUERY_RESPONSE;
  only announce once when the guild name is first learned at login
2026-03-13 06:43:11 -07:00
Kelsi
e882110e7f fix: suppress repeated group-join chat spam on every SMSG_GROUP_LIST update
Previously "You are now in a group with N members." was shown on every
GROUP_LIST packet, which fires for each party stat update. Now only show
a message on actual state transitions: joining, leaving the group.
2026-03-13 06:38:50 -07:00
Kelsi
3a143b9b5b fix: use playerNameCache fallback and show zone name in summon/trade requests
- SMSG_SUMMON_REQUEST: fall back to playerNameCache when entity not in
  range; include zone name from getAreaName() in the summon message
  (e.g. "Bob is summoning you to Stormwind.")
- SMSG_TRADE_STATUS BEGIN_TRADE: fall back to playerNameCache when the
  trade initiator's entity is not visible
2026-03-13 06:37:26 -07:00
Kelsi
8a81ffa29c fix: show quest name in QUESTGIVER_QUEST_FAILED, use playerNameCache for achievements
- SMSG_QUESTGIVER_QUEST_FAILED: look up quest title from questLog_ and
  include it in the failure message (same pattern as QUESTUPDATE_FAILED
  fix from previous session)
- SMSG_ACHIEVEMENT_EARNED: fall back to playerNameCache for non-visible
  players before showing a raw hex GUID in the achievement message
2026-03-13 06:36:04 -07:00
Kelsi
b1015abffe fix: use actual pct in durability death message, fix pet cast failure feedback
- SMSG_DURABILITY_DAMAGE_DEATH: use the actual pct field from the packet
  instead of hardcoding "10%"
- SMSG_PET_CAST_FAILED: read reason as uint8 (not uint32), look up spell
  name and show human-readable failure reason to player
- Trade status 9 (REJECTED): show "Trade declined." instead of "Trade
  cancelled." to distinguish explicit decline from cancellation
2026-03-13 06:30:30 -07:00
Kelsi
2a52aedbf7 fix: show quest name instead of ID in failed/timed-out quest messages
SMSG_QUESTUPDATE_FAILED and SMSG_QUESTUPDATE_FAILEDTIMER were emitting
generic "Quest 12345 failed!" messages. Now looks up the title from
questLog_ and shows e.g. "\"Report to Gryan Stoutmantle\" failed!" for
a much more readable notification. Falls back to the generic form if
the title is not cached.
2026-03-13 06:24:16 -07:00
Kelsi
156ddfad9a fix: pass power type from POWER_DRAIN energize to color-code combat text
SMSG_SPELLLOGEXECUTE POWER_DRAIN reads drainPower but was not passing it
to addCombatText, so drained-resource returns showed as blue (mana) even
for rage or energy. Now correctly colored following the energize palette
added in the earlier commit.
2026-03-13 06:22:51 -07:00
Kelsi
43b007cdcd fix: only show SMSG_DISPEL_FAILED message when player is the caster
The dispel-failed handler was showing the failure notification for every
dispel attempt in the party/raid, regardless of who cast it. Now checks
casterGuid == playerGuid before showing "X failed to dispel." so only
the player's own failed dispels surface in chat.
2026-03-13 06:21:33 -07:00
Kelsi
d79c79e1bc feat: show chat messages for channel notification events
SMSG_CHANNEL_NOTIFY carries many event types that were silently dropped
in the default case: wrong password, muted, banned, throttled, kicked,
not owner, not moderator, password changed, owner changed, invalid name,
not in area, not in LFG. These are now surfaced as system chat messages
matching WoW-standard phrasing.
2026-03-13 06:18:23 -07:00
Kelsi
38ab1e0aea fix: show correct duel fled message when loser left the duel area
SMSG_DUEL_WINNER type=1 means the loser fled the duel zone rather than
being defeated; was previously treated the same as a normal win. Now
shows "X has fled from the duel. Y wins!" for the flee case vs the
standard "X has defeated Y in a duel!" for a normal outcome.
2026-03-13 06:16:19 -07:00
Kelsi
3b499d6871 fix: prefix SMSG_SPELL_FAILURE error message with spell name
Previously a spell failure like "Not in range" gave no context about
which spell failed. Now the message reads e.g. "Fireball: Not in range"
using the spell name from the DBC cache. Falls back to the bare reason
string if the spell name is not yet cached.
2026-03-13 06:14:28 -07:00
Kelsi
c58fc3073f fix: clear action bar slots when spells are removed or unlearned
SMSG_REMOVED_SPELL and SMSG_SEND_UNLEARN_SPELLS both erased spells from
knownSpells but left stale references on the action bar. After a respec
or forced spell removal, action bar buttons would show removed talents
and spells as still present. Now both handlers clear matching slots and
persist the updated bar layout.
2026-03-13 06:11:10 -07:00
Kelsi
d9b9d1d2f2 fix: show dodge/parry/block/immune combat text when enemy spell misses player
SMSG_SPELLLOGMISS contains miss events for both directions: spells the
player cast that missed, and enemy spells that missed the player. The
victim side (dodge/parry/block/immune/absorb/resist) was silently
discarded. Now both caster==player and victim==player generate the
appropriate combat text floater.
2026-03-13 06:09:42 -07:00
Kelsi
4507a223cc feat: color-code ENERGIZE combat text by power type
Mana (0)=blue, Rage (1)=red, Focus (2)=orange, Energy (3)=yellow,
Runic Power (6)=teal. Previously all energize events showed as blue
regardless of resource type, making it impossible to distinguish
e.g. a Warrior's Rage generation from a Mage's Mana return.

Power type is now captured from SMSG_SPELLENERGIZELOG (uint8) and
SMSG_PERIODICAURALOG OBS_MOD_POWER/PERIODIC_ENERGIZE (uint32 cast
to uint8) and stored in CombatTextEntry::powerType.
2026-03-13 06:08:21 -07:00
Kelsi
b9c16e9be5 fix: suppress duplicate "Upgraded to X" message on trainer rank-up
When buying a higher spell rank from a trainer, SMSG_TRAINER_BUY_SUCCEEDED
already announces "You have learned X", and SMSG_SUPERCEDED_SPELLS would
then also print "Upgraded to X" — two messages for one action.

Fix: check if the new spell ID was already in knownSpells before inserting
it in handleSupercededSpell. If so, the trainer handler already announced
it and we skip the redundant "Upgraded to" message. Non-trainer supersedes
(quest rewards, etc.) where the spell wasn't pre-inserted still show it.
2026-03-13 06:00:39 -07:00
Kelsi
dfe091473c fix: show action bar cooldown timers for spells on cooldown at login
SMSG_INITIAL_SPELLS delivers active cooldowns which were stored in
spellCooldowns but never propagated to the action bar slot
cooldownRemaining/cooldownTotal fields. This meant that spells with
remaining cooldowns at login time showed no countdown overlay on the
action bar. Sync the action bar slots from spellCooldowns after
loadCharacterConfig() to restore the correct timers.
2026-03-13 05:58:57 -07:00
Kelsi
2b131548aa fix: show descriptive party command error messages
Replace the generic "Party command failed (error N)" message with
WoW-standard error strings for each PartyResult code, matching what
the original client displays (e.g. "Your party is full.", "%s is
already in a group.", "%s is ignoring you.", etc.).
2026-03-13 05:54:01 -07:00
Kelsi
b34df01331 fix: suppress duplicate chat message when learning trainer spell
SMSG_TRAINER_BUY_SUCCEEDED pre-inserts the spell into knownSpells and
shows "You have learned X." The subsequent SMSG_LEARNED_SPELL packet
would then show a second "You have learned a new spell: X." message.

Fix: check if the spell was already in knownSpells before inserting in
handleLearnedSpell. If it was pre-inserted by the trainer handler, skip
the chat notification to avoid the duplicate.
2026-03-13 05:51:15 -07:00
Kelsi
7dc12bb35e fix: persist action bar config after superceded spell slot upgrade
After automatically upgrading action bar slots to the new spell rank
in handleSupercededSpell, save the character config so the upgraded
slot IDs persist across sessions.
2026-03-13 05:42:24 -07:00
Kelsi
2d587d0d4b feat: upgrade action bar slots to new spell rank on supercede
When a spell is superceded (e.g. Fireball Rank 1 -> Rank 2 after
training), update any action bar slots referencing the old spell ID
to point to the new rank. This matches WoW client behaviour where
training a new rank automatically upgrades your action bars so you
don't have to manually re-place the spell.
2026-03-13 05:37:15 -07:00
Kelsi
3c704088af fix: clear lastInteractedGoGuid_ on world transfer in handleNewWorld
Same-map teleports (dungeon teleporters, etc.) clear casting state but
were not clearing lastInteractedGoGuid_.  If a gather cast was in progress
when the teleport happened, the stale GO guid could theoretically trigger
a spurious CMSG_LOOT on the destination map.

Also clears lastInteractedGoGuid_ in handleNewWorld alongside the rest of
the casting-state teardown for consistency with other reset paths.
2026-03-13 05:26:27 -07:00
Kelsi
103bb5a513 fix: query item info in SMSG_LOOT_START_ROLL and use live name in roll popup
SMSG_LOOT_START_ROLL was not calling queryItemInfo(), so the roll popup
would display item IDs instead of names when the item had not been
previously cached (e.g. first time seeing that item in the session).

Also update renderLootRollPopup to prefer the live ItemQueryResponseData
name/quality over the snapshot captured at parse time, so the popup
shows the correct name once SMSG_ITEM_QUERY_SINGLE_RESPONSE arrives.
2026-03-13 05:23:31 -07:00
Kelsi
48bcee32b4 fix: match spell ID in handleSpellGo to prevent proc spells triggering gather loot
wasInTimedCast checked casting == true but not whether the completing spell
was actually the gather cast.  A triggered/proc spell (SMSG_SPELL_GO with
a different spellId) could arrive while a gather cast is active (casting==true),
satisfying the old guard and firing lootTarget prematurely.

Require data.spellId == currentCastSpellId so only the spell that started
the cast bar triggers the post-gather CMSG_LOOT dispatch.
2026-03-13 05:12:22 -07:00
Kelsi
f44defec38 feat: show fish-hooked notification when fishing bobber splashes
When the server sends SMSG_GAMEOBJECT_CUSTOM_ANIM with animId=0 for a GO
of type 17 (FISHINGNODE), a fish has been hooked and the player needs to
click the bobber quickly.  Add a system chat message and a UI sound to
alert the player — previously there was no visual/audio feedback beyond
the bobber animation itself.
2026-03-13 05:07:51 -07:00
Kelsi
01f4ef5e79 fix: clear lastInteractedGoGuid_ for non-lootable GO interactions
Mailboxes, doors, buttons, and other non-lootable GOs set shouldSendLoot=false
so no CMSG_LOOT is dispatched — but lastInteractedGoGuid_ was still set.
Without SMSG_LOOT_RESPONSE to clear it, a subsequent timed cast completion
(e.g. player buffs at the mailbox) would fire a spurious CMSG_LOOT for the
mailbox GUID.
2026-03-13 05:06:00 -07:00
Kelsi
6878f120e9 fix: clear lastInteractedGoGuid_ in handleCastFailed path
SMSG_CAST_FAILED is a direct rejection (e.g. insufficient range, no mana)
before the cast starts.  Missing this path meant a stale gather-node guid
could survive into the next timed cast if SMSG_CAST_FAILED fired instead
of SMSG_SPELL_FAILURE.
2026-03-13 05:03:50 -07:00
Kelsi
7a4347dbac fix: clear lastInteractedGoGuid_ on cast failure, cancel, and world reset
If a gather cast was interrupted by SMSG_SPELL_FAILURE (e.g. player took
damage during mining), lastInteractedGoGuid_ was left set.  A subsequent
timed cast completion would then fire CMSG_LOOT for the stale node even
though the gather never completed.

Clear lastInteractedGoGuid_ in all cast-termination paths:
- SMSG_SPELL_FAILURE (cast interrupted by server)
- SMSG_CAST_RESULT non-zero (cast rejected before it started)
- cancelCast() (player or system cancelled the cast)
- World reset / logout block (state-clear boundary)
2026-03-13 05:02:58 -07:00
Kelsi
cc2b413e22 fix: guard gather-node CMSG_LOOT dispatch against instant casts and proc spells
handleSpellGo fired lootTarget(lastInteractedGoGuid_) on ANY player spell
completion, including instant casts and proc/triggered spells that arrive
while the gather cast is still in flight.  Save the casting flag before
clearing it and only dispatch CMSG_LOOT when wasInTimedCast is true — this
ensures only the gather cast completion triggers the post-gather loot send,
not unrelated instant spells that also produce SMSG_SPELL_GO.
2026-03-13 04:59:05 -07:00
Kelsi
2c6902d27d fix: mining nodes no longer report invalid target and now open loot after gather
Two bugs fixed:
1. Retry logic (for Classic) re-sent CMSG_GAMEOBJ_USE at 0.15s while the
   gather cast was in-flight, causing SPELL_FAILED_BAD_TARGETS. Now clears
   pendingGameObjectLootRetries_ as soon as SMSG_SPELL_START shows the player
   started a cast (gather accepted).

2. CMSG_LOOT was sent immediately before the gather cast completed, then
   never sent again — so the loot window never opened. Now tracks the last
   interacted GO and sends CMSG_LOOT in handleSpellGo once the gather spell
   completes, matching how the real client behaves.
2026-03-13 04:37:36 -07:00
Kelsi
4272491d56 feat: send CMSG_SET_ACTION_BUTTON to server when action bar slot changes
Action bar changes (dragging spells/items) were only saved locally.
Now notifies the server via CMSG_SET_ACTION_BUTTON so the layout
persists across relogs. Supports Classic (5-byte) and TBC/WotLK
(packed uint32) wire formats.
2026-03-13 04:25:05 -07:00