fix(WG): FFA quest credit for crossfaction WG kills#145
Merged
Conversation
Crossfaction players in Wintergrasp now advance whichever PvP-kill quest they actually hold, regardless of their assigned team. A real-Horde player flipped to Alliance can finish "Slay Them All" (13180) by killing Horde, and vice versa for Alliance quests. Previously only one credit NPC was granted, chosen by the killer's assigned team -- so a flipped player's original-faction quest never advanced. The hook now iterates both teams' war players within 40y and grants both credit IDs to each (granting credit for a quest the player does not hold is a no-op). Lieutenant-victim double-credit with the core path is avoided by skipping the core-side ID for killer-team players in that specific case. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Nyeriah
added a commit
to Nyeriah/mod-cfbg
that referenced
this pull request
May 27, 2026
ForEachPlayerInZone is protected, so iterate the public PlayersInWar sets for both teams instead. The killer is still credited directly (unconditionally), so non-war kills continue to advance the daily. The FFA assist propagation from azerothcore#145 is preserved verbatim for the in-war case. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Nyeriah
added a commit
to Nyeriah/mod-cfbg
that referenced
this pull request
May 27, 2026
The previous FFA iteration scanned PlayersInWar on both teams (up to ~100 players) for every kill, even non-lieutenant ones. That cost is disproportionate for a daily-quest credit path that only the killer strictly needs to receive. Credit the killer directly (O(1)) and leave assist credit for nearby allies on core's existing lieutenant-only path. The killer still benefits from the dual-credit fix from azerothcore#145 (both PvP-kill NPCs granted so crossfaction quests advance), and the daily still ticks outside an active war. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When a player is flipped to the opposite team by CFBG in Wintergrasp, the WG PvP-kill quests (
Slay Them All13180/13178 for Horde,No Mercy for the Merciless13179/13177 for Alliance) didn't advance.A real-Horde player flipped to Alliance still holds the Horde quest (needs credit NPC
31086), but the existing hook only granted one credit NPC chosen by the killer's assigned team — so killing Horde as flipped-Alliance gave39019(Alliance-side credit) and the original quest stayed at 0.Fix
OnBattlefieldPlayerKillnow iterates both teams' war players within 40y of the killer and grants both PvP-kill credit NPCs to each. Granting credit for a quest the player doesn't hold is a no-op, so this is safe for non-flipped players.The core's lieutenant-victim path (
BattlefieldWG.cpp) still grants one credit ID to killer-team players. To avoid double-credit on that specific quest tick, the hook skips the core-side credit for killer-team players when the victim hasSPELL_LIEUTENANT(55629).Credit matrix per kill
Every war player in range gets both credit IDs exactly once per kill, regardless of faction flips.
Test plan
Slay Them All(13180) gets flipped to Alliance, kills a Horde player → kill counter advances.No Mercy for the Merciless(13179) gets flipped to Horde, kills an Alliance player → kill counter advances.🤖 Generated with Claude Code