C#:
// Все права принадлежат дискорд сообществу https://discord.gg/VgNHPpNrz6
using Facepunch;
using Facepunch.Extend;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Oxide.Core;
using Oxide.Core.Configuration;
using Oxide.Core.Libraries.Covalence;
using Oxide.Core.Plugins;
using Oxide.Game.Rust.Cui;
using ProtoBuf;
using Rust.Modular;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TinyJSON;
using UnityEngine;
using WebSocketSharp;
using static Steamworks.InventoryItem;
namespace Oxide.Plugins {
[Info("Skill Tree", "Netrunner", "1.0.0")]
[Description("Скилы")]
class SkillTree : RustPlugin {
#region Config
private Configuration config;
public class Configuration {
[JsonProperty("General settings")]
public GeneralSettings general_settings = new GeneralSettings();
public class GeneralSettings {
[JsonProperty("Points required to unlock Tier 2 nodes in the tech trees")]
public int t2_points_required = 5;
[JsonProperty("Points required to unlock Tier 3 nodes in the tech trees")]
public int t3_points_required = 10;
[JsonProperty("Points required to unlock the Ultimate node in tech trees")]
public int ultimate_points_required = 25;
[JsonProperty("Skill points per level")]
public int points_per_level = 2;
[JsonProperty("Maximum points a player can spend [default]")]
public int max_skill_points = 200;
[JsonProperty("Modified max skill points based on permissions [must be higher than default]")]
public Dictionary<string, int> max_skill_points_override = new Dictionary<string, int>();
[JsonProperty("Maximum level a player can get to")]
public int max_player_level = 100;
[JsonProperty("Allow players to respec their skill points")]
public bool allow_respecs = true;
[JsonProperty("Cost per point to respec [default]")]
public double respec_cost = 30;
[JsonProperty("Cost per point to respec based on permissions [must be lower than default]")]
public Dictionary<string, double> respec_cost_override = new Dictionary<string, double>();
[JsonProperty("Currency type to respec [scrap, economics, srp, custom]")]
public string respec_currency = "scrap";
[JsonProperty("If currency is set to custom, what are the details of the item")]
public CustomCurrency respec_currency_custom = new CustomCurrency();
[JsonProperty("Multiplier increase after each respec [0.2 = a 20% increase in the cost to respec each time.0 = no increase] [resets on wipe or data reset]")]
public float respec_multiplier = 0;
[JsonProperty("Maximum value that the respec multiplier can get to [0 = no limit]")]
public float respec_multiplier_max = 0;
[JsonProperty("List of rewards the player receives based on level")]
public Dictionary<int, LevelReward> level_rewards = new Dictionary<int, LevelReward>();
[JsonProperty("Require players to have specific tree permissions to open them")]
public bool require_tree_perms = false;
[JsonProperty("Drop bag on death")]
public bool drop_bag_on_death = true;
[JsonProperty("XP pump bar settings")]
public PumpBar pump_bar_settings = new PumpBar();
[JsonProperty("Cache images using skinid or url? [skinid, url]")]
public string image_cache_source = "skinid";
[JsonProperty("Redownload all images when the plugin reloads if using URL?")]
public bool replace_on_reload = false;
}
[JsonProperty("Base yield settings")]
public BaseYieldSettings base_yield_settings = new BaseYieldSettings();
public class BaseYieldSettings {
[JsonProperty("Allow Skill Tree to adjust the base amount of resource received? Buffs will base their modifiers off of the amended base amount.")]
public bool adjust_base_yield = false;
[JsonProperty("Yield types multipliers [1.0 = vanilla]")]
public Dictionary<YieldTypes, float> multipliers = new Dictionary<YieldTypes, float>();
}
[JsonProperty("Buff settings")]
public BuffSettings buff_settings = new BuffSettings();
public class BuffSettings {
[JsonProperty("Minimum components for the component perk")]
public int min_components = 1;
[JsonProperty("Maximum components for the component perk")]
public int max_components = 1;
[JsonProperty("Minimum electrical components for the electrical component perk")]
public int min_electrical_components = 1;
[JsonProperty("Maximum electrical components for the electrical component perk")]
public int max_electrical_components = 1;
[JsonProperty("Minimum additional scrap to be added to crates and barrels")]
public int min_extra_scrap = 1;
[JsonProperty("Maximum additional scrap to be added to crates and barrels")]
public int max_extra_scrap = 2;
[JsonProperty("PVP Buff Critical damage modifier.Picks a random value between 0 and the declared value, and += the damage% onto the hit")]
public float pvp_critical_modifier = 0.3f;
[JsonProperty("Should the LootPickup buff only work with melee weapons?")]
public bool lootPickupBuffMeleeOnly = false;
[JsonProperty("Should we have a maximum distance for the loot pickup buff [0 = unlimited]?")]
public float loot_pickup_buff_max_distance = 0;
[JsonProperty("Allow the LootPickup buff to work with road-side signs?")]
public bool allow_roadsigns = false;
[JsonProperty("List of animals for animal resist ability", ObjectCreationHandling = ObjectCreationHandling.Replace)]
public List<string> animals = new List<string>();
[JsonProperty("Details of a horse to change when a player mounts a horse with the relevant perk unlocked")]
public HorseStats horse_buff_info = new HorseStats();
[JsonProperty("Delay for HealthRegen perk after taking damage")]
public float health_regen_combat_delay = 5f;
[JsonProperty("Delay between attempts at tracking animals")]
public float track_delay = 10f;
[JsonProperty("List of skins that the rationer perk will not refund")]
public List<ulong> no_refund_item_skins = new List<ulong>();
[JsonProperty("Bag cooldown time")]
public float bag_cooldown_time = 10f;
[JsonProperty("Bag prefab")]
public string bag_prefab = "assets/prefabs/deployable/large wood storage/box.wooden.large.prefab";
[JsonProperty("Primitive weapons for the primitive weapons ability", ObjectCreationHandling = ObjectCreationHandling.Replace)]
public List<string> primitive_weapons = new List<string>();
[JsonProperty("Harvesting yield blacklist [items listed here will not be affected by the harvesting yield perks]")]
public List<string> harvest_yield_blacklist = new List<string>();
[JsonProperty("List of items that the Durability perk will not work with")]
public List<string> durability_blacklist = new List<string>();
[JsonProperty("Raid perk settings")]
public RaidTreeSettings raid_perk_settings = new RaidTreeSettings();
public class RaidTreeSettings {
[JsonProperty("Settings for trap_damage_reduction")]
public TrapDamageReductionSettings trap_damage_reduction_settings = new TrapDamageReductionSettings();
public class TrapDamageReductionSettings {
[JsonProperty("Traps blacklist - will ignore the buff")]
public List<string> blacklist = new List<string>();
[JsonProperty("Only allow this buff to work with raidable base traps")]
public bool raidable_bases_only = false;
}
[JsonProperty("Settings for trap_damage_increase")]
public TrapDamageIncreaseSettings trap_damage_increase_settings = new TrapDamageIncreaseSettings();
public class TrapDamageIncreaseSettings {
[JsonProperty("Traps blacklist - will ignore the buff")]
public List<string> blacklist = new List<string>();
[JsonProperty("Only allow this buff to work with raidable base traps")]
public bool raidable_bases_only = false;
}
[JsonProperty("Settings for Personal_Explosive_Reduction")]
public PersonalExplosiveReductionSettings personal_explosive_reduction_settings = new PersonalExplosiveReductionSettings();
public class PersonalExplosiveReductionSettings {
[JsonProperty("Prefabs blacklist - will ignore the buff")]
public List<string> blacklist = new List<string>();
[JsonProperty("Work with fire explosives such as molotov's and incin rockets?")]
public bool fire_damage_reduction = true;
}
[JsonProperty("Settings for Double_Explosion_chance")]
public DoubleExplosionChanceSettings Double_Explosion_chance_settings = new DoubleExplosionChanceSettings();
public class DoubleExplosionChanceSettings {
[JsonProperty("Prefabs black - will not trigger with items listed here")]
public List<string> blacklist = new List<string>();
[JsonProperty("Only allow this buff to work with raidable base?")]
public bool raidable_bases_only = false;
}
[JsonProperty("Settings for Explosion_Radius")]
public ExpolosionRadiusSettings Explosion_Radius_settings = new ExpolosionRadiusSettings();
public class ExpolosionRadiusSettings {
[JsonProperty("Prefabs blacklist - will ignore the buff")]
public List<string> blacklist = new List<string>();
[JsonProperty("Add the difference to the minimum explosion radius")]
public bool add_to_minimum = true;
[JsonProperty("Only allow this buff to work with raidable base?")]
public bool raidable_bases_only = false;
}
[JsonProperty("Settings for Lock_Picker")]
public LockPickerSettings Lock_Picker_settings = new LockPickerSettings();
public class LockPickerSettings {
[JsonProperty("Command required for the player to activate their lockpick ability")]
public string pick_command = "picklock";
[JsonProperty("Time after the command has been used before the ability use expires [seconds]")]
public float time = 30;
[JsonProperty("Delay before the Lock_Picker ability can be used again [seconds]")]
public float use_delay = 600;
[JsonProperty("Only allow this buff to work with raidable base?")]
public bool raidable_bases_only = false;
}
[JsonProperty("Settings for Dudless_Explosive")]
public DudlessExplosiveSettings Dudless_Explosiv_settings = new DudlessExplosiveSettings();
public class DudlessExplosiveSettings {
[JsonProperty("Only allow this buff to work with raidable base?")]
public bool raidable_bases_only = false;
}
}
[JsonProperty("Underwater Breathing settings")]
public UnderwaterBreathingSettings underwaterSettings = new UnderwaterBreathingSettings();
public class UnderwaterBreathingSettings {
public string anchor_min = "1 1";
public string anchor_max = "1 1";
public string offset_min = "-48 -48";
public string offset_max = "-12 -12";
}
}
[JsonProperty("Chat command settings")]
public ChatCommands chat_commands = new ChatCommands();
public class ChatCommands {
[JsonProperty("Use mouse 3 to toggle the boat turbo (performance heavy on high pop servers).Set false to use a chat command instead")]
public bool use_input_key_boat = false;
[JsonProperty("Chat command for turbo")]
public string turbo_cmd = "turbo";
[JsonProperty("Chat commands to open the skill tree", ObjectCreationHandling = ObjectCreationHandling.Replace)]
public List<string> chat_cmd = new List<string>() {
"st", "skilltree", "skills"
}
;
[JsonProperty("Chat/console commands to open the score board", ObjectCreationHandling = ObjectCreationHandling.Replace)]
public List<string> score_chat_cmd = new List<string>() {
"score", "scoreboard"
}
;
}
[JsonProperty("XP settings")]
public XPSettings xp_settings = new XPSettings();
public class XPSettings {
[JsonProperty("XP Loss settings")]
public XPLossSettings xp_loss_settings = new XPLossSettings();
public class XPLossSettings {
[JsonProperty("Allow players to go into xp debt if they lose more xp than their level would allow?")]
public bool allow_xp_debt = true;
[JsonProperty("Use the players xp (not the level xp) to calculate loss")]
public bool percentage_of_current_xp = false;
[JsonProperty("Death penalty grace period - players won't lose xp if they die again within the specified time [seconds]")]
public float no_xp_loss_time = 0;
[JsonProperty("Percentage of xp into their current level that players lose when killed in PVP")]
public double pvp_death_penalty = 20;
[JsonProperty("Percentage of xp into their current level that players lose when killed in PVE")]
public double pve_death_penalty = 20;
[JsonProperty("Percentage of xp into their current level that players lose when they suicide")]
public double suicide_death_penalty = 0;
[JsonProperty("Permission based modifiers [1.0 = no reduced amount]")]
public Dictionary<string, double> xp_loss_override = new Dictionary<string, double>();
}
[JsonProperty("Permissions to adjust xp gain modifiers (skilltree.<perm>) [1.0 is default modifier]")]
public Dictionary<string, double> xp_perm_modifier = new Dictionary<string, double>();
[JsonProperty("How long should the xp be displayed for")]
public float xp_display_time = 1f;
[JsonProperty("Colour of the xp text when unmodified")]
public string xp_display_col_unmodified = "FFFFFF";
[JsonProperty("Colour of the xp text when modified")]
public string xp_display_col_modified = "00b6ff";
[JsonProperty("Prevent XP loss when dying at an event hosted by EventManager")]
public bool prevent_xp_loss = true;
[JsonProperty("Enable xp drop hud for players by default")]
public bool enable_xp_drop_by_default = true;
[JsonProperty("Restrict XP gain to the tools listed in their respective tools list?")]
public bool white_listed_tools_only = false;
[JsonProperty("Require grown plants to be ripe to provide xp")]
public bool ripe_required = true;
[JsonProperty("Give xp for crafting ingredients? [Requires Cooking.cs]")]
public bool cooking_award_xp_ingredients = false;
[JsonProperty("Use LootDefender to handle the XP for BradleyAPC")]
public bool UseLootDefender = true;
[JsonProperty("Allow players with god mode to receive xp?")]
public bool allow_godemode_xp = true;
[JsonProperty("Decimal places for the xp to be rounded to")]
public int xp_rounding = 2;
[JsonProperty("List of meals that will not provide xp [Requires Cooking.cs]")]
public List<string> cooking_black_list = new List<string>();
[JsonProperty("Experience sources - Set xp value to 0 to disable for that type", ObjectCreationHandling = ObjectCreationHandling.Replace)]
public XPSources xp_sources = new XPSources();
[JsonProperty("Night time settings")]
public NightTimeGains night_settings = new NightTimeGains();
public class NightTimeGains {
[JsonProperty("Modifier for xp gained at night [1.0 = standard]")]
public float night_xp_gain_modifier = 1f;
[JsonProperty("Modifier for woodcutting yield at night [1.0 = standard]")]
public float night_woodcutting_yield_modifier = 1f;
[JsonProperty("Modifier for mining yield at night [1.0 = standard]")]
public float night_mining_yield_modifier = 1f;
[JsonProperty("Modifier for skinning yield at night [1.0 = standard]")]
public float night_skinning_yield_modifier = 1f;
[JsonProperty("Modifier for harvesting yield at night [1.0 = standard]")]
public float night_harvesting_yield_modifier = 1f;
[JsonProperty("Should the harvesting yield increase include player-grown plants?")]
public bool include_grown_harvesting = false;
}
[JsonProperty("Allow players to move their XP bar?")]
public bool allow_move_xp_bar = true;
}
[JsonProperty("Wipe and plugin update settings")]
public WipeUpdate wipe_update_settings = new WipeUpdate();
public class WipeUpdate {
[JsonProperty("Erase all data on wipe - wipes everything")]
public bool erase_data_on_wipe = false;
[JsonProperty("Erase ExtraPockets storage on wipe")]
public bool erase_ExtraPockets_on_wipe = true;
[JsonProperty("Refund skill points on server wipe")]
public bool refund_sp_on_wipe = true;
[JsonProperty("Give the player with the highest xp bonus skill points next wipe")]
public bool bonus_skill_points = false;
[JsonProperty("How many skill points should they receive for winning?")]
public int bonus_skill_points_amount = 5;
[JsonProperty("Automatically add new trees from the default config?")]
public bool auto_update_trees = true;
[JsonProperty("Automatically add new nodes from the default config?")]
public bool auto_update_nodes = true;
[JsonProperty("Starting skill points")]
public int starting_skill_points = 0;
}
[JsonProperty("Rested XP Settings")]
public RestXPSettings rested_xp_settings = new RestXPSettings();
public class RestXPSettings {
[JsonProperty("Give players who have been offline a bonus to xp gain when they log in next?")]
public bool rested_xp_enabled = true;
[JsonProperty("Rested xp pool to accumulate per hour offline")]
public double rested_xp_per_hour = 1000;
[JsonProperty("Bonus xp rate while rested (until the rested xp pool is depleted) [0.25 = 25% bonus]")]
public double rested_xp_rate = 0.25;
[JsonProperty("Maximum xp a player can have in their rested pool [0 = no limit]")]
public double rested_xp_pool_max = 25000;
[JsonProperty("Reset rested xp pools on wipe?")]
public bool rested_xp_reset_on_wipe = false;
[JsonProperty("Modifiers based on permissions to adjust the rested xp value [1.0 = 100% increase.0.0 = no increase]")]
public Dictionary<string, float> rested_xp_modifier_perm_mod = new Dictionary<string, float>();
}
[JsonProperty("Tools and Black list/White list settings")]
public ToolAndListSettings tools_black_white_list_settings = new ToolAndListSettings();
public class ToolAndListSettings {
[JsonProperty("Global black list - these items will not gain xp and benefits at all")]
public List<string> black_listed_gather_items = new List<string>();
[JsonProperty("Black listed parts for component and electrical luck abilities", ObjectCreationHandling = ObjectCreationHandling.Replace)]
public List<string> comp_blacklist = new List<string>();
[JsonProperty("Power tool modifiers (chainsaw and jackhammer).1 = full xp/buffs.0 = off.0.5 = half xp/buffs.")]
public PowerTools power_tool_modifier = new PowerTools() {
mining_yield_modifier = 0.25f, mining_xp_modifier = 0.25f, mining_luck_modifier = 0.25f, skinning_yield_modifier = 0.25f, skinning_xp_modifier = 0.25f, skinning_luck_modifier = 0.25f, woodcutting_yield_modifier = 0.25f, woodcutting_xp_modifier = 0.25f, woodcutting_luck_modifier = 0.25f
}
;
[JsonProperty("Extra Pockets black list - disallows items that match")]
public List<string> black_list = new List<string>();
[JsonProperty("Extra Pockets white list - will only allow items that match")]
public List<string> white_list = new List<string>();
[JsonProperty("Extra pockets button anchors")]
public ExtraPocketsButtonAnchors extra_pockets_button_anchor = new ExtraPocketsButtonAnchors();
[JsonProperty("A black list of items that will not be refunded when using the thrifty tinkerer 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 while using the thirfty duplicator buff", ObjectCreationHandling = ObjectCreationHandling.Replace)]
public List<string> craft_duplicate_blacklist = new List<string>() {
"gunpowder", "explosives", "sulfur"
}
;
[JsonProperty("Woodcutting tools - Tools that meet whitelist requirements and work with the reduced durability ability", ObjectCreationHandling = ObjectCreationHandling.Replace)]
public List<string> wc_tools = new List<string>();
[JsonProperty("Mining tools - Tools that meet whitelist requirements and work with the reduced durability ability", ObjectCreationHandling = ObjectCreationHandling.Replace)]
public List<string> mining_tools = new List<string>();
[JsonProperty("Skinning tools - Tools that meet whitelist requirements and work with the reduced durability ability", ObjectCreationHandling = ObjectCreationHandling.Replace)]
public List<string> skinning_tools = new List<string>();
}
[JsonProperty("Effect settings")]
public EffectSettings effect_settings = new EffectSettings();
public class EffectSettings {
[JsonProperty("Instant repair effect")]
public string repair_effect = "assets/bundled/prefabs/fx/build/repair_full_metal.prefab";
[JsonProperty("Level up effect")]
public string level_effect = "assets/prefabs/misc/halloween/lootbag/effects/gold_open.prefab";
[JsonProperty("Node unlock effect")]
public string skill_point_unlock_effect = "assets/prefabs/misc/halloween/lootbag/effects/loot_bag_upgrade.prefab";
[JsonProperty("Node level effect")]
public string skill_point_level_effect = "assets/prefabs/misc/easter/painted eggs/effects/eggpickup.prefab";
}
[JsonProperty("Better Chat settings")]
public BetterChatSettings betterchat_settings = new BetterChatSettings();
public class BetterChatSettings {
[JsonProperty("Format for BetterChat title showing the playeres level.Set to null to disable.{0} is the colour value and {1} is the player level value")]
public string better_title_format = "<color=#{0}>[Lv.{1}]</color>";
[JsonProperty("Default colour for BetterChat xp titles")]
public string better_title_default_col = "0cb072";
[JsonProperty("Colour for BetterChat xp titles for players who are max level")]
public string better_title_max_col = "32ff00";
}
[JsonProperty("Loot settings")]
public LootTables loot_settings = new LootTables();
public class LootTables {
[JsonProperty("Mining luck loot table", ObjectCreationHandling = ObjectCreationHandling.Replace)]
public List<LootItems> mining_loot_table = new List<LootItems>();
[JsonProperty("Woodcutting luck loot table", ObjectCreationHandling = ObjectCreationHandling.Replace)]
public List<LootItems> wc_loot_table = new List<LootItems>();
[JsonProperty("Skinning luck loot table", ObjectCreationHandling = ObjectCreationHandling.Replace)]
public List<LootItems> skinning_loot_table = new List<LootItems>();
[JsonProperty("Fishing luck loot table", ObjectCreationHandling = ObjectCreationHandling.Replace)]
public List<LootItems> fishing_loot_table = new List<LootItems>();
[JsonProperty("Whitelist of loot crates to trigger the spawn chance for components, electronics and scrap.Set to null to not use the whitelist.", ObjectCreationHandling = ObjectCreationHandling.Replace)]
public List<string> loot_crate_whitelist = new List<string>();
}
[JsonProperty("Ultimate settings")]
public UltimateSettings ultimate_settings = new UltimateSettings();
public class UltimateSettings {
[JsonProperty("Background colour for the ultimate node")]
public string ultimate_node_background_col = "1 0.8741453 0 1";
[JsonProperty("Ultimate settings for woodcutting")]
public WoodcuttingUltimate ultimate_woodcutting = new WoodcuttingUltimate();
[JsonProperty("Ultimate settings for mining")]
public MiningUltimate ultimate_mining = new MiningUltimate();
[JsonProperty("Ultimate settings for vehicle")]
public VehicleUltimate ultimate_vehicle = new VehicleUltimate();
[JsonProperty("Ultimate settings for medical")]
public MedicalUltimate ultimate_medical = new MedicalUltimate();
[JsonProperty("Ultimate settings for harvesting")]
public HarvesterUltimate ultimate_harvesting = new HarvesterUltimate();
[JsonProperty("Ultimate settings for scavenger")]
public Scav_Ultimate ultimate_scavenger = new Scav_Ultimate();
[JsonProperty("Ultimate settings for combat")]
public CombatUltimate ultimate_combat = new CombatUltimate();
[JsonProperty("Ultimate settings for skinning")]
public SkinningUltimate ultimate_skinning = new SkinningUltimate();
[JsonProperty("Ultimate settings for build craft")]
public BuildCraftUltimate ultimate_buildCraft = new BuildCraftUltimate();
[JsonProperty("Ultimate settings for raiding")]
public RaidingUltimate ultimate_raiding = new RaidingUltimate();
}
[JsonProperty("Misc settings")]
public MiscSettings misc_settings = new MiscSettings();
public class MiscSettings {
[JsonProperty("BotReSpawn profile and xp list", ObjectCreationHandling = ObjectCreationHandling.Replace)]
public Dictionary<string, double> botrespawn_profiles = new Dictionary<string, double>();
[JsonProperty("Human NPC's name that can be used to open the skill tree")]
public string npc_name = "";
[JsonProperty("Should we add a button to the pump bar to open SkillTree?")]
public bool button_to_pump_bar = true;
[JsonProperty("Should SkillTree call out to other plugins before it starts modifying the value of the items? [required for plugins that need pre-modified item amounts]")]
public bool call_HandleDispenser = false;
}
[JsonProperty("NpcSpawn (by KpucTaji) settings")]
public BetterNPC betternpc_settings = new BetterNPC();
public class BetterNPC {
[JsonProperty("Give xp based on the name of a NpcSpawn, rather than the scientist type?")]
public bool betternpc_give_xp = true;
[JsonProperty("Dictionary of NPC names and the value that they provide")]
public Dictionary<string, double> NPC_xp_table = new Dictionary<string, double>(StringComparer.InvariantCultureIgnoreCase);
}
[JsonProperty("Skill tree", ObjectCreationHandling = ObjectCreationHandling.Replace)]
public Dictionary<string, Configuration.TreeInfo> trees = new Dictionary<string, Configuration.TreeInfo>();
[JsonProperty("Leveling information.Y value must be set to 2 or 3")]
public ExperienceInfo level = new ExperienceInfo();
[JsonProperty("Notification settings")]
public NotificationSettings notification_settings = new NotificationSettings();
public class ExtraPocketsButtonAnchors {
public string x_min = "185.4";
public string y_min = "25.4";
public string x_max = "227.4";
public string y_max = "67.4";
}
public class HorseStats {
public bool Increase_Horse_RunSpeed = true;
public bool Increase_Horse_MaxSpeed = true;
public bool Increase_Horse_TrotSpeed = false;
public bool Increase_Horse_TurnSpeed = false;
public bool Increase_Horse_WalkSpeed = false;
}
public class NotificationSettings {
[JsonProperty("Settings for Notify plugin")]
public NotifySettings notifySettings = new NotifySettings();
}
public class NotifySettings {
[JsonProperty("Language key and message type to display when a player gains a level")]
public KeyValuePair<string, int> level_up_notification = new KeyValuePair<string, int>("NotifyLevelGained", 0);
}
public class CustomCurrency {
public string displayName = "";
public string shortname = "";
public ulong skin = 0;
}
public class TreeInfo {
public bool enabled = true;
public Dictionary<string, NodeInfo> nodes = new Dictionary<string, NodeInfo>();
public TreeInfo(Dictionary<string, NodeInfo> nodes, bool enabled = true) {
this.nodes = nodes;
this.enabled = enabled;
}
public class NodeInfo {
public bool enabled;
public int max_level;
public int tier;
public float value_per_buff;
public KeyValuePair<Buff, BuffType> buff_info;
public string icon_url;
public ulong skin;
public Permissions permissions;
public NodeInfo(bool enabled, int max_level, int tier, float value_per_buff, KeyValuePair<Buff, BuffType> buff_info, string icon_url, ulong skin, Permissions permissions = null) {
this.enabled = enabled;
this.max_level = max_level;
this.tier = tier;
this.value_per_buff = value_per_buff;
this.buff_info = buff_info;
this.icon_url = icon_url;
this.permissions = permissions;
this.skin = skin;
}
}
}
public class PowerTools {
[JsonProperty("Yield modifier when using a jackhammer to mine")]
public float mining_yield_modifier;
[JsonProperty("Yield modifier when using a chainsaw to chop wood")]
public float woodcutting_yield_modifier;
[JsonProperty("Yield modifier when using a power tool to skin")]
public float skinning_yield_modifier;
[JsonProperty("XP modifier when using a jackhammer to mine")]
public float mining_xp_modifier;
[JsonProperty("XP modifier when using a chainsaw to chop wood")]
public float woodcutting_xp_modifier;
[JsonProperty("XP modifier when using a power tool to skin")]
public float skinning_xp_modifier;
[JsonProperty("Luck modifier when using a jackhammer to mine")]
public float mining_luck_modifier;
[JsonProperty("Luck modifier when using a chainsaw to chop wood")]
public float woodcutting_luck_modifier;
[JsonProperty("Luck modifier when using a power tool to skin")]
public float skinning_luck_modifier;
}
public class ExperienceInfo {
public double x = 0.07;
public int y = 2;
public Dictionary<int, double> xp_table = new Dictionary<int, double>();
//XP - (Level / X) ^ 2
//Level = X * SQR-Y
public void CalculateTable(int max_level) {
for (int i = 0; i <= max_level; i++) {
if (xp_table.ContainsKey(i)) {
var newValue = Math.Floor(Math.Pow(i / x, y));
if (xp_table[i] != newValue) {
xp_table[i] = newValue;
UpdatedTable = true;
}
}
else xp_table.Add(i, Math.Floor(Math.Pow(i / x, y)));
}
}
public int GetLevel(double xp) {
int highest = 0;
for (int i = 0; i < 9999; i++) {
if (xp > Math.Floor(Math.Pow(i / x, y))) highest = i;
else return highest;
}
return 9999;
//foreach (var level in xp_table)
//{
// if (xp > level.Value) highest = level.Key;
// else
// {
// Interface.Oxide.LogInfo($"Highest: {highest}");
// return highest;
// }
//}
//Interface.Oxide.LogInfo($"Level = X[{x}] * SqrtXP[{Math.Sqrt(xp)}] (xp: {xp}): {x * Math.Sqrt(xp)}");
//Interface.Oxide.LogInfo($"Convert.ToInt32(Math.Floor(x * Math.Sqrt(xp))): {Convert.ToInt32(Math.Floor(x * Math.Sqrt(xp)))}");
//return Convert.ToInt32(Math.Floor(x * Math.Sqrt(xp)));
}
public double GetLevelStartXP(int level) {
return Math.Pow(level / x, y);
}
public static bool UpdatedTable = false;
}
public class XPSources {
public double NodeHit = 12;
public double NodeHitFinal = 50;
public double TreeHit = 8;
public double TreeHitFinal = 40;
public double SkinHit = 10;
public double SkinHitFinal = 50;
public double CollectWildPlant = 30;
public double CollectGrownPlant = 5;
public double BuildingBlockDeployed = 0;
public double FishCaught = 100;
public double Crafting = 0.25;
public double ScientistNormal = 150;
public double TunnelDweller = 125;
public double ScientistHeavy = 300;
public double SmallAnimal = 20;
public double MediumAnimal = 50;
public double LargeAnimal = 100;
public double RoadSign = 10;
public double Barrel = 20;
public double Scarecrow = 100;
public double Mission = 1000;
public double BradleyAPC = 1000;
public double LootHackedCrate = 200;
public double LootHeliCrate = 250;
public double LootBradleyCrate = 50;
public double CookingMealXP = 10;
public double RaidableBaseCompletion_Easy = 100;
public double RaidableBaseCompletion_Medium = 200;
public double RaidableBaseCompletion_Hard = 300;
public double RaidableBaseCompletion_Expert = 400;
public double RaidableBaseCompletion_Nightmare = 500;
public double Win_HungerGames = 2000;
public double Win_ScubaArena = 2000;
public double Win_Skirmish = 2000;
public double Gut_Fish = 10;
public double default_botrespawn = 100;
public double crate_basic = 0;
public double crate_elite = 50;
public double crate_mine = 0;
public double crate_normal = 0;
public double crate_normal_2 = 0;
public double crate_normal_2_food = 0;
public double crate_normal_2_medical = 0;
public double crate_tools = 0;
public double crate_underwater_advanced = 100;
public double crate_underwater_basic = 25;
public double crate_ammunition = 0;
public double crate_food_1 = 0;
public double crate_food_2 = 0;
public double crate_fuel = 0;
public double crate_medical = 0;
public double supply_drop = 500;
public double Harbor_Event_Winner = 2000f;
public double Junkyard_Event_Winner = 2000f;
public double PowerPlant_Event_Winner = 2000f;
public double Satellite_Event_Winner = 2000f;
public double Water_Event_Winner = 2000f;
public double Air_Event_Winner = 2000f;
public double Armored_Train_Winner = 2000f;
public double Convoy_Winner = 2000f;
public double SurvivalArena_Winner = 2000f;
public double swipe_card_level_1 = 50;
public double swipe_card_level_2 = 100;
public double swipe_card_level_3 = 250;
public double boss_monster = 1000;
public double Zombie = 100;
}
public string ToJson() => JsonConvert.SerializeObject(this);
public Dictionary<string, object> ToDictionary() => JsonConvert.DeserializeObject<Dictionary<string, object>>(ToJson());
}
public class Permissions {
public string description;
public Dictionary<int, PermissionInfo> perms = new Dictionary<int, PermissionInfo>();
public Permissions(string description, Dictionary<int, PermissionInfo> perms) {
this.description = description;
this.perms = perms;
}
}
public class PermissionInfo {
public Dictionary<string, string> perms_list = new Dictionary<string, string>();
// Key = perm.Value = displayName.public PermissionInfo(Dictionary<string, string> perms_to_add)
{
this.perms_list = perms_to_add;
}
}
public class LootItems {
public string shortname;
public int min;
public int max;
public int dropWeight;
public string displayName;
public ulong skin;
public LootItems(string shortname, int min, int max, ulong skin = 0, string displayName = null, int dropWeight = 100) {
this.shortname = shortname;
this.min = min;
this.max = max;
this.skin = skin;
this.displayName = displayName;
this.dropWeight = dropWeight;
}
}
public class PumpBar {
[JsonProperty("Default xp bar offset - this is for any new player connecting to the server")]
public xp_bar_offset offset_default = new xp_bar_offset() {
min_x = -365.713f, min_y = 20f, max_x = -233.287f, max_y = 42f
}
;
[JsonProperty("Anchor points")]
public XP_Bar_Anchors anchor_default = new XP_Bar_Anchors() {
anchor_min = "1 0", anchor_max = "1 0"
}
;
[JsonProperty("Colour of the pump bar")]
public string pump_bar_colour = "0.5471698 0.3533202 0 0.6078432";
[JsonProperty("Colour of the pump bar when in xp debt")]
public string pump_bar_colour_debt = "0.8 0 0 0.6078432";
[JsonProperty("Font set for the pump bar")]
public string pump_bar_font = "robotocondensed-regular.ttf";
[JsonProperty("Font size for the pump bar")]
public int pump_bar_font_size = 10;
[JsonProperty("Pump bar formatting [1= (CurrentXP)/(TotalXP)] [2= (LevelCurrentXP)/(LevelTotalXP)] [3= (XPLeft) (%)]")]
public int pump_bar_formatting = 2;
}
public class RaidingUltimate {
[JsonProperty("Command to call in MLRS strike")]
public string command = "strike";
[JsonProperty("Maximum duration that the Raiding Ultimate can be active for [seconds]")]
public float max_duration = 30;
[JsonProperty("Cooldown between uses [minutes]")]
public float cooldown = 60;
[JsonProperty("How long between each update tick when targeting [seconds]")]
public float tick_interval = 1f;
[JsonProperty("How many ticks are required for the targeting to be successful")]
public int ticks_required = 5;
[JsonProperty("How many rockets should be fired when the ultimate is successful")]
public int missile_amount = 6;
[JsonProperty("Effect to run when the target is successfully acquired [leave blank for no effect]")]
public string missile_fire_confirmation_effect = "assets/prefabs/building/wall.frame.shopfront/effects/metal_transaction_complete.prefab";
[JsonProperty("Delay between each rocket when the barrage starts")]
public float delay_between_rockets = 0.5f;
[JsonProperty("Allow the Double_Explosion_chance buff to trigger with this ultimate?")]
public bool allow_doubling = false;
[JsonProperty("Reset the MLRS strike cool down on respec?")]
public bool reset_strike_cooldown_on_respec = false;
}
public class BuildCraftUltimate {
[JsonProperty("Chance that a card with lower access will successfully unlock the door (the card is damaged regardless) [%]")]
public int success_chance = 100;
[JsonProperty("Notify the player when their ultimate failed")]
public bool notify_fail = true;
}
public class SkinningUltimate {
[JsonProperty("How long should each buff last for [0 = off]?")]
public Dictionary<AnimalBuff, float> enabled_buffs = new Dictionary<AnimalBuff, float>();
[JsonProperty("Wolf perk: what health scale bonus should the player receive per team member near by [1.0 is 100%]?")]
public float wolf_health_scale = 0.25f;
[JsonProperty("Wolf perk: How close do teammates need to be in order to contribute to the perk [radius]?")]
public float wolf_team_dist = 30f;
[JsonProperty("Bear perk: Maximum health of the overshield")]
public float bear_overshield_max = 50f;
[JsonProperty("Stag perk: Maximum distance that the perk can detect dangerous entities from [radius]")]
public float stag_danger_dist = 30f;
[JsonProperty("Stag perk: Time between procs [seconds]")]
public float stag_timer = 10f;
[JsonProperty("Stag perk: Draw the enemy location?")]
public bool stag_draw_enemy = true;
[JsonProperty("Boar perk: Blacklist of components for the boar buff")]
public List<string> boar_blackList = new List<string>();
[JsonProperty("Boar perk: Chance when collecting mushrooms and berries that a player [%]")]
public float boar_chance = 2f;
[JsonProperty("Boar perk: Minimum quantity to give")]
public int boar_min_quantity =
// ... [Code preview truncated due to length. Full source in attached file] ...