summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2022-06-20 13:14:13 -0300
committerJesusaves <cpntb1@ymail.com>2022-06-20 13:14:13 -0300
commit1fb5f6659b0024fac6692c911ccdede8a122f63e (patch)
treeb6da7af138e3aa50333dcde03046c278b7e35eb8
parent59bc3ad02cb1d16308cd498150e474c8f08e9fc0 (diff)
downloadserverdata-1fb5f6659b0024fac6692c911ccdede8a122f63e.tar.gz
serverdata-1fb5f6659b0024fac6692c911ccdede8a122f63e.tar.bz2
serverdata-1fb5f6659b0024fac6692c911ccdede8a122f63e.tar.xz
serverdata-1fb5f6659b0024fac6692c911ccdede8a122f63e.zip
Formula corrections
-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