summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2018-03-11 15:58:32 -0300
committerJesusaves <cpntb1@ymail.com>2018-03-11 15:58:32 -0300
commit717a38861a5d43d771df8328db77c91dec8a737d (patch)
tree09d5493e038e80a9b66b815b7dbf803e87c3dd9d
parentf445b8e5d0e7cdec1438a07ff769db52a070295b (diff)
downloadserverdata-717a38861a5d43d771df8328db77c91dec8a737d.tar.gz
serverdata-717a38861a5d43d771df8328db77c91dec8a737d.tar.bz2
serverdata-717a38861a5d43d771df8328db77c91dec8a737d.tar.xz
serverdata-717a38861a5d43d771df8328db77c91dec8a737d.zip
Flexibilize restoreshopitem
-rw-r--r--npc/functions/shops.txt12
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;
}