C#:
using Facepunch;
using HarmonyLib;
using Mono.Cecil;
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 a dictionary to override the yield for certain ore types.*
* Fishing bait skill?
*
* Damage to bradley
*
* Crafting xp for tea stations
*/
/* 1.6.4
* Fixed an issue with starting skill points not allocating properly when starting point permissions were assigned.* Removed debug.* Added redundancies to unload method.* Optimized some timer methods.* Fixed an issue with recycler efficiencies not resetting.* Updated the plugin to dismount players who disable vehicle based buffs while mounted.* Moved Rationer perk to a different hook to prevent throwing pies from triggering it.* Fixed an issue with the heli_speed perk not applying to Scrap transport helis.* Updated the xp loss settings to add more control over loss types [PercentageOfCurrentLevel, PercentageOfTotalXp, XpValue]
* Updated the way resources are collected for better compatibility with other yield increasing plugins.* Updated support for Instant gathering skills between EpicLoot and ItemPerks.* Added yield modifier support for wheat
* Fixed tea durations for craftingtea_quality
* Added a config option to handle how prestige xp mod stacks with the other xp mods.*/
namespace Oxide.Plugins {
[Info("Skill Tree", "imthenewguy", "1.6.4")]
[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("Modified skill points per level based on permissions [must be higher than default]")]
public Dictionary<string, int> points_per_level_override = new Dictionary<string, int>();
[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("Settings for respecing skill points [Disabled, All, Tree]")]
public RespecType respecType = RespecType.All;
[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("Respec cost cap [0 = no limit]")]
public double respec_cost_cap = 0;
[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, shoppystock, custom]")]
public string respec_currency = "scrap";
[JsonProperty("ShoppyStock currency info [if currency type is set to shoppystock]")]
public ShoppyStockInfo shoppyStockInfo = new ShoppyStockInfo();
public class ShoppyStockInfo {
[JsonProperty("Shop name")]
public string shopName;
}
[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("Should yield bonus skills be additive [if true, yields will modify the item.amount value, rather than giving additional items]")]
public bool additiveYields = false;
[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_magnet = false;
[JsonProperty("Allow the Barrel Smasher buff to work with road-side signs?")]
public bool allow_roadsigns_smasher = false;
[JsonProperty("List of animals for animal resist ability", ObjectCreationHandling = ObjectCreationHandling.Replace)]
public List<string> animals = new List<string>();
[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("Distance in front of player for nodes to spawn when the Node_Spawn_Chance buff procs?")]
public float Node_Spawn_Chance_dist = 2;
[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("Automatically pass raidable base checks if the plugin is unloaded?")]
public bool default_pass = true;
[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("Position in the map where the workbenches spawn [default 0,0,0]")]
public Vector3 MapSpawnPosition = Vector3.zero;
}
[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("Harvesting luck settings")]
public HarvestingLuckSettings harvesting_luck_settings = new HarvestingLuckSettings();
public class HarvestingLuckSettings {
[JsonProperty("Allow the harvesting luck buff to work with player grown collectibles [uses its own drop table]?")]
public bool Harvesting_luck_works_with_grown = true;
[JsonProperty("List of entities that won't trigger the buff")]
public List<string> blacklist = new List<string>();
}
[JsonProperty("Awareness settings")]
public AwarenessSettings awareness_settings = new AwarenessSettings();
public class AwarenessSettings {
[JsonProperty("How often should awareness update?")]
public float updateRate = 5;
[JsonProperty("Show corpse locations?")]
public bool corpse = true;
[JsonProperty("Show bag locations?")]
public bool bag = true;
[JsonProperty("Show dropped item locations?")]
public bool droppedItem = true;
[JsonProperty("Show animal locations?")]
public bool animals = true;
[JsonProperty("Show Human Npc locations?")]
public bool humanNPC = true;
[JsonProperty("Blacklist of item shortnames that will not show up")]
public List<string> blacklist = new List<string>();
}
[JsonProperty("SharkSkinner blacklist [item shortname]")]
public List<string> SharkSkinnerblacklist = new List<string>();
}
[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 lose xp when they die?")]
public bool allow_xp_loss = true;
[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("Xp loss type [PercentageOfCurrentLevel, PercentageOfTotalXp, XpValue]")]
public XPLossType xp_loss_type = XPLossType.PercentageOfCurrentLevel;
[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("XP loss values [if percentage, 1.0 = 100%.If XpValue, 100.0 = 100xp]")]
public XP_Loss_Amounts xp_loss_table = new XP_Loss_Amounts();
public class XP_Loss_Amounts {
public float PVP = 0.1f;
public float Heli = 0.2f;
public float Bradley = 0.2f;
public float Scientist = 0.2f;
public float Animal = 0.2f;
public float Suicide = 0.2f;
public float Fire = 0.2f;
public float Cold = 0.2f;
public float Fall = 0.2f;
public float Traps = 0.2f;
public float Codelock = 0.2f;
public float Drowned = 0.2f;
public float Radiation = 0.2f;
public float Hunger = 0.2f;
public float Thirst = 0.2f;
}
[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("Colour of the xp text when modified by Skill Tree: XP Event")]
public string xp_display_col_xp_event_modified = "c900ff";
[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("Maximum amount of pending xp a player can accumulate [0 = no limit]")]
public int pending_xp_cap = 0;
[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("Should the givexp console command search for offline players as well?")]
public bool givexp_offline = false;
[JsonProperty("Should the givesp console command search for offline players as well?")]
public bool givesp_offline = false;
}
[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("Should the player keep excess skill points outside of what they received from leveling/starting points?")]
public bool should_keep_excess_points = false;
[JsonProperty("Should we apply the xp bonus multiplicatively? [false = additively]")]
public bool apply_bonus_multiplicatively = false;
[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;
[JsonProperty("XP modifier")]
public float xp_mod = 1;
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")
}
;
}
public int HighestLevel() {
if (levels == null) return 0;
var result = 0;
foreach (var level in levels.Keys) {
if (level > result) result = level;
}
return result;
}
}
[JsonProperty("Wipe and plugin update settings")]
public WipeUpdate wipe_update_settings = new WipeUpdate();
public class WipeUpdate {
/* Wipe xp/level -
* Refund points -
* Prestige
* Extra pockets
* Pending xp
* Rested xp
* Xp debt
*/
[JsonConverter(typeof(StringEnumConverter))]
public enum WipeType {
None, Reset, Refund
}
[JsonProperty("Wipe all player data files [setting true will ignore all below settings that handle data reset]?")]
public bool wipe_everything = false;
[JsonProperty("How should we handle xp, levels and skills when the server wipes [None, Reset, Refund]?")]
public WipeType xp_wipe_type = WipeType.Refund;
[JsonProperty("Should we wipe prestige levels?")]
public bool prestige_wipe = true;
[JsonProperty("Wipe xp debt?")]
public bool xp_debt_wipe = true;
[JsonProperty("Wipe respec multiplier?")]
public bool respec_multiplier_wipe = true;
[JsonProperty("Reset pending xp pools on wipe?")]
public bool reset_pending_xp_on_wipe = true;
[JsonProperty("Erase ExtraPockets storage on wipe")]
public bool erase_ExtraPockets_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("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("Electrical and component luck settings")]
public ElectricalAndComponentLuckSettings electricalComponentSettings = new ElectricalAndComponentLuckSettings();
public class ElectricalAndComponentLuckSettings {
[JsonProperty("Black listed parts for component and electrical luck abilities", ObjectCreationHandling = ObjectCreationHandling.Replace)]
public List<string> comp_blacklist = new List<string>();
[JsonProperty("Electrical custom loot override [use addelectricaloverride console command to add example to config]", ObjectCreationHandling = ObjectCreationHandling.Replace)]
public List<LootItems> electrical_loot_override = new List<LootItems>();
[JsonProperty("Component list custom loot override [use addcomponentoverride console command to add example to config]", ObjectCreationHandling = ObjectCreationHandling.Replace)]
public List<LootItems> component_loot_override = new List<LootItems>();
}
[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 t
// ... [Code preview truncated due to length. Full source in attached file] ...