From 39822585004dbeb19f595ccfba3b7eabc160665a Mon Sep 17 00:00:00 2001 From: Player Name Date: Sun, 6 Oct 2024 13:06:07 +0000 Subject: [PATCH] Corrected iron-ore-smelting success rate --- .../content/global/skill/smithing/smelting/SmeltingPulse.java | 2 +- Server/src/main/core/tools/RandomFunction.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Server/src/main/content/global/skill/smithing/smelting/SmeltingPulse.java b/Server/src/main/content/global/skill/smithing/smelting/SmeltingPulse.java index 06c55f1e1..e48e85508 100644 --- a/Server/src/main/content/global/skill/smithing/smelting/SmeltingPulse.java +++ b/Server/src/main/content/global/skill/smithing/smelting/SmeltingPulse.java @@ -204,7 +204,7 @@ public class SmeltingPulse extends SkillPulse { } return true; } else { - return RandomFunction.getRandom(100) <= (player.getSkills().getLevel(Skills.SMITHING) >= 45 ? 80 : 50); + return RandomFunction.nextBool(); } } return true; diff --git a/Server/src/main/core/tools/RandomFunction.java b/Server/src/main/core/tools/RandomFunction.java index 7e8dd580f..61d3275ad 100644 --- a/Server/src/main/core/tools/RandomFunction.java +++ b/Server/src/main/core/tools/RandomFunction.java @@ -49,9 +49,9 @@ public class RandomFunction { * @param chance the 1/chance rate for the roll to succeed * @return true if you hit the roll, false otherwise */ - public static boolean roll(int chance){ + public static boolean roll(int chance) { if (chance <= 1) return true; - return random(chance + 1) == chance / 2; + return random(chance) == 1; } /**