Decompiled source of Eclipse v1.3.14
Eclipse.dll
Decompiled a month 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.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Cryptography; using System.Security.Permissions; using System.Text; using System.Text.Json; using System.Text.Json.Serialization; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Configuration; using BepInEx.Core.Logging.Interpolation; using BepInEx.Logging; using BepInEx.Unity.IL2CPP; using BepInEx.Unity.IL2CPP.Utils.Collections; using BloodcraftEclipseBridge.Messages; using Eclipse.Patches; using Eclipse.Resources; using Eclipse.Resources.Localization; using Eclipse.Services; using Eclipse.Utilities; using HarmonyLib; using Il2CppInterop.Runtime; using Il2CppInterop.Runtime.InteropTypes.Arrays; using Il2CppSystem; using Il2CppSystem.Collections.Generic; using Il2CppSystem.Text; using Microsoft.CodeAnalysis; using MonoMod.Utils; using ProjectM; using ProjectM.Gameplay.Systems; using ProjectM.Hybrid; using ProjectM.Network; using ProjectM.Physics; using ProjectM.Scripting; using ProjectM.Shared; using ProjectM.UI; using StunShared.UI; using Stunlock.Core; using Stunlock.Localization; using TMPro; using Unity.Collections; using Unity.Entities; using Unity.Mathematics; using Unity.Transforms; using UnityEngine; using UnityEngine.Events; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")] [assembly: AssemblyCompany("Eclipse")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.3.14.0")] [assembly: AssemblyInformationalVersion("1.3.14+cbcdf58ff580e1f686334ff04ee7ef3998002358")] [assembly: AssemblyProduct("Eclipse")] [assembly: AssemblyTitle("Eclipse")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.3.14.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [CompilerGenerated] internal sealed class <>z__ReadOnlyList<T> : IEnumerable, ICollection, IList, IEnumerable<T>, IReadOnlyCollection<T>, IReadOnlyList<T>, ICollection<T>, IList<T> { int ICollection.Count => _items.Count; bool ICollection.IsSynchronized => false; object ICollection.SyncRoot => this; object IList.this[int index] { get { return _items[index]; } set { throw new NotSupportedException(); } } bool IList.IsFixedSize => true; bool IList.IsReadOnly => true; int IReadOnlyCollection<T>.Count => _items.Count; T IReadOnlyList<T>.this[int index] => _items[index]; int ICollection<T>.Count => _items.Count; bool ICollection<T>.IsReadOnly => true; T IList<T>.this[int index] { get { return _items[index]; } set { throw new NotSupportedException(); } } public <>z__ReadOnlyList(List<T> items) { _items = items; } IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable)_items).GetEnumerator(); } void ICollection.CopyTo(Array array, int index) { ((ICollection)_items).CopyTo(array, index); } int IList.Add(object? value) { throw new NotSupportedException(); } void IList.Clear() { throw new NotSupportedException(); } bool IList.Contains(object? value) { return ((IList)_items).Contains(value); } int IList.IndexOf(object? value) { return ((IList)_items).IndexOf(value); } void IList.Insert(int index, object? value) { throw new NotSupportedException(); } void IList.Remove(object? value) { throw new NotSupportedException(); } void IList.RemoveAt(int index) { throw new NotSupportedException(); } IEnumerator<T> IEnumerable<T>.GetEnumerator() { return ((IEnumerable<T>)_items).GetEnumerator(); } void ICollection<T>.Add(T item) { throw new NotSupportedException(); } void ICollection<T>.Clear() { throw new NotSupportedException(); } bool ICollection<T>.Contains(T item) { return _items.Contains(item); } void ICollection<T>.CopyTo(T[] array, int arrayIndex) { _items.CopyTo(array, arrayIndex); } bool ICollection<T>.Remove(T item) { throw new NotSupportedException(); } int IList<T>.IndexOf(T item) { return _items.IndexOf(item); } void IList<T>.Insert(int index, T item) { throw new NotSupportedException(); } void IList<T>.RemoveAt(int index) { throw new NotSupportedException(); } } namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace Eclipse { internal static class Core { private static World _client; private static SystemService _systemService; private static Entity _localCharacter = Entity.Null; private static Entity _localUser = Entity.Null; private static MonoBehaviour _monoBehaviour; public static bool _initialized; public static Entity LocalCharacter { get { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0023: 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) if (!_localCharacter.Exists()) { if (!ConsoleShared.TryGetLocalCharacterInCurrentWorld(ref _localCharacter, _client)) { return Entity.Null; } return _localCharacter; } return _localCharacter; } } public static Entity LocalUser { get { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0023: 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) if (!_localUser.Exists()) { if (!ConsoleShared.TryGetLocalUserInCurrentWorld(ref _localUser, _client)) { return Entity.Null; } return _localUser; } return _localUser; } } public static EntityManager EntityManager => _client.EntityManager; public static SystemService SystemService => _systemService ?? (_systemService = new SystemService(_client)); public static ClientGameManager ClientGameManager => SystemService.ClientScriptMapper._ClientGameManager; public static CanvasService CanvasService { get; set; } public static ServerTime ServerTime => ClientGameManager.ServerTime; public static ManualLogSource Log => Plugin.LogInstance; public static byte[] NEW_SHARED_KEY { get; set; } public static bool HasInitialized => _initialized; public static void Initialize(GameDataManager __instance) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) if (!_initialized) { _client = ((ComponentSystemBase)__instance).World; new LocalizationService(); NEW_SHARED_KEY = Convert.FromBase64String(SecretManager.GetNewSharedKey()); Entity entity = default(Entity); if (SystemService.PrefabCollectionSystem._PrefabGuidToEntityMap.TryGetValue(PrefabGUIDs.SetBonus_AllLeech_T09, ref entity) && entity.TryGetBuffer<ModifyUnitStatBuff_DOTS>(out DynamicBuffer<ModifyUnitStatBuff_DOTS> dynamicBuffer)) { dynamicBuffer.Clear(); } ShadowMatter.GatherShadows().Run(); _initialized = true; } } public static void Reset() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) ShadowMatter.UnloadAssets(); _client = null; _systemService = null; CanvasService = null; _initialized = false; _localCharacter = Entity.Null; _localUser = Entity.Null; } public static void SetCanvas(UICanvasBase canvas) { CanvasService = new CanvasService(canvas); } public static Coroutine StartCoroutine(IEnumerator routine) { //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) //IL_0027: Expected O, but got Unknown if ((Object)(object)_monoBehaviour == (Object)null) { GameObject val = new GameObject("Eclipse"); _monoBehaviour = (MonoBehaviour)(object)val.AddComponent<IgnorePhysicsDebugSystem>(); Object.DontDestroyOnLoad((Object)val); } return _monoBehaviour.StartCoroutine(CollectionExtensions.WrapToIl2Cpp(routine)); } public static void StopCoroutine(Coroutine routine) { if (!((Object)(object)_monoBehaviour == (Object)null)) { _monoBehaviour.StopCoroutine(routine); } } public static void DumpEntity(this Entity entity) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Expected O, but got Unknown //IL_000b: 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_0023: Expected O, but got Unknown StringBuilder val = new StringBuilder(); bool flag = default(bool); try { EntityDebuggingUtility.DumpEntity(_client, entity, true, val); ManualLogSource log = Log; BepInExInfoLogInterpolatedStringHandler val2 = new BepInExInfoLogInterpolatedStringHandler(13, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("Entity Dump:\n"); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(((Object)val).ToString()); } log.LogInfo(val2); } catch (Exception ex) { ManualLogSource log2 = Log; BepInExWarningLogInterpolatedStringHandler val3 = new BepInExWarningLogInterpolatedStringHandler(0, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<Exception>(ex); } log2.LogWarning(val3); } } private static AssetGuid GetAssetGuid(string textString) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) using SHA256 sHA = SHA256.Create(); byte[] array = sHA.ComputeHash(Encoding.UTF8.GetBytes(textString)); return AssetGuid.FromGuid(new Guid(Il2CppStructArray<byte>.op_Implicit(array[..16]))); } public static LocalizationKey LocalizeString(string text) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: 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_0013: 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_0029: 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) AssetGuid assetGuid = GetAssetGuid(text); if (Localization.Initialized) { if (!Localization._LocalizedStrings.TryAdd(assetGuid, text)) { Localization._LocalizedStrings[assetGuid] = text; } return new LocalizationKey(assetGuid); } Log.LogWarning((object)"Stunlock.Localization isn't ready yet!"); return LocalizationKey.Empty; } public static EntityQuery BuildEntityQuery(this EntityManager entityManager, ComponentType[] all, EntityQueryOptions options) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: 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_001e: 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_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) EntityQueryBuilder val = default(EntityQueryBuilder); ((EntityQueryBuilder)(ref val))..ctor(AllocatorHandle.op_Implicit((Allocator)2)); foreach (ComponentType val2 in all) { ((EntityQueryBuilder)(ref val)).AddAll(val2); } ((EntityQueryBuilder)(ref val)).WithOptions(options); return ((EntityManager)(ref entityManager)).CreateEntityQuery(ref val); } public static Type Il2CppTypeOf<T>() { return Il2CppType.Of<T>(); } } [BepInPlugin("io.zfolmt.Eclipse", "Eclipse", "1.3.14")] [BepInDependency(/*Could not decode attribute arguments.*/)] internal class Plugin : BasePlugin { private Harmony _harmony; private static ConfigEntry<bool> _leveling; private static ConfigEntry<bool> _prestige; private static ConfigEntry<bool> _legacies; private static ConfigEntry<bool> _expertise; private static ConfigEntry<bool> _familiars; private static ConfigEntry<bool> _professions; private static ConfigEntry<bool> _quests; private static ConfigEntry<bool> _shiftSlot; private static ConfigEntry<bool> _eclipsed; private static ConfigEntry<bool> _useEmberglassBridge; internal static Plugin Instance { get; set; } public static ManualLogSource LogInstance => ((BasePlugin)Instance).Log; public static bool Leveling => _leveling.Value; public static bool Prestige => _prestige.Value; public static bool Legacies => _legacies.Value; public static bool Expertise => _expertise.Value; public static bool Familiars => _familiars.Value; public static bool Professions => _professions.Value; public static bool Quests => _quests.Value; public static bool ShiftSlot => _shiftSlot.Value; public static bool Eclipsed => _eclipsed.Value; public static bool UseEmberglassBridge => _useEmberglassBridge.Value; public override void Load() { //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Expected O, but got Unknown //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown Instance = this; bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val; if (Application.productName == "VRisingServer") { ManualLogSource log = Core.Log; val = new BepInExInfoLogInterpolatedStringHandler(22, 3, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>("Eclipse"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("["); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>("1.3.14"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("] is a client mod! ("); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(Application.productName); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(")"); } log.LogInfo(val); return; } _harmony = Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), (string)null); InitConfig(); EmberglassEclipseBridge.Initialize(); ManualLogSource log2 = Core.Log; val = new BepInExInfoLogInterpolatedStringHandler(20, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>("Eclipse"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("["); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>("1.3.14"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("] loaded on client!"); } log2.LogInfo(val); } private static void InitConfig() { _leveling = InitConfigEntry("UIOptions", "ExperienceBar", defaultValue: true, "Enable/Disable the experience bar, requires both ClientCompanion/LevelingSystem to be enabled in Bloodcraft."); _prestige = InitConfigEntry("UIOptions", "ShowPrestige", defaultValue: true, "Enable/Disable showing prestige level in front of experience bar, requires both ClientCompanion/PrestigeSystem to be enabled in Bloodcraft."); _legacies = InitConfigEntry("UIOptions", "LegacyBar", defaultValue: true, "Enable/Disable the legacy bar, requires both ClientCompanion/BloodSystem to be enabled in Bloodcraft."); _expertise = InitConfigEntry("UIOptions", "ExpertiseBar", defaultValue: true, "Enable/Disable the expertise bar, requires both ClientCompanion/ExpertiseSystem to be enabled in Bloodcraft."); _familiars = InitConfigEntry("UIOptions", "Familiars", defaultValue: true, "Enable/Disable showing basic familiar details bar, requires both ClientCompanion/FamiliarSystem to be enabled in Bloodcraft."); _professions = InitConfigEntry("UIOptions", "Professions", defaultValue: true, "Enable/Disable the professions tab, requires both ClientCompanion/ProfessionSystem to be enabled in Bloodcraft."); _quests = InitConfigEntry("UIOptions", "QuestTrackers", defaultValue: true, "Enable/Disable the quest tracker, requires both ClientCompanion/QuestSystem to be enabled in Bloodcraft."); _shiftSlot = InitConfigEntry("UIOptions", "ShiftSlot", defaultValue: true, "Enable/Disable the shift slot, requires both ClientCompanion and shift slot spell to be enabled in Bloodcraft."); _eclipsed = InitConfigEntry("UIOptions", "Eclipsed", defaultValue: true, "Set to false for slower update intervals (0.1s -> 1s) if performance is negatively impacted."); _useEmberglassBridge = InitConfigEntry("UIOptions", "UseEmberglassBridge", defaultValue: false, "Use Emberglass for the Bloodcraft/Eclipse bridge when Emberglass is installed. Falls back to the legacy chat bridge when disabled or unavailable."); } private static ConfigEntry<T> InitConfigEntry<T>(string section, string key, T defaultValue, string description) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) ConfigEntry<T> val = ((BasePlugin)Instance).Config.Bind<T>(section, key, defaultValue, description); string text = Path.Combine(Paths.ConfigPath, "io.zfolmt.Eclipse.cfg"); ConfigEntry<T> val2 = default(ConfigEntry<T>); if (File.Exists(text) && new ConfigFile(text, true).TryGetEntry<T>(section, key, ref val2)) { val.Value = val2.Value; } return val; } public override bool Unload() { _harmony.UnpatchSelf(); return true; } } internal static class VExtensions { public delegate void WithRefHandler<T>(ref T item); private const string EMPTY_KEY = "LocalizationKey.Empty"; private const string PREFIX = "Entity("; private const int LENGTH = 7; private static EntityManager EntityManager => Core.EntityManager; private static ClientGameManager ClientGameManager => Core.ClientGameManager; private static PrefabCollectionSystem PrefabCollectionSystem => Core.SystemService.PrefabCollectionSystem; public static void With<T>(this Entity entity, WithRefHandler<T> action) where T : struct { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0018: 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_0020: Unknown result type (might be due to invalid IL or missing references) if (entity.Has<T>()) { T item = entity.Read<T>(); action(ref item); EntityManager entityManager = EntityManager; ((EntityManager)(ref entityManager)).SetComponentData<T>(entity, item); } } public static void WithEdit<T>(this Entity entity, int index, WithRefHandler<T> action) where T : struct { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Expected O, but got Unknown bool flag = default(bool); if (!entity.TryGetBuffer<T>(out var dynamicBuffer)) { ManualLogSource log = Core.Log; BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(34, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Entity is missing DynamicBuffer<"); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<Type>(typeof(T)); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(">!"); } log.LogWarning(val); } else if (!InventoryExtensions.IsIndexWithinRange<T>(ref dynamicBuffer, index)) { ManualLogSource log2 = Core.Log; BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(37, 4, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Index ("); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(index); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(") OoR ("); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(index); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("/"); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(dynamicBuffer.Length); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(") for DynamicBuffer<"); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<Type>(typeof(T)); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(">!"); } log2.LogWarning(val); } else { T item = dynamicBuffer[index]; action(ref item); dynamicBuffer[index] = item; } } public static void WithInsert<T>(this Entity entity, int index, T element) where T : struct { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Expected O, but got Unknown bool flag = default(bool); if (!entity.TryGetBuffer<T>(out var dynamicBuffer)) { ManualLogSource log = Core.Log; BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(34, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Entity is missing DynamicBuffer<"); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<Type>(typeof(T)); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(">!"); } log.LogWarning(val); } else if (!InventoryExtensions.IsIndexWithinRange<T>(ref dynamicBuffer, index)) { ManualLogSource log2 = Core.Log; BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(37, 4, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Index ("); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(index); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(") OoR ("); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(index); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("/"); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(dynamicBuffer.Length); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(") for DynamicBuffer<"); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<Type>(typeof(T)); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(">!"); } log2.LogWarning(val); } else { dynamicBuffer.Insert(index, element); } } public static void WithAdd<T>(this Entity entity, T element) where T : struct { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown if (!entity.TryGetBuffer<T>(out var dynamicBuffer)) { ManualLogSource log = Core.Log; bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(34, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Entity is missing DynamicBuffer<"); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<Type>(typeof(T)); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(">!"); } log.LogWarning(val); } else { dynamicBuffer.Add(element); } } public static void WithClear<T>(this Entity entity) where T : struct { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown if (!entity.TryGetBuffer<T>(out var dynamicBuffer)) { ManualLogSource log = Core.Log; bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(34, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Entity is missing DynamicBuffer<"); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<Type>(typeof(T)); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(">!"); } log.LogWarning(val); } else { dynamicBuffer.Clear(); } } public static void AddWith<T>(this Entity entity, WithRefHandler<T> action) where T : struct { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) if (!entity.Has<T>()) { entity.Add<T>(); } entity.With(action); } public static void Write<T>(this Entity entity, T componentData) where T : struct { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) if (entity.Has<T>()) { EntityManager entityManager = EntityManager; ((EntityManager)(ref entityManager)).SetComponentData<T>(entity, componentData); } } public static T Read<T>(this Entity entity) where T : struct { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) EntityManager entityManager = EntityManager; T result = default(T); if (!((EntityManager)(ref entityManager)).TryGetComponentData<T>(entity, ref result)) { return default(T); } return result; } public static T Lookup<T>(this Entity entity, ref ComponentLookup<T> componentLookup) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) T result = default(T); if (!componentLookup.TryGetComponent(entity, ref result)) { return default(T); } return result; } public static bool TryGetBuffer<T>(this Entity entity, out DynamicBuffer<T> dynamicBuffer) where T : struct { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) if (GameManager_Shared.TryGetBuffer<T>(EntityManager, entity, ref dynamicBuffer)) { return true; } dynamicBuffer = default(DynamicBuffer<T>); return false; } public static DynamicBuffer<T> ReadBuffer<T>(this Entity entity) where T : struct { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) EntityManager entityManager = EntityManager; return ((EntityManager)(ref entityManager)).GetBuffer<T>(entity, false); } public static DynamicBuffer<T> AddBuffer<T>(this Entity entity) where T : struct { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) EntityManager entityManager = EntityManager; return ((EntityManager)(ref entityManager)).AddBuffer<T>(entity); } public static bool TryGetComponent<T>(this Entity entity, out T componentData) where T : struct { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) componentData = default(T); if (entity.Has<T>()) { componentData = entity.Read<T>(); return true; } return false; } public static bool TryGetComponentObject<T>(this Entity entity, EntityManager entityManager, out T componentObject) where T : class { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) componentObject = null; if (((EntityManager)(ref entityManager)).HasComponent<T>(entity)) { componentObject = ((EntityManager)(ref entityManager)).GetComponentObject<T>(entity); return componentObject != null; } return false; } public static bool Has<T>(this Entity entity) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) EntityManager entityManager = EntityManager; return ((EntityManager)(ref entityManager)).HasComponent<T>(entity); } public static bool HasBuffer<T>(this Entity entity) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) EntityManager entityManager = EntityManager; return ((EntityManager)(ref entityManager)).HasBuffer<T>(entity); } public static string GetPrefabName(this PrefabGUID prefabGUID) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) if (!LocalizationService.PrefabGuidsToNames.TryGetValue(prefabGUID, out var value)) { return "String.Empty"; } return $"{value} {prefabGUID}"; } public static string GetLocalizedName(this PrefabGUID prefabGUID) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) string nameFromGuidString = LocalizationService.GetNameFromGuidString(LocalizationService.GetGuidString(prefabGUID)); if (!string.IsNullOrEmpty(nameFromGuidString)) { return nameFromGuidString; } return "LocalizationKey.Empty"; } public static void Add<T>(this Entity entity) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0008: 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_0010: 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) if (!entity.Has<T>()) { EntityManager entityManager = EntityManager; ((EntityManager)(ref entityManager)).AddComponent(entity, new ComponentType(Il2CppType.Of<T>(), (AccessMode)0)); } } public static void Remove<T>(this Entity entity) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0008: 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_0010: 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) if (entity.Has<T>()) { EntityManager entityManager = EntityManager; ((EntityManager)(ref entityManager)).RemoveComponent(entity, new ComponentType(Il2CppType.Of<T>(), (AccessMode)0)); } } public static bool TryGetFollowedPlayer(this Entity entity, out Entity player) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //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_001b: Unknown result type (might be due to invalid IL or missing references) player = Entity.Null; if (entity.TryGetComponent<Follower>(out Follower componentData) && componentData.Followed._Value.TryGetPlayer(out player)) { return true; } return false; } public static bool TryGetPlayer(this Entity entity, out Entity player) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) player = Entity.Null; if (entity.Has<PlayerCharacter>()) { player = entity; return true; } return false; } public static bool IsPlayer(this Entity entity) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) if (entity.Has<VampireTag>()) { return true; } return false; } public static bool IsDifferentPlayer(this Entity entity, Entity target) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0008: 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) if (entity.IsPlayer() && target.IsPlayer() && !((Entity)(ref entity)).Equals(target)) { return true; } return false; } public static bool IsFollowingPlayer(this Entity entity) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) if (entity.TryGetComponent<Follower>(out Follower componentData) && componentData.Followed._Value.IsPlayer()) { return true; } return false; } public static Entity GetBuffTarget(this Entity entity) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) return CreateGameplayEventServerUtility.GetBuffTarget(EntityManager, entity); } public static Entity GetPrefabEntity(this Entity entity) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) return GameManager_Shared.GetPrefabEntity(PrefabCollectionSystem._PrefabLookupMap, entity.GetPrefabGUID()); } public static Entity GetPrefabEntity(this PrefabGUID prefabGuid) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) if (!((PrefabGUID)(ref prefabGuid)).HasValue()) { return Entity.Null; } return GameManager_Shared.GetPrefabEntity(PrefabCollectionSystem._PrefabLookupMap, prefabGuid); } public static Entity GetSpellTarget(this Entity entity) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) return CreateGameplayEventServerUtility.GetSpellTarget(EntityManager, entity); } public static bool TryGetTeamEntity(this Entity entity, out Entity teamEntity) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //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_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: 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_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) teamEntity = Entity.Null; if (entity.TryGetComponent<TeamReference>(out TeamReference componentData)) { Entity value = componentData.Value._Value; if (value.Exists()) { teamEntity = value; return true; } } return false; } public static bool Exists(this Entity entity) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) if (entity.HasValue() && entity.IndexWithinCapacity()) { EntityManager entityManager = EntityManager; return ((EntityManager)(ref entityManager)).Exists(entity); } return false; } public static bool IndexWithinCapacity(this Entity entity) { //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) ReadOnlySpan<char> span = ((object)(Entity)(ref entity)).ToString().AsSpan(); if (!span.StartsWith("Entity(".AsSpan())) { return false; } span = span.Slice(7, span.Length - 7); int num = span.IndexOf(':'); if (num <= 0) { return false; } int result = num + 1; ReadOnlySpan<char> span2 = span.Slice(result, span.Length - result); int num2 = span2.IndexOf(')'); if (num2 <= 0) { return false; } if (!int.TryParse(span.Slice(0, num), out var result2)) { return false; } if (!int.TryParse(span2.Slice(0, num2), out result)) { return false; } EntityManager entityManager = EntityManager; int entityCapacity = ((EntityManager)(ref entityManager)).EntityCapacity; return (uint)result2 < (uint)entityCapacity; } public static bool IsDisabled(this Entity entity) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return entity.Has<Disabled>(); } public static bool HasConnectedCoffin(this Entity entity) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) if (entity.TryGetComponent<ServantConnectedCoffin>(out ServantConnectedCoffin componentData)) { return ((NetworkedEntity)(ref componentData.CoffinEntity)).GetEntityOnServer().Exists(); } return false; } public static bool IsVBlood(this Entity entity) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return entity.Has<VBloodUnit>(); } public static ulong GetSteamId(this Entity entity) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) if (entity.TryGetComponent<PlayerCharacter>(out PlayerCharacter componentData)) { return componentData.UserEntity.Read<User>().PlatformId; } if (entity.TryGetComponent<User>(out User componentData2)) { return componentData2.PlatformId; } return 0uL; } public static NetworkId GetNetworkId(this Entity entity) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (entity.TryGetComponent<NetworkId>(out NetworkId componentData)) { return componentData; } return NetworkId.Empty; } public static void ForEach<T>(this IEnumerable<T> source, Action<T> action) { foreach (T item in source) { action(item); } } public static PrefabGUID GetPrefabGUID(this Entity entity) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (entity.TryGetComponent<PrefabGUID>(out PrefabGUID componentData)) { return componentData; } return PrefabGUID.Empty; } public static Entity GetUserEntity(this Entity character) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) if (character.TryGetComponent<PlayerCharacter>(out PlayerCharacter componentData)) { return componentData.UserEntity; } return Entity.Null; } public static User GetUser(this Entity entity) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) if (entity.TryGetComponent<PlayerCharacter>(out PlayerCharacter componentData) && componentData.UserEntity.TryGetComponent<User>(out User componentData2)) { return componentData2; } if (entity.TryGetComponent<User>(out componentData2)) { return componentData2; } return User.Empty; } public static Equipment GetEquipment(this Entity entity) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (entity.TryGetComponent<Equipment>(out Equipment componentData)) { return componentData; } return default(Equipment); } public static CustomizationFeatures GetCustomizationFeatures(this Entity entity) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (entity.TryGetComponent<CustomizationFeatures>(out CustomizationFeatures componentData)) { return componentData; } return default(CustomizationFeatures); } public static T GetExistingDataManaged<T>(this PrefabGUID prefabGuid) where T : class { //IL_000f: Unknown result type (might be due to invalid IL or missing references) T result = default(T); if (((ManagedDataSystem_Base)Core.SystemService.ManagedDataSystem).ManagedDataRegistry.TryGet<T>(prefabGuid, ref result)) { return result; } return null; } public static bool HasBuff(this Entity entity, PrefabGUID buffPrefabGUID) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) return GameManager_Shared.HasBuff(EntityManager, entity, ((PrefabGUID)(ref buffPrefabGUID)).ToIdentifier()); } public static bool TryGetBuff(this Entity entity, PrefabGUID buffPrefabGUID, out Entity buffEntity) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) return GameManager_Shared.TryGetBuff(EntityManager, entity, ((PrefabGUID)(ref buffPrefabGUID)).ToIdentifier(), ref buffEntity); } public static float3 GetAimPosition(this Entity entity) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) if (entity.TryGetComponent<EntityInput>(out EntityInput componentData)) { return componentData.AimPosition; } return float3.zero; } public static bool TryGetPosition(this Entity entity, out float3 position) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: 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_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) position = float3.zero; if (entity.TryGetComponent<Translation>(out Translation componentData)) { position = componentData.Value; return true; } return false; } public static float3 GetPosition(this Entity entity) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) if (entity.TryGetComponent<Translation>(out Translation componentData)) { return componentData.Value; } return float3.zero; } public static bool TryGetMatch(this HashSet<(ulong, ulong)> hashSet, ulong value, out (ulong, ulong) matchingPair) { matchingPair = default((ulong, ulong)); foreach (var item in hashSet) { if (item.Item1 == value || item.Item2 == value) { matchingPair = item; return true; } } return false; } public static bool IsCustomSpawned(this Entity entity) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (entity.TryGetComponent<IsMinion>(out IsMinion componentData)) { return componentData.Value; } return false; } public static void Destroy(this Entity entity) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0008: 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) if (entity.Exists()) { DestroyUtility.Destroy(EntityManager, entity, (DestroyDebugReason)0, (string)null, 0); } } public static void SetTeam(this Entity entity, Entity teamSource) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: 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_0047: 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) if (entity.Has<Team>() && entity.Has<TeamReference>() && teamSource.TryGetComponent<Team>(out Team componentData) && teamSource.TryGetComponent<TeamReference>(out TeamReference componentData2)) { Entity teamRefEntity = componentData2.Value._Value; int teamId = componentData.Value; entity.With<TeamReference>((WithRefHandler<TeamReference>)delegate(ref TeamReference teamReference) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) teamReference.Value._Value = teamRefEntity; }); entity.With<Team>((WithRefHandler<Team>)delegate(ref Team team) { team.Value = teamId; }); } } public static void SetFaction(this Entity entity, PrefabGUID factionPrefabGUID) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: 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_0015: Unknown result type (might be due to invalid IL or missing references) if (entity.Has<FactionReference>()) { entity.With<FactionReference>((WithRefHandler<FactionReference>)delegate(ref FactionReference factionReference) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) factionReference.FactionGuid._Value = factionPrefabGUID; }); } } public static bool HasValue(this Entity entity) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) return entity != Entity.Null; } public static bool IsAllies(this Entity entity, Entity player) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) ClientGameManager clientGameManager = ClientGameManager; return ((ClientGameManager)(ref clientGameManager)).IsAllies(entity, player); } public static Coroutine Run(this IEnumerator routine) { return Core.StartCoroutine(routine); } public static void Stop(this Coroutine routine) { if (routine != null) { Core.StopCoroutine(routine); } } public static Dictionary<TValue, TKey> Reverse<TKey, TValue>(this IDictionary<TKey, TValue> source) { Dictionary<TValue, TKey> dictionary = new Dictionary<TValue, TKey>(); foreach (KeyValuePair<TKey, TValue> item in source) { dictionary[item.Value] = item.Key; } return dictionary; } public static bool Equals<T>(this T value, params T[] options) { foreach (T val in options) { if (value.Equals(val)) { return true; } } return false; } public static LocalizationKey LocalizeText(this string text) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return Core.LocalizeString(text); } public static void PreloadSprite(this string iconName) { CanvasService.DataHUD.SpriteNames.Add(iconName); } public static Sprite GetExistingSprite(this string iconName) { if (!CanvasService.DataHUD.Sprites.TryGetValue(iconName, out var value)) { return null; } return value; } public static bool IsEmpty(this string str) { return string.IsNullOrEmpty(str); } public static bool HasValue<T>(this T obj) where T : class { return obj != null; } public static bool HasValue(this Object obj) { return Object.op_Implicit(obj); } } public static class MyPluginInfo { public const string PLUGIN_GUID = "io.zfolmt.Eclipse"; public const string PLUGIN_NAME = "Eclipse"; public const string PLUGIN_VERSION = "1.3.14"; } } namespace Eclipse.Utilities { internal static class GameObjects { public static TMP_SpriteAsset CreateSpriteAsset(Sprite sprite) { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: 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_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Expected O, but got Unknown TMP_SpriteAsset val = ScriptableObject.CreateInstance<TMP_SpriteAsset>(); ((Object)val).name = ((Object)sprite).name; val.spriteSheet = (Texture)(object)sprite.texture; if (val.spriteInfoList == null) { val.spriteInfoList = new List<TMP_Sprite>(); } else { val.spriteInfoList.Clear(); } TMP_Sprite val2 = new TMP_Sprite { id = 0, name = ((Object)sprite).name, hashCode = TMP_TextUtilities.GetSimpleHashCode(((Object)sprite).name), sprite = sprite, unicode = 57344 }; Rect rect = sprite.rect; ((TMP_TextElement_Legacy)val2).x = ((Rect)(ref rect)).x; rect = sprite.rect; ((TMP_TextElement_Legacy)val2).y = ((Rect)(ref rect)).y; rect = sprite.rect; ((TMP_TextElement_Legacy)val2).width = ((Rect)(ref rect)).width; rect = sprite.rect; ((TMP_TextElement_Legacy)val2).height = ((Rect)(ref rect)).height; Vector2 pivot = sprite.pivot; rect = sprite.rect; val2.pivot = pivot / ((Rect)(ref rect)).size; TMP_Sprite val3 = val2; val.spriteInfoList.Add(val3); val.UpdateLookupTables(); return val; } public static GameObject FindTargetUIObject(Transform root, string targetName) { //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Expected O, but got Unknown Stack<(Transform, int)> stack = new Stack<(Transform, int)>(); stack.Push((root, 0)); HashSet<Transform> hashSet = new HashSet<Transform>(); List<Transform> list = ((IEnumerable<Transform>)((Component)root).GetComponentsInChildren<Transform>(true)).ToList(); while (stack.Count > 0) { var (val, num) = stack.Pop(); if (!hashSet.Add(val)) { continue; } if (((Object)((Component)val).gameObject).name.Equals(targetName, StringComparison.OrdinalIgnoreCase)) { return ((Component)val).gameObject; } foreach (Transform item in list) { if ((Object)(object)item.parent == (Object)(object)val) { stack.Push((item, num + 1)); } } } ManualLogSource log = Core.Log; bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val2 = new BepInExWarningLogInterpolatedStringHandler(34, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("GameObject with name '"); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(targetName); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("' not found!"); } log.LogWarning(val2); return null; } public static void FindLoadedObjects<T>() where T : Object { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Expected O, but got Unknown Il2CppReferenceArray<Object> val = Resources.FindObjectsOfTypeAll(Il2CppType.Of<T>()); ManualLogSource log = Core.Log; bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val2 = new BepInExInfoLogInterpolatedStringHandler(10, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("Found "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<int>(((Il2CppArrayBase<Object>)(object)val).Length); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(Il2CppType.Of<T>().FullName); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("'s!"); } log.LogInfo(val2); foreach (Object item in (Il2CppArrayBase<Object>)(object)val) { ManualLogSource log2 = Core.Log; val2 = new BepInExInfoLogInterpolatedStringHandler(8, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("Sprite: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(item.name); } log2.LogInfo(val2); } } public static void DeactivateChildrenExceptNamed(Transform root, string targetName) { Stack<(Transform, int)> stack = new Stack<(Transform, int)>(); stack.Push((root, 0)); HashSet<Transform> hashSet = new HashSet<Transform>(); List<Transform> list = ((IEnumerable<Transform>)((Component)root).GetComponentsInChildren<Transform>()).ToList(); while (stack.Count > 0) { var (val, num) = stack.Pop(); if (!hashSet.Add(val)) { continue; } foreach (Transform item in list) { if ((Object)(object)item.parent == (Object)(object)val) { stack.Push((item, num + 1)); } if (!((Object)item).name.Equals(targetName)) { ((Component)item).gameObject.SetActive(false); } } } } public static void FindGameObjects(Transform root, string filePath = "", bool includeInactive = false) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Expected O, but got Unknown //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) Stack<(Transform, int)> stack = new Stack<(Transform, int)>(); stack.Push((root, 0)); HashSet<Transform> hashSet = new HashSet<Transform>(); List<Transform> list = ((IEnumerable<Transform>)((Component)root).GetComponentsInChildren<Transform>(includeInactive)).ToList(); ManualLogSource log = Core.Log; bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(19, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Found "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(list.Count); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" GameObjects!"); } log.LogWarning(val); Scene scene; if (string.IsNullOrEmpty(filePath)) { while (stack.Count > 0) { var (val2, num) = stack.Pop(); if (!hashSet.Add(val2)) { continue; } List<string> values = FindGameObjectComponents(((Component)val2).gameObject); string text = new string('|', num); ManualLogSource log2 = Core.Log; BepInExInfoLogInterpolatedStringHandler val3 = new BepInExInfoLogInterpolatedStringHandler(8, 4, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<string>(text); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<string>(((Object)((Component)val2).gameObject).name); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(" | "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<string>(string.Join(",", values)); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(" | ["); scene = ((Component)val2).gameObject.scene; ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<string>(((Scene)(ref scene)).name); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("]"); } log2.LogInfo(val3); foreach (Transform item in list) { if ((Object)(object)item.parent == (Object)(object)val2) { stack.Push((item, num + 1)); } } } return; } if (!File.Exists(filePath)) { File.Create(filePath).Dispose(); } using StreamWriter streamWriter = new StreamWriter(filePath, append: false); while (stack.Count > 0) { var (val4, num2) = stack.Pop(); if (!hashSet.Add(val4)) { continue; } List<string> values2 = FindGameObjectComponents(((Component)val4).gameObject); string value = new string('|', num2); DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(8, 4); defaultInterpolatedStringHandler.AppendFormatted(value); defaultInterpolatedStringHandler.AppendFormatted(((Object)((Component)val4).gameObject).name); defaultInterpolatedStringHandler.AppendLiteral(" | "); defaultInterpolatedStringHandler.AppendFormatted(string.Join(",", values2)); defaultInterpolatedStringHandler.AppendLiteral(" | ["); scene = ((Component)val4).gameObject.scene; defaultInterpolatedStringHandler.AppendFormatted(((Scene)(ref scene)).name); defaultInterpolatedStringHandler.AppendLiteral("]"); streamWriter.WriteLine(defaultInterpolatedStringHandler.ToStringAndClear()); foreach (Transform item2 in list) { if ((Object)(object)item2.parent == (Object)(object)val4) { stack.Push((item2, num2 + 1)); } } } } public static List<string> FindGameObjectComponents(GameObject parentObject) { List<string> list = new List<string>(); int componentCount = parentObject.GetComponentCount(); for (int i = 0; i < componentCount; i++) { list.Add($"{((Object)parentObject.GetComponentAtIndex(i)).GetIl2CppType().FullName}({i})"); } return list; } public static GameObject FindByTransformPath(string scenePath) { foreach (GameObject item in Resources.FindObjectsOfTypeAll<GameObject>()) { string transformPath = GetTransformPath(item.transform); if (scenePath.Equals(transformPath)) { return item; } } return null; } private static string GetTransformPath(Transform transform) { StringBuilder stringBuilder = new StringBuilder(((Object)transform).name); while (Object.op_Implicit((Object)(object)transform.parent)) { transform = transform.parent; stringBuilder.Insert(0, ((Object)transform).name + "/"); } return stringBuilder.ToString(); } } internal static class ModificationIds { public enum StatSourceType { Weapon, Blood, Class } private const int SOURCE_SHIFT = 30; private const int STAT_SHIFT = 20; private const int SOURCE_MASK = 3; private const int STAT_MASK = 1023; private const int SIGN_SHIFT = 19; private const int SIGN_MASK = 524288; private const int MAG_MASK = 524287; [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int GenerateId(int sourceType, int statType, float value) { if (float.IsNaN(value) || float.IsInfinity(value)) { value = 0f; } int num = Mathf.RoundToInt(value * 1000f); int num2 = ((num < 0) ? 524288 : 0); int num3 = Mathf.Clamp(Mathf.Abs(num), 0, 524287); int num4 = num2 | num3; return ((sourceType & 3) << 30) | ((statType & 0x3FF) << 20) | (num4 & 0xFFFFF); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int GenerateId(StatSourceType source, int statType, float value) { return GenerateId((int)source, statType, value); } } internal static class Quips { private static FromCharacter? _fromCharacter; private static readonly ComponentType[] _componentTypes = (ComponentType[])(object)new ComponentType[4] { ComponentType.ReadOnly(Il2CppType.Of<FromCharacter>()), ComponentType.ReadOnly(Il2CppType.Of<NetworkEventType>()), ComponentType.ReadOnly(Il2CppType.Of<SendNetworkEventTag>()), ComponentType.ReadOnly(Il2CppType.Of<ChatMessageEvent>()) }; private static readonly NetworkEventType _networkEventType = new NetworkEventType { IsAdminEvent = false, EventId = NetworkEvents.EventId_ChatMessageEvent, IsDebugEvent = false }; private static EntityManager EntityManager => Core.EntityManager; private static Entity LocalCharacter => Core.LocalCharacter; private static Entity LocalUser => Core.LocalUser; private static NetworkId NetworkId => LocalUser.GetNetworkId(); public static FromCharacter FromCharacter { get { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0019: 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_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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) FromCharacter valueOrDefault = _fromCharacter.GetValueOrDefault(); if (!_fromCharacter.HasValue) { FromCharacter val = default(FromCharacter); val.Character = LocalCharacter; val.User = LocalUser; valueOrDefault = val; _fromCharacter = valueOrDefault; return valueOrDefault; } return valueOrDefault; } } public static void SendCommand(string command) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: 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_002b: 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_0038: 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_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0053: 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_0068: Expected O, but got Unknown ChatMessageEvent val = default(ChatMessageEvent); val.MessageText = new FixedString512Bytes(command); val.MessageType = (ChatMessageType)4; val.ReceiverEntity = NetworkId; ChatMessageEvent componentData = val; EntityManager entityManager = EntityManager; Entity entity = ((EntityManager)(ref entityManager)).CreateEntity(_componentTypes); entity.Write<FromCharacter>(FromCharacter); entity.Write<NetworkEventType>(_networkEventType); entity.Write<ChatMessageEvent>(componentData); ManualLogSource log = Core.Log; bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val2 = new BepInExInfoLogInterpolatedStringHandler(0, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(command); } log.LogInfo(val2); } } internal static class Recipes { private static readonly PrefabGUID _advancedGrinder = new PrefabGUID(-178579946); private static readonly PrefabGUID _advancedFurnace = new PrefabGUID(-222851985); private static readonly PrefabGUID _fabricator = new PrefabGUID(-465055967); private static readonly PrefabGUID _shardExtractor = new PrefabGUID(1794206684); private static readonly PrefabGUID _gemCuttingTable = new PrefabGUID(-21483617); private static readonly PrefabGUID _refinementInventoryLarge = new PrefabGUID(1436956144); private static readonly PrefabGUID _extractorInventory = new PrefabGUID(-1814907421); private static readonly PrefabGUID _ironBodyRecipe = new PrefabGUID(-1270503528); private static readonly PrefabGUID _vampiricDustRecipe = new PrefabGUID(311920560); private static readonly PrefabGUID _copperWiresRecipe = new PrefabGUID(-2031309726); private static readonly PrefabGUID _silverIngotRecipe = new PrefabGUID(-1633898285); private static readonly PrefabGUID _fakeFlowerRecipe = new PrefabGUID(-2095604835); private static readonly PrefabGUID _chargedBatteryRecipe = new PrefabGUID(-40415372); private static readonly PrefabGUID _batHide = new PrefabGUID(1262845777); private static readonly PrefabGUID _lesserStygian = new PrefabGUID(2103989354); private static readonly PrefabGUID _bloodEssence = new PrefabGUID(862477668); private static readonly PrefabGUID _plantThistle = new PrefabGUID(-598100816); private static readonly PrefabGUID _batteryCharge = new PrefabGUID(-77555820); private static readonly PrefabGUID _techScrap = new PrefabGUID(834864259); private static readonly PrefabGUID _primalEssence = new PrefabGUID(1566989408); private static readonly PrefabGUID _copperWires = new PrefabGUID(-456161884); private static readonly PrefabGUID _itemBuildingEMP = new PrefabGUID(-1447213995); private static readonly PrefabGUID _depletedBattery = new PrefabGUID(1270271716); private static readonly PrefabGUID _itemJewelTemplate = new PrefabGUID(1075994038); private static readonly PrefabGUID _pristineHeart = new PrefabGUID(-1413694594); private static readonly PrefabGUID _radiantFibre = new PrefabGUID(-182923609); private static readonly PrefabGUID _resonator = new PrefabGUID(-1629804427); private static readonly PrefabGUID _document = new PrefabGUID(1334469825); private static readonly PrefabGUID _demonFragment = new PrefabGUID(-77477508); private static readonly PrefabGUID _magicalComponent = new PrefabGUID(1488205677); private static readonly PrefabGUID _tailoringComponent = new PrefabGUID(828271620); private static readonly PrefabGUID _gemGrindStone = new PrefabGUID(2115367516); private static readonly PrefabGUID _perfectAmethyst = new PrefabGUID(-106283194); private static readonly PrefabGUID _perfectEmerald = new PrefabGUID(1354115931); private static readonly PrefabGUID _perfectRuby = new PrefabGUID(188653143); private static readonly PrefabGUID _perfectSapphire = new PrefabGUID(-2020212226); private static readonly PrefabGUID _perfectTopaz = new PrefabGUID(-1983566585); private static readonly PrefabGUID _perfectMiststone = new PrefabGUID(750542699); private static readonly PrefabGUID _goldOre = new PrefabGUID(660533034); private static readonly PrefabGUID _goldJewelry = new PrefabGUID(-1749304196); private static readonly PrefabGUID _extractShardRecipe = new PrefabGUID(1743327679); private static readonly PrefabGUID _solarusShardRecipe = new PrefabGUID(-958598508); private static readonly PrefabGUID _monsterShardRecipe = new PrefabGUID(1791150988); private static readonly PrefabGUID _manticoreShardRecipe = new PrefabGUID(-111826090); private static readonly PrefabGUID _draculaShardRecipe = new PrefabGUID(-414358988); private static readonly PrefabGUID _itemBuildingManticore = new PrefabGUID(-222860772); private static readonly PrefabGUID _solarusShard = new PrefabGUID(-21943750); private static readonly PrefabGUID _monsterShard = new PrefabGUID(-1581189572); private static readonly PrefabGUID _manticoreShard = new PrefabGUID(-1260254082); private static readonly PrefabGUID _draculaShard = new PrefabGUID(666638454); private static readonly PrefabGUID _solarusShardContainer = new PrefabGUID(-824445631); private static readonly PrefabGUID _monsterShardContainer = new PrefabGUID(-1996942061); private static readonly PrefabGUID _manticoreShardContainer = new PrefabGUID(653759442); private static readonly PrefabGUID _draculaShardContainer = new PrefabGUID(1495743889); private static readonly PrefabGUID _primalStygianRecipe = new PrefabGUID(-259193408); private static readonly PrefabGUID _greaterStygian = new PrefabGUID(576389135); private static readonly PrefabGUID _primalStygian = new PrefabGUID(28358550); private static readonly PrefabGUID _bloodCrystalRecipe = new PrefabGUID(-597461125); private static readonly PrefabGUID _crystal = new PrefabGUID(-257494203); private static readonly PrefabGUID _bloodCrystal = new PrefabGUID(-1913156733); private static readonly PrefabGUID _greaterEssence = new PrefabGUID(271594022); private static readonly List<PrefabGUID> _shardRecipes = new List<PrefabGUID>(4) { _solarusShardRecipe, _monsterShardRecipe, _manticoreShardRecipe, _draculaShardRecipe }; private static readonly List<PrefabGUID> _soulShards = new List<PrefabGUID>(4) { _solarusShard, _monsterShard, _manticoreShard, _draculaShard }; private static readonly List<PrefabGUID> _shardContainers = new List<PrefabGUID>(4) { _solarusShardContainer, _monsterShardContainer, _manticoreShardContainer, _draculaShardContainer }; private static readonly Dictionary<PrefabGUID, PrefabGUID> _recipesToShards = new Dictionary<PrefabGUID, PrefabGUID> { { _solarusShardRecipe, _solarusShard }, { _monsterShardRecipe, _monsterShard }, { _manticoreShardRecipe, _manticoreShard }, { _draculaShardRecipe, _draculaShard } }; private const string PRIMAL_JEWEL = "Stunlock_Icon_Item_Jewel_Collection4"; private static EntityManager EntityManager => Core.EntityManager; private static SystemService SystemService => Core.SystemService; private static PrefabCollectionSystem PrefabCollectionSystem => SystemService.PrefabCollectionSystem; private static GameDataSystem GameDataSystem => SystemService.GameDataSystem; private static AssetGuid HashStringToGuidString(string hashString) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) using SHA256 sHA = SHA256.Create(); byte[] array = sHA.ComputeHash(Encoding.UTF8.GetBytes(hashString)); return AssetGuid.FromGuid(new Guid(Il2CppStructArray<byte>.op_Implicit(array[..16]))); } public static void ModifyRecipes() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_02a8: Unknown result type (might be due to invalid IL or missing references) //IL_02ad: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_035c: Unknown result type (might be due to invalid IL or missing references) //IL_0361: Unknown result type (might be due to invalid IL or missing references) //IL_0365: Unknown result type (might be due to invalid IL or missing references) //IL_02dd: Unknown result type (might be due to invalid IL or missing references) //IL_03ed: Unknown result type (might be due to invalid IL or missing references) //IL_03f2: Unknown result type (might be due to invalid IL or missing references) //IL_03f6: Unknown result type (might be due to invalid IL or missing references) //IL_0373: Unknown result type (might be due to invalid IL or missing references) //IL_047e: Unknown result type (might be due to invalid IL or missing references) //IL_0483: Unknown result type (might be due to invalid IL or missing references) //IL_0487: Unknown result type (might be due to invalid IL or missing references) //IL_0404: Unknown result type (might be due to invalid IL or missing references) //IL_0383: Unknown result type (might be due to invalid IL or missing references) //IL_037c: Unknown result type (might be due to invalid IL or missing references) //IL_0305: Unknown result type (might be due to invalid IL or missing references) //IL_030a: Unknown result type (might be due to invalid IL or missing references) //IL_0327: Unknown result type (might be due to invalid IL or missing references) //IL_032c: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Unknown result type (might be due to invalid IL or missing references) //IL_0342: Unknown result type (might be due to invalid IL or missing references) //IL_0344: Unknown result type (might be due to invalid IL or missing references) //IL_0538: Unknown result type (might be due to invalid IL or missing references) //IL_053d: Unknown result type (might be due to invalid IL or missing references) //IL_0541: Unknown result type (might be due to invalid IL or missing references) //IL_0498: Unknown result type (might be due to invalid IL or missing references) //IL_0414: Unknown result type (might be due to invalid IL or missing references) //IL_040d: Unknown result type (might be due to invalid IL or missing references) //IL_03a9: Unknown result type (might be due to invalid IL or missing references) //IL_05c9: Unknown result type (might be due to invalid IL or missing references) //IL_05ce: Unknown result type (might be due to invalid IL or missing references) //IL_05d2: Unknown result type (might be due to invalid IL or missing references) //IL_054f: Unknown result type (might be due to invalid IL or missing references) //IL_04a8: Unknown result type (might be due to invalid IL or missing references) //IL_04a1: Unknown result type (might be due to invalid IL or missing references) //IL_043a: Unknown result type (might be due to invalid IL or missing references) //IL_03ba: Unknown result type (might be due to invalid IL or missing references) //IL_03bc: Unknown result type (might be due to invalid IL or missing references) //IL_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_03ce: Unknown result type (might be due to invalid IL or missing references) //IL_03d3: Unknown result type (might be due to invalid IL or missing references) //IL_03e0: Unknown result type (might be due to invalid IL or missing references) //IL_03b2: Unknown result type (might be due to invalid IL or missing references) //IL_03b4: Unknown result type (might be due to invalid IL or missing references) //IL_05e3: Unknown result type (might be due to invalid IL or missing references) //IL_055f: Unknown result type (might be due to invalid IL or missing references) //IL_0558: Unknown result type (might be due to invalid IL or missing references) //IL_04ce: Unknown result type (might be due to invalid IL or missing references) //IL_044b: Unknown result type (might be due to invalid IL or missing references) //IL_044d: Unknown result type (might be due to invalid IL or missing references) //IL_0452: Unknown result type (might be due to invalid IL or missing references) //IL_0457: Unknown result type (might be due to invalid IL or missing references) //IL_045f: Unknown result type (might be due to invalid IL or missing references) //IL_0464: Unknown result type (might be due to invalid IL or missing references) //IL_0471: Unknown result type (might be due to invalid IL or missing references) //IL_0443: Unknown result type (might be due to invalid IL or missing references) //IL_0445: Unknown result type (might be due to invalid IL or missing references) //IL_07fa: Unknown result type (might be due to invalid IL or missing references) //IL_07ff: Unknown result type (might be due to invalid IL or missing references) //IL_0803: Unknown result type (might be due to invalid IL or missing references) //IL_06ba: Unknown result type (might be due to invalid IL or missing references) //IL_06bf: Unknown result type (might be due to invalid IL or missing references) //IL_06c3: Unknown result type (might be due to invalid IL or missing references) //IL_05f3: Unknown result type (might be due to invalid IL or missing references) //IL_05ec: Unknown result type (might be due to invalid IL or missing references) //IL_0585: Unknown result type (might be due to invalid IL or missing references) //IL_04df: Unknown result type (might be due to invalid IL or missing references) //IL_04e1: Unknown result type (might be due to invalid IL or missing references) //IL_04e6: Unknown result type (might be due to invalid IL or missing references) //IL_04eb: Unknown result type (might be due to invalid IL or missing references) //IL_04f3: Unknown result type (might be due to invalid IL or missing references) //IL_04f8: Unknown result type (might be due to invalid IL or missing references) //IL_0505: Unknown result type (might be due to invalid IL or missing references) //IL_0511: Unknown result type (might be due to invalid IL or missing references) //IL_0519: Unknown result type (might be due to invalid IL or missing references) //IL_051e: Unknown result type (might be due to invalid IL or missing references) //IL_052b: Unknown result type (might be due to invalid IL or missing references) //IL_04d7: Unknown result type (might be due to invalid IL or missing references) //IL_04d9: Unknown result type (might be due to invalid IL or missing references) //IL_0836: Unknown result type (might be due to invalid IL or missing references) //IL_083b: Unknown result type (might be due to invalid IL or missing references) //IL_083f: Unknown result type (might be due to invalid IL or missing references) //IL_0844: Unknown result type (might be due to invalid IL or missing references) //IL_084e: Unknown result type (might be due to invalid IL or missing references) //IL_0853: Unknown result type (might be due to invalid IL or missing references) //IL_0857: Unknown result type (might be due to invalid IL or missing references) //IL_085c: Unknown result type (might be due to invalid IL or missing references) //IL_0861: Unknown result type (might be due to invalid IL or missing references) //IL_0862: Unknown result type (might be due to invalid IL or missing references) //IL_0811: Unknown result type (might be due to invalid IL or missing references) //IL_06d4: Unknown result type (might be due to invalid IL or missing references) //IL_0619: Unknown result type (might be due to invalid IL or missing references) //IL_0596: Unknown result type (might be due to invalid IL or missing references) //IL_0598: Unknown result type (might be due to invalid IL or missing references) //IL_059d: Unknown result type (might be due to invalid IL or missing references) //IL_05a2: Unknown result type (might be due to invalid IL or missing references) //IL_05aa: Unknown result type (might be due to invalid IL or missing references) //IL_05af: Unknown result type (might be due to invalid IL or missing references) //IL_05bc: Unknown result type (might be due to invalid IL or missing references) //IL_058e: Unknown result type (might be due to invalid IL or missing references) //IL_0590: Unknown result type (might be due to invalid IL or missing references) //IL_0889: Unknown result type (might be due to invalid IL or missing references) //IL_088e: Unknown result type (might be due to invalid IL or missing references) //IL_088f: Unknown result type (might be due to invalid IL or missing references) //IL_0899: Unknown result type (might be due to invalid IL or missing references) //IL_089e: Unknown result type (might be due to invalid IL or missing references) //IL_08a4: Unknown result type (might be due to invalid IL or missing references) //IL_08ac: Unknown result type (might be due to invalid IL or missing references) //IL_08b1: Unknown result type (might be due to invalid IL or missing references) //IL_08c6: Unknown result type (might be due to invalid IL or missing references) //IL_08d3: Unknown result type (might be due to invalid IL or missing references) //IL_08d8: Unknown result type (might be due to invalid IL or missing references) //IL_08dc: Unknown result type (might be due to invalid IL or missing references) //IL_08e1: Unknown result type (might be due to invalid IL or missing references) //IL_08eb: Unknown result type (might be due to invalid IL or missing references) //IL_08f0: Unknown result type (might be due to invalid IL or missing references) //IL_08f4: Unknown result type (might be due to invalid IL or missing references) //IL_08f9: Unknown result type (might be due to invalid IL or missing references) //IL_08fe: Unknown result type (might be due to invalid IL or missing references) //IL_08ff: Unknown result type (might be due to invalid IL or missing references) //IL_0821: Unknown result type (might be due to invalid IL or missing references) //IL_081a: Unknown result type (might be due to invalid IL or missing references) //IL_06e5: Unknown result type (might be due to invalid IL or missing references) //IL_06ea: Unknown result type (might be due to invalid IL or missing references) //IL_06ee: Unknown result type (might be due to invalid IL or missing references) //IL_06f3: Unknown result type (might be due to invalid IL or missing references) //IL_06f8: Unknown result type (might be due to invalid IL or missing references) //IL_06f9: Unknown result type (might be due to invalid IL or missing references) //IL_06fa: Unknown result type (might be due to invalid IL or missing references) //IL_06ff: Unknown result type (might be due to invalid IL or missing references) //IL_0703: Unknown result type (might be due to invalid IL or missing references) //IL_0708: Unknown result type (might be due to invalid IL or missing references) //IL_070c: Unknown result type (might be due to invalid IL or missing references) //IL_0711: Unknown result type (might be due to invalid IL or missing references) //IL_0719: Unknown result type (might be due to invalid IL or missing references) //IL_0720: Unknown result type (might be due to invalid IL or missing references) //IL_0721: Unknown result type (might be due to invalid IL or missing references) //IL_0726: Unknown result type (might be due to invalid IL or missing references) //IL_072c: Unknown result type (might be due to invalid IL or missing referenc