Decompiled source of PotionPlus v4.1.12

PotionsPlus.dll

Decompiled 7 months ago
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 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 YamlDotNet.Core;
using YamlDotNet.Core.Events;
using YamlDotNet.Core.Tokens;
using YamlDotNet.Helpers;
using YamlDotNet.Serialization;
using YamlDotNet.Serialization.Converters;
using YamlDotNet.Serialization.EventEmitters;
using YamlDotNet.Serialization.NamingConventions;
using YamlDotNet.Serialization.NodeDeserializers;
using YamlDotNet.Serialization.NodeTypeResolvers;
using YamlDotNet.Serialization.ObjectFactories;
using YamlDotNet.Serialization.ObjectGraphTraversalStrategies;
using YamlDotNet.Serialization.ObjectGraphVisitors;
using YamlDotNet.Serialization.Schemas;
using YamlDotNet.Serialization.TypeInspectors;
using YamlDotNet.Serialization.TypeResolvers;
using YamlDotNet.Serialization.Utilities;
using YamlDotNet.Serialization.ValueDeserializers;

[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: Guid("150BFDAF-FF35-4302-B7CC-BEDCE69118D5")]
[assembly: ComVisible(false)]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCopyright("Copyright ©  2022")]
[assembly: AssemblyProduct("PotionsPlus")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyDescription("https://valheim.thunderstore.io/package/OdinPlus/PotionPlus")]
[assembly: AssemblyTitle("PotionsPlus")]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: CompilationRelaxations(8)]
[assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")]
[assembly: AssemblyCompany("")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: <c1157dae-a5ff-401f-94e2-54d0856e44d2>RefSafetyRules(11)]
[module: UnverifiableCode]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[<43ee7184-2f61-4e39-a233-efc1b7c964d3>Embedded]
	internal sealed class <43ee7184-2f61-4e39-a233-efc1b7c964d3>EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	[<43ee7184-2f61-4e39-a233-efc1b7c964d3>Embedded]
	internal sealed class <f30b290c-5d3f-4f0c-9d33-1f24b1ebe980>NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public <f30b290c-5d3f-4f0c-9d33-1f24b1ebe980>NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public <f30b290c-5d3f-4f0c-9d33-1f24b1ebe980>NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	[<43ee7184-2f61-4e39-a233-efc1b7c964d3>Embedded]
	[CompilerGenerated]
	internal sealed class <5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public <5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	[CompilerGenerated]
	[<43ee7184-2f61-4e39-a233-efc1b7c964d3>Embedded]
	internal sealed class <c1157dae-a5ff-401f-94e2-54d0856e44d2>RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public <c1157dae-a5ff-401f-94e2-54d0856e44d2>RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace PotionsPlus
{
	public static class FlaskEffects
	{
		[HarmonyPatch(typeof(Character), "RPC_Damage")]
		private class ReduceDamageTaken
		{
			[<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>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("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("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;
					}
				}
			}
		}
	}
	[<f30b290c-5d3f-4f0c-9d33-1f24b1ebe980>Nullable(0)]
	[<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)]
	public class GroupPotion : SE_Stats
	{
		public static bool effectApplied;

		public DamageType damageType;

		public int range;

		public override void Setup(Character character)
		{
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: 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)
			{
				return;
			}
			foreach (PlayerReference groupPlayer in from p in API.GroupPlayers()
				where p != PlayerReference.fromPlayer(Player.m_localPlayer)
				select p)
			{
				Vector3 position = ((IEnumerable<PlayerInfo>)ZNet.m_instance.m_players).FirstOrDefault((Func<PlayerInfo, bool>)((PlayerInfo p) => ((ZDOID)(ref p.m_characterID)).UserID == groupPlayer.peerId)).m_position;
				if (range == 0 || Utils.DistanceXZ(((Component)character).transform.position, position) < (float)range)
				{
					ZRoutedRpc.instance.InvokeRoutedRPC(groupPlayer.peerId, "PotionsPlus Potion Activated", new object[1] { ((Object)this).name });
				}
			}
		}

		public override void ModifyAttack(SkillType skill, ref HitData hitData)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Invalid comparison between Unknown and I4
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Invalid comparison between Unknown and I4
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Invalid comparison between Unknown and I4
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Invalid comparison between Unknown and I4
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Invalid comparison between Unknown and I4
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: 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;
			if ((int)val <= 64)
			{
				if ((int)val != 32)
				{
					if ((int)val == 64)
					{
						hitData.m_damage.m_frost = num;
					}
				}
				else
				{
					hitData.m_damage.m_fire = num;
				}
			}
			else if ((int)val != 128)
			{
				if ((int)val != 256)
				{
					if ((int)val == 512)
					{
						hitData.m_damage.m_spirit = num;
					}
				}
				else
				{
					hitData.m_damage.m_poison = num;
				}
			}
			else
			{
				hitData.m_damage.m_lightning = num;
			}
		}
	}
	[<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)]
	[<f30b290c-5d3f-4f0c-9d33-1f24b1ebe980>Nullable(0)]
	[BepInPlugin("com.odinplus.potionsplus", "PotionsPlus", "4.1.12")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInIncompatibility("org.bepinex.plugins.valheim_plus")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class PotionsPlus : BaseUnityPlugin
	{
		[<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(0)]
		private enum Toggle
		{
			On = 1,
			Off = 0
		}

		[HarmonyPatch(typeof(Character), "SetHealth")]
		[<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(0)]
		public static class PatchCharacterSetHealth
		{
			[<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>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;
			}
		}

		[<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(0)]
		[HarmonyPatch(typeof(ZNet), "Awake")]
		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")]
		[<f30b290c-5d3f-4f0c-9d33-1f24b1ebe980>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]
		[<f30b290c-5d3f-4f0c-9d33-1f24b1ebe980>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([<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>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;
				}
			}
		}

		[<f30b290c-5d3f-4f0c-9d33-1f24b1ebe980>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 });
				}
			}
		}

		[<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(0)]
		[HarmonyPatch(typeof(InventoryGui), "DoCrafting")]
		private static class ApplyAlchemySkillOnAlchemyTableCrafting
		{
			private static void Prefix(out int __state)
			{
				__state = (int)Game.instance.GetPlayerProfile().m_playerStats[(PlayerStatType)13];
			}

			[<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>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);
					}
					((Character)(object)player).RaiseSkill("Alchemy");
				}
			}
		}

		[HarmonyPatch(typeof(Aoe), "OnHit")]
		[<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(0)]
		private class HealingBrothEffect
		{
			[<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)]
			private static bool Prefix(Collider collider, Vector3 hitPoint, Aoe __instance, ref bool __result)
			{
				//IL_0071: Unknown result type (might be due to invalid IL or missing references)
				//IL_0072: Unknown result type (might be due to invalid IL or missing references)
				if (!((Object)__instance).name.StartsWith("Hellbroth_Life_Explosion", StringComparison.Ordinal))
				{
					return true;
				}
				__result = false;
				GameObject val = Projectile.FindHitObject(collider);
				if (__instance.m_hitList.Contains(val))
				{
					return true;
				}
				__instance.m_hitList.Add(val);
				Character component = val.GetComponent<Character>();
				Player val2 = (Player)(object)((component is Player) ? component : null);
				if (val2 != null)
				{
					((Character)val2).Heal(((Character)val2).GetMaxHealth() * hellbrothOfEternalLifeHealing.Value / 100f, true);
					__result = true;
					__instance.m_hitEffects.Create(hitPoint, Quaternion.identity, (Transform)null, 1f, -1);
				}
				return false;
			}
		}

		[<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(0)]
		[HarmonyPatch(typeof(RandomSpeak), "Start")]
		private class PreventGhostFromTalking
		{
			[<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)]
			private static bool Prefix(RandomSpeak __instance)
			{
				return ((Component)__instance).gameObject.layer != Piece.s_ghostLayer;
			}
		}

		[HarmonyPatch(typeof(Attack), "Start")]
		[<f30b290c-5d3f-4f0c-9d33-1f24b1ebe980>Nullable(0)]
		private class BypassAmmoCheck
		{
			private static void Prefix(Attack __instance, ItemData weapon, [<f30b290c-5d3f-4f0c-9d33-1f24b1ebe980>Nullable(2)] 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, [<f30b290c-5d3f-4f0c-9d33-1f24b1ebe980>Nullable(2)] ref string __state)
			{
				if (__state != null)
				{
					weapon.m_shared.m_ammoType = __state;
				}
			}
		}

		[HarmonyPatch(typeof(Attack), "UseAmmo")]
		[<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(0)]
		private class ReduceAmmoUsage
		{
			[<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>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);
				if (!(text == "Odins_Dragon_Staff"))
				{
					if (!(text == "Odins_Alchemy_Wand"))
					{
						goto IL_00d3;
					}
				}
				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_00d3;
				IL_00d3:
				return true;
			}
		}

		[<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(0)]
		public class SmokescreenOwner : MonoBehaviour, IProjectile
		{
			[<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)]
			public void Setup(Character owner, Vector3 velocity, float hitNoise, HitData hitData, ItemData item, ItemData ammo)
			{
				//IL_0012: 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_0026: Unknown result type (might be due to invalid IL or missing references)
				//IL_002b: Unknown result type (might be due to invalid IL or missing references)
				if (((Component)this).GetComponent<ZNetView>().m_zdo.GetBool("PotionsPlus SmokeCloud HatBonus", false))
				{
					ParticleSystem[] componentsInChildren = ((Component)this).GetComponentsInChildren<ParticleSystem>();
					for (int i = 0; i < componentsInChildren.Length; i++)
					{
						ShapeModule shape = componentsInChildren[i].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);
				}
			}

			[<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)]
			public string GetTooltipString(int itemQuality)
			{
				return "";
			}
		}

		[<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(0)]
		[HarmonyPatch(typeof(Projectile), "FixedUpdate")]
		private class SmokescreenHitBarrier
		{
			private static int ProjectileBlocker(int mask)
			{
				return mask | (1 << LayerMask.NameToLayer("blocker"));
			}

			[<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>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));
					}
				}
			}
		}

		[<f30b290c-5d3f-4f0c-9d33-1f24b1ebe980>Nullable(0)]
		[HarmonyPatch(typeof(Projectile), "OnHit")]
		private class DestroyBlockedProjectile
		{
			private static bool Prefix(Projectile __instance, Collider collider, ref bool __state)
			{
				//IL_005a: Unknown result type (might be due to invalid IL or missing references)
				//IL_009c: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
				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);
				}
			}
		}

		[<f30b290c-5d3f-4f0c-9d33-1f24b1ebe980>Nullable(0)]
		[HarmonyPatch(typeof(Projectile), "SpawnOnHit")]
		private class TransferDamageToAoeProjectile
		{
			private static IProjectile UpdateAoeProjectileDamage(IProjectile newProjectile, IProjectile spawning)
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				//IL_0030: Unknown result type (might be due to invalid IL or missing references)
				//IL_0036: Unknown result type (might be due to invalid IL or missing references)
				//IL_003c: Expected O, but got Unknown
				//IL_003c: 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_004e: Unknown result type (might be due to invalid IL or missing references)
				//IL_004f: 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_0062: Unknown result type (might be due to invalid IL or missing references)
				//IL_0074: Unknown result type (might be due to invalid IL or missing references)
				string projectileName = ((Object)(Component)spawning).name;
				if (wandProjectiles.Any([<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>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.1.12";

		private const string ModGUID = "com.odinplus.potionsplus";

		private static readonly ConfigSync configSync = new ConfigSync("PotionsPlus")
		{
			DisplayName = "PotionsPlus",
			CurrentVersion = "4.1.12",
			MinimumRequiredVersion = "4.1.12"
		};

		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<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;

		private static ConfigEntry<float> hellbrothOfEternalLifeHealing = 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 static SE_Stats CheatDeathStatusEffect = null;

		private static SE_Stats AlchemySkillProcStatusEffect = null;

		private ConfigEntry<T> config<[<f30b290c-5d3f-4f0c-9d33-1f24b1ebe980>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);
			configSync.AddConfigEntry<T>(val).SynchronizedConfig = synchronizedSetting;
			return val;
		}

		private ConfigEntry<T> config<[<f30b290c-5d3f-4f0c-9d33-1f24b1ebe980>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_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: Expected O, but got Unknown
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Expected O, but got Unknown
			//IL_014d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0158: Expected O, but got Unknown
			//IL_017f: Unknown result type (might be due to invalid IL or missing references)
			//IL_018a: Expected O, but got Unknown
			//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b9: Expected O, but got Unknown
			//IL_01dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e8: Expected O, but got Unknown
			//IL_020c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0217: Expected O, but got Unknown
			//IL_023e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0249: Expected O, but got Unknown
			//IL_0268: Unknown result type (might be due to invalid IL or missing references)
			//IL_0278: Unknown result type (might be due to invalid IL or missing references)
			//IL_0283: Expected O, but got Unknown
			//IL_02b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bc: Expected O, but got Unknown
			//IL_02e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f1: Expected O, but got Unknown
			//IL_0311: Unknown result type (might be due to invalid IL or missing references)
			//IL_031c: Expected O, but got Unknown
			//IL_034a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0355: Expected O, but got Unknown
			//IL_037f: Unknown result type (might be due to invalid IL or missing references)
			//IL_038a: Expected O, but got Unknown
			//IL_03b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c3: Expected O, but got Unknown
			//IL_03f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_03fc: Expected O, but got Unknown
			//IL_042a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0435: Expected O, but got Unknown
			//IL_045c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0467: Expected O, but got Unknown
			//IL_0487: Unknown result type (might be due to invalid IL or missing references)
			//IL_0492: Expected O, but got Unknown
			//IL_04c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_04cb: Expected O, but got Unknown
			//IL_04f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0504: Expected O, but got Unknown
			//IL_0524: Unknown result type (might be due to invalid IL or missing references)
			//IL_052f: Expected O, but got Unknown
			//IL_055d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0568: Expected O, but got Unknown
			//IL_0592: Unknown result type (might be due to invalid IL or missing references)
			//IL_059d: Expected O, but got Unknown
			//IL_05bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c8: Expected O, but got Unknown
			//IL_05f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_05fd: Expected O, but got Unknown
			//IL_0621: Unknown result type (might be due to invalid IL or missing references)
			//IL_062c: Expected O, but got Unknown
			//IL_0650: Unknown result type (might be due to invalid IL or missing references)
			//IL_065b: Expected O, but got Unknown
			//IL_0682: Unknown result type (might be due to invalid IL or missing references)
			//IL_068d: Expected O, but got Unknown
			//IL_06ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_06b8: Expected O, but got Unknown
			//IL_06e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_06f1: Expected O, but got Unknown
			//IL_071f: Unknown result type (might be due to invalid IL or missing references)
			//IL_072a: Expected O, but got Unknown
			//IL_0754: Unknown result type (might be due to invalid IL or missing references)
			//IL_075f: Expected O, but got Unknown
			//IL_077f: Unknown result type (might be due to invalid IL or missing references)
			//IL_078a: Expected O, but got Unknown
			//IL_07b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_07bf: Expected O, but got Unknown
			//IL_07df: Unknown result type (might be due to invalid IL or missing references)
			//IL_07ea: Expected O, but got Unknown
			//IL_0814: Unknown result type (might be due to invalid IL or missing references)
			//IL_081f: Expected O, but got Unknown
			//IL_083f: Unknown result type (might be due to invalid IL or missing references)
			//IL_084a: Expected O, but got Unknown
			//IL_0878: Unknown result type (might be due to invalid IL or missing references)
			//IL_0883: Expected O, but got Unknown
			//IL_08b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_08bc: Expected O, but got Unknown
			//IL_08e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_08f1: Expected O, but got Unknown
			//IL_0911: Unknown result type (might be due to invalid IL or missing references)
			//IL_091c: Expected O, but got Unknown
			//IL_0946: Unknown result type (might be due to invalid IL or missing references)
			//IL_0951: Expected O, but got Unknown
			//IL_0971: Unknown result type (might be due to invalid IL or missing references)
			//IL_097c: Expected O, but got Unknown
			//IL_09a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_09b1: Expected O, but got Unknown
			//IL_09d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_09dc: Expected O, but got Unknown
			//IL_09fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a07: Expected O, but got Unknown
			//IL_0a27: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a32: Expected O, but got Unknown
			//IL_0a60: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a6b: Expected O, but got Unknown
			//IL_0a8b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a96: Expected O, but got Unknown
			//IL_0ac0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0acb: Expected O, but got Unknown
			//IL_0af2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0afd: Expected O, but got Unknown
			//IL_0b1d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b28: Expected O, but got Unknown
			//IL_0b52: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b5d: Expected O, but got Unknown
			//IL_0b84: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b8f: Expected O, but got Unknown
			//IL_0baf: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bba: Expected O, but got Unknown
			//IL_0be4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bef: Expected O, but got Unknown
			//IL_0c16: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c21: Expected O, but got Unknown
			//IL_0c4f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c5a: Expected O, but got Unknown
			//IL_0c81: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c8c: Expected O, but got Unknown
			//IL_0cba: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cc5: Expected O, but got Unknown
			//IL_0cec: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cf7: Expected O, but got Unknown
			//IL_0d25: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d30: Expected O, but got Unknown
			//IL_0d57: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d62: Expected O, but got Unknown
			//IL_0d90: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d9b: Expected O, but got Unknown
			//IL_0dc2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0dcd: Expected O, but got Unknown
			//IL_0dfb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e06: Expected O, but got Unknown
			//IL_0e2d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e38: Expected O, but got Unknown
			//IL_0e66: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e71: Expected O, but got Unknown
			//IL_0e9f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0eaa: Expected O, but got Unknown
			//IL_0ecd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ed8: Expected O, but got Unknown
			//IL_0efc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f07: Expected O, but got Unknown
			//IL_0f2b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f36: Expected O, but got Unknown
			//IL_0f64: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f6f: Expected O, but got Unknown
			//IL_0f92: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f9d: Expected O, but got Unknown
			//IL_0fcb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fd6: Expected O, but got Unknown
			//IL_13d6: Unknown result type (might be due to invalid IL or missing references)
			Localizer.Load();
			AssetBundle val = PrefabManager.RegisterAssetBundle("potions");
			alchemy = new Skill("Alchemy", val.LoadAsset<Sprite>("AlcSkill"));
			alchemy.Name.Alias("pp_potion_skill_name");
			alchemy.Description.Alias("pp_potion_skill_description");
			alchemy.Configurable = false;
			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>()));
			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>()));
			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);
			Localizer.AddPlaceholder("pp_flask_elements_description", "duration", flaskOfElementsTTL, [<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(0)] (int ttl) => ((float)ttl / 60f).ToString("0.#"));
			Localizer.AddPlaceholder("pp_flask_secondwind_description", "duration", flaskOfSecondWindTTL, [<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(0)] (int ttl) => ((float)ttl / 60f).ToString("0.#"));
			Localizer.AddPlaceholder("pp_flask_fort_description", "duration", flaskOfFortificationTTL, [<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>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_vial_stam_description", "power", lesserStaminaVialStaminaOverTime);
			Localizer.AddPlaceholder<float>("pp_hellbroth_of_flames_description", "power", hellbrothOfFlamesDamage);
			Localizer.AddPlaceholder<float>("pp_hellbroth_of_frost_description", "power", hellbrothOfFrostDamage);
			Localizer.AddPlaceholder<float>("pp_hellbroth_of_thors_fury", "power", hellbrothOfThorsFuryDamage);
			Localizer.AddPlaceholder<float>("pp_hellbroth_of_eternal_life_description", "power", hellbrothOfEternalLifeHealing);
			Localizer.AddPlaceholder<float>("pp_lesser_group_healing_description", "power", brewOfFaintGroupHealingHealthOverTime);
			Localizer.AddPlaceholder<int>("pp_lesser_group_healing_description", "range", brewOfFaintGroupHealingRange);
			Localizer.AddPlaceholder<float>("pp_medium_group_healing_description", "power", brewOfGroupHealingHealthOverTime);
			Localizer.AddPlaceholder<int>("pp_medium_group_healing_description", "range", brewOfGroupHealingRange);
			Localizer.AddPlaceholder<float>("pp_grand_group_healing_description", "power", brewOfGrandGroupHealingHealthOverTime);
			Localizer.AddPlaceholder<int>("pp_grand_group_healing_description", "range", brewOfGrandGroupHealingRange);
			Localizer.AddPlaceholder<int>("pp_brew_of_toxicity_description", "range", brewOfCunningToxicityRange);
			Localizer.AddPlaceholder<int>("pp_brew_of_fiery_revenge_description", "range", brewOfFieryRevengeRange);
			Localizer.AddPlaceholder<int>("pp_brew_of_icy_touch_description", "range", brewOfIcyTouchRange);
			Localizer.AddPlaceholder<int>("pp_brew_of_spiritual_death_description", "range", brewOfSpiritualDeathRange);
			Localizer.AddPlaceholder<int>("pp_brew_of_thunderous_words_description", "range", brewOfThunderousWordsRange);
			Localizer.AddPlaceholder<float>("pp_odins_wizard_hat_description", "power", wizardHatConsumeChargeReduction);
			Localizer.AddPlaceholder<int>("pp_odins_weapon_oil_description", "power", weaponOilDamageIncrease);
			Localizer.AddPlaceholder<float>("pp_odins_weapon_oil_description", "duration", weaponOilTTL);
			Localizer.AddPlaceholder<int>("pp_weapon_oil_description", "power", weaponOilDamageIncrease);
			Localizer.AddPlaceholder<int>("pp_odins_dragon_staff_description", "power", smokeScreenChanceToBlock);
			Localizer.AddPlaceholder<float>("pp_odins_dragon_staff_description", "duration", smokeScreenTTL);
			Localizer.AddPlaceholder<int>("pp_odins_warlock_hat_description", "power", warlockHatSmokeScreenBlockIncrease);
			Localizer.AddPlaceholder<float>("pp_odins_warlock_hat_description", "radius", warlockHatSmokeScreenSizeIncrease);
			Localizer.AddPlaceholder<int>("pp_odins_warlock_hat_description", "duration", warlockHatSmokeScreenDurationIncrease);
			Assembly executingAssembly = Assembly.GetExecutingAssembly();
			new Harmony("com.odinplus.potionsplus").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 static void onGroupPotionActivated(long sender, string effect)
		{
			GroupPotion.effectApplied = true;
			((Character)Player.m_localPlayer).GetSEMan().AddStatusEffect(ObjectDB.instance.GetStatusEffect(StringExtensionMethods.GetStableHashCode(effect)), false, 0, 0f);
			GroupPotion.effectApplied = false;
		}

		private static int DetermineExtraItems(int skillLevel, long sender)
		{
			int num = 0;
			if (alchemySkillBonusWhenCraftingEnabled.Value == Toggle.On)
			{
				if (Random.Range(1, 100) < skillLevel)
				{
					num++;
				}
				if ((float)skillLevel > 25f && Random.Range(1, 400) < skillLevel)
				{
					num++;
				}
			}
			if (num > 0)
			{
				ZRoutedRpc.instance.InvokeRoutedRPC(sender, "PotionsPlus Alchemy Proc", Array.Empty<object>());
			}
			return num;
		}
	}
	public static class BuildingPiecesSetup
	{
		[<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)]
		public static void initializeBuildingPieces(AssetBundle assets)
		{
			BuildPiece buildPiece = new BuildPiece(assets, "opalchemy");
			buildPiece.RequiredItems.Add("Stone", 8, recover: true);
			buildPiece.Category.Set(BuildPieceCategory.Crafting);
			BuildPiece buildPiece2 = new BuildPiece(assets, "opcauldron");
			buildPiece2.RequiredItems.Add("Iron", 4, recover: true);
			buildPiece2.Category.Set(BuildPieceCategory.Crafting);
			BuildPiece buildPiece3 = new BuildPiece(assets, "Odins_Alchemy_Book");
			buildPiece3.RequiredItems.Add("WitheredBone", 1, recover: true);
			buildPiece3.RequiredItems.Add("SurtlingCore", 2, recover: true);
			buildPiece3.RequiredItems.Add("Iron", 4, recover: true);
			buildPiece3.Category.Set(BuildPieceCategory.Crafting);
		}
	}
	public static class EquipmentSetup
	{
		[<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)]
		public static void initializeEquipment(AssetBundle assets)
		{
			Item item = new Item(assets, "Odins_Alchemy_Wand");
			item.Crafting.Add(ItemManager.CraftingTable.Forge, 2);
			item.RequiredItems.Add("FineWood", 8);
			item.RequiredItems.Add("Copper", 3);
			item.RequiredItems.Add("SurtlingCore", 1);
			item.RequiredUpgradeItems.Add("FineWood", 4);
			item.RequiredUpgradeItems.Add("Copper", 1);
			Item item2 = new Item(assets, "Odins_Wizard_Hat");
			item2.Crafting.Add(ItemManager.CraftingTable.Workbench, 5);
			item2.MaximumRequiredStationLevel = 5;
			item2.RequiredItems.Add("LinenThread", 20);
			item2.RequiredItems.Add("SurtlingCore", 5);
			item2.RequiredUpgradeItems.Add("LinenThread", 10);
			item2.RequiredUpgradeItems.Add("SurtlingCore", 2);
			Item item3 = new Item(assets, "Odins_Warlock_Hat");
			item3.Crafting.Add(ItemManager.CraftingTable.Workbench, 5);
			item3.MaximumRequiredStationLevel = 5;
			item3.RequiredItems.Add("LinenThread", 20);
			item3.RequiredItems.Add("SurtlingCore", 5);
			item3.RequiredUpgradeItems.Add("LinenThread", 10);
			item3.RequiredUpgradeItems.Add("SurtlingCore", 2);
			Item item4 = new Item(assets, "Odins_Dragon_Staff");
			item4.Crafting.Add(ItemManager.CraftingTable.Workbench, 3);
			item4.MaximumRequiredStationLevel = 5;
			item4.RequiredItems.Add("Odins_Alchemy_Wand", 1);
			item4.RequiredItems.Add("ElderBark", 40);
			item4.RequiredItems.Add("BlackMetal", 40);
			item4.RequiredItems.Add("SurtlingCore", 1);
			item4.RequiredUpgradeItems.Add("ElderBark", 20);
			item4.RequiredUpgradeItems.Add("BlackMetal", 20);
			GameObject smokeScreen = PrefabManager.RegisterPrefab(assets, "Staff_Smoke_Cloud");
			smokeScreen.AddComponent<PotionsPlus.SmokescreenOwner>();
			smokeScreen.GetComponent<TimedDestruction>().m_timeout = PotionsPlus.smokeScreenTTL.Value;
			PotionsPlus.smokeScreenTTL.SettingChanged += delegate
			{
				smokeScreen.GetComponent<TimedDestruction>().m_timeout = PotionsPlus.smokeScreenTTL.Value;
			};
		}
	}
	public static class GroupPotionSetup
	{
		[<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)]
		public static void initializeGroupPotions(AssetBundle assets)
		{
			//IL_027e: Unknown result type (might be due to invalid IL or missing references)
			//IL_033f: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0573: Unknown result type (might be due to invalid IL or missing references)
			Item item = new Item(assets, "Lesser_Group_Healing");
			if (API.IsLoaded())
			{
				item.Crafting.Add("opalchemy", 1);
				item.RequiredItems.Add("Honey", 1);
				item.RequiredItems.Add("Mushroom", 2);
			}
			Utils.SEValue(item, [<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)] (SE_Stats effect, int value) =>
			{
				((StatusEffect)effect).m_ttl = value;
			}, PotionsPlus.brewOfFaintGroupHealingCooldown);
			Utils.SEValue(item, [<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)] (SE_Stats effect, float value) =>
			{
				effect.m_healthOverTime = value;
			}, PotionsPlus.brewOfFaintGroupHealingHealthOverTime);
			((SE_Stats)Utils.ConvertConsumeSEStats<GroupPotion>(item.Prefab)).m_healthOverTimeDuration = 1f;
			item = new Item(assets, "Medium_Group_Healing");
			if (API.IsLoaded())
			{
				item.Crafting.Add("opalchemy", 1);
				item.RequiredItems.Add("Honey", 2);
				item.RequiredItems.Add("Mushroom", 4);
			}
			Utils.SEValue(item, [<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)] (SE_Stats effect, int value) =>
			{
				((StatusEffect)effect).m_ttl = value;
			}, PotionsPlus.brewOfGroupHealingCooldown);
			Utils.SEValue(item, [<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)] (SE_Stats effect, float value) =>
			{
				effect.m_healthOverTime = value;
			}, PotionsPlus.brewOfGroupHealingHealthOverTime);
			((SE_Stats)Utils.ConvertConsumeSEStats<GroupPotion>(item.Prefab)).m_healthOverTimeDuration = 1f;
			item = new Item(assets, "Grand_Group_Healing");
			if (API.IsLoaded())
			{
				item.Crafting.Add("opalchemy", 2);
				item.RequiredItems.Add("Honey", 4);
				item.RequiredItems.Add("Mushroom", 6);
			}
			Utils.SEValue(item, [<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)] (SE_Stats effect, int value) =>
			{
				((StatusEffect)effect).m_ttl = value;
			}, PotionsPlus.brewOfGrandGroupHealingCooldown);
			Utils.SEValue(item, [<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)] (SE_Stats effect, float value) =>
			{
				effect.m_healthOverTime = value;
			}, PotionsPlus.brewOfGrandGroupHealingHealthOverTime);
			((SE_Stats)Utils.ConvertConsumeSEStats<GroupPotion>(item.Prefab)).m_healthOverTimeDuration = 1f;
			item = new Item(assets, "Brew_of_Cunning_Toxicity");
			if (API.IsLoaded())
			{
				item.Crafting.Add("opalchemy", 2);
				item.RequiredItems.Add("Ooze", 10);
				item.RequiredItems.Add("Bloodbag", 3);
				item.RequiredItems.Add("Dandelion", 4);
			}
			Utils.ConvertConsumeSEStats<GroupPotion>(item.Prefab).damageType = (DamageType)256;
			Utils.SEValue(item, [<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)] (SE_Stats effect, float value) =>
			{
				((StatusEffect)effect).m_ttl = value;
			}, PotionsPlus.brewOfCunningToxicityTTL);
			Utils.SEValue(item, [<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)] (SE_Stats effect, int value) =>
			{
				((GroupPotion)(object)effect).range = value;
			}, PotionsPlus.brewOfCunningToxicityRange);
			item = new Item(assets, "Brew_of_Fiery_Revenge");
			if (API.IsLoaded())
			{
				item.Crafting.Add("opalchemy", 2);
				item.RequiredItems.Add("Resin", 20);
				item.RequiredItems.Add("Torch", 3);
				item.RequiredItems.Add("SurtlingCore", 2);
			}
			Utils.ConvertConsumeSEStats<GroupPotion>(item.Prefab).damageType = (DamageType)32;
			Utils.SEValue(item, [<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)] (SE_Stats effect, float value) =>
			{
				((StatusEffect)effect).m_ttl = value;
			}, PotionsPlus.brewOfFieryRevengeTTL);
			Utils.SEValue(item, [<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)] (SE_Stats effect, int value) =>
			{
				((GroupPotion)(object)effect).range = value;
			}, PotionsPlus.brewOfFieryRevengeRange);
			item = new Item(assets, "Brew_of_Icy_Touch");
			if (API.IsLoaded())
			{
				item.Crafting.Add("opalchemy", 2);
				item.RequiredItems.Add("FreezeGland", 4);
				item.RequiredItems.Add("Carrot", 5);
				item.RequiredItems.Add("Turnip", 5);
			}
			Utils.ConvertConsumeSEStats<GroupPotion>(item.Prefab).damageType = (DamageType)64;
			Utils.SEValue(item, [<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)] (SE_Stats effect, float value) =>
			{
				((StatusEffect)effect).m_ttl = value;
			}, PotionsPlus.brewOfIcyTouchTTL);
			Utils.SEValue(item, [<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)] (SE_Stats effect, int value) =>
			{
				((GroupPotion)(object)effect).range = value;
			}, PotionsPlus.brewOfIcyTouchRange);
			item = new Item(assets, "Brew_of_Spiritual_Death");
			if (API.IsLoaded())
			{
				item.Crafting.Add("opalchemy", 2);
				item.RequiredItems.Add("Chitin", 2);
				item.RequiredItems.Add("Entrails", 4);
			}
			Utils.ConvertConsumeSEStats<GroupPotion>(item.Prefab).damageType = (DamageType)512;
			Utils.SEValue(item, [<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)] (SE_Stats effect, float value) =>
			{
				((StatusEffect)effect).m_ttl = value;
			}, PotionsPlus.brewOfSpiritualDeathTTL);
			Utils.SEValue(item, [<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)] (SE_Stats effect, int value) =>
			{
				((GroupPotion)(object)effect).range = value;
			}, PotionsPlus.brewOfSpiritualDeathRange);
			item = new Item(assets, "Brew_of_Thunderous_Words");
			if (API.IsLoaded())
			{
				item.Crafting.Add("opalchemy", 2);
				item.RequiredItems.Add("Obsidian", 3);
				item.RequiredItems.Add("GreydwarfEye", 6);
				item.RequiredItems.Add("Cloudberry", 2);
			}
			Utils.ConvertConsumeSEStats<GroupPotion>(item.Prefab).damageType = (DamageType)128;
			Utils.SEValue(item, [<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)] (SE_Stats effect, float value) =>
			{
				((StatusEffect)effect).m_ttl = value;
			}, PotionsPlus.brewOfThunderousWordsTTL);
			Utils.SEValue(item, [<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)] (SE_Stats effect, int value) =>
			{
				((GroupPotion)(object)effect).range = value;
			}, PotionsPlus.brewOfThunderousWordsRange);
		}
	}
	public static class HellbrothSetup
	{
		[<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)]
		public static void initializeHellbroth(AssetBundle assets)
		{
			Item item = new Item(assets, "Hellbroth_of_Flames");
			item.Crafting.Add("opalchemy", 1);
			item.RequiredItems.Add("Resin", 8);
			item.RequiredItems.Add("Torch", 1);
			item.Configurable = Configurability.Recipe;
			Aoe fireAoe = PrefabManager.RegisterPrefab(assets, "Hellbroth_Explosion").GetComponent<Aoe>();
			fireAoe.m_damage.m_fire = PotionsPlus.hellbrothOfFlamesDamage.Value;
			PotionsPlus.hellbrothOfFlamesDamage.SettingChanged += delegate
			{
				fireAoe.m_damage.m_fire = PotionsPlus.hellbrothOfFlamesDamage.Value;
			};
			PrefabManager.RegisterPrefab(assets, "Hellbroth_Projectile");
			PrefabManager.RegisterPrefab(assets, "Hellbroth_Orb_Projectile");
			PotionsPlus.wandProjectiles.Add("Hellbroth_Orb_Projectile");
			Item item2 = new Item(assets, "Hellbroth_of_Flames_Charge");
			item2.Crafting.Add("opcauldron", 1);
			item2.CraftAmount = 2;
			item2.RequiredItems.Add("Hellbroth_of_Flames", 3);
			item2.Configurable = Configurability.Recipe;
			Item item3 = new Item(assets, "Hellbroth_of_Frost");
			item3.Crafting.Add("opalchemy", 2);
			item3.RequiredItems.Add("FreezeGland", 4);
			item3.RequiredItems.Add("Chain", 1);
			item3.Configurable = Configurability.Recipe;
			Aoe frostAoe = PrefabManager.RegisterPrefab(assets, "Hellbroth_Frost_Explosion").GetComponent<Aoe>();
			frostAoe.m_damage.m_frost = PotionsPlus.hellbrothOfFrostDamage.Value;
			PotionsPlus.hellbrothOfFrostDamage.SettingChanged += delegate
			{
				frostAoe.m_damage.m_frost = PotionsPlus.hellbrothOfFrostDamage.Value;
			};
			PrefabManager.RegisterPrefab(assets, "Hellbroth_Frost_Projectile");
			PrefabManager.RegisterPrefab(assets, "Hellbroth_Frost_Orb_Projectile");
			PotionsPlus.wandProjectiles.Add("Hellbroth_Frost_Orb_Projectile");
			Item item4 = new Item(assets, "Hellbroth_of_Frost_Charge");
			item4.Crafting.Add("opcauldron", 1);
			item4.CraftAmount = 2;
			item4.RequiredItems.Add("Hellbroth_of_Frost", 3);
			item4.Configurable = Configurability.Recipe;
			Item item5 = new Item(assets, "Hellbroth_of_Thors_Fury");
			item5.Crafting.Add("opalchemy", 2);
			item5.RequiredItems.Add("Tar", 6);
			item5.RequiredItems.Add("Thunderstone", 1);
			item5.Configurable = Configurability.Recipe;
			Aoe lightningAoe = PrefabManager.RegisterPrefab(assets, "Hellbroth_Thors_Fury_Explosion").GetComponent<Aoe>();
			lightningAoe.m_damage.m_lightning = PotionsPlus.hellbrothOfThorsFuryDamage.Value;
			PotionsPlus.hellbrothOfThorsFuryDamage.SettingChanged += delegate
			{
				lightningAoe.m_damage.m_lightning = PotionsPlus.hellbrothOfThorsFuryDamage.Value;
			};
			PrefabManager.RegisterPrefab(assets, "Hellbroth_Thors_Fury_Projectile");
			PrefabManager.RegisterPrefab(assets, "Hellbroth_Thors_Fury_Orb_Projectile");
			PotionsPlus.wandProjectiles.Add("Hellbroth_Thors_Fury_Orb_Projectile");
			Item item6 = new Item(assets, "Hellbroth_of_Thors_Fury_Charge");
			item6.Crafting.Add("opcauldron", 1);
			item6.CraftAmount = 2;
			item6.RequiredItems.Add("Hellbroth_of_Thors_Fury", 3);
			item6.Configurable = Configurability.Recipe;
			Item item7 = new Item(assets, "Hellbroth_of_Eternal_Life");
			item7.Crafting.Add("opalchemy", 2);
			item7.RequiredItems.Add("Honey", 5);
			item7.RequiredItems.Add("Dandelion", 3);
			item7.Configurable = Configurability.Recipe;
			PrefabManager.RegisterPrefab(assets, "Hellbroth_Life_Projectile");
			PrefabManager.RegisterPrefab(assets, "Hellbroth_Life_Explosion");
			PrefabManager.RegisterPrefab(assets, "Hellbroth_Life_Orb_Projectile");
			PotionsPlus.wandProjectiles.Add("Hellbroth_Life_Orb_Projectile");
			Item item8 = new Item(assets, "Hellbroth_of_Eternal_Life_Charge");
			item8.Crafting.Add("opcauldron", 1);
			item8.CraftAmount = 2;
			item8.RequiredItems.Add("Hellbroth_of_Eternal_Life", 3);
			item8.Configurable = Configurability.Recipe;
		}
	}
	public static class PhilosophersSetup
	{
		[<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)]
		public static void initializePhilosophersStones(AssetBundle assets)
		{
			Item item2 = new Item(assets, "PhilosopherStoneBlue");
			item2.Crafting.Add("opcauldron", 1);
			item2.RequiredItems.Add("Flask_of_Elements", 5);
			AddStatusEffectModifier(item2);
			Item item3 = new Item(assets, "PhilosopherStoneGreen");
			item3.Crafting.Add("opcauldron", 1);
			item3.RequiredItems.Add("Flask_of_Fortification", 5);
			AddStatusEffectModifier(item3);
			Item item4 = new Item(assets, "PhilosopherStoneRed");
			item4.Crafting.Add("opcauldron", 1);
			item4.RequiredItems.Add("Flask_of_the_Gods", 5);
			AddStatusEffectModifier(item4);
			Item item5 = new Item(assets, "PhilosopherStonePurple");
			item5.Crafting.Add("opcauldron", 1);
			item5.RequiredItems.Add("Flask_of_Second_Wind", 5);
			AddStatusEffectModifier(item5);
			AddStatusEffectModifier(new Item(assets, "PhilosopherStoneBlack"));
			[<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)]
			static void AddStatusEffectModifier(Item item)
			{
				//IL_0021: Unknown result type (might be due to invalid IL or missing references)
				//IL_002b: Expected O, but got Unknown
				//IL_0036: Unknown result type (might be due to invalid IL or missing references)
				//IL_003b: Unknown result type (might be due to invalid IL or missing references)
				SE_Stats statusEffect = (SE_Stats)item.Prefab.GetComponent<ItemDrop>().m_itemData.m_shared.m_equipStatusEffect;
				statusEffect.m_raiseSkill = Skill.fromName("Alchemy");
				statusEffect.m_raiseSkillModifier = PotionsPlus.philosophersStoneXpGainFactor.Value;
				PotionsPlus.philosophersStoneXpGainFactor.SettingChanged += delegate
				{
					statusEffect.m_raiseSkillModifier = PotionsPlus.philosophersStoneXpGainFactor.Value;
				};
			}
		}
	}
	public static class PotionsSetup
	{
		[<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)]
		public static void initializePotions(AssetBundle assets)
		{
			//IL_08f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_09c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b65: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c21: Unknown result type (might be due to invalid IL or missing references)
			Item item = new Item(assets, "Flask_of_Elements");
			item.Crafting.Add("opalchemy", 1);
			item.RequiredItems.Add("Potion_Meadbase", 1);
			item.RequiredItems.Add("FreezeGland", 2);
			item.RequiredItems.Add("ElderBark", 4);
			item.RequiredItems.Add("Entrails", 8);
			Utils.SEValue(item, [<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)] (SE_Stats effect, int value) =>
			{
				((StatusEffect)effect).m_ttl = value;
			}, PotionsPlus.flaskOfElementsTTL);
			Item item2 = new Item(assets, "Flask_of_Fortification");
			item2.Crafting.Add("opalchemy", 2);
			item2.RequiredItems.Add("Potion_Meadbase", 1);
			item2.RequiredItems.Add("Obsidian", 2);
			item2.RequiredItems.Add("Flint", 4);
			item2.RequiredItems.Add("Stone", 8);
			Utils.SEValue(item2, [<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)] (SE_Stats effect, int value) =>
			{
				((StatusEffect)effect).m_ttl = value;
			}, PotionsPlus.flaskOfFortificationTTL);
			Item item3 = new Item(assets, "Flask_of_the_Gods");
			item3.Crafting.Add("opalchemy", 2);
			item3.RequiredItems.Add("Potion_Meadbase", 1);
			item3.RequiredItems.Add("Thistle", 4);
			item3.RequiredItems.Add("Flax", 4);
			item3.RequiredItems.Add("Carrot", 2);
			Utils.SEValue(item3, [<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)] (SE_Stats effect, int value) =>
			{
				((StatusEffect)effect).m_ttl = value;
			}, PotionsPlus.flaskOfGodsTTL);
			Utils.SEValue(item3, [<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)] (SE_Stats effect, float value) =>
			{
				effect.m_healthOverTime = value;
			}, PotionsPlus.flaskOfGodsHealing);
			Utils.SEValue(item3, [<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)] (SE_Stats effect, float value) =>
			{
				effect.m_healthRegenMultiplier = value;
			}, PotionsPlus.flaskOfGodsRegenMultiplier);
			Item item4 = new Item(assets, "Flask_of_Magelight");
			item4.Crafting.Add("opalchemy", 2);
			item4.RequiredItems.Add("Potion_Meadbase", 1);
			item4.RequiredItems.Add("BoneFragments", 4);
			item4.RequiredItems.Add("FreezeGland", 4);
			item4.RequiredItems.Add("GreydwarfEye", 8);
			Utils.SEValue(item4, [<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)] (SE_Stats effect, int value) =>
			{
				((StatusEffect)effect).m_ttl = value;
			}, PotionsPlus.flaskOfMagelightTTL);
			Light Magelight = PrefabManager.RegisterPrefab(assets, "Magelight").GetComponent<Light>();
			SetLightIntensity();
			PotionsPlus.flaskOfMagelightIntensity.SettingChanged += delegate
			{
				SetLightIntensity();
			};
			PotionsPlus.flaskOfMagelightColor.SettingChanged += delegate
			{
				SetLightIntensity();
			};
			Item item5 = new Item(assets, "Flask_of_Second_Wind");
			item5.Crafting.Add("opalchemy", 2);
			item5.RequiredItems.Add("Potion_Meadbase", 1);
			item5.RequiredItems.Add("Ooze", 4);
			item5.RequiredItems.Add("FreezeGland", 2);
			item5.RequiredItems.Add("Feathers", 6);
			Utils.SEValue(item5, [<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)] (SE_Stats effect, int value) =>
			{
				((StatusEffect)effect).m_ttl = value;
			}, PotionsPlus.flaskOfSecondWindTTL);
			Utils.SEValue(item5, [<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)] (SE_Stats effect, float value) =>
			{
				effect.m_jumpStaminaUseModifier = 1f - value;
			}, PotionsPlus.flaskOfSecondWindJumpStaminaFactor);
			Utils.SEValue(item5, [<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)] (SE_Stats effect, float value) =>
			{
				effect.m_runStaminaDrainModifier = 1f - value;
			}, PotionsPlus.flaskOfSecondWindRunStaminaFactor);
			Utils.SEValue(item5, [<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)] (SE_Stats effect, float value) =>
			{
				effect.m_staminaRegenMultiplier = value;
			}, PotionsPlus.flaskOfSecondWindStaminaRegenMultiplier);
			Item item6 = new Item(assets, "Grand_Healing_Tide_Potion");
			item6.Crafting.Add("opalchemy", 2);
			item6.RequiredItems.Add("Ooze", 2);
			item6.RequiredItems.Add("Barley", 4);
			item6.RequiredItems.Add("Needle", 2);
			item6.RequiredItems.Add("Cloudberry", 6);
			Utils.SEValue(item6, [<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)] (SE_Stats effect, float value) =>
			{
				effect.m_healthOverTime = value;
			}, PotionsPlus.grandHealingTidePotionHealthOverTime);
			Utils.SEValue(item6, [<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)] (SE_Stats effect, float value) =>
			{
				effect.m_healthOverTimeDuration = value;
			}, PotionsPlus.grandHealingTidePotionTTL);
			Utils.SEValue(item6, [<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)] (SE_Stats effect, float value) =>
			{
				effect.m_healthOverTimeInterval = value;
			}, PotionsPlus.grandHealingTidePotionTickInterval);
			Item item7 = new Item(assets, "Grand_Spiritual_Healing_Potion");
			item7.Crafting.Add("opalchemy", 2);
			item7.RequiredItems.Add("Ooze", 4);
			item7.RequiredItems.Add("Flax", 4);
			item7.RequiredItems.Add("WolfFang", 2);
			item7.RequiredItems.Add("Cloudberry", 6);
			Utils.SEValue(item7, [<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)] (SE_Stats effect, int value) =>
			{
				((StatusEffect)effect).m_ttl = value;
			}, PotionsPlus.grandSpiritualHealingPotionCooldown);
			Utils.SEValue(item7, [<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)] (SE_Stats effect, float value) =>
			{
				effect.m_healthOverTime = value;
			}, PotionsPlus.grandSpiritualHealingPotionHealthOverTime);
			Item item8 = new Item(assets, "Grand_Stamina_Elixir");
			item8.Crafting.Add("opalchemy", 2);
			item8.RequiredItems.Add("LoxMeat", 2);
			item8.RequiredItems.Add("Carrot", 4);
			item8.RequiredItems.Add("Turnip", 4);
			item8.RequiredItems.Add("Cloudberry", 8);
			Utils.SEValue(item8, [<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)] (SE_Stats effect, int value) =>
			{
				((StatusEffect)effect).m_ttl = value;
			}, PotionsPlus.grandStaminaElixirCooldown);
			Utils.SEValue(item8, [<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)] (SE_Stats effect, float value) =>
			{
				effect.m_staminaOverTime = value;
			}, PotionsPlus.grandStaminaElixirStaminaOverTime);
			Utils.SEValue(item8, [<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)] (SE_Stats effect, float value) =>
			{
				effect.m_staminaOverTimeDuration = value;
			}, PotionsPlus.grandStaminaElixirTTL);
			Item item9 = new Item(assets, "Grand_Stealth_Elixir");
			item9.Crafting.Add("opalchemy", 2);
			item9.RequiredItems.Add("FreezeGland", 2);
			item9.RequiredItems.Add("Flax", 4);
			item9.RequiredItems.Add("Feathers", 2);
			item9.RequiredItems.Add("Carrot", 2);
			Utils.SEValue(item9, [<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)] (SE_Stats effect, int value) =>
			{
				((StatusEffect)effect).m_ttl = value;
			}, PotionsPlus.grandStealthElixirTTL);
			Utils.SEValue(item9, [<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)] (SE_Stats effect, int value) =>
			{
				effect.m_noiseModifier = (float)(-value) / 100f;
			}, PotionsPlus.grandStealthElixirNoiseReduction);
			Utils.SEValue(item9, [<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)] (SE_Stats effect, int value) =>
			{
				effect.m_stealthModifier = (float)(-value) / 100f;
			}, PotionsPlus.grandStealthElixirVisibilityReduction);
			Item item10 = new Item(assets, "Medium_Healing_Tide_Flask");
			item10.Crafting.Add("opalchemy", 1);
			item10.RequiredItems.Add("Resin", 6);
			item10.RequiredItems.Add("Blueberries", 4);
			item10.RequiredItems.Add("Bloodbag", 2);
			Utils.SEValue(item10, [<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)] (SE_Stats effect, int value) =>
			{
				((StatusEffect)effect).m_ttl = value;
			}, PotionsPlus.mediumHealingTideFlaskCooldown);
			Utils.SEValue(item10, [<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)] (SE_Stats effect, float value) =>
			{
				effect.m_healthOverTime = value;
			}, PotionsPlus.mediumHealingTideFlaskHealthOverTime);
			Utils.SEValue(item10, [<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)] (SE_Stats effect, float value) =>
			{
				effect.m_healthOverTimeDuration = value;
			}, PotionsPlus.mediumHealingTideFlaskTTL);
			Utils.SEValue(item10, [<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)] (SE_Stats effect, float value) =>
			{
				effect.m_healthOverTimeInterval = value;
			}, PotionsPlus.mediumHealingTideFlaskTickInterval);
			Item item11 = new Item(assets, "Medium_Spiritual_Healing_Flask");
			item11.Crafting.Add("opalchemy", 1);
			item11.RequiredItems.Add("Ooze", 2);
			item11.RequiredItems.Add("BoneFragments", 4);
			item11.RequiredItems.Add("Bloodbag", 2);
			Utils.SEValue(item11, [<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)] (SE_Stats effect, int value) =>
			{
				((StatusEffect)effect).m_ttl = value;
			}, PotionsPlus.mediumSpiritualHealingFlaskCooldown);
			Utils.SEValue(item11, [<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)] (SE_Stats effect, float value) =>
			{
				effect.m_healthOverTime = value;
			}, PotionsPlus.mediumSpiritualHealingFlaskHealthOverTime);
			((SE_Stats)item11.Prefab.GetComponent<ItemDrop>().m_itemData.m_shared.m_consumeStatusEffect).m_healthOverTimeDuration = 1f;
			Item item12 = new Item(assets, "Medium_Stamina_Flask");
			item12.Crafting.Add("opalchemy", 1);
			item12.RequiredItems.Add("Resin", 4);
			item12.RequiredItems.Add("Blueberries", 4);
			item12.RequiredItems.Add("Bloodbag", 2);
			Utils.SEValue(item12, [<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)] (SE_Stats effect, int value) =>
			{
				((StatusEffect)effect).m_ttl = value;
			}, PotionsPlus.mediumStaminaFlaskCooldown);
			Utils.SEValue(item12, [<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)] (SE_Stats effect, float value) =>
			{
				effect.m_staminaOverTime = value;
			}, PotionsPlus.mediumStaminaFlaskStaminaOverTime);
			((SE_Stats)item12.Prefab.GetComponent<ItemDrop>().m_itemData.m_shared.m_consumeStatusEffect).m_staminaOverTimeDuration = 1f;
			Item item13 = new Item(assets, "Lesser_Healing_Tide_Vial");
			item13.Crafting.Add("opalchemy", 1);
			item13.RequiredItems.Add("Honey", 2);
			item13.RequiredItems.Add("Raspberry", 4);
			Utils.SEValue(item13, [<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)] (SE_Stats effect, int value) =>
			{
				((StatusEffect)effect).m_ttl = value;
			}, PotionsPlus.lesserHealingTideVialCooldown);
			Utils.SEValue(item13, [<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)] (SE_Stats effect, float value) =>
			{
				effect.m_healthOverTime = value;
			}, PotionsPlus.lesserHealingTideVialHealthOverTime);
			Utils.SEValue(item13, [<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)] (SE_Stats effect, float value) =>
			{
				effect.m_healthOverTimeDuration = value;
			}, PotionsPlus.lesserHealingTideVialTTL);
			Utils.SEValue(item13, [<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)] (SE_Stats effect, float value) =>
			{
				effect.m_healthOverTimeInterval = value;
			}, PotionsPlus.lesserHealingTideVialTickInterval);
			Item item14 = new Item(assets, "Lesser_Spiritual_Healing_Vial");
			item14.Crafting.Add("opalchemy", 1);
			item14.RequiredItems.Add("Dandelion", 2);
			item14.RequiredItems.Add("Raspberry", 4);
			Utils.SEValue(item14, [<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)] (SE_Stats effect, int value) =>
			{
				((StatusEffect)effect).m_ttl = value;
			}, PotionsPlus.lesserSpiritualHealingVialCooldown);
			Utils.SEValue(item14, [<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)] (SE_Stats effect, float value) =>
			{
				effect.m_healthOverTime = value;
			}, PotionsPlus.lesserSpiritualHealingVialHealthOverTime);
			((SE_Stats)item14.Prefab.GetComponent<ItemDrop>().m_itemData.m_shared.m_consumeStatusEffect).m_healthOverTimeDuration = 1f;
			Item item15 = new Item(assets, "Lesser_Stamina_Vial");
			item15.Crafting.Add("opalchemy", 1);
			item15.RequiredItems.Add("Honey", 2);
			item15.RequiredItems.Add("Mushroom", 4);
			Utils.SEValue(item15, [<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)] (SE_Stats effect, int value) =>
			{
				((StatusEffect)effect).m_ttl = value;
			}, PotionsPlus.lesserStaminaVialCooldown);
			Utils.SEValue(item15, [<5bcdd7ef-db98-4f36-82a5-0f77207f3e11>NullableContext(1)] (SE_Stats effect, float value) =>
			{
				effect.m_staminaOverTime = value;
			}, PotionsPlus.lesserStaminaVialStaminaOverTime);
			((SE_Stats)item15.Prefab.GetComponent<ItemDrop>().m_itemData.m_shared.m_consumeStatusEffect).m_staminaOverTimeDuration = 1f;
			Ite