C#:
// Все права принадлежат дискорд сообществу https://discord.gg/VgNHPpNrz6
// Reference: 0Harmony
using Facepunch;
using HarmonyLib;
using Mono.Cecil;
using Mono.Cecil.Cil;
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 System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
using WebSocketSharp;
using System.Reflection;
/* Ideas
* Vehiclular combatant - more damage to vehicles (maybe including bradley and heli?)
* Add heli as XP source.* Add CUI option to enable/disable components that are shredded by the shredder perk.* Add an XP cap for certain sources (quests, building etc).-
* Colour the pump bar based on xp progression for the level
* Possible buff for healing percentage when using medical deviucs with whitelist or blacklist
* - Add option to disable BotRespawn
* - Reach out to Steen and ask him to add support natively for xp
* Add a dictionary to override the yield for certain ore types.*
* Team Skill Tree
* - Ultimate: mobile respawn point.Will function effectively as a sleeping bag with a global cooldown time for teams.* - Configureable cooldown time
* - Delayed unlock - a cooldown after the player dies before it can be used by them
*
* Add prestige icons to the scoreboard.*/
/* 1.5.0
* Fixed errors with the givexptoall and givesptoall commands.* Added option for the medical ultimate to prevent in PVP death.* Added HookMethod to API: float GetBuffValue(BasePlayer player, string skill) - Returns the buff value for the specified buff.* Added a prestige system [default off]
* Updated the way the plugin runs the reset commands for levels.Only relies on the data file instead of BasePlayer.allPlayerList.* Added console command for updatexptable
* Added new HookMethod: AwardXP(ulong userid, double value, string plugin, bool noMod = false)
* XP awarded to the player while they are offline will now be added to a pending pool, which will be awarded when they next connect.* Separated player save data into individual files, rather than 1 large data file.* Added an option for the Raiding ultimate to use the MLRS on the map, rather than spawning MLRS rockets above the players head.* Prevented resource yield stacking with tea bonuses, unless the player has the skilltree.teabonus permission.(Thanks Nivex)
* Fixed an issue that would prevent xp from all crates if bradley and heli crate xp was set to 0.* Wrapped RunResetCommands in a try catch to prevent it from stopping player data reset.* Added cooldown option for woodcutting ultimate.* Added cooldown option for Double_Bandage_Heal.* Added cooldown option for Wounded_Resist.* Added a number of config options to disable certain chat messages.* Added a new Tree: Team.This tree is focused around team based benefits.* Added a new skill: Comfort.This turns the player into a source of comfort for all nearby team members.* Added a new skill: Heal-Share.When the user receives healing, a percentage of the health received is shared with nearby team mates.* Added a new skill: XP_Share.When the user receives xp, a percentage of the xp is shared with nearby team mates.* Added a new skill: Tea_Share.When the user drinks a tea, a percentage of the teas modifiers are shared with nearby team mates, unless their current modifiers are better.* Added a new skill: Metabolism_Share.When the player receives calories or hydration, a percentage of it is also given to nearby team mates.* Added a new skill: Human_Workbench.This skill turns the player into a walking workbench, providing them and all nearby team mates with access to a workbench equal to the skills level.* Updated Double Explosive change to work with RF Explosives.* Added console command to delete player data: stremoveplayerdata <userid>
* Fixed a number of Overflow exceptions caused by infinite healing loops after the last oxide update.* Fixed an issue with the respect cost multiplier showing the incorrect value in the warning message.* Updated the language for the respect cost multiplier message.* Fixed an issue with Fishing Luck not triggering.* Fixed an issue with Skill Tree XP Event.* Updated Harmony Patching for forced wipe.*/
namespace Oxide.Plugins {
[Info("Skill Tree", "imthenewguy", "1.5.0")]
[Description("Skills on a tree!")]
class SkillTree : RustPlugin {
#region Config
private Configuration config;
public class Configuration {
[JsonProperty("General settings")]
public GeneralSettings general_settings = new GeneralSettings();
public class GeneralSettings {
[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("Permission based level requirement override")]
public Dictionary<string, PermOverride> level_requirement_override = new Dictionary<string, PermOverride>(StringComparer.InvariantCultureIgnoreCase);
[JsonProperty("Permission based point requirement override")]
public Dictionary<string, PermOverride> point_requirement_override = new Dictionary<string, PermOverride>(StringComparer.InvariantCultureIgnoreCase);
[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("Show the quick navigation buttons to the player")]
public bool show_navigation_buttons = true;
[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("Allow the Harvest Grown Yield to increase the amount of clones a player receives?")]
public bool clone_yield = true;
[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("Force all modified extended weapons to unload their ammo when the plugin unloads/hook all users with the buff log off?")]
public bool force_unload_extended_mag_weapons_unload = false;
[JsonProperty("Prevent flyhack kicks when a player lands?")]
public bool prevent_flyhack_kick_fall_damage = false;
[JsonProperty("Automatically apply the boat turbo when a player mounts the boat? [Disables the turbo command]")]
public bool boat_turbo_on_mount = false;
[JsonProperty("Forager settings")]
public ForagerSettings forager_settings = new ForagerSettings();
public class ForagerSettings {
[JsonProperty("Command to use the ability")]
public string command = "forage";
[JsonProperty("Distance to search for map collectibles")]
public float distance = 100f;
[JsonProperty("Time that the locations are displayed on the screen")]
public float time_on_screen = 60f;
[JsonProperty("Usage cooldown")]
public float cooldown = 60f;
[JsonProperty("Black list of shortnames for collecibles that won't be displayed")]
public List<string> blacklist = new List<string>();
[JsonProperty("Display colours")]
public Dictionary<string, float[]> displayColours = new Dictionary<string, float[]>();
[JsonProperty("Show distance?")]
public bool show_distance = false;
}
[JsonProperty("Tea looter settings")]
public TeaLooterSettings tea_looter_settings = new TeaLooterSettings();
public class TeaLooterSettings {
[JsonProperty("Minimum stack of tea that the player will receive when the Tea Looter buff procs?")]
public int min_tea = 1;
[JsonProperty("Maximum stack of tea that the player will receive when the Tea Looter buff procs?")]
public int max_tea = 1;
[JsonProperty("Tea looter table [shortname : drop weight]")]
public Dictionary<string, int> TeaDropTable = new Dictionary<string, int>(StringComparer.InvariantCultureIgnoreCase);
[JsonProperty("Containers that tea can be found in")]
public List<string> containers = new List<string>();
}
[JsonProperty("Sonar settings")]
public SonarSettings sonar_settings = new SonarSettings();
public class SonarSettings {
[JsonProperty("Command to use the ability")]
public string command = "sonar";
[JsonProperty("Distance to search for underwater entities")]
public float distance = 300f;
[JsonProperty("Time that the locations are displayed on the screen")]
public float time_on_screen = 10f;
[JsonProperty("Usage cooldown")]
public float cooldown = 10f;
public bool show_tugboats = true;
public bool show_dive_sites = true;
public bool show_sharks = true;
public bool show_scientists = true;
public bool show_players = false;
[JsonProperty("Show distance?")]
public bool show_distance = false;
}
[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("Damage the player receives when they fail an attempt")]
public float damage_per_fail = 0;
[JsonProperty("Show the pick lock timer when activating the ability")]
public bool show_timer = true;
[JsonProperty("How often should the timer update")]
public int timer_tick_rate = 1;
[JsonProperty("Set the lock to unlocked when successfully picking a lock? [false will open the entity but keep it locked]")]
public bool unlock_entity = 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("Settings for Trap_Spotter")]
public TrapSpotterSettings Trap_Spotter_settings = new TrapSpotterSettings();
public class TrapSpotterSettings {
[JsonProperty("Max distance from the player to search for traps")]
public float distance = 20f;
[JsonProperty("Cooldown between uses [seconds]")]
public float cooldown = 60f;
[JsonProperty("Time that the traps will be displayed for [seconds]")]
public float time_on_screen = 60f;
[JsonProperty("Show the names of each trap prefab")]
public bool show_names = true;
[JsonProperty("Command to perform the search")]
public string command = "traps";
[JsonProperty("Only allow this buff to work with raidable base?")]
public bool raidable_bases_only = false;
[JsonProperty("Colours that the traps will be displayed in")]
public Dictionary<string, float[]> trap_colours = new Dictionary<string, float[]>();
}
}
[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("Allow the UnderwaterDamageBonus to function in PVP")]
public bool UnderwaterDamageBonus_pvp = true;
[JsonProperty("Base the crafting xp on the time it takes to craft the item? [false will use blueprint craft time]")]
public bool timeBasedCraftingXP = true;
[JsonProperty("Comfort settings")]
public ComfortSettings comfortSettings = new ComfortSettings();
public class ComfortSettings {
[JsonProperty("How often should we update comfort levels for nearby team members [seconds]")]
public float Interval = 5;
[JsonProperty("Distance that team members receive comfort from")]
public float Distance = 10;
}
[JsonProperty("Mobile Workbench settings")]
public MobileWorkbenchSettings mobileWorkbenchSettings = new MobileWorkbenchSettings();
public class MobileWorkbenchSettings {
[JsonProperty("How often should we run the update cycle for workbenches [seconds]")]
public float Interval = 5;
[JsonProperty("Distance that team members can access workbench from")]
public float Distance = 10;
}
[JsonProperty("Tea Share settings")]
public TeaShareSettings teaShareSettings = new TeaShareSettings();
public class TeaShareSettings {
[JsonProperty("Distance that team members can receive tea buffs from")]
public float Distance = 10;
}
[JsonProperty("Metabolism Share settings")]
public MetabolismShareSettings metabolismShareSettings = new MetabolismShareSettings();
public class MetabolismShareSettings {
[JsonProperty("Distance that team members can receive calory and hydration from")]
public float Distance = 10;
}
[JsonProperty("Heal Share settings")]
public HealShareSettings healShareSettings = new HealShareSettings();
public class HealShareSettings {
[JsonProperty("Distance that team members can receive healing from")]
public float Distance = 10;
}
[JsonProperty("XP Share settings")]
public XPShareSettings xpShareSettings = new XPShareSettings();
public class XPShareSettings {
[JsonProperty("Distance that team members can receive xp from")]
public float Distance = 10;
[JsonProperty("Base the percentage using modified xp [true] or the base xp amount [false]")]
public bool modifiedXP = false;
}
[JsonProperty("Double Bandage Heal Cooldown [seconds]")]
public float Double_Bandage_Heal_Cooldown = 0;
[JsonProperty("Wounded Resist Cooldown [seconds]")]
public float Wounded_Resist_Cooldown = 0;
}
[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("Chat command for tracking an animal with the AnimalTracker buff")]
public string track_animal_cmd = "track";
}
[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("Prevent xp loss when a player is offline?")]
public bool prevent_offline_xp_loss = true;
[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("Whitelist - List of items to award crafting xp")]
public List<string> craft_xp_whitelist = new List<string>();
[JsonProperty("Blacklist - List of items that will not award crafting xp")]
public List<string> craft_xp_blacklist = new List<string>();
[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("Cooldown for awarding xp after using a swipe card")]
public float swipe_card_xp_cooldown = 0;
[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("Prestige settings")]
public PrestigeSettings prestige_settings = new PrestigeSettings();
public class PrestigeSettings {
[JsonProperty("Allow players to reset their progresss and gain Prestige levels?")]
public bool enabled = false;
[JsonProperty("Ignore the level reward bonuses if the player has prestige levels?")]
public bool ignore_level_rewards = false;
[JsonProperty("Remove players from lower level prestige groups?")]
public bool remove_from_lower_groups = false;
[JsonProperty("Run reset commands for level rewards when the player prestiges?")]
public bool run_level_rewards_reset_on_Prestige = false;
[JsonProperty("Show the prestige button before the player achieves the level? (they won't be able to accept the rank up until max level)")]
public bool show_button_before_level = true;
[JsonProperty("Prestige levels")]
public Dictionary<int, PrestigeInfo> levels = new Dictionary<int, PrestigeInfo>();
public class PrestigeInfo {
[JsonProperty("Permissions [name : perm]")]
public Dictionary<string, string> perms;
[JsonProperty("Additional benefits descriptions")]
public List<string> additionalBenfitsDescription = new List<string>();
[JsonProperty("Format for BetterChat title showing the prestige level.{0} is the colour value and {1} is the player prestige value")]
public string better_title_format = "<color=#{0}>[Pr.{1}]</color>";
[JsonProperty("Colour for BetterChat xp titles")]
public string better_title_default_col = "d109ec";
[JsonProperty("Skin ID that will be displayed when ranking up")]
public ulong RankUpPic;
[JsonProperty("Rank title")]
public string rankTitle;
public PrestigeInfo(Dictionary<string, string> perms, ulong RankUpPic, string title) {
this.perms = perms;
this.RankUpPic = RankUpPic;
this.rankTitle = title;
}
}
public void Initialize() {
if (levels != null && levels.Count > 0) {
foreach (var level in levels) {
if (string.IsNullOrEmpty(level.Value.rankTitle)) level.Value.rankTitle = $"Prestige Rank {level.Key}";
}
return;
}
levels = new Dictionary<int, PrestigeInfo>() {
[1]
= new PrestigeInfo(new Dictionary<string, string>() {
["Your perm title"]
= "yourperm.use"
}
, 3165843865, "Prestige Rank 1"), [2] = new PrestigeInfo(new Dictionary<string, string>() {
["Your perm title"]
= "yourperm.use"
}
, 3165843987, "Prestige Rank 2"), [3] = new PrestigeInfo(new Dictionary<string, string>() {
["Your perm title"]
= "yourperm.use"
}
, 3165844049, "Prestige Rank 3")
}
;
}
}
[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("Remove players prestige?")]
public bool remove_prestige = false;
[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("Reset pending xp pools on wipe?")]
public bool reset_pending_xp_on_wipe = true;
[JsonProperty("Dictionary of permission based overrides for starting skill points")]
public Dictionary<string, int> starting_skill_point_overrides = new Dictionary<string, int>();
}
[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("Blacklist of weapon prefab shortnames that cannot benefit from the Extended Mag buff")]
public List<string> extendedMag_weapon_blacklist = new List<string>();
[JsonProperty("Blacklist of ammo item shortnames that cannot benefit from the Extended Mag buff")]
public List<string> extendedMag_ammotype_blacklist = 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("Lock pick fail attempt")]
public string lockpick_fail_effect = "assets/prefabs/deployable/bear trap/effects/bear-trap-deploy.prefab";
[JsonProperty("Lock pick success attempt")]
public string lockpick_success_effect = "assets/prefabs/deployable/locker/effects/locker-deploy.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 =
// ... [Code preview truncated due to length. Full source in attached file] ...