Server Systems & Source Patches
Metin2 alignment bonuses: tier transitions and stale-affect cleanup
M2City Systems · Editorial · Published 2026-11-04 · Branch-specific details should be checked against your own source.
Applies a tiered server bonus based on real character alignment, with two client affect icons. In the supplied examples, positive displayed alignment 1000/4000/8000/12000/20000 grants monster bonuses 1–5; negative -1/-4000/-8000/-12000/-20000 grants human bonuses 1–5. These are editable policy examples, not balance recommendations. Internal alignment uses ten times displayed units. Hiding displayed alignment does not remove bonuses; real alignment is used, as in the original.
M2City r1 fixes
The alignment delta now uses a wide intermediate before clamping, avoiding signed integer overflow for extreme changes. Refresh removes an opposite/stale alignment affect even when the expected bonus is already present. This handles inconsistent persisted state without touching unrelated affects. Normal tier transitions, neutral ranges and repeated matching refreshes retain the intended behavior.
Integration and persistence
Reserve IDs 750/751 on both client and server; change both sides together if occupied. Preserve the strongest-to-weakest table order and ensure POINT_* values fit the branch's apply-index type. Merge the ShowAlignment/UpdateAlignment hooks, lookup helper, death-preservation condition, client constants and UI entries. Pack the two supplied 32×32 TGA icons at their declared paths.
After persistent affects have finished loading for a logged-in player, call AlignmentBonus to reconcile stale saved values. Do not call before an asynchronous LoadAffect has completed. The exact completion hook depends on your branch and is not supplied here; reconcile it with ComputePoints and the existing affect save/load policy to prevent double application. The supplied ClearAffect instructions preserve these bonuses across death.
Test login/relogin, positive-to-negative transitions, each threshold, hidden alignment, death/revive and bonus recalculation on a disposable server before enabling for players. Merge instructions into your source, retaining unrelated behavior.
Validation and credits
All 12 original text/source files were read and both TGA icons decoded. Reviewed helpers compiled with a fake character/affect store and -ftrapv; twenty threshold cases, stale opposing state, repeated refresh, unrelated affects, extreme integer deltas and missing-character/descriptor guards passed. Actual persistence timing, network delivery, game calculations and client rendering remain untested. The original README credits EREMIT STUDIO and remains included. Exact public version/checksum was not independently established. Redistribution was confirmed by the supplying owner; underlying code/art is not relicensed.
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: Native reviewed affect helpers and alignment updates compiled with fake CHARACTER/affect storage and -ftrapv. Twenty threshold cases, stale opposing bonus cleanup, repeat refresh, unrelated affects, INT_MIN/INT_MAX deltas, hidden alignment and invalid character/descriptor guards passed. Two TGA icons decoded. No actual persistence/load/death/client-server test.
Source: Owner-supplied archive, reviewed files and retained notices; exact upstream release not established
SHA-256: 6eb10e31e196c2c5be5af5ac41066b467e36da1315466ee82d7707099035a952
Download package
3 download options · Sign in to download
metin2-alignment-bonuses-m2city-r1.zipM2City downloadmetin2-alignment-bonuses-m2city-r1.zipGoogle Drive mirrormetin2-alignment-bonuses-m2city-r1.zipMEGA mirrorMAKE THE NEXT ANSWER BETTER
What happened on your build?
Share a small example, the exact error and how you verified your fix. The discussion is open on the forum.
Need a scoped quest, UI or proto fix? · Explore more development guides · Check your proto files free