Skip to content

Commit

Permalink
add: synthesis high quality related configurable settings
Browse files Browse the repository at this point in the history
  • Loading branch information
ampitere committed May 13, 2024
1 parent dc7a35f commit ac379cc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 3 additions & 0 deletions settings/default/map.lua
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ xi.settings.map =
-- Amount of points allowed in crafts over the level defined above. Points are shared across all crafting skills. (Retail = 400; All skills can go to max = 3200)
CRAFT_SPECIALIZATION_POINTS = 400,

-- Multiplier applied to high quality chance
CRAFT_HQ_CHANCE_MULTIPLIER = 1.0,

-- Enables fishing. 0 = Disabled. 1 = Enable. ENABLE AT YOUR OWN RISK.
FISHING_ENABLE = false,

Expand Down
8 changes: 5 additions & 3 deletions src/map/utils/synthutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,8 @@ namespace synthutils
case 3: // 1 in 4
chanceHQ = 25.0;
break;
case 2: // 1 in 20
chanceHQ = 5.0;
case 2: // 1 in 16
chanceHQ = 6.25;
break;
case 1: // 1 in 100
chanceHQ = 1.0;
Expand All @@ -361,9 +361,11 @@ namespace synthutils
chanceHQ = chanceHQ * 1.5f;
}

float chanceHQMultiplier = settings::get<float>("map.CRAFT_HQ_CHANCE_MULTIPLIER"); // server configured additional HQ multiplier (default 1.0)

// HQ success rate modifier.
// See: https://www.bluegartr.com/threads/130586-CraftyMath-v2-Post-September-2017-Update page 3.
chanceHQ = chanceHQ + 100.0f * PChar->getMod(Mod::SYNTH_HQ_RATE) / 512.0f;
chanceHQ = (chanceHQ * chanceHQMultiplier) + 100.0f * PChar->getMod(Mod::SYNTH_HQ_RATE) / 512.0f;

// limit max hq chance
if (chanceHQ > maxChanceHQ)
Expand Down

0 comments on commit ac379cc

Please sign in to comment.