Decompiled source of PvPKit v0.1.1

PvPKit.dll

Decompiled a month ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Threading.Tasks;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Core.Logging.Interpolation;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using Il2CppSystem.Collections.Generic;
using Microsoft.CodeAnalysis;
using ProjectM;
using ProjectM.Network;
using ProjectM.Scripting;
using ProjectM.Shared;
using PvPKit.Configs;
using PvPKit.Database;
using PvPKit.Utils;
using Stunlock.Core;
using Unity.Collections;
using Unity.Entities;
using UnityEngine;
using VampireCommandFramework;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("PvPKit")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("A mod that gives the Dracula Set to any player who uses the .kit command")]
[assembly: AssemblyFileVersion("0.1.0.0")]
[assembly: AssemblyInformationalVersion("0.1.0+c5bc5dc75d05b77a82a117bff9d15c5cdf372e64")]
[assembly: AssemblyProduct("PvPKit")]
[assembly: AssemblyTitle("PvPKit")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.1.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace PvPKit
{
	[BepInPlugin("PvPKit", "PvPKit", "0.1.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BasePlugin
	{
		public static ManualLogSource? Logger;

		public static Plugin? Instance;

		private static bool _hasPrefabsBeenModified;

		public override void Load()
		{
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Expected O, but got Unknown
			Instance = this;
			Logger = ((BasePlugin)this).Log;
			MainConfig.Initialize();
			DB.LoadData();
			CommandRegistry.RegisterAll();
			ManualLogSource log = ((BasePlugin)this).Log;
			bool flag = default(bool);
			BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(27, 2, ref flag);
			if (flag)
			{
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Plugin ");
				((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>("PvPKit");
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" version ");
				((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>("0.1.0");
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" is loaded!");
			}
			log.LogInfo(val);
			try
			{
				ModifyPrefabs();
			}
			catch (Exception ex)
			{
				ManualLogSource logger = Logger;
				if (logger != null)
				{
					val = new BepInExInfoLogInterpolatedStringHandler(36, 1, ref flag);
					if (flag)
					{
						((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Initial prefab modification failed: ");
						((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(ex.Message);
					}
					logger.LogInfo(val);
				}
			}
			Task.Run(async delegate
			{
				bool flag2 = default(bool);
				for (int i = 0; i < 10; i++)
				{
					await Task.Delay(5000);
					try
					{
						ManualLogSource logger2 = Logger;
						if (logger2 != null)
						{
							BepInExInfoLogInterpolatedStringHandler val2 = new BepInExInfoLogInterpolatedStringHandler(27, 1, ref flag2);
							if (flag2)
							{
								((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("Attempt #");
								((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<int>(i + 1);
								((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" to modify prefabs");
							}
							logger2.LogInfo(val2);
						}
						ModifyPrefabs();
						if (_hasPrefabsBeenModified)
						{
							ManualLogSource? logger3 = Logger;
							if (logger3 != null)
							{
								logger3.LogInfo((object)"Prefabs successfully modified!");
							}
							break;
						}
					}
					catch (Exception ex2)
					{
						ManualLogSource logger4 = Logger;
						if (logger4 != null)
						{
							BepInExInfoLogInterpolatedStringHandler val2 = new BepInExInfoLogInterpolatedStringHandler(18, 2, ref flag2);
							if (flag2)
							{
								((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("Attempt #");
								((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<int>(i + 1);
								((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" failed: ");
								((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(ex2.Message);
							}
							logger4.LogInfo(val2);
						}
					}
				}
			});
		}

		public override bool Unload()
		{
			CommandRegistry.UnregisterAssembly();
			return true;
		}

		private static void ModifyPrefabs()
		{
			//IL_0893: Unknown result type (might be due to invalid IL or missing references)
			//IL_089a: Expected O, but got Unknown
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: 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_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0206: Unknown result type (might be due to invalid IL or missing references)
			//IL_020d: Expected O, but got Unknown
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bf: Expected O, but got Unknown
			//IL_016a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0171: Expected O, but got Unknown
			//IL_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_014a: Unknown result type (might be due to invalid IL or missing references)
			//IL_014c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Expected O, but got Unknown
			//IL_028b: Unknown result type (might be due to invalid IL or missing references)
			//IL_028d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0292: Unknown result type (might be due to invalid IL or missing references)
			//IL_0296: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ea: Expected O, but got Unknown
			//IL_02c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02da: Unknown result type (might be due to invalid IL or missing references)
			//IL_0395: Unknown result type (might be due to invalid IL or missing references)
			//IL_039c: Expected O, but got Unknown
			//IL_0467: Unknown result type (might be due to invalid IL or missing references)
			//IL_046c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0347: Unknown result type (might be due to invalid IL or missing references)
			//IL_034e: Expected O, but got Unknown
			//IL_02fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0304: Expected O, but got Unknown
			//IL_063a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0641: Expected O, but got Unknown
			//IL_04a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ca: Expected O, but got Unknown
			//IL_04f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_04fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ce: Expected O, but got Unknown
			//IL_06b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_06bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_06c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0575: Unknown result type (might be due to invalid IL or missing references)
			//IL_057c: Expected O, but got Unknown
			//IL_0548: Unknown result type (might be due to invalid IL or missing references)
			//IL_054d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0551: Unknown result type (might be due to invalid IL or missing references)
			//IL_051b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0522: Expected O, but got Unknown
			//IL_06db: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_07ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0806: Expected O, but got Unknown
			//IL_06f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_06fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0702: Unknown result type (might be due to invalid IL or missing references)
			//IL_0707: Unknown result type (might be due to invalid IL or missing references)
			//IL_07b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_07b8: Expected O, but got Unknown
			//IL_0713: Unknown result type (might be due to invalid IL or missing references)
			//IL_0718: Unknown result type (might be due to invalid IL or missing references)
			//IL_071a: Unknown result type (might be due to invalid IL or missing references)
			//IL_071c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0722: Invalid comparison between Unknown and I4
			//IL_0769: Unknown result type (might be due to invalid IL or missing references)
			//IL_076e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0777: Unknown result type (might be due to invalid IL or missing references)
			//IL_073b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0742: Expected O, but got Unknown
			bool flag2 = default(bool);
			try
			{
				World world = GetWorld("Server");
				if (world == null)
				{
					ManualLogSource? logger = Logger;
					if (logger != null)
					{
						logger.LogError((object)"Cannot modify prefabs - Server world is null!");
					}
					return;
				}
				ManualLogSource? logger2 = Logger;
				if (logger2 != null)
				{
					logger2.LogInfo((object)"Starting prefab modifications for infinite items...");
				}
				bool flag = false;
				int[] array = new int[5] { -1568756102, 1510182325, -2102469163, 800879747, -1885959251 };
				ManualLogSource? logger3 = Logger;
				if (logger3 != null)
				{
					logger3.LogInfo((object)"Modifying consumable items to be infinite...");
				}
				int[] array2 = array;
				PrefabGUID prefabGUID = default(PrefabGUID);
				EntityManager entityManager;
				foreach (int num in array2)
				{
					((PrefabGUID)(ref prefabGUID))..ctor(num);
					Entity prefabEntityByPrefabGUID = GetPrefabEntityByPrefabGUID(world, prefabGUID);
					if (!((Entity)(ref prefabEntityByPrefabGUID)).Equals(Entity.Null))
					{
						entityManager = world.EntityManager;
						if (((EntityManager)(ref entityManager)).HasComponent<ItemData>(prefabEntityByPrefabGUID))
						{
							entityManager = world.EntityManager;
							ItemData componentData = ((EntityManager)(ref entityManager)).GetComponentData<ItemData>(prefabEntityByPrefabGUID);
							if (componentData.RemoveOnConsume)
							{
								ManualLogSource logger4 = Logger;
								if (logger4 != null)
								{
									BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(21, 1, ref flag2);
									if (flag2)
									{
										((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Making item ");
										((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(num);
										((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" infinite");
									}
									logger4.LogInfo(val);
								}
								componentData.RemoveOnConsume = false;
								entityManager = world.EntityManager;
								((EntityManager)(ref entityManager)).SetComponentData<ItemData>(prefabEntityByPrefabGUID, componentData);
								flag = true;
								continue;
							}
							ManualLogSource logger5 = Logger;
							if (logger5 != null)
							{
								BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(25, 1, ref flag2);
								if (flag2)
								{
									((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Item ");
									((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(num);
									((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" is already infinite");
								}
								logger5.LogInfo(val);
							}
							continue;
						}
						ManualLogSource logger6 = Logger;
						if (logger6 != null)
						{
							BepInExWarningLogInterpolatedStringHandler val2 = new BepInExWarningLogInterpolatedStringHandler(37, 1, ref flag2);
							if (flag2)
							{
								((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("Item ");
								((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<int>(num);
								((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" doesn't have ItemData component");
							}
							logger6.LogWarning(val2);
						}
						continue;
					}
					ManualLogSource logger7 = Logger;
					if (logger7 != null)
					{
						BepInExWarningLogInterpolatedStringHandler val2 = new BepInExWarningLogInterpolatedStringHandler(35, 1, ref flag2);
						if (flag2)
						{
							((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("Couldn't find entity for item hash ");
							((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<int>(num);
						}
						logger7.LogWarning(val2);
					}
				}
				ManualLogSource? logger8 = Logger;
				if (logger8 != null)
				{
					logger8.LogInfo((object)"Clearing drop tables for empty containers...");
				}
				int[] array3 = new int[4] { -437611596, -810738866, -1749706632, 971866957 };
				int[] array4 = array3;
				PrefabGUID prefabGUID2 = default(PrefabGUID);
				foreach (int num2 in array4)
				{
					((PrefabGUID)(ref prefabGUID2))..ctor(num2);
					Entity prefabEntityByPrefabGUID2 = GetPrefabEntityByPrefabGUID(world, prefabGUID2);
					if (!((Entity)(ref prefabEntityByPrefabGUID2)).Equals(Entity.Null))
					{
						entityManager = world.EntityManager;
						if (((EntityManager)(ref entityManager)).HasComponent<DropTableDataBuffer>(prefabEntityByPrefabGUID2))
						{
							entityManager = world.EntityManager;
							DynamicBuffer<DropTableDataBuffer> buffer = ((EntityManager)(ref entityManager)).GetBuffer<DropTableDataBuffer>(prefabEntityByPrefabGUID2, false);
							if (buffer.Length > 0)
							{
								ManualLogSource logger9 = Logger;
								if (logger9 != null)
								{
									BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(24, 1, ref flag2);
									if (flag2)
									{
										((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Clearing drop table for ");
										((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(num2);
									}
									logger9.LogInfo(val);
								}
								buffer.Clear();
								flag = true;
								continue;
							}
							ManualLogSource logger10 = Logger;
							if (logger10 != null)
							{
								BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(32, 1, ref flag2);
								if (flag2)
								{
									((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Drop table for ");
									((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(num2);
									((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" is already empty");
								}
								logger10.LogInfo(val);
							}
							continue;
						}
						ManualLogSource logger11 = Logger;
						if (logger11 != null)
						{
							BepInExWarningLogInterpolatedStringHandler val2 = new BepInExWarningLogInterpolatedStringHandler(48, 1, ref flag2);
							if (flag2)
							{
								((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("Item ");
								((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<int>(num2);
								((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" doesn't have DropTableDataBuffer component");
							}
							logger11.LogWarning(val2);
						}
						continue;
					}
					ManualLogSource logger12 = Logger;
					if (logger12 != null)
					{
						BepInExWarningLogInterpolatedStringHandler val2 = new BepInExWarningLogInterpolatedStringHandler(41, 1, ref flag2);
						if (flag2)
						{
							((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("Couldn't find entity for drop table hash ");
							((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<int>(num2);
						}
						logger12.LogWarning(val2);
					}
				}
				ManualLogSource? logger13 = Logger;
				if (logger13 != null)
				{
					logger13.LogInfo((object)"Removing consume components from abilities...");
				}
				int[] array5 = new int[5] { -1885959251, -1661839227, -2102469163, -1568756102, 1510182325 };
				int num3 = 0;
				PrefabCollectionSystem existingSystemManaged = world.GetExistingSystemManaged<PrefabCollectionSystem>();
				if (existingSystemManaged != null)
				{
					NativeParallelHashMap<PrefabGUID, Entity> prefabGuidToEntityMap = existingSystemManaged._PrefabGuidToEntityMap;
					ManualLogSource? logger14 = Logger;
					if (logger14 != null)
					{
						logger14.LogInfo((object)"Checking prefab collection system");
					}
					int[] array6 = array5;
					PrefabGUID val3 = default(PrefabGUID);
					Entity val4 = default(Entity);
					foreach (int num4 in array6)
					{
						((PrefabGUID)(ref val3))..ctor(num4);
						if (prefabGuidToEntityMap.TryGetValue(val3, ref val4))
						{
							ManualLogSource logger15 = Logger;
							if (logger15 != null)
							{
								BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(25, 1, ref flag2);
								if (flag2)
								{
									((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Found ability with hash: ");
									((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(num4);
								}
								logger15.LogInfo(val);
							}
							entityManager = world.EntityManager;
							if (((EntityManager)(ref entityManager)).HasComponent<AbilityGroupConsumeItemOnCast>(val4))
							{
								ManualLogSource logger16 = Logger;
								if (logger16 != null)
								{
									BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(44, 1, ref flag2);
									if (flag2)
									{
										((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Removing AbilityGroupConsumeItemOnCast from ");
										((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(num4);
									}
									logger16.LogInfo(val);
								}
								entityManager = world.EntityManager;
								((EntityManager)(ref entityManager)).RemoveComponent<AbilityGroupConsumeItemOnCast>(val4);
								num3++;
								flag = true;
								continue;
							}
							ManualLogSource logger17 = Logger;
							if (logger17 != null)
							{
								BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(41, 1, ref flag2);
								if (flag2)
								{
									((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Ability ");
									((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(num4);
									((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" already has no consume component");
								}
								logger17.LogInfo(val);
							}
							continue;
						}
						ManualLogSource logger18 = Logger;
						if (logger18 != null)
						{
							BepInExWarningLogInterpolatedStringHandler val2 = new BepInExWarningLogInterpolatedStringHandler(37, 1, ref flag2);
							if (flag2)
							{
								((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("Ability hash ");
								((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<int>(num4);
								((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" not found in prefab map");
							}
							logger18.LogWarning(val2);
						}
					}
				}
				else
				{
					ManualLogSource? logger19 = Logger;
					if (logger19 != null)
					{
						logger19.LogWarning((object)"PrefabCollectionSystem is not initialized yet");
					}
				}
				ManualLogSource logger20 = Logger;
				if (logger20 != null)
				{
					BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(19, 1, ref flag2);
					if (flag2)
					{
						((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Modified ");
						((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(num3);
						((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" abilities");
					}
					logger20.LogInfo(val);
				}
				ManualLogSource? logger21 = Logger;
				if (logger21 != null)
				{
					logger21.LogInfo((object)"Fixing healing potion empty consumable issue...");
				}
				int[] array7 = new int[1] { 635603587 };
				int[] array8 = array7;
				PrefabGUID prefabGUID3 = default(PrefabGUID);
				foreach (int num5 in array8)
				{
					((PrefabGUID)(ref prefabGUID3))..ctor(num5);
					Entity prefabEntityByPrefabGUID3 = GetPrefabEntityByPrefabGUID(world, prefabGUID3);
					if (!((Entity)(ref prefabEntityByPrefabGUID3)).Equals(Entity.Null))
					{
						entityManager = world.EntityManager;
						if (((EntityManager)(ref entityManager)).HasBuffer<DropTableBuffer>(prefabEntityByPrefabGUID3))
						{
							entityManager = world.EntityManager;
							DynamicBuffer<DropTableBuffer> buffer2 = ((EntityManager)(ref entityManager)).GetBuffer<DropTableBuffer>(prefabEntityByPrefabGUID3, false);
							for (int m = 0; m < buffer2.Length; m++)
							{
								DropTableBuffer val5 = buffer2[m];
								if ((int)val5.DropTrigger != 3)
								{
									continue;
								}
								ManualLogSource logger22 = Logger;
								if (logger22 != null)
								{
									BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(46, 1, ref flag2);
									if (flag2)
									{
										((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Fixing DropTrigger for healing potion ability ");
										((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(num5);
									}
									logger22.LogInfo(val);
								}
								val5.DropTableGuid = PrefabGUID.Empty;
								buffer2[m] = val5;
								flag = true;
							}
							continue;
						}
						ManualLogSource logger23 = Logger;
						if (logger23 != null)
						{
							BepInExWarningLogInterpolatedStringHandler val2 = new BepInExWarningLogInterpolatedStringHandler(47, 1, ref flag2);
							if (flag2)
							{
								((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("Ability ");
								((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<int>(num5);
								((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" doesn't have DropTableBuffer component");
							}
							logger23.LogWarning(val2);
						}
						continue;
					}
					ManualLogSource logger24 = Logger;
					if (logger24 != null)
					{
						BepInExWarningLogInterpolatedStringHandler val2 = new BepInExWarningLogInterpolatedStringHandler(38, 1, ref flag2);
						if (flag2)
						{
							((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("Couldn't find entity for ability hash ");
							((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<int>(num5);
						}
						logger24.LogWarning(val2);
					}
				}
				if (flag)
				{
					ManualLogSource? logger25 = Logger;
					if (logger25 != null)
					{
						logger25.LogInfo((object)"Successfully modified prefabs!");
					}
					_hasPrefabsBeenModified = true;
				}
				else
				{
					ManualLogSource? logger26 = Logger;
					if (logger26 != null)
					{
						logger26.LogInfo((object)"No prefabs needed modification or prefabs weren't ready yet");
					}
				}
			}
			catch (Exception ex)
			{
				ManualLogSource logger27 = Logger;
				if (logger27 != null)
				{
					BepInExErrorLogInterpolatedStringHandler val6 = new BepInExErrorLogInterpolatedStringHandler(26, 2, ref flag2);
					if (flag2)
					{
						((BepInExLogInterpolatedStringHandler)val6).AppendLiteral("Error modifying prefabs: ");
						((BepInExLogInterpolatedStringHandler)val6).AppendFormatted<string>(ex.Message);
						((BepInExLogInterpolatedStringHandler)val6).AppendLiteral("\n");
						((BepInExLogInterpolatedStringHandler)val6).AppendFormatted<string>(ex.StackTrace);
					}
					logger27.LogError(val6);
				}
			}
		}

		private static Entity GetPrefabEntityByPrefabGUID(World world, PrefabGUID prefabGUID)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: 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_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			if (world == null)
			{
				return Entity.Null;
			}
			PrefabCollectionSystem existingSystemManaged = world.GetExistingSystemManaged<PrefabCollectionSystem>();
			Entity result = default(Entity);
			if (existingSystemManaged != null && existingSystemManaged._PrefabGuidToEntityMap.TryGetValue(prefabGUID, ref result))
			{
				return result;
			}
			return Entity.Null;
		}

		private static World? GetWorld(string name)
		{
			Enumerator<World> enumerator = World.All.GetEnumerator();
			while (enumerator.MoveNext())
			{
				World current = enumerator.Current;
				if (current.Name == name)
				{
					return current;
				}
			}
			return null;
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "PvPKit";

		public const string PLUGIN_NAME = "PvPKit";

		public const string PLUGIN_VERSION = "0.1.0";
	}
}
namespace PvPKit.Utils
{
	internal class Helper
	{
		private static World? _serverWorld;

		public static ServerGameManager serverGameManager = Server.GetExistingSystemManaged<ServerScriptMapper>()._ServerGameManager;

		public static EntityManager EntityManager => Server.EntityManager;

		public static GameDataSystem gameData => Server.GetExistingSystemManaged<GameDataSystem>();

		public static PrefabCollectionSystem PrefabCollection => Server.GetExistingSystemManaged<PrefabCollectionSystem>();

		public static Dictionary<string, PrefabGUID> NameToGuid => PrefabCollection.NameToPrefabGuidDictionary;

		public static World Server
		{
			get
			{
				if (_serverWorld != null)
				{
					return _serverWorld;
				}
				_serverWorld = GetWorld("Server") ?? throw new Exception("There is no Server world (yet). Did you install a server mod on the client?");
				return _serverWorld;
			}
		}

		public static bool IsServer => Application.productName == "VRisingServer";

		public static void TryEquipItem(Entity playerEntity, PrefabGUID itemGuid, Entity itemEntity)
		{
			//IL_018a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0191: Expected O, but got Unknown
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: 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_0018: Unknown result type (might be due to invalid IL or missing references)
			//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_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//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)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_0155: Unknown result type (might be due to invalid IL or missing references)
			//IL_015c: Expected O, but got Unknown
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: 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_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Expected O, but got Unknown
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: 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)
			bool flag = default(bool);
			try
			{
				EntityManager entityManager = EntityManager;
				Entity val = ((EntityManager)(ref entityManager)).CreateEntity((ComponentType[])(object)new ComponentType[2]
				{
					ComponentType.ReadWrite<FromCharacter>(),
					ComponentType.ReadWrite<EquipItemEvent>()
				});
				entityManager = EntityManager;
				PlayerCharacter componentData = ((EntityManager)(ref entityManager)).GetComponentData<PlayerCharacter>(playerEntity);
				Entity userEntity = componentData.UserEntity;
				entityManager = EntityManager;
				((EntityManager)(ref entityManager)).SetComponentData<FromCharacter>(val, new FromCharacter
				{
					User = userEntity,
					Character = playerEntity
				});
				int num = -1;
				entityManager = EntityManager;
				if (((EntityManager)(ref entityManager)).HasComponent<InventoryBuffer>(playerEntity))
				{
					entityManager = EntityManager;
					DynamicBuffer<InventoryBuffer> buffer = ((EntityManager)(ref entityManager)).GetBuffer<InventoryBuffer>(playerEntity, false);
					for (int i = 0; i < buffer.Length; i++)
					{
						if (buffer[i].ItemEntity._Entity == itemEntity)
						{
							num = i;
							break;
						}
					}
				}
				if (num >= 0)
				{
					entityManager = EntityManager;
					((EntityManager)(ref entityManager)).SetComponentData<EquipItemEvent>(val, new EquipItemEvent
					{
						SlotIndex = num
					});
					ManualLogSource logger = Plugin.Logger;
					BepInExInfoLogInterpolatedStringHandler val2 = new BepInExInfoLogInterpolatedStringHandler(46, 1, ref flag);
					if (flag)
					{
						((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("Sent equip command for item in inventory slot ");
						((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<int>(num);
					}
					logger.LogInfo(val2);
				}
				else
				{
					ManualLogSource logger2 = Plugin.Logger;
					BepInExWarningLogInterpolatedStringHandler val3 = new BepInExWarningLogInterpolatedStringHandler(41, 0, ref flag);
					if (flag)
					{
						((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("Could not find item in inventory to equip");
					}
					logger2.LogWarning(val3);
				}
			}
			catch (Exception ex)
			{
				ManualLogSource logger3 = Plugin.Logger;
				BepInExWarningLogInterpolatedStringHandler val3 = new BepInExWarningLogInterpolatedStringHandler(22, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("Error equipping item: ");
					((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<string>(ex.Message);
				}
				logger3.LogWarning(val3);
			}
		}

		public static Entity AddItemToInventoryByGuid(Entity recipient, PrefabGUID guid, int amount)
		{
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Expected O, but got Unknown
			//IL_015a: Unknown result type (might be due to invalid IL or missing references)
			//IL_015f: Unknown result type (might be due to invalid IL or missing references)
			//IL_012d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Expected O, but got Unknown
			//IL_0163: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Expected O, but got Unknown
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Expected O, but got Unknown
			//IL_0042: 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)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: 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)
			bool flag = default(bool);
			try
			{
				BepInExWarningLogInterpolatedStringHandler val;
				if (((PrefabGUID)(ref guid)).GuidHash == 0)
				{
					ManualLogSource logger = Plugin.Logger;
					val = new BepInExWarningLogInterpolatedStringHandler(14, 1, ref flag);
					if (flag)
					{
						((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Invalid GUID: ");
						((BepInExLogInterpolatedStringHandler)val).AppendFormatted<PrefabGUID>(guid);
					}
					logger.LogWarning(val);
					return Entity.Null;
				}
				AddItemResponse val2 = ((ServerGameManager)(ref serverGameManager)).TryAddInventoryItem(recipient, guid, amount);
				if (((AddItemResponse)(ref val2)).Success)
				{
					ManualLogSource logger2 = Plugin.Logger;
					BepInExInfoLogInterpolatedStringHandler val3 = new BepInExInfoLogInterpolatedStringHandler(34, 1, ref flag);
					if (flag)
					{
						((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("Successfully added item with GUID ");
						((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<PrefabGUID>(guid);
					}
					logger2.LogInfo(val3);
					return val2.NewEntity;
				}
				ManualLogSource logger3 = Plugin.Logger;
				val = new BepInExWarningLogInterpolatedStringHandler(31, 2, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Failed to add item with GUID ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<PrefabGUID>(guid);
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral(": ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<AddItemResult>(val2.Result);
				}
				logger3.LogWarning(val);
				return Entity.Null;
			}
			catch (Exception ex)
			{
				ManualLogSource logger4 = Plugin.Logger;
				BepInExErrorLogInterpolatedStringHandler val4 = new BepInExErrorLogInterpolatedStringHandler(34, 2, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val4).AppendLiteral("Exception adding item with GUID ");
					((BepInExLogInterpolatedStringHandler)val4).AppendFormatted<PrefabGUID>(guid);
					((BepInExLogInterpolatedStringHandler)val4).AppendLiteral(": ");
					((BepInExLogInterpolatedStringHandler)val4).AppendFormatted<string>(ex.Message);
				}
				logger4.LogError(val4);
				return Entity.Null;
			}
		}

		public static void GiveStartKit(ChatCommandContext ctx, List<RecordKit> kit)
		{
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			//IL_010d: Expected O, but got Unknown
			//IL_018d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0194: Expected O, but got Unknown
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: 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_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Expected O, but got Unknown
			//IL_0274: Unknown result type (might be due to invalid IL or missing references)
			//IL_027b: Expected O, but got Unknown
			//IL_0217: Unknown result type (might be due to invalid IL or missing references)
			//IL_021e: Expected O, but got Unknown
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			int num = 0;
			List<string> list = new List<string>();
			bool flag = default(bool);
			foreach (RecordKit item in kit)
			{
				try
				{
					if (!NameToGuid.ContainsKey(item.Name))
					{
						list.Add(item.Name);
						ManualLogSource logger = Plugin.Logger;
						BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(16, 1, ref flag);
						if (flag)
						{
							((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Item not found: ");
							((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(item.Name);
						}
						logger.LogWarning(val);
						continue;
					}
					Entity val2 = AddItemToInventory(ctx.Event.SenderCharacterEntity, NameToGuid[item.Name], item.Amount);
					if (val2 != Entity.Null)
					{
						try
						{
							TryEquipItem(ctx.Event.SenderCharacterEntity, NameToGuid[item.Name], val2);
							num++;
						}
						catch (Exception ex)
						{
							ManualLogSource logger2 = Plugin.Logger;
							BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(23, 2, ref flag);
							if (flag)
							{
								((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Failed to equip item ");
								((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(item.Name);
								((BepInExLogInterpolatedStringHandler)val).AppendLiteral(": ");
								((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(ex.Message);
							}
							logger2.LogWarning(val);
							num++;
						}
					}
					else
					{
						list.Add(item.Name);
					}
				}
				catch (Exception ex2)
				{
					list.Add(item.Name);
					ManualLogSource logger3 = Plugin.Logger;
					BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(20, 2, ref flag);
					if (flag)
					{
						((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Error adding item ");
						((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(item.Name);
						((BepInExLogInterpolatedStringHandler)val).AppendLiteral(": ");
						((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(ex2.Message);
					}
					logger3.LogWarning(val);
				}
			}
			if (list.Count > 0)
			{
				ManualLogSource logger4 = Plugin.Logger;
				BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(22, 2, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Failed to add ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(list.Count);
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" items: ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(string.Join(", ", list));
				}
				logger4.LogWarning(val);
			}
			ManualLogSource logger5 = Plugin.Logger;
			BepInExInfoLogInterpolatedStringHandler val3 = new BepInExInfoLogInterpolatedStringHandler(29, 2, ref flag);
			if (flag)
			{
				((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("Successfully added ");
				((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<int>(num);
				((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(" of ");
				((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<int>(kit.Count);
				((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(" items");
			}
			logger5.LogInfo(val3);
		}

		public static Entity AddItemToInventory(Entity recipient, PrefabGUID guid, int amount)
		{
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Expected O, but got Unknown
			//IL_010d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Expected O, but got Unknown
			//IL_0116: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Expected O, but got Unknown
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//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)
			//IL_0042: 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)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			bool flag = default(bool);
			try
			{
				BepInExWarningLogInterpolatedStringHandler val;
				if (((PrefabGUID)(ref guid)).GuidHash == 0)
				{
					ManualLogSource logger = Plugin.Logger;
					val = new BepInExWarningLogInterpolatedStringHandler(14, 1, ref flag);
					if (flag)
					{
						((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Invalid GUID: ");
						((BepInExLogInterpolatedStringHandler)val).AppendFormatted<PrefabGUID>(guid);
					}
					logger.LogWarning(val);
					return Entity.Null;
				}
				AddItemResponse val2 = ((ServerGameManager)(ref serverGameManager)).TryAddInventoryItem(recipient, guid, amount);
				if (((AddItemResponse)(ref val2)).Success)
				{
					return val2.NewEntity;
				}
				ManualLogSource logger2 = Plugin.Logger;
				val = new BepInExWarningLogInterpolatedStringHandler(31, 2, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Failed to add item with GUID ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<PrefabGUID>(guid);
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral(": ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<AddItemResult>(val2.Result);
				}
				logger2.LogWarning(val);
				return Entity.Null;
			}
			catch (Exception ex)
			{
				ManualLogSource logger3 = Plugin.Logger;
				BepInExErrorLogInterpolatedStringHandler val3 = new BepInExErrorLogInterpolatedStringHandler(23, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("Exception adding item: ");
					((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<string>(ex.Message);
				}
				logger3.LogError(val3);
				return Entity.Null;
			}
		}

		public static void EquipEquipment(Entity player, int slot)
		{
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Expected O, but got Unknown
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: 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_0032: 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_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: 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_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				EntityManager entityManager = Server.EntityManager;
				Entity val = ((EntityManager)(ref entityManager)).CreateEntity((ComponentType[])(object)new ComponentType[2]
				{
					ComponentType.ReadWrite<FromCharacter>(),
					ComponentType.ReadWrite<EquipItemEvent>()
				});
				entityManager = Server.EntityManager;
				PlayerCharacter componentData = ((EntityManager)(ref entityManager)).GetComponentData<PlayerCharacter>(player);
				Entity userEntity = componentData.UserEntity;
				entityManager = Server.EntityManager;
				((EntityManager)(ref entityManager)).SetComponentData<FromCharacter>(val, new FromCharacter
				{
					User = userEntity,
					Character = player
				});
				entityManager = Server.EntityManager;
				((EntityManager)(ref entityManager)).SetComponentData<EquipItemEvent>(val, new EquipItemEvent
				{
					SlotIndex = slot
				});
			}
			catch (Exception ex)
			{
				ManualLogSource logger = Plugin.Logger;
				bool flag = default(bool);
				BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(31, 2, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("Error equipping item in slot ");
					((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<int>(slot);
					((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(": ");
					((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(ex.Message);
				}
				logger.LogError(val2);
			}
		}

		private static World GetWorld(string name)
		{
			Enumerator<World> enumerator = World.s_AllWorlds.GetEnumerator();
			while (enumerator.MoveNext())
			{
				World current = enumerator.Current;
				if (current.Name == name)
				{
					return current;
				}
			}
			return null;
		}

		public static bool TryAddItemByName(Entity playerEntity, string itemName, int amount)
		{
			//IL_02f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ff: Expected O, but got Unknown
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Expected O, but got Unknown
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: 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)
			//IL_006b: 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_02b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c0: Expected O, but got Unknown
			//IL_01f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0202: Unknown result type (might be due to invalid IL or missing references)
			//IL_0224: Unknown result type (might be due to invalid IL or missing references)
			//IL_022a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0230: Unknown result type (might be due to invalid IL or missing references)
			//IL_0235: Unknown result type (might be due to invalid IL or missing references)
			//IL_0257: Unknown result type (might be due to invalid IL or missing references)
			//IL_025d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0263: Unknown result type (might be due to invalid IL or missing references)
			//IL_0268: Unknown result type (might be due to invalid IL or missing references)
			//IL_0134: Unknown result type (might be due to invalid IL or missing references)
			//IL_013b: Expected O, but got Unknown
			//IL_028a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0290: Unknown result type (might be due to invalid IL or missing references)
			//IL_0296: Unknown result type (might be due to invalid IL or missing references)
			//IL_029b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0181: Unknown result type (might be due to invalid IL or missing references)
			//IL_0184: 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_018f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0191: Unknown result type (might be due to invalid IL or missing references)
			//IL_0193: Unknown result type (might be due to invalid IL or missing references)
			//IL_016c: Unknown result type (might be due to invalid IL or missing references)
			bool flag = default(bool);
			try
			{
				PrefabGUID val = default(PrefabGUID);
				if (NameToGuid.TryGetValue(itemName, ref val))
				{
					ManualLogSource logger = Plugin.Logger;
					BepInExInfoLogInterpolatedStringHandler val2 = new BepInExInfoLogInterpolatedStringHandler(22, 2, ref flag);
					if (flag)
					{
						((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("Found item ");
						((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(itemName);
						((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" with GUID ");
						((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<PrefabGUID>(val);
					}
					logger.LogInfo(val2);
					Entity val3 = AddItemToInventory(playerEntity, val, amount);
					return val3 != Entity.Null;
				}
				PrefabCollectionSystem existingSystemManaged = Server.GetExistingSystemManaged<PrefabCollectionSystem>();
				if (existingSystemManaged != null)
				{
					Enumerator<string, PrefabGUID> enumerator = existingSystemManaged.NameToPrefabGuidDictionary.GetEnumerator();
					while (enumerator.MoveNext())
					{
						KeyValuePair<string, PrefabGUID> current = enumerator.Current;
						if (!current.Key.StartsWith("Recipe_") && current.Key.StartsWith("Item_") && (current.Key.Contains("_Dracula_") || current.Key.EndsWith("_Dracula") || current.Key.Contains("Dracula")))
						{
							ManualLogSource logger2 = Plugin.Logger;
							BepInExInfoLogInterpolatedStringHandler val2 = new BepInExInfoLogInterpolatedStringHandler(31, 2, ref flag);
							if (flag)
							{
								((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("Found Dracula item: ");
								((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(current.Key);
								((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" with GUID ");
								((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<PrefabGUID>(current.Value);
							}
							logger2.LogInfo(val2);
							Entity val4 = AddItemToInventory(playerEntity, current.Value, amount);
							if (val4 != Entity.Null)
							{
								return true;
							}
						}
					}
				}
				if (itemName.Contains("Item_Armor_") && itemName.Contains("_T09"))
				{
					if (itemName.Contains("Chest"))
					{
						return AddItemToInventory(playerEntity, new PrefabGUID(1626067133), 1) != Entity.Null;
					}
					if (itemName.Contains("Legs"))
					{
						return AddItemToInventory(playerEntity, new PrefabGUID(871588325), 1) != Entity.Null;
					}
					if (itemName.Contains("Gloves"))
					{
						return AddItemToInventory(playerEntity, new PrefabGUID(-2097658343), 1) != Entity.Null;
					}
					if (itemName.Contains("Boots"))
					{
						return AddItemToInventory(playerEntity, new PrefabGUID(1851183595), 1) != Entity.Null;
					}
				}
				ManualLogSource logger3 = Plugin.Logger;
				BepInExWarningLogInterpolatedStringHandler val5 = new BepInExWarningLogInterpolatedStringHandler(30, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val5).AppendLiteral("Could not find item with name ");
					((BepInExLogInterpolatedStringHandler)val5).AppendFormatted<string>(itemName);
				}
				logger3.LogWarning(val5);
				return false;
			}
			catch (Exception ex)
			{
				ManualLogSource logger4 = Plugin.Logger;
				BepInExErrorLogInterpolatedStringHandler val6 = new BepInExErrorLogInterpolatedStringHandler(32, 2, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val6).AppendLiteral("Error in TryAddItemByName for ");
					((BepInExLogInterpolatedStringHandler)val6).AppendFormatted<string>(itemName);
					((BepInExLogInterpolatedStringHandler)val6).AppendLiteral(": ");
					((BepInExLogInterpolatedStringHandler)val6).AppendFormatted<string>(ex.Message);
				}
				logger4.LogError(val6);
				return false;
			}
		}

		public static bool TryAddDraculaItemsByPrefix(Entity playerEntity, string prefix, HashSet<string> alreadyAdded)
		{
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Expected O, but got Unknown
			//IL_0164: Unknown result type (might be due to invalid IL or missing references)
			//IL_0167: Unknown result type (might be due to invalid IL or missing references)
			//IL_016d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0172: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			//IL_0176: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0197: Unknown result type (might be due to invalid IL or missing references)
			//IL_019a: 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)
			bool result = false;
			PrefabCollectionSystem existingSystemManaged = Server.GetExistingSystemManaged<PrefabCollectionSystem>();
			if (existingSystemManaged == null)
			{
				return false;
			}
			Enumerator<string, PrefabGUID> enumerator = existingSystemManaged.NameToPrefabGuidDictionary.GetEnumerator();
			bool flag2 = default(bool);
			while (enumerator.MoveNext())
			{
				KeyValuePair<string, PrefabGUID> current = enumerator.Current;
				if (current.Key.StartsWith("Recipe_") || !current.Key.StartsWith("Item_") || !current.Key.StartsWith(prefix) || !current.Key.Contains("Dracula"))
				{
					continue;
				}
				bool flag = false;
				foreach (string item in alreadyAdded)
				{
					if (current.Key.Contains(item) || item.Contains(current.Key))
					{
						flag = true;
						break;
					}
				}
				if (!flag)
				{
					ManualLogSource logger = Plugin.Logger;
					BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(41, 2, ref flag2);
					if (flag2)
					{
						((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Found Dracula item by prefix: ");
						((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(current.Key);
						((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" with GUID ");
						((BepInExLogInterpolatedStringHandler)val).AppendFormatted<PrefabGUID>(current.Value);
					}
					logger.LogInfo(val);
					Entity val2 = AddItemToInventory(playerEntity, current.Value, 1);
					if (val2 != Entity.Null)
					{
						alreadyAdded.Add(current.Key);
						result = true;
						TryEquipItem(playerEntity, current.Value, val2);
					}
				}
			}
			return result;
		}

		public static void ForceEquipItemToInventorySlot(Entity playerEntity, Entity itemEntity, int slotIndex)
		{
			//IL_0179: Unknown result type (might be due to invalid IL or missing references)
			//IL_0180: Expected O, but got Unknown
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Expected O, but got Unknown
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Expected O, but got Unknown
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: 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_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: Unknown result type (might be due to invalid IL or missing references)
			//IL_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0143: Expected O, but got Unknown
			bool flag = default(bool);
			try
			{
				if (playerEntity == Entity.Null || itemEntity == Entity.Null)
				{
					ManualLogSource logger = Plugin.Logger;
					BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(36, 0, ref flag);
					if (flag)
					{
						((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Cannot equip: player or item is null");
					}
					logger.LogWarning(val);
					return;
				}
				ManualLogSource logger2 = Plugin.Logger;
				BepInExInfoLogInterpolatedStringHandler val2 = new BepInExInfoLogInterpolatedStringHandler(42, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("Attempting to directly equip item to slot ");
					((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<int>(slotIndex);
				}
				logger2.LogInfo(val2);
				EntityManager entityManager = Server.EntityManager;
				Entity val3 = ((EntityManager)(ref entityManager)).CreateEntity((ComponentType[])(object)new ComponentType[2]
				{
					ComponentType.ReadWrite<FromCharacter>(),
					ComponentType.ReadWrite<EquipItemEvent>()
				});
				entityManager = Server.EntityManager;
				PlayerCharacter componentData = ((EntityManager)(ref entityManager)).GetComponentData<PlayerCharacter>(playerEntity);
				Entity userEntity = componentData.UserEntity;
				entityManager = Server.EntityManager;
				((EntityManager)(ref entityManager)).SetComponentData<FromCharacter>(val3, new FromCharacter
				{
					User = userEntity,
					Character = playerEntity
				});
				entityManager = Server.EntityManager;
				((EntityManager)(ref entityManager)).SetComponentData<EquipItemEvent>(val3, new EquipItemEvent
				{
					SlotIndex = slotIndex
				});
				ManualLogSource logger3 = Plugin.Logger;
				val2 = new BepInExInfoLogInterpolatedStringHandler(38, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("Force equip event dispatched for slot ");
					((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<int>(slotIndex);
				}
				logger3.LogInfo(val2);
			}
			catch (Exception ex)
			{
				ManualLogSource logger4 = Plugin.Logger;
				BepInExErrorLogInterpolatedStringHandler val4 = new BepInExErrorLogInterpolatedStringHandler(28, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val4).AppendLiteral("Error force equipping item: ");
					((BepInExLogInterpolatedStringHandler)val4).AppendFormatted<string>(ex.Message);
				}
				logger4.LogError(val4);
			}
		}
	}
}
namespace PvPKit.Database
{
	internal struct RecordKit
	{
		public string Name { get; set; }

		public int Amount { get; set; }

		public RecordKit(string name, int amount)
		{
			Name = name;
			Amount = amount;
		}
	}
	public class DB
	{
		private static readonly string FileDirectory = Path.Combine("BepInEx", "config", "PvPKit");

		public static bool EnabledKitCommand { get; set; }

		public static void Initialize()
		{
			EnabledKitCommand = true;
			Plugin.Logger.LogWarning((object)"PvPKit DB initialized.");
		}

		internal static void LoadData()
		{
			if (!Directory.Exists(FileDirectory))
			{
				Directory.CreateDirectory(FileDirectory);
			}
			Plugin.Logger.LogWarning((object)"PvPKit DB initialized.");
		}
	}
}
namespace PvPKit.Configs
{
	public class MainConfig
	{
		private static ConfigFile Conf;

		private static readonly string FileName = "PvPKit.cfg";

		private static readonly string ConfigPath = Path.Combine("BepInEx", "config");

		public static bool EnabledKitCommand { get; private set; }

		public static void Initialize()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			Conf = new ConfigFile(Path.Combine(ConfigPath, FileName), true);
			ConfigEntry<bool> val = Conf.Bind<bool>("PvPKit", "EnableKitCommand", true, "Enable kit command that gives Dracula Set.");
			EnabledKitCommand = val.Value;
			DB.EnabledKitCommand = EnabledKitCommand;
		}
	}
}
namespace PvPKit.Commands
{
	internal class KitCommands
	{
		private static Dictionary<ulong, DateTime> kitCooldowns = new Dictionary<ulong, DateTime>();

		private static Dictionary<ulong, string> playerKits = new Dictionary<ulong, string>();

		private const int KIT_COOLDOWN_SECONDS = 1;

		private static ulong GetPlayerPlatformId(Entity playerEntity)
		{
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Expected O, but got Unknown
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: 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_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				EntityManager entityManager = Helper.EntityManager;
				EntityManager entityManager2 = Helper.EntityManager;
				User componentData = ((EntityManager)(ref entityManager)).GetComponentData<User>(((EntityManager)(ref entityManager2)).GetComponentData<PlayerCharacter>(playerEntity).UserEntity);
				return componentData.PlatformId;
			}
			catch (Exception ex)
			{
				ManualLogSource logger = Plugin.Logger;
				bool flag = default(bool);
				BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(34, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Error getting player platform ID: ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(ex.Message);
				}
				logger.LogError(val);
				return 0uL;
			}
		}

		private static void ResetKitTracking(ulong platformId)
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Expected O, but got Unknown
			if (playerKits.ContainsKey(platformId))
			{
				playerKits.Remove(platformId);
				ManualLogSource logger = Plugin.Logger;
				bool flag = default(bool);
				BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(30, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Reset kit tracking for player ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<ulong>(platformId);
				}
				logger.LogInfo(val);
			}
		}

		private static void UnequipArmor(Entity playerEntity)
		{
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Expected O, but got Unknown
			//IL_0012: 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_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				Plugin.Logger.LogInfo((object)"Unequipping all armor pieces");
				Helper.EquipEquipment(playerEntity, 3);
				Helper.EquipEquipment(playerEntity, 4);
				Helper.EquipEquipment(playerEntity, 6);
				Helper.EquipEquipment(playerEntity, 5);
				Plugin.Logger.LogInfo((object)"All armor pieces unequipped");
			}
			catch (Exception ex)
			{
				ManualLogSource logger = Plugin.Logger;
				bool flag = default(bool);
				BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(25, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Error unequipping armor: ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(ex.Message);
				}
				logger.LogError(val);
			}
		}

		private static int GetInventoryIndex(Entity characterEntity, Entity itemEntity)
		{
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Expected O, but got Unknown
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//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_001d: Unknown result type (might be due to invalid IL or missing references)
			//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_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				EntityManager entityManager = Helper.EntityManager;
				if (((EntityManager)(ref entityManager)).HasComponent<InventoryBuffer>(characterEntity))
				{
					entityManager = Helper.EntityManager;
					DynamicBuffer<InventoryBuffer> buffer = ((EntityManager)(ref entityManager)).GetBuffer<InventoryBuffer>(characterEntity, false);
					for (int i = 0; i < buffer.Length; i++)
					{
						Entity entity = buffer[i].ItemEntity._Entity;
						if (entity == itemEntity)
						{
							return i;
						}
					}
				}
				return -1;
			}
			catch (Exception ex)
			{
				ManualLogSource logger = Plugin.Logger;
				bool flag = default(bool);
				BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(31, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Error getting inventory index: ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(ex.Message);
				}
				logger.LogError(val);
				return -1;
			}
		}

		private static void EquipItem(Entity characterEntity, Entity itemEntity)
		{
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Expected O, but got Unknown
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//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)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: 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)
			//IL_007f: 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_0086: 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_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Expected O, but got Unknown
			bool flag = default(bool);
			try
			{
				int inventoryIndex = GetInventoryIndex(characterEntity, itemEntity);
				if (inventoryIndex == -1)
				{
					Plugin.Logger.LogError((object)"Couldn't find slot index for item to equip.");
					return;
				}
				EntityManager entityManager = Helper.EntityManager;
				Entity val = ((EntityManager)(ref entityManager)).CreateEntity();
				entityManager = Helper.EntityManager;
				PlayerCharacter componentData = ((EntityManager)(ref entityManager)).GetComponentData<PlayerCharacter>(characterEntity);
				Entity userEntity = componentData.UserEntity;
				entityManager = Helper.EntityManager;
				((EntityManager)(ref entityManager)).AddComponentData<EquipItemEvent>(val, new EquipItemEvent
				{
					SlotIndex = inventoryIndex,
					IsCosmetic = false
				});
				entityManager = Helper.EntityManager;
				((EntityManager)(ref entityManager)).AddComponentData<FromCharacter>(val, new FromCharacter
				{
					Character = characterEntity,
					User = userEntity
				});
				ManualLogSource logger = Plugin.Logger;
				BepInExInfoLogInterpolatedStringHandler val2 = new BepInExInfoLogInterpolatedStringHandler(22, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("Equipped item at slot ");
					((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<int>(inventoryIndex);
				}
				logger.LogInfo(val2);
			}
			catch (Exception ex)
			{
				ManualLogSource logger2 = Plugin.Logger;
				BepInExErrorLogInterpolatedStringHandler val3 = new BepInExErrorLogInterpolatedStringHandler(22, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("Error equipping item: ");
					((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<string>(ex.Message);
				}
				logger2.LogError(val3);
			}
		}

		private static void AddAndEquipItems(Entity characterEntity, Dictionary<PrefabGUID, int> items)
		{
			//IL_0107: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Expected O, but got Unknown
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: 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_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Expected O, but got Unknown
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Expected O, but got Unknown
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: 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_0092: Unknown result type (might be due to invalid IL or missing references)
			bool flag = default(bool);
			foreach (KeyValuePair<PrefabGUID, int> item in items)
			{
				PrefabGUID key = item.Key;
				int value = item.Value;
				try
				{
					AddItemResponse val = ((ServerGameManager)(ref Helper.serverGameManager)).TryAddInventoryItem(characterEntity, key, value);
					if (((AddItemResponse)(ref val)).Success)
					{
						ManualLogSource logger = Plugin.Logger;
						BepInExInfoLogInterpolatedStringHandler val2 = new BepInExInfoLogInterpolatedStringHandler(38, 1, ref flag);
						if (flag)
						{
							((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("Item ");
							((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<int>(((PrefabGUID)(ref key)).GuidHash);
							((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" added successfully. Equipping...");
						}
						logger.LogInfo(val2);
						EquipItem(characterEntity, val.NewEntity);
					}
					else
					{
						ManualLogSource logger2 = Plugin.Logger;
						BepInExWarningLogInterpolatedStringHandler val3 = new BepInExWarningLogInterpolatedStringHandler(31, 2, ref flag);
						if (flag)
						{
							((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("Failed to add item with GUID ");
							((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<PrefabGUID>(key);
							((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(": ");
							((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<AddItemResult>(val.Result);
						}
						logger2.LogWarning(val3);
					}
				}
				catch (Exception ex)
				{
					ManualLogSource logger3 = Plugin.Logger;
					BepInExErrorLogInterpolatedStringHandler val4 = new BepInExErrorLogInterpolatedStringHandler(30, 2, ref flag);
					if (flag)
					{
						((BepInExLogInterpolatedStringHandler)val4).AppendLiteral("Error adding/equipping item ");
						((BepInExLogInterpolatedStringHandler)val4).AppendFormatted<PrefabGUID>(key);
						((BepInExLogInterpolatedStringHandler)val4).AppendLiteral(": ");
						((BepInExLogInterpolatedStringHandler)val4).AppendFormatted<string>(ex.Message);
					}
					logger3.LogError(val4);
				}
			}
		}

		private static void RemoveKitItemsFromInventory(Entity playerEntity)
		{
			//IL_026f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0276: Expected O, but got Unknown
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: 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_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//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_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Expected O, but got Unknown
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_01af: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cd: Expected O, but got Unknown
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_010d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_021e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0225: Expected O, but got Unknown
			//IL_0152: Unknown result type (might be due to invalid IL or missing references)
			bool flag = default(bool);
			try
			{
				UnequipArmor(playerEntity);
				string[] array = new string[4] { "Item_Boots_T09_Dracula_", "Item_Chest_T09_Dracula_", "Item_Gloves_T09_Dracula_", "Item_Legs_T09_Dracula_" };
				EntityManager entityManager = Helper.EntityManager;
				if (!((EntityManager)(ref entityManager)).HasComponent<InventoryBuffer>(playerEntity))
				{
					return;
				}
				PrefabCollectionSystem existingSystemManaged = Helper.Server.GetExistingSystemManaged<PrefabCollectionSystem>();
				entityManager = Helper.EntityManager;
				DynamicBuffer<InventoryBuffer> buffer = ((EntityManager)(ref entityManager)).GetBuffer<InventoryBuffer>(playerEntity, false);
				ManualLogSource logger = Plugin.Logger;
				BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(59, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Checking inventory for kit items to remove. Buffer length: ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(buffer.Length);
				}
				logger.LogInfo(val);
				List<(Entity, string)> list = new List<(Entity, string)>();
				string text = default(string);
				for (int i = 0; i < buffer.Length; i++)
				{
					Entity entity = buffer[i].ItemEntity._Entity;
					if (entity == Entity.Null)
					{
						continue;
					}
					entityManager = Helper.EntityManager;
					if (!((EntityManager)(ref entityManager)).Exists(entity))
					{
						continue;
					}
					entityManager = Helper.EntityManager;
					if (!((EntityManager)(ref entityManager)).HasComponent<PrefabGUID>(entity))
					{
						continue;
					}
					entityManager = Helper.EntityManager;
					PrefabGUID componentData = ((EntityManager)(ref entityManager)).GetComponentData<PrefabGUID>(entity);
					if (!existingSystemManaged.PrefabGuidToNameDictionary.TryGetValue(componentData, ref text))
					{
						continue;
					}
					string[] array2 = array;
					foreach (string value in array2)
					{
						if (text.StartsWith(value))
						{
							list.Add((entity, text));
							break;
						}
					}
				}
				foreach (var item in list)
				{
					entityManager = Helper.EntityManager;
					((EntityManager)(ref entityManager)).DestroyEntity(item.Item1);
					ManualLogSource logger2 = Plugin.Logger;
					val = new BepInExInfoLogInterpolatedStringHandler(18, 1, ref flag);
					if (flag)
					{
						((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Removed kit item: ");
						((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(item.Item2);
					}
					logger2.LogInfo(val);
				}
				ManualLogSource logger3 = Plugin.Logger;
				val = new BepInExInfoLogInterpolatedStringHandler(33, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Removed ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(list.Count);
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" kit items from inventory");
				}
				logger3.LogInfo(val);
			}
			catch (Exception ex)
			{
				ManualLogSource logger4 = Plugin.Logger;
				BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(26, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("Error removing kit items: ");
					((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(ex.Message);
				}
				logger4.LogError(val2);
			}
		}

		private static void RemoveExistingKitItems(Entity playerEntity)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			RemoveKitItemsFromInventory(playerEntity);
		}

		[Command("dumpitems", null, null, "Dumps item list to log", null, true)]
		public static void DumpItemsCommand(ChatCommandContext ctx)
		{
			//IL_0156: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: Expected O, but got Unknown
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Expected O, but got Unknown
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Expected O, but got Unknown
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			bool flag = default(bool);
			try
			{
				PrefabCollectionSystem existingSystemManaged = Helper.Server.GetExistingSystemManaged<PrefabCollectionSystem>();
				if (existingSystemManaged != null)
				{
					Plugin.Logger.LogInfo((object)"========== DUMPING ALL ITEMS ==========");
					int num = 0;
					Enumerator<PrefabGUID, string> enumerator = existingSystemManaged.PrefabGuidToNameDictionary.GetEnumerator();
					BepInExInfoLogInterpolatedStringHandler val;
					while (enumerator.MoveNext())
					{
						KeyValuePair<PrefabGUID, string> current = enumerator.Current;
						if (current.Value.StartsWith("Item_"))
						{
							ManualLogSource logger = Plugin.Logger;
							val = new BepInExInfoLogInterpolatedStringHandler(4, 2, ref flag);
							if (flag)
							{
								((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(current.Value);
								((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" -> ");
								((BepInExLogInterpolatedStringHandler)val).AppendFormatted<PrefabGUID>(current.Key);
							}
							logger.LogInfo(val);
							num++;
						}
					}
					ManualLogSource logger2 = Plugin.Logger;
					val = new BepInExInfoLogInterpolatedStringHandler(35, 1, ref flag);
					if (flag)
					{
						((BepInExLogInterpolatedStringHandler)val).AppendLiteral("========== DUMPED ");
						((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(num);
						((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" ITEMS ==========");
					}
					logger2.LogInfo(val);
					ctx.Reply($"<color=#00ff00>Dumped {num} items to the log file.</color>");
				}
				else
				{
					ctx.Reply("<color=#ff0000>Failed to get prefab system.</color>");
				}
			}
			catch (Exception ex)
			{
				ManualLogSource logger3 = Plugin.Logger;
				BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(21, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("Error dumping items: ");
					((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(ex.Message);
				}
				logger3.LogError(val2);
				ctx.Reply("<color=#ff0000>Error: " + ex.Message + "</color>");
			}
		}

		[Command("pk", null, null, "Shows available kit options.", null, false)]
		public static void ShowKitOptionsCommand(ChatCommandContext ctx)
		{
			ctx.Reply("<color=#ffffffff>Available kits: .pk warrior, .pk rogue, .pk brute, .pk sorcerer</color>");
			ctx.Reply("<color=#ffffffff>For general weapons and equipment: .pvpkit</color>");
		}

		[Command("pvpkit", null, null, "Give basic weapons, consumables, and equipment to the player.", null, false)]
		public static void KitCommand(ChatCommandContext ctx)
		{
			//IL_024f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0256: Expected O, but got Unknown
			//IL_03dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e4: Expected O, but got Unknown
			//IL_05d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_05dd: Expected O, but got Unknown
			//IL_0761: Unknown result type (might be due to invalid IL or missing references)
			//IL_0768: Expected O, but got Unknown
			//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_003d: 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)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: 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)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: 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_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_010d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: Unknown result type (might be due to invalid IL or missing references)
			//IL_0139: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0165: Unknown result type (might be due to invalid IL or missing references)
			//IL_017b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0191: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01de: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0309: Unknown result type (might be due to invalid IL or missing references)
			//IL_031f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0335: Unknown result type (might be due to invalid IL or missing references)
			//IL_035c: Unknown result type (might be due to invalid IL or missing references)
			//IL_035f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0365: Unknown result type (might be due to invalid IL or missing references)
			//IL_036a: Unknown result type (might be due to invalid IL or missing references)
			//IL_036c: Unknown result type (might be due to invalid IL or missing references)
			//IL_036e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0467: Unknown result type (might be due to invalid IL or missing references)
			//IL_0468: Unknown result type (might be due to invalid IL or missing references)
			//IL_046b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0470: Unknown result type (might be due to invalid IL or missing references)
			//IL_0472: Unknown result type (might be due to invalid IL or missing refe