Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of PotionPlus v4.3.1
PotionsPlus.dll
Decompiled 2 days 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.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Serialization; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using System.Text.RegularExpressions; using System.Threading; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using Groups; using HarmonyLib; using ItemManager; using JetBrains.Annotations; using LocalizationManager; using Microsoft.CodeAnalysis; using PieceManager; using ServerSync; using SkillManager; using TMPro; using UnityEngine; using UnityEngine.UI; using YamlDotNet.Core; using YamlDotNet.Core.Events; using YamlDotNet.Core.ObjectPool; using YamlDotNet.Core.Tokens; using YamlDotNet.Helpers; using YamlDotNet.Serialization; using YamlDotNet.Serialization.BufferedDeserialization; using YamlDotNet.Serialization.BufferedDeserialization.TypeDiscriminators; using YamlDotNet.Serialization.Callbacks; 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("150BFDAF-FF35-4302-B7CC-BEDCE69118D5")] [assembly: ComVisible(false)] [assembly: AssemblyTrademark("")] [assembly: AssemblyCopyright("Copyright © 2022")] [assembly: AssemblyProduct("PotionsPlus")] [assembly: AssemblyCompany("")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyDescription("https://valheim.thunderstore.io/package/OdinPlus/PotionPlus")] [assembly: AssemblyTitle("PotionsPlus")] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: CompilationRelaxations(8)] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyConfiguration("")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: <9407dcec-b638-448b-adf5-8a2e40be51e7>RefSafetyRules(11)] [module: UnverifiableCode] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [<1195e483-29da-41f7-8154-e81dc911ce3c>Embedded] internal sealed class <1195e483-29da-41f7-8154-e81dc911ce3c>EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [<1195e483-29da-41f7-8154-e81dc911ce3c>Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class <6e8bc1f7-ed74-405e-8cf6-e77cb9d255f7>NullableAttribute : Attribute { public readonly byte[] NullableFlags; public <6e8bc1f7-ed74-405e-8cf6-e77cb9d255f7>NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public <6e8bc1f7-ed74-405e-8cf6-e77cb9d255f7>NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [<1195e483-29da-41f7-8154-e81dc911ce3c>Embedded] [CompilerGenerated] internal sealed class <278e803c-873f-4fa5-9ebc-5b24f0c1bd96>NullableContextAttribute : Attribute { public readonly byte Flag; public <278e803c-873f-4fa5-9ebc-5b24f0c1bd96>NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [<1195e483-29da-41f7-8154-e81dc911ce3c>Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class <9407dcec-b638-448b-adf5-8a2e40be51e7>RefSafetyRulesAttribute : Attribute { public readonly int Version; public <9407dcec-b638-448b-adf5-8a2e40be51e7>RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace SkillManager { [<278e803c-873f-4fa5-9ebc-5b24f0c1bd96>NullableContext(1)] [<6e8bc1f7-ed74-405e-8cf6-e77cb9d255f7>Nullable(0)] [PublicAPI] public class Skill { [<6e8bc1f7-ed74-405e-8cf6-e77cb9d255f7>Nullable(0)] public static class LocalizationCache { private static readonly Dictionary<string, Localization> localizations = new Dictionary<string, Localization>(); internal static void LocalizationPostfix(Localization __instance, string language) { string key = localizations.FirstOrDefault([<278e803c-873f-4fa5-9ebc-5b24f0c1bd96>NullableContext(0)] (KeyValuePair<string, Localization> l) => l.Value == __instance).Key; if (key != null) { localizations.Remove(key); } if (!localizations.ContainsKey(language)) { localizations.Add(language, __instance); } } public static Localization ForLanguage([<6e8bc1f7-ed74-405e-8cf6-e77cb9d255f7>Nullable(2)] string language = null) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown if (localizations.TryGetValue(language ?? PlayerPrefs.GetString("language", "English"), out var value)) { return value; } value = new Localization(); if (language != null) { value.SetupLanguage(language); } return value; } } [PublicAPI] [<6e8bc1f7-ed74-405e-8cf6-e77cb9d255f7>Nullable(0)] public class LocalizeKey { private static readonly List<LocalizeKey> keys = new List<LocalizeKey>(); public readonly string Key; public readonly Dictionary<string, string> Localizations = new Dictionary<string, string>(); public LocalizeKey(string key) { Key = key.Replace("$", ""); keys.Add(this); } public void Alias(string alias) { Localizations.Clear(); if (!alias.Contains("$")) { alias = "$" + alias; } Localizations["alias"] = alias; if (Localization.m_instance != null) { Localization.instance.AddWord(Key, Localization.instance.Localize(alias)); } } public LocalizeKey English(string key) { return addForLang("English", key); } public LocalizeKey Swedish(string key) { return addForLang("Swedish", key); } public LocalizeKey French(string key) { return addForLang("French", key); } public LocalizeKey Italian(string key) { return addForLang("Italian", key); } public LocalizeKey German(string key) { return addForLang("German", key); } public LocalizeKey Spanish(string key) { return addForLang("Spanish", key); } public LocalizeKey Russian(string key) { return addForLang("Russian", key); } public LocalizeKey Romanian(string key) { return addForLang("Romanian", key); } public LocalizeKey Bulgarian(string key) { return addForLang("Bulgarian", key); } public LocalizeKey Macedonian(string key) { return addForLang("Macedonian", key); } public LocalizeKey Finnish(string key) { return addForLang("Finnish", key); } public LocalizeKey Danish(string key) { return addForLang("Danish", key); } public LocalizeKey Norwegian(string key) { return addForLang("Norwegian", key); } public LocalizeKey Icelandic(string key) { return addForLang("Icelandic", key); } public LocalizeKey Turkish(string key) { return addForLang("Turkish", key); } public LocalizeKey Lithuanian(string key) { return addForLang("Lithuanian", key); } public LocalizeKey Czech(string key) { return addForLang("Czech", key); } public LocalizeKey Hungarian(string key) { return addForLang("Hungarian", key); } public LocalizeKey Slovak(string key) { return addForLang("Slovak", key); } public LocalizeKey Polish(string key) { return addForLang("Polish", key); } public LocalizeKey Dutch(string key) { return addForLang("Dutch", key); } public LocalizeKey Portuguese_European(string key) { return addForLang("Portuguese_European", key); } public LocalizeKey Portuguese_Brazilian(string key) { return addForLang("Portuguese_Brazilian", key); } public LocalizeKey Chinese(string key) { return addForLang("Chinese", key); } public LocalizeKey Japanese(string key) { return addForLang("Japanese", key); } public LocalizeKey Korean(string key) { return addForLang("Korean", key); } public LocalizeKey Hindi(string key) { return addForLang("Hindi", key); } public LocalizeKey Thai(string key) { return addForLang("Thai", key); } public LocalizeKey Abenaki(string key) { return addForLang("Abenaki", key); } public LocalizeKey Croatian(string key) { return addForLang("Croatian", key); } public LocalizeKey Georgian(string key) { return addForLang("Georgian", key); } public LocalizeKey Greek(string key) { return addForLang("Greek", key); } public LocalizeKey Serbian(string key) { return addForLang("Serbian", key); } public LocalizeKey Ukrainian(string key) { return addForLang("Ukrainian", key); } private LocalizeKey addForLang(string lang, string value) { Localizations[lang] = value; if (Localization.m_instance != null) { if (Localization.instance.GetSelectedLanguage() == lang) { Localization.instance.AddWord(Key, value); } else if (lang == "English" && !Localization.instance.m_translations.ContainsKey(Key)) { Localization.instance.AddWord(Key, value); } } return this; } [HarmonyPriority(300)] internal static void AddLocalizedKeys(Localization __instance, string language) { foreach (LocalizeKey key in keys) { string value2; if (key.Localizations.TryGetValue(language, out var value) || key.Localizations.TryGetValue("English", out value)) { __instance.AddWord(key.Key, value); } else if (key.Localizations.TryGetValue("alias", out value2)) { __instance.AddWord(key.Key, Localization.instance.Localize(value2)); } } } } [<278e803c-873f-4fa5-9ebc-5b24f0c1bd96>NullableContext(0)] private class ConfigurationManagerAttributes { [<6e8bc1f7-ed74-405e-8cf6-e77cb9d255f7>Nullable(2)] [UsedImplicitly] public string Category; } [<278e803c-873f-4fa5-9ebc-5b24f0c1bd96>NullableContext(0)] [HarmonyPatch(typeof(Skills), "IsSkillValid")] private static class Patch_Skills_IsSkillValid { private static void Postfix(SkillType type, ref bool __result) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) if (!__result && skills.ContainsKey(type)) { __result = true; } } } private static readonly Dictionary<SkillType, Skill> skills; internal static readonly Dictionary<string, Skill> skillByName; private readonly string skillName; private readonly string internalSkillName; private readonly SkillDef skillDef; public readonly LocalizeKey Name; public readonly LocalizeKey Description; private float skillEffectFactor = 1f; private int skillLoss = 5; public bool Configurable = false; private static bool InitializedTerminal; [<6e8bc1f7-ed74-405e-8cf6-e77cb9d255f7>Nullable(2)] private static Localization _english; [<6e8bc1f7-ed74-405e-8cf6-e77cb9d255f7>Nullable(2)] private static BaseUnityPlugin _plugin; private static bool hasConfigSync; [<6e8bc1f7-ed74-405e-8cf6-e77cb9d255f7>Nullable(2)] private static object _configSync; public float SkillGainFactor { get { return skillDef.m_increseStep; } set { skillDef.m_increseStep = value; this.SkillGainFactorChanged?.Invoke(value); } } public float SkillEffectFactor { get { return skillEffectFactor; } set { skillEffectFactor = value; this.SkillEffectFactorChanged?.Invoke(value); } } public int SkillLoss { get { return skillLoss; } set { skillLoss = value; this.SkillLossChanged?.Invoke(value); } } private static Localization english => _english ?? (_english = LocalizationCache.ForLanguage("English")); private static BaseUnityPlugin plugin { get { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Expected O, but got Unknown object obj = _plugin; if (obj == null) { BaseUnityPlugin val = (BaseUnityPlugin)Chainloader.ManagerObject.GetComponent((Type)Assembly.GetExecutingAssembly().DefinedTypes.First([<278e803c-873f-4fa5-9ebc-5b24f0c1bd96>NullableContext(0)] (TypeInfo t) => t.IsClass && typeof(BaseUnityPlugin).IsAssignableFrom(t))); _plugin = val; obj = (object)val; } return (BaseUnityPlugin)obj; } } [<6e8bc1f7-ed74-405e-8cf6-e77cb9d255f7>Nullable(2)] private static object configSync { [<278e803c-873f-4fa5-9ebc-5b24f0c1bd96>NullableContext(2)] get { if (_configSync == null && hasConfigSync) { Type type = Assembly.GetExecutingAssembly().GetType("ServerSync.ConfigSync"); if ((object)type != null) { _configSync = Activator.CreateInstance(type, plugin.Info.Metadata.GUID + " SkillManager"); type.GetField("CurrentVersion").SetValue(_configSync, plugin.Info.Metadata.Version.ToString()); type.GetProperty("IsLocked").SetValue(_configSync, true); } else { hasConfigSync = false; } } return _configSync; } } [<6e8bc1f7-ed74-405e-8cf6-e77cb9d255f7>Nullable(2)] [method: <278e803c-873f-4fa5-9ebc-5b24f0c1bd96>NullableContext(2)] [field: <6e8bc1f7-ed74-405e-8cf6-e77cb9d255f7>Nullable(2)] public event Action<float> SkillGainFactorChanged; [<6e8bc1f7-ed74-405e-8cf6-e77cb9d255f7>Nullable(2)] [method: <278e803c-873f-4fa5-9ebc-5b24f0c1bd96>NullableContext(2)] [field: <6e8bc1f7-ed74-405e-8cf6-e77cb9d255f7>Nullable(2)] public event Action<float> SkillEffectFactorChanged; [<6e8bc1f7-ed74-405e-8cf6-e77cb9d255f7>Nullable(2)] [method: <278e803c-873f-4fa5-9ebc-5b24f0c1bd96>NullableContext(2)] [field: <6e8bc1f7-ed74-405e-8cf6-e77cb9d255f7>Nullable(2)] public event Action<float> SkillLossChanged; public Skill(string englishName, string icon) : this(englishName, loadSprite(icon, 64, 64)) { } public unsafe Skill(string englishName, Sprite icon) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown SkillType val = fromName(englishName); string text = new Regex("[^a-zA-Z]").Replace(englishName, "_"); skills[val] = this; skillByName[englishName] = this; skillDef = new SkillDef { m_description = "$skilldesc_" + text, m_icon = icon, m_increseStep = 1f, m_skill = val }; internalSkillName = text; skillName = englishName; Name = new LocalizeKey("skill_" + ((object)(*(SkillType*)(&val))/*cast due to .constrained prefix*/).ToString()).English(englishName); Description = new LocalizeKey("skilldesc_" + text); } public static SkillType fromName(string englishName) { return (SkillType)Math.Abs(StringExtensionMethods.GetStableHashCode(englishName)); } static Skill() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Expected O, but got Unknown //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Expected O, but got Unknown //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Expected O, but got Unknown //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Expected O, but got Unknown //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Expected O, but got Unknown //IL_01ad: Expected O, but got Unknown //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Expected O, but got Unknown //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Expected O, but got Unknown //IL_023f: Expected O, but got Unknown skills = new Dictionary<SkillType, Skill>(); skillByName = new Dictionary<string, Skill>(); InitializedTerminal = false; hasConfigSync = true; Harmony val = new Harmony("org.bepinex.helpers.skillmanager"); val.Patch((MethodBase)AccessTools.DeclaredMethod(typeof(FejdStartup), "Awake", (Type[])null, (Type[])null), (HarmonyMethod)null, new HarmonyMethod(AccessTools.DeclaredMethod(typeof(Skill), "Patch_FejdStartup", (Type[])null, (Type[])null)), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); val.Patch((MethodBase)AccessTools.DeclaredMethod(typeof(Skills), "GetSkillDef", (Type[])null, (Type[])null), (HarmonyMethod)null, new HarmonyMethod(AccessTools.DeclaredMethod(typeof(Skill), "Patch_Skills_GetSkillDef", (Type[])null, (Type[])null)), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); val.Patch((MethodBase)AccessTools.DeclaredMethod(typeof(Skills), "CheatRaiseSkill", (Type[])null, (Type[])null), new HarmonyMethod(AccessTools.DeclaredMethod(typeof(Skill), "Patch_Skills_CheatRaiseskill", (Type[])null, (Type[])null)), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); val.Patch((MethodBase)AccessTools.DeclaredMethod(typeof(Skills), "CheatResetSkill", (Type[])null, (Type[])null), new HarmonyMethod(AccessTools.DeclaredMethod(typeof(Skill), "Patch_Skills_CheatResetSkill", (Type[])null, (Type[])null)), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); val.Patch((MethodBase)AccessTools.DeclaredMethod(typeof(Localization), "LoadCSV", (Type[])null, (Type[])null), (HarmonyMethod)null, new HarmonyMethod(AccessTools.DeclaredMethod(typeof(LocalizeKey), "AddLocalizedKeys", (Type[])null, (Type[])null)), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); val.Patch((MethodBase)AccessTools.DeclaredMethod(typeof(Terminal), "InitTerminal", (Type[])null, (Type[])null), new HarmonyMethod(AccessTools.DeclaredMethod(typeof(Skill), "Patch_Terminal_InitTerminal_Prefix", (Type[])null, (Type[])null)), new HarmonyMethod(AccessTools.DeclaredMethod(typeof(Skill), "Patch_Terminal_InitTerminal", (Type[])null, (Type[])null)), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); val.Patch((MethodBase)AccessTools.DeclaredMethod(typeof(Localization), "SetupLanguage", (Type[])null, (Type[])null), (HarmonyMethod)null, new HarmonyMethod(AccessTools.DeclaredMethod(typeof(LocalizationCache), "LocalizationPostfix", (Type[])null, (Type[])null)), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); val.Patch((MethodBase)AccessTools.DeclaredMethod(typeof(Skills), "OnDeath", (Type[])null, (Type[])null), new HarmonyMethod(AccessTools.DeclaredMethod(typeof(Skill), "Patch_Skills_OnDeath_Prefix", (Type[])null, (Type[])null)), (HarmonyMethod)null, (HarmonyMethod)null, new HarmonyMethod(AccessTools.DeclaredMethod(typeof(Skill), "Patch_Skills_OnDeath_Finalizer", (Type[])null, (Type[])null)), (HarmonyMethod)null); } private static void Patch_FejdStartup() { //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Expected O, but got Unknown //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Expected O, but got Unknown //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Expected O, but got Unknown foreach (Skill skill in skills.Values) { if (skill.Configurable) { string key = skill.Name.Key; string text = new Regex("['[\"\\]]").Replace(english.Localize(key), "").Trim(); string category = Localization.instance.Localize(key).Trim(); ConfigEntry<float> skillGain = config(text, "Skill gain factor", skill.SkillGainFactor, new ConfigDescription("The rate at which you gain experience for the skill.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.01f, 5f), new object[1] { new ConfigurationManagerAttributes { Category = category } })); skill.SkillGainFactor = skillGain.Value; skillGain.SettingChanged += [<278e803c-873f-4fa5-9ebc-5b24f0c1bd96>NullableContext(0)] (object _, EventArgs _) => { skill.SkillGainFactor = skillGain.Value; }; ConfigEntry<float> skillEffect = config(text, "Skill effect factor", skill.SkillEffectFactor, new ConfigDescription("The power of the skill, based on the default power.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.01f, 5f), new object[1] { new ConfigurationManagerAttributes { Category = category } })); skill.SkillEffectFactor = skillEffect.Value; skillEffect.SettingChanged += [<278e803c-873f-4fa5-9ebc-5b24f0c1bd96>NullableContext(0)] (object _, EventArgs _) => { skill.SkillEffectFactor = skillEffect.Value; }; ConfigEntry<int> skillLoss = config(text, "Skill loss", skill.skillLoss, new ConfigDescription("How much experience to lose on death.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), new object[1] { new ConfigurationManagerAttributes { Category = category } })); skill.skillLoss = skillLoss.Value; skillLoss.SettingChanged += [<278e803c-873f-4fa5-9ebc-5b24f0c1bd96>NullableContext(0)] (object _, EventArgs _) => { skill.skillLoss = skillLoss.Value; }; } } } private static void Patch_Skills_GetSkillDef([<6e8bc1f7-ed74-405e-8cf6-e77cb9d255f7>Nullable(2)] ref SkillDef __result, List<SkillDef> ___m_skills, SkillType type) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) if (__result == null) { SkillDef val = GetSkillDef(type); if (val != null) { ___m_skills.Add(val); __result = val; } } } private unsafe static bool Patch_Skills_CheatRaiseskill(Skills __instance, string name, float value, Player ___m_player) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) foreach (SkillType key in skills.Keys) { Skill skill = skills[key]; if (string.Equals(skill.internalSkillName, name, StringComparison.CurrentCultureIgnoreCase)) { Skill skill2 = __instance.GetSkill(key); skill2.m_level += value; skill2.m_level = Mathf.Clamp(skill2.m_level, 0f, 100f); ((Character)___m_player).Message((MessageType)1, "Skill increased " + Localization.instance.Localize("$skill_" + ((object)(*(SkillType*)(&key))/*cast due to .constrained prefix*/).ToString()) + ": " + (int)skill2.m_level, 0, skill2.m_info.m_icon); Console.instance.Print("Skill " + skill.internalSkillName + " = " + skill2.m_level); return false; } } return true; } private static bool Patch_Skills_CheatResetSkill(Skills __instance, string name) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) foreach (SkillType key in skills.Keys) { Skill skill = skills[key]; if (string.Equals(skill.internalSkillName, name, StringComparison.CurrentCultureIgnoreCase)) { __instance.ResetSkill(key); Console.instance.Print("Skill " + skill.internalSkillName + " reset"); return false; } } return true; } private static void Patch_Skills_OnDeath_Prefix(Skills __instance, [<6e8bc1f7-ed74-405e-8cf6-e77cb9d255f7>Nullable(new byte[] { 2, 1 })] ref Dictionary<SkillType, Skill> __state) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) if (__state == null) { __state = new Dictionary<SkillType, Skill>(); } foreach (KeyValuePair<SkillType, Skill> skill in skills) { if (__instance.m_skillData.TryGetValue(skill.Key, out var value)) { __state[skill.Key] = value; if (skill.Value.skillLoss > 0) { Skill obj = value; obj.m_level -= value.m_level * (float)skill.Value.SkillLoss / 100f; value.m_accumulator = 0f; } __instance.m_skillData.Remove(skill.Key); } } } private static void Patch_Skills_OnDeath_Finalizer(Skills __instance, [<6e8bc1f7-ed74-405e-8cf6-e77cb9d255f7>Nullable(new byte[] { 2, 1 })] ref Dictionary<SkillType, Skill> __state) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) if (__state == null) { return; } foreach (KeyValuePair<SkillType, Skill> item in __state) { __instance.m_skillData[item.Key] = item.Value; } __state = null; } private static void Patch_Terminal_InitTerminal_Prefix() { InitializedTerminal = Terminal.m_terminalInitialized; } private static void Patch_Terminal_InitTerminal() { if (!InitializedTerminal) { AddSkill(Terminal.commands["raiseskill"]); AddSkill(Terminal.commands["resetskill"]); } static void AddSkill(ConsoleCommand command) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown ConsoleOptionsFetcher fetcher = command.m_tabOptionsFetcher; command.m_tabOptionsFetcher = (ConsoleOptionsFetcher)([<278e803c-873f-4fa5-9ebc-5b24f0c1bd96>NullableContext(0)] () => { List<string> list = fetcher.Invoke(); list.AddRange(skills.Values.Select([<278e803c-873f-4fa5-9ebc-5b24f0c1bd96>NullableContext(0)] (Skill skill) => skill.internalSkillName)); return list; }); } } [<278e803c-873f-4fa5-9ebc-5b24f0c1bd96>NullableContext(2)] private static SkillDef GetSkillDef(SkillType skillType) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) if (!skills.ContainsKey(skillType)) { return null; } Skill skill = skills[skillType]; return skill.skillDef; } private static byte[] ReadEmbeddedFileBytes(string name) { using MemoryStream memoryStream = new MemoryStream(); Assembly.GetExecutingAssembly().GetManifestResourceStream(Assembly.GetExecutingAssembly().GetName().Name + "." + name).CopyTo(memoryStream); return memoryStream.ToArray(); } private static Texture2D loadTexture(string name) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Expected O, but got Unknown Texture2D val = new Texture2D(0, 0); ImageConversion.LoadImage(val, ReadEmbeddedFileBytes("icons." + name)); return val; } private static Sprite loadSprite(string name, int width, int height) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) return Sprite.Create(loadTexture(name), new Rect(0f, 0f, (float)width, (float)height), Vector2.zero); } private static ConfigEntry<T> config<[<6e8bc1f7-ed74-405e-8cf6-e77cb9d255f7>Nullable(2)] T>(string group, string name, T value, ConfigDescription description) { ConfigEntry<T> val = plugin.Config.Bind<T>(group, name, value, description); configSync?.GetType().GetMethod("AddConfigEntry").MakeGenericMethod(typeof(T)) .Invoke(configSync, new object[1] { val }); return val; } private static ConfigEntry<T> config<[<6e8bc1f7-ed74-405e-8cf6-e77cb9d255f7>Nullable(2)] T>(string group, string name, T value, string description) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown return config(group, name, value, new ConfigDescription(description, (AcceptableValueBase)null, Array.Empty<object>())); } } public static class SkillManagerVersion { [<6e8bc1f7-ed74-405e-8cf6-e77cb9d255f7>Nullable(1)] public const string Version = "1.7.0"; } [PublicAPI] [<278e803c-873f-4fa5-9ebc-5b24f0c1bd96>NullableContext(1)] [<6e8bc1f7-ed74-405e-8cf6-e77cb9d255f7>Nullable(0)] public static class SkillExtensions { public static float GetSkillFactor(this Character character, string name) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return character.GetSkillFactor(Skill.fromName(name)) * Skill.skillByName[name].SkillEffectFactor; } public static float GetSkillFactor(this Skills skills, string name) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return skills.GetSkillFactor(Skill.fromName(name)) * Skill.skillByName[name].SkillEffectFactor; } public static void RaiseSkill(this Character character, string name, float value = 1f) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) character.RaiseSkill(Skill.fromName(name), value); } public static void RaiseSkill(this Skills skill, string name, float value = 1f) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) skill.RaiseSkill(Skill.fromName(name), value); } public static void LowerSkill(this Character character, string name, float factor = 1f) { character.GetSkills().LowerSkill(name, factor); } public static void LowerSkill(this Skills skills, string name, float factor) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) if (factor > 0f && skills.m_skillData.TryGetValue(Skill.fromName(name), out var value)) { Skill obj = value; obj.m_level -= value.m_level * factor; value.m_accumulator = 0f; } } } } namespace PotionsPlus { public static class FlaskEffects { [HarmonyPatch(typeof(Character), "RPC_Damage")] private class ReduceDamageTaken { [<278e803c-873f-4fa5-9ebc-5b24f0c1bd96>NullableContext(1)] private static void Prefix(Character __instance, HitData hit) { Player val = (Player)(object)((__instance is Player) ? __instance : null); if (val != null) { if (((Character)val).GetSEMan().HaveStatusEffect(StringExtensionMethods.GetStableHashCode("Flask_of_Elements"))) { hit.m_damage.m_fire *= 1f - (float)PotionsPlus.flaskOfElementsFireDamageTakenReduction.Value / 100f; hit.m_damage.m_lightning *= 1f - (float)PotionsPlus.flaskOfElementsLightningDamageTakenReduction.Value / 100f; } if (((Character)val).GetSEMan().HaveStatusEffect(StringExtensionMethods.GetStableHashCode("Flask_of_Fortification"))) { hit.m_damage.m_blunt *= 1f - (float)PotionsPlus.flaskOfFortificationBluntDamageTakenReduction.Value / 100f; hit.m_damage.m_slash *= 1f - (float)PotionsPlus.flaskOfFortificationSlashDamageTakenReduction.Value / 100f; hit.m_damage.m_pierce *= 1f - (float)PotionsPlus.flaskOfFortificationPierceDamageTakenReduction.Value / 100f; } } } } } [<278e803c-873f-4fa5-9ebc-5b24f0c1bd96>NullableContext(1)] [<6e8bc1f7-ed74-405e-8cf6-e77cb9d255f7>Nullable(0)] public class GroupPotion : SE_Stats { public static bool effectApplied; public DamageType damageType; public int range; public override void Setup(Character character) { //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) ((SE_Stats)this).Setup(character); if ((Object)(object)character != (Object)(object)Player.m_localPlayer || effectApplied || !API.IsLoaded()) { return; } try { List<PlayerReference> list = API.GroupPlayers(); if (list == null) { return; } foreach (PlayerReference groupPlayer in list.Where((PlayerReference p) => p != PlayerReference.fromPlayer(Player.m_localPlayer))) { Player val = Player.s_players?.FirstOrDefault((Func<Player, bool>)([<278e803c-873f-4fa5-9ebc-5b24f0c1bd96>NullableContext(0)] (Player p) => (Object)(object)p != (Object)null && p.GetPlayerID() == groupPlayer.peerId)); if (!((Object)(object)val == (Object)null)) { Vector3 position = ((Component)val).transform.position; if ((range == 0 || Utils.DistanceXZ(((Component)character).transform.position, position) < (float)range) && ZRoutedRpc.instance != null) { ZRoutedRpc.instance.InvokeRoutedRPC(groupPlayer.peerId, "PotionsPlus Potion Activated", new object[1] { ((Object)this).name }); } } } effectApplied = true; } catch (Exception ex) { Debug.LogError((object)("[PotionsPlus] Error in GroupPotion.Setup: " + ex.Message + "\n" + ex.StackTrace)); } } public override void ModifyAttack(SkillType skill, ref HitData hitData) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 //IL_003e: 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_0056: 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_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Invalid comparison between Unknown and I4 //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Invalid comparison between Unknown and I4 //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Invalid comparison between Unknown and I4 //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Invalid comparison between Unknown and I4 //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Invalid comparison between Unknown and I4 if ((int)damageType == 0) { return; } float chop = hitData.m_damage.m_chop; float pickaxe = hitData.m_damage.m_pickaxe; float num = hitData.GetTotalDamage() - pickaxe - chop; hitData.m_damage = new DamageTypes { m_chop = chop, m_pickaxe = pickaxe }; DamageType val = damageType; DamageType val2 = val; if ((int)val2 <= 64) { if ((int)val2 != 32) { if ((int)val2 == 64) { hitData.m_damage.m_frost = num; } } else { hitData.m_damage.m_fire = num; } } else if ((int)val2 != 128) { if ((int)val2 != 256) { if ((int)val2 == 512) { hitData.m_damage.m_spirit = num; } } else { hitData.m_damage.m_poison = num; } } else { hitData.m_damage.m_lightning = num; } } } [<278e803c-873f-4fa5-9ebc-5b24f0c1bd96>NullableContext(1)] [<6e8bc1f7-ed74-405e-8cf6-e77cb9d255f7>Nullable(0)] [BepInPlugin("com.odinplus.potionsplus", "PotionsPlus", "4.3.1")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class PotionsPlus : BaseUnityPlugin { [<278e803c-873f-4fa5-9ebc-5b24f0c1bd96>NullableContext(0)] private enum Toggle { On = 1, Off = 0 } [HarmonyPatch(typeof(ObjectDB), "Awake")] [<278e803c-873f-4fa5-9ebc-5b24f0c1bd96>NullableContext(0)] private static class RegisterAlchemySkill { private static void Postfix() { if (alchemy == null) { Sprite icon = potionAssets.LoadAsset<Sprite>("AlcSkill"); alchemy = new Skill("Alchemy", icon) { Configurable = false }; alchemy.Name.Alias("pp_potion_skill_name"); alchemy.Description.Alias("pp_potion_skill_description"); } } } [<278e803c-873f-4fa5-9ebc-5b24f0c1bd96>NullableContext(0)] [HarmonyPatch(typeof(Character), "SetHealth")] public static class PatchCharacterSetHealth { [<278e803c-873f-4fa5-9ebc-5b24f0c1bd96>NullableContext(1)] private static bool Prefix(ref Character __instance, float health) { if (!((Object)(object)__instance != (Object)(object)Player.m_localPlayer) && !(health > 0f)) { StatusEffect val = ((IEnumerable<StatusEffect>)((Character)Player.m_localPlayer).GetSEMan().GetStatusEffects()).FirstOrDefault((Func<StatusEffect, bool>)((StatusEffect se) => se.m_category == "pp_philstone")); if (val != null) { ((Character)Player.m_localPlayer).GetSEMan().RemoveStatusEffect(val, false); Inventory inventory = ((Humanoid)Player.m_localPlayer).GetInventory(); ItemData val2 = ((IEnumerable<ItemData>)inventory.GetAllItems()).FirstOrDefault((Func<ItemData, bool>)((ItemData i) => i.m_equipped && (int)i.m_shared.m_itemType == 18 && i.m_shared.m_equipStatusEffect.m_category == "pp_philstone")); if (val2 != null) { inventory.RemoveOneItem(val2); ((StatusEffect)CheatDeathStatusEffect).m_ttl = 6f; ((Character)Player.m_localPlayer).GetSEMan().AddStatusEffect((StatusEffect)(object)CheatDeathStatusEffect, false, 0, 0f); __instance.Heal(__instance.GetMaxHealth(), true); return false; } return true; } } return true; } } [HarmonyPatch(typeof(ZNet), "Awake")] [<278e803c-873f-4fa5-9ebc-5b24f0c1bd96>NullableContext(0)] private static class RegisterRPCPatch { private static void Postfix() { ZRoutedRpc.instance.Register<float>("PotionsPlus Raise Alchemy", (Action<long, float>)delegate(long _, float num) { ((Character)(object)Player.m_localPlayer).RaiseSkill("Alchemy", num); }); ZRoutedRpc.instance.Register<int>("PotionsPlus Alchemy Level", (Action<long, int>)delegate(long sender, int num) { SubmitAlchemyLevel.playerAlchemyLevels[sender] = num; }); ZRoutedRpc.instance.Register("PotionsPlus Alchemy Proc", (Action<long>)delegate { ((Character)Player.m_localPlayer).GetSEMan().AddStatusEffect((StatusEffect)(object)AlchemySkillProcStatusEffect, false, 0, 0f); }); ZRoutedRpc.instance.Register<string>("PotionsPlus Potion Activated", (Action<long, string>)onGroupPotionActivated); } } [HarmonyPatch(typeof(Incinerator), "OnIncinerate")] [<6e8bc1f7-ed74-405e-8cf6-e77cb9d255f7>Nullable(0)] private static class SubmitAlchemyLevel { public static readonly Dictionary<long, int> playerAlchemyLevels = new Dictionary<long, int>(); private static void Postfix(Incinerator __instance) { ZRoutedRpc.instance.InvokeRoutedRPC(__instance.m_nview.GetZDO().GetOwner(), "PotionsPlus Alchemy Level", new object[1] { Mathf.RoundToInt(((Character)(object)Player.m_localPlayer).GetSkillFactor("Alchemy") * 100f) }); } } [HarmonyPatch] [<6e8bc1f7-ed74-405e-8cf6-e77cb9d255f7>Nullable(0)] private static class SaveCauldronUsingPlayer { public static long uid; private static void SetUid(Incinerator incinerator, long sender) { if (((Object)incinerator).name.StartsWith("opcauldron", StringComparison.Ordinal)) { uid = sender; } } private static MethodInfo TargetMethod() { return (from t in typeof(Incinerator).GetNestedTypes(BindingFlags.Instance | BindingFlags.NonPublic) where t.Name.Contains("Incinerate") select t).SelectMany([<278e803c-873f-4fa5-9ebc-5b24f0c1bd96>NullableContext(0)] (Type t) => from m in t.GetMethods(BindingFlags.Instance | BindingFlags.NonPublic) where m.Name == "MoveNext" select m).First(); } private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) { Type Incinerate = TargetMethod().DeclaringType; MethodInfo invoke = AccessTools.DeclaredMethod(typeof(MonoBehaviour), "Invoke", (Type[])null, (Type[])null); foreach (CodeInstruction instruction in instructions) { if (instruction.opcode == OpCodes.Call && CodeInstructionExtensions.OperandIs(instruction, (MemberInfo)invoke)) { yield return new CodeInstruction(OpCodes.Ldarg_0, (object)null); yield return new CodeInstruction(OpCodes.Ldfld, (object)AccessTools.DeclaredField(Incinerate, "<>4__this")); yield return new CodeInstruction(OpCodes.Ldarg_0, (object)null); yield return new CodeInstruction(OpCodes.Ldfld, (object)AccessTools.DeclaredField(Incinerate, "uid")); yield return new CodeInstruction(OpCodes.Call, (object)AccessTools.DeclaredMethod(typeof(SaveCauldronUsingPlayer), "SetUid", (Type[])null, (Type[])null)); } if (instruction.opcode == OpCodes.Ret) { yield return new CodeInstruction(OpCodes.Ldarg_0, (object)null); yield return new CodeInstruction(OpCodes.Ldfld, (object)AccessTools.DeclaredField(Incinerate, "<>4__this")); yield return new CodeInstruction(OpCodes.Ldc_I8, (object)0L); yield return new CodeInstruction(OpCodes.Call, (object)AccessTools.DeclaredMethod(typeof(SaveCauldronUsingPlayer), "SetUid", (Type[])null, (Type[])null)); } yield return instruction; } } } [<6e8bc1f7-ed74-405e-8cf6-e77cb9d255f7>Nullable(0)] [HarmonyPatch(typeof(IncineratorConversion), "AttemptCraft")] private static class ApplyAlchemySkillOnCauldronUsage { private static void Prefix(List<ItemDrop> toAdd, out int __state) { __state = toAdd.Count; } private static void Postfix(List<ItemDrop> toAdd, int __state, ref int __result) { if (SaveCauldronUsingPlayer.uid == 0L || toAdd.Count == __state) { return; } for (int num = toAdd.Count - 1; num >= __state; num--) { SubmitAlchemyLevel.playerAlchemyLevels.TryGetValue(SaveCauldronUsingPlayer.uid, out var value); for (int num2 = DetermineExtraItems(value, SaveCauldronUsingPlayer.uid); num2 > 0; num2--) { toAdd.Add(toAdd[num]); __result++; } } if (alchemySkillEnabled.Value == Toggle.On) { ZRoutedRpc.instance.InvokeRoutedRPC(SaveCauldronUsingPlayer.uid, "PotionsPlus Raise Alchemy", new object[1] { (float)toAdd.Count }); } } } [HarmonyPatch(typeof(InventoryGui), "DoCrafting")] [<278e803c-873f-4fa5-9ebc-5b24f0c1bd96>NullableContext(0)] private static class ApplyAlchemySkillOnAlchemyTableCrafting { private static void Prefix(out int __state) { __state = (int)Game.instance.GetPlayerProfile().m_playerStats[(PlayerStatType)13]; } [<278e803c-873f-4fa5-9ebc-5b24f0c1bd96>NullableContext(1)] private static void Postfix(InventoryGui __instance, Player player, int __state) { if ((int)Game.instance.GetPlayerProfile().m_playerStats[(PlayerStatType)13] <= __state) { return; } CraftingStation currentCraftingStation = Player.m_localPlayer.GetCurrentCraftingStation(); if (currentCraftingStation != null && ((Object)currentCraftingStation).name.StartsWith("opalchemy") && __instance.m_craftUpgradeItem == null) { for (int num = DetermineExtraItems(Mathf.RoundToInt(((Character)(object)player).GetSkillFactor("Alchemy") * 100f), ZDOMan.instance.m_sessionID); num > 0; num--) { int num2 = ((__instance.m_craftUpgradeItem == null) ? 1 : (__instance.m_craftUpgradeItem.m_quality + 1)); ((Humanoid)player).GetInventory().AddItem(((Object)((Component)__instance.m_craftRecipe.m_item).gameObject).name, __instance.m_craftRecipe.m_amount, num2, __instance.m_craftVariant, player.GetPlayerID(), player.GetPlayerName(), false); } if (alchemySkillEnabled.Value == Toggle.On) { ((Character)(object)player).RaiseSkill("Alchemy"); } } } } [<278e803c-873f-4fa5-9ebc-5b24f0c1bd96>NullableContext(0)] [HarmonyPatch(typeof(RandomSpeak), "Start")] private class PreventGhostFromTalking { [<278e803c-873f-4fa5-9ebc-5b24f0c1bd96>NullableContext(1)] private static bool Prefix(RandomSpeak __instance) { return ((Component)__instance).gameObject.layer != Piece.s_ghostLayer; } } [<6e8bc1f7-ed74-405e-8cf6-e77cb9d255f7>Nullable(0)] [HarmonyPatch(typeof(Attack), "Start")] private class BypassAmmoCheck { private static void Prefix(Attack __instance, ItemData weapon, ref string __state) { GameObject dropPrefab = weapon.m_dropPrefab; if (((dropPrefab != null) ? ((Object)dropPrefab).name : null) == "Odins_Dragon_Staff") { GameObject spawnOnTrigger = __instance.m_spawnOnTrigger; if (((spawnOnTrigger != null) ? ((Object)spawnOnTrigger).name : null) == "Staff_Smoke_Cloud") { __state = weapon.m_shared.m_ammoType; weapon.m_shared.m_ammoType = ""; } } } private static void Finalizer(ItemData weapon, ref string __state) { if (__state != null) { weapon.m_shared.m_ammoType = __state; } } } [HarmonyPatch(typeof(Attack), "UseAmmo")] [<278e803c-873f-4fa5-9ebc-5b24f0c1bd96>NullableContext(0)] private class ReduceAmmoUsage { [<278e803c-873f-4fa5-9ebc-5b24f0c1bd96>NullableContext(1)] private static bool Prefix(Attack __instance, ref bool __result) { GameObject dropPrefab = __instance.m_weapon.m_dropPrefab; string text = ((dropPrefab != null) ? ((Object)dropPrefab).name : null); string text2 = text; if (!(text2 == "Odins_Dragon_Staff")) { if (!(text2 == "Odins_Alchemy_Wand")) { goto IL_00f8; } } else { GameObject spawnOnTrigger = __instance.m_spawnOnTrigger; if (((spawnOnTrigger != null) ? ((Object)spawnOnTrigger).name : null) == "Staff_Smoke_Cloud") { __result = true; return false; } } ItemData helmetItem = __instance.m_character.m_helmetItem; object obj; if (helmetItem == null) { obj = null; } else { GameObject dropPrefab2 = helmetItem.m_dropPrefab; obj = ((dropPrefab2 != null) ? ((Object)dropPrefab2).name : null); } if ((string?)obj == "Odins_Wizard_Hat") { ItemData ammoItem = __instance.m_character.GetInventory().GetAmmoItem(__instance.m_weapon.m_shared.m_ammoType, (string)null); if (ammoItem == null) { return true; } if (Random.value < wizardHatConsumeChargeReduction.Value / 100f) { __instance.m_ammoItem = ammoItem; __result = true; return false; } } goto IL_00f8; IL_00f8: return true; } } [<278e803c-873f-4fa5-9ebc-5b24f0c1bd96>NullableContext(0)] public class HealingAoe : MonoBehaviour { private float nextHealTime = 0f; [<6e8bc1f7-ed74-405e-8cf6-e77cb9d255f7>Nullable(1)] private HashSet<int> healedThisTick = new HashSet<int>(); private float radius => hellbrothOfEternalLifeRadius.Value; private float healInterval => hellbrothOfEternalLifeTickInterval.Value; private void Start() { nextHealTime = Time.time; } private void Update() { if (Time.time >= nextHealTime) { healedThisTick.Clear(); HealNearbyCharacters(); nextHealTime = Time.time + healInterval; } } private void HealNearbyCharacters() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)this).transform.position; int mask = LayerMask.GetMask(new string[3] { "character", "character_noenv", "character_ghost" }); Collider[] array = Physics.OverlapSphere(position, radius, mask); int num = 0; Collider[] array2 = array; foreach (Collider val in array2) { Character val2 = ((Component)val).GetComponentInParent<Character>(); if ((Object)(object)val2 == (Object)null) { val2 = ((Component)val).GetComponent<Character>(); } if ((Object)(object)val2 == (Object)null || val2.IsDead()) { continue; } int instanceID = ((Object)val2).GetInstanceID(); if (healedThisTick.Contains(instanceID)) { continue; } healedThisTick.Add(instanceID); if (val2 is Player || val2.IsTamed()) { float maxHealth = val2.GetMaxHealth(); float num2 = maxHealth * hellbrothOfEternalLifeHealing.Value / 100f; val2.Heal(num2, true); num++; Player val3 = (Player)(object)((val2 is Player) ? val2 : null); if (val3 != null && Random.value < 0.3f) { ((Character)val3).Message((MessageType)2, $"+{Mathf.RoundToInt(num2)} HP", 0, (Sprite)null); } } } } } [<278e803c-873f-4fa5-9ebc-5b24f0c1bd96>NullableContext(0)] public class SmokescreenOwner : MonoBehaviour, IProjectile { [<278e803c-873f-4fa5-9ebc-5b24f0c1bd96>NullableContext(1)] public void Setup(Character owner, Vector3 velocity, float hitNoise, HitData hitData, ItemData item, ItemData ammo) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) ZDO zdo = ((Component)this).GetComponent<ZNetView>().m_zdo; zdo.Set("PotionsPlus SmokeCloud Owner", owner.GetZDOID()); zdo.Set("PotionsPlus SmokeCloud HatBonus", ((Component)owner).GetComponent<VisEquipment>().m_currentHelmetItemHash == StringExtensionMethods.GetStableHashCode("Odins_Warlock_Hat")); } public void Start() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) if (((Component)this).GetComponent<ZNetView>().m_zdo.GetBool("PotionsPlus SmokeCloud HatBonus", false)) { ParticleSystem[] componentsInChildren = ((Component)this).GetComponentsInChildren<ParticleSystem>(); foreach (ParticleSystem val in componentsInChildren) { ShapeModule shape = val.shape; ((ShapeModule)(ref shape)).radius = ((ShapeModule)(ref shape)).radius + warlockHatSmokeScreenSizeIncrease.Value; } SphereCollider componentInChildren = ((Component)this).GetComponentInChildren<SphereCollider>(); componentInChildren.radius += warlockHatSmokeScreenSizeIncrease.Value; TimedDestruction component = ((Component)this).GetComponent<TimedDestruction>(); ((MonoBehaviour)component).CancelInvoke("DestroyNow"); component.Trigger(smokeScreenTTL.Value + (float)warlockHatSmokeScreenDurationIncrease.Value); } } [<278e803c-873f-4fa5-9ebc-5b24f0c1bd96>NullableContext(1)] public string GetTooltipString(int itemQuality) { return ""; } } [<278e803c-873f-4fa5-9ebc-5b24f0c1bd96>NullableContext(0)] [HarmonyPatch(typeof(Projectile), "FixedUpdate")] private class SmokescreenHitBarrier { private static int ProjectileBlocker(int mask) { return mask | (1 << LayerMask.NameToLayer("blocker")); } [<278e803c-873f-4fa5-9ebc-5b24f0c1bd96>NullableContext(1)] private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) { FieldInfo maskField = AccessTools.DeclaredField(typeof(Projectile), "s_rayMaskSolids"); foreach (CodeInstruction instruction in instructions) { yield return instruction; if (instruction.opcode == OpCodes.Ldsfld && CodeInstructionExtensions.OperandIs(instruction, (MemberInfo)maskField)) { yield return new CodeInstruction(OpCodes.Call, (object)AccessTools.DeclaredMethod(typeof(SmokescreenHitBarrier), "ProjectileBlocker", (Type[])null, (Type[])null)); } } } } [HarmonyPatch(typeof(Projectile), "OnHit")] [<6e8bc1f7-ed74-405e-8cf6-e77cb9d255f7>Nullable(0)] private class DestroyBlockedProjectile { private static bool Prefix(Projectile __instance, Collider collider, ref bool __state) { //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)collider) && ((Component)collider).gameObject.layer == LayerMask.NameToLayer("blocker")) { Transform parent = ((Component)collider).transform.parent; ZDO val = ((parent == null) ? null : ((Component)parent).GetComponent<ZNetView>()?.m_zdo); if (val != null) { GameObject obj = ZNetScene.instance.FindInstance(val.GetZDOID("PotionsPlus SmokeCloud Owner")); Character val2 = ((obj != null) ? obj.GetComponent<Character>() : null); if (val2 != null && !__instance.IsValidTarget((IDestructible)(object)val2)) { return false; } __state = true; Random.InitState((int)((ZDOID)(ref __instance.m_nview.m_zdo.m_uid)).ID); State state = Random.state; bool result = Random.value < (float)(smokeScreenChanceToBlock.Value + (val.GetBool("PotionsPlus SmokeCloud HatBonus", false) ? warlockHatSmokeScreenBlockIncrease.Value : 0)) / 100f; Random.state = state; return result; } } return true; } [HarmonyPriority(200)] private static void Postfix(Projectile __instance, Collider collider, bool __state) { if (__state && __instance != null && __instance.m_didHit && __instance.m_stayAfterHitStatic) { ZNetScene.instance.Destroy(((Component)__instance).gameObject); } } } [HarmonyPatch(typeof(Projectile), "SpawnOnHit")] [<6e8bc1f7-ed74-405e-8cf6-e77cb9d255f7>Nullable(0)] private class TransferDamageToAoeProjectile { private static IProjectile UpdateAoeProjectileDamage(IProjectile newProjectile, IProjectile spawning) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Expected O, but got Unknown //IL_0048: Unknown result type (might be due to invalid IL or missing references) string projectileName = ((Object)(Component)spawning).name; if (wandProjectiles.Any([<278e803c-873f-4fa5-9ebc-5b24f0c1bd96>NullableContext(0)] (string p) => projectileName.StartsWith(p, StringComparison.Ordinal))) { Aoe val = (Aoe)newProjectile; Projectile val2 = (Projectile)spawning; ((DamageTypes)(ref val.m_damage)).Add(val2.m_damage, 1); val.m_attackForce += val2.m_attackForce; val.m_backstabBonus += val2.m_backstabBonus; val.m_statusEffect += val2.m_statusEffect; } return newProjectile; } private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) { MethodInfo projectile = AccessTools.DeclaredMethod(typeof(GameObject), "GetComponent", Array.Empty<Type>(), new Type[1] { typeof(IProjectile) }); foreach (CodeInstruction instruction in instructions) { yield return instruction; if (instruction.opcode == OpCodes.Callvirt && CodeInstructionExtensions.OperandIs(instruction, (MemberInfo)projectile)) { yield return new CodeInstruction(OpCodes.Ldarg_0, (object)null); yield return new CodeInstruction(OpCodes.Call, (object)AccessTools.DeclaredMethod(typeof(TransferDamageToAoeProjectile), "UpdateAoeProjectileDamage", (Type[])null, (Type[])null)); } } } } private const string ModName = "PotionsPlus"; private const string ModVersion = "4.3.1"; private const string ModGUID = "com.odinplus.potionsplus"; private static readonly ConfigSync configSync = new ConfigSync("PotionsPlus") { DisplayName = "PotionsPlus", CurrentVersion = "4.3.1", MinimumRequiredVersion = "4.3.1" }; private static AssetBundle potionAssets; public static readonly HashSet<string> wandProjectiles = new HashSet<string>(); private static ConfigEntry<Toggle> serverConfigLocked = null; public static ConfigEntry<float> philosophersStoneXpGainFactor = null; private static ConfigEntry<Toggle> alchemySkillEnabled = null; private static ConfigEntry<Toggle> alchemySkillBonusWhenCraftingEnabled = null; public static ConfigEntry<int> flaskOfElementsFireDamageTakenReduction = null; public static ConfigEntry<int> flaskOfElementsLightningDamageTakenReduction = null; public static ConfigEntry<int> flaskOfElementsTTL = null; public static ConfigEntry<int> flaskOfFortificationBluntDamageTakenReduction = null; public static ConfigEntry<int> flaskOfFortificationSlashDamageTakenReduction = null; public static ConfigEntry<int> flaskOfFortificationPierceDamageTakenReduction = null; public static ConfigEntry<int> flaskOfFortificationTTL = null; public static ConfigEntry<float> flaskOfMagelightIntensity = null; public static ConfigEntry<Color> flaskOfMagelightColor = null; public static ConfigEntry<int> flaskOfMagelightTTL = null; public static ConfigEntry<float> flaskOfGodsHealing = null; public static ConfigEntry<float> flaskOfGodsRegenMultiplier = null; public static ConfigEntry<int> flaskOfGodsTTL = null; public static ConfigEntry<float> flaskOfSecondWindJumpStaminaFactor = null; public static ConfigEntry<float> flaskOfSecondWindRunStaminaFactor = null; public static ConfigEntry<float> flaskOfSecondWindStaminaRegenMultiplier = null; public static ConfigEntry<int> flaskOfSecondWindTTL = null; public static ConfigEntry<float> grandHealingTidePotionHealthOverTime = null; public static ConfigEntry<float> grandHealingTidePotionTickInterval = null; public static ConfigEntry<float> grandHealingTidePotionTTL = null; public static ConfigEntry<int> grandHealingTidePotionCooldown = null; public static ConfigEntry<float> grandSpiritualHealingPotionHealthOverTime = null; public static ConfigEntry<int> grandSpiritualHealingPotionCooldown = null; public static ConfigEntry<float> grandStaminaElixirStaminaOverTime = null; public static ConfigEntry<float> grandStaminaElixirTTL = null; public static ConfigEntry<int> grandStaminaElixirCooldown = null; public static ConfigEntry<int> grandStealthElixirNoiseReduction = null; public static ConfigEntry<int> grandStealthElixirVisibilityReduction = null; public static ConfigEntry<int> grandStealthElixirTTL = null; public static ConfigEntry<float> mediumHealingTideFlaskHealthOverTime = null; public static ConfigEntry<float> mediumHealingTideFlaskTickInterval = null; public static ConfigEntry<float> mediumHealingTideFlaskTTL = null; public static ConfigEntry<int> mediumHealingTideFlaskCooldown = null; public static ConfigEntry<float> mediumSpiritualHealingFlaskHealthOverTime = null; public static ConfigEntry<int> mediumSpiritualHealingFlaskCooldown = null; public static ConfigEntry<float> mediumStaminaFlaskStaminaOverTime = null; public static ConfigEntry<int> mediumStaminaFlaskCooldown = null; public static ConfigEntry<float> lesserHealingTideVialHealthOverTime = null; public static ConfigEntry<float> lesserHealingTideVialTickInterval = null; public static ConfigEntry<float> lesserHealingTideVialTTL = null; public static ConfigEntry<int> lesserHealingTideVialCooldown = null; public static ConfigEntry<float> lesserSpiritualHealingVialHealthOverTime = null; public static ConfigEntry<int> lesserSpiritualHealingVialCooldown = null; public static ConfigEntry<float> lesserStaminaVialStaminaOverTime = null; public static ConfigEntry<int> lesserStaminaVialCooldown = null; public static ConfigEntry<float> hellbrothOfFlamesDamage = null; public static ConfigEntry<float> hellbrothOfFrostDamage = null; public static ConfigEntry<float> hellbrothOfThorsFuryDamage = null; public static ConfigEntry<float> hellbrothOfEternalLifeHealing = null; public static ConfigEntry<float> hellbrothOfEternalLifeTTL = null; public static ConfigEntry<float> hellbrothOfEternalLifeRadius = null; public static ConfigEntry<float> hellbrothOfEternalLifeTickInterval = null; public static ConfigEntry<float> brewOfFaintGroupHealingHealthOverTime = null; public static ConfigEntry<int> brewOfFaintGroupHealingCooldown = null; private static ConfigEntry<int> brewOfFaintGroupHealingRange = null; public static ConfigEntry<float> brewOfGroupHealingHealthOverTime = null; public static ConfigEntry<int> brewOfGroupHealingCooldown = null; private static ConfigEntry<int> brewOfGroupHealingRange = null; public static ConfigEntry<float> brewOfGrandGroupHealingHealthOverTime = null; public static ConfigEntry<int> brewOfGrandGroupHealingCooldown = null; private static ConfigEntry<int> brewOfGrandGroupHealingRange = null; public static ConfigEntry<float> brewOfFieryRevengeTTL = null; public static ConfigEntry<int> brewOfFieryRevengeRange = null; public static ConfigEntry<float> brewOfIcyTouchTTL = null; public static ConfigEntry<int> brewOfIcyTouchRange = null; public static ConfigEntry<float> brewOfCunningToxicityTTL = null; public static ConfigEntry<int> brewOfCunningToxicityRange = null; public static ConfigEntry<float> brewOfSpiritualDeathTTL = null; public static ConfigEntry<int> brewOfSpiritualDeathRange = null; public static ConfigEntry<float> brewOfThunderousWordsTTL = null; public static ConfigEntry<int> brewOfThunderousWordsRange = null; private static ConfigEntry<float> wizardHatConsumeChargeReduction = null; private static ConfigEntry<float> warlockHatSmokeScreenSizeIncrease = null; private static ConfigEntry<int> warlockHatSmokeScreenBlockIncrease = null; private static ConfigEntry<int> warlockHatSmokeScreenDurationIncrease = null; public static ConfigEntry<int> weaponOilDamageIncrease = null; public static ConfigEntry<float> weaponOilTTL = null; private static ConfigEntry<int> smokeScreenChanceToBlock = null; public static ConfigEntry<float> smokeScreenTTL = null; private static Skill alchemy = null; private bool _placeholdersRegistered = false; private static SE_Stats CheatDeathStatusEffect = null; private static SE_Stats AlchemySkillProcStatusEffect = null; private ConfigEntry<T> config<[<6e8bc1f7-ed74-405e-8cf6-e77cb9d255f7>Nullable(2)] T>(string group, string name, T value, ConfigDescription description, bool synchronizedSetting = true) { ConfigEntry<T> val = ((BaseUnityPlugin)this).Config.Bind<T>(group, name, value, description); SyncedConfigEntry<T> syncedConfigEntry = configSync.AddConfigEntry<T>(val); syncedConfigEntry.SynchronizedConfig = synchronizedSetting; return val; } private ConfigEntry<T> config<[<6e8bc1f7-ed74-405e-8cf6-e77cb9d255f7>Nullable(2)] T>(string group, string name, T value, string description, bool synchronizedSetting = true) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown return config(group, name, value, new ConfigDescription(description, (AcceptableValueBase)null, Array.Empty<object>()), synchronizedSetting); } public void Awake() { //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Expected O, but got Unknown //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Expected O, but got Unknown //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Expected O, but got Unknown //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Expected O, but got Unknown //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Expected O, but got Unknown //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Expected O, but got Unknown //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Expected O, but got Unknown //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Expected O, but got Unknown //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Expected O, but got Unknown //IL_0270: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Expected O, but got Unknown //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Expected O, but got Unknown //IL_02d0: Unknown result type (might be due to invalid IL or missing references) //IL_02db: Expected O, but got Unknown //IL_0309: Unknown result type (might be due to invalid IL or missing references) //IL_0314: Expected O, but got Unknown //IL_033e: Unknown result type (might be due to invalid IL or missing references) //IL_0349: Expected O, but got Unknown //IL_0377: Unknown result type (might be due to invalid IL or missing references) //IL_0382: Expected O, but got Unknown //IL_03b0: Unknown result type (might be due to invalid IL or missing references) //IL_03bb: Expected O, but got Unknown //IL_03e9: Unknown result type (might be due to invalid IL or missing references) //IL_03f4: Expected O, but got Unknown //IL_041b: Unknown result type (might be due to invalid IL or missing references) //IL_0426: Expected O, but got Unknown //IL_0446: Unknown result type (might be due to invalid IL or missing references) //IL_0451: 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_04ed: Unknown result type (might be due to invalid IL or missing references) //IL_04f8: Expected O, but got Unknown //IL_0518: Unknown result type (might be due to invalid IL or missing references) //IL_0523: Expected O, but got Unknown //IL_0551: Unknown result type (might be due to invalid IL or missing references) //IL_055c: Expected O, but got Unknown //IL_0586: Unknown result type (might be due to invalid IL or missing references) //IL_0591: Expected O, but got Unknown //IL_05b1: Unknown result type (might be due to invalid IL or missing references) //IL_05bc: Expected O, but got Unknown //IL_05e6: Unknown result type (might be due to invalid IL or missing references) //IL_05f1: Expected O, but got Unknown //IL_0615: Unknown result type (might be due to invalid IL or missing references) //IL_0620: Expected O, but got Unknown //IL_0644: Unknown result type (might be due to invalid IL or missing references) //IL_064f: Expected O, but got Unknown //IL_0676: Unknown result type (might be due to invalid IL or missing references) //IL_0681: Expected O, but got Unknown //IL_06a1: Unknown result type (might be due to invalid IL or missing references) //IL_06ac: Expected O, but got Unknown //IL_06da: Unknown result type (might be due to invalid IL or missing references) //IL_06e5: Expected O, but got Unknown //IL_0713: Unknown result type (might be due to invalid IL or missing references) //IL_071e: Expected O, but got Unknown //IL_0748: Unknown result type (might be due to invalid IL or missing references) //IL_0753: Expected O, but got Unknown //IL_0773: Unknown result type (might be due to invalid IL or missing references) //IL_077e: Expected O, but got Unknown //IL_07a8: Unknown result type (might be due to invalid IL or missing references) //IL_07b3: Expected O, but got Unknown //IL_07d3: Unknown result type (might be due to invalid IL or missing references) //IL_07de: Expected O, but got Unknown //IL_0808: Unknown result type (might be due to invalid IL or missing references) //IL_0813: Expected O, but got Unknown //IL_0833: Unknown result type (might be due to invalid IL or missing references) //IL_083e: Expected O, but got Unknown //IL_086c: Unknown result type (might be due to invalid IL or missing references) //IL_0877: Expected O, but got Unknown //IL_08a5: Unknown result type (might be due to invalid IL or missing references) //IL_08b0: Expected O, but got Unknown //IL_08da: Unknown result type (might be due to invalid IL or missing references) //IL_08e5: Expected O, but got Unknown //IL_0905: Unknown result type (might be due to invalid IL or missing references) //IL_0910: Expected O, but got Unknown //IL_093a: Unknown result type (might be due to invalid IL or missing references) //IL_0945: Expected O, but got Unknown //IL_0965: Unknown result type (might be due to invalid IL or missing references) //IL_0970: Expected O, but got Unknown //IL_099a: Unknown result type (might be due to invalid IL or missing references) //IL_09a5: Expected O, but got Unknown //IL_09c5: Unknown result type (might be due to invalid IL or missing references) //IL_09d0: Expected O, but got Unknown //IL_09f0: Unknown result type (might be due to invalid IL or missing references) //IL_09fb: Expected O, but got Unknown //IL_0a1b: Unknown result type (might be due to invalid IL or missing references) //IL_0a26: Expected O, but got Unknown //IL_0a54: Unknown result type (might be due to invalid IL or missing references) //IL_0a5f: Expected O, but got Unknown //IL_0a8d: Unknown result type (might be due to invalid IL or missing references) //IL_0a98: Expected O, but got Unknown //IL_0ac6: Unknown result type (might be due to invalid IL or missing references) //IL_0ad1: Expected O, but got Unknown //IL_0aff: Unknown result type (might be due to invalid IL or missing references) //IL_0b0a: Expected O, but got Unknown //IL_0b2a: Unknown result type (might be due to invalid IL or missing references) //IL_0b35: Expected O, but got Unknown //IL_0b5f: Unknown result type (might be due to invalid IL or missing references) //IL_0b6a: Expected O, but got Unknown //IL_0b91: Unknown result type (might be due to invalid IL or missing references) //IL_0b9c: Expected O, but got Unknown //IL_0bbc: Unknown result type (might be due to invalid IL or missing references) //IL_0bc7: Expected O, but got Unknown //IL_0bf1: Unknown result type (might be due to invalid IL or missing references) //IL_0bfc: Expected O, but got Unknown //IL_0c23: Unknown result type (might be due to invalid IL or missing references) //IL_0c2e: Expected O, but got Unknown //IL_0c4e: Unknown result type (might be due to invalid IL or missing references) //IL_0c59: Expected O, but got Unknown //IL_0c83: Unknown result type (might be due to invalid IL or missing references) //IL_0c8e: Expected O, but got Unknown //IL_0cb5: Unknown result type (might be due to invalid IL or missing references) //IL_0cc0: Expected O, but got Unknown //IL_0cee: Unknown result type (might be due to invalid IL or missing references) //IL_0cf9: Expected O, but got Unknown //IL_0d20: Unknown result type (might be due to invalid IL or missing references) //IL_0d2b: Expected O, but got Unknown //IL_0d59: Unknown result type (might be due to invalid IL or missing references) //IL_0d64: Expected O, but got Unknown //IL_0d8b: Unknown result type (might be due to invalid IL or missing references) //IL_0d96: Expected O, but got Unknown //IL_0dc4: Unknown result type (might be due to invalid IL or missing references) //IL_0dcf: Expected O, but got Unknown //IL_0df6: Unknown result type (might be due to invalid IL or missing references) //IL_0e01: Expected O, but got Unknown //IL_0e2f: Unknown result type (might be due to invalid IL or missing references) //IL_0e3a: Expected O, but got Unknown //IL_0e61: Unknown result type (might be due to invalid IL or missing references) //IL_0e6c: Expected O, but got Unknown //IL_0e9a: Unknown result type (might be due to invalid IL or missing references) //IL_0ea5: Expected O, but got Unknown //IL_0ecc: Unknown result type (might be due to invalid IL or missing references) //IL_0ed7: Expected O, but got Unknown //IL_0f05: Unknown result type (might be due to invalid IL or missing references) //IL_0f10: Expected O, but got Unknown //IL_0f3e: Unknown result type (might be due to invalid IL or missing references) //IL_0f49: Expected O, but got Unknown //IL_0f6c: Unknown result type (might be due to invalid IL or missing references) //IL_0f77: Expected O, but got Unknown //IL_0f9b: Unknown result type (might be due to invalid IL or missing references) //IL_0fa6: Expected O, but got Unknown //IL_0fca: Unknown result type (might be due to invalid IL or missing references) //IL_0fd5: Expected O, but got Unknown //IL_1003: Unknown result type (might be due to invalid IL or missing references) //IL_100e: Expected O, but got Unknown //IL_1031: Unknown result type (might be due to invalid IL or missing references) //IL_103c: Expected O, but got Unknown //IL_106a: Unknown result type (might be due to invalid IL or missing references) //IL_1075: Expected O, but got Unknown //IL_10af: Unknown result type (might be due to invalid IL or missing references) //IL_10b5: Expected O, but got Unknown Localizer.Load(); potionAssets = PrefabManager.RegisterAssetBundle("potions"); AssetBundle val = potionAssets; serverConfigLocked = config("1 - General", "Lock Configuration", Toggle.On, "If on, the configuration is locked and can be changed by server admins only."); configSync.AddLockingConfigEntry<Toggle>(serverConfigLocked); alchemySkillEnabled = config("1 - General", "Alchemy Skill", Toggle.On, "Enables the Alchemy skill."); alchemySkillBonusWhenCraftingEnabled = config("1 - General", "Alchemy Crafting Bonus", Toggle.On, "Enable Alchemy Bonus when crafting."); philosophersStoneXpGainFactor = config("2 - Philosophers Stone", "Philosophers Stone XP Gain Factor", 1.25f, new ConfigDescription("Factor for Alchemy XP gain, when a Philosophers Stone is equipped.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 3f), Array.Empty<object>())); flaskOfElementsFireDamageTakenReduction = config("Flask of Elements", "Fire damage reduction", 66, new ConfigDescription("Fire damage reduction during Flask of Elements effect.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>())); flaskOfElementsLightningDamageTakenReduction = config("Flask of Elements", "Lightning damage reduction", 66, new ConfigDescription("Lightning damage reduction during Flask of Elements effect.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>())); flaskOfElementsTTL = config("Flask of Elements", "Effect Duration", 120, new ConfigDescription("Effect duration of the Flask of Elements in seconds.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(5, 900), Array.Empty<object>())); flaskOfFortificationBluntDamageTakenReduction = config("Flask of Fortification", "Blunt damage reduction", 66, new ConfigDescription("Blunt damage reduction during Flask of Fortification effect.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>())); flaskOfFortificationSlashDamageTakenReduction = config("Flask of Fortification", "Slash damage reduction", 66, new ConfigDescription("Slash damage reduction during Flask of Fortification effect.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>())); flaskOfFortificationPierceDamageTakenReduction = config("Flask of Fortification", "Pierce damage reduction", 66, new ConfigDescription("Pierce damage reduction during Flask of Fortification effect.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>())); flaskOfFortificationTTL = config("Flask of Fortification", "Effect Duration", 120, new ConfigDescription("Effect duration of the Flask of Fortification in seconds.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(5, 900), Array.Empty<object>())); flaskOfMagelightColor = config<Color>("Flask of Magelight", "Effect Color", new Color(0.75f, 0.75f, 1f), new ConfigDescription("Color of the Flask of Magelight effect.", (AcceptableValueBase)null, Array.Empty<object>())); flaskOfMagelightIntensity = config("Flask of Magelight", "Effect Intensity", 3f, new ConfigDescription("Intensity of the Flask of Magelight effect.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.01f, 5f), Array.Empty<object>())); flaskOfMagelightTTL = config("Flask of Magelight", "Effect Duration", 300, new ConfigDescription("Effect duration of the Flask of Magelight in seconds.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(5, 900), Array.Empty<object>())); flaskOfGodsHealing = config("Flask of the Gods", "Healing Effect", 250f, new ConfigDescription("Healing from the Flask of the Gods effect.", (AcceptableValueBase)null, Array.Empty<object>())); flaskOfGodsRegenMultiplier = config("Flask of the Gods", "Health Regen Factor", 1.05f, new ConfigDescription("Health regen factor from the Flask of the Gods effect.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 5f), Array.Empty<object>())); flaskOfGodsTTL = config("Flask of the Gods", "Effect Duration", 300, new ConfigDescription("Effect duration of the Flask of the Gods in seconds.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(5, 900), Array.Empty<object>())); flaskOfSecondWindJumpStaminaFactor = config("Flask of Second Wind", "Jump Stamina Usage Factor", 0.75f, new ConfigDescription("Jump stamina usage factor the Flask of Second Wind effect.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>())); flaskOfSecondWindRunStaminaFactor = config("Flask of Second Wind", "Run Stamina Usage Factor", 0.75f, new ConfigDescription("Run stamina usage factor from the Flask of Second Wind effect.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>())); flaskOfSecondWindStaminaRegenMultiplier = config("Flask of Second Wind", "Stamina Regen Factor", 1.05f, new ConfigDescription("Stamina regeneration factor from the Flask of Second Wind effect.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 5f), Array.Empty<object>())); flaskOfSecondWindTTL = config("Flask of Second Wind", "Effect Duration", 120, new ConfigDescription("Effect duration of the Flask of Second Wind in seconds.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(5, 900), Array.Empty<object>())); grandHealingTidePotionHealthOverTime = config("Grand Healing Tide Potion", "Healing Effect", 95f, new ConfigDescription("Healing from the Grand Healing Tide Potion effect.", (AcceptableValueBase)null, Array.Empty<object>())); grandHealingTidePotionTickInterval = config("Grand Healing Tide Potion", "Tick Interval", 1f, new ConfigDescription("Tick interval for the Grand Healing Tide Potion effect.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 10f), Array.Empty<object>())); grandHealingTidePotionTTL = config("Grand Healing Tide Potion", "Effect Duration", 10f, new ConfigDescription("Effect duration of the Grand Healing Tide Potion in seconds.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 30f), Array.Empty<object>())); grandHealingTidePotionCooldown = config("Grand Healing Tide Potion", "Cooldown Duration", 240, new ConfigDescription("Cooldown of the Grand Healing Tide Potion in seconds.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 600), Array.Empty<object>())); grandStaminaElixirStaminaOverTime = config("Grand Stamina Elixir", "Stamina Regeneration", 150f, new ConfigDescription("Stamina regeneration from the Grand Stamina Elixir effect.", (AcceptableValueBase)null, Array.Empty<object>())); grandStaminaElixirTTL = config("Grand Stamina Elixir", "Effect Duration", 15f, new ConfigDescription("Effect duration of the Grand Stamina Elixir effect in seconds.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 30f), Array.Empty<object>())); grandStaminaElixirCooldown = config("Grand Stamina Elixir", "Cooldown Duration", 300, new ConfigDescription("Cooldown duration of the Grand Stamina Elixir in seconds.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(5, 900), Array.Empty<object>())); grandSpiritualHealingPotionHealthOverTime = config("Grand Spiritual Healing Potion", "Healing Effect", 100f, new ConfigDescription("Healing from the Grand Spiritual Healing Potion effect.", (AcceptableValueBase)null, Array.Empty<object>())); grandSpiritualHealingPotionCooldown = config("Grand Spiritual Healing Potion", "Cooldown Duration", 240, new ConfigDescription("Cooldown of the Grand Spiritual Healing Potion in seconds.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 600), Array.Empty<object>())); grandStealthElixirVisibilityReduction = config("Grand Stealth Elixir", "Visibility Reduction", 100, new ConfigDescription("Visibility reduction while sneaking during the Grand Stealth Elixir effect.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>())); grandStealthElixirNoiseReduction = config("Grand Stealth Elixir", "Noise Reduction", 100, new ConfigDescription("Noise reduction while sneaking during the Grand Stealth Elixir effect.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>())); grandStealthElixirTTL = config("Grand Stealth Elixir", "Effect Duration", 60, new ConfigDescription("Effect duration of the Grand Stealth Elixir effect in seconds.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(5, 900), Array.Empty<object>())); mediumHealingTideFlaskHealthOverTime = config("Medium Healing Tide Flask", "Healing Effect", 45f, new ConfigDescription("Healing from the Medium Healing Tide Flask effect.", (AcceptableValueBase)null, Array.Empty<object>())); mediumHealingTideFlaskTickInterval = config("Medium Healing Tide Flask", "Tick Interval", 1f, new ConfigDescription("Tick interval for the Medium Healing Tide Flask effect.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 10f), Array.Empty<object>())); mediumHealingTideFlaskTTL = config("Medium Healing Tide Flask", "Effect Duration", 10f, new ConfigDescription("Effect duration of the Medium Healing Tide Flask in seconds.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 30f), Array.Empty<object>())); mediumHealingTideFlaskCooldown = config("Medium Healing Tide Flask", "Cooldown Duration", 240, new ConfigDescription("Cooldown of the Medium Healing Tide Flask in seconds.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 600), Array.Empty<object>())); mediumSpiritualHealingFlaskHealthOverTime = config("Medium Spiritual Healing Flask", "Healing Effect", 50f, new ConfigDescription("Healing from the Medium Spiritual Healing Flask effect.", (AcceptableValueBase)null, Array.Empty<object>())); mediumSpiritualHealingFlaskCooldown = config("Medium Spiritual Healing Flask", "Cooldown Duration", 240, new ConfigDescription("Cooldown of the Medium Spiritual Healing Flask in seconds.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(5, 900), Array.Empty<object>())); mediumStaminaFlaskStaminaOverTime = config("Medium Stamina Flask", "Stamina Regeneration", 90f, new ConfigDescription("Stamina regeneration from the Medium Stamina Flask effect.", (AcceptableValueBase)null, Array.Empty<object>())); mediumStaminaFlaskCooldown = config("Medium Stamina Flask", "Cooldown Duration", 240, new ConfigDescription("Cooldown duration of the Medium Stamina Flask in seconds.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(5, 900), Array.Empty<object>())); lesserHealingTideVialHealthOverTime = config("Lesser Healing Tide Vial", "Healing Effect", 25f, new ConfigDescription("Healing from the Lesser Healing Tide Vial effect.", (AcceptableValueBase)null, Array.Empty<object>())); lesserHealingTideVialTickInterval = config("Lesser Healing Tide Vial", "Tick Interval", 1f, new ConfigDescription("Tick interval for the Lesser Healing Tide Vial effect.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 10f), Array.Empty<object>())); lesserHealingTideVialTTL = config("Lesser Healing Tide Vial", "Effect Duration", 10f, new ConfigDescription("Effect duration of the Lesser Healing Tide Vial in seconds.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 30f), Array.Empty<object>())); lesserHealingTideVialCooldown = config("Lesser Healing Tide Vial", "Cooldown Duration", 240, new ConfigDescription("Cooldown duration of the Lesser Healing Tide Vial in seconds.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(5, 900), Array.Empty<object>())); lesserSpiritualHealingVialHealthOverTime = config("Lesser Spiritual Healing Vial", "Healing Effect", 25f, new ConfigDescription("Healing from the Lesser Spiritual Healing Vial effect.", (AcceptableValueBase)null, Array.Empty<object>())); lesserSpiritualHealingVialCooldown = config("Lesser Spiritual Healing Vial", "Cooldown Duration", 240, new ConfigDescription("Cooldown duration of the Lesser Spiritual Healing Vial in seconds.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(5, 900), Array.Empty<object>())); lesserStaminaVialStaminaOverTime = config("Lesser Stamina Vial", "Stamina Regeneration", 45f, new ConfigDescription("Stamina regeneration from the Lesser Stamina Vial effect.", (AcceptableValueBase)null, Array.Empty<object>())); lesserStaminaVialCooldown = config("Lesser Stamina Vial", "Cooldown Duration", 240, new ConfigDescription("Cooldown duration of the Lesser Stamina Vial in seconds.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(5, 900), Array.Empty<object>())); hellbrothOfFlamesDamage = config("Hellbroth of Flames", "Fire Damage", 20f, new ConfigDescription("Fire damage dealt per tick by the Hellbroth of Flames.", (AcceptableValueBase)null, Array.Empty<object>())); hellbrothOfFrostDamage = config("Hellbroth of Frost", "Frost Damage", 50f, new ConfigDescription("Frost damage dealt per tick by the Hellbroth of Frost.", (AcceptableValueBase)null, Array.Empty<object>())); hellbrothOfThorsFuryDamage = config("Hellbroth of Thors Fury", "Lightning Damage", 60f, new ConfigDescription("Lightning damage dealt per tick by the Hellbroth of Thors Fury.", (AcceptableValueBase)null, Array.Empty<object>())); hellbrothOfEternalLifeHealing = config("Hellbroth of Eternal Life", "Healing", 20f, new ConfigDescription("Percentage of maximum health as healing per tick by the Hellbroth of Eternal Life.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 100f), Array.Empty<object>())); hellbrothOfEternalLifeTTL = config("Hellbroth of Eternal Life", "Effect Duration", 5f, new ConfigDescription("Duration of the healing effect in seconds.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 30f), Array.Empty<object>())); hellbrothOfEternalLifeRadius = config("Hellbroth of Eternal Life", "Healing Radius", 5f, new ConfigDescription("Healing radius in meters.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 20f), Array.Empty<object>())); hellbrothOfEternalLifeTickInterval = config("Hellbroth of Eternal Life", "Heal Interval", 1f, new ConfigDescription("Time between healing ticks in seconds.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.25f, 5f), Array.Empty<object>())); brewOfFaintGroupHealingHealthOverTime = config("Brew of Faint Group Healing", "Healing Effect", 25f, new ConfigDescription("Healing from the Brew of Faint Group Healing effect.", (AcceptableValueBase)null, Array.Empty<object>())); brewOfFaintGroupHealingCooldown = config("Brew of Faint Group Healing", "Cooldown Duration", 240, new ConfigDescription("Cooldown of the Brew of Faint Group Healing in seconds.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(5, 900), Array.Empty<object>())); brewOfFaintGroupHealingRange = config("Brew of Faint Group Healing", "Effect Range", 30, new ConfigDescription("Range of the Brew of Faint Group Healing effect.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(3, 200), Array.Empty<object>())); brewOfGroupHealingHealthOverTime = config("Brew of Group Healing", "Healing Effect", 50f, new ConfigDescription("Healing from the Brew of Group Healing effect.", (AcceptableValueBase)null, Array.Empty<object>())); brewOfGroupHealingCooldown = config("Brew of Group Healing", "Cooldown Duration", 240, new ConfigDescription("Cooldown of the Brew of Group Healing in seconds.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(5, 900), Array.Empty<object>())); brewOfGroupHealingRange = config("Brew of Group Healing", "Effect Range", 30, new ConfigDescription("Range of the Brew of Group Healing effect.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(3, 200), Array.Empty<object>())); brewOfGrandGroupHealingHealthOverTime = config("Brew of Grand Group Healing", "Healing Effect", 125f, new ConfigDescription("Healing from the Brew of Grand Group Healing effect.", (AcceptableValueBase)null, Array.Empty<object>())); brewOfGrandGroupHealingCooldown = config("Brew of Grand Group Healing", "Cooldown Duration", 240, new ConfigDescription("Cooldown of the Brew of Grand Group Healing in seconds.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(5, 900), Array.Empty<object>())); brewOfGrandGroupHealingRange = config("Brew of Grand Group Healing", "Effect Range", 30, new ConfigDescription("Range of the Brew of Grand Group Healing effect.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(3, 200), Array.Empty<object>())); brewOfFieryRevengeTTL = config("Brew of Fiery Revenge", "Effect Duration", 180f, new ConfigDescription("Effect duration for the Brew of Fiery Revenge in seconds.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(5f, 900f), Array.Empty<object>())); brewOfFieryRevengeRange = config("Brew of Fiery Revenge", "Effect Range", 30, new ConfigDescription("Range of the Brew of Fiery Revenge effect.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(3, 200), Array.Empty<object>())); brewOfIcyTouchTTL = config("Brew of the Icy Touch", "Effect Duration", 180f, new ConfigDescription("Effect duration for the Brew of the Icy Touch in seconds.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(5f, 900f), Array.Empty<object>())); brewOfIcyTouchRange = config("Brew of the Icy Touch", "Effect Range", 30, new ConfigDescription("Range of the Brew of the Icy Touch effect.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(3, 200), Array.Empty<object>())); brewOfCunningToxicityTTL = config("Brew of Cunning Toxicity", "Effect Duration", 180f, new ConfigDescription("Effect duration for the Brew of Cunning Toxicity in seconds.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(5f, 900f), Array.Empty<object>())); brewOfCunningToxicityRange = config("Brew of Cunning Toxicity", "Effect Range", 30, new ConfigDescription("Range of the Brew of Cunning Toxicity effect.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(3, 200), Array.Empty<object>())); brewOfSpiritualDeathTTL = config("Brew of Spiritual Death", "Effect Duration", 180f, new ConfigDescription("Effect duration for the Brew of Spiritual Death in seconds.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(5f, 900f), Array.Empty<object>())); brewOfSpiritualDeathRange = config("Brew of Spiritual Death", "Effect Range", 30, new ConfigDescription("Range of the Brew of Spiritual Death effect.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(3, 200), Array.Empty<object>())); brewOfThunderousWordsTTL = config("Brew of Thunderous Words", "Effect Duration", 180f, new ConfigDescription("Effect duration for the Brew of Thunderous Words in seconds.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(5f, 900f), Array.Empty<object>())); brewOfThunderousWordsRange = config("Brew of Thunderous Words", "Effect Range", 30, new ConfigDescription("Range of the Brew of Thunderous Words effect.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(3, 200), Array.Empty<object>())); wizardHatConsumeChargeReduction = config("Odins Wizard Hat", "Charge Consumption Reduction", 40f, new ConfigDescription("Chance to not consume a Hellbroth charge, when using the Alchemy Wand or Dragon Staff while wearing the Wizard hat.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 100f), Array.Empty<object>())); warlockHatSmokeScreenSizeIncrease = config("Odins Warlock Hat", "Smoke Screen Size Increase", 2f, new ConfigDescription("Radius increase for the smoke screen ability of the Dragon Staff while wearing the Warlock hat.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 5f), Array.Empty<object>())); warlockHatSmokeScreenDurationIncrease = config("Odins Warlock Hat", "Smoke Screen Duration Increase", 2, new ConfigDescription("Duration increase for the smoke screen ability of the Dragon Staff while wearing the Warlock hat in seconds.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 15), Array.Empty<object>())); warlockHatSmokeScreenBlockIncrease = config("Odins Warlock Hat", "Smoke Screen Block Chance Increase", 25, new ConfigDescription("Projectile block chance increase for the smoke screen ability of the Dragon Staff while wearing the Warlock hat.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>())); smokeScreenChanceToBlock = config("Odins Dragon Staff", "Block Chance", 50, new ConfigDescription("Chance to block projectiles for the smoke screen effect of Odins Dragon Staff.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>())); smokeScreenTTL = config("Odins Dragon Staff", "Effect Duration", 8f, new ConfigDescription("Effect duration for the smoke screen effect of Odins Dragon Staff in seconds.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 30f), Array.Empty<object>())); weaponOilDamageIncrease = config("Odins Weapon Oil", "Damage Increase", 5, new ConfigDescription("Damage increase for weapons from the Odins Weapon Oil effect.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>())); weaponOilTTL = config("Odins Weapon Oil", "Effect Duration", 30f, new ConfigDescription("Effect duration for Odins Weapon Oil in minutes.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 120f), Array.Empty<object>())); BuildingPiecesSetup.initializeBuildingPieces(val); PotionsSetup.initializePotions(val); EquipmentSetup.initializeEquipment(val); GroupPotionSetup.initializeGroupPotions(val); HellbrothSetup.initializeHellbroth(val); PhilosophersSetup.initializePhilosophersStones(val); Assembly executingAssembly = Assembly.GetExecutingAssembly(); Harmony val2 = new Harmony("com.odinplus.potionsplus"); val2.PatchAll(executingAssembly); CheatDeathStatusEffect = val.LoadAsset<SE_Stats>("CheatDeath"); AlchemySkillProcStatusEffect = val.LoadAsset<SE_Stats>("AlcSkillProc"); PrefabManager.RegisterPrefab(val, "PP_sfx_rebirth"); PrefabManager.RegisterPrefab(val, "PP_sfx_stoneuse"); PrefabManager.RegisterPrefab(val, "PP_sfx_brewpotiondone"); PrefabManager.RegisterPrefab(val, "PP_sfx_potion_smash"); PrefabManager.RegisterPrefab(val, "PP_sfx_brewpotion"); PrefabManager.RegisterPrefab(val, "PP_vfx_potionhit"); PrefabManager.RegisterPrefab(val, "sfx_build_alchemy"); PrefabManager.RegisterPrefab(val, "VFX_RedPotionDrink"); PrefabManager.RegisterPrefab(val, "VFX_GreenPotionDrink"); PrefabManager.RegisterPrefab(val, "VFX_BluePotionDrink"); PrefabManager.RegisterPrefab(val, "VFX_PurplePotionDrink"); PrefabManager.RegisterPrefab(val, "VFX_StonePurple"); PrefabManager.RegisterPrefab(val, "VFX_StoneBlue"); PrefabManager.RegisterPrefab(val, "VFX_StoneGreen"); PrefabManager.RegisterPrefab(val, "potionaudio"); } private void Start() { Localizer.OnLocalizationComplete += RegisterPlaceholders; } private void RegisterPlaceholders() { if (!_placeholdersRegistered) { _placeholdersRegistered = true; Localizer.AddPlaceholder("pp_flask_elements_description", "duration", flaskOfElementsTTL, [<278e803c-873f-4fa5-9ebc-5b24f0c1bd96>NullableContext(0)] (int ttl) => ((float)ttl / 60f).ToString("0.#")); Localizer.AddPlaceholder("pp_flask_secondwind_description", "duration", flaskOfSecondWindTTL, [<278e803c-873f-4fa5-9ebc-5b24f0c1bd96>NullableContext(0)] (int ttl) => ((float)ttl / 60f).ToString("0.#")); Localizer.AddPlaceholder("pp_flask_fort_description", "duration", flaskOfFortificationTTL, [<278e803c-873f-4fa5-9ebc-5b24f0c1bd96>NullableContext(0)] (int ttl) => ((float)ttl / 60f).ToString("0.#")); Localizer.AddPlaceholder<float>("pp_flask_god_description", "power", flaskOfGodsHealing); Localizer.AddPlaceholder<float>("pp_elixir_healing_description", "power", grandHealingTidePotionHealthOverTime); Localizer.AddPlaceholder<float>("pp_elixir_healing_description", "duration", grandHealingTidePotionTTL); Localizer.AddPlaceholder<float>("pp_elixir_spiritual_description", "power", grandSpiritualHealingPotionHealthOverTime); Localizer.AddPlaceholder<float>("pp_elixir_stam_description", "power", grandStaminaElixirStaminaOverTime); Localizer.AddPlaceholder<float>("pp_elixir_stam_description", "duration", grandStaminaElixirTTL); Localizer.AddPlaceholder<int>("pp_elixir_stealth_description", "duration", grandStealthElixirTTL); Localizer.AddPlaceholder<float>("pp_potion_healing_description", "power", mediumHealingTideFlaskHealthOverTime); Localizer.AddPlaceholder<float>("pp_potion_healing_description", "duration", mediumHealingTideFlaskTTL); Localizer.AddPlaceholder<float>("pp_potion_spiritual_description", "power", mediumSpiritualHealingFlaskHealthOverTime); Localizer.AddPlaceholder<float>("pp_potion_stam_description", "power", mediumStaminaFlaskStaminaOverTime); Localizer.AddPlaceholder<float>("pp_vial_healing_description", "power", lesserHealingTideVialHealthOverTime); Localizer.AddPlaceholder<float>("pp_vial_healing_description", "duration", lesserHealingTideVialTTL); Localizer.AddPlaceholder<float>("pp_vial_spiritual_description", "power", lesserSpiritualHealingVialHealthOverTime); Localizer.AddPlaceholder<float>("pp