From be06b1e0cf8ed6cc6a77a9835f22d49c280c0f8d Mon Sep 17 00:00:00 2001 From: Sarjuuk Date: Thu, 29 Feb 2024 17:33:55 +0100 Subject: [PATCH] Items/ExtraLoot * corrected calculation after writing a simulator and some consultation * sad thing is, this will not even be visible after rounding for display --- pages/spell.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pages/spell.php b/pages/spell.php index 65ecab56..f02492ba 100644 --- a/pages/spell.php +++ b/pages/spell.php @@ -1255,11 +1255,11 @@ class SpellPage extends GenericPage $pctStack = []; for ($i = 1; $i <= $maxStack; $i++) { - $pctStack[$i] = (($baseChance ** $i) * 100) / $baseChance ; + $pctStack[$i] = (($baseChance ** $i) * 100) / $baseChance; // remove chance from previous stacks - for ($j = 1; $j < $i; $j++) - $pctStack[$j] -= ($pctStack[$i] / ($i - 1)); + if ($i > 1) + $pctStack[$i-1] -= $pctStack[$i]; } // cleanup tiny fractions