summaryrefslogtreecommitdiff
path: root/npc
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2019-07-07 23:14:55 -0300
committerJesusaves <cpntb1@ymail.com>2019-07-07 23:14:55 -0300
commit78d3143d1fa2403a1a85ac100dc360b45faf2d30 (patch)
tree6f7eb38512446d0a6a164b75997c4141c61aa1f9 /npc
parent6ca4fd31ded0e940f9ff8a447224af1360212ce4 (diff)
downloadserverdata-78d3143d1fa2403a1a85ac100dc360b45faf2d30.tar.gz
serverdata-78d3143d1fa2403a1a85ac100dc360b45faf2d30.tar.bz2
serverdata-78d3143d1fa2403a1a85ac100dc360b45faf2d30.tar.xz
serverdata-78d3143d1fa2403a1a85ac100dc360b45faf2d30.zip
Never go below zero on Merc Boxset, fix a bug with all merc boxsets
Diffstat (limited to 'npc')
-rw-r--r--npc/items/mercenary.txt10
1 files changed, 8 insertions, 2 deletions
diff --git a/npc/items/mercenary.txt b/npc/items/mercenary.txt
index c87081760..15060795d 100644
--- a/npc/items/mercenary.txt
+++ b/npc/items/mercenary.txt
@@ -14,9 +14,15 @@ function script merc_boxset {
.@s1=getarg(4,0);
.@sumup=.@s5+.@s4+.@s3+.@s2+.@s1;
+ /* I wonder if this is needed...?
+ .@s4+=.@s5;
+ .@s3+=.@s4;
+ .@s2+=.@s3;
+ .@s1+=.@s2;
+ */
// Make the seed. More level and luck increases odds of higher rarity
- .@seed=rand(0, .@sumup)-BaseLevel-readparam(bLuk);
+ .@seed=max(0, rand(0, .@sumup)-BaseLevel-readparam(bLuk));
// 5 ★
if (.@seed < .@s5) {
@@ -40,7 +46,7 @@ function script merc_boxset {
.@n=any_of(.@r);
}
- getitem .@r[.@n], 1;
+ getitem .@n, 1;
return;
}