diff options
Diffstat (limited to 'npc/functions/shops.txt')
-rw-r--r-- | npc/functions/shops.txt | 12 |
1 files changed, 10 insertions, 2 deletions
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; } |