files/plugins/modelchanger.dll

Decompiled 2 weeks ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using HarmonyLib;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("modelchanger")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("1010101110")]
[assembly: AssemblyProduct("modelchanger")]
[assembly: AssemblyCopyright("Copyright ©  2021")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("3B95EEF7-4A97-4393-91A0-3626434F3631")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace modelchanger;

[BepInPlugin("1010101110.modelchanger", "modelchanger", "1.0.4")]
public class Mod : BaseUnityPlugin
{
	[HarmonyPatch(typeof(Player), "Start")]
	private static class PlayerStartPatch
	{
		private static void Postfix(Player __instance)
		{
			if ((Object)(object)CustomRuntime == (Object)null)
			{
				CustomRuntime = MakeAOC(replacementMap, ((Character)__instance).m_animator.runtimeAnimatorController);
			}
			if (!Object.op_Implicit((Object)(object)Player.m_localPlayer))
			{
				return;
			}
			string @string = ((Character)__instance).m_nview.m_zdo.GetString("KGmodelchanged", "");
			if (!string.IsNullOrWhiteSpace(@string))
			{
				ApplyModelOnPlayer(__instance, @string);
			}
			if (Humanoids != null)
			{
				return;
			}
			Humanoids = new Dictionary<string, string>();
			foreach (GameObject prefab in ZNetScene.instance.m_prefabs)
			{
				Humanoid component = prefab.GetComponent<Humanoid>();
				if (Object.op_Implicit((Object)(object)component))
				{
					if (((Character)component).m_name != null)
					{
						Humanoids.Add(((Object)prefab.gameObject).name, ((Character)prefab.GetComponent<Humanoid>()).m_name);
					}
					else
					{
						Humanoids.Add(((Object)prefab.gameObject).name, ((Object)prefab.gameObject).name);
					}
				}
				OrderedHumanoids = Humanoids.OrderBy(delegate(KeyValuePair<string, string> name)
				{
					Localization instance = Localization.instance;
					KeyValuePair<string, string> keyValuePair = name;
					return instance.Localize(keyValuePair.Value);
				});
			}
		}
	}

	[HarmonyPatch(typeof(ZNetScene), "Awake")]
	private static class AddingZroutMethods
	{
		private static void Postfix()
		{
			ZRoutedRpc.instance.Register<ZPackage>("KGchangemodel", (Action<long, ZPackage>)PlayerChangedModel);
		}
	}

	[HarmonyPatch(typeof(Terminal), "InitTerminal")]
	public static class addcheats
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static ConsoleEvent <>9__0_0;

			public static ConsoleEvent <>9__0_1;

			internal void <Postfix>b__0_0(ConsoleEventArgs args)
			{
				//IL_004c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0052: Expected O, but got Unknown
				//IL_0058: Unknown result type (might be due to invalid IL or missing references)
				if (args.Length == 2)
				{
					if (Humanoids.ContainsKey(args[1]))
					{
						((Character)Player.m_localPlayer).m_nview.m_zdo.Set("KGmodelchanged", args[1]);
						ZPackage val = new ZPackage();
						val.Write(((Character)Player.m_localPlayer).GetZDOID());
						val.Write(args[1]);
						ZRoutedRpc.instance.InvokeRoutedRPC(ZRoutedRpc.Everybody, "KGchangemodel", new object[1] { val });
						args.Context.AddString("model changed! " + args[1]);
					}
					else
					{
						args.Context.AddString("invalid model");
					}
				}
				else
				{
					args.Context.AddString("you must specify a model, use modellist to get the options");
				}
			}

			internal void <Postfix>b__0_1(ConsoleEventArgs args)
			{
				string text = "Models you can change to(hopefully): ";
				foreach (KeyValuePair<string, string> orderedHumanoid in OrderedHumanoids)
				{
					text = text + orderedHumanoid.Key + ", ";
				}
				args.Context.AddString(text);
			}
		}

		private static void Postfix()
		{
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Expected O, but got Unknown
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Expected O, but got Unknown
			object obj = <>c.<>9__0_0;
			if (obj == null)
			{
				ConsoleEvent val = delegate(ConsoleEventArgs args)
				{
					//IL_004c: Unknown result type (might be due to invalid IL or missing references)
					//IL_0052: Expected O, but got Unknown
					//IL_0058: Unknown result type (might be due to invalid IL or missing references)
					if (args.Length == 2)
					{
						if (Humanoids.ContainsKey(args[1]))
						{
							((Character)Player.m_localPlayer).m_nview.m_zdo.Set("KGmodelchanged", args[1]);
							ZPackage val3 = new ZPackage();
							val3.Write(((Character)Player.m_localPlayer).GetZDOID());
							val3.Write(args[1]);
							ZRoutedRpc.instance.InvokeRoutedRPC(ZRoutedRpc.Everybody, "KGchangemodel", new object[1] { val3 });
							args.Context.AddString("model changed! " + args[1]);
						}
						else
						{
							args.Context.AddString("invalid model");
						}
					}
					else
					{
						args.Context.AddString("you must specify a model, use modellist to get the options");
					}
				};
				<>c.<>9__0_0 = val;
				obj = (object)val;
			}
			new ConsoleCommand("modelchange", "", (ConsoleEvent)obj, true, false, false, true, false, (ConsoleOptionsFetcher)null, false, false, false);
			object obj2 = <>c.<>9__0_1;
			if (obj2 == null)
			{
				ConsoleEvent val2 = delegate(ConsoleEventArgs args)
				{
					string text = "Models you can change to(hopefully): ";
					foreach (KeyValuePair<string, string> orderedHumanoid in OrderedHumanoids)
					{
						text = text + orderedHumanoid.Key + ", ";
					}
					args.Context.AddString(text);
				};
				<>c.<>9__0_1 = val2;
				obj2 = (object)val2;
			}
			new ConsoleCommand("modellist", "", (ConsoleEvent)obj2, true, false, false, true, false, (ConsoleOptionsFetcher)null, false, false, false);
		}
	}

	public static readonly Harmony harmony = new Harmony(typeof(Mod).GetCustomAttributes(typeof(BepInPlugin), inherit: false).Cast<BepInPlugin>().First()
		.GUID);

	private static RuntimeAnimatorController CustomRuntime;

	private static Dictionary<string, string> Humanoids;

	private static IOrderedEnumerable<KeyValuePair<string, string>> OrderedHumanoids;

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

	public static Dictionary<string, AnimationClip> ExternalAnimations = new Dictionary<string, AnimationClip>();

	private void Awake()
	{
		harmony.PatchAll();
	}

	private void OnDestroy()
	{
		harmony.UnpatchSelf();
	}

	private static void ResetPlayerModel(Player p)
	{
		Transform val = ((Component)p).transform.Find("NewVisual");
		if (Object.op_Implicit((Object)(object)(((Object)(object)val != (Object)null) ? ((Component)val).gameObject : null)))
		{
			Object.Destroy((Object)(object)((Component)((Component)p).transform.Find("NewVisual")).gameObject);
		}
		((Character)p).m_visual = ((Component)((Component)p).transform.Find("Visual")).gameObject;
		((Character)p).m_visual.transform.SetSiblingIndex(0);
		((Character)p).m_visual.SetActive(true);
		((Character)p).m_animator = ((Character)p).m_visual.GetComponent<Animator>();
		((Character)p).m_zanim.m_animator = ((Character)p).m_visual.GetComponent<Animator>();
		((Humanoid)p).m_visEquipment.m_visual = ((Character)p).m_visual;
		((Component)p).GetComponent<FootStep>().m_feet = (Transform[])(object)new Transform[2]
		{
			Utils.FindChild(((Character)p).m_visual.transform, "LeftFoot", (IterativeSearchType)0),
			Utils.FindChild(((Character)p).m_visual.transform, "RightFoot", (IterativeSearchType)0)
		};
		((Humanoid)p).m_visEquipment.m_rightHand = Utils.FindChild(((Character)p).m_visual.transform, "RightHand_Attach", (IterativeSearchType)0);
		((Humanoid)p).m_visEquipment.m_leftHand = Utils.FindChild(((Character)p).m_visual.transform, "LeftHand_Attach", (IterativeSearchType)0);
		((Humanoid)p).m_visEquipment.m_helmet = Utils.FindChild(((Character)p).m_visual.transform, "Helmet_attach", (IterativeSearchType)0);
		((Collider)((Character)p).m_collider).enabled = true;
	}

	private static void ApplyModelOnPlayer(Player p, string changedModel)
	{
		//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0101: Unknown result type (might be due to invalid IL or missing references)
		//IL_0105: 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_010f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0131: Unknown result type (might be due to invalid IL or missing references)
		//IL_0143: Unknown result type (might be due to invalid IL or missing references)
		//IL_0155: Unknown result type (might be due to invalid IL or missing references)
		//IL_0165: Unknown result type (might be due to invalid IL or missing references)
		ResetPlayerModel(p);
		GameObject prefab = ZNetScene.instance.GetPrefab(changedModel);
		if (!Object.op_Implicit((Object)(object)prefab) || !Object.op_Implicit((Object)(object)prefab.GetComponent<Humanoid>()))
		{
			return;
		}
		prefab = ((Component)prefab.GetComponentInChildren<Animator>()).gameObject;
		((Character)p).m_visual = Object.Instantiate<GameObject>(prefab, ((Component)p).transform);
		((Character)p).m_visual.transform.SetSiblingIndex(0);
		((Object)((Character)p).m_visual.transform).name = "NewVisual";
		Collider val = CopyComponent<Collider>(ZNetScene.instance.GetPrefab(changedModel).GetComponent<Collider>(), ((Character)p).m_visual);
		((Component)val).gameObject.layer = ((Component)((Character)p).m_collider).gameObject.layer;
		Transform val2 = Utils.FindChild(((Character)p).m_visual.transform, "Armature", (IterativeSearchType)0);
		if (Object.op_Implicit((Object)(object)val2))
		{
			Vector3 localScale = val2.localScale;
			Bounds bounds = ((Character)p).m_visual.GetComponentInChildren<SkinnedMeshRenderer>().sharedMesh.bounds;
			Vector3 val3 = Vector3.Scale(localScale, ((Bounds)(ref bounds)).size);
			if (((Vector3)(ref val3)).magnitude >= 12f)
			{
				val2.localScale = new Vector3(val2.localScale.x / 3.5f, val2.localScale.y / 3.5f, val2.localScale.z / 3.5f);
				CapsuleCollider val4 = (CapsuleCollider)(object)((val is CapsuleCollider) ? val : null);
				if ((Object)(object)val4 != (Object)null)
				{
					val4.radius /= 3.5f;
				}
			}
		}
		((Character)p).m_visual.transform.localPosition = Vector3.zero;
		((Character)p).m_visual.GetComponent<Animator>().runtimeAnimatorController = CustomRuntime;
		((Character)p).m_animator = ((Character)p).m_visual.GetComponent<Animator>();
		((Character)p).m_zanim.m_animator = ((Character)p).m_visual.GetComponent<Animator>();
		((Component)((Component)p).transform.Find("Visual")).gameObject.SetActive(false);
		((Humanoid)p).m_visEquipment.m_visual = ((Character)p).m_visual;
		if ((Object)(object)Utils.FindChild(((Character)p).m_visual.transform, "RightHand_Attach", (IterativeSearchType)0) != (Object)null)
		{
			((Humanoid)p).m_visEquipment.m_rightHand = Utils.FindChild(((Character)p).m_visual.transform, "RightHand_Attach", (IterativeSearchType)0);
			((Humanoid)p).m_visEquipment.m_leftHand = Utils.FindChild(((Character)p).m_visual.transform, "LeftHand_Attach", (IterativeSearchType)0);
			((Humanoid)p).m_visEquipment.m_helmet = Utils.FindChild(((Character)p).m_visual.transform, "Helmet_attach", (IterativeSearchType)0);
		}
		else if ((Object)(object)Utils.FindChild(((Character)p).m_visual.transform, "RightAttach", (IterativeSearchType)0) != (Object)null)
		{
			((Humanoid)p).m_visEquipment.m_rightHand = Utils.FindChild(((Character)p).m_visual.transform, "RightAttach", (IterativeSearchType)0);
			((Humanoid)p).m_visEquipment.m_leftHand = Utils.FindChild(((Character)p).m_visual.transform, "LeftAttach", (IterativeSearchType)0);
			((Humanoid)p).m_visEquipment.m_helmet = Utils.FindChild(((Character)p).m_visual.transform, "HelmetAttach", (IterativeSearchType)0);
		}
		else if ((Object)(object)Utils.FindChild(((Character)p).m_visual.transform, "RightHand", (IterativeSearchType)0) != (Object)null)
		{
			((Humanoid)p).m_visEquipment.m_rightHand = Utils.FindChild(((Character)p).m_visual.transform, "RightHand", (IterativeSearchType)0);
			((Humanoid)p).m_visEquipment.m_leftHand = Utils.FindChild(((Character)p).m_visual.transform, "LeftHand", (IterativeSearchType)0);
			((Humanoid)p).m_visEquipment.m_helmet = Utils.FindChild(((Character)p).m_visual.transform, "Head", (IterativeSearchType)0);
		}
		else if ((Object)(object)Utils.FindChild(((Character)p).m_visual.transform, "l_hand", (IterativeSearchType)0) != (Object)null)
		{
			((Humanoid)p).m_visEquipment.m_rightHand = Utils.FindChild(((Character)p).m_visual.transform, "r_hand", (IterativeSearchType)0);
			((Humanoid)p).m_visEquipment.m_leftHand = Utils.FindChild(((Character)p).m_visual.transform, "l_hand", (IterativeSearchType)0);
			((Humanoid)p).m_visEquipment.m_helmet = Utils.FindChild(((Character)p).m_visual.transform, "head", (IterativeSearchType)0);
		}
		else if ((Object)(object)Utils.FindChild(((Character)p).m_visual.transform, "mixamorig:RightHand", (IterativeSearchType)0) != (Object)null)
		{
			((Humanoid)p).m_visEquipment.m_rightHand = Utils.FindChild(((Character)p).m_visual.transform, "mixamorig:RightHand", (IterativeSearchType)0);
			((Humanoid)p).m_visEquipment.m_leftHand = Utils.FindChild(((Character)p).m_visual.transform, "mixamorig:LeftHand", (IterativeSearchType)0);
			((Humanoid)p).m_visEquipment.m_helmet = Utils.FindChild(((Character)p).m_visual.transform, "mixamorig:HeadTop_End", (IterativeSearchType)0);
		}
		((Collider)((Character)p).m_collider).enabled = false;
		((Component)p).GetComponent<FootStep>().m_feet = (Transform[])(object)new Transform[2]
		{
			Utils.FindChild(((Character)p).m_visual.transform, "LeftFoot", (IterativeSearchType)0),
			Utils.FindChild(((Character)p).m_visual.transform, "RightFoot", (IterativeSearchType)0)
		};
	}

	private static void PlayerChangedModel(long sender, ZPackage pkg)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		ZDOID val = pkg.ReadZDOID();
		string changedModel = pkg.ReadString();
		GameObject val2 = ZNetScene.instance.FindInstance(val);
		if (Object.op_Implicit((Object)(object)val2) && Object.op_Implicit((Object)(object)val2.GetComponent<Player>()))
		{
			Player component = val2.GetComponent<Player>();
			ApplyModelOnPlayer(component, changedModel);
		}
	}

	private static T CopyComponent<T>(T original, GameObject destination) where T : Component
	{
		Type type = ((object)original).GetType();
		Component val = destination.AddComponent(type);
		try
		{
			BindingFlags bindingAttr = BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic;
			PropertyInfo[] properties = type.GetProperties(bindingAttr);
			PropertyInfo[] array = properties;
			foreach (PropertyInfo propertyInfo in array)
			{
				if (propertyInfo.CanWrite)
				{
					propertyInfo.SetValue(val, propertyInfo.GetValue(original, null), null);
				}
			}
			FieldInfo[] fields = type.GetFields(bindingAttr);
			FieldInfo[] array2 = fields;
			foreach (FieldInfo fieldInfo in array2)
			{
				fieldInfo.SetValue(val, fieldInfo.GetValue(original));
			}
		}
		catch
		{
		}
		return (T)(object)((val is T) ? val : null);
	}

	public static RuntimeAnimatorController MakeAOC(Dictionary<string, string> replacement, RuntimeAnimatorController ORIGINAL)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Expected O, but got Unknown
		AnimatorOverrideController val = new AnimatorOverrideController(ORIGINAL);
		List<KeyValuePair<AnimationClip, AnimationClip>> list = new List<KeyValuePair<AnimationClip, AnimationClip>>();
		AnimationClip[] animationClips = ((RuntimeAnimatorController)val).animationClips;
		foreach (AnimationClip val2 in animationClips)
		{
			string name = ((Object)val2).name;
			if (replacement.ContainsKey(name))
			{
				AnimationClip value = Object.Instantiate<AnimationClip>(ExternalAnimations[replacement[name]]);
				list.Add(new KeyValuePair<AnimationClip, AnimationClip>(val2, value));
			}
			else
			{
				list.Add(new KeyValuePair<AnimationClip, AnimationClip>(val2, val2));
			}
		}
		val.ApplyOverrides((IList<KeyValuePair<AnimationClip, AnimationClip>>)list);
		return (RuntimeAnimatorController)(object)val;
	}
}

files/plugins/vrp.dll

Decompiled 2 weeks ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Net;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using BepInEx;
using BepInEx.Bootstrap;
using HarmonyLib;
using Jotunn;
using Jotunn.Configs;
using Jotunn.Entities;
using Jotunn.Managers;
using Jotunn.Utils;
using SimpleJson;
using TMPro;
using UnityEngine;
using UnityEngine.Networking;
using UnityEngine.PostProcessing;
using UnityEngine.UI;
using vrp.Patches;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("vrp")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("1010101110")]
[assembly: AssemblyProduct("vrp")]
[assembly: AssemblyCopyright("Copyright ©  2021")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("3B95EEF7-4A97-4393-91A0-3626434F3631")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace vrp
{
	[Serializable]
	public class DbLog
	{
		public string p { get; set; }

		public string i { get; set; }

		public string a { get; set; }

		public string c { get; set; }

		public string r { get; set; }
	}
	[Serializable]
	public class DbPlayer
	{
		public string player { get; set; }
	}
	[Serializable]
	public class DbWhitelist
	{
		public int pid { get; set; }

		public int cid { get; set; }

		public string steamid { get; set; }

		public string charactername { get; set; }

		public bool isnew { get; set; }

		public bool banned { get; set; }

		public bool permadeath { get; set; }
	}
	[Serializable]
	public class DbWhitelistNew
	{
		public int pid { get; set; }

		public int cid { get; set; }

		public string steamid { get; set; }

		public string charName { get; set; }
	}
	[Serializable]
	public class DbGroup
	{
		public int id { get; set; }

		public string charName { get; set; }

		public string groupName { get; set; }

		public bool deleted { get; set; }
	}
	[Serializable]
	public class DbRecipe
	{
		public int id { get; set; }

		public string recipeName { get; set; }

		public string groups { get; set; }

		public bool enabled { get; set; }

		public bool deleted { get; set; }
	}
	internal class Api
	{
		public static IEnumerator LogInsert(string json)
		{
			UnityWebRequest request = new UnityWebRequest("http://localhost:3333/db/log/insert", "POST");
			try
			{
				byte[] bodyRaw = Encoding.UTF8.GetBytes(json);
				request.uploadHandler = (UploadHandler)new UploadHandlerRaw(bodyRaw);
				request.downloadHandler = (DownloadHandler)new DownloadHandlerBuffer();
				request.SetRequestHeader("Content-Type", "application/json");
				yield return request.SendWebRequest();
				ZLog.Log((object)("api log " + json));
			}
			finally
			{
				((IDisposable)request)?.Dispose();
			}
		}

		public static IEnumerator WhitelistAuth(string steamid, string charName, int pid, int cid)
		{
			string json = SimpleJson.SerializeObject((object)new DbWhitelistNew
			{
				steamid = steamid,
				charName = charName,
				cid = cid,
				pid = pid
			});
			UnityWebRequest request = new UnityWebRequest("http://localhost:3333/db/whitelist/new", "POST");
			try
			{
				byte[] bodyRaw = Encoding.UTF8.GetBytes(json);
				request.uploadHandler = (UploadHandler)new UploadHandlerRaw(bodyRaw);
				request.downloadHandler = (DownloadHandler)new DownloadHandlerBuffer();
				request.SetRequestHeader("Content-Type", "application/json");
				yield return request.SendWebRequest();
				ZLog.Log((object)("api whitelist sent " + charName + " " + steamid));
			}
			finally
			{
				((IDisposable)request)?.Dispose();
			}
		}

		public static IEnumerator WhitelistPermadeath(DbWhitelist deadplayer)
		{
			deadplayer.permadeath = true;
			string json = SimpleJson.SerializeObject((object)deadplayer);
			UnityWebRequest request = new UnityWebRequest("http://localhost:3333/db/whitelist/dead", "POST");
			try
			{
				byte[] bodyRaw = Encoding.UTF8.GetBytes(json);
				request.uploadHandler = (UploadHandler)new UploadHandlerRaw(bodyRaw);
				request.downloadHandler = (DownloadHandler)new DownloadHandlerBuffer();
				request.SetRequestHeader("Content-Type", "application/json");
				yield return request.SendWebRequest();
				ZLog.Log((object)("api permadeath sent " + deadplayer.charactername + " " + deadplayer.steamid));
			}
			finally
			{
				((IDisposable)request)?.Dispose();
			}
		}

		public static IEnumerator ServerGetWhitelist()
		{
			UnityWebRequest request = UnityWebRequest.Get("http://localhost:3333/db/whitelist/");
			yield return request.SendWebRequest();
			if ((int)request.result == 1)
			{
				string raw = Encoding.UTF8.GetString(request.downloadHandler.data);
				DbWhitelist[] obj = SimpleJson.DeserializeObject<DbWhitelist[]>(raw);
				if (obj != null)
				{
					ServerPatches.whitelist.Clear();
					DbWhitelist[] array = obj;
					foreach (DbWhitelist x in array)
					{
						ServerPatches.whitelist.Add(x);
					}
				}
				else
				{
					ZLog.LogError((object)"error whitelist json");
				}
			}
			else
			{
				ZLog.LogError((object)"error in whitelist request");
			}
		}

		public static IEnumerator ServerGetGroups()
		{
			UnityWebRequest request = UnityWebRequest.Get("http://localhost:3333/db/groups/");
			yield return request.SendWebRequest();
			if ((int)request.result == 1)
			{
				string raw = Encoding.UTF8.GetString(request.downloadHandler.data);
				DbGroup[] obj = SimpleJson.DeserializeObject<DbGroup[]>(raw);
				if (obj != null)
				{
					ServerPatches.groups.Clear();
					DbGroup[] array = obj;
					foreach (DbGroup x in array)
					{
						if (!x.deleted)
						{
							ServerPatches.groups.Add(x);
						}
					}
				}
				else
				{
					ZLog.LogError((object)"error groups json");
				}
			}
			else
			{
				ZLog.LogError((object)"error in groups request");
			}
		}

		public static IEnumerator ServerGetRecipes()
		{
			UnityWebRequest request = UnityWebRequest.Get("http://localhost:3333/db/recipes");
			yield return request.SendWebRequest();
			if ((int)request.result == 1)
			{
				string raw = Encoding.UTF8.GetString(request.downloadHandler.data);
				ServerPatches.recipesraw = raw;
			}
			else
			{
				ZLog.LogError((object)"error in recipes request");
			}
		}
	}
	[BepInPlugin("1010101110.vrp", "vrp", "10.3.1")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Mod : BaseUnityPlugin
	{
		public static readonly Harmony harmony = new Harmony(typeof(Mod).GetCustomAttributes(typeof(BepInPlugin), inherit: false).Cast<BepInPlugin>().First()
			.GUID);

		private void Awake()
		{
			harmony.PatchAll();
			JotunnPatches.AddVariants();
		}

		private void OnDestroy()
		{
			harmony.UnpatchSelf();
		}
	}
}
namespace vrp.Patches
{
	public class ClientPatches
	{
		[HarmonyPatch(typeof(GameVersion), "ToString")]
		private class fixver
		{
			private static void Postfix(GameVersion __instance, ref string __result)
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				if (__instance == Version.CurrentVersion)
				{
					__result += "-vrp10.3.1";
				}
			}
		}

		[HarmonyPatch(typeof(ZNet), "RPC_ClientHandshake")]
		public static class checkforbadmods
		{
			private static void Postfix()
			{
				//IL_0587: Unknown result type (might be due to invalid IL or missing references)
				Dictionary<string, bool> dictionary = new Dictionary<string, bool>();
				Dictionary<string, bool> dictionary2 = new Dictionary<string, bool>();
				int num = 0;
				bool flag = false;
				if (ZNet.instance.IsServer())
				{
					return;
				}
				ZLog.LogWarning((object)"VRP CLIENT 10.3.1");
				if ((Object)(object)Game.instance != (Object)null && Game.instance.m_playerProfile != null && isAdmin())
				{
					ZLog.LogError((object)"VRP ADMIN");
					dictionary2.Add("SKTOOLBOX", value: false);
					dictionary2.Add("EASYSPAWNER", value: false);
					dictionary2.Add("TERRAINRESET", value: false);
					dictionary2.Add("MAPTELEPORT", value: false);
					dictionary2.Add("GENERICOBJECTREMOVER", value: false);
					dictionary2.Add("LOCAT", value: false);
					dictionary2.Add("PLANBUILD", value: false);
					dictionary2.Add("UNITYEXPLORER", value: false);
					dictionary2.Add("ASSETTESTER", value: false);
					dictionary2.Add("INFINITY", value: false);
					dictionary2.Add("VNEI", value: false);
					dictionary2.Add("DEVCOMMANDS", value: false);
					dictionary2.Add("XRAY", value: false);
					dictionary2.Add("ESP", value: false);
					dictionary2.Add("WORLD_EDIT_COMMANDS", value: false);
					dictionary2.Add("UPGRADE_WORLD", value: false);
					dictionary2.Add("ZONESCOUTER", value: false);
				}
				dictionary.Add("1010101110.ME", value: false);
				dictionary.Add("1010101110.ROLL", value: false);
				dictionary.Add("1010101110.SHROOMS", value: false);
				dictionary.Add("1010101110.SPARRING", value: false);
				dictionary.Add("1010101110.MODELCHANGER", value: false);
				dictionary.Add("1010101110.GOLDBEES", value: false);
				dictionary.Add("SERVERCHARACTERS", value: false);
				dictionary.Add("CREATURELEVELCONTROL", value: false);
				dictionary.Add("SPAWN_THAT", value: false);
				dictionary.Add("DROP_THAT", value: false);
				dictionary.Add("JOTUNN", value: false);
				dictionary.Add("POSITIONALAUDIO", value: false);
				dictionary.Add("COM.BRUCE.VALHEIM.COMFYQUICKSLOTS", value: false);
				dictionary.Add("PLUMGA.CLUTTER", value: false);
				dictionary.Add("BLACKS7AR.COOKINGADDITIONS", value: false);
				dictionary.Add("SEASONALITY", value: false);
				dictionary.Add("8F0F9F2B-E481-4BEC-B641-01228D7508F9", value: false);
				num += dictionary.Count;
				num++;
				num++;
				foreach (KeyValuePair<string, PluginInfo> pluginInfo in Chainloader.PluginInfos)
				{
					string text = pluginInfo.Key.ToString().ToUpperInvariant();
					foreach (string item in dictionary.Keys.ToList())
					{
						if (Contains(text, item, StringComparison.InvariantCultureIgnoreCase))
						{
							ZLog.Log((object)("VRP CLIENT - found required plugin " + item + " " + text));
							dictionary[item] = true;
						}
					}
				}
				foreach (KeyValuePair<string, bool> item2 in dictionary)
				{
					if (!item2.Value)
					{
						ZLog.LogError((object)("VRP CLIENT - did not find required plugin " + item2.Key));
						flag = true;
					}
				}
				dictionary2.Add("PAGEABLE.BUILD.HUD", value: false);
				dictionary2.Add("COMPASS", value: false);
				dictionary2.Add("GIZMO", value: false);
				dictionary2.Add("MINIMALUI", value: false);
				dictionary2.Add("ORYXEN.VALHEIM.UI.DISPLAYDAYTIME", value: false);
				dictionary2.Add("QUICK_STACK", value: false);
				dictionary2.Add("VALHEIM.DISPLAYINFO", value: false);
				dictionary2.Add("CAMERAMOD.KAILEN_", value: false);
				dictionary2.Add("ONTRIGGER.VPO", value: false);
				dictionary2.Add("BETTERDISCORDPRESENCE", value: false);
				dictionary2.Add("ITEM_STAND_ALL_ITEMS", value: false);
				dictionary2.Add("CUSTOMLOADINGSCREENS", value: false);
				dictionary2.Add("EMOTEWHEEL", value: false);
				dictionary2.Add("TRASH", value: false);
				dictionary2.Add("BRUCE.VALHEIM.COMFY.DUMPSTERFIRE", value: false);
				dictionary2.Add("AZUMATT.FIRSTPERSONMODE", value: false);
				foreach (KeyValuePair<string, PluginInfo> pluginInfo2 in Chainloader.PluginInfos)
				{
					string source = pluginInfo2.Key.ToString().ToUpperInvariant();
					foreach (string item3 in dictionary2.Keys.ToList())
					{
						if (Contains(source, item3, StringComparison.InvariantCultureIgnoreCase))
						{
							ZLog.Log((object)("VRP CLIENT - found optional plugin " + item3));
							dictionary2[item3] = true;
							num++;
						}
					}
				}
				if (Chainloader.PluginInfos.Count > num)
				{
					ZLog.LogError((object)("VRP CLIENT - #plugins req" + num + " found" + Chainloader.PluginInfos.Count));
					flag = true;
				}
				if (!flag)
				{
					return;
				}
				ZLog.LogError((object)"VRP ERROR");
				foreach (KeyValuePair<string, PluginInfo> pluginInfo3 in Chainloader.PluginInfos)
				{
					ZLog.Log((object)pluginInfo3.Key.ToString().ToUpper());
				}
				ZNet.m_connectionStatus = (ConnectionStatus)12;
			}
		}

		[HarmonyPatch(typeof(EnemyHud), "TestShow")]
		public static class hudfix
		{
			private static bool Prefix(ref Character c, ref EnemyHud __instance, ref bool __result)
			{
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0012: Unknown result type (might be due to invalid IL or missing references)
				//IL_0017: Unknown result type (might be due to invalid IL or missing references)
				__result = false;
				float num = Vector3.SqrMagnitude(((Component)c).transform.position - __instance.m_refPoint);
				if (c.IsBoss() && num < __instance.m_maxShowDistanceBoss * __instance.m_maxShowDistanceBoss)
				{
					__result = ((Component)c).GetComponent<BaseAI>().IsAlerted();
				}
				else if (c.IsPlayer() && !isAdmin())
				{
					float num2 = 2f;
					__result = !c.IsCrouching() && num < num2 * num2;
					__result = false;
				}
				else if (num < 100f)
				{
					__result = true;
				}
				return false;
			}
		}

		[HarmonyPatch(typeof(WearNTear), "RPC_Damage")]
		public static class DamageWard
		{
			private static bool Prefix(long sender, HitData hit, WearNTear __instance)
			{
				//IL_0047: Unknown result type (might be due to invalid IL or missing references)
				//IL_004d: Expected O, but got Unknown
				//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
				bool result = true;
				if (hit != null && (Object)(object)hit.GetAttacker() != (Object)null && hit.GetAttacker().IsPlayer() && (Object)(object)((Component)__instance).gameObject != (Object)null)
				{
					Player val = (Player)hit.GetAttacker();
					if (((Object)((Component)__instance).gameObject).name.Contains("chest") || ((Object)((Component)__instance).gameObject).name.Contains("guard_stone") || ((Object)((Component)__instance).gameObject).name.Contains("vrp_ward"))
					{
						foreach (PrivateArea allArea in PrivateArea.m_allAreas)
						{
							if (allArea.IsEnabled() && allArea.IsInside(hit.m_point, 1f))
							{
								string raw = ((Object)((Component)__instance).gameObject).name + " damaged | " + allArea.m_piece.m_creator + " creator | " + val.GetPlayerID() + " damage by";
								SendModerationLog(((Character)val).GetHoverName(), ((Object)((Component)__instance).gameObject).name, "damaged", allArea.m_piece.m_creator.ToString(), raw);
								if (isAdmin())
								{
									result = true;
								}
								else if (allArea.m_piece.m_creator != val.GetPlayerID() && !allArea.IsPermitted(val.GetPlayerID()))
								{
									allArea.FlashShield(false);
									result = false;
								}
							}
						}
					}
				}
				return result;
			}
		}

		[HarmonyPatch(typeof(PrivateArea), "Awake")]
		private class wardrange
		{
			private static float range = 25f;

			private static float rangeadmin = 100f;

			private static bool Prefix(ref PrivateArea __instance)
			{
				if (Object.op_Implicit((Object)(object)__instance))
				{
					Piece component = ((Component)__instance).gameObject.GetComponent<Piece>();
					if ((Object)(object)component != (Object)null && component.m_name == "WardAdmin")
					{
						__instance.m_radius = rangeadmin;
					}
					else
					{
						__instance.m_radius = range;
					}
				}
				return true;
			}

			private static void Postfix(ref PrivateArea __instance)
			{
				//IL_0092: Unknown result type (might be due to invalid IL or missing references)
				//IL_0097: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
				if (!Object.op_Implicit((Object)(object)__instance))
				{
					return;
				}
				if ((Object)(object)__instance.m_areaMarker != (Object)null)
				{
					__instance.m_areaMarker.m_radius = __instance.m_radius;
				}
				if (__instance.m_flashEffect != null && __instance.m_flashEffect.m_effectPrefabs != null && __instance.m_flashEffect.m_effectPrefabs.Length != 0)
				{
					ParticleSystem componentInChildren = ((Component)__instance.m_flashEffect.m_effectPrefabs[0].m_prefab.transform).GetComponentInChildren<ParticleSystem>();
					if ((Object)(object)componentInChildren != (Object)null)
					{
						MainModule main = componentInChildren.main;
						((MainModule)(ref main)).startSize = MinMaxCurve.op_Implicit(__instance.m_radius * 2f);
					}
				}
			}
		}

		[HarmonyPatch(typeof(PrivateArea), "GetHoverText")]
		private class wardText
		{
			private static void Postfix(ref string __result, ref PrivateArea __instance)
			{
				long @long = __instance.m_nview.GetZDO().GetLong("decaytimer", 123L);
				if (@long != 123)
				{
					DateTime dateTime = new DateTime(@long).AddDays(10.0).ToLocalTime();
					__result = __result + "\n[<color=purple><b>" + dateTime.ToShortDateString() + " " + dateTime.ToShortTimeString() + "</b></color>] until decay" + Environment.NewLine;
				}
				__result += "use floam on this ward to recharge it";
			}
		}

		[HarmonyPatch(typeof(PrivateArea), "UseItem")]
		private class wardupdate
		{
			private static void Postfix(Humanoid user, ItemData item, ref PrivateArea __instance, ref bool __result)
			{
				if (!(item.m_shared.m_name == "Floam"))
				{
					return;
				}
				if (__instance.m_nview.IsValid())
				{
					Inventory inventory = user.GetInventory();
					int num = inventory.CountItems(item.m_shared.m_name, -1, true);
					if (num >= 10)
					{
						((Character)user).Message((MessageType)2, "the ward is recharged", 0, (Sprite)null);
						inventory.RemoveItem(item, 10);
						__instance.m_nview.GetZDO().Set("decaytimer", DateTime.Now.Ticks);
					}
				}
				__result = true;
			}
		}

		[HarmonyPatch(typeof(PrivateArea), "Interact")]
		public static class wardinteract
		{
			private static bool Prefix(ref Humanoid human, ref bool hold, PrivateArea __instance)
			{
				if ((isAdmin() || __instance.IsPermitted(Player.m_localPlayer.GetPlayerID())) && !hold)
				{
					__instance.m_nview.InvokeRPC("ToggleEnabled", new object[1] { __instance.m_piece.m_creator });
					return false;
				}
				return true;
			}
		}

		[HarmonyPatch(typeof(PrivateArea), "CheckAccess")]
		public static class wardaccess
		{
			private static void Postfix(Vector3 point, float radius, bool flash, ref bool __result)
			{
				if (isAdmin())
				{
					__result = true;
				}
			}
		}

		[HarmonyPatch(typeof(PrivateArea), "UpdateStatus")]
		public static class wardstatus
		{
			private static void Postfix(ref PrivateArea __instance)
			{
				if (__instance.m_nview.IsValid() && __instance.m_nview.IsOwner())
				{
					long num = __instance.m_nview.GetZDO().GetLong("decaytimer", 123L);
					if (num == 123)
					{
						SendModerationLog("", "", "new ward", __instance.GetCreatorName(), "");
						num = DateTime.Now.Ticks;
						__instance.m_nview.GetZDO().Set("decaytimer", num);
					}
					DateTime dateTime = new DateTime(num);
					if (DateTime.Now > dateTime.AddDays(10.0) && __instance.IsEnabled())
					{
						SendModerationLog("", "", "ward timer deactivate!", __instance.GetCreatorName(), dateTime.ToLongDateString() + " " + DateTime.Now.ToLongTimeString());
						__instance.SetEnabled(false);
					}
				}
			}
		}

		[HarmonyPatch(typeof(Container), "CheckAccess")]
		public static class ContainerAccessPatch
		{
			private static void Postfix(long playerID, ref bool __result)
			{
				Player player = Player.GetPlayer(playerID);
				if (isAdmin(player.GetPlayerName()))
				{
					__result = true;
				}
			}
		}

		[HarmonyPatch(typeof(ItemStand), "Interact")]
		private class standFix
		{
			private static bool Prefix(Humanoid user, bool hold, ItemStand __instance)
			{
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				return PrivateArea.CheckAccess(((Component)__instance).transform.position, 0f, true, false);
			}
		}

		[HarmonyPatch(typeof(Player), "FixedUpdate")]
		public static class PlayerCheck
		{
			private static void Postfix(ref Player __instance)
			{
				//IL_025c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0261: Unknown result type (might be due to invalid IL or missing references)
				//IL_0281: Unknown result type (might be due to invalid IL or missing references)
				//IL_0286: Unknown result type (might be due to invalid IL or missing references)
				//IL_02a6: Unknown result type (might be due to invalid IL or missing references)
				//IL_02ab: Unknown result type (might be due to invalid IL or missing references)
				//IL_030f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0315: Invalid comparison between Unknown and I4
				if (!((Object)(object)Player.m_localPlayer != (Object)null) || __instance.GetPlayerID() != Player.m_localPlayer.GetPlayerID())
				{
					return;
				}
				if (!cheatInfstam && (__instance.m_runStaminaDrain == 0f || __instance.m_maxStamina > 800f))
				{
					cheatInfstam = true;
					SendModerationLog(__instance.GetPlayerName(), "infstam", "cheat", "", "");
				}
				if (!cheatGhost && __instance.m_ghostMode)
				{
					cheatGhost = true;
					SendModerationLog(__instance.GetPlayerName(), "ghost", "cheat", "", "");
				}
				if (!cheatNocost && __instance.m_noPlacementCost)
				{
					cheatNocost = true;
					SendModerationLog(__instance.GetPlayerName(), "nocost", "cheat", "", "");
				}
				if (!cheatGod && __instance.m_godMode)
				{
					cheatGod = true;
					SendModerationLog(__instance.GetPlayerName(), "god", "cheat", "", "");
				}
				if (!cheatFly && __instance.m_debugFly)
				{
					cheatFly = true;
					SendModerationLog(__instance.GetPlayerName(), "fly", "cheat", "", "");
				}
				cheattimer += Time.deltaTime;
				if (!(cheattimer > 20f))
				{
					return;
				}
				cheattimer = 0f;
				checkforcheats();
				if ((Object)(object)ZNetScene.instance != (Object)null && (Object)(object)MessageHud.instance != (Object)null && ZNetScene.instance.NrOfInstances() > 11000)
				{
					MessageHud.instance.ShowMessage((MessageType)2, "VRP WARNING: INSTANCE COUNT OVER 11k!", 0, (Sprite)null);
				}
				if (isAdmin())
				{
					return;
				}
				if ((Object)(object)ZNetScene.instance != (Object)null && ZNetScene.instance.NrOfInstances() > 15000)
				{
					string text = ((Component)__instance).transform.position.x + "," + ((Component)__instance).transform.position.z + "," + ((Component)__instance).transform.position.y;
					SendModerationLog(__instance.GetPlayerName(), "", "instance count kicked", "", "loc: " + text);
					ZLog.LogError((object)"VRP ERROR: INSTANCE COUNT TOO HIGH");
					Game.instance.Logout(true, true);
				}
				if ((Object)(object)ZNetScene.instance != (Object)null && (int)ZNet.m_connectionStatus == 2)
				{
					float num = default(float);
					float num2 = default(float);
					int num3 = default(int);
					float num4 = default(float);
					float num5 = default(float);
					ZNet.instance.GetNetStats(ref num, ref num2, ref num3, ref num4, ref num5);
					if (num3 > 600)
					{
						SendModerationLog(__instance.GetPlayerName(), "", "ping kicked", "", "");
						ZLog.LogError((object)"VRP ERROR: PING OUT OF BOUNDS");
						ZLog.LogError((object)num3.ToString());
						Game.instance.Logout(true, true);
					}
					if (!ZNet.instance.IsServer() && (num < 0.5f || num2 < 0.5f))
					{
						SendModerationLog(__instance.GetPlayerName(), "", "quality kicked", "", "");
						ZLog.LogError((object)"VRP ERROR: QUALITY OUT OF BOUNDS");
						ZLog.LogError((object)(num + " " + num2));
						Game.instance.Logout(true, true);
					}
				}
			}
		}

		[HarmonyPatch(typeof(ConsoleCommand), "RunAction")]
		public static class cheatlogg
		{
			private static void Postfix(ConsoleEventArgs args, ConsoleCommand __instance)
			{
				try
				{
					if (__instance.Command != "say" && __instance.Command != "s")
					{
						SendModerationLog(Player.m_localPlayer.GetPlayerName(), __instance.Command, "CHEAT COMMAND", "", "");
					}
				}
				catch (Exception)
				{
				}
			}
		}

		[HarmonyPatch(typeof(EnvMan), "CanSleep")]
		public static class cansleepyes
		{
			private static void Postfix(EnvMan __instance, bool __result)
			{
				__result = true;
			}
		}

		[HarmonyPatch(typeof(Humanoid), "EquipItem")]
		public static class PlayerEquip
		{
			private static void Postfix(ItemData item, bool triggerEquipEffects, ref Humanoid __instance)
			{
				playerEqp(ref item, ref __instance);
			}
		}

		[HarmonyPatch(typeof(Humanoid), "UnequipItem")]
		public static class PlayerUnEquip
		{
			private static void Postfix(ItemData item, bool triggerEquipEffects, ref Humanoid __instance)
			{
				playerEqp(ref item, ref __instance);
			}
		}

		[HarmonyPatch(typeof(Player), "ConsumeItem")]
		public static class ConsumeLog
		{
			private static void Postfix(Inventory inventory, ItemData item, ref bool __result, ref Player __instance)
			{
				if (!__result || !((Object)(object)__instance != (Object)null) || item == null || item.m_shared == null || !((Character)__instance).m_nview.IsValid())
				{
					return;
				}
				if (((Character)__instance).IsOwner())
				{
					if (item.m_shared.m_name == "Bandage")
					{
						StatusEffect statusEffect = ((Character)__instance).m_seman.GetStatusEffect(StringExtensionMethods.GetStableHashCode("Wounded"));
						if ((Object)(object)statusEffect != (Object)null)
						{
							float num = statusEffect.GetRemaningTime() * 0.5f;
							statusEffect.m_time += num;
							Player obj = __instance;
							obj.m_timeSinceDeath += num;
						}
					}
					if (item.m_shared.m_name == "BandageShiny")
					{
						StatusEffect statusEffect2 = ((Character)__instance).m_seman.GetStatusEffect(StringExtensionMethods.GetStableHashCode("Wounded"));
						if ((Object)(object)statusEffect2 != (Object)null)
						{
							float num2 = statusEffect2.GetRemaningTime() * 0.75f;
							statusEffect2.m_time += num2;
							Player obj2 = __instance;
							obj2.m_timeSinceDeath += num2;
						}
					}
				}
				string creator = ((item.m_crafterID == 0L) ? " | uncrafted | " : (" | crafted by | " + item.m_crafterName + " "));
				SendModerationLog(__instance.GetPlayerName(), item.m_shared.m_name, "consume", creator, "");
			}
		}

		[HarmonyPatch(typeof(Sign), "SetText")]
		public static class SignText
		{
			private static void Postfix(string text, Sign __instance)
			{
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				//IL_000c: Unknown result type (might be due to invalid IL or missing references)
				//IL_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_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)
				string text2 = ((Component)__instance).transform.position.x + " ";
				text2 = text2 + ((Component)__instance).transform.position.z + " ";
				text2 += ((Component)__instance).transform.position.y;
				SendModerationLog(Player.m_localPlayer.GetPlayerName(), text, "sign_text", "", text2);
			}
		}

		[HarmonyPatch(typeof(TeleportWorld), "SetText")]
		public static class TeleportText
		{
			private static void Postfix(string text, TeleportWorld __instance)
			{
				SendModerationLog(Player.m_localPlayer.GetPlayerName(), text, "teleport_text", "", "");
			}
		}

		[HarmonyPatch(typeof(Chat), "InputText")]
		public static class ChatText
		{
			private static void Postfix(ref Chat __instance)
			{
				if (!((Object)(object)Chat.instance != (Object)null) || !((Object)(object)((Terminal)Chat.instance).m_input != (Object)null) || string.IsNullOrWhiteSpace(((TMP_InputField)((Terminal)Chat.instance).m_input).text))
				{
					return;
				}
				SendModerationLog(Player.m_localPlayer.GetPlayerName(), ((TMP_InputField)((Terminal)Chat.instance).m_input).text, "chat_text", "", "");
				try
				{
					if (((TMP_InputField)((Terminal)__instance).m_input).text.StartsWith("/bc "))
					{
						string message = ((TMP_InputField)((Terminal)__instance).m_input).text.Substring(4);
						SendBroadcast(message);
					}
					if (((TMP_InputField)((Terminal)__instance).m_input).text == "/resetglobalkeys")
					{
						SendResetKeys();
					}
					if (((TMP_InputField)((Terminal)__instance).m_input).text.StartsWith("/sleepers") && Object.op_Implicit((Object)(object)Player.m_localPlayer))
					{
						int hash = ZSyncAnimation.GetHash("attach_bed");
						bool @bool = ((Character)Player.m_localPlayer).m_zanim.m_animator.GetBool(hash);
						((Character)Player.m_localPlayer).m_zanim.SetBool("attach_bed", !@bool);
					}
					if (!(((TMP_InputField)((Terminal)__instance).m_input).text == "/raft"))
					{
					}
				}
				catch (Exception)
				{
					ZLog.LogError((object)"failed text processing");
				}
			}
		}

		[HarmonyPatch(typeof(Player), "SetIntro")]
		public static class SpawnLog
		{
			private static void Postfix(bool intro, Player __instance)
			{
				if (!ZNet.instance.IsServer() && (Object)(object)__instance != (Object)null && ((Character)__instance).m_nview.IsValid() && ZRoutedRpc.instance != null)
				{
					ZLog.LogWarning((object)("FRESH " + __instance.GetPlayerName()));
					SendModerationLog(__instance.GetPlayerName(), "", "Fresh", "", "");
				}
			}
		}

		[HarmonyPatch(typeof(ZSteamMatchmaking))]
		[HarmonyPatch("GetServers")]
		private class PatchUpdateServerListGui
		{
			private static void Postfix(ref List<ServerStatus> allServers)
			{
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				//IL_000c: Expected O, but got Unknown
				//IL_0018: Unknown result type (might be due to invalid IL or missing references)
				//IL_001e: Expected O, but got Unknown
				ServerJoinDataDedicated val = new ServerJoinDataDedicated("159.223.189.211");
				((ServerJoinData)val).m_serverName = "VRP Season 10";
				ServerStatus val2 = new ServerStatus((ServerJoinData)(object)val);
				val2.m_playerCount = 69u;
				allServers.Add(val2);
				checkforcheats();
			}
		}

		[HarmonyPatch(typeof(Chat), "Awake")]
		private class textinputfix
		{
			private static void Postfix(ref Chat __instance)
			{
				__instance.m_worldTextTTL = 20f;
				((TMP_InputField)((Terminal)__instance).m_input).characterLimit = 300;
				__instance.m_hideDelay = 10f;
				Graphic[] componentsInChildren = ((Component)((Terminal)__instance).m_chatWindow).GetComponentsInChildren<Graphic>();
				Graphic[] array = componentsInChildren;
				foreach (Graphic val in array)
				{
					val.raycastTarget = false;
				}
			}
		}

		[HarmonyPatch(typeof(Talker), "Awake")]
		private class talkerrange
		{
			private static void Postfix(ref Talker __instance)
			{
				__instance.m_normalDistance = 25f;
				__instance.m_shoutDistance = 150f;
			}
		}

		[HarmonyPatch(typeof(Chat), "SendText")]
		private class notglobalshouts
		{
			private static bool Prefix(ref Type type, ref string text)
			{
				if (Object.op_Implicit((Object)(object)Player.m_localPlayer))
				{
					((Component)Player.m_localPlayer).GetComponent<Talker>().Say(type, text);
				}
				return false;
			}
		}

		[HarmonyPatch(typeof(Chat), "GetShoutWorldTexts")]
		private class nominimapshouts
		{
			private static void Postfix(ref List<WorldTextInstance> texts)
			{
				texts.Clear();
			}
		}

		[HarmonyPatch(typeof(Chat), "OnNewChatMessage")]
		private static class silentallchat
		{
			private static bool Prefix(ref GameObject go, ref long senderID, ref Vector3 pos, ref Type type, ref UserInfo user, ref string text, ref Chat __instance)
			{
				//IL_0031: Unknown result type (might be due to invalid IL or missing references)
				if ((int)type == 3)
				{
					text = text.Replace('<', ' ');
					text = text.Replace('>', ' ');
					__instance.AddInworldText(go, senderID, pos, type, user, text);
					return false;
				}
				return true;
			}
		}

		[HarmonyPatch(typeof(Player), "FixedUpdate")]
		private class playerposty
		{
			private static void Postfix(ref Player __instance)
			{
				//IL_0147: Unknown result type (might be due to invalid IL or missing references)
				//IL_014c: Unknown result type (might be due to invalid IL or missing references)
				if (!((Character)__instance).m_nview.IsValid() || !((Character)__instance).m_nview.IsOwner() || __instance.GetPlayerID() != Player.m_localPlayer.GetPlayerID())
				{
					return;
				}
				if ((Object)(object)InventoryGui.instance != (Object)null)
				{
					InventoryGui.instance.m_pvp.isOn = true;
				}
				if (!((Character)__instance).IsPVPEnabled())
				{
					__instance.SetPVP(true);
				}
				StatusEffect statusEffect = ((Character)__instance).m_seman.GetStatusEffect(StringExtensionMethods.GetStableHashCode("Poozy"));
				if ((Object)(object)statusEffect != (Object)null)
				{
					((Character)__instance).m_swimDepth = 20f;
				}
				else
				{
					((Character)__instance).m_swimDepth = 1.5f;
				}
				StatusEffect statusEffect2 = ((Character)__instance).m_seman.GetStatusEffect(StringExtensionMethods.GetStableHashCode("Wounded"));
				PostProcessingBehaviour component = ((Component)GameCamera.instance).gameObject.GetComponent<PostProcessingBehaviour>();
				if (!((Object)(object)component != (Object)null))
				{
					return;
				}
				if ((Object)(object)statusEffect2 != (Object)null)
				{
					((PostProcessingModel)((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model).enabled = true;
					((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model.m_Settings.color = new Color(0f, 0f, 0f, 0.8f);
					((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model.m_Settings.intensity = 0.6f;
				}
				else if (((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model.m_Settings.intensity > 0.05f)
				{
					((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model.m_Settings.intensity = Mathf.Max(0.05f, ((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model.m_Settings.intensity - 0.001f);
				}
				else
				{
					((PostProcessingModel)((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model).enabled = false;
				}
				if (!Object.op_Implicit((Object)(object)statusEffect2) && ((PostProcessingComponent<ColorGradingModel>)(object)component.m_ColorGrading).model.m_Settings.basic.saturation != 1f)
				{
					if (((PostProcessingComponent<ColorGradingModel>)(object)component.m_ColorGrading).model.m_Settings.basic.saturation < 1f)
					{
						((PostProcessingComponent<ColorGradingModel>)(object)component.m_ColorGrading).model.m_Settings.basic.saturation = Mathf.Min(1f, ((PostProcessingComponent<ColorGradingModel>)(object)component.m_ColorGrading).model.m_Settings.basic.saturation + 0.01f);
					}
					else
					{
						((PostProcessingComponent<ColorGradingModel>)(object)component.m_ColorGrading).model.m_Settings.basic.saturation = Mathf.Max(1f, ((PostProcessingComponent<ColorGradingModel>)(object)component.m_ColorGrading).model.m_Settings.basic.saturation - 0.01f);
					}
					((PostProcessingComponent<ColorGradingModel>)(object)component.m_ColorGrading).model.isDirty = true;
				}
			}
		}

		[HarmonyPatch(typeof(Fireplace), "Awake")]
		private class fixfireplace
		{
			private static void Postfix(ref Fireplace __instance)
			{
				Fireplace obj = __instance;
				obj.m_secPerFuel *= 5f;
			}
		}

		[HarmonyPatch(typeof(Fireplace), "UpdateFireplace")]
		private class updatefireplace
		{
			private static void Postfix(ref Fireplace __instance)
			{
				if (__instance.m_nview.IsValid() && __instance.m_nview.IsOwner() && __instance.m_nview.GetZDO().GetFloat("fuel", 0f) == 0f && !__instance.IsBurning() && (((Object)__instance).name == "fire_pit(Clone)" || ((Object)__instance).name == "rk_campfire(Clone)"))
				{
					WearNTear component = ((Component)__instance).gameObject.GetComponent<WearNTear>();
					if ((Object)(object)component != (Object)null)
					{
						component.Remove();
					}
				}
			}
		}

		[HarmonyPatch(typeof(Ship), "Awake")]
		public static class shipfix
		{
			private static void Postfix(ref Ship __instance)
			{
				__instance.m_minWaterImpactForce = 100f;
			}
		}

		[HarmonyPatch(typeof(WearNTear), "OnPlaced")]
		private class shipCreated
		{
			private static void Postfix(ref WearNTear __instance)
			{
				if (Object.op_Implicit((Object)(object)__instance))
				{
					Ship component = ((Component)__instance).gameObject.GetComponent<Ship>();
					if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.m_nview) && component.m_nview.IsValid())
					{
						component.m_nview.GetZDO().Set("creatorName", Game.instance.GetPlayerProfile().GetName());
						SendModerationLog("", ((Object)((Component)component).gameObject).name, "ship created", Game.instance.GetPlayerProfile().GetName(), "");
					}
				}
			}
		}

		[HarmonyPatch(typeof(Ship), "OnDestroyed")]
		private class shipDestroyed
		{
			private static void Postfix(ref Ship __instance)
			{
				//IL_003e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0056: Unknown result type (might be due to invalid IL or missing references)
				//IL_005b: Unknown result type (might be due to invalid IL or missing references)
				//IL_007c: 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_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)
				if (__instance.IsOwner() && Object.op_Implicit((Object)(object)__instance.m_nview) && __instance.m_nview.IsValid())
				{
					List<Player> list = new List<Player>();
					Player.GetPlayersInRange(((Component)__instance).transform.position, 30f, list);
					string text = ((Component)__instance).transform.position.x + " ";
					text = text + ((Component)__instance).transform.position.z + " ";
					text += ((Component)__instance).transform.position.y;
					SendModerationLog(string.Join(",", list.Select((Player p) => p.GetPlayerName())), ((Object)((Component)__instance).gameObject).name, "ship destroyed", __instance.m_nview.GetZDO().GetString("creatorName", ""), text);
				}
			}
		}

		[HarmonyPatch(typeof(Player), "StartDoodadControl")]
		private class shipControlled
		{
			private static void Postfix(ref ShipControlls shipControl)
			{
				Component controlledComponent = shipControl.GetControlledComponent();
				Ship val = (Ship)(object)((controlledComponent is Ship) ? controlledComponent : null);
				if ((Object)(object)val != (Object)null)
				{
					SendModerationLog(Game.instance.GetPlayerProfile().GetName(), ((Object)shipControl.GetControlledComponent().gameObject).name, "ship controlled", val.m_nview.GetZDO().GetString("creatorName", ""), "");
				}
			}
		}

		[HarmonyPatch(typeof(ShipControlls), "GetHoverText")]
		private class shipName
		{
			private static void Postfix(ref ShipControlls __instance, ref string __result)
			{
				Component controlledComponent = __instance.GetControlledComponent();
				Ship val = (Ship)(object)((controlledComponent is Ship) ? controlledComponent : null);
				if ((Object)(object)val != (Object)null)
				{
					__result = __result + Environment.NewLine + ((Object)((Component)val).gameObject).name + " " + val.m_nview.GetZDO().GetString("creatorName", "");
				}
			}
		}

		[HarmonyPatch(typeof(Ship), "UpdateUpsideDmg")]
		private class raftdmg
		{
			private static void Postfix(float dt, Ship __instance)
			{
				//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_0080: 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_0087: Invalid comparison between Unknown and I4
				//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ab: Expected O, but got Unknown
				//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
				raftdmgcounter += dt;
				if (!(raftdmgcounter > 2f))
				{
					return;
				}
				raftdmgcounter = 0f;
				if (!__instance.IsOwner() || !Object.op_Implicit((Object)(object)__instance.m_nview) || !__instance.m_nview.IsValid() || !(((Object)((Component)__instance).gameObject).name == "Raft(Clone)"))
				{
					return;
				}
				Biome val = Heightmap.FindBiome(((Component)__instance).transform.position);
				if ((int)val == 256)
				{
					IDestructible component = ((Component)__instance).GetComponent<IDestructible>();
					if (component != null)
					{
						HitData val2 = new HitData();
						val2.m_damage.m_blunt = 1f;
						val2.m_point = ((Component)__instance).transform.position;
						val2.m_dir = Vector3.up;
						component.Damage(val2);
					}
				}
			}
		}

		[HarmonyPatch(typeof(Game), "SpawnPlayer")]
		private class respawnclass
		{
			private static void Postfix()
			{
				try
				{
					ZRoutedRpc.instance.Register<string, string>("ClientSetClass", (Action<long, string, string>)RPC_SetClass);
					ZRoutedRpc.instance.Register<bool>("ClientSetWard", (Action<long, bool>)RPC_SetWard);
				}
				catch (Exception)
				{
				}
				ZRoutedRpc.instance.InvokeRoutedRPC("ServerGetClass", new object[1] { Player.m_localPlayer.GetPlayerName() });
				ZRoutedRpc.instance.InvokeRoutedRPC("ServerGetWard", new object[1] { Player.m_localPlayer.GetPlayerName() });
			}
		}

		[HarmonyPatch(typeof(Skill), "Raise")]
		private class skillcap
		{
			private static void Postfix(ref Skill __instance, ref bool __result)
			{
				float num = 25f;
				float num2 = 45f;
				switch (((object)(SkillType)(ref __instance.m_info.m_skill)).ToString().ToLower())
				{
				case "swords":
				case "knives":
				case "axes":
					if (groups.Contains("Slash"))
					{
						num += num2;
					}
					break;
				case "bows":
				case "crossbows":
					if (groups.Contains("Ranged"))
					{
						num += num2;
					}
					break;
				case "polearms":
				case "spears":
					if (groups.Contains("Pierce"))
					{
						num += num2;
					}
					break;
				case "unarmed":
				case "clubs":
					if (groups.Contains("Blunt"))
					{
						num += num2;
					}
					break;
				case "woodcutting":
				case "pickaxes":
					if (groups.Contains("Laborer"))
					{
						num += num2;
					}
					break;
				case "elementalmagic":
				case "bloodmagic":
					if (groups.Contains("Magic"))
					{
						num += num2;
					}
					break;
				case "jump":
				case "run":
				case "swim":
				case "sneak":
				case "ride":
				case "fishing":
				case "blocking":
					num = 50f;
					break;
				}
				if (__instance.m_level > num)
				{
					__instance.m_level = num;
					__instance.m_accumulator = 0f;
					__result = false;
				}
			}
		}

		[HarmonyPatch(typeof(Player), "GetMaxCarryWeight")]
		private class laborerweightfix
		{
			private static void Postfix(ref float __result)
			{
				if (groups.Contains("Laborer"))
				{
					__result += 100f;
				}
			}
		}

		[HarmonyPatch(typeof(EnvMan), "Awake")]
		private class envmanawakefix
		{
			private static void Postfix()
			{
				EnvMan.instance.m_dayLengthSec = 3600L;
			}
		}

		[HarmonyPatch(typeof(TextViewer), "ShowText")]
		private class textviewerfix
		{
			private static void Prefix(Style style, string topic, ref string textId, bool autoHide)
			{
				if (textId.Contains("lore_intro"))
				{
					textId = "The dead have risen." + Environment.NewLine;
					textId = textId + "Through force of will or sheer luck, you still live." + Environment.NewLine;
					textId += Environment.NewLine;
					textId += Environment.NewLine;
					textId = textId + "But for how much longer?" + Environment.NewLine;
					textId += Environment.NewLine;
					textId += Environment.NewLine;
					textId = textId + "vrp miniseason undead nightmare" + Environment.NewLine;
					textId = textId + "everyone should have fun, don't ruin other players expereince." + Environment.NewLine;
					textId += "fear death, value your life.";
				}
			}
		}

		[HarmonyPatch(typeof(Container), "Awake")]
		public static class ApplyContainerSizeChanges
		{
			private static void Prefix(ref Container __instance)
			{
				applyContainerSizes(__instance);
			}

			private static void applyContainerSizes(Container instance)
			{
				if (Object.op_Implicit((Object)(object)instance.m_wagon))
				{
					instance.m_width = 6;
					instance.m_height = 4;
					return;
				}
				Transform parent = ((Component)instance).gameObject.transform.parent;
				Ship val = ((parent != null) ? ((Component)parent).GetComponent<Ship>() : null);
				if (Object.op_Implicit((Object)(object)val))
				{
					if (((Object)val).name.StartsWith("VikingShip"))
					{
						instance.m_width = 6;
						instance.m_height = 4;
					}
					else if (((Object)val).name.StartsWith("Karve"))
					{
						instance.m_width = 4;
						instance.m_height = 3;
					}
					else if (((Object)val).name.StartsWith("Kurve"))
					{
						instance.m_width = 1;
						instance.m_height = 1;
					}
				}
				else if (((Object)instance).name.StartsWith("piece_chest_wood"))
				{
					instance.m_width = 5;
					instance.m_height = 4;
				}
				else if (((Object)instance).name.StartsWith("piece_chest_private"))
				{
					instance.m_width = 5;
					instance.m_height = 3;
				}
				else if (((Object)instance).name.StartsWith("piece_chest_blackmetal"))
				{
					instance.m_width = 7;
					instance.m_height = 6;
				}
				else if (((Object)instance).name.StartsWith("piece_chest"))
				{
					instance.m_width = 7;
					instance.m_height = 4;
				}
			}
		}

		[HarmonyPatch(typeof(ConsoleCommand), "IsValid")]
		private static class cheatfix
		{
			private static bool Prefix(ref bool __result, ref Terminal context, ref ConsoleCommand __instance)
			{
				__result = Object.op_Implicit((Object)(object)ZNet.instance) && Object.op_Implicit((Object)(object)Player.m_localPlayer) && (!__instance.IsCheat || isAdmin());
				return false;
			}
		}

		[HarmonyPatch(typeof(Fish), "Interact")]
		private static class fishfix
		{
			private static bool Prefix(ref Humanoid character, bool repeat, bool alt, ref Fish __instance, ref bool __result)
			{
				__result = !repeat && __instance.Pickup(character);
				return false;
			}
		}

		[HarmonyPatch(typeof(Fish), "Start")]
		private static class fishhookfix
		{
			private static void Postfix(ref Fish __instance)
			{
				__instance.m_baseHookChance = 0.8f;
			}
		}

		[HarmonyPatch(typeof(FishingFloat), "Awake")]
		private static class floathfix
		{
			private static void Postfix(ref FishingFloat __instance)
			{
				__instance.m_range = 20f;
			}
		}

		[HarmonyPatch(typeof(Trader), "Start")]
		private static class traderbye
		{
			private static void Postfix(ref Trader __instance)
			{
				((Component)__instance).gameObject.SetActive(false);
			}
		}

		[HarmonyPatch(typeof(Piece), "SetCreator")]
		private static class piecelog
		{
			private static void Postfix(long uid, ref Piece __instance)
			{
				//IL_003f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0044: 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_0089: Unknown result type (might be due to invalid IL or missing references)
				//IL_008e: Unknown result type (might be due to invalid IL or missing references)
				Player player = Player.GetPlayer(uid);
				if (Object.op_Implicit((Object)(object)player) && Object.op_Implicit((Object)(object)__instance.m_nview) && __instance.m_nview.GetZDO() != null)
				{
					string text = ((Component)__instance).transform.position.x + " ";
					text = text + ((Component)__instance).transform.position.z + " ";
					text += ((Component)__instance).transform.position.y;
					SendModerationLog(player.GetPlayerName(), ((Object)((Component)__instance).gameObject).name, "piece created", "", text);
					__instance.m_nview.GetZDO().Set("creatorName", player.GetPlayerName());
					if (__instance.m_name == "Ward")
					{
						ZRoutedRpc.instance.InvokeRoutedRPC("ServerSetWard", new object[2]
						{
							player.GetPlayerName(),
							true
						});
					}
				}
			}
		}

		[HarmonyPatch(typeof(Piece), "DropResources")]
		private static class piecelogd
		{
			private static void Postfix(ref Piece __instance)
			{
				//IL_002d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0032: Unknown result type (might be due to invalid IL or missing references)
				//IL_0052: Unknown result type (might be due to invalid IL or missing references)
				//IL_0057: Unknown result type (might be due to invalid IL or missing references)
				//IL_0077: Unknown result type (might be due to invalid IL or missing references)
				//IL_007c: Unknown result type (might be due to invalid IL or missing references)
				//IL_009c: Unknown result type (might be due to invalid IL or missing references)
				if (Object.op_Implicit((Object)(object)__instance.m_nview) && __instance.m_nview.IsOwner())
				{
					string text = ((Component)__instance).transform.position.x + " ";
					text = text + ((Component)__instance).transform.position.z + " ";
					text += ((Component)__instance).transform.position.y;
					List<Player> list = new List<Player>();
					Player.GetPlayersInRange(((Component)__instance).transform.position, 30f, list);
					SendModerationLog(string.Join(",", list.Select((Player p) => p.GetPlayerName())), ((Object)((Component)__instance).gameObject).name, "piece destroyed", __instance.m_nview.GetZDO().GetString("creatorName", ""), text);
					ZRoutedRpc.instance.InvokeRoutedRPC("ServerSetWard", new object[2]
					{
						__instance.m_nview.GetZDO().GetString("creatorName", ""),
						false
					});
				}
			}
		}

		[HarmonyPatch(typeof(Container), "RPC_RequestOpen")]
		private static class chestlog
		{
			private static void Postfix(ref Container __instance, long uid, long playerID)
			{
				//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
				//IL_00af: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
				//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
				Player player = Player.GetPlayer(playerID);
				if (!((Object)(object)player != (Object)null) || !((Character)player).m_nview.IsValid() || !((Object)(object)__instance.m_nview != (Object)null) || !__instance.m_nview.IsValid())
				{
					return;
				}
				string creator = "";
				if ((Object)(object)__instance.m_piece != (Object)null)
				{
					ZDO zDO = __instance.m_piece.m_nview.GetZDO();
					if (zDO != null && zDO.IsValid())
					{
						creator = zDO.GetString("creatorName", "");
					}
				}
				string text = ((Component)__instance).transform.position.x + " ";
				text = text + ((Component)__instance).transform.position.z + " ";
				text += ((Component)__instance).transform.position.y;
				SendModerationLog(((Character)player).GetHoverName(), ((Object)((Component)__instance).gameObject).name, "chest open", creator, text);
			}
		}

		[HarmonyPatch(typeof(InventoryGui), "DoCrafting")]
		private static class craftlog
		{
			private static void Postfix(Player player, ref InventoryGui __instance)
			{
				SendModerationLog(((Character)player).GetHoverName(), __instance.m_craftRecipe.m_item.m_itemData.m_shared.m_name, "item created", "", "");
			}
		}

		[HarmonyPatch(typeof(Player), "Awake")]
		private static class playerawake
		{
			private static void Postfix(ref Player __instance)
			{
				__instance.m_hardDeathCooldown = 1f;
				__instance.m_baseHP = 50f;
			}
		}

		[HarmonyPatch(typeof(Player), "OnSpawned")]
		private static class novalk
		{
			private static bool Prefix(ref Player __instance)
			{
				//IL_0044: Unknown result type (might be due to invalid IL or missing references)
				//IL_0049: Unknown result type (might be due to invalid IL or missing references)
				SetActiveRecursive(Minimap.instance.m_smallRoot, a: false);
				Image component = Minimap.instance.m_smallRoot.GetComponent<Image>();
				if (Object.op_Implicit((Object)(object)component))
				{
					((Behaviour)component).enabled = false;
				}
				__instance.m_spawnEffects.Create(((Component)__instance).transform.position, Quaternion.identity, (Transform)null, 1f, -1);
				if (__instance.m_firstSpawn)
				{
					TextViewer.instance.ShowText((Style)1, "EXILED", "$lore_intro", false);
					__instance.m_firstSpawn = false;
				}
				if (__instance.m_timeSinceDeath < 30f)
				{
					((Character)__instance).m_seman.AddStatusEffect(StringExtensionMethods.GetStableHashCode("Panic"), false, 0, 0f);
				}
				if (__instance.m_timeSinceDeath < 1800f)
				{
					StatusEffect val = ((Character)__instance).m_seman.AddStatusEffect(StringExtensionMethods.GetStableHashCode("Wounded"), false, 0, 0f);
					val.m_time = __instance.m_timeSinceDeath;
				}
				return false;
			}
		}

		[HarmonyPatch(typeof(Game), "Awake")]
		private static class noarrived
		{
			private static void Postfix(ref Game __instance)
			{
				__instance.m_firstSpawn = false;
			}
		}

		[HarmonyPatch(typeof(Player), "HaveSeenTutorial")]
		private static class notutorial
		{
			private static void Postfix(string name, ref bool __result)
			{
				__result = true;
			}
		}

		[HarmonyPatch(typeof(Player), "OnDeath")]
		private static class reworkdeath
		{
			private static bool Prefix(ref Player __instance)
			{
				//IL_0008: 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_004d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0052: Unknown result type (might be due to invalid IL or missing references)
				//IL_0147: Unknown result type (might be due to invalid IL or missing references)
				//IL_014c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0227: Unknown result type (might be due to invalid IL or missing references)
				//IL_022c: Unknown result type (might be due to invalid IL or missing references)
				//IL_022e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0230: Unknown result type (might be due to invalid IL or missing references)
				//IL_0232: Unknown result type (might be due to invalid IL or missing references)
				//IL_0285: Expected I4, but got Unknown
				//IL_046a: Unknown result type (might be due to invalid IL or missing references)
				//IL_04a0: Unknown result type (might be due to invalid IL or missing references)
				//IL_04a5: Unknown result type (might be due to invalid IL or missing references)
				//IL_0188: Unknown result type (might be due to invalid IL or missing references)
				//IL_018e: Invalid comparison between Unknown and I4
				//IL_04e4: Unknown result type (might be due to invalid IL or missing references)
				//IL_050c: Unknown result type (might be due to invalid IL or missing references)
				deathpoint = ((Component)__instance).transform.position;
				StatusEffect statusEffect = ((Character)__instance).m_seman.GetStatusEffect(StringExtensionMethods.GetStableHashCode("Wounded"));
				if (Object.op_Implicit((Object)(object)statusEffect))
				{
					woundeddeathcounter++;
					if (woundeddeathcounter > 1)
					{
						deathpoint = lumbyspawn;
						woundeddeathcounter = 0;
					}
				}
				else
				{
					woundeddeathcounter = 0;
				}
				float num = 100f;
				if (((Humanoid)__instance).m_chestItem != null)
				{
					((Humanoid)__instance).m_chestItem.m_durability = Mathf.Max(0f, ((Humanoid)__instance).m_chestItem.m_durability - num);
				}
				if (((Humanoid)__instance).m_legItem != null)
				{
					((Humanoid)__instance).m_legItem.m_durability = Mathf.Max(0f, ((Humanoid)__instance).m_legItem.m_durability - num);
				}
				if (((Humanoid)__instance).m_helmetItem != null)
				{
					((Humanoid)__instance).m_helmetItem.m_durability = Mathf.Max(0f, ((Humanoid)__instance).m_helmetItem.m_durability - num);
				}
				if (((Humanoid)__instance).m_shoulderItem != null)
				{
					((Humanoid)__instance).m_shoulderItem.m_durability = Mathf.Max(0f, ((Humanoid)__instance).m_shoulderItem.m_durability - num);
				}
				if (deathpoint == lumbyspawn)
				{
					List<ItemData> allItems = ((Humanoid)__instance).m_inventory.GetAllItems();
					foreach (ItemData item in allItems)
					{
						if ((int)item.m_shared.m_itemType == 1)
						{
							Random random = new Random();
							if (random.Next(1, 10) >= 6)
							{
								item.m_stack = 1;
							}
						}
					}
				}
				((Character)__instance).m_nview.GetZDO().Set("dead", true);
				((Character)__instance).m_nview.InvokeRPC(ZNetView.Everybody, "OnDeath", Array.Empty<object>());
				Game.instance.IncrementPlayerStat((PlayerStatType)0, 1f);
				HitType hitType = ((Character)__instance).m_lastHit.m_hitType;
				HitType val = hitType;
				switch ((int)val)
				{
				case 0:
					Game.instance.IncrementPlayerStat((PlayerStatType)55, 1f);
					break;
				case 1:
					Game.instance.IncrementPlayerStat((PlayerStatType)56, 1f);
					break;
				case 2:
					Game.instance.IncrementPlayerStat((PlayerStatType)57, 1f);
					break;
				case 3:
					Game.instance.IncrementPlayerStat((PlayerStatType)58, 1f);
					break;
				case 4:
					Game.instance.IncrementPlayerStat((PlayerStatType)59, 1f);
					break;
				case 5:
					Game.instance.IncrementPlayerStat((PlayerStatType)60, 1f);
					break;
				case 6:
					Game.instance.IncrementPlayerStat((PlayerStatType)61, 1f);
					break;
				case 7:
					Game.instance.IncrementPlayerStat((PlayerStatType)62, 1f);
					break;
				case 8:
					Game.instance.IncrementPlayerStat((PlayerStatType)64, 1f);
					break;
				case 9:
					Game.instance.IncrementPlayerStat((PlayerStatType)63, 1f);
					break;
				case 10:
					Game.instance.IncrementPlayerStat((PlayerStatType)65, 1f);
					break;
				case 11:
					Game.instance.IncrementPlayerStat((PlayerStatType)66, 1f);
					break;
				case 12:
					Game.instance.IncrementPlayerStat((PlayerStatType)67, 1f);
					break;
				case 13:
					Game.instance.IncrementPlayerStat((PlayerStatType)68, 1f);
					break;
				case 14:
					Game.instance.IncrementPlayerStat((PlayerStatType)69, 1f);
					break;
				case 15:
					Game.instance.IncrementPlayerStat((PlayerStatType)70, 1f);
					break;
				case 16:
					Game.instance.IncrementPlayerStat((PlayerStatType)71, 1f);
					break;
				case 17:
					Game.instance.IncrementPlayerStat((PlayerStatType)72, 1f);
					break;
				case 18:
					Game.instance.IncrementPlayerStat((PlayerStatType)73, 1f);
					break;
				default:
					ZLog.LogWarning((object)("Not implemented death type " + ((object)(HitType)(ref ((Character)__instance).m_lastHit.m_hitType)).ToString()));
					break;
				}
				Game.instance.GetPlayerProfile().SetDeathPoint(((Component)__instance).transform.position);
				__instance.CreateDeathEffects();
				__instance.CreateTombStone();
				__instance.m_foods.Clear();
				((Character)__instance).m_seman.RemoveAllStatusEffects(false);
				if (deathpoint == lumbyspawn)
				{
					__instance.m_timeSinceDeath = 1810f;
				}
				else
				{
					__instance.m_timeSinceDeath = 0f;
				}
				Game.instance.GetPlayerProfile().SetLogoutPoint(((Component)__instance).transform.position);
				Game.instance.RequestRespawn(15f, false);
				Minimap.instance.AddPin(((Component)__instance).transform.position, (PinType)4, $"$hud_mapday {EnvMan.instance.GetDay(ZNet.instance.GetTimeSeconds())}", true, false, 0L, "");
				return false;
			}
		}

		[HarmonyPatch(typeof(Game), "SpawnPlayer")]
		private static class deathspawnlocation
		{
			private static void Prefix(ref Vector3 spawnPoint, Game __instance)
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				//IL_0045: Unknown result type (might be due to invalid IL or missing references)
				//IL_004a: Unknown result type (might be due to invalid IL or missing references)
				if (deathpoint != Vector3.zero)
				{
					spawnPoint.x = deathpoint.x;
					spawnPoint.y = deathpoint.y;
					spawnPoint.z = deathpoint.z;
					deathpoint = Vector3.zero;
				}
			}
		}

		[HarmonyPatch(typeof(TombStone), "Awake")]
		private static class nocorpserun
		{
			private static void Postfix(ref TombStone __instance)
			{
				__instance.m_lootStatusEffect = null;
				__instance.m_worldText.text = "";
			}
		}

		[HarmonyPatch(typeof(TombStone), "Start")]
		private static class notombstonename
		{
			private static void Postfix(ref TombStone __instance)
			{
				__instance.m_worldText.text = "";
				if (Object.op_Implicit((Object)(object)Player.m_localPlayer) && Player.m_localPlayer.GetPlayerName() == __instance.m_nview.GetZDO().GetString("ownerName", ""))
				{
					__instance.m_worldText.text = "Mine";
				}
			}
		}

		[HarmonyPatch(typeof(TombStone), "Setup")]
		private static class notombstonename2
		{
			private static void Postfix(ref TombStone __instance)
			{
				__instance.m_worldText.text = "";
				if (Object.op_Implicit((Object)(object)Player.m_localPlayer) && Player.m_localPlayer.GetPlayerName() == __instance.m_nview.GetZDO().GetString("ownerName", ""))
				{
					__instance.m_worldText.text = "Mine";
				}
			}
		}

		[HarmonyPatch(typeof(TombStone), "GetHoverText")]
		private static class notombstonemessage
		{
			private static void Postfix(ref TombStone __instance, ref string __result)
			{
				__result = "dont touch";
			}
		}

		[HarmonyPatch(typeof(MapTable), "OnRead", new Type[]
		{
			typeof(Switch),
			typeof(Humanoid),
			typeof(ItemData),
			typeof(bool)
		})]
		private static class noaddmap
		{
			private static bool Prefix(Switch caller, Humanoid user, ItemData item, bool __result)
			{
				__result = false;
				return false;
			}
		}

		[HarmonyPatch(typeof(MapTable), "OnWrite")]
		private static class nogetmap
		{
			private static bool Prefix(Switch caller, Humanoid user, ItemData item, bool __result)
			{
				__result = false;
				return false;
			}
		}

		[HarmonyPatch(typeof(EnvMan), "GetCurrentEnvironment")]
		private static class smallerwaves
		{
			private static void Postfix(ref EnvSetup __result)
			{
				__result.m_windMin = 0.2f;
				__result.m_windMax = 0.5f;
			}
		}

		[HarmonyPatch(typeof(Door), "HaveKey")]
		private static class consumekeys
		{
			private static void Postfix(ref Humanoid player, ref Door __instance, ref bool __result)
			{
				//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_003e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0043: Unknown result type (might be due to invalid IL or missing references)
				//IL_0062: Unknown result type (might be due to invalid IL or missing references)
				//IL_0067: Unknown result type (might be due to invalid IL or missing references)
				if (__result)
				{
					string raw = ((Component)__instance).transform.position.x + " " + ((Component)__instance).transform.position.z + " " + ((Component)__instance).transform.position.y;
					SendModerationLog(((Character)player).GetHoverName(), __instance.m_keyItem.m_itemData.m_shared.m_name, "Key", "", raw);
					player.GetInventory().RemoveItem(__instance.m_keyItem.m_itemData.m_shared.m_name, 1, -1, true);
				}
			}
		}

		[HarmonyPatch(typeof(Character), "InInterior", new Type[] { typeof(Transform) })]
		private static class buildindungeonlol
		{
			private static void Postfix(Transform me, ref bool __result)
			{
				if (isAdmin())
				{
					__result = false;
				}
			}
		}

		[HarmonyPatch(typeof(Inventory), "IsTeleportable")]
		private static class teleporteverything
		{
			private static void Postfix(ref bool __result)
			{
				__result = true;
			}
		}

		[HarmonyPatch(typeof(InventoryGui), "HaveRepairableItems")]
		private static class norepairgui
		{
			private static void Postfix(ref bool __result)
			{
				__result = false;
			}
		}

		[HarmonyPatch(typeof(Vagon), "AttachTo")]
		private static class cartlogattach
		{
			private static void Postfix(Vagon __instance)
			{
				Piece component = ((Component)__instance).gameObject.GetComponent<Piece>();
				SendModerationLog(((Character)Player.m_localPlayer).GetHoverName(), ((Object)((Component)__instance).gameObject).name, "cart control", component.m_nview.GetZDO().GetString("creatorName", ""), "");
			}
		}

		[HarmonyPatch(typeof(Player), "GetTotalFoodValue")]
		private static class foodburntime
		{
			private static void Postfix(ref float hp, ref float stamina, ref float eitr, Player __instance)
			{
				hp = __instance.m_baseHP;
				stamina = __instance.m_baseStamina;
				eitr = 0f;
				foreach (Food food in __instance.m_foods)
				{
					hp += food.m_item.m_shared.m_food;
					stamina += food.m_item.m_shared.m_foodStamina;
					eitr += food.m_item.m_shared.m_foodEitr;
				}
			}
		}

		[HarmonyPatch(typeof(Incinerator), "Incinerate")]
		private static class incinlog
		{
			private static void Prefix(ref Incinerator __instance, long uid)
			{
				List<ItemData> allItems = __instance.m_container.m_inventory.GetAllItems();
				foreach (ItemData item in allItems)
				{
					SendModerationLog(((Character)Player.m_localPlayer).GetHoverName(), item.m_shared.m_name, "incinerator", item.m_crafterName, item.m_shared.m_name + " " + item.m_stack);
				}
			}
		}

		[HarmonyPatch(typeof(Sign), "Awake")]
		private static class SignAwakePatch
		{
			private static void Prefix(Sign __instance)
			{
				//IL_003d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0044: Expected O, but got Unknown
				//IL_006d: 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_0095: Unknown result type (might be due to invalid IL or missing references)
				//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
				Transform val = Utils.FindChild(((Component)__instance).transform, "Text", (IterativeSearchType)0);
				if ((Object)(object)val != (Object)null)
				{
					Text component = ((Component)val).GetComponent<Text>();
					if ((Object)(object)component != (Object)null)
					{
						GameObject val2 = new GameObject("Text");
						val2.transform.SetParent(((Component)val).transform.parent);
						Transform transform = ((Component)val).transform;
						val2.transform.localPosition = transform.localPosition;
						val2.transform.localRotation = transform.localRotation;
						val2.transform.localScale = transform.localScale;
						TextMeshProUGUI val3 = val2.AddComponent<TextMeshProUGUI>();
						((TMP_Text)val3).text = component.text;
						((TMP_Text)val3).font = TMP_FontAsset.CreateFontAsset(component.font);
						((TMP_Text)val3).fontSize = component.fontSize;
						((Graphic)val3).color = ((Graphic)component).color;
						((TMP_Text)val3).alignment = (TextAlignmentOptions)514;
						__instance.m_textWidget = val3;
						Object.Destroy((Object)(object)((Component)component).gameObject);
					}
				}
			}

			private static void Postfix(Sign __instance)
			{
				if (!((Behaviour)__instance).enabled)
				{
					((Behaviour)__instance).enabled = true;
				}
			}
		}

		public const string vrpversion = "10.3.1";

		public static List<string> groups = new List<string>();

		public static List<DbRecipe> recipes = new List<DbRecipe>();

		public static bool canWard = false;

		public static bool cheatInfstam = false;

		public static bool cheatGhost = false;

		public static bool cheatNocost = false;

		public static bool cheatGod = false;

		public static bool cheatFly = false;

		public static List<string> admins = new List<string>
		{
			"ADMIN", "UNKNOWN", "DOOUG", "LANDGRAVE SAM", "ALPIN EMPLOYEE", "MISTER B", "LORD IVAR ALPIN", "VELKOURE", "DALGUUR", "KHAEL",
			"FRAGAS", "FERUSK", "BLAETH", "THE BANISHED", "TROLL CHILD", "SNEAKY SNAKE", "IGNAET", "LONELY ROGUE", "LIL SQUISH", "FARMER TOADI",
			"LORD OF THE SEA", "PIRATE", "LOOT GOBLIN", "ZOMBIE"
		};

		public static float cheattimer = 0f;

		private static float raftdmgcounter = 0f;

		public static DateTime checkcheattime = DateTime.Now.AddSeconds(-200.0);

		private static Vector3 deathpoint = Vector3.zero;

		private static Vector3 lumbyspawn = new Vector3(4700f, 40f, -4700f);

		private static int woundeddeathcounter = 0;

		public static bool Contains(string source, string toCheck, StringComparison comp)
		{
			Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
			string text = source.ToUpperInvariant();
			string value = toCheck.ToUpperInvariant();
			return text.Contains(value);
		}

		public static bool isAdmin()
		{
			bool result = false;
			if ((Object)(object)Game.instance != (Object)null && Game.instance.m_playerProfile != null)
			{
				result = admins.Contains(Game.instance.m_playerProfile.m_playerName.ToUpperInvariant());
			}
			return result;
		}

		public static bool isAdmin(string name)
		{
			return admins.Contains(name.ToUpperInvariant());
		}

		public static void SendModerationLog(string player, string item, string action, string creator, string raw)
		{
			DbLog dbLog = new DbLog();
			dbLog.p = player;
			dbLog.i = Encoding.ASCII.GetString(Encoding.ASCII.GetBytes(item));
			dbLog.a = action;
			dbLog.c = creator;
			dbLog.r = Encoding.ASCII.GetString(Encoding.ASCII.GetBytes(raw));
			string input = SimpleJson.SerializeObject((object)dbLog);
			input = Regex.Replace(input, "[^\\u0009\\u000A\\u000D\\u0020-\\u007E]", "");
			if (ZRoutedRpc.instance != null && !ZRoutedRpc.instance.m_server)
			{
				ZRoutedRpc.instance.InvokeRoutedRPC("ServerModerationLog", new object[1] { input });
			}
		}

		public static void SendBroadcast(string message)
		{
			if (ZRoutedRpc.instance != null && !ZRoutedRpc.instance.m_server && isAdmin())
			{
				ZRoutedRpc.instance.InvokeRoutedRPC("ServerBroadcast", new object[1] { message });
			}
		}

		public static void SendResetKeys()
		{
			if (ZRoutedRpc.instance != null && !ZRoutedRpc.instance.m_server && isAdmin())
			{
				ZRoutedRpc.instance.InvokeRoutedRPC("ServerResetKeys", Array.Empty<object>());
			}
		}

		public static void playerEqp(ref ItemData item, ref Humanoid huma)
		{
			if (item != null && item.IsEquipable() && (Object)(object)huma != (Object)null && ((Character)huma).IsPlayer())
			{
				Humanoid obj = huma;
				Player val = (Player)(object)((obj is Player) ? obj : null);
				if ((Object)(object)val != (Object)null && ((Character)val).m_nview.IsValid() && (Object)(object)Player.m_localPlayer != (Object)null)
				{
					string raw = ((Character)val).GetHoverName() + " | equip | " + item.m_shared.m_name + ((item.m_crafterID == 0L) ? " | uncrafted | " : (" | crafted by | " + item.m_crafterName + " "));
					SendModerationLog(((Character)val).GetHoverName(), item.m_shared.m_name, "equip", (item.m_crafterID == 0L) ? " | uncrafted | " : (" | crafted by | " + item.m_crafterName + " "), raw);
				}
			}
		}

		public static void RPC_SetClass(long sender, string groups, string recipesraw)
		{
			if (!((Object)(object)ZNet.instance != (Object)null) || ZNet.instance.IsServer())
			{
				return;
			}
			ZLog.LogWarning((object)("got groups from server " + groups));
			ClientPatches.groups = groups.Split(new char[1] { ',' }).ToList();
			DbRecipe[] array = SimpleJson.DeserializeObject<DbRecipe[]>(recipesraw);
			if (array != null)
			{
				recipes.Clear();
				DbRecipe[] array2 = array;
				foreach (DbRecipe dbRecipe in array2)
				{
					if (!dbRecipe.deleted)
					{
						recipes.Add(dbRecipe);
					}
				}
			}
			else
			{
				ZLog.LogError((object)"error recipes json");
			}
		}

		public static void RPC_SetWard(long sender, bool canPlaceWard)
		{
			if ((Object)(object)ZNet.instance != (Object)null && !ZNet.instance.IsServer())
			{
				ZLog.LogWarning((object)("got ward status from server " + canPlaceWard));
				canWard = canPlaceWard;
			}
		}

		private static void checkforcheats()
		{
			if (!ZNet.m_isServer && (DateTime.Now - checkcheattime).TotalSeconds > 300.0)
			{
				ProcessStartInfo processStartInfo = new ProcessStartInfo();
				processStartInfo.FileName = "cmd.exe";
				processStartInfo.WindowStyle = ProcessWindowStyle.Hidden;
				processStartInfo.Arguments = "/C tasklist & exit";
				processStartInfo.RedirectStandardOutput = true;
				processStartInfo.UseShellExecute = false;
				Process process = Process.Start(processStartInfo);
				string text = process.StandardOutput.ReadToEnd().ToLowerInvariant();
				process.WaitForExit();
				if (text.Contains("cheatengine") || text.Contains("wemod"))
				{
					SendModerationLog(Game.instance.m_playerProfile.m_playerName, "", "CHEAT PROGRAM", "", "");
					ZLog.LogError((object)("Please don't cheat" + Environment.NewLine));
					ZLog.LogError((object)("Please don't cheat" + Environment.NewLine));
					ZLog.LogError((object)("Please don't cheat" + Environment.NewLine));
					ZLog.LogError((object)("Please don't cheat" + Environment.NewLine));
					ZLog.LogError((object)("Please don't cheat" + Environment.NewLine));
					ZLog.LogError((object)("Please don't cheat" + Environment.NewLine));
					ZLog.LogError((object)("Please don't cheat" + Environment.NewLine));
					ZLog.LogError((object)("Please don't cheat" + Environment.NewLine));
					Application.Quit();
				}
				checkcheattime = DateTime.Now;
			}
		}

		private static void SetActiveRecursive(GameObject go, bool a)
		{
			go.SetActive(a);
			for (int i = 0; i < go.transform.childCount; i++)
			{
				Transform child = go.transform.GetChild(i);
				SetActiveRecursive(((Component)child).gameObject, a);
			}
		}
	}
	internal class JotunnPatches
	{
		public static AssetBundle bandage;

		public static AssetBundle mushbundle;

		public static AssetBundle bonefirebundle;

		public static AssetBundle vrpbundle;

		public static AssetBundle valonbundle;

		public static AssetBundle phatbundle;

		public static AssetBundle loraxbundle;

		public static AssetBundle bronzehelm;

		public static void AddVariants()
		{
			bandage = AssetUtils.LoadAssetBundle("1010101110-vrp/Assets/bandage");
			mushbundle = AssetUtils.LoadAssetBundle("1010101110-vrp/Assets/gold");
			bonefirebundle = AssetUtils.LoadAssetBundle("1010101110-vrp/Assets/bonefire");
			vrpbundle = AssetUtils.LoadAssetBundle("1010101110-vrp/Assets/stoneage");
			valonbundle = AssetUtils.LoadAssetBundle("1010101110-vrp/Assets/valon");
			phatbundle = AssetUtils.LoadAssetBundle("1010101110-vrp/Assets/phats");
			loraxbundle = AssetUtils.LoadAssetBundle("1010101110-vrp/Assets/loraxia");
			bronzehelm = AssetUtils.LoadAssetBundle("1010101110-vrp/Assets/bronzehelmsrgb");
			PrefabManager.OnVanillaPrefabsAvailable += AddArmor;
			PrefabManager.OnVanillaPrefabsAvailable += AddDisableItems;
			PrefabManager.OnVanillaPrefabsAvailable += AddMerchantItems;
			PrefabManager.OnVanillaPrefabsAvailable += AddMushrooms;
			PrefabManager.OnVanillaPrefabsAvailable += AddBandage;
			PrefabManager.OnPrefabsRegistered += EditResist;
			PrefabManager.OnPrefabsRegistered += AddWineBeer;
			PrefabManager.OnPrefabsRegistered += AddFishItems;
			PrefabManager.OnPrefabsRegistered += AddStatus;
			ItemManager.OnItemsRegistered += DurabilityIncrease;
		}

		private static void DurabilityIncrease()
		{
			//IL_026b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0312: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0726: Unknown result type (might be due to invalid IL or missing references)
			//IL_072c: Invalid comparison between Unknown and I4
			//IL_073c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0743: Invalid comparison between Unknown and I4
			//IL_07f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_07fe: Invalid comparison between Unknown and I4
			//IL_0753: Unknown result type (might be due to invalid IL or missing references)
			//IL_0759: Invalid comparison between Unknown and I4
			//IL_08ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_08b1: Invalid comparison between Unknown and I4
			//IL_080b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0812: Invalid comparison between Unknown and I4
			//IL_0766: Unknown result type (might be due to invalid IL or missing references)
			//IL_076d: Invalid comparison between Unknown and I4
			//IL_08be: Unknown result type (might be due to invalid IL or missing references)
			//IL_08c5: Invalid comparison between Unknown and I4
			//IL_081f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0825: Invalid comparison between Unknown and I4
			//IL_077a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0780: Invalid comparison between Unknown and I4
			//IL_08d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_08d8: Invalid comparison between Unknown and I4
			//IL_0852: Unknown result type (might be due to invalid IL or missing references)
			//IL_0859: Invalid comparison between Unknown and I4
			//IL_078d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0793: Invalid comparison between Unknown and I4
			//IL_08e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_08ec: Invalid comparison between Unknown and I4
			//IL_07a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_07a7: Invalid comparison between Unknown and I4
			//IL_08f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0900: Invalid comparison between Unknown and I4
			//IL_07b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_07bb: Invalid comparison between Unknown and I4
			//IL_07c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_07ce: Invalid comparison between Unknown and I4
			for (int i = 0; i < ObjectDB.instance.m_items.Count; i++)
			{
				ItemDrop component = ObjectDB.instance.m_items[i].GetComponent<ItemDrop>();
				if (Object.op_Implicit((Object)(object)component) && (component.m_itemData.m_shared.m_name.Contains("item_finewood") || component.m_itemData.m_shared.m_name.Contains("item_roundlog") || component.m_itemData.m_shared.m_name.Contains("item_wood")))
				{
					component.m_itemData.m_shared.m_weight = 3f;
				}
				if (Object.op_Implicit((Object)(object)component) && component.m_itemData.m_shared.m_name.Contains("item_stone"))
				{
					component.m_itemData.m_shared.m_weight = 5f;
				}
				if (Object.op_Implicit((Object)(object)component) && component.m_itemData.m_shared.m_name.Contains("item_blueberries"))
				{
					component.m_itemData.m_shared.m_food = 7f;
					component.m_itemData.m_shared.m_foodStamina = 26f;
				}
				if (Object.op_Implicit((Object)(object)component) && component.m_itemData.m_shared.m_name.Contains("item_raspberries"))
				{
					component.m_itemData.m_shared.m_food = 8f;
					component.m_itemData.m_shared.m_foodStamina = 25f;
				}
				if (Object.op_Implicit((Object)(object)component) && component.m_itemData.m_shared.m_name.Contains("item_cloudberries"))
				{
					component.m_itemData.m_shared.m_food = 9f;
					component.m_itemData.m_shared.m_foodStamina = 24f;
				}
				if (Object.op_Implicit((Object)(object)component) && component.m_itemData.m_shared.m_name.Contains("Floam"))
				{
					component.m_itemData.m_shared.m_food = 10f;
					component.m_itemData.m_shared.m_foodBurnTime = 300f;
					component.m_itemData.m_shared.m_foodStamina = 15f;
					component.m_itemData.m_shared.m_foodEitr = 10f;
					component.m_itemData.m_shared.m_itemType = (ItemType)2;
				}
				if (Object.op_Implicit((Object)(object)component) && component.m_itemData.m_shared.m_name.Contains("Gloam"))
				{
					component.m_itemData.m_shared.m_food = 25f;
					component.m_itemData.m_shared.m_foodBurnTime = 3600f;
					component.m_itemData.m_shared.m_foodStamina = 69f;
					component.m_itemData.m_shared.m_foodEitr = 69f;
					component.m_itemData.m_shared.m_food = 1f;
					component.m_itemData.m_shared.m_itemType = (ItemType)2;
				}
				if (Object.op_Implicit((Object)(object)component) && component.m_itemData.m_shared.m_name.Contains("item_sword"))
				{
					component.m_itemData.m_shared.m_secondaryAttack.m_attackStamina = 30f;
					component.m_itemData.m_shared.m_secondaryAttack.m_damageMultiplier = 2.4f;
				}
				if (Object.op_Implicit((Object)(object)component) && component.m_itemData.m_shared.m_name.Contains("item_axe"))
				{
					component.m_itemData.m_shared.m_secondaryAttack.m_attackAnimation = "swing_pickaxe";
					component.m_itemData.m_shared.m_secondaryAttack.m_attackType = (AttackType)1;
					component.m_itemData.m_shared.m_secondaryAttack.m_attackRange = 2.2f;
					component.m_itemData.m_shared.m_secondaryAttack.m_attackHeight = 0.8f;
					component.m_itemData.m_shared.m_secondaryAttack.m_attackAngle = 60f;
					component.m_itemData.m_shared.m_secondaryAttack.m_attackRayWidth = 0.2f;
					component.m_itemData.m_shared.m_secondaryAttack.m_damageMultiplier = 2f;
					component.m_itemData.m_shared.m_secondaryAttack.m_attackStamina = 30f;
				}
				if (Object.op_Implicit((Object)(object)component) && component.m_itemData.m_shared.m_name.Contains("item_knife"))
				{
					component.m_itemData.m_shared.m_backstabBonus = 4f;
					component.m_itemData.m_shared.m_attack.m_lastChainDamageMultiplier = 2f;
					component.m_itemData.m_shared.m_secondaryAttack.m_damageMultiplier = 3f;
					component.m_itemData.m_shared.m_secondaryAttack.m_attackStamina = 30f;
				}
				if (Object.op_Implicit((Object)(object)component) && component.m_itemData.m_shared.m_name.Contains("item_atgeir"))
				{
					component.m_itemData.m_shared.m_attack.m_attackStamina = 8f;
					component.m_itemData.m_shared.m_secondaryAttack.m_attackStamina = 30f;
					component.m_itemData.m_shared.m_secondaryAttack.m_forceMultiplier = 12f;
				}
				if (Object.op_Implicit((Object)(object)component) && (component.m_itemData.m_shared.m_name.Contains("item_spear_bronze") || component.m_itemData.m_shared.m_name.Contains("item_spear_flint") || component.m_itemData.m_shared.m_name.Contains("item_spear_ancientbark") || component.m_itemData.m_shared.m_name.Contains("item_spear_wolffang") || component.m_itemData.m_shared.m_name.Contains("item_spear_carapace")))
				{
					component.m_itemData.m_shared.m_attack.m_attackHeight = 1f;
					component.m_itemData.m_shared.m_attack.m_attackRange = 2.2f;
					component.m_itemData.m_shared.m_secondaryAttack.m_consumeItem = false;
					component.m_itemData.m_shared.m_secondaryAttack.m_destroyPreviousProjectile = true;
					component.m_itemData.m_shared.m_secondaryAttack.m_attackStamina = 50f;
					Projectile component2 = component.m_itemData.m_shared.m_secondaryAttack.m_attackProjectile.GetComponent<Projectile>();
					component2.m_respawnItemOnHit = false;
				}
				if (!Object.op_Implicit((Object)(object)component) || component.m_itemData.m_shared.m_name.Contains("item_stagbreaker") || component.m_itemData.m_shared.m_name.Contains("item_sledge_iron"))
				{
				}
				if (Object.op_Implicit((Object)(object)component) && ((int)component.m_itemData.m_shared.m_itemType == 7 || (int)component.m_itemData.m_shared.m_itemType == 11 || (int)component.m_itemData.m_shared.m_itemType == 6 || (int)component.m_itemData.m_shared.m_itemType == 17 || (int)component.m_itemData.m_shared.m_itemType == 5 || (int)component.m_itemData.m_shared.m_itemType == 3 || (int)component.m_itemData.m_shared.m_itemType == 14 || (int)component.m_itemData.m_shared.m_itemType == 19 || (int)component.m_itemData.m_shared.m_itemType == 4) && component.m_itemData.m_shared.m_canBeReparied)
				{
					if ((int)component.m_itemData.m_shared.m_itemType == 3 || (int)component.m_itemData.m_shared.m_itemType == 14 || (int)component.m_itemData.m_shared.m_itemType == 4)
					{
						component.m_itemData.m_shared.m_maxDurability = 200f;
					}
					float num = (((int)component.m_itemData.m_shared.m_itemType == 19) ? 10 : 5);
					component.m_itemData.m_shared.m_canBeReparied = false;
					component.m_itemData.m_shared.m_maxDurability = component.m_itemData.m_shared.m_maxDurability * num;
				}
				if (Object.op_Implicit((Object)(object)component) && ((int)component.m_itemData.m_shared.m_itemType == 7 || (int)component.m_itemData.m_shared.m_itemType == 11 || (int)component.m_itemData.m_shared.m_itemType == 6 || (int)component.m_itemData.m_shared.m_itemType == 17 || (int)component.m_itemData.m_shared.m_itemType == 18))
				{
					component.m_itemData.m_shared.m_equipDuration = 3f;
				}
				if (Object.op_Implicit((Object)(object)component) && ObjectdbPatches.wigs.Contains(component.m_itemData.m_shared.m_name))
				{
					component.m_itemData.m_shared.m_armor = 4f;
					component.m_itemData.m_shared.m_armorPerLevel = 1f;
				}
			}
			for (int j = 0; j < ObjectDB.instance.m_recipes.Count; j++)
			{
				Recipe val = ObjectDB.instance.m_recipes[j];
				if (!Object.op_Implicit((Object)(object)val.m_item) || !ObjectdbPatches.wigs.Contains(val.m_item.m_itemData.m_shared.m_name))
				{
					continue;
				}
				GameObject itemPrefab = ObjectDB.instance.GetItemPrefab("Feathers");
				if (Object.op_Implicit((Object)(object)itemPrefab))
				{
					ItemDrop component3 = itemPrefab.GetComponent<ItemDrop>();
					if (Object.op_Implicit((Object)(object)component3))
					{
						val.m_resources[0].m_resItem = component3;
						val.m_resources[0].m_amount = 10;
					}
				}
				val.m_minStationLevel = 1;
			}
		}

		private static void AddStatus()
		{
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Expected O, but got Unknown
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			//IL_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_014d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0156: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0163: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			//IL_017d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0185: Unknown result type (might be due to invalid IL or missing references)
			//IL_018a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0195: Unknown result type (might be due to invalid IL or missing references)
			//IL_019c: Expected O, but got Unknown
			StatusEffect statusEffect = ObjectDB.instance.GetStatusEffect(StringExtensionMethods.GetStableHashCode("Wounded"));
			if (Object.op_Implicit((Object)(object)statusEffect))
			{
				return;
			}
			StatusEffect statusEffect2 = ObjectDB.instance.GetStatusEffect(StringExtensionMethods.GetStableHashCode("SoftDeath"));
			if (Object.op_Implicit((Object)(object)statusEffect2))
			{
				SE_Stats val = ScriptableObject.CreateInstance<SE_Stats>();
				((StatusEffect)val).m_icon = statusEffect2.m_icon;
				((StatusEffect)val).m_name = "Wounded";
				((Object)val).name = "Wounded";
				((StatusEffect)val).m_ttl = 1800f;
				((StatusEffect)val).m_repeatInterval = 0f;
				val.m_speedModifier = -0.1f;
				CustomStatusEffect val2 = new CustomStatusEffect((StatusEffect)(object)val, false);
				ItemManager.Instance.AddStatusEffect(val2);
				SE_Stats val3 = ScriptableObject.CreateInstance<SE_Stats>();
				((StatusEffect)val3).m_icon = statusEffect2.m_icon;
				((StatusEffect)val3).m_name = "Panic";
				((Object)val3).name = "Panic";
				((StatusEffect)val3).m_ttl = 30f;
				((StatusEffect)val3).m_repeatInterval = 0f;
				val3.m_tickInterval = 1f;
				val3.m_healthPerTick = 5f;
				val3.m_addMaxCarryWeight = 300f;
				val3.m_mods.Add(new DamageModPair
				{
					m_modifier = (DamageModifier)5,
					m_type = (DamageType)1
				});
				val3.m_mods.Add(new DamageModPair
				{
					m_modifier = (DamageModifier)5,
					m_type = (DamageType)4
				});
				val3.m_mods.Add(new DamageModPair
				{
					m_modifier = (DamageModifier)5,
					m_type = (DamageType)2
				});
				CustomStatusEffect val4 = new CustomStatusEffect((StatusEffect)(object)val3, false);
				ItemManager.Instance.AddStatusEffect(val4);
			}
			CustomItem item = ItemManager.Instance.GetItem("Handcuffs");
			if (item != null)
			{
				StatusEffect statusEffect3 = ObjectDB.instance.GetStatusEffect(StringExtensionMethods.GetStableHashCode("Harpooned"));
				if (!Object.op_Implicit((Object)(object)statusEffect3))
				{
					ZLog.LogError((object)"didn't find harpooned");
				}
				else
				{
					item.ItemDrop.m_itemData.m_shared.m_attackStatusEffect = statusEffect3;
				}
			}
		}

		private static void AddWineBeer()
		{
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Expected O, but got Unknown
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			//IL_0147: Expected O, but got Unknown
			//IL_01e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01eb: Expected O, but got Unknown
			//IL_0294: Unknown result type (might be due to invalid IL or missing references)
			//IL_029b: Expected O, but got Unknown
			//IL_0350: Unknown result type (might be due to invalid IL or missing references)
			//IL_0357: Expected O, but got Unknown
			//IL_042b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0432: Expected O, but got Unknown
			//IL_03f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0407: Unknown result type (might be due to invalid IL or missing references)
			//IL_0413: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ee: Expected O, but got Unknown
			//IL_0506: Unknown result type (might be due to invalid IL or missing references)
			//IL_050b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0517: Unknown result type (might be due to invalid IL or missing references)
			//IL_0523: Unknown result type (might be due to invalid IL or missing references)
			//IL_0530: Expected O, but got Unknown
			//IL_052b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0532: Expected O, but got Unknown
			//IL_054a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0551: Expected O, but got Unknown
			//IL_0595: 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_05a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b0: Expected O, but got Unknown
			//IL_05b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_05cc: Expected O, but got Unknown
			//IL_05d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_05db: Expected O, but got Unknown
			//IL_05ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_0685: Unknown result type (might be due to invalid IL or missing references)
			//IL_068c: Expected O, but got Unknown
			//IL_06d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_06d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_06eb: Expected O, but got Unknown
			//IL_06ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_06f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_06fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0707: Expected O, but got Unknown
			//IL_070f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0716: Expected O, but got Unknown
			//IL_0728: Unknown result type (might be due to invalid IL or missing references)
			//IL_07bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_07c6: Expected O, but got Unknown
			//IL_07fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0801: Unknown result type (might be due to invalid IL or missing references)
			//IL_080d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0816: Expected O, but got Unknown
			//IL_0818: Unknown result type (might be due to invalid IL or missing references)
			//IL_081d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0829: Unknown result type (might be due to invalid IL or missing references)
			//IL_0832: Expected O, but got Unknown
			//IL_0834: Unknown result type (might be due to invalid IL or missing references)
			//IL_0839: Unknown result type (might be due to invalid IL or missing references)
			//IL_0845: Unknown result type (might be due to invalid IL or missing references)
			//IL_084e: Expected O, but got Unknown
			//IL_0850: Unknown result type (might be due to invalid IL or missing references)
			//IL_0855: Unknown result type (might be due to invalid IL or missing references)
			//IL_0861: Unknown result type (might be due to invalid IL or missing references)
			//IL_086a: Expected O, but got Unknown
			//IL_0872: Unknown result type (might be due to invalid IL or missing references)
			//IL_0879: Expected O, but got Unknown
			//IL_08c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_08cf: Expected O, but got Unknown
			//IL_0906: Unknown result type (might be due to invalid IL or missing references)
			//IL_090b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0917: Unknown result type (might be due to invalid IL or missing references)
			//IL_0920: Expected O, but got Unknown
			//IL_0928: Unknown result type (might be due to invalid IL or missing references)
			//IL_092f: Expected O, but got Unknown
			//IL_095c: Unknown result type (might be due to invalid IL or missing references)
			//IL_09e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_09ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_09fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a06: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a14: Expected O, but got Unknown
			//IL_0a0f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a16: Expected O, but got Unknown
			//IL_0a2d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a34: Expected O, but got Unknown
			//IL_0a6a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a6f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a7b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a84: Expected O, but got Unknown
			//IL_0a86: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a8b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a97: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aa0: Expected O, but got Unknown
			//IL_0aa2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aa7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ab3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0abc: Expected O, but got Unknown
			//IL_0ac4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0acb: Expected O, but got Unknown
			//IL_0b1a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b21: Expected O, but got Unknown
			//IL_0b41: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b46: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b52: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b5b: Expected O, but got Unknown
			//IL_0b63: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b6a: Expected O, but got Unknown
			//IL_0b97: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c24: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c29: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c35: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c41: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c4f: Expected O, but got Unknown
			//IL_0c4a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c51: Expected O, but got Unknown
			try
			{
				GameObject prefab = PrefabManager.Instance.GetPrefab("MeadTasty");
				ItemDrop component = prefab.GetComponent<ItemDrop>();
				StatusEffect obj = Object.Instantiate<StatusEffect>(component.m_itemData.m_shared.m_consumeStatusEffect);
				SE_Stats val = (SE_Stats)(object)((obj is SE_Stats) ? obj : null);
				if ((Object)(object)val != (Object)null)
				{
					((Object)val).name = "se_alcohol";
					((StatusEffect)val).m_cooldown = 3f;
					((StatusEffect)val).m_name = "Tipsy";
					((StatusEffect)val).m_tooltip = "Alcohol is great!";
					val.m_healthOverTime = 0f;
					val.m_staminaRegenMultiplier = 3f;
					val.m_healthRegenMultiplier = 0.5f;
					((StatusEffect)val).m_ttl = 10f;
				}
				CustomStatusEffect val2 = new CustomStatusEffect((StatusEffect)(object)val, false);
				ItemManager.Instance.AddStatusEffect(val2);
				StatusEffect obj2 = Object.Instantiate<StatusEffect>(component.m_itemData.m_shared.m_consumeStatusEffect);
				SE_Stats val3 = (SE_Stats)(object)((obj2 is SE_Stats) ? obj2 : null);
				if ((Object)(object)val3 != (Object)null)
				{
					((Object)val3).name = "Musty";
					((StatusEffect)val3).m_cooldown = 300f;
					((StatusEffect)val3).m_name = "Musty";
					((StatusEffect)val3).m_tooltip = "this feels strange";
					val3.m_healthOverTime = 0f;
					val3.m_staminaRegenMultiplier = 1f;
					val3.m_healthRegenMultiplier = 1f;
					((StatusEffect)val3).m_ttl = 600f;
				}
				CustomStatusEffect val4 = new CustomStatusEffect((StatusEffect)(object)val3, false);
				ItemManager.Instance.AddStatusEffect(val4);
				StatusEffect obj3 = Object.Instantiate<StatusEffect>(component.m_itemData.m_shared.m_consumeStatusEffect);
				SE_Stats val5 = (SE_Stats)(object)((obj3 is SE_Stats) ? obj3 : null);
				if ((Object)(object)val5 != (Object)null)
				{
					((Object)val5).name = "Poozy";
					((StatusEffect)val5).m_cooldown = 600f;
					((StatusEffect)val5).m_name = "Poozy";
					((StatusEffect)val5).m_tooltip = "i have a sinking feeling about this";
					val5.m_healthOverTime = 0f;
					val5.m_staminaRegenMultiplier = 1f;
					val5.m_healthRegenMultiplier = 1f;
					((StatusEffect)val5).m_ttl = 20f;
				}
				CustomStatusEffect val6 = new CustomStatusEffect((StatusEffect)(object)val5, false);
				ItemManager.Instance.AddStatusEffect(val6);
				StatusEffect obj4 = Object.Instantiate<StatusEffect>(component.m_itemData.m_shared.m_consumeStatusEffect);
				SE_Stats val7 = (SE_Stats)(object)((obj4 is SE_Stats) ? obj4 : null);
				if ((Object)(object)val7 != (Object)null)
				{
					((Object)val7).name = "se_juiced";
					((StatusEffect)val7).m_cooldown = 15f;
					((StatusEffect)val7).m_name = "Juiced";
					((StatusEffect)val7).m_tooltip = "S