From 1fb5f6659b0024fac6692c911ccdede8a122f63e Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Mon, 20 Jun 2022 13:14:13 -0300 Subject: Formula corrections --- npc/functions/treasure.txt | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'npc') diff --git a/npc/functions/treasure.txt b/npc/functions/treasure.txt index c6d9a70d5..999740442 100644 --- a/npc/functions/treasure.txt +++ b/npc/functions/treasure.txt @@ -30,12 +30,15 @@ function script TreasureBox { TREASURE_OPEN=TREASURE_OPEN+1; .@t=TREASURE_OPEN; .@r=rand(0,10000)-(readparam2(bLuk)*2); + // Some chests may have different rates - if (.@r > 1600) // UC and C (100 ~ 150% bonus) + // Note that rare is used as 300 instead of 200 + // This is to normalize with SR/UR formula + if (.@r > 1600) // UC and C (100% ~ 150% bonus) .@r-=getarg(0, 0)+min((.@r-1600), getarg(0, 0)/2); - else if (.@r > 200) // Rare (100 ~ 120% bonus) - .@r-=getarg(0, 0)+min((.@r-300), getarg(0, 0)/5); // 300 to normalize - else if (.@r <= 200) // SR and UR (67% Bonus) + else if (.@r > 300) // Rare (67% ~ 120% bonus) + .@r-=getarg(0, 0)+min((.@r-300), getarg(0, 0)/5); + else if (.@r <= 300) // SR and UR (67% Bonus) .@r-=getarg(0, 0)*2/3; // Select treasure list -- cgit v1.2.3-70-g09d2