Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of UnofficialValheimLevelingSystemm v5.9.2
ValheimLevelSystem.dll
Decompiled 2 years ago
The result has been truncated due to the large size, download it to view full contents!
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.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using Groups; using HarmonyLib; using Jotunn; using Jotunn.Managers; using Jotunn.Utils; using Microsoft.CodeAnalysis; using UnityEngine; using UnityEngine.Events; using UnityEngine.UI; using ValheimLevelSystem.PlayerSkills; [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: CompilationRelaxations(8)] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.0.0")] [module: UnverifiableCode] internal class <Module> { static <Module>() { Initializer.Init(); } } namespace ValheimLevelSystem { public class ExpTable { public static List<MonsterExp> MonsterExpList { get; set; } public static List<PickableExp> PickableExpList { get; set; } public static List<MineableExp> MineableExpList { get; set; } public static List<ChoppableExp> ChoppableExpList { get; set; } public static List<FishableExp> FishableExpList { get; set; } public static void InitMonsterExpList() { MonsterExpList = new List<MonsterExp>(); ValheimLevelSystem.Tier1Creatures.Value.Split(new char[1] { ',' }).ToList().ForEach(delegate(string x) { MonsterExpList.Add(new MonsterExp(x, ValheimLevelSystem.Tier1Exp.Value)); }); ValheimLevelSystem.Tier2Creatures.Value.Split(new char[1] { ',' }).ToList().ForEach(delegate(string x) { MonsterExpList.Add(new MonsterExp(x, ValheimLevelSystem.Tier2Exp.Value)); }); ValheimLevelSystem.Tier3Creatures.Value.Split(new char[1] { ',' }).ToList().ForEach(delegate(string x) { MonsterExpList.Add(new MonsterExp(x, ValheimLevelSystem.Tier3Exp.Value)); }); ValheimLevelSystem.Tier4Creatures.Value.Split(new char[1] { ',' }).ToList().ForEach(delegate(string x) { MonsterExpList.Add(new MonsterExp(x, ValheimLevelSystem.Tier4Exp.Value)); }); ValheimLevelSystem.Tier5Creatures.Value.Split(new char[1] { ',' }).ToList().ForEach(delegate(string x) { MonsterExpList.Add(new MonsterExp(x, ValheimLevelSystem.Tier5Exp.Value)); }); ValheimLevelSystem.Tier6Creatures.Value.Split(new char[1] { ',' }).ToList().ForEach(delegate(string x) { MonsterExpList.Add(new MonsterExp(x, ValheimLevelSystem.Tier6Exp.Value)); }); ValheimLevelSystem.Tier7Creatures.Value.Split(new char[1] { ',' }).ToList().ForEach(delegate(string x) { MonsterExpList.Add(new MonsterExp(x, ValheimLevelSystem.Tier7Exp.Value)); }); } public static void InitPickableExpList() { PickableExpList = new List<PickableExp>(); ValheimLevelSystem.Tier1Pickables.Value.Split(new char[1] { ',' }).ToList().ForEach(delegate(string x) { PickableExpList.Add(new PickableExp(x, ValheimLevelSystem.Tier1Exp.Value)); }); ValheimLevelSystem.Tier2Pickables.Value.Split(new char[1] { ',' }).ToList().ForEach(delegate(string x) { PickableExpList.Add(new PickableExp(x, ValheimLevelSystem.Tier2Exp.Value)); }); ValheimLevelSystem.Tier3Pickables.Value.Split(new char[1] { ',' }).ToList().ForEach(delegate(string x) { PickableExpList.Add(new PickableExp(x, ValheimLevelSystem.Tier3Exp.Value)); }); ValheimLevelSystem.Tier4Pickables.Value.Split(new char[1] { ',' }).ToList().ForEach(delegate(string x) { PickableExpList.Add(new PickableExp(x, ValheimLevelSystem.Tier4Exp.Value)); }); ValheimLevelSystem.Tier5Pickables.Value.Split(new char[1] { ',' }).ToList().ForEach(delegate(string x) { PickableExpList.Add(new PickableExp(x, ValheimLevelSystem.Tier5Exp.Value)); }); ValheimLevelSystem.Tier6Pickables.Value.Split(new char[1] { ',' }).ToList().ForEach(delegate(string x) { PickableExpList.Add(new PickableExp(x, ValheimLevelSystem.Tier6Exp.Value)); }); ValheimLevelSystem.Tier7Pickables.Value.Split(new char[1] { ',' }).ToList().ForEach(delegate(string x) { PickableExpList.Add(new PickableExp(x, ValheimLevelSystem.Tier7Exp.Value)); }); } public static void InitMineableExpList() { MineableExpList = new List<MineableExp>(); ValheimLevelSystem.Tier1Mineables.Value.Split(new char[1] { ',' }).ToList().ForEach(delegate(string x) { MineableExpList.Add(new MineableExp(x, ValheimLevelSystem.Tier1Exp.Value)); }); ValheimLevelSystem.Tier2Mineables.Value.Split(new char[1] { ',' }).ToList().ForEach(delegate(string x) { MineableExpList.Add(new MineableExp(x, ValheimLevelSystem.Tier2Exp.Value)); }); ValheimLevelSystem.Tier3Mineables.Value.Split(new char[1] { ',' }).ToList().ForEach(delegate(string x) { MineableExpList.Add(new MineableExp(x, ValheimLevelSystem.Tier3Exp.Value)); }); ValheimLevelSystem.Tier4Mineables.Value.Split(new char[1] { ',' }).ToList().ForEach(delegate(string x) { MineableExpList.Add(new MineableExp(x, ValheimLevelSystem.Tier4Exp.Value)); }); ValheimLevelSystem.Tier6Mineables.Value.Split(new char[1] { ',' }).ToList().ForEach(delegate(string x) { MineableExpList.Add(new MineableExp(x, ValheimLevelSystem.Tier6Exp.Value)); }); ValheimLevelSystem.Tier7Mineables.Value.Split(new char[1] { ',' }).ToList().ForEach(delegate(string x) { MineableExpList.Add(new MineableExp(x, ValheimLevelSystem.Tier7Exp.Value)); }); } public static void InitChoppableExpList() { ChoppableExpList = new List<ChoppableExp>(); ValheimLevelSystem.Tier1Choppables.Value.Split(new char[1] { ',' }).ToList().ForEach(delegate(string x) { ChoppableExpList.Add(new ChoppableExp(x, ValheimLevelSystem.Tier1Exp.Value)); }); ValheimLevelSystem.Tier2Choppables.Value.Split(new char[1] { ',' }).ToList().ForEach(delegate(string x) { ChoppableExpList.Add(new ChoppableExp(x, ValheimLevelSystem.Tier2Exp.Value)); }); ValheimLevelSystem.Tier3Choppables.Value.Split(new char[1] { ',' }).ToList().ForEach(delegate(string x) { ChoppableExpList.Add(new ChoppableExp(x, ValheimLevelSystem.Tier3Exp.Value)); }); ValheimLevelSystem.Tier6Choppables.Value.Split(new char[1] { ',' }).ToList().ForEach(delegate(string x) { ChoppableExpList.Add(new ChoppableExp(x, ValheimLevelSystem.Tier6Exp.Value)); }); ValheimLevelSystem.Tier7Choppables.Value.Split(new char[1] { ',' }).ToList().ForEach(delegate(string x) { ChoppableExpList.Add(new ChoppableExp(x, ValheimLevelSystem.Tier7Exp.Value)); }); } public static void InitFishableExpList() { FishableExpList = new List<FishableExp>(); ValheimLevelSystem.Tier2Fishables.Value.Split(new char[1] { ',' }).ToList().ForEach(delegate(string x) { FishableExpList.Add(new FishableExp(x, ValheimLevelSystem.Tier2Exp.Value)); }); ValheimLevelSystem.Tier3Fishables.Value.Split(new char[1] { ',' }).ToList().ForEach(delegate(string x) { FishableExpList.Add(new FishableExp(x, ValheimLevelSystem.Tier3Exp.Value)); }); ValheimLevelSystem.Tier4Fishables.Value.Split(new char[1] { ',' }).ToList().ForEach(delegate(string x) { FishableExpList.Add(new FishableExp(x, ValheimLevelSystem.Tier4Exp.Value)); }); ValheimLevelSystem.Tier5Fishables.Value.Split(new char[1] { ',' }).ToList().ForEach(delegate(string x) { FishableExpList.Add(new FishableExp(x, ValheimLevelSystem.Tier5Exp.Value)); }); ValheimLevelSystem.Tier6Fishables.Value.Split(new char[1] { ',' }).ToList().ForEach(delegate(string x) { FishableExpList.Add(new FishableExp(x, ValheimLevelSystem.Tier6Exp.Value)); }); } } public class MonsterExp { public string Name { get; set; } public int ExpAmount { get; set; } public MonsterExp(string name, int exp = 100) { Name = name; ExpAmount = exp; } } public class PickableExp { public string Name { get; set; } public int ExpAmount { get; set; } public PickableExp(string name, int exp = 100) { Name = name; ExpAmount = exp; } } public class MineableExp { public string Name { get; set; } public int ExpAmount { get; set; } public MineableExp(string name, int exp = 100) { Name = name; ExpAmount = exp; } } public class ChoppableExp { public string Name { get; set; } public int ExpAmount { get; set; } public ChoppableExp(string name, int exp = 100) { Name = name; ExpAmount = exp; } } public class FishableExp { public string Name { get; set; } public int ExpAmount { get; set; } public FishableExp(string name, int exp = 100) { Name = name; ExpAmount = exp; } } public class GUILog { public static GameObject GUILogWindow; public static bool state; public static void CreateLogWindow() { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)GUILogWindow) && Object.op_Implicit((Object)(object)Player.m_localPlayer)) { int value = ValheimLevelSystem.LogEntries.Value; GUILogWindow = GUIManager.Instance.CreateWoodpanel(GUIManager.CustomGUIFront.transform, new Vector2(1f, 0f), new Vector2(1f, 0f), loadLocation(), 250f, (float)(50 + 17 * value), true); GameObject value2 = GUIManager.Instance.CreateText("", GUILogWindow.transform, new Vector2(0.5f, 1f), new Vector2(0.5f, 1f), new Vector2(0f, -25f), GUIManager.Instance.AveriaSerifBold, 16, GUIManager.Instance.ValheimOrange, true, Color.black, 200f, 30f, false); GameObject value3 = GUIManager.Instance.CreateText("", GUILogWindow.transform, new Vector2(0.65f, 0.5f), new Vector2(0.65f, 0.5f), new Vector2(0f, -10f), GUIManager.Instance.AveriaSerif, 13, GUIManager.Instance.ValheimBeige, true, Color.black, 250f, (float)(17 * value), false); ValheimLevelSystem.menuItems.Add("LogWarning", value2); ValheimLevelSystem.menuItems.Add("LogEntries", value3); UpdateWarning(); GUILogWindow.SetActive(true); state = true; } } public static void toggle() { state = !state; GUILogWindow.SetActive(state); } public static void saveLocation() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) try { RectTransform component = GUILogWindow.GetComponent<RectTransform>(); Vector2 anchoredPosition = component.anchoredPosition; if (!Player.m_localPlayer.m_knownTexts.ContainsKey("logPosition")) { Player.m_localPlayer.m_knownTexts["logPosition"] = ""; } Player.m_localPlayer.m_knownTexts["logPosition"] = ((object)(Vector2)(ref anchoredPosition)).ToString(); } catch { } } public static Vector2 loadLocation() { //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) Vector2 result = default(Vector2); ((Vector2)(ref result))..ctor(-130f, 200f); if (!Player.m_localPlayer.m_knownTexts.ContainsKey("logPosition")) { return result; } try { string text = Player.m_localPlayer.m_knownTexts["logPosition"]; float num = float.Parse(text.Split(new char[1] { ',' })[0].Replace("(", "").Trim()); float num2 = float.Parse(text.Split(new char[1] { ',' })[1].Replace(")", "").Trim()); if (0f - num > (float)Screen.width || num > 0f || num2 > (float)Screen.height || num2 < 0f) { return result; } return new Vector2(num, num2); } catch { return result; } } public static void UpdateWarning() { ValheimLevelSystem.menuItems.TryGetValue("LogWarning", out var value); if (Object.op_Implicit((Object)(object)value)) { if (!Level.GetAvailablePoints().Equals("0") || !Level.GetAvailableAttributePoints().Equals("0")) { value.GetComponent<Text>().text = "You have points to spend!"; } else { value.GetComponent<Text>().text = ""; } if (Level.GetSpecialization() == PlayerSpecialization.None) { value.GetComponent<Text>().text = "Choose a specialization!"; } } } public static void UpdateLog(string logentry) { int value = ValheimLevelSystem.LogEntries.Value; string text = ""; ValheimLevelSystem.menuItems.TryGetValue("LogEntries", out var value2); string[] array = value2.GetComponent<Text>().text.Split(new char[1] { '\n' }); for (int i = Math.Max(array.Length - value, 0); i < array.Length; i++) { text = ((i != Math.Max(array.Length - value, 0)) ? (text + "\n" + array[i]) : array[i]); } if (!text.Equals("")) { text += "\n"; } text += logentry; if (Object.op_Implicit((Object)(object)value2)) { value2.GetComponent<Text>().text = text; } } } public class GUIXP { public static GameObject XPBar; public static void CreateXPBar() { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0117: 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) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)XPBar) && Object.op_Implicit((Object)(object)Player.m_localPlayer)) { XPBar = GUIManager.Instance.CreateWoodpanel(GUIManager.CustomGUIFront.transform, new Vector2(0.15f, 0.07f), new Vector2(0.15f, 0.07f), new Vector2(0f, 0f), 400f, 30f, false); float num = (float)int.Parse(Level.GetExp()) * 100f / (float)Level.GetMaxExpForCurrentLevel(); if (num > 100f) { num = 100f; } if (Level.GetMaxExpForCurrentLevel() == 0) { num = 0f; } GameObject value = GUIManager.Instance.CreateText("Lvl " + Level.GetLevel() + " " + num.ToString("0.00") + "%", XPBar.transform, new Vector2(0f, 0.5f), new Vector2(0f, 0.5f), new Vector2(65f, 0f), GUIManager.Instance.AveriaSerifBold, 15, GUIManager.Instance.ValheimOrange, true, Color.black, 100f, 20f, false); string text = ""; for (int i = 1; i <= (int)(2f * num / 3f); i++) { text += "|"; } GameObject value2 = GUIManager.Instance.CreateText(text, XPBar.transform, new Vector2(0f, 0.5f), new Vector2(0f, 0.5f), new Vector2(275f, 0f), GUIManager.Instance.AveriaSerifBold, 14, GUIManager.Instance.ValheimBeige, false, Color.black, 300f, 20f, false); ValheimLevelSystem.menuItems.Add("XPBarLvl", value); ValheimLevelSystem.menuItems.Add("XPBarBars", value2); XPBar.SetActive(true); } } public static void UpdateXPBar() { float num = (float)int.Parse(Level.GetExp()) * 100f / (float)Level.GetMaxExpForCurrentLevel(); if (num > 100f) { num = 100f; } if (Level.GetMaxExpForCurrentLevel() == 0) { num = 0f; } string text = ""; for (int i = 1; i <= (int)(2f * num / 3f); i++) { text += "|"; } ValheimLevelSystem.menuItems.TryGetValue("XPBarLvl", out var value); if (Object.op_Implicit((Object)(object)value)) { value.GetComponent<Text>().text = "Lvl " + Level.GetLevel() + " " + num.ToString("0.00") + "%"; } ValheimLevelSystem.menuItems.TryGetValue("XPBarBars", out var value2); if (Object.op_Implicit((Object)(object)value2)) { value2.GetComponent<Text>().text = text; } } } public class GUISpec { public static GameObject menu; public static void CreateSpecializationMenu() { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Expected O, but got Unknown //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: 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_0273: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_02b8: Unknown result type (might be due to invalid IL or missing references) //IL_02c2: Expected O, but got Unknown if (Level.GetSpecialization() != 0) { return; } GUI.DestroyMenu(); UpdateSpecDescr(); if (!Object.op_Implicit((Object)(object)menu) && Object.op_Implicit((Object)(object)Player.m_localPlayer)) { menu = GUIManager.Instance.CreateWoodpanel(GUIManager.CustomGUIFront.transform, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(0f, 0f), 600f, 1000f, true); ValheimLevelSystem.Menu.SetActive(false); int num = 0; foreach (PlayerAttribute specialization in Enum.GetValues(typeof(PlayerSpecialization)).Cast<PlayerAttribute>().ToList()) { if (specialization != 0) { GameObject val = GUIManager.Instance.CreateButton(System.Runtime.CompilerServices.Unsafe.As<PlayerAttribute, PlayerSpecialization>(ref specialization).ToString(), menu.transform, new Vector2(0.12f, 1f), new Vector2(0.12f, 1f), new Vector2(0f, -55f + (float)(-115 * num)), 100f, 40f); val.SetActive(true); Button component = val.GetComponent<Button>(); ((UnityEvent)component.onClick).AddListener((UnityAction)delegate { SpecializationManager.SkillUp((PlayerSpecialization)specialization); }); GameObject value = GUIManager.Instance.CreateText(SpecializationManager.SpecializationDescription((PlayerSpecialization)specialization), menu.transform, new Vector2(0.6f, 1f), new Vector2(0.6f, 1f), new Vector2(0f, -70f + (float)(-115 * num)), GUIManager.Instance.AveriaSerifBold, 12, GUIManager.Instance.ValheimOrange, true, Color.black, 400f, 110f, false); ValheimLevelSystem.menuItems.Add(System.Runtime.CompilerServices.Unsafe.As<PlayerAttribute, PlayerSpecialization>(ref specialization).ToString() + "specDescr", value); num++; } } GameObject val2 = GUIManager.Instance.CreateButton("Cancel", menu.transform, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(0f, -450f), 150f, 50f); val2.SetActive(true); Button component2 = val2.GetComponent<Button>(); ((UnityEvent)component2.onClick).AddListener(new UnityAction(DestroyMenu)); } bool active = !ValheimLevelSystem.Menu.activeSelf; menu.SetActive(active); } public static void UpdateSpecDescr() { foreach (PlayerSpecialization item in Enum.GetValues(typeof(PlayerSpecialization)).Cast<PlayerSpecialization>().ToList()) { ValheimLevelSystem.menuItems.TryGetValue(item.ToString() + "specDescr", out var value); if (Object.op_Implicit((Object)(object)value)) { value.GetComponent<Text>().text = SpecializationManager.SpecializationDescription(item); } } } public static void DestroyMenu() { menu.SetActive(false); } } public class GUIConfirm { public static GameObject menu; public static void CreateResetSkillMenu() { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Expected O, but got Unknown //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Expected O, but got Unknown GUI.DestroyMenu(); if (!Object.op_Implicit((Object)(object)menu) && Object.op_Implicit((Object)(object)Player.m_localPlayer)) { menu = GUIManager.Instance.CreateWoodpanel(GUIManager.CustomGUIFront.transform, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(0f, 0f), 300f, 220f, true); ValheimLevelSystem.Menu.SetActive(false); GameObject val = GUIManager.Instance.CreateText("Reset Points", menu.transform, new Vector2(0.5f, 1f), new Vector2(0.5f, 1f), new Vector2(0f, -60f), GUIManager.Instance.AveriaSerifBold, 25, GUIManager.Instance.ValheimOrange, true, Color.black, 150f, 40f, false); GameObject val2 = GUIManager.Instance.CreateButton("Yes", menu.transform, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(70f, -30f), 100f, 50f); val2.SetActive(true); Button component = val2.GetComponent<Button>(); ((UnityEvent)component.onClick).AddListener(new UnityAction(Reset.ResetSkills)); GameObject val3 = GUIManager.Instance.CreateButton("No", menu.transform, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(-70f, -30f), 100f, 50f); val3.SetActive(true); Button component2 = val3.GetComponent<Button>(); ((UnityEvent)component2.onClick).AddListener(new UnityAction(DestroyMenu)); } bool active = !ValheimLevelSystem.Menu.activeSelf; menu.SetActive(active); } public static void DestroyMenu() { menu.SetActive(false); } } public class Level { public static bool StanceActive; public static int StanceCycle; public static float StanceCD; public static List<LevelRequirement> LevelRequirementList { get; set; } public static void ToggleStance() { if (GetSpecialization() == PlayerSpecialization.None || StanceCD > 0f) { return; } if (GetSpecialization() == PlayerSpecialization.Ritualist || GetSpecialization() == PlayerSpecialization.Torturer) { StanceActive = true; StanceCycle = StanceCycle % 3 + 1; } else { StanceActive = !StanceActive; } StanceCD = ValheimLevelSystem.StanceCD.Value; string text = ""; switch (GetSpecialization()) { case PlayerSpecialization.Protector: text = "Defensive Stance "; break; case PlayerSpecialization.Ritualist: text = "Adaptive Stance - "; switch (StanceCycle) { case 1: text += "Health "; break; case 2: text += "Stamina "; break; case 3: text += "Eitr "; break; } StanceCD *= 0.25f; break; case PlayerSpecialization.Runeblade: text = "Fury Stance "; break; case PlayerSpecialization.Berserker: text = "Berserker Stance "; break; case PlayerSpecialization.Torturer: text = "Pain Stance - "; switch (StanceCycle) { case 1: text += "Poison "; break; case 2: text += "Fire "; break; case 3: text += "Spirit "; break; } StanceCD *= 0.25f; break; case PlayerSpecialization.Worker: text = "Burden Stance "; break; case PlayerSpecialization.Slugger: text = "Overpower Stance "; break; case PlayerSpecialization.Infused: text = "Overflow Stance "; break; } GUILog.UpdateLog(text + (StanceActive ? "On" : "Off")); } public static void InitLevelRequirementList() { LevelRequirementList = new List<LevelRequirement>(); int value = ValheimLevelSystem.BaseExpPerLevel.Value; float value2 = ValheimLevelSystem.ExpMultiplierPerLevel.Value; for (int i = 0; i <= ValheimLevelSystem.MaxLevel.Value; i++) { LevelRequirement levelRequirement = new LevelRequirement { Level = i }; if (i == 0) { levelRequirement.ExpAmount = value; LevelRequirementList.Add(levelRequirement); } else { long expAmount = LevelRequirementList.Last().ExpAmount; levelRequirement.ExpAmount = (long)Math.Round((float)(expAmount + value) * value2); LevelRequirementList.Add(levelRequirement); } } } public static void RaiseExpWithValues(int expAmount, int level, bool boss = false) { //IL_004c: Unknown result type (might be due to invalid IL or missing references) if (GetSpecialization() != PlayerSpecialization.Worker) { float num = expAmount; num *= 1f + (float)(level - 1) * ValheimLevelSystem.ExpPercentageBonusPerStar.Value; if (boss) { num *= (float)ValheimLevelSystem.BossExpMultiplier.Value; } int playersInRangeXZ = Player.GetPlayersInRangeXZ(((Component)Player.m_localPlayer).transform.position, (float)ValheimLevelSystem.RangeToDivideExp.Value); num *= ValheimLevelSystem.ExpRate.Value; if (playersInRangeXZ > 0) { num /= (float)playersInRangeXZ; } int num2 = Math.Max(Convert.ToInt32(num), 1); AddExp(num2); } } public static void RaiseExpWork(int expToGive) { float num = expToGive; num *= ValheimLevelSystem.ExpRateWork.Value; if (GetSpecialization() == PlayerSpecialization.Worker) { num *= Worker.PassiveXPMult.Value; } AddExp(Convert.ToInt32(num)); } public static void RaiseExpBase(int expToGive) { float num = expToGive; if (GetSpecialization() == PlayerSpecialization.Worker) { num *= Worker.PassiveXPMult.Value; } AddExp(Convert.ToInt32(num)); } public static void AddExp(long exp) { if (!Player.m_localPlayer.m_knownTexts.ContainsKey("playerLevel")) { Player.m_localPlayer.m_knownTexts.Add("playerLevel", "0"); Player.m_localPlayer.m_knownTexts.Add("playerExp", exp.ToString()); } else { long num = long.Parse(Player.m_localPlayer.m_knownTexts["playerExp"]); int currentLevel = Convert.ToInt32(Player.m_localPlayer.m_knownTexts["playerLevel"]); if (currentLevel == ValheimLevelSystem.MaxLevel.Value) { return; } long num2 = exp + num; LevelRequirement levelRequirement = LevelRequirementList.FirstOrDefault((LevelRequirement x) => x.Level == currentLevel); if (levelRequirement == null) { return; } if (num2 >= levelRequirement.ExpAmount) { GUILog.UpdateLog("You gained " + (levelRequirement.ExpAmount - num) + " XP."); PlayerLevelUp(currentLevel); AddExp(num2 - levelRequirement.ExpAmount); } else { if (exp > 0) { GUILog.UpdateLog("You gained " + exp + " XP."); } else { GUILog.UpdateLog("You lost " + -exp + " XP."); } Player.m_localPlayer.m_knownTexts["playerExp"] = num2.ToString(); } } GUI.UpdateExpText(); GUIXP.UpdateXPBar(); } public static void RemoveExpOnDeath() { if (ValheimLevelSystem.ExpPercentageToLoseOnDeath.Value > 0f && Player.m_localPlayer.m_knownTexts.TryGetValue("playerExp", out var value)) { long num = Convert.ToInt64(value); long maxExpForCurrentLevel = GetMaxExpForCurrentLevel(); float value2 = ValheimLevelSystem.ExpPercentageToLoseOnDeath.Value; long num2 = (long)((float)(maxExpForCurrentLevel / 100) * value2); if (num2 > num) { num2 = num; } AddExp(num2 * -1); } } private static void PlayerLevelUp(int currentLevel) { Player.m_localPlayer.m_knownTexts["playerExp"] = "0"; Player.m_localPlayer.m_knownTexts["playerLevel"] = (currentLevel + 1).ToString(); AddPoints(ValheimLevelSystem.PointsPerLevel.Value); AddAttributePoints(ValheimLevelSystem.AttributePointsPerLevel.Value); ((Character)Player.m_localPlayer).Message((MessageType)2, "Level: " + (currentLevel + 1), 0, (Sprite)null); GUI.UpdatePlayerLevelText(); GUILog.UpdateWarning(); GUILog.UpdateLog("Reached level " + (currentLevel + 1) + "!"); } public static long GetMaxExpForCurrentLevel() { Player localPlayer = Player.m_localPlayer; if (!Object.op_Implicit((Object)(object)localPlayer) || ((Character)localPlayer).InCutscene() || ((Character)localPlayer).IsTeleporting()) { return 0L; } return LevelRequirementList.FirstOrDefault((LevelRequirement x) => x.Level == long.Parse(Player.m_localPlayer.m_knownTexts["playerLevel"]))?.ExpAmount ?? 0; } public static string GetLevel() { if (!Player.m_localPlayer.m_knownTexts.ContainsKey("playerLevel")) { Player.m_localPlayer.m_knownTexts.Add("playerLevel", "0"); } return Player.m_localPlayer.m_knownTexts["playerLevel"]; } public static void SetLevelMax() { if (!Player.m_localPlayer.m_knownTexts.ContainsKey("playerLevel")) { Player.m_localPlayer.m_knownTexts.Add("playerLevel", "0"); } Player.m_localPlayer.m_knownTexts["playerLevel"] = ValheimLevelSystem.MaxLevel.Value.ToString(); ResetExp(); } public static string GetExp() { if (!Player.m_localPlayer.m_knownTexts.ContainsKey("playerExp")) { Player.m_localPlayer.m_knownTexts.Add("playerExp", "0"); } return Player.m_localPlayer.m_knownTexts["playerExp"]; } public static void ResetExp() { if (!Player.m_localPlayer.m_knownTexts.ContainsKey("playerExp")) { Player.m_localPlayer.m_knownTexts.Add("playerExp", "0"); } Player.m_localPlayer.m_knownTexts["playerExp"] = "0"; } public static string GetExpVerbose() { float num = Convert.ToInt32(GetExp()); float num2 = Convert.ToInt32(GetMaxExpForCurrentLevel()); string text = ((num > 1000000f) ? (GetThreeDigits(Math.Round(num / 1000000f, 2)) + "M") : ((!(num > 1000f)) ? Math.Round(num).ToString() : (GetThreeDigits(Math.Round(num / 1000f, 2)) + "K"))); string text2 = ((num2 > 1000000f) ? (GetThreeDigits(Math.Round(num2 / 1000000f, 2)) + "M") : ((!(num2 > 1000f)) ? Math.Round(num2).ToString() : (GetThreeDigits(Math.Round(num2 / 1000f, 2)) + "K"))); return text + " / " + text2; } private static string GetThreeDigits(double number) { string text = ""; string text2 = number.ToString(); int num = 0; string text3 = text2; for (int i = 0; i < text3.Length; i++) { char c = text3[i]; if (num == 3) { break; } text += c; if (c != '.') { num++; } } return text; } public static string GetAvailablePoints() { if (!Player.m_localPlayer.m_knownTexts.ContainsKey("playerAvailablePoints")) { Player.m_localPlayer.m_knownTexts.Add("playerAvailablePoints", ValheimLevelSystem.StartingPoints.Value.ToString()); } return Player.m_localPlayer.m_knownTexts["playerAvailablePoints"]; } public static string GetAvailableAttributePoints() { if (!Player.m_localPlayer.m_knownTexts.ContainsKey("playerAvailableAttributePoints")) { Player.m_localPlayer.m_knownTexts.Add("playerAvailableAttributePoints", "0"); } return Player.m_localPlayer.m_knownTexts["playerAvailableAttributePoints"]; } public static PlayerSpecialization GetSpecialization() { if (!Player.m_localPlayer.m_knownTexts.ContainsKey("playerSpecialization")) { Player.m_localPlayer.m_knownTexts.Add("playerSpecialization", "None"); return PlayerSpecialization.None; } return Player.m_localPlayer.m_knownTexts["playerSpecialization"] switch { "Protector" => PlayerSpecialization.Protector, "Ritualist" => PlayerSpecialization.Ritualist, "Runeblade" => PlayerSpecialization.Runeblade, "Berserker" => PlayerSpecialization.Berserker, "Torturer" => PlayerSpecialization.Torturer, "Worker" => PlayerSpecialization.Worker, "Slugger" => PlayerSpecialization.Slugger, "Infused" => PlayerSpecialization.Infused, _ => PlayerSpecialization.None, }; } public static string GetSpecializationStr() { return GetSpecialization().ToString(); } public static string GetAttributeTotal(PlayerAttribute playerAttribute) { int attributeLevel = GetAttributeLevel(playerAttribute); return playerAttribute switch { PlayerAttribute.Health => (attributeLevel + 25).ToString(), PlayerAttribute.Stamina => (attributeLevel + 50).ToString(), PlayerAttribute.Eitr => (attributeLevel + 20).ToString(), _ => "0", }; } public static string GetHighestBossKill() { if (!Player.m_localPlayer.m_knownTexts.ContainsKey("playerHighestBoss")) { Player.m_localPlayer.m_knownTexts.Add("playerHighestBoss", "0"); } return Player.m_localPlayer.m_knownTexts["playerHighestBoss"]; } public static void AddPoints(int points) { if (!Player.m_localPlayer.m_knownTexts.ContainsKey("playerAvailablePoints")) { Player.m_localPlayer.m_knownTexts.Add("playerAvailablePoints", "0"); } int num = Convert.ToInt32(GetAvailablePoints()); Player.m_localPlayer.m_knownTexts["playerAvailablePoints"] = (num + points).ToString(); GUI.UpdatePlayerPointsAvailable(); } public static void AddAttributePoints(int points) { if (!Player.m_localPlayer.m_knownTexts.ContainsKey("playerAvailableAttributePoints")) { Player.m_localPlayer.m_knownTexts.Add("playerAvailableAttributePoints", "0"); } int num = Convert.ToInt32(GetAvailableAttributePoints()); Player.m_localPlayer.m_knownTexts["playerAvailableAttributePoints"] = (num + points).ToString(); GUI.UpdatePlayerAttributePointsAvailable(); } public static void IncreaseHighestBossKill(int boss_lvl) { int num = boss_lvl - Convert.ToInt32(GetHighestBossKill()); if (num > 0) { int num2 = Convert.ToInt32(GetAvailableAttributePoints()) + ValheimLevelSystem.PointsPerBoss.Value * num; Player.m_localPlayer.m_knownTexts["playerAvailableAttributePoints"] = num2.ToString(); Player.m_localPlayer.m_knownTexts["playerHighestBoss"] = boss_lvl.ToString(); GUI.UpdatePlayerPointsAvailable(); GUILog.UpdateWarning(); GUILog.UpdateLog("You gained " + ValheimLevelSystem.PointsPerBoss.Value * num + " attribute points!"); } } public static void RemovePoints(int points) { int num = Convert.ToInt32(GetAvailablePoints()); Player.m_localPlayer.m_knownTexts["playerAvailablePoints"] = (num - points).ToString(); GUI.UpdatePlayerPointsAvailable(); } public static void RemoveAttributePoints(int points) { int num = Convert.ToInt32(GetAvailableAttributePoints()); Player.m_localPlayer.m_knownTexts["playerAvailableAttributePoints"] = (num - points).ToString(); GUI.UpdatePlayerAttributePointsAvailable(); } public static int GetSkillLevel(Skill skill) { if (!ValheimLevelSystem.listInitiliazed) { return 0; } if (Player.m_localPlayer.m_knownTexts.TryGetValue("player" + skill, out var value)) { return Convert.ToInt32(value); } Debug.Log((object)("Unable to find player" + skill)); StackTrace stackTrace = new StackTrace(); Debug.Log((object)stackTrace); Player.m_localPlayer.m_knownTexts.Add("player" + skill, "0"); return Convert.ToInt32(Player.m_localPlayer.m_knownTexts["player" + skill]); } public static int GetAttributeLevel(PlayerAttribute attribute) { if (!ValheimLevelSystem.listInitiliazed) { return 0; } if (Player.m_localPlayer.m_knownTexts.TryGetValue("playerAttribute" + attribute, out var value)) { return Convert.ToInt32(value); } Debug.Log((object)("Unable to find playerAttribute" + attribute)); StackTrace stackTrace = new StackTrace(); Debug.Log((object)stackTrace); Player.m_localPlayer.m_knownTexts.Add("playerAttribute" + attribute, "0"); return Convert.ToInt32(Player.m_localPlayer.m_knownTexts["playerAttribute" + attribute]); } public static float CalcEffect(int lvl, float valreg, float valdim, bool eff) { int value = ValheimLevelSystem.BreakPoint.Value; float num = 0f; if (eff) { num = 1f; if (lvl <= value) { return 1f / (1f + valreg * (float)lvl); } return 1f / (1f + valreg * (float)value + valdim * (float)(lvl - value)); } if (lvl <= value) { return valreg * (float)lvl; } return valreg * (float)value + valdim * (float)(lvl - value); } } public class LevelRequirement { public int Level { get; set; } public long ExpAmount { get; set; } } internal class GUI { public static void ToggleMenu() { if (!Object.op_Implicit((Object)(object)ValheimLevelSystem.Menu) && Object.op_Implicit((Object)(object)Player.m_localPlayer)) { if (GUIManager.Instance == null) { Debug.LogError((object)"GUIManager instance is null"); return; } if (!Object.op_Implicit((Object)(object)GUIManager.CustomGUIFront)) { Debug.LogError((object)"GUIManager CustomGUI is null"); return; } LoadMenu(); } ResetIfIncompatible(); if (ValheimLevelSystem.listInitiliazed) { UpdateAll(); } bool active = !ValheimLevelSystem.Menu.activeSelf; ValheimLevelSystem.Menu.SetActive(active); } public static void DestroyMenu() { ValheimLevelSystem.Menu.SetActive(false); } public static void LoadMenu() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Expected O, but got Unknown //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: 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_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: 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_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0333: 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_0374: Expected O, but got Unknown //IL_0395: 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_03bf: Unknown result type (might be due to invalid IL or missing references) //IL_03d5: Unknown result type (might be due to invalid IL or missing references) //IL_03db: Unknown result type (might be due to invalid IL or missing references) //IL_04b1: Unknown result type (might be due to invalid IL or missing references) //IL_04c0: Unknown result type (might be due to invalid IL or missing references) //IL_04d6: Unknown result type (might be due to invalid IL or missing references) //IL_04ec: Unknown result type (might be due to invalid IL or missing references) //IL_04f2: Unknown result type (might be due to invalid IL or missing references) //IL_0527: Unknown result type (might be due to invalid IL or missing references) //IL_0536: Unknown result type (might be due to invalid IL or missing references) //IL_054c: Unknown result type (might be due to invalid IL or missing references) //IL_0583: Unknown result type (might be due to invalid IL or missing references) //IL_058d: Expected O, but got Unknown //IL_05b3: Unknown result type (might be due to invalid IL or missing references) //IL_05c2: Unknown result type (might be due to invalid IL or missing references) //IL_05dd: Unknown result type (might be due to invalid IL or missing references) //IL_05f3: Unknown result type (might be due to invalid IL or missing references) //IL_05f9: Unknown result type (might be due to invalid IL or missing references) //IL_0675: Unknown result type (might be due to invalid IL or missing references) //IL_0684: Unknown result type (might be due to invalid IL or missing references) //IL_0693: Unknown result type (might be due to invalid IL or missing references) //IL_06a9: Unknown result type (might be due to invalid IL or missing references) //IL_06af: Unknown result type (might be due to invalid IL or missing references) //IL_0715: Unknown result type (might be due to invalid IL or missing references) //IL_0724: Unknown result type (might be due to invalid IL or missing references) //IL_0733: Unknown result type (might be due to invalid IL or missing references) //IL_0749: Unknown result type (might be due to invalid IL or missing references) //IL_074f: Unknown result type (might be due to invalid IL or missing references) //IL_07a0: Unknown result type (might be due to invalid IL or missing references) //IL_07af: Unknown result type (might be due to invalid IL or missing references) //IL_07be: Unknown result type (might be due to invalid IL or missing references) //IL_07d4: Unknown result type (might be due to invalid IL or missing references) //IL_07da: Unknown result type (might be due to invalid IL or missing references) //IL_082b: Unknown result type (might be due to invalid IL or missing references) //IL_083a: Unknown result type (might be due to invalid IL or missing references) //IL_0849: Unknown result type (might be due to invalid IL or missing references) //IL_085f: Unknown result type (might be due to invalid IL or missing references) //IL_0865: Unknown result type (might be due to invalid IL or missing references) //IL_08ac: Unknown result type (might be due to invalid IL or missing references) //IL_08bb: Unknown result type (might be due to invalid IL or missing references) //IL_08ca: Unknown result type (might be due to invalid IL or missing references) //IL_0900: Unknown result type (might be due to invalid IL or missing references) //IL_090a: Expected O, but got Unknown //IL_0929: Unknown result type (might be due to invalid IL or missing references) //IL_0938: Unknown result type (might be due to invalid IL or missing references) //IL_0947: Unknown result type (might be due to invalid IL or missing references) //IL_097d: Unknown result type (might be due to invalid IL or missing references) //IL_0987: Expected O, but got Unknown //IL_09a6: Unknown result type (might be due to invalid IL or missing references) //IL_09b5: Unknown result type (might be due to invalid IL or missing references) //IL_09c4: Unknown result type (might be due to invalid IL or missing references) //IL_09fa: Unknown result type (might be due to invalid IL or missing references) //IL_0a04: Expected O, but got Unknown if ((Object)(object)Player.m_localPlayer == (Object)null) { return; } ValheimLevelSystem.Menu = GUIManager.Instance.CreateWoodpanel(GUIManager.CustomGUIFront.transform, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(0f, 0f), 400f, 850f, true); ValheimLevelSystem.Menu.SetActive(false); GameObject val = GUIManager.Instance.CreateScrollView(ValheimLevelSystem.Menu.transform, false, true, 8f, 50f, GUIManager.Instance.ValheimScrollbarHandleColorBlock, new Color(0.1568628f, 0.1019608f, 0.0627451f, 1f), 350f, 300f); RectTransform val2 = (RectTransform)val.transform; val2.anchoredPosition = new Vector2(0f, -170f); val.SetActive(true); ((Component)val.transform.Find("Scroll View")).GetComponent<ScrollRect>().verticalNormalizedPosition = 1f; GameObject value = GUIManager.Instance.CreateText(Player.m_localPlayer.GetPlayerName(), ValheimLevelSystem.Menu.transform, new Vector2(0.5f, 1f), new Vector2(0.5f, 1f), new Vector2(-100f, -50f), GUIManager.Instance.AveriaSerifBold, 25, GUIManager.Instance.ValheimOrange, true, Color.black, 150f, 40f, false); GameObject value2 = GUIManager.Instance.CreateText("Level: " + Level.GetLevel(), ValheimLevelSystem.Menu.transform, new Vector2(0.5f, 1f), new Vector2(0.5f, 1f), new Vector2(120f, -50f), GUIManager.Instance.AveriaSerifBold, 25, GUIManager.Instance.ValheimOrange, true, Color.black, 150f, 40f, false); ValheimLevelSystem.menuItems.Add("levelText", value2); ValheimLevelSystem.menuItems.Add("nameText", value); int num = 0; List<GameObject> list = new List<GameObject>(); foreach (Skill skill in Enum.GetValues(typeof(Skill)).Cast<Skill>().ToList()) { int skillLevel = Level.GetSkillLevel(skill); GameObject val3 = GUIManager.Instance.CreateText(skill.ToString(), ValheimLevelSystem.Menu.transform, new Vector2(0.5f, 1f), new Vector2(0.5f, 1f), new Vector2(-100f, -240f + (float)(-28 * num)), GUIManager.Instance.AveriaSerifBold, 18, GUIManager.Instance.ValheimOrange, true, Color.black, 150f, 25f, false); GameObject val4 = GUIManager.Instance.CreateButton(" + ", ValheimLevelSystem.Menu.transform, new Vector2(0.5f, 1f), new Vector2(0.5f, 1f), new Vector2(110f, -237f + (float)(-28 * num)), 30f, 25f); val4.SetActive(true); Button component = val4.GetComponent<Button>(); ((UnityEvent)component.onClick).AddListener((UnityAction)delegate { SkillManager.SkillUp(skill); }); GameObject value3 = GUIManager.Instance.CreateText(skillLevel.ToString(), ValheimLevelSystem.Menu.transform, new Vector2(0.5f, 1f), new Vector2(0.5f, 1f), new Vector2(70f, -240f + (float)(-28 * num++)), GUIManager.Instance.AveriaSerifBold, 18, GUIManager.Instance.ValheimOrange, true, Color.black, 40f, 25f, false); ValheimLevelSystem.menuItems.Add(skill.ToString() + "Text", value3); } num = 0; foreach (PlayerAttribute playerAttribute in Enum.GetValues(typeof(PlayerAttribute)).Cast<PlayerAttribute>().ToList()) { int attributeLevel = Level.GetAttributeLevel(playerAttribute); GameObject val5 = GUIManager.Instance.CreateText(playerAttribute.ToString(), ValheimLevelSystem.Menu.transform, new Vector2(0.5f, 1f), new Vector2(0.5f, 1f), new Vector2(-100f, -130f + (float)(-28 * num)), GUIManager.Instance.AveriaSerifBold, 18, GUIManager.Instance.ValheimOrange, true, Color.black, 150f, 25f, false); GameObject val6 = GUIManager.Instance.CreateButton(" + ", ValheimLevelSystem.Menu.transform, new Vector2(0.5f, 1f), new Vector2(0.5f, 1f), new Vector2(110f, -127f + (float)(-28 * num)), 30f, 25f); val6.SetActive(true); Button component2 = val6.GetComponent<Button>(); ((UnityEvent)component2.onClick).AddListener((UnityAction)delegate { AttributeManager.SkillUp(playerAttribute); }); GameObject value4 = GUIManager.Instance.CreateText(Level.GetAttributeTotal(playerAttribute), ValheimLevelSystem.Menu.transform, new Vector2(0.5f, 1f), new Vector2(0.5f, 1f), new Vector2(70f, -130f + (float)(-28 * num++)), GUIManager.Instance.AveriaSerifBold, 18, GUIManager.Instance.ValheimOrange, true, Color.black, 40f, 25f, false); ValheimLevelSystem.menuItems.Add(playerAttribute.ToString() + "Text", value4); } GameObject val7 = GUIManager.Instance.CreateText("Available Effects:", ValheimLevelSystem.Menu.transform, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(-100f, 0f), GUIManager.Instance.AveriaSerifBold, 15, GUIManager.Instance.ValheimOrange, true, Color.black, 150f, 20f, false); CreateAvailableEffectListText(val); ((Component)val.transform.Find("Scroll View")).GetComponent<ScrollRect>().verticalNormalizedPosition = 1f; GameObject value5 = GUIManager.Instance.CreateText("Exp: " + Level.GetExpVerbose(), ValheimLevelSystem.Menu.transform, new Vector2(0.5f, 1f), new Vector2(0.5f, 1f), new Vector2(120f, -90f), GUIManager.Instance.AveriaSerifBold, 15, GUIManager.Instance.ValheimOrange, true, Color.black, 150f, 40f, false); ValheimLevelSystem.menuItems.Add("ExpText", value5); GameObject value6 = GUIManager.Instance.CreateText("Skill Points: " + Level.GetAvailablePoints(), ValheimLevelSystem.Menu.transform, new Vector2(0.5f, 1f), new Vector2(0.5f, 1f), new Vector2(-100f, -225f), GUIManager.Instance.AveriaSerifBold, 15, GUIManager.Instance.ValheimOrange, true, Color.black, 150f, 40f, false); ValheimLevelSystem.menuItems.Add("PlayerPointsAvailableText", value6); GameObject value7 = GUIManager.Instance.CreateText("Attribute Points: " + Level.GetAvailableAttributePoints(), ValheimLevelSystem.Menu.transform, new Vector2(0.5f, 1f), new Vector2(0.5f, 1f), new Vector2(-100f, -115f), GUIManager.Instance.AveriaSerifBold, 15, GUIManager.Instance.ValheimOrange, true, Color.black, 150f, 40f, false); ValheimLevelSystem.menuItems.Add("PlayerAttributePointsAvailableText", value7); GameObject val8 = GUIManager.Instance.CreateButton("Reset", ValheimLevelSystem.Menu.transform, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(140f, -375f), 80f, 30f); val8.SetActive(true); Button component3 = val8.GetComponent<Button>(); ((UnityEvent)component3.onClick).AddListener(new UnityAction(GUIConfirm.CreateResetSkillMenu)); GameObject val9 = GUIManager.Instance.CreateButton("Close", ValheimLevelSystem.Menu.transform, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(0f, -350f), 170f, 45f); val9.SetActive(true); Button component4 = val9.GetComponent<Button>(); ((UnityEvent)component4.onClick).AddListener(new UnityAction(DestroyMenu)); GameObject val10 = GUIManager.Instance.CreateButton(Level.GetSpecializationStr(), ValheimLevelSystem.Menu.transform, new Vector2(0.5f, 1f), new Vector2(0.5f, 1f), new Vector2(-125f, -75f), 100f, 30f); val8.SetActive(true); Button component5 = val10.GetComponent<Button>(); ((UnityEvent)component5.onClick).AddListener(new UnityAction(GUISpec.CreateSpecializationMenu)); ValheimLevelSystem.menuItems.Add("specButton", val10); } private static void CreateAvailableEffectListText(GameObject scrollView) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) GameObject value = GUIManager.Instance.CreateText("", scrollView.transform.Find("Scroll View/Viewport/Content"), new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(0f, 80f), GUIManager.Instance.AveriaSerifBold, 15, GUIManager.Instance.ValheimOrange, true, Color.black, 300f, 150f, false); ValheimLevelSystem.menuItems.Add("availableEffectsListText", value); SetAvailableEffectListText(); } private static void ResetIfIncompatible() { int skillLevel = Level.GetSkillLevel(Skill.Constitution); int skillLevel2 = Level.GetSkillLevel(Skill.Strength); int skillLevel3 = Level.GetSkillLevel(Skill.Agility); int skillLevel4 = Level.GetSkillLevel(Skill.Intelligence); int skillLevel5 = Level.GetSkillLevel(Skill.Focus); int skillLevel6 = Level.GetSkillLevel(Skill.Magic); int attributeLevel = Level.GetAttributeLevel(PlayerAttribute.Health); int attributeLevel2 = Level.GetAttributeLevel(PlayerAttribute.Stamina); int attributeLevel3 = Level.GetAttributeLevel(PlayerAttribute.Eitr); int num = skillLevel + skillLevel2 + skillLevel3 + skillLevel4 + skillLevel5 + skillLevel6; int num2 = attributeLevel + attributeLevel2 + attributeLevel3; int num3 = Convert.ToInt32(Level.GetAvailablePoints()); int num4 = Convert.ToInt32(Level.GetAvailableAttributePoints()); int num5 = Convert.ToInt32(Level.GetLevel()); int num6 = (int)Focus.getEffectValue(2); int specializationAttribute = SpecializationManager.getSpecializationAttribute(Level.GetSpecialization(), PlayerAttribute.Health); specializationAttribute += SpecializationManager.getSpecializationAttribute(Level.GetSpecialization(), PlayerAttribute.Stamina); specializationAttribute += SpecializationManager.getSpecializationAttribute(Level.GetSpecialization(), PlayerAttribute.Eitr); int value = ValheimLevelSystem.MaxLevel.Value; if (num5 > value) { GUILog.UpdateLog("Current level is above maximum level!"); Level.SetLevelMax(); Reset.ResetSkillsIgnorePenalty(); } int num7 = Convert.ToInt32(Level.GetHighestBossKill()) * ValheimLevelSystem.PointsPerBoss.Value; if (num5 * ValheimLevelSystem.PointsPerLevel.Value + ValheimLevelSystem.StartingPoints.Value != num3 + num || num5 * ValheimLevelSystem.AttributePointsPerLevel.Value + num7 + num6 + specializationAttribute != num4 + num2) { GUILog.UpdateLog("Skill points or attribute points impossible!"); Reset.ResetSkillsIgnorePenalty(); } } public static void SetAvailableEffectListText() { ValheimLevelSystem.menuItems.TryGetValue("availableEffectsListText", out var value); if (Object.op_Implicit((Object)(object)value)) { value.GetComponent<Text>().text = ""; SetStrengthAvailableEffectListText(value); SetAgilityAvailableEffectListText(value); SetIntelligenceAvailableEffectListText(value); SetFocusAvailableEffectListText(value); SetConstitutionAvailableEffectListText(value); SetMagicAvailableEffectListText(value); if (Level.GetSpecialization() != 0) { Text component = value.GetComponent<Text>(); component.text += SpecializationManager.SpecializationDescription(Level.GetSpecialization()); } } } private static void SetConstitutionAvailableEffectListText(GameObject txt) { int skillLevel = Level.GetSkillLevel(Skill.Constitution); if (skillLevel != 0) { Text component = txt.GetComponent<Text>(); component.text = component.text + "\n +" + Math.Round(Constitution.getEffectValue(0) * 100f, 2) + "% Health Regeneration"; if (skillLevel >= ValheimLevelSystem.FirstPerkLevel.Value) { Text component2 = txt.GetComponent<Text>(); component2.text = component2.text + "\n +" + Math.Round(Constitution.getEffectValue(1) * 100f, 2) + "% Armor"; } if (skillLevel >= ValheimLevelSystem.BonusSkillXPLevel.Value) { Text component3 = txt.GetComponent<Text>(); component3.text += "\n +Exp: Block, Polearm, Spear, Sword"; } if (skillLevel >= ValheimLevelSystem.SecondPerkLevel.Value) { Text component4 = txt.GetComponent<Text>(); component4.text = component4.text + "\n +" + Math.Round(Constitution.getEffectValue(2) * 100f, 2) + "% Stamina on parry"; } if (skillLevel >= ValheimLevelSystem.MasteryPerkLevel.Value) { Text component5 = txt.GetComponent<Text>(); component5.text = component5.text + "\n +Second Wind " + ((skillLevel >= ValheimLevelSystem.MasteryPlusPerkLevel.Value) ? "II " : "I ") + Math.Round(Constitution.getEffectValue(3) * 100f, 2) + "%"; } Text component6 = txt.GetComponent<Text>(); component6.text += "\n\n"; } } private static void SetFocusAvailableEffectListText(GameObject txt) { int skillLevel = Level.GetSkillLevel(Skill.Focus); if (skillLevel != 0) { Text component = txt.GetComponent<Text>(); component.text = component.text + " +" + Math.Round(Focus.getEffectValue(0) * 100f, 2) + "% Power, Mead, Food Duration"; if (skillLevel >= ValheimLevelSystem.FirstPerkLevel.Value) { Text component2 = txt.GetComponent<Text>(); component2.text = component2.text + "\n +" + (int)Focus.getEffectValue(1) + " Comfort"; } if (skillLevel >= ValheimLevelSystem.BonusSkillXPLevel.Value) { Text component3 = txt.GetComponent<Text>(); component3.text += "\n +Exp: Fish, Swim, Sneak, Ride"; } if (skillLevel >= ValheimLevelSystem.SecondPerkLevel.Value) { Text component4 = txt.GetComponent<Text>(); component4.text = component4.text + "\n +" + (int)Focus.getEffectValue(2) + " Attribute Points"; } if (skillLevel >= ValheimLevelSystem.MasteryPerkLevel.Value) { Text component5 = txt.GetComponent<Text>(); component5.text = component5.text + "\n +Navigation " + ((skillLevel >= ValheimLevelSystem.MasteryPlusPerkLevel.Value) ? "II" : "I"); } Text component6 = txt.GetComponent<Text>(); component6.text += "\n\n"; } } private static void SetIntelligenceAvailableEffectListText(GameObject txt) { int skillLevel = Level.GetSkillLevel(Skill.Intelligence); if (skillLevel != 0) { Text component = txt.GetComponent<Text>(); component.text = component.text + " +" + Math.Round(Intelligence.getEffectValue(0) * 100f, 2) + "% Stance effectiveness"; if (skillLevel >= ValheimLevelSystem.FirstPerkLevel.Value) { Text component2 = txt.GetComponent<Text>(); component2.text = component2.text + "\n +" + Math.Round(Intelligence.getEffectValue(1) * 100f, 2) + "% Skill effectiveness"; } if (skillLevel >= ValheimLevelSystem.BonusSkillXPLevel.Value) { Text component3 = txt.GetComponent<Text>(); component3.text += "\n +Exp: all skills"; } if (skillLevel >= ValheimLevelSystem.SecondPerkLevel.Value) { Text component4 = txt.GetComponent<Text>(); component4.text = component4.text + "\n -" + Math.Round((1f - Intelligence.getEffectValue(2)) * 100f, 2) + "% Power and Mead Cooldown"; } if (skillLevel >= ValheimLevelSystem.MasteryPerkLevel.Value) { Text component5 = txt.GetComponent<Text>(); component5.text = component5.text + "\n +Power Heal " + ((skillLevel >= ValheimLevelSystem.MasteryPlusPerkLevel.Value) ? "II " : "I ") + Math.Round(Intelligence.getEffectValue(3) * 100f, 2) + "%"; } Text component6 = txt.GetComponent<Text>(); component6.text += "\n\n"; } } private static void SetAgilityAvailableEffectListText(GameObject txt) { int skillLevel = Level.GetSkillLevel(Skill.Agility); if (skillLevel != 0) { Text component = txt.GetComponent<Text>(); component.text = component.text + " +" + Math.Round(Agility.getEffectValue(0) * 100f, 2) + "% Movement Speed"; if (skillLevel >= ValheimLevelSystem.FirstPerkLevel.Value) { Text component2 = txt.GetComponent<Text>(); component2.text = component2.text + "\n +" + Math.Round(Agility.getEffectValue(1) * 100f, 2) + "% Stamina Regeneration"; } if (skillLevel >= ValheimLevelSystem.BonusSkillXPLevel.Value) { Text component3 = txt.GetComponent<Text>(); component3.text += "\n +Exp: Run, Jump, Knife, Fist, Bow"; } if (skillLevel >= ValheimLevelSystem.SecondPerkLevel.Value) { Text component4 = txt.GetComponent<Text>(); component4.text = component4.text + "\n +" + Math.Round(Agility.getEffectValue(2) * 100f, 2) + "% Stamina on dodge"; } if (skillLevel >= ValheimLevelSystem.MasteryPerkLevel.Value) { Text component5 = txt.GetComponent<Text>(); component5.text = component5.text + "\n +Power Attack " + ((skillLevel >= ValheimLevelSystem.MasteryPlusPerkLevel.Value) ? "II " : "I ") + Math.Round(Agility.getEffectValue(3) * 100f, 2) + "%"; } Text component6 = txt.GetComponent<Text>(); component6.text += "\n\n"; } } private static void SetStrengthAvailableEffectListText(GameObject txt) { int skillLevel = Level.GetSkillLevel(Skill.Strength); if (skillLevel != 0) { Text component = txt.GetComponent<Text>(); component.text = component.text + " +" + (int)Strength.getEffectValue(0) + " Carry Weight"; if (skillLevel >= ValheimLevelSystem.FirstPerkLevel.Value) { Text component2 = txt.GetComponent<Text>(); component2.text = component2.text + "\n +" + Math.Round(Strength.getEffectValue(1) * 100f, 2) + "% Damage/Eitr Channel Strike"; } if (skillLevel >= ValheimLevelSystem.BonusSkillXPLevel.Value) { Text component3 = txt.GetComponent<Text>(); component3.text += "\n +Exp: Pickaxe, Axe, Club, Crossbow"; } if (skillLevel >= ValheimLevelSystem.SecondPerkLevel.Value) { Text component4 = txt.GetComponent<Text>(); component4.text = component4.text + "\n +" + Math.Round(Strength.getEffectValue(2) * 100f, 2) + "% Stagger Damage"; } if (skillLevel >= ValheimLevelSystem.MasteryPerkLevel.Value) { Text component5 = txt.GetComponent<Text>(); component5.text = component5.text + "\n +Critical Hit " + ((skillLevel >= ValheimLevelSystem.MasteryPlusPerkLevel.Value) ? "II " : "I ") + Math.Round(Strength.getEffectValue(3) * 100f, 2) + "%"; } Text component6 = txt.GetComponent<Text>(); component6.text += "\n\n"; } } private static void SetMagicAvailableEffectListText(GameObject txt) { int skillLevel = Level.GetSkillLevel(Skill.Magic); if (skillLevel != 0) { Text component = txt.GetComponent<Text>(); component.text = component.text + " +" + Math.Round(Magic.getEffectValue(0), 2) + " Damage/Eitr Elemental Imbue"; if (skillLevel >= ValheimLevelSystem.FirstPerkLevel.Value) { Text component2 = txt.GetComponent<Text>(); component2.text = component2.text + "\n +" + Math.Round(Magic.getEffectValue(1) * 100f, 2) + "% Eitr Regeneration"; } if (skillLevel >= ValheimLevelSystem.BonusSkillXPLevel.Value) { Text component3 = txt.GetComponent<Text>(); component3.text += "\n +Exp: Blood Magic, Elemental Magic"; } if (skillLevel >= ValheimLevelSystem.SecondPerkLevel.Value) { Text component4 = txt.GetComponent<Text>(); component4.text = component4.text + "\n +" + Math.Round((1f - Magic.getEffectValue(2)) * 100f, 2) + "% Elemental/Poison Resistance"; } if (skillLevel >= ValheimLevelSystem.MasteryPerkLevel.Value) { Text component5 = txt.GetComponent<Text>(); component5.text = component5.text + "\n +Alchemy " + ((skillLevel >= ValheimLevelSystem.MasteryPlusPerkLevel.Value) ? "II " : "I ") + Math.Round(Magic.getEffectValue(3) * 100f, 2) + "%"; } Text component6 = txt.GetComponent<Text>(); component6.text += "\n\n"; } } public static void UpdateAll() { UpdatePlayerPointsAvailable(); UpdateSkillLevels(); UpdateAttributeLevels(); UpdateExpText(); UpdatePlayerLevelText(); } public static void UpdatePlayerPointsAvailable() { ValheimLevelSystem.menuItems.TryGetValue("PlayerPointsAvailableText", out var value); if (Object.op_Implicit((Object)(object)value)) { value.GetComponent<Text>().text = "Skill Points: " + Level.GetAvailablePoints(); } } public static void UpdatePlayerAttributePointsAvailable() { ValheimLevelSystem.menuItems.TryGetValue("PlayerAttributePointsAvailableText", out var value); if (Object.op_Implicit((Object)(object)value)) { value.GetComponent<Text>().text = "Attribute Points: " + Level.GetAvailableAttributePoints(); } } public static void UpdateSkillLevels() { foreach (Skill value in Enum.GetValues(typeof(Skill))) { string name = Enum.GetName(typeof(Skill), value); string level = Level.GetSkillLevel(value).ToString(); UpdateSkillLevelText(name, level); } } public static void UpdateAttributeLevels() { foreach (PlayerAttribute value2 in Enum.GetValues(typeof(PlayerAttribute))) { string name = Enum.GetName(typeof(PlayerAttribute), value2); string attributeTotal = Level.GetAttributeTotal(value2); ValheimLevelSystem.menuItems.TryGetValue(name + "Text", out var value); if (Object.op_Implicit((Object)(object)value)) { value.GetComponent<Text>().text = attributeTotal + " " + name; } } } public static void UpdateSkillLevelText(string skill, string level) { ValheimLevelSystem.menuItems.TryGetValue(skill + "Text", out var value); if (Object.op_Implicit((Object)(object)value)) { value.GetComponent<Text>().text = level + " " + skill; } SetAvailableEffectListText(); } public static void UpdateExpText() { ValheimLevelSystem.menuItems.TryGetValue("ExpText", out var value); if (Object.op_Implicit((Object)(object)value)) { value.GetComponent<Text>().text = "Exp: " + Level.GetExpVerbose(); } } public static void UpdatePlayerLevelText() { ValheimLevelSystem.menuItems.TryGetValue("levelText", out var value); if (Object.op_Implicit((Object)(object)value)) { value.GetComponent<Text>().text = "Level: " + Level.GetLevel(); } ValheimLevelSystem.menuItems.TryGetValue("nameText", out var value2); value2.GetComponent<Text>().text = Player.m_localPlayer.GetPlayerName(); ValheimLevelSystem.menuItems.TryGetValue("specButton", out var value3); value3.GetComponentInChildren<Text>().text = Level.GetSpecializationStr(); } } [HarmonyPatch] public class RPC { [HarmonyPrefix] [HarmonyPatch(typeof(Game), "Start")] public static void Prefix() { ZRoutedRpc.instance.Register<ZPackage>("RaiseExp", (Action<long, ZPackage>)RPC_RaiseExp); ZRoutedRpc.instance.Register<ZPackage>("RaiseExpPick", (Action<long, ZPackage>)RPC_RaiseExpPick); ZRoutedRpc.instance.Register<ZPackage>("RaiseExpMine", (Action<long, ZPackage>)RPC_RaiseExpMine); ZRoutedRpc.instance.Register<ZPackage>("RaiseExpChop", (Action<long, ZPackage>)RPC_RaiseExpChop); ZRoutedRpc.instance.Register<ZPackage>("RaiseExpFish", (Action<long, ZPackage>)RPC_RaiseExpFish); } public static void RPC_RaiseExpPick(long sender, ZPackage pkg) { if (!Object.op_Implicit((Object)(object)Player.m_localPlayer)) { return; } string[] array = pkg.ReadString().Split(new char[1] { ',' }); string pickedname = array[0]; int num = Convert.ToInt32(array[1]); pickedname = pickedname.Replace("(Clone)", ""); PickableExp pickableExp = ExpTable.PickableExpList.Where((PickableExp xx) => xx.Name.ToLower() == pickedname.ToLower()).FirstOrDefault(); if (pickableExp == null) { Debug.Log((object)("Unable to find pickable in ExpList: " + pickedname)); return; } int expAmount = pickableExp.ExpAmount; if (((Object)Player.m_localPlayer).GetInstanceID() == num) { Level.RaiseExpWork(expAmount); } } public static void RPC_RaiseExpMine(long sender, ZPackage pkg) { if (!Object.op_Implicit((Object)(object)Player.m_localPlayer)) { return; } string[] array = pkg.ReadString().Split(new char[1] { ',' }); string minedname = array[0]; int num = Convert.ToInt32(array[1]); minedname = minedname.Replace("(Clone)", ""); MineableExp mineableExp = ExpTable.MineableExpList.Where((MineableExp xx) => xx.Name.ToLower() == minedname.ToLower()).FirstOrDefault(); if (mineableExp == null) { if (minedname.ToLower().Contains("rock")) { mineableExp = ExpTable.MineableExpList.Where((MineableExp xx) => xx.Name.ToLower() == "rock".ToLower()).FirstOrDefault(); } if (mineableExp == null) { Debug.Log((object)("Unable to find mineable in ExpList: " + minedname)); return; } } int expAmount = mineableExp.ExpAmount; if (((Object)Player.m_localPlayer).GetInstanceID() == num) { Level.RaiseExpWork(expAmount); } } public static void RPC_RaiseExpChop(long sender, ZPackage pkg) { if (!Object.op_Implicit((Object)(object)Player.m_localPlayer)) { return; } string[] array = pkg.ReadString().Split(new char[1] { ',' }); string choppedname = array[0]; int num = Convert.ToInt32(array[1]); choppedname = choppedname.Replace("(Clone)", ""); ChoppableExp choppableExp = ExpTable.ChoppableExpList.Where((ChoppableExp xx) => choppedname.ToLower().Contains(xx.Name.ToLower())).FirstOrDefault(); if (choppableExp == null) { Debug.Log((object)("Unable to find choppable in ExpList: " + choppedname)); return; } int expAmount = choppableExp.ExpAmount; if (((Object)Player.m_localPlayer).GetInstanceID() == num) { Level.RaiseExpWork(expAmount); } } public static void RPC_RaiseExpFish(long sender, ZPackage pkg) { if (!Object.op_Implicit((Object)(object)Player.m_localPlayer)) { return; } string[] array = pkg.ReadString().Split(new char[1] { ',' }); string fishname = array[0]; int num = Convert.ToInt32(array[1]); int num2 = Convert.ToInt32(array[2]); FishableExp fishableExp = ExpTable.FishableExpList.Where((FishableExp xx) => fishname.ToLower().Contains(xx.Name.ToLower())).FirstOrDefault(); if (fishableExp == null) { Debug.Log((object)("Unable to find fishable in ExpList: " + fishname)); return; } int expToGive = (int)Math.Round((float)fishableExp.ExpAmount * (1f + ValheimLevelSystem.FishingQualityMultiplier.Value * (float)(num - 1))); if (((Object)Player.m_localPlayer).GetInstanceID() == num2) { Level.RaiseExpBase(expToGive); } } public static void RPC_RaiseExp(long sender, ZPackage pkg) { //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Invalid comparison between Unknown and I4 //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_0285: Invalid comparison between Unknown and I4 if (!Object.op_Implicit((Object)(object)Player.m_localPlayer)) { return; } string[] array = pkg.ReadString().Split(new char[1] { ',' }); int num = Convert.ToInt32(array[0]); int num2 = Convert.ToInt32(array[1]); int num3 = Convert.ToInt32(array[2]); string name = array[3]; int level = Convert.ToInt32(array[4]); bool flag = Convert.ToBoolean(array[5]); if ((double)Vector3.Distance(new Vector3((float)num, (float)num2, (float)num3), ((Component)Player.m_localPlayer).transform.position) >= (double)ValheimLevelSystem.RangeToDivideExp.Value) { return; } name = name.Replace("(Clone)", ""); MonsterExp monsterExp = ExpTable.MonsterExpList.Where((MonsterExp xx) => xx.Name.ToLower() == name.ToLower()).FirstOrDefault(); if (monsterExp == null) { Debug.Log((object)("Unable to find creature in ExpList: " + name)); return; } Character component = PrefabManager.Instance.GetPrefab(name).GetComponent<Character>(); if ((int)component.m_faction == 8) { switch (name.ToLower()) { case "eikthyr": Level.IncreaseHighestBossKill(1); break; case "gd_king": Level.IncreaseHighestBossKill(2); break; case "bonemass": Level.IncreaseHighestBossKill(3); break; case "dragon": Level.IncreaseHighestBossKill(4); break; case "goblinking": Level.IncreaseHighestBossKill(5); break; case "seekerqueen": Level.IncreaseHighestBossKill(6); break; case "fader": Level.IncreaseHighestBossKill(7); break; } } int num4 = monsterExp.ExpAmount; if (!flag) { num4 /= ValheimLevelSystem.ExpToDivideWhenNotKilledByPlayer.Value; } Level.RaiseExpWithValues(num4, level, (int)component.m_faction == 8); } } [BepInPlugin("Lorska.ValheimLevelSystem", "Lorska.ValheimLevelSystem", "0.9.5.2")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] public class ValheimLevelSystem : BaseUnityPlugin { [HarmonyPatch(typeof(Game), "Logout")] public static class Logout { private static void Postfix() { hasAwake = false; } } [HarmonyPatch(typeof(Game), "Shutdown")] public static class Shutdown { private static void Prefix() { GUILog.saveLocation(); } } [HarmonyPatch(typeof(Player), "OnSpawned")] public static class OnSpawned { private static void Postfix() { if (!hasAwake) { hasAwake = true; Level.InitLevelRequirementList(); ExpTable.InitMonsterExpList(); ExpTable.InitPickableExpList(); ExpTable.InitMineableExpList(); ExpTable.InitChoppableExpList(); ExpTable.InitFishableExpList(); GUI.LoadMenu(); GUIXP.CreateXPBar(); GUILog.CreateLogWindow(); if (!Level.StanceActive && (Level.GetSpecialization() == PlayerSpecialization.Ritualist || Level.GetSpecialization() == PlayerSpecialization.Torturer)) { Level.ToggleStance(); } } } } public const string PluginGUID = "Lorska.ValheimLevelSystem"; public const string Name = "ValheimLevelSystem"; public const string Version = "0.9.5.2"; public static bool listInitiliazed = false; public static string PlayerName = ""; public static List<string> PotionToReduceCooldownNameList = new List<string>(new string[0]); public static List<string> PotionToIncreaseTimeNameList = new List<string>(new string[0]); public static List<string> PotionNameList = new List<string>(new string[0]); public static List<string> PotionAlchemyList = new List<string>(new string[0]); public static Dictionary<string, GameObject> menuItems = new Dictionary<string, GameObject>(); public static ConfigEntry<bool> RunSpeedFix; public static ConfigEntry<float> ExpRate; public static ConfigEntry<float> ExpRateWork; public static ConfigEntry<float> ExpPercentageBonusPerStar; public static ConfigEntry<int> ExpToDivideWhenNotKilledByPlayer; public static ConfigEntry<bool> OnlyGiveExpIfDamageComesFromPlayer; public static ConfigEntry<int> StartingPoints; public static ConfigEntry<int> MaxLevel; public static ConfigEntry<int> BreakPoint; public static ConfigEntry<int> FirstPerkLevel; public static ConfigEntry<int> SecondPerkLevel; public static ConfigEntry<int> BonusSkillXPLevel; public static ConfigEntry<int> MasteryPerkLevel; public static ConfigEntry<int> MasteryPlusPerkLevel; public static ConfigEntry<int> AttributePointsPerLevel; public static ConfigEntry<int> PointsPerLevel; public static ConfigEntry<int> PointsPerBoss; public static ConfigEntry<int> BaseExpPerLevel; public static ConfigEntry<int> RangeToDivideExp; public static ConfigEntry<float> ExpPercentageToLoseOnDeath; public static ConfigEntry<float> ExpMultiplierPerLevel; public static ConfigEntry<KeyCode> KeyboardShortcut; public static ConfigEntry<KeyCode> KeyboardShortcutStance; public static ConfigEntry<KeyCode> KeyboardShortcutLog; public static ConfigEntry<KeyCode> KeyboardShortcutImbue; public static ConfigEntry<int> LogEntries; public static ConfigEntry<float> StanceCD; public static ConfigEntry<int> Tier1Exp; public static ConfigEntry<int> Tier2Exp; public static ConfigEntry<int> Tier3Exp; public static ConfigEntry<int> Tier4Exp; public static ConfigEntry<int> Tier5Exp; public static ConfigEntry<int> Tier6Exp; public static ConfigEntry<int> Tier7Exp; public static ConfigEntry<int> Tier8Exp; public static ConfigEntry<int> BossExpMultiplier; public static ConfigEntry<float> FishingQualityMultiplier; public static ConfigEntry<string> Tier1Creatures; public static ConfigEntry<string> Tier2Creatures; public static ConfigEntry<string> Tier3Creatures; public static ConfigEntry<string> Tier4Creatures; public static ConfigEntry<string> Tier5Creatures; public static ConfigEntry<string> Tier6Creatures; public static ConfigEntry<string> Tier7Creatures; public static ConfigEntry<string> Tier8Creatures; public static ConfigEntry<string> Tier1Pickables; public static ConfigEntry<string> Tier2Pickables; public static ConfigEntry<string> Tier3Pickables; public static ConfigEntry<string> Tier4Pickables; public static ConfigEntry<string> Tier5Pickables; public static ConfigEntry<string> Tier6Pickables; public static ConfigEntry<string> Tier7Pickables; public static ConfigEntry<string> Tier1Mineables; public static ConfigEntry<string> Tier2Mineables; public static ConfigEntry<string> Tier3Mineables; public static ConfigEntry<string> Tier4Mineables; public static ConfigEntry<string> Tier6Mineables; public static ConfigEntry<string> Tier7Mineables; public static ConfigEntry<string> Tier1Choppables; public static ConfigEntry<string> Tier2Choppables; public static ConfigEntry<string> Tier3Choppables; public static ConfigEntry<string> Tier6Choppables; public static ConfigEntry<string> Tier7Choppables; public static ConfigEntry<string> Tier2Fishables; public static ConfigEntry<string> Tier3Fishables; public static ConfigEntry<string> Tier4Fishables; public static ConfigEntry<string> Tier5Fishables; public static ConfigEntry<string> Tier6Fishables; public static ConfigEntry<float> AllSkillsExpRate; public static ConfigEntry<float> AxeExpRate; public static ConfigEntry<float> BlockExpRate; public static ConfigEntry<float> BloodExpRate; public static ConfigEntry<float> BowExpRate; public static ConfigEntry<float> ClubExpRate; public static ConfigEntry<float> CrossExpRate; public static ConfigEntry<float> ElemExpRate; public static ConfigEntry<float> FishExpRate; public static ConfigEntry<float> JumpExpRate; public static ConfigEntry<float> KnifeExpRate; public static ConfigEntry<float> PickExpRate; public static ConfigEntry<float> PoleExpRate; public static ConfigEntry<float> RideExpRate; public static ConfigEntry<float> RunExpRate; public static ConfigEntry<float> SneakExpRate; public static ConfigEntry<float> SpearExpRate; public static ConfigEntry<float> SwimExpRate; public static ConfigEntry<float> SwordExpRate; public static ConfigEntry<float> UnarmedExpRate; public static ConfigEntry<float> WoodExpRate; public static ConfigEntry<string> AllPotions; public static ConfigEntry<string> DurationPotions; public static ConfigEntry<string> CDPotions; public static ConfigEntry<string> EnhancedPotions; public static List<string> playerSkills = new List<string>(new string[6] { "Strength", "Agility", "Intelligence", "Constitution", "Focus", "Magic" }); private Harmony harmony = new Harmony("Lorska.ValheimLevelSystem"); public static GameObject Menu; public static bool hasAwake = false; public void Awake() { ((object)GUIManager.Instance).GetType(); ((BaseUnityPlugin)this).Config.SaveOnConfigSet = true; InitConfigs(); SynchronizationManager.OnConfigurationSynchronized += delegate(object obj, ConfigurationSynchronizationEventArgs attr) { if (attr.InitialSynchronization) { Logger.LogMessage((object)"Initial Config sync event received"); } else { Logger.LogMessage((object)"Config sync event received"); } }; harmony.PatchAll(); ExpTable.InitMonsterExpList(); ExpTable.InitPickableExpList(); ExpTable.InitMineableExpList(); ExpTable.InitChoppableExpList(); ExpTable.InitFishableExpList(); PotionToReduceCooldownNameList = CDPotions.Value.Split(new char[1] { ',' }).ToList(); PotionToIncreaseTimeNameList = DurationPotions.Value.Split(new char[1] { ',' }).ToList(); PotionNameList = AllPotions.Value.Split(new char[1] { ',' }).ToList(); PotionAlchemyList = EnhancedPotions.Value.Split(new char[1] { ',' }).ToList(); } private void Update() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) Player localPlayer = Player.m_localPlayer; if (Input.GetKeyDown(KeyboardShortcut.Value) && !blockInput()) { if (!Object.op_Implicit((Object)(object)localPlayer) || ((Character)localPlayer).IsDead() || ((Character)localPlayer).InCutscene() || ((Character)localPlayer).IsTeleporting()) { return; } GUI.ToggleMenu(); } if (Input.GetKeyDown(KeyboardShortcutStance.Value) && !blockInput()) { if (!Object.op_Implicit((Object)(object)localPlayer) || ((Character)localPlayer).IsDead() || ((Character)localPlayer).InCutscene() || ((Character)localPlayer).IsTeleporting()) { return; } Level.ToggleStance(); } if (Input.GetKeyDown(KeyboardShortcutLog.Value) && !blockInput()) { if (!Object.op_Implicit((Object)(object)localPlayer) || ((Character)localPlayer).IsDead() || ((Character)localPlayer).InCutscene() || ((Character)localPlayer).IsTeleporting()) { return; } GUILog.toggle(); } if (Input.GetKeyDown(KeyboardShortcutImbue.Value) && !blockInput()) { if (!Object.op_Implicit((Object)(object)localPlayer) || ((Character)localPlayer).IsDead() || ((Character)localPlayer).InCutscene() || ((Character)localPlayer).IsTeleporting() || Level.GetSkillLevel(Skill.Magic) == 0) { return; } Magic.imbueActive = !Magic.imbueActive; GUILog.UpdateLog("Imbue Weapon " + (Magic.imbueActive ? "active" : "inactive")); } if (Input.GetKeyDown((KeyCode)27)) { GUI.DestroyMenu(); } } public static bool blockInput() { return Minimap.IsOpen() || Console.IsVisible() || TextInput.IsVisible() || ((Object)(object)Chat.instance != (Object)null && Chat.instance.HasFocus()); } public void InitConfigs() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Expected O, but got Unknown //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Expected O, but got Unknown //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Expected O, but got Unknown //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Expected O, but got Unknown //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Expected O, but got Unknown //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Expected O, but got Unknown //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Expected O, but got Unknown //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Expected O, but got Unknown //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Expected O, but got Unknown //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Expected O, but got Unknown //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Expected O, but got Unknown //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Expected O, but got Unknown //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Expected O, but got Unknown //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Expected O, but got Unknown //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_0276: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Expected O, but got Unknown //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Expected O, but got Unknown //IL_02b4: Unknown result type (might be due to invalid IL or missing references) //IL_02b9: Unknown result type (might be due to invalid IL or missing references) //IL_02c2: Expected O, but got Unknown //IL_02c2: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Expected O, but got Unknown //IL_02f7: Unknown result type (might be due to invalid IL or missing references) //IL_02fc: Unknown result type (might be due to invalid IL or missing references) //IL_0305: Expected O, but got Unknown //IL_0305: Unknown result type (might be due to invalid IL or missing references) //IL_030f: Expected O, but got Unknown //IL_033d: Unknown result type (might be due to invalid IL or missing references) //IL_0342: Unknown result type (might be due to invalid IL or missing references) //IL_034b: Expected O, but got Unknown //IL_034b: Unknown result type (might be due to invalid IL or missing references) //IL_0355: Expected O, but got Unknown //IL_0383: Unknown result type (might be due to invalid IL or missing references) //IL_0388: Unknown result type (might be due to invalid IL or missing references) //IL_0391: Expected O, but got Unknown //IL_0391: Unknown result type (might be due to invalid IL or missing references) //IL_039b: Expected O, but got Unknown //IL_03c9: Unknown result type (might be due to invalid IL or missing references) //IL_03ce: Unknown result type (might be due to invalid IL or missing references) //IL_03d7: Expected O, but got Unknown //IL_03d7: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Expected O, but got Unknown //IL_0410: Unknown result type (might be due to invalid IL or missing references) //IL_0415: Unknown result type (might be due to invalid IL or missing references) //IL_041e: Expected O, but got Unknown //IL_041e: Unknown result type (might be due to invalid IL or missing references) //IL_0428: Expected O, but got Unknown //IL_0457: Unknown result type (might be due to invalid IL or missing references) //IL_045c: Unknown result type (might be due to invalid IL or missing references) //IL_0465: Expected O, but got Unknown //IL_0465: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Expected O, but got Unknown //IL_049e: Unknown result type (might be due to invalid IL or missing references) //IL_04a3: Unknown result type (might be due to invalid IL or missing references) //IL_04ac: Expected O, but got Unknown //IL_04ac: Unknown result type (might be due to invalid IL or missing references) //IL_04b6: Expected O, but got Unknown //IL_04e5: Unknown result type (might be due to invalid IL or missing references) //IL_04ea: Unknown result type (might be due to invalid IL or missing references) //IL_04f3: Expected O, but got Unknown //IL_04f3: Unknown result type (might be due to invalid IL or missing references) //IL_04fd: Expected O, but got Unknown //IL_052c: Unknown result type (might be due to invalid IL or missing references) //IL_0531: Unknown result type (might be due to invalid IL or missing references) //IL_053a: Expected O, but got Unknown //IL_053a: Unknown result type (might be due to invalid IL or missing references) //IL_0544: Expected O, but got Unknown //IL_0573: Unknown result type (might be due to invalid IL or missing references) //IL_0578: Unknown result type (might be due to invalid IL or missing references) //IL_0581: Expected O, but got Unknown //IL_0581: Unknown result type (might be due to invalid IL or missing references) //IL_058b: Expected O, but got Unknown //IL_05ba: Unknown result type (might be due to invalid IL or missing references) //IL_05bf: Unknown result type (might be due to invalid IL or missing references) //IL_05c8: Expected O, but got Unknown //IL_05c8: Unknown result type (might be due to invalid IL or missing references) //IL_05d2: Expected O, but got Unknown //IL_0601: Unknown result type (might be due to invalid IL or missing references) //IL_0606: Unknown result type (might be due to invalid IL or missing references) //IL_060f: Expected O, but got Unknown //IL_060f: Unknown result type (might be due to invalid IL or missing references) //IL_0619: Expected O, but got Unknown //IL_064f: Unknown result type (might be due to invalid IL or missing references) //IL_0654: Unknown result type (might be due to invalid IL or missing references) //IL_065d: Expected O, but got Unknown //IL_065d: Unknown result type (might be due to invalid IL or missing references) //IL_0667: Expected O, but got Unknown //IL_068c: Unknown result type (might be due to invalid IL or missing references) //IL_0691: Unknown result type (might be due to invalid IL or missing references) //IL_069a: Expected O, but got Unknown //IL_069a: Unknown result type (might be due to invalid IL or missing references) //IL_06a4: Expected O, but got Unknown //IL_06c9: Unknown result type (might be due to invalid IL or missing references) //IL_06ce: Unknown result type (might be due to invalid IL or missing references) //IL_06d7: Expected O, but got Unknown //IL_06d7: Unknown result type (might be due to invalid IL or missing references) //IL_06e1: Expected O, but got Unknown //IL_0706: Unknown result type (might be due to invalid IL or missing references) //IL_070b: Unknown result type (might be due to invalid IL or missing references) //IL_0714: Expected O, but got Unknown //IL_0714: Unknown result type (might be due to invalid IL or missing references) //IL_071e: Expected O, but got Unknown //IL_0743: Unknown result type (might be due to invalid IL or missing references) //IL_0748: Unknown result type (might be due to invalid IL or missing references) //IL_0751: Expected O, but got Unknown //IL_0751: Unknown result type (might be due to invalid IL or missing references) //IL_075b: Expected O, but got Unknown //IL_0787: Unknown result type (might be due to invalid IL or missing references) //IL_078c: Unknown result type (might be due to invalid IL or missing references) //IL_0795: Expected O, but got Unknown //IL_0795: Unknown result type (might be due to invalid IL or missing references) //IL_079f: Expected O, but got Unknown //IL_07d5: Unknown result type (might be due to invalid IL or missing references) //IL_07da: Unknown result type (might be due to invalid IL or missing references) //IL_07e3: Expected O, but got Unknown //IL_07e3: Unknown result type (might be due to invalid IL or missing references) //IL_07ed: Expected O, but got Unknown //IL_081b: Unknown result type (might be due to invalid IL or missing references) //IL_0820: Unknown result type (might be due to invalid IL or missing references) //IL_0829: Expected O, but got Unknown //IL_0829: Unknown result type (might be due to invalid IL or missing references) //IL_0833: Expected O, but got Unknown //IL_085b: Unknown result type (might be due to invalid IL or missing references) //IL_0860: Unknown result type (might be due to invalid IL or missing references) //IL_0869: Expected O, but got Unknown //IL_0869: Unknown result type (might be due to invalid IL or missing references) //IL_0873: Expected O, but got Unknown //IL_089b: Unknown result type (might be due to invalid IL or missing references) //IL_08a0: Unknown result type (might be due to invalid IL or missing references) //IL_08a9: Expected O, but got Unknown //IL_08a9: Unknown result type (might be due to invalid IL or missing references) //IL_08b3: Expected O, but got Unknown //IL_08db: Unknown result type (might be due to invalid IL or missing references) //IL_08e0: Unknown result type (might be due to invalid IL or missing references) //IL_08e9: Expected O, but got Unknown //IL_08e9: Unknown result type (might be due to invalid IL or missing references) //IL_08f3: Expected O, but got Unknown //IL_091b: Unknown result type (might be due to invalid IL or missing references) //IL_0920: Unknown result type (might be due to invalid IL or missing references) //IL_0929: Expected O, but got Unknown //IL_0929: Unknown result type (might be due to invalid IL or missing references) //IL_0933: Expected O, but got Unknown //IL_0962: Unknown result type (might be due to invalid IL or missing references) //IL_0967: Unknown result type (might be due to invalid IL or missing references) //IL_0970: Expected O, but got Unknown //IL_0970: Unknown result type (might be due to invalid IL or missing references) //IL_097a: Expected O, but got Unknown //IL_09a2: Unknown result type (might be due to invalid IL or missing references) //IL_09a7: Unknown result type (might be due to invalid IL or missing references) //IL_09b0: Expected O, but got Unknown //IL_09b0: Unknown result type (might be due to invalid IL or missing references) //IL_09ba: Expected O, but got Unknown //IL_09e2: Unknown result type (might be due to invalid IL or missing references) //IL_09e7: Unknown result type (might be due to invalid IL or missing references) //IL_09f0: Expected O, but got Unknown //IL_09f0: Unknown result type (might be due to invalid IL or missing references) //IL_09fa: Expected O, but got Unknown //IL_0a22: Unknown result type (might be due to invalid IL or missing references) //IL_0a27: Unknown result type (might be due to invalid IL or missing references) //IL_0a30: Expected O, but got Unknown //IL_0a30: Unknown result type (might be due to invalid IL or missing references) //IL_0a3a: Expected O, but got Unknown //IL_0a62: Unknown result type (might be due to invalid IL or missing references) //IL_0a67: Unknown result type (might be due to invalid IL or missing references) //IL_0a70: Expected O, but got Unknown //IL_0a70: Unknown result type (might be due to invalid IL or missing references) //IL_0a7a: Expected O, but got Unknown //IL_0aa9: Unknown result type (might be due to invalid IL or missing references) //IL_0aae: Unknown result type (might be due to invalid IL or missing references) //IL_0ab7: Expected O, but got Unknown //IL_0ab7: Unknown result type (might be due to invalid IL or missing references) //IL_0ac1: Expected O, but got Unknown //IL_0ae9: Unknown result type (might be due to invalid IL or missing references) //IL_0aee: Unknown result type (might be due to invalid IL or missing references) //IL_0af7: Expected O, but got Unknown //IL_0af7: Unknown result type (might be due to invalid IL or missing references) //IL_0b01: Expected O, but got Unknown //IL_0b29: Unknown result type (might be due to invalid IL or missing references) //IL_0b2e: Unknown result type (might be due to invalid IL or missing references) //IL_0b37: Expected O, but got Unknown //IL_0b37: Unknown result type (might be due to invalid IL or missing references) //IL_0b41: Expected O, but got Unknown //IL_0b69: Unknown result type (might be due to invalid IL or missing references) //IL_0b6e: Unknown result type (might be due to invalid IL or missing references) //IL_0b77: Expected O, but got Unknown //IL_0b77: Unknown result type (might be due to invalid IL or missing references) //IL_0b81: Expected O, but got Unknown //IL_0ba9: Unknown result type (might be due to invalid IL or missing references) //IL_0bae: Unknown result type (might be due to invalid IL or missing references) //IL_0bb7: Expected O, but got Unknown //IL_0bb7: Unknown result type (might be due to invalid IL or missing references) //IL_0bc1: Expected O, but got Unknown //IL_0bf0: Unknown result type (might be due to invalid IL or missing references) //IL_0bf5: Unknown result type (might be due to invalid IL or missing references) //IL_0bfe: Expected O, but got Unknown //IL_0bfe: Unknown result type (might be due to invalid IL or missing references) //IL_0c08: Expected O, but got Unknown //IL_0c30: Unknown result type (might be due to invalid IL or missing references) //IL_0c35: Unknown result type (might be due to invalid IL or missing references) //IL_0c3e: Expected O, but got Unknown //IL_0c3e: Unknown result type (might be due to invalid IL or missing references) //IL_0c48: Expected O, but got Unknown //IL_0c70: Unknown result type (might be due to invalid IL or missing references) //IL_0c75: Unknown result type (might be due to invalid IL or missing references) //IL_0c7e: Expected O, but got Unknown //IL_0c7e: Unknown result type (might be due to invalid IL or missing references) //IL_0c88: Expected O, but got Unknown //IL_0cb0: Unknown result type (might be due to invalid IL or missing references) //IL_0cb5: Unknown result type (might be due to invalid IL or missing references) //IL_0cbe: Expected O, but got Unknown //IL_0cbe: Unknown result type (might be due to invalid IL or missing references) //IL_0cc8: Expected O, but got Unknown //IL_0cfa: Unknown result type (might be due to invalid IL or missing references) //IL_0cff: Unknown result type (might be due to invalid IL or missing references) //IL_0d08: Expected O, but got Unknown //IL_0d08: Unknown result type (might be due to invalid IL or missing