Items/ExtraLoot

* corrected calculation after writing a simulator and some consultation
 * sad thing is, this will not even be visible after rounding for display
This commit is contained in:
Sarjuuk
2024-02-29 17:33:55 +01:00
parent 29f80f9a76
commit be06b1e0cf

View File

@@ -1255,11 +1255,11 @@ class SpellPage extends GenericPage
$pctStack = []; $pctStack = [];
for ($i = 1; $i <= $maxStack; $i++) for ($i = 1; $i <= $maxStack; $i++)
{ {
$pctStack[$i] = (($baseChance ** $i) * 100) / $baseChance ; $pctStack[$i] = (($baseChance ** $i) * 100) / $baseChance;
// remove chance from previous stacks // remove chance from previous stacks
for ($j = 1; $j < $i; $j++) if ($i > 1)
$pctStack[$j] -= ($pctStack[$i] / ($i - 1)); $pctStack[$i-1] -= $pctStack[$i];
} }
// cleanup tiny fractions // cleanup tiny fractions