Decompiled source of LoLItems v1.3.1

LoLItems.dll

Decompiled 3 weeks 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.1", FrameworkDisplayName = ".NET Standard 2.1")]
[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+982688563d07229a24b7fa878a92496ffc01f36f")]
[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 MyAssets
{
	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>("Banner of Command", "Enabled", true, "Determines if the item should be loaded by the game.");
			Rarity = LoLItems.MyConfig.Bind<string>("Banner of Command", "Rarity", "Tier1Def", "Set the rarity of the item. Valid values: Tier1Def, Tier2Def, Tier3Def, VoidTier1Def, VoidTier2Def, and VoidTier3Def.");
			VoidItems = LoLItems.MyConfig.Bind<string>("Banner of Command", "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>("Banner of Command", "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 = MyAssets.icons.LoadAsset<Sprite>("BannerOfCommandIcon");
			myItemDef.pickupModelPrefab = MyAssets.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:#, ##0.##}"), item1: Language.GetString(myItemDef.descriptionToken));
		}

		private static void AddTokens()
		{
			LanguageAPI.Add("BannerOfCommand", "Banner of Command");
			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_01a4: Unknown result type (might be due to invalid IL or missing references)
				//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
				//IL_020e: Unknown result type (might be due to invalid IL or missing references)
				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 = DamageTypeCombo.op_Implicit((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>("Blade of the Ruined King", "Enabled", true, "Determines if the item should be loaded by the game.");
			Rarity = LoLItems.MyConfig.Bind<string>("Blade of the Ruined King", "Rarity", "VoidTier2Def", "Set the rarity of the item. Valid values: Tier1Def, Tier2Def, Tier3Def, VoidTier1Def, VoidTier2Def, and VoidTier3Def.");
			VoidItems = LoLItems.MyConfig.Bind<string>("Blade of the Ruined King", "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>("Blade of the Ruined King", "On Hit Damage Percent", 5f, "Amount of on hit current health damage percent each item will grant.");
			ProcForBigHit = LoLItems.MyConfig.Bind<float>("Blade of the Ruined King", "On Hit Proc Requirement", 3f, "Amount of hits required to proc the on hit damage.");
			OnHitHealPercent = LoLItems.MyConfig.Bind<float>("Blade of the Ruined King", "Heal Percent", 20f, "Percentage of damage dealt to be gained as healing.");
			BigOnHitTimer = LoLItems.MyConfig.Bind<float>("Blade of the Ruined King", "Proc Cooldown", 10f, "Cooldown per enemy.");
			ProcDamageMin = LoLItems.MyConfig.Bind<float>("Blade of the Ruined King", "Min Proc Damage", 2f, "Multiplied by your base damage to determine the minimum proc damage.");
			ProcDamageMax = LoLItems.MyConfig.Bind<float>("Blade of the Ruined King", "Max Proc Damage", 25f, "Multiplied by your base damage to determine the maximum proc damage.");
			AttackSpeed = LoLItems.MyConfig.Bind<float>("Blade of the Ruined King", "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 = MyAssets.icons.LoadAsset<Sprite>("BorkIcon");
			myItemDef.pickupModelPrefab = MyAssets.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_01a4: Unknown result type (might be due to invalid IL or missing references)
					//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
					//IL_020e: Unknown result type (might be due to invalid IL or missing references)
					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 = DamageTypeCombo.op_Implicit((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:#, ##0.##}"));
			float value2;
			return new ValueTuple<string, string>(item2: (!borkBonusHeal.TryGetValue(((NetworkBehaviour)masterRef).netId, out value2)) ? (text + "<br>Healing: 0") : (text + "<br>Healing: " + $"{value2:#, ##0.##}"), item1: Language.GetString(myItemDef.descriptionToken));
		}

		private static void AddTokens()
		{
			LanguageAPI.Add("Bork", "Blade of the Ruined King");
			LanguageAPI.Add("BorkItem", "Increases 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_021f: Unknown result type (might be due to invalid IL or missing references)
				//IL_018a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0194: Unknown result type (might be due to invalid IL or missing references)
				//IL_01b6: 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; (float)j < KillsToBreak.Value; 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_0047: 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 = MyAssets.icons.LoadAsset<Sprite>("CullIcon");
			myItemDef.pickupModelPrefab = MyAssets.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 = MyAssets.icons.LoadAsset<Sprite>("CullIcon");
			((Object)myBuffDef).name = "Cull Stacks";
			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_021f: Unknown result type (might be due to invalid IL or missing references)
					//IL_018a: Unknown result type (might be due to invalid IL or missing references)
					//IL_0194: Unknown result type (might be due to invalid IL or missing references)
					//IL_01b6: 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; (float)k < KillsToBreak.Value; 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_0047: 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:#, ##0.##}"), item1: Language.GetString(myItemDef.descriptionToken));
		}

		private static void AddTokens()
		{
			LanguageAPI.Add("Cull", "Cull");
			LanguageAPI.Add("CullItem", "Gives gold when killing enemies. Turns into White Scrap when <style=cIsUtility>" + KillsToBreak.Value + "</style> enemies are killed.");
			LanguageAPI.Add("CullDesc", "Gives <style=cIsUtility>" + GoldOnKill.Value + "</style> <style=cStack>(+" + GoldOnKill.Value + ")</style> gold when killing an enemy. Upon killing <style=cIsUtility>" + KillsToBreak.Value + "</style> enemies, 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 ExperimentalHexplate
	{
		[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_OnSkillActivated <>9__34_0;

			internal void <Hooks>b__34_0(orig_OnSkillActivated orig, CharacterBody self, GenericSkill genericSkill)
			{
				if (!NetworkServer.active)
				{
					orig.Invoke(self, genericSkill);
					return;
				}
				GenericSkill val = self.skillLocator?.special;
				Inventory inventory = self.inventory;
				if (inventory != null && inventory.GetItemCount(myItemDef) > 0 && (Object)(object)val == (Object)(object)genericSkill)
				{
					Utilities.AddTimedBuff(self, myBuffDef, Duration.Value);
					Utilities.AddValueInDictionary(ref totalTimesActivated, self.master, 1f, totalTimesActivatedToken, checkMinionOwnership: false);
				}
				orig.Invoke(self, genericSkill);
			}
		}

		public static ItemDef myItemDef;

		public static BuffDef myBuffDef;

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

		public static string totalTimesActivatedToken = "ExperimentalHexplate.totalTimesActivated";

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

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

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

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

		public static ConfigEntry<float> MoveSpeed { 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, "ExperimentalHexplate");
				SetupNetworkMappings();
			}
		}

		private static void LoadConfig()
		{
			Enabled = LoLItems.MyConfig.Bind<bool>("Experimental Hexplate", "Enabled", true, "Determines if the item should be loaded by the game.");
			Rarity = LoLItems.MyConfig.Bind<string>("Experimental Hexplate", "Rarity", "Tier2Def", "Set the rarity of the item. Valid values: Tier1Def, Tier2Def, Tier3Def, VoidTier1Def, VoidTier2Def, and VoidTier3Def.");
			VoidItems = LoLItems.MyConfig.Bind<string>("Experimental Hexplate", "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.");
			Duration = LoLItems.MyConfig.Bind<float>("Experimental Hexplate", "Duration", 5f, "The duration of the item buff.");
			AttackSpeed = LoLItems.MyConfig.Bind<float>("Experimental Hexplate", "Attack Speed", 40f, "The amount of attack speed the item proc grants.");
			MoveSpeed = LoLItems.MyConfig.Bind<float>("Experimental Hexplate", "Movespeed", 32f, "The amount of movespeed the item proc grants.");
		}

		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 = "ExperimentalHexplate";
			myItemDef.nameToken = "ExperimentalHexplate";
			myItemDef.pickupToken = "ExperimentalHexplateItem";
			myItemDef.descriptionToken = "ExperimentalHexplateDesc";
			myItemDef.loreToken = "ExperimentalHexplateLore";
			myItemDef._itemTierDef = Addressables.LoadAssetAsync<ItemTierDef>((object)Utilities.GetRarityFromString(Rarity.Value)).WaitForCompletion();
			myItemDef.pickupIconSprite = MyAssets.icons.LoadAsset<Sprite>("ExperimentalHexplateIcon");
			myItemDef.pickupModelPrefab = MyAssets.prefabs.LoadAsset<GameObject>("ExperimentalHexplatePrefab");
			myItemDef.canRemove = true;
			myItemDef.hidden = false;
			myItemDef.tags = (ItemTag[])(object)new ItemTag[2]
			{
				(ItemTag)1,
				(ItemTag)3
			};
		}

		private static void CreateBuff()
		{
			myBuffDef = ScriptableObject.CreateInstance<BuffDef>();
			myBuffDef.iconSprite = MyAssets.icons.LoadAsset<Sprite>("ExperimentalHexplateIcon");
			((Object)myBuffDef).name = "ExperimentalHexplateBuff";
			myBuffDef.canStack = false;
			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_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__34_0;
			if (obj == null)
			{
				hook_OnSkillActivated val = delegate(orig_OnSkillActivated orig, CharacterBody self, GenericSkill genericSkill)
				{
					if (!NetworkServer.active)
					{
						orig.Invoke(self, genericSkill);
					}
					else
					{
						GenericSkill val3 = self.skillLocator?.special;
						Inventory inventory = self.inventory;
						if (inventory != null && inventory.GetItemCount(myItemDef) > 0 && (Object)(object)val3 == (Object)(object)genericSkill)
						{
							Utilities.AddTimedBuff(self, myBuffDef, Duration.Value);
							Utilities.AddValueInDictionary(ref totalTimesActivated, self.master, 1f, totalTimesActivatedToken, checkMinionOwnership: false);
						}
						orig.Invoke(self, genericSkill);
					}
				};
				<>c.<>9__34_0 = val;
				obj = (object)val;
			}
			CharacterBody.OnSkillActivated += (hook_OnSkillActivated)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)
		{
			//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 && characterBody.HasBuff(myBuffDef))
			{
				args.baseAttackSpeedAdd += ((valueOrDefault == 1) ? ((float)valueOrDefault * AttackSpeed.Value / 100f) : ((float)(valueOrDefault - 1) * AttackSpeed.Value / 100f / 2f + AttackSpeed.Value / 100f));
				args.baseMoveSpeedAdd += ((valueOrDefault == 1) ? ((float)valueOrDefault * MoveSpeed.Value / 10f) : ((float)(valueOrDefault - 1) * MoveSpeed.Value / 10f / 2f + MoveSpeed.Value / 10f));
			}
		}

		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: (!totalTimesActivated.TryGetValue(((NetworkBehaviour)masterRef).netId, out value)) ? (text + "<br><br>Times activated: 0") : (text + "<br><br>Times activated: " + $"{value:#, ##0.##}"), item1: Language.GetString(myItemDef.descriptionToken));
		}

		private static void AddTokens()
		{
			LanguageAPI.Add("ExperimentalHexplate", "Experimental Hexplate");
			LanguageAPI.Add("ExperimentalHexplateItem", "Using your Special skill temporarily increases your attack speed and movespeed.");
			LanguageAPI.Add("ExperimentalHexplateDesc", "Using your Special skill increases your attack speed by <style=cIsDamage>" + AttackSpeed.Value + "%</style> <style=cStack>(+ " + AttackSpeed.Value / 2f + "%)</style> and your movespeed by <style=cIsUtility>" + MoveSpeed.Value + "%</style> <style=cStack>(+ " + MoveSpeed.Value / 2f + "%)</style> for " + Duration.Value + " seconds.");
			LanguageAPI.Add("ExperimentalHexplateLore", "Was it wise to put on something this experimental? <br><br>Probably.");
			LanguageAPI.Add("ExperimentalHexplateBuff", "Experimental Hexplate");
		}

		public static void SetupNetworkMappings()
		{
			LoLItems.networkMappings.Add(totalTimesActivatedToken, totalTimesActivated);
		}
	}
	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>("Gargoyle Stoneplate", "Enabled", true, "Determines if the item should be loaded by the game.");
			BarrierPercent = LoLItems.MyConfig.Bind<float>("Gargoyle Stoneplate", "Barrier Percentage", 60f, "Percent of barrier Gargoyle Stoneplate will grant you.");
			BarrierCooldown = LoLItems.MyConfig.Bind<float>("Gargoyle Stoneplate", "Barrier Cooldown", 60f, "Cooldown of the item.");
			ArmorDuration = LoLItems.MyConfig.Bind<float>("Gargoyle Stoneplate", "Armor Duration", 2f, "Duration of the armor buff.");
			ArmorValue = LoLItems.MyConfig.Bind<float>("Gargoyle Stoneplate", "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 = MyAssets.icons.LoadAsset<Sprite>("GargoyleStoneplateIcon");
			myEquipmentDef.pickupModelPrefab = MyAssets.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 = MyAssets.icons.LoadAsset<Sprite>("GargoyleStoneplateIcon");
			((Object)gargoyleArmorBuff).name = "Gargoyle Stoneplate Armor Buff";
			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:#, ##0.##}"), 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>("Guardians Blade", "Enabled", true, "Determines if the item should be loaded by the game.");
			Rarity = LoLItems.MyConfig.Bind<string>("Guardians Blade", "Rarity", "Tier1Def", "Set the rarity of the item. Valid values: Tier1Def, Tier2Def, Tier3Def, VoidTier1Def, VoidTier2Def, and VoidTier3Def.");
			VoidItems = LoLItems.MyConfig.Bind<string>("Guardians Blade", "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>("Guardians Blade", "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 = MyAssets.icons.LoadAsset<Sprite>("GuardiansBladeIcon");
			myItemDef.pickupModelPrefab = MyAssets.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", "Guardian's Blade");
			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>("Guinsoos Rageblade", "Enabled", true, "Determines if the item should be loaded by the game.");
			Rarity = LoLItems.MyConfig.Bind<string>("Guinsoos Rageblade", "Rarity", "Tier2Def", "Set the rarity of the item. Valid values: Tier1Def, Tier2Def, Tier3Def, VoidTier1Def, VoidTier2Def, and VoidTier3Def.");
			VoidItems = LoLItems.MyConfig.Bind<string>("Guinsoos Rageblade", "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>("Guinsoos Rageblade", "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 = MyAssets.icons.LoadAsset<Sprite>("GuinsoosRagebladeIcon");
			myItemDef.pickupModelPrefab = MyAssets.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", "Guinsoo's Rageblade");
			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_008e: Unknown result type (might be due to invalid IL or missing references)
				//IL_008f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0090: Unknown result type (might be due to invalid IL or missing references)
				//IL_0095: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
				//IL_00af: Expected O, but got Unknown
				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
						{
							origin = origin,
							target = Util.FindBodyMainHurtBox(damageReport.attackerBody),
							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_00f5: Unknown result type (might be due to invalid IL or missing references)
				//IL_0113: 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 = DamageTypeCombo.op_Implicit((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 = MyAssets.icons.LoadAsset<Sprite>("HeartsteelIcon");
			myItemDef.pickupModelPrefab = MyAssets.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 = MyAssets.icons.LoadAsset<Sprite>("HeartsteelIcon");
			((Object)myTimerBuffDef).name = "Heartsteel Timer Debuff";
			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_008e: Unknown result type (might be due to invalid IL or missing references)
					//IL_008f: Unknown result type (might be due to invalid IL or missing references)
					//IL_0090: Unknown result type (might be due to invalid IL or missing references)
					//IL_0095: Unknown result type (might be due to invalid IL or missing references)
					//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
					//IL_00af: Expected O, but got Unknown
					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
							{
								origin = origin,
								target = Util.FindBodyMainHurtBox(damageReport.attackerBody),
								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_00f5: Unknown result type (might be due to invalid IL or missing references)
					//IL_0113: 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 = DamageTypeCombo.op_Implicit((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:#, ##0.##}"));
			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:#, ##0.##}"), 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>("Immortal Shieldbow", "Enabled", true, "Determines if the item should be loaded by the game.");
			Rarity = LoLItems.MyConfig.Bind<string>("Immortal Shieldbow", "Rarity", "Tier2Def", "Set the rarity of the item. Valid values: Tier1Def, Tier2Def, Tier3Def, VoidTier1Def, VoidTier2Def, and VoidTier3Def.");
			VoidItems = LoLItems.MyConfig.Bind<string>("Immortal Shieldbow", "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>("Immortal Shieldbow", "Barrier Percent", 40f, "Amount of percent max health barrier each item will grant.");
			BuffCooldown = LoLItems.MyConfig.Bind<float>("Immortal Shieldbow", "Cooldown", 40f, "Cooldown of the barrier.");
			BarrierThreshold = LoLItems.MyConfig.Bind<float>("Immortal Shieldbow", "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 = MyAssets.icons.LoadAsset<Sprite>("ImmortalShieldbowIcon");
			myItemDef.pickupModelPrefab = MyAssets.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 = MyAssets.icons.LoadAsset<Sprite>("ImmortalShieldbowIcon");
			((Object)myBuffDefCooldown).name = "Immortal Shieldbow Cooldown";
			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 re