From f00998d58e0e71efa6d3de80eea466c8df33ed67 Mon Sep 17 00:00:00 2001 From: Jesse Woolsey Date: Sat, 13 Feb 2016 16:26:49 -0500 Subject: [PATCH] Add Varrock shops --- data/plugins/location/varrock/npcs.rb | 4 ++-- data/plugins/location/varrock/plugin.xml | 2 ++ data/plugins/location/varrock/shops.rb | 7 +++++++ data/plugins/shops/shop.rb | 2 +- data/plugins/shops/shops.rb | 6 +++--- 5 files changed, 15 insertions(+), 6 deletions(-) create mode 100644 data/plugins/location/varrock/shops.rb diff --git a/data/plugins/location/varrock/npcs.rb b/data/plugins/location/varrock/npcs.rb index 4c484d64..4a3ebf77 100644 --- a/data/plugins/location/varrock/npcs.rb +++ b/data/plugins/location/varrock/npcs.rb @@ -223,8 +223,8 @@ spawn_npc name: :scavvo, x: 3192, y: 3353, z: 1 spawn_npc name: :shop_keeper_551, x: 3206, y: 3399 spawn_npc name: :shop_assistant_552, x: 3207, y: 3396 -spawn_npc name: :shop_keeper, x: 3216, y: 3414 -spawn_npc name: :shop_assistant, x: 3216, y: 3417 +spawn_npc name: :shop_keeper_522, x: 3216, y: 3414 +spawn_npc name: :shop_assistant_523, x: 3216, y: 3417 spawn_npc name: :tea_seller, x: 3271, y: 3411 diff --git a/data/plugins/location/varrock/plugin.xml b/data/plugins/location/varrock/plugin.xml index 83f3a354..2e74c9fb 100644 --- a/data/plugins/location/varrock/plugin.xml +++ b/data/plugins/location/varrock/plugin.xml @@ -9,8 +9,10 @@ + entity-spawning + shops \ No newline at end of file diff --git a/data/plugins/location/varrock/shops.rb b/data/plugins/location/varrock/shops.rb new file mode 100644 index 00000000..33ec9a0c --- /dev/null +++ b/data/plugins/location/varrock/shops.rb @@ -0,0 +1,7 @@ +create_shop :npcs => [553], :name => 'Aubury\'s Rune Shop.', :items => [[554, 5_000], [555, 5_000], [556, 5_000], [557, 5_000], [558, 5_000], [559, 5_000], [562, 250], [560, 250]] +create_shop :npcs => [550], :name => 'Lowe\'s Archery Emporium', :items => [[882, 2_000], [884, 1_500], [886, 1_000], [888, 800], [890, 600], [841, 4], [839, 4], [843, 3], [845, 3], [849, 2], [847, 2], [853, 1], [851, 1], [837, 2]] +create_shop :npcs => [549], :buys => :all, :name => 'Horvik\s Armour Shop.', :items => [[1103, 5], [1101, 3], [1105, 3], [1109, 1], [1117, 3], [1115, 1], [1119, 1], [1125, 1], [1121, 1], [1067, 1], [1133, 1], [1097, 1]] +create_shop :npcs => [548], :name => 'Thessalia\'s Fine Clothes.', :items => [[1005, 3], [1129, 12], [1059, 10], [1061, 10], [1757, 1], [1013, 5], [1015, 3], [1011, 2], [1007, 4], [950, 5], [428, 3], [426, 3]] +create_shop :npcs => [522, 523], :buys => :all, :name => 'Varrock General Store', :items => [[1931, 5], [1935, 2], [1735, 2], [1925, 3], [1923, 2], [1887, 2], [590, 2], [1755, 2], [2347, 5], [550, 5]] +create_shop :npcs => [551, 552], :name => 'Varrock Swordshop', :items => [[1277, 5], [1279, 4], [1281, 4], [1283, 3], [1285, 3], [1287, 2], [1291, 4], [1293, 3], [1295, 3], [1297, 2], [1299, 2], [1301, 1], [1205, 10], [1203, 6], [1207, 5], [1217, 4], [1209, 3], [1211, 2]] +create_shop :npcs => [546], :name => 'Zaff\'s Superior Staffs!', :items => [[1391, 5], [1379, 5], [1389, 5], [1381, 2], [1383, 2], [1385, 2], [1387, 2]] diff --git a/data/plugins/shops/shop.rb b/data/plugins/shops/shop.rb index 3cb73a99..d455d27d 100644 --- a/data/plugins/shops/shop.rb +++ b/data/plugins/shops/shop.rb @@ -22,7 +22,7 @@ end private # The `Currency` used by default. -DEFAULT_CURRENCY = Currency.new(995, 'money') +DEFAULT_CURRENCY = Currency.new(995, 'coins') # The default capacity of a shop. DEFAULT_CAPACITY = 30 diff --git a/data/plugins/shops/shops.rb b/data/plugins/shops/shops.rb index f844ed7a..c34b0a89 100644 --- a/data/plugins/shops/shops.rb +++ b/data/plugins/shops/shops.rb @@ -190,7 +190,7 @@ on :message, :item_action do |player, message| next end - if !contains && inventory.free_space == 0 + if !contains && inventory.free_slots == 0 player.send_message('The shop is currently full at the moment.') message.terminate next @@ -237,7 +237,7 @@ def buy(shop, player, message, currency) option = message.option if option == 1 player.send_message("#{shop_item.name}: currently costs #{shop_item.cost} #{currency.name}.") - next + return end buy_amount = case option @@ -297,4 +297,4 @@ def buy(shop, player, message, currency) end # Declares the open_shop attribute, which contains the id of the currently open shop. -declare_attribute(:open_shop, -1) +declare_attribute(:open_shop, -1) \ No newline at end of file