Decompiled source of z0rderEpicMMOSystem v1.1.2
EpicMMOSystem.dll
Decompiled 10 months ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Concurrent; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Collections.Specialized; using System.ComponentModel; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Dynamic; using System.Globalization; using System.IO; using System.IO.Compression; using System.Linq; using System.Linq.Expressions; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Serialization; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using System.Text.RegularExpressions; using System.Xml.Serialization; using API; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using CreatureLevelControl; using EpicMMOSystem; using EpicMMOSystem.Gui; using EpicMMOSystem.MonoScripts; using EpicMMOSystem.OdinWrath; using EpicMMOSystem.OtherApi; using Groups; using HarmonyLib; using ItemManager; using JetBrains.Annotations; using LocalizationManager; using Microsoft.CodeAnalysis; using PieceManager; using ServerSync; using StatusEffectManager; using TMPro; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.UI; using YamlDotNet.Core; using YamlDotNet.Core.Events; using YamlDotNet.Core.Tokens; using YamlDotNet.Helpers; using YamlDotNet.Serialization; using YamlDotNet.Serialization.Converters; using YamlDotNet.Serialization.EventEmitters; using YamlDotNet.Serialization.NamingConventions; using YamlDotNet.Serialization.NodeDeserializers; using YamlDotNet.Serialization.NodeTypeResolvers; using YamlDotNet.Serialization.ObjectFactories; using YamlDotNet.Serialization.ObjectGraphTraversalStrategies; using YamlDotNet.Serialization.ObjectGraphVisitors; using YamlDotNet.Serialization.Schemas; using YamlDotNet.Serialization.TypeInspectors; using YamlDotNet.Serialization.TypeResolvers; using YamlDotNet.Serialization.Utilities; using YamlDotNet.Serialization.ValueDeserializers; using fastJSON; [assembly: Guid("4358610B-F3F4-4843-B7AF-98B7BC60DCDE")] [assembly: ComVisible(false)] [assembly: AssemblyTrademark("")] [assembly: AssemblyCopyright("Copyright © 2022")] [assembly: AssemblyProduct("EpicMMOSystem")] [assembly: AssemblyCompany("z0rderWackyMole")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyDescription("")] [assembly: AssemblyTitle("EpicMMOSystem")] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: CompilationRelaxations(8)] [assembly: AssemblyFileVersion("1.1.2")] [assembly: AssemblyConfiguration("")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.1.2.0")] [module: UnverifiableCode] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [<b72c47c7-f577-45a0-bf66-ceb43b6f6c4f>Embedded] internal sealed class <b72c47c7-f577-45a0-bf66-ceb43b6f6c4f>EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] [<b72c47c7-f577-45a0-bf66-ceb43b6f6c4f>Embedded] [CompilerGenerated] internal sealed class <28f2501a-2654-4601-a73e-34b637b0459d>NullableAttribute : Attribute { public readonly byte[] NullableFlags; public <28f2501a-2654-4601-a73e-34b637b0459d>NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public <28f2501a-2654-4601-a73e-34b637b0459d>NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [<b72c47c7-f577-45a0-bf66-ceb43b6f6c4f>Embedded] [CompilerGenerated] internal sealed class <8e82bed1-12f2-4cdb-baa0-fc8d4271746a>NullableContextAttribute : Attribute { public readonly byte Flag; public <8e82bed1-12f2-4cdb-baa0-fc8d4271746a>NullableContextAttribute(byte P_0) { Flag = P_0; } } } [<28f2501a-2654-4601-a73e-34b637b0459d>Nullable(0)] [<8e82bed1-12f2-4cdb-baa0-fc8d4271746a>NullableContext(1)] public class ColorUtil { public static Color GetColorFromHex(string hex) { //IL_00a3: Unknown result type (might be due to invalid IL or missing references) hex = hex.TrimStart(new char[1] { '#' }); Color result = default(Color); ((Color)(ref result))..ctor(255f, 0f, 0f); if (hex.Length >= 6) { result.r = int.Parse(hex.Substring(0, 2), NumberStyles.HexNumber); result.g = int.Parse(hex.Substring(2, 2), NumberStyles.HexNumber); result.b = int.Parse(hex.Substring(4, 2), NumberStyles.HexNumber); if (hex.Length == 8) { result.a = int.Parse(hex.Substring(6, 2), NumberStyles.HexNumber); } } return result; } public static string GetHexFromColor(Color color) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_003d: 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) return $"#{(int)(color.r * 255f):X2}" + $"{(int)(color.g * 255f):X2}" + $"{(int)(color.b * 255f):X2}" + $"{(int)(color.a * 255f):X2}"; } } namespace API { [<8e82bed1-12f2-4cdb-baa0-fc8d4271746a>NullableContext(1)] [<28f2501a-2654-4601-a73e-34b637b0459d>Nullable(0)] public static class EpicMMOSystem_API { [<8e82bed1-12f2-4cdb-baa0-fc8d4271746a>NullableContext(0)] private enum API_State { NotReady, NotInstalled, Ready } [<8e82bed1-12f2-4cdb-baa0-fc8d4271746a>NullableContext(0)] public enum Attribut { Strength, Agility, Intellect, Body, Vigour, Special } private static API_State state; private static MethodInfo eGetLevel; private static MethodInfo eAddExp; private static MethodInfo eGetAttribute; private static MethodInfo eSetSingleRate; public static int GetLevel() { int result = 0; Init(); if (eGetLevel != null) { result = (int)eGetLevel.Invoke(null, null); } return result; } public static int GetAttribute(Attribut attribute) { int result = 0; Init(); if (eGetAttribute != null) { result = (int)eGetAttribute.Invoke(null, new object[1] { attribute }); } return result; } public static void AddExp(int value) { Init(); eAddExp?.Invoke(null, new object[1] { value }); } public static void SetSingleRate(float rate) { Init(); eSetSingleRate?.Invoke(null, new object[1] { rate }); } private static void Init() { API_State aPI_State = state; if (aPI_State != API_State.Ready && aPI_State != API_State.NotInstalled) { if (Type.GetType("EpicMMOSystem.EpicMMOSystem, EpicMMOSystem") == null) { state = API_State.NotInstalled; return; } state = API_State.Ready; Type? type = Type.GetType("API.EMMOS_API, EpicMMOSystem"); eGetLevel = type.GetMethod("GetLevel", BindingFlags.Static | BindingFlags.Public); eAddExp = type.GetMethod("AddExp", BindingFlags.Static | BindingFlags.Public); eAddExp = type.GetMethod("GetAttribute", BindingFlags.Static | BindingFlags.Public); eSetSingleRate = type.GetMethod("SetSingleRate", BindingFlags.Static | BindingFlags.Public); } } } public static class EMMOS_API { public static int GetLevel() { return LevelSystem.Instance.getLevel(); } public static void AddExp(int exp) { LevelSystem.Instance.AddExp(exp); } public static void SetSingleRate(float rate) { LevelSystem.Instance.SetSingleRate(rate); } public static int GetAttribute(EpicMMOSystem_API.Attribut attribute) { return LevelSystem.Instance.getParameter((Parameter)attribute); } } [<8e82bed1-12f2-4cdb-baa0-fc8d4271746a>NullableContext(1)] [<28f2501a-2654-4601-a73e-34b637b0459d>Nullable(0)] [PublicAPI] public static class Marketplace_API { [<8e82bed1-12f2-4cdb-baa0-fc8d4271746a>NullableContext(0)] [Flags] public enum TerritoryFlags { None = 0, PushAway = 1, NoBuild = 2, NoPickaxe = 4, NoInteract = 8, NoAttack = 0x10, PvpOnly = 0x20, PveOnly = 0x40, PeriodicHeal = 0x80, PeriodicDamage = 0x100, IncreasedPlayerDamage = 0x200, IncreasedMonsterDamage = 0x400, NoMonsters = 0x800, CustomEnvironment = 0x1000, MoveSpeedMultiplier = 0x2000, NoDeathPenalty = 0x4000, NoPortals = 0x8000, PeriodicHealALL = 0x10000, ForceGroundHeight = 0x20000, ForceBiome = 0x40000, AddGroundHeight = 0x80000, NoBuildDamage = 0x100000, MonstersAddStars = 0x200000, InfiniteFuel = 0x400000, NoInteractItems = 0x800000, NoInteractCraftingStation = 0x1000000, NoInteractItemStands = 0x2000000, NoInteractChests = 0x4000000, NoInteractDoors = 0x8000000, NoStructureSupport = 0x10000000, NoInteractPortals = 0x20000000, CustomPaint = 0x40000000, LimitZoneHeight = int.MinValue } [<8e82bed1-12f2-4cdb-baa0-fc8d4271746a>NullableContext(0)] [Flags] public enum AdditionalTerritoryFlags { None = 0, NoItemLoss = 1, SnowMask = 2, NoMist = 4, InfiniteEitr = 8, InfiniteStamina = 0x10, NoCreatureDrops = 0x20 } private static readonly bool _IsInstalled; private static readonly MethodInfo MI_IsPlayerInsideTerritory; private static readonly MethodInfo MI_IsObjectInsideTerritoryWithFlag; private static readonly MethodInfo MI_IsObjectInsideTerritoryWithFlag_Additional; private static readonly MethodInfo MI_ResetTraderItems; private static readonly MethodInfo MI_AddTraderItem; private static readonly MethodInfo MI_OpenQuestJournal; public static bool IsInstalled() { return _IsInstalled; } public static bool IsPlayerInsideTerritory(out string name, out TerritoryFlags flags, out AdditionalTerritoryFlags additionalFlags) { flags = TerritoryFlags.None; additionalFlags = AdditionalTerritoryFlags.None; name = ""; if (!_IsInstalled || MI_IsPlayerInsideTerritory == null) { return false; } object[] array = new object[3] { "", 0, 0 }; bool result = (bool)MI_IsPlayerInsideTerritory.Invoke(null, array); name = (string)array[0]; flags = (TerritoryFlags)array[1]; additionalFlags = (AdditionalTerritoryFlags)array[2]; return result; } public static bool IsObjectInsideTerritoryWithFlag(GameObject go, TerritoryFlags flag, out string name, out TerritoryFlags flags, out AdditionalTerritoryFlags additionalFlags) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return IsPointInsideTerritoryWithFlag(go.transform.position, flag, out name, out flags, out additionalFlags); } public static bool IsObjectInsideTerritoryWithFlag(GameObject go, AdditionalTerritoryFlags flag, out string name, out TerritoryFlags flags, out AdditionalTerritoryFlags additionalFlags) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return IsPointInsideTerritoryWithFlag(go.transform.position, flag, out name, out flags, out additionalFlags); } public static bool IsPointInsideTerritoryWithFlag(Vector3 pos, TerritoryFlags flag, out string name, out TerritoryFlags flags, out AdditionalTerritoryFlags additionalFlags) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) name = ""; flags = TerritoryFlags.None; additionalFlags = AdditionalTerritoryFlags.None; if (!_IsInstalled || MI_IsObjectInsideTerritoryWithFlag == null) { return false; } object[] array = new object[5] { pos, (int)flag, "", 0, 0 }; bool result = (bool)MI_IsObjectInsideTerritoryWithFlag.Invoke(null, array); name = (string)array[2]; flags = (TerritoryFlags)array[3]; additionalFlags = (AdditionalTerritoryFlags)array[4]; return result; } public static bool IsPointInsideTerritoryWithFlag(Vector3 pos, AdditionalTerritoryFlags flag, out string name, out TerritoryFlags flags, out AdditionalTerritoryFlags additionalFlags) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) name = ""; flags = TerritoryFlags.None; additionalFlags = AdditionalTerritoryFlags.None; if (!_IsInstalled || MI_IsObjectInsideTerritoryWithFlag_Additional == null) { return false; } object[] array = new object[5] { pos, (int)flag, "", 0, 0 }; bool result = (bool)MI_IsObjectInsideTerritoryWithFlag_Additional.Invoke(null, array); name = (string)array[2]; flags = (TerritoryFlags)array[3]; additionalFlags = (AdditionalTerritoryFlags)array[4]; return result; } public static void ResetTraderItems() { if (_IsInstalled && !(MI_ResetTraderItems == null)) { MI_ResetTraderItems.Invoke(null, null); } } public static void OpenQuestJournal() { if (_IsInstalled && !(MI_OpenQuestJournal == null)) { MI_OpenQuestJournal.Invoke(null, null); } } static Marketplace_API() { Type type = Type.GetType("API.ClientSide, kg.Marketplace"); if ((object)type == null) { _IsInstalled = false; return; } _IsInstalled = true; MI_IsPlayerInsideTerritory = type.GetMethod("IsPlayerInsideTerritory", BindingFlags.Static | BindingFlags.Public); MI_IsObjectInsideTerritoryWithFlag = type.GetMethod("IsObjectInsideTerritoryWithFlag", BindingFlags.Static | BindingFlags.Public); MI_IsObjectInsideTerritoryWithFlag_Additional = type.GetMethod("IsObjectInsideTerritoryWithFlag_Additional", BindingFlags.Static | BindingFlags.Public); MI_ResetTraderItems = type.GetMethod("ResetTraderItems", BindingFlags.Static | BindingFlags.Public); MI_OpenQuestJournal = type.GetMethod("OpenQuestJournal", BindingFlags.Static | BindingFlags.Public); } } } namespace EpicMMOSystem { [Serializable] [<28f2501a-2654-4601-a73e-34b637b0459d>Nullable(0)] [<8e82bed1-12f2-4cdb-baa0-fc8d4271746a>NullableContext(1)] public struct Monster { public string name; public int minExp; public int maxExp; public int level; public Monster(string name, int minExp, int maxExp, int level) { this.name = name; this.minExp = minExp; this.maxExp = maxExp; this.level = level; } } public class LevelSystem { [HarmonyPatch(typeof(ItemData), "GetDamage", new Type[] { typeof(int), typeof(float) })] private static class MiningPostfix { [<8e82bed1-12f2-4cdb-baa0-fc8d4271746a>NullableContext(1)] private static void Postfix(ItemData __instance, ref DamageTypes __result) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Invalid comparison between Unknown and I4 if (__instance != null && (int)__instance.m_shared.m_skillType == 12) { float num = 1f + Instance.getaddMiningDmg() / 100f; __result.m_pickaxe *= num; } } } [HarmonyPatch(typeof(WearNTear), "OnPlaced")] internal static class Player_HealthChange { [<8e82bed1-12f2-4cdb-baa0-fc8d4271746a>NullableContext(1)] internal static void Prefix(ref WearNTear __instance) { __instance.m_health = Instance.getAddPieceHealth() + __instance.m_health; } } [HarmonyPatch(typeof(ItemData), "GetDamage", new Type[] { typeof(int), typeof(float) })] private static class TreeCuttingPostfix { [<8e82bed1-12f2-4cdb-baa0-fc8d4271746a>NullableContext(1)] private static void Postfix(ItemData __instance, ref DamageTypes __result) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Invalid comparison between Unknown and I4 //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Invalid comparison between Unknown and I4 if (__instance != null && ((int)__instance.m_shared.m_skillType == 7 || (int)__instance.m_shared.m_skillType == 13)) { float num = 1f + Instance.getAddTreeCuttingDmg() / 100f; __result.m_chop *= num; } } } [HarmonyPatch(typeof(Player), "GetTotalFoodValue")] public static class AddHp_Path { public static void Postfix(ref float hp) { float num = Instance.getAddHp() + EpicMMOSystem.addDefaultHealth.Value; hp += num; } } [HarmonyPatch(typeof(SEMan), "ModifyHealthRegen")] public static class RegenHp_Patch { [<8e82bed1-12f2-4cdb-baa0-fc8d4271746a>NullableContext(1)] public static void Postfix(SEMan __instance, ref float regenMultiplier) { if (__instance.m_character.IsPlayer()) { float addRegenHp = Instance.getAddRegenHp(); regenMultiplier += addRegenHp / 100f; } } } [HarmonyPatch(typeof(Character), "RPC_Damage")] public static class RPC_Damage { [<8e82bed1-12f2-4cdb-baa0-fc8d4271746a>NullableContext(1)] public static void Prefix(Character __instance, HitData hit) { if (__instance.IsPlayer() && !((Object)(object)hit.GetAttacker() == (Object)(object)__instance)) { float addMagicArmor = Instance.getAddMagicArmor(); float num = 1f - addMagicArmor / 100f; hit.m_damage.m_fire *= num; hit.m_damage.m_frost *= num; hit.m_damage.m_lightning *= num; hit.m_damage.m_poison *= num; hit.m_damage.m_spirit *= num; } } } [HarmonyPatch(typeof(Attack), "GetAttackStamina")] public static class StaminaAttack_Patch { public static void Postfix(ref float __result) { float num = 1f - Instance.getAttackStamina() / 100f; __result *= num; } } [HarmonyPatch(typeof(SEMan), "ModifyRunStaminaDrain")] public static class ModifyRun_Patch { public static void Postfix(ref float drain) { float num = 1f - Instance.getStaminaReduction() / 100f; drain *= num; } } [HarmonyPatch(typeof(SEMan), "ModifyJumpStaminaUsage")] public static class ModifyJump_Patch { public static void Postfix(ref float staminaUse) { float num = 1f - Instance.getStaminaReduction() / 100f; staminaUse *= num; } } [HarmonyPatch(typeof(SEMan), "ModifyStaminaRegen")] public static class RegenStamina_Patch { [<8e82bed1-12f2-4cdb-baa0-fc8d4271746a>NullableContext(1)] public static void Postfix(SEMan __instance, ref float staminaMultiplier) { if (__instance.m_character.IsPlayer()) { float staminaRegen = Instance.getStaminaRegen(); staminaMultiplier += staminaRegen / 100f; } } } [HarmonyPatch(typeof(Player), "GetTotalFoodValue")] public static class AddStamina_Path { public static void Postfix(ref float stamina) { stamina += Instance.getAddStamina(); } } [HarmonyPatch(typeof(Character), "RPC_Damage")] public static class PhysicArmor_Path { [<8e82bed1-12f2-4cdb-baa0-fc8d4271746a>NullableContext(1)] public static void Prefix(Character __instance, HitData hit) { if (__instance.IsPlayer() && !((Object)(object)hit.GetAttacker() == (Object)(object)__instance)) { float addPhysicArmor = Instance.getAddPhysicArmor(); float num = 1f - addPhysicArmor / 100f; hit.m_damage.m_blunt *= num; hit.m_damage.m_slash *= num; hit.m_damage.m_pierce *= num; hit.m_damage.m_chop *= num; hit.m_damage.m_pickaxe *= num; } } } [HarmonyPatch(typeof(Player), "GetTotalFoodValue")] public static class AddEitrFood_Path { public static void Postfix(ref float eitr) { if (eitr > 2f || EpicMMOSystem.addDefaultEitr.Value > 0f) { float addEitr = Instance.getAddEitr(); eitr += addEitr + EpicMMOSystem.addDefaultEitr.Value; } } } [HarmonyPatch(typeof(ItemData), "GetDamage", new Type[] { typeof(int), typeof(float) })] public class AddDamageIntellect_Path { [<8e82bed1-12f2-4cdb-baa0-fc8d4271746a>NullableContext(1)] public static void Postfix(ref ItemData __instance, ref DamageTypes __result) { if (!((Object)(object)Player.m_localPlayer == (Object)null) && ((Humanoid)Player.m_localPlayer).m_inventory.ContainsItem(__instance)) { float num = Instance.getAddMagicDamage() / 100f + 1f; __result.m_fire *= num; __result.m_frost *= num; __result.m_lightning *= num; __result.m_poison *= num; __result.m_spirit *= num; } } } [HarmonyPatch(typeof(SEMan), "ModifyEitrRegen")] public static class RegenEitr_Patch { [<8e82bed1-12f2-4cdb-baa0-fc8d4271746a>NullableContext(1)] public static void Postfix(SEMan __instance, ref float eitrMultiplier) { if (__instance.m_character.IsPlayer()) { float eitrRegen = Instance.getEitrRegen(); eitrMultiplier += eitrRegen / 100f; } } } [HarmonyPatch(typeof(ItemData), "GetDamage", new Type[] { typeof(int), typeof(float) })] public class AddDamageStrength_Path { [<8e82bed1-12f2-4cdb-baa0-fc8d4271746a>NullableContext(1)] public static void Postfix(ref ItemData __instance, ref DamageTypes __result) { if (!((Object)(object)Player.m_localPlayer == (Object)null) && ((Humanoid)Player.m_localPlayer).m_inventory.ContainsItem(__instance)) { float num = Instance.getAddPhysicDamage() / 100f + 1f; __result.m_blunt *= num; __result.m_slash *= num; __result.m_pierce *= num; __result.m_chop *= num; __result.m_pickaxe *= num; } } } [HarmonyPatch(typeof(Player), "GetMaxCarryWeight")] public class AddWeight_Path { private static void Postfix(ref float __result) { float num = Instance.getAddWeight() + EpicMMOSystem.addDefaultWeight.Value; __result += (float)Math.Round(num); } } [HarmonyPatch(typeof(Humanoid), "BlockAttack")] private static class Humanoid_BlockAttack_Patch { private static float ReturnMyValue() { return 1f - Instance.getReducedStaminaBlock() / 100f; } [HarmonyTranspiler] [<8e82bed1-12f2-4cdb-baa0-fc8d4271746a>NullableContext(1)] private static IEnumerable<CodeInstruction> StaminaBlock(IEnumerable<CodeInstruction> code) { MethodInfo method = AccessTools.DeclaredMethod(typeof(Character), "UseStamina", (Type[])null, (Type[])null); MethodInfo MyMethod = AccessTools.DeclaredMethod(typeof(Humanoid_BlockAttack_Patch), "ReturnMyValue", (Type[])null, (Type[])null); List<CodeInstruction> instructions = new List<CodeInstruction>(code); for (int i = 0; i < instructions.Count; i++) { if (i < instructions.Count - 1) { CodeInstruction val = instructions[i + 1]; if (val.opcode == OpCodes.Callvirt && val.operand == method) { yield return new CodeInstruction(OpCodes.Call, (object)MyMethod); yield return new CodeInstruction(OpCodes.Mul, (object)null); } } yield return instructions[i]; } } } [HarmonyPatch(typeof(Character), "ApplyDamage")] public class AddCritDmg { [<8e82bed1-12f2-4cdb-baa0-fc8d4271746a>NullableContext(1)] private static void Prefix(Character __instance, ref bool showDamageText, ref HitData hit) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)__instance != (Object)null && hit.HaveAttacker() && (int)__instance.m_faction != 0 && (int)hit.GetAttacker().m_faction == 0 && Random.Range(0f, 100f) < Instance.getAddCriticalChance()) { float num = 1f + Instance.getAddCriticalDmg() / 100f; hit.m_damage.m_blunt *= num; hit.m_damage.m_slash *= num; hit.m_damage.m_pierce *= num; hit.m_damage.m_chop *= num; hit.m_damage.m_pickaxe *= num; hit.m_damage.m_fire *= num; hit.m_damage.m_frost *= num; hit.m_damage.m_lightning *= num; hit.m_damage.m_poison *= num; hit.m_damage.m_spirit *= num; new CritDmgVFX().CriticalVFX(hit.m_point, hit.GetTotalDamage()); showDamageText = false; EpicMMOSystem.MLLogger.LogInfo((object)("You got a Critical Hit with damage of " + hit.GetTotalDamage())); } } } [<28f2501a-2654-4601-a73e-34b637b0459d>Nullable(1)] private static LevelSystem instance; [<28f2501a-2654-4601-a73e-34b637b0459d>Nullable(1)] private Dictionary<int, long> levelsExp; [<28f2501a-2654-4601-a73e-34b637b0459d>Nullable(1)] private const string pluginKey = "EpicMMOSystem"; [<28f2501a-2654-4601-a73e-34b637b0459d>Nullable(1)] private const string midleKey = "LevelSystem"; [<28f2501a-2654-4601-a73e-34b637b0459d>Nullable(1)] private int[] depositPoint = new int[6]; private float singleRate = 1f; [<28f2501a-2654-4601-a73e-34b637b0459d>Nullable(1)] private const string CurrentExpKey = "EpicMMOSystem_LevelSystem_CurrentExp"; [<28f2501a-2654-4601-a73e-34b637b0459d>Nullable(1)] private const string CurrentLevelKey = "EpicMMOSystem_LevelSystem_Level"; [<28f2501a-2654-4601-a73e-34b637b0459d>Nullable(1)] public static LevelSystem Instance { [<8e82bed1-12f2-4cdb-baa0-fc8d4271746a>NullableContext(1)] get { if (instance == null) { instance = new LevelSystem(); return instance; } return instance; } } public float getaddMiningDmg() { int parameter = getParameter(Parameter.Special); float value = EpicMMOSystem.miningSpeed.Value; return (float)parameter * value; } public float getAddPieceHealth() { int parameter = getParameter(Parameter.Special); float value = EpicMMOSystem.constructionPieceHealth.Value; return (float)parameter * value; } public float getAddTreeCuttingDmg() { int parameter = getParameter(Parameter.Special); float value = EpicMMOSystem.treeCuttingSpeed.Value; return (float)parameter * value; } public float getAddHp() { int parameter = getParameter(Parameter.Vigour); float value = EpicMMOSystem.addHp.Value; return (float)parameter * value; } public float getAddRegenHp() { int parameter = getParameter(Parameter.Vigour); float value = EpicMMOSystem.regenHp.Value; return (float)parameter * value; } public float getAddMagicArmor() { int parameter = getParameter(Parameter.Vigour); float value = EpicMMOSystem.magicArmor.Value; return (float)parameter * value; } public LevelSystem() { FillLevelsExp(); } public int getLevel() { if (!Object.op_Implicit((Object)(object)Player.m_localPlayer)) { return 1; } if (!Player.m_localPlayer.m_knownTexts.ContainsKey("EpicMMOSystem_LevelSystem_Level")) { return 1; } return int.Parse(Player.m_localPlayer.m_knownTexts["EpicMMOSystem_LevelSystem_Level"]); } private void setLevel(int value) { if (Object.op_Implicit((Object)(object)Player.m_localPlayer)) { Player.m_localPlayer.m_knownTexts["EpicMMOSystem_LevelSystem_Level"] = value.ToString(); } } private long CurrentExpFallback() { if (!Object.op_Implicit((Object)(object)Player.m_localPlayer)) { return 1L; } try { Player.m_localPlayer.m_knownTexts["EpicMMOSystem_LevelSystem_CurrentExp"] = "1"; return 1L; } catch (Exception) { EpicMMOSystem.MLLogger.LogError((object)"Cannot write currentExp"); } return 1L; } public long getCurrentExp() { if (!Object.op_Implicit((Object)(object)Player.m_localPlayer)) { return 0L; } if (!Player.m_localPlayer.m_knownTexts.ContainsKey("EpicMMOSystem_LevelSystem_CurrentExp") || !int.TryParse(Player.m_localPlayer.m_knownTexts["EpicMMOSystem_LevelSystem_CurrentExp"], out var result)) { return CurrentExpFallback(); } return result; } private void setCurrentExp(long value) { if (Object.op_Implicit((Object)(object)Player.m_localPlayer)) { Player.m_localPlayer.m_knownTexts["EpicMMOSystem_LevelSystem_CurrentExp"] = value.ToString(); } } [<8e82bed1-12f2-4cdb-baa0-fc8d4271746a>NullableContext(1)] private void setParameter(Parameter parameter, int value, Player target = null) { Player val = (((Object)(object)target == (Object)null) ? Player.m_localPlayer : target); if (Object.op_Implicit((Object)(object)val)) { int num; int num2 = Mathf.Clamp(value, 0, parameter.ToString() switch { "Strength" => EpicMMOSystem.maxValueStrength.Value, "Agility" => EpicMMOSystem.maxValueDexterity.Value, "Intellect" => EpicMMOSystem.maxValueIntelligence.Value, "Body" => EpicMMOSystem.maxValueEndurance.Value, "Vigour" => EpicMMOSystem.maxValueVigour.Value, "Special" => EpicMMOSystem.maxValueSpecializing.Value, _ => num = 205, }); val.m_knownTexts["EpicMMOSystem_LevelSystem_" + parameter] = num2.ToString(); } } public int getParameter(Parameter parameter) { if (!Object.op_Implicit((Object)(object)Player.m_localPlayer)) { return 0; } if (!Player.m_localPlayer.m_knownTexts.ContainsKey("EpicMMOSystem_LevelSystem_" + parameter)) { return 0; } int num = int.Parse(Player.m_localPlayer.m_knownTexts["EpicMMOSystem_LevelSystem_" + parameter]); int num2; return Mathf.Clamp(num, 0, parameter.ToString() switch { "Strength" => EpicMMOSystem.maxValueStrength.Value, "Agility" => EpicMMOSystem.maxValueDexterity.Value, "Intellect" => EpicMMOSystem.maxValueIntelligence.Value, "Body" => EpicMMOSystem.maxValueEndurance.Value, "Vigour" => EpicMMOSystem.maxValueVigour.Value, "Special" => EpicMMOSystem.maxValueSpecializing.Value, _ => num2 = 205, }); } public int getFreePoints() { int value = EpicMMOSystem.freePointForLevel.Value; int value2 = EpicMMOSystem.startFreePoint.Value; int level = getLevel(); int num = 0; try { string value3 = EpicMMOSystem.levelsForBinusFreePoint.Value; if (!Utility.IsNullOrWhiteSpace(value3)) { string[] array = value3.Split(new char[1] { ',' }); for (int i = 0; i < array.Length; i++) { string[] array2 = array[i].Split(new char[1] { ':' }); if (int.Parse(array2[0]) <= level) { num += int.Parse(array2[1]); continue; } break; } } } catch (Exception ex) { MonoBehaviour.print((object)("Free point, bonus error: " + ex.Message)); } int num2 = level * value + value2 + num; int num3 = 0; for (int j = 0; j < EpicMMOSystem.numofCats; j++) { num3 += getParameter((Parameter)j); } return num2 - num3; } public void addPointsParametr(Parameter parameter, int addPoint) { int freePoints = getFreePoints(); if (freePoints > 0) { int num = Mathf.Clamp(addPoint, 1, freePoints); depositPoint[(int)parameter] += num; int parameter2 = getParameter(parameter); setParameter(parameter, parameter2 + num); } } public long getNeedExp(int addLvl = 0) { int key = Mathf.Clamp(getLevel() + 1 + addLvl, 1, EpicMMOSystem.maxLevel.Value); return levelsExp[key]; } [<8e82bed1-12f2-4cdb-baa0-fc8d4271746a>NullableContext(1)] public void ResetAllParameter(Player player = null) { for (int i = 0; i < EpicMMOSystem.numofCats; i++) { setParameter((Parameter)i, 0, player); } MyUI.UpdateParameterPanel(); } public void ResetAllParameterPayment() { string value = EpicMMOSystem.prefabNameCoins.Value; string name = ZNetScene.instance.GetPrefab(value).GetComponent<ItemDrop>().m_itemData.m_shared.m_name; int priceResetPoints = getPriceResetPoints(); if (((Humanoid)Player.m_localPlayer).m_inventory.CountItems(name, -1, true) < priceResetPoints) { string name2 = ZNetScene.instance.GetPrefab("ResetTrophy").GetComponent<ItemDrop>().m_itemData.m_shared.m_name; if (((Humanoid)Player.m_localPlayer).m_inventory.CountItems(name2, -1, true) > 0) { ((Humanoid)Player.m_localPlayer).m_inventory.RemoveItem(name2, 1, -1, true); ResetAllParameter(); } } else { ((Humanoid)Player.m_localPlayer).m_inventory.RemoveItem(name, priceResetPoints, -1, true); ResetAllParameter(); } } public void SetSingleRate(float rate) { singleRate = rate; } public void AddExp(int addAmount, bool noxpMulti = false) { if (addAmount < 1) { if (addAmount == -2) { Util.FloatingText("No XP for red/blue creatures :( "); } return; } if ((!ZoneSystem.instance.CheckKey("defeated_eikthyr", (GameKeyType)0, true) && getLevel() >= 15) || (!ZoneSystem.instance.CheckKey("defeated_gdking", (GameKeyType)0, true) && getLevel() >= 25) || (!ZoneSystem.instance.CheckKey("defeated_bonemass", (GameKeyType)0, true) && getLevel() >= 35) || (!ZoneSystem.instance.CheckKey("defeated_goblinking", (GameKeyType)0, true) && getLevel() >= 45) || (!ZoneSystem.instance.CheckKey("defeated_queen", (GameKeyType)0, true) && getLevel() >= 55)) { Util.FloatingText("Достигнут максимальный уровень прогресса"); return; } float value = EpicMMOSystem.rateExp.Value; float num = (noxpMulti ? ((float)addAmount) : ((float)addAmount * (value + singleRate))); if (!noxpMulti) { if (((Character)Player.m_localPlayer).m_seman.HaveStatusEffect("Potion_MMO_Greater")) { num *= EpicMMOSystem.XPforGreaterPotion.Value; } else if (((Character)Player.m_localPlayer).m_seman.HaveStatusEffect("Potion_MMO_Medium")) { num *= EpicMMOSystem.XPforMediumPotion.Value; } else if (((Character)Player.m_localPlayer).m_seman.HaveStatusEffect("Potion_MMO_Minor")) { num *= EpicMMOSystem.XPforMinorPotion.Value; } } long currentExp = getCurrentExp(); long needExp = getNeedExp(); if ((float)currentExp + num > (float)needExp) { AddLevel(1); setCurrentExp(0L); } else { setCurrentExp(currentExp + (long)num); } MyUI.updateExpBar(); if (EpicMMOSystem.leftMessageXP.Value) { ((Character)Player.m_localPlayer).Message((MessageType)1, string.Format("{0}: {1}", EpicMMOSystem.localizationold["$get_exp"], (long)num), 0, (Sprite)null); } Util.FloatingText(EpicMMOSystem.XPstring.Value.Replace("@", $"{(long)num}") ?? ""); } public void AddLevel(int toAdd) { //IL_004c: Unknown result type (might be due to invalid IL or missing references) if (toAdd > 0) { int num = getLevel() + toAdd; setLevel(Mathf.Clamp(num, 1, EpicMMOSystem.maxLevel.Value)); PlayerFVX.levelUp(); ZDO zDO = ((Character)Player.m_localPlayer).m_nview.GetZDO(); zDO.Set("EpicMMOSystem_level", num); ZDOMan.instance.ForceSendZDO(zDO.m_uid); } } public bool hasDepositPoints() { bool result = false; int[] array = depositPoint; for (int i = 0; i < array.Length; i++) { if (array[i] > 0) { result = true; break; } } return result; } public void applyDepositPoints() { for (int i = 0; i < depositPoint.Length; i++) { depositPoint[i] = 0; } MyUI.UpdateParameterPanel(); } public void cancelDepositPoints() { if (!Object.op_Implicit((Object)(object)Player.m_localPlayer)) { return; } for (int i = 0; i < depositPoint.Length; i++) { if (depositPoint[i] != 0) { Parameter parameter = (Parameter)i; int num = depositPoint[i]; int parameter2 = getParameter(parameter); setParameter(parameter, parameter2 - num); depositPoint[i] = 0; } } MyUI.UpdateParameterPanel(); } public int getPriceResetPoints() { int num = 0; for (int i = 0; i < EpicMMOSystem.numofCats; i++) { num += getParameter((Parameter)i); } return num * EpicMMOSystem.priceResetPoints.Value; } [<8e82bed1-12f2-4cdb-baa0-fc8d4271746a>NullableContext(1)] public void DeathPlayer(Player player) { if (EpicMMOSystem.hardcoreDeath.Value) { EpicMMOSystem.MLLogger.LogInfo((object)("Player " + player.GetPlayerName() + " is hardcored!")); SetLevelTargetPlayer(player, 1); player.DropPlayerKeys(); player.m_knownTexts.Clear(); player.m_knownStations.Clear(); ((Humanoid)player).m_inventory.RemoveAll(); player.m_skills.LowerAllSkills(0.25f); } else if (EpicMMOSystem.lossExp.Value && Player.m_localPlayer.HardDeath()) { float value = EpicMMOSystem.minLossExp.Value; float value2 = EpicMMOSystem.maxLossExp.Value; float num = 1f - Random.Range(value, value2); long currentExp = (long)((float)getCurrentExp() * num); setCurrentExp(currentExp); MyUI.updateExpBar(); } } public void FillLevelsExp() { int value = EpicMMOSystem.levelExp.Value; float value2 = EpicMMOSystem.multiNextLevel.Value; int value3 = EpicMMOSystem.maxLevel.Value; levelsExp = new Dictionary<int, long>(); if (EpicMMOSystem.levelexpforeachlevel.Value) { long num = 0L; for (int i = 1; i <= value3; i++) { num = (long)Math.Round((float)num * value2 + (float)value); levelsExp[i + 1] = num; } } else { long num2 = value; for (int j = 1; j <= value3; j++) { num2 = (long)Math.Round((float)num2 * value2); levelsExp[j + 1] = num2; } } } public void terminalSetLevel(int value) { //IL_0054: Unknown result type (might be due to invalid IL or missing references) int num = Mathf.Clamp(value, 1, EpicMMOSystem.maxLevel.Value); setLevel(num); setCurrentExp(0L); ResetAllParameter(); PlayerFVX.levelUp(); MyUI.updateExpBar(); ZDO zDO = ((Character)Player.m_localPlayer).m_nview.GetZDO(); zDO.Set("EpicMMOSystem_level", num); ZDOMan.instance.ForceSendZDO(zDO.m_uid); } [<8e82bed1-12f2-4cdb-baa0-fc8d4271746a>NullableContext(1)] public void SetLevelTargetPlayer(Player player, int value) { //IL_0076: Unknown result type (might be due to invalid IL or missing references) int num = Mathf.Clamp(value, 1, EpicMMOSystem.maxLevel.Value); player.m_knownTexts["EpicMMOSystem_LevelSystem_Level"] = $"{num}"; player.m_knownTexts["EpicMMOSystem_LevelSystem_CurrentExp"] = "0"; ResetAllParameter(player); PlayerFVX.levelUp(); MyUI.updateExpBar(); ZDO zDO = ((Character)player).m_nview.GetZDO(); zDO.Set("EpicMMOSystem_level", num); ZDOMan.instance.ForceSendZDO(zDO.m_uid); } public float getAddAttackSpeed() { int parameter = getParameter(Parameter.Agility); float value = EpicMMOSystem.attackSpeed.Value; return (float)parameter * value; } public float getAttackStamina() { int parameter = getParameter(Parameter.Agility); float value = EpicMMOSystem.attackStamina.Value; return (float)parameter * value; } public float getStaminaReduction() { int parameter = getParameter(Parameter.Agility); float value = EpicMMOSystem.staminaReduction.Value; return (float)parameter * value; } public float getStaminaRegen() { int parameter = getParameter(Parameter.Body); float value = EpicMMOSystem.staminaRegen.Value; return (float)parameter * value; } public float getAddStamina() { int parameter = getParameter(Parameter.Body); float value = EpicMMOSystem.addStamina.Value; return (float)parameter * value; } public float getAddPhysicArmor() { int parameter = getParameter(Parameter.Body); float value = EpicMMOSystem.physicArmor.Value; return (float)parameter * value; } public float getAddMagicDamage() { int parameter = getParameter(Parameter.Intellect); float value = EpicMMOSystem.magicDamage.Value; return (float)parameter * value; } public float getEitrRegen() { int parameter = getParameter(Parameter.Intellect); float value = EpicMMOSystem.magicEitrRegen.Value; return (float)parameter * value; } public float getAddEitr() { int parameter = getParameter(Parameter.Intellect); float value = EpicMMOSystem.addEitr.Value; return (float)parameter * value; } public float getAddPhysicDamage() { int parameter = getParameter(Parameter.Strength); float value = EpicMMOSystem.physicDamage.Value; return (float)parameter * value; } public float getAddWeight() { if (!Object.op_Implicit((Object)(object)Player.m_localPlayer)) { return 0f; } int parameter = getParameter(Parameter.Strength); float value = EpicMMOSystem.addWeight.Value; return (float)parameter * value; } public float getReducedStaminaBlock() { int parameter = getParameter(Parameter.Strength); float value = EpicMMOSystem.staminaBlock.Value; return (float)parameter * value; } public float getAddCriticalDmg() { int parameter = getParameter(Parameter.Strength); float value = EpicMMOSystem.critDmg.Value; return (float)parameter * value + EpicMMOSystem.CriticalDefaultDamage.Value; } public float getAddCriticalChance() { int parameter = getParameter(Parameter.Special); float value = EpicMMOSystem.critChance.Value; return (float)parameter * value + EpicMMOSystem.CriticalStartChance.Value; } } [<8e82bed1-12f2-4cdb-baa0-fc8d4271746a>NullableContext(2)] [<28f2501a-2654-4601-a73e-34b637b0459d>Nullable(0)] public static class ZDOUtils { [<28f2501a-2654-4601-a73e-34b637b0459d>Nullable(1)] private const string LevelKey = "EpicMMOKey"; public static void SetMMOLevel(this Character character, int level) { if (!((Object)(object)character == (Object)null)) { ((Component)character).GetComponent<ZNetView>().GetZDO().Set("EpicMMOKey", level); } } public static int GetMMOLevel(this Character character) { if ((Object)(object)character == (Object)null) { return 1; } return ((Component)character).GetComponent<ZNetView>().GetZDO().GetInt("EpicMMOKey", 0); } } [<8e82bed1-12f2-4cdb-baa0-fc8d4271746a>NullableContext(1)] [<28f2501a-2654-4601-a73e-34b637b0459d>Nullable(0)] public class FriendsData { private Dictionary<string, FriendInfo> friends = new Dictionary<string, FriendInfo>(); public Dictionary<string, FriendInfo> getFriends() { if (friends.Count == 0) { LoadFriends(); } return friends; } public void addFriends(FriendInfo friend) { if (!friends.ContainsKey(friend.name)) { friends.Add(friend.name, friend); SaveFriends(); } } public void updateFriends(FriendInfo friend) { friends[friend.name] = friend; SaveFriends(); } public void deleteFriend(FriendInfo friend) { friends.Remove(friend.name); SaveFriends(); } private void SaveFriends() { if (Object.op_Implicit((Object)(object)Player.m_localPlayer)) { string text = JSON.ToJSON(friends.Values.ToArray()); Player.m_localPlayer.m_knownTexts["EpicMMOSystem_friend_list"] = text ?? ""; } } private void LoadFriends() { if (!Object.op_Implicit((Object)(object)Player.m_localPlayer) || !Player.m_localPlayer.m_knownTexts.ContainsKey("EpicMMOSystem_friend_list")) { return; } friends.Clear(); FriendInfo[] array = JSON.ToObject<FriendInfo[]>(Player.m_localPlayer.m_knownTexts["EpicMMOSystem_friend_list"] ?? ""); if (array != null) { FriendInfo[] array2 = array; foreach (FriendInfo friendInfo in array2) { friends.Add(friendInfo.name, friendInfo); } } } public void ClearFriend() { friends.Clear(); } } [Serializable] [<8e82bed1-12f2-4cdb-baa0-fc8d4271746a>NullableContext(1)] [<28f2501a-2654-4601-a73e-34b637b0459d>Nullable(0)] public class FriendInfo { public string name; public string host; public int level; public int moClass; } [<28f2501a-2654-4601-a73e-34b637b0459d>Nullable(0)] [<8e82bed1-12f2-4cdb-baa0-fc8d4271746a>NullableContext(1)] public static class FriendsSystem { [HarmonyPatch(typeof(ZNetScene), "Awake")] [<8e82bed1-12f2-4cdb-baa0-fc8d4271746a>NullableContext(0)] private static class ZrouteMethodsServerFeedback { private static void Postfix() { if (!isServer) { ZRoutedRpc.instance.Register<int, int>(modName + " InviteFriend", (Action<long, int, int>)RPC_InviteFriend); ZRoutedRpc.instance.Register<int, int>(modName + " AcceptInviteFriend", (Action<long, int, int>)RPC_AcceptFriend); ZRoutedRpc.instance.Register<string>(modName + " RejectInviteFriend", (Action<long, string>)RPC_RejectFriend); } } } private static bool isServer => (int)SystemInfo.graphicsDeviceType == 4; private static string modName => "EpicMMOSystem"; private static Localizationold local => EpicMMOSystem.localizationold; public static void Init() { } public static void inviteFriend(string name) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_003e: 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_0044: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) foreach (PlayerInfo player in ZNet.instance.GetPlayerList()) { if (player.m_name == name) { int level = LevelSystem.Instance.getLevel(); ZRoutedRpc instance = ZRoutedRpc.instance; ZDOID characterID = player.m_characterID; instance.InvokeRoutedRPC(((ZDOID)(ref characterID)).UserID, modName + " InviteFriend", new object[2] { level, ((Character)Player.m_localPlayer).m_nview.GetZDO().GetInt("MagicOverhaulClass", 0) }); Chat.instance.RPC_ChatMessage(200L, Vector3.zero, 0, UserInfo.GetLocalUser(), string.Format(local["$send_invite"], name), PrivilegeManager.GetNetworkUserId()); return; } } Chat.instance.RPC_ChatMessage(200L, Vector3.zero, 0, UserInfo.GetLocalUser(), string.Format(local["$not_found"], name), PrivilegeManager.GetNetworkUserId()); } public static void acceptInvite(FriendInfo info, PlayerInfo player) { ZRoutedRpc.instance.InvokeRoutedRPC(((ZDOID)(ref player.m_characterID)).UserID, modName + " AcceptInviteFriend", new object[2] { info.level, ((Character)Player.m_localPlayer).m_nview.GetZDO().GetInt("MagicOverhaulClass", 0) }); } public static void rejectInvite(FriendInfo info, PlayerInfo player) { ZRoutedRpc.instance.InvokeRoutedRPC(((ZDOID)(ref player.m_characterID)).UserID, modName + " RejectInviteFriend", new object[1] { info.name }); } private static void RPC_InviteFriend(long sender, int level, int moClass) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) PlayerInfo val = ZNet.instance.GetPlayerList().Find((PlayerInfo f) => ((ZDOID)(ref f.m_characterID)).UserID == sender); FriendInfo friendInfo = new FriendInfo(); friendInfo.name = val.m_name; friendInfo.host = val.m_host; friendInfo.level = level; friendInfo.moClass = moClass; Chat.instance.RPC_ChatMessage(200L, Vector3.zero, 0, UserInfo.GetLocalUser(), string.Format(local["$get_invite"], friendInfo.name), PrivilegeManager.GetNetworkUserId()); MyUI.addInviteFriend(friendInfo, val); } private static void RPC_AcceptFriend(long sender, int level, int moClass) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) PlayerInfo val = ZNet.instance.GetPlayerList().Find((PlayerInfo f) => ((ZDOID)(ref f.m_characterID)).UserID == sender); FriendInfo friendInfo = new FriendInfo(); friendInfo.name = val.m_name; friendInfo.host = val.m_host; friendInfo.level = level; friendInfo.moClass = moClass; Chat.instance.RPC_ChatMessage(200L, Vector3.zero, 0, UserInfo.GetLocalUser(), string.Format(local["$accept_invite"], friendInfo.name), PrivilegeManager.GetNetworkUserId()); MyUI.acceptInvited(friendInfo); } private static void RPC_RejectFriend(long sender, string name) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) Chat.instance.RPC_ChatMessage(200L, Vector3.zero, 0, UserInfo.GetLocalUser(), string.Format(local["$cancel_invite"], name), PrivilegeManager.GetNetworkUserId()); } } [<8e82bed1-12f2-4cdb-baa0-fc8d4271746a>NullableContext(1)] [<28f2501a-2654-4601-a73e-34b637b0459d>Nullable(0)] public static class MyUI { [HarmonyPatch(typeof(InventoryGui), "Show")] [<8e82bed1-12f2-4cdb-baa0-fc8d4271746a>NullableContext(0)] public static class ShowPanel_Path { public static void Postfix() { Show(); } } [<8e82bed1-12f2-4cdb-baa0-fc8d4271746a>NullableContext(0)] [HarmonyPatch(typeof(InventoryGui), "Hide")] public static class HidePanel_Path { public static void Postfix() { Hide(); } } [<8e82bed1-12f2-4cdb-baa0-fc8d4271746a>NullableContext(0)] [HarmonyPatch(typeof(Menu), "IsVisible")] private static class BufferUIFix { private static void Postfix(ref bool __result) { if (textField.isFocused) { __result = true; } } } [<8e82bed1-12f2-4cdb-baa0-fc8d4271746a>NullableContext(0)] [HarmonyPatch(typeof(Hud), "SetVisible")] public static class Vis { private static void Postfix(bool visible) { if (visible && !UIToggle && !EpicMMOSystem.oldExpBar.Value) { ((Component)expPanelRoot).gameObject.SetActive(true); UIToggle = true; DragControl.SaveWindowPositions(((Component)expPanel).gameObject, initialLoad: true); DragControl.SaveWindowPositions(((Component)hp).gameObject, initialLoad: true); DragControl.SaveWindowPositions(((Component)stamina).gameObject, initialLoad: true); } if (!visible && UIToggle && !EpicMMOSystem.oldExpBar.Value) { ((Component)expPanelRoot).gameObject.SetActive(false); UIToggle = false; } } } [<8e82bed1-12f2-4cdb-baa0-fc8d4271746a>NullableContext(0)] [HarmonyPatch(typeof(Hud), "Awake")] public static class InstantiateExpPanel { [<8e82bed1-12f2-4cdb-baa0-fc8d4271746a>NullableContext(1)] private static void Postfix(Hud __instance) { //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) if (EpicMMOSystem.oldExpBar.Value) { Transform transform = Object.Instantiate<GameObject>(EpicMMOSystem._asset.LoadAsset<GameObject>("ExpPanel"), __instance.m_rootObject.transform).transform; eLevelText = ((Component)transform.Find("Lvl")).GetComponent<Text>(); eExpText = ((Component)transform.Find("Exp")).GetComponent<Text>(); eBarImage = ((Component)transform.Find("Bar/Fill")).GetComponent<Image>(); return; } expPanelRoot = Object.Instantiate<GameObject>(EpicMMOSystem._asset.LoadAsset<GameObject>("EpicHudPanelCanvas")).transform; ((Component)expPanelRoot).gameObject.SetActive(false); InitHudPanel(); DHpBar = ((Component)((Transform)__instance.m_healthPanel).Find("Health")).gameObject; IconHpBar = ((Component)((Transform)__instance.m_healthPanel).Find("healthicon")).gameObject; if (!EpicMMOSystem.oldExpBar.Value) { ((Component)((Transform)__instance.m_healthPanel).Find("Health")).gameObject.SetActive(false); ((Component)((Transform)__instance.m_healthPanel).Find("healthicon")).gameObject.SetActive(false); } Transform val = __instance.m_buildHud.transform.Find("SelectedInfo"); if (Object.op_Implicit((Object)(object)val)) { val.localPosition += new Vector3(0f, 45f, 0f); } } } [HarmonyPatch(typeof(Hud), "UpdateHealth")] [<8e82bed1-12f2-4cdb-baa0-fc8d4271746a>NullableContext(0)] public static class UpdateHealth { [<8e82bed1-12f2-4cdb-baa0-fc8d4271746a>NullableContext(1)] private static bool Prefix(Player player) { if (EpicMMOSystem.oldExpBar.Value) { eLevelText.text = string.Format("{0} {1}", localization["$lvl"], currentLVL); return true; } if (DisableHPBar) { return true; } if (!firstloadHP) { ((Component)((Component)expPanelRoot).GetComponent<Canvas>()).gameObject.SetActive(true); firstloadHP = true; } float health = ((Character)player).GetHealth(); float maxHealth = ((Character)player).GetMaxHealth(); hpImage.fillAmount = health / maxHealth; string text = ""; text = ((!EpicMMOSystem.showMaxHp.Value) ? Mathf.CeilToInt(health).ToString() : (Mathf.CeilToInt(health) + " / " + Mathf.CeilToInt(maxHealth))); hpText.text = text; return false; } } [HarmonyPatch(typeof(Hud), "UpdateStamina")] [<8e82bed1-12f2-4cdb-baa0-fc8d4271746a>NullableContext(0)] public static class UpdateStamina { [<8e82bed1-12f2-4cdb-baa0-fc8d4271746a>NullableContext(1)] private static bool Prefix(Player player) { if (EpicMMOSystem.oldExpBar.Value) { return true; } if (DisableStaminaBar) { return true; } float stamina = player.GetStamina(); float maxStamina = ((Character)player).GetMaxStamina(); staminaImage.fillAmount = stamina / maxStamina; string text = ""; text = ((!EpicMMOSystem.showMaxHp.Value) ? Mathf.CeilToInt(stamina).ToString() : (Mathf.CeilToInt(stamina) + " / " + Mathf.CeilToInt(maxStamina))); staminaText.text = text; return false; } } [HarmonyPatch(typeof(Hud), "UpdateEitr")] [<8e82bed1-12f2-4cdb-baa0-fc8d4271746a>NullableContext(0)] public static class UpdateEitr { [<8e82bed1-12f2-4cdb-baa0-fc8d4271746a>NullableContext(1)] private static bool Prefix(Player player) { if (EpicMMOSystem.oldExpBar.Value) { return true; } if (DisableEitrBar) { EitrGameObj.SetActive(false); } if (DisableEitrBar) { return true; } float eitr = player.GetEitr(); float maxEitr = ((Character)player).GetMaxEitr(); if (flagforMove > 0) { DragControl.RestoreWindow(((Component)hp).gameObject); DragControl.RestoreWindow(((Component)Exp).gameObject); DragControl.RestoreWindow(((Component)stamina).gameObject); if (flagforMove == 2) { DragControl.RestoreWindow(EitrGameObj); } flagforMove = 0; } if (maxEitr < 2f && EitrGameObj.activeSelf) { EitrGameObj.SetActive(false); ((Component)expPanel).GetComponent<RectTransform>().SetSizeWithCurrentAnchors((Axis)0, 1050f); flagforMove = 1; } if (maxEitr > 2f && !EitrGameObj.activeSelf) { EitrGameObj.SetActive(true); ((Component)expPanel).GetComponent<RectTransform>().SetSizeWithCurrentAnchors((Axis)0, 1475f); flagforMove = 2; } EitrImage.fillAmount = eitr / maxEitr; string text = ""; text = ((!EpicMMOSystem.showMaxHp.Value) ? Mathf.CeilToInt(eitr).ToString() : (Mathf.CeilToInt(eitr) + " / " + Mathf.CeilToInt(maxEitr))); Eitr.text = text; firstload = true; return false; } } [<8e82bed1-12f2-4cdb-baa0-fc8d4271746a>NullableContext(0)] [HarmonyPatch(typeof(Game), "SpawnPlayer")] public static class UpdateExpPanelForStart { private static void Postfix() { try { updateExpBar(); if (!EpicMMOSystem.oldExpBar.Value) { ((Component)expPanelRoot).gameObject.SetActive(true); } } catch (Exception ex) { MonoBehaviour.print((object)("Error set expbar: " + ex.Message)); throw; } } } [<28f2501a-2654-4601-a73e-34b637b0459d>Nullable(0)] private class FriendsCell { [<8e82bed1-12f2-4cdb-baa0-fc8d4271746a>NullableContext(0)] public enum StatusFriend { online, offline, invite } private GameObject cell; private FriendInfo friend; private Text nameText; private Text levelText; private Image icon; private PlayerInfo player; private StatusFriend status; public FriendsCell(GameObject cell, FriendInfo friend, PlayerInfo info, StatusFriend status) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: 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_0302: Unknown result type (might be due to invalid IL or missing references) //IL_030c: Expected O, but got Unknown //IL_032d: Unknown result type (might be due to invalid IL or missing references) //IL_0337: Expected O, but got Unknown //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_0362: Expected O, but got Unknown this.cell = cell; this.friend = friend; player = info; nameText = ((Component)cell.transform.Find("Name")).GetComponent<Text>(); levelText = ((Component)cell.transform.Find("Level")).GetComponent<Text>(); icon = ((Component)cell.transform.Find("IconClass")).GetComponent<Image>(); nameText.text = friend.name; this.status = status; int num = friend.level; int num2 = friend.moClass; switch (status) { case StatusFriend.online: try { ZDO zDO = ZDOMan.instance.GetZDO(info.m_characterID); num = zDO.GetInt("EpicMMOSystem_level", 1); num2 = zDO.GetInt("MagicOverhaulClass", 0); } catch (Exception ex) { MonoBehaviour.print((object)("Ошибка в получении значений из здо: " + ex.Message)); } ((Component)cell.transform.Find("Status")).GetComponent<Text>().text = localization["$online"]; ((Graphic)((Component)cell.transform.Find("Status")).GetComponent<Text>()).color = Color.green; ((Component)cell.transform.Find("Buttons/Accept")).gameObject.SetActive(false); if (!Groups.API.IsLoaded()) { ((Component)cell.transform.Find("Buttons/AddGroup")).gameObject.SetActive(false); } else if (Groups.API.GroupPlayers().Count > 0 && (Groups.API.GetLeader()?.name ?? "") != Player.m_localPlayer.GetPlayerName()) { ((Component)cell.transform.Find("Buttons/AddGroup")).gameObject.SetActive(false); } break; case StatusFriend.offline: ((Component)cell.transform.Find("Buttons/AddGroup")).gameObject.SetActive(false); ((Component)cell.transform.Find("Buttons/Accept")).gameObject.SetActive(false); ((Component)cell.transform.Find("Status")).GetComponent<Text>().text = localization["$offline"]; ((Graphic)((Component)cell.transform.Find("Status")).GetComponent<Text>()).color = Color.red; break; case StatusFriend.invite: ((Component)cell.transform.Find("Buttons/AddGroup")).gameObject.SetActive(false); ((Component)cell.transform.Find("Status")).GetComponent<Text>().text = ""; break; } levelText.text = string.Format("{0}: {1}", localization["$level"], num); if (num2 != 0) { icon.sprite = sprites[num2]; } ((UnityEvent)((Component)cell.transform.Find("Buttons/AddGroup")).GetComponent<Button>().onClick).AddListener(new UnityAction(inviteGroup)); ((UnityEvent)((Component)cell.transform.Find("Buttons/Accept")).GetComponent<Button>().onClick).AddListener(new UnityAction(acceptInvite)); ((UnityEvent)((Component)cell.transform.Find("Buttons/Delete")).GetComponent<Button>().onClick).AddListener(new UnityAction(deleteFriend)); if (num > friend.level || num2 != friend.moClass) { friend.level = num; friend.moClass = num2; friendsData.updateFriends(friend); } } private void inviteGroup() { if (Groups.API.GroupPlayers().Count > 0) { foreach (PlayerReference item in Groups.API.GroupPlayers()) { if (item.name == friend.name) { return; } } string playerName = Player.m_localPlayer.GetPlayerName(); if ((Groups.API.GetLeader()?.name ?? "") == playerName) { ZRoutedRpc.instance.InvokeRoutedRPC(((ZDOID)(ref player.m_characterID)).UserID, "Groups InvitePlayer", new object[1] { playerName }); } } else { Groups.API.CreateNewGroup(); ZRoutedRpc.instance.InvokeRoutedRPC(((ZDOID)(ref player.m_characterID)).UserID, "Groups InvitePlayer", new object[1] { Player.m_localPlayer.GetPlayerName() }); } } private void acceptInvite() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) FriendsSystem.acceptInvite(friend, player); inviteList.Remove(friend); acceptInvited(friend); Destroy(); } private void deleteFriend() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) if (status == StatusFriend.invite) { inviteList.Remove(friend); FriendsSystem.rejectInvite(friend, player); updateInviteList(); } else { friendsData.deleteFriend(friend); updateFriendsList(); } } public void Destroy() { Object.Destroy((Object)(object)cell); } } [HarmonyPatch(typeof(Game), "Logout")] [<8e82bed1-12f2-4cdb-baa0-fc8d4271746a>NullableContext(0)] public static class DataFriendsClear { public static void Prefix() { inviteList.Clear(); friendsData.ClearFriend(); } } [<28f2501a-2654-4601-a73e-34b637b0459d>Nullable(0)] private class ParameterButton { private Parameter parameter; private Transform head; private GameObject buttons; private Text text; public ParameterButton(Transform head, Parameter parameter) { //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Expected O, but got Unknown this.head = head; this.parameter = parameter; text = ((Component)head.Find("Text")).GetComponent<Text>(); buttons = ((Component)head.Find("Buttons")).gameObject; ((UnityEvent)((Component)buttons.transform.Find("Plus1")).GetComponent<Button>().onClick).AddListener(new UnityAction(ClickButton1)); ((UnityEvent)((Component)buttons.transform.Find("Plus5")).GetComponent<Button>().onClick).AddListener(new UnityAction(ClickButton5)); } private void ClickButton1() { LevelSystem.Instance.addPointsParametr(parameter, 1); UpdateParameterPanel(); } private void ClickButton5() { LevelSystem.Instance.addPointsParametr(parameter, 5); UpdateParameterPanel(); } public void UpdateParameters(int freePoints) { int num = parameter.ToString() switch { "Strength" => EpicMMOSystem.maxValueStrength.Value, "Agility" => EpicMMOSystem.maxValueDexterity.Value, "Intellect" => EpicMMOSystem.maxValueIntelligence.Value, "Body" => EpicMMOSystem.maxValueEndurance.Value, "Vigour" => EpicMMOSystem.maxValueVigour.Value, "Special" => EpicMMOSystem.maxValueSpecializing.Value, _ => num = 205, }; int num2 = LevelSystem.Instance.getParameter(parameter); text.text = string.Format("{0}: {1}", localization["$parameter_" + parameter.ToString().ToLower()], num2); buttons.SetActive(freePoints > 0 && num2 < num); } } [HarmonyPatch(typeof(InventoryGui), "Awake")] [<8e82bed1-12f2-4cdb-baa0-fc8d4271746a>NullableContext(0)] private static class InventoryGui_Awake_Patch { [<8e82bed1-12f2-4cdb-baa0-fc8d4271746a>NullableContext(1)] private static void Postfix(InventoryGui __instance) { UITooltip[] componentsInChildren = levelSystemPanel.GetComponentsInChildren<UITooltip>(true); foreach (UITooltip val in componentsInChildren) { val.m_tooltipPrefab = __instance.m_playerGrid.m_elementPrefab.GetComponent<UITooltip>().m_tooltipPrefab; switch (val.m_topic) { case "Strength": val.m_text = localization["$strength_tooltip"]; break; case "Dexterity": val.m_text = localization["$dexterity_tooltip"]; break; case "Intelect": val.m_text = localization["$intelect_tooltip"]; break; case "Endurance": val.m_text = localization["$endurance_tooltip"]; break; case "Vigour": val.m_text = localization["$vigour_tooltip"]; break; case "Special": val.m_text = localization["$special_tooltip"]; break; } } } } private static GameObject UI; internal static Text eLevelText; internal static Text eExpText; internal static Image eBarImage; internal static Transform Exp; internal static bool DisableExpBar = false; internal static Text hpText; internal static Image hpImage; internal static Transform hp; internal static Transform hpFill; internal static Color hpFillColor; internal static bool DisableHPBar = false; internal static GameObject DHpBar; internal static GameObject IconHpBar; internal static Text staminaText; internal static Image staminaImage; internal static Transform stamina; internal static Transform staminaBarFill; internal static Color staminaBarColor; internal static bool DisableStaminaBar = false; internal static Text Eitr; internal static Image EitrImage; internal static GameObject EitrGameObj; internal static Transform EitrTran; internal static Transform EitrFill; internal static Color EitrBarColor; internal static bool DisableEitrBar = false; internal static Transform expPanel; internal static Transform expPanelRoot; internal static Color expPanelBackgroundColor; internal static GameObject expPanelBackground; internal static int flagforMove = 0; internal static bool firstload = false; internal static bool firstloadHP = false; internal static int frameCount = 0; internal static int currentLVL = 1; internal static bool UIToggle = false; private static List<Sprite> sprites = new List<Sprite>(); private static FriendsData friendsData = new FriendsData(); private static GameObject friendsListPanel; private static GameObject friendsCell; private static GameObject headerInvited; private static GameObject contentInvited; private static GameObject headerFriends; private static GameObject contentFriends; private static GameObject addFriendAlert; private static InputField textField; private static List<FriendsCell> friendsCells = new List<FriendsCell>(); private static List<FriendsCell> inviteCells = new List<FriendsCell>(); private static Dictionary<FriendInfo, PlayerInfo> inviteList = new Dictionary<FriendInfo, PlayerInfo>(); internal static GameObject levelSystemPanel; internal static GameObject levelSystemPanelRoot; private static GameObject alertResetPointPanel; private static Text alertResetPointText; private static List<ParameterButton> parameterButtons = new List<ParameterButton>(); private static GameObject freePointsPanel; private static Text freePointsText; private static Text currentLevelText; private static Text expText; private static Text physicDamageText; private static Text addWeightText; private static Text criticalDmgMultText; private static Text attackSpeedMultiText; private static Text reducedStaminaText; private static Text attackStamina; private static Text magicDamageText; private static Text magicEitrRegText; private static Text eitrIncreaseText; private static Text addStaminaText; private static Text staminaRegen; private static Text reducedStaminaBlockText; private static Text physicArmorText; private static Text addHpText; private static Text regenHpText; private static Text magicArmorText; private static Text criticalChanceText; private static Text miningSpeedText; private static Text addpieceHealthText; private static Text treeCuttingSpeedText; internal static GameObject navigationPanel; private static Transform buttonLevelSystem; private static Transform buttonFriendsList; private static Transform buttonQuestPanel; private static Transform buttonProfessionsPanel; private static Transform buttonShopPanel; private static Localizationold localization => EpicMMOSystem.localizationold; public static bool IsPanelVisible() { if (Object.op_Implicit((Object)(object)UI)) { return UI.activeSelf; } return false; } public static void Init() { UI = Object.Instantiate<GameObject>(EpicMMOSystem._asset.LoadAsset<GameObject>("LevelHud")); Object.DontDestroyOnLoad((Object)(object)UI); UI.SetActive(false); InitNavigationPanel(); InitLevelSystem(); InitFriendsList(); } public static void Hide() { navigationPanel.SetActive(false); levelSystemPanel.SetActive(false); levelSystemPanel.GetComponent<CanvasGroup>().interactable = true; alertResetPointPanel.SetActive(false); friendsListPanel.SetActive(false); friendsListPanel.GetComponent<CanvasGroup>().interactable = true; alertResetPointPanel.SetActive(false); addFriendAlert.SetActive(false); UI.SetActive(false); LevelSystem.Instance.cancelDepositPoints(); DonatShop_API.HidePanel(); } public static void Show() { ShowNavigationPanel(); navigationPanel.SetActive(true); UI.SetActive(true); } public static void updateExpBar() { if (DisableExpBar) { ((Component)Exp).gameObject.SetActive(false); } int level = LevelSystem.Instance.getLevel(); long currentExp = LevelSystem.Instance.getCurrentExp(); long needExp = LevelSystem.Instance.getNeedExp(); if (!DisableExpBar || EpicMMOSystem.oldExpBar.Value) { string text = ((float)currentExp / (float)needExp * 100f).ToString("0.00"); eLevelText.text = string.Format("{0} {1}", localization["$lvl"], level); eExpText.text = text.Replace(',', '.') + " %"; eBarImage.fillAmount = (float)currentExp / (float)needExp; currentLVL = level; } } internal static void InitHudPanel() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) expPanel = expPanelRoot.Find("EpicHudPanel"); expPanelBackground = ((Component)expPanel.Find("Background")).gameObject; expPanelBackgroundColor = ((Graphic)expPanelBackground.GetComponent<Image>()).color; ((Component)expPanelRoot).GetComponent<CanvasScaler>().scaleFactor = EpicMMOSystem.HudBarScale.Value; if (EpicMMOSystem.HudExpBackgroundCol.Value == "none") { expPanelBackground.SetActive(false); } else { expPanelBackgroundColor = ColorUtil.GetColorFromHex(EpicMMOSystem.HudExpBackgroundCol.Value); } eLevelText = ((Component)expPanel.Find("Container/Exp/Lvl")).GetComponent<Text>(); eExpText = ((Component)expPanel.Find("Container/Exp/Exp")).GetComponent<Text>(); Exp = expPanel.Find("Container/Exp"); eBarImage = ((Component)expPanel.Find("Container/Exp/Bar/Fill")).GetComponent<Image>(); hpText = ((Component)expPanel.Find("Container/Hp/Text")).GetComponent<Text>(); hpFill = expPanel.Find("Container/Hp/Bar/Fill"); hpImage = ((Component)hpFill).GetComponent<Image>(); hpFillColor = ((Graphic)hpImage).color; hp = expPanel.Find("Container/Hp"); staminaText = ((Component)expPanel.Find("Container/Stamina/Text")).GetComponent<Text>(); staminaBarFill = expPanel.Find("Container/Stamina/Bar/Fill"); staminaImage = ((Component)staminaBarFill).GetComponent<Image>(); staminaBarColor = ((Graphic)staminaImage).color; stamina = expPanel.Find("Container/Stamina"); EitrTran = expPanel.Find("Container/Eitr"); EitrGameObj = ((Component)expPanel.Find("Container/Eitr")).gameObject; Eitr = ((Component)expPanel.Find("Container/Eitr/Text")).GetComponent<Text>(); EitrFill = expPanel.Find("Container/Eitr/Bar/Fill"); EitrImage = ((Component)EitrFill).GetComponent<Image>(); EitrBarColor = ((Graphic)EitrImage).color; } private static void InitFriendsList() { //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Expected O, but got Unknown //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_0272: Expected O, but got Unknown //IL_02c4: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Expected O, but got Unknown friendsListPanel = ((Component)UI.transform.Find("Canvas/FriendList")).gameObject; ((Component)friendsListPanel.transform.Find("Background")).gameObject.AddComponent<DragMenu>().menu = friendsListPanel.transform; ((Component)friendsListPanel.transform.Find("Header")).gameObject.AddComponent<DragMenu>().menu = friendsListPanel.transform; ((Component)friendsListPanel.transform.Find("Header/Text")).GetComponent<Text>().text = localization["$friends_list"]; friendsCell = EpicMMOSystem._asset.LoadAsset<GameObject>("FriendCell"); ((Graphic)((Component)friendsListPanel.transform.Find("Border")).GetComponent<Image>()).raycastTarget = false; ((UnityEvent)((Component)friendsListPanel.transform.Find("Add")).GetComponent<Button>().onClick).AddListener(new UnityAction(clickButtonAdd)); headerInvited = ((Component)friendsListPanel.transform.Find("Scroll View/Viewport/Content/HeaderInvited")).gameObject; headerInvited.SetActive(false); contentInvited = ((Component)friendsListPanel.transform.Find("Scroll View/Viewport/Content/Invited")).gameObject; headerFriends = ((Component)friendsListPanel.transform.Find("Scroll View/Viewport/Content/HeaderFriends")).gameObject; contentFriends = ((Component)friendsListPanel.transform.Find("Scroll View/Viewport/Content/Friends")).gameObject; ((Component)headerInvited.transform.Find("Text")).GetComponent<Text>().text = localization["$invited"]; ((Component)headerFriends.transform.Find("Text")).GetComponent<Text>().text = localization["$friends"]; addFriendAlert = ((Component)UI.transform.Find("Canvas/SendInvite")).gameObject; textField = ((Component)addFriendAlert.transform.Find("InputField")).GetComponent<InputField>(); ((Component)((Component)textField).transform.Find("Placeholder")).GetComponent<Text>().text = ""; ((UnityEvent)((Component)addFriendAlert.transform.Find("Buttons/Send")).GetComponent<Button>().onClick).AddListener(new UnityAction(clickButtonSend)); ((Component)addFriendAlert.transform.Find("Buttons/Send/Text")).GetComponent<Text>().text = localization["$send"]; ((UnityEvent)((Component)addFriendAlert.transform.Find("Buttons/Cancel")).GetComponent<Button>().onClick).AddListener(new UnityAction(clickButtonCancel)); ((Component)addFriendAlert.transform.Find("Buttons/Cancel/Text")).GetComponent<Text>().text = localization["$cancel"]; sprites.Add(EpicMMOSystem._asset.LoadAsset<Sprite>("manIcon")); for (int i = 1; i < 15; i++) { sprites.Add(EpicMMOSystem._asset.LoadAsset<Sprite>($"Class{i}")); } } private static void updateList() { updateFriendsList(); updateInviteList(); } private static void updateFriendsList() { //IL_005a: 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_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) if (friendsCells.Count > 0) { friendsCells.ForEach(delegate(FriendsCell f) { f.Destroy(); }); friendsCells.Clear(); } Dictionary<string, PlayerInfo> dictionary = new Dictionary<string, PlayerInfo>(); foreach (PlayerInfo player in ZNet.instance.GetPlayerList()) { dictionary.Add(player.m_name, player); } Dictionary<string, FriendInfo> dictionary2 = new Dictionary<string, FriendInfo>(friendsData.getFriends()); headerFriends.SetActive(dictionary2.Count > 0); List<FriendInfo> list = new List<FriendInfo>(); foreach (KeyValuePair<string, FriendInfo> item3 in dictionary2) { if (dictionary.ContainsKey(item3.Key)) { PlayerInfo info = dictionary[item3.Key]; GameObject val = Object.Instantiate<GameObject>(friendsCell, contentFriends.transform); if (Object.op_Implicit((Object)(object)val)) { FriendsCell item = new FriendsCell(val, item3.Value, info, FriendsCell.StatusFriend.online); friendsCells.Add(item); } } else { list.Add(item3.Value); } } foreach (FriendInfo item4 in list) { GameObject val2 = Object.Instantiate<GameObject>(friendsCell, contentFriends.transform); if (Object.op_Implicit((Object)(object)val2)) { FriendsCell item2 = new FriendsCell(val2, item4, default(PlayerInfo), FriendsCell.StatusFriend.offline); friendsCells.Add(item2); } } } private static void updateInviteList() { //IL_0093: Unknown result type (might be due to invalid IL or missing references) if (inviteCells.Count > 0) { inviteCells.ForEach(delegate(FriendsCell f) { f.Destroy(); }); inviteCells.Clear(); } headerInvited.SetActive(inviteList.Count > 0); foreach (KeyValuePair<FriendInfo, PlayerInfo> invite in inviteList) { GameObject val = Object.Instantiate<GameObject>(friendsCell, contentInvited.transform); if (Object.op_Implicit((Object)(object)val)) { FriendsCell item = new FriendsCell(val, invite.Key, invite.Value, FriendsCell.StatusFriend.invite); inviteCells.Add(item); } } } public static void addInviteFriend(FriendInfo info, PlayerInfo playerInfo) { //IL_004f: Unknown result type (might be due to invalid IL or missing references) foreach (KeyValuePair<FriendInfo, PlayerInfo> invite in inviteList) { if (invite.Key.name == info.name) { return; } } inviteList.Add(info, playerInfo); updateInviteList(); } private static bool hasInvite() { return inviteList.Count > 0; } public static void acceptInvited(FriendInfo friendInfo) { friendsData.addFriends(friendInfo); if (friendsListPanel.activeSelf) { updateList(); } } private static void clickButtonAdd() { friendsListPanel.GetComponent<CanvasGroup>().interactable = false; textField.SetTextWithoutNotify(""); addFriendAlert.SetActive(true); } private static void clickButtonSend() { string text = textField.text ?? ""; foreach (KeyValuePair<FriendInfo, PlayerInfo> invite in inviteList) { if (invite.Key.name == text) { return; } } if (!(text == Player.m_localPlayer.GetPlayerName()) && !friendsData.getFriends().ContainsKey(text)) { FriendsSystem.inviteFriend(text); friendsListPanel.GetComponent<CanvasGroup>().interactable = true; addFriendAlert.SetActive(false); } } private static void clickButtonCancel() { friendsListPanel.GetComponent<CanvasGroup>().interactable = true; addFriendAlert.SetActive(false); } private static void InitLevelSystem() { //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Expected O, but got Unknown //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Expected O, but got Unknown //IL_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Expected O, but got Unknown //IL_0325: Unknown result type (might be due to invalid IL or missing references) //IL_032f: Expected O, but got Unknown //IL_0381: Unknown result type (might be due to invalid IL or missing references) //IL_038b: Expected O, but got Unknown levelSystemPanel = ((Component)UI.transform.Find("Canvas/PointPanel")).gameObject; levelSystemPanelRoot = ((Component)UI.transform.Find("Canvas")).gameObject; levelSystemPanelRoot.GetComponent<CanvasScaler>().scaleFactor = EpicMMOSystem.LevelHudGroupScale.Value; ((Component)levelSystemPanel.transform.Find("Header/Text")).GetComponent<Text>().text = localization["$attributes"]; DragWindowCntrl.ApplyDragWindowCntrl(levelSystemPanel); alertResetPointPanel = ((Component)UI.transform.Find("Canvas/ApplyReset")).gameObject; alertResetPointText = ((Component)alertResetPointPanel.transform.Find("Text")).GetComponent<Text>(); ((UnityEvent)((Component)alertResetPointPanel.transform.Find("Buttons/Yes")).GetComponent<Button>().onClick).AddListener(new UnityAction(ResetYes)); ((Component)alertResetPointPanel.transform.Find("Buttons/Yes/Text")).GetComponent<Text>().text = localization["$yes"]; ((UnityEvent)((Component)alertResetPointPanel.transform.Find("Buttons/No")).GetComponent<Button>().onClick).AddListener(new UnityAction(ResetNo)); ((Component)alertResetPointPanel.transform.Find("Buttons/No/Text")).GetComponent<Text>().text = localization["$no"]; Transform head = levelSystemPanel.transform.Find("Points/ListStat/Strength"); parameterButtons.Add(new ParameterButton(head, Parameter.Strength)); Transform head2 = levelSystemPanel.transform.Find("Points/ListStat/Dexterity"); parameterButtons.Add(new ParameterButton(head2, Parameter.Agility)); Transform head3 = levelSystemPanel.transform.Find("Points/ListStat/Intelect"); parameterButtons.Add(new ParameterButton(head3, Parameter.Intellect)); Transform head4 = levelSystemPanel.transform.Find("Points/ListStat/Endurance"); parameterButtons.Add(new ParameterButton(head4, Parameter.Body)); Transform head5 = levelSystemPanel.transform.Find("Points/ListStat/Vigour"); parameterButtons.Add(new ParameterButton(head5, Parameter.Vigour)); Transform head6 = levelSystemPanel.transform.Find("Points/ListStat/Specializing"); parameterButtons.Add(new ParameterButton(head6, Parameter.Special)); freePointsPanel = ((Component)levelSystemPanel.transform.Find("Points/FreePoints")).gameObject; freePointsText = ((Component)levelSystemPanel.transform.Find("Points/FreePoints/Text")).GetComponent<Text>(); ((UnityEvent)((Component)freePointsPanel.transform.Find("Cancel")).GetComponent<Button>().onClick).AddListener(new UnityAction(ClickCancel)); ((Component)freePointsPanel.transform.Find("Cancel/Text")).GetComponent<Text>().text = localization["$cancel"]; ((UnityEvent)((Component)freePointsPanel.transform.Find("Apply")).GetComponent<Button>().onClick).AddListener(new UnityAction(ClickApply)); ((Component)freePointsPanel.transform.Find("Apply/Text")).GetComponent<Text>().text = localization["$apply"]; ((UnityEvent)((Component)levelSystemPanel.transform.Find("Points/ResetButton/Button")).GetComponent<Button>().onClick).AddListener(new UnityAction(ResetParameters)); ((Component)levelSystemPanel.transform.Find("Points/ResetButton/Button/Text")).GetComponent<Text>().text = localization["$reset_parameters"]; currentLevelText = ((Component)levelSystemPanel.transform.Find("CurrentLevel/Content/Lvl")).GetComponent<Text>(); expText = ((Component)levelSystemPanel.transform.Find("CurrentLevel/Content/Exp")).GetComponent<Text>(); Transform obj = levelSystemPanel.transform.Find("DescriptionStats/Scroll View/Viewport/Content"); ((Component)((Component)obj).transform.Find("HeaderDamage/Text")).GetComponent<Text>().text = localization["$damage"]; ((Component)((Component)obj).transform.Find("HeaderDefence/Text")).GetComponent<Text>().text = localization["$armor"]; ((Component)((Component)obj).transform.Find("HeaderSurv/Text")).GetComponent<Text>().text = localization["$survival"]; ((Component)((Component)obj).transform.Find("HeaderOther/Text")).GetComponent<Text>().text = localization["$specialother"]; physicDamageText = ((Component)((Component)obj).transform.Find("PhysicDamage")).GetComponent<Text>(); addWeightText = ((Component)((Component)obj).transform.Find("Weight")).GetComponent<Text>(); reducedStaminaBlockText = ((Component)((Component)obj).transform.Find("StaminaBlock")).GetComponent<Text>(); criticalDmgMultText = ((Component)((Component)obj).transform.Find("CriticalDmg")).GetComponent<Text>(); attackSpeedMultiText = ((Component)((Component)obj).transform.Find("SpeedAttack")).GetComponent<Text>(); attackStamina = ((Component)((Component)obj).transform.Find("AttackStamina")).GetComponent<Text>(); reducedStaminaText = ((Component)((Component)obj).transform.Find("StaminaReduction")).GetComponent<Text>(); magicDamageText = ((Component)((Component)obj).transform.Find("MagicDamage")).GetComponent<Text>(); magicEitrRegText = ((Component)((Component)obj).transform.Find("EitrReg")).GetComponent<Text>(); eitrIncreaseText = ((Component)((Component)obj).transform.Find("EitrIncr")).GetComponent<Text>(); physicArmorText = ((Component)((Component)obj).transform.Find("DamageReduction")).GetComponent<Text>(); staminaRegen = ((Component)((Component)obj).transform.Find("StaminaRegeneration")).GetComponent<Text>(); addStaminaText = ((Component)((Component)obj).transform.Find("Stamina")).GetComponent<Text>(); addHpText = ((Component)((Component)obj).transform.Find("Hp")).GetComponent<Text>(); regenHpText = ((Component)((Component)obj).transform.Find("HpRegeneration")).GetComponent<Text>(); magicArmorText = ((Component)((Component)obj).transform.Find("MagicDamageReduction")).GetComponent<Text>(); criticalChanceText = ((Component)((Component)obj).transform.Find("CriticalChance")).GetComponent<Text>(); miningSpeedText = ((Component)((Component)obj).transform.Find("MiningSpeed")).GetComponent<Text>(); addpieceHealthText = ((Component)((Component)obj).transform.Find("ConstructionPieceHealth")).GetComponent<Text>(); treeCuttingSpeedText = ((Component)((Component)obj).transform.Find("TreeCutting")).GetComponent<Text>(); } private static void ClickCancel() { LevelSystem.Instance.cancelDepositPoints(); levelSystemPanel.SetActive(false); } private static void ClickApply() { LevelSystem.Instance.applyDepositPoints(); levelSystemPanel.SetActive(false); } private static void ResetParameters() { string value = EpicMMOSystem.viewTextCoins.Value; int priceResetPoints = LevelSystem.Instance.getPriceResetPoints(); string format = localization["$reset_point_text"]; alertResetPointText.text = string.Format(format, priceResetPoints, value); levelSystemPanel.GetComponent<CanvasGroup>().interactable = false; alertResetPointPanel.SetActive(true); } private static void ResetYes() { ResetNo(); LevelSystem.Instance.ResetAllParameterPayment(); } private static void ResetNo() { alertResetPointPanel.SetActive(false); levelSystemPanel.GetComponent<CanvasGroup>().interactable = true; } public static void UpdateParameterPanel() { int points = LevelSystem.Instance.getFreePoints(); bool flag = LevelSystem.Instance.hasDepositPoints(); parameterButtons.ForEach(delegate(ParameterButton p) { p.UpdateParameters(points); }); freePointsPanel.SetActive(points > 0 || flag); freePointsText.text = string.Format("{0}: {1}", localization["$free_points"], points); currentLevelText.text = string.Format("{0}: {1}", localization["$level"], LevelSystem.Instance.getLevel()); long currentExp = LevelSystem.Instance.getCurrentExp(); long needExp = LevelSystem.Instance.getNeedExp(); string arg = localization["$exp"]; expText.text = $"{arg}: {currentExp} / {needExp}"; physicDamageText.text = string.Format("{0}: +{1}%", localization["$physic_damage"], LevelSystem.Instance.getAddPhysicDamage()); addWeightText.text = string.Format("{0}: +{1}", localization["$add_weight"], LevelSystem.Instance.getAddWeight()); reducedStaminaBlockText.text = string.Format("{0}: -{1}%", localization["$reduced_stamina_block"], LevelSystem.Instance.getReducedStaminaBlock()); criticalDmgMultText.text = string.Format("{0}: +{1}%", localization["$crtcDmgMulti"], LevelSystem.Instance.getAddCriticalDmg()); attackSpeedMultiText.text = string.Format("{0}: +{1}%", localization["$attack_speed"], LevelSystem.Instance.getAddAttackSpeed()); attackStamina.text = string.Format("{0}: -{1}%", localization["$attack_stamina"], LevelSystem.Instance.getAttackStamina()); reducedStaminaText.text = string.Format("{0}: -{1}%", localization["$reduced_stamina"], LevelSystem.Instance.getStaminaReduction()); magicDamageText.text = string.Format("{0}: +{1}%", localization["$magic_damage"], LevelSystem.Instance.getAddMagicDamage()); eitrIncreaseText.text = string.Format("{0}: +{1}", localization["$add_eitr"], LevelSystem.Instance.getAddEitr()); magicEitrRegText.text = string.Format("{0}: +{1}%", localization["$regen_eitr"], LevelSystem.Instance.getEitrRegen()); physicArmorText.text = string.Format("{0}: +{1}%", localization["$physic_armor"], LevelSystem.Instance.getAddPhysicArmor()); staminaRegen.text = string.Format("{0}: +{1}%", localization["$stamina_reg"], LevelSystem.Instance.getStaminaRegen()); addStaminaText.text = string.Format("{0}: +{1}", localization["$add_stamina"], LevelSystem.Instance.getAddStamina()); addHpText.text = string.Format("{0}: +{1}", localization["$add_hp"], LevelSystem.Instance.getAddHp()); regenHpText.text = string.Format("{0}: +{1}%", localization["$regen_hp"], LevelSystem.Instance.getAddRegenHp()); magicArmorText.text = string.Format("{0}: +{1}%", localization["$magic_armor"], LevelSystem.Instance.getAddMagicArmor()); criticalChanceText.text = string.Format("{0}: +{1}%", localization["$crit_chance"], LevelSystem.Instance.getAddCriticalChance()); miningSpeedText.text = string.Format("{0}: +{1}%", localization["$mining_speed"], LevelSystem.Instance.getaddMiningDmg()); addpieceHealthText.text = string.Format("{0}: +{1}", localization["$piece_health"], LevelSystem.Instance.getAddPieceHealth()); treeCuttingSpeedText.text = string.Format("{0}: +{1}%", localization["$tree_cutting"], LevelSystem.Instance.getAddTreeCuttingDmg()); } private static void InitNavigationPanel() { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Expected O, but got Unknown //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Expected O, but got Unknown //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Expected O, but got Unknown //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Expected O, but got Unknown //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Expected O, but got Unknown navigationPanel = ((Component)UI.transform.Find("Canvas/NavigatePanel")).gameObject; buttonLevelSystem = navigationPanel.transform.Find("Buttons/ButtonLevelSystem"); ((UnityEvent)((Component)buttonLevelSystem).GetComponent<Button>().onClick).AddListener(new UnityAction(ClickButtonLevelSystem)); DragWindowCntrl.ApplyDragWindowCntrl(navigationPanel); buttonFriendsList = navigationPanel.transform.Find("Buttons/ButtonFriends"); ((UnityEvent)((Component)buttonFriendsList).GetComponent<Button>().onClick).AddListener(new UnityAction(ClickButtonFriendsList)); if (Marketplace_API.IsInstalled()) { buttonQuestPanel = navigationPanel.transform.Find("Buttons/ButtonQuests"); ((UnityEvent)((Component)buttonQuestPanel).GetComponent<Button>().onClick).AddListener(new UnityAction(ClickQuestPanel)); ((Component)buttonQuestPanel).gameObject.SetActive(true); } if (Professions_API.IsInstalled()) { buttonProfessionsPanel = navigationPanel.transform.Find("Buttons/ButtonProffesions"); ((UnityEvent)((Component)buttonProfessionsPanel).GetComponent<Button>().onClick).AddListener(new UnityAction(ClickProfessionsPanel)); ((Component)buttonProfessionsPanel).gameObject.SetActive(true); } if (DonatShop_API.IsInstalled()) { buttonShopPanel = navigationPanel.transform.Find("Buttons/ButtonShop"); ((UnityEvent)((Component)buttonShopPanel).GetComponent<Button>().onClick).AddListener(new UnityAction(ClickButtonDonatShop)); ((Component)buttonShopPanel).gameObject.SetActive(true); } } private static void ClickButtonLevelSystem() { if (!levelSystemPanel.activeSelf) { UpdateParameterPanel(); } levelSystemPanel.SetActive(!levelSystemPanel.activeSelf); } private static void ClickButtonFriendsList() { if (!friendsListPanel.activeSelf) { updateList(); } friendsListPanel.SetActive(!friendsListPanel.activeSelf); } private static void ClickButtonDonatShop() { DonatShop_API.OpenShop(); } private static void ClickQuestPanel() { Marketplace_API.OpenQuestJournal(); } private static void ClickProfessionsPanel() { Professions_API.showProfessions(); } private static void ShowNavigationPanel() { int freePoints = LevelSystem.Instance.getFreePoints(); ((Component)buttonLevelSystem.GetChild(0)).gameObject.SetActive(freePoints > 0); ((Component)buttonFriendsList.GetChild(0)).gameObject.SetActive(hasInvite()); } } public class DragMenu : MonoBehaviour, IDragHandler, IEventSystemHandler { [<28f2501a-2654-4601-a73e-34b637b0459d>Nullable(1)] public Transform menu; [<8e82bed1-12f2-4cdb-baa0-fc8d4271746a>NullableContext(1)] public void OnDrag(PointerEventData eventData) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) Transform obj = menu; obj.position += Vector2.op_Implicit(eventData.delta); } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("z0rder.EpicMMOSystem", "EpicMMOSystem", "1.1.2")] [<28f2501a-2654-4601-a73e-34b637b0459d>Nullable(0)] [<8e82bed1-12f2-4cdb-baa0-fc8d4271746a>NullableContext(1)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class EpicMMOSystem : BaseUnityPlugin { [<8e82bed1-12f2-4cdb-baa0-fc8d4271746a>NullableContext(0)] [HarmonyPatch(typeof(ZNetScene), "Awake")] private static class InitCustomItemsClass { [<8e82bed1-12f2-4cdb-baa0-fc8d4271746a>NullableContext(1)] private static void Postfix(ZNetScene __instance) { GameObject val = _asset.LoadAsset<GameObject>("LevelUpVFX"); __instance.m_prefabs.Add(val); __instance.m_namedPrefabs.Add(StringExtensionMethods.GetStableHashCode(((Object)val).name), val); } } [<8e82bed1-12f2-4cdb-baa0-fc8d4271746a>NullableContext(0)] [HarmonyPatch(typeof(Player), "GetKnownTexts")] private static class FixCompendium { private static void Postfix([<28f2501a-2654-4601-a73e-34b637b0459d>Nullable(new byte[] { 1, 0, 1, 1 })] ref List<KeyValuePair<string, string>> __result) { __result = __result.Where((KeyValuePair<string, string> p) => !p.Key.StartsWith("EpicMMOSystem")).ToList(); } } [<8e82bed1-12f2-4cdb-baa0-fc8d4271746a>NullableContext(0)] [HarmonyPatch(typeof(ObjectDB), "Awake")] internal static class DBPatMMO { internal static void Postfix() { //IL_00d4: 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) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Expected O, but got Unknown //IL_00fe: 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_010a: 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_0129: Expected O, but got Unknown //IL_016e: 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_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Expected O, but got Unknown //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Expected O, but got Unknown ObjectDB instance = ObjectDB.m_instance; if ((Object)(object)instance.GetItemPrefab("Wood") == (Object)null) { return; } Mead1Alt = ScriptableObject.CreateInstance<Recipe>(); Mead2Alt = ScriptableObject.CreateInstance<Recipe>(); Mead3Alt = ScriptableObject.CreateInstance<Recipe>(); ((Object)Mead1Alt).name = "MMO_Recipe_Mead1Alt"; ((Object)Mead2Alt).name = "MMO_Recipe_Mead2Alt"; ((Object)Mead3Alt).name = "MMO_Recipe_Mead3Alt"; CraftingStation[] array = Resources.FindObjectsOfTypeAll<CraftingStation>(); CraftingStation craftingStation = null; CraftingStation[] array2 = array; foreach (CraftingStation val in array2) { if (((Object)val).name == "piece_cauldron") { craftingStation = val; } } Mead1Alt.m_craftingStation = craftingStation; Mead2Alt.m_craftingStation = craftingStation; Mead3Alt.m_craftingStation = craftingStation; Mead1Alt.m_item = Mead1D; List<Requirement> list = new List<Requirement>(); Requirement item = new Requirement { m_amount = 1, m_recover = true, m_resItem = instance.GetItemPrefab("Mob_chunks").GetComponent<ItemDrop>() }; Requirement item2 = new Requirement { m_amount = 1, m_recover = true, m_resItem = instance.GetItemPrefab("mmo_orb2").GetComponent<ItemDrop>() }; list.Add(item); list.Add(item2); Mead1Alt.m_resources = list.ToArray(); instance.m_recipes.Add(Mead1Alt); Mead2Alt.m_item = Mead2D; List<Requirement> list2 = new List<Requirement>(); Requirement item3 = new Requirement { m_amount = 1, m_recover = true, m_resItem = instance.GetItemPrefab("mmo_orb4").GetComponent<ItemDrop>() }; list2.Add(item); list2.Add(item3); Mead2Alt.m_resources = list2.ToArray(); instance.m_recipes.Add(Mead2Alt); Mead3Alt.m_item = Mead3D; List<Requirement> list3 = new List<Requirement>(); Requirement item4 = new Requirement { m_amount = 1, m_recover = true, m_resItem = instance.GetItemPrefab("mmo_orb6").GetComponent<ItemDrop>() }; list3.Add(item); list3.Add(item4); Mead3Alt.m_resources = list3.ToArray(); instance.m_recipes.Add(Mead3Alt); } } [<8e82bed1-12f2-4cdb-baa0-fc8d4271746a>NullableContext(0)] [HarmonyPatch(typeof(ZNetScene), "Awake")] private static class ZRouteAwake { private static void Postfix() { NetisActive = true; GameObject[] array = Resources.FindObjectsOfTypeAll<GameObject>(); foreach (GameObject val in array) { if (((Object)val).name.Contains("fx_seeker_hurt")) { fx_seeker_crit = val; } } } } [<8e82bed1-12f2-4cdb-baa0-fc8d4271746a>NullableContext(0)] private class ConfigurationManagerAttributes { public bool? Browsable = false; } internal const string ModName = "EpicMMOSystem"; internal const string ModVersion = "1.1.2"; internal const string Author = "z0rder"; private const string ModGUID = "z0rder.EpicMMOSystem"; private static string ConfigFileName = "z0rder.EpicMMOSystem.cfg"; private static string ConfigFileFullPath; inte