Decompiled source of TeleportationMeads v1.2.2
TeleportationMeads.dll
Decompiled 2 months ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Concurrent; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.IO; using System.IO.Compression; using System.Linq; using System.Linq.Expressions; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Serialization; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using JetBrains.Annotations; using LocalizationManager; using Microsoft.CodeAnalysis; using ServerSync; using TMPro; using TeleportationMeads.Patches; using TeleportationMeads.Utils; using UnityEngine; using YamlDotNet.Core; using YamlDotNet.Core.Events; using YamlDotNet.Core.Tokens; using YamlDotNet.Helpers; using YamlDotNet.Serialization; using YamlDotNet.Serialization.Converters; using YamlDotNet.Serialization.EventEmitters; using YamlDotNet.Serialization.NamingConventions; using YamlDotNet.Serialization.NodeDeserializers; using YamlDotNet.Serialization.NodeTypeResolvers; using YamlDotNet.Serialization.ObjectFactories; using YamlDotNet.Serialization.ObjectGraphTraversalStrategies; using YamlDotNet.Serialization.ObjectGraphVisitors; using YamlDotNet.Serialization.Schemas; using YamlDotNet.Serialization.TypeInspectors; using YamlDotNet.Serialization.TypeResolvers; using YamlDotNet.Serialization.Utilities; using YamlDotNet.Serialization.ValueDeserializers; [assembly: Guid("FA376F04-B198-46F3-AB15-BE149FDAD33F")] [assembly: ComVisible(false)] [assembly: AssemblyTrademark("")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyProduct("TeleportationMeads")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyDescription("https://valheim.thunderstore.io/package/blacks7ar/TeleportationMeads/")] [assembly: AssemblyTitle("TeleportationMeads")] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: CompilationRelaxations(8)] [assembly: AssemblyFileVersion("1.2.2")] [assembly: AssemblyCompany("blacks7ar")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.2.2.0")] [module: <5e5e04db-fca9-4624-baed-7c826acf5da6>RefSafetyRules(11)] [module: UnverifiableCode] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [<61cb81d9-fb22-4292-ab6a-bb3ed6b3c00e>Embedded] internal sealed class <61cb81d9-fb22-4292-ab6a-bb3ed6b3c00e>EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] [CompilerGenerated] [<61cb81d9-fb22-4292-ab6a-bb3ed6b3c00e>Embedded] internal sealed class <5e5e04db-fca9-4624-baed-7c826acf5da6>RefSafetyRulesAttribute : Attribute { public readonly int Version; public <5e5e04db-fca9-4624-baed-7c826acf5da6>RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace TeleportationMeads { [BepInPlugin("blacks7ar.TeleportationMeads", "TeleportationMeads", "1.2.2")] public class Plugin : BaseUnityPlugin { private const string modGUID = "blacks7ar.TeleportationMeads"; public const string modName = "TeleportationMeads"; public const string modAuthor = "blacks7ar"; public const string modVersion = "1.2.2"; public const string modLink = "https://valheim.thunderstore.io/package/blacks7ar/TeleportationMeads/"; private static readonly Harmony _harmony = new Harmony("blacks7ar.TeleportationMeads"); private static readonly ConfigSync _configSync = new ConfigSync("blacks7ar.TeleportationMeads") { DisplayName = "TeleportationMeads", CurrentVersion = "1.2.2", MinimumRequiredVersion = "1.2.2" }; private static ConfigEntry<Toggle> _serverConfigLocked; public static ConfigEntry<float> _huginsMeadCD; public static ConfigEntry<float> _haldorsMeadCD; public static ConfigEntry<float> _odinsMeadCD; public static ConfigEntry<float> _knarrsMeadCD; public static ConfigEntry<float> _herculesMeadCD; public static ConfigEntry<float> _herculesMeadEffectDuration; public static ConfigEntry<float> _dvergersMeadCD; public static ConfigEntry<float> _hildirsMeadCD; public static Vector3 _savedPosition; public static Vector3 _spawnPoint; public static Vector3 _startPoint; public static Vector3 _traderPoint; public static Vector3 _hildirPoint; public static bool _portalActivated; public static bool _haldorsMeadUsed; public static bool _odinsMeadUsed; public static bool _huginsMeadUsed; public static bool _dvergersMeadUsed; public static bool _hildirsMeadUsed; public static bool _countBegan; public static Plugin _Instance; public static readonly Dictionary<GameObject, GameObject> ToBeFermented = new Dictionary<GameObject, GameObject>(); public static readonly Dictionary<GameObject, GameObject> ToBeFermented2 = new Dictionary<GameObject, GameObject>(); public ConfigEntry<T> config<T>(string group, string name, T value, ConfigDescription description, bool synchronizedConfig = true) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown ConfigDescription val = new ConfigDescription(description.Description + (synchronizedConfig ? " [Synced with Server]" : " [Not Synced with Server]"), description.AcceptableValues, description.Tags); ConfigEntry<T> val2 = ((BaseUnityPlugin)this).Config.Bind<T>(group, name, value, val); _configSync.AddConfigEntry<T>(val2).SynchronizedConfig = synchronizedConfig; return val2; } public void Awake() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Expected O, but got Unknown //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Expected O, but got Unknown //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Expected O, but got Unknown //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Expected O, but got Unknown //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Expected O, but got Unknown //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Expected O, but got Unknown //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Expected O, but got Unknown //IL_0285: Unknown result type (might be due to invalid IL or missing references) //IL_0290: Expected O, but got Unknown Localizer.Load(); _Instance = this; ((BaseUnityPlugin)this).Config.SaveOnConfigSet = false; _serverConfigLocked = config("1- ServerSync", "Lock Configuration", Toggle.On, new ConfigDescription("If On, the configuration is locked and can be changed by server admins only.", (AcceptableValueBase)null, Array.Empty<object>())); _configSync.AddLockingConfigEntry<Toggle>(_serverConfigLocked); PrefabSetup.Init(); string group = Localization.instance.Localize("$btm_haldormead").Trim(); _haldorsMeadCD = config(group, "Haldors Mead Cooldown", 60f, new ConfigDescription("Haldor's mead cooldown duration in seconds. (Recommended: 60)", (AcceptableValueBase)(object)new AcceptableValueRange<float>(30f, 420f), Array.Empty<object>())); string group2 = Localization.instance.Localize("$btm_odinmead").Trim(); _odinsMeadCD = config(group2, "Odins Mead Cooldown", 120f, new ConfigDescription("Odin's mead cooldown duration in seconds. (Recommended: 120)", (AcceptableValueBase)(object)new AcceptableValueRange<float>(30f, 420f), Array.Empty<object>())); string group3 = Localization.instance.Localize("$btm_knarrmead").Trim(); _knarrsMeadCD = config(group3, "Knarrs Mead Cooldown", 60f, new ConfigDescription("Knarr's mead cooldown duration in seconds. (Recommended: 60)", (AcceptableValueBase)(object)new AcceptableValueRange<float>(30f, 420f), Array.Empty<object>())); string group4 = Localization.instance.Localize("$btm_huginmead").Trim(); _huginsMeadCD = config(group4, "Hugins Mead Cooldown", 120f, new ConfigDescription("Knarr's Mead cooldown duration in seconds. (Recommended: 120)", (AcceptableValueBase)(object)new AcceptableValueRange<float>(30f, 420f), Array.Empty<object>())); string group5 = Localization.instance.Localize("$btm_herculesmead").Trim(); _herculesMeadCD = config(group5, "Hercules Mead Cooldown", 420f, new ConfigDescription("Hercules mead cooldown duration in seconds. (Recommended: 420)", (AcceptableValueBase)(object)new AcceptableValueRange<float>(30f, 420f), Array.Empty<object>())); _herculesMeadEffectDuration = config(group5, "Herculean Buff Duration", 300f, new ConfigDescription("Herculean Buff duration in seconds. (Recommended: 300)", (AcceptableValueBase)(object)new AcceptableValueRange<float>(30f, 420f), Array.Empty<object>())); string group6 = Localization.instance.Localize("$btm_dvergrmead").Trim(); _dvergersMeadCD = config(group6, "Dvergers Mead Cooldown", 120f, new ConfigDescription("Dvergers mead cooldown duration in seconds. (Recommended: 120)", (AcceptableValueBase)(object)new AcceptableValueRange<float>(30f, 420f), Array.Empty<object>())); string group7 = Localization.instance.Localize("$btm_hildirsmead").Trim(); _hildirsMeadCD = config(group7, "Hildirs Mead Cooldown", 120f, new ConfigDescription("Hildirs mead cooldown duration in seconds.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(30f, 420f), Array.Empty<object>())); ToBeFermented.Add(PrefabSetup._haldorMeadBase, PrefabSetup._haldorMead); ToBeFermented2.Add(PrefabSetup._odinMeadBase, PrefabSetup._odinMead); ToBeFermented.Add(PrefabSetup._knarrMeadBase, PrefabSetup._knarrMead); ToBeFermented.Add(PrefabSetup._huginMeadBase, PrefabSetup._huginMead); ToBeFermented.Add(PrefabSetup._herculesMeadBase, PrefabSetup._herculesMead); ToBeFermented2.Add(PrefabSetup._dvergrMeadBase, PrefabSetup._dvergrMead); ToBeFermented2.Add(PrefabSetup._hildirsMeadBase, PrefabSetup._hildirsMead); ConfigSetup.Init(); ((BaseUnityPlugin)this).Config.SaveOnConfigSet = true; ((BaseUnityPlugin)this).Config.Save(); Assembly executingAssembly = Assembly.GetExecutingAssembly(); _harmony.PatchAll(executingAssembly); } private void OnDestroy() { ((BaseUnityPlugin)this).Config.Save(); } } } namespace TeleportationMeads.Utils { public static class Logging { private static readonly ManualLogSource TMLogger = Logger.CreateLogSource("TeleportationMeads"); public static void LogDebug(string debug) { TMLogger.LogDebug((object)debug); } public static void LogInfo(string info) { TMLogger.LogInfo((object)info); } public static void LogWarning(string warning) { TMLogger.LogWarning((object)warning); } public static void LogError(string error) { TMLogger.LogError((object)error); } } public enum Toggle { On = 1, Off = 0 } internal static class Helper { public static SE_Stats CreateStatusEffects(string effectName, string m_name, Sprite icon) { SE_Stats obj = ScriptableObject.CreateInstance<SE_Stats>(); ((Object)obj).name = effectName; ((StatusEffect)obj).m_name = m_name; ((StatusEffect)obj).m_tooltip = m_name; ((StatusEffect)obj).m_icon = icon; return obj; } public static SE_Stats CreateHerculeanBuff(string effectName, string m_name, Sprite icon) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) SE_Stats obj = ScriptableObject.CreateInstance<SE_Stats>(); ((Object)obj).name = effectName; ((StatusEffect)obj).m_name = m_name; ((StatusEffect)obj).m_tooltip = m_name; ((StatusEffect)obj).m_icon = icon; ((StatusEffect)obj).m_startMessageType = (MessageType)2; ((StatusEffect)obj).m_startMessage = "<size=28><color=red>Herculean Buff</color> started, your Max Carry Weight is now Doubled.</size>"; ((StatusEffect)obj).m_stopMessageType = (MessageType)2; ((StatusEffect)obj).m_stopMessage = "<size=28><color=red>Herculean Buff</color> ended, your Max Carry Weight is now back to normal.</size>"; return obj; } public static void AddClonedObject(this ZNetScene zNetScene, GameObject gameObject, bool overWrite = true) { GameObject prefab; if ((Object)(object)(prefab = zNetScene.GetPrefab(((Object)gameObject).name)) != (Object)null) { if (!overWrite) { return; } zNetScene.m_prefabs.Remove(prefab); zNetScene.m_namedPrefabs.Remove(StringExtensionMethods.GetStableHashCode(((Object)gameObject).name)); } zNetScene.m_prefabs.Add(gameObject); zNetScene.m_namedPrefabs.Add(StringExtensionMethods.GetStableHashCode(((Object)gameObject).name), gameObject); } public static void AddClonedObject(this ObjectDB objectDB, GameObject gameObject, bool overWrite = true) { GameObject itemPrefab; if ((Object)(object)(itemPrefab = objectDB.GetItemPrefab(((Object)gameObject).name)) != (Object)null) { if (!overWrite) { return; } objectDB.m_items.Remove(itemPrefab); objectDB.m_itemByHash.Remove(StringExtensionMethods.GetStableHashCode(((Object)gameObject).name)); } objectDB.m_items.Add(gameObject); objectDB.m_itemByHash.Add(StringExtensionMethods.GetStableHashCode(((Object)gameObject).name), gameObject); } public static void AddRecipe(this ObjectDB objectDB, Recipe recipe, bool overWrite = true) { if (objectDB.m_recipes.Contains(recipe)) { if (!overWrite) { return; } objectDB.m_recipes.Remove(recipe); } objectDB.m_recipes.Add(recipe); } public static bool ObjectDBAwake() { if ((Object)(object)ObjectDB.instance != (Object)null && ObjectDB.instance.m_items.Count != 0) { return (Object)(object)ObjectDB.instance.GetItemPrefab("Wood") != (Object)null; } return false; } public static bool ZNetSceneAwake() { if ((Object)(object)ZNetScene.instance != (Object)null && ZNetScene.instance.m_prefabs.Count != 0) { return (Object)(object)ZNetScene.instance.GetPrefab("piece_workbench") != (Object)null; } return false; } } } namespace TeleportationMeads.Patches { public static class ConfigSetup { public static ConfigEntry<bool> _dvergrMeadBaseEnable; public static ConfigEntry<string> _dvergrMeadBaseMat1; public static ConfigEntry<string> _dvergrMeadBaseMat2; public static ConfigEntry<string> _dvergrMeadBaseMat3; public static ConfigEntry<string> _dvergrMeadBaseMat4; public static ConfigEntry<bool> _haldorMeadBaseEnable; public static ConfigEntry<string> _haldorMeadBaseMat1; public static ConfigEntry<string> _haldorMeadBaseMat2; public static ConfigEntry<string> _haldorMeadBaseMat3; public static ConfigEntry<string> _haldorMeadBaseMat4; public static ConfigEntry<bool> _herculesMeadBaseEnable; public static ConfigEntry<string> _herculesMeadBaseMat1; public static ConfigEntry<string> _herculesMeadBaseMat2; public static ConfigEntry<string> _herculesMeadBaseMat3; public static ConfigEntry<string> _herculesMeadBaseMat4; public static ConfigEntry<bool> _huginMeadBaseEnable; public static ConfigEntry<string> _huginMeadBaseMat1; public static ConfigEntry<string> _huginMeadBaseMat2; public static ConfigEntry<string> _huginMeadBaseMat3; public static ConfigEntry<string> _huginMeadBaseMat4; public static ConfigEntry<bool> _knarrMeadBaseEnable; public static ConfigEntry<string> _knarrMeadBaseMat1; public static ConfigEntry<string> _knarrMeadBaseMat2; public static ConfigEntry<string> _knarrMeadBaseMat3; public static ConfigEntry<string> _knarrMeadBaseMat4; public static ConfigEntry<bool> _odinsMeadBaseEnable; public static ConfigEntry<string> _odinsMeadBaseMat1; public static ConfigEntry<string> _odinsMeadBaseMat2; public static ConfigEntry<string> _odinsMeadBaseMat3; public static ConfigEntry<string> _odinsMeadBaseMat4; public static ConfigEntry<bool> _hildirsMeadBaseEnable; public static ConfigEntry<string> _hildirsMeadBaseMat1; public static ConfigEntry<string> _hildirsMeadBaseMat2; public static ConfigEntry<string> _hildirsMeadBaseMat3; public static ConfigEntry<string> _hildirsMeadBaseMat4; private static Localization english; public static void Init() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Expected O, but got Unknown //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Expected O, but got Unknown //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Expected O, but got Unknown //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Expected O, but got Unknown //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Expected O, but got Unknown //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Expected O, but got Unknown //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Expected O, but got Unknown //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Expected O, but got Unknown //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Expected O, but got Unknown //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Expected O, but got Unknown //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Expected O, but got Unknown //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_0293: Expected O, but got Unknown //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_02be: Expected O, but got Unknown //IL_02ea: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: Expected O, but got Unknown //IL_0315: Unknown result type (might be due to invalid IL or missing references) //IL_0320: Expected O, but got Unknown //IL_0340: Unknown result type (might be due to invalid IL or missing references) //IL_034b: Expected O, but got Unknown //IL_036b: Unknown result type (might be due to invalid IL or missing references) //IL_0376: Expected O, but got Unknown //IL_0396: Unknown result type (might be due to invalid IL or missing references) //IL_03a1: Expected O, but got Unknown //IL_03cf: Unknown result type (might be due to invalid IL or missing references) //IL_03da: Expected O, but got Unknown //IL_03fb: Unknown result type (might be due to invalid IL or missing references) //IL_0406: Expected O, but got Unknown //IL_0427: Unknown result type (might be due to invalid IL or missing references) //IL_0432: Expected O, but got Unknown //IL_0453: Unknown result type (might be due to invalid IL or missing references) //IL_045e: Expected O, but got Unknown //IL_047f: Unknown result type (might be due to invalid IL or missing references) //IL_048a: Expected O, but got Unknown //IL_04b8: Unknown result type (might be due to invalid IL or missing references) //IL_04c3: Expected O, but got Unknown //IL_04e4: Unknown result type (might be due to invalid IL or missing references) //IL_04ef: Expected O, but got Unknown //IL_0510: Unknown result type (might be due to invalid IL or missing references) //IL_051b: Expected O, but got Unknown //IL_053c: Unknown result type (might be due to invalid IL or missing references) //IL_0547: Expected O, but got Unknown //IL_0568: Unknown result type (might be due to invalid IL or missing references) //IL_0573: Expected O, but got Unknown //IL_05a1: Unknown result type (might be due to invalid IL or missing references) //IL_05ac: Expected O, but got Unknown //IL_05cd: Unknown result type (might be due to invalid IL or missing references) //IL_05d8: Expected O, but got Unknown //IL_05f9: Unknown result type (might be due to invalid IL or missing references) //IL_0604: Expected O, but got Unknown //IL_0625: Unknown result type (might be due to invalid IL or missing references) //IL_0630: Expected O, but got Unknown //IL_0651: Unknown result type (might be due to invalid IL or missing references) //IL_065c: Expected O, but got Unknown english = new Localization(); english.SetupLanguage("English"); string group = english.Localize("$btm_dvergrmeadbase"); _dvergrMeadBaseEnable = Plugin._Instance.config(group, "Recipe", value: true, new ConfigDescription("Enable/Disables recipe. (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>())); _dvergrMeadBaseMat1 = Plugin._Instance.config(group, "Required Material 1", "BTM_HaldorMead:1", new ConfigDescription("Item name : amount (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>())); _dvergrMeadBaseMat2 = Plugin._Instance.config(group, "Required Material 2", "SurtlingCore:1", new ConfigDescription("Item name : amount (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>())); _dvergrMeadBaseMat3 = Plugin._Instance.config(group, "Required Material 3", "AncientSeed:10", new ConfigDescription("Item name : amount (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>())); _dvergrMeadBaseMat4 = Plugin._Instance.config(group, "Required Material 4", "GreydwarfEye:10", new ConfigDescription("Item name : amount (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>())); string group2 = english.Localize("$btm_haldormeadbase"); _haldorMeadBaseEnable = Plugin._Instance.config(group2, "Recipe", value: true, new ConfigDescription("Enable/Disables recipe. (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>())); _haldorMeadBaseMat1 = Plugin._Instance.config(group2, "Required Material 1", "SurtlingCore:1", new ConfigDescription("Item name : amount (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>())); _haldorMeadBaseMat2 = Plugin._Instance.config(group2, "Required Material 2", "GreydwarfEye:20", new ConfigDescription("Item name : amount (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>())); _haldorMeadBaseMat3 = Plugin._Instance.config(group2, "Required Material 3", "AncientSeed:2", new ConfigDescription("Item name : amount (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>())); _haldorMeadBaseMat4 = Plugin._Instance.config(group2, "Required Material 4", "BeechSeeds:20", new ConfigDescription("Item name : amount (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>())); string group3 = english.Localize("$btm_herculesmeadbase"); _herculesMeadBaseEnable = Plugin._Instance.config(group3, "Recipe", value: true, new ConfigDescription("Enable/Disables recipe. (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>())); _herculesMeadBaseMat1 = Plugin._Instance.config(group3, "Required Material 1", "SurtlingCore:1", new ConfigDescription("Item name : amount (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>())); _herculesMeadBaseMat2 = Plugin._Instance.config(group3, "Required Material 2", "CopperOre:2", new ConfigDescription("Item name : amount (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>())); _herculesMeadBaseMat3 = Plugin._Instance.config(group3, "Required Material 3", "AncientSeed:2", new ConfigDescription("Item name : amount (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>())); _herculesMeadBaseMat4 = Plugin._Instance.config(group3, "Required Material 4", "GreydwarfEye:10", new ConfigDescription("Item name : amount (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>())); string group4 = english.Localize("$btm_huginmeadbase"); _huginMeadBaseEnable = Plugin._Instance.config(group4, "Recipe", value: true, new ConfigDescription("Enable/Disables recipe. (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>())); _huginMeadBaseMat1 = Plugin._Instance.config(group4, "Required Material 1", "SurtlingCore:1", new ConfigDescription("Item name : amount (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>())); _huginMeadBaseMat2 = Plugin._Instance.config(group4, "Required Material 2", "GreydwarfEye:20", new ConfigDescription("Item name : amount (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>())); _huginMeadBaseMat3 = Plugin._Instance.config(group4, "Required Material 3", "AncientSeed:2", new ConfigDescription("Item name : amount (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>())); _huginMeadBaseMat4 = Plugin._Instance.config(group4, "Required Material 4", "Feathers:10", new ConfigDescription("Item name : amount (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>())); string group5 = english.Localize("$btm_knarrmeadbase"); _knarrMeadBaseEnable = Plugin._Instance.config(group5, "Recipe", value: true, new ConfigDescription("Enable/Disables recipe. (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>())); _knarrMeadBaseMat1 = Plugin._Instance.config(group5, "Required Material 1", "SurtlingCore:1", new ConfigDescription("Item name : amount (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>())); _knarrMeadBaseMat2 = Plugin._Instance.config(group5, "Required Material 2", "GreydwarfEye:20", new ConfigDescription("Item name : amount (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>())); _knarrMeadBaseMat3 = Plugin._Instance.config(group5, "Required Material 3", "AncientSeed:2", new ConfigDescription("Item name : amount (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>())); _knarrMeadBaseMat4 = Plugin._Instance.config(group5, "Required Material 4", "Resin:20", new ConfigDescription("Item name : amount (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>())); string group6 = english.Localize("$btm_odinmeadbase"); _odinsMeadBaseEnable = Plugin._Instance.config(group6, "Recipe", value: true, new ConfigDescription("Enable/Disables recipe. (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>())); _odinsMeadBaseMat1 = Plugin._Instance.config(group6, "Required Material 1", "BTM_HaldorMead:1", new ConfigDescription("Item name : amount (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>())); _odinsMeadBaseMat2 = Plugin._Instance.config(group6, "Required Material 2", "SurtlingCore:2", new ConfigDescription("Item name : amount (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>())); _odinsMeadBaseMat3 = Plugin._Instance.config(group6, "Required Material 3", "AncientSeed:5", new ConfigDescription("Item name : amount (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>())); _odinsMeadBaseMat4 = Plugin._Instance.config(group6, "Required Material 4", "Resin:10", new ConfigDescription("Item name : amount (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>())); string group7 = english.Localize("$btm_hildirsmeadbase"); _hildirsMeadBaseEnable = Plugin._Instance.config(group7, "Recipe", value: true, new ConfigDescription("Enable/Disables recipe. (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>())); _hildirsMeadBaseMat1 = Plugin._Instance.config(group7, "Required Material 1", "BTM_HaldorMead:1", new ConfigDescription("Item name : amount (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>())); _hildirsMeadBaseMat2 = Plugin._Instance.config(group7, "Required Material 2", "SurtlingCore:1", new ConfigDescription("Item name : amount (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>())); _hildirsMeadBaseMat3 = Plugin._Instance.config(group7, "Required Material 3", "AncientSeed:10", new ConfigDescription("Item name : amount (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>())); _hildirsMeadBaseMat4 = Plugin._Instance.config(group7, "Required Material 4", "GreydwarfEye:10", new ConfigDescription("Item name : amount (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>())); } } public static class PrefabSetup { private static AssetBundle _meadBundle; public static GameObject _dvergrMead; public static GameObject _dvergrMeadBase; public static GameObject _haldorMead; public static GameObject _haldorMeadBase; public static GameObject _herculesMead; public static GameObject _herculesMeadBase; public static GameObject _huginMead; public static GameObject _huginMeadBase; public static GameObject _knarrMead; public static GameObject _knarrMeadBase; public static GameObject _odinMead; public static GameObject _odinMeadBase; public static Sprite _herculesIcon; public static GameObject _hildirsMead; public static GameObject _hildirsMeadBase; public static void Init() { _meadBundle = GetAssetBundleFromResources("meadbundle"); _dvergrMead = _meadBundle.LoadAsset<GameObject>("BTM_DvergrMead"); _dvergrMeadBase = _meadBundle.LoadAsset<GameObject>("BTM_DvergrMeadBase"); _haldorMead = _meadBundle.LoadAsset<GameObject>("BTM_HaldorMead"); _haldorMeadBase = _meadBundle.LoadAsset<GameObject>("BTM_HaldorMeadBase"); _herculesMead = _meadBundle.LoadAsset<GameObject>("BTM_HerculesMead"); _herculesMeadBase = _meadBundle.LoadAsset<GameObject>("BTM_HerculesMeadBase"); _herculesIcon = _herculesMead.GetComponent<ItemDrop>().m_itemData.GetIcon(); _huginMead = _meadBundle.LoadAsset<GameObject>("BTM_HuginMead"); _huginMeadBase = _meadBundle.LoadAsset<GameObject>("BTM_HuginMeadBase"); _knarrMead = _meadBundle.LoadAsset<GameObject>("BTM_KnarrMead"); _knarrMeadBase = _meadBundle.LoadAsset<GameObject>("BTM_KnarrMeadBase"); _odinMead = _meadBundle.LoadAsset<GameObject>("BTM_OdinMead"); _odinMeadBase = _meadBundle.LoadAsset<GameObject>("BTM_OdinMeadBase"); _hildirsMead = _meadBundle.LoadAsset<GameObject>("BTM_HildirsMead"); _hildirsMeadBase = _meadBundle.LoadAsset<GameObject>("BTM_HildirsMeadBase"); } private static AssetBundle GetAssetBundleFromResources(string filename) { Assembly executingAssembly = Assembly.GetExecutingAssembly(); string name = executingAssembly.GetManifestResourceNames().Single((string x) => x.EndsWith(filename)); using Stream stream = executingAssembly.GetManifestResourceStream(name); return AssetBundle.LoadFromStream(stream); } } public static class RegisterPrefabsToObjectDB { private static ObjectDB _objectDB => ObjectDB.instance; public static void Init() { if (Helper.ObjectDBAwake()) { DvergrMead(); HaldorMead(); HerculesMead(); HuginMead(); KnarrMead(); OdinsMead(); MeadBase(); HildirsMead(); } } private static void DvergrMead() { _objectDB.AddClonedObject(PrefabSetup._dvergrMead); RegisterStatusEffects(PrefabSetup._dvergrMead.GetComponent<ItemDrop>().m_itemData.m_shared.m_consumeStatusEffect); } private static void HaldorMead() { _objectDB.AddClonedObject(PrefabSetup._haldorMead); RegisterStatusEffects(PrefabSetup._haldorMead.GetComponent<ItemDrop>().m_itemData.m_shared.m_consumeStatusEffect); } private static void HerculesMead() { _objectDB.AddClonedObject(PrefabSetup._herculesMead); RegisterStatusEffects(PrefabSetup._herculesMead.GetComponent<ItemDrop>().m_itemData.m_shared.m_consumeStatusEffect); } private static void HuginMead() { _objectDB.AddClonedObject(PrefabSetup._huginMead); RegisterStatusEffects(PrefabSetup._huginMead.GetComponent<ItemDrop>().m_itemData.m_shared.m_consumeStatusEffect); } private static void KnarrMead() { _objectDB.AddClonedObject(PrefabSetup._knarrMead); RegisterStatusEffects(PrefabSetup._knarrMead.GetComponent<ItemDrop>().m_itemData.m_shared.m_consumeStatusEffect); } private static void OdinsMead() { _objectDB.AddClonedObject(PrefabSetup._odinMead); RegisterStatusEffects(PrefabSetup._odinMead.GetComponent<ItemDrop>().m_itemData.m_shared.m_consumeStatusEffect); } private static void HildirsMead() { _objectDB.AddClonedObject(PrefabSetup._hildirsMead); RegisterStatusEffects(PrefabSetup._hildirsMead.GetComponent<ItemDrop>().m_itemData.m_shared.m_consumeStatusEffect); } private static void MeadBase() { _objectDB.AddClonedObject(PrefabSetup._dvergrMeadBase); _objectDB.AddClonedObject(PrefabSetup._haldorMeadBase); _objectDB.AddClonedObject(PrefabSetup._herculesMeadBase); _objectDB.AddClonedObject(PrefabSetup._huginMeadBase); _objectDB.AddClonedObject(PrefabSetup._knarrMeadBase); _objectDB.AddClonedObject(PrefabSetup._odinMeadBase); _objectDB.AddClonedObject(PrefabSetup._hildirsMeadBase); } private static void RegisterStatusEffects(StatusEffect statusEffect) { if (statusEffect != null && !Object.op_Implicit((Object)(object)_objectDB.GetStatusEffect(StringExtensionMethods.GetStableHashCode(((Object)statusEffect).name)))) { _objectDB.m_StatusEffects.Add(statusEffect); } } } public static class RegisterPrefabsToZNetScene { private static ZNetScene _zNetScene => ZNetScene.instance; public static void Init() { if (Helper.ZNetSceneAwake()) { _zNetScene.AddClonedObject(PrefabSetup._dvergrMead); _zNetScene.AddClonedObject(PrefabSetup._dvergrMeadBase); _zNetScene.AddClonedObject(PrefabSetup._haldorMead); _zNetScene.AddClonedObject(PrefabSetup._haldorMeadBase); _zNetScene.AddClonedObject(PrefabSetup._herculesMead); _zNetScene.AddClonedObject(PrefabSetup._herculesMeadBase); _zNetScene.AddClonedObject(PrefabSetup._huginMead); _zNetScene.AddClonedObject(PrefabSetup._huginMeadBase); _zNetScene.AddClonedObject(PrefabSetup._knarrMead); _zNetScene.AddClonedObject(PrefabSetup._knarrMeadBase); _zNetScene.AddClonedObject(PrefabSetup._odinMead); _zNetScene.AddClonedObject(PrefabSetup._odinMeadBase); _zNetScene.AddClonedObject(PrefabSetup._hildirsMead); _zNetScene.AddClonedObject(PrefabSetup._hildirsMeadBase); } } } public static class RegisterRecipesToObjectDB { private static ZNetScene _zNetScene => ZNetScene.instance; private static ObjectDB _objectDB => ObjectDB.instance; public static void Init() { if (Helper.ObjectDBAwake() && Helper.ZNetSceneAwake()) { DvergrMeadBase(); HaldorMeadBase(); HerculesMeadBase(); HuginMeadBase(); KnarrMeadBase(); OdinMeadBase(); HildirsMeadBase(); } } private static void DvergrMeadBase() { //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Expected O, but got Unknown //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_015c: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Expected O, but got Unknown //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Expected O, but got Unknown //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Expected O, but got Unknown Recipe val = ScriptableObject.CreateInstance<Recipe>(); ((Object)val).name = "Recipe_BTM_DvergrMeadBase"; val.m_item = PrefabSetup._dvergrMeadBase.GetComponent<ItemDrop>(); val.m_amount = 1; val.m_enabled = ConfigSetup._dvergrMeadBaseEnable.Value; val.m_qualityResultAmountMultiplier = 1f; val.m_craftingStation = _zNetScene.GetPrefab("piece_cauldron").GetComponent<CraftingStation>(); val.m_repairStation = null; val.m_minStationLevel = 1; val.m_requireOnlyOneIngredient = false; string[] array = ConfigSetup._dvergrMeadBaseMat1.Value.Split(':', ' '); string[] array2 = ConfigSetup._dvergrMeadBaseMat2.Value.Split(':', ' '); string[] array3 = ConfigSetup._dvergrMeadBaseMat3.Value.Split(':', ' '); string[] array4 = ConfigSetup._dvergrMeadBaseMat4.Value.Split(':', ' '); val.m_resources = (Requirement[])(object)new Requirement[4] { new Requirement { m_resItem = _objectDB.GetItemPrefab(array[0]).GetComponent<ItemDrop>(), m_amount = int.Parse(array[1]), m_extraAmountOnlyOneIngredient = 0, m_amountPerLevel = 0, m_recover = true }, new Requirement { m_resItem = _objectDB.GetItemPrefab(array2[0]).GetComponent<ItemDrop>(), m_amount = int.Parse(array2[1]), m_extraAmountOnlyOneIngredient = 0, m_amountPerLevel = 0, m_recover = true }, new Requirement { m_resItem = _objectDB.GetItemPrefab(array3[0]).GetComponent<ItemDrop>(), m_amount = int.Parse(array3[1]), m_extraAmountOnlyOneIngredient = 0, m_amountPerLevel = 0, m_recover = true }, new Requirement { m_resItem = _objectDB.GetItemPrefab(array4[0]).GetComponent<ItemDrop>(), m_amount = int.Parse(array4[1]), m_extraAmountOnlyOneIngredient = 0, m_amountPerLevel = 0, m_recover = true } }; _objectDB.AddRecipe(val); } private static void HaldorMeadBase() { //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Expected O, but got Unknown //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_015c: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Expected O, but got Unknown //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Expected O, but got Unknown //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Expected O, but got Unknown Recipe val = ScriptableObject.CreateInstance<Recipe>(); ((Object)val).name = "Recipe_BTM_HaldorMeadBase"; val.m_item = PrefabSetup._haldorMeadBase.GetComponent<ItemDrop>(); val.m_amount = 1; val.m_enabled = ConfigSetup._haldorMeadBaseEnable.Value; val.m_qualityResultAmountMultiplier = 1f; val.m_craftingStation = _zNetScene.GetPrefab("piece_cauldron").GetComponent<CraftingStation>(); val.m_repairStation = null; val.m_minStationLevel = 1; val.m_requireOnlyOneIngredient = false; string[] array = ConfigSetup._haldorMeadBaseMat1.Value.Split(':', ' '); string[] array2 = ConfigSetup._haldorMeadBaseMat2.Value.Split(':', ' '); string[] array3 = ConfigSetup._haldorMeadBaseMat3.Value.Split(':', ' '); string[] array4 = ConfigSetup._haldorMeadBaseMat4.Value.Split(':', ' '); val.m_resources = (Requirement[])(object)new Requirement[4] { new Requirement { m_resItem = _objectDB.GetItemPrefab(array[0]).GetComponent<ItemDrop>(), m_amount = int.Parse(array[1]), m_extraAmountOnlyOneIngredient = 0, m_amountPerLevel = 0, m_recover = true }, new Requirement { m_resItem = _objectDB.GetItemPrefab(array2[0]).GetComponent<ItemDrop>(), m_amount = int.Parse(array2[1]), m_extraAmountOnlyOneIngredient = 0, m_amountPerLevel = 0, m_recover = true }, new Requirement { m_resItem = _objectDB.GetItemPrefab(array3[0]).GetComponent<ItemDrop>(), m_amount = int.Parse(array3[1]), m_extraAmountOnlyOneIngredient = 0, m_amountPerLevel = 0, m_recover = true }, new Requirement { m_resItem = _objectDB.GetItemPrefab(array4[0]).GetComponent<ItemDrop>(), m_amount = int.Parse(array4[1]), m_extraAmountOnlyOneIngredient = 0, m_amountPerLevel = 0, m_recover = true } }; _objectDB.AddRecipe(val); } private static void HerculesMeadBase() { //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Expected O, but got Unknown //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_015c: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Expected O, but got Unknown //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Expected O, but got Unknown //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Expected O, but got Unknown Recipe val = ScriptableObject.CreateInstance<Recipe>(); ((Object)val).name = "Recipe_BTM_HerculesMeadBase"; val.m_item = PrefabSetup._herculesMeadBase.GetComponent<ItemDrop>(); val.m_amount = 1; val.m_enabled = ConfigSetup._herculesMeadBaseEnable.Value; val.m_qualityResultAmountMultiplier = 1f; val.m_craftingStation = _zNetScene.GetPrefab("piece_cauldron").GetComponent<CraftingStation>(); val.m_repairStation = null; val.m_minStationLevel = 1; val.m_requireOnlyOneIngredient = false; string[] array = ConfigSetup._herculesMeadBaseMat1.Value.Split(':', ' '); string[] array2 = ConfigSetup._herculesMeadBaseMat2.Value.Split(':', ' '); string[] array3 = ConfigSetup._herculesMeadBaseMat3.Value.Split(':', ' '); string[] array4 = ConfigSetup._herculesMeadBaseMat4.Value.Split(':', ' '); val.m_resources = (Requirement[])(object)new Requirement[4] { new Requirement { m_resItem = _objectDB.GetItemPrefab(array[0]).GetComponent<ItemDrop>(), m_amount = int.Parse(array[1]), m_extraAmountOnlyOneIngredient = 0, m_amountPerLevel = 0, m_recover = true }, new Requirement { m_resItem = _objectDB.GetItemPrefab(array2[0]).GetComponent<ItemDrop>(), m_amount = int.Parse(array2[1]), m_extraAmountOnlyOneIngredient = 0, m_amountPerLevel = 0, m_recover = true }, new Requirement { m_resItem = _objectDB.GetItemPrefab(array3[0]).GetComponent<ItemDrop>(), m_amount = int.Parse(array3[1]), m_extraAmountOnlyOneIngredient = 0, m_amountPerLevel = 0, m_recover = true }, new Requirement { m_resItem = _objectDB.GetItemPrefab(array4[0]).GetComponent<ItemDrop>(), m_amount = int.Parse(array4[1]), m_extraAmountOnlyOneIngredient = 0, m_amountPerLevel = 0, m_recover = true } }; _objectDB.AddRecipe(val); } private static void HuginMeadBase() { //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Expected O, but got Unknown //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_015c: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Expected O, but got Unknown //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Expected O, but got Unknown //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Expected O, but got Unknown Recipe val = ScriptableObject.CreateInstance<Recipe>(); ((Object)val).name = "Recipe_BTM_HuginMeadBase"; val.m_item = PrefabSetup._huginMeadBase.GetComponent<ItemDrop>(); val.m_amount = 1; val.m_enabled = ConfigSetup._huginMeadBaseEnable.Value; val.m_qualityResultAmountMultiplier = 1f; val.m_craftingStation = _zNetScene.GetPrefab("piece_cauldron").GetComponent<CraftingStation>(); val.m_repairStation = null; val.m_minStationLevel = 1; val.m_requireOnlyOneIngredient = false; string[] array = ConfigSetup._huginMeadBaseMat1.Value.Split(':', ' '); string[] array2 = ConfigSetup._huginMeadBaseMat2.Value.Split(':', ' '); string[] array3 = ConfigSetup._huginMeadBaseMat3.Value.Split(':', ' '); string[] array4 = ConfigSetup._huginMeadBaseMat4.Value.Split(':', ' '); val.m_resources = (Requirement[])(object)new Requirement[4] { new Requirement { m_resItem = _objectDB.GetItemPrefab(array[0]).GetComponent<ItemDrop>(), m_amount = int.Parse(array[1]), m_extraAmountOnlyOneIngredient = 0, m_amountPerLevel = 0, m_recover = true }, new Requirement { m_resItem = _objectDB.GetItemPrefab(array2[0]).GetComponent<ItemDrop>(), m_amount = int.Parse(array2[1]), m_extraAmountOnlyOneIngredient = 0, m_amountPerLevel = 0, m_recover = true }, new Requirement { m_resItem = _objectDB.GetItemPrefab(array3[0]).GetComponent<ItemDrop>(), m_amount = int.Parse(array3[1]), m_extraAmountOnlyOneIngredient = 0, m_amountPerLevel = 0, m_recover = true }, new Requirement { m_resItem = _objectDB.GetItemPrefab(array4[0]).GetComponent<ItemDrop>(), m_amount = int.Parse(array4[1]), m_extraAmountOnlyOneIngredient = 0, m_amountPerLevel = 0, m_recover = true } }; _objectDB.AddRecipe(val); } private static void KnarrMeadBase() { //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Expected O, but got Unknown //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_015c: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Expected O, but got Unknown //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Expected O, but got Unknown //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Expected O, but got Unknown Recipe val = ScriptableObject.CreateInstance<Recipe>(); ((Object)val).name = "Recipe_BTM_KnarrMeadBase"; val.m_item = PrefabSetup._knarrMeadBase.GetComponent<ItemDrop>(); val.m_amount = 1; val.m_enabled = ConfigSetup._knarrMeadBaseEnable.Value; val.m_qualityResultAmountMultiplier = 1f; val.m_craftingStation = _zNetScene.GetPrefab("piece_cauldron").GetComponent<CraftingStation>(); val.m_repairStation = null; val.m_minStationLevel = 1; val.m_requireOnlyOneIngredient = false; string[] array = ConfigSetup._knarrMeadBaseMat1.Value.Split(':', ' '); string[] array2 = ConfigSetup._knarrMeadBaseMat2.Value.Split(':', ' '); string[] array3 = ConfigSetup._knarrMeadBaseMat3.Value.Split(':', ' '); string[] array4 = ConfigSetup._knarrMeadBaseMat4.Value.Split(':', ' '); val.m_resources = (Requirement[])(object)new Requirement[4] { new Requirement { m_resItem = _objectDB.GetItemPrefab(array[0]).GetComponent<ItemDrop>(), m_amount = int.Parse(array[1]), m_extraAmountOnlyOneIngredient = 0, m_amountPerLevel = 0, m_recover = true }, new Requirement { m_resItem = _objectDB.GetItemPrefab(array2[0]).GetComponent<ItemDrop>(), m_amount = int.Parse(array2[1]), m_extraAmountOnlyOneIngredient = 0, m_amountPerLevel = 0, m_recover = true }, new Requirement { m_resItem = _objectDB.GetItemPrefab(array3[0]).GetComponent<ItemDrop>(), m_amount = int.Parse(array3[1]), m_extraAmountOnlyOneIngredient = 0, m_amountPerLevel = 0, m_recover = true }, new Requirement { m_resItem = _objectDB.GetItemPrefab(array4[0]).GetComponent<ItemDrop>(), m_amount = int.Parse(array4[1]), m_extraAmountOnlyOneIngredient = 0, m_amountPerLevel = 0, m_recover = true } }; _objectDB.AddRecipe(val); } private static void OdinMeadBase() { //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Expected O, but got Unknown //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_015c: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Expected O, but got Unknown //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Expected O, but got Unknown //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Expected O, but got Unknown Recipe val = ScriptableObject.CreateInstance<Recipe>(); ((Object)val).name = "Recipe_BTM_OdinMeadBase"; val.m_item = PrefabSetup._odinMeadBase.GetComponent<ItemDrop>(); val.m_amount = 1; val.m_enabled = ConfigSetup._odinsMeadBaseEnable.Value; val.m_qualityResultAmountMultiplier = 1f; val.m_craftingStation = _zNetScene.GetPrefab("piece_cauldron").GetComponent<CraftingStation>(); val.m_repairStation = null; val.m_minStationLevel = 1; val.m_requireOnlyOneIngredient = false; string[] array = ConfigSetup._odinsMeadBaseMat1.Value.Split(':', ' '); string[] array2 = ConfigSetup._odinsMeadBaseMat2.Value.Split(':', ' '); string[] array3 = ConfigSetup._odinsMeadBaseMat3.Value.Split(':', ' '); string[] array4 = ConfigSetup._odinsMeadBaseMat4.Value.Split(':', ' '); val.m_resources = (Requirement[])(object)new Requirement[4] { new Requirement { m_resItem = _objectDB.GetItemPrefab(array[0]).GetComponent<ItemDrop>(), m_amount = int.Parse(array[1]), m_extraAmountOnlyOneIngredient = 0, m_amountPerLevel = 0, m_recover = true }, new Requirement { m_resItem = _objectDB.GetItemPrefab(array2[0]).GetComponent<ItemDrop>(), m_amount = int.Parse(array2[1]), m_extraAmountOnlyOneIngredient = 0, m_amountPerLevel = 0, m_recover = true }, new Requirement { m_resItem = _objectDB.GetItemPrefab(array3[0]).GetComponent<ItemDrop>(), m_amount = int.Parse(array3[1]), m_extraAmountOnlyOneIngredient = 0, m_amountPerLevel = 0, m_recover = true }, new Requirement { m_resItem = _objectDB.GetItemPrefab(array4[0]).GetComponent<ItemDrop>(), m_amount = int.Parse(array4[1]), m_extraAmountOnlyOneIngredient = 0, m_amountPerLevel = 0, m_recover = true } }; _objectDB.AddRecipe(val); } private static void HildirsMeadBase() { //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Expected O, but got Unknown //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_015c: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Expected O, but got Unknown //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Expected O, but got Unknown //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Expected O, but got Unknown Recipe val = ScriptableObject.CreateInstance<Recipe>(); ((Object)val).name = "Recipe_BTM_HildirsMeadBase"; val.m_item = PrefabSetup._hildirsMeadBase.GetComponent<ItemDrop>(); val.m_amount = 1; val.m_enabled = ConfigSetup._hildirsMeadBaseEnable.Value; val.m_qualityResultAmountMultiplier = 1f; val.m_craftingStation = _zNetScene.GetPrefab("piece_cauldron").GetComponent<CraftingStation>(); val.m_repairStation = null; val.m_minStationLevel = 1; val.m_requireOnlyOneIngredient = false; string[] array = ConfigSetup._hildirsMeadBaseMat1.Value.Split(':', ' '); string[] array2 = ConfigSetup._hildirsMeadBaseMat2.Value.Split(':', ' '); string[] array3 = ConfigSetup._hildirsMeadBaseMat3.Value.Split(':', ' '); string[] array4 = ConfigSetup._hildirsMeadBaseMat4.Value.Split(':', ' '); val.m_resources = (Requirement[])(object)new Requirement[4] { new Requirement { m_resItem = _objectDB.GetItemPrefab(array[0]).GetComponent<ItemDrop>(), m_amount = int.Parse(array[1]), m_extraAmountOnlyOneIngredient = 0, m_amountPerLevel = 0, m_recover = true }, new Requirement { m_resItem = _objectDB.GetItemPrefab(array2[0]).GetComponent<ItemDrop>(), m_amount = int.Parse(array2[1]), m_extraAmountOnlyOneIngredient = 0, m_amountPerLevel = 0, m_recover = true }, new Requirement { m_resItem = _objectDB.GetItemPrefab(array3[0]).GetComponent<ItemDrop>(), m_amount = int.Parse(array3[1]), m_extraAmountOnlyOneIngredient = 0, m_amountPerLevel = 0, m_recover = true }, new Requirement { m_resItem = _objectDB.GetItemPrefab(array4[0]).GetComponent<ItemDrop>(), m_amount = int.Parse(array4[1]), m_extraAmountOnlyOneIngredient = 0, m_amountPerLevel = 0, m_recover = true } }; _objectDB.AddRecipe(val); } } [HarmonyPatch(typeof(Game), "Update")] public class GamePatch { public static void Postfix(ref Game __instance) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) if (Plugin._haldorsMeadUsed || Plugin._odinsMeadUsed || Plugin._huginsMeadUsed || Plugin._dvergersMeadUsed || Plugin._hildirsMeadUsed) { Plugin._spawnPoint = ((PlayerProfile)Traverse.Create((object)__instance).Field("m_playerProfile").GetValue()).GetCustomSpawnPoint(); Plugin._spawnPoint.y += 0.5f; if (!Plugin._portalActivated) { Plugin._portalActivated = true; } } } } [HarmonyPatch] public class ObjectDBPatch { [HarmonyPriority(700)] [HarmonyPatch(typeof(ObjectDB), "Awake")] [HarmonyPostfix] public static void Awake_Postfix(ObjectDB __instance) { __instance.m_StatusEffects.Add((StatusEffect)(object)Helper.CreateStatusEffects("blacks7ar_tpmeads_cd", "TP Cooldown", ((IEnumerable<Sprite>)Resources.FindObjectsOfTypeAll<Sprite>()).LastOrDefault((Func<Sprite, bool>)((Sprite x) => ((Object)x).name == "portal")))); __instance.m_StatusEffects.Add((StatusEffect)(object)Helper.CreateStatusEffects("blacks7ar_herculesmead_cd", "Cooldown", PrefabSetup._herculesIcon)); __instance.m_StatusEffects.Add((StatusEffect)(object)Helper.CreateHerculeanBuff("blacks7ar_herculeanbuff_duration", "Herculean Buff", ((IEnumerable<Sprite>)Resources.FindObjectsOfTypeAll<Sprite>()).LastOrDefault((Func<Sprite, bool>)((Sprite x) => ((Object)x).name == "bronzehead_01")))); RegisterPrefabsToObjectDB.Init(); RegisterRecipesToObjectDB.Init(); __instance.UpdateRegisters(); } [HarmonyPatch(typeof(ObjectDB), "CopyOtherDB")] [HarmonyPriority(700)] [HarmonyPostfix] public static void CopyOtherDB_Postfix(ObjectDB __instance) { RegisterPrefabsToObjectDB.Init(); RegisterRecipesToObjectDB.Init(); __instance.UpdateRegisters(); } } [HarmonyPatch] public class PlayerPatch { [HarmonyPatch(typeof(Player), "ConsumeItem")] [HarmonyPrefix] private static bool ConsumeItem_Prefix(ItemData item, ref Player __instance) { //IL_05f0: Unknown result type (might be due to invalid IL or missing references) //IL_05f5: Unknown result type (might be due to invalid IL or missing references) //IL_05f7: Unknown result type (might be due to invalid IL or missing references) //IL_05fe: Unknown result type (might be due to invalid IL or missing references) //IL_0605: Unknown result type (might be due to invalid IL or missing references) //IL_060c: Unknown result type (might be due to invalid IL or missing references) //IL_0611: Unknown result type (might be due to invalid IL or missing references) //IL_0670: Unknown result type (might be due to invalid IL or missing references) //IL_0675: Unknown result type (might be due to invalid IL or missing references) //IL_067a: Unknown result type (might be due to invalid IL or missing references) //IL_0694: Unknown result type (might be due to invalid IL or missing references) //IL_06a0: Unknown result type (might be due to invalid IL or missing references) //IL_063d: Unknown result type (might be due to invalid IL or missing references) //IL_0649: Unknown result type (might be due to invalid IL or missing references) //IL_09a5: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_09b8: Unknown result type (might be due to invalid IL or missing references) //IL_09ba: Unknown result type (might be due to invalid IL or missing references) //IL_09bf: Unknown result type (might be due to invalid IL or missing references) //IL_09d0: Unknown result type (might be due to invalid IL or missing references) //IL_09d2: Unknown result type (might be due to invalid IL or missing references) //IL_09d7: Unknown result type (might be due to invalid IL or missing references) //IL_09dc: Unknown result type (might be due to invalid IL or missing references) //IL_09e1: Unknown result type (might be due to invalid IL or missing references) //IL_09f1: Unknown result type (might be due to invalid IL or missing references) //IL_09f6: Unknown result type (might be due to invalid IL or missing references) //IL_09f8: Unknown result type (might be due to invalid IL or missing references) //IL_09ff: Unknown result type (might be due to invalid IL or missing references) //IL_0a06: Unknown result type (might be due to invalid IL or missing references) //IL_0a0d: Unknown result type (might be due to invalid IL or missing references) //IL_0a12: Unknown result type (might be due to invalid IL or missing references) //IL_0a37: Unknown result type (might be due to invalid IL or missing references) //IL_0a3e: Unknown result type (might be due to invalid IL or missing references) //IL_0346: Unknown result type (might be due to invalid IL or missing references) //IL_0348: Unknown result type (might be due to invalid IL or missing references) //IL_0352: Unknown result type (might be due to invalid IL or missing references) //IL_0357: 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_036c: Unknown result type (might be due to invalid IL or missing references) //IL_0371: 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_037a: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Unknown result type (might be due to invalid IL or missing references) //IL_0388: Unknown result type (might be due to invalid IL or missing references) //IL_038d: 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_03b9: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: 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_0207: 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_020e: 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_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_048b: Unknown result type (might be due to invalid IL or missing references) //IL_0490: Unknown result type (might be due to invalid IL or missing references) //IL_0492: Unknown result type (might be due to invalid IL or missing references) //IL_0499: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Unknown result type (might be due to invalid IL or missing references) //IL_04a7: Unknown result type (might be due to invalid IL or missing references) //IL_04ac: Unknown result type (might be due to invalid IL or missing references) //IL_0781: Unknown result type (might be due to invalid IL or missing references) //IL_078d: Unknown result type (might be due to invalid IL or missing references) //IL_050b: Unknown result type (might be due to invalid IL or missing references) //IL_0510: Unknown result type (might be due to invalid IL or missing references) //IL_0515: Unknown result type (might be due to invalid IL or missing references) //IL_052f: Unknown result type (might be due to invalid IL or missing references) //IL_053b: Unknown result type (might be due to invalid IL or missing references) //IL_04d8: Unknown result type (might be due to invalid IL or missing references) //IL_04e4: Unknown result type (might be due to invalid IL or missing references) switch (((Object)item.m_dropPrefab).name) { case "BTM_DvergrMead": { if (!((Humanoid)__instance).IsTeleportable()) { MessageHud.instance.ShowMessage((MessageType)2, "<size=28>You can't teleport right now.</size>", 0, (Sprite)null); return false; } if (((Character)__instance).GetSEMan().HaveStatusEffect(StringExtensionMethods.GetStableHashCode("blacks7ar_tpmeads_cd"))) { MessageHud.instance.ShowMessage((MessageType)2, "<size=28>You can't teleport right now.</size>", 0, (Sprite)null); return false; } StatusEffect statusEffect2 = ObjectDB.instance.GetStatusEffect(StringExtensionMethods.GetStableHashCode("blacks7ar_tpmeads_cd")); Plugin._dvergersMeadCD.SettingChanged += delegate { statusEffect2.m_ttl = Plugin._dvergersMeadCD.Value; }; statusEffect2.m_ttl = Plugin._dvergersMeadCD.Value; ((Character)__instance).GetSEMan().AddStatusEffect(statusEffect2, false, 0, 0f); Dictionary<Vector3, string> dictionary2 = new Dictionary<Vector3, string>(); LocationInstance val3 = default(LocationInstance); if (ZoneSystem.instance.FindClosestLocation("Vendor_BlackForest", Vector3.zero, ref val3)) { dictionary2[val3.m_position] = val3.m_location.m_prefabName; Plugin._traderPoint = val3.m_position + Vector3.up; Transform transform3 = ((Component)__instance).transform; Vector3 position5 = transform3.position; Plugin._savedPosition = new Vector3(position5.x, position5.y, position5.z); Plugin._dvergersMeadUsed = true; Plugin._huginsMeadUsed = false; Plugin._haldorsMeadUsed = false; Plugin._odinsMeadUsed = false; Plugin._hildirsMeadUsed = false; ((Character)__instance).TeleportTo(Plugin._traderPoint, transform3.rotation, true); } else { Logging.LogInfo("Trader not found, try again later.."); } break; } case "BTM_HuginMead": { if (!((Humanoid)__instance).IsTeleportable()) { MessageHud.instance.ShowMessage((MessageType)2, "<size=28>You can't teleport right now.</size>", 0, (Sprite)null); return false; } if (((Character)__instance).GetSEMan().HaveStatusEffect(StringExtensionMethods.GetStableHashCode("blacks7ar_tpmeads_cd"))) { MessageHud.instance.ShowMessage((MessageType)2, "<size=28>You can't teleport right now.</size>", 0, (Sprite)null); return false; } StatusEffect statusEffect7 = ObjectDB.instance.GetStatusEffect(StringExtensionMethods.GetStableHashCode("blacks7ar_tpmeads_cd")); Plugin._huginsMeadCD.SettingChanged += delegate { statusEffect7.m_ttl = Plugin._huginsMeadCD.Value; }; statusEffect7.m_ttl = Plugin._huginsMeadCD.Value; ((Character)__instance).GetSEMan().AddStatusEffect(statusEffect7, false, 0, 0f); Game instance2 = Game.instance; Vector3 val2 = default(Vector3); if (ZoneSystem.instance.GetLocationIcon(instance2.m_StartLocation, ref val2)) { Plugin._startPoint = val2 + Vector3.up * 2f; Transform transform2 = ((Component)__instance).transform; Vector3 position3 = transform2.position; Plugin._savedPosition = new Vector3(position3.x, position3.y, position3.z); Plugin._huginsMeadUsed = true; Plugin._haldorsMeadUsed = false; Plugin._odinsMeadUsed = false; Plugin._dvergersMeadUsed = false; Plugin._hildirsMeadUsed = false; ((Character)__instance).TeleportTo(Plugin._startPoint, transform2.rotation, true); } break; } case "BTM_HaldorMead": { if (!((Humanoid)__instance).IsTeleportable()) { MessageHud.instance.ShowMessage((MessageType)2, "<size=28>You can't teleport right now.</size>", 0, (Sprite)null); return false; } if (((Character)__instance).GetSEMan().HaveStatusEffect(StringExtensionMethods.GetStableHashCode("blacks7ar_tpmeads_cd"))) { MessageHud.instance.ShowMessage((MessageType)2, "<size=28>You can't teleport right now.</size>", 0, (Sprite)null); return false; } StatusEffect statusEffect6 = ObjectDB.instance.GetStatusEffect(StringExtensionMethods.GetStableHashCode("blacks7ar_tpmeads_cd")); Plugin._haldorsMeadCD.SettingChanged += delegate { statusEffect6.m_ttl = Plugin._haldorsMeadCD.Value; }; statusEffect6.m_ttl = Plugin._haldorsMeadCD.Value; ((Character)__instance).GetSEMan().AddStatusEffect(statusEffect6, false, 0, 0f); Game instance = Game.instance; Vector3 position2 = ((Component)__instance).transform.position; Plugin._savedPosition = new Vector3(position2.x, position2.y, position2.z); Plugin._haldorsMeadUsed = true; Plugin._odinsMeadUsed = false; Plugin._dvergersMeadUsed = false; Plugin._huginsMeadUsed = false; Plugin._hildirsMeadUsed = false; if (Plugin._portalActivated) { ((Character)__instance).TeleportTo(Plugin._spawnPoint, ((Component)__instance).transform.rotation, true); break; } Plugin._spawnPoint = ((PlayerProfile)Traverse.Create((object)instance).Field("m_playerProfile").GetValue()).GetCustomSpawnPoint(); Plugin._spawnPoint.y += 0.5f; ((Character)__instance).TeleportTo(Plugin._spawnPoint, ((Component)__instance).transform.rotation, true); break; } case "BTM_OdinMead": { if (((Character)__instance).GetSEMan().HaveStatusEffect(StringExtensionMethods.GetStableHashCode("blacks7ar_tpmeads_cd"))) { MessageHud.instance.ShowMessage((MessageType)2, "<size=28>You can't teleport right now.</size>", 0, (Sprite)null); return false; } StatusEffect statusEffect3 = ObjectDB.instance.GetStatusEffect(StringExtensionMethods.GetStableHashCode("blacks7ar_tpmeads_cd")); Plugin._odinsMeadCD.SettingChanged += delegate { statusEffect3.m_ttl = Plugin._odinsMeadCD.Value; }; statusEffect3.m_ttl = Plugin._odinsMeadCD.Value; ((Character)__instance).GetSEMan().AddStatusEffect(statusEffect3, false, 0, 0f); Game instance3 = Game.instance; Vector3 position4 = ((Component)__instance).transform.position; Plugin._savedPosition = new Vector3(position4.x, position4.y, position4.z); Plugin._odinsMeadUsed = true; Plugin._haldorsMeadUsed = false; Plugin._dvergersMeadUsed = false; Plugin._huginsMeadUsed = false; Plugin._hildirsMeadUsed = false; if (Plugin._portalActivated) { ((Character)__instance).TeleportTo(Plugin._spawnPoint, ((Component)__instance).transform.rotation, true); break; } Plugin._spawnPoint = ((PlayerProfile)Traverse.Create((object)instance3).Field("m_playerProfile").GetValue()).GetCustomSpawnPoint(); Plugin._spawnPoint.y += 0.5f; ((Character)__instance).TeleportTo(Plugin._spawnPoint, ((Component)__instance).transform.rotation, true); break; } case "BTM_KnarrMead": { if (!Plugin._portalActivated) { MessageHud.instance.ShowMessage((MessageType)2, "<size=28>You don't have a previous saved location to go back to.</size>", 0, (Sprite)null); return false; } if (!((Humanoid)__instance).IsTeleportable()) { MessageHud.instance.ShowMessage((MessageType)2, "<size=28>You can't teleport right now.</size>", 0, (Sprite)null); return false; } if (((Character)__instance).GetSEMan().HaveStatusEffect(StringExtensionMethods.GetStableHashCode("blacks7ar_tpmeads_cd"))) { MessageHud.instance.ShowMessage((MessageType)2, "<size=28>You can't teleport right now.</size>", 0, (Sprite)null); return false; } StatusEffect statusEffect = ObjectDB.instance.GetStatusEffect(StringExtensionMethods.GetStableHashCode("blacks7ar_tpmeads_cd")); Plugin._knarrsMeadCD.SettingChanged += delegate { statusEffect.m_ttl = Plugin._knarrsMeadCD.Value; }; statusEffect.m_ttl = Plugin._knarrsMeadCD.Value; ((Character)__instance).GetSEMan().AddStatusEffect(statusEffect, false, 0, 0f); ((Character)__instance).TeleportTo(Plugin._savedPosition, ((Component)__instance).transform.rotation, true); break; } case "BTM_HerculesMead": { if (((Character)__instance).GetSEMan().HaveStatusEffect(StringExtensionMethods.GetStableHashCode("blacks7ar_herculesmead_cd"))) { MessageHud.instance.ShowMessage((MessageType)2, "<size=28>Can't be use right now.</size>", 0, (Sprite)null); return false; } if (((Character)__instance).GetSEMan().HaveStatusEffect(StringExtensionMethods.GetStableHashCode("blacks7ar_herculeanbuff_duration"))) { MessageHud.instance.ShowMessage((MessageType)2, "<size=28>Herculean Buff is still in effect, try again later.</size>", 0, (Sprite)null); return false; } StatusEffect statusEffect5 = ObjectDB.instance.GetStatusEffect(StringExtensionMethods.GetStableHashCode("blacks7ar_herculesmead_cd")); Plugin._herculesMeadCD.SettingChanged += delegate { statusEffect5.m_ttl = Plugin._herculesMeadCD.Value; }; statusEffect5.m_ttl = Plugin._herculesMeadCD.Value; ((Character)__instance).GetSEMan().AddStatusEffect(statusEffect5, false, 0, 0f); StatusEffect statusEffect8 = ObjectDB.instance.GetStatusEffect(StringExtensionMethods.GetStableHashCode("blacks7ar_herculeanbuff_duration")); Plugin._herculesMeadEffectDuration.SettingChanged += delegate { statusEffect8.m_ttl = Plugin._herculesMeadEffectDuration.Value; }; statusEffect8.m_ttl = Plugin._herculesMeadEffectDuration.Value; ((Character)__instance).GetSEMan().AddStatusEffect(statusEffect8, false, 0, 0f); Player obj = __instance; obj.m_maxCarryWeight *= 2f; Plugin._countBegan = true; break; } case "BTM_HildirsMead": { if (!((Humanoid)__instance).IsTeleportable()) { MessageHud.instance.ShowMessage((MessageType)2, "<size=28>You can't teleport right now.</size>", 0, (Sprite)null); return false; } if (((Character)__instance).GetSEMan().HaveStatusEffect(StringExtensionMethods.GetStableHashCode("blacks7ar_tpmeads_cd"))) { MessageHud.instance.ShowMessage((MessageType)2, "<size=28>You can't teleport right now.</size>", 0, (Sprite)null); return false; } StatusEffect statusEffect4 = ObjectDB.instance.GetStatusEffect(StringExtensionMethods.GetStableHashCode("blacks7ar_tpmeads_cd")); Plugin._hildirsMeadCD.SettingChanged += delegate { statusEffect4.m_ttl = Plugin._hildirsMeadCD.Value; }; statusEffect4.m_ttl = Plugin._hildirsMeadCD.Value; ((Character)__instance).GetSEMan().AddStatusEffect(statusEffect4, false, 0, 0f); Dictionary<Vector3, string> dictionary = new Dictionary<Vector3, string>(); LocationInstance val = default(LocationInstance); if (ZoneSystem.instance.FindClosestLocation("Hildir_camp", Vector3.zero, ref val)) { dictionary[val.m_position] = val.m_location.m_prefabName; Plugin._hildirPoint = val.m_position + Vector3.up; Transform transform = ((Component)__instance).transform; Vector3 position = transform.position; Plugin._savedPosition = new Vector3(position.x, position.y, position.z); Plugin._dvergersMeadUsed = false; Plugin._huginsMeadUsed = false; Plugin._haldorsMeadUsed = false; Plugin._odinsMeadUsed = false; Plugin._hildirsMeadUsed = true; ((Character)__instance).TeleportTo(Plugin._hildirPoint, transform.rotation, true); } else { Logging.LogInfo("Hildirs Camp not found, try again later.."); } break; } } return true; } [HarmonyPatch(typeof(Player), "FixedUpdate")] [HarmonyPostfix] public static void FixedUpdate_Postfix(ref Player __instance) { if (!((Character)__instance).GetSEMan().HaveStatusEffect(StringExtensionMethods.GetStableHashCode("blacks7ar_herculeanbuff_duration")) && Plugin._countBegan) { Player obj = __instance; obj.m_maxCarryWeight /= 2f; Plugin._countBegan = false; } } } [HarmonyPatch(typeof(ZNetScene), "Awake")] public class ZNetScenePatch { public static void Postfix(ZNetScene __instance) { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005c: 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_009b: Expected O, but got Unknown //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Expected O, but got Unknown if ((Object)(object)__instance == (Object)null) { return; } List<GameObject> prefabs = __instance.m_prefabs; if (prefabs == null || prefabs.Count <= 0) { return; } RegisterPrefabsToZNetScene.Init(); Fermenter component = __instance.GetPrefab("fermenter").GetComponent<Fermenter>(); foreach (KeyValuePair<GameObject, GameObject> item in Plugin.ToBeFermented) { component.m_conversion.Add(new ItemConversion { m_producedItems = 10, m_from = __instance.GetPrefab(((Object)item.Key).name).GetComponent<ItemDrop>(), m_to = __instance.GetPrefab(((Object)item.Value).name).GetComponent<ItemDrop>() }); } foreach (KeyValuePair<GameObject, GameObject> item2 in Plugin.ToBeFermented2) { component.m_conversion.Add(new ItemConversion { m_producedItems = 1, m_from = __instance.GetPrefab(((Object)item2.Key).name).GetComponent<ItemDrop>(), m_to = __instance.GetPrefab(((Object)item2.Value).name).GetComponent<ItemDrop>() }); } } } } namespace Microsoft.CodeAnalysis { [<b89b921d-8954-4084-bd4d-1feb826a594e>Embedded] [CompilerGenerated] internal sealed class <b89b921d-8954-4084-bd4d-1feb826a594e>EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [<b89b921d-8954-4084-bd4d-1feb826a594e>Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class <f6f8ff5f-fa45-43ba-9489-b740a9e7c98b>NullableAttribute : Attribute { public readonly byte[] NullableFlags; public <f6f8ff5f-fa45-43ba-9489-b740a9e7c98b>NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public <f6f8ff5f-fa45-43ba-9489-b740a9e7c98b>NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [<b89b921d-8954-4084-bd4d-1feb826a594e>Embedded] internal sealed class <bb5e3e5e-5c47-485a-88ef-ea5afd7f01c7>NullableContextAttribute : Attribute { public readonly byte Flag; public <bb5e3e5e-5c47-485a-88ef-ea5afd7f01c7>NullableContextAttribute(byte P_0) { Flag = P_0; } } } namespace LocalizationManager { [<bb5e3e5e-5c47-485a-88ef-ea5afd7f01c7>NullableContext(1)] [PublicAPI] [<f6f8ff5f-fa45-43ba-9489-b740a9e7c98b>Nullable(0)] internal class Localizer { private static readonly Dictionary<string, Dictionary<string, Func<string>>> PlaceholderProcessors; private static readonly Dictionary<string, Dictionary<string, string>> loadedTexts; private static readonly ConditionalWeakTable<Localization, string> localizationLanguage; private static readonly List<WeakReference<Localization>> localizationObjects; [<f6f8ff5f-fa45-43ba-9489-b740a9e7c98b>Nullable(2)] private static BaseUnityPlugin _plugin; private static readonly List<string> fileExtensions; private static BaseUnityPlugin plugin { get { //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Expected O, but got Unknown if (_plugin == null) { IEnumerable<TypeInfo> source; try { source = Assembly.GetExecutingAssembly().DefinedTypes.ToList(); } catch (ReflectionTypeLoadException ex) { source = from t in ex.Types where t != null select t.GetTypeInfo(); } _plugin = (BaseUnityPlugin)Chainloader.ManagerObject.GetComponent((Type)source.First([<bb5e3e5e-5c47-485a-88ef-ea5afd7f01c7>NullableContext(0)] (TypeInfo t) => t.IsClass && typeof(BaseUnityPlugin).IsAssignableFrom(t))); } return _plugin; } } private static void UpdatePlaceholderText(Localization localization, string key) { localizationLanguage.TryGetValue(localization, out var value); string text = loadedTexts[value][key]; if (PlaceholderProcessors.TryGetValue(key, out var value2)) { text = value2.Aggregate(text, [<bb5e3e5e-5c47-485a-88ef-ea5afd7f01c7>NullableContext(0)] (string current, KeyValuePair<string, Func<string>> kv) => current.Replace("{" + kv.Key + "}", kv.Value())); } localization.AddWord(key, text); } public static void AddPlaceholder<T>(string key, string placeholder, ConfigEntry<T> config, [<f6f8ff5f-fa45-43ba-9489-b740a9e7c98b>Nullable(new byte[] { 2, 1, 1 })] Func<T, string> convertConfigValue = null) { if (convertConfigValue == null) { convertConfigValue = [<bb5e3e5e-5c47-485a-88ef-ea5afd7f01c7>NullableContext(0)] [return: <f6f8ff5f-fa45-43ba-9489-b740a9e7c98b>Nullable(1)] (T val) => val.ToString(); } if (!PlaceholderProcessors.ContainsKey(key)) { PlaceholderProcessors[key] = new Dictionary<string, Func<string>>(); } config.SettingChanged += [<bb5e3e5e-5c47-485a-88ef-ea5afd7f01c7>NullableContext(0)] (object _, EventArgs _) => { UpdatePlaceholder(); }; if (loadedTexts.ContainsKey(Localization.instance.GetSelectedLanguage())) { UpdatePlaceholder(); } void UpdatePlaceholder() { PlaceholderProcessors[key][placeholder] = () => convertConfigValue(config.Value); UpdatePlaceholderText(Localization.instance, key); } } public static void AddText(string key, string text) { List<WeakReference<Localization>> list = new List<WeakReference<Localization>>(); foreach (WeakReference<Localization> localizationObject in localizationObjects) { if (localizationObject.TryGetTarget(out var target)) { Dictionary<string, string> dictionary = loadedTexts[localizationLanguage.GetOrCreateValue(target)]; if (!target.m_translations.ContainsKey(key)) { dictionary[key] = text; target.AddWord(key, text); } } else { list.Add(localizationObject); } } foreach (WeakReference<Localization> item in list) { localizationObjects.Remove(item); } } public static void Load() { LoadLocalization(Localization.instance, Localization.instance.GetSelectedLanguage()); } private static void LoadLocalization(Localization __instance, string language) { if (!localizationLanguage.Remove(__instance)) { localizationObjects.Add(new WeakReference<Localization>(__instance)); } localizationLanguage.Add(__instance, language); Dictionary<string, string> dictionary = new Dictionary<string, string>(); foreach (string item in from f in Directory.GetFiles(Path.GetDirectoryName(Paths.PluginPath), plugin.Info.Metadata.Name + ".*", SearchOption.AllDirectories) where fileExtensions.IndexOf(Path.GetExtension(f)) >= 0 select f) { string text = Path.GetFileNameWithoutExtension(item).Split(new char[1] { '.' })[1]; if (dictionary.ContainsKey(text)) { Debug.LogWarning((object)("Duplicate key " + text + " found for " + plugin.Info.Metadata.Name + ". The duplicate file found at " + item + " will be skipped.")); } else { dictionary[text] = item; } } byte[] array = LoadTranslationFromAssembly("English"); if (array == null) { throw new Exception("Found no English localizations in mod " + plugin.Info.Metadata.Name + ". Expected an embedded resource translations/English.json or translations/English.yml."); } Dictionary<string, string> dictionary2 = new DeserializerBuilder().IgnoreFields().Build().Deserialize<Dictionary<string, string>>(Encoding.UTF8.GetString(array)); if (dictionary2 == null) { throw new Exception("Localization for mod " + plugin.Info.Metadata.Name + " failed: Localization file was empty."); } string text2 = null; if (language != "English") { if (dictionary.ContainsKey(language)) { text2 = File.ReadAllText(dictionary[language]); } else { byte[] array2 = LoadTranslationFromAssembly(language); if (array2 != null) { text2 = Encoding.UTF8.GetString(array2); } } } if (text2 == null && dictionary.ContainsKey("English")) { text2 = File.ReadAllText(dictionary["English"]); } if (text2 != null) { foreach (KeyValuePair<string, string> item2 in new DeserializerBuilder().IgnoreFields().Build().Deserialize<Dictionary<string, string>>(text2) ?? new Dictionary<string, string>()) { dictionary2[item2.Key] = item2.Value; } } loadedTexts[language] = dictionary2; foreach (KeyValuePair<string, string> item3 in dictionary2) { UpdatePlaceholderText(__instance, item3.Key); } } static Localizer() { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown PlaceholderProcessors = new Dictionary<string, Dictionary<string, Func<string>>>(); loadedTexts = new Dictionary<string, Dictionary<string, string>>(); localizationLanguage = new ConditionalWeakTable<Localization, string>(); localizationObjects = new List<WeakReference<Localization>>(); fileExtensions = new List<string> { ".json", ".yml" }; new Harmony("org.bepinex.helpers.LocalizationManager").Patch((MethodBase)AccessTools.DeclaredMethod(typeof(Localization), "LoadCSV", (Type[])null, (Type[])null), (HarmonyMethod)null, new HarmonyMethod(AccessTools.DeclaredMethod(typeof(Localizer), "LoadLocalization", (Type[])null, (Type[])null)), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } [return: <f6f8ff5f-fa45-43ba-9489-b740a9e7c98b>Nullable(2)] private static byte[] LoadTranslationFromAssembly(string language) { foreach (string fileExtension in fileExtensions) { byte[] array = ReadEmbeddedFileBytes("translations." + language + fileExtension); if (array != null) { return array; } } return null; } [<bb5e3e5e-5c47-485a-88ef-ea5afd7f01c7>NullableContext(2)] public static byte[] ReadEmbeddedFileBytes([<f6f8ff5f-fa45-43ba-9489-b740a9e7c98b>Nullable(1)] string resourceFileName, Assembly containingAssembly = null) { using MemoryStream memoryStream = new MemoryStream(); if ((object)containingAssembly == null) { containingAssembly = Assembly.GetCallingAssembly(); } string text = containingAssembly.GetManifestResourceNames().FirstOrDefault([<bb5e3e5e-5c47-485a-88ef-ea5afd7f01c7>NullableContext(0)] (string str) => str.EndsWith(resourceFileName, StringComparison.Ordinal)); if (text != null) { containingAssembly.GetManifestResourceStream(text)?.CopyTo(memoryStream); } return (memoryStream.Length == 0L) ? null : memoryStream.ToArray(); } } } namespace Microsoft.CodeAnalysis { [CompilerGenerated] [<c92073a2-53ca-45ee-9ddf-e51047ce755e>Embedded] internal sealed class <c92073a2-53ca-45ee-9ddf-e51047ce755e>EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [<c92073a2-53ca-45ee-9ddf-e51047ce755e>Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class <79d6ad86-8235-42f0-9edf-34356f216d24>NullableAttribute : Attribute { public readonly byte[] NullableFlags; public <79d6ad86-8235-42f0-9edf-34356f216d24>NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public <79d6ad86-8235-42f0-9edf-34356f216d24>NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [<c92073a2-53ca-45ee-9ddf-e51047ce755e>Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class <15628f4a-31df-48ee-8ddb-8214dbfd2964>NullableContextAttribute : Attribute { public readonly byte Flag; public <15628f4a-31df-48ee-8ddb-8214dbfd2964>NullableContextAttribute(byte P_0) { Flag = P_0; } } } namespace System.Diagnostics.CodeAnalysis { [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)] internal sealed class AllowNullAttribute : Attribute { } [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)] internal sealed class DisallowNullAttribute : Attribute { } [AttributeUsage(AttributeTargets.Method, Inherited = false)] internal sealed class DoesNotReturnAttribute : Attribute { } [AttributeUsage(AttributeTargets.Parameter, Inherited = false)] internal sealed class DoesNotReturnIfAttribute : Attribute { public bool ParameterValue { get; } public DoesNotReturnIfAttribute(bool parameterValue) { ParameterValue = parameterValue; } } [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)] internal sealed class MaybeNullAttribute : Attribute { } [AttributeUsage(AttributeTargets.Parameter, Inherited = false)] internal sealed class MaybeNullWhenAttribute : Attribute { public bool ReturnValue { get; } public MaybeNullWhenAttribute(bool returnValue) { ReturnValue = returnValue; } } [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)] internal sealed class NotNullAttribute : Attribute { } [<79d6ad86-8235-42f0-9edf-34356f216d24>Nullable(0)] [AttributeUsage(AttributeTargets.Property | AttributeTargets.Parameter | AttributeTargets.ReturnValue, AllowMultiple = true, Inherited = false)] [<15628f4a-31df-48ee-8ddb-8214dbfd2964>NullableContext(1)] internal sealed class NotNullIfNotNullAttribute : Attribute { public string ParameterName { get; } public NotNullIfNotNullAttribute(string parameterName) { ParameterName = parameterName; } } [AttributeUsage(AttributeTargets.Parameter, Inherited = false)] internal sealed class NotNullWhenAttribute : Attribute { public bool ReturnValue { get; } public NotNullWhenAttribute(bool returnValue) { ReturnValue = returnValue; } } } namespace System.Collections.Generic { internal static class DeconstructionExtensions { [<15628f4a-31df-48ee-8ddb-8214dbfd2964>NullableContext(1)] public static void Deconstruct<[<79d6ad86-8235-42f0-9edf-34356f216d24>Nullable(2)] TKey, [<79d6ad86-8235-42f0-9edf-34356f216d24>Nullable(2)] TValue>([<79d6ad86-8235-42f0-9edf-34356f216d24>Nullable(new byte[] { 0, 1, 1 })] this KeyValuePair<TKey, TValue> pair, out TKey key, out TValue value) { key = pair.Key; value = pair.Value; } } } namespace YamlDotNet { [<15628f4a-31df-48ee-8ddb-8214dbfd2964>NullableContext(1)] [<79d6ad86-8235-42f0-9edf-34356f216d24>Nullable(0)] internal sealed class CultureInfoAdapter : CultureInfo { private readonly IFormatProvider provider; public CultureInfoAdapter(CultureInfo baseCulture, IFormatProvider provider) : base(baseCulture.LCID) { this.provider = provider; } [<15628f4a-31df-48ee-8ddb-8214dbfd2964>NullableContext(2)] public override object GetFormat(Type formatType) { return provider.GetFormat(formatType); } } [<79d6ad86-8235-42f0-9edf-34356f216d24>Nullable(0)] [<15628f4a-31df-48ee-8ddb-8214dbfd2964>NullableContext(1)] internal static class ReflectionExtensions { [<79d6ad86-8235-42f0-9edf-34356f216d24>Nullable(2)] private static readonly FieldInfo RemoteStackTraceField = typeof(Exception).GetField("_remoteStackTraceString", BindingFlags.Instance | BindingFlags.NonPublic); [return: <79d6ad86-8235-42f0-9edf-34356f216d24>Nullable(2)] public static Type BaseType(this Type type) { return t