Decompiled source of PotionPlus v4.1.16
PotionsPlus.dll
Decompiled a day ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Concurrent; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.IO; using System.IO.Compression; using System.Linq; using System.Linq.Expressions; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Serialization; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using System.Text.RegularExpressions; using System.Threading; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using Groups; using HarmonyLib; using ItemManager; using JetBrains.Annotations; using LocalizationManager; using Microsoft.CodeAnalysis; using PieceManager; using ServerSync; using SkillManager; using TMPro; using UnityEngine; using UnityEngine.UI; using YamlDotNet.Core; using YamlDotNet.Core.Events; using YamlDotNet.Core.ObjectPool; using YamlDotNet.Core.Tokens; using YamlDotNet.Helpers; using YamlDotNet.Serialization; using YamlDotNet.Serialization.BufferedDeserialization; using YamlDotNet.Serialization.BufferedDeserialization.TypeDiscriminators; using YamlDotNet.Serialization.Callbacks; using YamlDotNet.Serialization.Converters; using YamlDotNet.Serialization.EventEmitters; using YamlDotNet.Serialization.NamingConventions; using YamlDotNet.Serialization.NodeDeserializers; using YamlDotNet.Serialization.NodeTypeResolvers; using YamlDotNet.Serialization.ObjectFactories; using YamlDotNet.Serialization.ObjectGraphTraversalStrategies; using YamlDotNet.Serialization.ObjectGraphVisitors; using YamlDotNet.Serialization.Schemas; using YamlDotNet.Serialization.TypeInspectors; using YamlDotNet.Serialization.TypeResolvers; using YamlDotNet.Serialization.Utilities; using YamlDotNet.Serialization.ValueDeserializers; [assembly: 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.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: CompilationRelaxations(8)] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyCompany("")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: <2258e8df-455b-4094-b4e5-169280c3b287>RefSafetyRules(11)] [module: UnverifiableCode] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [<9b8f695a-9e56-4f1d-83fa-58bf0f0871ff>Embedded] internal sealed class <9b8f695a-9e56-4f1d-83fa-58bf0f0871ff>EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [<9b8f695a-9e56-4f1d-83fa-58bf0f0871ff>Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class <e39e4b9e-0146-48e3-8151-bfa170435579>NullableAttribute : Attribute { public readonly byte[] NullableFlags; public <e39e4b9e-0146-48e3-8151-bfa170435579>NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public <e39e4b9e-0146-48e3-8151-bfa170435579>NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [<9b8f695a-9e56-4f1d-83fa-58bf0f0871ff>Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [CompilerGenerated] internal sealed class <88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContextAttribute : Attribute { public readonly byte Flag; public <88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [<9b8f695a-9e56-4f1d-83fa-58bf0f0871ff>Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class <2258e8df-455b-4094-b4e5-169280c3b287>RefSafetyRulesAttribute : Attribute { public readonly int Version; public <2258e8df-455b-4094-b4e5-169280c3b287>RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace PotionsPlus { public static class FlaskEffects { [HarmonyPatch(typeof(Character), "RPC_Damage")] private class ReduceDamageTaken { [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(1)] private static void Prefix(Character __instance, HitData hit) { Player val = (Player)(object)((__instance is Player) ? __instance : null); if (val != null) { if (((Character)val).GetSEMan().HaveStatusEffect(StringExtensionMethods.GetStableHashCode("Flask_of_Elements"))) { hit.m_damage.m_fire *= 1f - (float)PotionsPlus.flaskOfElementsFireDamageTakenReduction.Value / 100f; hit.m_damage.m_lightning *= 1f - (float)PotionsPlus.flaskOfElementsLightningDamageTakenReduction.Value / 100f; } if (((Character)val).GetSEMan().HaveStatusEffect(StringExtensionMethods.GetStableHashCode("Flask_of_Fortification"))) { hit.m_damage.m_blunt *= 1f - (float)PotionsPlus.flaskOfFortificationBluntDamageTakenReduction.Value / 100f; hit.m_damage.m_slash *= 1f - (float)PotionsPlus.flaskOfFortificationSlashDamageTakenReduction.Value / 100f; hit.m_damage.m_pierce *= 1f - (float)PotionsPlus.flaskOfFortificationPierceDamageTakenReduction.Value / 100f; } } } } } [<e39e4b9e-0146-48e3-8151-bfa170435579>Nullable(0)] [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(1)] public class GroupPotion : SE_Stats { public static bool effectApplied; public DamageType damageType; public int range; public override void Setup(Character character) { //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: 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_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Invalid comparison between Unknown and I4 //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Invalid comparison between Unknown and I4 //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Invalid comparison between Unknown and I4 //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Invalid comparison between Unknown and I4 //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Invalid comparison between Unknown and I4 if ((int)damageType == 0) { return; } float chop = hitData.m_damage.m_chop; float pickaxe = hitData.m_damage.m_pickaxe; float num = hitData.GetTotalDamage() - pickaxe - chop; hitData.m_damage = new DamageTypes { m_chop = chop, m_pickaxe = pickaxe }; DamageType val = damageType; DamageType val2 = val; if ((int)val2 <= 64) { if ((int)val2 != 32) { if ((int)val2 == 64) { hitData.m_damage.m_frost = num; } } else { hitData.m_damage.m_fire = num; } } else if ((int)val2 != 128) { if ((int)val2 != 256) { if ((int)val2 == 512) { hitData.m_damage.m_spirit = num; } } else { hitData.m_damage.m_poison = num; } } else { hitData.m_damage.m_lightning = num; } } } [BepInPlugin("com.odinplus.potionsplus", "PotionsPlus", "4.1.16")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInIncompatibility("org.bepinex.plugins.valheim_plus")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInIncompatibility("shudnal.ExtraSlots")] [<e39e4b9e-0146-48e3-8151-bfa170435579>Nullable(0)] [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(1)] public class PotionsPlus : BaseUnityPlugin { [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(0)] private enum Toggle { On = 1, Off = 0 } [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(0)] [HarmonyPatch(typeof(Character), "SetHealth")] public static class PatchCharacterSetHealth { [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(1)] private static bool Prefix(ref Character __instance, float health) { if (!((Object)(object)__instance != (Object)(object)Player.m_localPlayer) && !(health > 0f)) { StatusEffect val = ((IEnumerable<StatusEffect>)((Character)Player.m_localPlayer).GetSEMan().GetStatusEffects()).FirstOrDefault((Func<StatusEffect, bool>)((StatusEffect se) => se.m_category == "pp_philstone")); if (val != null) { ((Character)Player.m_localPlayer).GetSEMan().RemoveStatusEffect(val, false); Inventory inventory = ((Humanoid)Player.m_localPlayer).GetInventory(); ItemData val2 = ((IEnumerable<ItemData>)inventory.GetAllItems()).FirstOrDefault((Func<ItemData, bool>)((ItemData i) => i.m_equipped && (int)i.m_shared.m_itemType == 18 && i.m_shared.m_equipStatusEffect.m_category == "pp_philstone")); if (val2 != null) { inventory.RemoveOneItem(val2); ((StatusEffect)CheatDeathStatusEffect).m_ttl = 6f; ((Character)Player.m_localPlayer).GetSEMan().AddStatusEffect((StatusEffect)(object)CheatDeathStatusEffect, false, 0, 0f); __instance.Heal(__instance.GetMaxHealth(), true); return false; } return true; } } return true; } } [HarmonyPatch(typeof(ZNet), "Awake")] [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(0)] private static class RegisterRPCPatch { private static void Postfix() { ZRoutedRpc.instance.Register<float>("PotionsPlus Raise Alchemy", (Action<long, float>)delegate(long _, float num) { ((Character)(object)Player.m_localPlayer).RaiseSkill("Alchemy", num); }); ZRoutedRpc.instance.Register<int>("PotionsPlus Alchemy Level", (Action<long, int>)delegate(long sender, int num) { SubmitAlchemyLevel.playerAlchemyLevels[sender] = num; }); ZRoutedRpc.instance.Register("PotionsPlus Alchemy Proc", (Action<long>)delegate { ((Character)Player.m_localPlayer).GetSEMan().AddStatusEffect((StatusEffect)(object)AlchemySkillProcStatusEffect, false, 0, 0f); }); ZRoutedRpc.instance.Register<string>("PotionsPlus Potion Activated", (Action<long, string>)onGroupPotionActivated); } } [<e39e4b9e-0146-48e3-8151-bfa170435579>Nullable(0)] [HarmonyPatch(typeof(Incinerator), "OnIncinerate")] 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] [<e39e4b9e-0146-48e3-8151-bfa170435579>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([<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>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; } } } [<e39e4b9e-0146-48e3-8151-bfa170435579>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 }); } } } [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>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]; } [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>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"); } } } [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(0)] [HarmonyPatch(typeof(Aoe), "OnHit")] private class HealingBrothEffect { [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(1)] private static bool Prefix(Collider collider, Vector3 hitPoint, Aoe __instance, ref bool __result) { //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) 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; } } [HarmonyPatch(typeof(RandomSpeak), "Start")] [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(0)] private class PreventGhostFromTalking { [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(1)] private static bool Prefix(RandomSpeak __instance) { return ((Component)__instance).gameObject.layer != Piece.s_ghostLayer; } } [HarmonyPatch(typeof(Attack), "Start")] [<e39e4b9e-0146-48e3-8151-bfa170435579>Nullable(0)] private class BypassAmmoCheck { private static void Prefix(Attack __instance, ItemData weapon, ref string __state) { GameObject dropPrefab = weapon.m_dropPrefab; if (((dropPrefab != null) ? ((Object)dropPrefab).name : null) == "Odins_Dragon_Staff") { GameObject spawnOnTrigger = __instance.m_spawnOnTrigger; if (((spawnOnTrigger != null) ? ((Object)spawnOnTrigger).name : null) == "Staff_Smoke_Cloud") { __state = weapon.m_shared.m_ammoType; weapon.m_shared.m_ammoType = ""; } } } private static void Finalizer(ItemData weapon, ref string __state) { if (__state != null) { weapon.m_shared.m_ammoType = __state; } } } [HarmonyPatch(typeof(Attack), "UseAmmo")] [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(0)] private class ReduceAmmoUsage { [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(1)] private static bool Prefix(Attack __instance, ref bool __result) { GameObject dropPrefab = __instance.m_weapon.m_dropPrefab; string text = ((dropPrefab != null) ? ((Object)dropPrefab).name : null); string text2 = text; if (!(text2 == "Odins_Dragon_Staff")) { if (!(text2 == "Odins_Alchemy_Wand")) { goto IL_00f8; } } else { GameObject spawnOnTrigger = __instance.m_spawnOnTrigger; if (((spawnOnTrigger != null) ? ((Object)spawnOnTrigger).name : null) == "Staff_Smoke_Cloud") { __result = true; return false; } } ItemData helmetItem = __instance.m_character.m_helmetItem; object obj; if (helmetItem == null) { obj = null; } else { GameObject dropPrefab2 = helmetItem.m_dropPrefab; obj = ((dropPrefab2 != null) ? ((Object)dropPrefab2).name : null); } if ((string?)obj == "Odins_Wizard_Hat") { ItemData ammoItem = __instance.m_character.GetInventory().GetAmmoItem(__instance.m_weapon.m_shared.m_ammoType, (string)null); if (ammoItem == null) { return true; } if (Random.value < wizardHatConsumeChargeReduction.Value / 100f) { __instance.m_ammoItem = ammoItem; __result = true; return false; } } goto IL_00f8; IL_00f8: return true; } } [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(0)] public class SmokescreenOwner : MonoBehaviour, IProjectile { [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(1)] public void Setup(Character owner, Vector3 velocity, float hitNoise, HitData hitData, ItemData item, ItemData ammo) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) ZDO zdo = ((Component)this).GetComponent<ZNetView>().m_zdo; zdo.Set("PotionsPlus SmokeCloud Owner", owner.GetZDOID()); zdo.Set("PotionsPlus SmokeCloud HatBonus", ((Component)owner).GetComponent<VisEquipment>().m_currentHelmetItemHash == StringExtensionMethods.GetStableHashCode("Odins_Warlock_Hat")); } public void Start() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) if (((Component)this).GetComponent<ZNetView>().m_zdo.GetBool("PotionsPlus SmokeCloud HatBonus", false)) { ParticleSystem[] componentsInChildren = ((Component)this).GetComponentsInChildren<ParticleSystem>(); foreach (ParticleSystem val in componentsInChildren) { ShapeModule shape = val.shape; ((ShapeModule)(ref shape)).radius = ((ShapeModule)(ref shape)).radius + warlockHatSmokeScreenSizeIncrease.Value; } SphereCollider componentInChildren = ((Component)this).GetComponentInChildren<SphereCollider>(); componentInChildren.radius += warlockHatSmokeScreenSizeIncrease.Value; TimedDestruction component = ((Component)this).GetComponent<TimedDestruction>(); ((MonoBehaviour)component).CancelInvoke("DestroyNow"); component.Trigger(smokeScreenTTL.Value + (float)warlockHatSmokeScreenDurationIncrease.Value); } } [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(1)] public string GetTooltipString(int itemQuality) { return ""; } } [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(0)] [HarmonyPatch(typeof(Projectile), "FixedUpdate")] private class SmokescreenHitBarrier { private static int ProjectileBlocker(int mask) { return mask | (1 << LayerMask.NameToLayer("blocker")); } [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>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)); } } } } [<e39e4b9e-0146-48e3-8151-bfa170435579>Nullable(0)] [HarmonyPatch(typeof(Projectile), "OnHit")] private class DestroyBlockedProjectile { private static bool Prefix(Projectile __instance, Collider collider, ref bool __state) { //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)collider) && ((Component)collider).gameObject.layer == LayerMask.NameToLayer("blocker")) { Transform parent = ((Component)collider).transform.parent; ZDO val = ((parent == null) ? null : ((Component)parent).GetComponent<ZNetView>()?.m_zdo); if (val != null) { GameObject obj = ZNetScene.instance.FindInstance(val.GetZDOID("PotionsPlus SmokeCloud Owner")); Character val2 = ((obj != null) ? obj.GetComponent<Character>() : null); if (val2 != null && !__instance.IsValidTarget((IDestructible)(object)val2)) { return false; } __state = true; Random.InitState((int)((ZDOID)(ref __instance.m_nview.m_zdo.m_uid)).ID); State state = Random.state; bool result = Random.value < (float)(smokeScreenChanceToBlock.Value + (val.GetBool("PotionsPlus SmokeCloud HatBonus", false) ? warlockHatSmokeScreenBlockIncrease.Value : 0)) / 100f; Random.state = state; return result; } } return true; } [HarmonyPriority(200)] private static void Postfix(Projectile __instance, Collider collider, bool __state) { if (__state && __instance != null && __instance.m_didHit && __instance.m_stayAfterHitStatic) { ZNetScene.instance.Destroy(((Component)__instance).gameObject); } } } [HarmonyPatch(typeof(Projectile), "SpawnOnHit")] [<e39e4b9e-0146-48e3-8151-bfa170435579>Nullable(0)] private class TransferDamageToAoeProjectile { private static IProjectile UpdateAoeProjectileDamage(IProjectile newProjectile, IProjectile spawning) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Expected O, but got Unknown //IL_0048: Unknown result type (might be due to invalid IL or missing references) string projectileName = ((Object)(Component)spawning).name; if (wandProjectiles.Any([<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>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.16"; private const string ModGUID = "com.odinplus.potionsplus"; private static readonly ConfigSync configSync = new ConfigSync("PotionsPlus") { DisplayName = "PotionsPlus", CurrentVersion = "4.1.16", MinimumRequiredVersion = "4.1.16" }; 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<[<e39e4b9e-0146-48e3-8151-bfa170435579>Nullable(2)] T>(string group, string name, T value, ConfigDescription description, bool synchronizedSetting = true) { ConfigEntry<T> val = ((BaseUnityPlugin)this).Config.Bind<T>(group, name, value, description); SyncedConfigEntry<T> syncedConfigEntry = configSync.AddConfigEntry<T>(val); syncedConfigEntry.SynchronizedConfig = synchronizedSetting; return val; } private ConfigEntry<T> config<[<e39e4b9e-0146-48e3-8151-bfa170435579>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_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Expected O, but got Unknown //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Expected O, but got Unknown //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Expected O, but got Unknown //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Expected O, but got Unknown //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Expected O, but got Unknown //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Expected O, but got Unknown //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Expected O, but got Unknown //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Expected O, but got Unknown //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Unknown result type (might be due to invalid IL or missing references) //IL_0287: Expected O, but got Unknown //IL_02b5: Unknown result type (might be due to invalid IL or missing references) //IL_02c0: Expected O, but got Unknown //IL_02ea: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: Expected O, but got Unknown //IL_0315: Unknown result type (might be due to invalid IL or missing references) //IL_0320: Expected O, but got Unknown //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Expected O, but got Unknown //IL_0383: Unknown result type (might be due to invalid IL or missing references) //IL_038e: Expected O, but got Unknown //IL_03bc: Unknown result type (might be due to invalid IL or missing references) //IL_03c7: Expected O, but got Unknown //IL_03f5: Unknown result type (might be due to invalid IL or missing references) //IL_0400: Expected O, but got Unknown //IL_042e: Unknown result type (might be due to invalid IL or missing references) //IL_0439: Expected O, but got Unknown //IL_0460: Unknown result type (might be due to invalid IL or missing references) //IL_046b: Expected O, but got Unknown //IL_048b: Unknown result type (might be due to invalid IL or missing references) //IL_0496: Expected O, but got Unknown //IL_04c4: Unknown result type (might be due to invalid IL or missing references) //IL_04cf: Expected O, but got Unknown //IL_04fd: Unknown result type (might be due to invalid IL or missing references) //IL_0508: Expected O, but got Unknown //IL_0528: Unknown result type (might be due to invalid IL or missing references) //IL_0533: Expected O, but got Unknown //IL_0561: Unknown result type (might be due to invalid IL or missing references) //IL_056c: Expected O, but got Unknown //IL_0596: Unknown result type (might be due to invalid IL or missing references) //IL_05a1: Expected O, but got Unknown //IL_05c1: Unknown result type (might be due to invalid IL or missing references) //IL_05cc: Expected O, but got Unknown //IL_05f6: Unknown result type (might be due to invalid IL or missing references) //IL_0601: Expected O, but got Unknown //IL_0625: Unknown result type (might be due to invalid IL or missing references) //IL_0630: Expected O, but got Unknown //IL_0654: Unknown result type (might be due to invalid IL or missing references) //IL_065f: Expected O, but got Unknown //IL_0686: Unknown result type (might be due to invalid IL or missing references) //IL_0691: Expected O, but got Unknown //IL_06b1: Unknown result type (might be due to invalid IL or missing references) //IL_06bc: Expected O, but got Unknown //IL_06ea: Unknown result type (might be due to invalid IL or missing references) //IL_06f5: Expected O, but got Unknown //IL_0723: Unknown result type (might be due to invalid IL or missing references) //IL_072e: Expected O, but got Unknown //IL_0758: Unknown result type (might be due to invalid IL or missing references) //IL_0763: Expected O, but got Unknown //IL_0783: Unknown result type (might be due to invalid IL or missing references) //IL_078e: Expected O, but got Unknown //IL_07b8: Unknown result type (might be due to invalid IL or missing references) //IL_07c3: Expected O, but got Unknown //IL_07e3: Unknown result type (might be due to invalid IL or missing references) //IL_07ee: Expected O, but got Unknown //IL_0818: Unknown result type (might be due to invalid IL or missing references) //IL_0823: Expected O, but got Unknown //IL_0843: Unknown result type (might be due to invalid IL or missing references) //IL_084e: Expected O, but got Unknown //IL_087c: Unknown result type (might be due to invalid IL or missing references) //IL_0887: Expected O, but got Unknown //IL_08b5: Unknown result type (might be due to invalid IL or missing references) //IL_08c0: Expected O, but got Unknown //IL_08ea: Unknown result type (might be due to invalid IL or missing references) //IL_08f5: Expected O, but got Unknown //IL_0915: Unknown result type (might be due to invalid IL or missing references) //IL_0920: Expected O, but got Unknown //IL_094a: Unknown result type (might be due to invalid IL or missing references) //IL_0955: Expected O, but got Unknown //IL_0975: Unknown result type (might be due to invalid IL or missing references) //IL_0980: Expected O, but got Unknown //IL_09aa: Unknown result type (might be due to invalid IL or missing references) //IL_09b5: Expected O, but got Unknown //IL_09d5: Unknown result type (might be due to invalid IL or missing references) //IL_09e0: Expected O, but got Unknown //IL_0a00: Unknown result type (might be due to invalid IL or missing references) //IL_0a0b: Expected O, but got Unknown //IL_0a2b: Unknown result type (might be due to invalid IL or missing references) //IL_0a36: Expected O, but got Unknown //IL_0a64: Unknown result type (might be due to invalid IL or missing references) //IL_0a6f: Expected O, but got Unknown //IL_0a8f: Unknown result type (might be due to invalid IL or missing references) //IL_0a9a: Expected O, but got Unknown //IL_0ac4: Unknown result type (might be due to invalid IL or missing references) //IL_0acf: Expected O, but got Unknown //IL_0af6: Unknown result type (might be due to invalid IL or missing references) //IL_0b01: Expected O, but got Unknown //IL_0b21: Unknown result type (might be due to invalid IL or missing references) //IL_0b2c: Expected O, but got Unknown //IL_0b56: Unknown result type (might be due to invalid IL or missing references) //IL_0b61: Expected O, but got Unknown //IL_0b88: Unknown result type (might be due to invalid IL or missing references) //IL_0b93: Expected O, but got Unknown //IL_0bb3: Unknown result type (might be due to invalid IL or missing references) //IL_0bbe: Expected O, but got Unknown //IL_0be8: Unknown result type (might be due to invalid IL or missing references) //IL_0bf3: Expected O, but got Unknown //IL_0c1a: Unknown result type (might be due to invalid IL or missing references) //IL_0c25: Expected O, but got Unknown //IL_0c53: Unknown result type (might be due to invalid IL or missing references) //IL_0c5e: Expected O, but got Unknown //IL_0c85: Unknown result type (might be due to invalid IL or missing references) //IL_0c90: Expected O, but got Unknown //IL_0cbe: Unknown result type (might be due to invalid IL or missing references) //IL_0cc9: Expected O, but got Unknown //IL_0cf0: Unknown result type (might be due to invalid IL or missing references) //IL_0cfb: Expected O, but got Unknown //IL_0d29: Unknown result type (might be due to invalid IL or missing references) //IL_0d34: Expected O, but got Unknown //IL_0d5b: Unknown result type (might be due to invalid IL or missing references) //IL_0d66: Expected O, but got Unknown //IL_0d94: Unknown result type (might be due to invalid IL or missing references) //IL_0d9f: Expected O, but got Unknown //IL_0dc6: Unknown result type (might be due to invalid IL or missing references) //IL_0dd1: Expected O, but got Unknown //IL_0dff: Unknown result type (might be due to invalid IL or missing references) //IL_0e0a: Expected O, but got Unknown //IL_0e31: Unknown result type (might be due to invalid IL or missing references) //IL_0e3c: Expected O, but got Unknown //IL_0e6a: Unknown result type (might be due to invalid IL or missing references) //IL_0e75: Expected O, but got Unknown //IL_0ea3: Unknown result type (might be due to invalid IL or missing references) //IL_0eae: Expected O, but got Unknown //IL_0ed1: Unknown result type (might be due to invalid IL or missing references) //IL_0edc: Expected O, but got Unknown //IL_0f00: Unknown result type (might be due to invalid IL or missing references) //IL_0f0b: Expected O, but got Unknown //IL_0f2f: Unknown result type (might be due to invalid IL or missing references) //IL_0f3a: Expected O, but got Unknown //IL_0f68: Unknown result type (might be due to invalid IL or missing references) //IL_0f73: Expected O, but got Unknown //IL_0f96: Unknown result type (might be due to invalid IL or missing references) //IL_0fa1: Expected O, but got Unknown //IL_0fcf: Unknown result type (might be due to invalid IL or missing references) //IL_0fda: Expected O, but got Unknown //IL_140a: Unknown result type (might be due to invalid IL or missing references) //IL_1410: Expected O, but got Unknown 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, [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(0)] (int ttl) => ((float)ttl / 60f).ToString("0.#")); Localizer.AddPlaceholder("pp_flask_secondwind_description", "duration", flaskOfSecondWindTTL, [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(0)] (int ttl) => ((float)ttl / 60f).ToString("0.#")); Localizer.AddPlaceholder("pp_flask_fort_description", "duration", flaskOfFortificationTTL, [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>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(); Harmony val2 = new Harmony("com.odinplus.potionsplus"); val2.PatchAll(executingAssembly); CheatDeathStatusEffect = val.LoadAsset<SE_Stats>("CheatDeath"); AlchemySkillProcStatusEffect = val.LoadAsset<SE_Stats>("AlcSkillProc"); PrefabManager.RegisterPrefab(val, "PP_sfx_rebirth"); PrefabManager.RegisterPrefab(val, "PP_sfx_stoneuse"); PrefabManager.RegisterPrefab(val, "PP_sfx_brewpotiondone"); PrefabManager.RegisterPrefab(val, "PP_sfx_potion_smash"); PrefabManager.RegisterPrefab(val, "PP_sfx_brewpotion"); PrefabManager.RegisterPrefab(val, "PP_vfx_potionhit"); PrefabManager.RegisterPrefab(val, "sfx_build_alchemy"); PrefabManager.RegisterPrefab(val, "VFX_RedPotionDrink"); PrefabManager.RegisterPrefab(val, "VFX_GreenPotionDrink"); PrefabManager.RegisterPrefab(val, "VFX_BluePotionDrink"); PrefabManager.RegisterPrefab(val, "VFX_PurplePotionDrink"); PrefabManager.RegisterPrefab(val, "VFX_StonePurple"); PrefabManager.RegisterPrefab(val, "VFX_StoneBlue"); PrefabManager.RegisterPrefab(val, "VFX_StoneGreen"); PrefabManager.RegisterPrefab(val, "potionaudio"); } public static string SanitizeText(string input) { return Regex.Replace(input, "[\\p{C}-[\\r\\n\\t]]+", ""); } 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 { [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>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 = new BuildPiece(assets, "opcauldron"); buildPiece.RequiredItems.Add("Iron", 4, recover: true); buildPiece.Category.Set(BuildPieceCategory.Crafting); buildPiece = new BuildPiece(assets, "Odins_Alchemy_Book"); buildPiece.RequiredItems.Add("WitheredBone", 1, recover: true); buildPiece.RequiredItems.Add("SurtlingCore", 2, recover: true); buildPiece.RequiredItems.Add("Iron", 4, recover: true); buildPiece.Category.Set(BuildPieceCategory.Crafting); } } public static class EquipmentSetup { [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>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 = new Item(assets, "Odins_Wizard_Hat"); item.Crafting.Add(ItemManager.CraftingTable.Workbench, 5); item.MaximumRequiredStationLevel = 5; item.RequiredItems.Add("LinenThread", 20); item.RequiredItems.Add("SurtlingCore", 5); item.RequiredUpgradeItems.Add("LinenThread", 10); item.RequiredUpgradeItems.Add("SurtlingCore", 2); item = new Item(assets, "Odins_Warlock_Hat"); item.Crafting.Add(ItemManager.CraftingTable.Workbench, 5); item.MaximumRequiredStationLevel = 5; item.RequiredItems.Add("LinenThread", 20); item.RequiredItems.Add("SurtlingCore", 5); item.RequiredUpgradeItems.Add("LinenThread", 10); item.RequiredUpgradeItems.Add("SurtlingCore", 2); item = new Item(assets, "Odins_Dragon_Staff"); item.Crafting.Add(ItemManager.CraftingTable.Workbench, 3); item.MaximumRequiredStationLevel = 5; item.RequiredItems.Add("Odins_Alchemy_Wand", 1); item.RequiredItems.Add("ElderBark", 40); item.RequiredItems.Add("BlackMetal", 40); item.RequiredItems.Add("SurtlingCore", 1); item.RequiredUpgradeItems.Add("ElderBark", 20); item.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 { [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(1)] public static void initializeGroupPotions(AssetBundle assets) { //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_0371: Unknown result type (might be due to invalid IL or missing references) //IL_043d: Unknown result type (might be due to invalid IL or missing references) //IL_04f9: Unknown result type (might be due to invalid IL or missing references) //IL_05c8: 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, [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(1)] (SE_Stats effect, int value) => { ((StatusEffect)effect).m_ttl = value; }, PotionsPlus.brewOfFaintGroupHealingCooldown); Utils.SEValue(item, [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>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, [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(1)] (SE_Stats effect, int value) => { ((StatusEffect)effect).m_ttl = value; }, PotionsPlus.brewOfGroupHealingCooldown); Utils.SEValue(item, [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>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, [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(1)] (SE_Stats effect, int value) => { ((StatusEffect)effect).m_ttl = value; }, PotionsPlus.brewOfGrandGroupHealingCooldown); Utils.SEValue(item, [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>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, [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(1)] (SE_Stats effect, float value) => { ((StatusEffect)effect).m_ttl = value; }, PotionsPlus.brewOfCunningToxicityTTL); Utils.SEValue(item, [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>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, [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(1)] (SE_Stats effect, float value) => { ((StatusEffect)effect).m_ttl = value; }, PotionsPlus.brewOfFieryRevengeTTL); Utils.SEValue(item, [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>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, [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(1)] (SE_Stats effect, float value) => { ((StatusEffect)effect).m_ttl = value; }, PotionsPlus.brewOfIcyTouchTTL); Utils.SEValue(item, [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>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, [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(1)] (SE_Stats effect, float value) => { ((StatusEffect)effect).m_ttl = value; }, PotionsPlus.brewOfSpiritualDeathTTL); Utils.SEValue(item, [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>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, [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(1)] (SE_Stats effect, float value) => { ((StatusEffect)effect).m_ttl = value; }, PotionsPlus.brewOfThunderousWordsTTL); Utils.SEValue(item, [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(1)] (SE_Stats effect, int value) => { ((GroupPotion)(object)effect).range = value; }, PotionsPlus.brewOfThunderousWordsRange); } } public static class HellbrothSetup { [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>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 = new Item(assets, "Hellbroth_of_Frost"); item.Crafting.Add("opalchemy", 2); item.RequiredItems.Add("FreezeGland", 4); item.RequiredItems.Add("Chain", 1); item.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"); item2 = new Item(assets, "Hellbroth_of_Frost_Charge"); item2.Crafting.Add("opcauldron", 1); item2.CraftAmount = 2; item2.RequiredItems.Add("Hellbroth_of_Frost", 3); item2.Configurable = Configurability.Recipe; item = new Item(assets, "Hellbroth_of_Thors_Fury"); item.Crafting.Add("opalchemy", 2); item.RequiredItems.Add("Tar", 6); item.RequiredItems.Add("Thunderstone", 1); item.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"); item2 = new Item(assets, "Hellbroth_of_Thors_Fury_Charge"); item2.Crafting.Add("opcauldron", 1); item2.CraftAmount = 2; item2.RequiredItems.Add("Hellbroth_of_Thors_Fury", 3); item2.Configurable = Configurability.Recipe; item = new Item(assets, "Hellbroth_of_Eternal_Life"); item.Crafting.Add("opalchemy", 2); item.RequiredItems.Add("Honey", 5); item.RequiredItems.Add("Dandelion", 3); item.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"); item2 = new Item(assets, "Hellbroth_of_Eternal_Life_Charge"); item2.Crafting.Add("opcauldron", 1); item2.CraftAmount = 2; item2.RequiredItems.Add("Hellbroth_of_Eternal_Life", 3); item2.Configurable = Configurability.Recipe; } } public static class PhilosophersSetup { [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>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); item2 = new Item(assets, "PhilosopherStoneGreen"); item2.Crafting.Add("opcauldron", 1); item2.RequiredItems.Add("Flask_of_Fortification", 5); AddStatusEffectModifier(item2); item2 = new Item(assets, "PhilosopherStoneRed"); item2.Crafting.Add("opcauldron", 1); item2.RequiredItems.Add("Flask_of_the_Gods", 5); AddStatusEffectModifier(item2); item2 = new Item(assets, "PhilosopherStonePurple"); item2.Crafting.Add("opcauldron", 1); item2.RequiredItems.Add("Flask_of_Second_Wind", 5); AddStatusEffectModifier(item2); AddStatusEffectModifier(new Item(assets, "PhilosopherStoneBlack")); [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(1)] static void AddStatusEffectModifier(Item item) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) 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 { [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(1)] public static void initializePotions(AssetBundle assets) { //IL_095f: Unknown result type (might be due to invalid IL or missing references) //IL_0a35: Unknown result type (might be due to invalid IL or missing references) //IL_0be8: Unknown result type (might be due to invalid IL or missing references) //IL_0cab: 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, [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(1)] (SE_Stats effect, int value) => { ((StatusEffect)effect).m_ttl = value; }, PotionsPlus.flaskOfElementsTTL); item = new Item(assets, "Flask_of_Fortification"); item.Crafting.Add("opalchemy", 2); item.RequiredItems.Add("Potion_Meadbase", 1); item.RequiredItems.Add("Obsidian", 2); item.RequiredItems.Add("Flint", 4); item.RequiredItems.Add("Stone", 8); Utils.SEValue(item, [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(1)] (SE_Stats effect, int value) => { ((StatusEffect)effect).m_ttl = value; }, PotionsPlus.flaskOfFortificationTTL); item = new Item(assets, "Flask_of_the_Gods"); item.Crafting.Add("opalchemy", 2); item.RequiredItems.Add("Potion_Meadbase", 1); item.RequiredItems.Add("Thistle", 4); item.RequiredItems.Add("Flax", 4); item.RequiredItems.Add("Carrot", 2); Utils.SEValue(item, [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(1)] (SE_Stats effect, int value) => { ((StatusEffect)effect).m_ttl = value; }, PotionsPlus.flaskOfGodsTTL); Utils.SEValue(item, [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(1)] (SE_Stats effect, float value) => { effect.m_healthOverTime = value; }, PotionsPlus.flaskOfGodsHealing); Utils.SEValue(item, [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(1)] (SE_Stats effect, float value) => { effect.m_healthRegenMultiplier = value; }, PotionsPlus.flaskOfGodsRegenMultiplier); item = new Item(assets, "Flask_of_Magelight"); item.Crafting.Add("opalchemy", 2); item.RequiredItems.Add("Potion_Meadbase", 1); item.RequiredItems.Add("BoneFragments", 4); item.RequiredItems.Add("FreezeGland", 4); item.RequiredItems.Add("GreydwarfEye", 8); Utils.SEValue(item, [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>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 = new Item(assets, "Flask_of_Second_Wind"); item.Crafting.Add("opalchemy", 2); item.RequiredItems.Add("Potion_Meadbase", 1); item.RequiredItems.Add("Ooze", 4); item.RequiredItems.Add("FreezeGland", 2); item.RequiredItems.Add("Feathers", 6); Utils.SEValue(item, [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(1)] (SE_Stats effect, int value) => { ((StatusEffect)effect).m_ttl = value; }, PotionsPlus.flaskOfSecondWindTTL); Utils.SEValue(item, [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(1)] (SE_Stats effect, float value) => { effect.m_jumpStaminaUseModifier = 1f - value; }, PotionsPlus.flaskOfSecondWindJumpStaminaFactor); Utils.SEValue(item, [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(1)] (SE_Stats effect, float value) => { effect.m_runStaminaDrainModifier = 1f - value; }, PotionsPlus.flaskOfSecondWindRunStaminaFactor); Utils.SEValue(item, [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(1)] (SE_Stats effect, float value) => { effect.m_staminaRegenMultiplier = value; }, PotionsPlus.flaskOfSecondWindStaminaRegenMultiplier); item = new Item(assets, "Grand_Healing_Tide_Potion"); item.Crafting.Add("opalchemy", 2); item.RequiredItems.Add("Ooze", 2); item.RequiredItems.Add("Barley", 4); item.RequiredItems.Add("Needle", 2); item.RequiredItems.Add("Cloudberry", 6); Utils.SEValue(item, [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(1)] (SE_Stats effect, float value) => { effect.m_healthOverTime = value; }, PotionsPlus.grandHealingTidePotionHealthOverTime); Utils.SEValue(item, [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(1)] (SE_Stats effect, float value) => { effect.m_healthOverTimeDuration = value; }, PotionsPlus.grandHealingTidePotionTTL); Utils.SEValue(item, [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(1)] (SE_Stats effect, float value) => { effect.m_healthOverTimeInterval = value; }, PotionsPlus.grandHealingTidePotionTickInterval); item = new Item(assets, "Grand_Spiritual_Healing_Potion"); item.Crafting.Add("opalchemy", 2); item.RequiredItems.Add("Ooze", 4); item.RequiredItems.Add("Flax", 4); item.RequiredItems.Add("WolfFang", 2); item.RequiredItems.Add("Cloudberry", 6); Utils.SEValue(item, [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(1)] (SE_Stats effect, int value) => { ((StatusEffect)effect).m_ttl = value; }, PotionsPlus.grandSpiritualHealingPotionCooldown); Utils.SEValue(item, [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(1)] (SE_Stats effect, float value) => { effect.m_healthOverTime = value; }, PotionsPlus.grandSpiritualHealingPotionHealthOverTime); item = new Item(assets, "Grand_Stamina_Elixir"); item.Crafting.Add("opalchemy", 2); item.RequiredItems.Add("LoxMeat", 2); item.RequiredItems.Add("Carrot", 4); item.RequiredItems.Add("Turnip", 4); item.RequiredItems.Add("Cloudberry", 8); Utils.SEValue(item, [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(1)] (SE_Stats effect, int value) => { ((StatusEffect)effect).m_ttl = value; }, PotionsPlus.grandStaminaElixirCooldown); Utils.SEValue(item, [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(1)] (SE_Stats effect, float value) => { effect.m_staminaOverTime = value; }, PotionsPlus.grandStaminaElixirStaminaOverTime); Utils.SEValue(item, [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(1)] (SE_Stats effect, float value) => { effect.m_staminaOverTimeDuration = value; }, PotionsPlus.grandStaminaElixirTTL); item = new Item(assets, "Grand_Stealth_Elixir"); item.Crafting.Add("opalchemy", 2); item.RequiredItems.Add("FreezeGland", 2); item.RequiredItems.Add("Flax", 4); item.RequiredItems.Add("Feathers", 2); item.RequiredItems.Add("Carrot", 2); Utils.SEValue(item, [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(1)] (SE_Stats effect, int value) => { ((StatusEffect)effect).m_ttl = value; }, PotionsPlus.grandStealthElixirTTL); Utils.SEValue(item, [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(1)] (SE_Stats effect, int value) => { effect.m_noiseModifier = (float)(-value) / 100f; }, PotionsPlus.grandStealthElixirNoiseReduction); Utils.SEValue(item, [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(1)] (SE_Stats effect, int value) => { effect.m_stealthModifier = (float)(-value) / 100f; }, PotionsPlus.grandStealthElixirVisibilityReduction); item = new Item(assets, "Medium_Healing_Tide_Flask"); item.Crafting.Add("opalchemy", 1); item.RequiredItems.Add("Resin", 6); item.RequiredItems.Add("Blueberries", 4); item.RequiredItems.Add("Bloodbag", 2); Utils.SEValue(item, [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(1)] (SE_Stats effect, int value) => { ((StatusEffect)effect).m_ttl = value; }, PotionsPlus.mediumHealingTideFlaskCooldown); Utils.SEValue(item, [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(1)] (SE_Stats effect, float value) => { effect.m_healthOverTime = value; }, PotionsPlus.mediumHealingTideFlaskHealthOverTime); Utils.SEValue(item, [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(1)] (SE_Stats effect, float value) => { effect.m_healthOverTimeDuration = value; }, PotionsPlus.mediumHealingTideFlaskTTL); Utils.SEValue(item, [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(1)] (SE_Stats effect, float value) => { effect.m_healthOverTimeInterval = value; }, PotionsPlus.mediumHealingTideFlaskTickInterval); item = new Item(assets, "Medium_Spiritual_Healing_Flask"); item.Crafting.Add("opalchemy", 1); item.RequiredItems.Add("Ooze", 2); item.RequiredItems.Add("BoneFragments", 4); item.RequiredItems.Add("Bloodbag", 2); Utils.SEValue(item, [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(1)] (SE_Stats effect, int value) => { ((StatusEffect)effect).m_ttl = value; }, PotionsPlus.mediumSpiritualHealingFlaskCooldown); Utils.SEValue(item, [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(1)] (SE_Stats effect, float value) => { effect.m_healthOverTime = value; }, PotionsPlus.mediumSpiritualHealingFlaskHealthOverTime); ((SE_Stats)item.Prefab.GetComponent<ItemDrop>().m_itemData.m_shared.m_consumeStatusEffect).m_healthOverTimeDuration = 1f; item = new Item(assets, "Medium_Stamina_Flask"); item.Crafting.Add("opalchemy", 1); item.RequiredItems.Add("Resin", 4); item.RequiredItems.Add("Blueberries", 4); item.RequiredItems.Add("Bloodbag", 2); Utils.SEValue(item, [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(1)] (SE_Stats effect, int value) => { ((StatusEffect)effect).m_ttl = value; }, PotionsPlus.mediumStaminaFlaskCooldown); Utils.SEValue(item, [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(1)] (SE_Stats effect, float value) => { effect.m_staminaOverTime = value; }, PotionsPlus.mediumStaminaFlaskStaminaOverTime); ((SE_Stats)item.Prefab.GetComponent<ItemDrop>().m_itemData.m_shared.m_consumeStatusEffect).m_staminaOverTimeDuration = 1f; item = new Item(assets, "Lesser_Healing_Tide_Vial"); item.Crafting.Add("opalchemy", 1); item.RequiredItems.Add("Honey", 2); item.RequiredItems.Add("Raspberry", 4); Utils.SEValue(item, [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(1)] (SE_Stats effect, int value) => { ((StatusEffect)effect).m_ttl = value; }, PotionsPlus.lesserHealingTideVialCooldown); Utils.SEValue(item, [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(1)] (SE_Stats effect, float value) => { effect.m_healthOverTime = value; }, PotionsPlus.lesserHealingTideVialHealthOverTime); Utils.SEValue(item, [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(1)] (SE_Stats effect, float value) => { effect.m_healthOverTimeDuration = value; }, PotionsPlus.lesserHealingTideVialTTL); Utils.SEValue(item, [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(1)] (SE_Stats effect, float value) => { effect.m_healthOverTimeInterval = value; }, PotionsPlus.lesserHealingTideVialTickInterval); item = new Item(assets, "Lesser_Spiritual_Healing_Vial"); item.Crafting.Add("opalchemy", 1); item.RequiredItems.Add("Dandelion", 2); item.RequiredItems.Add("Raspberry", 4); Utils.SEValue(item, [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(1)] (SE_Stats effect, int value) => { ((StatusEffect)effect).m_ttl = value; }, PotionsPlus.lesserSpiritualHealingVialCooldown); Utils.SEValue(item, [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(1)] (SE_Stats effect, float value) => { effect.m_healthOverTime = value; }, PotionsPlus.lesserSpiritualHealingVialHealthOverTime); ((SE_Stats)item.Prefab.GetComponent<ItemDrop>().m_itemData.m_shared.m_consumeStatusEffect).m_healthOverTimeDuration = 1f; item = new Item(assets, "Lesser_Stamina_Vial"); item.Crafting.Add("opalchemy", 1); item.RequiredItems.Add("Honey", 2); item.RequiredItems.Add("Mushroom", 4); Utils.SEValue(item, [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(1)] (SE_Stats effect, int value) => { ((StatusEffect)effect).m_ttl = value; }, PotionsPlus.lesserStaminaVialCooldown); Utils.SEValue(item, [<88e4718b-b4e9-47c6-bea8-57dbfe0eafb4>NullableContext(1)] (SE_Stats effect, float value) => { effect.m_staminaOverTime = value; }, PotionsPlus.lesserStaminaVialStaminaOverTime); ((SE_Stats)i