From 2699d41a092adc672cd0cbc5235b5ff08ae754cf Mon Sep 17 00:00:00 2001 From: Shaun Prince Date: Sun, 31 Oct 2021 14:21:21 -0700 Subject: [PATCH] UPdating for SRT V1.7.1 --- defaults/oxide/config/Shop.json | 1539 ++++++---------------------- defaults/oxide/data/Kits/Kits.json | 219 ++++ defaults/oxide/data/Shop.json | 66 ++ defaults/oxide/plugins/Shop.cs | 932 +++++++++++------ 4 files changed, 1177 insertions(+), 1579 deletions(-) create mode 100644 defaults/oxide/data/Shop.json diff --git a/defaults/oxide/config/Shop.json b/defaults/oxide/config/Shop.json index 271b2255..125cea2d 100644 --- a/defaults/oxide/config/Shop.json +++ b/defaults/oxide/config/Shop.json @@ -42,7 +42,7 @@ "Skin": 0, "Amount": 1, "Price": 100.0, - "Sell Price": 100.0, + "Sell Price": 10.0, "Buy Cooldown (0 - disable)": 0.0, "Sell Cooldown (0 - disable)": 0.0, "Discount (%)": { @@ -65,8 +65,8 @@ "ShortName": "diving.fins", "Skin": 0, "Amount": 1, - "Price": 100.0, - "Sell Price": 100.0, + "Price": 10.0, + "Sell Price": 1.0, "Buy Cooldown (0 - disable)": 0.0, "Sell Cooldown (0 - disable)": 0.0, "Discount (%)": { @@ -89,8 +89,8 @@ "ShortName": "diving.mask", "Skin": 0, "Amount": 1, - "Price": 100.0, - "Sell Price": 100.0, + "Price": 10.0, + "Sell Price": 1.0, "Buy Cooldown (0 - disable)": 0.0, "Sell Cooldown (0 - disable)": 0.0, "Discount (%)": { @@ -114,7 +114,7 @@ "Skin": 0, "Amount": 1, "Price": 100.0, - "Sell Price": 100.0, + "Sell Price": 10.0, "Buy Cooldown (0 - disable)": 0.0, "Sell Cooldown (0 - disable)": 0.0, "Discount (%)": { @@ -137,8 +137,8 @@ "ShortName": "diving.wetsuit", "Skin": 0, "Amount": 1, - "Price": 100.0, - "Sell Price": 100.0, + "Price": 10.0, + "Sell Price": 1.0, "Buy Cooldown (0 - disable)": 0.0, "Sell Cooldown (0 - disable)": 0.0, "Discount (%)": { @@ -172,7 +172,7 @@ }, { "Type": "Item", - "ID": 6, + "ID": 10, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -182,7 +182,7 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "ghostsheet", + "ShortName": "mask.bandana", "Skin": 0, "Amount": 1, "Price": 100.0, @@ -196,7 +196,7 @@ }, { "Type": "Item", - "ID": 7, + "ID": 11, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -206,7 +206,7 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "halloween.mummysuit", + "ShortName": "attire.ninja.suit", "Skin": 0, "Amount": 1, "Price": 100.0, @@ -220,7 +220,7 @@ }, { "Type": "Item", - "ID": 8, + "ID": 13, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -230,7 +230,7 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "scarecrow.suit", + "ShortName": "hazmatsuit", "Skin": 0, "Amount": 1, "Price": 100.0, @@ -244,7 +244,7 @@ }, { "Type": "Item", - "ID": 9, + "ID": 21, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -254,7 +254,7 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "hat.miner", + "ShortName": "sunglasses", "Skin": 0, "Amount": 1, "Price": 100.0, @@ -265,10 +265,23 @@ "shop.default": 0, "shop.vip": 10 } - }, + } + ] + }, + { + "Enabled": true, + "Title": "Misc", + "Permission": "", + "Items": [] + }, + { + "Enabled": true, + "Title": "Items", + "Permission": "", + "Items": [ { "Type": "Item", - "ID": 10, + "ID": 22, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -278,7 +291,7 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "mask.bandana", + "ShortName": "composter", "Skin": 0, "Amount": 1, "Price": 100.0, @@ -292,7 +305,7 @@ }, { "Type": "Item", - "ID": 11, + "ID": 23, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -302,7 +315,7 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "attire.ninja.suit", + "ShortName": "water.barrel", "Skin": 0, "Amount": 1, "Price": 100.0, @@ -316,7 +329,7 @@ }, { "Type": "Item", - "ID": 12, + "ID": 24, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -326,7 +339,7 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "attire.banditguard", + "ShortName": "planter.large", "Skin": 0, "Amount": 1, "Price": 100.0, @@ -337,10 +350,17 @@ "shop.default": 0, "shop.vip": 10 } - }, + } + ] + }, + { + "Enabled": true, + "Title": "Ammunition", + "Permission": "", + "Items": [ { "Type": "Item", - "ID": 13, + "ID": 27, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -350,10 +370,10 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "hazmatsuit", + "ShortName": "ammo.grenadelauncher.buckshot", "Skin": 0, "Amount": 1, - "Price": 100.0, + "Price": 500.0, "Sell Price": 100.0, "Buy Cooldown (0 - disable)": 0.0, "Sell Cooldown (0 - disable)": 0.0, @@ -364,7 +384,7 @@ }, { "Type": "Item", - "ID": 14, + "ID": 28, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -374,10 +394,10 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "hazmatsuit_scientist", + "ShortName": "ammo.grenadelauncher.he", "Skin": 0, "Amount": 1, - "Price": 100.0, + "Price": 1000.0, "Sell Price": 100.0, "Buy Cooldown (0 - disable)": 0.0, "Sell Cooldown (0 - disable)": 0.0, @@ -388,7 +408,7 @@ }, { "Type": "Item", - "ID": 15, + "ID": 29, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -398,10 +418,10 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "hazmatsuit_scientist_peacekeeper", + "ShortName": "ammo.grenadelauncher.smoke", "Skin": 0, "Amount": 1, - "Price": 100.0, + "Price": 500.0, "Sell Price": 100.0, "Buy Cooldown (0 - disable)": 0.0, "Sell Cooldown (0 - disable)": 0.0, @@ -412,7 +432,7 @@ }, { "Type": "Item", - "ID": 16, + "ID": 31, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -422,11 +442,11 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "scientistsuit_heavy", + "ShortName": "arrow.wooden", "Skin": 0, "Amount": 1, - "Price": 100.0, - "Sell Price": 100.0, + "Price": 1.0, + "Sell Price": 1.0, "Buy Cooldown (0 - disable)": 0.0, "Sell Cooldown (0 - disable)": 0.0, "Discount (%)": { @@ -436,7 +456,7 @@ }, { "Type": "Item", - "ID": 17, + "ID": 32, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -446,11 +466,11 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "jumpsuit.suit.blue", + "ShortName": "arrow.fire", "Skin": 0, "Amount": 1, - "Price": 100.0, - "Sell Price": 100.0, + "Price": 1.0, + "Sell Price": 1.0, "Buy Cooldown (0 - disable)": 0.0, "Sell Cooldown (0 - disable)": 0.0, "Discount (%)": { @@ -460,7 +480,7 @@ }, { "Type": "Item", - "ID": 18, + "ID": 33, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -470,11 +490,11 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "jumpsuit.suit", + "ShortName": "ammo.pistol", "Skin": 0, - "Amount": 1, - "Price": 100.0, - "Sell Price": 100.0, + "Amount": 10, + "Price": 10.0, + "Sell Price": 1.0, "Buy Cooldown (0 - disable)": 0.0, "Sell Cooldown (0 - disable)": 0.0, "Discount (%)": { @@ -484,7 +504,7 @@ }, { "Type": "Item", - "ID": 19, + "ID": 35, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -494,11 +514,11 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "attire.bunny.onesie", + "ShortName": "ammo.rifle", "Skin": 0, - "Amount": 1, - "Price": 100.0, - "Sell Price": 100.0, + "Amount": 10, + "Price": 10.0, + "Sell Price": 1.0, "Buy Cooldown (0 - disable)": 0.0, "Sell Cooldown (0 - disable)": 0.0, "Discount (%)": { @@ -508,7 +528,7 @@ }, { "Type": "Item", - "ID": 20, + "ID": 36, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -518,11 +538,11 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "halloween.surgeonsuit", + "ShortName": "ammo.rifle.explosive", "Skin": 0, - "Amount": 1, + "Amount": 10, "Price": 100.0, - "Sell Price": 100.0, + "Sell Price": 10.0, "Buy Cooldown (0 - disable)": 0.0, "Sell Cooldown (0 - disable)": 0.0, "Discount (%)": { @@ -532,7 +552,7 @@ }, { "Type": "Item", - "ID": 21, + "ID": 37, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -542,34 +562,21 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "sunglasses", + "ShortName": "ammo.rifle.hv", "Skin": 0, - "Amount": 1, - "Price": 100.0, - "Sell Price": 100.0, + "Amount": 10, + "Price": 10.0, + "Sell Price": 1.0, "Buy Cooldown (0 - disable)": 0.0, "Sell Cooldown (0 - disable)": 0.0, "Discount (%)": { "shop.default": 0, "shop.vip": 10 } - } - ] - }, - { - "Enabled": true, - "Title": "Misc", - "Permission": "", - "Items": [] - }, - { - "Enabled": true, - "Title": "Items", - "Permission": "", - "Items": [ + }, { "Type": "Item", - "ID": 22, + "ID": 38, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -579,11 +586,11 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "composter", + "ShortName": "ammo.shotgun", "Skin": 0, - "Amount": 1, - "Price": 100.0, - "Sell Price": 100.0, + "Amount": 10, + "Price": 10.0, + "Sell Price": 1.0, "Buy Cooldown (0 - disable)": 0.0, "Sell Cooldown (0 - disable)": 0.0, "Discount (%)": { @@ -593,7 +600,7 @@ }, { "Type": "Item", - "ID": 23, + "ID": 39, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -603,11 +610,11 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "water.barrel", + "ShortName": "ammo.shotgun.slug", "Skin": 0, - "Amount": 1, - "Price": 100.0, - "Sell Price": 100.0, + "Amount": 10, + "Price": 10.0, + "Sell Price": 1.0, "Buy Cooldown (0 - disable)": 0.0, "Sell Cooldown (0 - disable)": 0.0, "Discount (%)": { @@ -617,7 +624,7 @@ }, { "Type": "Item", - "ID": 24, + "ID": 40, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -627,21 +634,28 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "planter.large", + "ShortName": "speargun.spear", "Skin": 0, - "Amount": 1, - "Price": 100.0, - "Sell Price": 100.0, + "Amount": 10, + "Price": 10.0, + "Sell Price": 1.0, "Buy Cooldown (0 - disable)": 0.0, "Sell Cooldown (0 - disable)": 0.0, "Discount (%)": { "shop.default": 0, "shop.vip": 10 } - }, + } + ] + }, + { + "Enabled": true, + "Title": "Construction", + "Permission": "", + "Items": [ { "Type": "Item", - "ID": 25, + "ID": 41, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -651,7 +665,7 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "sleepingbag", + "ShortName": "wall.external.high", "Skin": 0, "Amount": 1, "Price": 100.0, @@ -665,7 +679,7 @@ }, { "Type": "Item", - "ID": 26, + "ID": 45, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -675,11 +689,11 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "sofa", + "ShortName": "ladder.wooden.wall", "Skin": 0, "Amount": 1, - "Price": 100.0, - "Sell Price": 100.0, + "Price": 2.0, + "Sell Price": 1.0, "Buy Cooldown (0 - disable)": 0.0, "Sell Cooldown (0 - disable)": 0.0, "Discount (%)": { @@ -691,12 +705,12 @@ }, { "Enabled": true, - "Title": "Ammunition", + "Title": "Component", "Permission": "", "Items": [ { "Type": "Item", - "ID": 27, + "ID": 45, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -706,7 +720,7 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "ammo.grenadelauncher.buckshot", + "ShortName": "carburetor3", "Skin": 0, "Amount": 1, "Price": 100.0, @@ -720,7 +734,7 @@ }, { "Type": "Item", - "ID": 28, + "ID": 46, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -730,7 +744,7 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "ammo.grenadelauncher.he", + "ShortName": "crankshaft3", "Skin": 0, "Amount": 1, "Price": 100.0, @@ -744,7 +758,7 @@ }, { "Type": "Item", - "ID": 29, + "ID": 47, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -754,7 +768,7 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "ammo.grenadelauncher.smoke", + "ShortName": "piston3", "Skin": 0, "Amount": 1, "Price": 100.0, @@ -768,7 +782,7 @@ }, { "Type": "Item", - "ID": 30, + "ID": 48, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -778,7 +792,7 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "arrow.hv", + "ShortName": "sparkplug3", "Skin": 0, "Amount": 1, "Price": 100.0, @@ -792,7 +806,7 @@ }, { "Type": "Item", - "ID": 31, + "ID": 49, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -802,7 +816,7 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "arrow.wooden", + "ShortName": "valve3", "Skin": 0, "Amount": 1, "Price": 100.0, @@ -816,7 +830,7 @@ }, { "Type": "Item", - "ID": 32, + "ID": 50, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -826,7 +840,7 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "arrow.fire", + "ShortName": "metalpipe", "Skin": 0, "Amount": 1, "Price": 100.0, @@ -840,7 +854,7 @@ }, { "Type": "Item", - "ID": 33, + "ID": 51, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -850,7 +864,7 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "ammo.pistol", + "ShortName": "roadsigns", "Skin": 0, "Amount": 1, "Price": 100.0, @@ -864,7 +878,7 @@ }, { "Type": "Item", - "ID": 34, + "ID": 52, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -874,7 +888,7 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "ammo.pistol.fire", + "ShortName": "sewingkit", "Skin": 0, "Amount": 1, "Price": 100.0, @@ -888,7 +902,7 @@ }, { "Type": "Item", - "ID": 35, + "ID": 53, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -898,7 +912,7 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "ammo.rifle", + "ShortName": "metalspring", "Skin": 0, "Amount": 1, "Price": 100.0, @@ -912,7 +926,7 @@ }, { "Type": "Item", - "ID": 36, + "ID": 54, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -922,7 +936,7 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "ammo.rifle.explosive", + "ShortName": "techparts", "Skin": 0, "Amount": 1, "Price": 100.0, @@ -936,7 +950,7 @@ }, { "Type": "Item", - "ID": 37, + "ID": 55, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -946,7 +960,7 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "ammo.rifle.hv", + "ShortName": "riflebody", "Skin": 0, "Amount": 1, "Price": 100.0, @@ -960,7 +974,7 @@ }, { "Type": "Item", - "ID": 38, + "ID": 56, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -970,7 +984,7 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "ammo.shotgun", + "ShortName": "smgbody", "Skin": 0, "Amount": 1, "Price": 100.0, @@ -981,10 +995,23 @@ "shop.default": 0, "shop.vip": 10 } - }, + } + ] + }, + { + "Enabled": true, + "Title": "Traps", + "Permission": "", + "Items": [] + }, + { + "Enabled": true, + "Title": "Electrical", + "Permission": "", + "Items": [ { "Type": "Item", - "ID": 39, + "ID": 58, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -994,7 +1021,7 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "ammo.shotgun.slug", + "ShortName": "computerstation", "Skin": 0, "Amount": 1, "Price": 100.0, @@ -1008,7 +1035,7 @@ }, { "Type": "Item", - "ID": 40, + "ID": 59, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -1018,7 +1045,7 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "speargun.spear", + "ShortName": "electric.battery.rechargable.large", "Skin": 0, "Amount": 1, "Price": 100.0, @@ -1029,17 +1056,10 @@ "shop.default": 0, "shop.vip": 10 } - } - ] - }, - { - "Enabled": true, - "Title": "Construction", - "Permission": "", - "Items": [ + }, { "Type": "Item", - "ID": 41, + "ID": 64, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -1049,7 +1069,7 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "wall.external.high", + "ShortName": "electric.solarpanel.large", "Skin": 0, "Amount": 1, "Price": 100.0, @@ -1063,7 +1083,7 @@ }, { "Type": "Item", - "ID": 42, + "ID": 69, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -1073,7 +1093,7 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "cupboard.tool", + "ShortName": "generator.wind.scrap", "Skin": 0, "Amount": 1, "Price": 100.0, @@ -1084,10 +1104,17 @@ "shop.default": 0, "shop.vip": 10 } - }, + } + ] + }, + { + "Enabled": true, + "Title": "Fun", + "Permission": "", + "Items": [ { "Type": "Item", - "ID": 43, + "ID": 72, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -1097,7 +1124,7 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "lock.code", + "ShortName": "firework.boomer.champagne", "Skin": 0, "Amount": 1, "Price": 100.0, @@ -1111,7 +1138,7 @@ }, { "Type": "Item", - "ID": 44, + "ID": 73, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -1121,7 +1148,7 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "building.planner", + "ShortName": "abovegroundpool", "Skin": 0, "Amount": 1, "Price": 100.0, @@ -1135,7 +1162,7 @@ }, { "Type": "Item", - "ID": 45, + "ID": 74, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -1145,977 +1172,7 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "ladder.wooden.wall", - "Skin": 0, - "Amount": 1, - "Price": 2.0, - "Sell Price": 1.0, - "Buy Cooldown (0 - disable)": 0.0, - "Sell Cooldown (0 - disable)": 0.0, - "Discount (%)": { - "shop.default": 0, - "shop.vip": 10 - } - } - ] - }, - { - "Enabled": true, - "Title": "Component", - "Permission": "", - "Items": [ - { - "Type": "Item", - "ID": 45, - "Image": "", - "Title": "", - "Command (%steamid%)": "", - "Plugin": { - "Hook": null, - "Plugin Name": null, - "Amount": 0 - }, - "DisplayName (empty - default)": "", - "ShortName": "carburetor3", - "Skin": 0, - "Amount": 1, - "Price": 100.0, - "Sell Price": 100.0, - "Buy Cooldown (0 - disable)": 0.0, - "Sell Cooldown (0 - disable)": 0.0, - "Discount (%)": { - "shop.default": 0, - "shop.vip": 10 - } - }, - { - "Type": "Item", - "ID": 46, - "Image": "", - "Title": "", - "Command (%steamid%)": "", - "Plugin": { - "Hook": null, - "Plugin Name": null, - "Amount": 0 - }, - "DisplayName (empty - default)": "", - "ShortName": "crankshaft3", - "Skin": 0, - "Amount": 1, - "Price": 100.0, - "Sell Price": 100.0, - "Buy Cooldown (0 - disable)": 0.0, - "Sell Cooldown (0 - disable)": 0.0, - "Discount (%)": { - "shop.default": 0, - "shop.vip": 10 - } - }, - { - "Type": "Item", - "ID": 47, - "Image": "", - "Title": "", - "Command (%steamid%)": "", - "Plugin": { - "Hook": null, - "Plugin Name": null, - "Amount": 0 - }, - "DisplayName (empty - default)": "", - "ShortName": "piston3", - "Skin": 0, - "Amount": 1, - "Price": 100.0, - "Sell Price": 100.0, - "Buy Cooldown (0 - disable)": 0.0, - "Sell Cooldown (0 - disable)": 0.0, - "Discount (%)": { - "shop.default": 0, - "shop.vip": 10 - } - }, - { - "Type": "Item", - "ID": 48, - "Image": "", - "Title": "", - "Command (%steamid%)": "", - "Plugin": { - "Hook": null, - "Plugin Name": null, - "Amount": 0 - }, - "DisplayName (empty - default)": "", - "ShortName": "sparkplug3", - "Skin": 0, - "Amount": 1, - "Price": 100.0, - "Sell Price": 100.0, - "Buy Cooldown (0 - disable)": 0.0, - "Sell Cooldown (0 - disable)": 0.0, - "Discount (%)": { - "shop.default": 0, - "shop.vip": 10 - } - }, - { - "Type": "Item", - "ID": 49, - "Image": "", - "Title": "", - "Command (%steamid%)": "", - "Plugin": { - "Hook": null, - "Plugin Name": null, - "Amount": 0 - }, - "DisplayName (empty - default)": "", - "ShortName": "valve3", - "Skin": 0, - "Amount": 1, - "Price": 100.0, - "Sell Price": 100.0, - "Buy Cooldown (0 - disable)": 0.0, - "Sell Cooldown (0 - disable)": 0.0, - "Discount (%)": { - "shop.default": 0, - "shop.vip": 10 - } - }, - { - "Type": "Item", - "ID": 50, - "Image": "", - "Title": "", - "Command (%steamid%)": "", - "Plugin": { - "Hook": null, - "Plugin Name": null, - "Amount": 0 - }, - "DisplayName (empty - default)": "", - "ShortName": "metalpipe", - "Skin": 0, - "Amount": 1, - "Price": 100.0, - "Sell Price": 100.0, - "Buy Cooldown (0 - disable)": 0.0, - "Sell Cooldown (0 - disable)": 0.0, - "Discount (%)": { - "shop.default": 0, - "shop.vip": 10 - } - }, - { - "Type": "Item", - "ID": 51, - "Image": "", - "Title": "", - "Command (%steamid%)": "", - "Plugin": { - "Hook": null, - "Plugin Name": null, - "Amount": 0 - }, - "DisplayName (empty - default)": "", - "ShortName": "roadsigns", - "Skin": 0, - "Amount": 1, - "Price": 100.0, - "Sell Price": 100.0, - "Buy Cooldown (0 - disable)": 0.0, - "Sell Cooldown (0 - disable)": 0.0, - "Discount (%)": { - "shop.default": 0, - "shop.vip": 10 - } - }, - { - "Type": "Item", - "ID": 52, - "Image": "", - "Title": "", - "Command (%steamid%)": "", - "Plugin": { - "Hook": null, - "Plugin Name": null, - "Amount": 0 - }, - "DisplayName (empty - default)": "", - "ShortName": "sewingkit", - "Skin": 0, - "Amount": 1, - "Price": 100.0, - "Sell Price": 100.0, - "Buy Cooldown (0 - disable)": 0.0, - "Sell Cooldown (0 - disable)": 0.0, - "Discount (%)": { - "shop.default": 0, - "shop.vip": 10 - } - }, - { - "Type": "Item", - "ID": 53, - "Image": "", - "Title": "", - "Command (%steamid%)": "", - "Plugin": { - "Hook": null, - "Plugin Name": null, - "Amount": 0 - }, - "DisplayName (empty - default)": "", - "ShortName": "metalspring", - "Skin": 0, - "Amount": 1, - "Price": 100.0, - "Sell Price": 100.0, - "Buy Cooldown (0 - disable)": 0.0, - "Sell Cooldown (0 - disable)": 0.0, - "Discount (%)": { - "shop.default": 0, - "shop.vip": 10 - } - }, - { - "Type": "Item", - "ID": 54, - "Image": "", - "Title": "", - "Command (%steamid%)": "", - "Plugin": { - "Hook": null, - "Plugin Name": null, - "Amount": 0 - }, - "DisplayName (empty - default)": "", - "ShortName": "techparts", - "Skin": 0, - "Amount": 1, - "Price": 100.0, - "Sell Price": 100.0, - "Buy Cooldown (0 - disable)": 0.0, - "Sell Cooldown (0 - disable)": 0.0, - "Discount (%)": { - "shop.default": 0, - "shop.vip": 10 - } - }, - { - "Type": "Item", - "ID": 55, - "Image": "", - "Title": "", - "Command (%steamid%)": "", - "Plugin": { - "Hook": null, - "Plugin Name": null, - "Amount": 0 - }, - "DisplayName (empty - default)": "", - "ShortName": "riflebody", - "Skin": 0, - "Amount": 1, - "Price": 100.0, - "Sell Price": 100.0, - "Buy Cooldown (0 - disable)": 0.0, - "Sell Cooldown (0 - disable)": 0.0, - "Discount (%)": { - "shop.default": 0, - "shop.vip": 10 - } - }, - { - "Type": "Item", - "ID": 56, - "Image": "", - "Title": "", - "Command (%steamid%)": "", - "Plugin": { - "Hook": null, - "Plugin Name": null, - "Amount": 0 - }, - "DisplayName (empty - default)": "", - "ShortName": "smgbody", - "Skin": 0, - "Amount": 1, - "Price": 100.0, - "Sell Price": 100.0, - "Buy Cooldown (0 - disable)": 0.0, - "Sell Cooldown (0 - disable)": 0.0, - "Discount (%)": { - "shop.default": 0, - "shop.vip": 10 - } - } - ] - }, - { - "Enabled": true, - "Title": "Traps", - "Permission": "", - "Items": [] - }, - { - "Enabled": true, - "Title": "Electrical", - "Permission": "", - "Items": [ - { - "Type": "Item", - "ID": 57, - "Image": "", - "Title": "", - "Command (%steamid%)": "", - "Plugin": { - "Hook": null, - "Plugin Name": null, - "Amount": 0 - }, - "DisplayName (empty - default)": "", - "ShortName": "ceilinglight", - "Skin": 0, - "Amount": 1, - "Price": 100.0, - "Sell Price": 100.0, - "Buy Cooldown (0 - disable)": 0.0, - "Sell Cooldown (0 - disable)": 0.0, - "Discount (%)": { - "shop.default": 0, - "shop.vip": 10 - } - }, - { - "Type": "Item", - "ID": 58, - "Image": "", - "Title": "", - "Command (%steamid%)": "", - "Plugin": { - "Hook": null, - "Plugin Name": null, - "Amount": 0 - }, - "DisplayName (empty - default)": "", - "ShortName": "computerstation", - "Skin": 0, - "Amount": 1, - "Price": 100.0, - "Sell Price": 100.0, - "Buy Cooldown (0 - disable)": 0.0, - "Sell Cooldown (0 - disable)": 0.0, - "Discount (%)": { - "shop.default": 0, - "shop.vip": 10 - } - }, - { - "Type": "Item", - "ID": 59, - "Image": "", - "Title": "", - "Command (%steamid%)": "", - "Plugin": { - "Hook": null, - "Plugin Name": null, - "Amount": 0 - }, - "DisplayName (empty - default)": "", - "ShortName": "electric.battery.rechargable.large", - "Skin": 0, - "Amount": 1, - "Price": 100.0, - "Sell Price": 100.0, - "Buy Cooldown (0 - disable)": 0.0, - "Sell Cooldown (0 - disable)": 0.0, - "Discount (%)": { - "shop.default": 0, - "shop.vip": 10 - } - }, - { - "Type": "Item", - "ID": 60, - "Image": "", - "Title": "", - "Command (%steamid%)": "", - "Plugin": { - "Hook": null, - "Plugin Name": null, - "Amount": 0 - }, - "DisplayName (empty - default)": "", - "ShortName": "electric.counter", - "Skin": 0, - "Amount": 1, - "Price": 100.0, - "Sell Price": 100.0, - "Buy Cooldown (0 - disable)": 0.0, - "Sell Cooldown (0 - disable)": 0.0, - "Discount (%)": { - "shop.default": 0, - "shop.vip": 10 - } - }, - { - "Type": "Item", - "ID": 61, - "Image": "", - "Title": "", - "Command (%steamid%)": "", - "Plugin": { - "Hook": null, - "Plugin Name": null, - "Amount": 0 - }, - "DisplayName (empty - default)": "", - "ShortName": "fluid.switch", - "Skin": 0, - "Amount": 1, - "Price": 100.0, - "Sell Price": 100.0, - "Buy Cooldown (0 - disable)": 0.0, - "Sell Cooldown (0 - disable)": 0.0, - "Discount (%)": { - "shop.default": 0, - "shop.vip": 10 - } - }, - { - "Type": "Item", - "ID": 62, - "Image": "", - "Title": "", - "Command (%steamid%)": "", - "Plugin": { - "Hook": null, - "Plugin Name": null, - "Amount": 0 - }, - "DisplayName (empty - default)": "", - "ShortName": "electrical.branch", - "Skin": 0, - "Amount": 1, - "Price": 100.0, - "Sell Price": 100.0, - "Buy Cooldown (0 - disable)": 0.0, - "Sell Cooldown (0 - disable)": 0.0, - "Discount (%)": { - "shop.default": 0, - "shop.vip": 10 - } - }, - { - "Type": "Item", - "ID": 63, - "Image": "", - "Title": "", - "Command (%steamid%)": "", - "Plugin": { - "Hook": null, - "Plugin Name": null, - "Amount": 0 - }, - "DisplayName (empty - default)": "", - "ShortName": "electrical.combiner", - "Skin": 0, - "Amount": 1, - "Price": 100.0, - "Sell Price": 100.0, - "Buy Cooldown (0 - disable)": 0.0, - "Sell Cooldown (0 - disable)": 0.0, - "Discount (%)": { - "shop.default": 0, - "shop.vip": 10 - } - }, - { - "Type": "Item", - "ID": 64, - "Image": "", - "Title": "", - "Command (%steamid%)": "", - "Plugin": { - "Hook": null, - "Plugin Name": null, - "Amount": 0 - }, - "DisplayName (empty - default)": "", - "ShortName": "electric.solarpanel.large", - "Skin": 0, - "Amount": 1, - "Price": 100.0, - "Sell Price": 100.0, - "Buy Cooldown (0 - disable)": 0.0, - "Sell Cooldown (0 - disable)": 0.0, - "Discount (%)": { - "shop.default": 0, - "shop.vip": 10 - } - }, - { - "Type": "Item", - "ID": 65, - "Image": "", - "Title": "", - "Command (%steamid%)": "", - "Plugin": { - "Hook": null, - "Plugin Name": null, - "Amount": 0 - }, - "DisplayName (empty - default)": "", - "ShortName": "electric.switch", - "Skin": 0, - "Amount": 1, - "Price": 100.0, - "Sell Price": 100.0, - "Buy Cooldown (0 - disable)": 0.0, - "Sell Cooldown (0 - disable)": 0.0, - "Discount (%)": { - "shop.default": 0, - "shop.vip": 10 - } - }, - { - "Type": "Item", - "ID": 66, - "Image": "", - "Title": "", - "Command (%steamid%)": "", - "Plugin": { - "Hook": null, - "Plugin Name": null, - "Amount": 0 - }, - "DisplayName (empty - default)": "", - "ShortName": "electric.splitter", - "Skin": 0, - "Amount": 1, - "Price": 100.0, - "Sell Price": 100.0, - "Buy Cooldown (0 - disable)": 0.0, - "Sell Cooldown (0 - disable)": 0.0, - "Discount (%)": { - "shop.default": 0, - "shop.vip": 10 - } - }, - { - "Type": "Item", - "ID": 67, - "Image": "", - "Title": "", - "Command (%steamid%)": "", - "Plugin": { - "Hook": null, - "Plugin Name": null, - "Amount": 0 - }, - "DisplayName (empty - default)": "", - "ShortName": "electric.sprinkler", - "Skin": 0, - "Amount": 1, - "Price": 100.0, - "Sell Price": 100.0, - "Buy Cooldown (0 - disable)": 0.0, - "Sell Cooldown (0 - disable)": 0.0, - "Discount (%)": { - "shop.default": 0, - "shop.vip": 10 - } - }, - { - "Type": "Item", - "ID": 68, - "Image": "", - "Title": "", - "Command (%steamid%)": "", - "Plugin": { - "Hook": null, - "Plugin Name": null, - "Amount": 0 - }, - "DisplayName (empty - default)": "", - "ShortName": "waterpump", - "Skin": 0, - "Amount": 1, - "Price": 100.0, - "Sell Price": 100.0, - "Buy Cooldown (0 - disable)": 0.0, - "Sell Cooldown (0 - disable)": 0.0, - "Discount (%)": { - "shop.default": 0, - "shop.vip": 10 - } - }, - { - "Type": "Item", - "ID": 69, - "Image": "", - "Title": "", - "Command (%steamid%)": "", - "Plugin": { - "Hook": null, - "Plugin Name": null, - "Amount": 0 - }, - "DisplayName (empty - default)": "", - "ShortName": "generator.wind.scrap", - "Skin": 0, - "Amount": 1, - "Price": 100.0, - "Sell Price": 100.0, - "Buy Cooldown (0 - disable)": 0.0, - "Sell Cooldown (0 - disable)": 0.0, - "Discount (%)": { - "shop.default": 0, - "shop.vip": 10 - } - }, - { - "Type": "Item", - "ID": 70, - "Image": "", - "Title": "", - "Command (%steamid%)": "", - "Plugin": { - "Hook": null, - "Plugin Name": null, - "Amount": 0 - }, - "DisplayName (empty - default)": "", - "ShortName": "hosetool", - "Skin": 0, - "Amount": 1, - "Price": 100.0, - "Sell Price": 100.0, - "Buy Cooldown (0 - disable)": 0.0, - "Sell Cooldown (0 - disable)": 0.0, - "Discount (%)": { - "shop.default": 0, - "shop.vip": 10 - } - }, - { - "Type": "Item", - "ID": 71, - "Image": "", - "Title": "", - "Command (%steamid%)": "", - "Plugin": { - "Hook": null, - "Plugin Name": null, - "Amount": 0 - }, - "DisplayName (empty - default)": "", - "ShortName": "wiretool", - "Skin": 0, - "Amount": 1, - "Price": 100.0, - "Sell Price": 100.0, - "Buy Cooldown (0 - disable)": 0.0, - "Sell Cooldown (0 - disable)": 0.0, - "Discount (%)": { - "shop.default": 0, - "shop.vip": 10 - } - } - ] - }, - { - "Enabled": true, - "Title": "Fun", - "Permission": "", - "Items": [ - { - "Type": "Item", - "ID": 72, - "Image": "", - "Title": "", - "Command (%steamid%)": "", - "Plugin": { - "Hook": null, - "Plugin Name": null, - "Amount": 0 - }, - "DisplayName (empty - default)": "", - "ShortName": "firework.boomer.champagne", - "Skin": 0, - "Amount": 1, - "Price": 100.0, - "Sell Price": 100.0, - "Buy Cooldown (0 - disable)": 0.0, - "Sell Cooldown (0 - disable)": 0.0, - "Discount (%)": { - "shop.default": 0, - "shop.vip": 10 - } - }, - { - "Type": "Item", - "ID": 73, - "Image": "", - "Title": "", - "Command (%steamid%)": "", - "Plugin": { - "Hook": null, - "Plugin Name": null, - "Amount": 0 - }, - "DisplayName (empty - default)": "", - "ShortName": "abovegroundpool", - "Skin": 0, - "Amount": 1, - "Price": 100.0, - "Sell Price": 100.0, - "Buy Cooldown (0 - disable)": 0.0, - "Sell Cooldown (0 - disable)": 0.0, - "Discount (%)": { - "shop.default": 0, - "shop.vip": 10 - } - }, - { - "Type": "Item", - "ID": 74, - "Image": "", - "Title": "", - "Command (%steamid%)": "", - "Plugin": { - "Hook": null, - "Plugin Name": null, - "Amount": 0 - }, - "DisplayName (empty - default)": "", - "ShortName": "beachchair", - "Skin": 0, - "Amount": 1, - "Price": 100.0, - "Sell Price": 100.0, - "Buy Cooldown (0 - disable)": 0.0, - "Sell Cooldown (0 - disable)": 0.0, - "Discount (%)": { - "shop.default": 0, - "shop.vip": 10 - } - }, - { - "Type": "Item", - "ID": 75, - "Image": "", - "Title": "", - "Command (%steamid%)": "", - "Plugin": { - "Hook": null, - "Plugin Name": null, - "Amount": 0 - }, - "DisplayName (empty - default)": "", - "ShortName": "beachparasol", - "Skin": 0, - "Amount": 1, - "Price": 100.0, - "Sell Price": 100.0, - "Buy Cooldown (0 - disable)": 0.0, - "Sell Cooldown (0 - disable)": 0.0, - "Discount (%)": { - "shop.default": 0, - "shop.vip": 10 - } - }, - { - "Type": "Item", - "ID": 76, - "Image": "", - "Title": "", - "Command (%steamid%)": "", - "Plugin": { - "Hook": null, - "Plugin Name": null, - "Amount": 0 - }, - "DisplayName (empty - default)": "", - "ShortName": "beachtable", - "Skin": 0, - "Amount": 1, - "Price": 100.0, - "Sell Price": 100.0, - "Buy Cooldown (0 - disable)": 0.0, - "Sell Cooldown (0 - disable)": 0.0, - "Discount (%)": { - "shop.default": 0, - "shop.vip": 10 - } - }, - { - "Type": "Item", - "ID": 77, - "Image": "", - "Title": "", - "Command (%steamid%)": "", - "Plugin": { - "Hook": null, - "Plugin Name": null, - "Amount": 0 - }, - "DisplayName (empty - default)": "", - "ShortName": "beachtowel", - "Skin": 0, - "Amount": 1, - "Price": 100.0, - "Sell Price": 100.0, - "Buy Cooldown (0 - disable)": 0.0, - "Sell Cooldown (0 - disable)": 0.0, - "Discount (%)": { - "shop.default": 0, - "shop.vip": 10 - } - }, - { - "Type": "Item", - "ID": 78, - "Image": "", - "Title": "", - "Command (%steamid%)": "", - "Plugin": { - "Hook": null, - "Plugin Name": null, - "Amount": 0 - }, - "DisplayName (empty - default)": "", - "ShortName": "boogieboard", - "Skin": 0, - "Amount": 1, - "Price": 100.0, - "Sell Price": 100.0, - "Buy Cooldown (0 - disable)": 0.0, - "Sell Cooldown (0 - disable)": 0.0, - "Discount (%)": { - "shop.default": 0, - "shop.vip": 10 - } - }, - { - "Type": "Item", - "ID": 79, - "Image": "", - "Title": "", - "Command (%steamid%)": "", - "Plugin": { - "Hook": null, - "Plugin Name": null, - "Amount": 0 - }, - "DisplayName (empty - default)": "", - "ShortName": "innertube", - "Skin": 0, - "Amount": 1, - "Price": 100.0, - "Sell Price": 100.0, - "Buy Cooldown (0 - disable)": 0.0, - "Sell Cooldown (0 - disable)": 0.0, - "Discount (%)": { - "shop.default": 0, - "shop.vip": 10 - } - }, - { - "Type": "Item", - "ID": 80, - "Image": "", - "Title": "", - "Command (%steamid%)": "", - "Plugin": { - "Hook": null, - "Plugin Name": null, - "Amount": 0 - }, - "DisplayName (empty - default)": "", - "ShortName": "paddlingpool", - "Skin": 0, - "Amount": 1, - "Price": 100.0, - "Sell Price": 100.0, - "Buy Cooldown (0 - disable)": 0.0, - "Sell Cooldown (0 - disable)": 0.0, - "Discount (%)": { - "shop.default": 0, - "shop.vip": 10 - } - }, - { - "Type": "Item", - "ID": 81, - "Image": "", - "Title": "", - "Command (%steamid%)": "", - "Plugin": { - "Hook": null, - "Plugin Name": null, - "Amount": 0 - }, - "DisplayName (empty - default)": "", - "ShortName": "fun.boomboxportable", - "Skin": 0, - "Amount": 1, - "Price": 100.0, - "Sell Price": 100.0, - "Buy Cooldown (0 - disable)": 0.0, - "Sell Cooldown (0 - disable)": 0.0, - "Discount (%)": { - "shop.default": 0, - "shop.vip": 10 - } - }, - { - "Type": "Item", - "ID": 82, - "Image": "", - "Title": "", - "Command (%steamid%)": "", - "Plugin": { - "Hook": null, - "Plugin Name": null, - "Amount": 0 - }, - "DisplayName (empty - default)": "", - "ShortName": "mobilephone", - "Skin": 0, - "Amount": 1, - "Price": 100.0, - "Sell Price": 100.0, - "Buy Cooldown (0 - disable)": 0.0, - "Sell Cooldown (0 - disable)": 0.0, - "Discount (%)": { - "shop.default": 0, - "shop.vip": 10 - } - } - ] - }, - { - "Enabled": true, - "Title": "Food", - "Permission": "", - "Items": [ - { - "Type": "Item", - "ID": 83, - "Image": "", - "Title": "", - "Command (%steamid%)": "", - "Plugin": { - "Hook": null, - "Plugin Name": null, - "Amount": 0 - }, - "DisplayName (empty - default)": "", - "ShortName": "cactusflesh", + "ShortName": "beachchair", "Skin": 0, "Amount": 1, "Price": 100.0, @@ -2129,7 +1186,7 @@ }, { "Type": "Item", - "ID": 84, + "ID": 75, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -2139,7 +1196,7 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "chicken.cooked", + "ShortName": "beachparasol", "Skin": 0, "Amount": 1, "Price": 100.0, @@ -2153,7 +1210,7 @@ }, { "Type": "Item", - "ID": 85, + "ID": 76, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -2163,7 +1220,7 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "waterjug", + "ShortName": "beachtable", "Skin": 0, "Amount": 1, "Price": 100.0, @@ -2177,7 +1234,7 @@ }, { "Type": "Item", - "ID": 86, + "ID": 77, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -2187,7 +1244,7 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "seed.red.berry", + "ShortName": "beachtowel", "Skin": 0, "Amount": 1, "Price": 100.0, @@ -2201,7 +1258,7 @@ }, { "Type": "Item", - "ID": 87, + "ID": 78, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -2211,7 +1268,7 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "seed.yellow.berry", + "ShortName": "boogieboard", "Skin": 0, "Amount": 1, "Price": 100.0, @@ -2225,7 +1282,7 @@ }, { "Type": "Item", - "ID": 88, + "ID": 79, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -2235,7 +1292,7 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "pumpkin", + "ShortName": "innertube", "Skin": 0, "Amount": 1, "Price": 100.0, @@ -2249,7 +1306,7 @@ }, { "Type": "Item", - "ID": 89, + "ID": 80, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -2259,7 +1316,7 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "seed.pumpkin", + "ShortName": "paddlingpool", "Skin": 0, "Amount": 1, "Price": 100.0, @@ -2273,7 +1330,7 @@ }, { "Type": "Item", - "ID": 90, + "ID": 81, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -2283,7 +1340,7 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "maxhealthtea.pure", + "ShortName": "fun.boomboxportable", "Skin": 0, "Amount": 1, "Price": 100.0, @@ -2297,7 +1354,7 @@ }, { "Type": "Item", - "ID": 91, + "ID": 82, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -2307,7 +1364,7 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "radiationresisttea.pure", + "ShortName": "mobilephone", "Skin": 0, "Amount": 1, "Price": 100.0, @@ -2323,12 +1380,12 @@ }, { "Enabled": true, - "Title": "Resources", + "Title": "Food", "Permission": "", "Items": [ { "Type": "Item", - "ID": 92, + "ID": 83, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -2338,7 +1395,7 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "cctv.camera", + "ShortName": "cactusflesh", "Skin": 0, "Amount": 1, "Price": 100.0, @@ -2352,7 +1409,7 @@ }, { "Type": "Item", - "ID": 93, + "ID": 84, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -2362,7 +1419,7 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "cloth", + "ShortName": "chicken.cooked", "Skin": 0, "Amount": 1, "Price": 100.0, @@ -2376,7 +1433,7 @@ }, { "Type": "Item", - "ID": 94, + "ID": 85, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -2386,7 +1443,7 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "horsedung", + "ShortName": "waterjug", "Skin": 0, "Amount": 1, "Price": 100.0, @@ -2400,7 +1457,7 @@ }, { "Type": "Item", - "ID": 95, + "ID": 86, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -2410,7 +1467,7 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "hq.metal.ore", + "ShortName": "seed.red.berry", "Skin": 0, "Amount": 1, "Price": 100.0, @@ -2424,7 +1481,7 @@ }, { "Type": "Item", - "ID": 96, + "ID": 87, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -2434,7 +1491,7 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "metal.refined", + "ShortName": "seed.yellow.berry", "Skin": 0, "Amount": 1, "Price": 100.0, @@ -2448,7 +1505,7 @@ }, { "Type": "Item", - "ID": 97, + "ID": 88, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -2458,7 +1515,7 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "leather", + "ShortName": "pumpkin", "Skin": 0, "Amount": 1, "Price": 100.0, @@ -2472,7 +1529,7 @@ }, { "Type": "Item", - "ID": 98, + "ID": 89, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -2482,7 +1539,7 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "lowgradefuel", + "ShortName": "seed.pumpkin", "Skin": 0, "Amount": 1, "Price": 100.0, @@ -2496,7 +1553,7 @@ }, { "Type": "Item", - "ID": 99, + "ID": 90, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -2506,10 +1563,10 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "metal.fragments", + "ShortName": "maxhealthtea.pure", "Skin": 0, "Amount": 1, - "Price": 100.0, + "Price": 1000.0, "Sell Price": 100.0, "Buy Cooldown (0 - disable)": 0.0, "Sell Cooldown (0 - disable)": 0.0, @@ -2517,10 +1574,17 @@ "shop.default": 0, "shop.vip": 10 } - }, + } + ] + }, + { + "Enabled": true, + "Title": "Resources", + "Permission": "", + "Items": [ { "Type": "Item", - "ID": 100, + "ID": 93, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -2530,11 +1594,11 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "metal.ore", + "ShortName": "cloth", "Skin": 0, "Amount": 1, "Price": 100.0, - "Sell Price": 100.0, + "Sell Price": 10.0, "Buy Cooldown (0 - disable)": 0.0, "Sell Cooldown (0 - disable)": 0.0, "Discount (%)": { @@ -2544,7 +1608,7 @@ }, { "Type": "Item", - "ID": 101, + "ID": 95, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -2554,11 +1618,11 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "stones", + "ShortName": "hq.metal.ore", "Skin": 0, "Amount": 1, "Price": 100.0, - "Sell Price": 100.0, + "Sell Price": 10.0, "Buy Cooldown (0 - disable)": 0.0, "Sell Cooldown (0 - disable)": 0.0, "Discount (%)": { @@ -2568,7 +1632,7 @@ }, { "Type": "Item", - "ID": 102, + "ID": 96, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -2578,11 +1642,11 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "sulfur.ore", + "ShortName": "metal.refined", "Skin": 0, - "Amount": 1, - "Price": 100.0, - "Sell Price": 100.0, + "Amount": 10, + "Price": 500.0, + "Sell Price": 50.0, "Buy Cooldown (0 - disable)": 0.0, "Sell Cooldown (0 - disable)": 0.0, "Discount (%)": { @@ -2592,38 +1656,7 @@ }, { "Type": "Item", - "ID": 103, - "Image": "", - "Title": "", - "Command (%steamid%)": "", - "Plugin": { - "Hook": null, - "Plugin Name": null, - "Amount": 0 - }, - "DisplayName (empty - default)": "", - "ShortName": "wood", - "Skin": 0, - "Amount": 1, - "Price": 100.0, - "Sell Price": 100.0, - "Buy Cooldown (0 - disable)": 0.0, - "Sell Cooldown (0 - disable)": 0.0, - "Discount (%)": { - "shop.default": 0, - "shop.vip": 10 - } - } - ] - }, - { - "Enabled": true, - "Title": "Tool", - "Permission": "", - "Items": [ - { - "Type": "Item", - "ID": 104, + "ID": 97, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -2633,11 +1666,11 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "tool.instant_camera", + "ShortName": "leather", "Skin": 0, - "Amount": 1, + "Amount": 10, "Price": 100.0, - "Sell Price": 100.0, + "Sell Price": 10.0, "Buy Cooldown (0 - disable)": 0.0, "Sell Cooldown (0 - disable)": 0.0, "Discount (%)": { @@ -2647,7 +1680,7 @@ }, { "Type": "Item", - "ID": 105, + "ID": 98, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -2657,11 +1690,11 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "flashlight.held", + "ShortName": "lowgradefuel", "Skin": 0, - "Amount": 1, + "Amount": 10, "Price": 100.0, - "Sell Price": 100.0, + "Sell Price": 10.0, "Buy Cooldown (0 - disable)": 0.0, "Sell Cooldown (0 - disable)": 0.0, "Discount (%)": { @@ -2671,7 +1704,7 @@ }, { "Type": "Item", - "ID": 106, + "ID": 99, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -2681,11 +1714,11 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "chainsaw", + "ShortName": "metal.fragments", "Skin": 0, - "Amount": 1, - "Price": 100.0, - "Sell Price": 100.0, + "Amount": 100, + "Price": 300.0, + "Sell Price": 200.0, "Buy Cooldown (0 - disable)": 0.0, "Sell Cooldown (0 - disable)": 0.0, "Discount (%)": { @@ -2695,7 +1728,7 @@ }, { "Type": "Item", - "ID": 107, + "ID": 100, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -2705,11 +1738,11 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "hammer", + "ShortName": "metal.ore", "Skin": 0, - "Amount": 1, - "Price": 100.0, - "Sell Price": 100.0, + "Amount": 100, + "Price": 400.0, + "Sell Price": 200.0, "Buy Cooldown (0 - disable)": 0.0, "Sell Cooldown (0 - disable)": 0.0, "Discount (%)": { @@ -2719,7 +1752,7 @@ }, { "Type": "Item", - "ID": 108, + "ID": 101, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -2729,10 +1762,10 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "rock", + "ShortName": "stones", "Skin": 0, - "Amount": 1, - "Price": 100.0, + "Amount": 100, + "Price": 200.0, "Sell Price": 100.0, "Buy Cooldown (0 - disable)": 0.0, "Sell Cooldown (0 - disable)": 0.0, @@ -2743,7 +1776,7 @@ }, { "Type": "Item", - "ID": 109, + "ID": 102, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -2753,11 +1786,11 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "torch", + "ShortName": "sulfur.ore", "Skin": 0, "Amount": 1, - "Price": 100.0, - "Sell Price": 100.0, + "Price": 500.0, + "Sell Price": 250.0, "Buy Cooldown (0 - disable)": 0.0, "Sell Cooldown (0 - disable)": 0.0, "Discount (%)": { @@ -2767,7 +1800,7 @@ }, { "Type": "Item", - "ID": 110, + "ID": 103, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -2777,11 +1810,11 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "bucket.water", + "ShortName": "wood", "Skin": 0, - "Amount": 1, + "Amount": 100, "Price": 100.0, - "Sell Price": 100.0, + "Sell Price": 10.0, "Buy Cooldown (0 - disable)": 0.0, "Sell Cooldown (0 - disable)": 0.0, "Discount (%)": { @@ -2793,12 +1826,12 @@ }, { "Enabled": true, - "Title": "Weapon", + "Title": "Tool", "Permission": "", "Items": [ { "Type": "Item", - "ID": 111, + "ID": 105, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -2808,7 +1841,7 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "multiplegrenadelauncher", + "ShortName": "flashlight.held", "Skin": 0, "Amount": 1, "Price": 100.0, @@ -2822,7 +1855,7 @@ }, { "Type": "Item", - "ID": 112, + "ID": 106, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -2832,7 +1865,7 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "knife.combat", + "ShortName": "chainsaw", "Skin": 0, "Amount": 1, "Price": 100.0, @@ -2843,10 +1876,17 @@ "shop.default": 0, "shop.vip": 10 } - }, + } + ] + }, + { + "Enabled": true, + "Title": "Weapon", + "Permission": "", + "Items": [ { "Type": "Item", - "ID": 113, + "ID": 112, "Image": "", "Title": "", "Command (%steamid%)": "", @@ -2856,7 +1896,7 @@ "Amount": 0 }, "DisplayName (empty - default)": "", - "ShortName": "pistol.m92", + "ShortName": "knife.combat", "Skin": 0, "Amount": 1, "Price": 100.0, @@ -2872,7 +1912,7 @@ "Type": "Item", "ID": 114, "Image": "", - "Title": "", + "Title": "MP5", "Command (%steamid%)": "", "Plugin": { "Hook": null, @@ -2883,8 +1923,8 @@ "ShortName": "smg.mp5", "Skin": 0, "Amount": 1, - "Price": 100.0, - "Sell Price": 100.0, + "Price": 10000.0, + "Sell Price": 1000.0, "Buy Cooldown (0 - disable)": 0.0, "Sell Cooldown (0 - disable)": 0.0, "Discount (%)": { @@ -2894,27 +1934,24 @@ }, { "Type": "Item", - "ID": 115, + "ID": -878881366, "Image": "", - "Title": "", + "Title": "Semi Automatic Rifle (SAR)", "Command (%steamid%)": "", "Plugin": { - "Hook": null, - "Plugin Name": null, - "Amount": 0 + "Hook": "", + "Plugin Name": "", + "Amount": 1 }, "DisplayName (empty - default)": "", - "ShortName": "speargun", + "ShortName": "rifle.semiauto", "Skin": 0, "Amount": 1, - "Price": 100.0, + "Price": 1000.0, "Sell Price": 100.0, "Buy Cooldown (0 - disable)": 0.0, "Sell Cooldown (0 - disable)": 0.0, - "Discount (%)": { - "shop.default": 0, - "shop.vip": 10 - } + "Discount (%)": {} } ] }, @@ -2938,8 +1975,8 @@ "ShortName": "antiradpills", "Skin": 0, "Amount": 1, - "Price": 100.0, - "Sell Price": 100.0, + "Price": 10.0, + "Sell Price": 1.0, "Buy Cooldown (0 - disable)": 0.0, "Sell Cooldown (0 - disable)": 0.0, "Discount (%)": { @@ -2963,7 +2000,7 @@ "Skin": 0, "Amount": 1, "Price": 100.0, - "Sell Price": 100.0, + "Sell Price": 10.0, "Buy Cooldown (0 - disable)": 0.0, "Sell Cooldown (0 - disable)": 0.0, "Discount (%)": { @@ -2986,8 +2023,8 @@ "ShortName": "syringe.medical", "Skin": 0, "Amount": 1, - "Price": 100.0, - "Sell Price": 100.0, + "Price": 10.0, + "Sell Price": 1.0, "Buy Cooldown (0 - disable)": 0.0, "Sell Cooldown (0 - disable)": 0.0, "Discount (%)": { @@ -3009,9 +2046,9 @@ "DisplayName (empty - default)": "", "ShortName": "bandage", "Skin": 0, - "Amount": 1, + "Amount": 10, "Price": 100.0, - "Sell Price": 100.0, + "Sell Price": 10.0, "Buy Cooldown (0 - disable)": 0.0, "Sell Cooldown (0 - disable)": 0.0, "Discount (%)": { diff --git a/defaults/oxide/data/Kits/Kits.json b/defaults/oxide/data/Kits/Kits.json index ffa3db58..8bfd4d44 100644 --- a/defaults/oxide/data/Kits/Kits.json +++ b/defaults/oxide/data/Kits/Kits.json @@ -4701,6 +4701,225 @@ "Content": null } ] + }, + { + "Name": "Crispy", + "Display Name": "Crispy", + "Color": "#F28633", + "Permission": "kits.Crispy", + "Description": null, + "Image": null, + "Hide": true, + "Amount": 0, + "Cooldown": 0.0, + "Wipe Block": 0.0, + "Building": null, + "Items": [ + { + "Type": "Item", + "Command": "", + "ShortName": "hoodie", + "Amount": 1, + "Blueprint": 0, + "SkinID": 1373714814, + "Container": "wear", + "Condition": 0.0, + "Chance": 100, + "Position": 1, + "Image": null, + "Weapon": null, + "Content": null + }, + { + "Type": "Item", + "Command": "", + "ShortName": "roadsign.gloves", + "Amount": 1, + "Blueprint": 0, + "SkinID": 2530894213, + "Container": "wear", + "Condition": 0.0, + "Chance": 100, + "Position": 2, + "Image": null, + "Weapon": null, + "Content": null + }, + { + "Type": "Item", + "Command": "", + "ShortName": "shoes.boots", + "Amount": 1, + "Blueprint": 0, + "SkinID": 2090776132, + "Container": "wear", + "Condition": 0.0, + "Chance": 100, + "Position": 3, + "Image": null, + "Weapon": null, + "Content": null + }, + { + "Type": "Item", + "Command": "", + "ShortName": "roadsign.kilt", + "Amount": 1, + "Blueprint": 0, + "SkinID": 2120628865, + "Container": "wear", + "Condition": 165.0, + "Chance": 100, + "Position": 4, + "Image": null, + "Weapon": null, + "Content": null + }, + { + "Type": "Item", + "Command": "", + "ShortName": "pants", + "Amount": 1, + "Blueprint": 0, + "SkinID": 1441311938, + "Container": "wear", + "Condition": 0.0, + "Chance": 100, + "Position": 5, + "Image": null, + "Weapon": null, + "Content": null + }, + { + "Type": "Item", + "Command": "", + "ShortName": "metal.plate.torso", + "Amount": 1, + "Blueprint": 0, + "SkinID": 797410767, + "Container": "wear", + "Condition": 360.0, + "Chance": 100, + "Position": 6, + "Image": null, + "Weapon": null, + "Content": null + }, + { + "Type": "Item", + "Command": "", + "ShortName": "metal.facemask", + "Amount": 1, + "Blueprint": 0, + "SkinID": 784316334, + "Container": "wear", + "Condition": 320.0, + "Chance": 100, + "Position": 0, + "Image": null, + "Weapon": null, + "Content": null + }, + { + "Type": "Item", + "Command": "", + "ShortName": "ammo.rifle", + "Amount": 711, + "Blueprint": 0, + "SkinID": 0, + "Container": "main", + "Condition": 0.0, + "Chance": 100, + "Position": 18, + "Image": null, + "Weapon": null, + "Content": null + }, + { + "Type": "Item", + "Command": "", + "ShortName": "rifle.ak", + "Amount": 1, + "Blueprint": 0, + "SkinID": 2249370680, + "Container": "belt", + "Condition": 149.25, + "Chance": 100, + "Position": 0, + "Image": null, + "Weapon": { + "ammoType": "ammo.rifle", + "ammoAmount": 30 + }, + "Content": [ + { + "ShortName": "weapon.mod.flashlight", + "Condition": 300.0, + "Amount": 1 + } + ] + }, + { + "Type": "Item", + "Command": "", + "ShortName": "syringe.medical", + "Amount": 88, + "Blueprint": 0, + "SkinID": 0, + "Container": "belt", + "Condition": 0.0, + "Chance": 100, + "Position": 1, + "Image": null, + "Weapon": null, + "Content": null + }, + { + "Type": "Item", + "Command": "", + "ShortName": "bandage", + "Amount": 85, + "Blueprint": 0, + "SkinID": 0, + "Container": "belt", + "Condition": 0.0, + "Chance": 100, + "Position": 2, + "Image": null, + "Weapon": null, + "Content": null + }, + { + "Type": "Item", + "Command": "", + "ShortName": "hammer", + "Amount": 1, + "Blueprint": 0, + "SkinID": 1457914371, + "Container": "belt", + "Condition": 0.0, + "Chance": 100, + "Position": 5, + "Image": null, + "Weapon": null, + "Content": null + }, + { + "Type": "Item", + "Command": "", + "ShortName": "building.planner", + "Amount": 1, + "Blueprint": 0, + "SkinID": 0, + "Container": "belt", + "Condition": 0.0, + "Chance": 100, + "Position": 4, + "Image": null, + "Weapon": null, + "Content": null + } + ] } ] } \ No newline at end of file diff --git a/defaults/oxide/data/Shop.json b/defaults/oxide/data/Shop.json new file mode 100644 index 00000000..5100999d --- /dev/null +++ b/defaults/oxide/data/Shop.json @@ -0,0 +1,66 @@ +{ + "Players": { + "76561197996782220": { + "Items": {} + }, + "76561198024774727": { + "Items": {} + }, + "76561198885943506": { + "Items": {} + }, + "76561198206550912": { + "Items": {} + }, + "76561199075365195": { + "Items": {} + }, + "76561198970648199": { + "Items": { + "118": 5 + } + }, + "76561198829779315": { + "Items": {} + }, + "76561199122461964": { + "Items": { + "50": 4 + } + }, + "76561199203012383": { + "Items": {} + }, + "76561199130801590": { + "Items": {} + }, + "76561199213513074": { + "Items": {} + }, + "76561199120063736": { + "Items": {} + }, + "76561199154087938": { + "Items": {} + }, + "76561199173706010": { + "Items": {} + }, + "76561197995273428": { + "Items": {} + }, + "76561199092833624": { + "Items": { + "98": 18 + } + }, + "76561198453356489": { + "Items": { + "93": 1 + } + }, + "76561197991583474": { + "Items": {} + } + } +} \ No newline at end of file diff --git a/defaults/oxide/plugins/Shop.cs b/defaults/oxide/plugins/Shop.cs index 44eda72e..23a5ba78 100644 --- a/defaults/oxide/plugins/Shop.cs +++ b/defaults/oxide/plugins/Shop.cs @@ -17,11 +17,9 @@ namespace Oxide.Plugins { - [Info("Shop", "Mevent", "1.0.19")] + [Info("Shop", "Mevent", "1.0.21")] public class Shop : RustPlugin { - //TODO: Transfer of currency between players - #region Fields [PluginReference] private Plugin ImageLibrary, ItemCostCalculator, HumanNPC, Notify, NoEscape; @@ -41,6 +39,8 @@ public class Shop : RustPlugin private const string ModalLayer = "UI.Shop.Modal"; + private const string EditingLayer = "UI.Shop.Editing"; + private const string PermAdmin = "Shop.admin"; private readonly Dictionary _carts = new Dictionary(); @@ -110,14 +110,17 @@ public DataCart(PlayerCart cart) #endregion } - private readonly Dictionary OpenedShops = new Dictionary(); + private readonly Dictionary _openedShops = new Dictionary(); private NPCShop GetShopByPlayer(BasePlayer player) { NPCShop shop; - return OpenedShops.TryGetValue(player, out shop) ? shop : null; + return _openedShops.TryGetValue(player, out shop) ? shop : null; } + private readonly Dictionary> _itemEditing = + new Dictionary>(); + #endregion #region Colors @@ -147,6 +150,9 @@ private class Configuration [JsonProperty(PropertyName = "Work with Notify?")] public bool UseNotify = true; + [JsonProperty(PropertyName = "Use Spectating mode when editing kits?")] + public bool UseSpectating = true; + [JsonProperty(PropertyName = "Can admins edit? (by flag)")] public bool FlagAdmin = true; @@ -239,6 +245,8 @@ private class Configuration EnableSearch = true, RoundDigits = 5 }; + + public VersionNumber Version; } private class UserInterface @@ -321,6 +329,9 @@ private class ShopItem [JsonProperty(PropertyName = "Title")] public string Title; + [JsonProperty(PropertyName = "Description")] + public string Description; + [JsonProperty(PropertyName = "Command (%steamid%)")] public string Command; @@ -350,7 +361,15 @@ private class ShopItem public float SellCooldown; [JsonProperty(PropertyName = "Discount (%)", ObjectCreationHandling = ObjectCreationHandling.Replace)] - public Dictionary Discount; + public Dictionary Discount = new Dictionary(); + + [JsonProperty(PropertyName = "Sell Limits (0 - no limit)", + ObjectCreationHandling = ObjectCreationHandling.Replace)] + public Dictionary SellLimits = new Dictionary(); + + [JsonProperty(PropertyName = "Buy Limits (0 - no limit)", + ObjectCreationHandling = ObjectCreationHandling.Replace)] + public Dictionary BuyLimits = new Dictionary(); [JsonIgnore] private string _publicTitle; @@ -448,6 +467,18 @@ where _instance.permission.UserHasPermission(player.UserIDString, check.Key) select check.Value).Prepend(0).Max(); } + public int GetLimit(BasePlayer player, bool buy = true) + { + var dict = buy ? BuyLimits : SellLimits; + + if (dict.Count == 0) + return 0; + + return (from check in dict + where _instance.permission.UserHasPermission(player.UserIDString, check.Key) + select check.Value).Prepend(0).Max(); + } + public void Get(BasePlayer player, int count = 1) { switch (Type) @@ -702,6 +733,10 @@ protected override void LoadConfig() { _config = Config.ReadObject(); if (_config == null) throw new Exception(); + + if (_config.Version < Version) + UpdateConfigValues(); + SaveConfig(); } catch @@ -721,6 +756,39 @@ protected override void LoadDefaultConfig() _config = new Configuration(); } + private void UpdateConfigValues() + { + PrintWarning("Config update detected! Updating config values..."); + + if (_config.Version == default(VersionNumber) && _config.Version < new VersionNumber(1, 0, 21)) + { + _data = Interface.Oxide.DataFileSystem.ReadObject(Name); + if (_data != null) + Interface.Oxide.DataFileSystem.WriteObject($"{Name}/Players", _data); + } + + if (_config.Version < new VersionNumber(1, 0, 21)) + _config.Shop.ForEach(shop => + { + shop.Items.ForEach(item => + { + item.SellLimits = new Dictionary + { + ["shop.default"] = 0, + ["shop.vip"] = 0 + }; + item.BuyLimits = new Dictionary + { + ["shop.default"] = 0, + ["shop.vip"] = 0 + }; + }); + }); + + _config.Version = Version; + PrintWarning("Config update completed!"); + } + #endregion #region Data @@ -728,20 +796,41 @@ protected override void LoadDefaultConfig() private PluginData _data; private void SaveData() + { + SavePlayers(); + + SaveCooldown(); + + SaveLimits(); + } + + private void SavePlayers() { _data.PlayerCarts.Clear(); foreach (var check in _carts) _data.PlayerCarts.Add(check.Key, check.Value.ToPlayerCart()); - Interface.Oxide.DataFileSystem.WriteObject(Name, _data); + Interface.Oxide.DataFileSystem.WriteObject($"{Name}/Players", _data); + } + + private void SaveCooldown() + { + Interface.Oxide.DataFileSystem.WriteObject($"{Name}/Cooldown", _cooldown); + } + + private void SaveLimits() + { + Interface.Oxide.DataFileSystem.WriteObject($"{Name}/Limits", _limits); } private void LoadData() { try { - _data = Interface.Oxide.DataFileSystem.ReadObject(Name); + _data = Interface.Oxide.DataFileSystem.ReadObject($"{Name}/Players"); + _cooldown = Interface.Oxide.DataFileSystem.ReadObject>($"{Name}/Cooldown"); + _limits = Interface.Oxide.DataFileSystem.ReadObject($"{Name}/Limits"); } catch (Exception e) { @@ -749,6 +838,8 @@ private void LoadData() } if (_data == null) _data = new PluginData(); + if (_cooldown == null) _cooldown = new Dictionary(); + if (_limits == null) _limits = new PlayerLimits(); } private class PluginData @@ -858,12 +949,14 @@ private void OnPlayerDisconnected(BasePlayer player) _itemsToUpdate.Remove(player); - if (itemEditing.ContainsKey(player)) + if (_itemEditing.ContainsKey(player)) { - player.SetPlayerFlag(BasePlayer.PlayerFlags.Spectating, false); - itemEditing.Remove(player); + if (_config.UseSpectating) + player.SetPlayerFlag(BasePlayer.PlayerFlags.Spectating, false); + + _itemEditing.Remove(player); - if (itemEditing.Count == 0) + if (_itemEditing.Count == 0) Unsubscribe(nameof(CanSpectateTarget)); } @@ -877,7 +970,7 @@ private void OnPlayerDisconnected(BasePlayer player) private object CanSpectateTarget(BasePlayer player, string filter) { - return player != null && itemEditing.ContainsKey(player) ? (object)true : null; + return player != null && _itemEditing.ContainsKey(player) ? (object)true : null; } private void OnUseNPC(BasePlayer npc, BasePlayer player) @@ -887,6 +980,8 @@ private void OnUseNPC(BasePlayer npc, BasePlayer player) NPCShop npcShop; if (!_config.NPCs.TryGetValue(npc.UserIDString, out npcShop) || npcShop == null) return; + _openedShops[player] = npcShop; + MainUi(player, npcShop: npcShop, first: true); } @@ -913,7 +1008,7 @@ private void CmdConsoleShop(ConsoleSystem.Arg arg) case "closeui": { _itemsToUpdate.Remove(player); - OpenedShops.Remove(player); + _openedShops.Remove(player); break; } @@ -1085,11 +1180,22 @@ private void CmdConsoleShop(ConsoleSystem.Arg arg) return; } + if (playerCart.Items.Any(x => + { + var limit = GetLimit(player, x.Key, true); + if (limit != 0) return false; + + ErrorUi(player, Msg(player, BuyLimitReached, x.Key.PublicTitle)); + return true; + })) + return; + foreach (var cartItem in playerCart.Items) { cartItem.Key?.Get(player, cartItem.Value); SetCooldown(player, cartItem.Key, true); + UseLimit(player, cartItem.Key, true); } CuiHelper.DestroyUi(player, Layer); @@ -1142,6 +1248,13 @@ private void CmdConsoleShop(ConsoleSystem.Arg arg) } } + var limit = GetLimit(player, item, false); + if (limit == 0) + { + ErrorUi(player, Msg(player, SellLimitReached, item.PublicTitle)); + return; + } + var totalAmount = item.Amount * amount; var playerItems = player.inventory.AllItems(); @@ -1156,6 +1269,7 @@ private void CmdConsoleShop(ConsoleSystem.Arg arg) _config.Economy.AddBalance(player, item.SellPrice * amount); SetCooldown(player, item, false, true); + UseLimit(player, item, false); if (_itemsToUpdate.ContainsKey(player)) { @@ -1185,9 +1299,9 @@ private void CmdConsoleShop(ConsoleSystem.Arg arg) !int.TryParse(arg.Args[2], out page) || !int.TryParse(arg.Args[3], out id)) return; - itemEditing.Remove(player); + _itemEditing.Remove(player); - if (itemEditing.Count == 0) + if (_itemEditing.Count == 0) Unsubscribe(nameof(CanSpectateTarget)); EditUi(player, category, page, id, true); @@ -1203,7 +1317,7 @@ private void CmdConsoleShop(ConsoleSystem.Arg arg) var key = arg.Args[3]; var value = arg.Args[4]; - if (itemEditing.ContainsKey(player) && itemEditing[player].ContainsKey(key)) + if (_itemEditing.ContainsKey(player) && _itemEditing[player].ContainsKey(key)) { object newValue = null; @@ -1263,7 +1377,7 @@ private void CmdConsoleShop(ConsoleSystem.Arg arg) } } - itemEditing[player][key] = newValue; + _itemEditing[player][key] = newValue; } EditUi(player, category, page); @@ -1272,10 +1386,12 @@ private void CmdConsoleShop(ConsoleSystem.Arg arg) case "closeediting": { - player.SetPlayerFlag(BasePlayer.PlayerFlags.Spectating, false); - itemEditing.Remove(player); + if (_config.UseSpectating) + player.SetPlayerFlag(BasePlayer.PlayerFlags.Spectating, false); - if (itemEditing.Count == 0) + _itemEditing.Remove(player); + + if (_itemEditing.Count == 0) Unsubscribe(nameof(CanSpectateTarget)); break; } @@ -1286,7 +1402,7 @@ private void CmdConsoleShop(ConsoleSystem.Arg arg) if (!IsAdmin(player) || !arg.HasArgs(3) || !int.TryParse(arg.Args[1], out category) || !int.TryParse(arg.Args[2], out page)) return; - var edit = itemEditing[player]; + var edit = _itemEditing[player]; if (edit == null) return; var newItem = new ShopItem(edit); @@ -1318,10 +1434,12 @@ private void CmdConsoleShop(ConsoleSystem.Arg arg) ImageLibrary.Call("AddImage", newItem.Image, newItem.Image); } - player.SetPlayerFlag(BasePlayer.PlayerFlags.Spectating, false); - itemEditing.Remove(player); + if (_config.UseSpectating) + player.SetPlayerFlag(BasePlayer.PlayerFlags.Spectating, false); - if (itemEditing.Count == 0) + _itemEditing.Remove(player); + + if (_itemEditing.Count == 0) Unsubscribe(nameof(CanSpectateTarget)); SaveConfig(); @@ -1341,7 +1459,7 @@ private void CmdConsoleShop(ConsoleSystem.Arg arg) if (!IsAdmin(player) || !arg.HasArgs(2) || !int.TryParse(arg.Args[1], out category)) return; - var editing = itemEditing[player]; + var editing = _itemEditing[player]; if (editing == null) return; var shopItem = FindItemById((int)editing["ID"]); @@ -1349,10 +1467,12 @@ private void CmdConsoleShop(ConsoleSystem.Arg arg) _config.Shop.ForEach(x => x.Items.Remove(shopItem)); - player.SetPlayerFlag(BasePlayer.PlayerFlags.Spectating, false); - itemEditing.Remove(player); + if (_config.UseSpectating) + player.SetPlayerFlag(BasePlayer.PlayerFlags.Spectating, false); + + _itemEditing.Remove(player); - if (itemEditing.Count == 0) + if (_itemEditing.Count == 0) Unsubscribe(nameof(CanSpectateTarget)); SaveConfig(); @@ -1391,11 +1511,31 @@ private void CmdConsoleShop(ConsoleSystem.Arg arg) if (!IsAdmin(player) || !arg.HasArgs(4) || !int.TryParse(arg.Args[1], out category) || !int.TryParse(arg.Args[2], out page)) return; - itemEditing[player]["ShortName"] = arg.Args[3]; + _itemEditing[player]["ShortName"] = arg.Args[3]; EditUi(player, category, page); break; } + + case "item_info": + { + int itemId, catPage, shopPage; + bool status; + if (!arg.HasArgs(5) || + !int.TryParse(arg.Args[1], out itemId) || + !int.TryParse(arg.Args[2], out catPage) || + !int.TryParse(arg.Args[3], out shopPage) || + !bool.TryParse(arg.Args[4], out status)) return; + + var item = FindItemById(itemId); + if (item == null) return; + + var container = new CuiElementContainer(); + ItemUi(player, item, ref container, catPage, shopPage, !status); + CuiHelper.DestroyUi(player, Layer + $".Item.{item.ID}"); + CuiHelper.AddUi(player, container); + break; + } } } @@ -1596,333 +1736,171 @@ private void MainUi(BasePlayer player, int catPage = 0, int shopPage = 0, NPCSho #endregion - #region Items + if (shopCategories.Count > 0) + { + #region Items - var xSwitch = MainSwitch; - var ySwitch = -70f; + var xSwitch = MainSwitch; + var ySwitch = -70f; - var i = 1; - var shopItems = string.IsNullOrEmpty(search) - ? shopCategories[catPage].Items - : shopCategories.SelectMany(x => x.Items).Where( - item => item.PublicTitle.StartsWith(search) || item.PublicTitle.Contains(search) || - item.ShortName.StartsWith(search) || item.ShortName.Contains(search)).ToList(); - - var inPageItems = shopItems.Skip(shopPage * MainTotalAmount).Take(MainTotalAmount).ToList(); - - var cdItems = inPageItems.FindAll(x => - GetCooldownTime(player.userID, x, true) > 0 || GetCooldownTime(player.userID, x, false) > 0); - if (cdItems.Count > 0) - _itemsToUpdate[player] = cdItems; - else - _itemsToUpdate.Remove(player); + var shopItems = string.IsNullOrEmpty(search) + ? shopCategories[catPage].Items + : shopCategories.SelectMany(x => x.Items).Where( + item => item.PublicTitle.StartsWith(search) || item.PublicTitle.Contains(search) || + item.ShortName.StartsWith(search) || item.ShortName.Contains(search)).ToList(); - foreach (var shopItem in inPageItems) - { - container.Add(new CuiPanel - { - RectTransform = - { - AnchorMin = "0.5 1", AnchorMax = "0.5 1", - OffsetMin = $"{xSwitch} {ySwitch - _config.UI.ItemHeight}", - OffsetMax = $"{xSwitch + _config.UI.ItemWidth} {ySwitch}" - }, - Image = - { - Color = "0 0 0 0" - } - }, Layer + ".Main", Layer + $".Item.{shopItem.ID}"); - container.Add(new CuiPanel - { - RectTransform = - { - AnchorMin = "0 1", AnchorMax = "1 1", - OffsetMin = "0 -150", OffsetMax = "0 0" - }, - Image = - { - Color = _firstColor - } - }, Layer + $".Item.{shopItem.ID}"); + var inPageItems = shopItems.Skip(shopPage * MainTotalAmount).Take(MainTotalAmount).ToList(); - container.Add(new CuiElement + var cdItems = inPageItems.FindAll(x => + GetCooldownTime(player.userID, x, true) > 0 || GetCooldownTime(player.userID, x, false) > 0); + if (cdItems.Count > 0) + _itemsToUpdate[player] = cdItems; + else + _itemsToUpdate.Remove(player); + + for (var i = 0; i < inPageItems.Count; i++) { - Name = Layer + $".Item.{shopItem.ID}.Image", - Parent = Layer + $".Item.{shopItem.ID}", - Components = + var shopItem = inPageItems[i]; + container.Add(new CuiPanel { - new CuiRawImageComponent + RectTransform = { - Png = !string.IsNullOrEmpty(shopItem.Image) - ? ImageLibrary.Call("GetImage", shopItem.Image) - : ImageLibrary.Call("GetImage", shopItem.ShortName, shopItem.Skin) + AnchorMin = "0.5 1", AnchorMax = "0.5 1", + OffsetMin = $"{xSwitch} {ySwitch - _config.UI.ItemHeight}", + OffsetMax = $"{xSwitch + _config.UI.ItemWidth} {ySwitch}" }, - new CuiRectTransformComponent + Image = { - AnchorMin = "0.5 1", AnchorMax = "0.5 1", - OffsetMin = "-35 -85", OffsetMax = "35 -15" + Color = "0 0 0 0" } - } - }); - - #region Name - - container.Add(new CuiLabel - { - RectTransform = - { - AnchorMin = "0 1", AnchorMax = "1 1", - OffsetMin = "0 -100", OffsetMax = "0 -85" - }, - Text = - { - Text = $"{shopItem.PublicTitle}", - Align = TextAnchor.MiddleCenter, - Font = "robotocondensed-regular.ttf", - FontSize = 12, - Color = "1 1 1 0.95" - } - }, Layer + $".Item.{shopItem.ID}"); - - #endregion + }, Layer + ".Main", Layer + $".Item.{shopItem.ID}.Background"); - #region Amount - - container.Add(new CuiLabel - { - RectTransform = - { - AnchorMin = "0.5 1", AnchorMax = "0.5 1", - OffsetMin = "-65 -130", OffsetMax = "-5 -110" - }, - Text = - { - Text = Msg(player, ItemAmount), - Align = TextAnchor.MiddleCenter, - Font = "robotocondensed-regular.ttf", - FontSize = 12, - Color = "1 1 1 1" - } - }, Layer + $".Item.{shopItem.ID}"); + ItemUi(player, shopItem, ref container, catPage, shopPage); - container.Add(new CuiPanel - { - RectTransform = - { - AnchorMin = "0.5 1", AnchorMax = "0.5 1", - OffsetMin = "-10 -130", OffsetMax = "30 -110" - }, - Image = + if ((i + 1) % _config.UI.ItemsOnString == 0) { - Color = HexToCuiColor(_config.SecondColor, 33) + xSwitch = MainSwitch; + ySwitch = ySwitch - _config.UI.Margin - _config.UI.ItemHeight; } - }, Layer + $".Item.{shopItem.ID}", Layer + $".Item.{shopItem.ID}.Amount"); - - container.Add(new CuiLabel - { - RectTransform = { AnchorMin = "0 0", AnchorMax = "1 1" }, - Text = + else { - Text = $"{shopItem.Amount}", - Align = TextAnchor.MiddleCenter, - Font = "robotocondensed-regular.ttf", - FontSize = 12, - Color = "1 1 1 1" + xSwitch += _config.UI.Margin + _config.UI.ItemWidth; } - }, Layer + $".Item.{shopItem.ID}.Amount"); + } #endregion - #region Discount + #region Search - var discount = shopItem.GetDiscount(player); - if (discount > 0) + var enableSearch = _config.UI.EnableSearch; + if (enableSearch) { container.Add(new CuiPanel { RectTransform = { - AnchorMin = "1 1", AnchorMax = "1 1", - OffsetMin = "-30 -45", OffsetMax = "10 -25" + AnchorMin = "0.5 0", AnchorMax = "0.5 0", + OffsetMin = "-140 20", + OffsetMax = "60 55" }, Image = { - Color = _fourthColor + Color = _sixthColor } - }, Layer + $".Item.{shopItem.ID}", Layer + $".Item.{shopItem.ID}.Discount"); + }, Layer + ".Main", Layer + ".Search"); container.Add(new CuiLabel { RectTransform = { AnchorMin = "0 0", AnchorMax = "1 1" }, Text = { - Text = $"-{discount}%", + Text = string.IsNullOrEmpty(search) ? Msg(player, SearchTitle) : $"{search}", Align = TextAnchor.MiddleCenter, - Font = "robotocondensed-bold.ttf", + Font = "robotocondensed-regular.ttf", FontSize = 12, - Color = "1 1 1 1" + Color = "1 1 1 0.65" } - }, Layer + $".Item.{shopItem.ID}.Discount"); - } - - #endregion - - #region Button - - if (shopItem.Price > 0.0) BuyButtonUi(player, ref container, shopItem); - - #endregion + }, Layer + ".Search"); - #region Sell - - if (shopItem.SellPrice > 0.0) SellButtonUi(player, ref container, shopItem); - - #endregion - - #region Edit - - if (IsAdmin(player)) - container.Add(new CuiButton + container.Add(new CuiElement { - RectTransform = - { - AnchorMin = "0 0", AnchorMax = "1 1" - }, - Text = { Text = "" }, - Button = + Parent = Layer + ".Search", + Components = { - Color = "0 0 0 0", - Command = $"UI_Shop startedititem {catPage} {shopPage} {shopItem.ID}" + new CuiInputFieldComponent + { + FontSize = 12, + Align = TextAnchor.MiddleCenter, + Font = "robotocondensed-regular.ttf", + Command = catPage != -1 && shopPage != 0 + ? "UI_Shop main_page -1 0 " + : $"UI_Shop main_page -1 {shopPage} ", + Color = "1 1 1 0.95", + CharsLimit = 32 + }, + new CuiRectTransformComponent + { + AnchorMin = "0 0", AnchorMax = "1 1" + } } - }, Layer + $".Item.{shopItem.ID}.Image"); - - #endregion - - if (i % _config.UI.ItemsOnString == 0) - { - xSwitch = MainSwitch; - ySwitch = ySwitch - _config.UI.Margin - _config.UI.ItemHeight; - } - else - { - xSwitch += _config.UI.Margin + _config.UI.ItemWidth; + }); } - i++; - } - - #endregion + #endregion - #region Search + #region Pages - var enableSearch = _config.UI.EnableSearch; - if (enableSearch) - { - container.Add(new CuiPanel + container.Add(new CuiButton { RectTransform = { AnchorMin = "0.5 0", AnchorMax = "0.5 0", - OffsetMin = "-140 20", - OffsetMax = "60 55" + OffsetMin = $"{(enableSearch ? 65 : -37.5f)} 20", + OffsetMax = $"{(enableSearch ? 100 : -2.5f)} 55" }, - Image = - { - Color = _sixthColor - } - }, Layer + ".Main", Layer + ".Search"); - - container.Add(new CuiLabel - { - RectTransform = { AnchorMin = "0 0", AnchorMax = "1 1" }, Text = { - Text = string.IsNullOrEmpty(search) ? Msg(player, SearchTitle) : $"{search}", + Text = Msg(player, BackPage), Align = TextAnchor.MiddleCenter, Font = "robotocondensed-regular.ttf", FontSize = 12, - Color = "1 1 1 0.65" - } - }, Layer + ".Search"); - - container.Add(new CuiElement - { - Parent = Layer + ".Search", - Components = - { - new CuiInputFieldComponent - { - FontSize = 12, - Align = TextAnchor.MiddleCenter, - Font = "robotocondensed-regular.ttf", - Command = catPage != -1 && shopPage != 0 - ? "UI_Shop main_page -1 0 " - : $"UI_Shop main_page -1 {shopPage} ", - Color = "1 1 1 0.95", - CharsLimit = 32 - }, - new CuiRectTransformComponent - { - AnchorMin = "0 0", AnchorMax = "1 1" - } - } - }); - } - - #endregion - - #region Pages - - container.Add(new CuiButton - { - RectTransform = - { - AnchorMin = "0.5 0", AnchorMax = "0.5 0", - OffsetMin = $"{(enableSearch ? 65 : -37.5f)} 20", - OffsetMax = $"{(enableSearch ? 100 : -2.5f)} 55" - }, - Text = - { - Text = Msg(player, BackPage), - Align = TextAnchor.MiddleCenter, - Font = "robotocondensed-regular.ttf", - FontSize = 12, - Color = "1 1 1 1" - }, - Button = - { - Color = _sixthColor, - Command = shopPage != 0 ? $"UI_Shop main_page {catPage} {shopPage - 1} {search}" : "" - } - }, Layer + ".Main"); - - container.Add(new CuiButton - { - RectTransform = - { - AnchorMin = "0.5 0", AnchorMax = "0.5 0", - OffsetMin = $"{(enableSearch ? 105 : 2.5f)} 20", - OffsetMax = $"{(enableSearch ? 140 : 37.5f)} 55" - }, - Text = - { - Text = Msg(player, NextPage), - Align = TextAnchor.MiddleCenter, - Font = "robotocondensed-regular.ttf", - FontSize = 12, - Color = "1 1 1 1" - }, - Button = + Color = "1 1 1 1" + }, + Button = + { + Color = _sixthColor, + Command = shopPage != 0 ? $"UI_Shop main_page {catPage} {shopPage - 1} {search}" : "" + } + }, Layer + ".Main"); + + container.Add(new CuiButton { - Color = _secondColor, - Command = shopItems.Count > (shopPage + 1) * MainTotalAmount - ? $"UI_Shop main_page {catPage} {shopPage + 1} {search}" - : "" - } - }, Layer + ".Main"); + RectTransform = + { + AnchorMin = "0.5 0", AnchorMax = "0.5 0", + OffsetMin = $"{(enableSearch ? 105 : 2.5f)} 20", + OffsetMax = $"{(enableSearch ? 140 : 37.5f)} 55" + }, + Text = + { + Text = Msg(player, NextPage), + Align = TextAnchor.MiddleCenter, + Font = "robotocondensed-regular.ttf", + FontSize = 12, + Color = "1 1 1 1" + }, + Button = + { + Color = _secondColor, + Command = shopItems.Count > (shopPage + 1) * MainTotalAmount + ? $"UI_Shop main_page {catPage} {shopPage + 1} {search}" + : "" + } + }, Layer + ".Main"); - #endregion + #endregion + } #endregion @@ -2635,7 +2613,7 @@ private void ErrorUi(BasePlayer player, string msg) { RectTransform = { - AnchorMin = "0 1", AnchorMax = "1 1", OffsetMin = "0 -175", OffsetMax = "0 -155" + AnchorMin = "0 1", AnchorMax = "1 1", OffsetMin = "0 -175", OffsetMax = "0 -135" }, Text = { @@ -2890,24 +2868,19 @@ private void BalanceUi(ref CuiElementContainer container, BasePlayer player) CuiHelper.DestroyUi(player, Layer + ".Balance"); } - private const string EditingLayer = "UI.Shop.Editing"; - - private readonly Dictionary> itemEditing = - new Dictionary>(); - private void EditUi(BasePlayer player, int category, int page, int itemId = 0, bool First = false) { var container = new CuiElementContainer(); #region Dictionary - if (!itemEditing.ContainsKey(player)) + if (!_itemEditing.ContainsKey(player)) { var shopItem = FindItemById(itemId); if (shopItem != null) - itemEditing[player] = shopItem.ToDictionary(); + _itemEditing[player] = shopItem.ToDictionary(); else - itemEditing[player] = new Dictionary + _itemEditing[player] = new Dictionary { ["Generated"] = true, ["ID"] = GetId(), @@ -2926,14 +2899,15 @@ private void EditUi(BasePlayer player, int category, int page, int itemId = 0, b ["Plugin_Amount"] = 1 }; - player.SetPlayerFlag(BasePlayer.PlayerFlags.Spectating, true); + if (_config.UseSpectating) + player.SetPlayerFlag(BasePlayer.PlayerFlags.Spectating, true); Subscribe(nameof(CanSpectateTarget)); } #endregion - var edit = itemEditing[player]; + var edit = _itemEditing[player]; #region Background @@ -3958,6 +3932,225 @@ private void SellButtonUi(BasePlayer player, ref CuiElementContainer container, CuiHelper.DestroyUi(player, Layer + $".Item.{shopItem.ID}.Sell"); } + private void ItemUi(BasePlayer player, ShopItem shopItem, ref CuiElementContainer container, int catPage, + int shopPage, bool status = false) + { + container.Add(new CuiPanel + { + RectTransform = + { + AnchorMin = "0 1", AnchorMax = "1 1", + OffsetMin = "0 -150", OffsetMax = "0 0" + }, + Image = + { + Color = _firstColor + } + }, Layer + $".Item.{shopItem.ID}.Background", Layer + $".Item.{shopItem.ID}"); + + if (status) + { + container.Add(new CuiLabel + { + RectTransform = + { + AnchorMin = "0 1", AnchorMax = "1 1", + OffsetMin = "0 -135", OffsetMax = "0 0" + }, + Text = + { + Text = $"{shopItem.Description}", + Align = TextAnchor.MiddleCenter, + Font = "robotocondensed-regular.ttf", + FontSize = 14, + Color = "1 1 1 1" + } + }, Layer + $".Item.{shopItem.ID}"); + } + else + { + container.Add(new CuiElement + { + Name = Layer + $".Item.{shopItem.ID}.Image", + Parent = Layer + $".Item.{shopItem.ID}", + Components = + { + new CuiRawImageComponent + { + Png = !string.IsNullOrEmpty(shopItem.Image) + ? ImageLibrary.Call("GetImage", shopItem.Image) + : ImageLibrary.Call("GetImage", shopItem.ShortName, shopItem.Skin) + }, + new CuiRectTransformComponent + { + AnchorMin = "0.5 1", AnchorMax = "0.5 1", + OffsetMin = "-35 -85", OffsetMax = "35 -15" + } + } + }); + + #region Name + + container.Add(new CuiLabel + { + RectTransform = + { + AnchorMin = "0 1", AnchorMax = "1 1", + OffsetMin = "0 -100", OffsetMax = "0 -85" + }, + Text = + { + Text = $"{shopItem.PublicTitle}", + Align = TextAnchor.MiddleCenter, + Font = "robotocondensed-regular.ttf", + FontSize = 12, + Color = "1 1 1 0.95" + } + }, Layer + $".Item.{shopItem.ID}"); + + #endregion + } + + #region Amount + + container.Add(new CuiLabel + { + RectTransform = + { + AnchorMin = "0.5 1", AnchorMax = "0.5 1", + OffsetMin = "-65 -130", OffsetMax = "-5 -110" + }, + Text = + { + Text = Msg(player, ItemAmount), + Align = TextAnchor.MiddleCenter, + Font = "robotocondensed-regular.ttf", + FontSize = 12, + Color = "1 1 1 1" + } + }, Layer + $".Item.{shopItem.ID}"); + + container.Add(new CuiPanel + { + RectTransform = + { + AnchorMin = "0.5 1", AnchorMax = "0.5 1", + OffsetMin = "-10 -130", OffsetMax = "30 -110" + }, + Image = + { + Color = HexToCuiColor(_config.SecondColor, 33) + } + }, Layer + $".Item.{shopItem.ID}", Layer + $".Item.{shopItem.ID}.Amount"); + + container.Add(new CuiLabel + { + RectTransform = { AnchorMin = "0 0", AnchorMax = "1 1" }, + Text = + { + Text = $"{shopItem.Amount}", + Align = TextAnchor.MiddleCenter, + Font = "robotocondensed-regular.ttf", + FontSize = 12, + Color = "1 1 1 1" + } + }, Layer + $".Item.{shopItem.ID}.Amount"); + + #endregion + + #region Info + + if (!string.IsNullOrEmpty(shopItem.Description)) + container.Add(new CuiButton + { + RectTransform = + { + AnchorMin = "0.5 1", AnchorMax = "0.5 1", + OffsetMin = "35 -130", OffsetMax = "55 -110" + }, + Text = + { + Text = Msg(player, InfoTitle), + Align = TextAnchor.MiddleCenter, + Font = "robotocondensed-regular.ttf", + FontSize = 14, + Color = "1 1 1 1" + }, + Button = + { + Color = HexToCuiColor("#000000"), + Command = $"UI_Shop item_info {shopItem.ID} {catPage} {shopPage} {status}" + } + }, Layer + $".Item.{shopItem.ID}"); + + #endregion + + #region Discount + + var discount = shopItem.GetDiscount(player); + if (discount > 0) + { + container.Add(new CuiPanel + { + RectTransform = + { + AnchorMin = "1 1", AnchorMax = "1 1", + OffsetMin = "-30 -45", OffsetMax = "10 -25" + }, + Image = + { + Color = _fourthColor + } + }, Layer + $".Item.{shopItem.ID}", Layer + $".Item.{shopItem.ID}.Discount"); + + container.Add(new CuiLabel + { + RectTransform = { AnchorMin = "0 0", AnchorMax = "1 1" }, + Text = + { + Text = $"-{discount}%", + Align = TextAnchor.MiddleCenter, + Font = "robotocondensed-bold.ttf", + FontSize = 12, + Color = "1 1 1 1" + } + }, Layer + $".Item.{shopItem.ID}.Discount"); + } + + #endregion + + #region Button + + if (shopItem.Price > 0.0) BuyButtonUi(player, ref container, shopItem); + + #endregion + + #region Sell + + if (shopItem.SellPrice > 0.0) SellButtonUi(player, ref container, shopItem); + + #endregion + + #region Edit + + if (IsAdmin(player)) + container.Add(new CuiButton + { + RectTransform = + { + AnchorMin = "0 0", AnchorMax = "1 1" + }, + Text = { Text = "" }, + Button = + { + Color = "0 0 0 0", + Command = $"UI_Shop startedititem {catPage} {shopPage} {shopItem.ID}" + } + }, Layer + $".Item.{shopItem.ID}.Image"); + + #endregion + } + #endregion #region Utils @@ -4108,6 +4301,16 @@ private void FillCategories() { ["shop.default"] = 0, ["shop.vip"] = 10 + }, + SellLimits = new Dictionary + { + ["shop.default"] = 0, + ["shop.vip"] = 0 + }, + BuyLimits = new Dictionary + { + ["shop.default"] = 0, + ["shop.vip"] = 0 } }); }); @@ -4165,16 +4368,15 @@ private void ItemsToDict() id = GetId(); _shopItems.Add(id, item); - foreach (var check in item.Discount.Where(check => !permission.PermissionExists(check.Key))) - permission.RegisterPermission(check.Key, this); + if (item.Discount != null) + foreach (var check in item.Discount.Where(check => + !string.IsNullOrEmpty(check.Key) && !permission.PermissionExists(check.Key))) + permission.RegisterPermission(check.Key, this); - var itemDefinition = !string.IsNullOrEmpty(item.ShortName) - ? ItemManager.FindItemDefinition(item.ShortName) - : null; - - item.Definition = item.Type == ItemType.Item && !string.IsNullOrEmpty(item.ShortName) - ? itemDefinition - : null; + if (item.Type == ItemType.Item && !string.IsNullOrEmpty(item.ShortName)) + item.Definition = !string.IsNullOrEmpty(item.ShortName) + ? ItemManager.FindItemDefinition(item.ShortName) + : null; })); } @@ -4310,7 +4512,7 @@ private void LoadImages() private readonly Dictionary> _itemsToUpdate = new Dictionary>(); - private readonly Dictionary _cooldowns = new Dictionary(); + private Dictionary _cooldown = new Dictionary(); private void ItemsUpdateController() { @@ -4355,7 +4557,7 @@ private void ItemsUpdateController() private Cooldown GetCooldown(ulong player) { Cooldown cooldown; - return _cooldowns.TryGetValue(player, out cooldown) ? cooldown : null; + return _cooldown.TryGetValue(player, out cooldown) ? cooldown : null; } private CooldownData GetCooldown(ulong player, ShopItem item) @@ -4372,10 +4574,10 @@ private void SetCooldown(BasePlayer player, ShopItem item, bool buy, bool needUp { if ((buy ? item.BuyCooldown : item.SellCooldown) <= 0) return; - if (_cooldowns.ContainsKey(player.userID)) - _cooldowns[player.userID].SetCooldown(item, buy); + if (_cooldown.ContainsKey(player.userID)) + _cooldown[player.userID].SetCooldown(item, buy); else - _cooldowns.Add(player.userID, new Cooldown().SetCooldown(item, buy)); + _cooldown.Add(player.userID, new Cooldown().SetCooldown(item, buy)); if (needUpdate) { @@ -4393,15 +4595,15 @@ private void SetCooldown(BasePlayer player, ShopItem item, bool buy, bool needUp private void RemoveCooldown(BasePlayer player, ShopItem item) { - if (!_cooldowns.ContainsKey(player.userID)) return; + if (!_cooldown.ContainsKey(player.userID)) return; _itemsToUpdate[player].Remove(item); - _cooldowns[player.userID].RemoveCooldown(item); + _cooldown[player.userID].RemoveCooldown(item); - if (_cooldowns[player.userID].Data.Count == 0) + if (_cooldown[player.userID].Data.Count == 0) { - _cooldowns.Remove(player.userID); + _cooldown.Remove(player.userID); _itemsToUpdate.Remove(player); } @@ -4463,9 +4665,80 @@ private class CooldownData #endregion + #region Limits + + private PlayerLimits _limits; + + private class PlayerLimits + { + [JsonProperty(PropertyName = "Players", ObjectCreationHandling = ObjectCreationHandling.Replace)] + public Dictionary Players = new Dictionary(); + + public static PlayerLimitData GetOrAdd(ulong member) + { + if (!_instance._limits.Players.ContainsKey(member)) + _instance._limits.Players.Add(member, new PlayerLimitData()); + + return _instance._limits.Players[member]; + } + } + + private class PlayerLimitData + { + [JsonProperty(PropertyName = "Limits", ObjectCreationHandling = ObjectCreationHandling.Replace)] + public readonly Dictionary ItemsLimits = new Dictionary(); + + public void AddItem(ShopItem item, bool buy) + { + if (!ItemsLimits.ContainsKey(item.ID)) ItemsLimits.Add(item.ID, new ItemLimitData()); + + if (buy) + ItemsLimits[item.ID].Buy++; + else + ItemsLimits[item.ID].Sell++; + } + + public int GetLimit(ShopItem item, bool buy) + { + ItemLimitData data; + if (ItemsLimits.TryGetValue(item.ID, out data)) + return buy ? data.Buy : data.Sell; + + return 0; + } + } + + private class ItemLimitData + { + public int Sell; + + public int Buy; + } + + private void UseLimit(BasePlayer player, ShopItem item, bool buy) + { + PlayerLimits.GetOrAdd(player.userID).AddItem(item, buy); + } + + private int GetLimit(BasePlayer player, ShopItem item, bool buy) + { + var hasLimit = item.GetLimit(player, buy); + if (hasLimit == 0) + return -1; + + var used = PlayerLimits.GetOrAdd(player.userID).GetLimit(item, buy); + + return hasLimit - used; + } + + #endregion + #region Lang private const string + SellLimitReached = "SellLimitReached", + BuyLimitReached = "BuyLimitReached", + InfoTitle = "InfoTitle", BuyRaidBlocked = "BuyRaidBlocked", SellRaidBlocked = "SellRaidBlocked", DaysFormat = "DaysFormat", @@ -4578,7 +4851,10 @@ protected override void LoadDefaultMessages() [BtnNext] = "▼", [SellNotify] = "You have successfully sold {0} pcs of {1}", [BuyRaidBlocked] = "You can't buy while blocked!", - [SellRaidBlocked] = "You can't sell while blocked!" + [SellRaidBlocked] = "You can't sell while blocked!", + [InfoTitle] = "i", + [BuyLimitReached] = "You cannot buy the '{0}'. You have reached the limit", + [SellLimitReached] = "You cannot sell the '{0}'. You have reached the limit" }, this); }