From 717a38861a5d43d771df8328db77c91dec8a737d Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Sun, 11 Mar 2018 15:58:32 -0300 Subject: Flexibilize restoreshopitem --- npc/functions/shops.txt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'npc') diff --git a/npc/functions/shops.txt b/npc/functions/shops.txt index 915964bfc..6e1a5780e 100644 --- a/npc/functions/shops.txt +++ b/npc/functions/shops.txt @@ -8,7 +8,15 @@ // Item ID, Item Price, Item Amount function script restoreshopitem { - if (shopcount(getarg(0)) < getarg(1)) - sellitem getarg(0), getarg(1), getarg(2); + if (getarg(2) < 1) { + .@amount=getarg(1); + .@price=-1; + } else { + .@amount=getarg(2); + .@price=getarg(1); + } + + if (shopcount(getarg(0)) < .@amount) + sellitem getarg(0), .@price, .@amount; return; } -- cgit v1.2.3-70-g09d2