Decompiled source of RPGMods Waypoints v0.9.9

RPGMods.Waypoints.dll

Decompiled 6 months ago
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.IO.Compression;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text.Json;
using System.Text.RegularExpressions;
using System.Threading;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Core.Logging.Interpolation;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using Costura;
using HarmonyLib;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Il2CppSystem.Collections.Generic;
using Microsoft.CodeAnalysis;
using ProjectM;
using ProjectM.Gameplay;
using ProjectM.Gameplay.Systems;
using ProjectM.Network;
using ProjectM.Scripting;
using RPGMods.Commands;
using RPGMods.Hooks;
using RPGMods.Systems;
using RPGMods.Utils;
using Stunlock.Core;
using Stunlock.Network;
using Unity.Collections;
using Unity.Entities;
using Unity.Mathematics;
using Unity.Transforms;
using UnityEngine;
using VampireCommandFramework;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("RPGMods.Waypoints")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("RPG Mods - Waypoints Standalone Module")]
[assembly: AssemblyFileVersion("0.9.9.0")]
[assembly: AssemblyInformationalVersion("0.9.9")]
[assembly: AssemblyProduct("RPGMods.Waypoints")]
[assembly: AssemblyTitle("RPGMods.Waypoints")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.9.9.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
internal class <Module>
{
	static <Module>()
	{
		AssemblyLoader.Attach();
	}
}
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[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 RPGMods
{
	[BepInPlugin("RPGMods.Waypoints", "RPGMods - Waypoints Standalone Module", "0.9.9")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BasePlugin
	{
		public const string moduleName = "Waypoints";

		public static Harmony harmony;

		public static bool testing;

		private static ConfigEntry<int> WaypointLimit;

		private static ConfigEntry<int> teleportItem;

		private static ConfigEntry<int> teleportItemCost;

		private static ConfigEntry<string> teleportItemName;

		private static ConfigEntry<int> waypointItem;

		private static ConfigEntry<int> waypointItemCost;

		private static ConfigEntry<string> waypointItemName;

		private static ConfigEntry<int> teleportCD;

		public static bool isInitialized;

		public static ManualLogSource Logger;

		private static World _serverWorld;

		private static bool parseLogging;

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

		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 void InitConfig()
		{
			WaypointLimit = ((BasePlugin)this).Config.Bind<int>("Waypoints", "Waypoint Limit", 2, "Set a waypoint limit for non-admin users.");
			teleportItem = ((BasePlugin)this).Config.Bind<int>("Waypoints", "Teleport Item GUID", 0, "Set the item needed to teleport, set to 0 to disable.");
			teleportItemCost = ((BasePlugin)this).Config.Bind<int>("Waypoints", "Teleport Item Cost", 0, "Set how many of the item are consumed to teleport, 0 to not consume any.");
			teleportItemName = ((BasePlugin)this).Config.Bind<string>("Waypoints", "Teleport Item Name", "No Item", "The name of the item required for teleporting, only for cosmetic reasons.");
			waypointItem = ((BasePlugin)this).Config.Bind<int>("Waypoints", "Waypoint Item GUID", 0, "Set the item needed to set a waypoint, set to 0 to disable.");
			waypointItemCost = ((BasePlugin)this).Config.Bind<int>("Waypoints", "Waypoint Item Cost", 0, "Set how many of the item are consumed to set a waypoint, 0 to not consume any.");
			waypointItemName = ((BasePlugin)this).Config.Bind<string>("Waypoints", "Waypoint Item Name", "No Item", "The name of the item required for setting a waypoint, only for cosmetic reasons.");
			teleportCD = ((BasePlugin)this).Config.Bind<int>("Waypoints", "Teleport Cooldown", 300, "Sets the default cooldown in seconds for teleporting, after telepoing you will need to wait this long before teleporting again, may be changed by waypoint.");
			if (!Directory.Exists("BepInEx/config/RPGMods"))
			{
				Directory.CreateDirectory("BepInEx/config/RPGMods");
			}
			if (!Directory.Exists("BepInEx/config/RPGMods/Waypoints"))
			{
				Directory.CreateDirectory("BepInEx/config/RPGMods/Waypoints");
			}
			if (!Directory.Exists("BepInEx/config/RPGMods/Waypoints/Backup"))
			{
				Directory.CreateDirectory("BepInEx/config/RPGMods/Waypoints/Backup");
			}
		}

		public override void Load()
		{
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Expected O, but got Unknown
			if (!IsServer)
			{
				((BasePlugin)this).Log.LogWarning((object)"RPGMods is a server plugin. Not continuing to load on client.");
				return;
			}
			InitConfig();
			Logger = ((BasePlugin)this).Log;
			harmony = new Harmony("RPGMods - Waypoints");
			harmony.PatchAll(Assembly.GetExecutingAssembly());
			TaskRunner.Initialize();
			((BasePlugin)this).Log.LogInfo((object)"Plugin RPGMods - Waypoints is loaded!");
		}

		public override bool Unload()
		{
			AutoSaveSystem.SaveDatabase();
			((BasePlugin)this).Config.Clear();
			harmony.UnpatchSelf();
			TaskRunner.Destroy();
			return true;
		}

		public void OnGameInitialized()
		{
			Initialize();
		}

		public static void Initialize()
		{
			Logger.LogInfo((object)("Trying to Initalize RPGMods - Waypoints, isInitalized already: " + isInitialized));
			if (!isInitialized)
			{
				Logger.LogInfo((object)"Initalizing RPGMods - Waypoints");
				Helper.CreatePlayerCache();
				Logger.LogInfo((object)"Registering commands");
				CommandRegistry.RegisterAll();
				Waypoint.WaypointLimit = WaypointLimit.Value;
				Waypoint.teleportItem = teleportItem.Value;
				Waypoint.teleportCost = teleportItemCost.Value;
				Waypoint.teleportItemName = teleportItemName.Value;
				Waypoint.setWaypointItem = waypointItem.Value;
				Waypoint.setWaypointCost = waypointItemCost.Value;
				Waypoint.setWaypointItemName = waypointItemName.Value;
				Waypoint.teleportCD = teleportCD.Value;
				AutoSaveSystem.LoadDatabase();
				Logger.LogInfo((object)"Finished initialising");
				isInitialized = true;
			}
		}

		public static int[] parseIntArrayConifg(string data)
		{
			if (parseLogging)
			{
				Logger.LogInfo((object)(">>>parsing int array: " + data));
			}
			Match match = Regex.Match(data, "([0-9]+)");
			List<int> list = new List<int>();
			while (match.Success)
			{
				try
				{
					if (parseLogging)
					{
						Logger.LogInfo((object)(">>>got int: " + match.Value));
					}
					int item = int.Parse(match.Value, CultureInfo.InvariantCulture);
					if (parseLogging)
					{
						Logger.LogInfo((object)(">>>int parsed into: " + item));
					}
					list.Add(item);
				}
				catch
				{
					if (parseLogging)
					{
						Logger.LogWarning((object)("Error interperting integer value: " + match.ToString()));
					}
				}
				match = match.NextMatch();
			}
			if (parseLogging)
			{
				Logger.LogInfo((object)">>>done parsing int array");
			}
			return list.ToArray();
		}

		public static float[] parseFloatArrayConifg(string data)
		{
			if (parseLogging)
			{
				Logger.LogInfo((object)(">>>parsing float array: " + data));
			}
			Match match = Regex.Match(data, "[-+]?[0-9]*\\.?[0-9]+");
			List<float> list = new List<float>();
			while (match.Success)
			{
				try
				{
					if (parseLogging)
					{
						Logger.LogInfo((object)(">>>got float: " + match.Value));
					}
					float item = float.Parse(match.Value, CultureInfo.InvariantCulture);
					if (parseLogging)
					{
						Logger.LogInfo((object)(">>>float parsed into: " + item));
					}
					list.Add(item);
				}
				catch
				{
					Logger.LogWarning((object)("Error interperting float value: " + match.ToString()));
				}
				match = match.NextMatch();
			}
			if (parseLogging)
			{
				Logger.LogInfo((object)">>>done parsing float array");
			}
			return list.ToArray();
		}

		public static double[] parseDoubleArrayConifg(string data)
		{
			if (parseLogging)
			{
				Logger.LogInfo((object)(">>>parsing double array: " + data));
			}
			Match match = Regex.Match(data, "[-+]?[0-9]*\\.?[0-9]+");
			List<double> list = new List<double>();
			while (match.Success)
			{
				try
				{
					if (parseLogging)
					{
						Logger.LogInfo((object)(">>>got double: " + match.Value));
					}
					double item = double.Parse(match.Value, CultureInfo.InvariantCulture);
					if (parseLogging)
					{
						Logger.LogInfo((object)(">>>double parsed into: " + item));
					}
					list.Add(item);
				}
				catch
				{
					Logger.LogWarning((object)("Error interperting double value: " + match.ToString()));
				}
				match = match.NextMatch();
			}
			if (parseLogging)
			{
				Logger.LogInfo((object)">>>done parsing double array");
			}
			return list.ToArray();
		}

		public static string[] parseStringArrayConifg(string data)
		{
			if (parseLogging)
			{
				Logger.LogInfo((object)(">>>parsing comma seperated String array: " + data));
			}
			List<string> list = new List<string>();
			while (data.IndexOf(",") > 0)
			{
				string text = data.Substring(0, data.IndexOf(","));
				text.Trim();
				list.Add(text);
				data = data.Substring(data.IndexOf(",") + 1);
			}
			data.Trim();
			list.Add(data);
			if (parseLogging)
			{
				Logger.LogInfo((object)">>>done parsing string array");
			}
			return list.ToArray();
		}
	}
}
namespace RPGMods.Utils
{
	public class Alliance
	{
		public struct CloseAlly
		{
			public Entity userEntity;

			public User userComponent;

			public int currentXp;

			public int playerLevel;

			public ulong steamID;

			public float3 position;

			public bool isTrigger;
		}

		private static readonly int CacheAgeLimit = 300;

		private static bool ConvertToAlly(Entity entity, float3 position, bool logging, out CloseAlly ally)
		{
			//IL_0005: 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_000e: 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_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_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_0078: 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_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0112: 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_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: 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_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_004a: 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_00ab: 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_00b4: Unknown result type (might be due to invalid IL or missing references)
			EntityManager entityManager = Plugin.Server.EntityManager;
			PlayerCharacter val = default(PlayerCharacter);
			EntityManagerDebug debug;
			if (!((EntityManager)(ref entityManager)).TryGetComponentData<PlayerCharacter>(entity, ref val))
			{
				if (logging)
				{
					ManualLogSource logger = Plugin.Logger;
					string text = DateTime.Now.ToString();
					entityManager = Plugin.Server.EntityManager;
					debug = ((EntityManager)(ref entityManager)).Debug;
					logger.LogInfo((object)(text + ": Player Character Component unavailable, available components are: " + ((EntityManagerDebug)(ref debug)).GetEntityInfo(entity)));
				}
				ally = default(CloseAlly);
				return false;
			}
			Entity userEntity = val.UserEntity;
			entityManager = Plugin.Server.EntityManager;
			User val2 = default(User);
			if (!((EntityManager)(ref entityManager)).TryGetComponentData<User>(userEntity, ref val2))
			{
				if (logging)
				{
					ManualLogSource logger2 = Plugin.Logger;
					string text2 = DateTime.Now.ToString();
					entityManager = Plugin.Server.EntityManager;
					debug = ((EntityManager)(ref entityManager)).Debug;
					logger2.LogInfo((object)(text2 + ": User Component unavailable, available components from pc.UserEntity are: " + ((EntityManagerDebug)(ref debug)).GetEntityInfo(userEntity)));
				}
				ally = default(CloseAlly);
				return false;
			}
			ulong platformId = val2.PlatformId;
			int playerLevel = 0;
			Database.player_experience.TryGetValue(platformId, out var value);
			ally = new CloseAlly
			{
				currentXp = value,
				playerLevel = playerLevel,
				steamID = platformId,
				userEntity = userEntity,
				userComponent = val2,
				position = position
			};
			return true;
		}

		public static List<CloseAlly> GetCloseAllies(Entity closeToEntity, Entity triggerEntity, float groupMaxDistance, bool useGroup, bool logging)
		{
			//IL_0075: 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_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_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_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: 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_00cb: 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_0094: Expected O, but got Unknown
			//IL_0128: Unknown result type (might be due to invalid IL or missing references)
			//IL_0161: Unknown result type (might be due to invalid IL or missing references)
			//IL_0166: 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)
			//IL_0171: 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_017a: Unknown result type (might be due to invalid IL or missing references)
			//IL_017f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0244: Unknown result type (might be due to invalid IL or missing references)
			//IL_0249: 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_01b4: 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: Unknown result type (might be due to invalid IL or missing references)
			float num = groupMaxDistance * groupMaxDistance;
			if (logging)
			{
				Plugin.Logger.LogInfo((object)(DateTime.Now.ToString() + ": Fetching allies..."));
			}
			List<CloseAlly> list = new List<CloseAlly>();
			EntityManager entityManager;
			LocalToWorld componentData;
			if (!useGroup)
			{
				entityManager = Plugin.Server.EntityManager;
				componentData = ((EntityManager)(ref entityManager)).GetComponentData<LocalToWorld>(triggerEntity);
				float3 position = ((LocalToWorld)(ref componentData)).Position;
				if (ConvertToAlly(triggerEntity, position, logging, out var ally))
				{
					ally.isTrigger = true;
					list.Add(ally);
				}
			}
			else
			{
				GetAllies(triggerEntity, logging, out var playerGroup);
				if (logging)
				{
					ManualLogSource logger = Plugin.Logger;
					bool flag = default(bool);
					BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(22, 1, ref flag);
					if (flag)
					{
						((BepInExLogInterpolatedStringHandler)val).AppendFormatted<DateTime>(DateTime.Now);
						((BepInExLogInterpolatedStringHandler)val).AppendLiteral(": Getting close allies");
					}
					logger.LogInfo(val);
				}
				entityManager = Plugin.Server.EntityManager;
				LocalToWorld componentData2 = ((EntityManager)(ref entityManager)).GetComponentData<LocalToWorld>(closeToEntity);
				foreach (KeyValuePair<Entity, Entity> ally3 in playerGroup.Allies)
				{
					if (logging)
					{
						Plugin.Logger.LogInfo((object)(DateTime.Now.ToString() + ": Iterating over allies, entity is " + ally3.GetHashCode()));
					}
					bool flag2 = ((Entity)(ref triggerEntity)).Equals(ally3.Key);
					if (logging && flag2)
					{
						Plugin.Logger.LogInfo((object)(DateTime.Now.ToString() + ": Entity is trigger"));
					}
					entityManager = Plugin.Server.EntityManager;
					componentData = ((EntityManager)(ref entityManager)).GetComponentData<LocalToWorld>(ally3.Value);
					float3 position2 = ((LocalToWorld)(ref componentData)).Position;
					if (!flag2)
					{
						if (logging)
						{
							Plugin.Logger.LogInfo((object)(DateTime.Now.ToString() + ": Got entity Position"));
						}
						float3 position3 = ((LocalToWorld)(ref componentData2)).Position;
						float num2 = math.distancesq(((float3)(ref position3)).xz, ((float3)(ref position2)).xz);
						if (logging)
						{
							Plugin.Logger.LogInfo((object)(DateTime.Now.ToString() + ": DistanceSq is " + num2 + ", Max DistanceSq is " + num));
						}
						if (!(num2 <= num))
						{
							continue;
						}
					}
					if (logging)
					{
						Plugin.Logger.LogInfo((object)(DateTime.Now.ToString() + ": Converting entity to ally..."));
					}
					if (ConvertToAlly(ally3.Key, position2, logging, out var ally2))
					{
						ally2.isTrigger = flag2;
						list.Add(ally2);
					}
				}
			}
			if (logging)
			{
				Plugin.Logger.LogInfo((object)(DateTime.Now.ToString() + ": Allies Fetched, Total ally count of " + list.Count));
			}
			return list;
		}

		public static void GetAllies(Entity playerCharacter, bool logging, out PlayerGroup playerGroup)
		{
			//IL_0005: 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_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_010c: 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_00e4: Expected O, but got Unknown
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Expected O, but got Unknown
			//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Expected O, but got Unknown
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0125: Unknown result type (might be due to invalid IL or missing references)
			//IL_012c: Expected O, but got Unknown
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: 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_009d: 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_064a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0651: Expected O, but got Unknown
			//IL_0632: Unknown result type (might be due to invalid IL or missing references)
			//IL_0634: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_05f1: Expected O, but got Unknown
			//IL_02fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_030b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0312: Expected O, but got Unknown
			//IL_031c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0321: Unknown result type (might be due to invalid IL or missing references)
			//IL_0328: Unknown result type (might be due to invalid IL or missing references)
			//IL_032d: 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_034c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0350: Unknown result type (might be due to invalid IL or missing references)
			//IL_0355: Unknown result type (might be due to invalid IL or missing references)
			//IL_035a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0294: Unknown result type (might be due to invalid IL or missing references)
			//IL_029b: Expected O, but got Unknown
			//IL_01e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e7: Expected O, but got Unknown
			//IL_03b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_06dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_066f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0683: Unknown result type (might be due to invalid IL or missing references)
			//IL_060f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0623: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0368: Unknown result type (might be due to invalid IL or missing references)
			//IL_036f: Expected O, but got Unknown
			//IL_02b9: 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_021c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0223: Expected O, but got Unknown
			//IL_0205: Unknown result type (might be due to invalid IL or missing references)
			//IL_018b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0192: Expected O, but got Unknown
			//IL_03f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_03fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0246: Unknown result type (might be due to invalid IL or missing references)
			//IL_024b: Unknown result type (might be due to invalid IL or missing references)
			//IL_024f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0254: Unknown result type (might be due to invalid IL or missing references)
			//IL_0258: Unknown result type (might be due to invalid IL or missing references)
			//IL_043f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0422: Unknown result type (might be due to invalid IL or missing references)
			//IL_0424: Unknown result type (might be due to invalid IL or missing references)
			//IL_046d: Unknown result type (might be due to invalid IL or missing references)
			//IL_046f: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0593: Unknown result type (might be due to invalid IL or missing references)
			//IL_059a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0534: Unknown result type (might be due to invalid IL or missing references)
			//IL_0536: Unknown result type (might be due to invalid IL or missing references)
			//IL_056c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0571: 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_057a: Unknown result type (might be due to invalid IL or missing references)
			//IL_057e: Unknown result type (might be due to invalid IL or missing references)
			EntityManager entityManager = Plugin.Server.EntityManager;
			bool flag = default(bool);
			EntityManagerDebug debug;
			if (!((EntityManager)(ref entityManager)).HasComponent<PlayerCharacter>(playerCharacter))
			{
				if (logging)
				{
					ManualLogSource logger = Plugin.Logger;
					BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(22, 2, ref flag);
					if (flag)
					{
						((BepInExLogInterpolatedStringHandler)val).AppendFormatted<DateTime>(DateTime.Now);
						((BepInExLogInterpolatedStringHandler)val).AppendLiteral(": Entity is not user: ");
						((BepInExLogInterpolatedStringHandler)val).AppendFormatted<Entity>(playerCharacter);
					}
					logger.LogInfo(val);
					ManualLogSource logger2 = Plugin.Logger;
					val = new BepInExInfoLogInterpolatedStringHandler(39, 2, ref flag);
					if (flag)
					{
						((BepInExLogInterpolatedStringHandler)val).AppendFormatted<DateTime>(DateTime.Now);
						((BepInExLogInterpolatedStringHandler)val).AppendLiteral(": Components for Player Character are: ");
						BepInExInfoLogInterpolatedStringHandler obj = val;
						entityManager = Plugin.Server.EntityManager;
						debug = ((EntityManager)(ref entityManager)).Debug;
						((BepInExLogInterpolatedStringHandler)obj).AppendFormatted<string>(((EntityManagerDebug)(ref debug)).GetEntityInfo(playerCharacter));
					}
					logger2.LogInfo(val);
				}
				playerGroup = new PlayerGroup
				{
					Allies = new Dictionary<Entity, Entity>()
				};
				return;
			}
			if (logging)
			{
				ManualLogSource logger3 = Plugin.Logger;
				BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(33, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<DateTime>(DateTime.Now);
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral(": Beginning To Parse Player Group");
				}
				logger3.LogInfo(val);
			}
			if (Cache.PlayerAllies.TryGetValue(playerCharacter, out playerGroup))
			{
				if (logging)
				{
					ManualLogSource logger4 = Plugin.Logger;
					BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(38, 2, ref flag);
					if (flag)
					{
						((BepInExLogInterpolatedStringHandler)val).AppendFormatted<DateTime>(DateTime.Now);
						((BepInExLogInterpolatedStringHandler)val).AppendLiteral(": Allies Found in Cache, timestamp is ");
						((BepInExLogInterpolatedStringHandler)val).AppendFormatted<DateTime>(playerGroup.TimeStamp);
					}
					logger4.LogInfo(val);
				}
				if ((DateTime.Now - playerGroup.TimeStamp).TotalSeconds < (double)CacheAgeLimit)
				{
					return;
				}
				if (logging)
				{
					ManualLogSource logger5 = Plugin.Logger;
					BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(26, 1, ref flag);
					if (flag)
					{
						((BepInExLogInterpolatedStringHandler)val).AppendFormatted<DateTime>(DateTime.Now);
						((BepInExLogInterpolatedStringHandler)val).AppendLiteral(": Refreshing cached allies");
					}
					logger5.LogInfo(val);
				}
			}
			entityManager = Plugin.Server.EntityManager;
			Team val2 = default(Team);
			if (!((EntityManager)(ref entityManager)).TryGetComponentData<Team>(playerCharacter, ref val2))
			{
				if (logging)
				{
					ManualLogSource logger6 = Plugin.Logger;
					BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(43, 2, ref flag);
					if (flag)
					{
						((BepInExLogInterpolatedStringHandler)val).AppendFormatted<DateTime>(DateTime.Now);
						((BepInExLogInterpolatedStringHandler)val).AppendLiteral(": Could not get team for Player Character: ");
						((BepInExLogInterpolatedStringHandler)val).AppendFormatted<Entity>(playerCharacter);
					}
					logger6.LogInfo(val);
					ManualLogSource logger7 = Plugin.Logger;
					val = new BepInExInfoLogInterpolatedStringHandler(39, 2, ref flag);
					if (flag)
					{
						((BepInExLogInterpolatedStringHandler)val).AppendFormatted<DateTime>(DateTime.Now);
						((BepInExLogInterpolatedStringHandler)val).AppendLiteral(": Components for Player Character are: ");
						BepInExInfoLogInterpolatedStringHandler obj2 = val;
						entityManager = Plugin.Server.EntityManager;
						debug = ((EntityManager)(ref entityManager)).Debug;
						((BepInExLogInterpolatedStringHandler)obj2).AppendFormatted<string>(((EntityManagerDebug)(ref debug)).GetEntityInfo(playerCharacter));
					}
					logger7.LogInfo(val);
				}
				playerGroup = new PlayerGroup
				{
					Allies = new Dictionary<Entity, Entity>()
				};
				return;
			}
			if (logging)
			{
				ManualLogSource logger8 = Plugin.Logger;
				BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(50, 3, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<DateTime>(DateTime.Now);
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral(": Player Character Found Value: ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(val2.Value);
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" - Faction Index: ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(val2.FactionIndex);
				}
				logger8.LogInfo(val);
			}
			playerGroup.TimeStamp = DateTime.Now;
			Dictionary<Entity, Entity> dictionary = new Dictionary<Entity, Entity>();
			entityManager = Plugin.Server.EntityManager;
			EntityQueryDesc[] array = new EntityQueryDesc[1];
			EntityQueryDesc val3 = new EntityQueryDesc();
			val3.All = Il2CppStructArray<ComponentType>.op_Implicit((ComponentType[])(object)new ComponentType[2]
			{
				ComponentType.ReadOnly<PlayerCharacter>(),
				ComponentType.ReadOnly<IsConnected>()
			});
			val3.Options = (EntityQueryOptions)2;
			array[0] = val3;
			EntityQuery val4 = ((EntityManager)(ref entityManager)).CreateEntityQuery((EntityQueryDesc[])(object)array);
			NativeArray<Entity> val5 = ((EntityQuery)(ref val4)).ToEntityArray(AllocatorHandle.op_Implicit((Allocator)2));
			if (logging)
			{
				ManualLogSource logger9 = Plugin.Logger;
				BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(45, 2, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<DateTime>(DateTime.Now);
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral(": got connected PC entities buffer of length ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(val5.Length);
				}
				logger9.LogInfo(val);
			}
			Enumerator<Entity> enumerator = val5.GetEnumerator();
			Team val7 = default(Team);
			while (enumerator.MoveNext())
			{
				Entity current = enumerator.Current;
				Entity val6;
				if (logging)
				{
					ManualLogSource logger10 = Plugin.Logger;
					string text = DateTime.Now.ToString();
					val6 = current;
					logger10.LogInfo((object)(text + ": got Entity " + ((object)(Entity)(ref val6)).ToString()));
				}
				entityManager = Plugin.Server.EntityManager;
				if (((EntityManager)(ref entityManager)).HasComponent<PlayerCharacter>(current))
				{
					if (logging)
					{
						ManualLogSource logger11 = Plugin.Logger;
						string text2 = DateTime.Now.ToString();
						val6 = current;
						logger11.LogInfo((object)(text2 + ": Entity is User " + ((object)(Entity)(ref val6)).ToString()));
					}
					if (((Entity)(ref current)).Equals(playerCharacter))
					{
						if (logging)
						{
							Plugin.Logger.LogInfo((object)(DateTime.Now.ToString() + ": Entity is self"));
						}
						dictionary[current] = current;
						continue;
					}
					bool flag2 = false;
					try
					{
						if (logging)
						{
							Plugin.Logger.LogInfo((object)(DateTime.Now.ToString() + ": Trying to get teams "));
						}
						entityManager = Plugin.Server.EntityManager;
						bool flag3 = ((EntityManager)(ref entityManager)).TryGetComponentData<Team>(current, ref val7);
						if (logging)
						{
							if (flag3)
							{
								Plugin.Logger.LogInfo((object)(DateTime.Now.ToString() + ": Team Value:" + val7.Value + " - Faction Index: " + val7.FactionIndex));
							}
							else
							{
								ManualLogSource logger12 = Plugin.Logger;
								string text3 = DateTime.Now.ToString();
								val6 = current;
								logger12.LogInfo((object)(text3 + ": Could not get team for entity: " + ((object)(Entity)(ref val6)).ToString()));
								ManualLogSource logger13 = Plugin.Logger;
								string text4 = DateTime.Now.ToString();
								entityManager = Plugin.Server.EntityManager;
								debug = ((EntityManager)(ref entityManager)).Debug;
								logger13.LogInfo((object)(text4 + ": Components for entity are: " + ((EntityManagerDebug)(ref debug)).GetEntityInfo(current)));
							}
						}
						flag2 = flag3 && val7.Value == val2.Value;
					}
					catch (Exception ex)
					{
						if (logging)
						{
							Plugin.Logger.LogInfo((object)(DateTime.Now.ToString() + ": IsAllies Failed " + ex.Message));
						}
					}
					if (flag2)
					{
						if (logging)
						{
							ManualLogSource logger14 = Plugin.Logger;
							BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(13, 3, ref flag);
							if (flag)
							{
								((BepInExLogInterpolatedStringHandler)val).AppendFormatted<DateTime>(DateTime.Now);
								((BepInExLogInterpolatedStringHandler)val).AppendLiteral(": Allies: ");
								((BepInExLogInterpolatedStringHandler)val).AppendFormatted<Entity>(playerCharacter);
								((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" - ");
								((BepInExLogInterpolatedStringHandler)val).AppendFormatted<Entity>(current);
							}
							logger14.LogInfo(val);
						}
						dictionary[current] = current;
					}
					else if (logging)
					{
						ManualLogSource logger15 = Plugin.Logger;
						BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(17, 3, ref flag);
						if (flag)
						{
							((BepInExLogInterpolatedStringHandler)val).AppendFormatted<DateTime>(DateTime.Now);
							((BepInExLogInterpolatedStringHandler)val).AppendLiteral(": Not allies: ");
							((BepInExLogInterpolatedStringHandler)val).AppendFormatted<Entity>(playerCharacter);
							((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" - ");
							((BepInExLogInterpolatedStringHandler)val).AppendFormatted<Entity>(current);
						}
						logger15.LogInfo(val);
					}
				}
				else if (logging)
				{
					Plugin.Logger.LogInfo((object)(DateTime.Now.ToString() + ": No Associated User!"));
				}
			}
			playerGroup.Allies = dictionary;
			playerGroup.AllyCount = dictionary.Count;
			Cache.PlayerAllies[playerCharacter] = playerGroup;
		}
	}
	public static class AutoSaveSystem
	{
		public const string mainSaveFolder = "BepInEx/config/RPGMods/Waypoints/";

		public const string backupSaveFolder = "BepInEx/config/RPGMods/Waypoints/Backup/";

		private static int saveCount = 0;

		public static int backupFrequency = 5;

		public static bool saveLogging = false;

		public static void SaveDatabase()
		{
			saveCount++;
			string saveFolder = "BepInEx/config/RPGMods/Waypoints/";
			if (saveCount % backupFrequency == 0)
			{
				saveFolder = "BepInEx/config/RPGMods/Waypoints/Backup/";
			}
			Waypoint.SaveWaypoints(saveFolder);
			if (saveLogging)
			{
				Plugin.Logger.LogInfo((object)(DateTime.Now.ToString() + ": Waypoints Saved."));
			}
			Plugin.Logger.LogInfo((object)(DateTime.Now.ToString() + ": Waypoints databases saved to JSON file."));
		}

		public static void LoadDatabase()
		{
			Waypoint.LoadWaypoints();
			Plugin.Logger.LogInfo((object)(DateTime.Now.ToString() + ": Waypoints database is now loaded."));
		}
	}
	public static class Color
	{
		private static string ColorText(string color, string text)
		{
			return "<color=" + color + ">" + text + "</color>";
		}

		public static string White(string text)
		{
			return ColorText("#fffffffe", text);
		}

		public static string Black(string text)
		{
			return ColorText("#000000", text);
		}

		public static string Gray(string text)
		{
			return ColorText("#404040", text);
		}

		public static string Orange(string text)
		{
			return ColorText("#c98332", text);
		}

		public static string Yellow(string text)
		{
			return ColorText("#cfc14a", text);
		}

		public static string Green(string text)
		{
			return ColorText("#56ad3b", text);
		}

		public static string Teal(string text)
		{
			return ColorText("#3b8dad", text);
		}

		public static string Blue(string text)
		{
			return ColorText("#3444a8", text);
		}

		public static string Purple(string text)
		{
			return ColorText("#8b3691", text);
		}

		public static string Pink(string text)
		{
			return ColorText("#b53c8ffe", text);
		}

		public static string Red(string text)
		{
			return ColorText("#ff0000", text);
		}

		public static string SoftRed(string text)
		{
			return ColorText("#b53c40", text);
		}
	}
	public static class Cache
	{
		public static Dictionary<string, PlayerData> NamePlayerCache = new Dictionary<string, PlayerData>();

		public static Dictionary<ulong, PlayerData> SteamPlayerCache = new Dictionary<ulong, PlayerData>();

		public static Dictionary<Entity, PlayerGroup> PlayerAllies = new Dictionary<Entity, PlayerGroup>();

		public static Dictionary<Entity, LocalToWorld> PlayerLocations = new Dictionary<Entity, LocalToWorld>();

		public static Dictionary<ulong, List<BuffData>> buffData = new Dictionary<ulong, List<BuffData>>();

		public static Dictionary<ulong, float> command_Cooldown = new Dictionary<ulong, float>();

		public static Dictionary<ulong, DateTime> playerCombatStart = new Dictionary<ulong, DateTime>();

		public static Dictionary<ulong, DateTime> playerCombatEnd = new Dictionary<ulong, DateTime>();

		public static Dictionary<ulong, DateTime> player_last_combat = new Dictionary<ulong, DateTime>();

		public static Dictionary<ulong, int> player_combat_ticks = new Dictionary<ulong, int>();

		public static Dictionary<ulong, float> player_level = new Dictionary<ulong, float>();

		public static Dictionary<ulong, Dictionary<UnitStatType, float>> player_geartypedonned = new Dictionary<ulong, Dictionary<UnitStatType, float>>();

		public static Dictionary<Entity, LevelData> PlayerLevelCache = new Dictionary<Entity, LevelData>();

		public static Dictionary<ulong, PvPOffenseLog> OffenseLog = new Dictionary<ulong, PvPOffenseLog>();

		public static Dictionary<ulong, ReputationLog> ReputationLog = new Dictionary<ulong, ReputationLog>();

		public static Dictionary<Entity, StateData> HostilityState = new Dictionary<Entity, StateData>();

		public static SizedDictionaryAsync<float, SpawnNPCListen> spawnNPC_Listen = new SizedDictionaryAsync<float, SpawnNPCListen>(500);

		public static DateTime GetCombatStart(ulong steamID)
		{
			if (!playerCombatStart.TryGetValue(steamID, out var value))
			{
				return DateTime.MinValue;
			}
			return value;
		}

		public static DateTime GetCombatEnd(ulong steamID)
		{
			if (!playerCombatEnd.TryGetValue(steamID, out var value))
			{
				return DateTime.MinValue;
			}
			return value;
		}
	}
	public static class Database
	{
		public static class Buff
		{
			public static PrefabGUID EquipBuff = new PrefabGUID(343359674);

			public static PrefabGUID WolfStygian = new PrefabGUID(-1158884666);

			public static PrefabGUID WolfNormal = new PrefabGUID(-351718282);

			public static PrefabGUID BatForm = new PrefabGUID(1205505492);

			public static PrefabGUID NormalForm = new PrefabGUID(1352541204);

			public static PrefabGUID RatForm = new PrefabGUID(902394170);

			public static PrefabGUID DownedBuff = new PrefabGUID(-1992158531);

			public static PrefabGUID BloodSight = new PrefabGUID(1199823151);

			public static PrefabGUID InCombat = new PrefabGUID(581443919);

			public static PrefabGUID InCombat_PvP = new PrefabGUID(697095869);

			public static PrefabGUID OutofCombat = new PrefabGUID(897325455);

			public static PrefabGUID BloodMoon = new PrefabGUID(-560523291);

			public static PrefabGUID Severe_GarlicDebuff = new PrefabGUID(1582196539);

			public static PrefabGUID General_GarlicDebuff = new PrefabGUID(-1701323826);

			public static PrefabGUID Buff_4pT2 = new PrefabGUID(1444835872);

			public static PrefabGUID cloakBuff = new PrefabGUID(1409441911);

			public static PrefabGUID SiegeGolem_T01 = new PrefabGUID(-148535031);

			public static PrefabGUID SiegeGolem_T02 = new PrefabGUID(914043867);

			public static PrefabGUID AB_Interact_GetInside_Owner_Buff_Stone = new PrefabGUID(569692162);

			public static PrefabGUID AB_Interact_GetInside_Owner_Buff_Base = new PrefabGUID(381160212);

			public static PrefabGUID AB_ExitCoffin_Travel_Phase_Stone = new PrefabGUID(-162820429);

			public static PrefabGUID AB_ExitCoffin_Travel_Phase_Base = new PrefabGUID(-997204628);

			public static PrefabGUID AB_Interact_TombCoffinSpawn_Travel = new PrefabGUID(722466953);

			public static PrefabGUID AB_Interact_WaypointSpawn_Travel = new PrefabGUID(-66432447);

			public static PrefabGUID AB_Interact_WoodenCoffinSpawn_Travel = new PrefabGUID(-1705977973);

			public static PrefabGUID AB_Interact_StoneCoffinSpawn_Travel = new PrefabGUID(-1276482574);

			public static PrefabGUID LevelUp_Buff = new PrefabGUID(-1133938228);

			public static PrefabGUID AB_Undead_BishopOfShadows_ShadowSoldier_Minion_Buff = new PrefabGUID(450215391);

			public static PrefabGUID HolyNuke = new PrefabGUID(-1807398295);

			public static PrefabGUID AB_Manticore_Flame_Buff_UNUSED = new PrefabGUID(1502566434);

			public static PrefabGUID Pig_Transform_Debuff = new PrefabGUID(1356064917);

			public static PrefabGUID EquipBuff_Chest_Base = new PrefabGUID(1872694456);

			public static PrefabGUID Buff_VBlood_Perk_ProgTest = new PrefabGUID(1614409699);

			public static PrefabGUID AB_BloodBuff_VBlood_0 = new PrefabGUID(20081801);
		}

		public static JsonSerializerOptions JSON_options = new JsonSerializerOptions
		{
			WriteIndented = false,
			IncludeFields = false
		};

		public static JsonSerializerOptions Pretty_JSON_options = new JsonSerializerOptions
		{
			WriteIndented = true,
			IncludeFields = true
		};

		public static HashSet<ApplyBuffDebugEvent> playerBuffs = new HashSet<ApplyBuffDebugEvent>();

		public static bool ErrorOnLoadingExperienceClasses = false;

		public static Dictionary<ulong, SiegeData> SiegeState = new Dictionary<ulong, SiegeData>();

		public static Dictionary<ulong, bool> sunimmunity { get; set; }

		public static Dictionary<ulong, bool> nocooldownlist { get; set; }

		public static Dictionary<ulong, bool> godmode { get; set; }

		public static Dictionary<ulong, bool> speeding { get; set; }

		public static Dictionary<ulong, bool> autoRespawn { get; set; }

		public static Dictionary<string, Tuple<float, float, float, int, int, int, string>> waypointDBNew { get; set; }

		public static Dictionary<ulong, DateTime> lastUsedWaypoint { get; set; }

		public static Dictionary<string, WaypointData> globalWaypoint { get; set; }

		public static Dictionary<string, WaypointData> waypoints { get; set; }

		public static Dictionary<ulong, int> waypoints_owned { get; set; }

		public static Dictionary<ulong, int> user_permission { get; set; }

		public static Dictionary<string, int> command_permission { get; set; }

		public static Dictionary<ulong, PowerUpData> PowerUpList { get; set; }

		public static Dictionary<ulong, int> player_experience { get; set; }

		public static Dictionary<ulong, int> player_abilityIncrease { get; set; }

		public static LazyDictionary<ulong, LazyDictionary<UnitStatType, float>> player_level_stats { get; set; }

		public static Dictionary<string, Dictionary<UnitStatType, float>> experience_class_stats { get; set; }

		public static Dictionary<ulong, bool> player_log_exp { get; set; }

		public static Dictionary<int, int> XPChart { get; set; }

		public static ConcurrentDictionary<ulong, PvPData> PvPStats { get; set; }

		public static Dictionary<Entity, Entity> killMap { get; set; }

		public static Dictionary<ulong, int> pvpkills { get; set; }

		public static Dictionary<ulong, int> pvpdeath { get; set; }

		public static Dictionary<ulong, double> pvpkd { get; set; }

		public static Dictionary<ulong, DateTime> player_decaymastery_logout { get; set; }

		public static Dictionary<ulong, bool> player_log_mastery { get; set; }

		public static Dictionary<ulong, bool> player_log_buffs { get; set; }

		public static bool logAllBuffs { get; set; }

		public static Dictionary<int, int> forcedMasteryType { get; set; }

		public static Dictionary<int, string> forcedMasteryName { get; set; }

		public static Dictionary<ulong, HashSet<int>> playerActiveBuffs { get; set; }

		public static Dictionary<ulong, DateTime> playerActiveBuffsLastClear { get; set; }

		public static Dictionary<int, RateData> buffMasteryRates { get; set; }

		public static Dictionary<ulong, WeaponMasterData_Dictionary> player_weaponmastery_Dictionary { get; set; }

		public static Dictionary<int, RateData> mastery_Rates { get; set; }

		public static Dictionary<ulong, DateTime> playerDecayBloodlineLogout { get; set; }

		public static Dictionary<ulong, bool> playerLogBloodline { get; set; }

		public static ConcurrentDictionary<int, FactionData> FactionStats { get; set; }

		public static HashSet<string> IgnoredMonsters { get; set; }

		public static HashSet<PrefabGUID> IgnoredMonstersGUID { get; set; }

		public static Dictionary<int, Tuple<int, string>> ForcedFactionMonstersGUID { get; set; }
	}
	public static class FactionUnits
	{
		public struct Unit
		{
			public Prefabs.Units type { get; }

			public int level { get; }

			public int value { get; }

			public Unit(Prefabs.Units type, int level, int value)
			{
				this.type = type;
				this.level = level;
				this.value = value;
			}
		}

		private static Unit[] bandit_units = new Unit[9]
		{
			new Unit(Prefabs.Units.CHAR_Bandit_Wolf, 14, 1),
			new Unit(Prefabs.Units.CHAR_Bandit_Hunter, 16, 2),
			new Unit(Prefabs.Units.CHAR_Bandit_Thug, 16, 2),
			new Unit(Prefabs.Units.CHAR_Bandit_Thief, 18, 3),
			new Unit(Prefabs.Units.CHAR_Bandit_Mugger, 20, 3),
			new Unit(Prefabs.Units.CHAR_Bandit_Trapper, 20, 3),
			new Unit(Prefabs.Units.CHAR_Bandit_Deadeye, 26, 4),
			new Unit(Prefabs.Units.CHAR_Bandit_Stalker, 30, 4),
			new Unit(Prefabs.Units.CHAR_Bandit_Bomber, 32, 4)
		};

		private static Unit[] church = new Unit[14]
		{
			new Unit(Prefabs.Units.CHAR_ChurchOfLight_Miner_Standard, 42, 1),
			new Unit(Prefabs.Units.CHAR_ChurchOfLight_Archer, 56, 1),
			new Unit(Prefabs.Units.CHAR_ChurchOfLight_SlaveRuffian, 60, 1),
			new Unit(Prefabs.Units.CHAR_ChurchOfLight_Cleric, 62, 2),
			new Unit(Prefabs.Units.CHAR_ChurchOfLight_Footman, 62, 2),
			new Unit(Prefabs.Units.CHAR_ChurchOfLight_Rifleman, 62, 2),
			new Unit(Prefabs.Units.CHAR_ChurchOfLight_SlaveMaster_Enforcer, 64, 3),
			new Unit(Prefabs.Units.CHAR_ChurchOfLight_SlaveMaster_Sentry, 64, 3),
			new Unit(Prefabs.Units.CHAR_ChurchOfLight_Knight_2H, 68, 3),
			new Unit(Prefabs.Units.CHAR_ChurchOfLight_Knight_Shield, 68, 3),
			new Unit(Prefabs.Units.CHAR_ChurchOfLight_CardinalAide, 70, 4),
			new Unit(Prefabs.Units.CHAR_ChurchOfLight_Lightweaver, 72, 4),
			new Unit(Prefabs.Units.CHAR_ChurchOfLight_Paladin, 74, 4),
			new Unit(Prefabs.Units.CHAR_ChurchOfLight_Priest, 74, 4)
		};

		private static Unit[] church_elite = new Unit[1]
		{
			new Unit(Prefabs.Units.CHAR_Paladin_DivineAngel, 80, 5)
		};

		private static Unit[] church_extra = new Unit[1]
		{
			new Unit(Prefabs.Units.CHAR_Militia_EyeOfGod, 0, 1)
		};

		private static Unit[] cultist_units = new Unit[2]
		{
			new Unit(Prefabs.Units.CHAR_Cultist_Pyromancer, 60, 2),
			new Unit(Prefabs.Units.CHAR_Cultist_Slicer, 60, 2)
		};

		private static Unit[] cursed_units = new Unit[12]
		{
			new Unit(Prefabs.Units.CHAR_Cursed_MonsterToad, 61, 1),
			new Unit(Prefabs.Units.CHAR_Cursed_ToadSpitter, 61, 1),
			new Unit(Prefabs.Units.CHAR_Cursed_Witch_Exploding_Mosquito, 61, 1),
			new Unit(Prefabs.Units.CHAR_Cursed_MonsterToad_Minion, 62, 1),
			new Unit(Prefabs.Units.CHAR_Cursed_Mosquito, 62, 1),
			new Unit(Prefabs.Units.CHAR_Cursed_Wolf, 62, 1),
			new Unit(Prefabs.Units.CHAR_Cursed_WormTerror, 62, 2),
			new Unit(Prefabs.Units.CHAR_Cursed_Bear_Standard, 64, 2),
			new Unit(Prefabs.Units.CHAR_Cursed_Nightlurker, 64, 2),
			new Unit(Prefabs.Units.CHAR_Cursed_Witch, 72, 3),
			new Unit(Prefabs.Units.CHAR_Cursed_Bear_Spirit, 80, 3),
			new Unit(Prefabs.Units.CHAR_Cursed_Wolf_Spirit, 80, 3)
		};

		private static Unit[] farmlands = new Unit[8]
		{
			new Unit(Prefabs.Units.CHAR_Farmlands_HostileVillager_Female_FryingPan, 28, 1),
			new Unit(Prefabs.Units.CHAR_Farmlands_HostileVillager_Female_Pitchfork, 28, 1),
			new Unit(Prefabs.Units.CHAR_Farmlands_HostileVillager_Male_Club, 28, 1),
			new Unit(Prefabs.Units.CHAR_Farmlands_HostileVillager_Male_Shovel, 28, 1),
			new Unit(Prefabs.Units.CHAR_Farmlands_HostileVillager_Male_Torch, 28, 1),
			new Unit(Prefabs.Units.CHAR_Farmlands_HostileVillager_Male_Unarmed, 28, 1),
			new Unit(Prefabs.Units.CHAR_Farmlands_Woodcutter_Standard, 34, 1),
			new Unit(Prefabs.Units.CHAR_Farmland_Wolf, 40, 1)
		};

		private static Unit[] farmNonHostile = new Unit[4]
		{
			new Unit(Prefabs.Units.CHAR_Farmlands_Villager_Female_Sister, 20, 1),
			new Unit(Prefabs.Units.CHAR_Farmlands_Villager_Female, 26, 1),
			new Unit(Prefabs.Units.CHAR_Farmlands_Villager_Male, 26, 1),
			new Unit(Prefabs.Units.CHAR_Farmlands_Farmer, 34, 1)
		};

		public static Unit[] farmFood = new Unit[6]
		{
			new Unit(Prefabs.Units.CHAR_Farmlands_SheepOld, 10, 1),
			new Unit(Prefabs.Units.CHAR_Farmlands_SmallPig, 20, 1),
			new Unit(Prefabs.Units.CHAR_Farmlands_Pig, 24, 1),
			new Unit(Prefabs.Units.CHAR_Farmlands_Cow, 30, 1),
			new Unit(Prefabs.Units.CHAR_Farmlands_Sheep, 36, 1),
			new Unit(Prefabs.Units.CHAR_Farmlands_Ram, 38, 1)
		};

		private static Unit[] forest = new Unit[3]
		{
			new Unit(Prefabs.Units.CHAR_Forest_Wolf, 10, 1),
			new Unit(Prefabs.Units.CHAR_Forest_AngryMoose, 16, 2),
			new Unit(Prefabs.Units.CHAR_Forest_Bear_Standard, 18, 2)
		};

		private static Unit[] gloomrot = new Unit[14]
		{
			new Unit(Prefabs.Units.CHAR_Gloomrot_Pyro, 56, 1),
			new Unit(Prefabs.Units.CHAR_Gloomrot_Batoon, 58, 1),
			new Unit(Prefabs.Units.CHAR_Gloomrot_Railgunner, 58, 1),
			new Unit(Prefabs.Units.CHAR_Gloomrot_Tazer, 58, 1),
			new Unit(Prefabs.Units.CHAR_Gloomrot_Technician, 58, 1),
			new Unit(Prefabs.Units.CHAR_Gloomrot_Technician_Labworker, 58, 1),
			new Unit(Prefabs.Units.CHAR_Gloomrot_TractorBeamer, 58, 1),
			new Unit(Prefabs.Units.CHAR_Gloomrot_SentryOfficer, 60, 1),
			new Unit(Prefabs.Units.CHAR_Gloomrot_SentryTurret, 60, 1),
			new Unit(Prefabs.Units.CHAR_Gloomrot_SpiderTank_Driller, 60, 1),
			new Unit(Prefabs.Units.CHAR_Gloomrot_AceIncinerator, 74, 1),
			new Unit(Prefabs.Units.CHAR_Gloomrot_SpiderTank_LightningRod, 74, 1),
			new Unit(Prefabs.Units.CHAR_Gloomrot_SpiderTank_Gattler, 77, 1),
			new Unit(Prefabs.Units.CHAR_Gloomrot_SpiderTank_Zapper, 77, 1)
		};

		private static Unit[] harpy = new Unit[4]
		{
			new Unit(Prefabs.Units.CHAR_Harpy_Dasher, 66, 1),
			new Unit(Prefabs.Units.CHAR_Harpy_FeatherDuster, 66, 1),
			new Unit(Prefabs.Units.CHAR_Harpy_Sorceress, 68, 1),
			new Unit(Prefabs.Units.CHAR_Harpy_Scratcher, 70, 1)
		};

		private static Unit[] militia_units = new Unit[12]
		{
			new Unit(Prefabs.Units.CHAR_Militia_Hound, 36, 1),
			new Unit(Prefabs.Units.CHAR_Militia_Light, 36, 1),
			new Unit(Prefabs.Units.CHAR_Militia_Torchbearer, 36, 2),
			new Unit(Prefabs.Units.CHAR_Militia_InkCrawler, 38, 2),
			new Unit(Prefabs.Units.CHAR_Militia_Guard, 40, 1),
			new Unit(Prefabs.Units.CHAR_Militia_Bomber, 47, 1),
			new Unit(Prefabs.Units.CHAR_Militia_Longbowman, 42, 3),
			new Unit(Prefabs.Units.CHAR_Militia_Nun, 42, 3),
			new Unit(Prefabs.Units.CHAR_Militia_Miner_Standard, 50, 1),
			new Unit(Prefabs.Units.CHAR_Militia_Heavy, 54, 3),
			new Unit(Prefabs.Units.CHAR_Militia_Devoted, 56, 2),
			new Unit(Prefabs.Units.CHAR_Militia_Crossbow, 70, 2)
		};

		private static Unit[] vhunter = new Unit[2]
		{
			new Unit(Prefabs.Units.CHAR_VHunter_Leader_VBlood, 44, 5),
			new Unit(Prefabs.Units.CHAR_VHunter_Jade_VBlood, 57, 5)
		};

		private static Unit[] wtf = new Unit[3]
		{
			new Unit(Prefabs.Units.CHAR_Scarecrow, 54, 3),
			new Unit(Prefabs.Units.CHAR_ChurchOfLight_Sommelier_BarrelMinion, 50, 1),
			new Unit(Prefabs.Units.CHAR_Farmlands_HostileVillager_Werewolf, 20, 2)
		};

		private static Unit[] spiders = new Unit[7]
		{
			new Unit(Prefabs.Units.CHAR_Spider_Forestling, 20, 1),
			new Unit(Prefabs.Units.CHAR_Spider_Forest, 26, 1),
			new Unit(Prefabs.Units.CHAR_Spider_Baneling, 56, 1),
			new Unit(Prefabs.Units.CHAR_Spider_Spiderling, 56, 1),
			new Unit(Prefabs.Units.CHAR_Spider_Melee, 58, 2),
			new Unit(Prefabs.Units.CHAR_Spider_Range, 58, 2),
			new Unit(Prefabs.Units.CHAR_Spider_Broodmother, 60, 4)
		};

		private static Unit[] golems = new Unit[5]
		{
			new Unit(Prefabs.Units.CHAR_IronGolem, 36, 1),
			new Unit(Prefabs.Units.CHAR_StoneGolem, 36, 1),
			new Unit(Prefabs.Units.CHAR_CopperGolem, 42, 1),
			new Unit(Prefabs.Units.CHAR_RockElemental, 50, 1),
			new Unit(Prefabs.Units.CHAR_Treant, 57, 1)
		};

		private static Unit[] mutants = new Unit[5]
		{
			new Unit(Prefabs.Units.CHAR_Mutant_RatHorror, 58, 1),
			new Unit(Prefabs.Units.CHAR_Mutant_FleshGolem, 60, 2),
			new Unit(Prefabs.Units.CHAR_Mutant_Wolf, 64, 1),
			new Unit(Prefabs.Units.CHAR_Mutant_Spitter, 70, 2),
			new Unit(Prefabs.Units.CHAR_Mutant_Bear_Standard, 74, 2)
		};

		private static Unit[] undead_minions = new Unit[39]
		{
			new Unit(Prefabs.Units.CHAR_Undead_SkeletonSoldier_TombSummon, 1, 1),
			new Unit(Prefabs.Units.CHAR_Undead_SkeletonSoldier_Withered, 1, 1),
			new Unit(Prefabs.Units.CHAR_Undead_SkeletonCrossbow_Graveyard, 2, 1),
			new Unit(Prefabs.Units.CHAR_Undead_RottingGhoul, 4, 1),
			new Unit(Prefabs.Units.CHAR_Undead_ArmoredSkeletonCrossbow_Farbane, 18, 1),
			new Unit(Prefabs.Units.CHAR_Undead_SkeletonCrossbow_GolemMinion, 18, 1),
			new Unit(Prefabs.Units.CHAR_Undead_SkeletonCrossbow_Farbane_OLD, 20, 1),
			new Unit(Prefabs.Units.CHAR_Undead_SkeletonSoldier_Armored_Farbane, 20, 1),
			new Unit(Prefabs.Units.CHAR_Undead_SkeletonSoldier_GolemMinion, 20, 1),
			new Unit(Prefabs.Units.CHAR_Undead_SkeletonApprentice, 22, 1),
			new Unit(Prefabs.Units.CHAR_Undead_UndyingGhoul, 25, 2),
			new Unit(Prefabs.Units.CHAR_Undead_Priest, 27, 3),
			new Unit(Prefabs.Units.CHAR_Undead_Ghoul_TombSummon, 30, 1),
			new Unit(Prefabs.Units.CHAR_Undead_FlyingSkull, 32, 2),
			new Unit(Prefabs.Units.CHAR_Undead_Assassin, 35, 3),
			new Unit(Prefabs.Units.CHAR_Undead_ArmoredSkeletonCrossbow_Dunley, 38, 1),
			new Unit(Prefabs.Units.CHAR_Undead_SkeletonGolem, 38, 3),
			new Unit(Prefabs.Units.CHAR_Undead_Ghoul_Armored_Farmlands, 40, 2),
			new Unit(Prefabs.Units.CHAR_Undead_SkeletonSoldier_Armored_Dunley, 40, 2),
			new Unit(Prefabs.Units.CHAR_Undead_SkeletonSoldier_Infiltrator, 40, 1),
			new Unit(Prefabs.Units.CHAR_Undead_Guardian, 42, 2),
			new Unit(Prefabs.Units.CHAR_Undead_Necromancer, 46, 3),
			new Unit(Prefabs.Units.CHAR_Undead_Necromancer_TombSummon, 46, 3),
			new Unit(Prefabs.Units.CHAR_Undead_SkeletonMage, 44, 3),
			new Unit(Prefabs.Units.CHAR_Unholy_Baneling, 58, 1),
			new Unit(Prefabs.Units.CHAR_Undead_CursedSmith_FloatingWeapon_Base, 60, 3),
			new Unit(Prefabs.Units.CHAR_Undead_CursedSmith_FloatingWeapon_Mace, 60, 3),
			new Unit(Prefabs.Units.CHAR_Undead_CursedSmith_FloatingWeapon_Slashers, 60, 3),
			new Unit(Prefabs.Units.CHAR_Undead_CursedSmith_FloatingWeapon_Spear, 60, 3),
			new Unit(Prefabs.Units.CHAR_Undead_CursedSmith_FloatingWeapon_Sword, 60, 3),
			new Unit(Prefabs.Units.CHAR_Undead_ShadowSoldier, 60, 2),
			new Unit(Prefabs.Units.CHAR_Undead_SkeletonSoldier_Base, 60, 1),
			new Unit(Prefabs.Units.CHAR_Undead_GhostMilitia_Crossbow, 63, 2),
			new Unit(Prefabs.Units.CHAR_Undead_GhostMilitia_Light, 63, 2),
			new Unit(Prefabs.Units.CHAR_Undead_ZealousCultist_Ghost, 64, 1),
			new Unit(Prefabs.Units.CHAR_Undead_GhostAssassin, 65, 3),
			new Unit(Prefabs.Units.CHAR_Undead_GhostBanshee, 65, 3),
			new Unit(Prefabs.Units.CHAR_Undead_GhostBanshee_TombSummon, 65, 3),
			new Unit(Prefabs.Units.CHAR_Undead_GhostGuardian, 65, 3)
		};

		private static Unit[] werewolves = new Unit[2]
		{
			new Unit(Prefabs.Units.CHAR_Werewolf, 62, 1),
			new Unit(Prefabs.Units.CHAR_WerewolfChieftain_VBlood, 64, 2)
		};

		private static Unit[] winter = new Unit[3]
		{
			new Unit(Prefabs.Units.CHAR_Winter_Wolf, 50, 1),
			new Unit(Prefabs.Units.CHAR_Winter_Moose, 52, 2),
			new Unit(Prefabs.Units.CHAR_Winter_Bear_Standard, 54, 2)
		};

		private static Unit[] servants = new Unit[59]
		{
			new Unit(Prefabs.Units.CHAR_Bandit_Bomber_Servant, 32, 1),
			new Unit(Prefabs.Units.CHAR_Bandit_Deadeye_Servant, 26, 1),
			new Unit(Prefabs.Units.CHAR_Bandit_Hunter_Servant, 16, 1),
			new Unit(Prefabs.Units.CHAR_Bandit_Miner_Standard_Servant, 14, 1),
			new Unit(Prefabs.Units.CHAR_Bandit_Mugger_Servant, 20, 1),
			new Unit(Prefabs.Units.CHAR_Bandit_Stalker_Servant, 30, 1),
			new Unit(Prefabs.Units.CHAR_Bandit_Thief_Servant, 18, 1),
			new Unit(Prefabs.Units.CHAR_Bandit_Thug_Servant, 16, 1),
			new Unit(Prefabs.Units.CHAR_Bandit_Trapper_Servant, 20, 1),
			new Unit(Prefabs.Units.CHAR_Bandit_Woodcutter_Standard_Servant, 14, 1),
			new Unit(Prefabs.Units.CHAR_Bandit_Worker_Gatherer_Servant, 14, 1),
			new Unit(Prefabs.Units.CHAR_ChurchOfLight_Archer_Servant, 56, 1),
			new Unit(Prefabs.Units.CHAR_ChurchOfLight_Cleric_Servant, 62, 1),
			new Unit(Prefabs.Units.CHAR_ChurchOfLight_Footman_Servant, 62, 1),
			new Unit(Prefabs.Units.CHAR_ChurchOfLight_Knight_2H_Servant, 68, 1),
			new Unit(Prefabs.Units.CHAR_ChurchOfLight_Knight_Shield_Servant, 68, 1),
			new Unit(Prefabs.Units.CHAR_ChurchOfLight_Lightweaver_Servant, 72, 1),
			new Unit(Prefabs.Units.CHAR_ChurchOfLight_Miner_Standard_Servant, 42, 1),
			new Unit(Prefabs.Units.CHAR_ChurchOfLight_Paladin_Servant, 74, 1),
			new Unit(Prefabs.Units.CHAR_ChurchOfLight_Priest_Servant, 74, 1),
			new Unit(Prefabs.Units.CHAR_ChurchOfLight_Rifleman_Servant, 62, 1),
			new Unit(Prefabs.Units.CHAR_ChurchOfLight_SlaveMaster_Enforcer_Servant, 64, 1),
			new Unit(Prefabs.Units.CHAR_ChurchOfLight_SlaveMaster_Sentry_Servant, 64, 1),
			new Unit(Prefabs.Units.CHAR_ChurchOfLight_SlaveRuffian_Servant, 60, 1),
			new Unit(Prefabs.Units.CHAR_ChurchOfLight_Villager_Female_Servant, 50, 1),
			new Unit(Prefabs.Units.CHAR_ChurchOfLight_Villager_Male_Servant, 50, 1),
			new Unit(Prefabs.Units.CHAR_Farmlands_Farmer_Servant, 34, 1),
			new Unit(Prefabs.Units.CHAR_Farmlands_Nun_Servant, 46, 1),
			new Unit(Prefabs.Units.CHAR_Farmlands_Villager_Female_Servant, 26, 1),
			new Unit(Prefabs.Units.CHAR_Farmlands_Villager_Female_Sister_Servant, 20, 1),
			new Unit(Prefabs.Units.CHAR_Farmlands_Villager_Male_Servant, 26, 1),
			new Unit(Prefabs.Units.CHAR_Farmlands_Woodcutter_Standard_Servant, 34, 1),
			new Unit(Prefabs.Units.CHAR_Militia_BellRinger_Servant, 36, 1),
			new Unit(Prefabs.Units.CHAR_Militia_Bomber_Servant, 47, 1),
			new Unit(Prefabs.Units.CHAR_Militia_Crossbow_Servant, 36, 1),
			new Unit(Prefabs.Units.CHAR_Militia_Devoted_Servant, 56, 1),
			new Unit(Prefabs.Units.CHAR_Militia_Guard_Servant, 40, 1),
			new Unit(Prefabs.Units.CHAR_Militia_Heavy_Servant, 54, 1),
			new Unit(Prefabs.Units.CHAR_Militia_Light_Servant, 36, 1),
			new Unit(Prefabs.Units.CHAR_Militia_Torchbearer_Servant, 36, 1),
			new Unit(Prefabs.Units.CHAR_Militia_Longbowman_Servant, 42, 1),
			new Unit(Prefabs.Units.CHAR_Militia_Miner_Standard_Servant, 40, 1),
			new Unit(Prefabs.Units.CHAR_Gloomrot_AceIncinerator_Servant, 72, 1),
			new Unit(Prefabs.Units.CHAR_Gloomrot_Batoon_Servant, 58, 1),
			new Unit(Prefabs.Units.CHAR_Gloomrot_Pyro_Servant, 56, 1),
			new Unit(Prefabs.Units.CHAR_Gloomrot_Railgunner_Servant, 58, 1),
			new Unit(Prefabs.Units.CHAR_Gloomrot_SentryOfficer_Servant, 60, 1),
			new Unit(Prefabs.Units.CHAR_Gloomrot_Tazer_Servant, 58, 1),
			new Unit(Prefabs.Units.CHAR_Gloomrot_Technician_Labworker_Servant, 58, 1),
			new Unit(Prefabs.Units.CHAR_Gloomrot_Technician_Servant, 58, 1),
			new Unit(Prefabs.Units.CHAR_Gloomrot_TractorBeamer_Servant, 58, 1),
			new Unit(Prefabs.Units.CHAR_Gloomrot_Villager_Female_Servant, 50, 1),
			new Unit(Prefabs.Units.CHAR_Gloomrot_Villager_Male_Servant, 50, 1),
			new Unit(Prefabs.Units.CHAR_NecromancyDagger_SkeletonBerserker_Armored_Farbane, 20, 1),
			new Unit(Prefabs.Units.CHAR_Paladin_FallenAngel, 80, 1),
			new Unit(Prefabs.Units.CHAR_Spectral_Guardian, 1, 1),
			new Unit(Prefabs.Units.CHAR_Spectral_SpellSlinger, 60, 1),
			new Unit(Prefabs.Units.CHAR_Unholy_DeathKnight, 60, 1),
			new Unit(Prefabs.Units.CHAR_Unholy_FallenAngel, 0, 1)
		};

		private static ArraySegment<Unit> GetUnitsForLevel(Unit[] units, int playerLevel)
		{
			int num = playerLevel + 10;
			int i;
			for (i = 1; i < units.Length && units[i].level < num; i++)
			{
			}
			return new ArraySegment<Unit>(units, 0, i);
		}

		public static ArraySegment<Unit> GetFactionUnits(Prefabs.Faction faction, int playerLevel, int wantedLevel)
		{
			//IL_0265: Unknown result type (might be due to invalid IL or missing references)
			//IL_026b: Expected O, but got Unknown
			switch (faction)
			{
			case Prefabs.Faction.Bandits:
				return GetUnitsForLevel(bandit_units, playerLevel);
			case Prefabs.Faction.Undead:
				return GetUnitsForLevel(undead_minions, playerLevel);
			case Prefabs.Faction.Militia:
				if (wantedLevel > 3)
				{
					return GetUnitsForLevel(church, playerLevel);
				}
				if (wantedLevel > 1)
				{
					return GetUnitsForLevel(militia_units, playerLevel);
				}
				return GetUnitsForLevel(farmlands, playerLevel);
			case Prefabs.Faction.ChurchOfLum_SpotShapeshiftVampire:
				return GetUnitsForLevel(church, playerLevel);
			case Prefabs.Faction.Gloomrot:
				return GetUnitsForLevel(gloomrot, playerLevel);
			default:
			{
				ManualLogSource logger = Plugin.Logger;
				bool flag = default(bool);
				BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(25, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(Enum.GetName(faction));
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" units not yet suppported");
				}
				logger.LogWarning(val);
				return GetUnitsForLevel(bandit_units, playerLevel);
			}
			}
		}
	}
	public class LazyDictionary<TKey, TValue> : Dictionary<TKey, TValue> where TValue : new()
	{
		public new TValue this[TKey key]
		{
			get
			{
				if (!ContainsKey(key))
				{
					Add(key, new TValue());
				}
				return base[key];
			}
			set
			{
				if (!ContainsKey(key))
				{
					Add(key, value);
				}
				else
				{
					base[key] = value;
				}
			}
		}
	}
	public static class Helper
	{
		private static Entity empty_entity = default(Entity);

		private static Random rand = new Random();

		public static ServerGameSettings SGS = null;

		public static ServerGameManager SGM = default(ServerGameManager);

		public static UserActivityGridSystem UAGS = null;

		public static int groupRange = 50;

		public static int buffGUID = 1444835872;

		public static int forbiddenBuffGUID = -161632603;

		public static bool buffLogging = false;

		public static bool deathLogging = true;

		public static PrefabGUID appliedBuff = Database.Buff.Buff_4pT2;

		public static Regex rxName = new Regex("(?<=\\])[^\\[].*");

		public static string GetTrueName(string name)
		{
			MatchCollection matchCollection = rxName.Matches(name);
			if (matchCollection.Count > 0)
			{
				name = matchCollection[matchCollection.Count - 1].ToString();
			}
			return name;
		}

		public static void CreatePlayerCache()
		{
			//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_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Expected O, but got Unknown
			//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_0055: 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_005e: 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_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_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: 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_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: 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_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			Cache.NamePlayerCache.Clear();
			Cache.SteamPlayerCache.Clear();
			EntityManager entityManager = Plugin.Server.EntityManager;
			EntityQueryDesc[] array = new EntityQueryDesc[1];
			EntityQueryDesc val = new EntityQueryDesc();
			val.All = Il2CppStructArray<ComponentType>.op_Implicit((ComponentType[])(object)new ComponentType[1] { ComponentType.ReadOnly<User>() });
			val.Options = (EntityQueryOptions)2;
			array[0] = val;
			EntityQuery val2 = ((EntityManager)(ref entityManager)).CreateEntityQuery((EntityQueryDesc[])(object)array);
			Enumerator<Entity> enumerator = ((EntityQuery)(ref val2)).ToEntityArray(AllocatorHandle.op_Implicit((Allocator)2)).GetEnumerator();
			while (enumerator.MoveNext())
			{
				Entity current = enumerator.Current;
				entityManager = Plugin.Server.EntityManager;
				User componentData = ((EntityManager)(ref entityManager)).GetComponentData<User>(current);
				PlayerData value = new PlayerData(((object)(FixedString64Bytes)(ref componentData.CharacterName)).ToString(), componentData.PlatformId, componentData.IsConnected, current, componentData.LocalCharacter._Entity);
				Cache.NamePlayerCache.TryAdd(GetTrueName(((object)(FixedString64Bytes)(ref componentData.CharacterName)).ToString().ToLower()), value);
				Cache.SteamPlayerCache.TryAdd(componentData.PlatformId, value);
			}
			Plugin.Logger.LogWarning((object)"Player Cache Created.");
		}

		public static Dictionary<TKey, TVal> LoadDB<TKey, TVal>(string specificFile)
		{
			confirmFile("BepInEx/config/RPGMods/Waypoints/", specificFile);
			confirmFile("BepInEx/config/RPGMods/Waypoints/Backup/", specificFile);
			string json = File.ReadAllText("BepInEx/config/RPGMods/Waypoints/" + specificFile);
			Dictionary<TKey, TVal> dictionary;
			try
			{
				dictionary = JsonSerializer.Deserialize<Dictionary<TKey, TVal>>(json);
				if (dictionary == null)
				{
					json = File.ReadAllText("BepInEx/config/RPGMods/Waypoints/Backup/" + specificFile);
					dictionary = JsonSerializer.Deserialize<Dictionary<TKey, TVal>>(json);
				}
				Plugin.Logger.LogWarning((object)(DateTime.Now.ToString() + ": DB Populated for " + specificFile));
			}
			catch (Exception ex)
			{
				dictionary = new Dictionary<TKey, TVal>();
				Plugin.Logger.LogWarning((object)(DateTime.Now.ToString() + ": DB Created for " + specificFile));
				Plugin.Logger.LogWarning((object)(DateTime.Now.ToString() + ": Caught error for " + specificFile + " of: " + ex.ToString()));
			}
			return dictionary;
		}

		public static void TeleportTo(ChatCommandContext ctx, Tuple<float, float, float> position)
		{
			//IL_0005: 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_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: 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_0041: 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_0054: 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_0066: 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_0076: 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_007e: 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_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: 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)
			EntityManager entityManager = Plugin.Server.EntityManager;
			Entity val = ((EntityManager)(ref entityManager)).CreateEntity((ComponentType[])(object)new ComponentType[2]
			{
				ComponentType.ReadWrite<FromCharacter>(),
				ComponentType.ReadWrite<PlayerTeleportDebugEvent>()
			});
			entityManager = Plugin.Server.EntityManager;
			((EntityManager)(ref entityManager)).SetComponentData<FromCharacter>(val, new FromCharacter
			{
				User = ctx.Event.SenderUserEntity,
				Character = ctx.Event.SenderCharacterEntity
			});
			entityManager = Plugin.Server.EntityManager;
			((EntityManager)(ref entityManager)).SetComponentData<PlayerTeleportDebugEvent>(val, new PlayerTeleportDebugEvent
			{
				Position = new float3(position.Item1, position.Item2, position.Item3),
				Target = (TeleportTarget)0
			});
		}

		public static void AddItemToInventory(ChatCommandContext ctx, PrefabGUID guid, int amount)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: 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_001f: 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_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_0042: Unknown result type (might be due to invalid IL or missing references)
			Plugin.Server.GetExistingSystem<GameDataSystem>();
			AddItemSettings val = default(AddItemSettings);
			val.EntityManager = Plugin.Server.EntityManager;
			val.DropRemainder = true;
			val.EquipIfPossible = true;
			InventoryUtilitiesServer.TryAddItem(val, ctx.Event.SenderCharacterEntity, guid, amount);
		}

		public static bool IsPlayerInCombat(Entity player)
		{
			//IL_0005: 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_000b: 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_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			if (!BuffUtility.HasBuff(Plugin.Server.EntityManager, player, PrefabIdentifier.op_Implicit(Database.Buff.InCombat)))
			{
				return BuffUtility.HasBuff(Plugin.Server.EntityManager, player, PrefabIdentifier.op_Implicit(Database.Buff.InCombat_PvP));
			}
			return true;
		}

		public static void confirmFile(string address, string file)
		{
			try
			{
				Directory.CreateDirectory(address);
			}
			catch (Exception ex)
			{
				Plugin.Logger.LogWarning((object)(DateTime.Now.ToString() + ": Error creating directory at " + address + "\n Error is: " + ex.Message));
			}
			try
			{
				if (!File.Exists(address + file))
				{
					File.Create(address + file).Dispose();
				}
			}
			catch (Exception ex2)
			{
				Plugin.Logger.LogWarning((object)(DateTime.Now.ToString() + ": Error creating file at " + address + "\n Error is: " + ex2.Message));
			}
		}
	}
	public class ItemKit
	{
		public string Name { get; }

		public Dictionary<int, int> PrefabGUIDs { get; }

		public ItemKit(string name, Dictionary<int, int> prefabGuids)
		{
			Name = name;
			PrefabGUIDs = prefabGuids;
		}
	}
	public static class Output
	{
		public static void CustomErrorMessage(VChatEvent ev, string message)
		{
			//IL_0005: 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)
			ServerChatUtils.SendSystemMessageToClient(Plugin.Server.EntityManager, ev.User, "<color=#ff0000>" + message + "</color>");
		}

		public static void SendSystemMessage(VChatEvent ev, string message)
		{
			//IL_0005: 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)
			ServerChatUtils.SendSystemMessageToClient(Plugin.Server.EntityManager, ev.User, message ?? "");
		}

		public static void InvalidCommand(VChatEvent ev)
		{
			//IL_0005: 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)
			ServerChatUtils.SendSystemMessageToClient(Plugin.Server.EntityManager, ev.User, "<color=#ff0000>Invalid command.</color>");
		}

		public static void SendLore(Entity userEntity, string message)
		{
			//IL_0005: 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_000b: 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_000f: Unknown result type (might be due to invalid IL or missing references)
			EntityManager entityManager = Plugin.Server.EntityManager;
			ServerChatUtils.SendSystemMessageToClient(entityManager, ((EntityManager)(ref entityManager)).GetComponentData<User>(userEntity), message);
		}
	}
	public static class Prefabs
	{
		public enum Units
		{
			Unknown = 0,
			CHAR_ArchMage_FlameSphere = 2138173476,
			CHAR_ArchMage_Summon = 805231073,
			CHAR_ArchMage_VBlood = -2013903325,
			CHAR_Bandit_Bomber = -1128238456,
			CHAR_Bandit_Bomber_Servant = -450600397,
			CHAR_Bandit_Bomber_VBlood = 1896428751,
			CHAR_Bandit_Deadeye = -1030822544,
			CHAR_Bandit_Deadeye_Chaosarrow_VBlood = 763273073,
			CHAR_Bandit_Deadeye_Frostarrow_VBlood = 1124739990,
			CHAR_Bandit_Deadeye_Servant = -2086044081,
			CHAR_Bandit_Foreman_VBlood = 2122229952,
			CHAR_Bandit_GraveDigger_VBlood_UNUSED = 936169687,
			CHAR_Bandit_Hunter = -1301144178,
			CHAR_Bandit_Hunter_Servant = -370708253,
			CHAR_Bandit_Leader_VBlood_UNUSED = -175381832,
			CHAR_Bandit_Leader_Wolf_Summon = -671059374,
			CHAR_Bandit_Miner_Standard_Servant = 1112903312,
			CHAR_Bandit_Miner_VBlood_UNUSED = 276934707,
			CHAR_Bandit_Mugger = 2057508774,
			CHAR_Bandit_Mugger_Servant = 1727426580,
			CHAR_Bandit_Prisoner_Villager_Female = 1069072707,
			CHAR_Bandit_Prisoner_Villager_Male = 286320185,
			CHAR_Bandit_Stalker = -309264723,
			CHAR_Bandit_Stalker_Servant = 1453520986,
			CHAR_Bandit_Stalker_VBlood = 1106149033,
			CHAR_Bandit_StoneBreaker_VBlood = -2025101517,
			CHAR_Bandit_Thief = 923140362,
			CHAR_Bandit_Thief_Servant = -872078546,
			CHAR_Bandit_Thief_VBlood_UNUSED = 2139023341,
			CHAR_Bandit_Thug = -301730941,
			CHAR_Bandit_Thug_Servant = 1466015976,
			CHAR_Bandit_Tourok_VBlood = -1659822956,
			CHAR_Bandit_Trapper = -589412777,
			CHAR_Bandit_Trapper_Servant = 2112911542,
			CHAR_Bandit_Wolf = -1554428547,
			CHAR_Bandit_Woodcutter_Standard_Servant = 51737727,
			CHAR_Bandit_Worker_Gatherer = 1743532914,
			CHAR_Bandit_Worker_Gatherer_Servant = 48283616,
			CHAR_Bandit_Worker_Miner = -2039670689,
			CHAR_Bandit_Worker_Woodcutter = 1309418594,
			CHAR_BatVampire_VBlood = 1112948824,
			CHAR_ChurchOfLight_Archer = 426583055,
			CHAR_ChurchOfLight_Archer_Servant = -915884427,
			CHAR_ChurchOfLight_Cardinal_VBlood = 114912615,
			CHAR_ChurchOfLight_CardinalAide = 1745498602,
			CHAR_ChurchOfLight_Cleric = -1464869978,
			CHAR_ChurchOfLight_Cleric_Servant = 1218339832,
			CHAR_ChurchOfLight_EnchantedCross = -1449314709,
			CHAR_ChurchOfLight_Footman = 2128996433,
			CHAR_ChurchOfLight_Footman_Servant = -1719944550,
			CHAR_ChurchOfLight_Knight_2H = -930333806,
			CHAR_ChurchOfLight_Knight_2H_Servant = 17367048,
			CHAR_ChurchOfLight_Knight_Shield = 794228023,
			CHAR_ChurchOfLight_Knight_Shield_Servant = -694328454,
			CHAR_ChurchOfLight_Lightweaver = 1185952775,
			CHAR_ChurchOfLight_Lightweaver_Servant = -383158562,
			CHAR_ChurchOfLight_Miner_Standard = 924132254,
			CHAR_ChurchOfLight_Miner_Standard_Servant = -1988959460,
			CHAR_ChurchOfLight_Overseer_VBlood = -26105228,
			CHAR_ChurchOfLight_Paladin = 1728773109,
			CHAR_ChurchOfLight_Paladin_HomePos = -502558061,
			CHAR_ChurchOfLight_Paladin_Servant = 1649578802,
			CHAR_ChurchOfLight_Paladin_VBlood = -740796338,
			CHAR_ChurchOfLight_Priest = 1406393857,
			CHAR_ChurchOfLight_Priest_Servant = -1728284448,
			CHAR_ChurchOfLight_Rifleman = 1148936156,
			CHAR_ChurchOfLight_Rifleman_Servant = -268935837,
			CHAR_ChurchOfLight_SlaveMaster_Enforcer = 891705701,
			CHAR_ChurchOfLight_SlaveMaster_Enforcer_Servant = -2114140065,
			CHAR_ChurchOfLight_SlaveMaster_Sentry = -240536861,
			CHAR_ChurchOfLight_SlaveMaster_Sentry_Servant = -442412464,
			CHAR_ChurchOfLight_SlaveRuffian = -1875351031,
			CHAR_ChurchOfLight_SlaveRuffian_Cover = -1387838833,
			CHAR_ChurchOfLight_SlaveRuffian_Servant = -1416355128,
			CHAR_ChurchOfLight_SmiteOrb = 1917502536,
			CHAR_ChurchOfLight_Sommelier_BarrelMinion = -1917548708,
			CHAR_ChurchOfLight_Sommelier_VBlood = 192051202,
			CHAR_ChurchOfLight_Villager_Female = -1224027101,
			CHAR_ChurchOfLight_Villager_Female_Servant = 1157537604,
			CHAR_ChurchOfLight_Villager_Male = -2025921616,
			CHAR_ChurchOfLight_Villager_Male_Servant = -1786031969,
			CHAR_CopperGolem = 1107541186,
			CHAR_CreatureDeer_Mutated = -575831311,
			CHAR_CreatureMoose_Mutated = 1570140219,
			CHAR_Critter_Rat = -2072914343,
			CHAR_Critter_Silkworm = -1587402408,
			CHAR_Critter_VerminNest_Rat = -372256748,
			CHAR_Cultist_Pyromancer = 2055824593,
			CHAR_Cultist_Slicer = 1807491570,
			CHAR_Cursed_Bear_Spirit = 1105583702,
			CHAR_Cursed_Bear_Standard = -559819989,
			CHAR_Cursed_MonsterToad = 575918722,
			CHAR_Cursed_MonsterToad_Minion = -38041784,
			CHAR_Cursed_Mosquito = -744966291,
			CHAR_Cursed_MountainBeast_SpiritDouble = -935560085,
			CHAR_Cursed_MountainBeast_VBlood = -1936575244,
			CHAR_Cursed_Nightlurker = -2046268156,
			CHAR_Cursed_ToadKing_VBlood = -203043163,
			CHAR_Cursed_ToadSpitter = 1478790879,
			CHAR_Cursed_Witch = -56441915,
			CHAR_Cursed_Witch_Exploding_Mosquito = -1399273168,
			CHAR_Cursed_Witch_VBlood = -910296704,
			CHAR_Cursed_Wolf = -218175217,
			CHAR_Cursed_Wolf_Spirit = 407089231,
			CHAR_Cursed_WormTerror = 658578725,
			CHAR_Farmland_Wolf = -578677530,
			CHAR_Farmlands_Cow = 721166952,
			CHAR_Farmlands_Farmer = -1342764880,
			CHAR_Farmlands_Farmer_Servant = 516718373,
			CHAR_Farmlands_HostileVillager_Base = -2007601567,
			CHAR_Farmlands_HostileVillager_Female_FryingPan = 729746981,
			CHAR_Farmlands_HostileVillager_Female_Pitchfork = 1576267559,
			CHAR_Farmlands_HostileVillager_Male_Club = -164116132,
			CHAR_Farmlands_HostileVillager_Male_Shovel = -864975423,
			CHAR_Farmlands_HostileVillager_Male_Torch = -81727312,
			CHAR_Farmlands_HostileVillager_Male_Unarmed = -1353870145,
			CHAR_Farmlands_HostileVillager_Werewolf = -951976780,
			CHAR_Farmlands_Militia_Summon = -213868361,
			CHAR_Farmlands_Nun_Servant = -1788957652,
			CHAR_Farmlands_Pig = -1356006948,
			CHAR_Farmlands_Ram = 947731555,
			CHAR_Farmlands_Sheep = 1012307512,
			CHAR_Farmlands_SheepOld = 1635167941,
			CHAR_Farmlands_SmallPig = 1420480270,
			CHAR_Farmlands_Villager_Female = 525027204,
			CHAR_Farmlands_Villager_Female_Servant = 1532829342,
			CHAR_Farmlands_Villager_Female_Sister = 1772642154,
			CHAR_Farmlands_Villager_Female_Sister_Servant = -444945115,
			CHAR_Farmlands_Villager_Male = 1887807944,
			CHAR_Farmlands_Villager_Male_Servant = 1426964824,
			CHAR_Farmlands_Woodcutter_Standard = -893091615,
			CHAR_Farmlands_Woodcutter_Standard_Servant = -1659842473,
			CHAR_Forest_AngryMoose = 2097040330,
			CHAR_Forest_Bear_Dire_Vblood = -1391546313,
			CHAR_Forest_Bear_Standard = 1043643344,
			CHAR_Forest_Deer = 1897056612,
			CHAR_Forest_Moose = -831097925,
			CHAR_Forest_Wolf = -1418430647,
			CHAR_Forest_Wolf_VBlood = -1905691330,
			CHAR_Geomancer_Golem_Guardian = -2092246077,
			CHAR_Geomancer_Golem_VBlood = -1317534496,
			CHAR_Geomancer_Human_VBlood = -1065970933,
			CHAR_Gloomrot_AceIncinerator = 1756241788,
			CHAR_Gloomrot_AceIncinerator_Servant = -1897484769,
			CHAR_Gloomrot_Batoon = -1707267769,
			CHAR_Gloomrot_Batoon_Servant = 657708566,
			CHAR_Gloomrot_Iva_VBlood = 172235178,
			CHAR_Gloomrot_Monster_VBlood = 1233988687,
			CHAR_Gloomrot_Purifier_VBlood = 106480588,
			CHAR_Gloomrot_Pyro = -322293503,
			CHAR_Gloomrot_Pyro_Servant = 1304434816,
			CHAR_Gloomrot_Railgunner = 1732477970,
			CHAR_Gloomrot_Railgunner_Servant = -1070366200,
			CHAR_Gloomrot_RailgunSergeant_HomePos = -1499025256,
			CHAR_Gloomrot_RailgunSergeant_Minion = 1626314708,
			CHAR_Gloomrot_RailgunSergeant_VBlood = 2054432370,
			CHAR_Gloomrot_SentryOfficer = 1401026468,
			CHAR_Gloomrot_SentryOfficer_Servant = -1213645419,
			CHAR_Gloomrot_SentryTurret = -1082044089,
			CHAR_Gloomrot_SpiderTank_Driller = 709450349,
			CHAR_Gloomrot_SpiderTank_Gattler = -884401089,
			CHAR_Gloomrot_SpiderTank_LightningRod = 1655577903,
			CHAR_Gloomrot_SpiderTank_Zapper = -2018710724,
			CHAR_Gloomrot_Tazer = 674807351,
			CHAR_Gloomrot_Tazer_Servant = -924080115,
			CHAR_Gloomrot_Technician = 820492683,
			CHAR_Gloomrot_Technician_Labworker = -825299465,
			CHAR_Gloomrot_Technician_Labworker_Servant = -1034892278,
			CHAR_Gloomrot_Technician_Servant = -775762125,
			CHAR_Gloomrot_TheProfessor_VBlood = 814083983,
			CHAR_Gloomrot_TractorBeamer = -293507834,
			CHAR_Gloomrot_TractorBeamer_Servant = 565869317,
			CHAR_Gloomrot_Villager_Female = 1216169364,
			CHAR_Gloomrot_Villager_Female_Servant = -1192403515,
			CHAR_Gloomrot_Villager_Male = -732208863,
			CHAR_Gloomrot_Villager_Male_Servant = -2085282780,
			CHAR_Gloomrot_Voltage_VBlood = -1101874342,
			CHAR_Harpy_Dasher = -1846851895,
			CHAR_Harpy_Dasher_SUMMON = 1635780151,
			CHAR_Harpy_FeatherDuster = -1407234470,
			CHAR_Harpy_Matriarch_VBlood = 685266977,
			CHAR_Harpy_Scratcher = 1462269123,
			CHAR_Harpy_Sorceress = 1224283123,
			CHAR_IceElemental = 302393064,
			CHAR_Illusion_Mosquito = -303396552,
			CHAR_IronGolem = 763796308,
			CHAR_Manticore_HomePos = 980068444,
			CHAR_Manticore_VBlood = -393555055,
			CHAR_Mantrap_Dull = -878541676,
			CHAR_Mantrap_Nest = 2016963774,
			CHAR_Mantrap_Standard = 173817657,
			CHAR_Militia_BellRinger = -1670130821,
			CHAR_Militia_BellRinger_Servant = -1433235567,
			CHAR_Militia_BishopOfDunley_VBlood = -680831417,
			CHAR_Militia_Bomber = 847893333,
			CHAR_Militia_Bomber_Servant = 232701971,
			CHAR_Militia_ConstrainingPole = 85290673,
			CHAR_Militia_Crossbow = 956965183,
			CHAR_Militia_Crossbow_Servant = 1481842114,
			CHAR_Militia_Crossbow_Summon = 2036785949,
			CHAR_Militia_Devoted = 1660801216,
			CHAR_Militia_Devoted_Servant = -823557242,
			CHAR_Militia_EyeOfGod = -1254618756,
			CHAR_Militia_Glassblower_VBlood = 910988233,
			CHAR_Militia_Guard = 1730498275,
			CHAR_Militia_Guard_Servant = -1447279513,
			CHAR_Militia_Guard_Summon = 1050151632,
			CHAR_Militia_Guard_VBlood = -29797003,
			CHAR_Militia_Heavy = 2005508157,
			CHAR_Militia_Heavy_Servant = -1773935659,
			CHAR_Militia_Hound = -249647316,
			CHAR_Militia_Hound_VBlood = -1373413273,
			CHAR_Militia_HoundMaster_VBlood = -784265984,
			CHAR_Militia_InkCrawler = 2090982759,
			CHAR_Militia_Leader_VBlood = 1688478381,
			CHAR_Militia_Light = -63435588,
			CHAR_Militia_Light_Servant = 169329980,
			CHAR_Militia_Light_Summon = 1772451421,
			CHAR_Militia_Longbowman = 203103783,
			CHAR_Militia_Longbowman_LightArrow_Vblood = 850622034,
			CHAR_Militia_Longbowman_Servant = -242295780,
			CHAR_Militia_Longbowman_Summon = 1083647444,
			CHAR_Militia_Miner_Standard = -1072754152,
			CHAR_Militia_Miner_Standard_Servant = -1363137425,
			CHAR_Militia_Nun = -700632469,
			CHAR_Militia_Nun_VBlood = -99012450,
			CHAR_Militia_Scribe_VBlood = 1945956671,
			CHAR_Militia_Torchbearer = 37713289,
			CHAR_Militia_Torchbearer_Servant = 986768339,
			CHAR_Militia_Undead_Infiltrator = -614820237,
			CHAR_Monster_LightningPillar = -1977168943,
			CHAR_Mount_Horse = 1149585723,
			CHAR_Mount_Horse_Gloomrot = 1213710323,
			CHAR_Mount_Horse_Spectral = 2022889449,
			CHAR_Mount_Horse_Vampire = -1502865710,
			CHAR_Mutant_Bear_Standard = 1938756250,
			CHAR_Mutant_FleshGolem = 823276204,
			CHAR_Mutant_RatHorror = -375581934,
			CHAR_Mutant_Spitter = 1092792896,
			CHAR_Mutant_Wolf = 572729167,
			CHAR_NecromancyDagger_SkeletonBerserker_Armored_Farbane = -825517671,
			CHAR_Paladin_DivineAngel = -1737346940,
			CHAR_Paladin_FallenAngel = -76116724,
			CHAR_Pixie = 1434914085,
			CHAR_Poloma_VBlood = -484556888,
			CHAR_RockElemental = 20817667,
			CHAR_Scarecrow = -1750347680,
			CHAR_Spectral_Guardian = 304726480,
			CHAR_Spectral_SpellSlinger = 2065149172,
			CHAR_Spider_Baneling = -764515001,
			CHAR_Spider_Baneling_Summon = -1004061470,
			CHAR_Spider_Broodmother = 342127250,
			CHAR_Spider_Forest = -581295882,
			CHAR_Spider_Forestling = 574276383,
			CHAR_Spider_Melee = 2136899683,
			CHAR_Spider_Melee_Summon = 2119230788,
			CHAR_Spider_Queen_VBlood = -548489519,
			CHAR_Spider_Range = 2103131615,
			CHAR_Spider_Range_Summon = 1974733695,
			CHAR_Spider_Spiderling = 1078424589,
			CHAR_Spider_Spiderling_VerminNest = 1767714956,
			CHAR_Spiderling_Summon = -18289884,
			CHAR_StoneGolem = -779411607,
			CHAR_SUMMON_Wolf = 1825512527,
			CHAR_TargetDummy_Footman = 1479720323,
			CHAR_Trader_Dunley_Gems_T02 = 194933933,
			CHAR_Trader_Dunley_Herbs_T02 = 233171451,
			CHAR_Trader_Dunley_Knowledge_T02 = 281572043,
			CHAR_Trader_Dunley_RareGoods_T02 = -1594911649,
			CHAR_Trader_Farbane_Gems_T01 = -1168705805,
			CHAR_Trader_Farbane_Herbs_T01 = -375258845,
			CHAR_Trader_Farbane_Knowledge_T01 = -208499374,
			CHAR_Trader_Farbane_RareGoods_T01 = -1810631919,
			CHAR_Trader_Legendary_T04 = -1292194494,
			CHAR_Trader_Silverlight_Gems_T03 = -1990875761,
			CHAR_Trader_Silverlight_Herbs_T03 = 1687896942,
			CHAR_Trader_Silverlight_Knowledge_T03 = -915182578,
			CHAR_Trader_Silverlight_RareGoods_T03 = 739223277,
			CHAR_Treant = -1089337069,
			CHAR_Undead_ArmoredSkeletonCrossbow_Dunley = -861407720,
			CHAR_Undead_ArmoredSkeletonCrossbow_Farbane = -195077008,
			CHAR_Undead_Assassin = -1365627158,
			CHAR_Undead_BishopOfDeath_VBlood = 577478542,
			CHAR_Undead_BishopOfShadows_VBlood = 939467639,
			CHAR_Undead_CursedSmith_FloatingWeapon_Base = -1099451233,
			CHAR_Undead_CursedSmith_FloatingWeapon_Mace = -55245645,
			CHAR_Undead_CursedSmith_FloatingWeapon_Slashers = 769910415,
			CHAR_Undead_CursedSmith_FloatingWeapon_Spear = 233127264,
			CHAR_Undead_CursedSmith_FloatingWeapon_Sword = -2020619708,
			CHAR_Undead_CursedSmith_VBlood = 326378955,
			CHAR_Undead_FlyingSkull = -236166535,
			CHAR_Undead_GhostAssassin = 849891426,
			CHAR_Undead_GhostBanshee = -1146194149,
			CHAR_Undead_GhostBanshee_TombSummon = 414648299,
			CHAR_Undead_GhostGuardian = -458883491,
			CHAR_Undead_GhostMilitia_Crossbow = -85729652,
			CHAR_Undead_GhostMilitia_Crossbow_Summon = 348038236,
			CHAR_Undead_GhostMilitia_Light = -1618703048,
			CHAR_Undead_GhostMilitia_Light_Summon = 1684831595,
			CHAR_Undead_Ghoul_Armored_Farmlands = 2105565286,
			CHAR_Undead_Ghoul_TombSummon = 937597711,
			CHAR_Undead_Guardian = -1967480038,
			CHAR_Undead_Infiltrator_AfterShadow = -558928562,
			CHAR_Undead_Infiltrator_VBlood = 613251918,
			CHAR_Undead_Leader_Vblood = -1365931036,
			CHAR_Undead_Necromancer = -572568236,
			CHAR_Undead_Necromancer_TombSummon = 2025660438,
			CHAR_Undead_Priest = -1653554504,
			CHAR_Undead_Priest_VBlood = 153390636,
			CHAR_Undead_RottingGhoul = -1722506709,
			CHAR_Undead_ShadowSoldier = 678628353,
			CHAR_Undead_SkeletonApprentice = -1789347076,
			CHAR_Undead_SkeletonCrossbow_Base = 597386568,
			CHAR_Undead_SkeletonCrossbow_Farbane_OLD = 1250474035,
			CHAR_Undead_SkeletonCrossbow_GolemMinion = 1706319681,
			CHAR_Undead_SkeletonCrossbow_Graveyard = 1395549638,
			CHAR_Undead_SkeletonGolem = -1380216646,
			CHAR_Undead_SkeletonMage = -1287507270,
			CHAR_Undead_SkeletonSoldier_Armored_Dunley = 952695804,
			CHAR_Undead_SkeletonSoldier_Armored_Farbane = -837329073,
			CHAR_Undead_SkeletonSoldier_Base = -603934060,
			CHAR_Undead_SkeletonSoldier_GolemMinion = 343833814,
			CHAR_Undead_SkeletonSoldier_Infiltrator = -1642110920,
			CHAR_Undead_SkeletonSoldier_TombSummon = -259591573,
			CHAR_Undead_SkeletonSoldier_Unholy_Minion = -1779239433,
			CHAR_Undead_SkeletonSoldier_Withered = -1584807109,
			CHAR_Undead_UndyingGhoul = 1640311129,
			CHAR_Undead_ZealousCultist_Ghost = 128488545,
			CHAR_Undead_ZealousCultist_VBlood = -1208888966,
			CHAR_Unholy_Baneling = -1823987835,
			CHAR_Unholy_DeathKnight = 1857865401,
			CHAR_Unholy_FallenAngel = -1928607398,
			CHAR_Unholy_SkeletonApprentice_Summon = 722671522,
			CHAR_Unholy_SkeletonWarrior_Summon = 1604500740,
			CHAR_Vampire_Withered = -1117581429,
			CHAR_Vampire_WitheredBatMinion = -989999571,
			CHAR_VampireMale = 38526109,
			CHAR_Vermin_DireRat_VBlood = -2039908510,
			CHAR_Vermin_GiantRat = -1722278689,
			CHAR_Vermin_WickedRat_Rare = -19165577,
			CHAR_VHunter_Jade_VBlood = -1968372384,
			CHAR_VHunter_Leader_VBlood = -1449631170,
			CHAR_Villager_CursedWanderer_VBlood = 109969450,
			CHAR_Villager_Tailor_VBlood = -1942352521,
			CHAR_Wendigo_VBlood = 24378719,
			CHAR_Werewolf = -1554760905,
			CHAR_WerewolfChieftain_Human = -1505705712,
			CHAR_WerewolfChieftain_ShadowClone = -1699898875,
			CHAR_WerewolfChieftain_VBlood = -1007062401,
			CHAR_Winter_Bear_Standard = 2041915372,
			CHAR_Winter_Moose = -779632831,
			CHAR_Winter_Wolf = 134039094,
			CHAR_Winter_Yeti_VBlood = -1347412392
		}

		public enum Buffs
		{
			Buff_Bandit_Worker_Shared_Wounded = -1169480604,
			Buff_Base = -1761213251,
			Buff_Base_BloodQuality = 1691282284,
			Buff_Base_Channeling_Ticks = -222270535,
			Buff_BatVampire_InCombat = -1818876607,
			Buff_BatVampire_Wounded_Buff = 846762364,
			Buff_BloodAltar_TrackVBloodUnit = -1458480041,
			Buff_BloodBuff_Assault = -646796985,
			Buff_BloodBuff_CriticalStrike = 1536493953,
			Buff_BloodBuff_Empower = 1096233037,
			Buff_BloodBuff_FadingHaste = 2131895379,
			Buff_BloodBuff_FreeCast = 1564305682,
			Buff_BloodFountain_FadingHaste = 219224509,
			Buff_BloodMoon = -560523291,
			Buff_BloodQuality_T01_OLD = 68256796,
			Buff_BloodQuality_T02_OLD = -1678486319,
			Buff_BloodQuality_T03_OLD = -1132025074,
			Buff_BloodQuality_T04_OLD = 1894166679,
			Buff_BloodQuality_T05_OLD = 1388654603,
			Buff_BounceDelay_Base = -479631449,
			Buff_Building_Siege_ActivationTimer_Buff_Base = -1650963283,
			Buff_Building_Siege_ActivationTimer_Buff_T01 = -2007316848,
			Buff_Building_Siege_ActivationTimer_Buff_T02 = -1602570831,
			Buff_Building_Siege_Active_Buff = 40754527,
			Buff_Cardinal_Shield_Stack = 636817215,
			Buff_ChurchOfLight_Cardinal_VBlood_Downed = 334972667,
			Buff_ChurchOfLight_CardinalAide_Block_HasBlocked = 859409812,
			Buff_ChurchOfLight_Cleric_Block_HasBlocked = 1896858104,
			Buff_ChurchOfLight_Cleric_Intervene_Shield = 514720473,
			Buff_ChurchOfLight_Flee_Bellringer = -1202486333,
			Buff_ChurchOfLight_Flee_Villager_Female = 111464415,
			Buff_ChurchOfLight_Flee_Villager_Male = 1904904415,
			Buff_ChurchOfLight_Knight_2H_MovementUsed = -2109458830,
			Buff_ChurchOfLight_Overseer_MinionAggro = -1787328614,
			Buff_ChurchOfLight_Overseer_VBlood_Downed = 1136634549,
			Buff_ChurchOfLight_Paladin_FinalStageBuff = 2144624015,
			Buff_ChurchOfLight_Paladin_ImmaterialHomePos = 293087822,
			Buff_ChurchOfLight_Paladin_OnAggroAnimation = -1299085096,
			Buff_ChurchOfLight_Paladin_Return = -1435372081,
			Buff_ChurchOfLight_Paladin_VBlood_Downed = 351185022,
			Buff_ChurchOfLight_SlaveMaster_HideWhip_Buff = -1104282069,
			Buff_ChurchOfLight_Sommelier_VBlood_Downed = -2037971116,
			Buff_ChurchOfLight_Villager_Cover_Female = 1423858323,
			Buff_ChurchOfLight_Villager_Cover_Male = -167087059,
			Buff_CombatStance = -952067173,
			Buff_ComboBuffA = -960097294,
			Buff_ComboBuffB = 917058375,
			Buff_ComboBuffB2 = 1082027099,
			Buff_ComboBuffC = -1018709766,
			Buff_Cover_Base = -665834590,
			Buff_Cultist_BloodFrenzy_Buff = -106492795,
			Buff_CursedWanderer_VBlood_Flee = 573463911,
			Buff_Delayed_Coffin_Destroy = 2096715241,
			Buff_Devoted_CircleMovement = -581099651,
			Buff_Elemental_Active_Base = -1124158800,
			Buff_Farbane_Trader_HideBackbling = 1871900432,
			Buff_Farbane_Trader_HideWeapons = -724071729,
			Buff_Flee_Base = -713982875,
			Buff_Footman_MovementUsed = 1967011140,
			Buff_General_Amplify = 128529083,
			Buff_General_BloodBuff_RogueAmplify = -752572494,
			Buff_General_BounceDelay = 1097461278,
			Buff_General_Build_Spawn_Buff_Immaterial = 1360141727,
			Buff_General_Build_Spawn_Buff_WeakStructure = 237078863,
			Buff_General_Build_Spawn_Buff_WeakStructure_Wall = 740689171,
			Buff_General_Chill = -1974768686,
			Buff_General_CurseOfTheForest_Area = 821183186,
			Buff_General_Daze = 792451792,
			Buff_General_Disconnected = 1769215014,
			Buff_General_DisconnectedTemporaryImmunity = 915954162,
			Buff_General_Entangled = -1270359452,
			Buff_General_FadingHaste = -1911970959,
			Buff_General_FadingSnare = 1276262777,
			Buff_General_Fear = 695136154,
			Buff_General_FearWithoutDamageCap = 1416250466,
			Buff_General_Freeze = -948292568,
			Buff_General_Freeze_HighDamageTreshold = 399565845,
			Buff_General_Garlic_Area_Base = 434938627,
			Buff_General_Garlic_Area_Inside = -1701323826,
			Buff_General_Garlic_Fever = 1582196539,
			Buff_General_Gloomrot_LightningFadingSnare = -741376672,
			Buff_General_Gloomrot_LightningStun = 469128628,
			Buff_General_Gloomrot_Static = -2067402784,
			Buff_General_Haste = 900030866,
			Buff_General_HideCorpse = 1160901934,
			Buff_General_Holy_Area_T01 = 1593142604,
			Buff_General_Holy_Area_T02 = -621774510,
			Buff_General_Holy_AreaDamage_Prog = -1532362646,
			Buff_General_Ignite = 1533067119,
			Buff_General_Immaterial = 227784838,
			Buff_General_Immobilize = -1548063130,
			Buff_General_InAir_Landing = 129112290,
			Buff_General_Incapacitate = -211448091,
			Buff_General_Incapacitate_ImpactFX = 796254181,
			Buff_General_Incapacitate_ImpactFX_NoDiminishingReturn = 552294046,
			Buff_General_Knockback = -984195038,
			Buff_General_Knockback_Ally = -2099203048,
			Buff_General_Knockback_ExpandFire = -319767548,
			Buff_General_Knockback_WallTrigger = -1483130162,
			Buff_General_Knockback_Wind = -1505593036,
			Buff_General_LockRotation = -814835059,
			Buff_General_NoAnimationKnockback = -1266751732,
			Buff_General_Petrify = 1161081043,
			Buff_General_Phasing = -79611032,
			Buff_General_Poison = 1728652937,
			Buff_General_PvPProtected = 1111481396,
			Buff_General_RelicCarryDebuff = -714279777,
			Buff_General_SelfStun = -704735901,
			Buff_General_SemiTransparent = 1511101848,
			Buff_General_Shapeshift_Base = 32037890,
			Buff_General_Shapeshift_IntoVillager = -1845915827,
			Buff_General_Shapeshift_IntoVillagerChieftain = -1408868059,
			Buff_General_Shapeshift_IntoWerewolf = -1366668190,
			Buff_General_Shapeshift_IntoWerewolfChieftain = 984412445,
			Buff_General_Shield = -1968422421,
			Buff_General_Silence = 385404312,
			Buff_General_Silver_Sickness_Burn_De