summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--npc/000-1/shop.txt25
-rw-r--r--npc/functions/shops.txt13
-rw-r--r--npc/scripts.conf1
3 files changed, 32 insertions, 7 deletions
diff --git a/npc/000-1/shop.txt b/npc/000-1/shop.txt
index 763fc2f8..a88b421c 100644
--- a/npc/000-1/shop.txt
+++ b/npc/000-1/shop.txt
@@ -8,15 +8,26 @@
000-1,84,98,0 trader Bag 109,{
OnInit:
- sellitem PiouLegs;
- sellitem Bread;
- sellitem Croconut;
- sellitem Aquada;
- sellitem Armbands;
- sellitem LousyMoccasins;
- sellitem PiouSlayer;
+ tradertype(NST_MARKET);
+
+ sellitem PiouLegs, -1, 1000;
+ sellitem Bread, -1, 1000;
+ sellitem Croconut, -1, 1000;
+ sellitem Aquada, -1, 1000;
+ sellitem Armbands, -1, 1000;
+ sellitem LousyMoccasins, -1, 1000;
+ sellitem PiouSlayer, -1, 1000;
setnpcsex G_MALE;
setnpcdistance 2;
end;
+
+OnClock0000:
+ restoreshopitem PiouLegs, 1000;
+ restoreshopitem Bread, 1000;
+ restoreshopitem Croconut, 1000;
+ restoreshopitem Aquada, 1000;
+ restoreshopitem Armbands, 1000;
+ restoreshopitem LousyMoccasins, 1000;
+ restoreshopitem PiouSlayer, 1000;
}
diff --git a/npc/functions/shops.txt b/npc/functions/shops.txt
new file mode 100644
index 00000000..0e491706
--- /dev/null
+++ b/npc/functions/shops.txt
@@ -0,0 +1,13 @@
+// Evol functions.
+// Authors:
+// 4144
+// Description:
+// Shops utility functions
+// Variables:
+// none
+
+function script restoreshopitem {
+ if (shopcount(args(0)) < args(1))
+ sellitem args(0), -1, args(1);
+ return;
+}
diff --git a/npc/scripts.conf b/npc/scripts.conf
index 0682cab0..eeb92856 100644
--- a/npc/scripts.conf
+++ b/npc/scripts.conf
@@ -14,6 +14,7 @@ npc: npc/functions/inventoryplace.txt
npc: npc/functions/goodbye.txt
npc: npc/functions/sailordialogue.txt
npc: npc/functions/savepoint.txt
+npc: npc/functions/shops.txt
// Maps specific scripts
import: npc/_import.txt