Retain selected Metin2 buffs after death
BuffsPlus is a legacy client/game integration that lets a player toggle retention of five buff flags after eligible PvM and/or PvP deaths. It is source code and merge instructions, not a compiled server or a complete character system. This review covers all 14 supplied text/source files and preserves the original archive for comparison.

The important r1 fix: inspect the current affect
The original ClearAffect loop asks whether the character has any of the selected buffs. If one is active, that character-wide condition can keep unrelated affects too. The revised condition checks the current CAffect::dwFlag against AFF_HOSIN, AFF_BOHO, AFF_KWAESOK, AFF_GICHEON and AFF_JEUNGRYEOK. Unrelated effects continue through normal removal. The existing no-clear-on-death and no-save exceptions are preserved. Full cleanup with bSave=false remains full cleanup.
This assumes the fork stores one affect flag enum in dwFlag, not a bitmask. Inspect the relevant AddAffect calls and adapt the allowlist if your skills use different flags. Retention does not refresh durations, duplicate buffs or restore expired effects.

Preference and interface corrections
Removed the cached flag and the Entergame write that could overwrite a default before quest state loaded. Only the explicit player command persists a preference; buffsplus.enable equal to 1 enables it, absent/invalid values mean disabled. A one-second server cooldown limits repeated toggles. The existing localized chat message confirms enabled/disabled status.
The client uses a weak callback through SetEvent and ui.__mem_func__, without requiring the fork-specific SAFE_SetEvent. The revised UIScript appendix adds only the two new controls after existing optional rows, adjusts board/window height and avoids duplicate insertion. It does not replace the whole game-options window or collide with the supplied optional monster-info row. The button is labelled Toggle; it is not a persistent on/off indicator.

Integration and policy
Merge reviewed/ into a staging copy of the actual client/game branch. Preserve the rest of ClearAffect and any later cleanup/expiry/security checks. Keep ENABLE_BUFFS_PLUS and its Python export consistent. ENABLE_BUFFS_PLUS_WHEN_PVM and ENABLE_BUFFS_PLUS_WHEN_PVP control the two killer classes independently; neither means no death retention. An absent killer does not retain buffs. PvM includes non-player killers as classified by your fork, including pets where applicable.
This package contains no premium entitlement checks or arena-specific policy. Decide those rules explicitly before enabling the feature on a PvP server. Keep quest-flag loading ordered before player commands, verify locale mappings and ensure the option dialog releases the new button during its existing teardown. Adapt the additive row placement if the window uses bottom/center-aligned children or a custom scrolling layout.
No database schema or packet layout change is introduced. Rebuild the client and game with the matching feature settings, back up both and test death, respawn, expiry, relog and quest loading on your real server.

Validation and provenance
The exact revised ClearAffect, preference, toggle and death-selection fragments compiled against fake engine interfaces in four PvM/PvP configurations. Tests covered mixed retained/removed affects, ordinary cleanup, empty affect-event cancellation, quest-flag writes, invalid preferences and 100 repeated toggles. The additive UI appendix was evaluated with the feature on/off, 0/10/30 existing rows and repeat execution. These are isolated tests: no real client/server build, renderer or in-game death/expiry/relog test was performed.
No exact upstream release or original author could be independently established from the supplied BuffsPlus name, so none is invented. Redistribution was confirmed by the supplying owner. Original notices are retained and no open-source relicensing is asserted. INSTALL.txt contains the precise branch assumptions and review boundaries.

Editorial resource — M2City
Version: Owner-supplied legacy integration; M2City r1 (2026-11-04); exact fork unspecified
Rights: Owner explicitly confirmed public redistribution. Preserve original notices; no open-source relicensing.
Validation: Exact ClearAffect, preference, toggle and death-selection fragments compiled with fake engine interfaces in four PvM/PvP configurations. Mixed affects, ordinary cleanup, quest-flag writes and 100 toggle retries passed. Additive UI layout tested enabled/disabled with 0/10/30 existing rows and duplicate execution. No real client/server build, death/expiry/relog test.
Source: Owner-supplied archive, reviewed files and retained notices; exact upstream release not established
SHA-256: 8d185955638450efd1d9a453975c81e7f0996dd0385ee2e747e72ccc5f26623f