From bab2ce47595ea6a36d3f16637ff52ebb5762ca4e Mon Sep 17 00:00:00 2001 From: WinterSolstice8 <60417494+wintersolstice8@users.noreply.github.com> Date: Thu, 5 Feb 2026 08:29:35 -0700 Subject: [PATCH] [core] Adjust desynth HQ2/3 algo, add comments --- src/map/utils/synthutils.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/map/utils/synthutils.cpp b/src/map/utils/synthutils.cpp index 02ac76e34e4..9527224f439 100644 --- a/src/map/utils/synthutils.cpp +++ b/src/map/utils/synthutils.cpp @@ -666,16 +666,20 @@ auto calculateDesynthResult(CCharEntity* PChar) -> uint8 // Calculate HQ2 and HQ3 upgrades. uint8 upgradeHQ = 0; - for (uint8 tries = 0; tries < 2; ++tries) + + // https://www.bluegartr.com/threads/135055-Extensive-Desynthesis-Rate-Research?p=7789195&viewfull=1#post7789195 + // https://wiki.ffo.jp/html/401.html + // In order to achieve a desynth HQ rate distribution of + // (NQ , HQ1, HQ2, HQ3) + // (40%, 30%, 20%, 10%) + // roll a 50% HQ2 rate, then a 33.33(...)% rate for HQ3 + if (xirand::GetRandomNumber(0.0f, 100.f) < 50.0f) { - if (xirand::GetRandomNumber(0.0f, 100.f) < 50.0f) - { - upgradeHQ = 1; + upgradeHQ = 1; - if (xirand::GetRandomNumber(0.0f, 100.f) < 33.0f) - { - upgradeHQ = 2; - } + if (xirand::GetRandomNumber(0.0f, 100.f) < 100.f / 3.0f) + { + upgradeHQ = 2; } }