Decompiled source of LoLItems v1.2.0

LoLItems.dll

Decompiled 4 months ago
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using LoLItems;
using Microsoft.CodeAnalysis;
using On.RoR2;
using On.RoR2.Items;
using On.RoR2.UI;
using R2API;
using R2API.Utils;
using RoR2;
using RoR2.Orbs;
using RoR2.UI;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;
using UnityEngine.Rendering;

[assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = ".NET Standard 2.0")]
[assembly: AssemblyCompany("LoLItems")]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: AssemblyProduct("LoLItems")]
[assembly: AssemblyTitle("LoLItems")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[Microsoft.CodeAnalysis.Embedded]
	[CompilerGenerated]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
public static class Assets
{
	public static AssetBundle icons;

	public static AssetBundle prefabs;

	public const string iconsName = "icons";

	public const string prefabsName = "prefabs";

	public static string IconAssetBundlePath => Path.Combine(Path.GetDirectoryName(global::LoLItems.LoLItems.PInfo.Location), "icons");

	public static string PrefabAssetBundlePath => Path.Combine(Path.GetDirectoryName(global::LoLItems.LoLItems.PInfo.Location), "prefabs");

	public static void Init()
	{
		icons = AssetBundle.LoadFromFile(IconAssetBundlePath);
		prefabs = AssetBundle.LoadFromFile(PrefabAssetBundlePath);
	}
}
internal class MyNetworkComponent : NetworkBehaviour
{
	private static MyNetworkComponent _instance;

	private static int kTargetRpcTargetSyncDictionary;

	private void Awake()
	{
		_instance = this;
	}

	public static void Invoke(NetworkUser user, NetworkInstanceId netId, float value, string dictToken)
	{
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		_instance.CallTargetSyncDictionary(((NetworkBehaviour)user).connectionToClient, netId, value, dictToken);
	}

	[TargetRpc]
	private void TargetSyncDictionary(NetworkConnection target, NetworkInstanceId netId, float value, string dictToken)
	{
		//IL_0010: Unknown result type (might be due to invalid IL or missing references)
		global::LoLItems.LoLItems.networkMappings.TryGetValue(dictToken, out var value2);
		NetworkManager.GetCharacterMasterFromNetId(netId, out var characterMaster);
		if (value2 != null && (Object)(object)characterMaster != (Object)null && !NetworkServer.active)
		{
			Utilities.SetValueInDictionary(ref value2, characterMaster, value, dictToken);
		}
	}

	private void UNetVersion()
	{
	}

	protected static void InvokeRpcTargetSyncDictionary(NetworkBehaviour obj, NetworkReader reader)
	{
		//IL_0022: Unknown result type (might be due to invalid IL or missing references)
		if (!NetworkClient.active)
		{
			Debug.LogError((object)"TargetRPC TargetSyncDictionary called on server.");
		}
		else
		{
			((MyNetworkComponent)(object)obj).TargetSyncDictionary(ClientScene.readyConnection, reader.ReadNetworkId(), reader.ReadSingle(), reader.ReadString());
		}
	}

	public void CallTargetSyncDictionary(NetworkConnection target, NetworkInstanceId netId, float value, string dictToken)
	{
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Expected O, but got Unknown
		//IL_0058: 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)
		if (!NetworkServer.active)
		{
			Debug.LogError((object)"TargetRPC Function TargetSyncDictionary called on client.");
			return;
		}
		if (target is ULocalConnectionToServer)
		{
			Debug.LogError((object)"TargetRPC Function TargetSyncDictionary called on connection to server");
			return;
		}
		NetworkWriter val = new NetworkWriter();
		val.Write((short)0);
		val.Write((short)2);
		val.WritePackedUInt32((uint)kTargetRpcTargetSyncDictionary);
		val.Write(((Component)this).GetComponent<NetworkIdentity>().netId);
		val.Write(netId);
		val.Write(value);
		val.Write(dictToken);
		((NetworkBehaviour)this).SendTargetRPCInternal(target, val, 0, "TargetSyncDictionary");
	}

	static MyNetworkComponent()
	{
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		//IL_002a: Expected O, but got Unknown
		kTargetRpcTargetSyncDictionary = 1824529895;
		NetworkBehaviour.RegisterRpcDelegate(typeof(MyNetworkComponent), kTargetRpcTargetSyncDictionary, new CmdDelegate(InvokeRpcTargetSyncDictionary));
		NetworkCRC.RegisterBehaviour("MyNetworkComponent", 0);
	}

	public override bool OnSerialize(NetworkWriter writer, bool forceAll)
	{
		bool result = default(bool);
		return result;
	}

	public override void OnDeserialize(NetworkReader reader, bool initialState)
	{
	}
}
namespace ExamplePlugin
{
	internal static class Log
	{
		internal static ManualLogSource _logSource;

		internal static void Init(ManualLogSource logSource)
		{
			_logSource = logSource;
		}

		internal static void LogDebug(object data)
		{
			_logSource.LogDebug(data);
		}

		internal static void LogError(object data)
		{
			_logSource.LogError(data);
		}

		internal static void LogFatal(object data)
		{
			_logSource.LogFatal(data);
		}

		internal static void LogInfo(object data)
		{
			_logSource.LogInfo(data);
		}

		internal static void LogMessage(object data)
		{
			_logSource.LogMessage(data);
		}

		internal static void LogWarning(object data)
		{
			_logSource.LogWarning(data);
		}
	}
}
namespace LoLItems
{
	internal class BannerOfCommand
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static hook_TakeDamage <>9__24_0;

			internal void <hooks>b__24_0(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo)
			{
				//IL_0066: Unknown result type (might be due to invalid IL or missing references)
				if (Object.op_Implicit((Object)(object)damageInfo.attacker))
				{
					CharacterBody component = damageInfo.attacker.GetComponent<CharacterBody>();
					object obj;
					if (component == null)
					{
						obj = null;
					}
					else
					{
						CharacterMaster master = component.master;
						if (master == null)
						{
							obj = null;
						}
						else
						{
							MinionOwnership minionOwnership = master.minionOwnership;
							obj = ((minionOwnership != null) ? minionOwnership.ownerMaster : null);
						}
					}
					CharacterMaster val = (CharacterMaster)obj;
					if (Object.op_Implicit((Object)(object)((val != null) ? val.inventory : null)))
					{
						int itemCount = val.inventory.GetItemCount(myItemDef.itemIndex);
						if (itemCount > 0)
						{
							float num = 1f + (float)itemCount * damagePercentAmp.Value / 100f;
							Utilities.AddValueInDictionary(ref bonusDamageDealt, val, num * damageInfo.damage, bonusDamageDealtToken);
							damageInfo.damage *= num;
						}
					}
				}
				orig.Invoke(self, damageInfo);
			}
		}

		public static ItemDef myItemDef;

		public static Dictionary<NetworkInstanceId, float> bonusDamageDealt = new Dictionary<NetworkInstanceId, float>();

		public static string bonusDamageDealtToken = "BannerOfCommand.bonusDamageDealt";

		public static Dictionary<ItemInventoryDisplay, CharacterMaster> DisplayToMasterRef = new Dictionary<ItemInventoryDisplay, CharacterMaster>();

		public static Dictionary<ItemIcon, CharacterMaster> IconToMasterRef = new Dictionary<ItemIcon, CharacterMaster>();

		public static ConfigEntry<float> damagePercentAmp { get; set; }

		public static ConfigEntry<bool> enabled { get; set; }

		public static ConfigEntry<string> rarity { get; set; }

		public static ConfigEntry<string> voidItems { get; set; }

		internal static void Init()
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Expected O, but got Unknown
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Expected O, but got Unknown
			LoadConfig();
			if (enabled.Value)
			{
				CreateItem();
				AddTokens();
				ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null);
				ItemAPI.Add(new CustomItem(myItemDef, val));
				hooks();
				Utilities.SetupReadOnlyHooks(DisplayToMasterRef, IconToMasterRef, myItemDef, GetDisplayInformation, rarity, voidItems, "BannerOfCommand");
				SetupNetworkMappings();
			}
		}

		private static void LoadConfig()
		{
			enabled = LoLItems.MyConfig.Bind<bool>("BannerOfCommand", "Enabled", true, "Determines if the item should be loaded by the game.");
			rarity = LoLItems.MyConfig.Bind<string>("BannerOfCommand", "Rarity", "Tier1Def", "Set the rarity of the item. Valid values: Tier1Def, Tier2Def, Tier3Def, VoidTier1Def, VoidTier2Def, and VoidTier3Def.");
			voidItems = LoLItems.MyConfig.Bind<string>("BannerOfCommand", "Void Items", "", "Set regular items to convert into this void item (Only if the rarity is set as a void tier). Items should be separated by a comma, no spaces. The item should be the in game item ID, which may differ from the item name.");
			damagePercentAmp = LoLItems.MyConfig.Bind<float>("BannerOfCommand", "Damage Amp", 10f, "Amount of damage amp each stack will grant.");
		}

		private static void CreateItem()
		{
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			myItemDef = ScriptableObject.CreateInstance<ItemDef>();
			((Object)myItemDef).name = "BannerOfCommand";
			myItemDef.nameToken = "BannerOfCommand";
			myItemDef.pickupToken = "BannerOfCommandItem";
			myItemDef.descriptionToken = "BannerOfCommandDesc";
			myItemDef.loreToken = "BannerOfCommandLore";
			myItemDef._itemTierDef = Addressables.LoadAssetAsync<ItemTierDef>((object)Utilities.GetRarityFromString(rarity.Value)).WaitForCompletion();
			myItemDef.pickupIconSprite = Assets.icons.LoadAsset<Sprite>("BannerOfCommandIcon");
			myItemDef.pickupModelPrefab = Assets.prefabs.LoadAsset<GameObject>("BannerOfCommandPrefab");
			myItemDef.canRemove = true;
			myItemDef.hidden = false;
			myItemDef.tags = (ItemTag[])(object)new ItemTag[1] { (ItemTag)1 };
		}

		private static void hooks()
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Expected O, but got Unknown
			object obj = <>c.<>9__24_0;
			if (obj == null)
			{
				hook_TakeDamage val = delegate(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo)
				{
					//IL_0066: Unknown result type (might be due to invalid IL or missing references)
					if (Object.op_Implicit((Object)(object)damageInfo.attacker))
					{
						CharacterBody component = damageInfo.attacker.GetComponent<CharacterBody>();
						object obj2;
						if (component == null)
						{
							obj2 = null;
						}
						else
						{
							CharacterMaster master = component.master;
							if (master == null)
							{
								obj2 = null;
							}
							else
							{
								MinionOwnership minionOwnership = master.minionOwnership;
								obj2 = ((minionOwnership != null) ? minionOwnership.ownerMaster : null);
							}
						}
						CharacterMaster val2 = (CharacterMaster)obj2;
						if (Object.op_Implicit((Object)(object)((val2 != null) ? val2.inventory : null)))
						{
							int itemCount = val2.inventory.GetItemCount(myItemDef.itemIndex);
							if (itemCount > 0)
							{
								float num = 1f + (float)itemCount * damagePercentAmp.Value / 100f;
								Utilities.AddValueInDictionary(ref bonusDamageDealt, val2, num * damageInfo.damage, bonusDamageDealtToken);
								damageInfo.damage *= num;
							}
						}
					}
					orig.Invoke(self, damageInfo);
				};
				<>c.<>9__24_0 = val;
				obj = (object)val;
			}
			HealthComponent.TakeDamage += (hook_TakeDamage)obj;
		}

		private static (string, string) GetDisplayInformation(CharacterMaster masterRef)
		{
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)masterRef == (Object)null)
			{
				return (Language.GetString(myItemDef.descriptionToken), "");
			}
			string text = "";
			float value;
			return new ValueTuple<string, string>(item2: (!bonusDamageDealt.TryGetValue(((NetworkBehaviour)masterRef).netId, out value)) ? (text + "<br><br>Damage dealt: 0") : (text + "<br><br>Damage dealt: " + $"{value:#}"), item1: Language.GetString(myItemDef.descriptionToken));
		}

		private static void AddTokens()
		{
			LanguageAPI.Add("BannerOfCommand", "BannerOfCommand");
			LanguageAPI.Add("BannerOfCommandItem", "Increase allied minion damage");
			LanguageAPI.Add("BannerOfCommandDesc", "Increase the damage of allied minions by <style=cIsUtility>" + damagePercentAmp.Value + "%</style> <style=cStack>(+" + damagePercentAmp.Value + "%)</style>");
			LanguageAPI.Add("BannerOfCommandLore", "Split pushing is boring.");
		}

		public static void SetupNetworkMappings()
		{
			LoLItems.networkMappings.Add(bonusDamageDealtToken, bonusDamageDealt);
		}
	}
	internal class Bork
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static Func<CharacterMaster, (string, string)> <0>__GetDisplayInformation;

			public static StatHookEventHandler <1>__RecalculateStatsAPI_GetStatCoefficients;
		}

		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static hook_OnHitEnemy <>9__54_0;

			internal void <hooks>b__54_0(orig_OnHitEnemy orig, GlobalEventManager self, DamageInfo damageInfo, GameObject victim)
			{
				//IL_006a: Unknown result type (might be due to invalid IL or missing references)
				//IL_010b: Unknown result type (might be due to invalid IL or missing references)
				//IL_019f: Unknown result type (might be due to invalid IL or missing references)
				//IL_01be: Unknown result type (might be due to invalid IL or missing references)
				//IL_0209: Unknown result type (might be due to invalid IL or missing references)
				orig.Invoke(self, damageInfo, victim);
				if (!NetworkServer.active || !Object.op_Implicit((Object)(object)damageInfo.attacker))
				{
					return;
				}
				CharacterBody component = damageInfo.attacker.GetComponent<CharacterBody>();
				CharacterBody component2 = victim.GetComponent<CharacterBody>();
				if (!Object.op_Implicit((Object)(object)((component != null) ? component.inventory : null)))
				{
					return;
				}
				int itemCount = component.inventory.GetItemCount(myItemDef.itemIndex);
				if (itemCount > 0 && damageInfo.procCoefficient > 0f && !component2.HasBuff(myTimerBuffDef))
				{
					int buffCount = component2.healthComponent.body.GetBuffCount(myCounterBuffDef);
					if ((float)buffCount < procForBigHit.Value - 1f && NetworkServer.active)
					{
						component2.healthComponent.body.AddBuff(myCounterBuffDef);
						return;
					}
					Utilities.RemoveBuffStacks(component2, myCounterBuffDef.buffIndex);
					Utilities.AddTimedBuff(component2, myTimerBuffDef, bigOnHitTimer.Value);
					float val = component2.healthComponent.health * (float)itemCount * onHitDamageAmount.Value / 100f * damageInfo.procCoefficient;
					val = Math.Max(procDamageMin.Value * component.damage, Math.Min(procDamageMax.Value * component.damage, val));
					damageInfo.crit = false;
					damageInfo.procCoefficient = 0f;
					damageInfo.damageType = (DamageType)0;
					damageInfo.inflictor = damageInfo.attacker;
					damageInfo.damage = val;
					damageInfo.damageColorIndex = (DamageColorIndex)10;
					component2.healthComponent.TakeDamage(damageInfo);
					Utilities.AddValueInDictionary(ref borkBonusDamage, component.master, val, borkBonusDamageToken);
					float num = val * (onHitHealPercent.Value / 100f);
					component.healthComponent.Heal(num, damageInfo.procChainMask, true);
					Utilities.AddValueInDictionary(ref borkBonusHeal, component.master, num, borkBonusHealToken);
					AkSoundEngine.PostEvent(procSoundEffect, ((Component)component).gameObject);
				}
			}
		}

		public static ItemDef myItemDef;

		public static BuffDef myCounterBuffDef;

		public static BuffDef myTimerBuffDef;

		public static Dictionary<NetworkInstanceId, float> borkBonusDamage = new Dictionary<NetworkInstanceId, float>();

		public static string borkBonusDamageToken = "Bork.borkBonusDamage";

		public static Dictionary<NetworkInstanceId, float> borkBonusHeal = new Dictionary<NetworkInstanceId, float>();

		public static string borkBonusHealToken = "Bork.borkBonusHeal";

		public static Dictionary<ItemInventoryDisplay, CharacterMaster> DisplayToMasterRef = new Dictionary<ItemInventoryDisplay, CharacterMaster>();

		public static Dictionary<ItemIcon, CharacterMaster> IconToMasterRef = new Dictionary<ItemIcon, CharacterMaster>();

		public static uint procSoundEffect = 3722891417u;

		public static ConfigEntry<float> onHitDamageAmount { get; set; }

		public static ConfigEntry<float> procForBigHit { get; set; }

		public static ConfigEntry<float> onHitHealPercent { get; set; }

		public static ConfigEntry<float> bigOnHitTimer { get; set; }

		public static ConfigEntry<float> procDamageMin { get; set; }

		public static ConfigEntry<float> procDamageMax { get; set; }

		public static ConfigEntry<float> attackSpeed { get; set; }

		public static ConfigEntry<bool> enabled { get; set; }

		public static ConfigEntry<string> rarity { get; set; }

		public static ConfigEntry<string> voidItems { get; set; }

		internal static void Init()
		{
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Expected O, but got Unknown
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Expected O, but got Unknown
			LoadConfig();
			if (enabled.Value)
			{
				CreateItem();
				CreateBuff();
				AddTokens();
				ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null);
				ItemAPI.Add(new CustomItem(myItemDef, val));
				ContentAddition.AddBuffDef(myCounterBuffDef);
				ContentAddition.AddBuffDef(myTimerBuffDef);
				hooks();
				Utilities.SetupReadOnlyHooks(DisplayToMasterRef, IconToMasterRef, myItemDef, GetDisplayInformation, rarity, voidItems, "Bork");
				SetupNetworkMappings();
			}
		}

		private static void LoadConfig()
		{
			enabled = LoLItems.MyConfig.Bind<bool>("Bork", "Enabled", true, "Determines if the item should be loaded by the game.");
			rarity = LoLItems.MyConfig.Bind<string>("Bork", "Rarity", "VoidTier2Def", "Set the rarity of the item. Valid values: Tier1Def, Tier2Def, Tier3Def, VoidTier1Def, VoidTier2Def, and VoidTier3Def.");
			voidItems = LoLItems.MyConfig.Bind<string>("Bork", "Void Items", "Syringe,Seed", "Set regular items to convert into this void item (Only if the rarity is set as a void tier). Items should be separated by a comma, no spaces. The item should be the in game item ID, which may differ from the item name.");
			onHitDamageAmount = LoLItems.MyConfig.Bind<float>("Bork", "On Hit Damage Percent", 5f, "Amount of on hit max health damage percent each item will grant.");
			procForBigHit = LoLItems.MyConfig.Bind<float>("Bork", "On Hit Proc Requirement", 3f, "Amount of hits required to proc the on hit damage.");
			onHitHealPercent = LoLItems.MyConfig.Bind<float>("Bork", "Heal Percent", 20f, "Percentage of damage dealt to be gained as healing.");
			bigOnHitTimer = LoLItems.MyConfig.Bind<float>("Bork", "Proc Cooldown", 10f, "Cooldown per enemy.");
			procDamageMin = LoLItems.MyConfig.Bind<float>("Bork", "Min Proc Damage", 2f, "Multiplied by your base damage to determine the minimum proc damage.");
			procDamageMax = LoLItems.MyConfig.Bind<float>("Bork", "Max Proc Damage", 25f, "Multiplied by your base damage to determine the maximum proc damage.");
			attackSpeed = LoLItems.MyConfig.Bind<float>("Bork", "Attack Speed", 5f, "Amount of attack speed each item will grant.");
		}

		private static void CreateItem()
		{
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			myItemDef = ScriptableObject.CreateInstance<ItemDef>();
			((Object)myItemDef).name = "Bork";
			myItemDef.nameToken = "Bork";
			myItemDef.pickupToken = "BorkItem";
			myItemDef.descriptionToken = "BorkDesc";
			myItemDef.loreToken = "BorkLore";
			myItemDef._itemTierDef = Addressables.LoadAssetAsync<ItemTierDef>((object)Utilities.GetRarityFromString(rarity.Value)).WaitForCompletion();
			myItemDef.pickupIconSprite = Assets.icons.LoadAsset<Sprite>("BorkIcon");
			myItemDef.pickupModelPrefab = Assets.prefabs.LoadAsset<GameObject>("BorkPrefab");
			myItemDef.canRemove = true;
			myItemDef.hidden = false;
			myItemDef.tags = (ItemTag[])(object)new ItemTag[2]
			{
				(ItemTag)1,
				(ItemTag)2
			};
		}

		private static void CreateBuff()
		{
			myCounterBuffDef = ScriptableObject.CreateInstance<BuffDef>();
			myCounterBuffDef.iconSprite = Resources.Load<Sprite>("Textures/MiscIcons/texMysteryIcon");
			((Object)myCounterBuffDef).name = "BorkCounterBuff";
			myCounterBuffDef.canStack = true;
			myCounterBuffDef.isDebuff = false;
			myCounterBuffDef.isCooldown = false;
			myCounterBuffDef.isHidden = true;
			myTimerBuffDef = ScriptableObject.CreateInstance<BuffDef>();
			myTimerBuffDef.iconSprite = Resources.Load<Sprite>("Textures/MiscIcons/texMysteryIcon");
			((Object)myTimerBuffDef).name = "BorkTimerBuff";
			myTimerBuffDef.canStack = true;
			myTimerBuffDef.isDebuff = false;
			myTimerBuffDef.isCooldown = true;
			myTimerBuffDef.isHidden = true;
		}

		private static void hooks()
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Expected O, but got Unknown
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Expected O, but got Unknown
			object obj = <>c.<>9__54_0;
			if (obj == null)
			{
				hook_OnHitEnemy val = delegate(orig_OnHitEnemy orig, GlobalEventManager self, DamageInfo damageInfo, GameObject victim)
				{
					//IL_006a: Unknown result type (might be due to invalid IL or missing references)
					//IL_010b: Unknown result type (might be due to invalid IL or missing references)
					//IL_019f: Unknown result type (might be due to invalid IL or missing references)
					//IL_01be: Unknown result type (might be due to invalid IL or missing references)
					//IL_0209: Unknown result type (might be due to invalid IL or missing references)
					orig.Invoke(self, damageInfo, victim);
					if (NetworkServer.active && Object.op_Implicit((Object)(object)damageInfo.attacker))
					{
						CharacterBody component = damageInfo.attacker.GetComponent<CharacterBody>();
						CharacterBody component2 = victim.GetComponent<CharacterBody>();
						if (Object.op_Implicit((Object)(object)((component != null) ? component.inventory : null)))
						{
							int itemCount = component.inventory.GetItemCount(myItemDef.itemIndex);
							if (itemCount > 0 && damageInfo.procCoefficient > 0f && !component2.HasBuff(myTimerBuffDef))
							{
								int buffCount = component2.healthComponent.body.GetBuffCount(myCounterBuffDef);
								if ((float)buffCount < procForBigHit.Value - 1f && NetworkServer.active)
								{
									component2.healthComponent.body.AddBuff(myCounterBuffDef);
								}
								else
								{
									Utilities.RemoveBuffStacks(component2, myCounterBuffDef.buffIndex);
									Utilities.AddTimedBuff(component2, myTimerBuffDef, bigOnHitTimer.Value);
									float val3 = component2.healthComponent.health * (float)itemCount * onHitDamageAmount.Value / 100f * damageInfo.procCoefficient;
									val3 = Math.Max(procDamageMin.Value * component.damage, Math.Min(procDamageMax.Value * component.damage, val3));
									damageInfo.crit = false;
									damageInfo.procCoefficient = 0f;
									damageInfo.damageType = (DamageType)0;
									damageInfo.inflictor = damageInfo.attacker;
									damageInfo.damage = val3;
									damageInfo.damageColorIndex = (DamageColorIndex)10;
									component2.healthComponent.TakeDamage(damageInfo);
									Utilities.AddValueInDictionary(ref borkBonusDamage, component.master, val3, borkBonusDamageToken);
									float num = val3 * (onHitHealPercent.Value / 100f);
									component.healthComponent.Heal(num, damageInfo.procChainMask, true);
									Utilities.AddValueInDictionary(ref borkBonusHeal, component.master, num, borkBonusHealToken);
									AkSoundEngine.PostEvent(procSoundEffect, ((Component)component).gameObject);
								}
							}
						}
					}
				};
				<>c.<>9__54_0 = val;
				obj = (object)val;
			}
			GlobalEventManager.OnHitEnemy += (hook_OnHitEnemy)obj;
			object obj2 = <>O.<1>__RecalculateStatsAPI_GetStatCoefficients;
			if (obj2 == null)
			{
				StatHookEventHandler val2 = RecalculateStatsAPI_GetStatCoefficients;
				<>O.<1>__RecalculateStatsAPI_GetStatCoefficients = val2;
				obj2 = (object)val2;
			}
			RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)obj2;
		}

		private static void RecalculateStatsAPI_GetStatCoefficients(CharacterBody characterBody, StatHookEventArgs args)
		{
			float baseAttackSpeedAdd = args.baseAttackSpeedAdd;
			int? obj;
			if (characterBody == null)
			{
				obj = null;
			}
			else
			{
				Inventory inventory = characterBody.inventory;
				obj = ((inventory != null) ? new int?(inventory.GetItemCount(myItemDef)) : null);
			}
			args.baseAttackSpeedAdd = baseAttackSpeedAdd + ((float?)obj / 100f * attackSpeed.Value).GetValueOrDefault();
		}

		private static (string, string) GetDisplayInformation(CharacterMaster masterRef)
		{
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)masterRef == (Object)null)
			{
				return (Language.GetString(myItemDef.descriptionToken), "");
			}
			string text = "";
			text = ((!borkBonusDamage.TryGetValue(((NetworkBehaviour)masterRef).netId, out var value)) ? (text + "<br><br>Damage dealt: 0") : (text + "<br><br>Damage dealt: " + $"{value:#}"));
			float value2;
			return new ValueTuple<string, string>(item2: (!borkBonusHeal.TryGetValue(((NetworkBehaviour)masterRef).netId, out value2)) ? (text + "<br>Healing: 0") : (text + "<br>Healing: " + $"{value2:#}"), item1: Language.GetString(myItemDef.descriptionToken));
		}

		private static void AddTokens()
		{
			LanguageAPI.Add("Bork", "Bork");
			LanguageAPI.Add("BorkItem", "Attack speed. Every " + procForBigHit.Value + " hits do damage and heal, and has a cooldown. Corrupts <style=cIsVoid>Syringes</style> and <style=cIsVoid>Leaching Seeds</style>.");
			LanguageAPI.Add("BorkDesc", "Gives <style=cIsDamage>" + attackSpeed.Value + "%</style> <style=cStack>(+" + attackSpeed.Value + "%)</style> attack speed. Deals <style=cIsDamage>" + onHitDamageAmount.Value + "%</style> <style=cStack>(+" + onHitDamageAmount.Value + "%)</style> current enemy hp every third hit, and heal for <style=cIsHealing>" + onHitHealPercent.Value + "%</style> of that damage on a " + bigOnHitTimer.Value + " second cooldown. Corrupts <style=cIsVoid>Syringes</style> and <style=cIsVoid>Leaching Seeds</style>.");
			LanguageAPI.Add("BorkLore", "Viego is a plague to everything he touches.");
		}

		public static void SetupNetworkMappings()
		{
			LoLItems.networkMappings.Add(borkBonusDamageToken, borkBonusDamage);
			LoLItems.networkMappings.Add(borkBonusHealToken, borkBonusHeal);
		}
	}
	internal class Cull
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static hook_OnCharacterDeath <>9__32_0;

			public static hook_OnInventoryChanged <>9__32_1;

			public static hook_Start <>9__32_2;

			internal void <hooks>b__32_0(orig_OnCharacterDeath orig, GlobalEventManager globalEventManager, DamageReport damageReport)
			{
				//IL_001f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0024: Unknown result type (might be due to invalid IL or missing references)
				//IL_004b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0050: Unknown result type (might be due to invalid IL or missing references)
				//IL_0083: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
				//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d6: Expected O, but got Unknown
				//IL_0212: Unknown result type (might be due to invalid IL or missing references)
				//IL_0188: Unknown result type (might be due to invalid IL or missing references)
				//IL_0192: Unknown result type (might be due to invalid IL or missing references)
				//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
				orig.Invoke(globalEventManager, damageReport);
				if (!NetworkServer.active)
				{
					return;
				}
				GameObject val = null;
				Transform val2 = null;
				Vector3 origin = Vector3.zero;
				if (Object.op_Implicit((Object)(object)damageReport.victim))
				{
					val = ((Component)damageReport.victim).gameObject;
					val2 = val.transform;
					origin = val2.position;
				}
				CharacterMaster attackerMaster = damageReport.attackerMaster;
				if (!Object.op_Implicit((Object)(object)((attackerMaster != null) ? attackerMaster.inventory : null)))
				{
					return;
				}
				int itemCount = damageReport.attackerMaster.inventory.GetItemCount(myItemDef.itemIndex);
				if (itemCount <= 0)
				{
					return;
				}
				float num = goldOnKill.Value * (float)itemCount;
				GoldOrb val3 = new GoldOrb
				{
					origin = origin,
					target = Util.FindBodyMainHurtBox(damageReport.attackerBody),
					goldAmount = (uint)num
				};
				OrbManager.instance.AddOrb((Orb)(object)val3);
				if (NetworkServer.active)
				{
					for (int i = 0; i < itemCount; i++)
					{
						damageReport.attackerBody.AddBuff(myBuffDef);
					}
				}
				if ((float)damageReport.attackerBody.GetBuffCount(myBuffDef) >= killsToBreak.Value)
				{
					if (NetworkServer.active)
					{
						damageReport.attackerBody.inventory.RemoveItem(myItemDef, 1);
						damageReport.attackerBody.inventory.GiveItem(Items.ScrapWhite, 1);
					}
					CharacterMasterNotificationQueue.SendTransformNotification(damageReport.attackerMaster, myItemDef.itemIndex, Items.ScrapWhite.itemIndex, (TransformationType)0);
					if (itemCount == 1)
					{
						Utilities.RemoveBuffStacks(damageReport.attackerBody, myBuffDef.buffIndex);
					}
					else if (NetworkServer.active)
					{
						for (int j = 0; j < 100; j++)
						{
							damageReport.attackerBody.RemoveBuff(myBuffDef);
						}
					}
				}
				Utilities.SetValueInDictionary(ref buffStacks, damageReport.attackerBody.master, damageReport.attackerBody.GetBuffCount(myBuffDef.buffIndex), buffStacksToken);
				Utilities.AddValueInDictionary(ref goldGained, damageReport.attackerBody.master, num, goldGainedToken);
			}

			internal void <hooks>b__32_1(orig_OnInventoryChanged orig, CharacterBody self)
			{
				//IL_001b: Unknown result type (might be due to invalid IL or missing references)
				//IL_002d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0048: Unknown result type (might be due to invalid IL or missing references)
				orig.Invoke(self);
				if (NetworkServer.active && self.inventory.GetItemCount(myItemDef.itemIndex) == 0 && self.GetBuffCount(myBuffDef.buffIndex) > 0)
				{
					Utilities.RemoveBuffStacks(self, myBuffDef.buffIndex);
				}
			}

			internal void <hooks>b__32_2(orig_Start orig, CharacterBody self)
			{
				//IL_0028: Unknown result type (might be due to invalid IL or missing references)
				//IL_0047: Unknown result type (might be due to invalid IL or missing references)
				orig.Invoke(self);
				if (NetworkServer.active && Object.op_Implicit((Object)(object)self.master) && buffStacks.TryGetValue(((NetworkBehaviour)self.master).netId, out var value))
				{
					for (int i = 0; (float)i < value; i++)
					{
						self.AddBuff(myBuffDef.buffIndex);
					}
				}
			}
		}

		public static ItemDef myItemDef;

		public static BuffDef myBuffDef;

		public static Dictionary<NetworkInstanceId, float> goldGained = new Dictionary<NetworkInstanceId, float>();

		public static string goldGainedToken = "Cull.goldGained";

		public static Dictionary<NetworkInstanceId, float> buffStacks = new Dictionary<NetworkInstanceId, float>();

		public static string buffStacksToken = "Cull.buffStacks";

		public static Dictionary<ItemInventoryDisplay, CharacterMaster> DisplayToMasterRef = new Dictionary<ItemInventoryDisplay, CharacterMaster>();

		public static Dictionary<ItemIcon, CharacterMaster> IconToMasterRef = new Dictionary<ItemIcon, CharacterMaster>();

		public static ConfigEntry<float> goldOnKill { get; set; }

		public static ConfigEntry<float> killsToBreak { get; set; }

		public static ConfigEntry<bool> enabled { get; set; }

		public static ConfigEntry<string> rarity { get; set; }

		public static ConfigEntry<string> voidItems { get; set; }

		internal static void Init()
		{
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Expected O, but got Unknown
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Expected O, but got Unknown
			LoadConfig();
			if (enabled.Value)
			{
				CreateItem();
				CreateBuff();
				AddTokens();
				ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null);
				ItemAPI.Add(new CustomItem(myItemDef, val));
				ContentAddition.AddBuffDef(myBuffDef);
				hooks();
				Utilities.SetupReadOnlyHooks(DisplayToMasterRef, IconToMasterRef, myItemDef, GetDisplayInformation, rarity, voidItems, "Cull");
				SetupNetworkMappings();
			}
		}

		private static void LoadConfig()
		{
			enabled = LoLItems.MyConfig.Bind<bool>("Cull", "Enabled", true, "Determines if the item should be loaded by the game.");
			rarity = LoLItems.MyConfig.Bind<string>("Cull", "Rarity", "Tier1Def", "Set the rarity of the item. Valid values: Tier1Def, Tier2Def, Tier3Def, VoidTier1Def, VoidTier2Def, and VoidTier3Def.");
			voidItems = LoLItems.MyConfig.Bind<string>("Cull", "Void Items", "", "Set regular items to convert into this void item (Only if the rarity is set as a void tier). Items should be separated by a comma, no spaces. The item should be the in game item ID, which may differ from the item name.");
			goldOnKill = LoLItems.MyConfig.Bind<float>("Cull", "Gold Per Kill", 1f, "Amount of gold each kill will grant.");
			killsToBreak = LoLItems.MyConfig.Bind<float>("Cull", "Kills To Convert", 100f, "Amount of kills needed to convert the item.");
		}

		private static void CreateItem()
		{
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			myItemDef = ScriptableObject.CreateInstance<ItemDef>();
			((Object)myItemDef).name = "Cull";
			myItemDef.nameToken = "Cull";
			myItemDef.pickupToken = "CullItem";
			myItemDef.descriptionToken = "CullDesc";
			myItemDef.loreToken = "CullLore";
			myItemDef._itemTierDef = Addressables.LoadAssetAsync<ItemTierDef>((object)Utilities.GetRarityFromString(rarity.Value)).WaitForCompletion();
			myItemDef.pickupIconSprite = Assets.icons.LoadAsset<Sprite>("CullIcon");
			myItemDef.pickupModelPrefab = Assets.prefabs.LoadAsset<GameObject>("CullPrefab");
			myItemDef.canRemove = true;
			myItemDef.hidden = false;
			myItemDef.tags = (ItemTag[])(object)new ItemTag[1] { (ItemTag)3 };
		}

		private static void CreateBuff()
		{
			myBuffDef = ScriptableObject.CreateInstance<BuffDef>();
			myBuffDef.iconSprite = Assets.icons.LoadAsset<Sprite>("CullIcon");
			((Object)myBuffDef).name = "CullBuff";
			myBuffDef.canStack = true;
			myBuffDef.isDebuff = false;
			myBuffDef.isCooldown = false;
			myBuffDef.isHidden = false;
		}

		private static void hooks()
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Expected O, but got Unknown
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Expected O, but got Unknown
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Expected O, but got Unknown
			object obj = <>c.<>9__32_0;
			if (obj == null)
			{
				hook_OnCharacterDeath val = delegate(orig_OnCharacterDeath orig, GlobalEventManager globalEventManager, DamageReport damageReport)
				{
					//IL_001f: Unknown result type (might be due to invalid IL or missing references)
					//IL_0024: Unknown result type (might be due to invalid IL or missing references)
					//IL_004b: Unknown result type (might be due to invalid IL or missing references)
					//IL_0050: Unknown result type (might be due to invalid IL or missing references)
					//IL_0083: Unknown result type (might be due to invalid IL or missing references)
					//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
					//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
					//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
					//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
					//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
					//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
					//IL_00d6: Expected O, but got Unknown
					//IL_0212: Unknown result type (might be due to invalid IL or missing references)
					//IL_0188: Unknown result type (might be due to invalid IL or missing references)
					//IL_0192: Unknown result type (might be due to invalid IL or missing references)
					//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
					orig.Invoke(globalEventManager, damageReport);
					if (NetworkServer.active)
					{
						GameObject val4 = null;
						Transform val5 = null;
						Vector3 origin = Vector3.zero;
						if (Object.op_Implicit((Object)(object)damageReport.victim))
						{
							val4 = ((Component)damageReport.victim).gameObject;
							val5 = val4.transform;
							origin = val5.position;
						}
						CharacterMaster attackerMaster = damageReport.attackerMaster;
						if (Object.op_Implicit((Object)(object)((attackerMaster != null) ? attackerMaster.inventory : null)))
						{
							int itemCount = damageReport.attackerMaster.inventory.GetItemCount(myItemDef.itemIndex);
							if (itemCount > 0)
							{
								float num = goldOnKill.Value * (float)itemCount;
								GoldOrb val6 = new GoldOrb
								{
									origin = origin,
									target = Util.FindBodyMainHurtBox(damageReport.attackerBody),
									goldAmount = (uint)num
								};
								OrbManager.instance.AddOrb((Orb)(object)val6);
								if (NetworkServer.active)
								{
									for (int j = 0; j < itemCount; j++)
									{
										damageReport.attackerBody.AddBuff(myBuffDef);
									}
								}
								if ((float)damageReport.attackerBody.GetBuffCount(myBuffDef) >= killsToBreak.Value)
								{
									if (NetworkServer.active)
									{
										damageReport.attackerBody.inventory.RemoveItem(myItemDef, 1);
										damageReport.attackerBody.inventory.GiveItem(Items.ScrapWhite, 1);
									}
									CharacterMasterNotificationQueue.SendTransformNotification(damageReport.attackerMaster, myItemDef.itemIndex, Items.ScrapWhite.itemIndex, (TransformationType)0);
									if (itemCount == 1)
									{
										Utilities.RemoveBuffStacks(damageReport.attackerBody, myBuffDef.buffIndex);
									}
									else if (NetworkServer.active)
									{
										for (int k = 0; k < 100; k++)
										{
											damageReport.attackerBody.RemoveBuff(myBuffDef);
										}
									}
								}
								Utilities.SetValueInDictionary(ref buffStacks, damageReport.attackerBody.master, damageReport.attackerBody.GetBuffCount(myBuffDef.buffIndex), buffStacksToken);
								Utilities.AddValueInDictionary(ref goldGained, damageReport.attackerBody.master, num, goldGainedToken);
							}
						}
					}
				};
				<>c.<>9__32_0 = val;
				obj = (object)val;
			}
			GlobalEventManager.OnCharacterDeath += (hook_OnCharacterDeath)obj;
			object obj2 = <>c.<>9__32_1;
			if (obj2 == null)
			{
				hook_OnInventoryChanged val2 = delegate(orig_OnInventoryChanged orig, CharacterBody self)
				{
					//IL_001b: Unknown result type (might be due to invalid IL or missing references)
					//IL_002d: Unknown result type (might be due to invalid IL or missing references)
					//IL_0048: Unknown result type (might be due to invalid IL or missing references)
					orig.Invoke(self);
					if (NetworkServer.active && self.inventory.GetItemCount(myItemDef.itemIndex) == 0 && self.GetBuffCount(myBuffDef.buffIndex) > 0)
					{
						Utilities.RemoveBuffStacks(self, myBuffDef.buffIndex);
					}
				};
				<>c.<>9__32_1 = val2;
				obj2 = (object)val2;
			}
			CharacterBody.OnInventoryChanged += (hook_OnInventoryChanged)obj2;
			object obj3 = <>c.<>9__32_2;
			if (obj3 == null)
			{
				hook_Start val3 = delegate(orig_Start orig, CharacterBody self)
				{
					//IL_0028: Unknown result type (might be due to invalid IL or missing references)
					//IL_0047: Unknown result type (might be due to invalid IL or missing references)
					orig.Invoke(self);
					if (NetworkServer.active && Object.op_Implicit((Object)(object)self.master) && buffStacks.TryGetValue(((NetworkBehaviour)self.master).netId, out var value))
					{
						for (int i = 0; (float)i < value; i++)
						{
							self.AddBuff(myBuffDef.buffIndex);
						}
					}
				};
				<>c.<>9__32_2 = val3;
				obj3 = (object)val3;
			}
			CharacterBody.Start += (hook_Start)obj3;
		}

		private static (string, string) GetDisplayInformation(CharacterMaster masterRef)
		{
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)masterRef == (Object)null)
			{
				return (Language.GetString(myItemDef.descriptionToken), "");
			}
			string text = "";
			float value;
			return new ValueTuple<string, string>(item2: (!goldGained.TryGetValue(((NetworkBehaviour)masterRef).netId, out value)) ? (text + "<br><br>Total gold gained: 0") : (text + "<br><br>Total gold gained: " + $"{value:#}"), item1: Language.GetString(myItemDef.descriptionToken));
		}

		private static void AddTokens()
		{
			LanguageAPI.Add("Cull", "Cull");
			LanguageAPI.Add("CullItem", "Cull gives gold when killing enemies. Turns into scrap when enough gold collected.");
			LanguageAPI.Add("CullDesc", "Cull gives <style=cIsUtility>" + goldOnKill.Value + "</style> <style=cStack>(+" + goldOnKill.Value + ")</style> gold when killing an enemy. Upon hitting <style=cIsUtility>" + killsToBreak.Value + "</style> gold turns into White Scrap.");
			LanguageAPI.Add("CullLore", "I personally like Doran's Blade more");
			LanguageAPI.Add("CullBuff", "Gold gained");
		}

		public static void SetupNetworkMappings()
		{
			LoLItems.networkMappings.Add(goldGainedToken, goldGained);
			LoLItems.networkMappings.Add(buffStacksToken, buffStacks);
		}
	}
	internal class GargoyleStoneplate
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static Func<CharacterMaster, (string, string)> <0>__GetDisplayInformation;

			public static StatHookEventHandler <1>__RecalculateStatsAPI_GetStatCoefficients;
		}

		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static hook_PerformEquipmentAction <>9__31_0;

			internal bool <hooks>b__31_0(orig_PerformEquipmentAction orig, EquipmentSlot self, EquipmentDef equipmentDef)
			{
				if (NetworkServer.active && (Object)(object)equipmentDef == (Object)(object)myEquipmentDef)
				{
					return ActivateEquipment(self);
				}
				return orig.Invoke(self, equipmentDef);
			}
		}

		public static BuffDef gargoyleArmorBuff;

		public static EquipmentDef myEquipmentDef;

		public static Dictionary<NetworkInstanceId, float> totalBarrierGiven = new Dictionary<NetworkInstanceId, float>();

		public static string totalBarrierGivenToken = "GargoyleStoneplate.totalBarrierGiven";

		public static Dictionary<ItemInventoryDisplay, CharacterMaster> DisplayToMasterRef = new Dictionary<ItemInventoryDisplay, CharacterMaster>();

		public static Dictionary<EquipmentIcon, CharacterMaster> IconToMasterRef = new Dictionary<EquipmentIcon, CharacterMaster>();

		public static uint activateSoundEffectID = 2213188569u;

		public static ConfigEntry<float> barrierPercent { get; set; }

		public static ConfigEntry<float> barrierCooldown { get; set; }

		public static ConfigEntry<float> armorDuration { get; set; }

		public static ConfigEntry<float> armorValue { get; set; }

		public static ConfigEntry<bool> enabled { get; set; }

		internal static void Init()
		{
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Expected O, but got Unknown
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Expected O, but got Unknown
			LoadConfig();
			if (enabled.Value)
			{
				CreateItem();
				CreateBuff();
				ContentAddition.AddBuffDef(gargoyleArmorBuff);
				AddTokens();
				ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null);
				ItemAPI.Add(new CustomEquipment(myEquipmentDef, val));
				hooks();
				Utilities.SetupReadOnlyHooks(DisplayToMasterRef, myEquipmentDef, GetDisplayInformation);
				SetupNetworkMappings();
			}
		}

		private static void LoadConfig()
		{
			enabled = LoLItems.MyConfig.Bind<bool>("GargoyleStoneplate", "Enabled", true, "Determines if the item should be loaded by the game.");
			barrierPercent = LoLItems.MyConfig.Bind<float>("GargoyleStoneplate", "Barrier Percentage", 60f, "Percent of barrier Gargoyle Stoneplate will grant you.");
			barrierCooldown = LoLItems.MyConfig.Bind<float>("GargoyleStoneplate", "Barrier Cooldown", 60f, "Cooldown of the item.");
			armorDuration = LoLItems.MyConfig.Bind<float>("GargoyleStoneplate", "Armor Duration", 2f, "Duration of the armor buff.");
			armorValue = LoLItems.MyConfig.Bind<float>("GargoyleStoneplate", "Armor Value", 100f, "Armor value given during the buff.");
		}

		private static void CreateItem()
		{
			myEquipmentDef = ScriptableObject.CreateInstance<EquipmentDef>();
			((Object)myEquipmentDef).name = "GargoyleStoneplate";
			myEquipmentDef.nameToken = "GargoyleStoneplate";
			myEquipmentDef.pickupToken = "GargoyleStoneplateItem";
			myEquipmentDef.descriptionToken = "GargoyleStoneplateDesc";
			myEquipmentDef.loreToken = "GargoyleStoneplateLore";
			myEquipmentDef.pickupIconSprite = Assets.icons.LoadAsset<Sprite>("GargoyleStoneplateIcon");
			myEquipmentDef.pickupModelPrefab = Assets.prefabs.LoadAsset<GameObject>("GargoyleStoneplatePrefab");
			myEquipmentDef.canDrop = true;
			myEquipmentDef.appearsInMultiPlayer = true;
			myEquipmentDef.appearsInSinglePlayer = true;
			myEquipmentDef.canBeRandomlyTriggered = true;
			myEquipmentDef.enigmaCompatible = true;
			myEquipmentDef.cooldown = barrierCooldown.Value;
		}

		private static void CreateBuff()
		{
			gargoyleArmorBuff = ScriptableObject.CreateInstance<BuffDef>();
			gargoyleArmorBuff.iconSprite = Assets.icons.LoadAsset<Sprite>("GargoyleStoneplateIcon");
			((Object)gargoyleArmorBuff).name = "gargoyleArmorBuff";
			gargoyleArmorBuff.canStack = false;
			gargoyleArmorBuff.isDebuff = false;
			gargoyleArmorBuff.isCooldown = true;
			gargoyleArmorBuff.isHidden = false;
		}

		private static void hooks()
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Expected O, but got Unknown
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Expected O, but got Unknown
			object obj = <>c.<>9__31_0;
			if (obj == null)
			{
				hook_PerformEquipmentAction val = (orig_PerformEquipmentAction orig, EquipmentSlot self, EquipmentDef equipmentDef) => (NetworkServer.active && (Object)(object)equipmentDef == (Object)(object)myEquipmentDef) ? ActivateEquipment(self) : orig.Invoke(self, equipmentDef);
				<>c.<>9__31_0 = val;
				obj = (object)val;
			}
			EquipmentSlot.PerformEquipmentAction += (hook_PerformEquipmentAction)obj;
			object obj2 = <>O.<1>__RecalculateStatsAPI_GetStatCoefficients;
			if (obj2 == null)
			{
				StatHookEventHandler val2 = RecalculateStatsAPI_GetStatCoefficients;
				<>O.<1>__RecalculateStatsAPI_GetStatCoefficients = val2;
				obj2 = (object)val2;
			}
			RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)obj2;
		}

		private static void RecalculateStatsAPI_GetStatCoefficients(CharacterBody characterBody, StatHookEventArgs args)
		{
			if (NetworkServer.active && characterBody.HasBuff(gargoyleArmorBuff))
			{
				args.armorAdd += armorValue.Value;
			}
		}

		private static bool ActivateEquipment(EquipmentSlot slot)
		{
			float num = slot.characterBody.healthComponent.fullHealth * barrierPercent.Value / 100f;
			if (num > slot.characterBody.healthComponent.fullHealth)
			{
				num = slot.characterBody.healthComponent.fullHealth;
			}
			slot.characterBody.healthComponent.AddBarrier(num);
			Utilities.AddTimedBuff(slot.characterBody, gargoyleArmorBuff, armorDuration.Value);
			Utilities.AddValueInDictionary(ref totalBarrierGiven, slot.characterBody.master, num, totalBarrierGivenToken, checkMinionOwnership: false);
			AkSoundEngine.PostEvent(activateSoundEffectID, ((Component)slot.characterBody).gameObject);
			return true;
		}

		private static (string, string) GetDisplayInformation(CharacterMaster masterRef)
		{
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)masterRef == (Object)null)
			{
				return (Language.GetString(myEquipmentDef.descriptionToken), "");
			}
			string text = "";
			float value;
			return new ValueTuple<string, string>(item2: (!totalBarrierGiven.TryGetValue(((NetworkBehaviour)masterRef).netId, out value)) ? (text + "<br><br>Barrier given: 0") : (text + "<br><br>Barrier given: " + $"{value:#}"), item1: Language.GetString(myEquipmentDef.descriptionToken));
		}

		private static void AddTokens()
		{
			LanguageAPI.Add("GargoyleStoneplate", "Gargoyle Stoneplate");
			LanguageAPI.Add("GargoyleStoneplateItem", "Temporarily gain armor and a barrier based on your maximum health.");
			LanguageAPI.Add("GargoyleStoneplateDesc", $"Temporarily gain <style=cIsHealing>{armorValue.Value}</style> armor for <style=cIsUtility>{armorDuration.Value}s</style> and a barrier for <style=cIsHealing>{barrierPercent.Value}%</style> of your maximum health.");
			LanguageAPI.Add("GargoyleStoneplateLore", "Whoever thought of breaking this off of a gargoyle's body and strapping it onto their own body was a genius.");
		}

		public static void SetupNetworkMappings()
		{
			LoLItems.networkMappings.Add(totalBarrierGivenToken, totalBarrierGiven);
		}
	}
	internal class GuardiansBlade
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static Func<CharacterMaster, (string, string)> <0>__GetDisplayInformation;

			public static StatHookEventHandler <1>__RecalculateStatsAPI_GetStatCoefficients;
		}

		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static hook_HandleInventoryChanged <>9__24_0;

			internal void <hooks>b__24_0(orig_HandleInventoryChanged orig, Inventory self)
			{
				//IL_000f: Unknown result type (might be due to invalid IL or missing references)
				orig.Invoke(self);
				int itemCount = self.GetItemCount(myItemDef.itemIndex);
				if (itemCount > 0)
				{
					float num = Math.Abs(Utilities.HyperbolicScale(itemCount, cooldownReduction.Value / 100f) - 1f);
					Utilities.SetValueInDictionary(ref cooldownReductionTracker, ((Component)self).GetComponentInParent<CharacterMaster>(), Math.Abs(num - 1f) * 100f, cooldownReductionTrackerToken, checkMinionOwnership: false);
				}
			}
		}

		public static ItemDef myItemDef;

		public static Dictionary<NetworkInstanceId, float> cooldownReductionTracker = new Dictionary<NetworkInstanceId, float>();

		public static string cooldownReductionTrackerToken = "GuardiansBlade.cooldownReductionTracker";

		public static Dictionary<ItemInventoryDisplay, CharacterMaster> DisplayToMasterRef = new Dictionary<ItemInventoryDisplay, CharacterMaster>();

		public static Dictionary<ItemIcon, CharacterMaster> IconToMasterRef = new Dictionary<ItemIcon, CharacterMaster>();

		public static ConfigEntry<float> cooldownReduction { get; set; }

		public static ConfigEntry<bool> enabled { get; set; }

		public static ConfigEntry<string> rarity { get; set; }

		public static ConfigEntry<string> voidItems { get; set; }

		internal static void Init()
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Expected O, but got Unknown
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Expected O, but got Unknown
			LoadConfig();
			if (enabled.Value)
			{
				CreateItem();
				AddTokens();
				ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null);
				ItemAPI.Add(new CustomItem(myItemDef, val));
				hooks();
				Utilities.SetupReadOnlyHooks(DisplayToMasterRef, IconToMasterRef, myItemDef, GetDisplayInformation, rarity, voidItems, "GuardiansBlade");
				SetupNetworkMappings();
			}
		}

		private static void LoadConfig()
		{
			enabled = LoLItems.MyConfig.Bind<bool>("GuardiansBlade", "Enabled", true, "Determines if the item should be loaded by the game.");
			rarity = LoLItems.MyConfig.Bind<string>("GuardiansBlade", "Rarity", "Tier1Def", "Set the rarity of the item. Valid values: Tier1Def, Tier2Def, Tier3Def, VoidTier1Def, VoidTier2Def, and VoidTier3Def.");
			voidItems = LoLItems.MyConfig.Bind<string>("GuardiansBlade", "Void Items", "", "Set regular items to convert into this void item (Only if the rarity is set as a void tier). Items should be separated by a comma, no spaces. The item should be the in game item ID, which may differ from the item name.");
			cooldownReduction = LoLItems.MyConfig.Bind<float>("GuardiansBlade", "Cooldown Reduction", 10f, "Amount of cooldown reduction each item will grant.");
		}

		private static void CreateItem()
		{
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			myItemDef = ScriptableObject.CreateInstance<ItemDef>();
			((Object)myItemDef).name = "GuardiansBlade";
			myItemDef.nameToken = "GuardiansBlade";
			myItemDef.pickupToken = "GuardiansBladeItem";
			myItemDef.descriptionToken = "GuardiansBladeDesc";
			myItemDef.loreToken = "GuardiansBladeLore";
			myItemDef._itemTierDef = Addressables.LoadAssetAsync<ItemTierDef>((object)Utilities.GetRarityFromString(rarity.Value)).WaitForCompletion();
			myItemDef.pickupIconSprite = Assets.icons.LoadAsset<Sprite>("GuardiansBladeIcon");
			myItemDef.pickupModelPrefab = Assets.prefabs.LoadAsset<GameObject>("GuardiansBladePrefab");
			myItemDef.canRemove = true;
			myItemDef.hidden = false;
			myItemDef.tags = (ItemTag[])(object)new ItemTag[1] { (ItemTag)3 };
		}

		private static void hooks()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Expected O, but got Unknown
			object obj = <>O.<1>__RecalculateStatsAPI_GetStatCoefficients;
			if (obj == null)
			{
				StatHookEventHandler val = RecalculateStatsAPI_GetStatCoefficients;
				<>O.<1>__RecalculateStatsAPI_GetStatCoefficients = val;
				obj = (object)val;
			}
			RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)obj;
			object obj2 = <>c.<>9__24_0;
			if (obj2 == null)
			{
				hook_HandleInventoryChanged val2 = delegate(orig_HandleInventoryChanged orig, Inventory self)
				{
					//IL_000f: Unknown result type (might be due to invalid IL or missing references)
					orig.Invoke(self);
					int itemCount = self.GetItemCount(myItemDef.itemIndex);
					if (itemCount > 0)
					{
						float num = Math.Abs(Utilities.HyperbolicScale(itemCount, cooldownReduction.Value / 100f) - 1f);
						Utilities.SetValueInDictionary(ref cooldownReductionTracker, ((Component)self).GetComponentInParent<CharacterMaster>(), Math.Abs(num - 1f) * 100f, cooldownReductionTrackerToken, checkMinionOwnership: false);
					}
				};
				<>c.<>9__24_0 = val2;
				obj2 = (object)val2;
			}
			Inventory.HandleInventoryChanged += (hook_HandleInventoryChanged)obj2;
		}

		private static void RecalculateStatsAPI_GetStatCoefficients(CharacterBody characterBody, StatHookEventArgs args)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			int? obj;
			if (characterBody == null)
			{
				obj = null;
			}
			else
			{
				Inventory inventory = characterBody.inventory;
				obj = ((inventory != null) ? new int?(inventory.GetItemCount(myItemDef.itemIndex)) : null);
			}
			int? num = obj;
			int valueOrDefault = num.GetValueOrDefault();
			if (valueOrDefault > 0)
			{
				float num2 = Utilities.HyperbolicScale(valueOrDefault, cooldownReduction.Value / 100f);
				args.utilityCooldownMultAdd -= num2;
				args.secondaryCooldownMultAdd -= num2;
			}
		}

		private static (string, string) GetDisplayInformation(CharacterMaster masterRef)
		{
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)masterRef == (Object)null)
			{
				return (Language.GetString(myItemDef.descriptionToken), "");
			}
			string text = "";
			float value;
			return new ValueTuple<string, string>(item2: (!cooldownReductionTracker.TryGetValue(((NetworkBehaviour)masterRef).netId, out value)) ? (text + "<br><br>Cooldown reduction: 0") : (text + "<br><br>Cooldown reduction: " + $"{value:F1}"), item1: Language.GetString(myItemDef.descriptionToken));
		}

		private static void AddTokens()
		{
			LanguageAPI.Add("GuardiansBlade", "GuardiansBlade");
			LanguageAPI.Add("GuardiansBladeItem", "Reduce the cooldown on secondary and utility skills");
			LanguageAPI.Add("GuardiansBladeDesc", "Reduce the cooldown on your secondary and utility skills by <style=cIsUtility>" + cooldownReduction.Value + "%</style> <style=cStack>(+" + cooldownReduction.Value + ")</style>. Scales hyperbolically, just like tougher times.");
			LanguageAPI.Add("GuardiansBladeLore", "Awesome Refund And Movement.");
		}

		public static void SetupNetworkMappings()
		{
			LoLItems.networkMappings.Add(cooldownReductionTrackerToken, cooldownReductionTracker);
		}
	}
	internal class GuinsoosRageblade
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static hook_OnHitEnemy <>9__24_0;

			internal void <hooks>b__24_0(orig_OnHitEnemy orig, GlobalEventManager self, DamageInfo damageInfo, GameObject victim)
			{
				//IL_0049: Unknown result type (might be due to invalid IL or missing references)
				if (Object.op_Implicit((Object)(object)damageInfo.attacker))
				{
					CharacterBody component = damageInfo.attacker.GetComponent<CharacterBody>();
					CharacterBody component2 = victim.GetComponent<CharacterBody>();
					if (Object.op_Implicit((Object)(object)((component != null) ? component.inventory : null)))
					{
						int itemCount = component.inventory.GetItemCount(myItemDef.itemIndex);
						if (itemCount > 0 && damageInfo.procCoefficient > 0f)
						{
							float num = procCoef.Value * (float)itemCount;
							Utilities.SetValueInDictionary(ref totalProcCoef, component.master, num, totalProcCoefToken);
							damageInfo.procCoefficient += num;
						}
					}
				}
				orig.Invoke(self, damageInfo, victim);
			}
		}

		public static ItemDef myItemDef;

		public static Dictionary<NetworkInstanceId, float> totalProcCoef = new Dictionary<NetworkInstanceId, float>();

		public static string totalProcCoefToken = "GuinsoosRageblade.totalProcCoef";

		public static Dictionary<ItemInventoryDisplay, CharacterMaster> DisplayToMasterRef = new Dictionary<ItemInventoryDisplay, CharacterMaster>();

		public static Dictionary<ItemIcon, CharacterMaster> IconToMasterRef = new Dictionary<ItemIcon, CharacterMaster>();

		public static ConfigEntry<float> procCoef { get; set; }

		public static ConfigEntry<bool> enabled { get; set; }

		public static ConfigEntry<string> rarity { get; set; }

		public static ConfigEntry<string> voidItems { get; set; }

		internal static void Init()
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Expected O, but got Unknown
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Expected O, but got Unknown
			LoadConfig();
			if (enabled.Value)
			{
				CreateItem();
				AddTokens();
				ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null);
				ItemAPI.Add(new CustomItem(myItemDef, val));
				hooks();
				Utilities.SetupReadOnlyHooks(DisplayToMasterRef, IconToMasterRef, myItemDef, GetDisplayInformation, rarity, voidItems, "GuinsoosRageblade");
				SetupNetworkMappings();
			}
		}

		private static void LoadConfig()
		{
			enabled = LoLItems.MyConfig.Bind<bool>("GuinsoosRageblade", "Enabled", true, "Determines if the item should be loaded by the game.");
			rarity = LoLItems.MyConfig.Bind<string>("GuinsoosRageblade", "Rarity", "Tier2Def", "Set the rarity of the item. Valid values: Tier1Def, Tier2Def, Tier3Def, VoidTier1Def, VoidTier2Def, and VoidTier3Def.");
			voidItems = LoLItems.MyConfig.Bind<string>("GuinsoosRageblade", "Void Items", "", "Set regular items to convert into this void item (Only if the rarity is set as a void tier). Items should be separated by a comma, no spaces. The item should be the in game item ID, which may differ from the item name.");
			procCoef = LoLItems.MyConfig.Bind<float>("GuinsoosRageblade", "ProcCoef", 0.1f, "Amount of profCoef each item will grant");
		}

		private static void CreateItem()
		{
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			myItemDef = ScriptableObject.CreateInstance<ItemDef>();
			((Object)myItemDef).name = "GuinsoosRageblade";
			myItemDef.nameToken = "GuinsoosRageblade";
			myItemDef.pickupToken = "GuinsoosRagebladeItem";
			myItemDef.descriptionToken = "GuinsoosRagebladeDesc";
			myItemDef.loreToken = "GuinsoosRagebladeLore";
			myItemDef._itemTierDef = Addressables.LoadAssetAsync<ItemTierDef>((object)Utilities.GetRarityFromString(rarity.Value)).WaitForCompletion();
			myItemDef.pickupIconSprite = Assets.icons.LoadAsset<Sprite>("GuinsoosRagebladeIcon");
			myItemDef.pickupModelPrefab = Assets.prefabs.LoadAsset<GameObject>("GuinsoosRagebladePrefab");
			myItemDef.canRemove = true;
			myItemDef.hidden = false;
			myItemDef.tags = (ItemTag[])(object)new ItemTag[1] { (ItemTag)3 };
		}

		private static void hooks()
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Expected O, but got Unknown
			object obj = <>c.<>9__24_0;
			if (obj == null)
			{
				hook_OnHitEnemy val = delegate(orig_OnHitEnemy orig, GlobalEventManager self, DamageInfo damageInfo, GameObject victim)
				{
					//IL_0049: Unknown result type (might be due to invalid IL or missing references)
					if (Object.op_Implicit((Object)(object)damageInfo.attacker))
					{
						CharacterBody component = damageInfo.attacker.GetComponent<CharacterBody>();
						CharacterBody component2 = victim.GetComponent<CharacterBody>();
						if (Object.op_Implicit((Object)(object)((component != null) ? component.inventory : null)))
						{
							int itemCount = component.inventory.GetItemCount(myItemDef.itemIndex);
							if (itemCount > 0 && damageInfo.procCoefficient > 0f)
							{
								float num = procCoef.Value * (float)itemCount;
								Utilities.SetValueInDictionary(ref totalProcCoef, component.master, num, totalProcCoefToken);
								damageInfo.procCoefficient += num;
							}
						}
					}
					orig.Invoke(self, damageInfo, victim);
				};
				<>c.<>9__24_0 = val;
				obj = (object)val;
			}
			GlobalEventManager.OnHitEnemy += (hook_OnHitEnemy)obj;
		}

		private static (string, string) GetDisplayInformation(CharacterMaster masterRef)
		{
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)masterRef == (Object)null)
			{
				return (Language.GetString(myItemDef.descriptionToken), "");
			}
			string text = "";
			float value;
			return new ValueTuple<string, string>(item2: (!totalProcCoef.TryGetValue(((NetworkBehaviour)masterRef).netId, out value)) ? (text + "<br><br>Extra procCoef: 0") : (text + "<br><br>Extra procCoef: " + $"{value:F1}"), item1: Language.GetString(myItemDef.descriptionToken));
		}

		private static void AddTokens()
		{
			LanguageAPI.Add("GuinsoosRageblade", "GuinsoosRageblade");
			LanguageAPI.Add("GuinsoosRagebladeItem", "Increase proc coefficient of everything");
			LanguageAPI.Add("GuinsoosRagebladeDesc", "Gives <style=cIsUtility>" + procCoef.Value + "</style> <style=cStack>(+" + procCoef.Value + ")</style> proc coefficient to everything");
			LanguageAPI.Add("GuinsoosRagebladeLore", "Procs go brrrrrrr.");
		}

		public static void SetupNetworkMappings()
		{
			LoLItems.networkMappings.Add(totalProcCoefToken, totalProcCoef);
		}
	}
	internal class Heartsteel
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static Func<CharacterMaster, (string, string)> <0>__GetDisplayInformation;

			public static StatHookEventHandler <1>__RecalculateStatsAPI_GetStatCoefficients;
		}

		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static hook_OnCharacterDeath <>9__37_0;

			public static hook_OnHitEnemy <>9__37_1;

			internal void <hooks>b__37_0(orig_OnCharacterDeath orig, GlobalEventManager globalEventManager, DamageReport damageReport)
			{
				//IL_000e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0013: Unknown result type (might be due to invalid IL or missing references)
				//IL_0038: Unknown result type (might be due to invalid IL or missing references)
				//IL_003d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0071: Unknown result type (might be due to invalid IL or missing references)
				//IL_0089: Unknown result type (might be due to invalid IL or missing references)
				//IL_0090: Expected O, but got Unknown
				//IL_0092: Unknown result type (might be due to invalid IL or missing references)
				//IL_0093: Unknown result type (might be due to invalid IL or missing references)
				orig.Invoke(globalEventManager, damageReport);
				GameObject val = null;
				Transform val2 = null;
				Vector3 origin = Vector3.zero;
				if (Object.op_Implicit((Object)(object)damageReport.victim))
				{
					val = ((Component)damageReport.victim).gameObject;
					val2 = val.transform;
					origin = val2.position;
				}
				CharacterMaster attackerMaster = damageReport.attackerMaster;
				if ((Object)(object)((attackerMaster != null) ? attackerMaster.inventory : null) != (Object)null)
				{
					int itemCount = damageReport.attackerMaster.inventory.GetItemCount(myItemDef.itemIndex);
					if (itemCount > 0)
					{
						InfusionOrb val3 = new InfusionOrb();
						((Orb)val3).origin = origin;
						((Orb)val3).target = Util.FindBodyMainHurtBox(damageReport.attackerBody);
						val3.maxHpValue = 0;
						OrbManager.instance.AddOrb((Orb)(object)val3);
						Utilities.AddValueInDictionary(ref heartsteelHealth, damageReport.attackerMaster, bonusHealthAmount.Value * (float)itemCount, heartsteelHealthToken, checkMinionOwnership: false);
					}
				}
			}

			internal void <hooks>b__37_1(orig_OnHitEnemy orig, GlobalEventManager self, DamageInfo damageInfo, GameObject victim)
			{
				//IL_0069: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
				//IL_010e: Unknown result type (might be due to invalid IL or missing references)
				orig.Invoke(self, damageInfo, victim);
				if (!Object.op_Implicit((Object)(object)damageInfo.attacker) || !(damageInfo.procCoefficient > 0f))
				{
					return;
				}
				CharacterBody component = damageInfo.attacker.GetComponent<CharacterBody>();
				CharacterBody component2 = victim.GetComponent<CharacterBody>();
				if (Object.op_Implicit((Object)(object)((component != null) ? component.inventory : null)))
				{
					int itemCount = component.inventory.GetItemCount(myItemDef.itemIndex);
					if (itemCount > 0 && !component.HasBuff(myTimerBuffDef))
					{
						component.healthComponent.body.AddTimedBuff(myTimerBuffDef, damageCooldown.Value);
						float num = component.healthComponent.fullHealth * (float)itemCount * damageBonus.Value / 100f * damageInfo.procCoefficient;
						damageInfo.procCoefficient = 1f;
						damageInfo.damageType = (DamageType)0;
						damageInfo.inflictor = damageInfo.attacker;
						damageInfo.damage = num;
						damageInfo.damageColorIndex = (DamageColorIndex)3;
						component2.healthComponent.TakeDamage(damageInfo);
						Utilities.AddValueInDictionary(ref heartsteelBonusDamage, component.master, num, heartsteelBonusDamageToken, checkMinionOwnership: false);
						AkSoundEngine.PostEvent(triggerSoundEffectID, damageInfo.attacker.gameObject);
					}
				}
			}
		}

		public static ItemDef myItemDef;

		public static BuffDef myTimerBuffDef;

		public static Dictionary<NetworkInstanceId, float> heartsteelHealth = new Dictionary<NetworkInstanceId, float>();

		public static string heartsteelHealthToken = "Heartsteel.heartsteelHealth";

		public static Dictionary<NetworkInstanceId, float> heartsteelBonusDamage = new Dictionary<NetworkInstanceId, float>();

		public static string heartsteelBonusDamageToken = "Heartsteel.heartsteelBonusDamage";

		public static Dictionary<ItemInventoryDisplay, CharacterMaster> DisplayToMasterRef = new Dictionary<ItemInventoryDisplay, CharacterMaster>();

		public static Dictionary<ItemIcon, CharacterMaster> IconToMasterRef = new Dictionary<ItemIcon, CharacterMaster>();

		public static uint triggerSoundEffectID = 3202319100u;

		public static ConfigEntry<float> bonusHealthAmount { get; set; }

		public static ConfigEntry<float> damageCooldown { get; set; }

		public static ConfigEntry<float> damageBonus { get; set; }

		public static ConfigEntry<bool> enabled { get; set; }

		public static ConfigEntry<string> rarity { get; set; }

		public static ConfigEntry<string> voidItems { get; set; }

		internal static void Init()
		{
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Expected O, but got Unknown
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Expected O, but got Unknown
			LoadConfig();
			if (enabled.Value)
			{
				CreateItem();
				CreateBuff();
				AddTokens();
				ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null);
				ItemAPI.Add(new CustomItem(myItemDef, val));
				ContentAddition.AddBuffDef(myTimerBuffDef);
				hooks();
				Utilities.SetupReadOnlyHooks(DisplayToMasterRef, IconToMasterRef, myItemDef, GetDisplayInformation, rarity, voidItems, "Heartsteel");
				SetupNetworkMappings();
			}
		}

		private static void LoadConfig()
		{
			enabled = LoLItems.MyConfig.Bind<bool>("Heartsteel", "Enabled", true, "Determines if the item should be loaded by the game.");
			rarity = LoLItems.MyConfig.Bind<string>("Heartsteel", "Rarity", "Tier3Def", "Set the rarity of the item. Valid values: Tier1Def, Tier2Def, Tier3Def, VoidTier1Def, VoidTier2Def, and VoidTier3Def.");
			voidItems = LoLItems.MyConfig.Bind<string>("Heartsteel", "Void Items", "", "Set regular items to convert into this void item (Only if the rarity is set as a void tier). Items should be separated by a comma, no spaces. The item should be the in game item ID, which may differ from the item name.");
			bonusHealthAmount = LoLItems.MyConfig.Bind<float>("Heartsteel", "Health Per Kill", 2f, "Amount of health per kill each item will grant.");
			damageCooldown = LoLItems.MyConfig.Bind<float>("Heartsteel", "Damage Cooldown", 10f, "The cooldown of the damage proc.");
			damageBonus = LoLItems.MyConfig.Bind<float>("Heartsteel", "Bonus Damage Percent", 50f, "The percentage of your health that will be dealt as damage.");
		}

		private static void CreateItem()
		{
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			myItemDef = ScriptableObject.CreateInstance<ItemDef>();
			((Object)myItemDef).name = "Heartsteel";
			myItemDef.nameToken = "Heartsteel";
			myItemDef.pickupToken = "HeartsteelItem";
			myItemDef.descriptionToken = "HeartsteelDesc";
			myItemDef.loreToken = "HeartsteelLore";
			myItemDef._itemTierDef = Addressables.LoadAssetAsync<ItemTierDef>((object)Utilities.GetRarityFromString(rarity.Value)).WaitForCompletion();
			myItemDef.pickupIconSprite = Assets.icons.LoadAsset<Sprite>("HeartsteelIcon");
			myItemDef.pickupModelPrefab = Assets.prefabs.LoadAsset<GameObject>("HeartsteelPrefab");
			myItemDef.canRemove = true;
			myItemDef.hidden = false;
			myItemDef.tags = (ItemTag[])(object)new ItemTag[2]
			{
				(ItemTag)2,
				(ItemTag)6
			};
		}

		private static void CreateBuff()
		{
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			myTimerBuffDef = ScriptableObject.CreateInstance<BuffDef>();
			myTimerBuffDef.iconSprite = Assets.icons.LoadAsset<Sprite>("HeartsteelIcon");
			((Object)myTimerBuffDef).name = "HeartsteelTimerBuff";
			myTimerBuffDef.canStack = false;
			myTimerBuffDef.isDebuff = true;
			myTimerBuffDef.isCooldown = true;
			myTimerBuffDef.isHidden = false;
			myTimerBuffDef.buffColor = Color.grey;
		}

		private static void hooks()
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Expected O, but got Unknown
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Expected O, but got Unknown
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Expected O, but got Unknown
			object obj = <>c.<>9__37_0;
			if (obj == null)
			{
				hook_OnCharacterDeath val = delegate(orig_OnCharacterDeath orig, GlobalEventManager globalEventManager, DamageReport damageReport)
				{
					//IL_000e: Unknown result type (might be due to invalid IL or missing references)
					//IL_0013: Unknown result type (might be due to invalid IL or missing references)
					//IL_0038: Unknown result type (might be due to invalid IL or missing references)
					//IL_003d: Unknown result type (might be due to invalid IL or missing references)
					//IL_0071: Unknown result type (might be due to invalid IL or missing references)
					//IL_0089: Unknown result type (might be due to invalid IL or missing references)
					//IL_0090: Expected O, but got Unknown
					//IL_0092: Unknown result type (might be due to invalid IL or missing references)
					//IL_0093: Unknown result type (might be due to invalid IL or missing references)
					orig.Invoke(globalEventManager, damageReport);
					GameObject val4 = null;
					Transform val5 = null;
					Vector3 origin = Vector3.zero;
					if (Object.op_Implicit((Object)(object)damageReport.victim))
					{
						val4 = ((Component)damageReport.victim).gameObject;
						val5 = val4.transform;
						origin = val5.position;
					}
					CharacterMaster attackerMaster = damageReport.attackerMaster;
					if ((Object)(object)((attackerMaster != null) ? attackerMaster.inventory : null) != (Object)null)
					{
						int itemCount2 = damageReport.attackerMaster.inventory.GetItemCount(myItemDef.itemIndex);
						if (itemCount2 > 0)
						{
							InfusionOrb val6 = new InfusionOrb();
							((Orb)val6).origin = origin;
							((Orb)val6).target = Util.FindBodyMainHurtBox(damageReport.attackerBody);
							val6.maxHpValue = 0;
							OrbManager.instance.AddOrb((Orb)(object)val6);
							Utilities.AddValueInDictionary(ref heartsteelHealth, damageReport.attackerMaster, bonusHealthAmount.Value * (float)itemCount2, heartsteelHealthToken, checkMinionOwnership: false);
						}
					}
				};
				<>c.<>9__37_0 = val;
				obj = (object)val;
			}
			GlobalEventManager.OnCharacterDeath += (hook_OnCharacterDeath)obj;
			object obj2 = <>c.<>9__37_1;
			if (obj2 == null)
			{
				hook_OnHitEnemy val2 = delegate(orig_OnHitEnemy orig, GlobalEventManager self, DamageInfo damageInfo, GameObject victim)
				{
					//IL_0069: Unknown result type (might be due to invalid IL or missing references)
					//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
					//IL_010e: Unknown result type (might be due to invalid IL or missing references)
					orig.Invoke(self, damageInfo, victim);
					if (Object.op_Implicit((Object)(object)damageInfo.attacker) && damageInfo.procCoefficient > 0f)
					{
						CharacterBody component = damageInfo.attacker.GetComponent<CharacterBody>();
						CharacterBody component2 = victim.GetComponent<CharacterBody>();
						if (Object.op_Implicit((Object)(object)((component != null) ? component.inventory : null)))
						{
							int itemCount = component.inventory.GetItemCount(myItemDef.itemIndex);
							if (itemCount > 0 && !component.HasBuff(myTimerBuffDef))
							{
								component.healthComponent.body.AddTimedBuff(myTimerBuffDef, damageCooldown.Value);
								float num = component.healthComponent.fullHealth * (float)itemCount * damageBonus.Value / 100f * damageInfo.procCoefficient;
								damageInfo.procCoefficient = 1f;
								damageInfo.damageType = (DamageType)0;
								damageInfo.inflictor = damageInfo.attacker;
								damageInfo.damage = num;
								damageInfo.damageColorIndex = (DamageColorIndex)3;
								component2.healthComponent.TakeDamage(damageInfo);
								Utilities.AddValueInDictionary(ref heartsteelBonusDamage, component.master, num, heartsteelBonusDamageToken, checkMinionOwnership: false);
								AkSoundEngine.PostEvent(triggerSoundEffectID, damageInfo.attacker.gameObject);
							}
						}
					}
				};
				<>c.<>9__37_1 = val2;
				obj2 = (object)val2;
			}
			GlobalEventManager.OnHitEnemy += (hook_OnHitEnemy)obj2;
			object obj3 = <>O.<1>__RecalculateStatsAPI_GetStatCoefficients;
			if (obj3 == null)
			{
				StatHookEventHandler val3 = RecalculateStatsAPI_GetStatCoefficients;
				<>O.<1>__RecalculateStatsAPI_GetStatCoefficients = val3;
				obj3 = (object)val3;
			}
			RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)obj3;
		}

		private static void RecalculateStatsAPI_GetStatCoefficients(CharacterBody characterBody, StatHookEventArgs args)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			CharacterMaster master = characterBody.master;
			if (master != null)
			{
				_ = ((NetworkBehaviour)master).netId;
				if (true && heartsteelHealth.TryGetValue(((NetworkBehaviour)characterBody.master).netId, out var value))
				{
					args.baseHealthAdd += value;
				}
			}
		}

		private static (string, string) GetDisplayInformation(CharacterMaster masterRef)
		{
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)masterRef == (Object)null)
			{
				return (Language.GetString(myItemDef.descriptionToken), "");
			}
			string text = "";
			text = ((!heartsteelHealth.TryGetValue(((NetworkBehaviour)masterRef).netId, out var value)) ? (text + "<br><br>Health gained: 0") : (text + "<br><br>Health gained: " + $"{value:#}"));
			float value2;
			return new ValueTuple<string, string>(item2: (!heartsteelBonusDamage.TryGetValue(((NetworkBehaviour)masterRef).netId, out value2)) ? (text + "<br>Damage dealt: 0") : (text + "<br>Damage dealt: " + $"{value2:#}"), item1: Language.GetString(myItemDef.descriptionToken));
		}

		private static void AddTokens()
		{
			LanguageAPI.Add("Heartsteel", "Heartsteel");
			LanguageAPI.Add("HeartsteelItem", "Gain permanent health on kill with no cap. Every few seconds deal a portion of your health as extra damage on hit.");
			LanguageAPI.Add("HeartsteelDesc", "Adds <style=cIsHealth>" + bonusHealthAmount.Value + "</style> <style=cStack>(+" + bonusHealthAmount.Value + ")</style> base health per kill with no cap. Every <style=cIsUtility>" + damageCooldown.Value + "</style> seconds deal <style=cIsDamage>" + damageBonus.Value + "%</style> of your max health as damage on hit.");
			LanguageAPI.Add("HeartsteelLore", "Lore was meant to go here, but Sion trampled it.");
		}

		public static void SetupNetworkMappings()
		{
			LoLItems.networkMappings.Add(heartsteelBonusDamageToken, heartsteelBonusDamage);
			LoLItems.networkMappings.Add(heartsteelHealthToken, heartsteelHealth);
		}
	}
	internal class ImmortalShieldbow
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static Func<CharacterMaster, (string, string)> <0>__GetDisplayInformation;

			public static StatHookEventHandler <1>__RecalculateStatsAPI_GetStatCoefficients;
		}

		public static ItemDef myItemDef;

		public static BuffDef myBuffDefCooldown;

		public static Dictionary<NetworkInstanceId, float> totalShieldGiven = new Dictionary<NetworkInstanceId, float>();

		public static string totalShieldGivenToken = "ImmortalShieldbow.totalShieldGiven";

		public static Dictionary<ItemInventoryDisplay, CharacterMaster> DisplayToMasterRef = new Dictionary<ItemInventoryDisplay, CharacterMaster>();

		public static Dictionary<ItemIcon, CharacterMaster> IconToMasterRef = new Dictionary<ItemIcon, CharacterMaster>();

		public static uint procSoundEffect = 2060112413u;

		public static ConfigEntry<float> barrierPercent { get; set; }

		public static ConfigEntry<float> buffCooldown { get; set; }

		public static ConfigEntry<float> barrierThreshold { get; set; }

		public static ConfigEntry<bool> enabled { get; set; }

		public static ConfigEntry<string> rarity { get; set; }

		public static ConfigEntry<string> voidItems { get; set; }

		internal static void Init()
		{
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Expected O, but got Unknown
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Expected O, but got Unknown
			LoadConfig();
			if (enabled.Value)
			{
				CreateItem();
				CreateBuff();
				AddTokens();
				ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null);
				ItemAPI.Add(new CustomItem(myItemDef, val));
				ContentAddition.AddBuffDef(myBuffDefCooldown);
				hooks();
				Utilities.SetupReadOnlyHooks(DisplayToMasterRef, IconToMasterRef, myItemDef, GetDisplayInformation, rarity, voidItems, "ImmortalShieldbow");
				SetupNetworkMappings();
			}
		}

		private static void LoadConfig()
		{
			enabled = LoLItems.MyConfig.Bind<bool>("ImmortalShieldbow", "Enabled", true, "Determines if the item should be loaded by the game.");
			rarity = LoLItems.MyConfig.Bind<string>("ImmortalShieldbow", "Rarity", "Tier2Def", "Set the rarity of the item. Valid values: Tier1Def, Tier2Def, Tier3Def, VoidTier1Def, VoidTier2Def, and VoidTier3Def.");
			voidItems = LoLItems.MyConfig.Bind<string>("ImmortalShieldbow", "Void Items", "", "Set regular items to convert into this void item (Only if the rarity is set as a void tier). Items should be separated by a comma, no spaces. The item should be the in game item ID, which may differ from the item name.");
			barrierPercent = LoLItems.MyConfig.Bind<float>("ImmortalShieldbow", "Barrier Percent", 40f, "Amount of percent max health barrier each item will grant.");
			buffCooldown = LoLItems.MyConfig.Bind<float>("ImmortalShieldbow", "Cooldown", 40f, "Cooldown of the barrier.");
			barrierThreshold = LoLItems.MyConfig.Bind<float>("ImmortalShieldbow", "Health Threshold", 30f, "Health threshold to trigger the barrier.");
		}

		private static void CreateItem()
		{
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			myItemDef = ScriptableObject.CreateInstance<ItemDef>();
			((Object)myItemDef).name = "ImmortalShieldbow";
			myItemDef.nameToken = "ImmortalShieldbow";
			myItemDef.pickupToken = "ImmortalShieldbowItem";
			myItemDef.descriptionToken = "ImmortalShieldbowDesc";
			myItemDef.loreToken = "ImmortalShieldbowLore";
			myItemDef._itemTierDef = Addressables.LoadAssetAsync<ItemTierDef>((object)Utilities.GetRarityFromString(rarity.Value)).WaitForCompletion();
			myItemDef.pickupIconSprite = Assets.icons.LoadAsset<Sprite>("ImmortalShieldbowIcon");
			myItemDef.pickupModelPrefab = Assets.prefabs.LoadAsset<GameObject>("ImmortalShieldbowPrefab");
			myItemDef.canRemove = true;
			myItemDef.hidden = false;
			myItemDef.tags = (ItemTag[])(object)new ItemTag[1] { (ItemTag)2 };
		}

		private static void CreateBuff()
		{
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			myBuffDefCooldown = ScriptableObject.CreateInstance<BuffDef>();
			myBuffDefCooldown.iconSprite = Assets.icons.LoadAsset<Sprite>("ImmortalShieldbowIcon");
			((Object)myBuffDefCooldown).name = "ImmortalShieldbowBuffCooldown";
			myBuffDefCooldown.buffColor = Color.gray;
			myBuffDefCooldown.canStack = false;
			myBuffDefCooldown.isDebuff = true;
			myBuffDefCooldown.isCooldown = true;
			myBuffDefCooldown.isHidden = false;
		}

		private static void hooks()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			object obj = <>O.<1>__RecalculateStatsAPI_GetStatCoefficients;
			if (obj == null)
			{
				StatHookEventHandler val = RecalculateStatsAPI_GetStatCoefficients;
				<>O.<1>__RecalculateStatsAPI_GetStatCoefficients = val;
				obj = (object)val;
			}
			RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)obj;
		}

		private static void RecalculateStatsAPI_GetStatCoefficients(CharacterBody characterBody, StatHookEventArgs args)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			int? obj;
			if (characterBody == null)
			{
				obj = null;
			}
			else
			{
				Inventory inventory = characterBody.inventory;
				obj = ((inventory != null) ? new int?(inventory.GetItemCount(myItemDef.itemIndex)) : null);
			}
			int? num = obj;
			int valueOrDefault = num.GetValueOrDefault();
			if (valueOrDefault <= 0)
			{
				return;
			}
			float? num2 = characterBody.healthComponent?.health;
			HealthComponent healthComponent = characterBody.healthComponent;
			if (!(num2 < ((healthComponent != null) ? new float?(healthComponent.fullHealth) : null) * barrierThreshold.Value / 100f) || characterBody.HasBuff(myBuffDefCooldown))
			{
				return;
			}
			AkSoundEngine.PostEvent(procSoundEffect, ((Component)characterBody).gameObject);
			if (NetworkServer.active)
			{
				float num3 = characterBody.healthComponent.fullHealth * barrierPercent.Value / 100f * (float)valueOrDefault;
				if (num3 > characterBody.healthComponent.fullHealth)
				{
					num3 = characterBody.healthComponent.fullHealth;
				}
				characterBody.healthComponent.AddBarrier(num3);
				Utilities.AddTimedBuff(characterBody, myBuffDefCooldown, buffCooldown.Value);
				Utilities.AddValueInDictionary(ref totalShieldGiven, characterBody.master, num3, totalShieldGivenToken, checkMinionOwnership: false);
			}
		}

		private static (string, string) GetDisplayInformation(CharacterMaster masterRef)
		{
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)masterRef == (Object)null)
			{
				return (Language.GetString(myItemDef.descriptionToken), "");
			}
			string text = "";
			float value;
			return new ValueTuple<string, string>(item2: (!totalShieldGiven.TryGetValue(((NetworkBehaviour)masterRef).netId, out value)) ? (text + "<br><br>Barrier given: 0") : (text + "<br><br>Barrier given: " + $"{value:#}"), item1: Language.GetString(myItemDef.descriptionToken));
		}

		private static void AddTokens()
		{
			LanguageAPI.Add("ImmortalShieldbow", "ImmortalShieldbow");
			LanguageAPI.Add("ImmortalShieldbowItem", "Gives a barrier when low on health.");
			LanguageAPI.Add("ImmortalShieldbowDesc", "Gives a barrier for <style=cIsHealth>" + barrierPercent.Value + "%</style> <style=cStack>(+" + barrierPercent.Value + "%)</style> of your max health when dropping below <style=cIsHealth>" + barrierThreshold.Value + "%</style> max health. On a <style=cIsUtility>" + buffCooldown.Value + "</style> second cooldown.");
			LanguageAPI.Add("ImmortalShieldbowLore", "Here to save you for when you mess up.");
			LanguageAPI.Add("ImmortalShieldbowBuff", "ImmortalShieldbow is recharging.");
		}

		public static void SetupNetworkMappings()
		{
			LoLItems.networkMappings.Add(totalShieldGivenToken, totalShieldGiven);
		}
	}
	internal class ImperialMandate
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static hook_TakeDamage <>9__24_0;

			internal void <hooks>b__24_0(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo)
			{
				//IL_004b: Unknown result type (might be due to invalid IL or missing references)
				//IL_007b: Unknown result type (might be due to invalid IL or missing references)
				//IL_007f: Unknown result type (might be due to invalid IL or missing references)
				//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
				//IL_00de: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e2: Invalid comparison between Unknown and I4
				//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
				//IL_00db: Unknown result type (might be due to invalid IL or missing references)
				//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
				if (Object.op_Implicit((Object)(object)damageInfo.attacker))
				{
					CharacterBody component = damageInfo.attacker.GetComponent<CharacterBody>();
					CharacterBody component2 = ((Component)self).GetComponent<CharacterBody>();
					if (Object.op_Implicit((Object)(object)((component != null) ? component.inventory : null)))
					{
						int itemCount = component.inventory.GetItemCount(myItemDef.itemIndex);
						if (itemCount > 0)
						{
							int num = 0;
							BuffIndex[] debuffBuffIndices = BuffCatalog.debuffBuffIndices;
							foreach (BuffIndex val in debuffBuffIndices)
							{
								if (component2.HasBuff(val))
								{
									num++;
								}
							}
							DotController val2 = DotController.FindDotController(((Component)component2).gameObject);
							if (Object.op_Implicit((Object)(object)val2))
							{
								for (DotIndex val3 = (DotIndex)0; (int)val3 < 9; val3 = (DotIndex)(val3 + 1))
								{
									if (val2.HasDotActive(val3))
									{
										num++;
									}
								}
							}
							float num2 = damageInfo.damage * damageAmpPerStack.Value / 100f * (float)itemCount * (float)num;
							damageInfo.damage += num2;
							Utilities.AddValueInDictionary(ref bonusDamageDealt, component.master, num2, bonusDamageDealtToken);
						}
					}
				}
				orig.Invoke(self, damageInfo);
			}
		}

		public static ItemDef myItemDef;

		public static Dictionary<NetworkInstanceId, float> bonusDamageDealt = new Dictionary<NetworkInstanceId, float>();

		public static string bonusDamageDealtToken = "ImperialMandate.bonusDamageDealt";

		public static Dictionary<ItemInventoryDisplay, CharacterMaster> DisplayToMasterRef = new Dictionary<ItemInventoryDisplay, CharacterMaster>();

		public static Dictionary<ItemIcon, CharacterMaster> IconToMasterRef = new Dictionary<ItemIcon, CharacterMaster>();

		public static ConfigEntry<float> damageAmpPerStack { get; set; }

		public static ConfigEntry<bool> enabled { get; set; }

		public static ConfigEntry<string> rarity { get; set; }

		public static ConfigEntry<string> voidItems { get; set; }

		internal static void Init()
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Expected O, but got Unknown
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Expected O, but got Unknown
			LoadConfig();
			if (enabled.Value)
			{
				CreateItem();
				AddTokens();
				ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null);
				ItemAPI.Add(new CustomItem(myItemDef, val));
				hooks();
				Utilities.SetupReadOnlyHooks(DisplayToMasterRef, IconToMasterRef, myItemDef, GetDisplayInformation, rarity, voidItems, "ImperialMandate");
				SetupNetworkMappings();
			}
		}

		private static void LoadConfig()
		{
			enabled = LoLItems.MyConfig.Bind<bool>("ImperialMandate", "Enabled", true, "Determines if the item should be loaded by the game.");
			rarity = LoLItems.MyConfig.Bind<string>("ImperialMandate", "Rarity", "VoidTier2Def", "Set the rarity of the item. Valid values: Tier1Def, Tier2Def, Tier3Def, VoidTier1Def, VoidTier2Def, and VoidTier3Def.");
			voidItems = LoLItems.MyConfig.Bind<string>("ImperialMandate", "Void Items", "DeathMark", "Set regular items to convert into this void item (Only if the rarity is set as a void tier). Items should be separated by a comma, no spaces. The item should be the in game item ID, which may differ from the item name.");
			damageAmpPerStack = LoLItems.MyConfig.Bind<float>("ImperialMandate", "Damage Amp", 8f, "Amount of bonus damage each item will grant.");
		}

		private static void CreateItem()
		{
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			myItemDef = ScriptableObject.CreateInstance<ItemDef>();
			((Object)myItemDef).name = "ImperialMandate";
			myItemDef.nameToken = "ImperialMandate";
			myItemDef.pickupToken = "ImperialMandateItem";
			myItemDef.descriptionToken = "ImperialMandateDesc";
			myItemDef.loreToken = "ImperialMandateLore";
			myItemDef._itemTierDef = Addressables.LoadAssetAsync<ItemTierDef>((object)Utilities.GetRarityFromString(rarity.Value)).WaitForCompletion();
			myItemDef.pickupIconSprite = Assets.icons.LoadAsset<Sprite>("ImperialMandateIcon");
			myItemDef.pickupModelPrefab = Assets.prefabs.LoadAsset<GameObject>("ImperialMandatePrefab");
			myItemDef.canRemove = true;
			myItemDef.hidden = false;
			myItemDef.tags = (ItemTag[])(object)new ItemTag[1] { (ItemTag)1 };
		}

		private static void hooks()
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Expected O, but got Unknown
			object obj = <>c.<>9__24_0;
			if (obj == null)
			{
				hook_TakeDamage val = delegate(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo)
				{
					//IL_004b: Unknown result type (might be due to invalid IL or missing references)
					//IL_007b: Unknown result type (might be due to invalid IL or missing references)
					//IL_007f: Unknown result type (might be due to invalid IL or missing references)
					//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
					//IL_00de: Unknown result type (might be due to invalid IL or missing references)
					//IL_00e2: Invalid comparison between Unknown and I4
					//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
					//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
					//IL_00db: Unknown result type (might be due to invalid IL or missing references)
					//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
					if (Object.op_Implicit((Object)(object)damageInfo.attacker))
					{
						CharacterBody component = damageInfo.attacker.GetComponent<CharacterBody>();
						CharacterBody component2 = ((Component)self).GetComponent<CharacterBody>();
						if (Object.op_Implicit((Object)(object)((component != null) ? component.inventory : null)))
						{
							int itemCount = component.inventory.GetItemCount(myItemDef.itemIndex);
							if (itemCount > 0)
							{
								int num = 0;
								BuffIndex[] debuffBuffIndices = BuffCatalog.debuffBuffIndices;
								foreach (BuffIndex val2 in debuffBuffIndices)
								{
									if (component2.HasBuff(val2))
									{
										num++;
									}
								}
								DotController val3 = DotController.FindDotController(((Component)component2).gameObject);
								if (Object.op_Implicit((Object)(object)val3))
								{
									for (DotIndex val4 = (DotIndex)0; (int)val4 < 9; val4 = (DotIndex)(val4 + 1))
									{
										if (val3.HasDotActive(val4))
										{
											num++;
										}
									}
								}
								float num2 = damageInfo.damage * damageAmpPerStack.Value / 100f * (float)itemCount * (float)num;
								damageInfo.damage += num2;
								Utilities.AddValueInDictionary(ref bonusDamageDealt, component.master, num2, bonusDamageDealtToken);
							}
						}
					}
					orig.Invoke(self, damageInfo);
				};
				<>c.<>9__24_0 = val;
				obj = (object)val;
			}
			HealthComponent.TakeDamage += (hook_TakeDamage)obj;
		}

		private static (string, string) GetDisplayInformation(CharacterMaster masterRef)
		{
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)masterRef == (Object)null)
			{
				return (Language.GetString(myItemDef.descriptionToken), "");
			}
			string text = "";
			float value;
			return new ValueTuple<string, string>(item2: (!bonusDamageDealt.TryGetValue(((NetworkBehaviour)masterRef).netId, out value)) ? (text + "<br><br>Damage dealt: 0") : (text + "<br><br>Damage dealt: " + $"{value:#}"), item1: Language.GetString(myItemDef.descriptionToken));
		}

		private static void AddTokens()
		{
			LanguageAPI.Add("ImperialMandate", "ImperialMandate");
			LanguageAPI.Add("ImperialMandateItem", "Do more damage to enemies for each debuff. Corrupts <style=cIsVoid>Death Mark</style>.");
			LanguageAPI.Add("ImperialMandateDesc", "Do <style=cIsDamage>" + damageAmpPerStack.Value + "%</style> <style=cStack>(+" + damageAmpPerStack.Value + "%)</style> more damage to enemies for each debuff. Corrupts <style=cIsVoid>Death Mark</style>.");
			LanguageAPI.Add("ImperialMandateLore", "Hunt your prey.");
		}

		public static void SetupNetworkMappings()
		{