mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-03 00:38:21 +00:00
Merge pull request #225 from Major-/shops
Create shops using npc/item names instead of ids
This commit is contained in:
@@ -11,21 +11,16 @@ spawn_npc name: :drunken_man, x: 2957, y: 3368, z: 1
|
||||
spawn_npc name: :dwarf_118, x: 3023, y: 3334
|
||||
spawn_npc name: :dwarf_118, x: 3027, y: 3341
|
||||
spawn_npc name: :dwarf_118, x: 3012, y: 3341
|
||||
|
||||
spawn_npc name: :dwarf_118, x: 3017, y: 3346, z: 1
|
||||
spawn_npc name: :dwarf_118, x: 3011, y: 3341, z: 1
|
||||
|
||||
spawn_npc name: :dwarf_121, x: 3027, y: 3341
|
||||
|
||||
spawn_npc name: :dwarf_382, x: 3017, y: 3340
|
||||
|
||||
spawn_npc name: :dwarf_121, x: 3027, y: 3341
|
||||
spawn_npc name: :dwarf_382, x: 3017, y: 3340
|
||||
spawn_npc name: :dwarf_3294, x: 3022, y: 3338
|
||||
|
||||
spawn_npc name: :dwarf_3295, x: 3021, y: 3341
|
||||
|
||||
spawn_npc name: :gardener, x: 2998, y: 3385
|
||||
spawn_npc name: :gardener, x: 3019, y: 3369
|
||||
|
||||
spawn_npc name: :gardener, x: 2998, y: 3385
|
||||
spawn_npc name: :gardener, x: 3019, y: 3369
|
||||
spawn_npc name: :gardener_3234, x: 3016, y: 3386
|
||||
|
||||
spawn_npc name: :guard, x: 2965, y: 3394
|
||||
@@ -45,7 +40,6 @@ spawn_npc name: :guard_3230, x: 2967, y: 3395
|
||||
spawn_npc name: :guard_3230, x: 2966, y: 3392
|
||||
spawn_npc name: :guard_3230, x: 2963, y: 3376
|
||||
spawn_npc name: :guard_3230, x: 2954, y: 3382
|
||||
|
||||
spawn_npc name: :guard_3231, x: 2950, y: 3377
|
||||
spawn_npc name: :guard_3231, x: 2968, y: 3381
|
||||
|
||||
@@ -67,7 +61,6 @@ spawn_npc name: :swan, x: 2976, y: 3358
|
||||
spawn_npc name: :swan, x: 2989, y: 3384
|
||||
|
||||
spawn_npc name: :man_3223, x: 2991, y: 3365
|
||||
|
||||
spawn_npc name: :man_3225, x: 3037, y: 3345, z: 1
|
||||
|
||||
spawn_npc name: :white_knight, x: 2983, y: 3343
|
||||
@@ -98,8 +91,7 @@ spawn_npc name: :white_knight_3348, x: 2964, y: 3337, z: 1
|
||||
|
||||
spawn_npc name: :white_knight_3349, x: 2989, y: 3344, z: 1
|
||||
|
||||
spawn_npc name: :white_knight, x: 2985, y: 3342, z: 2
|
||||
|
||||
spawn_npc name: :white_knight, x: 2985, y: 3342, z: 2
|
||||
spawn_npc name: :white_knight_3348, x: 2979, y: 3348, z: 2
|
||||
spawn_npc name: :white_knight_3348, x: 2974, y: 3329, z: 2
|
||||
spawn_npc name: :white_knight_3348, x: 2982, y: 3341, z: 2
|
||||
@@ -136,37 +128,30 @@ spawn_npc name: :banker, x: 3011, y: 3353, face: :north
|
||||
spawn_npc name: :banker, x: 3010, y: 3353, face: :north
|
||||
|
||||
spawn_npc name: :cassie, x: 2976, y: 3383
|
||||
|
||||
spawn_npc name: :emily, x: 2954, y: 3372
|
||||
|
||||
spawn_npc name: :flynn, x: 2950, y: 3387
|
||||
spawn_npc name: :emily, x: 2954, y: 3372
|
||||
spawn_npc name: :flynn, x: 2950, y: 3387
|
||||
|
||||
spawn_npc name: :hairdresser, x: 2944, y: 3380
|
||||
|
||||
spawn_npc name: :herquin, x: 2945, y: 3335
|
||||
|
||||
spawn_npc name: :heskel, x: 3007, y: 3374
|
||||
|
||||
spawn_npc name: :kaylee, x: 2957, y: 3372
|
||||
|
||||
spawn_npc name: :tina, x: 2955, y: 3371, z: 1
|
||||
|
||||
spawn_npc name: :tina, x: 2955, y: 3371, z: 1
|
||||
spawn_npc name: :tool_leprechaun, x: 3005, y: 3370
|
||||
|
||||
spawn_npc name: :sir_amik_varze, x: 2960, y: 3336, z: 2
|
||||
|
||||
spawn_npc name: :squire, x: 2977, y: 3343
|
||||
spawn_npc name: :sir_tiffy_cashien, x: 2997, y: 3373, face: :north
|
||||
|
||||
spawn_npc name: :sir_vyvin, x: 2983, y: 3335, z: 2
|
||||
spawn_npc name: :sir_amik_varze, x: 2960, y: 3336, z: 2
|
||||
spawn_npc name: :sir_vyvin, x: 2983, y: 3335, z: 2
|
||||
|
||||
spawn_npc name: :shop_asssistant_525, x: 2955, y: 3389
|
||||
|
||||
spawn_npc name: :shop_keeper_524, x: 2957, y: 3387
|
||||
|
||||
spawn_npc name: :squire, x: 2977, y: 3343
|
||||
spawn_npc name: :shop_keeper_524, x: 2957, y: 3387
|
||||
|
||||
spawn_npc name: :wayne, x: 2972, y: 3312
|
||||
|
||||
spawn_npc name: :workman_3236, x: 2975, y: 3369, z: 1
|
||||
|
||||
spawn_npc name: :wyson_the_gardener, x: 3028, y: 3381
|
||||
spawn_npc name: :wyson_the_gardener, x: 3028, y: 3381
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@ spawn_npc name: :giant_rat_87, x: 3267, y: 3381
|
||||
spawn_npc name: :guard_368, x: 3263, y: 3407, face: :south
|
||||
|
||||
spawn_npc name: :jeremy_clerksin, x: 3253, y: 3477
|
||||
|
||||
spawn_npc name: :martina_scorsby, x: 3256, y: 3481
|
||||
|
||||
spawn_npc name: :man, x: 3281, y: 3500
|
||||
@@ -38,7 +37,6 @@ spawn_npc name: :man, x: 3245, y: 3394
|
||||
spawn_npc name: :man, x: 3283, y: 3492, z: 1
|
||||
|
||||
spawn_npc name: :man_2, x: 3263, y: 3400
|
||||
|
||||
spawn_npc name: :man_3, x: 3227, y: 3395, z: 1
|
||||
spawn_npc name: :man_3, x: 3231, y: 3399, z: 1
|
||||
|
||||
@@ -235,18 +233,14 @@ spawn_npc name: :zaff, x: 3203, y: 3434
|
||||
# Juliet House
|
||||
|
||||
spawn_npc name: :draul_leptoc, x: 3228, y: 3475
|
||||
|
||||
spawn_npc name: :juliet, x: 3159, y: 3425, z: 1
|
||||
|
||||
spawn_npc name: :phillipa, x: 3160, y: 3429, z: 1
|
||||
spawn_npc name: :juliet, x: 3159, y: 3425, z: 1
|
||||
spawn_npc name: :phillipa, x: 3160, y: 3429, z: 1
|
||||
|
||||
# Gertrude House
|
||||
|
||||
spawn_npc name: :gertrude, x: 3153, y: 3413
|
||||
|
||||
spawn_npc name: :kanel, x: 3155, y: 3405, face: :east
|
||||
|
||||
spawn_npc name: :philop, x: 3150, y: 3405, face: :south
|
||||
spawn_npc name: :kanel, x: 3155, y: 3405, face: :east
|
||||
spawn_npc name: :philop, x: 3150, y: 3405, face: :south
|
||||
|
||||
# Small Bank
|
||||
|
||||
@@ -261,4 +255,4 @@ spawn_npc name: :banker_494, x: 3187, y: 3436, face: :west
|
||||
spawn_npc name: :banker_495, x: 3187, y: 3438, face: :west
|
||||
spawn_npc name: :banker_494, x: 3187, y: 3440, face: :west
|
||||
spawn_npc name: :banker_495, x: 3187, y: 3442, face: :west
|
||||
spawn_npc name: :banker_494, x: 3187, y: 3444, face: :west
|
||||
spawn_npc name: :banker_494, x: 3187, y: 3444, face: :west
|
||||
|
||||
@@ -1,7 +1,44 @@
|
||||
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]]
|
||||
|
||||
create_shop npcs: :aubury, name: "Aubury's Rune Shop.", items: [
|
||||
[:fire_rune, 5_000], [:water_rune, 5_000], [:air_rune, 5_000], [:earth_rune, 5_000],
|
||||
[:mind_rune, 5_000], [:body_rune, 5_000 ], [:chaos_rune, 250], [:death_rune, 250 ]
|
||||
]
|
||||
|
||||
create_shop npcs: :lowe, name: "Lowe's Archery Emporium", items: [
|
||||
[:bronze_arrow, 2_000], [:iron_arrow, 1_500], [:steel_arrow, 1_000],
|
||||
[:mithril_arrow, 800], [:adamant_arrow, 600], [:shortbow, 4], [:longbow, 4],
|
||||
[:oak_shortbow, 3], [:oak_longbow, 3], [:willow_shortbow, 2], [:willow_longbow, 2],
|
||||
[:maple_shortbow, 1], [:maple_longbow, 1], [:crossbow, 2]
|
||||
]
|
||||
|
||||
create_shop npcs: :horvik, buys: :all, name: "Horvik's Armour Shop.", items: [
|
||||
[:bronze_chainbody, 5], [:iron_chainbody, 3], [:steel_chainbody, 3],
|
||||
[:mithril_chainbody, 1], [:bronze_platebody, 3], [:iron_platebody, 1],
|
||||
[:steel_platebody, 1], [:black_platebody, 1], [:mithril_platebody, 1],
|
||||
[:iron_platelegs, 1], [:studded_body, 1], [:studded_chaps, 1]
|
||||
]
|
||||
|
||||
create_shop npcs: :thessalia, name: "Thessalia's Fine Clothes.", items: [
|
||||
[:white_apron, 3], [:leather_body, 12], [:leather_gloves, 10], [:leather_boots, 10],
|
||||
[:brown_apron, 1], [:pink_skirt, 5], [:black_skirt, 3], [:blue_skirt, 2], [:cape, 4],
|
||||
[:silk, 5], [:priest_gown_428, 3], [:priest_gown_426, 3]
|
||||
]
|
||||
|
||||
create_shop npcs: [:shop_keeper_522, :shop_assistant_523], buys: :all,
|
||||
name: 'Varrock General Store', items: [
|
||||
[:pot, 5], [:jug, 2], [:shears, 2], [:bucket, 3], [:bowl, 2], [:cake_tin, 2],
|
||||
[:tinderbox, 2], [:chisel, 2], [:hammer, 5], [:newcomer_map, 5]
|
||||
]
|
||||
|
||||
create_shop npcs: [:shop_keeper_551, :shop_assistant_552], name: 'Varrock Swordshop', items: [
|
||||
[:bronze_sword, 5], [:iron_sword, 4], [:steel_sword, 4], [:black_sword, 3],
|
||||
[:mithril_sword, 3], [:adamant_sword, 2], [:bronze_longsword, 4], [:iron_longsword, 3],
|
||||
[:steel_longsword, 3], [:black_longsword, 2], [:mithril_longsword, 2],
|
||||
[:adamant_longsword, 1], [:bronze_dagger, 10], [:iron_dagger, 6], [:steel_dagger, 5],
|
||||
[:black_dagger, 4], [:mithril_dagger, 3], [:adamant_dagger, 2]
|
||||
]
|
||||
|
||||
create_shop npcs: :zaff, name: "Zaff's Superior Staffs!", items: [
|
||||
[:battlestaff, 5], [:staff, 5], [:magic_staff, 5], [:staff_of_air, 2],
|
||||
[:staff_of_water, 2], [:staff_of_earth, 2], [:staff_of_fire, 2]
|
||||
]
|
||||
|
||||
@@ -18,15 +18,16 @@ def create_shop(hash)
|
||||
end
|
||||
|
||||
npcs, name = hash[:npcs], hash[:name]
|
||||
npcs = [npcs] unless npcs.is_a?(Array)
|
||||
currency = hash[:currency] || DEFAULT_CURRENCY
|
||||
|
||||
options = hash[:npc_options] || [1]
|
||||
buys = hash[:buys] || :own
|
||||
|
||||
items = hash.delete(:items).collect { |data| ShopItem.new(*data) }
|
||||
items = hash.delete(:items).collect { |data| ShopItem.new(lookup_item(data[0]), data[1]) }
|
||||
shop = Shop.new(name, items, currency, options, buys)
|
||||
|
||||
npcs.each { |npc| SHOPS[npc] = shop }
|
||||
npcs.map { |name| lookup_npc(name) }.each { |npc| SHOPS[npc] = shop }
|
||||
end
|
||||
|
||||
private
|
||||
@@ -297,4 +298,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)
|
||||
|
||||
Reference in New Issue
Block a user