Иконка ресурса

FREE EpicLoot : 1.2.5 1.2.5

Нет прав для скачивания
C#:
// Все права принадлежат дискорд сообществу https://discord.gg/VgNHPpNrz6
using CompanionServer.Handlers;
using Facepunch;
using HarmonyLib;
using Newtonsoft.Json;
using Oxide.Core;
using Oxide.Core.Configuration;
using Oxide.Core.Plugins;
using Oxide.Game.Rust.Cui;
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEngine.Assertions;
/* Suggestions
 * Add generic NPC dmage resist.* Add Bradley damage resist
 */
/* 1.2.5
 * Updated the SkillTree Epic Loot buff to provide more control over the skill info, such as the tree, name of the node, max level etc.* Patched pooling
 * Patched for October update.*/
namespace Oxide.Plugins {
    [Info("Epic Loot", "imthenewguy", "1.2.5")]
    [Description("Man this loot is epic!")]
    class EpicLoot : RustPlugin {
#region Config
        private Configuration config;
        public class Configuration {
            [JsonProperty("General Settings")]
            public GeneralSettings general_settings = new GeneralSettings();
            [JsonProperty("Crafting info")]
            public CraftingChance crafting_info = new CraftingChance();
            [JsonProperty("Button information")]
            public ButtonInfo button_info = new ButtonInfo();
            [JsonProperty("PVP critical damage information")]
            public PVPCrit pvp_crit_damage = new PVPCrit();
            [JsonProperty("Horse information")]
            public HorseStats horse_info = new HorseStats();
            [JsonProperty("Scrap information for Scavangers buff")]
            public Scavengers scavanger_info = new Scavengers();
            [JsonProperty("Raiders information")]
            public Raiders raiders_info = new Raiders();
            [JsonProperty("Tier information")]
            public TierSettings tier_information = new TierSettings();
            [JsonProperty("Loot crate info")]
            public LootInfo containers = new LootInfo();
            [JsonProperty("Corpse loot info")]
            public CorpseLootInfo corpses = new CorpseLootInfo();
            [JsonProperty("List of items that can not be enhanced")]
            public List<string> global_blacklist = new List<string>();
            [JsonProperty("List of skin IDs that cannot be enhanced")]
            public List<ulong> skin_blacklist = new List<ulong>();
            [JsonProperty("A black list of items that will not be refunded when using the assembler buff", ObjectCreationHandling = ObjectCreationHandling.Replace)]
            public List<string> craft_refund_blacklist = new List<string>() {
                "gunpowder", "explosives", "sulfur"
            }
            ;
            [JsonProperty("A black list of items that will not be duplicated when using the fabricators buff", ObjectCreationHandling = ObjectCreationHandling.Replace)]
            public List<string> fabricator_blacklist = new List<string>() {
                "gunpowder", "explosives", "sulfur"
            }
            ;
            [JsonProperty("A black list of items that will be ignored by the reinforced buff", ObjectCreationHandling = ObjectCreationHandling.Replace)]
            public List<string> reinforced_blacklist = new List<string>() {
                "keycard_green", "keycard_blue", "keycard_red"
            }
            ;
            [JsonProperty("Healthshot weapon modifiers.Modifies the set bonus value for selected weapons.[1.0 is full dmage]")]
            public Dictionary<string, float> healthshot_override = new Dictionary<string, float>();
            [JsonProperty("Allow health shot to remove bleeding?")]
            public bool stop_bleeding = true;
            [JsonProperty("Attractive set bonus settings")]
            public LootPickup attractive_settings = new LootPickup();
            [JsonProperty("Mission Rewards")]
            public MissionConfig mission_rewards;
            [JsonProperty("Drop tables for MinersLuck, WoodcuttersLuck and SkinnersLuck set bonuses")]
            public Dictionary<Buff, DropTableLuck> luck_drop_table = new Dictionary<Buff, DropTableLuck>();
            [JsonProperty("Enhancement information")]
            public Dictionary<Buff, EnhancementInfo> enhancements = new Dictionary<Buff, EnhancementInfo>();
            [JsonProperty("List of skins for item types.If more than 1 skin is added, a random one will be selected when the item is created.")]
            public Dictionary<string, List<ulong>> item_skins = new Dictionary<string, List<ulong>>();
            [JsonProperty("RandomTrader Integration")]
            public RandomTraderAPI random_trader_api = new RandomTraderAPI();
            [JsonProperty("FishingContest Integration")]
            public FishingContestLoot fishing_contest_api = new FishingContestLoot();
            [JsonProperty("Scrapper settings")]
            public ScrapperSettings scrapper_settings = new ScrapperSettings();
            [JsonProperty("TruePVE settings")]
            public TruePVESettings truepve_settings = new TruePVESettings();
            [JsonProperty("RaidableBases settings")]
            public RaidableBaseSettings raidablebases_settings = new RaidableBaseSettings();
            [JsonProperty("Effect settings")]
            public EffectSettings effect_settings = new EffectSettings();
            [JsonProperty("BossMonster settings")]
            public BossMonsterSettings bossmonster_settings = new BossMonsterSettings();
            [JsonProperty("Notification settings")]
            public NotificationSettings notificationSettings = new NotificationSettings();
            [JsonProperty("SkillTree settings")]
            public SkillTreeInfo skilltree_settings = new SkillTreeInfo();
            public string ToJson() => JsonConvert.SerializeObject(this);
            public Dictionary<string, object> ToDictionary() => JsonConvert.DeserializeObject<Dictionary<string, object>>(ToJson());
        }
        public class NotificationSettings {
            [JsonProperty("UINotify plugin settings")]
            public NotifySettings notify = new NotifySettings();
        }
        //UINotify
        public class NotifySettings {
            [JsonProperty("Send player specific messages using the notify plugin")]
            public bool enabled = true;
            [JsonProperty("Message type")]
            public int messageType = 0;
        }
        public class EffectSettings {
            [JsonProperty("Effect when a player gets a successful dodge.Set to null to disable.")]
            public string UncannyDodge_effect = "assets/prefabs/building/wall.frame.fence/effects/chain-link-impact.prefab";
        }
        public class FishingContestLoot {
            [JsonProperty("A list of item shortnames that will be added to the fishing contest as prizes")]
            public List<string> shortnames = new List<string>();
            [JsonProperty("A list of buff types that will be added to the fishing contest items as prizes")]
            public List<Buff> buffs = new List<Buff>();
            [JsonProperty("Send payload? (set to true if you want more EpicLoot items added to the FishingContest loot table)")]
            public bool send_payload = true;
        }
        public class LootInfo {
            [JsonProperty("Should we use the default item loot table for the below containers?")]
            public bool use_default_loot_table = true;
            [JsonProperty("Containers and their chance for an enhanced item to spawn")]
            public Dictionary<string, float> containers = new Dictionary<string, float>();
            [JsonProperty("Barrels and their chance for an enhanced item to spawn")]
            public Dictionary<string, float> barrels = new Dictionary<string, float>();
        }
        public class CorpseLootInfo {
            [JsonProperty("Corpse types and their chance for an enhanced item to spawn")]
            public Dictionary<string, float> corpses = new Dictionary<string, float>();
        }
        public class TruePVESettings {
            [JsonProperty("Allow the healthshot set bonus to work in pve [requires TruePVE]?")]
            public bool allow_healthshot_in_pve = true;
        }
        public class ScrapperSettings {
            [JsonProperty("Enable scrapping of equipment for a special currency that can be used to enhanced weapons?")]
            public bool enabled = true;
            [JsonProperty("Allow players to recycle EpicLoot items in the recycler (no components will be received, only EpicScrap)?")]
            public bool allow_recyler = true;
            [JsonProperty("Name of the scrapper currency")]
            public string currency_name = "epic scrap";
            [JsonProperty("Shortname of the item the currency will be based off of")]
            public string currency_shortname = "blood";
            [JsonProperty("Currency skin")]
            public ulong currency_skin = 2834920066;
            [JsonProperty("Currency received for scrapping items based on tier")]
            public Dictionary<string, int> scrapper_value = new Dictionary<string, int>();
            [JsonProperty("Cost to enhance an item based on the buff type")]
            public Dictionary<Buff, int> enhancement_cost = new Dictionary<Buff, int>();
        }
        public class ButtonInfo {
            [JsonProperty("Enable use of the HUD button? Players can still disable it client side via the player settings")]
            public bool enable_button = true;
            [JsonProperty("Path of the icon button.You can use a SkinID, URL or assets/icons path")]
            public string icon_path = "assets/icons/inventory.png";
            [JsonProperty("Offset Min")]
            public string offsetMin = "-251.4 20.7";
            [JsonProperty("Offset Max")]
            public string offsetMax = "-215.4 56.7";
        }
        public class MissionConfig {
            public bool enabled = true;
            public Dictionary<string, MissionInfo> mission_rewards;
            public MissionConfig(bool enabled, Dictionary<string, MissionInfo> mission_rewards) {
                this.enabled = enabled;
                this.mission_rewards = mission_rewards;
            }
            [JsonConstructor]
            public MissionConfig() {
            }
        }
        public class MissionInfo {
            [JsonProperty("Chance after completing a mission to obtain a reward [%]")]
            public float reward_chance = 25f;
            [JsonProperty("Set types that can be given as a reward, and their respective chance weights")]
            public Dictionary<string, int> rewards = new Dictionary<string, int>();
            public MissionInfo(float reward_chance, Dictionary<string, int> rewards) {
                this.reward_chance = reward_chance;
                this.rewards = rewards;
            }
        }
        public class RandomTraderAPI {
            [JsonProperty("CopyPaste file name to use")]
            public string copypaste_file_name = "EnhancedStore";
            [JsonProperty("Shop name")]
            public string shop_name = "Enhanced Item Shop";
            [JsonProperty("Shop purchase limit")]
            public int shop_purchase_limit = 2;
            [JsonProperty("How many random items from the list will be picked?")]
            public int shop_display_amount = 8;
            [JsonProperty("Minimum quantity of an item that the shop will stock")]
            public int min_stock_quantity = 1;
            [JsonProperty("Maximum quantity of an item that the shop will stock")]
            public int max_stock_quantity = 5;
            [JsonProperty("Minimum cost of an item")]
            public int min_cost = 100;
            [JsonProperty("Maximum cost of an item")]
            public int max_cost = 1000;
            [JsonProperty("Skin the items?")]
            public bool skin_item = true;
            [JsonProperty("How many rolls of each enhancement should we add?")]
            public int quantity_of_enhancements = 10;
        }
        public class CraftingChance {
            [JsonProperty("Should players have a chance of their crafted items becoming enhanced?")]
            public bool enabled = true;
            [JsonProperty("What % chance each craft should they have for their item to be enhanced?")]
            public float chance = 1.0f;
            [JsonProperty("List of craftable items that cannot be enhanced")]
            public List<string> black_list = new List<string>();
        }
        public class LootPickup {
            [JsonProperty("Should the Attractive set bonus only trigger with melee weapons?")]
            public bool MeleeOnly = false;
            [JsonProperty("Maximum distance that the player can be for Attractive set bonus to trigger.0 = no distance limit.")]
            public float MaxDistance = 0f;
        }
        public class PVPCrit {
            [JsonProperty("Minimum crit damage multiplier")]
            public float min_crit_modifier = 0.1f;
            [JsonProperty("Maximum crit damage multiplier")]
            public float max_crit_modifier = 0.3f;
        }
        public class GeneralSettings {
            [JsonProperty("Automatically add missing sets from the default sets?")]
            public bool auto_update_sets = true;
            [JsonProperty("Automatically add missing set bonuses from the default sets?")]
            public bool auto_update_set_bonuses = true;
            [JsonProperty("Maximum distance that the TeamHeal setbonus will share healing with")]
            public float TeamHealRadius = 5f;
            [JsonProperty("Message players about how EpicLoot works when they find their first piece (resets on plugin restart)?")]
            public bool message_on_first_loot = true;
            [JsonProperty("Prevent EpicLoot items from being reskinned?")]
            public bool prevent_reskin = false;
            [JsonProperty("Prevent EpicLoot items from losing max condition?")]
            public bool prevent_max_condition_loss = false;
            [JsonProperty("Chat commands to open the Inspector")]
            public List<string> ui_commands = new List<string>();
            [JsonProperty("Permission based chance multiplier for finding EpicLoot in crates [1.0 = normal chance.2.0 = twice the chance]")]
            public Dictionary<string, float> perm_chance_modifier_loot = new Dictionary<string, float>();
            [JsonProperty("Permission based chance multiplier for creating an EpicLoot item while crafting [1.0 = normal chance.2.0 = twice the chance]")]
            public Dictionary<string, float> perm_chance_modifier_craft = new Dictionary<string, float>();
            [JsonProperty("Allow the plugin to handle stacking of Epic Loot items? [set to false if using StackModifier]")]
            public bool handleStacking = true;
            [JsonProperty("Allow the plugin to handle splitting of Epic Loot items? [set to false if using StackModifier]")]
            public bool handleSplitting = true;
        }
        public class TierSettings {
            [JsonProperty("Tier display names that show up in the menu")]
            public Dictionary<string, string> tier_display_names = new Dictionary<string, string>() {
                ["s"]
                = "Legendary", ["a"] = "Epic", ["b"] = "Rare", ["c"] = "Uncommon"
            }
            ;
            [JsonProperty("Tier colours")]
            public Dictionary<string, string> tier_colours = new Dictionary<string, string>() {
                ["s"]
                = "#FFF900", ["a"] = "#9500BA", ["b"] = "#077E93", ["c"] = "#AE5403"
            }
            ;
        }
        public class HorseStats {
            [JsonProperty("Adjust run speed?")]
            public bool Adjust_Run_Speed = true;
            [JsonProperty("Adjust trot speed?")]
            public bool Adjust_Trot_Speed = true;
            [JsonProperty("Adjust walk speed?")]
            public bool Adjust_Walk_Speed = true;
            [JsonProperty("Adjust turn speed?")]
            public bool Adjust_Turn_Speed = true;
        }
        public class Scavengers {
            [JsonProperty("Minimum extra scrap that a player should receive when the Scavengers buff triggers")]
            public int Min_extra_scrap = 1;
            [JsonProperty("Maximum extra scrap that a player should receive when the Scavengers buff triggers")]
            public int Max_extra_scrap = 3;
        }
        public class Raiders {
            [JsonProperty("Blacklist of items that will not trigger the raiders buff")]
            public List<string> blacklist = new List<string>();
        }
        public class DropTableLuck {
            [JsonProperty("Drop table")]
            public List<DropTable> dropTable;
            public DropTableLuck(List<DropTable> dropTable) {
                this.dropTable = dropTable;
            }
        }
        public enum GatherType {
            Mine, Chop, Skin, Fish
        }
        public class DropTable {
            public string shortname;
            public ulong skin;
            public int min_quantity;
            public int max_quantity;
            public string name;
            public int drop_weight;
            public DropTable(string shortname, int min_quantity, int max_quantity, int drop_weight, ulong skin = 0, string name = null) {
                this.shortname = shortname;
                this.min_quantity = min_quantity;
                this.max_quantity = max_quantity;
                this.skin = skin;
                this.name = name;
                this.drop_weight = drop_weight;
            }
        }
        public class SkillTreeInfo {
            [JsonProperty("Allow the MaxRepair buff from SkillTree to repair EpicLoot items to max condition?")]
            public bool allow_MaxRepair_buff_on_EL_items = false;
            [JsonProperty("EpicLoot chance skill")]
            public EpicChanceBuff epicChanceBuff = new EpicChanceBuff();
            public class EpicChanceBuff {
                [JsonProperty("Set to true if you want to add the Epic Loot skill to the skill tree")]
                public bool enabled = false;
                [JsonProperty("Which skill tree should the skill be added to? [Name must match the tree name config in SkillTree exactly]")]
                public string tree = "Scavenging";
                [JsonProperty("Which tier level should it be added to? [1, 2 or 3]")]
                public int tier = 1;
                [JsonProperty("What is the name of the skill?")]
                public string skillName = "Epic Loot Chance";
                [JsonProperty("Maximum level for the loot chance buff")]
                public int max_level = 5;
                [JsonProperty("Chance increase per level for the loot chance buff [0.05 = 5%]")]
                public float increase_per_level = 0.05f;
                [JsonProperty("URL of the skill icon")]
                public string URL = "https://www.dropbox.com/s/7oecz6cy1oy0nia/Epic_Loot_Chance.png?dl=1";
                [JsonProperty("Skin ID of the skill icon")]
                public ulong skin = 2874788669;
            }
        }
        protected override void LoadDefaultConfig() {
            config = new Configuration();
            config.enhancements = Default_Tier_Values;
            config.global_blacklist = new List<string>() {
                "geiger.counter", "flare", "grenade.smoke", "explosive.timed", "rf.detonator", "tool.camera", "skull", "grenade.f1", "grenade.flashbang", "grenade.molotov", "explosive.satchel", "grenade.beancan"
            }
            ;
            config.containers = DefaultProfile;
            config.luck_drop_table = Default_tables;
            config.mission_rewards = Default_Mission_Rewards;
            config.corpses = DefaultCorpseProfile;
            config.fishing_contest_api.shortnames = DefaultFishingContestShortnames;
            config.fishing_contest_api.buffs = DefaultFishingContestBuffs;
            config.scrapper_settings.scrapper_value = DefaultScrapperTierValue;
            config.scrapper_settings.enhancement_cost = DefaultEnhancementCost();
            config.general_settings.ui_commands = new List<string>() {
                "el", "elinspect"
            }
            ;
            config.raidablebases_settings = new RaidableBaseSettings() {
                enabled = true, base_settings = DefaultRaidables, container_whitelist = DefaultRaidContainerWhitelist
            }
            ;
            config.healthshot_override = DefaultHealthShot;
            config.general_settings.perm_chance_modifier_craft.Add("epicloot.vip", 1);
            config.general_settings.perm_chance_modifier_loot.Add("epicloot.vip", 1);
        }
        protected override void LoadConfig() {
            base.LoadConfig();
            try {
                config = Config.ReadObject<Configuration>();
                if (config == null) {
                    throw new JsonException();
                }
                if (!config.ToDictionary().Keys.SequenceEqual(Config.ToDictionary(x => x.Key, x => x.Value).Keys)) {
                    PrintToConsole("Configuration appears to be outdated; updating and saving");
                }
            }
            catch {
                PrintToConsole($"Configuration file {Name}.json is invalid; using defaults");
                LoadDefaultConfig();
            }
            SaveConfig();
        }
        protected override void SaveConfig() {
            PrintToConsole($"Configuration changes saved to {Name}.json");
            Config.WriteObject(config, true);
        }
#endregion
#region Default settings
        Dictionary<string, float> DefaultHealthShot {
            get {
                return new Dictionary<string, float>() {
                    ["lmg.m249"]
                    = 0.2f, ["hmlmg"] = 0.2f
                }
                ;
            }
        }
        Dictionary<int, RaidableBaseLootSettings> DefaultRaidables {
            get {
                return new Dictionary<int, RaidableBaseLootSettings>() {
                    [0]
                    = new RaidableBaseLootSettings(1, 2), [1] = new RaidableBaseLootSettings(2, 4), [2] = new RaidableBaseLootSettings(3, 6), [3] = new RaidableBaseLootSettings(5, 10), [4] = new RaidableBaseLootSettings(8, 14)
                }
                ;
            }
        }
        public List<string> DefaultRaidContainerWhitelist {
            get {
                return new List<string>() {
                    "coffinstorage", "box.wooden.large", "dropbox.deployed", "woodbox_deployed"
                }
                ;
            }
        }
        List<Buff> DefaultFishingContestBuffs {
            get {
                return new List<Buff>() {
                    Buff.Fishermans
                }
                ;
            }
        }
        List<string> DefaultFishingContestShortnames {
            get {
                return new List<string>() {
                    "hoodie", "pants", "attire.hide.boots", "shoes.boots", "hat.beenie", "twitchsunglasses", "sunglasses02black", "santabeard", "burlap.gloves.new", "burlap.gloves", "tactical.gloves", "wood.armor.jacket", "jacket", "wood.armor.pants", "fishingrod.handmade"
                }
                ;
            }
        }
        LootInfo DefaultProfile = new LootInfo() {
            containers = Default_Crate_Spawns, use_default_loot_table = true, barrels = Default_Barrel_Spawns
        }
        ;
        CorpseLootInfo DefaultCorpseProfile = new CorpseLootInfo() {
            corpses = Default_Corpse_Spawns
        }
        ;
        Dictionary<Buff, int> DefaultEnhancementCost() {
            var result = new Dictionary<Buff, int>();
            List<Buff> buffs = Pool.Get<List<Buff>>();
            buffs.AddRange(Enum.GetValues(typeof(Buff)).Cast<Buff>().Intersect(config.enhancements.Keys));
            foreach (var buff in buffs) {
                if (!result.ContainsKey(buff)) result.Add(buff, 100);
            }
            Pool.FreeUnmanaged(ref buffs);
            return result;
        }
        Dictionary<string, int> DefaultScrapperTierValue {
            get {
                return new Dictionary<string, int>() {
                    ["s"]
                    = 10, ["a"] = 8, ["b"] = 6, ["c"] = 4
                }
                ;
            }
        }
        public MissionConfig Default_Mission_Rewards {
            get {
                return new MissionConfig(true, new Dictionary<string, MissionInfo>() {
                    ["missionprovider_fishing_a"]
                    = new MissionInfo(25f, new Dictionary<string, int>() {
                        ["Fishermans"]
                        = 100, ["Scavengers"] = 25, ["Foragers"] = 25
                    }
                    ), ["missionprovider_fishing_b"] = new MissionInfo(25f, new Dictionary<string, int>() {
                        ["Fishermans"]
                        = 100, ["Scavengers"] = 25, ["Foragers"] = 25
                    }
                    ), ["missionprovider_bandit_a"] = new MissionInfo(25f, new Dictionary<string, int>() {
                        ["Lumberjacks"]
                        = 100, ["Operators"] = 25, ["Transporters"] = 25
                    }
                    ), ["missionprovider_bandit_b"] = new MissionInfo(25f, new Dictionary<string, int>() {
                        ["Lumberjacks"]
                        = 100, ["Operators"] = 25, ["Transporters"] = 25
                    }
                    ), ["missionprovider_outpost_a"] = new MissionInfo(25f, new Dictionary<string, int>() {
                        ["Miners"]
                        = 100, ["Assassins"] = 25, ["Reinforced"] = 25
                    }
                    ), ["missionprovider_outpost_b"] = new MissionInfo(25f, new Dictionary<string, int>() {
                        ["Miners"]
                        = 100, ["Assassins"] = 25, ["Reinforced"] = 25
                    }
                    ), ["missionprovider_stables_a"] = new MissionInfo(25f, new Dictionary<string, int>() {
                        ["Jockeys"]
                        = 100, ["Builders"] = 25, ["Skinners"] = 25
                    }
                    )
                }
                );
            }
        }
        public static Dictionary<string, float> Default_Crate_Spawns {
            get {
                return new Dictionary<string, float>() {
                    ["crate_normal_2"]
                    = 1f, ["crate_normal"] = 3f, ["crate_elite"] = 15f, ["crate_underwater_basic"] = 6f, ["crate_underwater_advanced"] = 12f, ["heli_crate"] = 10f, ["bradley_crate"] = 10f, ["codelockedhackablecrate"] = 10f, ["codelockedhackablecrate_oilrig"] = 10f, ["crate_tools"] = 1.5f
                }
                ;
            }
        }
        public static Dictionary<string, float> Default_Barrel_Spawns {
            get {
                return new Dictionary<string, float>() {
                    ["loot-barrel-1"]
                    = 1f, ["loot_barrel_1"] = 1f, ["loot-barrel-2"] = 2f, ["loot_barrel_2"] = 2f,
                }
                ;
            }
        }
        public static Dictionary<string, float> Default_Corpse_Spawns {
            get {
                return new Dictionary<string, float>() {
                    ["scientistnpc_heavy"]
                    = 3f, ["scientistnpc_cargo"] = 1f, ["scientistnpc_cargo_turret_any"] = 1f, ["scientistnpc_cargo_turret_lr300"] = 1f, ["scientistnpc_ch47_gunner"] = 1f, ["scientistnpc_excavator"] = 1f, ["scientistnpc_full_any"] = 1f, ["scientistnpc_full_lr300"] = 1f, ["scientistnpc_full_mp5"] = 1f, ["scientistnpc_full_pistol"] = 1f, ["scientistnpc_full_shotgun"] = 1f, ["scientistnpc_junkpile_pistol"] = 1f, ["scientistnpc_oilrig"] = 1f, ["scientistnpc_patrol"] = 1f, ["scientistnpc_peacekeeper"] = 1f, ["scientistnpc_roam"] = 1f, ["scientistnpc_roamtethered"] = 1f
                }
                ;
            }
        }
        Dictionary<string, List<ulong>> DefaultItemSkins() {
            var result = new Dictionary<string, List<ulong>>();
            System.Random rnd = new System.Random();
            foreach (var skin in Rust.Workshop.Approved.All.Values) {
                if (EnhanceableItems.Contains(skin.Skinnable.ItemName)) {
                    if (!result.ContainsKey(skin.Skinnable.ItemName)) result.Add(skin.Skinnable.ItemName, new List<ulong>());
                    result[skin.Skinnable.ItemName].Add(skin.WorkshopdId);
                }
            }
            // Picks 5 random skins from each result
            foreach (var entry in result) {
                if (entry.Value.Count > 5) {
                    List<ulong> skins = Pool.Get<List<ulong>>();
                    skins.AddRange(entry.Value.OrderBy(x => rnd.Next()).Take(5));
                    entry.Value.Clear();
                    entry.Value.AddRange(skins);
                    Pool.FreeUnmanaged(ref skins);
                }
                else if (entry.Value.Count == 0) entry.Value.Add(0);
            }
            return result;
        }
        Dictionary<string, string> DefaultTierColours {
            get {
                return new Dictionary<string, string>() {
                    ["s"]
                    = "#FFF900", ["a"] = "#9500BA", ["b"] = "#077E93", ["c"] = "#AE5403",
                }
                ;
            }
        }
        Dictionary<Buff, EnhancementInfo> Default_Tier_Values {
            get {
                return new Dictionary<Buff, EnhancementInfo>() {
                    [Buff.Miners]
                    = new EnhancementInfo(true, new Dictionary<string, EnhancementInfo.TierInfo>() {
                        ["s"]
                        = new EnhancementInfo.TierInfo(10, 0.15f, 0.25f), ["a"] = new EnhancementInfo.TierInfo(20, 0.10f, 0.17f), ["b"] = new EnhancementInfo.TierInfo(50, 0.05f, 0.12f), ["c"] = new EnhancementInfo.TierInfo(100, 0.03f, 0.08f)
                    }
                    , new Dictionary<int, SetBonusEffect>() {
                        [2]
                        = new SetBonusEffect(new Dictionary<Buff, SetBonusValues>() {
                            [Buff.BonusMultiplier]
                            = new SetBonusValues(0.25f)
                        }
                        ), [4] = new SetBonusEffect(new Dictionary<Buff, SetBonusValues>() {
                            [Buff.InstantMining]
                            = new SetBonusValues(0.10f), [Buff.Smelting] = new SetBonusValues(0.20f), [Buff.BonusMultiplier] = new SetBonusValues(0.35f)
                        }
                        ), [6] = new SetBonusEffect(new Dictionary<Buff, SetBonusValues>() {
                            [Buff.InstantMining]
                            = new SetBonusValues(0.20f), [Buff.Smelting] = new SetBonusValues(0.30f), [Buff.BonusMultiplier] = new SetBonusValues(0.65f), [Buff.MinersLuck] = new SetBonusValues(0.05f)
                        }
                        )
                    }
                    ), [Buff.Lumberjacks] = new EnhancementInfo(true, new Dictionary<string, EnhancementInfo.TierInfo>() {
                        ["s"]
                        = new EnhancementInfo.TierInfo(10, 0.15f, 0.25f), ["a"] = new EnhancementInfo.TierInfo(20, 0.10f, 0.17f), ["b"] = new EnhancementInfo.TierInfo(50, 0.05f, 0.12f), ["c"] = new EnhancementInfo.TierInfo(100, 0.03f, 0.08f)
                    }
                    , new Dictionary<int, SetBonusEffect>() {
                        [2]
                        = new SetBonusEffect(new Dictionary<Buff, SetBonusValues>() {
                            [Buff.BonusMultiplier]
                            = new SetBonusValues(0.25f)
                        }
                        ), [4] = new SetBonusEffect(new Dictionary<Buff, SetBonusValues>() {
                            [Buff.InstantWoodcutting]
                            = new SetBonusValues(0.10f), [Buff.Regrowth] = new SetBonusValues(0.10f), [Buff.BonusMultiplier] = new SetBonusValues(0.35f)
                        }
                        ), [6] = new SetBonusEffect(new Dictionary<Buff, SetBonusValues>() {
                            [Buff.InstantWoodcutting]
                            = new SetBonusValues(0.20f), [Buff.Regrowth] = new SetBonusValues(0.20f), [Buff.BonusMultiplier] = new SetBonusValues(0.65f), [Buff.WoodcuttersLuck] = new SetBonusValues(0.05f)
                        }
                        )
                    }
                    ), [Buff.Skinners] = new EnhancementInfo(true, new Dictionary<string, EnhancementInfo.TierInfo>() {
                        ["s"]
                        = new EnhancementInfo.TierInfo(10, 0.15f, 0.25f), ["a"] = new EnhancementInfo.TierInfo(20, 0.10f, 0.17f), ["b"] = new EnhancementInfo.TierInfo(50, 0.05f, 0.12f), ["c"] = new EnhancementInfo.TierInfo(100, 0.03f, 0.08f)
                    }
                    , new Dictionary<int, SetBonusEffect>() {
                        [2]
                        = new SetBonusEffect(new Dictionary<Buff, SetBonusValues>() {
                            [Buff.BonusMultiplier]
                            = new SetBonusValues(0.25f)
                        }
                        ), [4] = new SetBonusEffect(new Dictionary<Buff, SetBonusValues>() {
                            [Buff.InstantSkinning]
                            = new SetBonusValues(0.10f), [Buff.InstantCook] = new SetBonusValues(0.50f), [Buff.BonusMultiplier] = new SetBonusValues(0.35f)
                        }
                        ), [6] = new SetBonusEffect(new Dictionary<Buff, SetBonusValues>() {
                            [Buff.InstantSkinning]
                            = new SetBonusValues(0.20f), [Buff.InstantCook] = new SetBonusValues(0.80f), [Buff.BonusMultiplier] = new SetBonusValues(0.65f), [Buff.SkinnersLuck] = new SetBonusValues(0.05f)
                        }
                        )
                    }
                    ), [Buff.Farmers] = new EnhancementInfo(true, new Dictionary<string, EnhancementInfo.TierInfo>() {
                        ["s"]
                        = new EnhancementInfo.TierInfo(10, 0.10f, 0.15f), ["a"] = new EnhancementInfo.TierInfo(20, 0.06f, 0.11f), ["b"] = new EnhancementInfo.TierInfo(50, 0.04f, 0.07f), ["c"] = new EnhancementInfo.TierInfo(100, 0.01f, 0.05f)
                    }
                    , new Dictionary<int, SetBonusEffect>() {
                        [2]
                        = new SetBonusEffect(new Dictionary<Buff, SetBonusValues>() {
                            [Buff.BonusMultiplier]
                            = new SetBonusValues(0.10f)
                        }
                        ), [4] = new SetBonusEffect(new Dictionary<Buff, SetBonusValues>() {
                            [Buff.BonusMultiplier]
                            = new SetBonusValues(0.25f)
                        }
                        ), [6] = new SetBonusEffect(new Dictionary<Buff, SetBonusValues>() {
                            [Buff.BonusMultiplier]
                            = new SetBonusValues(0.50f)
                        }
                        )
                    }
                    ), [Buff.Foragers] = new EnhancementInfo(true, new Dictionary<string, EnhancementInfo.TierInfo>() {
                        ["s"]
                        = new EnhancementInfo.TierInfo(10, 0.15f, 0.25f), ["a"] = new EnhancementInfo.TierInfo(20, 0.10f, 0.17f), ["b"] = new EnhancementInfo.TierInfo(50, 0.05f, 0.12f), ["c"] = new EnhancementInfo.TierInfo(100, 0.03f, 0.08f)
                    }
                    , new Dictionary<int, SetBonusEffect>() {
                        [2]
                        = new SetBonusEffect(new Dictionary<Buff, SetBonusValues>() {
                            [Buff.BonusMultiplier]
                            = new SetBonusValues(0.25f)
                        }
                        ), [4] = new SetBonusEffect(new Dictionary<Buff, SetBonusValues>() {
                            [Buff.BonusMultiplier]
                            = new SetBonusValues(0.35f)
                        }
                        ), [6] = new SetBonusEffect(new Dictionary<Buff, SetBonusValues>() {
                            [Buff.BonusMultiplier]
                            = new SetBonusValues(0.65f)
                        }
                        )
                    }
                    ), [Buff.Fishermans] = new EnhancementInfo(true, new Dictionary<string, EnhancementInfo.TierInfo>() {
                        ["s"]
                        = new EnhancementInfo.TierInfo(10, 0.15f, 0.25f), ["a"] = new EnhancementInfo.TierInfo(20, 0.10f, 0.17f), ["b"] = new EnhancementInfo.TierInfo(50, 0.05f, 0.12f), ["c"] = new EnhancementInfo.TierInfo(100, 0.03f, 0.08f)
                    }
                    , new Dictionary<int, SetBonusEffect>() {
                        [2]
                        = new SetBonusEffect(new Dictionary<Buff, SetBonusValues>() {
                            [Buff.BonusMultiplier]
                            = new SetBonusValues(0.25f)
                        }
                        ), [4] = new SetBonusEffect(new Dictionary<Buff, SetBonusValues>() {
                            [Buff.BonusMultiplier]
                            = new SetBonusValues(0.35f), [Buff.Gilled] = new SetBonusValues(0.50f), [Buff.FishingRodModifier] = new SetBonusValues(0.25f)
                        }
                        ), [6] = new SetBonusEffect(new Dictionary<Buff, SetBonusValues>() {
                            [Buff.BonusMultiplier]
                            = new SetBonusValues(0.75f), [Buff.Gilled] = new SetBonusValues(1.0f), [Buff.FishersLuck] = new SetBonusValues(0.05f), [Buff.FishingRodModifier] = new SetBonusValues(0.50f)
                        }
                        )
                    }
                    ), [Buff.Demo] = new EnhancementInfo(true, new Dictionary<string, EnhancementInfo.TierInfo>() {
                        ["s"]
                        = new EnhancementInfo.TierInfo(10, 0.10f, 0.15f), ["a"] = new EnhancementInfo.TierInfo(20, 0.06f, 0.11f), ["b"] = new EnhancementInfo.TierInfo(50, 0.04f, 0.07f), ["c"] = new EnhancementInfo.TierInfo(100, 0.01f, 0.05f)
                    }
                    , new Dictionary<int, SetBonusEffect>() {
                        [2]
                        = new SetBonusEffect(new Dictionary<Buff, SetBonusValues>() {
                            [Buff.BonusMultiplier]
                            = new SetBonusValues(0.20f)
                        }
                        ), [4] = new SetBonusEffect(new Dictionary<Buff, SetBonusValues>() {
                            [Buff.BonusMultiplier]
                            = new SetBonusValues(0.50f)
                        }
                        )
                    }
                    ), [Buff.Elemental] = new EnhancementInfo(true, new Dictionary<string, EnhancementInfo.TierInfo>() {
                        ["s"]
                        = new EnhancementInfo.TierInfo(10, 0.15f, 0.25f), ["a"] = new EnhancementInfo.TierInfo(20, 0.10f, 0.17f), ["b"] = new EnhancementInfo.TierInfo(50, 0.05f, 0.12f), ["c"] = new EnhancementInfo.TierInfo(100, 0.03f, 0.08f)
                    }
                    , new Dictionary<int, SetBonusEffect>() {
                        [2]
                        = new SetBonusEffect(new Dictionary<Buff, SetBonusValues>() {
                            [Buff.BonusMultiplier]
                            = new SetBonusValues(0.20f)
                        }
                        ), [4] = new SetBonusEffect(new Dictionary<Buff, SetBonusValues>() {
                            [Buff.BonusMultiplier]
                            = new SetBonusValues(0.50f)
                        }
                        )
                    }
                    ), [Buff.Scavengers] = new EnhancementInfo(true, new Dictionary<string, EnhancementInfo.TierInfo>() {
                        ["s"]
                        = new EnhancementInfo.TierInfo(10, 0.10f, 0.15f), ["a"] = new EnhancementInfo.TierInfo(20, 0.06f, 0.11f), ["b"] = new EnhancementInfo.TierInfo(50, 0.04f, 0.07f), ["c"] = new EnhancementInfo.TierInfo(100, 0.01f, 0.05f)
                    }
                    , new Dictionary<int, SetBonusEffect>() {
                        [2]
                        = new SetBonusEffect(new Dictionary<Buff, SetBonusValues>() {
                            [Buff.BonusMultiplier]
                            = new SetBonusValues(0.10f)
                        }
                        ), [4] = new SetBonusEffect(new Dictionary<Buff, SetBonusValues>() {
                            [Buff.BonusMultiplier]
                            = new SetBonusValues(0.20f), [Buff.Smasher] = new SetBonusValues(0.30f)
                        }
                        ), [6] = new SetBonusEffect(new Dictionary<Buff, SetBonusValues>() {
                            [Buff.BonusMultiplier]
                            = new SetBonusValues(0.50f), [Buff.Smasher] = new SetBonusValues(0.75f), [Buff.Attractive] = new SetBonusValues(0.50f)
                        }
                        )
                    }
                    ), [Buff.Transporters] = new EnhancementInfo(true, new Dictionary<string, EnhancementInfo.TierInfo>() {
                        ["s"]
                        = new EnhancementInfo.TierInfo(10, 0.10f, 0.15f), ["a"] = new EnhancementInfo.TierInfo(20, 0.06f, 0.11f), ["b"] = new EnhancementInfo.TierInfo(50, 0.04f, 0.07f), ["c"] = new EnhancementInfo.TierInfo(100, 0.01f, 0.05f)
                    }
                    , new Dictionary<int, SetBonusEffect>() {
                        [2]
                        = new SetBonusEffect(new Dictionary<Buff, SetBonusValues>() {
                            [Buff.BonusMultiplier]
                            = new SetBonusValues(0.10f)
                        }
                        ), [4] = new SetBonusEffect(new Dictionary<Buff, SetBonusValues>() {
                            [Buff.BonusMultiplier]
                            = new SetBonusValues(0.20f), [Buff.IncreasedBoatSpeed] = new SetBonusValues(0.50f)
                        }
                        ), [6] = new SetBonusEffect(new Dictionary<Buff, SetBonusValues>() {
                            [Buff.BonusMultiplier]
                            = new SetBonusValues(0.50f), [Buff.IncreasedBoatSpeed] = new SetBonusValues(1f), [Buff.FreeVehicleRepair] = new SetBonusValues(1f)
                        }
                        )
                    }
                    ), [Buff.Crafters] = new EnhancementInfo(true, new Dictionary<string, EnhancementInfo.TierInfo>() {
                        ["s"]
                        = new EnhancementInfo.TierInfo(10, 0.10f, 0.15f), ["a"] = new EnhancementInfo.TierInfo(20, 0.06f, 0.11f), ["b"] = new EnhancementInfo.TierInfo(50, 0.04f, 0.07f), ["c"] = new EnhancementInfo.TierInfo(100, 0.01f, 0.05f)
                    }
                    , new Dictionary<int, SetBonusEffect>() {
                        [2]
                        = new SetBonusEffect(new Dictionary<Buff, SetBonusValues>() {
                            [Buff.BonusMultiplier]
                            = new SetBonusValues(0.10f)
                        }
                        ), [4] = new SetBonusEffect(new Dictionary<Buff, SetBonusValues>() {
                            [Buff.BonusMultiplier]
                            = new SetBonusValues(0.20f), [Buff.Researcher] = new SetBonusValues(0.10f)
                        }
                        ), [6] = new SetBonusEffect(new Dictionary<Buff, SetBonusValues>() {
                            [Buff.BonusMultiplier]
                            = new SetBonusValues(0.50f), [Buff.Researcher] = new SetBonusValues(0.3f)
                        }
                        )
                    }
                    ), [Buff.Reinforced] = new EnhancementInfo(true, new Dictionary<string, EnhancementInfo.TierInfo>() {
                        ["s"]
                        = new EnhancementInfo.TierInfo(10, 0.10f, 0.15f), ["a"] = new EnhancementInfo.TierInfo(20, 0.06f, 0.11f), ["b"] = new EnhancementInfo.TierInfo(50, 0.04f, 0.07f), ["c"] = new EnhancementInfo.TierInfo(100, 0.01f, 0.05f)
                    }
                    , new Dictionary<int, SetBonusEffect>() {
                        [2]
                        = new SetBonusEffect(new Dictionary<Buff, SetBonusValues>() {
                            [Buff.BonusMultiplier]
                            = new SetBonusValues(0.10f)
                        }
                        ), [4] = new SetBonusEffect(new Dictionary<Buff, SetBonusValues>() {
                            [Buff.BonusMultiplier]
                            = new SetBonusValues(0.20f), [Buff.Feline] = new SetBonusValues(0.50f, new Dictionary<string, string>() {
                                ["DoubleJump.use"]
                                = "Double Jump"
                            }
                            ), [Buff.Lead] = new SetBonusValues(0.50f)
                        }
                        ), [6] = new SetBonusEffect(new Dictionary<Buff, SetBonusValues>() {
                            [Buff.BonusMultiplier]
                            = new SetBonusValues(0.50f), [Buff.Feline] = new SetBonusValues(1f, new Dictionary<string, string>() {
                                ["DoubleJump.use"]
                                = "Double Jump"
                            }
                            ), [Buff.Lead] = new SetBonusValues(1f)
                        }
                        )
                    }
                    ), [Buff.Tamers] = new EnhancementInfo(true, new Dictionary<string, EnhancementInfo.TierInfo>() {
                        ["s"]
                        = new EnhancementInfo.TierInfo(10, 0.10f, 0.15f), ["a"] = new EnhancementInfo.TierInfo(20, 0.06f, 0.11f), ["b"] = new EnhancementInfo.TierInfo(50, 0.04f, 0.07f), ["c"] = new EnhancementInfo.TierInfo(100, 0.01f, 0.05f)
                    }
                    , new Dictionary<int, SetBonusEffect>() {
                        [2]
                        = new SetBonusEffect(new Dictionary<Buff, SetBonusValues>() {
                            [Buff.BonusMultiplier]
                            = new SetBonusValues(0.10f)
                        }
                        ), [4] = new SetBonusEffect(new Dictionary<Buff, SetBonusValues>() {
                            [Buff.BonusMultiplier]
                            = new SetBonusValues(0.20f), [Buff.Reflexes] = new SetBonusValues(0.10f)
                        }
                        ), [6] = new SetBonusEffect(new Dictionary<Buff, SetBonusValues>() {
                            [Buff.BonusMultiplier]
                            = new SetBonusValues(0.50f), [Buff.Reflexes] = new SetBonusValues(0.2f)
                        }
                        )
                    }
                    ), [Buff.Hunters] = new EnhancementInfo(true, new Dictionary<string, EnhancementInfo.TierInfo>()
// ... [Code preview truncated due to length. Full source in attached file] ...

Автор
15FPS
Скачиваний
0
Просмотры
1
Первый выпуск
Обновление
Оценка
0.00 звёзд 0 оценок
Сверху