Skip to content

Make offensive perks work against other players in PvP - #30

Open
absol89 wants to merge 1 commit into
devfrom
feat/pvp-offensive-perks
Open

absol89 wants to merge 1 commit into
devfrom
feat/pvp-offensive-perks

Conversation

@absol89

@absol89 absol89 commented Nov 5, 2026

Copy link
Copy Markdown
Owner

Requested by Eric · project thread

Part of tiltedphoques#938 ("Offensive perks not working on other players").

What

A PvP hit is resolved on the victim's client, against its copy of the attacker. That copy never had the attacker's perks, so perk entry points (damage, crits, sneak, Apply Bashing Spell...) contributed nothing.

  • Each player sends their perk list (GameId + rank) when it changes, when PvP turns on, or when someone joins (PlayerPerksRequest / NotifyPlayerPerks, relayed by the server PlayerService).
  • On the victim's client, perk checks for a remote player answer from that list (RemotePerks, MagicTarget.cpp hooks).
  • Perks are never added to the copy, so perk abilities don't run on it. Perks from mods the victim doesn't have are skipped.
  • Only used when PvP is on and the attacker is a remote player. PvE hits and heal/buff spells don't use it (the heal bonus would otherwise stack to 2.25x).

Verified vs assumed

  • Verified in Ghidra (SkyrimSE 1.6.1170): player perks live on PlayerCharacter, so the copy can't have them. For 1.7.104, only the existence of the new hook IDs was checked.
  • Assumed: everything about in-game behavior. Not tested in game yet.

Testing

  • Client, server, launcher and TPTests build; tests pass (new encoding tests in Code/tests/encoding.cpp).
  • Still needed, two clients with PvP on: attacker with a damage perk (e.g. Armsman) vs without, compare damage; sneak attack multiplier; a perk from a mod only one player has (no crash); PvP off (no change); PvE damage unchanged.

Generated by Claude Code

PvP hits resolve on the victim's client against its copy of the attacker,
which only has the perks on its TESNPC, not the ones the player earned.
Players now share their perk list and the victim's client answers perk
checks and entry points for that copy from it, without adding the perks
to the copy so their abilities don't run. Perks missing from the load
order are skipped.

Only active with PvP on. Entry points only answer when the local player
is one of their arguments, so nothing changes when a remote player hits
an NPC. Needs an in-game test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018fvQxQEu7yvi9eRZyKsEur
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