summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--npc/functions/treasure.txt11
1 files changed, 7 insertions, 4 deletions
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