From 78d3143d1fa2403a1a85ac100dc360b45faf2d30 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Sun, 7 Jul 2019 23:14:55 -0300 Subject: Never go below zero on Merc Boxset, fix a bug with all merc boxsets --- npc/items/mercenary.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'npc/items') 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; } -- cgit v1.2.3-70-g09d2