From 4749fcd6635946cb926f22dd0511d851a995ef7c Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 9 Feb 2015 12:12:48 +0300 Subject: Convert shop into market with 1000 items limit. --- npc/000-1/shop.txt | 25 ++++++++++++++++++------- npc/functions/shops.txt | 13 +++++++++++++ npc/scripts.conf | 1 + 3 files changed, 32 insertions(+), 7 deletions(-) create mode 100644 npc/functions/shops.txt 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 -- cgit v1.2.3-70-g09d2