diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-02-09 12:12:48 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-02-09 12:13:49 +0300 |
commit | 4749fcd6635946cb926f22dd0511d851a995ef7c (patch) | |
tree | 90965f2d0c1b8d12b8a943e7ec2579bf0d9cba2b | |
parent | ef77998980e6529ab5fbc1dfad783ee5aeea8d9c (diff) | |
download | serverdata-4749fcd6635946cb926f22dd0511d851a995ef7c.tar.gz serverdata-4749fcd6635946cb926f22dd0511d851a995ef7c.tar.bz2 serverdata-4749fcd6635946cb926f22dd0511d851a995ef7c.tar.xz serverdata-4749fcd6635946cb926f22dd0511d851a995ef7c.zip |
Convert shop into market with 1000 items limit.
-rw-r--r-- | npc/000-1/shop.txt | 25 | ||||
-rw-r--r-- | npc/functions/shops.txt | 13 | ||||
-rw-r--r-- | npc/scripts.conf | 1 |
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 |