Decompiled source of MoreSkills v0.3.3

MoreSkills.dll

Decompiled 2 weeks ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using MoreSkills.Config;
using MoreSkills.UI;
using MoreSkills.Utility;
using Pipakin.FitnessSkillMod.Config;
using Pipakin.SkillInjectorMod;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("MoreSkills")]
[assembly: AssemblyDescription("Valheim BepInEx Mod that adds additional skills")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("MoreSkills")]
[assembly: AssemblyCopyright("Copyright © 2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("10ba59fd-7bfc-46e9-92a3-a7691d15918c")]
[assembly: AssemblyFileVersion("0.3.3")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.3.3.0")]
[module: UnverifiableCode]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
}
namespace Pipakin.FitnessSkillMod
{
	public class FitnessConfig
	{
		private GenericConfigVariable<bool> fitnessSkillEnabled;

		private GenericConfigVariable<float> configSkillIncrease;

		private GenericConfigVariable<float> maxStaminaMultiplier;

		private GenericConfigVariable<float> regenStaminaMultiplier;

		private GenericConfigVariable<float> baseStaminaRegen;

		private GenericConfigVariable<float> baseStamina;

		private GenericConfigVariable<float> skillGainIncrement;

		public bool SkillEnabled => fitnessSkillEnabled.Value;

		public float SkillIncrease => configSkillIncrease.Value;

		public float MaxStaminaMultiplier => maxStaminaMultiplier.Value;

		public float RegenStaminaMultiplier => regenStaminaMultiplier.Value;

		public float BaseStaminaRegen => baseStaminaRegen.Value;

		public float BaseStamina => baseStamina.Value;

		public float SkillGainIncrement => skillGainIncrement.Value;

		public void InitConfig(string id, ConfigFile config)
		{
			config.Bind<int>("General", "NexusID", 388, "Nexus mod ID for updates");
			Assembly assembly = AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault((Assembly a) => a.GetName().Name == "ModConfigEnforcer");
			if (assembly != null)
			{
				Debug.Log((object)"[FitnessMod] Mod Config Enforcer detected, registering mod...");
				Type type = assembly.GetType("ModConfigEnforcer.ConfigManager");
				Traverse.Create(type).Method("RegisterMod", new object[2] { id, config }).GetValue(new object[2] { id, config });
			}
			else
			{
				Debug.Log((object)"Mod Config Enforcer not detected.");
			}
			fitnessSkillEnabled = new GenericConfigVariable<bool>(assembly, config, id, "FitnessSkillEnabled", defaultValue: true, "Enablers", "Enable or Disable the Fitness Skill", localOnly: true);
			configSkillIncrease = new GenericConfigVariable<float>(assembly, config, id, "LevelingIncrement", 1f, "Progression", "Increment to increase skill per use of a full bar of stamina", localOnly: true);
			baseStamina = new GenericConfigVariable<float>(assembly, config, id, "BaseMaximum", 75f, "Stamina", "Base Max Stamina. The default is 75 which is the same as the umodded game", localOnly: true);
			maxStaminaMultiplier = new GenericConfigVariable<float>(assembly, config, id, "MaxMultiplier", 1.5f, "Stamina", "Maximum stamina multiplier (at level 100). Minimum 1", localOnly: true);
			baseStaminaRegen = new GenericConfigVariable<float>(assembly, config, id, "BaseRegen", 5f, "Stamina", "Base Regen. The default is 5 which is the same as the umodded game", localOnly: true);
			regenStaminaMultiplier = new GenericConfigVariable<float>(assembly, config, id, "RegenMultiplier", 1.5f, "Stamina", "Stamina regen multiplier (at level 100). Minimum 1", localOnly: true);
			skillGainIncrement = new GenericConfigVariable<float>(assembly, config, id, "GainIncrement", 25f, "Stamina", "Amount of stamina used before any skill is gained", localOnly: true);
		}
	}
	[BepInPlugin("com.pipakin.FitnessSkillMod", "FitnessSkillMod", "2.0.1")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class FitnessSkill : BaseUnityPlugin
	{
		[HarmonyPatch(typeof(Player), "SetMaxStamina")]
		public static class ApplyFitnessEffects
		{
			[HarmonyPrefix]
			public static void Prefix(ref float stamina, Player __instance)
			{
				if (fitnessConfig.SkillEnabled)
				{
					try
					{
						float skillFactor = ((Character)__instance).GetSkillFactor((SkillType)243);
						float num = (float)Math.Ceiling(skillFactor * (fitnessConfig.MaxStaminaMultiplier - 1f) * fitnessConfig.BaseStamina);
						stamina += num + fitnessConfig.BaseStamina - 75f;
					}
					catch (Exception ex)
					{
						Debug.LogError((object)("Error adusting base stamina: " + ex.ToString()));
					}
				}
			}
		}

		[HarmonyPatch]
		public static class ApplyFitnessRegen
		{
			public static MethodBase TargetMethod()
			{
				return AccessTools.DeclaredMethod(typeof(Player), "UpdateStats", new Type[0], (Type[])null);
			}

			[HarmonyPrefix]
			public static void Prefix(Player __instance, ref float ___m_staminaRegen)
			{
				if (fitnessConfig.SkillEnabled)
				{
					try
					{
						float skillFactor = ((Character)__instance).GetSkillFactor((SkillType)243);
						float num = (float)Math.Ceiling((skillFactor * (fitnessConfig.RegenStaminaMultiplier - 1f) + 1f) * fitnessConfig.BaseStaminaRegen);
						___m_staminaRegen = num;
					}
					catch (Exception ex)
					{
						Debug.LogError((object)("Error adusting stamina regen: " + ex.ToString()));
					}
				}
			}
		}

		[HarmonyPatch(typeof(Player), "RPC_UseStamina")]
		public static class IncreaseFitnessSkill
		{
			[HarmonyPrefix]
			public static void Prefix(float v, Player __instance, ZNetView ___m_nview)
			{
				if (!fitnessConfig.SkillEnabled)
				{
					return;
				}
				try
				{
					float @float = ___m_nview.GetZDO().GetFloat("fitness_progress", 0f);
					@float += v;
					if (@float > fitnessConfig.SkillGainIncrement)
					{
						float num = @float / ((Character)__instance).GetMaxStamina();
						((Character)__instance).RaiseSkill((SkillType)243, num * fitnessConfig.SkillIncrease);
						___m_nview.GetZDO().Set("fitness_progress", 0f);
					}
					else
					{
						___m_nview.GetZDO().Set("fitness_progress", @float);
					}
				}
				catch (Exception ex)
				{
					Debug.LogError((object)("Error increasing fitness skill: " + ex.ToString()));
				}
			}
		}

		private const string MOD_ID = "com.pipakin.FitnessSkillMod";

		private readonly Harmony harmony = new Harmony("com.pipakin.FitnessSkillMod");

		private static FitnessConfig fitnessConfig = new FitnessConfig();

		private static Dictionary<string, Texture2D> cachedTextures = new Dictionary<string, Texture2D>();

		public const int SKILL_TYPE = 243;

		private static string iconPath = "Assets.Icons.";

		private static string iconFileName = "fitness.png";

		public static Sprite FitnessIcon;

		public static Sprite Load_FitnessIcon()
		{
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				Stream stream = EmbeddedAssets.LoadAssets(iconPath + iconFileName);
				Texture2D val = Helper.LoadPng(stream);
				FitnessIcon = Sprite.Create(val, new Rect(0f, 0f, 32f, 32f), Vector2.zero);
				stream.Dispose();
			}
			catch (Exception ex)
			{
				Debug.LogError((object)("Unable to load skill icon '" + iconFileName + "': " + ex.Message));
			}
			return FitnessIcon;
		}

		private void Awake()
		{
			fitnessConfig.InitConfig("com.pipakin.FitnessSkillMod", ((BaseUnityPlugin)this).Config);
			harmony.PatchAll(typeof(ApplyFitnessEffects));
			harmony.PatchAll(typeof(ApplyFitnessRegen));
			harmony.PatchAll(typeof(IncreaseFitnessSkill));
			if (fitnessConfig.SkillEnabled)
			{
				SkillInjector.RegisterNewSkill(243, "Fitness", "Affects maximum stamina level", 1f, Load_FitnessIcon(), (SkillType)102);
			}
		}
	}
}
namespace Pipakin.FitnessSkillMod.Config
{
	internal class GenericConfigVariable<T>
	{
		private object backingStore;

		public T Value => Traverse.Create(backingStore).Property("Value", (object[])null).GetValue<T>();

		public GenericConfigVariable(Assembly assembly, ConfigFile config, string id, string varName, T defaultValue, string configSection, string configDescription, bool localOnly)
		{
			if (assembly != null)
			{
				MethodInfo methodInfo = assembly.GetType("ModConfigEnforcer.ConfigManager").GetMethods().First((MethodInfo x) => x.Name == "RegisterModConfigVariable" && x.IsGenericMethod)
					.MakeGenericMethod(typeof(T));
				backingStore = methodInfo.Invoke(null, new object[6] { id, varName, defaultValue, configSection, configDescription, localOnly });
			}
			else
			{
				backingStore = config.Bind<T>(configSection, varName, defaultValue, configDescription);
			}
		}
	}
}
namespace MoreSkills.Info
{
	public static class PluginInfo
	{
		public const string Name = "MoreSkills";

		public const string Guid = "com.macharastormwing.moreskills";

		public const string Version = "0.3.3";
	}
}
namespace MoreSkills.Utility
{
	internal class EmbeddedAssets
	{
		public static Stream LoadAssets(string assetPath)
		{
			Assembly executingAssembly = Assembly.GetExecutingAssembly();
			string[] manifestResourceNames = executingAssembly.GetManifestResourceNames();
			if (executingAssembly.GetManifestResourceInfo(executingAssembly.GetName().Name + "." + assetPath) != null)
			{
				return executingAssembly.GetManifestResourceStream(executingAssembly.GetName().Name + "." + assetPath);
			}
			return null;
		}
	}
	public static class Helper
	{
		public struct HuntingDrops
		{
			public string CreaturePrefab { get; }

			public int Max { get; }

			public int Min { get; }

			public float Chance { get; }

			public HuntingDrops(string creatureprefab, int max, int min, float chance)
			{
				CreaturePrefab = creatureprefab;
				Max = max;
				Min = min;
				Chance = chance;
			}
		}

		public struct CraftingSaves
		{
			public string ObjNumItem { get; }

			public float ObjNum { get; }

			public float ItemCNum { get; }

			public float ItemUNum { get; }

			public CraftingSaves(string objnumitem, float objnum, float itemcnum, float itemunum)
			{
				ObjNumItem = objnumitem;
				ObjNum = objnum;
				ItemCNum = itemcnum;
				ItemUNum = itemunum;
			}
		}

		public struct FishStats
		{
			public string FishName { get; }

			public float BHookChance { get; }

			public int ItemStackSize { get; }

			public float StaminaUse { get; }

			public FishStats(string fishname, float bhookchance, int itemstacksize, float staminause)
			{
				FishName = fishname;
				BHookChance = bhookchance;
				ItemStackSize = itemstacksize;
				StaminaUse = staminause;
			}
		}

		public struct FishSizes
		{
			public string FishNameZDOID { get; }

			public Vector3 FishSize { get; }

			public float FishHeight { get; }

			public float FishSpeed { get; }

			public FishSizes(string fishnamezdoid, Vector3 fishsize, float fishheight, float fishspeed)
			{
				//IL_0009: Unknown result type (might be due to invalid IL or missing references)
				//IL_000a: Unknown result type (might be due to invalid IL or missing references)
				FishNameZDOID = fishnamezdoid;
				FishSize = fishsize;
				FishHeight = fishheight;
				FishSpeed = fishspeed;
			}
		}

		public static Texture2D LoadPng(Stream fileStream)
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Expected O, but got Unknown
			Texture2D val = null;
			if (fileStream != null)
			{
				using MemoryStream memoryStream = new MemoryStream();
				fileStream.CopyTo(memoryStream);
				val = new Texture2D(2, 2);
				ImageConversion.LoadImage(val, memoryStream.ToArray());
			}
			return val;
		}
	}
	public class MoreSkills_Instances
	{
		[HarmonyPatch(typeof(Vagon), "UpdateMass")]
		public static class SI_Vagon
		{
			public static void Postfix(ref Vagon __instance)
			{
				if ((Object)(object)__instance != (Object)null)
				{
					_cart = __instance;
				}
			}
		}

		[HarmonyPatch]
		public static class SI_Player
		{
			public static MethodBase TargetMethod()
			{
				return AccessTools.DeclaredMethod(typeof(Player), "UpdateStats", new Type[0], (Type[])null);
			}

			public static void Postfix(ref Player __instance)
			{
				if ((Object)(object)__instance != (Object)null)
				{
					_player = __instance;
				}
			}
		}

		[HarmonyPatch(typeof(Inventory), "UpdateTotalWeight")]
		public static class SI_Inventory
		{
			public static void Postfix(ref Inventory __instance)
			{
				if (__instance != null)
				{
					_inventory = __instance;
				}
			}
		}

		[HarmonyPatch(typeof(ItemDrop), "SlowUpdate")]
		public static class SI_ItemDrop
		{
			public static void Postfix(ref ItemDrop __instance)
			{
				if ((Object)(object)__instance != (Object)null)
				{
					_itemDrop = __instance;
				}
			}
		}

		[HarmonyPatch(typeof(ObjectDB), "Awake")]
		public static class SI_ObjectDB
		{
			public static void Postfix(ref ObjectDB __instance)
			{
				if ((Object)(object)__instance != (Object)null)
				{
					_objectDB = __instance;
				}
			}
		}

		[HarmonyPatch(typeof(InventoryGui), "Awake")]
		public static class SI_InventoryGui
		{
			public static void Postfix(ref InventoryGui __instance)
			{
				if ((Object)(object)__instance != (Object)null)
				{
					_inventoryGui = __instance;
				}
			}
		}

		[HarmonyPatch(typeof(ZNetView), "Awake")]
		public static class SI_ZNetView
		{
			public static void Postfix(ref ZNetView __instance)
			{
				if ((Object)(object)__instance != (Object)null)
				{
					_zNetView = __instance;
				}
			}
		}

		[HarmonyPatch(typeof(MineRock5), "Awake")]
		public static class SI_MineRock5
		{
			public static void Postfix(ref MineRock5 __instance)
			{
				_mineRock5 = __instance;
			}
		}

		[HarmonyPatch(typeof(Character), "Damage")]
		public static class SI_CDamage
		{
			public static void Postfix(ref Character __instance, HitData hit)
			{
				//IL_0019: Unknown result type (might be due to invalid IL or missing references)
				//IL_001e: Unknown result type (might be due to invalid IL or missing references)
				if ((Object)(object)_player != (Object)null)
				{
					_CDamage = __instance;
					_CDAttacker = hit.m_attacker;
				}
			}
		}

		[HarmonyPatch(typeof(Destructible), "Damage")]
		public static class Si_DDamage
		{
			public static void Postfix(ref Destructible __instance, HitData hit)
			{
				//IL_0019: Unknown result type (might be due to invalid IL or missing references)
				//IL_001e: Unknown result type (might be due to invalid IL or missing references)
				if ((Object)(object)_player != (Object)null)
				{
					_DDamage = __instance;
					_DDAttacker = hit.m_attacker;
				}
			}
		}

		[HarmonyPatch(typeof(MineRock5), "Damage")]
		public static class SI_MR5Damage
		{
			public static void Postfix(ref MineRock5 __instance, HitData hit)
			{
				//IL_0019: Unknown result type (might be due to invalid IL or missing references)
				//IL_001e: Unknown result type (might be due to invalid IL or missing references)
				if ((Object)(object)_player != (Object)null)
				{
					_MR5Damage = __instance;
					_MR5DAttacker = hit.m_attacker;
				}
			}
		}

		[HarmonyPatch(typeof(TreeBase), "Damage")]
		public static class SI_TBDamage
		{
			public static void Postfix(ref TreeBase __instance, HitData hit)
			{
				//IL_0019: Unknown result type (might be due to invalid IL or missing references)
				//IL_001e: Unknown result type (might be due to invalid IL or missing references)
				if ((Object)(object)_player != (Object)null)
				{
					_TBDamage = __instance;
					_TBDAttacker = hit.m_attacker;
				}
			}
		}

		[HarmonyPatch(typeof(TreeLog), "Damage")]
		public static class SI_TLDamage
		{
			public static void Postfix(ref TreeLog __instance, HitData hit)
			{
				//IL_0019: Unknown result type (might be due to invalid IL or missing references)
				//IL_001e: Unknown result type (might be due to invalid IL or missing references)
				if ((Object)(object)_player != (Object)null)
				{
					_TLDamage = __instance;
					_TLDAttacker = hit.m_attacker;
				}
			}
		}

		public static Player _player;

		public static ObjectDB _objectDB;

		public static InventoryGui _inventoryGui;

		public static ZDOID _CDAttacker;

		public static ZDOID _DDAttacker;

		public static ZDOID _MR5DAttacker;

		public static ZDOID _TBDAttacker;

		public static ZDOID _TLDAttacker;

		private static Vagon _cart;

		private static Inventory _inventory;

		private static ItemDrop _itemDrop;

		private static ZNetView _zNetView;

		private static MineRock5 _mineRock5;

		private static Character _CDamage;

		private static Destructible _DDamage;

		private static MineRock5 _MR5Damage;

		private static TreeBase _TBDamage;

		private static TreeLog _TLDamage;
	}
	public class Utilities
	{
		internal static void TextAreaDrawer(ConfigEntryBase entry)
		{
			GUILayout.ExpandHeight(true);
			GUILayout.ExpandWidth(true);
			entry.BoxedValue = GUILayout.TextArea((string)entry.BoxedValue, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.ExpandWidth(true),
				GUILayout.ExpandHeight(true)
			});
		}

		public static void Log(string message, [CallerMemberName] string method = null)
		{
			Debug.Log((object)("[MoreSkills].[" + (method ?? "null") + "] " + message));
		}

		public static void LogWarning(string message, [CallerMemberName] string method = null)
		{
			Debug.LogWarning((object)("[MoreSkills].[" + (method ?? "null") + "] " + message));
		}

		public static void LogError(string message, [CallerMemberName] string method = null)
		{
			Debug.LogError((object)("[MoreSkills].[" + (method ?? "null") + "] " + message));
		}
	}
}
namespace MoreSkills.UI
{
	internal static class SkillIcons
	{
		public static Sprite VitalityIcon;

		public static Sprite StrengthIcon;

		public static Sprite SailingIcon;

		public static Sprite CraftingIcon;

		public static Sprite HuntingIcon;

		public static Sprite TamingIcon;

		public static Sprite FishingIcon;

		public static Sprite Load_VitalityIcon()
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			Stream stream = EmbeddedAssets.LoadAssets("Assets.Icons.vitalityicon.png");
			Texture2D val = Helper.LoadPng(stream);
			VitalityIcon = Sprite.Create(val, new Rect(0f, 0f, 32f, 32f), Vector2.zero);
			stream.Dispose();
			return VitalityIcon;
		}

		public static Sprite Load_StrengthIcon()
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			Stream stream = EmbeddedAssets.LoadAssets("Assets.Icons.strengthicon.png");
			Texture2D val = Helper.LoadPng(stream);
			StrengthIcon = Sprite.Create(val, new Rect(0f, 0f, 32f, 32f), Vector2.zero);
			stream.Dispose();
			return StrengthIcon;
		}

		public static Sprite Load_SailingIcon()
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			Stream stream = EmbeddedAssets.LoadAssets("Assets.Icons.sailingicon.png");
			Texture2D val = Helper.LoadPng(stream);
			SailingIcon = Sprite.Create(val, new Rect(0f, 0f, 32f, 32f), Vector2.zero);
			stream.Dispose();
			return SailingIcon;
		}

		public static Sprite Load_CraftingIcon()
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			Stream stream = EmbeddedAssets.LoadAssets("Assets.Icons.craftingicon.png");
			Texture2D val = Helper.LoadPng(stream);
			CraftingIcon = Sprite.Create(val, new Rect(0f, 0f, 32f, 32f), Vector2.zero);
			stream.Dispose();
			return CraftingIcon;
		}

		public static Sprite Load_HuntingIcon()
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			Stream stream = EmbeddedAssets.LoadAssets("Assets.Icons.huntingicon.png");
			Texture2D val = Helper.LoadPng(stream);
			HuntingIcon = Sprite.Create(val, new Rect(0f, 0f, 32f, 32f), Vector2.zero);
			stream.Dispose();
			return HuntingIcon;
		}

		public static Sprite Load_TamingIcon()
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			Stream stream = EmbeddedAssets.LoadAssets("Assets.Icons.tamingicon.png");
			Texture2D val = Helper.LoadPng(stream);
			TamingIcon = Sprite.Create(val, new Rect(0f, 0f, 32f, 32f), Vector2.zero);
			stream.Dispose();
			return TamingIcon;
		}

		public static Sprite Load_FishingIcon()
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			Stream stream = EmbeddedAssets.LoadAssets("Assets.Icons.fishingicon.png");
			Texture2D val = Helper.LoadPng(stream);
			FishingIcon = Sprite.Create(val, new Rect(0f, 0f, 32f, 32f), Vector2.zero);
			stream.Dispose();
			return FishingIcon;
		}
	}
}
namespace MoreSkills.ModSkills
{
	internal class MoreSkills_DropsRocksWood
	{
		[HarmonyPatch(typeof(DropTable), "GetDropList", new Type[] { typeof(int) })]
		public static class DropTable_DropsRocksWood
		{
			private class DropObjectContainer
			{
				public int NumItems { get; set; }

				public DropObjectAssocinatedSkillType SkillType { get; set; }

				public GameObject DropItem { get; set; }

				public DropObjectContainer(int numItems, DropObjectAssocinatedSkillType skillType, GameObject dropItem)
				{
					NumItems = numItems;
					SkillType = skillType;
					DropItem = dropItem;
				}
			}

			private enum DropObjectAssocinatedSkillType
			{
				Woodworking,
				Pickaxe,
				Hunting
			}

			public static void Postfix(ref DropTable __instance, ref List<GameObject> __result, int amount)
			{
				//IL_0054: Unknown result type (might be due to invalid IL or missing references)
				//IL_005e: Unknown result type (might be due to invalid IL or missing references)
				//IL_006a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0074: Unknown result type (might be due to invalid IL or missing references)
				//IL_0080: Unknown result type (might be due to invalid IL or missing references)
				//IL_008a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0096: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
				if (!((Object)(object)MoreSkills_Instances._player != (Object)null) || __result == null || __result.Count <= 0 || (!MoreSkills_OverhaulsConfig.EnableWoodCuttingDropMod.Value && !MoreSkills_OverhaulsConfig.EnablePickaxeDropMod.Value && !MoreSkills_HuntingConfig.EnableHuntingSkill.Value) || (!(MoreSkills_Instances._DDAttacker == ((Character)MoreSkills_Instances._player).GetZDOID()) && !(MoreSkills_Instances._MR5DAttacker == ((Character)MoreSkills_Instances._player).GetZDOID()) && !(MoreSkills_Instances._TBDAttacker == ((Character)MoreSkills_Instances._player).GetZDOID()) && !(MoreSkills_Instances._TLDAttacker == ((Character)MoreSkills_Instances._player).GetZDOID())))
				{
					return;
				}
				bool value = MoreSkills_OverhaulsConfig.EnableDetailedLogging.Value;
				if (value)
				{
					Utilities.Log("Starting DropsRocksWood.Postfix with " + __result.Count + " drops", "Postfix");
				}
				List<GameObject> list = new List<GameObject>();
				float num = 0f;
				float appliedStoneLootFactor = 0f;
				float num2 = 0f;
				if (useNewDropMethod)
				{
					string[] array = MoreSkills_OverhaulsConfig.WoodCuttingApplyForItems.Value.Split(commaSeparator, StringSplitOptions.RemoveEmptyEntries);
					string[] array2 = MoreSkills_OverhaulsConfig.PickaxeApplyForItems.Value.Split(commaSeparator, StringSplitOptions.RemoveEmptyEntries);
					string[] array3 = MoreSkills_OverhaulsConfig.HuntingApplyForItems.Value.Split(commaSeparator, StringSplitOptions.RemoveEmptyEntries);
					string[] collection = MoreSkills_OverhaulsConfig.IgnoreDropItemNames.Value.Split(commaSeparator, StringSplitOptions.RemoveEmptyEntries);
					HashSet<string> hashSet = new HashSet<string>(collection);
					string[] collection2 = MoreSkills_OverhaulsConfig.DontDropItemNames.Value.Split(commaSeparator, StringSplitOptions.RemoveEmptyEntries);
					HashSet<string> hashSet2 = new HashSet<string>(collection2);
					Dictionary<string, DropObjectContainer> dictionary = new Dictionary<string, DropObjectContainer>();
					string[] array4 = array;
					foreach (string text in array4)
					{
						if (!dictionary.ContainsKey(text))
						{
							dictionary.Add(text, new DropObjectContainer(0, DropObjectAssocinatedSkillType.Woodworking, null));
							continue;
						}
						Utilities.LogWarning("Key '" + text + "' already exists in '" + ((ConfigEntryBase)MoreSkills_OverhaulsConfig.WoodCuttingApplyForItems).Definition.Key + "' found in config 'MoreSkills.OverhaulsConfig.cfg'. Did you configure it twice?", "Postfix");
					}
					string[] array5 = array2;
					foreach (string text2 in array5)
					{
						if (!dictionary.ContainsKey(text2))
						{
							dictionary.Add(text2, new DropObjectContainer(0, DropObjectAssocinatedSkillType.Pickaxe, null));
							continue;
						}
						Utilities.LogWarning("Key '" + text2 + "' already exists in '" + ((ConfigEntryBase)MoreSkills_OverhaulsConfig.PickaxeApplyForItems).Definition.Key + "' found in config 'MoreSkills.OverhaulsConfig.cfg'. Did you configure it twice?", "Postfix");
					}
					string[] array6 = array3;
					foreach (string text3 in array6)
					{
						if (!dictionary.ContainsKey(text3))
						{
							dictionary.Add(text3, new DropObjectContainer(0, DropObjectAssocinatedSkillType.Hunting, null));
							continue;
						}
						Utilities.LogWarning("Key '" + text3 + "' already exists in '" + ((ConfigEntryBase)MoreSkills_OverhaulsConfig.HuntingApplyForItems).Definition.Key + "' found in config 'MoreSkills.OverhaulsConfig.cfg'. Did you configure it twice?", "Postfix");
					}
					foreach (GameObject item23 in __result)
					{
						if ((Object)(object)item23 == (Object)null)
						{
							continue;
						}
						if (dictionary.TryGetValue(((Object)item23).name, out var value2))
						{
							if ((Object)(object)value2.DropItem == (Object)null)
							{
								value2.DropItem = item23;
							}
							value2.NumItems++;
							if (value)
							{
								Utilities.Log("Added drop '" + ((Object)item23).name + "' to dropObjects map (skillType=" + value2.SkillType.ToString() + ", NumItems=" + value2.NumItems + ")", "Postfix");
							}
						}
						else if (hashSet2.Contains(((Object)item23).name))
						{
							if (value)
							{
								Utilities.LogWarning("Not dropping Drop '" + ((Object)item23).name + "' because it was found in DontDropItemNames.", "Postfix");
							}
						}
						else
						{
							if (!hashSet.Contains(((Object)item23).name))
							{
								Utilities.LogWarning("Unknown Drop '" + ((Object)item23).name + "'. Ignoring skill and just dropping item.", "Postfix");
							}
							list.Add(item23);
						}
					}
					num = GetAppliedWoodLootFactor(num);
					appliedStoneLootFactor = GetAppliedStoneLootFactor(appliedStoneLootFactor);
					num2 = GetAppliedHuntingLootFactor(num2);
					foreach (string key in dictionary.Keys)
					{
						if (dictionary.TryGetValue(key, out var value3) && value3.NumItems > 0 && (Object)(object)value3.DropItem != (Object)null)
						{
							int num3 = 0;
							switch (value3.SkillType)
							{
							case DropObjectAssocinatedSkillType.Woodworking:
								num3 = (MoreSkills_OverhaulsConfig.EnableWoodCuttingDropMod.Value ? ((int)((float)value3.NumItems + (float)value3.NumItems * num)) : value3.NumItems);
								break;
							case DropObjectAssocinatedSkillType.Pickaxe:
								num3 = (MoreSkills_OverhaulsConfig.EnablePickaxeDropMod.Value ? ((int)((float)value3.NumItems + (float)value3.NumItems * appliedStoneLootFactor)) : value3.NumItems);
								break;
							case DropObjectAssocinatedSkillType.Hunting:
								num3 = (MoreSkills_HuntingConfig.EnableHuntingSkill.Value ? ((int)((float)value3.NumItems + (float)value3.NumItems * num2)) : value3.NumItems);
								break;
							default:
								Utilities.LogWarning("Unknown dropContainer Skilltype '" + value3.SkillType.ToString() + "'", "Postfix");
								break;
							}
							if (value)
							{
								Utilities.Log("Dropping " + num3 + " " + ((Object)value3.DropItem).name + " (original drops: " + value3.NumItems + ")", "Postfix");
							}
							for (int l = 0; l < num3; l++)
							{
								list.Add(value3.DropItem);
							}
						}
					}
				}
				else
				{
					float num4 = 0f;
					GameObject item = null;
					float num5 = 0f;
					GameObject item2 = null;
					float num6 = 0f;
					GameObject item3 = null;
					float num7 = 0f;
					GameObject item4 = null;
					float num8 = 0f;
					GameObject item5 = null;
					float num9 = 0f;
					GameObject item6 = null;
					float num10 = 0f;
					GameObject item7 = null;
					float num11 = 0f;
					GameObject item8 = null;
					float num12 = 0f;
					GameObject item9 = null;
					float num13 = 0f;
					GameObject item10 = null;
					float num14 = 0f;
					GameObject item11 = null;
					float num15 = 0f;
					GameObject item12 = null;
					float num16 = 0f;
					GameObject item13 = null;
					float num17 = 0f;
					GameObject item14 = null;
					float num18 = 0f;
					GameObject item15 = null;
					float num19 = 0f;
					GameObject item16 = null;
					float num20 = 0f;
					GameObject item17 = null;
					float num21 = 0f;
					GameObject item18 = null;
					float num22 = 0f;
					GameObject item19 = null;
					float num23 = 0f;
					GameObject item20 = null;
					float num24 = 0f;
					GameObject item21 = null;
					float num25 = 0f;
					GameObject item22 = null;
					foreach (GameObject item24 in __result)
					{
						if (!((Object)(object)item24 == (Object)null))
						{
							if (((Object)item24).name == "BeechSeeds")
							{
								num4 += 1f;
								item = item24;
							}
							else if (((Object)item24).name == "BirchCone")
							{
								num12 += 1f;
								item9 = item24;
							}
							else if (((Object)item24).name == "OakSeeds")
							{
								num13 += 1f;
								item10 = item24;
							}
							else if (((Object)item24).name == "Acorn")
							{
								num14 += 1f;
								item11 = item24;
							}
							else if (((Object)item24).name == "ElderBark")
							{
								num5 += 1f;
								item2 = item24;
							}
							else if (((Object)item24).name == "FineWood")
							{
								num6 += 1f;
								item3 = item24;
							}
							else if (((Object)item24).name == "FirCone")
							{
								num7 += 1f;
								item4 = item24;
							}
							else if (((Object)item24).name == "PineCone")
							{
								num8 += 1f;
								item5 = item24;
							}
							else if (((Object)item24).name == "Resin")
							{
								num9 += 1f;
								item6 = item24;
							}
							else if (((Object)item24).name == "RoundLog")
							{
								num10 += 1f;
								item7 = item24;
							}
							else if (((Object)item24).name == "Wood")
							{
								num11 += 1f;
								item8 = item24;
							}
							else if (((Object)item24).name == "Chitin")
							{
								num15 += 1f;
								item12 = item24;
							}
							else if (((Object)item24).name == "CopperOre")
							{
								num16 += 1f;
								item13 = item24;
							}
							else if (((Object)item24).name == "IronScrap")
							{
								num17 += 1f;
								item14 = item24;
							}
							else if (((Object)item24).name == "Obsidian")
							{
								num18 += 1f;
								item15 = item24;
							}
							else if (((Object)item24).name == "SilverOre")
							{
								num19 += 1f;
								item16 = item24;
							}
							else if (((Object)item24).name == "TinOre")
							{
								num21 += 1f;
								item18 = item24;
							}
							else if (((Object)item24).name == "Stone")
							{
								num20 += 1f;
								item17 = item24;
							}
							else if (((Object)item24).name == "Feathers")
							{
								num22 += 1f;
								item19 = item24;
							}
							else if (((Object)item24).name == "Guck")
							{
								num23 += 1f;
								item20 = item24;
							}
							else if (((Object)item24).name == "LeatherScraps")
							{
								num24 += 1f;
								item21 = item24;
							}
							else if (((Object)item24).name == "WitheredBone")
							{
								num25 += 1f;
								item22 = item24;
							}
							else
							{
								Utilities.LogWarning("Report Missing/Unknown Drop: '" + ((Object)item24).name + "'", "Postfix");
								list.Add(item24);
							}
						}
					}
					if (MoreSkills_OverhaulsConfig.EnableWoodCuttingDropMod.Value)
					{
						num = GetAppliedWoodLootFactor(num);
						for (int m = 0; m < (int)(num4 + num4 * num); m++)
						{
							list.Add(item);
						}
						for (int n = 0; n < (int)(num12 + num12 * num); n++)
						{
							list.Add(item9);
						}
						for (int num26 = 0; num26 < (int)(num13 + num13 * num); num26++)
						{
							list.Add(item10);
						}
						for (int num27 = 0; num27 < (int)(num14 + num14 * num); num27++)
						{
							list.Add(item11);
						}
						for (int num28 = 0; num28 < (int)(num5 + num5 * num); num28++)
						{
							list.Add(item2);
						}
						for (int num29 = 0; num29 < (int)(num6 + num6 * num); num29++)
						{
							list.Add(item3);
						}
						for (int num30 = 0; num30 < (int)(num7 + num7 * num); num30++)
						{
							list.Add(item4);
						}
						for (int num31 = 0; num31 < (int)(num8 + num8 * num); num31++)
						{
							list.Add(item5);
						}
						for (int num32 = 0; num32 < (int)(num9 + num9 * num); num32++)
						{
							list.Add(item6);
						}
						for (int num33 = 0; num33 < (int)(num10 + num10 * num); num33++)
						{
							list.Add(item7);
						}
						for (int num34 = 0; num34 < (int)(num11 + num11 * num); num34++)
						{
							list.Add(item8);
						}
					}
					else
					{
						for (int num35 = 0; num35 < (int)num4; num35++)
						{
							list.Add(item);
						}
						for (int num36 = 0; num36 < (int)num12; num36++)
						{
							list.Add(item9);
						}
						for (int num37 = 0; num37 < (int)num13; num37++)
						{
							list.Add(item10);
						}
						for (int num38 = 0; num38 < (int)num14; num38++)
						{
							list.Add(item11);
						}
						for (int num39 = 0; num39 < (int)num5; num39++)
						{
							list.Add(item2);
						}
						for (int num40 = 0; num40 < (int)num6; num40++)
						{
							list.Add(item3);
						}
						for (int num41 = 0; num41 < (int)num7; num41++)
						{
							list.Add(item4);
						}
						for (int num42 = 0; num42 < (int)num8; num42++)
						{
							list.Add(item5);
						}
						for (int num43 = 0; num43 < (int)num9; num43++)
						{
							list.Add(item6);
						}
						for (int num44 = 0; num44 < (int)num10; num44++)
						{
							list.Add(item7);
						}
						for (int num45 = 0; num45 < (int)num11; num45++)
						{
							list.Add(item8);
						}
					}
					if (MoreSkills_OverhaulsConfig.EnablePickaxeDropMod.Value)
					{
						appliedStoneLootFactor = GetAppliedStoneLootFactor(appliedStoneLootFactor);
						for (int num46 = 0; num46 < (int)(num15 + num15 * appliedStoneLootFactor); num46++)
						{
							list.Add(item12);
						}
						for (int num47 = 0; num47 < (int)(num16 + num16 * appliedStoneLootFactor); num47++)
						{
							list.Add(item13);
						}
						for (int num48 = 0; num48 < (int)(num17 + num17 * appliedStoneLootFactor); num48++)
						{
							list.Add(item14);
						}
						for (int num49 = 0; num49 < (int)(num18 + num18 * appliedStoneLootFactor); num49++)
						{
							list.Add(item15);
						}
						for (int num50 = 0; num50 < (int)(num19 + num19 * appliedStoneLootFactor); num50++)
						{
							list.Add(item16);
						}
						for (int num51 = 0; num51 < (int)(num20 + num20 * appliedStoneLootFactor); num51++)
						{
							list.Add(item17);
						}
						for (int num52 = 0; num52 < (int)(num21 + num21 * appliedStoneLootFactor); num52++)
						{
							list.Add(item18);
						}
					}
					else
					{
						for (int num53 = 0; num53 < (int)num15; num53++)
						{
							list.Add(item12);
						}
						for (int num54 = 0; num54 < (int)num16; num54++)
						{
							list.Add(item13);
						}
						for (int num55 = 0; num55 < (int)num17; num55++)
						{
							list.Add(item14);
						}
						for (int num56 = 0; num56 < (int)num18; num56++)
						{
							list.Add(item15);
						}
						for (int num57 = 0; num57 < (int)num19; num57++)
						{
							list.Add(item16);
						}
						for (int num58 = 0; num58 < (int)num20; num58++)
						{
							list.Add(item17);
						}
						for (int num59 = 0; num59 < (int)num21; num59++)
						{
							list.Add(item18);
						}
					}
					if (MoreSkills_HuntingConfig.EnableHuntingSkill.Value)
					{
						appliedStoneLootFactor = GetAppliedHuntingLootFactor(num);
						for (int num60 = 0; num60 < (int)(num22 + num22 * num2); num60++)
						{
							list.Add(item19);
						}
						for (int num61 = 0; num61 < (int)(num23 + num23 * num2); num61++)
						{
							list.Add(item20);
						}
						for (int num62 = 0; num62 < (int)(num24 + num24 * num2); num62++)
						{
							list.Add(item21);
						}
						for (int num63 = 0; num63 < (int)(num25 + num25 * num2); num63++)
						{
							list.Add(item22);
						}
					}
					else
					{
						for (int num64 = 0; num64 < (int)num22; num64++)
						{
							list.Add(item19);
						}
						for (int num65 = 0; num65 < (int)num23; num65++)
						{
							list.Add(item20);
						}
						for (int num66 = 0; num66 < (int)num24; num66++)
						{
							list.Add(item21);
						}
						for (int num67 = 0; num67 < (int)num25; num67++)
						{
							list.Add(item22);
						}
					}
				}
				__result = list;
				if (!value)
				{
					return;
				}
				string text4 = "";
				foreach (GameObject item25 in __result)
				{
					text4 = text4 + "'" + ((Object)item25).name + "',";
				}
				Utilities.Log("Returning Drops: " + text4, "Postfix");
			}
		}

		private static readonly bool useNewDropMethod = true;

		private static readonly char[] commaSeparator = new char[1] { ',' };

		private static float GetAppliedWoodLootFactor(float appliedWoodLootFactor)
		{
			if (appliedWoodLootFactor == 0f)
			{
				float skillFactor = ((Character)MoreSkills_Instances._player).GetSkillFactor((SkillType)13);
				appliedWoodLootFactor = (MoreSkills_OverhaulsConfig.WoodCuttingMultiplier.Value - 1f) * skillFactor;
			}
			return appliedWoodLootFactor;
		}

		private static float GetAppliedStoneLootFactor(float appliedStoneLootFactor)
		{
			if (appliedStoneLootFactor == 0f)
			{
				float skillFactor = ((Character)MoreSkills_Instances._player).GetSkillFactor((SkillType)12);
				appliedStoneLootFactor = (MoreSkills_OverhaulsConfig.PickaxeMultiplier.Value - 1f) * skillFactor;
			}
			return appliedStoneLootFactor;
		}

		private static float GetAppliedHuntingLootFactor(float appliedHuntingLootFactor)
		{
			if (appliedHuntingLootFactor == 0f)
			{
				float skillFactor = ((Character)MoreSkills_Instances._player).GetSkillFactor((SkillType)704);
				appliedHuntingLootFactor = (MoreSkills_HuntingConfig.HuntingDropMultiplier.Value - 1f) * skillFactor;
			}
			return appliedHuntingLootFactor;
		}
	}
	internal class MoreSkills_Crafting
	{
		[HarmonyPatch(typeof(InventoryGui), "Show")]
		public static class CraftingSkill_InventoryShow
		{
			public static void Postfix()
			{
				if (!((Object)(object)MoreSkills_Instances._player != (Object)null) || !MoreSkills_CraftingConfig.EnableCraftingSkill.Value)
				{
					return;
				}
				IGUI = true;
				if (!Saved)
				{
					foreach (Recipe recipe in MoreSkills_Instances._objectDB.m_recipes)
					{
						Requirement[] resources = recipe.m_resources;
						foreach (Requirement val in resources)
						{
							if (!((Object)(object)recipe == (Object)null) && !((Object)(object)recipe.m_item == (Object)null))
							{
								string objnumitem2 = string.Concat(((Object)recipe.m_item).name + ":" + recipe.m_amount + ":" + ((Object)val.m_resItem).name);
								float objnum = recipe.m_amount;
								float itemcnum = val.m_amount;
								float itemunum = val.m_amountPerLevel;
								if (cSaves.Find((Helper.CraftingSaves csaves) => csaves.ObjNumItem == objnumitem2).ObjNumItem != objnumitem2)
								{
									cSaves.Add(new Helper.CraftingSaves(objnumitem2, objnum, itemcnum, itemunum));
								}
							}
						}
					}
					Saved = true;
					Utilities.Log("Saved All Objects in DataBase", "Postfix");
				}
				bool value = MoreSkills_CraftingConfig.EnableDetailedLogging.Value;
				float num = CalculateAppliedItemMultiplier(value, "Show (Crafting)");
				foreach (Recipe recipe2 in MoreSkills_Instances._objectDB.m_recipes)
				{
					Requirement[] resources2 = recipe2.m_resources;
					foreach (Requirement val2 in resources2)
					{
						if ((Object)(object)recipe2 == (Object)null || (Object)(object)recipe2.m_item == (Object)null)
						{
							continue;
						}
						string objnumitem = string.Concat(((Object)recipe2.m_item).name + ":" + recipe2.m_amount + ":" + ((Object)val2.m_resItem).name);
						Helper.CraftingSaves craftingSaves = cSaves.Find((Helper.CraftingSaves csaves) => csaves.ObjNumItem == objnumitem);
						if (craftingSaves.ObjNumItem == objnumitem)
						{
							if (val2.m_amount >= 1)
							{
								val2.m_amount = Mathf.RoundToInt(craftingSaves.ItemCNum * num);
								if (val2.m_amount < 1)
								{
									val2.m_amount = 1;
								}
							}
							if (val2.m_amountPerLevel >= 1)
							{
								val2.m_amountPerLevel = Mathf.RoundToInt(craftingSaves.ItemUNum * num);
								if (val2.m_amountPerLevel < 1)
								{
									val2.m_amountPerLevel = 1;
								}
							}
							if (value)
							{
								Utilities.Log("Show (Crafting): Handling ObjNumItem '" + craftingSaves.ObjNumItem + "': old amount: " + craftingSaves.ItemCNum + " new amount: " + val2.m_amount + " (amountPerLevel: " + val2.m_amountPerLevel + " ) after applying item multiplier: " + num, "Postfix");
							}
						}
						else
						{
							Utilities.LogWarning("Show (Crafting): Stored objnumitem '" + craftingSaves.ObjNumItem + "' does not match expected objnumitm '" + objnumitem + "'", "Postfix");
						}
					}
				}
			}
		}

		[HarmonyPatch(typeof(InventoryGui), "DoCrafting")]
		public static class CraftingSkillMod_SkillIncrease
		{
			public static void Postfix()
			{
				if (!((Object)(object)MoreSkills_Instances._player != (Object)null) || !MoreSkills_CraftingConfig.EnableCraftingSkill.Value)
				{
					return;
				}
				bool value = MoreSkills_CraftingConfig.EnableDetailedLogging.Value;
				float num = CalculateAppliedItemMultiplier(value, "DoCrafting");
				foreach (Recipe recipe in MoreSkills_Instances._objectDB.m_recipes)
				{
					Requirement[] resources = recipe.m_resources;
					foreach (Requirement val in resources)
					{
						if ((Object)(object)recipe == (Object)null || (Object)(object)recipe.m_item == (Object)null)
						{
							continue;
						}
						string objnumitem = string.Concat(((Object)recipe.m_item).name + ":" + recipe.m_amount + ":" + ((Object)val.m_resItem).name);
						Helper.CraftingSaves craftingSaves = cSaves.Find((Helper.CraftingSaves csaves) => csaves.ObjNumItem == objnumitem);
						if (craftingSaves.ObjNumItem == objnumitem)
						{
							if (val.m_amount >= 1)
							{
								val.m_amount = Mathf.RoundToInt(craftingSaves.ItemCNum * num);
								if (val.m_amount < 1)
								{
									val.m_amount = 1;
								}
							}
							if (val.m_amountPerLevel >= 1)
							{
								val.m_amountPerLevel = Mathf.RoundToInt(craftingSaves.ItemUNum * num);
								if (val.m_amountPerLevel < 1)
								{
									val.m_amountPerLevel = 1;
								}
							}
							if (value)
							{
								Utilities.Log("DoCrafting: Handling ObjNumItem '" + craftingSaves.ObjNumItem + "': old amount: " + craftingSaves.ItemCNum + " new amount: " + val.m_amount + " (amountPerLevel: " + val.m_amountPerLevel + " ) after applying item multiplier: " + num, "Postfix");
							}
						}
						else
						{
							Utilities.LogWarning("DoCrafting: Stored objnumitem '" + craftingSaves.ObjNumItem + "' does not match expected objnumitm '" + objnumitem + "'", "Postfix");
						}
					}
				}
				int num2 = 0;
				foreach (Recipe recipe2 in MoreSkills_Instances._objectDB.m_recipes)
				{
					if ((Object)(object)recipe2 == (Object)null || (Object)(object)recipe2.m_item == (Object)null || !((Object)(object)recipe2.m_item == (Object)(object)((RecipeDataPair)(ref MoreSkills_Instances._inventoryGui.m_selectedRecipe)).Recipe.m_item))
					{
						continue;
					}
					Requirement[] resources2 = recipe2.m_resources;
					foreach (Requirement val2 in resources2)
					{
						if (val2 != null && !((Object)(object)val2.m_resItem == (Object)null))
						{
							CraftSkillInc += val2.m_amount;
							CraftSkillInc += val2.m_amountPerLevel;
							num2++;
						}
					}
				}
				((Character)MoreSkills_Instances._player).RaiseSkill((SkillType)703, CraftSkillInc * MoreSkills_CraftingConfig.CraftingSkillIncreaseMultiplier.Value / 10f);
				Utilities.Log("Granted Crafting EXP: " + CraftSkillInc * MoreSkills_CraftingConfig.CraftingSkillIncreaseMultiplier.Value + " found Recipe maches: " + num2, "Postfix");
				CraftSkillInc = 0f;
			}
		}

		public static bool IGUI;

		public static float CraftSkillInc;

		public static bool Saved;

		public static List<Helper.CraftingSaves> cSaves = new List<Helper.CraftingSaves>();

		private static float CalculateAppliedItemMultiplier(bool advancedLogging, string caltculatedAt)
		{
			float skillFactor = ((Character)MoreSkills_Instances._player).GetSkillFactor((SkillType)703);
			float num = (float)MoreSkills_CraftingConfig.CraftingMiddleLevel.Value / 100f;
			if (num < 0f)
			{
				num = 0f;
			}
			else if (num > 1f)
			{
				num = 1f;
			}
			float result;
			if (skillFactor < num)
			{
				float value = MoreSkills_CraftingConfig.CraftingLevelMultiplier.Value;
				result = value - skillFactor * (1f / num) * (value - 1f);
				if (advancedLogging)
				{
					Utilities.Log(caltculatedAt + ": formula: appliedItemMultiplier = CraftingLevelMultiplier - ((SkillLevel * (1 / CraftingMiddleLevel)) * (CraftingLevelMultiplier - 1)) where configured middle (0-100) was divided by 100 to get 0.0-1.0", "CalculateAppliedItemMultiplier");
				}
				Utilities.Log(caltculatedAt + ": formula with values: " + result + " = " + value + " - ((" + skillFactor + " * (1 / " + num + ")) * (" + value + " - 1))", "CalculateAppliedItemMultiplier");
				Utilities.Log(caltculatedAt + ": calculated appliedItemMultiplier " + result + " using crafing skill level " + skillFactor + " and multiplier " + value + " ) because skill is below " + num, "CalculateAppliedItemMultiplier");
			}
			else
			{
				float value2 = MoreSkills_CraftingConfig.CraftingLevelDivider.Value;
				float num2 = 1f + (skillFactor - num) * (1f / (1f - num)) * (value2 - 1f);
				result = 1f / num2;
				if (advancedLogging)
				{
					Utilities.Log(caltculatedAt + ": formula: appliedItemDivider = 1 + ((SkillLevel - CraftingMiddleLevel) * (1 / (1 - CraftingMiddleLevel)) * (CraftingLevelDivider - 1)) where configured middle (0-100) was divided by 100 to get 0.0-1.0", "CalculateAppliedItemMultiplier");
				}
				Utilities.Log(caltculatedAt + ": formula with values: " + num2 + " = 1 + ((" + skillFactor + " - " + num + ") * (1 / (1 - " + num + ")) * (" + value2 + " - 1))", "CalculateAppliedItemMultiplier");
				Utilities.Log(caltculatedAt + ": calculated appliedItemMultiplier " + result + " (based on '1 / appliedItemDivider': " + num2 + ") using crafing skill level " + skillFactor + " and divider " + value2 + " because skill is aboveequal " + num, "CalculateAppliedItemMultiplier");
			}
			return result;
		}
	}
	internal class MoreSkills_Sailing
	{
		[HarmonyPatch(typeof(Ship), "GetSailForce")]
		public static class Sailing_Skill
		{
			public static bool SittingInBoat;

			public static float Captain;

			public static float SittingCrew;

			public static float StandingCrew;

			public static void Postfix()
			{
				//IL_01f1: Unknown result type (might be due to invalid IL or missing references)
				//IL_01f6: Unknown result type (might be due to invalid IL or missing references)
				//IL_025f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0264: Unknown result type (might be due to invalid IL or missing references)
				//IL_059a: Unknown result type (might be due to invalid IL or missing references)
				//IL_059f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0504: Unknown result type (might be due to invalid IL or missing references)
				//IL_0509: Unknown result type (might be due to invalid IL or missing references)
				//IL_0289: Unknown result type (might be due to invalid IL or missing references)
				//IL_028e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0437: Unknown result type (might be due to invalid IL or missing references)
				//IL_043c: Unknown result type (might be due to invalid IL or missing references)
				//IL_05d5: Unknown result type (might be due to invalid IL or missing references)
				//IL_05da: Unknown result type (might be due to invalid IL or missing references)
				//IL_053f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0544: Unknown result type (might be due to invalid IL or missing references)
				//IL_0472: Unknown result type (might be due to invalid IL or missing references)
				//IL_0477: Unknown result type (might be due to invalid IL or missing references)
				//IL_02fa: Unknown result type (might be due to invalid IL or missing references)
				//IL_02ff: Unknown result type (might be due to invalid IL or missing references)
				//IL_0324: Unknown result type (might be due to invalid IL or missing references)
				//IL_0329: Unknown result type (might be due to invalid IL or missing references)
				//IL_038a: Unknown result type (might be due to invalid IL or missing references)
				//IL_038f: Unknown result type (might be due to invalid IL or missing references)
				//IL_03b4: Unknown result type (might be due to invalid IL or missing references)
				//IL_03b9: Unknown result type (might be due to invalid IL or missing references)
				if (!((Object)(object)MoreSkills_Instances._player != (Object)null) || !MoreSkills_SailingConfig.EnableSailingMod.Value)
				{
					return;
				}
				float num2;
				float num3;
				float num5;
				float backwardForce;
				float num6;
				Speed speedSetting;
				if ((Object)(object)MoreSkills_Instances._player.GetControlledShip() != (Object)null)
				{
					float num = Mathf.Floor(((Character)MoreSkills_Instances._player).GetSkillFactor((SkillType)702) * 100f + 1E-06f);
					num2 = (MoreSkills_SailingConfig.BaseMaxBForce.Value - MoreSkills_SailingConfig.BaseBForce.Value) / 100f * num;
					num3 = (MoreSkills_SailingConfig.BaseMaxRSpeed.Value - MoreSkills_SailingConfig.BaseRSpeed.Value) / 100f * num;
					float num4 = (MoreSkills_SailingConfig.BaseMaxSForce.Value - MoreSkills_SailingConfig.BaseSForce.Value) / 100f * num;
					num5 = (MoreSkills_SailingConfig.BaseMaxDSideways.Value - MoreSkills_SailingConfig.BaseDSideways.Value) / 100f * num;
					backwardForce = MoreSkills_Instances._player.GetControlledShip().m_backwardForce;
					float sailForceFactor = MoreSkills_Instances._player.GetControlledShip().m_sailForceFactor;
					num6 = MoreSkills_SailingConfig.BaseBForce.Value + num2 + MoreSkills_SailingConfig.CrewMembersBForceAdd.Value * num2 / 5f * (float)MoreSkills_Instances._player.GetControlledShip().m_players.Count;
					if (!MoreSkills_SailingConfig.EnableShipAcceleration.Value)
					{
						if (!MoreSkills_SailingConfig.EnableShipCrew.Value)
						{
							MoreSkills_Instances._player.GetControlledShip().m_backwardForce = MoreSkills_SailingConfig.BaseBForce.Value + num2;
						}
						else
						{
							MoreSkills_Instances._player.GetControlledShip().m_backwardForce = MoreSkills_SailingConfig.BaseBForce.Value + num2 + MoreSkills_SailingConfig.CrewMembersBForceAdd.Value * num2 / 5f * (float)MoreSkills_Instances._player.GetControlledShip().m_players.Count;
						}
						MoreSkills_Instances._player.GetControlledShip().m_sailForceFactor = MoreSkills_SailingConfig.BaseSForce.Value + num4;
					}
					else
					{
						speedSetting = MoreSkills_Instances._player.GetControlledShip().GetSpeedSetting();
						if (((object)(Speed)(ref speedSetting)).ToString() == "Stop")
						{
							MoreSkills_Instances._player.GetControlledShip().m_sailForceFactor = 0.01f;
							MoreSkills_Instances._player.GetControlledShip().m_backwardForce = 0.01f;
						}
						else
						{
							if (!(sailForceFactor < MoreSkills_SailingConfig.BaseSForce.Value + num4))
							{
								goto IL_02d3;
							}
							speedSetting = MoreSkills_Instances._player.GetControlledShip().GetSpeedSetting();
							if (!(((object)(Speed)(ref speedSetting)).ToString() == "Half"))
							{
								speedSetting = MoreSkills_Instances._player.GetControlledShip().GetSpeedSetting();
								if (!(((object)(Speed)(ref speedSetting)).ToString() == "Full"))
								{
									goto IL_02d3;
								}
							}
							Ship controlledShip = MoreSkills_Instances._player.GetControlledShip();
							controlledShip.m_sailForceFactor += 0.0001f;
						}
					}
					goto IL_03fa;
				}
				if (!((Object)(object)((Character)MoreSkills_Instances._player).GetStandingOnShip() != (Object)null) && !SittingInBoat)
				{
					return;
				}
				Vector3 velocity;
				if (((Character)MoreSkills_Instances._player).IsAttached())
				{
					SittingInBoat = true;
					velocity = ((Character)MoreSkills_Instances._player).GetVelocity();
					if (((Vector3)(ref velocity)).magnitude >= 1f)
					{
						if (SittingCrew < 0.5f)
						{
							float sittingCrew = SittingCrew;
							velocity = ((Character)MoreSkills_Instances._player).GetVelocity();
							SittingCrew = sittingCrew + ((Vector3)(ref velocity)).magnitude / 8000f * MoreSkills_SailingConfig.SailingSkillIncreaseMultiplier.Value;
						}
						else
						{
							((Character)MoreSkills_Instances._player).RaiseSkill((SkillType)702, SittingCrew);
							SittingCrew = 0f;
						}
					}
					return;
				}
				SittingInBoat = false;
				velocity = ((Character)MoreSkills_Instances._player).GetVelocity();
				if (((Vector3)(ref velocity)).magnitude >= 1f)
				{
					if (StandingCrew < 0.5f)
					{
						float standingCrew = StandingCrew;
						velocity = ((Character)MoreSkills_Instances._player).GetVelocity();
						StandingCrew = standingCrew + ((Vector3)(ref velocity)).magnitude / 16000f * MoreSkills_SailingConfig.SailingSkillIncreaseMultiplier.Value;
					}
					else
					{
						((Character)MoreSkills_Instances._player).RaiseSkill((SkillType)702, StandingCrew);
						StandingCrew = 0f;
					}
				}
				return;
				IL_036e:
				if (backwardForce < num6 && MoreSkills_SailingConfig.EnableShipCrew.Value)
				{
					speedSetting = MoreSkills_Instances._player.GetControlledShip().GetSpeedSetting();
					if (!(((object)(Speed)(ref speedSetting)).ToString() == "Slow"))
					{
						speedSetting = MoreSkills_Instances._player.GetControlledShip().GetSpeedSetting();
						if (!(((object)(Speed)(ref speedSetting)).ToString() == "Back"))
						{
							goto IL_03fa;
						}
					}
					Ship controlledShip2 = MoreSkills_Instances._player.GetControlledShip();
					controlledShip2.m_backwardForce += 0.001f;
				}
				goto IL_03fa;
				IL_02d3:
				if (!(backwardForce < MoreSkills_SailingConfig.BaseBForce.Value + num2) || MoreSkills_SailingConfig.EnableShipCrew.Value)
				{
					goto IL_036e;
				}
				speedSetting = MoreSkills_Instances._player.GetControlledShip().GetSpeedSetting();
				if (!(((object)(Speed)(ref speedSetting)).ToString() == "Slow"))
				{
					speedSetting = MoreSkills_Instances._player.GetControlledShip().GetSpeedSetting();
					if (!(((object)(Speed)(ref speedSetting)).ToString() == "Back"))
					{
						goto IL_036e;
					}
				}
				Ship controlledShip3 = MoreSkills_Instances._player.GetControlledShip();
				controlledShip3.m_backwardForce += 0.001f;
				goto IL_03fa;
				IL_03fa:
				MoreSkills_Instances._player.GetControlledShip().m_rudderSpeed = MoreSkills_SailingConfig.BaseRSpeed.Value + num3;
				MoreSkills_Instances._player.GetControlledShip().m_dampingSideway = MoreSkills_SailingConfig.BaseDSideways.Value + num5;
				velocity = ((Character)MoreSkills_Instances._player).GetVelocity();
				if (((Vector3)(ref velocity)).magnitude >= 1f)
				{
					if (Captain < 0.5f)
					{
						float captain = Captain;
						velocity = ((Character)MoreSkills_Instances._player).GetVelocity();
						Captain = captain + ((Vector3)(ref velocity)).magnitude / 4000f * MoreSkills_SailingConfig.SailingSkillIncreaseMultiplier.Value;
					}
					else
					{
						((Character)MoreSkills_Instances._player).RaiseSkill((SkillType)702, Captain);
						Captain = 0f;
					}
				}
			}
		}
	}
	internal class MoreSkills_Vitality
	{
		[HarmonyPatch(typeof(Player), "SetMaxHealth")]
		public static class Vitality_ApplyBaseHealthMod
		{
			public static void Prefix(ref float health)
			{
				if ((Object)(object)MoreSkills_Instances._player != (Object)null && MoreSkills_VitalityConfig.EnableHealthMod.Value)
				{
					float num = Mathf.Floor(((Character)MoreSkills_Instances._player).GetSkillFactor((SkillType)701) * 100f + 1E-06f);
					float num2 = (MoreSkills_VitalityConfig.BaseMaxHealth.Value - MoreSkills_VitalityConfig.BaseHealth.Value) / 100f * num;
					health += MoreSkills_VitalityConfig.BaseHealth.Value + num2 - 25f;
				}
			}
		}

		[HarmonyPatch]
		public static class Vitality_HealthRegen
		{
			public static MethodBase TargetMethod()
			{
				return AccessTools.DeclaredMethod(typeof(Player), "UpdateStats", new Type[0], (Type[])null);
			}

			public static void Postfix()
			{
				if (!((Object)(object)MoreSkills_Instances._player != (Object)null) || !MoreSkills_VitalityConfig.EnableHealthMod.Value || !(((Character)MoreSkills_Instances._player).GetHealth() < ((Character)MoreSkills_Instances._player).GetMaxHealth()))
				{
					return;
				}
				if (Damaged)
				{
					if (lastattackcounter > 1800)
					{
						Damaged = false;
					}
					else
					{
						lastattackcounter++;
					}
				}
				else if (healcounter > 600)
				{
					((Character)MoreSkills_Instances._player).Heal(((Character)MoreSkills_Instances._player).GetSkillFactor((SkillType)701), true);
					healcounter = 0;
				}
				else
				{
					healcounter++;
				}
			}
		}

		[HarmonyPatch(typeof(Player), "OnDamaged")]
		public static class Vitality_RaiseSkill
		{
			public static float IncVitality;

			public static void Postfix(ref HitData hit)
			{
				if ((Object)(object)MoreSkills_Instances._player != (Object)null && MoreSkills_VitalityConfig.EnableHealthMod.Value)
				{
					Damaged = true;
					healcounter = 0;
					lastattackcounter = 0;
					if (IncVitality < 0.1f)
					{
						IncVitality += hit.GetTotalDamage() / 10f * MoreSkills_VitalityConfig.VitalitySkillIncreaseMultiplier.Value;
						return;
					}
					((Character)MoreSkills_Instances._player).RaiseSkill((SkillType)701, IncVitality);
					IncVitality = 0f;
				}
			}
		}

		public static int lastattackcounter;

		public static int healcounter;

		public static bool Damaged;
	}
	internal class MoreSkills_Strength
	{
		[HarmonyPatch]
		public static class RaiseSkill_Strength
		{
			public static float IncEncumbred;

			public static float IncHalfnRunning;

			public static float IncHalfnMoving;

			public static int count;

			public static MethodBase TargetMethod()
			{
				return AccessTools.DeclaredMethod(typeof(Player), "UpdateStats", new Type[0], (Type[])null);
			}

			public static void Postfix()
			{
				//IL_0121: Unknown result type (might be due to invalid IL or missing references)
				//IL_0126: Unknown result type (might be due to invalid IL or missing references)
				if (!((Object)(object)MoreSkills_Instances._player != (Object)null) || !MoreSkills_StrengthConfig.EnableStrengthMod.Value)
				{
					return;
				}
				bool flag = ((Humanoid)MoreSkills_Instances._player).GetInventory().GetTotalWeight() > MoreSkills_Instances._player.GetMaxCarryWeight() / 2f;
				float magnitude = ((Vector3)(ref ((Character)MoreSkills_Instances._player).m_currentVel)).magnitude;
				bool flag2 = Mathf.Floor(magnitude) > 1f;
				float num = Mathf.Floor(((Character)MoreSkills_Instances._player).GetSkillFactor((SkillType)700) * 100f + 1E-06f);
				float num2 = (MoreSkills_StrengthConfig.BaseMaxWeight.Value - MoreSkills_StrengthConfig.BaseWeight.Value) / 100f * num;
				float num3 = num / ((((Humanoid)MoreSkills_Instances._player).GetInventory().GetTotalWeight() - MoreSkills_Instances._player.GetMaxCarryWeight()) * 50f) * MoreSkills_StrengthConfig.StrengthStaminaMultiplier.Value;
				if (MoreSkills_StrengthConfig.EnableWeightMod.Value)
				{
					MoreSkills_Instances._player.m_maxCarryWeight = MoreSkills_StrengthConfig.BaseWeight.Value + num2;
				}
				if (MoreSkills_StrengthConfig.EnableStrengthStaminaMod.Value)
				{
					if (((Character)MoreSkills_Instances._player).IsEncumbered())
					{
						Vector3 velocity = ((Character)MoreSkills_Instances._player).GetVelocity();
						if (((Vector3)(ref velocity)).magnitude < 0.1f)
						{
							if (count > 200)
							{
								count++;
							}
							((Character)MoreSkills_Instances._player).AddStamina(num3);
							goto IL_0176;
						}
					}
					count = 0;
				}
				goto IL_0176;
				IL_0176:
				if (!(flag && flag2))
				{
					return;
				}
				if (((Character)MoreSkills_Instances._player).IsEncumbered())
				{
					if (IncEncumbred < 0.1f)
					{
						IncEncumbred += ((Humanoid)MoreSkills_Instances._player).GetInventory().GetTotalWeight() / 20000f * MoreSkills_StrengthConfig.StrengthSkillIncreaseMultiplier.Value;
						return;
					}
					((Character)MoreSkills_Instances._player).RaiseSkill((SkillType)700, IncEncumbred);
					IncEncumbred = 0f;
				}
				else
				{
					if (!flag)
					{
						return;
					}
					if (((Character)MoreSkills_Instances._player).IsRunning())
					{
						if (IncHalfnRunning < 0.1f)
						{
							IncHalfnRunning += ((Humanoid)MoreSkills_Instances._player).GetInventory().GetTotalWeight() / 40000f * MoreSkills_StrengthConfig.StrengthSkillIncreaseMultiplier.Value;
							return;
						}
						((Character)MoreSkills_Instances._player).RaiseSkill((SkillType)700, IncHalfnRunning);
						IncHalfnRunning = 0f;
					}
					else if (IncHalfnMoving < 0.1f)
					{
						IncHalfnMoving += ((Humanoid)MoreSkills_Instances._player).GetInventory().GetTotalWeight() / 60000f * MoreSkills_StrengthConfig.StrengthSkillIncreaseMultiplier.Value;
					}
					else
					{
						((Character)MoreSkills_Instances._player).RaiseSkill((SkillType)700, IncHalfnMoving);
						IncHalfnMoving = 0f;
					}
				}
			}
		}
	}
	internal class MoreSkills_SwimMod
	{
		[HarmonyPatch]
		public static class Swim_SwimMod
		{
			public static int count;

			public static MethodBase TargetMethod()
			{
				return AccessTools.DeclaredMethod(typeof(Player), "UpdateStats", new Type[0], (Type[])null);
			}

			public static void Postfix()
			{
				//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
				//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
				if (!MoreSkills_OverhaulsConfig.EnableSwimMod.Value || !((Object)(object)MoreSkills_Instances._player != (Object)null))
				{
					return;
				}
				float num = (float)Math.Floor(((Character)MoreSkills_Instances._player).GetSkillFactor((SkillType)103) * 100f + 1E-06f);
				float num2 = (MoreSkills_OverhaulsConfig.BaseMaxSwimSpeed.Value - MoreSkills_OverhaulsConfig.BaseSwimSpeed.Value) / 100f * num;
				float num3 = num / 5000f * MoreSkills_OverhaulsConfig.SwimStaminaMultiplier.Value;
				if (MoreSkills_OverhaulsConfig.EnableSwimSpeedMod.Value)
				{
					((Character)MoreSkills_Instances._player).m_swimSpeed = MoreSkills_OverhaulsConfig.BaseSwimSpeed.Value + num2;
				}
				if (!MoreSkills_OverhaulsConfig.EnableSwimStaminaMod.Value)
				{
					return;
				}
				Character player = (Character)(object)MoreSkills_Instances._player;
				if (((Character)MoreSkills_Instances._player).IsSwimming())
				{
					Vector3 velocity = ((Character)MoreSkills_Instances._player).GetVelocity();
					if (((Vector3)(ref velocity)).magnitude < 0.6f)
					{
						if (count > 200)
						{
							count++;
						}
						((Character)MoreSkills_Instances._player).AddStamina(num3);
						return;
					}
				}
				count = 0;
			}
		}
	}
	internal class MoreSkills_CrouchMod
	{
		[HarmonyPatch]
		public static class Sneak_CrouchSpeedMod
		{
			public static MethodBase TargetMethod()
			{
				return AccessTools.DeclaredMethod(typeof(Player), "UpdateStats", new Type[0], (Type[])null);
			}

			public static void Postfix()
			{
				if (MoreSkills_OverhaulsConfig.EnableCrouchMod.Value && (Object)(object)MoreSkills_Instances._player != (Object)null)
				{
					if (((Character)MoreSkills_Instances._player).IsCrouching())
					{
						float num = (float)Math.Floor(((Character)MoreSkills_Instances._player).GetSkillFactor((SkillType)101) * 100f + 1E-06f);
						float num2 = (MoreSkills_OverhaulsConfig.BaseMaxCrouchSpeed.Value - MoreSkills_OverhaulsConfig.BaseCrouchSpeed.Value) / 100f * num;
						((Character)MoreSkills_Instances._player).m_crouchSpeed = MoreSkills_OverhaulsConfig.BaseCrouchSpeed.Value + num2;
					}
					else
					{
						((Character)MoreSkills_Instances._player).m_crouchSpeed = 2f;
					}
					if (((Character)MoreSkills_Instances._player).IsEncumbered())
					{
						((Character)MoreSkills_Instances._player).SetCrouch(false);
					}
				}
			}
		}
	}
}
namespace MoreSkills.ModSkills.Overhauls
{
	internal class MoreSkills_JumpMod
	{
		[HarmonyPatch]
		public static class TestJump
		{
			public static MethodBase TargetMethod()
			{
				return AccessTools.DeclaredMethod(typeof(Player), "UpdateStats", new Type[0], (Type[])null);
			}

			public static void Postfix(ref Character __instance)
			{
				//IL_0152: Unknown result type (might be due to invalid IL or missing references)
				//IL_004c: Unknown result type (might be due to invalid IL or missing references)
				//IL_01db: Unknown result type (might be due to invalid IL or missing references)
				//IL_01e0: Unknown result type (might be due to invalid IL or missing references)
				//IL_021d: Unknown result type (might be due to invalid IL or missing references)
				//IL_01fc: Unknown result type (might be due to invalid IL or missing references)
				//IL_0201: Unknown result type (might be due to invalid IL or missing references)
				if (!((Object)(object)MoreSkills_Instances._player != (Object)null) || !MoreSkills_OverhaulsConfig.EnableJumpMod.Value)
				{
					return;
				}
				if (MoreSkills_OverhaulsConfig.EnableHigherJump.Value)
				{
					if (MoreSkills_OverhaulsConfig.EnableHaveToShiftToHigherJump.Value)
					{
						if (Input.GetKey(MoreSkills_OverhaulsConfig.HigherJumpKey.Value))
						{
							((Character)MoreSkills_Instances._player).m_jumpForce = MoreSkills_OverhaulsConfig.BaseJumpForce.Value + (MoreSkills_OverhaulsConfig.BaseMaxJumpForce.Value - MoreSkills_OverhaulsConfig.BaseJumpForce.Value) * ((Character)MoreSkills_Instances._player).GetSkillFactor((SkillType)100);
						}
						else
						{
							((Character)MoreSkills_Instances._player).m_jumpForce = MoreSkills_OverhaulsConfig.BaseJumpForce.Value;
						}
					}
					else if (!MoreSkills_OverhaulsConfig.EnableHaveToShiftToHigherJump.Value)
					{
						((Character)MoreSkills_Instances._player).m_jumpForce = MoreSkills_OverhaulsConfig.BaseJumpForce.Value + (MoreSkills_OverhaulsConfig.BaseMaxJumpForce.Value - MoreSkills_OverhaulsConfig.BaseJumpForce.Value) * ((Character)MoreSkills_Instances._player).GetSkillFactor((SkillType)100);
					}
				}
				if (!MoreSkills_OverhaulsConfig.EnableRollOnFall.Value)
				{
					return;
				}
				float num = MoreSkills_OverhaulsConfig.BaseRollAltitude.Value + (MoreSkills_OverhaulsConfig.BaseMaxRollAltitude.Value - MoreSkills_OverhaulsConfig.BaseRollAltitude.Value) * ((Character)MoreSkills_Instances._player).GetSkillFactor((SkillType)100);
				float num2 = Mathf.Max(0f, __instance.m_maxAirAltitude - ((Component)MoreSkills_Instances._player).transform.position.y);
				if (num2 > MoreSkills_OverhaulsConfig.BaseRollAltitude.Value && num2 < num)
				{
					inAir = true;
					onGround = false;
				}
				else if (num2 > 8f)
				{
					inAir = false;
				}
				if (!inAir || num2 != 0f)
				{
					return;
				}
				onGround = true;
				if (onGround)
				{
					Vector3 val = ((Character)MoreSkills_Instances._player).m_moveDir;
					if (((Vector3)(ref val)).magnitude < 0.1f)
					{
						val = ((Character)MoreSkills_Instances._player).m_lookDir;
						val.y = 0f;
						((Vector3)(ref val)).Normalize();
					}
					MoreSkills_Instances._player.Dodge(val);
					inAir = false;
				}
			}
		}

		[HarmonyPatch(typeof(Character), "Damage")]
		public static class TestDamage
		{
			public static void Prefix(ref Character __instance, ref HitData hit)
			{
				//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
				if (!((Object)(object)MoreSkills_Instances._player != (Object)null) || !MoreSkills_OverhaulsConfig.EnableJumpMod.Value || !MoreSkills_OverhaulsConfig.EnableDecreaseFallDamageMod.Value)
				{
					return;
				}
				float value = MoreSkills_OverhaulsConfig.FallDamageDecrease.Value;
				float skillFactor = ((Character)MoreSkills_Instances._player).GetSkillFactor((SkillType)100);
				float value2 = MoreSkills_OverhaulsConfig.BaseMaxFallAltitude.Value;
				float value3 = MoreSkills_OverhaulsConfig.BaseRollAltitude.Value;
				float num = MoreSkills_OverhaulsConfig.BaseRollAltitude.Value + (MoreSkills_OverhaulsConfig.BaseMaxRollAltitude.Value - MoreSkills_OverhaulsConfig.BaseRollAltitude.Value) * ((Character)MoreSkills_Instances._player).GetSkillFactor((SkillType)100);
				float num2 = Mathf.Max(0f, __instance.m_maxAirAltitude - ((Component)MoreSkills_Instances._player).transform.position.y);
				float num3 = ((!(MoreSkills_OverhaulsConfig.MaxFallDamageIncrease.Value <= 0f)) ? MoreSkills_OverhaulsConfig.MaxFallDamageIncrease.Value : 1f);
				if (MoreSkills_OverhaulsConfig.EnableRollOnFall.Value)
				{
					if (num2 > value3 && num2 < num)
					{
						if (((ZDOID)(ref hit.m_attacker)).UserID == 0)
						{
							hit.m_damage.m_damage = 0f;
						}
					}
					else
					{
						if (!(num2 > num))
						{
							return;
						}
						if (MoreSkills_OverhaulsConfig.EnableMaxFallAltitude.Value)
						{
							if (num2 > num && num2 < value2)
							{
								if (((ZDOID)(ref hit.m_attacker)).UserID == 0)
								{
									hit.m_damage.m_damage = 100f / (value2 - num) * (num2 - num) / (value * skillFactor);
								}
							}
							else if (num2 > value2)
							{
								hit.m_damage.m_damage = 100f / (value2 - num) * (num2 - num) / (value * skillFactor) + (num2 - value2) * num3;
							}
						}
						else
						{
							if (!(num2 > num))
							{
								return;
							}
							if (num2 > 20f)
							{
								if (((ZDOID)(ref hit.m_attacker)).UserID == 0)
								{
									hit.m_damage.m_damage = 100f / (value * skillFactor);
								}
							}
							else if (num2 > num && num2 < 20f && ((ZDOID)(ref hit.m_attacker)).UserID == 0)
							{
								hit.m_damage.m_damage = 100f / (20f - num) * (num2 - num) / (value * skillFactor);
							}
						}
					}
				}
				else if (MoreSkills_OverhaulsConfig.EnableMaxFallAltitude.Value)
				{
					if (num2 > 4f && num2 < value2)
					{
						if (((ZDOID)(ref hit.m_attacker)).UserID == 0)
						{
							hit.m_damage.m_damage = 100f / (value2 - 4f) * (num2 - 4f) / (value * skillFactor);
						}
					}
					else if (num2 > value2 && ((ZDOID)(ref hit.m_attacker)).UserID == 0)
					{
						hit.m_damage.m_damage = 100f / (value2 - 4f) * (num2 - 4f) / (value * skillFactor) + (num2 - value2) * num3;
					}
				}
				else if (num2 > 4f && ((ZDOID)(ref hit.m_attacker)).UserID == 0)
				{
					hit.m_damage.m_damage /= value * skillFactor;
				}
			}
		}

		public static bool inAir;

		public static bool onGround;
	}
}
namespace MoreSkills.ModSkills.NewSkills
{
	internal class MoreSkills_Fishing
	{
		[HarmonyPatch(typeof(FishingFloat), "Nibble")]
		public static class FishFloat_Nibble_Patch
		{
			public static float mathAutoHook;

			public static void Postfix(ref FishingFloat __instance)
			{
				if (!((Object)(object)MoreSkills_Instances._player != (Object)null) || !MoreSkills_FishingConfig.EnableFishingSkill.Value)
				{
					return;
				}
				float skillFactor = ((Character)MoreSkills_Instances._player).GetSkillFactor((SkillType)706);
				float num = MoreSkills_FishingConfig.AutoHookLevel.Value;
				float num2 = MoreSkills_FishingConfig.AutoHookPercentage.Value;
				if (MoreSkills_FishingConfig.EnableFishingStaminaMod.Value)
				{
					if ((double)skillFactor <= 0.5)
					{
						__instance.m_hookedStaminaPerSec = 1f - 2f * (skillFactor * 2f);
					}
					else
					{
						__instance.m_hookedStaminaPerSec = -1f * ((skillFactor - 1f) * 2f);
					}
					__instance.m_pullStaminaUse = 10f - 8f * skillFactor;
				}
				__instance.m_moveForce = 5f + 15f * skillFactor;
				if (MoreSkills_FishingConfig.EnableFishingAutoHook.Value)
				{
					if (skillFactor <= num / 100f)
					{
						mathAutoHook = 1f - num2 / 100f * (100f / num * skillFactor);
					}
					else
					{
						mathAutoHook = 1f - num2 / 100f * 1f;
					}
					if (Random.value > mathAutoHook && (Object)(object)__instance.m_nibbler != (Object)null && Time.time - __instance.m_nibbleTime < 5f && (Object)(object)__instance.GetCatch() == (Object)null)
					{
						Fish nibbler = __instance.m_nibbler;
						__instance.Message("$msg_fishing_hooked", true);
						__instance.SetCatch(nibbler);
					}
				}
			}
		}

		[HarmonyPatch(typeof(Fish), "CustomFixedUpdate")]
		public static class Fish_SpeedNHeight_Patch
		{
			public static bool Prefix(ref float ___m_speed, ref float ___m_height, ref Fish __instance)
			{
				if ((Object)(object)MoreSkills_Instances._player != (Object)null && MoreSkills_FishingConfig.EnableFishingSkill.Value && MoreSkills_FishingConfig.EnableFishVariety.Value)
				{
					if (__instance.m_nview.GetZDO().GetFloat("fishspeed", -1f) != -1f)
					{
						___m_speed = __instance.m_nview.GetZDO().GetFloat("fishspeed", 0f);
						__instance.m_nview.GetZDO().Set("fishspeed", -1f);
					}
					if (__instance.m_nview.GetZDO().GetFloat("fishheight", -1f) != -1f)
					{
						___m_height = __instance.m_nview.GetZDO().GetFloat("fishheight", 0f);
						__instance.m_nview.GetZDO().Set("fishheight", -1f);
					}
				}
				return true;
			}
		}

		[HarmonyPatch(typeof(Fish), "CustomFixedUpdate")]
		public static class Fish_VarietyNMods_Patch
		{
			public static void Postfix(ref Fish __instance, ref float ___m_speed, ref float ___m_height)
			{
				//IL_0056: Unknown result type (might be due to invalid IL or missing references)
				//IL_005b: Unknown result type (might be due to invalid IL or missing references)
				//IL_015c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0183: Unknown result type (might be due to invalid IL or missing references)
				//IL_0199: Unknown result type (might be due to invalid IL or missing references)
				//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
				//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
				//IL_0203: Unknown result type (might be due to invalid IL or missing references)
				//IL_0302: Unknown result type (might be due to invalid IL or missing references)
				//IL_030e: Unknown result type (might be due to invalid IL or missing references)
				//IL_031b: Unknown result type (might be due to invalid IL or missing references)
				//IL_036a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0376: Unknown result type (might be due to invalid IL or missing references)
				//IL_0383: Unknown result type (might be due to invalid IL or missing references)
				//IL_03a4: Unknown result type (might be due to invalid IL or missing references)
				//IL_03b0: Unknown result type (might be due to invalid IL or missing references)
				//IL_03bd: Unknown result type (might be due to invalid IL or missing references)
				if (!((Object)(object)MoreSkills_Instances._player != (Object)null) || !MoreSkills_FishingConfig.EnableFishingSkill.Value)
				{
					return;
				}
				string FishName = ((Object)__instance).name.Replace("(Clone)", "");
				string text = FishName;
				ZDOID zDOID = __instance.GetZDOID();
				string FNZDOID = text + ":" + ((object)(ZDOID)(ref zDOID)).ToString();
				Helper.FishStats fishStats = fStats.Find((Helper.FishStats fstat) => fstat.FishName == FishName);
				Helper.FishSizes fishSizes = fSizes.Find((Helper.FishSizes fsize) => fsize.FishNameZDOID == FNZDOID);
				float skillFactor = ((Character)MoreSkills_Instances._player).GetSkillFactor((SkillType)706);
				if (MoreSkills_FishingConfig.EnableFishVariety.Value && fishSizes.FishNameZDOID != FNZDOID)
				{
					float num = Random.Range(0.25f, 2f);
					float num2 = Random.Range(-1f * (num * 0.5f), num * 0.5f);
					float num3 = Random.Range(-1f * (num * 0.5f), num * 0.5f);
					Vector3 val = default(Vector3);
					val.x = num + num2;
					val.y = num;
					val.z = num + num3;
					((Component)__instance.m_body).transform.localScale = val;
					__instance.m_nview.GetZDO().Set("fishspeed", ___m_speed / ((((Component)__instance.m_body).transform.localScale.x + ((Component)__instance.m_body).transform.localScale.y + ((Component)__instance.m_body).transform.localScale.z) / 3f));
					__instance.m_nview.GetZDO().Set("fishheight", ___m_height * ((Component)__instance.m_body).transform.localScale.y);
					fSizes.Add(new Helper.FishSizes(FNZDOID, val, __instance.m_height, __instance.m_speed));
				}
				if (!MoreSkills_FishingConfig.EnableFishingStaminaMod.Value && !MoreSkills_FishingConfig.EnableFishStackMod.Value && !MoreSkills_FishingConfig.EnableFishBaseHookMod.Value)
				{
					return;
				}
				if (fishStats.FishName != FishName)
				{
					fStats.Add(new Helper.FishStats(FishName, __instance.m_baseHookChance, __instance.m_pickupItemStackSize, __instance.m_staminaUse));
				}
				if (fishStats.FishName == FishName)
				{
					if (MoreSkills_FishingConfig.EnableFishBaseHookMod.Value)
					{
						__instance.m_baseHookChance = fishStats.BHookChance + (1f - fishStats.BHookChance) * skillFactor;
					}
					if (MoreSkills_FishingConfig.EnableFishStackMod.Value)
					{
						__instance.m_pickupItemStackSize = fishStats.ItemStackSize + Mathf.RoundToInt((float)fishStats.ItemStackSize * ((fishSizes.FishSize.x + fishSizes.FishSize.y + fishSizes.FishSize.z) / 3f) * (MoreSkills_FishingConfig.FishDropMultiplier.Value - 1f) * skillFactor);
					}
					if (MoreSkills_FishingConfig.EnableFishingStaminaMod.Value)
					{
						__instance.m_staminaUse = fishStats.StaminaUse * ((fishSizes.FishSize.x + fishSizes.FishSize.y + fishSizes.FishSize.z) / 3f / 2f) - fishStats.StaminaUse * ((fishSizes.FishSize.x + fishSizes.FishSize.y + fishSizes.FishSize.z) / 3f / 2f) / 4f * 3f * skillFactor;
					}
				}
			}
		}

		[HarmonyPatch(typeof(FishingFloat), "FixedUpdate")]
		public class FishingSkill_RaiseSkill
		{
			public static float FishingSkillIncrease;

			public static float oldLength;

			public static bool sOldLength;

			public static void Postfix(ref FishingFloat __instance)
			{
				//IL_0069: Unknown result type (might be due to invalid IL or missing references)
				//IL_006e: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
				//IL_0102: Unknown result type (might be due to invalid IL or missing references)
				//IL_010f: Unknown result type (might be due to invalid IL or missing references)
				if (!((Object)(object)MoreSkills_Instances._player != (Object)null) || !MoreSkills_FishingConfig.EnableFishingSkill.Value)
				{
					return;
				}
				if ((Object)(object)__instance.GetCatch() != (Object)null)
				{
					string text = ((Object)__instance.GetCatch()).name.Replace("(Clone)", "");
					ZDOID zDOID = __instance.GetCatch().GetZDOID();
					string FNZDOID = text + ":" + ((object)(ZDOID)(ref zDOID)).ToString();
					Helper.FishSizes fishSizes = fSizes.Find((Helper.FishSizes fsize) => fsize.FishNameZDOID == FNZDOID);
					if (!sOldLength)
					{
						oldLength = __instance.m_lineLength;
						sOldLength = true;
					}
					if (oldLength - __instance.m_lineLength > 0f)
					{
						FishingSkillIncrease += (oldLength - __instance.m_lineLength) / 2f * ((fishSizes.FishSize.x + fishSizes.FishSize.y + fishSizes.FishSize.z) / 3f);
						oldLength = 0f;
						sOldLength = false;
					}
					if (FishingSkillIncrease > 0.5f)
					{
						((Character)MoreSkills_Instances._player).RaiseSkill((SkillType)706, FishingSkillIncrease);
						FishingSkillIncrease = 0f;
					}
				}
				else
				{
					oldLength = 0f;
					sOldLength = false;
					__instance.m_pullStaminaUse = 0f;
				}
			}
		}

		public static List<Helper.FishStats> fStats = new List<Helper.FishStats>();

		public static List<Helper.FishSizes> fSizes = new List<Helper.FishSizes>();
	}
	internal class MoreSkills_Hunting
	{
		[HarmonyPatch(typeof(CharacterDrop), "Start")]
		public static class Hunting_UpdateDrops
		{
			public static void Postfix(ref CharacterDrop __instance)
			{
				if (!((Object)(object)MoreSkills_Instances._player != (Object)null) || !MoreSkills_HuntingConfig.EnableHuntingSkill.Value)
				{
					return;
				}
				bool value = MoreSkills_HuntingConfig.EnableHuntingMinMaxMod.Value;
				bool value2 = MoreSkills_HuntingConfig.EnableHuntingChanceMod.Value;
				float skillFactor = ((Character)MoreSkills_Instances._player).GetSkillFactor((SkillType)704);
				float num = MoreSkills_HuntingConfig.HuntingDropMultiplier.Value - 1f;
				foreach (Drop drop in __instance.m_drops)
				{
					float num2 = 0f;
					float num3 = 0f;
					float num4 = 0f;
					string nameprefab = string.Concat(((Object)__instance).name + ":" + (object)drop.m_prefab);
					string creaturePrefab = hDrops.Find((Helper.HuntingDrops hDrop) => hDrop.CreaturePrefab == nameprefab).CreaturePrefab;
					if (nameprefab != hDrops.Find((Helper.HuntingDrops hDrop) => hDrop.CreaturePrefab == nameprefab).CreaturePrefab)
					{
						hDrops.Add(new Helper.HuntingDrops(nameprefab, drop.m_amountMax, drop.m_amountMin, drop.m_chance));
						Utilities.Log("Hunting: Added Creature to the Temporal Hunting Database", "Postfix");
					}
					if ((!MoreSkills_HuntingConfig.EnableHuntingNormalMobsMod.Value && (!((Object)drop.m_prefab).name.Contains("Trophy") || !((Object)drop.m_prefab).name.Contains("Blob"))) || (!MoreSkills_HuntingConfig.EnableHuntingTrophyMod.Value && ((Object)drop.m_prefab).name.Contains("Trophy")) || (!MoreSkills_HuntingConfig.EnableHuntingBlobSpawn.Value && ((Object)drop.m_prefab).name.Contains("Blob")))
					{
						break;
					}
					if (!(nameprefab == hDrops.Find((Helper.HuntingDrops hDrop) => hDrop.CreaturePrefab == nameprefab).CreaturePrefab))
					{
						continue;
					}
					num2 = hDrops.Find((Helper.HuntingDrops hDrop) => hDrop.CreaturePrefab == nameprefab).Min;
					num3 = hDrops.Find((Helper.HuntingDrops hDrop) => hDrop.CreaturePrefab == nameprefab).Max;
					num4 = hDrops.Find((Helper.HuntingDrops hDrop) => hDrop.CreaturePrefab == nameprefab).Chance;
					if (MoreSkills_HuntingConfig.EnableTrialsOfOdinCompatibility.Value)
					{
						if (__instance.m_character.GetLevel() >= MoreSkills_HuntingConfig.ToOLowLevelStart.Value && __instance.m_character.GetLevel() < MoreSkills_HuntingConfig.ToOMidLevelStart.Value)
						{
							CLevel = 1;
						}
						else if (__instance.m_character.GetLevel() >= MoreSkills_HuntingConfig.ToOMidLevelStart.Value && __instance.m_character.GetLevel() < MoreSkills_HuntingConfig.ToOHighLevelStart.Value)
						{
							CLevel = 2;
						}
						else if (__instance.m_character.GetLevel() >= MoreSkills_HuntingConfig.ToOHighLevelStart.Value)
						{
							CLevel = 3;
						}
					}
					else
					{
						CLevel = __instance.m_character.GetLevel();
					}
					if (value)
					{
						if ((double)skillFactor > 0.5)
						{
							float num5 = Mathf.Round(num3 * num);
							drop.m_amountMax = (int)((num3 + num5) * (float)CLevel);
							float num6 = skillFactor * num;
							float num7 = Mathf.Round(num2 * num6);
							drop.m_amountMin = (int)((num2 + num7) * (float)CLevel);
						}
						else
						{
							float num8 = skillFactor * 2f * num;
							float num9 = Mathf.Round(num3 * num8);
							drop.m_amountMax = (int)((num3 + num9) * (float)CLevel);
						}
					}
					if (value2)
					{
						drop.m_chance = num4 + (1f - num4) * skillFactor;
					}
				}
			}
		}

		[HarmonyPatch(typeof(CharacterDrop), "OnDeath")]
		public static class Hunting_RaiseSkill
		{
			public static float HuntIncrease;

			public static void Postfix(ref CharacterDrop __instance)
			{
				//IL_0023: Unknown result type (might be due to invalid IL or missing references)
				//IL_002d: Unknown result type (might be due to invalid IL or missing references)
				if ((Object)(object)MoreSkills_Instances._player != (Object)null && MoreSkills_HuntingConfig.EnableHuntingSkill.Value)
				{
					if (MoreSkills_Instances._CDAttacker == ((Character)MoreSkills_Instances._player).GetZDOID())
					{
						HuntIncrease += __instance.m_character.GetMaxHealth() / 20f * (float)CLevel;
					}
					if (HuntIncrease > 0.1f)
					{
						((Character)MoreSkills_Instances._player).RaiseSkill((SkillType)704, HuntIncrease);
						HuntIncrease = 0f;
					}
				}
			}
		}

		public static int CLevel;

		public static List<Helper.HuntingDrops> hDrops = new List<Helper.HuntingDrops>();
	}
}
namespace MoreSkills.Config
{
	[BepInPlugin("MoreSkills.FishingConfig", "MoreSkills: Fishing", "0.0.1")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class MoreSkills_FishingConfig : BaseUnityPlugin
	{
		public const string Plugin_Name = "MoreSkills.FishingConfig";

		public static ConfigEntry<int> AutoHookLevel;

		public static ConfigEntry<int> AutoHookPercentage;

		private Harmony harmonyFishing;

		public static ConfigEntry<float> FishDropMultiplier;

		public static ConfigEntry<float> FishingSkillIncreaseMultiplier;

		public static ConfigEntry<bool> EnableFishingSkill;

		public static ConfigEntry<bool> EnableFishStackMod;

		public static ConfigEntry<bool> EnableFishBaseHookMod;

		public static ConfigEntry<bool> EnableFishingStaminaMod;

		public static ConfigEntry<bool> EnableFishingAutoHook;

		public static ConfigEntry<bool> EnableFishVariety;

		public const int FishingSkill_Type = 706;

		public void Awake()
		{
			//IL_01c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ce: Expected O, but got Unknown
			Utilities.Log("Loading Fishing Skill...", "Awake");
			EnableFishingSkill = ((BaseUnityPlugin)this).Config.Bind<bool>("1. Enablers", "Enable Fishing Skill", true, "Enables or disables the Fishing Skill.");
			EnableFishStackMod = ((BaseUnityPlugin)this).Config.Bind<bool>("1. Enablers", "Enable Fish Drop Amount Mod", true, "Enables or disables the Fish Drop Amount Modification.");
			EnableFishBaseHookMod = ((BaseUnityPlugin)this).Config.Bind<bool>("1. Enablers", "Enable Fish Base Chance of Hook Mod", true, "Enables or disables the Fish Base Hook Chance Modification.");
			EnableFishingStaminaMod = ((BaseUnityPlugin)this).Config.Bind<bool>("1. Enablers", "Enable Stamina Drain Decrease Mod", true, "Enables or disables the Stamina Decrease Modification.");
			EnableFishingAutoHook = ((BaseUnityPlugin)this).Config.Bind<bool>("1. Enablers", "Enable Fishing Auto Hook", true, "Enables or disables the Fishing Auto Hook.");
			EnableFishVariety = ((BaseUnityPlugin)this).Config.Bind<bool>("1. Enablers", "Enable Fish Variety", true, "Enables or disables the Fish Variety.");
			FishDropMultiplier = ((BaseUnityPlugin)this).Config.Bind<float>("2. Multipliers", "Fish Drop Multiplier", 4f, "Multiplies the amount of Raw Fish dropped from a Fish");
			FishingSkillIncreaseMultiplier = ((BaseUnityPlugin)this).Config.Bind<float>("2. Multipliers", "Fishing Skill Increase Multiplier", 3f, "Multiplies the Amount of Skill Gain at Fishing");
			AutoHookLevel = ((BaseUnityPlugin)this).Config.Bind<int>("3. BaseConfigs", "Fishing Skill Auto Hook Level", 75, "The level at which you reach the max Percentage to Auto Hook.");
			AutoHookPercentage = ((BaseUnityPlugin)this).Config.Bind<int>("3. BaseConfigs", "Auto Hook Max Percentage", 50, "The Max Percentage once reached the Fishing Skill Auto Hook Level, this will be the Chance of Auto Hook.");
			if (EnableFishingSkill.Value)
			{
				try
				{
					SkillInjector.RegisterNewSkill(706, "Fishing", "Fishing Stamina Drain, Fishing Base Hook, Fish Drop", 1f, SkillIcons.Load_FishingIcon(), (SkillType)11);
				}
				catch (Exception ex)
				{
					Utilities.LogError("Error Registering new Skill 'Fishing'" + ex.Message, "Awake");
				}
			}
			Utilities.Log("Fishing Skill Patched!", "Awake");
			harmonyFishing = new Harmony("MoreSkills.FishingConfig.GuiriGuyMods");
			if (!EnableFishingSkill.Value)
			{
				Utilities.LogWarning("Fishing Skill Disabled", "Awake");
			}
			else
			{
				Utilities.Log("Fishing Skill Enabled", "Awake");
				if (!EnableFishStackMod.Value)
				{
					Utilities.LogWarning("Fishing/Fish Stack Amount Mod Disabled", "Awake");
				}
				else
				{
					Utilities.Log("Fishing/Fish Stack Amount  Mod Enabled", "Awake");
				}
				if (!EnableFishBaseHookMod.Value)
				{
					Utilities.LogWarning("Fishing/Fish Base Hook Chance Mod Disabled", "Awake");
				}
				else
				{
					Utilities.Log("Fishing/Fish Base Hook Chance Mod Enabled", "Awake");
				}
				if (!EnableFishVariety.Value)
				{
					Utilities.LogWarning("Fishing/Variety Mod Disabled", "Awake");
				}
				else
				{
					Utilities.Log("Fishing/Variety Mod Enabled", "Awake");
				}
				if (!EnableFishingStaminaMod.Value)
				{
					Utilities.LogWarning("Fishing/Stamina Drain Decrease Mod Disabled", "Awake");
				}
				else
				{
					Utilities.Log("Fishing/Stamina Drain Decrease Mod Enabled", "Awake");
				}
			}
			Utilities.Log("Fishing Skill Loaded!", "Awake");
		}

		private void OnDestroy()
		{
			Utilities.Log("Fishing Skill UnPatched!", "OnDestroy");
			harmonyFishing.UnpatchSelf();
		}
	}
	[BepInPlugin("MoreSkills.OverhaulsConfig", "MoreSkills: Overhauls", "0.0.10")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class MoreSkills_OverhaulsConfig : BaseUnityPlugin
	{
		public const string Plugin_Name = "MoreSkills.OverhaulsConfig";

		public static ConfigEntry<bool> EnableDetailedLogging;

		public static ConfigEntry<float> BaseCrouchSpeed;

		public static ConfigEntry<float> BaseMaxCrouchSpeed;

		public static ConfigEntry<float> BaseSwimSpeed;

		public static ConfigEntry<float> BaseMaxSwimSpeed;

		public static ConfigEntry<float> BaseJumpForce;

		public static ConfigEntry<float> BaseMaxJumpForce;

		public static ConfigEntry<float> BaseRollAltitude;

		public static ConfigEntry<float> BaseMaxRollAltitude;

		public static ConfigEntry<float> BaseMaxFallAltitude;

		private Harmony harmonyOverhauls;

		public static ConfigEntry<float> PickaxeMultiplier;

		public static ConfigEntry<float> SwimStaminaMultiplier;

		public static ConfigEntry<float> WoodCuttingMultiplier;

		public static ConfigEntry<float> FallDamageDecrease;

		public static ConfigEntry<float> MaxFallDamageIncrease;

		public static ConfigEntry<bool> EnableCrouchMod;

		public static ConfigEntry<bool> EnableSwimMod;

		public static ConfigEntry<bool> EnablePickaxeDropMod;

		public static ConfigEntry<bool> EnablePickaxeChanceMod;

		public static ConfigEntry<bool> EnableSwimSpeedMod;

		public static ConfigEntry<bool> EnableSwimStaminaMod;

		public static ConfigEntry<bool> EnableWoodCuttingDropMod;

		public static ConfigEntry<bool> EnableJumpMod;

		public static ConfigEntry<bool> EnableDecreaseFallDamageMod;

		public static ConfigEntry<bool> EnableHigherJump;

		public static ConfigEntry<bool> EnableRollOnFall;

		public static ConfigEntry<bool> EnableHaveToShiftToHigherJump;

		public static ConfigEntry<bool> EnableMaxFallAltitude;

		public static ConfigEntry<KeyCode> HigherJumpKey;

		public static ConfigEntry<string> WoodCuttingApplyForItems;

		public static ConfigEntry<string> PickaxeApplyForItems;

		public static ConfigEntry<string> HuntingApplyForItems;

		public static ConfigEntry<string> IgnoreDropItemNames;

		public static ConfigEntry<string> DontDropItemNames;

		public void Awake()
		{
			//IL_0497: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a1: Expected O, but got Unknown
			Utilities.Log("Loading All Overhauls...", "Awake");
			EnableDetailedLogging = ((BaseUnityPlugin)this).Config.Bind<bool>("1. Enablers", "Enable Detailed Overhauls Logging", false, "Enables or disables additional logging (such as how drops are handled). This should be disabled unless you need it since it affects performance.");
			EnableCrouchMod = ((BaseUnityPlugin)this).Config.Bind<bool>("1. Enablers: Sneak", "Enable Crouch Speed Mod", true, "Enables or disables the Crouch Speed Modification");
			EnableSwimMod = ((BaseUnityPlugin)this).Config.Bind<bool>("1. Enablers: Swim", "Enable Swim Mods", true, "Enables or disables the Complete Swim Modification");
			EnableSwimSpeedMod = ((BaseUnityPlugin)this).Config.Bind<bool>("1. Enablers: Swim", "Enable Swim Speed Mod", true, "Enables or disables the Swim Speed Modification");
			EnableSwimStaminaMod = ((BaseUnityPlugin)this).Config.Bind<bool>("1. Enablers: Swim", "Enable Swim Stamina Mod", true, "Enables or disables the Swim Stamina Modification");
			EnablePickaxeDropMod = ((BaseUnityPlugin)this).Config.Bind<bool>("1. Enablers: Pickaxe", "Enable Pickaxe Drop Mod", true, "Enables or disables the Pickaxe Drops Modification");
			EnableWoodCuttingDropMod = ((BaseUnityPlugin)this).Config.Bind<bool>("1. Enablers: WoodCutting", "Enable WoodCutting Drop Mod", true, "Enables or disables the WoodCutting Drops Modification");
			EnableJumpMod = ((BaseUnityPlugin)this).Config.Bind<bool>("1. Enablers: Jump", "Enable Jump Mods", true, "Enables or disables the Jumping Modifications");
			EnableDecreaseFallDamageMod = ((BaseUnityPlugin)this).Config.Bind<bool>("1. Enablers: Jump", "Enable Fall Damage Mods", false, "Enables or disables the Jumping Fall Damage Modifications");
			EnableRollOnFall = ((BaseUnityPlugin)this).Config.Bind<bool>("1. Enablers: Jump", "Enable Roll on Fall Mod", true, "Enables or disables the Roll on Fall Modification");
			EnableHigherJump = ((BaseUnityPlugin)this).Config.Bind<bool>("1. Enablers: Jump", "Enable Higher Jump Mod", true, "Enables or disables the Higher Jump Modification");
			EnableHaveToShiftToHigherJump = ((BaseUnityPlugin)this).Config.Bind<bool>("1. Enablers: Jump", "Enable Need to Shift for Higher Jump Mod", true, "Enables or disables Need to Shift (or custom key) to make a Higher Jump Modification");
			EnableMaxFallAltitude = ((BaseUnityPlugin)this).Config.Bind<bool>("1. Enablers: Jump", "Enable Max Fall Altitude", true, "Enables or disables the Max Altitude a Character can fall without dying.");
			SwimStaminaMultiplier = ((BaseUnityPlugin)this).Config.Bind<float>("2. Multipliers: Swim", "Multiply the Swim Stamina Increase", 1f, "Multiply the amount of stamina you gain staying still in the water.");
			PickaxeMultiplier = ((BaseUnityPlugin)this).Config.Bind<float>("2. Multipliers: Pickaxe", "Multiplier based on Pickaxe Skill", 1.5f, "The based on level multipliers, so at level 100 you reach such number. At level 100 you got default x1.5 times the amount of drops than vanilla. This multiplier changes that number.");
			WoodCuttingMultiplier = ((BaseUnityPlugin)this).Config.Bind<float>("2. Multipliers: WoodCutting", "Multiplier based on WoodCutting Skill", 1.5f, "The based on level multipliers, so at level 100 you reach such number. At level 100 you got default x1.5 times the amount of drops than vanilla. This multiplier changes that number.");
			FallDamageDecrease = ((BaseUnityPlugin)this).Config.Bind<float>("2. Multipliers: Jump", "Decrease Multiplier based on Jumping Skill", 3f, "Decreases the Damage Recieved by Falling from a High Altitude (4 meters)");
			MaxFallDamageIncrease = ((BaseUnityPlugin)this).Config.Bind<float>("2. Multipliers: Jump", "Increase Multiplier Per Meter over Max Fall Altitude Skill", 3f, "Increses the Damage Recieved per meter exceded from Max Falling Altitude");
			BaseCrouchSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("3. BaseConfigs: Sneak", "Base Crouch Speed", 2f, "Change the base Crouch Speed. (Valheim Default is 2)");
			BaseMaxCrouchSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("3. BaseConfigs: Sneak", "Base Max Crouch Speed", 3f, "Change the base Max Crouch Speed at level 100. (Valheim Default is 2)");
			BaseSwimSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("3. BaseConfigs: Swim", "Base Swim Speed", 2f, "Change the base Swim Speed (Valheim Defailt is 2)");
			BaseMaxSwimSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("3. BaseConfigs: Swim", "Base Max Swim Speed", 4f, "Change the base Max Swim Speed at level 100. (Valheim Default is 2)");
			BaseJumpForce = ((BaseUnityPlugin)this).Config.Bind<float>("3. BaseConfigs: Jump", "Base Jump Force", 8f, "Change the base Jump Force (Valheim Defailt is 8)");
			BaseMaxJumpForce = ((BaseUnityPlugin)this).Config.Bind<float>("3. BaseConfigs: Jump", "Base Max Jump Force", 10f, "Change the base Max Jump Force at level 100. (Valheim Default is 8)");
			HigherJumpKey = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("3. BaseConfigs: Jump", "Base Higher Jump Key Force", (KeyCode)304, "Change the button to hold when wanted a Higher Jump. Keys: https://docs.unity3d.com/Manual/class-InputManager.html");
			BaseRollAltitude = ((BaseUnityPlugin)this).Config.Bind<float>("3. BaseConfigs: Jump", "Base Roll Altitude", 4f, "Change the base altitude you need to reach for the Character roll on fall, not recieving any damage.");
			BaseMaxRollAltitude = ((BaseUnityPlugin)this).Config.Bind<float>("3. BaseConfigs: Jump", "Base Max Roll Altitude", 8f, "Change the base Max altitude at jump level 100, at which the Character will roll on fall and not recieve any damage.");
			BaseMaxFallAltitude = ((BaseUnityPlugin)this).Config.Bind<float>("3. BaseConfigs: Jump", "Base Max Fall Altitude", 30f, "Change the base Max fall altitude which if it's higher than that you will directly die. (Valheim Default is 20)");
			WoodCuttingApplyForItems = ((BaseUnityPlugin)this).Config.Bind<string>("3. Baseconfigs: Woodcutting", "WoodCuttingApplyForItems", "BeechSeeds,BirchCone,OakSeeds,Acorn,ElderBark,FineWood,FirCone,PineCone,Resin,RoundLog,Wood,YggdrasilWood,Softtissue", "List of items that might drop when applying the skill 'WoodCutting' to apply the skill on and increase drop rates to based on skill level. If an item is not in the list the skill will not be applied. 'Enable WoodCutting Drop Mod' must be true for this to be applied.");
			PickaxeApplyForItems = ((BaseUnityPlugin)this).Config.Bind<string>("3. Baseconfigs: Pickaxe", "PickaxeApplyForItems", "Chitin,CopperOre,IronScrap,Obsidian,SilverOre,TinOre,Stone", "List of items that might drop when applying the skill Pickaxe to apply the skill on and increase drop rates to based on skill level. If an item is not in the list the skill will not be applied. 'Enable Pickaxe Drop Mod' must be true for this to be applied.");
			HuntingApplyForItems = ((BaseUnityPlugin)this).Config.Bind<string>("3. Baseconfigs: Hunting", "HuntingApplyForItems", "Feathers,Guck,LeatherScraps,WitheredBone", "List of items that m