Decompiled source of SkToolbox v1.10.8

SkToolboxValheim.dll

Decompiled 9 months 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.Threading;
using BepInEx;
using BepInEx.Configuration;
using HarmonyLib;
using SkToolbox.Configuration;
using SkToolbox.SkModules;
using SkToolbox.Utility;
using TMPro;
using UnityEngine;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("SkToolboxValheim")]
[assembly: AssemblyDescription("SkToolbox")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SkToolboxValheim")]
[assembly: AssemblyCopyright("Skrip (DS) Copyright ©  2021")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("8db1269b-91cf-45a1-a52c-7334c87ea75f")]
[assembly: AssemblyFileVersion("1.10.8.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.6.1", FrameworkDisplayName = ".NET Framework 4.6.1")]
[assembly: AssemblyVersion("1.10.8.0")]
namespace SkToolbox
{
	internal static class SkCommandProcessor
	{
		[Flags]
		public enum LogTo
		{
			Console = 0,
			Chat = 1,
			DebugConsole = 2
		}

		internal static class TerrainModification
		{
			private static void CreateTerrain(GameObject prefab, Vector3 position, ZNetView component)
			{
				//IL_000d: Unknown result type (might be due to invalid IL or missing references)
				//IL_000e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0014: Unknown result type (might be due to invalid IL or missing references)
				//IL_0019: Unknown result type (might be due to invalid IL or missing references)
				//IL_001e: Unknown result type (might be due to invalid IL or missing references)
				float levelOffset = prefab.GetComponent<TerrainModifier>().m_levelOffset;
				Object.Instantiate<GameObject>(prefab, position - Vector3.up * levelOffset, Quaternion.identity);
			}

			public static void ModifyTerrain(Vector3 centerLocation, GameObject prefab, float radius)
			{
				//IL_0026: Unknown result type (might be due to invalid IL or missing references)
				//IL_0027: Unknown result type (might be due to invalid IL or missing references)
				//IL_0055: Unknown result type (might be due to invalid IL or missing references)
				//IL_005f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0065: Unknown result type (might be due to invalid IL or missing references)
				//IL_0074: Unknown result type (might be due to invalid IL or missing references)
				//IL_0075: 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_00bf: 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_00cf: Unknown result type (might be due to invalid IL or missing references)
				//IL_00de: Unknown result type (might be due to invalid IL or missing references)
				//IL_00df: Unknown result type (might be due to invalid IL or missing references)
				//IL_0128: Unknown result type (might be due to invalid IL or missing references)
				//IL_0132: Unknown result type (might be due to invalid IL or missing references)
				//IL_0138: Unknown result type (might be due to invalid IL or missing references)
				//IL_0142: Unknown result type (might be due to invalid IL or missing references)
				//IL_014e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0158: 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_0168: Unknown result type (might be due to invalid IL or missing references)
				//IL_0178: Unknown result type (might be due to invalid IL or missing references)
				//IL_0182: Unknown result type (might be due to invalid IL or missing references)
				//IL_0188: Unknown result type (might be due to invalid IL or missing references)
				//IL_0192: Unknown result type (might be due to invalid IL or missing references)
				//IL_019e: Unknown result type (might be due to invalid IL or missing references)
				//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
				//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
				//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
				//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
				//IL_01d7: Unknown result type (might be due to invalid IL or missing references)
				//IL_01dd: Unknown result type (might be due to invalid IL or missing references)
				//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
				//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
				//IL_01fd: Unknown result type (might be due to invalid IL or missing references)
				//IL_0203: Unknown result type (might be due to invalid IL or missing references)
				//IL_020d: Unknown result type (might be due to invalid IL or missing references)
				//IL_021d: 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_022d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0237: Unknown result type (might be due to invalid IL or missing references)
				//IL_0243: Unknown result type (might be due to invalid IL or missing references)
				//IL_024d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0253: Unknown result type (might be due to invalid IL or missing references)
				//IL_025d: Unknown result type (might be due to invalid IL or missing references)
				if (radius > 30f)
				{
					PrintOut("Radius clamped to 30 max!", LogTo.Console);
				}
				radius = Mathf.Clamp(radius, 0f, 30f);
				ZNetView component = ((Component)Player.m_localPlayer).gameObject.GetComponent<ZNetView>();
				int num = Mathf.CeilToInt(radius / 3f) * 3;
				Vector3 val = default(Vector3);
				for (int i = -num; i <= num; i += 3)
				{
					for (int j = -num; j <= num; j += 3)
					{
						((Vector3)(ref val))..ctor(centerLocation.x + (float)i, centerLocation.y, centerLocation.z + (float)j);
						if (Utils.DistanceXZ(centerLocation, val) <= radius)
						{
							CreateTerrain(prefab, val, component);
						}
					}
				}
				int num2 = int.MaxValue;
				int num3 = int.MaxValue;
				Vector3 val2 = default(Vector3);
				for (int k = -num; k <= 0; k++)
				{
					for (int l = -num; l <= -num / 2; l++)
					{
						((Vector3)(ref val2))..ctor(centerLocation.x + (float)k, centerLocation.y, centerLocation.z + (float)l);
						if (!(Utils.DistanceXZ(centerLocation, val2) <= radius))
						{
							continue;
						}
						if (k < l || (l >= num3 && k <= num2 + 2 && k != 0))
						{
							break;
						}
						num2 = k;
						num3 = l;
						if (k / 3 * 3 == k && l / 3 * 3 == l)
						{
							break;
						}
						CreateTerrain(prefab, new Vector3(centerLocation.x + (float)k, centerLocation.y, centerLocation.z + (float)l), component);
						CreateTerrain(prefab, new Vector3(centerLocation.x + (float)k, centerLocation.y, centerLocation.z - (float)l), component);
						if (k != 0)
						{
							CreateTerrain(prefab, new Vector3(centerLocation.x - (float)k, centerLocation.y, centerLocation.z + (float)l), component);
							CreateTerrain(prefab, new Vector3(centerLocation.x - (float)k, centerLocation.y, centerLocation.z - (float)l), component);
						}
						if (k != l)
						{
							CreateTerrain(prefab, new Vector3(centerLocation.x + (float)l, centerLocation.y, centerLocation.z + (float)k), component);
							CreateTerrain(prefab, new Vector3(centerLocation.x - (float)l, centerLocation.y, centerLocation.z + (float)k), component);
							if (k != 0)
							{
								CreateTerrain(prefab, new Vector3(centerLocation.x + (float)l, centerLocation.y, centerLocation.z - (float)k), component);
								CreateTerrain(prefab, new Vector3(centerLocation.x - (float)l, centerLocation.y, centerLocation.z - (float)k), component);
							}
						}
						break;
					}
				}
			}

			public static void ResetTerrain(Vector3 centerLocation, float radius)
			{
				//IL_004e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0059: Unknown result type (might be due to invalid IL or missing references)
				if (radius > 50f)
				{
					PrintOut("Radius clamped to 50 max!", LogTo.Console);
				}
				radius = Mathf.Clamp(radius, 2f, 50f);
				try
				{
					foreach (TerrainModifier allInstance in TerrainModifier.GetAllInstances())
					{
						if ((Object)(object)allInstance != (Object)null && Utils.DistanceXZ(((Component)Player.m_localPlayer).transform.position, ((Component)allInstance).transform.position) < radius)
						{
							ZNetView component = ((Component)allInstance).GetComponent<ZNetView>();
							if ((Object)(object)component != (Object)null && component.IsValid())
							{
								component.ClaimOwnership();
								component.Destroy();
							}
						}
					}
				}
				catch (Exception)
				{
				}
			}
		}

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

			public static Func<KeyValuePair<string, string>, string> <>9__21_0;

			public static Func<KeyValuePair<string, string>, string> <>9__21_1;

			public static Func<KeyValuePair<string, string>, string> <>9__21_2;

			public static ConsoleEvent <>9__24_0;

			public static ConsoleEvent <>9__24_1;

			public static ConsoleEvent <>9__24_2;

			public static ConsoleEvent <>9__24_3;

			public static ConsoleEvent <>9__24_4;

			public static ConsoleEvent <>9__24_5;

			public static ConsoleEvent <>9__24_6;

			public static ConsoleEvent <>9__24_7;

			public static ConsoleEvent <>9__24_8;

			public static ConsoleEvent <>9__24_9;

			public static ConsoleEvent <>9__24_10;

			public static ConsoleEvent <>9__24_11;

			public static Func<string, string> <>9__24_48;

			public static ConsoleEvent <>9__24_12;

			public static ConsoleEvent <>9__24_13;

			public static ConsoleEvent <>9__24_14;

			public static ConsoleEvent <>9__24_15;

			public static ConsoleEvent <>9__24_16;

			public static ConsoleEvent <>9__24_17;

			public static ConsoleEvent <>9__24_18;

			public static ConsoleEvent <>9__24_19;

			public static ConsoleEvent <>9__24_20;

			public static ConsoleEvent <>9__24_21;

			public static ConsoleEvent <>9__24_22;

			public static ConsoleEvent <>9__24_23;

			public static ConsoleEvent <>9__24_24;

			public static ConsoleEvent <>9__24_25;

			public static ConsoleEvent <>9__24_26;

			public static ConsoleEvent <>9__24_27;

			public static ConsoleEvent <>9__24_28;

			public static ConsoleEvent <>9__24_29;

			public static ConsoleEvent <>9__24_30;

			public static ConsoleEvent <>9__24_31;

			public static ConsoleEvent <>9__24_32;

			public static ConsoleEvent <>9__24_33;

			public static ConsoleEvent <>9__24_34;

			public static ConsoleEvent <>9__24_35;

			public static ConsoleEvent <>9__24_36;

			public static ConsoleEvent <>9__24_37;

			public static ConsoleEvent <>9__24_38;

			public static ConsoleEvent <>9__24_39;

			public static ConsoleEvent <>9__24_40;

			public static ConsoleEvent <>9__24_41;

			public static ConsoleEvent <>9__24_42;

			public static ConsoleEvent <>9__24_43;

			public static ConsoleEvent <>9__24_44;

			public static ConsoleEvent <>9__24_45;

			public static ConsoleEvent <>9__24_46;

			public static ConsoleEvent <>9__24_47;

			internal string <Announce>b__21_0(KeyValuePair<string, string> obj)
			{
				return obj.Key;
			}

			internal string <Announce>b__21_1(KeyValuePair<string, string> obj)
			{
				return obj.Key;
			}

			internal string <Announce>b__21_2(KeyValuePair<string, string> obj)
			{
				return obj.Value;
			}

			internal void <InitCommands>b__24_0(ConsoleEventArgs args)
			{
				if (args.Length > 1)
				{
					string text = string.Empty;
					for (int i = 0; i < args.Length; i++)
					{
						text = text + args[i] + " ";
					}
					PrintOut(text, LogTo.Console);
				}
			}

			internal void <InitCommands>b__24_1(ConsoleEventArgs args)
			{
				if (args.Length > 1)
				{
					if (args[1].Equals("1"))
					{
						((Component)((Terminal)Console.instance).m_chatWindow).gameObject.SetActive(true);
						SkConfigEntry.CConsoleEnabled.Value = true;
					}
					else
					{
						((Component)((Terminal)Console.instance).m_chatWindow).gameObject.SetActive(false);
					}
				}
				else
				{
					((Component)((Terminal)Console.instance).m_chatWindow).gameObject.SetActive(!((Component)((Terminal)Console.instance).m_chatWindow).gameObject.activeSelf);
					if (((Component)((Terminal)Console.instance).m_chatWindow).gameObject.activeInHierarchy)
					{
						SkConfigEntry.CConsoleEnabled.Value = true;
					}
				}
			}

			internal void <InitCommands>b__24_2(ConsoleEventArgs args)
			{
				PrintOut("Quitting game...", LogTo.DebugConsole);
				Application.Quit();
			}

			internal void <InitCommands>b__24_3(ConsoleEventArgs args)
			{
				((TMP_Text)((Terminal)Console.instance).m_output).text = string.Empty;
				try
				{
					Console.instance.SetPrivateField("m_chatBuffer", new List<string>());
					ConsoleOpt.consoleOutputHistory.Clear();
				}
				catch (Exception)
				{
				}
			}

			internal void <InitCommands>b__24_4(ConsoleEventArgs args)
			{
				List<ItemData> list = new List<ItemData>();
				((Humanoid)Player.m_localPlayer).GetInventory().GetWornItems(list);
				foreach (ItemData item in list)
				{
					try
					{
						item.m_durability = item.GetMaxDurability();
					}
					catch (Exception)
					{
					}
				}
				PrintOut("All items repaired!");
			}

			internal void <InitCommands>b__24_5(ConsoleEventArgs args)
			{
				PrintOut(ListPortals(), LogTo.Console);
			}

			internal void <InitCommands>b__24_6(ConsoleEventArgs args)
			{
				//IL_0050: Unknown result type (might be due to invalid IL or missing references)
				GameObject prefab = ZNetScene.instance.GetPrefab("digg_v2");
				if ((Object)(object)prefab == (Object)null)
				{
					PrintOut("Terrain level failed. Report to mod author - terrain level error 1");
					return;
				}
				float radius = 5f;
				if (args.Length > 1)
				{
					try
					{
						radius = int.Parse(args[1]);
					}
					catch (Exception)
					{
					}
				}
				TerrainModification.ModifyTerrain(((Component)Player.m_localPlayer).transform.position, prefab, radius);
				PrintOut("Terrain levelled!");
			}

			internal void <InitCommands>b__24_7(ConsoleEventArgs args)
			{
				//IL_002c: Unknown result type (might be due to invalid IL or missing references)
				float radius = 5f;
				if (args.Length > 1)
				{
					try
					{
						radius = int.Parse(args[1]);
					}
					catch (Exception)
					{
					}
				}
				TerrainModification.ResetTerrain(((Component)Player.m_localPlayer).transform.position, radius);
				PrintOut("Terrain reset!");
			}

			internal void <InitCommands>b__24_8(ConsoleEventArgs args)
			{
				//IL_0072: Unknown result type (might be due to invalid IL or missing references)
				//IL_0077: Unknown result type (might be due to invalid IL or missing references)
				//IL_007d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0082: Unknown result type (might be due to invalid IL or missing references)
				GameObject prefab = ZNetScene.instance.GetPrefab("raise");
				if ((Object)(object)prefab == (Object)null)
				{
					PrintOut("Terrain raise failed. Report to mod author - terrain raise error 1");
					return;
				}
				float radius = 5f;
				float num = 2f;
				if (args.Length > 1)
				{
					try
					{
						radius = int.Parse(args[1]);
					}
					catch (Exception)
					{
					}
				}
				if (args.Length > 2)
				{
					try
					{
						num = int.Parse(args[2]);
					}
					catch (Exception)
					{
					}
				}
				TerrainModification.ModifyTerrain(((Component)Player.m_localPlayer).transform.position + Vector3.up * num, prefab, radius);
				PrintOut("Terrain raised!");
			}

			internal void <InitCommands>b__24_9(ConsoleEventArgs args)
			{
				//IL_0072: Unknown result type (might be due to invalid IL or missing references)
				//IL_0077: Unknown result type (might be due to invalid IL or missing references)
				//IL_007d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0082: Unknown result type (might be due to invalid IL or missing references)
				GameObject prefab = ZNetScene.instance.GetPrefab("digg_v2");
				if ((Object)(object)prefab == (Object)null)
				{
					PrintOut("Terrain dig failed. Report to mod author - terrain dig error 1");
					return;
				}
				float radius = 5f;
				float num = 1f;
				if (args.Length > 1)
				{
					try
					{
						radius = int.Parse(args[1]);
					}
					catch (Exception)
					{
					}
				}
				if (args.Length > 2)
				{
					try
					{
						num = int.Parse(args[2]);
					}
					catch (Exception)
					{
					}
				}
				TerrainModification.ModifyTerrain(((Component)Player.m_localPlayer).transform.position - Vector3.up * num, prefab, radius);
				PrintOut("Terrain dug!");
			}

			internal void <InitCommands>b__24_10(ConsoleEventArgs args)
			{
				EnvMan.instance.ResetDebugWind();
				PrintOut("Wind unlocked and under game control.");
			}

			internal void <InitCommands>b__24_11(ConsoleEventArgs args)
			{
				if (args.Length == 3)
				{
					float num = float.Parse(args[1]);
					float num2 = float.Parse(args[2]);
					EnvMan.instance.SetDebugWind(num, num2);
				}
				else
				{
					PrintOut("Failed to set wind. Check parameters! Ex. /wind 240 5");
				}
			}

			internal void <InitCommands>b__24_12(ConsoleEventArgs args)
			{
				if (args.Length == 1)
				{
					foreach (string item in weatherList.OrderBy((string q) => q).ToList())
					{
						PrintOut(item);
					}
					return;
				}
				if (args.Length >= 2)
				{
					if (args[1].Equals("-1"))
					{
						if ((Object)(object)EnvMan.instance != (Object)null)
						{
							EnvMan.instance.m_debugEnv = "";
							PrintOut("Weather unlocked and under game control.");
						}
						return;
					}
					string text = string.Empty;
					if (args.Length > 2)
					{
						string[] args2 = args.Args;
						foreach (string text2 in args2)
						{
							if (!text2.Equals(args[0]))
							{
								text = text + " " + text2;
							}
						}
						text = text.Trim();
					}
					else
					{
						text = args[1];
					}
					if (weatherList.Contains(text))
					{
						if ((Object)(object)EnvMan.instance != (Object)null)
						{
							EnvMan.instance.m_debugEnv = text;
							PrintOut("Weather set to: " + EnvMan.instance.m_debugEnv);
						}
						else
						{
							PrintOut("Failed to set weather to '" + text + "'. Can't find environment manager.");
						}
					}
					else
					{
						PrintOut("Failed to set weather to '" + text + "'. Check parameters! Ex. /env, /env -1, /env Misty");
					}
				}
				else
				{
					PrintOut("Failed to set weather. Check parameters! Ex. /env, /env -1, /env Misty");
				}
			}

			internal string <InitCommands>b__24_48(string q)
			{
				return q;
			}

			internal void <InitCommands>b__24_13(ConsoleEventArgs args)
			{
				flyEnabled = !flyEnabled;
				Player.m_debugMode = flyEnabled;
				Player.m_localPlayer.SetPrivateField("m_debugFly", flyEnabled);
				PrintOut("Fly toggled! (" + flyEnabled + ")");
			}

			internal void <InitCommands>b__24_14(ConsoleEventArgs args)
			{
				altOnScreenControls = !altOnScreenControls;
				PrintOut("Alt controls toggled! (" + altOnScreenControls + ")");
			}

			internal void <InitCommands>b__24_15(ConsoleEventArgs args)
			{
				RandEventSystem.instance.ResetRandomEvent();
				PrintOut("Event stopped!");
			}

			internal void <InitCommands>b__24_16(ConsoleEventArgs args)
			{
				Minimap.instance.ExploreAll();
				PrintOut("Map revealed!");
			}

			internal void <InitCommands>b__24_17(ConsoleEventArgs args)
			{
				string text = string.Empty;
				foreach (ZNetPeer connectedPeer in ZNet.instance.GetConnectedPeers())
				{
					if (connectedPeer != null)
					{
						text = text + ", " + connectedPeer.m_playerName + "(" + connectedPeer.m_uid + ")";
					}
				}
				if (text.Length > 2)
				{
					text = text.Remove(0, 2);
				}
				PrintOut("Active Players (" + Player.GetAllPlayers().Count + ") - " + text);
			}

			internal void <InitCommands>b__24_18(ConsoleEventArgs args)
			{
				//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_019f: Unknown result type (might be due to invalid IL or missing references)
				//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
				//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
				//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
				//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
				//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
				//IL_01d3: Expected O, but got Unknown
				string text = Player.m_localPlayer.GetPlayerName();
				_ = string.Empty;
				int stack = 1;
				int quality = 1;
				if (args.Length == 0)
				{
					PrintOut("Failed. No item provided. /give [Item] [Qty=1] [Player] [Level=1]");
				}
				if (args.Length >= 1)
				{
					_ = args[0];
				}
				if (args.Length == 2)
				{
					try
					{
						stack = int.Parse(args[1]);
					}
					catch (Exception)
					{
					}
				}
				if (args.Length > 2)
				{
					try
					{
						stack = int.Parse(args[1]);
					}
					catch (Exception)
					{
						stack = 1;
					}
				}
				if (args.Length >= 3)
				{
					try
					{
						text = args[2];
					}
					catch (Exception)
					{
					}
				}
				if (args.Length >= 4)
				{
					try
					{
						quality = int.Parse(args[3]);
					}
					catch (Exception)
					{
						quality = 1;
					}
				}
				Player val = null;
				foreach (Player allPlayer in Player.GetAllPlayers())
				{
					if ((Object)(object)allPlayer != (Object)null && allPlayer.GetPlayerName().ToLower().StartsWith(text.ToLower()))
					{
						val = allPlayer;
						break;
					}
				}
				if ((Object)(object)val == (Object)null)
				{
					PrintOut("Failed. Player does not exist. /give [Item] [Qty=1] [Player] [Level=1]");
					return;
				}
				GameObject prefab = ZNetScene.instance.GetPrefab(args[0]);
				if (Object.op_Implicit((Object)(object)prefab))
				{
					PrintOut("Spawning " + stack + " of item " + args[0] + "(" + quality + ") on " + text);
					try
					{
						ItemDrop val2 = (ItemDrop)Object.Instantiate<GameObject>(prefab, ((Component)val).transform.position + ((Component)val).transform.forward * 1.5f + Vector3.up, Quaternion.identity).GetComponent(typeof(ItemDrop));
						if ((Object)(object)val2 != (Object)null && val2.m_itemData != null)
						{
							val2.m_itemData.m_quality = quality;
							val2.m_itemData.m_stack = stack;
							val2.m_itemData.m_durability = val2.m_itemData.GetMaxDurability();
						}
						return;
					}
					catch (Exception ex5)
					{
						PrintOut("Something unexpected failed.");
						SkUtilities.Logz(new string[2] { "ERR", "/give" }, new string[2] { ex5.Message, ex5.Source }, (LogType)2);
						return;
					}
				}
				PrintOut("Failed. Check parameters. /give [Item] [Qty=1] [Player] [Level=1]");
			}

			internal void <InitCommands>b__24_19(ConsoleEventArgs args)
			{
				godEnabled = !godEnabled;
				Player.m_localPlayer.SetGodMode(godEnabled);
				PrintOut("God toggled! (" + godEnabled + ")");
			}

			internal void <InitCommands>b__24_20(ConsoleEventArgs args)
			{
				((Humanoid)Player.m_localPlayer).GetInventory().RemoveAll();
				PrintOut("All items removed from inventory.");
			}

			internal void <InitCommands>b__24_21(ConsoleEventArgs args)
			{
				//IL_0030: Unknown result type (might be due to invalid IL or missing references)
				TombStone[] array = Object.FindObjectsOfType<TombStone>();
				if (array.Length != 0)
				{
					TombStone[] array2 = array;
					foreach (TombStone val in array2)
					{
						if ((Object)(object)val != (Object)null && ((Behaviour)val).enabled)
						{
							Minimap.instance.AddPin(((Component)val).transform.position, (PinType)12, "TS", true, true, 0L, "");
						}
					}
				}
				PrintOut("Tombstone sought out! Potentially " + array.Length + " found.");
			}

			internal void <InitCommands>b__24_22(ConsoleEventArgs args)
			{
				World privateField = WorldGenerator.instance.GetPrivateField<World>("m_world");
				PrintOut("Map seed: " + privateField.m_seedName);
			}

			internal void <InitCommands>b__24_23(ConsoleEventArgs args)
			{
				GameCamera.instance.ToggleFreeFly();
				PrintOut("Free cam toggled " + GameCamera.InFreeFly());
			}

			internal void <InitCommands>b__24_24(ConsoleEventArgs args)
			{
				if (args.Length > 1)
				{
					foreach (Player allPlayer in Player.GetAllPlayers())
					{
						if ((Object)(object)allPlayer != (Object)null && allPlayer.GetPlayerName().ToLower().Equals(args[1].ToLower()))
						{
							((Character)allPlayer).Heal(((Character)allPlayer).GetMaxHealth(), true);
							PrintOut("Player healed: " + allPlayer.GetPlayerName());
						}
					}
					return;
				}
				((Character)Player.m_localPlayer).Heal(((Character)Player.m_localPlayer).GetMaxHealth(), true);
				PrintOut("Self healed.");
			}

			internal void <InitCommands>b__24_25(ConsoleEventArgs args)
			{
				SkCommandPatcher.InitPatch();
				SkCommandPatcher.bBuildAnywhere = !SkCommandPatcher.bBuildAnywhere;
				PrintOut("No build restrictions toggled! (" + SkCommandPatcher.bBuildAnywhere + ")");
			}

			internal void <InitCommands>b__24_26(ConsoleEventArgs args)
			{
				noCostEnabled = !noCostEnabled;
				Player.m_debugMode = noCostEnabled;
				Player.m_localPlayer.SetPrivateField("m_noPlacementCost", noCostEnabled);
				PrintOut("No build cost/requirements toggled! (" + noCostEnabled + ")");
			}

			internal void <InitCommands>b__24_27(ConsoleEventArgs args)
			{
				//IL_005c: Unknown result type (might be due to invalid IL or missing references)
				//IL_008a: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
				if (args.Length != 2 || !args[1].Contains(","))
				{
					PrintOut("Syntax /tp X,Z");
					return;
				}
				try
				{
					string[] array = args[1].Split(new char[1] { ',' });
					float num = float.Parse(array[0]);
					float num2 = float.Parse(array[1]);
					float groundHeight = ZoneSystem.instance.GetGroundHeight(new Vector3(num, 750f, num2));
					groundHeight = Mathf.Clamp(groundHeight, 0f, 100f);
					if (groundHeight > 99f)
					{
						groundHeight = ((Component)Player.m_localPlayer).transform.position.y;
					}
					Player localPlayer = Player.m_localPlayer;
					if (Object.op_Implicit((Object)(object)localPlayer))
					{
						Vector3 val = default(Vector3);
						((Vector3)(ref val))..ctor(num, groundHeight, num2);
						((Character)localPlayer).TeleportTo(val, ((Component)localPlayer).transform.rotation, false);
						PrintOut("Teleporting...");
					}
				}
				catch (Exception)
				{
					PrintOut("Syntax /tp X,Z");
				}
			}

			internal void <InitCommands>b__24_28(ConsoleEventArgs args)
			{
				bDetectEnemies = !bDetectEnemies;
				if (args.Length > 0)
				{
					try
					{
						bDetectRange = int.Parse(args[1]);
						bDetectRange = ((bDetectRange < 5) ? 5 : bDetectRange);
					}
					catch (Exception)
					{
						bDetectRange = 20;
					}
				}
				PrintOut("Detect enemies toggled! (" + bDetectEnemies + ", range: " + bDetectRange + ")");
			}

			internal void <InitCommands>b__24_29(ConsoleEventArgs args)
			{
				SkCommandPatcher.InitPatch();
				SkCommandPatcher.BCheat = !SkCommandPatcher.BCheat;
				if ((Object)(object)Player.m_localPlayer != (Object)null)
				{
					try
					{
						Player.m_localPlayer.SetPrivateField("m_debugMode", SkCommandPatcher.BCheat);
						Console.instance.SetPrivateField("m_cheat", SkCommandPatcher.BCheat);
					}
					catch (Exception)
					{
					}
				}
				PrintOut("Cheats toggled! (" + SkCommandPatcher.BCheat + ")");
			}

			internal void <InitCommands>b__24_30(ConsoleEventArgs args)
			{
				SkCommandPatcher.InitPatch();
				SkCommandPatcher.BFreeSupport = !SkCommandPatcher.BFreeSupport;
				PrintOut("No build support requirements toggled! (" + SkCommandPatcher.BFreeSupport + ")");
			}

			internal void <InitCommands>b__24_31(ConsoleEventArgs args)
			{
				bCoords = !bCoords;
				PrintOut("Show coords toggled! (" + bCoords + ")");
			}

			internal void <InitCommands>b__24_32(ConsoleEventArgs args)
			{
				Minimap.instance.Reset();
			}

			internal void <InitCommands>b__24_33(ConsoleEventArgs args)
			{
				infStamina = !infStamina;
				if (infStamina)
				{
					Player.m_localPlayer.m_staminaRegenDelay = 0.05f;
					Player.m_localPlayer.m_staminaRegen = 999f;
					Player.m_localPlayer.m_runStaminaDrain = 0f;
					Player.m_localPlayer.SetMaxStamina(9999f, true);
				}
				else
				{
					Player.m_localPlayer.m_staminaRegenDelay = 1f;
					Player.m_localPlayer.m_staminaRegen = 5f;
					Player.m_localPlayer.m_runStaminaDrain = 10f;
					Player.m_localPlayer.SetMaxStamina(100f, true);
				}
				PrintOut("Infinite stamina toggled! (" + infStamina + ")");
			}

			internal void <InitCommands>b__24_34(ConsoleEventArgs args)
			{
				//IL_000a: Unknown result type (might be due to invalid IL or missing references)
				Tameable.TameAllInArea(((Component)Player.m_localPlayer).transform.position, 20f);
				PrintOut("Creatures tamed!");
			}

			internal void <InitCommands>b__24_35(ConsoleEventArgs args)
			{
				farInteract = !farInteract;
				if (farInteract)
				{
					if (args.Length > 1)
					{
						try
						{
							int num = ((int.Parse(args[1]) < 20) ? 20 : int.Parse(args[1]));
							Player.m_localPlayer.m_maxInteractDistance = num;
							Player.m_localPlayer.m_maxPlaceDistance = num;
						}
						catch (Exception)
						{
							PrintOut("Failed to set far interaction distance. Check params. /farinteract 50");
						}
					}
					else
					{
						Player.m_localPlayer.m_maxInteractDistance = 50f;
						Player.m_localPlayer.m_maxPlaceDistance = 50f;
					}
					PrintOut("Far interactions toggled! (" + farInteract + " Distance: " + Player.m_localPlayer.m_maxInteractDistance + ")");
				}
				else
				{
					Player.m_localPlayer.m_maxInteractDistance = 5f;
					Player.m_localPlayer.m_maxPlaceDistance = 5f;
					PrintOut("Far interactions toggled! (" + farInteract + ")");
				}
			}

			internal void <InitCommands>b__24_36(ConsoleEventArgs args)
			{
				Player.m_localPlayer.SetGhostMode(!((Character)Player.m_localPlayer).InGhostMode());
				PrintOut("Ghost mode toggled! (" + ((Character)Player.m_localPlayer).InGhostMode() + ")");
			}

			internal void <InitCommands>b__24_37(ConsoleEventArgs args)
			{
				if (args.Length > 1)
				{
					if (float.TryParse(args[1], NumberStyles.Float, CultureInfo.InvariantCulture, out var result))
					{
						if (result < 0f)
						{
							EnvMan.instance.m_debugTimeOfDay = false;
							PrintOut("Time unlocked and under game control.");
						}
						else
						{
							EnvMan.instance.m_debugTimeOfDay = true;
							EnvMan.instance.m_debugTime = Mathf.Clamp01(result);
							PrintOut("Setting time of day:" + result);
						}
					}
				}
				else
				{
					PrintOut("Failed. Syntax /tod [0-1] Ex. /tod 0.5");
				}
			}

			internal void <InitCommands>b__24_38(ConsoleEventArgs args)
			{
				TerrainComp.UpgradeTerrain();
			}

			internal void <InitCommands>b__24_39(ConsoleEventArgs args)
			{
				if (args.Length <= 1)
				{
					return;
				}
				if (args[1].Equals("cw"))
				{
					try
					{
						int num = int.Parse(args[2]);
						Player.m_localPlayer.m_maxCarryWeight = num;
						PrintOut("New carry weight set to: " + num);
						return;
					}
					catch (Exception)
					{
						PrintOut("Failed to set new carry weight. Check params.");
						return;
					}
				}
				if (args[1].Equals("skill"))
				{
					if (args.Length == 4 && !args[2].Contains("None") && !args[2].Contains("All") && !args[2].Contains("FireMagic") && !args[2].Contains("FrostMagic"))
					{
						try
						{
							string text = args[2];
							int num2 = int.Parse(args[3]);
							((Character)Player.m_localPlayer).GetSkills().CheatResetSkill(text.ToLower());
							((Character)Player.m_localPlayer).GetSkills().CheatRaiseSkill(text.ToLower(), (float)num2, true);
							return;
						}
						catch (Exception)
						{
							PrintOut("Failed to set skill. Check params / skill name. See /listskills. /set skill [skill] [level]");
							return;
						}
					}
					PrintOut("Failed to set skill. Check params / skill name. See /listskills.  /set skill [skill] [level]");
				}
				else if (args[1].Equals("pickup"))
				{
					if (args.Length >= 3)
					{
						try
						{
							int num3 = int.Parse(args[2]);
							Player.m_localPlayer.m_autoPickupRange = num3;
							PrintOut("New range set to: " + num3);
							return;
						}
						catch (Exception)
						{
							PrintOut("Failed to set pickup range. Check params. /set pickup 2");
							return;
						}
					}
					PrintOut("Failed to set pickup range. Check params.  /set pickup 2");
				}
				else if (args[1].Equals("jumpforce"))
				{
					if (args.Length >= 3)
					{
						try
						{
							int num4 = int.Parse(args[2]);
							((Character)Player.m_localPlayer).m_jumpForce = num4;
							PrintOut("New range set to: " + num4);
							return;
						}
						catch (Exception)
						{
							PrintOut("Failed to set jump force. Check params. /set jumpforce 10");
							return;
						}
					}
					PrintOut("Failed to set jump force. Check params.  /set jumpforce 10");
				}
				else if (args[1].Equals("exploreradius"))
				{
					if (args.Length >= 3)
					{
						try
						{
							int num5 = int.Parse(args[2]);
							Minimap.instance.m_exploreRadius = num5;
							PrintOut("New range set to: " + num5);
							return;
						}
						catch (Exception)
						{
							PrintOut("Failed to set explore radius. Check params. /set exploreradius 100");
							return;
						}
					}
					PrintOut("Failed to set explore radius. Check params.  /set exploreradius 100");
				}
				else if (args[1].Equals("speed"))
				{
					if (args.Length >= 4)
					{
						string text2 = args[2];
						if (new string[3] { "crouch", "run", "swim" }.Contains(text2))
						{
							float num6 = 0f;
							try
							{
								int num7 = int.Parse(args[3]);
								switch (text2)
								{
								case "crouch":
									num6 = ((Character)Player.m_localPlayer).m_crouchSpeed;
									((Character)Player.m_localPlayer).m_crouchSpeed = num7;
									break;
								case "run":
									num6 = ((Character)Player.m_localPlayer).m_runSpeed;
									((Character)Player.m_localPlayer).m_runSpeed = num7;
									break;
								case "swim":
									num6 = ((Character)Player.m_localPlayer).m_swimSpeed;
									((Character)Player.m_localPlayer).m_swimSpeed = num7;
									break;
								}
								PrintOut("New " + text2 + " speed set to: " + num7 + " (was: " + num6 + ")");
								return;
							}
							catch (Exception)
							{
								PrintOut("Failed to set speed. Check params name. Ex. /set speed crouch 2");
								return;
							}
						}
						PrintOut("Failed to set speed. Check params name. Ex.  /set speed crouch 2");
					}
					else
					{
						PrintOut("Failed to set speed. Check params name. Ex.  /set speed crouch 2");
					}
				}
				else
				{
					if (!args[1].Equals("difficulty"))
					{
						return;
					}
					if (args.Length >= 3)
					{
						try
						{
							int forcePlayerDifficulty = int.Parse(args[2]);
							Game.instance.SetForcePlayerDifficulty(forcePlayerDifficulty);
							PrintOut("Difficulty set to " + forcePlayerDifficulty);
							return;
						}
						catch (Exception)
						{
							PrintOut("Failed to set difficulty. Check params. /set difficulty 5");
							return;
						}
					}
					PrintOut("Failed to set difficulty. Check params.  /set difficulty 5");
				}
			}

			internal void <InitCommands>b__24_40(ConsoleEventArgs args)
			{
				ItemDrop[] array = Object.FindObjectsOfType<ItemDrop>();
				for (int i = 0; i < array.Length; i++)
				{
					ZNetView component = ((Component)array[i]).GetComponent<ZNetView>();
					if (Object.op_Implicit((Object)(object)component))
					{
						component.Destroy();
					}
				}
				PrintOut("Items cleared.");
			}

			internal void <InitCommands>b__24_41(ConsoleEventArgs args)
			{
				//IL_0026: Unknown result type (might be due to invalid IL or missing references)
				//IL_0035: Unknown result type (might be due to invalid IL or missing references)
				//IL_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)
				((Terminal)Console.instance).TryRunCommand("/spawntamed " + args.FullLine, false, false);
				Tameable.TameAllInArea(((Component)Player.m_localPlayer).transform.position + ((Component)Player.m_localPlayer).transform.forward * 1.5f, 1f);
			}

			internal void <InitCommands>b__24_42(ConsoleEventArgs args)
			{
				//IL_0161: Unknown result type (might be due to invalid IL or missing references)
				//IL_0050: Unknown result type (might be due to invalid IL or missing references)
				//IL_0061: Unknown result type (might be due to invalid IL or missing references)
				//IL_0070: Unknown result type (might be due to invalid IL or missing references)
				//IL_007a: Unknown result type (might be due to invalid IL or missing references)
				//IL_007f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0084: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f5: Expected O, but got Unknown
				ZNetView[] array = Object.FindObjectsOfType<ZNetView>();
				if (array.Length == 0)
				{
					PrintOut("Couldn't find zdo...");
				}
				if (args.Length <= 1)
				{
					return;
				}
				GameObject prefab = ZNetScene.instance.GetPrefab(args[1]);
				if ((Object)(object)prefab == (Object)null)
				{
					PrintOut("Creature not found.");
					return;
				}
				_ = ((Component)Player.m_localPlayer).transform.position;
				GameObject val = Object.Instantiate<GameObject>(prefab, ((Component)Player.m_localPlayer).transform.position + ((Component)Player.m_localPlayer).transform.forward * 1.5f, Quaternion.identity);
				ZNetView component = val.GetComponent<ZNetView>();
				val.GetComponent<BaseAI>();
				if (args.Length > 2)
				{
					try
					{
						Character component2 = val.GetComponent<Character>();
						if ((Object)(object)component2 != (Object)null)
						{
							int num = int.Parse(args[2]);
							if (num > 10)
							{
								num = 10;
							}
							component2.SetLevel(num);
						}
						else
						{
							ItemDrop val2 = (ItemDrop)val.GetComponent(typeof(ItemDrop));
							if ((Object)(object)val2 != (Object)null && val2.m_itemData != null)
							{
								val2.m_itemData.m_quality = 1;
								val2.m_itemData.m_stack = int.Parse(args[2]);
								val2.m_itemData.m_durability = val2.m_itemData.GetMaxDurability();
							}
						}
					}
					catch (Exception)
					{
					}
				}
				if (array.Length != 0)
				{
					try
					{
						array[0].GetZDO().Set("spawn_id", component.GetZDO().m_uid);
						array[0].GetZDO().Set("alive_time", ZNet.instance.GetTime().Ticks);
					}
					catch (Exception)
					{
					}
				}
				PrintOut("Spawned - " + args[1]);
			}

			internal void <InitCommands>b__24_43(ConsoleEventArgs args)
			{
				//IL_0010: Unknown result type (might be due to invalid IL or missing references)
				//IL_0039: Unknown result type (might be due to invalid IL or missing references)
				//IL_003f: Expected O, but got Unknown
				List<Character> list = new List<Character>();
				Character.GetCharactersInRange(((Component)Player.m_localPlayer).transform.position, 50f, list);
				foreach (Character item in list)
				{
					if (!item.IsPlayer())
					{
						HitData val = new HitData();
						val.m_damage.m_damage = 1E+10f;
						item.Damage(val);
					}
				}
				PrintOut("Nearby creatures killed! (50m)");
			}

			internal void <InitCommands>b__24_44(ConsoleEventArgs args)
			{
				if (args.Length > 1)
				{
					foreach (GameObject item in ObjectDB.instance.m_items)
					{
						ItemDrop component = item.GetComponent<ItemDrop>();
						if (((Object)component).name.ToLower().Contains(args[1].ToLower()))
						{
							PrintOut("Item: '" + ((Object)component).name + "'", LogTo.DebugConsole);
						}
					}
					return;
				}
				foreach (GameObject item2 in ObjectDB.instance.m_items)
				{
					ItemDrop component2 = item2.GetComponent<ItemDrop>();
					PrintOut("Item: '" + ((Object)component2).name + "'", LogTo.DebugConsole);
				}
			}

			internal void <InitCommands>b__24_45(ConsoleEventArgs args)
			{
				ConsoleOpt.BuildPrefabs();
				if (args.Length > 1)
				{
					foreach (string prefab in ConsoleOpt.PrefabList)
					{
						if (prefab.ToLower().StartsWith(args[1].ToLower()))
						{
							PrintOut("Prefab: '" + prefab + "'", LogTo.DebugConsole);
						}
					}
					return;
				}
				foreach (string prefab2 in ConsoleOpt.PrefabList)
				{
					PrintOut("Prefab: '" + prefab2 + "'", LogTo.DebugConsole);
				}
			}

			internal void <InitCommands>b__24_46(ConsoleEventArgs args)
			{
				string text = "Skills found: ";
				foreach (object value in Enum.GetValues(typeof(SkillType)))
				{
					if (!value.ToString().Contains("None") && !value.ToString().Contains("All") && !value.ToString().Contains("FireMagic") && !value.ToString().Contains("FrostMagic"))
					{
						text = text + value.ToString() + ", ";
					}
				}
				text = text.Remove(text.Length - 2);
				PrintOut(text, LogTo.DebugConsole);
			}

			internal void <InitCommands>b__24_47(ConsoleEventArgs args)
			{
				((Terminal)Console.instance).TryRunCommand("help", false, false);
			}
		}

		public static bool flyEnabled = false;

		public static bool godEnabled = false;

		public static bool farInteract = false;

		public static bool infStamina = false;

		public static bool noCostEnabled = false;

		public static bool bTeleport = false;

		public static bool bDebugTime = false;

		public static bool bDetectEnemies = false;

		public static bool btDetectEnemiesSwitch = true;

		public static int bDetectRange = 20;

		public static bool altOnScreenControls = false;

		public static bool bCoords = false;

		public static int pageSize = 11;

		private static Vector3 chatPos = new Vector3(0f, -99f);

		private static ModConsole consoleOpt = null;

		public static List<string> weatherList = new List<string>
		{
			"Twilight_Clear", "Clear", "Misty", "Darklands_dark", "Heath clear", "DeepForest Mist", "GDKing", "Rain", "LightRain", "ThunderStorm",
			"Eikthyr", "GoblinKing", "nofogts", "SwampRain", "Bonemass", "Snow", "Twilight_Snow", "Twilight_SnowStorm", "SnowStorm", "Moder",
			"Ashrain", "Crypt", "SunkenCrypt"
		};

		public static Dictionary<string, string> commandList = new Dictionary<string, string>
		{
			{
				"/alt",
				"- Use alternate on-screen controls. Press '" + ((SkConfigEntry.OAltToggle == null) ? "Home" : SkConfigEntry.OAltToggle.Value) + "' to toggle if active."
			},
			{ "/console", "[1/0] - Toggle the console. No parameter with toggle. 1 = Open, 0 = Closed. Intended for use with hotkeys and aliases." },
			{ "/coords", "- Show coords in corner of the screen" },
			{ "/clear", "- Clear the current output shown in the console" },
			{ "/clearinventory", "- Removes all items from your inventory. There is no confirmation, be careful." },
			{ "/detect", "[Range=20] - Toggle enemy detection" },
			{ "/farinteract", "[Distance=50] - Toggles far interactions (building as well). To change distance, toggle this off then back on with new distance" },
			{ "/echo", "[Text] - Echo the text back to the console. This is intended for use with aliases and the autorun features." },
			{ "/env", "[Weather] - Change the weather. No parameter provided will list all weather. -1 will allow the game to control the weather again." },
			{ "/findtomb", "- Pin nearby dead player tombstones on the map if any currently exist" },
			{ "/fly", "- Toggle flying" },
			{ "/freecam", "- Toggle freecam" },
			{ "/ghost", "- Toggle Ghostmode (enemy creatures cannot see you)" },
			{ "/give", "[Item] [Qty=1], OR /give [Item] [Qty=1] [Player] [Level=1] - Gives item to player. If player has a space in name, only provide name before the space. Capital letters matter in item / player name!" },
			{ "/god", "- Toggle Godmode" },
			{ "/heal", "[Player=local] - Heal Player" },
			{ "/imacheater", "- Use the toolbox to force enable standard cheats on any server" },
			{ "/infstam", "- Toggles infinite stamina" },
			{ "/killall", "- Kills all nearby creatures" },
			{ "/listitems", "[Name Contains] - List all items. Optionally include name starts with. Ex. /listitems Woo returns any item that contains the letters 'Woo'" },
			{ "/listprefabs", "[Name Contains] - Lists all prefabs - List all prefabs/creatures. Optionally include name starts with. Ex. /listprefabs Troll returns any prefab that starts with the letters 'Troll'" },
			{ "/listskills", "- Lists all skills" },
			{ "/nocost", "- Toggle no requirement building" },
			{ "/nores", "- Toggle no restrictions to where you can build (except ward zones)" },
			{ "/nosup", "- Toggle no supports required for buildings - WARNING! - IF YOU REJOIN AND THIS IS DISABLED, YOUR STRUCTURES MAY FALL APART - USE WITH CARE. Maybe use the AutoRun functionality?" },
			{ "/optterrain", "- Optimize old terrain modifications" },
			{ "/portals", "- List all portal tags" },
			{ "/removedrops", "- Removes items from the ground" },
			{ "/resetwind", "- If wind has been set, this will allow the game to take control of the wind again" },
			{ "/repair", "- Repair your inventory" },
			{ "/resetmap", "- Reset the map exploration" },
			{ "/revealmap", "- Reveals the entire minimap" },
			{ "/q", "- Quickly exit the game. Commands are sometimes just more convenient." },
			{ "/seed", "- Reveals the map seed" },
			{ "/set cw", "[Weight] - Set your weight limit (default 300)" },
			{ "/set difficulty", "[Player Count] - Set the difficulty (default is number of connected players)" },
			{ "/set exploreradius", "[Radius=100] - Set the explore radius" },
			{ "/set jumpforce", "[Force] - Set jump force (default 10). Careful if you fall too far!" },
			{ "/set pickup", "[Radius] - Set your auto pickup radius (default 2)" },
			{ "/set skill", "[Skill] [Level] - Set your skill level" },
			{ "/set speed", "[Speed Type] [Speed] - Speed Types: crouch (def: 2), run (def: 7), swim (def: 2)" },
			{ "/td", "[Radius=5] [Height=1] - Dig nearby terrain. Radius 30 max." },
			{ "/tl", "[Radius=5] - Level nearby terrain. Radius 30 max." },
			{ "/tr", "[Radius=5] [Height=1] - Raise nearby terrain. Radius 30 max." },
			{ "/tu", "[Radius=5] - Undo terrain modifications around you. Radius 50 max." },
			{ "/spawn", "[Creature Name] [Level=1] - Spawns a creature or prefab in front of you. Capitals in name matter! Ex. /spawn Boar 3 (use /give for items!)" },
			{ "/spawntamed", "[Creature Name] [Level=1] - Spawns a tamed creature in front of you. Capitals in name matter! Ex. /spawntamed Boar 3" },
			{ "/stopevent", "- Stops a current event" },
			{ "/tame", "- Tame all nearby creatures" },
			{ "/tod", "[0-1] - Set (and lock) time of day (-1 to unlock time) - Ex. /tod 0.5" },
			{ "/tp", "[X,Y] - Teleport you to the coords provided" },
			{ "/wind", "[Angle] [Intensity] - Set the wind direction and intensity" },
			{ "/whois", "- List all players" }
		};

		internal static ModConsole ConsoleOpt
		{
			get
			{
				return consoleOpt;
			}
			set
			{
				consoleOpt = value;
			}
		}

		public static void Announce()
		{
			if ((SkConfigEntry.CScrollable != null) & !SkConfigEntry.CScrollable.Value)
			{
				if (SkVersionChecker.VersionCurrent())
				{
					PrintOut("====  Toolbox (" + SkVersionChecker.currentVersion?.ToString() + ") by Skrip (DS) is enabled.\t\t====", LogTo.Console);
				}
				else
				{
					PrintOut("Toolbox by Skrip (DS) is enabled.", LogTo.Console);
					PrintOut("New Version Available on NexusMods!\t► Current: " + SkVersionChecker.currentVersion?.ToString() + " Latest: " + SkVersionChecker.latestVersion, LogTo.DebugConsole);
				}
				PrintOut("====  Press numpad 0 to open on-screen menu or type /? 1\t====", LogTo.Console);
			}
			try
			{
				commandList = commandList.OrderBy((KeyValuePair<string, string> obj) => obj.Key).ToDictionary((KeyValuePair<string, string> obj) => obj.Key, (KeyValuePair<string, string> obj) => obj.Value);
				weatherList.Sort();
				SkCommandPatcher.InitPatch();
			}
			catch (Exception)
			{
			}
		}

		public static string DecomposeAlias(string inCommand)
		{
			string[] array = inCommand.Split(new char[1] { ';' });
			string text = inCommand;
			if ((Object)(object)ConsoleOpt != (Object)null && ConsoleOpt.AliasList != null && ConsoleOpt.AliasList.Count > 0)
			{
				for (int i = 0; i < array.Length; i++)
				{
					if (!string.IsNullOrEmpty(array[i]))
					{
						array[i] = array[i].Trim();
					}
					if (ConsoleOpt.AliasList.Keys.Contains(array[i]))
					{
						string value = string.Empty;
						ConsoleOpt.AliasList.TryGetValue(array[i], out value);
						value = value.Trim();
						if (value.EndsWith(";"))
						{
							value = value.Substring(0, value.Length - 1);
						}
						array[i] = value;
					}
				}
				text = string.Empty;
				string[] array2 = array;
				foreach (string text2 in array2)
				{
					text = ((array.Length <= 1) ? (text + text2) : (text + text2 + ";"));
				}
			}
			return text;
		}

		public static void ProcessCommands(string inCommand, LogTo source, GameObject go = null)
		{
			if (string.IsNullOrEmpty(inCommand))
			{
				return;
			}
			if ((Object)(object)Console.instance != (Object)null)
			{
				Console.instance.SetPrivateField("m_lastEntry", inCommand);
			}
			inCommand = inCommand.Trim();
			inCommand = DecomposeAlias(inCommand);
			string[] array = inCommand.Split(new char[1] { ';' });
			for (int i = 0; i < array.Length; i++)
			{
				string text = array[i].Trim();
				if (!string.IsNullOrEmpty(text))
				{
					((Terminal)Console.instance).TryRunCommand(text, false, false);
				}
			}
			((TMP_InputField)((Terminal)Console.instance).m_input).text = string.Empty;
		}

		public static void InitCommands()
		{
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Expected O, but got Unknown
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Expected O, but got Unknown
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Expected O, but got Unknown
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Expected O, but got Unknown
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Expected O, but got Unknown
			//IL_015a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_014b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0151: Expected O, but got Unknown
			//IL_0192: Unknown result type (might be due to invalid IL or missing references)
			//IL_017e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0183: Unknown result type (might be due to invalid IL or missing references)
			//IL_0189: Expected O, but got Unknown
			//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c1: Expected O, but got Unknown
			//IL_0202: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f9: Expected O, but got Unknown
			//IL_023a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0226: Unknown result type (might be due to invalid IL or missing references)
			//IL_022b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0231: Expected O, but got Unknown
			//IL_0272: Unknown result type (might be due to invalid IL or missing references)
			//IL_025e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0263: Unknown result type (might be due to invalid IL or missing references)
			//IL_0269: Expected O, but got Unknown
			//IL_02aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0296: Unknown result type (might be due to invalid IL or missing references)
			//IL_029b: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a1: Expected O, but got Unknown
			//IL_02e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d9: Expected O, but got Unknown
			//IL_031a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0306: Unknown result type (might be due to invalid IL or missing references)
			//IL_030b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0311: Expected O, but got Unknown
			//IL_0374: Unknown result type (might be due to invalid IL or missing references)
			//IL_0360: Unknown result type (might be due to invalid IL or missing references)
			//IL_0365: Unknown result type (might be due to invalid IL or missing references)
			//IL_036b: Expected O, but got Unknown
			//IL_03ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_0398: Unknown result type (might be due to invalid IL or missing references)
			//IL_039d: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a3: Expected O, but got Unknown
			//IL_03e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03db: Expected O, but got Unknown
			//IL_041c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0408: Unknown result type (might be due to invalid IL or missing references)
			//IL_040d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0413: Expected O, but got Unknown
			//IL_0454: Unknown result type (might be due to invalid IL or missing references)
			//IL_0440: Unknown result type (might be due to invalid IL or missing references)
			//IL_0445: Unknown result type (might be due to invalid IL or missing references)
			//IL_044b: Expected O, but got Unknown
			//IL_048c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0478: Unknown result type (might be due to invalid IL or missing references)
			//IL_047d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0483: Expected O, but got Unknown
			//IL_04c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_04bb: Expected O, but got Unknown
			//IL_04fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f3: Expected O, but got Unknown
			//IL_0534: Unknown result type (might be due to invalid IL or missing references)
			//IL_0520: Unknown result type (might be due to invalid IL or missing references)
			//IL_0525: Unknown result type (might be due to invalid IL or missing references)
			//IL_052b: Expected O, but got Unknown
			//IL_056c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0558: Unknown result type (might be due to invalid IL or missing references)
			//IL_055d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0563: Expected O, but got Unknown
			//IL_05a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0590: Unknown result type (might be due to invalid IL or missing references)
			//IL_0595: Unknown result type (might be due to invalid IL or missing references)
			//IL_059b: Expected O, but got Unknown
			//IL_05dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_05cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d3: Expected O, but got Unknown
			//IL_0614: Unknown result type (might be due to invalid IL or missing references)
			//IL_0600: Unknown result type (might be due to invalid IL or missing references)
			//IL_0605: Unknown result type (might be due to invalid IL or missing references)
			//IL_060b: Expected O, but got Unknown
			//IL_064c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0638: Unknown result type (might be due to invalid IL or missing references)
			//IL_063d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0643: Expected O, but got Unknown
			//IL_0684: Unknown result type (might be due to invalid IL or missing references)
			//IL_0670: Unknown result type (might be due to invalid IL or missing references)
			//IL_0675: Unknown result type (might be due to invalid IL or missing references)
			//IL_067b: Expected O, but got Unknown
			//IL_06bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_06a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_06b3: Expected O, but got Unknown
			//IL_06f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_06eb: Expected O, but got Unknown
			//IL_072c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0718: Unknown result type (might be due to invalid IL or missing references)
			//IL_071d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0723: Expected O, but got Unknown
			//IL_0764: Unknown result type (might be due to invalid IL or missing references)
			//IL_0750: Unknown result type (might be due to invalid IL or missing references)
			//IL_0755: Unknown result type (might be due to invalid IL or missing references)
			//IL_075b: Expected O, but got Unknown
			//IL_079c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0788: Unknown result type (might be due to invalid IL or missing references)
			//IL_078d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0793: Expected O, but got Unknown
			//IL_07d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_07c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_07c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_07cb: Expected O, but got Unknown
			//IL_080c: Unknown result type (might be due to invalid IL or missing references)
			//IL_07f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_07fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0803: Expected O, but got Unknown
			//IL_0844: Unknown result type (might be due to invalid IL or missing references)
			//IL_0830: Unknown result type (might be due to invalid IL or missing references)
			//IL_0835: Unknown result type (might be due to invalid IL or missing references)
			//IL_083b: Expected O, but got Unknown
			//IL_087c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0868: Unknown result type (might be due to invalid IL or missing references)
			//IL_086d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0873: Expected O, but got Unknown
			//IL_08b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_08a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_08a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_08ab: Expected O, but got Unknown
			//IL_08ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_08d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_08dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_08e3: Expected O, but got Unknown
			//IL_0924: Unknown result type (might be due to invalid IL or missing references)
			//IL_0910: Unknown result type (might be due to invalid IL or missing references)
			//IL_0915: Unknown result type (might be due to invalid IL or missing references)
			//IL_091b: Expected O, but got Unknown
			//IL_095c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0948: Unknown result type (might be due to invalid IL or missing references)
			//IL_094d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0953: Expected O, but got Unknown
			//IL_0994: Unknown result type (might be due to invalid IL or missing references)
			//IL_0980: Unknown result type (might be due to invalid IL or missing references)
			//IL_0985: Unknown result type (might be due to invalid IL or missing references)
			//IL_098b: Expected O, but got Unknown
			//IL_09cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_09b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_09bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_09c3: Expected O, but got Unknown
			//IL_0a04: Unknown result type (might be due to invalid IL or missing references)
			//IL_09f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_09f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_09fb: Expected O, but got Unknown
			//IL_0a3c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a28: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a2d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a33: Expected O, but got Unknown
			//IL_0a74: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a60: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a65: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a6b: Expected O, but got Unknown
			//IL_0aac: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a98: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a9d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aa3: Expected O, but got Unknown
			if (!((Object)(object)Console.instance != (Object)null))
			{
				return;
			}
			object obj = <>c.<>9__24_0;
			if (obj == null)
			{
				ConsoleEvent val = delegate(ConsoleEventArgs args)
				{
					if (args.Length > 1)
					{
						string text9 = string.Empty;
						for (int l = 0; l < args.Length; l++)
						{
							text9 = text9 + args[l] + " ";
						}
						PrintOut(text9, LogTo.Console);
					}
				};
				<>c.<>9__24_0 = val;
				obj = (object)val;
			}
			new ConsoleCommand("echo", "Echo the text back to the console. This is intended for use with aliases and the autorun features. (SkToolbox)", (ConsoleEvent)obj, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false);
			object obj2 = <>c.<>9__24_1;
			if (obj2 == null)
			{
				ConsoleEvent val2 = delegate(ConsoleEventArgs args)
				{
					if (args.Length > 1)
					{
						if (args[1].Equals("1"))
						{
							((Component)((Terminal)Console.instance).m_chatWindow).gameObject.SetActive(true);
							SkConfigEntry.CConsoleEnabled.Value = true;
						}
						else
						{
							((Component)((Terminal)Console.instance).m_chatWindow).gameObject.SetActive(false);
						}
					}
					else
					{
						((Component)((Terminal)Console.instance).m_chatWindow).gameObject.SetActive(!((Component)((Terminal)Console.instance).m_chatWindow).gameObject.activeSelf);
						if (((Component)((Terminal)Console.instance).m_chatWindow).gameObject.activeInHierarchy)
						{
							SkConfigEntry.CConsoleEnabled.Value = true;
						}
					}
				};
				<>c.<>9__24_1 = val2;
				obj2 = (object)val2;
			}
			new ConsoleCommand("/console", "[1/0] - Toggle the console. No parameter with toggle. 1 = Open, 0 = Closed. Intended for use with hotkeys and aliases. (SkToolbox)", (ConsoleEvent)obj2, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false);
			object obj3 = <>c.<>9__24_2;
			if (obj3 == null)
			{
				ConsoleEvent val3 = delegate
				{
					PrintOut("Quitting game...", LogTo.DebugConsole);
					Application.Quit();
				};
				<>c.<>9__24_2 = val3;
				obj3 = (object)val3;
			}
			new ConsoleCommand("/q", "Quickly exit the game. Commands are sometimes just more convenient. (SkToolbox)", (ConsoleEvent)obj3, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false);
			object obj4 = <>c.<>9__24_3;
			if (obj4 == null)
			{
				ConsoleEvent val4 = delegate
				{
					((TMP_Text)((Terminal)Console.instance).m_output).text = string.Empty;
					try
					{
						Console.instance.SetPrivateField("m_chatBuffer", new List<string>());
						ConsoleOpt.consoleOutputHistory.Clear();
					}
					catch (Exception)
					{
					}
				};
				<>c.<>9__24_3 = val4;
				obj4 = (object)val4;
			}
			new ConsoleCommand("/clear", "Clear the current output shown in the console. (SkToolbox)", (ConsoleEvent)obj4, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false);
			object obj5 = <>c.<>9__24_4;
			if (obj5 == null)
			{
				ConsoleEvent val5 = delegate
				{
					List<ItemData> list2 = new List<ItemData>();
					((Humanoid)Player.m_localPlayer).GetInventory().GetWornItems(list2);
					foreach (ItemData item in list2)
					{
						try
						{
							item.m_durability = item.GetMaxDurability();
						}
						catch (Exception)
						{
						}
					}
					PrintOut("All items repaired!");
				};
				<>c.<>9__24_4 = val5;
				obj5 = (object)val5;
			}
			new ConsoleCommand("/repair", "Repair your inventory. (SkToolbox)", (ConsoleEvent)obj5, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false);
			object obj6 = <>c.<>9__24_5;
			if (obj6 == null)
			{
				ConsoleEvent val6 = delegate
				{
					PrintOut(ListPortals(), LogTo.Console);
				};
				<>c.<>9__24_5 = val6;
				obj6 = (object)val6;
			}
			new ConsoleCommand("/portals", "List all portal tags. (SkToolbox)", (ConsoleEvent)obj6, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false);
			object obj7 = <>c.<>9__24_6;
			if (obj7 == null)
			{
				ConsoleEvent val7 = delegate(ConsoleEventArgs args)
				{
					//IL_0050: Unknown result type (might be due to invalid IL or missing references)
					GameObject prefab5 = ZNetScene.instance.GetPrefab("digg_v2");
					if ((Object)(object)prefab5 == (Object)null)
					{
						PrintOut("Terrain level failed. Report to mod author - terrain level error 1");
					}
					else
					{
						float radius4 = 5f;
						if (args.Length > 1)
						{
							try
							{
								radius4 = int.Parse(args[1]);
							}
							catch (Exception)
							{
							}
						}
						TerrainModification.ModifyTerrain(((Component)Player.m_localPlayer).transform.position, prefab5, radius4);
						PrintOut("Terrain levelled!");
					}
				};
				<>c.<>9__24_6 = val7;
				obj7 = (object)val7;
			}
			new ConsoleCommand("/tl", "[Radius=5] - Level nearby terrain. Radius 30 max. (SkToolbox)", (ConsoleEvent)obj7, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false);
			object obj8 = <>c.<>9__24_7;
			if (obj8 == null)
			{
				ConsoleEvent val8 = delegate(ConsoleEventArgs args)
				{
					//IL_002c: Unknown result type (might be due to invalid IL or missing references)
					float radius3 = 5f;
					if (args.Length > 1)
					{
						try
						{
							radius3 = int.Parse(args[1]);
						}
						catch (Exception)
						{
						}
					}
					TerrainModification.ResetTerrain(((Component)Player.m_localPlayer).transform.position, radius3);
					PrintOut("Terrain reset!");
				};
				<>c.<>9__24_7 = val8;
				obj8 = (object)val8;
			}
			new ConsoleCommand("/tu", "[Radius=5] - Undo terrain modifications around you. Radius 50 max. (SkToolbox)", (ConsoleEvent)obj8, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false);
			object obj9 = <>c.<>9__24_8;
			if (obj9 == null)
			{
				ConsoleEvent val9 = delegate(ConsoleEventArgs args)
				{
					//IL_0072: Unknown result type (might be due to invalid IL or missing references)
					//IL_0077: Unknown result type (might be due to invalid IL or missing references)
					//IL_007d: Unknown result type (might be due to invalid IL or missing references)
					//IL_0082: Unknown result type (might be due to invalid IL or missing references)
					GameObject prefab4 = ZNetScene.instance.GetPrefab("raise");
					if ((Object)(object)prefab4 == (Object)null)
					{
						PrintOut("Terrain raise failed. Report to mod author - terrain raise error 1");
					}
					else
					{
						float radius2 = 5f;
						float num15 = 2f;
						if (args.Length > 1)
						{
							try
							{
								radius2 = int.Parse(args[1]);
							}
							catch (Exception)
							{
							}
						}
						if (args.Length > 2)
						{
							try
							{
								num15 = int.Parse(args[2]);
							}
							catch (Exception)
							{
							}
						}
						TerrainModification.ModifyTerrain(((Component)Player.m_localPlayer).transform.position + Vector3.up * num15, prefab4, radius2);
						PrintOut("Terrain raised!");
					}
				};
				<>c.<>9__24_8 = val9;
				obj9 = (object)val9;
			}
			new ConsoleCommand("/tr", "[Radius=5] [Height=1] - Raise nearby terrain. Radius 30 max. (SkToolbox)", (ConsoleEvent)obj9, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false);
			object obj10 = <>c.<>9__24_9;
			if (obj10 == null)
			{
				ConsoleEvent val10 = delegate(ConsoleEventArgs args)
				{
					//IL_0072: Unknown result type (might be due to invalid IL or missing references)
					//IL_0077: Unknown result type (might be due to invalid IL or missing references)
					//IL_007d: Unknown result type (might be due to invalid IL or missing references)
					//IL_0082: Unknown result type (might be due to invalid IL or missing references)
					GameObject prefab3 = ZNetScene.instance.GetPrefab("digg_v2");
					if ((Object)(object)prefab3 == (Object)null)
					{
						PrintOut("Terrain dig failed. Report to mod author - terrain dig error 1");
					}
					else
					{
						float radius = 5f;
						float num14 = 1f;
						if (args.Length > 1)
						{
							try
							{
								radius = int.Parse(args[1]);
							}
							catch (Exception)
							{
							}
						}
						if (args.Length > 2)
						{
							try
							{
								num14 = int.Parse(args[2]);
							}
							catch (Exception)
							{
							}
						}
						TerrainModification.ModifyTerrain(((Component)Player.m_localPlayer).transform.position - Vector3.up * num14, prefab3, radius);
						PrintOut("Terrain dug!");
					}
				};
				<>c.<>9__24_9 = val10;
				obj10 = (object)val10;
			}
			new ConsoleCommand("/td", "[Radius=5] [Height=1] - Dig nearby terrain. Radius 30 max. (SkToolbox)", (ConsoleEvent)obj10, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false);
			object obj11 = <>c.<>9__24_10;
			if (obj11 == null)
			{
				ConsoleEvent val11 = delegate
				{
					EnvMan.instance.ResetDebugWind();
					PrintOut("Wind unlocked and under game control.");
				};
				<>c.<>9__24_10 = val11;
				obj11 = (object)val11;
			}
			new ConsoleCommand("/resetwind", "If wind has been set, this will allow the game to take control of the wind again. (SkToolbox)", (ConsoleEvent)obj11, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false);
			object obj12 = <>c.<>9__24_11;
			if (obj12 == null)
			{
				ConsoleEvent val12 = delegate(ConsoleEventArgs args)
				{
					if (args.Length == 3)
					{
						float num12 = float.Parse(args[1]);
						float num13 = float.Parse(args[2]);
						EnvMan.instance.SetDebugWind(num12, num13);
					}
					else
					{
						PrintOut("Failed to set wind. Check parameters! Ex. /wind 240 5");
					}
				};
				<>c.<>9__24_11 = val12;
				obj12 = (object)val12;
			}
			new ConsoleCommand("/wind", "[Angle] [Intensity] - Set the wind direction and intensity. (SkToolbox)", (ConsoleEvent)obj12, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false);
			object obj13 = <>c.<>9__24_12;
			if (obj13 == null)
			{
				ConsoleEvent val13 = delegate(ConsoleEventArgs args)
				{
					if (args.Length == 1)
					{
						foreach (string item2 in weatherList.OrderBy((string q) => q).ToList())
						{
							PrintOut(item2);
						}
						return;
					}
					if (args.Length >= 2)
					{
						if (args[1].Equals("-1"))
						{
							if ((Object)(object)EnvMan.instance != (Object)null)
							{
								EnvMan.instance.m_debugEnv = "";
								PrintOut("Weather unlocked and under game control.");
							}
						}
						else
						{
							string text7 = string.Empty;
							if (args.Length > 2)
							{
								string[] args2 = args.Args;
								foreach (string text8 in args2)
								{
									if (!text8.Equals(args[0]))
									{
										text7 = text7 + " " + text8;
									}
								}
								text7 = text7.Trim();
							}
							else
							{
								text7 = args[1];
							}
							if (weatherList.Contains(text7))
							{
								if ((Object)(object)EnvMan.instance != (Object)null)
								{
									EnvMan.instance.m_debugEnv = text7;
									PrintOut("Weather set to: " + EnvMan.instance.m_debugEnv);
								}
								else
								{
									PrintOut("Failed to set weather to '" + text7 + "'. Can't find environment manager.");
								}
							}
							else
							{
								PrintOut("Failed to set weather to '" + text7 + "'. Check parameters! Ex. /env, /env -1, /env Misty");
							}
						}
					}
					else
					{
						PrintOut("Failed to set weather. Check parameters! Ex. /env, /env -1, /env Misty");
					}
				};
				<>c.<>9__24_12 = val13;
				obj13 = (object)val13;
			}
			new ConsoleCommand("/env", "[Weather] - Change the weather. No parameter provided will list all weather. -1 will allow the game to control the weather again. (SkToolbox)", (ConsoleEvent)obj13, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false);
			object obj14 = <>c.<>9__24_13;
			if (obj14 == null)
			{
				ConsoleEvent val14 = delegate
				{
					flyEnabled = !flyEnabled;
					Player.m_debugMode = flyEnabled;
					Player.m_localPlayer.SetPrivateField("m_debugFly", flyEnabled);
					PrintOut("Fly toggled! (" + flyEnabled + ")");
				};
				<>c.<>9__24_13 = val14;
				obj14 = (object)val14;
			}
			new ConsoleCommand("/fly", "Toggle flying. (SkToolbox)", (ConsoleEvent)obj14, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false);
			string text = "Use alternate on-screen controls. Press '" + ((SkConfigEntry.OAltToggle == null) ? "Home" : SkConfigEntry.OAltToggle.Value) + "' to toggle if active. (SkToolbox)";
			object obj15 = <>c.<>9__24_14;
			if (obj15 == null)
			{
				ConsoleEvent val15 = delegate
				{
					altOnScreenControls = !altOnScreenControls;
					PrintOut("Alt controls toggled! (" + altOnScreenControls + ")");
				};
				<>c.<>9__24_14 = val15;
				obj15 = (object)val15;
			}
			new ConsoleCommand("/alt", text, (ConsoleEvent)obj15, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false);
			object obj16 = <>c.<>9__24_15;
			if (obj16 == null)
			{
				ConsoleEvent val16 = delegate
				{
					RandEventSystem.instance.ResetRandomEvent();
					PrintOut("Event stopped!");
				};
				<>c.<>9__24_15 = val16;
				obj16 = (object)val16;
			}
			new ConsoleCommand("/stopevent", "Stops a current event. (SkToolbox)", (ConsoleEvent)obj16, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false);
			object obj17 = <>c.<>9__24_16;
			if (obj17 == null)
			{
				ConsoleEvent val17 = delegate
				{
					Minimap.instance.ExploreAll();
					PrintOut("Map revealed!");
				};
				<>c.<>9__24_16 = val17;
				obj17 = (object)val17;
			}
			new ConsoleCommand("/revealmap", "Reveals the entire minimap. (SkToolbox)", (ConsoleEvent)obj17, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false);
			object obj18 = <>c.<>9__24_17;
			if (obj18 == null)
			{
				ConsoleEvent val18 = delegate
				{
					string text6 = string.Empty;
					foreach (ZNetPeer connectedPeer in ZNet.instance.GetConnectedPeers())
					{
						if (connectedPeer != null)
						{
							text6 = text6 + ", " + connectedPeer.m_playerName + "(" + connectedPeer.m_uid + ")";
						}
					}
					if (text6.Length > 2)
					{
						text6 = text6.Remove(0, 2);
					}
					PrintOut("Active Players (" + Player.GetAllPlayers().Count + ") - " + text6);
				};
				<>c.<>9__24_17 = val18;
				obj18 = (object)val18;
			}
			new ConsoleCommand("/whois", "List all players. (SkToolbox)", (ConsoleEvent)obj18, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false);
			object obj19 = <>c.<>9__24_18;
			if (obj19 == null)
			{
				ConsoleEvent val19 = delegate(ConsoleEventArgs args)
				{
					//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_019f: Unknown result type (might be due to invalid IL or missing references)
					//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
					//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
					//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
					//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
					//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
					//IL_01d3: Expected O, but got Unknown
					string text5 = Player.m_localPlayer.GetPlayerName();
					_ = string.Empty;
					int stack = 1;
					int quality = 1;
					if (args.Length == 0)
					{
						PrintOut("Failed. No item provided. /give [Item] [Qty=1] [Player] [Level=1]");
					}
					if (args.Length >= 1)
					{
						_ = args[0];
					}
					if (args.Length == 2)
					{
						try
						{
							stack = int.Parse(args[1]);
						}
						catch (Exception)
						{
						}
					}
					if (args.Length > 2)
					{
						try
						{
							stack = int.Parse(args[1]);
						}
						catch (Exception)
						{
							stack = 1;
						}
					}
					if (args.Length >= 3)
					{
						try
						{
							text5 = args[2];
						}
						catch (Exception)
						{
						}
					}
					if (args.Length >= 4)
					{
						try
						{
							quality = int.Parse(args[3]);
						}
						catch (Exception)
						{
							quality = 1;
						}
					}
					Player val54 = null;
					foreach (Player allPlayer in Player.GetAllPlayers())
					{
						if ((Object)(object)allPlayer != (Object)null && allPlayer.GetPlayerName().ToLower().StartsWith(text5.ToLower()))
						{
							val54 = allPlayer;
							break;
						}
					}
					if ((Object)(object)val54 == (Object)null)
					{
						PrintOut("Failed. Player does not exist. /give [Item] [Qty=1] [Player] [Level=1]");
					}
					else
					{
						GameObject prefab2 = ZNetScene.instance.GetPrefab(args[0]);
						if (Object.op_Implicit((Object)(object)prefab2))
						{
							PrintOut("Spawning " + stack + " of item " + args[0] + "(" + quality + ") on " + text5);
							try
							{
								ItemDrop val55 = (ItemDrop)Object.Instantiate<GameObject>(prefab2, ((Component)val54).transform.position + ((Component)val54).transform.forward * 1.5f + Vector3.up, Quaternion.identity).GetComponent(typeof(ItemDrop));
								if ((Object)(object)val55 != (Object)null && val55.m_itemData != null)
								{
									val55.m_itemData.m_quality = quality;
									val55.m_itemData.m_stack = stack;
									val55.m_itemData.m_durability = val55.m_itemData.GetMaxDurability();
								}
								return;
							}
							catch (Exception ex18)
							{
								PrintOut("Something unexpected failed.");
								SkUtilities.Logz(new string[2] { "ERR", "/give" }, new string[2] { ex18.Message, ex18.Source }, (LogType)2);
								return;
							}
						}
						PrintOut("Failed. Check parameters. /give [Item] [Qty=1] [Player] [Level=1]");
					}
				};
				<>c.<>9__24_18 = val19;
				obj19 = (object)val19;
			}
			new ConsoleCommand("/give", "[Item] [Qty=1], OR /give [Item] [Qty=1] [Player] [Level=1] - Gives item to player. If player has a space in name, only provide name before the space. Capital letters matter in item / player name! (SkToolbox)", (ConsoleEvent)obj19, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false);
			object obj20 = <>c.<>9__24_19;
			if (obj20 == null)
			{
				ConsoleEvent val20 = delegate
				{
					godEnabled = !godEnabled;
					Player.m_localPlayer.SetGodMode(godEnabled);
					PrintOut("God toggled! (" + godEnabled + ")");
				};
				<>c.<>9__24_19 = val20;
				obj20 = (object)val20;
			}
			new ConsoleCommand("/god", "Toggle Godmode. (SkToolbox)", (ConsoleEvent)obj20, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false);
			object obj21 = <>c.<>9__24_20;
			if (obj21 == null)
			{
				ConsoleEvent val21 = delegate
				{
					((Humanoid)Player.m_localPlayer).GetInventory().RemoveAll();
					PrintOut("All items removed from inventory.");
				};
				<>c.<>9__24_20 = val21;
				obj21 = (object)val21;
			}
			new ConsoleCommand("/clearinventory", "Removes all items from your inventory. There is no confirmation, be careful. (SkToolbox)", (ConsoleEvent)obj21, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false);
			object obj22 = <>c.<>9__24_21;
			if (obj22 == null)
			{
				ConsoleEvent val22 = delegate
				{
					//IL_0030: Unknown result type (might be due to invalid IL or missing references)
					TombStone[] array4 = Object.FindObjectsOfType<TombStone>();
					if (array4.Length != 0)
					{
						TombStone[] array5 = array4;
						foreach (TombStone val53 in array5)
						{
							if ((Object)(object)val53 != (Object)null && ((Behaviour)val53).enabled)
							{
								Minimap.instance.AddPin(((Component)val53).transform.position, (PinType)12, "TS", true, true, 0L, "");
							}
						}
					}
					PrintOut("Tombstone sought out! Potentially " + array4.Length + " found.");
				};
				<>c.<>9__24_21 = val22;
				obj22 = (object)val22;
			}
			new ConsoleCommand("/findtomb", "Pin nearby dead player tombstones on the map if any currently exist. (SkToolbox)", (ConsoleEvent)obj22, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false);
			object obj23 = <>c.<>9__24_22;
			if (obj23 == null)
			{
				ConsoleEvent val23 = delegate
				{
					World privateField = WorldGenerator.instance.GetPrivateField<World>("m_world");
					PrintOut("Map seed: " + privateField.m_seedName);
				};
				<>c.<>9__24_22 = val23;
				obj23 = (object)val23;
			}
			new ConsoleCommand("/seed", "Reveals the map seed. (SkToolbox)", (ConsoleEvent)obj23, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false);
			object obj24 = <>c.<>9__24_23;
			if (obj24 == null)
			{
				ConsoleEvent val24 = delegate
				{
					GameCamera.instance.ToggleFreeFly();
					PrintOut("Free cam toggled " + GameCamera.InFreeFly());
				};
				<>c.<>9__24_23 = val24;
				obj24 = (object)val24;
			}
			new ConsoleCommand("/freecam", "Toggle freecam. (SkToolbox)", (ConsoleEvent)obj24, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false);
			object obj25 = <>c.<>9__24_24;
			if (obj25 == null)
			{
				ConsoleEvent val25 = delegate(ConsoleEventArgs args)
				{
					if (args.Length > 1)
					{
						foreach (Player allPlayer2 in Player.GetAllPlayers())
						{
							if ((Object)(object)allPlayer2 != (Object)null && allPlayer2.GetPlayerName().ToLower().Equals(args[1].ToLower()))
							{
								((Character)allPlayer2).Heal(((Character)allPlayer2).GetMaxHealth(), true);
								PrintOut("Player healed: " + allPlayer2.GetPlayerName());
							}
						}
						return;
					}
					((Character)Player.m_localPlayer).Heal(((Character)Player.m_localPlayer).GetMaxHealth(), true);
					PrintOut("Self healed.");
				};
				<>c.<>9__24_24 = val25;
				obj25 = (object)val25;
			}
			new ConsoleCommand("/heal", "[Player=local] - Heal Player. (SkToolbox)", (ConsoleEvent)obj25, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false);
			object obj26 = <>c.<>9__24_25;
			if (obj26 == null)
			{
				ConsoleEvent val26 = delegate
				{
					SkCommandPatcher.InitPatch();
					SkCommandPatcher.bBuildAnywhere = !SkCommandPatcher.bBuildAnywhere;
					PrintOut("No build restrictions toggled! (" + SkCommandPatcher.bBuildAnywhere + ")");
				};
				<>c.<>9__24_25 = val26;
				obj26 = (object)val26;
			}
			new ConsoleCommand("/nores", "Toggle no restrictions to where you can build (except ward zones). (SkToolbox)", (ConsoleEvent)obj26, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false);
			object obj27 = <>c.<>9__24_26;
			if (obj27 == null)
			{
				ConsoleEvent val27 = delegate
				{
					noCostEnabled = !noCostEnabled;
					Player.m_debugMode = noCostEnabled;
					Player.m_localPlayer.SetPrivateField("m_noPlacementCost", noCostEnabled);
					PrintOut("No build cost/requirements toggled! (" + noCostEnabled + ")");
				};
				<>c.<>9__24_26 = val27;
				obj27 = (object)val27;
			}
			new ConsoleCommand("/nocost", "Toggle no requirement building. (SkToolbox)", (ConsoleEvent)obj27, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false);
			object obj28 = <>c.<>9__24_27;
			if (obj28 == null)
			{
				ConsoleEvent val28 = delegate(ConsoleEventArgs args)
				{
					//IL_005c: Unknown result type (might be due to invalid IL or missing references)
					//IL_008a: Unknown result type (might be due to invalid IL or missing references)
					//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
					//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
					if (args.Length != 2 || !args[1].Contains(","))
					{
						PrintOut("Syntax /tp X,Z");
						return;
					}
					try
					{
						string[] array3 = args[1].Split(new char[1] { ',' });
						float num10 = float.Parse(array3[0]);
						float num11 = float.Parse(array3[1]);
						float groundHeight = ZoneSystem.instance.GetGroundHeight(new Vector3(num10, 750f, num11));
						groundHeight = Mathf.Clamp(groundHeight, 0f, 100f);
						if (groundHeight > 99f)
						{
							groundHeight = ((Component)Player.m_localPlayer).transform.position.y;
						}
						Player localPlayer = Player.m_localPlayer;
						if (Object.op_Implicit((Object)(object)localPlayer))
						{
							Vector3 val52 = default(Vector3);
							((Vector3)(ref val52))..ctor(num10, groundHeight, num11);
							((Character)localPlayer).TeleportTo(val52, ((Component)localPlayer).transform.rotation, false);
							PrintOut("Teleporting...");
						}
					}
					catch (Exception)
					{
						PrintOut("Syntax /tp X,Z");
					}
				};
				<>c.<>9__24_27 = val28;
				obj28 = (object)val28;
			}
			new ConsoleCommand("/tp", "[X,Y] - Teleport you to the coords provided. (SkToolbox)", (ConsoleEvent)obj28, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false);
			object obj29 = <>c.<>9__24_28;
			if (obj29 == null)
			{
				ConsoleEvent val29 = delegate(ConsoleEventArgs args)
				{
					bDetectEnemies = !bDetectEnemies;
					if (args.Length > 0)
					{
						try
						{
							bDetectRange = int.Parse(args[1]);
							bDetectRange = ((bDetectRange < 5) ? 5 : bDetectRange);
						}
						catch (Exception)
						{
							bDetectRange = 20;
						}
					}
					PrintOut("Detect enemies toggled! (" + bDetectEnemies + ", range: " + bDetectRange + ")");
				};
				<>c.<>9__24_28 = val29;
				obj29 = (object)val29;
			}
			new ConsoleCommand("/detect", "[Range=20] - Toggle enemy detection. (SkToolbox)", (ConsoleEvent)obj29, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false);
			object obj30 = <>c.<>9__24_29;
			if (obj30 == null)
			{
				ConsoleEvent val30 = delegate
				{
					SkCommandPatcher.InitPatch();
					SkCommandPatcher.BCheat = !SkCommandPatcher.BCheat;
					if ((Object)(object)Player.m_localPlayer != (Object)null)
					{
						try
						{
							Player.m_localPlayer.SetPrivateField("m_debugMode", SkCommandPatcher.BCheat);
							Console.instance.SetPrivateField("m_cheat", SkCommandPatcher.BCheat);
						}
						catch (Exception)
						{
						}
					}
					PrintOut("Cheats toggled! (" + SkCommandPatcher.BCheat + ")");
				};
				<>c.<>9__24_29 = val30;
				obj30 = (object)val30;
			}
			new ConsoleCommand("/imacheater", "Use the toolbox to force enable standard cheats on any server. (SkToolbox)", (ConsoleEvent)obj30, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false);
			object obj31 = <>c.<>9__24_30;
			if (obj31 == null)
			{
				ConsoleEvent val31 = delegate
				{
					SkCommandPatcher.InitPatch();
					SkCommandPatcher.BFreeSupport = !SkCommandPatcher.BFreeSupport;
					PrintOut("No build support requirements toggled! (" + SkCommandPatcher.BFreeSupport + ")");
				};
				<>c.<>9__24_30 = val31;
				obj31 = (object)val31;
			}
			new ConsoleCommand("/nosup", "Toggle no supports required for buildings - WARNING! - IF YOU REJOIN AND THIS IS DISABLED, YOUR STRUCTURES MAY FALL APART - USE WITH CARE. Maybe use the AutoRun functionality? (SkToolbox)", (ConsoleEvent)obj31, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false);
			object obj32 = <>c.<>9__24_31;
			if (obj32 == null)
			{
				ConsoleEvent val32 = delegate
				{
					bCoords = !bCoords;
					PrintOut("Show coords toggled! (" + bCoords + ")");
				};
				<>c.<>9__24_31 = val32;
				obj32 = (object)val32;
			}
			new ConsoleCommand("/coords", "Show coords in corner of the screen. (SkToolbox)", (ConsoleEvent)obj32, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false);
			object obj33 = <>c.<>9__24_32;
			if (obj33 == null)
			{
				ConsoleEvent val33 = delegate
				{
					Minimap.instance.Reset();
				};
				<>c.<>9__24_32 = val33;
				obj33 = (object)val33;
			}
			new ConsoleCommand("/resetmap", "Reset the map exploration. (SkToolbox)", (ConsoleEvent)obj33, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false);
			object obj34 = <>c.<>9__24_33;
			if (obj34 == null)
			{
				ConsoleEvent val34 = delegate
				{
					infStamina = !infStamina;
					if (infStamina)
					{
						Player.m_localPlayer.m_staminaRegenDelay = 0.05f;
						Player.m_localPlayer.m_staminaRegen = 999f;
						Player.m_localPlayer.m_runStaminaDrain = 0f;
						Player.m_localPlayer.SetMaxStamina(9999f, true);
					}
					else
					{
						Player.m_localPlayer.m_staminaRegenDelay = 1f;
						Player.m_localPlayer.m_staminaRegen = 5f;
						Player.m_localPlayer.m_runStaminaDrain = 10f;
						Player.m_localPlayer.SetMaxStamina(100f, true);
					}
					PrintOut("Infinite stamina toggled! (" + infStamina + ")");
				};
				<>c.<>9__24_33 = val34;
				obj34 = (object)val34;
			}
			new ConsoleCommand("/infstam", "Toggles infinite stamina. (SkToolbox)", (ConsoleEvent)obj34, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false);
			object obj35 = <>c.<>9__24_34;
			if (obj35 == null)
			{
				ConsoleEvent val35 = delegate
				{
					//IL_000a: Unknown result type (might be due to invalid IL or missing references)
					Tameable.TameAllInArea(((Component)Player.m_localPlayer).transform.position, 20f);
					PrintOut("Creatures tamed!");
				};
				<>c.<>9__24_34 = val35;
				obj35 = (object)val35;
			}
			new ConsoleCommand("/tame", "Tame all nearby creatures. (SkToolbox)", (ConsoleEvent)obj35, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false);
			object obj36 = <>c.<>9__24_35;
			if (obj36 == null)
			{
				ConsoleEvent val36 = delegate(ConsoleEventArgs args)
				{
					farInteract = !farInteract;
					if (farInteract)
					{
						if (args.Length > 1)
						{
							try
							{
								int num9 = ((int.Parse(args[1]) < 20) ? 20 : int.Parse(args[1]));
								Player.m_localPlayer.m_maxInteractDistance = num9;
								Player.m_localPlayer.m_maxPlaceDistance = num9;
							}
							catch (Exception)
							{
								PrintOut("Failed to set far interaction distance. Check params. /farinteract 50");
							}
						}
						else
						{
							Player.m_localPlayer.m_maxInteractDistance = 50f;
							Player.m_localPlayer.m_maxPlaceDistance = 50f;
						}
						PrintOut("Far interactions toggled! (" + farInteract + " Distance: " + Player.m_localPlayer.m_maxInteractDistance + ")");
					}
					else
					{
						Player.m_localPlayer.m_maxInteractDistance = 5f;
						Player.m_localPlayer.m_maxPlaceDistance = 5f;
						PrintOut("Far interactions toggled! (" + farInteract + ")");
					}
				};
				<>c.<>9__24_35 = val36;
				obj36 = (object)val36;
			}
			new ConsoleCommand("/farinteract", "[Distance=50] - Toggles far interactions (building as well). To change distance, toggle this off then back on with new distance. (SkToolbox)", (ConsoleEvent)obj36, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false);
			object obj37 = <>c.<>9__24_36;
			if (obj37 == null)
			{
				ConsoleEvent val37 = delegate
				{
					Player.m_localPlayer.SetGhostMode(!((Character)Player.m_localPlayer).InGhostMode());
					PrintOut("Ghost mode toggled! (" + ((Character)Player.m_localPlayer).InGhostMode() + ")");
				};
				<>c.<>9__24_36 = val37;
				obj37 = (object)val37;
			}
			new ConsoleCommand("/ghost", "Toggle Ghostmode (enemy creatures cannot see you). (SkToolbox)", (ConsoleEvent)obj37, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false);
			object obj38 = <>c.<>9__24_37;
			if (obj38 == null)
			{
				ConsoleEvent val38 = delegate(ConsoleEventArgs args)
				{
					if (args.Length > 1)
					{
						if (float.TryParse(args[1], NumberStyles.Float, CultureInfo.InvariantCulture, out var result))
						{
							if (result < 0f)
							{
								EnvMan.instance.m_debugTimeOfDay = false;
								PrintOut("Time unlocked and under game control.");
							}
							else
							{
								EnvMan.instance.m_debugTimeOfDay = true;
								EnvMan.instance.m_debugTime = Mathf.Clamp01(result);
								PrintOut("Setting time of day:" + result);
							}
						}
					}
					else
					{
						PrintOut("Failed. Syntax /tod [0-1] Ex. /tod 0.5");
					}
				};
				<>c.<>9__24_37 = val38;
				obj38 = (object)val38;
			}
			new ConsoleCommand("/tod", "List all portal tags. (SkToolbox)", (ConsoleEvent)obj38, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false);
			object obj39 = <>c.<>9__24_38;
			if (obj39 == null)
			{
				ConsoleEvent val39 = delegate
				{
					TerrainComp.UpgradeTerrain();
				};
				<>c.<>9__24_38 = val39;
				obj39 = (object)val39;
			}
			new ConsoleCommand("/optterrain", "Optimize old terrain modifications. (SkToolbox)", (ConsoleEvent)obj39, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false);
			object obj40 = <>c.<>9__24_39;
			if (obj40 == null)
			{
				ConsoleEvent val40 = delegate(ConsoleEventArgs args)
				{
					if (args.Length > 1)
					{
						if (args[1].Equals("cw"))
						{
							try
							{
								int num2 = int.Parse(args[2]);
								Player.m_localPlayer.m_maxCarryWeight = num2;
								PrintOut("New carry weight set to: " + num2);
								return;
							}
							catch (Exception)
							{
								PrintOut("Failed to set new carry weight. Check params.");
								return;
							}
						}
						if (args[1].Equals("skill"))
						{
							if (args.Length == 4 && !args[2].Contains("None") && !args[2].Contains("All") && !args[2].Contains("FireMagic") && !args[2].Contains("FrostMagic"))
							{
								try
								{
									string text3 = args[2];
									int num3 = int.Parse(args[3]);
									((Character)Player.m_localPlayer).GetSkills().CheatResetSkill(text3.ToLower());
									((Character)Player.m_localPlayer).GetSkills().CheatRaiseSkill(text3.ToLower(), (float)num3, true);
									return;
								}
								catch (Exception)
								{
									PrintOut("Failed to set skill. Check params / skill name. See /listskills. /set skill [skill] [level]");
									return;
								}
							}
							PrintOut("Failed to set skill. Check params / skill name. See /listskills.  /set skill [skill] [level]");
						}
						else if (args[1].Equals("pickup"))
						{
							if (args.Length >= 3)
							{
								try
								{
									int num4 = int.Parse(args[2]);
									Player.m_localPlayer.m_autoPickupRange = num4;
									PrintOut("New range set to: " + num4);
									return;
								}
								catch (Exception)
								{
									PrintOut("Failed to set pickup range. Check params. /set pickup 2");
									return;
								}
							}
							PrintOut("Failed to set pickup range. Check params.  /set pickup 2");
						}
						else if (args[1].Equals("jumpforce"))
						{
							if (args.Length >= 3)
							{
								try
								{
									int num5 = int.Parse(args[2]);
									((Character)Player.m_localPlayer).m_jumpForce = num5;
									PrintOut("New range set to: " + num5);
									return;
								}
								catch (Exception)
								{
									PrintOut("Failed to set jump force. Check params. /set jumpforce 10");
									return;
								}
							}
							PrintOut("Failed to set jump force. Check params.  /set jumpforce 10");
						}
						else if (args[1].Equals("exploreradius"))
						{
							if (args.Length >= 3)
							{
								try
								{
									int num6 = int.Parse(args[2]);
									Minimap.instance.m_exploreRadius = num6;
									PrintOut("New range set to: " + num6);
									return;
								}
								catch (Exception)
								{
									PrintOut("Failed to set explore radius. Check params. /set exploreradius 100");
									return;
								}
							}
							PrintOut("Failed to set explore radius. Check params.  /set exploreradius 100");
						}
						else if (args[1].Equals("speed"))
						{
							if (args.Length >= 4)
							{
								string text4 = args[2];
								if (new string[3] { "crouch", "run", "swim" }.Contains(text4))
								{
									float num7 = 0f;
									try
									{
										int num8 = int.Parse(args[3]);
										switch (text4)
										{
										case "crouch":
											num7 = ((Character)Player.m_localPlayer).m_crouchSpeed;
											((Character)Player.m_localPlayer).m_crouchSpeed = num8;
											break;
										case "run":
											num7 = ((Character)Player.m_localPlayer).m_runSpeed;
											((Character)Player.m_localPlayer).m_runSpeed = num8;
											break;