Skip to content

fix(WG): FFA quest credit for crossfaction WG kills#145

Merged
Nyeriah merged 1 commit into
azerothcore:masterfrom
Nyeriah:fix/wg-ffa-quest-credit
May 24, 2026
Merged

fix(WG): FFA quest credit for crossfaction WG kills#145
Nyeriah merged 1 commit into
azerothcore:masterfrom
Nyeriah:fix/wg-ffa-quest-credit

Conversation

@Nyeriah
Copy link
Copy Markdown
Member

@Nyeriah Nyeriah commented May 24, 2026

Summary

When a player is flipped to the opposite team by CFBG in Wintergrasp, the WG PvP-kill quests (Slay Them All 13180/13178 for Horde, No Mercy for the Merciless 13179/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 gave 39019 (Alliance-side credit) and the original quest stayed at 0.

Fix

OnBattlefieldPlayerKill now 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 has SPELL_LIEUTENANT (55629).

Credit matrix per kill

Victim Player team vs killer coreCredit otherCredit
Lieutenant Killer's team core gives hook gives
Lieutenant Opposite team hook gives hook gives
Non-lieutenant Killer's team hook gives hook gives
Non-lieutenant Opposite team hook gives hook gives

Every war player in range gets both credit IDs exactly once per kill, regardless of faction flips.

Test plan

  • Real-Horde player with Slay Them All (13180) gets flipped to Alliance, kills a Horde player → kill counter advances.
  • Real-Alliance player with No Mercy for the Merciless (13179) gets flipped to Horde, kills an Alliance player → kill counter advances.
  • Non-flipped players continue to advance their own quests normally.
  • Lieutenant kills do not grant double credit on a single quest.

🤖 Generated with Claude Code

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 Nyeriah merged commit 2e9978c into azerothcore:master May 24, 2026
1 check passed
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant