Decompiled source of ValheimRoleplay v1.0.0

goldbees.dll

Decompiled 5 hours ago
using System;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using HarmonyLib;
using Jotunn.Configs;
using Jotunn.Entities;
using Jotunn.Managers;
using Jotunn.Utils;
using UnityEngine;

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

[BepInPlugin("1010101110.goldbees", "goldbees", "1.0.6")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class Mod : BaseUnityPlugin
{
	public static readonly Harmony harmony = new Harmony(typeof(Mod).GetCustomAttributes(typeof(BepInPlugin), inherit: false).Cast<BepInPlugin>().First()
		.GUID);

	private void Awake()
	{
		harmony.PatchAll();
		PrefabManager.OnVanillaPrefabsAvailable += AddPrefabs;
	}

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

	private void AddPrefabs()
	{
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Expected O, but got Unknown
		//IL_0069: Unknown result type (might be due to invalid IL or missing references)
		//IL_006e: Unknown result type (might be due to invalid IL or missing references)
		//IL_007a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0083: Expected O, but got Unknown
		//IL_0085: Unknown result type (might be due to invalid IL or missing references)
		//IL_008a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0096: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a3: Expected O, but got Unknown
		//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b5: Expected O, but got Unknown
		//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d9: Expected O, but got Unknown
		//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00de: Expected O, but got Unknown
		//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0102: Expected O, but got Unknown
		//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0107: Expected O, but got Unknown
		//IL_0119: Unknown result type (might be due to invalid IL or missing references)
		//IL_011e: Unknown result type (might be due to invalid IL or missing references)
		//IL_012b: Expected O, but got Unknown
		//IL_0126: Unknown result type (might be due to invalid IL or missing references)
		//IL_0130: Expected O, but got Unknown
		//IL_0142: Unknown result type (might be due to invalid IL or missing references)
		//IL_0147: Unknown result type (might be due to invalid IL or missing references)
		//IL_0154: Expected O, but got Unknown
		//IL_014f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0159: Expected O, but got Unknown
		//IL_0181: Unknown result type (might be due to invalid IL or missing references)
		//IL_0186: Unknown result type (might be due to invalid IL or missing references)
		//IL_018e: Unknown result type (might be due to invalid IL or missing references)
		//IL_019a: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
		//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_01de: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ef: Expected O, but got Unknown
		//IL_01ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f4: Expected O, but got Unknown
		//IL_0206: Unknown result type (might be due to invalid IL or missing references)
		//IL_020b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0213: Unknown result type (might be due to invalid IL or missing references)
		//IL_021f: 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_022f: 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_024f: Unknown result type (might be due to invalid IL or missing references)
		//IL_025b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0267: Unknown result type (might be due to invalid IL or missing references)
		//IL_0273: Unknown result type (might be due to invalid IL or missing references)
		//IL_027f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0290: Expected O, but got Unknown
		//IL_028b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0295: Expected O, but got Unknown
		//IL_02a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c1: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c9: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d1: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d9: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ed: Unknown result type (might be due to invalid IL or missing references)
		//IL_02f9: Unknown result type (might be due to invalid IL or missing references)
		//IL_0305: Unknown result type (might be due to invalid IL or missing references)
		//IL_0316: Expected O, but got Unknown
		//IL_0311: Unknown result type (might be due to invalid IL or missing references)
		//IL_031b: Expected O, but got Unknown
		//IL_032d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0334: Expected O, but got Unknown
		//IL_0365: Unknown result type (might be due to invalid IL or missing references)
		//IL_036a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0376: Unknown result type (might be due to invalid IL or missing references)
		//IL_0380: Expected O, but got Unknown
		//IL_0382: Unknown result type (might be due to invalid IL or missing references)
		//IL_0387: Unknown result type (might be due to invalid IL or missing references)
		//IL_0393: Unknown result type (might be due to invalid IL or missing references)
		//IL_039b: Unknown result type (might be due to invalid IL or missing references)
		//IL_03a4: Expected O, but got Unknown
		//IL_03ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_03b6: Expected O, but got Unknown
		//IL_03fa: Unknown result type (might be due to invalid IL or missing references)
		//IL_0443: Unknown result type (might be due to invalid IL or missing references)
		//IL_0449: Expected O, but got Unknown
		//IL_0498: Unknown result type (might be due to invalid IL or missing references)
		//IL_04e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_04e8: Expected O, but got Unknown
		//IL_053d: Unknown result type (might be due to invalid IL or missing references)
		//IL_058d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0594: Expected O, but got Unknown
		//IL_05e9: Unknown result type (might be due to invalid IL or missing references)
		//IL_0639: Unknown result type (might be due to invalid IL or missing references)
		//IL_0640: Expected O, but got Unknown
		//IL_0657: Unknown result type (might be due to invalid IL or missing references)
		//IL_065e: Expected O, but got Unknown
		//IL_0694: Unknown result type (might be due to invalid IL or missing references)
		//IL_0699: Unknown result type (might be due to invalid IL or missing references)
		//IL_06a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_06ae: Expected O, but got Unknown
		//IL_06b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_06b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_06c1: Unknown result type (might be due to invalid IL or missing references)
		//IL_06ca: Expected O, but got Unknown
		//IL_06cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_06d1: Unknown result type (might be due to invalid IL or missing references)
		//IL_06dd: Unknown result type (might be due to invalid IL or missing references)
		//IL_06e6: Expected O, but got Unknown
		//IL_06ee: Unknown result type (might be due to invalid IL or missing references)
		//IL_06f5: Expected O, but got Unknown
		//IL_0743: Unknown result type (might be due to invalid IL or missing references)
		//IL_074a: Expected O, but got Unknown
		//IL_078e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0793: Unknown result type (might be due to invalid IL or missing references)
		//IL_079f: Unknown result type (might be due to invalid IL or missing references)
		//IL_07a8: Expected O, but got Unknown
		//IL_07b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_07b7: Expected O, but got Unknown
		//IL_07c9: Unknown result type (might be due to invalid IL or missing references)
		//IL_084f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0854: Unknown result type (might be due to invalid IL or missing references)
		//IL_0860: Unknown result type (might be due to invalid IL or missing references)
		//IL_086c: Unknown result type (might be due to invalid IL or missing references)
		//IL_087a: Expected O, but got Unknown
		//IL_0875: Unknown result type (might be due to invalid IL or missing references)
		//IL_087f: Expected O, but got Unknown
		//IL_088a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0891: Expected O, but got Unknown
		//IL_08c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_08cc: 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_08e1: Expected O, but got Unknown
		//IL_08e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_08e8: Unknown result type (might be due to invalid IL or missing references)
		//IL_08f4: Unknown result type (might be due to invalid IL or missing references)
		//IL_08fd: Expected O, but got Unknown
		//IL_08ff: Unknown result type (might be due to invalid IL or missing references)
		//IL_0904: 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_0919: Expected O, but got Unknown
		//IL_0921: Unknown result type (might be due to invalid IL or missing references)
		//IL_0928: Expected O, but got Unknown
		//IL_0977: Unknown result type (might be due to invalid IL or missing references)
		//IL_097e: Expected O, but got Unknown
		//IL_09c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_09c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_09d3: Unknown result type (might be due to invalid IL or missing references)
		//IL_09dc: Expected O, but got Unknown
		//IL_09e4: Unknown result type (might be due to invalid IL or missing references)
		//IL_09eb: Expected O, but got Unknown
		//IL_09fd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a84: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a89: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a95: Unknown result type (might be due to invalid IL or missing references)
		//IL_0aa1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0aaf: Expected O, but got Unknown
		//IL_0aaa: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ab4: Expected O, but got Unknown
		//IL_0abf: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ac6: Expected O, but got Unknown
		//IL_0afc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b01: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b0d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b16: Expected O, but got Unknown
		//IL_0b18: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b1d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b29: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b32: Expected O, but got Unknown
		//IL_0b34: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b39: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b45: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b4e: Expected O, but got Unknown
		//IL_0b50: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b55: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b61: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b6a: Expected O, but got Unknown
		//IL_0b72: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b79: Expected O, but got Unknown
		//IL_0bc8: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bcf: Expected O, but got Unknown
		//IL_0c13: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c18: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c24: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c2d: Expected O, but got Unknown
		//IL_0c35: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c3c: Expected O, but got Unknown
		//IL_0c4e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0cd5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0cda: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ce6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0cf2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d00: Expected O, but got Unknown
		//IL_0cfb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d05: Expected O, but got Unknown
		//IL_0d10: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d17: Expected O, but got Unknown
		//IL_0d4d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d52: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d5e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d67: Expected O, but got Unknown
		//IL_0d69: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d6e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d7a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d83: Expected O, but got Unknown
		//IL_0d85: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d8a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d96: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d9f: Expected O, but got Unknown
		//IL_0da1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0da6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0db2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0dbb: Expected O, but got Unknown
		//IL_0dc3: Unknown result type (might be due to invalid IL or missing references)
		//IL_0dca: Expected O, but got Unknown
		//IL_0e19: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e20: Expected O, but got Unknown
		//IL_0e64: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e69: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e75: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e7e: Expected O, but got Unknown
		//IL_0e86: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e8d: Expected O, but got Unknown
		//IL_0e9f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f26: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f2b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f37: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f43: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f51: Expected O, but got Unknown
		//IL_0f4c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f56: Expected O, but got Unknown
		AssetBundle val = AssetUtils.LoadAssetBundleFromResources("goldbees", typeof(Mod).Assembly);
		ItemManager instance = ItemManager.Instance;
		GameObject obj = val.LoadAsset<GameObject>("QueenBeeGold");
		ItemConfig val2 = new ItemConfig();
		val2.Description = "this sweetie sure is shiny";
		val2.CraftingStation = "forge";
		val2.MinStationLevel = 1;
		val2.Amount = 1;
		val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[2]
		{
			new RequirementConfig
			{
				Item = "QueenBee",
				Amount = 2
			},
			new RequirementConfig
			{
				Item = "Coins",
				Amount = 999
			}
		};
		instance.AddItem(new CustomItem(obj, false, val2));
		ItemManager.Instance.AddItem(new CustomItem(val.LoadAsset<GameObject>("HoneyGold"), false, new ItemConfig
		{
			Enabled = false
		}));
		ItemManager.Instance.AddItem(new CustomItem(val.LoadAsset<GameObject>("Mums"), false, new ItemConfig
		{
			Enabled = false
		}));
		ItemManager.Instance.AddItem(new CustomItem(val.LoadAsset<GameObject>("Edelweiss"), false, new ItemConfig
		{
			Enabled = false
		}));
		ItemManager.Instance.AddItem(new CustomItem(val.LoadAsset<GameObject>("Scabiosa"), false, new ItemConfig
		{
			Enabled = false
		}));
		PrefabManager.Instance.AddPrefab(val.LoadAsset<GameObject>("BeehiveGold"));
		ZoneManager.Instance.AddCustomVegetation(new CustomVegetation(val.LoadAsset<GameObject>("Pickable_mums"), false, new VegetationConfig
		{
			Biome = (Biome)1,
			Max = 0.75f,
			BlockCheck = true,
			InForest = false,
			GroupSizeMin = 2,
			GroupSizeMax = 5,
			GroupRadius = 4f,
			MinAltitude = 1f,
			ScaleMin = 1.3f,
			ScaleMax = 1.8f
		}));
		ZoneManager.Instance.AddCustomVegetation(new CustomVegetation(val.LoadAsset<GameObject>("Pickable_edelweiss"), false, new VegetationConfig
		{
			Biome = (Biome)4,
			Max = 1f,
			BlockCheck = true,
			GroupSizeMin = 2,
			GroupSizeMax = 8,
			GroupRadius = 4f,
			MinAltitude = 1f,
			TerrainDeltaRadius = 2f,
			MinTerrainDelta = 0f,
			MaxTerrainDelta = 3f,
			ScaleMin = 0.6f,
			ScaleMax = 0.8f
		}));
		ZoneManager.Instance.AddCustomVegetation(new CustomVegetation(val.LoadAsset<GameObject>("Pickable_scabiosa"), false, new VegetationConfig
		{
			Biome = (Biome)16,
			Max = 0.5f,
			BlockCheck = true,
			InForest = false,
			GroupSizeMin = 5,
			GroupSizeMax = 8,
			GroupRadius = 4f,
			MinAltitude = 1f,
			ScaleMin = 0.4f,
			ScaleMax = 0.6f
		}));
		PieceManager instance2 = PieceManager.Instance;
		GameObject obj2 = val.LoadAsset<GameObject>("piece_beehive_gold");
		PieceConfig val3 = new PieceConfig();
		val3.PieceTable = "Hammer";
		val3.Category = "Crafting";
		val3.CraftingStation = "piece_workbench";
		val3.Requirements = (RequirementConfig[])(object)new RequirementConfig[2]
		{
			new RequirementConfig
			{
				Item = "FineWood",
				Amount = 10
			},
			new RequirementConfig
			{
				Item = "QueenBeeGold",
				Amount = 1,
				Recover = true
			}
		};
		instance2.AddPiece(new CustomPiece(obj2, true, val3));
		SE_Stats val4 = ScriptableObject.CreateInstance<SE_Stats>();
		((Object)val4).name = "Soothin";
		((StatusEffect)val4).m_name = "Soothin";
		((StatusEffect)val4).m_icon = PrefabManager.Instance.GetPrefab("Honey").GetComponent<ItemDrop>().m_itemData.GetIcon();
		((StatusEffect)val4).m_startMessageType = (MessageType)1;
		((StatusEffect)val4).m_startMessage = "you feel soothed and comforted.";
		val4.m_speedModifier = -0.8f;
		val4.m_healthOverTime = 20f;
		val4.m_staminaOverTime = 20f;
		val4.m_healthOverTimeInterval = 2f;
		((StatusEffect)val4).m_ttl = 10f;
		CustomStatusEffect val5 = new CustomStatusEffect((StatusEffect)(object)val4, false);
		ItemManager.Instance.AddStatusEffect(val5);
		SE_Stats val6 = ScriptableObject.CreateInstance<SE_Stats>();
		((Object)val6).name = "Golden";
		((StatusEffect)val6).m_name = "Golden";
		((StatusEffect)val6).m_icon = PrefabManager.Instance.GetPrefab("HoneyGold").GetComponent<ItemDrop>().m_itemData.GetIcon();
		((StatusEffect)val6).m_startMessageType = (MessageType)1;
		((StatusEffect)val6).m_startMessage = "you feel shiny and comforted.";
		val6.m_speedModifier = -0.8f;
		val6.m_healthOverTime = 30f;
		val6.m_staminaOverTime = 30f;
		val6.m_healthOverTimeInterval = 2f;
		((StatusEffect)val6).m_ttl = 10f;
		CustomStatusEffect val7 = new CustomStatusEffect((StatusEffect)(object)val6, false);
		ItemManager.Instance.AddStatusEffect(val7);
		SE_Stats val8 = ScriptableObject.CreateInstance<SE_Stats>();
		((Object)val8).name = "Chillin";
		((StatusEffect)val8).m_name = "Chillin";
		((StatusEffect)val8).m_icon = PrefabManager.Instance.GetPrefab("Edelweiss").GetComponent<ItemDrop>().m_itemData.GetIcon();
		((StatusEffect)val8).m_startMessageType = (MessageType)1;
		((StatusEffect)val8).m_startMessage = "so refreshing! sweet and cool and comforting!";
		val8.m_speedModifier = -0.8f;
		val8.m_healthOverTime = 69f;
		val8.m_healthOverTimeInterval = 1f;
		val8.m_staminaOverTime = 69f;
		((StatusEffect)val8).m_ttl = 10f;
		CustomStatusEffect val9 = new CustomStatusEffect((StatusEffect)(object)val8, false);
		ItemManager.Instance.AddStatusEffect(val9);
		SE_Stats val10 = ScriptableObject.CreateInstance<SE_Stats>();
		((Object)val10).name = "Easy";
		((StatusEffect)val10).m_name = "Easy";
		((StatusEffect)val10).m_icon = PrefabManager.Instance.GetPrefab("Scabiosa").GetComponent<ItemDrop>().m_itemData.GetIcon();
		((StatusEffect)val10).m_startMessageType = (MessageType)1;
		((StatusEffect)val10).m_startMessage = "just taking it easy comfortably";
		val10.m_speedModifier = -0.8f;
		val10.m_healthOverTime = 69f;
		val10.m_healthOverTimeInterval = 1f;
		val10.m_staminaOverTime = 420f;
		((StatusEffect)val10).m_ttl = 10f;
		CustomStatusEffect val11 = new CustomStatusEffect((StatusEffect)(object)val10, false);
		ItemManager.Instance.AddStatusEffect(val11);
		val2 = new ItemConfig();
		val2.Description = "This mush smells pleasant, throw it in a fermenter?";
		val2.Amount = 1;
		val2.CraftingStation = "piece_cauldron";
		val2.MinStationLevel = 1;
		val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[3]
		{
			new RequirementConfig
			{
				Item = "Dandelion",
				Amount = 5
			},
			new RequirementConfig
			{
				Item = "Raspberry",
				Amount = 5
			},
			new RequirementConfig
			{
				Item = "Honey",
				Amount = 4
			}
		};
		CustomItem val12 = new CustomItem("MushSoothing", "MeadBaseTasty", val2);
		val12.ItemDrop.m_itemData.m_shared.m_name = "Soothing Mush";
		val12.ItemDrop.m_itemData.m_shared.m_consumeStatusEffect = val5.StatusEffect;
		ItemManager.Instance.AddItem(val12);
		val2 = new ItemConfig();
		val2.Name = "Honey Tea";
		val2.Description = "a soothing tea";
		val2.CraftingStation = "piece_cauldron";
		val2.MinStationLevel = 1;
		val2.Amount = 20;
		val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[1]
		{
			new RequirementConfig
			{
				Item = "SledgeCheat",
				Amount = 1
			}
		};
		CustomItem val13 = new CustomItem("HoneyTea", "Tankard", val2);
		val13.ItemDrop.m_itemData.m_shared.m_itemType = (ItemType)2;
		val13.ItemDrop.m_itemData.m_shared.m_ammoType = "mead";
		val13.ItemDrop.m_itemData.m_shared.m_attack.m_attackAnimation = "emote_drink";
		val13.ItemDrop.m_itemData.m_shared.m_consumeStatusEffect = val5.StatusEffect;
		val13.ItemDrop.m_itemData.m_shared.m_maxStackSize = 30;
		ItemManager.Instance.AddItem(val13);
		ItemManager.Instance.AddItemConversion(new CustomItemConversion((ConversionConfig)new FermenterConversionConfig
		{
			FromItem = "MushSoothing",
			ToItem = "HoneyTea",
			ProducedItems = 10
		}));
		val2 = new ItemConfig();
		val2.Description = "This shiny mush, throw it in a fermenter?";
		val2.Amount = 1;
		val2.CraftingStation = "piece_cauldron";
		val2.MinStationLevel = 1;
		val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[3]
		{
			new RequirementConfig
			{
				Item = "Mums",
				Amount = 5
			},
			new RequirementConfig
			{
				Item = "Blueberries",
				Amount = 5
			},
			new RequirementConfig
			{
				Item = "HoneyGold",
				Amount = 4
			}
		};
		CustomItem val14 = new CustomItem("MushGolden", "MeadBaseTasty", val2);
		val14.ItemDrop.m_itemData.m_shared.m_name = "Golden Mush";
		val14.ItemDrop.m_itemData.m_shared.m_consumeStatusEffect = val7.StatusEffect;
		ItemManager.Instance.AddItem(val14);
		val2 = new ItemConfig();
		val2.Name = "Golden Tea";
		val2.Description = "a radiant tea";
		val2.CraftingStation = "piece_cauldron";
		val2.MinStationLevel = 2;
		val2.Amount = 20;
		val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[1]
		{
			new RequirementConfig
			{
				Item = "SledgeCheat",
				Amount = 1
			}
		};
		CustomItem val15 = new CustomItem("GoldenTea", "Tankard", val2);
		val15.ItemDrop.m_itemData.m_shared.m_itemType = (ItemType)2;
		val15.ItemDrop.m_itemData.m_shared.m_ammoType = "mead";
		val15.ItemDrop.m_itemData.m_shared.m_attack.m_attackAnimation = "emote_drink";
		val15.ItemDrop.m_itemData.m_shared.m_consumeStatusEffect = val7.StatusEffect;
		val15.ItemDrop.m_itemData.m_shared.m_maxStackSize = 30;
		ItemManager.Instance.AddItem(val15);
		ItemManager.Instance.AddItemConversion(new CustomItemConversion((ConversionConfig)new FermenterConversionConfig
		{
			FromItem = "MushGolden",
			ToItem = "GoldenTea",
			ProducedItems = 10
		}));
		val2 = new ItemConfig();
		val2.Description = "This mush is cold, throw it in a fermenter?";
		val2.Amount = 1;
		val2.CraftingStation = "piece_cauldron";
		val2.MinStationLevel = 2;
		val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[4]
		{
			new RequirementConfig
			{
				Item = "Edelweiss",
				Amount = 5
			},
			new RequirementConfig
			{
				Item = "Dandelion",
				Amount = 5
			},
			new RequirementConfig
			{
				Item = "Crystal",
				Amount = 1
			},
			new RequirementConfig
			{
				Item = "HoneyGold",
				Amount = 4
			}
		};
		CustomItem val16 = new CustomItem("MushIced", "MeadBaseTasty", val2);
		val16.ItemDrop.m_itemData.m_shared.m_name = "Iced Mush";
		val16.ItemDrop.m_itemData.m_shared.m_consumeStatusEffect = val9.StatusEffect;
		ItemManager.Instance.AddItem(val16);
		val2 = new ItemConfig();
		val2.Name = "Iced Tea";
		val2.Description = "a chilly tea";
		val2.CraftingStation = "piece_cauldron";
		val2.MinStationLevel = 1;
		val2.Amount = 20;
		val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[1]
		{
			new RequirementConfig
			{
				Item = "SledgeCheat",
				Amount = 1
			}
		};
		CustomItem val17 = new CustomItem("IcedTea", "Tankard", val2);
		val17.ItemDrop.m_itemData.m_shared.m_itemType = (ItemType)2;
		val17.ItemDrop.m_itemData.m_shared.m_ammoType = "mead";
		val17.ItemDrop.m_itemData.m_shared.m_attack.m_attackAnimation = "emote_drink";
		val17.ItemDrop.m_itemData.m_shared.m_consumeStatusEffect = val9.StatusEffect;
		val17.ItemDrop.m_itemData.m_shared.m_maxStackSize = 30;
		ItemManager.Instance.AddItem(val17);
		ItemManager.Instance.AddItemConversion(new CustomItemConversion((ConversionConfig)new FermenterConversionConfig
		{
			FromItem = "MushIced",
			ToItem = "IcedTea",
			ProducedItems = 10
		}));
		val2 = new ItemConfig();
		val2.Description = "This mush is flowery, throw it in a fermenter?";
		val2.Amount = 1;
		val2.CraftingStation = "piece_cauldron";
		val2.MinStationLevel = 2;
		val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[4]
		{
			new RequirementConfig
			{
				Item = "Mums",
				Amount = 5
			},
			new RequirementConfig
			{
				Item = "Scabiosa",
				Amount = 5
			},
			new RequirementConfig
			{
				Item = "Cloudberry",
				Amount = 5
			},
			new RequirementConfig
			{
				Item = "HoneyGold",
				Amount = 4
			}
		};
		CustomItem val18 = new CustomItem("MushEasy", "MeadBaseTasty", val2);
		val18.ItemDrop.m_itemData.m_shared.m_name = "Easy Mush";
		val18.ItemDrop.m_itemData.m_shared.m_consumeStatusEffect = val11.StatusEffect;
		ItemManager.Instance.AddItem(val18);
		val2 = new ItemConfig();
		val2.Name = "Easy Tea";
		val2.Description = "it's not easy to make but it do make you feel at ease!";
		val2.CraftingStation = "piece_cauldron";
		val2.MinStationLevel = 1;
		val2.Amount = 20;
		val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[1]
		{
			new RequirementConfig
			{
				Item = "SledgeCheat",
				Amount = 1
			}
		};
		CustomItem val19 = new CustomItem("EasyTea", "Tankard", val2);
		val19.ItemDrop.m_itemData.m_shared.m_itemType = (ItemType)2;
		val19.ItemDrop.m_itemData.m_shared.m_ammoType = "mead";
		val19.ItemDrop.m_itemData.m_shared.m_attack.m_attackAnimation = "emote_drink";
		val19.ItemDrop.m_itemData.m_shared.m_consumeStatusEffect = val11.StatusEffect;
		val19.ItemDrop.m_itemData.m_shared.m_maxStackSize = 30;
		ItemManager.Instance.AddItem(val19);
		ItemManager.Instance.AddItemConversion(new CustomItemConversion((ConversionConfig)new FermenterConversionConfig
		{
			FromItem = "MushEasy",
			ToItem = "EasyTea",
			ProducedItems = 10
		}));
	}
}
public class MyPatches
{
	[HarmonyPatch(typeof(SE_Rested), "CalculateComfortLevel", new Type[] { typeof(Player) })]
	private class restedadditions
	{
		private static void Postfix(Player player, ref int __result)
		{
			if (((Character)player).m_seman.HaveStatusEffect(StringExtensionMethods.GetStableHashCode("Soothin")))
			{
				__result += 5;
			}
			if (((Character)player).m_seman.HaveStatusEffect(StringExtensionMethods.GetStableHashCode("Golden")))
			{
				__result += 5;
			}
			if (((Character)player).m_seman.HaveStatusEffect(StringExtensionMethods.GetStableHashCode("Chillin")))
			{
				__result += 5;
			}
			if (((Character)player).m_seman.HaveStatusEffect(StringExtensionMethods.GetStableHashCode("Easy")))
			{
				__result += 10;
			}
		}
	}
}

modelchanger.dll

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

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

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

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

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

			public static ConsoleEvent <>9__0_0;

			public static ConsoleEvent <>9__0_1;

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

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

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

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

	private static RuntimeAnimatorController CustomRuntime;

	private static Dictionary<string, string> Humanoids;

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

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

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

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

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

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

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

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

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

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

shrooms.dll

Decompiled 5 hours ago
using System.Collections;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using HarmonyLib;
using Jotunn;
using Jotunn.Configs;
using Jotunn.Entities;
using Jotunn.Managers;
using Jotunn.Utils;
using UnityEngine;
using UnityEngine.PostProcessing;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("socketparams")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("socketparams")]
[assembly: AssemblyCopyright("Copyright ©  2021")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("3B95EEF7-4A97-4393-91A0-3626434F3631")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace tripping
{
	[BepInPlugin("1010101110.shrooms", "shrooms", "1.3.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Mod : BaseUnityPlugin
	{
		public static readonly Harmony harmony = new Harmony(typeof(Mod).GetCustomAttributes(typeof(BepInPlugin), inherit: false).Cast<BepInPlugin>().First()
			.GUID);

		private void Awake()
		{
			harmony.PatchAll();
			PrefabManager.OnVanillaPrefabsAvailable += AddShrooms;
		}

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

		private void AddShrooms()
		{
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Expected O, but got Unknown
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Expected O, but got Unknown
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Expected O, but got Unknown
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: 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_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Expected O, but got Unknown
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Expected O, but got Unknown
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Expected O, but got Unknown
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Expected O, but got Unknown
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: Expected O, but got Unknown
			//IL_0131: Unknown result type (might be due to invalid IL or missing references)
			//IL_0136: 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_014b: Expected O, but got Unknown
			//IL_0152: Unknown result type (might be due to invalid IL or missing references)
			//IL_015c: Expected O, but got Unknown
			//IL_016e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0178: Expected O, but got Unknown
			//IL_018a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0190: Expected O, but got Unknown
			//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01be: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c7: Expected O, but got Unknown
			//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_01da: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e3: Expected O, but got Unknown
			//IL_01ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f4: Expected O, but got Unknown
			//IL_0206: Unknown result type (might be due to invalid IL or missing references)
			//IL_0210: Expected O, but got Unknown
			//IL_0222: 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_022f: Unknown result type (might be due to invalid IL or missing references)
			//IL_023b: 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_024b: 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_025f: Unknown result type (might be due to invalid IL or missing references)
			//IL_026b: Unknown result type (might be due to invalid IL or missing references)
			//IL_027c: Expected O, but got Unknown
			//IL_0277: Unknown result type (might be due to invalid IL or missing references)
			//IL_0281: Expected O, but got Unknown
			//IL_0293: Unknown result type (might be due to invalid IL or missing references)
			//IL_0298: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a5: Expected O, but got Unknown
			//IL_02a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02aa: Expected O, but got Unknown
			//IL_02bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c6: Expected O, but got Unknown
			//IL_02d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0301: Unknown result type (might be due to invalid IL or missing references)
			//IL_0309: Unknown result type (might be due to invalid IL or missing references)
			//IL_0315: Unknown result type (might be due to invalid IL or missing references)
			//IL_0321: Unknown result type (might be due to invalid IL or missing references)
			//IL_0332: Expected O, but got Unknown
			//IL_032d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0337: Expected O, but got Unknown
			//IL_034d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0352: Unknown result type (might be due to invalid IL or missing references)
			//IL_035a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0366: Unknown result type (might be due to invalid IL or missing references)
			//IL_036e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0376: Unknown result type (might be due to invalid IL or missing references)
			//IL_037e: Unknown result type (might be due to invalid IL or missing references)
			//IL_038a: Unknown result type (might be due to invalid IL or missing references)
			//IL_039b: Expected O, but got Unknown
			//IL_0396: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a0: Expected O, but got Unknown
			//IL_03b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c4: Expected O, but got Unknown
			//IL_03bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c9: Expected O, but got Unknown
			//IL_03db: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e5: Expected O, but got Unknown
			//IL_03f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_03fd: Expected O, but got Unknown
			//IL_041a: Unknown result type (might be due to invalid IL or missing references)
			//IL_041f: Unknown result type (might be due to invalid IL or missing references)
			//IL_042b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0434: Expected O, but got Unknown
			//IL_0436: Unknown result type (might be due to invalid IL or missing references)
			//IL_043b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0447: Unknown result type (might be due to invalid IL or missing references)
			//IL_0450: Expected O, but got Unknown
			//IL_0452: Unknown result type (might be due to invalid IL or missing references)
			//IL_0457: Unknown result type (might be due to invalid IL or missing references)
			//IL_0463: Unknown result type (might be due to invalid IL or missing references)
			//IL_046c: Expected O, but got Unknown
			//IL_046e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0473: Unknown result type (might be due to invalid IL or missing references)
			//IL_047f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0488: Expected O, but got Unknown
			//IL_048f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0499: Expected O, but got Unknown
			AssetBundle val = AssetUtils.LoadAssetBundleFromResources("mushroom", typeof(Mod).Assembly);
			ItemManager.Instance.AddItem(new CustomItem(val.LoadAsset<GameObject>("MushroomBlack"), false, new ItemConfig
			{
				Enabled = false
			}));
			PrefabManager.Instance.AddPrefab(new CustomPrefab(val.LoadAsset<GameObject>("Pickable_Mushroom_black"), false));
			ZoneManager.Instance.AddCustomVegetation(new CustomVegetation(val.LoadAsset<GameObject>("Pickable_Mushroom_black"), false, new VegetationConfig
			{
				Biome = (Biome)8,
				Max = 0.1f,
				BlockCheck = true,
				GroupSizeMin = 1,
				GroupSizeMax = 1,
				GroupRadius = 4f,
				MinAltitude = 1f
			}));
			ItemManager instance = ItemManager.Instance;
			GameObject obj = val.LoadAsset<GameObject>("MushroomPink");
			ItemConfig val2 = new ItemConfig();
			val2.Amount = 2;
			val2.CraftingStation = "piece_cauldron";
			val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[3]
			{
				new RequirementConfig
				{
					Item = "MushroomYellow",
					Amount = 2
				},
				new RequirementConfig
				{
					Item = "Raspberry",
					Amount = 4
				},
				new RequirementConfig
				{
					Item = "GreydwarfEye",
					Amount = 4
				}
			};
			instance.AddItem(new CustomItem(obj, false, val2));
			PrefabManager.Instance.AddPrefab(new CustomPrefab(val.LoadAsset<GameObject>("Pickable_Mushroom_pink"), false));
			ItemManager instance2 = ItemManager.Instance;
			GameObject obj2 = val.LoadAsset<GameObject>("MushroomBlood");
			val2 = new ItemConfig();
			val2.Amount = 2;
			val2.CraftingStation = "piece_cauldron";
			val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[2]
			{
				new RequirementConfig
				{
					Item = "MushroomBlack",
					Amount = 2
				},
				new RequirementConfig
				{
					Item = "Bloodbag",
					Amount = 4
				}
			};
			instance2.AddItem(new CustomItem(obj2, false, val2));
			PrefabManager.Instance.AddPrefab(new CustomPrefab(val.LoadAsset<GameObject>("Pickable_Mushroom_blood"), false));
			ZoneManager.Instance.AddCustomVegetation(new CustomVegetation(val.LoadAsset<GameObject>("Pickable_Mushroom_blood"), false, new VegetationConfig
			{
				Biome = (Biome)2,
				Max = 0.1f,
				BlockCheck = true,
				GroupSizeMin = 1,
				GroupSizeMax = 1,
				GroupRadius = 4f,
				MinAltitude = 0f,
				MaxAltitude = 0.5f
			}));
			ItemManager.Instance.AddItem(new CustomItem(val.LoadAsset<GameObject>("MushroomGreen"), false, new ItemConfig
			{
				Enabled = false
			}));
			PrefabManager.Instance.AddPrefab(new CustomPrefab(val.LoadAsset<GameObject>("Pickable_Mushroom_green"), false));
			ZoneManager.Instance.AddCustomVegetation(new CustomVegetation(val.LoadAsset<GameObject>("Pickable_Mushroom_green"), false, new VegetationConfig
			{
				Biome = (Biome)2,
				Max = 0.1f,
				BlockCheck = true,
				GroupSizeMin = 1,
				GroupSizeMax = 1,
				GroupRadius = 4f,
				MinAltitude = 0.2f,
				MaxAltitude = 2f
			}));
			ZoneManager.Instance.AddCustomVegetation(new CustomVegetation(PrefabManager.Instance.GetPrefab("Pickable_Mushroom_blue"), false, new VegetationConfig
			{
				Biome = (Biome)4,
				Max = 0.1f,
				BlockCheck = true,
				GroupSizeMin = 1,
				GroupSizeMax = 1,
				GroupRadius = 4f,
				MinAltitude = 20f
			}));
			ItemManager.Instance.AddItem(new CustomItem(val.LoadAsset<GameObject>("MushroomPurple"), false, new ItemConfig
			{
				Enabled = false
			}));
			PrefabManager.Instance.AddPrefab(new CustomPrefab(val.LoadAsset<GameObject>("Pickable_Mushroom_purple"), false));
			ItemManager instance3 = ItemManager.Instance;
			GameObject obj3 = val.LoadAsset<GameObject>("MushroomRainbow");
			val2 = new ItemConfig();
			val2.Amount = 2;
			val2.CraftingStation = "piece_cauldron";
			val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[4]
			{
				new RequirementConfig
				{
					Item = "MushroomBlack",
					Amount = 1
				},
				new RequirementConfig
				{
					Item = "MushroomGreen",
					Amount = 1
				},
				new RequirementConfig
				{
					Item = "MushroomBlue",
					Amount = 1
				},
				new RequirementConfig
				{
					Item = "MushroomPurple",
					Amount = 1
				}
			};
			instance3.AddItem(new CustomItem(obj3, false, val2));
			PrefabManager.Instance.AddPrefab(val.LoadAsset<GameObject>("Pickable_Mushroom_rainbow"));
		}
	}
}
namespace tripping.Patches
{
	public class TrippingPatches
	{
		[HarmonyPatch(typeof(Player), "FixedUpdate")]
		private class playerposty
		{
			private static void Postfix(ref Player __instance)
			{
				//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ef: Expected O, but got Unknown
				//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
				//IL_0563: Unknown result type (might be due to invalid IL or missing references)
				//IL_0568: Unknown result type (might be due to invalid IL or missing references)
				//IL_04f0: Unknown result type (might be due to invalid IL or missing references)
				//IL_04ff: Unknown result type (might be due to invalid IL or missing references)
				//IL_050f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0514: Unknown result type (might be due to invalid IL or missing references)
				//IL_03c7: Unknown result type (might be due to invalid IL or missing references)
				//IL_03d6: Unknown result type (might be due to invalid IL or missing references)
				//IL_03e0: Unknown result type (might be due to invalid IL or missing references)
				//IL_03e5: Unknown result type (might be due to invalid IL or missing references)
				//IL_03ea: Unknown result type (might be due to invalid IL or missing references)
				//IL_03ef: Unknown result type (might be due to invalid IL or missing references)
				//IL_03f4: Unknown result type (might be due to invalid IL or missing references)
				//IL_05f3: Unknown result type (might be due to invalid IL or missing references)
				//IL_05f8: Unknown result type (might be due to invalid IL or missing references)
				//IL_0683: Unknown result type (might be due to invalid IL or missing references)
				//IL_0688: Unknown result type (might be due to invalid IL or missing references)
				if (!((Character)__instance).m_nview.IsValid() || !((Character)__instance).m_nview.IsOwner() || __instance.GetPlayerID() != Player.m_localPlayer.GetPlayerID())
				{
					return;
				}
				StatusEffect statusEffect = ((Character)__instance).m_seman.GetStatusEffect(StringExtensionMethods.GetStableHashCode("se_alcohol"));
				bool flag = false;
				bool flag2 = false;
				bool flag3 = false;
				bool flag4 = false;
				bool flag5 = false;
				bool flag6 = false;
				foreach (Food food in Player.m_localPlayer.m_foods)
				{
					if (food.m_name == "MushroomBlue")
					{
						flag = true;
					}
					if (food.m_name == "MushroomBlack")
					{
						flag2 = true;
						blacktimer += Time.deltaTime;
						if (blacktimer > 0.5f)
						{
							HitData val = new HitData();
							val.m_point = ((Character)__instance).GetCenterPoint();
							val.m_damage.m_spirit = 1f;
							((Character)__instance).ApplyDamage(val, true, false, (DamageModifier)0);
							blacktimer = 0f;
						}
					}
					if (food.m_name == "MushroomBlood")
					{
						flag3 = true;
					}
					if (food.m_name == "MushroomRainbow")
					{
						flag4 = true;
					}
					if (food.m_name == "MushroomPurple")
					{
						flag5 = true;
					}
					if (food.m_name == "MushroomGreen")
					{
						flag6 = true;
					}
				}
				if (flag6 || (((Humanoid)Player.m_localPlayer).m_utilityItem != null && ((Humanoid)Player.m_localPlayer).m_utilityItem.m_shared.m_name.Contains("wishbone")))
				{
					((Character)Player.m_localPlayer).m_seman.AddStatusEffect(StringExtensionMethods.GetStableHashCode("Wishbone"), false, 0, 0f);
				}
				else
				{
					((Character)Player.m_localPlayer).m_seman.RemoveStatusEffect(StringExtensionMethods.GetStableHashCode("Wishbone"), false);
				}
				if (flag5 && Time.frameCount % 200 == 0)
				{
					int num = Random.Range(1, 200);
					GameObject val2 = null;
					switch (num)
					{
					case 100:
						val2 = PrefabManager.Instance.GetPrefab("sfx_ghost_alert");
						break;
					case 99:
						val2 = PrefabManager.Instance.GetPrefab("sfx_haldor_laugh");
						break;
					case 98:
						val2 = PrefabManager.Instance.GetPrefab("sfx_land_water");
						break;
					case 97:
						val2 = PrefabManager.Instance.GetPrefab("sfx_offering");
						break;
					case 96:
						val2 = PrefabManager.Instance.GetPrefab("sfx_secretfound");
						break;
					case 95:
						val2 = PrefabManager.Instance.GetPrefab("sfx_tree_fall");
						break;
					case 94:
						val2 = PrefabManager.Instance.GetPrefab("sfx_wraith_idle");
						break;
					case 93:
						val2 = PrefabManager.Instance.GetPrefab("sfx_coins_pile_destroyed");
						break;
					case 92:
						val2 = PrefabManager.Instance.GetPrefab("sfx_eikthyr_idle");
						break;
					case 91:
						val2 = PrefabManager.Instance.GetPrefab("sfx_gui_craftitem_cauldron");
						break;
					case 90:
						val2 = PrefabManager.Instance.GetPrefab("sfx_lootspawn");
						break;
					case 89:
						((Humanoid)Player.m_localPlayer).UnequipAllItems();
						break;
					}
					if (Object.op_Implicit((Object)(object)val2))
					{
						ZLog.LogError((object)("purple sound " + ((Object)val2).name));
						Object.Instantiate<GameObject>(val2, ((Component)Player.m_localPlayer).transform.position + ((Component)Player.m_localPlayer).transform.forward * 2f + Vector3.up, Quaternion.identity);
					}
				}
				PostProcessingBehaviour component = ((Component)GameCamera.instance).gameObject.GetComponent<PostProcessingBehaviour>();
				if (!((Object)(object)component != (Object)null))
				{
					return;
				}
				if (flag4)
				{
					((PostProcessingModel)((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model).enabled = true;
					((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model.m_Settings.intensity = Mathf.Min(2f, ((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model.m_Settings.intensity + 0.01f);
					rainbowtimer += Time.deltaTime;
					if (rainbowtimer > rainbowchangeevery)
					{
						rainbowcurrent = (rainbowcurrent + 1) % rainbowcolors.Length;
						rainbownext = (rainbowcurrent + 1) % rainbowcolors.Length;
						rainbowtimer = 0f;
					}
					((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model.m_Settings.color = Color.Lerp(rainbowcolors[rainbowcurrent], rainbowcolors[rainbownext], rainbowtimer / rainbowchangeevery);
				}
				else if (flag3)
				{
					((PostProcessingModel)((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model).enabled = true;
					((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model.m_Settings.color = new Color(5f, 0f, 0f, 1f);
					((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model.m_Settings.intensity = Mathf.Min(1f, ((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model.m_Settings.intensity + 0.01f);
				}
				else if (flag2)
				{
					((PostProcessingModel)((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model).enabled = true;
					((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model.m_Settings.color = new Color(0f, 0f, 0f, 1f);
					((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model.m_Settings.intensity = Mathf.Min(0.8f, ((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model.m_Settings.intensity + 0.01f);
				}
				else if (flag)
				{
					((PostProcessingModel)((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model).enabled = true;
					((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model.m_Settings.color = new Color(0f, 0f, 2f, 1f);
					((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model.m_Settings.intensity = Mathf.Min(0.2f, ((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model.m_Settings.intensity + 0.01f);
				}
				else if (((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model.m_Settings.intensity > 0.05f)
				{
					((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model.m_Settings.intensity = Mathf.Max(0.05f, ((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model.m_Settings.intensity - 0.001f);
				}
				else
				{
					((PostProcessingModel)((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model).enabled = false;
				}
				if (flag || flag2 || flag3 || flag4 || flag5)
				{
					((PostProcessingComponent<ChromaticAberrationModel>)(object)component.m_ChromaticAberration).model.m_Settings.intensity = Mathf.Min(20f, ((PostProcessingComponent<ChromaticAberrationModel>)(object)component.m_ChromaticAberration).model.m_Settings.intensity + 0.5f);
				}
				else if ((Object)(object)statusEffect != (Object)null)
				{
					((PostProcessingComponent<ChromaticAberrationModel>)(object)component.m_ChromaticAberration).model.m_Settings.intensity += 0.003f;
				}
				else if (((PostProcessingComponent<ChromaticAberrationModel>)(object)component.m_ChromaticAberration).model.m_Settings.intensity > 0.14f)
				{
					((PostProcessingComponent<ChromaticAberrationModel>)(object)component.m_ChromaticAberration).model.m_Settings.intensity = Mathf.Max(0.14f, ((PostProcessingComponent<ChromaticAberrationModel>)(object)component.m_ChromaticAberration).model.m_Settings.intensity - 0.01f);
				}
				if (flag || flag4)
				{
					if (((PostProcessingComponent<ColorGradingModel>)(object)component.m_ColorGrading).model.m_Settings.basic.saturation != 2f)
					{
						((PostProcessingComponent<ColorGradingModel>)(object)component.m_ColorGrading).model.m_Settings.basic.saturation = Mathf.Min(2f, ((PostProcessingComponent<ColorGradingModel>)(object)component.m_ColorGrading).model.m_Settings.basic.saturation + 0.05f);
						((PostProcessingComponent<ColorGradingModel>)(object)component.m_ColorGrading).model.isDirty = true;
					}
				}
				else if (flag2 || flag6)
				{
					if (((PostProcessingComponent<ColorGradingModel>)(object)component.m_ColorGrading).model.m_Settings.basic.saturation != 0.2f)
					{
						((PostProcessingComponent<ColorGradingModel>)(object)component.m_ColorGrading).model.m_Settings.basic.saturation = 0.2f;
						((PostProcessingComponent<ColorGradingModel>)(object)component.m_ColorGrading).model.isDirty = true;
					}
				}
				else if (((PostProcessingComponent<ColorGradingModel>)(object)component.m_ColorGrading).model.m_Settings.basic.saturation != 1f)
				{
					if (((PostProcessingComponent<ColorGradingModel>)(object)component.m_ColorGrading).model.m_Settings.basic.saturation < 1f)
					{
						((PostProcessingComponent<ColorGradingModel>)(object)component.m_ColorGrading).model.m_Settings.basic.saturation = Mathf.Min(1f, ((PostProcessingComponent<ColorGradingModel>)(object)component.m_ColorGrading).model.m_Settings.basic.saturation + 0.01f);
					}
					else
					{
						((PostProcessingComponent<ColorGradingModel>)(object)component.m_ColorGrading).model.m_Settings.basic.saturation = Mathf.Max(1f, ((PostProcessingComponent<ColorGradingModel>)(object)component.m_ColorGrading).model.m_Settings.basic.saturation - 0.01f);
					}
					((PostProcessingComponent<ColorGradingModel>)(object)component.m_ColorGrading).model.isDirty = true;
				}
			}
		}

		[HarmonyPatch(typeof(Pickable), "Awake")]
		private class pickableposty
		{
			private static void Postfix(ref Pickable __instance)
			{
				((MonoBehaviour)__instance).StartCoroutine(CheckPinkMushroom(__instance));
			}
		}

		[HarmonyPatch(typeof(Pickable), "SetPicked")]
		private class pickablepostpick
		{
			private static void Postfix(bool picked, ref Pickable __instance)
			{
				if (!picked)
				{
					return;
				}
				GameObject gameObject = ((Component)((Component)__instance).transform).gameObject;
				if ((Object)(object)gameObject != (Object)null)
				{
					Transform val = gameObject.transform.Find("pinkfloaters");
					if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)((Component)val).gameObject))
					{
						Object.Destroy((Object)(object)((Component)val).gameObject);
					}
				}
			}
		}

		private static Color[] rainbowcolors = (Color[])(object)new Color[8]
		{
			new Color(5f, 0f, 0f, 1f),
			new Color(5f, 2f, 0f, 1f),
			new Color(5f, 5f, 0f, 1f),
			new Color(0f, 5f, 0f, 1f),
			new Color(0f, 3f, 2f, 1f),
			new Color(0f, 0f, 5f, 1f),
			new Color(3f, 0f, 5f, 1f),
			new Color(4f, 0f, 2f, 1f)
		};

		private static int rainbowcurrent = 0;

		private static int rainbownext = 1;

		private static float rainbowtimer = 0f;

		private static float rainbowchangeevery = 0.5f;

		private static float blacktimer = 0f;

		public static IEnumerator CheckPinkMushroom(Pickable __instance)
		{
			while (true)
			{
				if (__instance.m_nview.IsValid() && (Object)(object)Player.m_localPlayer != (Object)null && ((Character)Player.m_localPlayer).m_nview.IsValid())
				{
					bool pinkshroom = false;
					foreach (Food food in Player.m_localPlayer.m_foods)
					{
						if (food.m_name == "MushroomPink")
						{
							pinkshroom = true;
						}
					}
					if (!__instance.m_picked && pinkshroom)
					{
						GameObject parento2 = ((Component)((Component)__instance).transform).gameObject;
						if ((Object)(object)parento2 != (Object)null)
						{
							bool found = false;
							Transform floaterstransform2 = parento2.transform.Find("pinkfloaters");
							if (Object.op_Implicit((Object)(object)floaterstransform2) && Object.op_Implicit((Object)(object)((Component)floaterstransform2).gameObject))
							{
								found = true;
							}
							if (!found)
							{
								GameObject pinkprefab = PrefabManager.Instance.GetPrefab("MushroomPink");
								if (Object.op_Implicit((Object)(object)pinkprefab))
								{
									Transform pinkfloaterstransform = pinkprefab.transform.Find("attach/floaters");
									if (Object.op_Implicit((Object)(object)pinkfloaterstransform) && Object.op_Implicit((Object)(object)((Component)pinkfloaterstransform).gameObject))
									{
										GameObject pinkfloaters = Object.Instantiate<GameObject>(((Component)pinkfloaterstransform).gameObject, parento2.transform);
										((Object)pinkfloaters).name = "pinkfloaters";
										pinkfloaters.transform.localScale = new Vector3(2f, 2f, 2f);
									}
									else
									{
										Logger.LogError((object)"failed to find MushroomPink floaters");
									}
								}
								else
								{
									Logger.LogError((object)"failed to find MushroomPink");
								}
							}
						}
					}
					else
					{
						GameObject parento = ((Component)((Component)__instance).transform).gameObject;
						if ((Object)(object)parento != (Object)null)
						{
							Transform floaterstransform = parento.transform.Find("pinkfloaters");
							if (Object.op_Implicit((Object)(object)floaterstransform) && Object.op_Implicit((Object)(object)((Component)floaterstransform).gameObject))
							{
								Object.Destroy((Object)(object)((Component)floaterstransform).gameObject);
							}
						}
					}
				}
				yield return (object)new WaitForSeconds(Random.Range(10f, 20f));
			}
		}
	}
}

ValheimRoleplay.dll

Decompiled 5 hours ago
using System;
using System.Collections;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Linq.Expressions;
using System.Net;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Cryptography;
using System.Security.Permissions;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using JetBrains.Annotations;
using Jotunn;
using Jotunn.Configs;
using Jotunn.Entities;
using Jotunn.Managers;
using Jotunn.Utils;
using Microsoft.CodeAnalysis;
using ServerSync;
using SimpleJson;
using TMPro;
using UnityEngine;
using UnityEngine.Networking;
using UnityEngine.PostProcessing;
using UnityEngine.UI;
using ValheimRoleplay.Patches;
using YamlDotNet.Core;
using YamlDotNet.Core.Events;
using YamlDotNet.Core.Tokens;
using YamlDotNet.Helpers;
using YamlDotNet.Serialization;
using YamlDotNet.Serialization.BufferedDeserialization;
using YamlDotNet.Serialization.BufferedDeserialization.TypeDiscriminators;
using YamlDotNet.Serialization.Converters;
using YamlDotNet.Serialization.EventEmitters;
using YamlDotNet.Serialization.NamingConventions;
using YamlDotNet.Serialization.NodeDeserializers;
using YamlDotNet.Serialization.NodeTypeResolvers;
using YamlDotNet.Serialization.ObjectFactories;
using YamlDotNet.Serialization.ObjectGraphTraversalStrategies;
using YamlDotNet.Serialization.ObjectGraphVisitors;
using YamlDotNet.Serialization.Schemas;
using YamlDotNet.Serialization.TypeInspectors;
using YamlDotNet.Serialization.TypeResolvers;
using YamlDotNet.Serialization.Utilities;
using YamlDotNet.Serialization.ValueDeserializers;

[assembly: AssemblyFileVersion("1.0.0")]
[assembly: Guid("4358610B-F3F4-4843-B7AF-98B7BC60DCDE")]
[assembly: ComVisible(false)]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCopyright("Copyright ©  2025")]
[assembly: AssemblyProduct("ValheimRoleplay")]
[assembly: AssemblyCompany("Arielle")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyTitle("ValheimRoleplay")]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: CompilationRelaxations(8)]
[assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[<5518009c-148a-416f-9de6-fb697a9ac6fa>Embedded]
	internal sealed class <5518009c-148a-416f-9de6-fb697a9ac6fa>EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[<5518009c-148a-416f-9de6-fb697a9ac6fa>Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class <3410fd21-c857-4c99-a981-7ca28a98eb02>NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public <3410fd21-c857-4c99-a981-7ca28a98eb02>NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public <3410fd21-c857-4c99-a981-7ca28a98eb02>NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[<5518009c-148a-416f-9de6-fb697a9ac6fa>Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class <5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public <5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
}
namespace LocalizationManager
{
	[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
	[PublicAPI]
	[<3410fd21-c857-4c99-a981-7ca28a98eb02>Nullable(0)]
	public class Localizer
	{
		private static readonly Dictionary<string, Dictionary<string, Func<string>>> PlaceholderProcessors;

		private static readonly Dictionary<string, Dictionary<string, string>> loadedTexts;

		private static readonly ConditionalWeakTable<Localization, string> localizationLanguage;

		private static readonly List<WeakReference<Localization>> localizationObjects;

		[<3410fd21-c857-4c99-a981-7ca28a98eb02>Nullable(2)]
		private static BaseUnityPlugin _plugin;

		private static readonly List<string> fileExtensions;

		private static BaseUnityPlugin plugin
		{
			get
			{
				//IL_009b: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a5: Expected O, but got Unknown
				if (_plugin == null)
				{
					IEnumerable<TypeInfo> source;
					try
					{
						source = Assembly.GetExecutingAssembly().DefinedTypes.ToList();
					}
					catch (ReflectionTypeLoadException ex)
					{
						source = from t in ex.Types
							where t != null
							select t.GetTypeInfo();
					}
					_plugin = (BaseUnityPlugin)Chainloader.ManagerObject.GetComponent((Type)source.First([<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(0)] (TypeInfo t) => t.IsClass && typeof(BaseUnityPlugin).IsAssignableFrom(t)));
				}
				return _plugin;
			}
		}

		private static void UpdatePlaceholderText(Localization localization, string key)
		{
			localizationLanguage.TryGetValue(localization, out var value);
			string text = loadedTexts[value][key];
			if (PlaceholderProcessors.TryGetValue(key, out var value2))
			{
				text = value2.Aggregate(text, [<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(0)] (string current, KeyValuePair<string, Func<string>> kv) => current.Replace("{" + kv.Key + "}", kv.Value()));
			}
			localization.AddWord(key, text);
		}

		public static void AddPlaceholder<T>(string key, string placeholder, ConfigEntry<T> config, [<3410fd21-c857-4c99-a981-7ca28a98eb02>Nullable(new byte[] { 2, 1, 1 })] Func<T, string> convertConfigValue = null)
		{
			if (convertConfigValue == null)
			{
				convertConfigValue = (T val) => val.ToString();
			}
			if (!PlaceholderProcessors.ContainsKey(key))
			{
				PlaceholderProcessors[key] = new Dictionary<string, Func<string>>();
			}
			config.SettingChanged += [<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(0)] (object _, EventArgs _) =>
			{
				UpdatePlaceholder();
			};
			if (loadedTexts.ContainsKey(Localization.instance.GetSelectedLanguage()))
			{
				UpdatePlaceholder();
			}
			void UpdatePlaceholder()
			{
				PlaceholderProcessors[key][placeholder] = () => convertConfigValue(config.Value);
				UpdatePlaceholderText(Localization.instance, key);
			}
		}

		public static void AddText(string key, string text)
		{
			List<WeakReference<Localization>> list = new List<WeakReference<Localization>>();
			foreach (WeakReference<Localization> localizationObject in localizationObjects)
			{
				if (localizationObject.TryGetTarget(out var target))
				{
					Dictionary<string, string> dictionary = loadedTexts[localizationLanguage.GetOrCreateValue(target)];
					if (!target.m_translations.ContainsKey(key))
					{
						dictionary[key] = text;
						target.AddWord(key, text);
					}
				}
				else
				{
					list.Add(localizationObject);
				}
			}
			foreach (WeakReference<Localization> item in list)
			{
				localizationObjects.Remove(item);
			}
		}

		public static void Load()
		{
			LoadLocalization(Localization.instance, Localization.instance.GetSelectedLanguage());
		}

		private static void LoadLocalization(Localization __instance, string language)
		{
			if (!localizationLanguage.Remove(__instance))
			{
				localizationObjects.Add(new WeakReference<Localization>(__instance));
			}
			localizationLanguage.Add(__instance, language);
			Dictionary<string, string> dictionary = new Dictionary<string, string>();
			foreach (string item in from f in Directory.GetFiles(Path.GetDirectoryName(Paths.PluginPath), plugin.Info.Metadata.Name + ".*", SearchOption.AllDirectories)
				where fileExtensions.IndexOf(Path.GetExtension(f)) >= 0
				select f)
			{
				string text = Path.GetFileNameWithoutExtension(item).Split(new char[1] { '.' })[1];
				if (dictionary.ContainsKey(text))
				{
					Debug.LogWarning((object)("Duplicate key " + text + " found for " + plugin.Info.Metadata.Name + ". The duplicate file found at " + item + " will be skipped."));
				}
				else
				{
					dictionary[text] = item;
				}
			}
			byte[] array = LoadTranslationFromAssembly("English");
			if (array == null)
			{
				throw new Exception("Found no English localizations in mod " + plugin.Info.Metadata.Name + ". Expected an embedded resource translations/English.json or translations/English.yml.");
			}
			Dictionary<string, string> dictionary2 = new DeserializerBuilder().IgnoreFields().Build().Deserialize<Dictionary<string, string>>(Encoding.UTF8.GetString(array));
			if (dictionary2 == null)
			{
				throw new Exception("Localization for mod " + plugin.Info.Metadata.Name + " failed: Localization file was empty.");
			}
			string text2 = null;
			if (language != "English")
			{
				if (dictionary.ContainsKey(language))
				{
					text2 = File.ReadAllText(dictionary[language]);
				}
				else
				{
					byte[] array2 = LoadTranslationFromAssembly(language);
					if (array2 != null)
					{
						text2 = Encoding.UTF8.GetString(array2);
					}
				}
			}
			if (text2 == null && dictionary.ContainsKey("English"))
			{
				text2 = File.ReadAllText(dictionary["English"]);
			}
			if (text2 != null)
			{
				foreach (KeyValuePair<string, string> item2 in new DeserializerBuilder().IgnoreFields().Build().Deserialize<Dictionary<string, string>>(text2) ?? new Dictionary<string, string>())
				{
					dictionary2[item2.Key] = item2.Value;
				}
			}
			loadedTexts[language] = dictionary2;
			foreach (KeyValuePair<string, string> item3 in dictionary2)
			{
				UpdatePlaceholderText(__instance, item3.Key);
			}
		}

		static Localizer()
		{
			//IL_004d: 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_008c: Expected O, but got Unknown
			PlaceholderProcessors = new Dictionary<string, Dictionary<string, Func<string>>>();
			loadedTexts = new Dictionary<string, Dictionary<string, string>>();
			localizationLanguage = new ConditionalWeakTable<Localization, string>();
			localizationObjects = new List<WeakReference<Localization>>();
			fileExtensions = new List<string> { ".json", ".yml" };
			new Harmony("org.bepinex.helpers.LocalizationManager").Patch((MethodBase)AccessTools.DeclaredMethod(typeof(Localization), "LoadCSV", (Type[])null, (Type[])null), (HarmonyMethod)null, new HarmonyMethod(AccessTools.DeclaredMethod(typeof(Localizer), "LoadLocalization", (Type[])null, (Type[])null)), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
		}

		[return: <3410fd21-c857-4c99-a981-7ca28a98eb02>Nullable(2)]
		private static byte[] LoadTranslationFromAssembly(string language)
		{
			foreach (string fileExtension in fileExtensions)
			{
				byte[] array = ReadEmbeddedFileBytes("translations." + language + fileExtension);
				if (array != null)
				{
					return array;
				}
			}
			return null;
		}

		[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(2)]
		public static byte[] ReadEmbeddedFileBytes([<3410fd21-c857-4c99-a981-7ca28a98eb02>Nullable(1)] string resourceFileName, Assembly containingAssembly = null)
		{
			using MemoryStream memoryStream = new MemoryStream();
			if ((object)containingAssembly == null)
			{
				containingAssembly = Assembly.GetCallingAssembly();
			}
			string text = containingAssembly.GetManifestResourceNames().FirstOrDefault([<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(0)] (string str) => str.EndsWith(resourceFileName, StringComparison.Ordinal));
			if (text != null)
			{
				containingAssembly.GetManifestResourceStream(text)?.CopyTo(memoryStream);
			}
			return (memoryStream.Length == 0L) ? null : memoryStream.ToArray();
		}
	}
}
namespace ValheimRoleplay
{
	[Serializable]
	[<3410fd21-c857-4c99-a981-7ca28a98eb02>Nullable(0)]
	[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
	public class DbLog
	{
		public string p { get; set; }

		public string i { get; set; }

		public string a { get; set; }

		public string c { get; set; }

		public string r { get; set; }
	}
	[Serializable]
	[<3410fd21-c857-4c99-a981-7ca28a98eb02>Nullable(0)]
	[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
	public class DbPlayer
	{
		public string player { get; set; }
	}
	[Serializable]
	[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
	[<3410fd21-c857-4c99-a981-7ca28a98eb02>Nullable(0)]
	public class DbWhitelist
	{
		public int pid { get; set; }

		public int cid { get; set; }

		public string steamid { get; set; }

		public string charactername { get; set; }

		public bool isnew { get; set; }

		public bool banned { get; set; }

		public bool permadeath { get; set; }
	}
	[Serializable]
	[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
	[<3410fd21-c857-4c99-a981-7ca28a98eb02>Nullable(0)]
	public class DbWhitelistNew
	{
		public int pid { get; set; }

		public int cid { get; set; }

		public string steamid { get; set; }

		public string charName { get; set; }
	}
	[Serializable]
	[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
	[<3410fd21-c857-4c99-a981-7ca28a98eb02>Nullable(0)]
	public class DbGroup
	{
		public int id { get; set; }

		public string charName { get; set; }

		public string groupName { get; set; }

		public bool deleted { get; set; }
	}
	[Serializable]
	[<3410fd21-c857-4c99-a981-7ca28a98eb02>Nullable(0)]
	[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
	public class DbRecipe
	{
		public int id { get; set; }

		public string recipeName { get; set; }

		public string groups { get; set; }

		public bool enabled { get; set; }

		public bool deleted { get; set; }
	}
	[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
	[<3410fd21-c857-4c99-a981-7ca28a98eb02>Nullable(0)]
	internal class Api
	{
		public static IEnumerator LogInsert(string json)
		{
			UnityWebRequest request = new UnityWebRequest("http://localhost:3333/db/log/insert", "POST");
			try
			{
				byte[] bytes = Encoding.UTF8.GetBytes(json);
				request.uploadHandler = (UploadHandler)new UploadHandlerRaw(bytes);
				request.downloadHandler = (DownloadHandler)new DownloadHandlerBuffer();
				request.SetRequestHeader("Content-Type", "application/json");
				yield return request.SendWebRequest();
			}
			finally
			{
				((IDisposable)request)?.Dispose();
			}
		}

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

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

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

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

		public static IEnumerator ServerGetRecipes()
		{
			UnityWebRequest request = UnityWebRequest.Get("http://localhost:3333/db/recipes");
			yield return request.SendWebRequest();
			if ((int)request.result == 1)
			{
				ServerPatches.recipesraw = Encoding.UTF8.GetString(request.downloadHandler.data);
			}
			else
			{
				ZLog.LogError((object)"error in recipes request");
			}
		}
	}
	[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
	[<3410fd21-c857-4c99-a981-7ca28a98eb02>Nullable(0)]
	[BepInPlugin("Arielle.ValheimRoleplay", "ValheimRoleplay", "1.0.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class VRPMod : BaseUnityPlugin
	{
		[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(0)]
		public enum Toggle
		{
			On = 1,
			Off = 0
		}

		[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(0)]
		private class ConfigurationManagerAttributes
		{
			[UsedImplicitly]
			public int? Order;

			[UsedImplicitly]
			public bool? Browsable;

			[UsedImplicitly]
			[<3410fd21-c857-4c99-a981-7ca28a98eb02>Nullable(2)]
			public string Category;

			[UsedImplicitly]
			[<3410fd21-c857-4c99-a981-7ca28a98eb02>Nullable(new byte[] { 2, 1 })]
			public Action<ConfigEntryBase> CustomDrawer;
		}

		internal const string ModName = "ValheimRoleplay";

		internal const string ModVersion = "1.0.0";

		internal const string Author = "Arielle";

		private const string ModGUID = "Arielle.ValheimRoleplay";

		private static string ConfigFileName = "Arielle.ValheimRoleplay.cfg";

		private static string ConfigFileFullPath;

		internal static string ConnectionError;

		private readonly Harmony _harmony = new Harmony("Arielle.ValheimRoleplay");

		public static readonly ManualLogSource ValheimRoleplayLogger;

		private static readonly ConfigSync ConfigSync;

		private static ConfigEntry<Toggle> _serverConfigLocked;

		private static ConfigEntry<Toggle> _recipeIsActiveConfig;

		public void Awake()
		{
			_serverConfigLocked = config("1 - General", "Lock Configuration", Toggle.On, "If on, the configuration is locked and can be changed by server admins only.");
			ConfigSync.AddLockingConfigEntry<Toggle>(_serverConfigLocked);
			ClientPatches._vrpLore = config("2 - VRP", "Season Lore", "Hello World", "Intro text for new players.");
			ConfigSync.AddConfigEntry<string>(ClientPatches._vrpLore);
			_harmony.PatchAll();
			JotunnPatches.AddVariants();
			SetupWatcher();
		}

		private void OnDestroy()
		{
			((BaseUnityPlugin)this).Config.Save();
		}

		private void SetupWatcher()
		{
			FileSystemWatcher fileSystemWatcher = new FileSystemWatcher(Paths.ConfigPath, ConfigFileName);
			fileSystemWatcher.Changed += ReadConfigValues;
			fileSystemWatcher.Created += ReadConfigValues;
			fileSystemWatcher.Renamed += ReadConfigValues;
			fileSystemWatcher.IncludeSubdirectories = true;
			fileSystemWatcher.SynchronizingObject = ThreadingHelper.SynchronizingObject;
			fileSystemWatcher.EnableRaisingEvents = true;
		}

		private void ReadConfigValues(object sender, FileSystemEventArgs e)
		{
			if (!File.Exists(ConfigFileFullPath))
			{
				return;
			}
			try
			{
				ValheimRoleplayLogger.LogDebug((object)"ReadConfigValues called");
				((BaseUnityPlugin)this).Config.Reload();
			}
			catch
			{
				ValheimRoleplayLogger.LogError((object)("There was an issue loading your " + ConfigFileName));
				ValheimRoleplayLogger.LogError((object)"Please check your config entries for spelling and format!");
			}
		}

		private ConfigEntry<T> config<[<3410fd21-c857-4c99-a981-7ca28a98eb02>Nullable(2)] T>(string group, string name, T value, ConfigDescription description, bool synchronizedSetting = true)
		{
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Expected O, but got Unknown
			ConfigDescription val = new ConfigDescription(description.Description + (synchronizedSetting ? " [Synced with Server]" : " [Not Synced with Server]"), description.AcceptableValues, description.Tags);
			ConfigEntry<T> val2 = ((BaseUnityPlugin)this).Config.Bind<T>(group, name, value, val);
			ConfigSync.AddConfigEntry<T>(val2).SynchronizedConfig = synchronizedSetting;
			return val2;
		}

		private ConfigEntry<T> config<[<3410fd21-c857-4c99-a981-7ca28a98eb02>Nullable(2)] T>(string group, string name, T value, string description, bool synchronizedSetting = true)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Expected O, but got Unknown
			return config(group, name, value, new ConfigDescription(description, (AcceptableValueBase)null, Array.Empty<object>()), synchronizedSetting);
		}

		static VRPMod()
		{
			string configPath = Paths.ConfigPath;
			char directorySeparatorChar = Path.DirectorySeparatorChar;
			ConfigFileFullPath = configPath + directorySeparatorChar + ConfigFileName;
			ConnectionError = "";
			ValheimRoleplayLogger = Logger.CreateLogSource("ValheimRoleplay");
			ConfigSync = new ConfigSync("Arielle.ValheimRoleplay")
			{
				DisplayName = "ValheimRoleplay",
				CurrentVersion = "1.0.0",
				MinimumRequiredVersion = "1.0.0"
			};
			_serverConfigLocked = null;
			_recipeIsActiveConfig = null;
		}
	}
	public static class KeyboardExtensions
	{
		public static bool IsKeyDown(this KeyboardShortcut shortcut)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			if ((int)((KeyboardShortcut)(ref shortcut)).MainKey != 0 && Input.GetKeyDown(((KeyboardShortcut)(ref shortcut)).MainKey))
			{
				return ((KeyboardShortcut)(ref shortcut)).Modifiers.All((Func<KeyCode, bool>)Input.GetKey);
			}
			return false;
		}

		public static bool IsKeyHeld(this KeyboardShortcut shortcut)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			if ((int)((KeyboardShortcut)(ref shortcut)).MainKey != 0 && Input.GetKey(((KeyboardShortcut)(ref shortcut)).MainKey))
			{
				return ((KeyboardShortcut)(ref shortcut)).Modifiers.All((Func<KeyCode, bool>)Input.GetKey);
			}
			return false;
		}
	}
	[HarmonyPatch(typeof(ZNet), "OnNewConnection")]
	public static class RegisterAndCheckVersion
	{
		[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
		private static void Prefix(ZNetPeer peer, ref ZNet __instance)
		{
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Expected O, but got Unknown
			VRPMod.ValheimRoleplayLogger.LogDebug((object)"Registering version RPC handler");
			peer.m_rpc.Register<ZPackage>("ValheimRoleplay_VersionCheck", (Action<ZRpc, ZPackage>)RpcHandlers.RPC_ValheimRoleplay_Version);
			VRPMod.ValheimRoleplayLogger.LogInfo((object)"Invoking version check");
			ZPackage val = new ZPackage();
			val.Write("1.0.0");
			peer.m_rpc.Invoke("ValheimRoleplay_VersionCheck", new object[1] { val });
		}
	}
	[HarmonyPatch(typeof(ZNet), "RPC_PeerInfo")]
	[<3410fd21-c857-4c99-a981-7ca28a98eb02>Nullable(0)]
	[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
	public static class VerifyClient
	{
		private static bool Prefix(ZRpc rpc, ZPackage pkg, ref ZNet __instance)
		{
			if (!__instance.IsServer() || RpcHandlers.ValidatedPeers.Contains(rpc))
			{
				return true;
			}
			VRPMod.ValheimRoleplayLogger.LogWarning((object)("Peer (" + rpc.m_socket.GetHostName() + ") never sent version or couldn't due to previous disconnect, disconnecting"));
			rpc.Invoke("Error", new object[1] { 3 });
			return false;
		}

		private static void Postfix(ZNet __instance)
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Expected O, but got Unknown
			ZRoutedRpc.instance.InvokeRoutedRPC(ZRoutedRpc.instance.GetServerPeerID(), "ValheimRoleplayRequestAdminSync", new object[1] { (object)new ZPackage() });
		}
	}
	[HarmonyPatch(typeof(FejdStartup), "ShowConnectError")]
	public class ShowConnectionError
	{
		[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
		private static void Postfix(FejdStartup __instance)
		{
			if (__instance.m_connectionFailedPanel.activeSelf)
			{
				__instance.m_connectionFailedError.fontSizeMax = 25f;
				__instance.m_connectionFailedError.fontSizeMin = 15f;
				TMP_Text connectionFailedError = __instance.m_connectionFailedError;
				connectionFailedError.text = connectionFailedError.text + "\n" + VRPMod.ConnectionError;
			}
		}
	}
	[HarmonyPatch(typeof(ZNet), "Disconnect")]
	public static class RemoveDisconnectedPeerFromVerified
	{
		[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
		private static void Prefix(ZNetPeer peer, ref ZNet __instance)
		{
			if (__instance.IsServer())
			{
				VRPMod.ValheimRoleplayLogger.LogInfo((object)("Peer (" + peer.m_rpc.m_socket.GetHostName() + ") disconnected, removing from validated list"));
				RpcHandlers.ValidatedPeers.Remove(peer.m_rpc);
			}
		}
	}
	[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
	[<3410fd21-c857-4c99-a981-7ca28a98eb02>Nullable(0)]
	public static class RpcHandlers
	{
		public static readonly List<ZRpc> ValidatedPeers = new List<ZRpc>();

		public static void RPC_ValheimRoleplay_Version(ZRpc rpc, ZPackage pkg)
		{
			string text = pkg.ReadString();
			VRPMod.ValheimRoleplayLogger.LogInfo((object)("Version check, local: 1.0.0,  remote: " + text));
			if (text != "1.0.0")
			{
				VRPMod.ConnectionError = "ValheimRoleplay Installed: 1.0.0\n Needed: " + text;
				if (ZNet.instance.IsServer())
				{
					VRPMod.ValheimRoleplayLogger.LogWarning((object)("Peer (" + rpc.m_socket.GetHostName() + ") has incompatible version, disconnecting..."));
					rpc.Invoke("Error", new object[1] { 3 });
				}
			}
			else if (!ZNet.instance.IsServer())
			{
				VRPMod.ValheimRoleplayLogger.LogInfo((object)"Received same version from server!");
			}
			else
			{
				VRPMod.ValheimRoleplayLogger.LogInfo((object)("Adding peer (" + rpc.m_socket.GetHostName() + ") to validated list"));
				ValidatedPeers.Add(rpc);
			}
		}

		public static string ComputeHashForMod()
		{
			using SHA256 sHA = SHA256.Create();
			byte[] array = sHA.ComputeHash(File.ReadAllBytes(Assembly.GetExecutingAssembly().Location));
			StringBuilder stringBuilder = new StringBuilder();
			byte[] array2 = array;
			foreach (byte b in array2)
			{
				stringBuilder.Append(b.ToString("X2"));
			}
			return stringBuilder.ToString();
		}
	}
}
namespace ValheimRoleplay.Patches
{
	public class ClientPatches
	{
		[HarmonyPatch(typeof(GameVersion), "ToString")]
		private class fixver
		{
			[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
			private static void Postfix(GameVersion __instance, ref string __result)
			{
				//IL_0000: Unknown result type (might be due to invalid IL or missing references)
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				if (__instance == Version.CurrentVersion)
				{
					__result += "-vrp1.0.0";
				}
			}
		}

		[HarmonyPatch(typeof(FejdStartup), "ShowCharacterSelection")]
		public static class checkforbadmods2
		{
			private static void Postfix()
			{
				StringBuilder stringBuilder = new StringBuilder("Mods Installed:\n");
				foreach (KeyValuePair<string, PluginInfo> pluginInfo in Chainloader.PluginInfos)
				{
					string text = pluginInfo.Key.ToString().ToUpperInvariant();
					string text2 = $"{pluginInfo.Value.Metadata.Name} - {pluginInfo.Value.Metadata.Version}";
					stringBuilder.AppendLine(text2 + " : " + text);
				}
				ZLog.Log((object)stringBuilder.ToString());
			}
		}

		[HarmonyPatch(typeof(ZNet), "RPC_ClientHandshake")]
		public static class checkforbadmods
		{
			private static void Postfix()
			{
				//IL_048c: Unknown result type (might be due to invalid IL or missing references)
				Dictionary<string, bool> dictionary = new Dictionary<string, bool>();
				Dictionary<string, bool> dictionary2 = new Dictionary<string, bool>();
				int num = 0;
				bool flag = false;
				if (ZNet.instance.IsServer())
				{
					return;
				}
				ZLog.LogWarning((object)"VRP CLIENT 1.0.0");
				if ((Object)(object)Game.instance != (Object)null && Game.instance.m_playerProfile != null && isAdmin())
				{
					ZLog.LogError((object)"VRP ADMIN");
					dictionary2.Add("SERVER_DEVCOMMANDS", value: false);
					dictionary2.Add("SKTOOLBOX", value: false);
					dictionary2.Add("EASYSPAWNER", value: false);
					dictionary2.Add("TERRAINRESET", value: false);
					dictionary2.Add("MAPTELEPORT", value: false);
					dictionary2.Add("MARCOPOGO.PLANBUILD", value: false);
					dictionary2.Add("UNITYEXPLORER", value: false);
					dictionary2.Add("INFINITY_HAMMER", value: false);
					dictionary2.Add("VNEI", value: false);
					dictionary2.Add("DEVCOMMANDS", value: false);
					dictionary2.Add("XRAY", value: false);
					dictionary2.Add("ESP", value: false);
					dictionary2.Add("WORLD_EDIT_COMMANDS", value: false);
					dictionary2.Add("ZONESCOUTER", value: false);
				}
				dictionary.Add("COM.JOTUNN.JOTUNN", value: false);
				dictionary.Add("ARIELLE.VALHEIMROLEPLAY", value: false);
				dictionary.Add("1010101110.GOLDBEES", value: false);
				dictionary.Add("1010101110.MODELCHANGER", value: false);
				dictionary.Add("1010101110.SHROOMS", value: false);
				dictionary.Add("1010101110.VRPSTABLE", value: false);
				dictionary.Add("BETTERCONTINENTS", value: false);
				dictionary.Add("UPGRADE_WORLD", value: false);
				dictionary.Add("ASHARPPEN.VALHEIM.SPAWN_THAT", value: false);
				dictionary.Add("ASHARPPEN.VALHEIM.DROP_THAT", value: false);
				dictionary.Add("ORG.BEPINEX.PLUGINS.CREATURELEVELCONTROL", value: false);
				dictionary.Add("ORG.BEPINEX.PLUGINS.SERVERCHARACTERS", value: false);
				dictionary.Add("AZUMATT.AZUANTIARTHRITICCRAFTING", value: false);
				dictionary.Add("AZUMATT.AZUCLOCK", value: false);
				dictionary.Add("BLACKS7AR.COREWOODPIECES", value: false);
				dictionary.Add("BLACKS7AR.DARKWOODFURNITURES", value: false);
				dictionary.Add("BLACKS7AR.OREMINES", value: false);
				dictionary.Add("BLACKS7AR.SIMPLEELEVATORS", value: false);
				dictionary.Add("BRUCE.VALHEIM.COMFY.DUMPSTERFIRE", value: false);
				dictionary.Add("CW_JESSE.BETTERNETWORKING", value: false);
				dictionary2.Add("VALHEIM.DISPLAYINFO", value: false);
				dictionary2.Add("BRUCE.VALHEIM.COMFYMODS.GIZMO", value: false);
				dictionary2.Add("COM.BRUCE.VALHEIM.COMFYQUICKSLOTS", value: false);
				dictionary.Add("NEOBOTICS.VALHEIM_MOD.HUDCOMPASS", value: false);
				dictionary.Add("ORG.JROBSONCHASE.VALHEIM.PLUGINS.POSITIONALAUDIO", value: false);
				dictionary.Add("RAELAZIEL.ODINHORSE", value: false);
				dictionary.Add("SHUDNAL.MOREGATESEXTENDED", value: false);
				dictionary.Add("RUSTYMODS.CUSTOMBANNERS", value: false);
				dictionary.Add("SHUDNAL.SEASONS", value: false);
				dictionary.Add("SOUTHSIL.SOUTHSILARMOR", value: false);
				dictionary.Add("VAPOK.MODS.ADVENTUREBACKPACKS", value: false);
				dictionary2.Add("VIRTUACODE.VALHEIM.EMOTEWHEEL", value: false);
				dictionary.Add("WACKYMOLE.WACKYSDATABASE", value: false);
				num += dictionary.Count;
				num++;
				num++;
				foreach (KeyValuePair<string, PluginInfo> pluginInfo in Chainloader.PluginInfos)
				{
					string text = pluginInfo.Key.ToString().ToUpperInvariant();
					foreach (string item in dictionary.Keys.ToList())
					{
						if (Contains(text, item, StringComparison.InvariantCultureIgnoreCase))
						{
							ZLog.Log((object)("VRP CLIENT - found required plugin " + item + " " + text));
							dictionary[item] = true;
						}
					}
					foreach (string item2 in dictionary2.Keys.ToList())
					{
						if (Contains(text, item2, StringComparison.InvariantCultureIgnoreCase))
						{
							ZLog.Log((object)("VRP CLIENT - found optional plugin " + item2));
							dictionary2[item2] = true;
							num++;
						}
					}
				}
				foreach (KeyValuePair<string, bool> item3 in dictionary)
				{
					if (!item3.Value)
					{
						ZLog.LogError((object)("VRP CLIENT - did not find required plugin " + item3.Key));
						flag = true;
					}
				}
				if (Chainloader.PluginInfos.Count > num)
				{
					ZLog.LogError((object)("VRP CLIENT - #plugins req" + num + " found" + Chainloader.PluginInfos.Count));
					flag = true;
				}
				if (!flag)
				{
					return;
				}
				ZLog.LogError((object)"VRP ERROR");
				foreach (KeyValuePair<string, PluginInfo> pluginInfo2 in Chainloader.PluginInfos)
				{
					ZLog.Log((object)pluginInfo2.Key.ToString().ToUpper());
				}
				ZNet.m_connectionStatus = (ConnectionStatus)12;
			}
		}

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

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

		[<3410fd21-c857-4c99-a981-7ca28a98eb02>Nullable(0)]
		[HarmonyPatch(typeof(PrivateArea), "Awake")]
		[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
		private class wardrange
		{
			private static bool Prefix(ref PrivateArea __instance)
			{
				if (Object.op_Implicit((Object)(object)__instance))
				{
					Piece component = ((Component)__instance).gameObject.GetComponent<Piece>();
					_ = (Object)(object)component != (Object)null;
					if (component.m_name == "WardAdmin")
					{
						__instance.m_radius = 100f;
					}
					if (component.m_name == "Gloam Ward")
					{
						__instance.m_radius = 40f;
					}
					else
					{
						__instance.m_radius = 25f;
					}
				}
				return true;
			}

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

		[HarmonyPatch(typeof(PrivateArea), "GetHoverText")]
		private class wardText
		{
			[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
			private static void Postfix(ref string __result, ref PrivateArea __instance)
			{
				if (!((Object)(object)Player.m_localPlayer != (Object)null) || string.IsNullOrWhiteSpace(__result))
				{
					return;
				}
				string value = ((Character)Player.m_localPlayer).GetHoverName().ToUpperInvariant();
				string text = __result.ToUpperInvariant();
				if (!isAdmin() && !text.Contains(value))
				{
					if (__instance.IsEnabled())
					{
						__result = "unauthorized - active";
					}
					else
					{
						__result = "unauthorized - deactivated" + Environment.NewLine + "press e to add yourself to this ward";
					}
					return;
				}
				long @long = __instance.m_nview.GetZDO().GetLong("decaytimer", 123L);
				if (@long != 123)
				{
					DateTime dateTime = new DateTime(@long).AddDays(10.0).ToLocalTime();
					__result = __result + "\n[<color=purple><b>" + dateTime.ToShortDateString() + " " + dateTime.ToShortTimeString() + "</b></color>] until decay" + Environment.NewLine;
				}
				Piece component = ((Component)__instance).gameObject.GetComponent<Piece>();
				if ((Object)(object)component != (Object)null)
				{
					if (component.m_name == "Gloam Ward")
					{
						__result += "use 5 gloam to recharge this ward!";
					}
					if (component.m_name == "Floam Ward")
					{
						__result += "use 5 floam to recharge this ward!";
					}
				}
			}
		}

		[HarmonyPatch(typeof(PrivateArea), "UseItem")]
		private class wardupdate
		{
			[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
			private static void Postfix(Humanoid user, ItemData item, ref PrivateArea __instance, ref bool __result)
			{
				Piece component = ((Component)__instance).gameObject.GetComponent<Piece>();
				if (!((Object)(object)component != (Object)null))
				{
					return;
				}
				if (component.m_name == "Gloam Ward" && item.m_shared.m_name == "Gloam")
				{
					if (__instance.m_nview.IsValid())
					{
						Inventory inventory = user.GetInventory();
						if (inventory.CountItems(item.m_shared.m_name, -1, true) >= 5)
						{
							((Character)user).Message((MessageType)2, "the ward is recharged", 0, (Sprite)null);
							inventory.RemoveItem(item, 5);
							__instance.m_nview.GetZDO().Set("decaytimer", DateTime.Now.Ticks);
						}
					}
					__result = true;
				}
				if (!(component.m_name == "Floam Ward") || !(item.m_shared.m_name == "Floam"))
				{
					return;
				}
				if (__instance.m_nview.IsValid())
				{
					Inventory inventory2 = user.GetInventory();
					if (inventory2.CountItems(item.m_shared.m_name, -1, true) >= 5)
					{
						((Character)user).Message((MessageType)2, "the ward is recharged", 0, (Sprite)null);
						inventory2.RemoveItem(item, 5);
						__instance.m_nview.GetZDO().Set("decaytimer", DateTime.Now.Ticks);
					}
				}
				__result = true;
			}
		}

		[HarmonyPatch(typeof(PrivateArea), "Interact")]
		public static class wardinteract
		{
			[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
			private static bool Prefix(ref Humanoid human, ref bool hold, PrivateArea __instance)
			{
				if ((isAdmin() || __instance.IsPermitted(Player.m_localPlayer.GetPlayerID())) && !hold)
				{
					__instance.m_nview.InvokeRPC("ToggleEnabled", new object[1] { __instance.m_piece.m_creator });
					return false;
				}
				return true;
			}
		}

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

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

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

		[HarmonyPatch(typeof(ItemStand), "Interact")]
		private class standFix
		{
			[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
			private static bool Prefix(Humanoid user, bool hold, ItemStand __instance)
			{
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				return PrivateArea.CheckAccess(((Component)__instance).transform.position, 0f, true, false);
			}
		}

		[HarmonyPatch(typeof(ConsoleCommand), "RunAction")]
		public static class cheatlogg
		{
			[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
			private static void Postfix(ConsoleEventArgs args, ConsoleCommand __instance)
			{
				try
				{
					if (__instance.Command != "say" && __instance.Command != "s")
					{
						SendModerationLog(Player.m_localPlayer.GetPlayerName(), __instance.Command, "CHEAT COMMAND", "", "");
					}
				}
				catch (Exception)
				{
				}
			}
		}

		[HarmonyPatch(typeof(EnvMan), "CanSleep")]
		public static class cansleepyes
		{
			[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
			private static void Postfix(EnvMan __instance, bool __result)
			{
				__result = true;
			}
		}

		[HarmonyPatch(typeof(Humanoid), "EquipItem")]
		public static class PlayerEquip
		{
			[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
			private static void Postfix(ItemData item, bool triggerEquipEffects, ref Humanoid __instance)
			{
				playerEqp(ref item, ref __instance);
			}
		}

		[HarmonyPatch(typeof(Humanoid), "UnequipItem")]
		public static class PlayerUnEquip
		{
			[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
			private static void Postfix(ItemData item, bool triggerEquipEffects, ref Humanoid __instance)
			{
				playerEqp(ref item, ref __instance);
			}
		}

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

		[HarmonyPatch(typeof(Sign), "SetText")]
		public static class SignText
		{
			[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
			private static void Postfix(string text, Sign __instance)
			{
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				//IL_002a: Unknown result type (might be due to invalid IL or missing references)
				//IL_002f: Unknown result type (might be due to invalid IL or missing references)
				//IL_004e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0053: Unknown result type (might be due to invalid IL or missing references)
				string text2 = ((Component)__instance).transform.position.x + " ";
				text2 = text2 + ((Component)__instance).transform.position.z + " ";
				text2 += ((Component)__instance).transform.position.y;
				SendModerationLog(Player.m_localPlayer.GetPlayerName(), text, "sign_text", "", text2);
			}
		}

		[HarmonyPatch(typeof(TeleportWorld), "SetText")]
		public static class TeleportText
		{
			[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
			private static void Postfix(string text, TeleportWorld __instance)
			{
				SendModerationLog(Player.m_localPlayer.GetPlayerName(), text, "teleport_text", "", "");
			}
		}

		[HarmonyPatch(typeof(Chat), "InputText")]
		public static class ChatText
		{
			[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
			private static void Postfix(ref Chat __instance)
			{
				_ = ((TMP_InputField)((Terminal)__instance).m_input).text;
				if (!((Object)(object)Chat.instance != (Object)null) || !((Object)(object)((Terminal)Chat.instance).m_input != (Object)null) || string.IsNullOrWhiteSpace(((TMP_InputField)((Terminal)Chat.instance).m_input).text))
				{
					return;
				}
				SendModerationLog(Player.m_localPlayer.GetPlayerName(), ((TMP_InputField)((Terminal)Chat.instance).m_input).text, "chat_text", "", "");
				try
				{
					if (((TMP_InputField)((Terminal)__instance).m_input).text.StartsWith("/bc "))
					{
						SendBroadcast(((TMP_InputField)((Terminal)__instance).m_input).text.Substring(4));
					}
					if (((TMP_InputField)((Terminal)__instance).m_input).text.StartsWith("/sleepers") && Object.op_Implicit((Object)(object)Player.m_localPlayer))
					{
						int hash = ZSyncAnimation.GetHash("attach_bed");
						bool @bool = ((Character)Player.m_localPlayer).m_zanim.m_animator.GetBool(hash);
						((Character)Player.m_localPlayer).m_zanim.SetBool("attach_bed", !@bool);
					}
					if (((TMP_InputField)((Terminal)__instance).m_input).text.StartsWith("/vomit") && Object.op_Implicit((Object)(object)Player.m_localPlayer))
					{
						((Character)Player.m_localPlayer).m_seman.AddStatusEffect(StringExtensionMethods.GetStableHashCode("Puke"), false, 0, 0f);
					}
					if (((TMP_InputField)((Terminal)__instance).m_input).text.StartsWith("/roll"))
					{
						int num = 1;
						int num2 = 100;
						char[] separator = new char[1] { ' ' };
						string[] array = ((TMP_InputField)((Terminal)__instance).m_input).text.Split(separator);
						if (array.Length == 2)
						{
							num2 = int.Parse(array[1]);
						}
						else if (array.Length == 3)
						{
							num = int.Parse(array[1]);
							num2 = int.Parse(array[2]);
						}
						int num3 = RandomRoll(num, num2);
						string text = $"<color=#d65804>{Player.m_localPlayer.GetPlayerName()} rolls</color> <color=#E1AD21>{num3}</color> <color=#d65804>({num} - {num2})</color>";
						((Terminal)__instance).AddString(text);
					}
					if (((TMP_InputField)((Terminal)__instance).m_input).text.StartsWith("/coinflip"))
					{
						int num4 = RandomRoll(1, 2);
						string text2 = " coin is eaten by a lizard.";
						text2 = num4 switch
						{
							1 => " it's heads", 
							2 => " it's tails", 
							_ => " rolls away", 
						};
						string text3 = "<color=#d65804>" + Player.m_localPlayer.GetPlayerName() + " flips a coin</color> <color=#E1AD21>" + text2 + "</color>";
						((Terminal)__instance).AddString(text3);
					}
					if (((TMP_InputField)((Terminal)__instance).m_input).text.StartsWith("/me "))
					{
						string text4 = ((TMP_InputField)((Terminal)__instance).m_input).text.Substring(4);
						string text5 = "<color=#989749>" + Player.m_localPlayer.GetPlayerName() + " " + text4 + "</color>";
						if (isAnonymous)
						{
							text5 = "<color=#989749>??? " + text4 + "</color>";
						}
						else
						{
							__instance.SendText((Type)0, "");
						}
						((Terminal)__instance).AddString(text5);
					}
					if (((TMP_InputField)((Terminal)__instance).m_input).text.StartsWith("/hide"))
					{
						isAnonymous = !isAnonymous;
						ZLog.Log((object)(Player.m_localPlayer.GetPlayerName() + " changes hide status " + isAnonymous));
					}
					string[] array2 = new string[1] { "/say " };
					foreach (string text6 in array2)
					{
						if (((TMP_InputField)((Terminal)__instance).m_input).text.StartsWith(text6))
						{
							string text7 = ((TMP_InputField)((Terminal)__instance).m_input).text.Substring(text6.Length).Trim();
							string text8 = "<color=#d65804>" + Player.m_localPlayer.GetPlayerName() + ":</color><color=#FFFFFF> " + text7 + "</color>";
							if (isAnonymous)
							{
								text8 = "<color=#d65804>???: </color><color=#FFFFFF>" + text7 + "</color>";
							}
							((Terminal)__instance).AddString(text8);
						}
					}
					array2 = new string[3] { "/wis ", "/w ", "/whisper " };
					foreach (string text9 in array2)
					{
						if (((TMP_InputField)((Terminal)__instance).m_input).text.StartsWith(text9))
						{
							string text10 = ((TMP_InputField)((Terminal)__instance).m_input).text.Substring(text9.Length).Trim();
							string text11 = "<color=#7F7D9C>" + Player.m_localPlayer.GetPlayerName() + " whispers <i>\"" + text10 + "\"</i></color>";
							if (isAnonymous)
							{
								text11 = "<color=#7F7D9C>??? whispers <i>\"" + text10 + "\"</i></color>";
							}
							((Terminal)__instance).AddString(text11);
						}
					}
					_ = ((TMP_InputField)((Terminal)__instance).m_input).text == "/raft";
				}
				catch (Exception)
				{
					ZLog.LogError((object)"failed text processing");
				}
			}
		}

		[HarmonyPatch(typeof(Player), "SetIntro")]
		public static class SpawnLog
		{
			[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
			private static void Postfix(bool intro, Player __instance)
			{
				if (!ZNet.instance.IsServer() && (Object)(object)__instance != (Object)null && ((Character)__instance).m_nview.IsValid() && ZRoutedRpc.instance != null)
				{
					ZLog.LogWarning((object)("FRESH " + __instance.GetPlayerName()));
					SendModerationLog(__instance.GetPlayerName(), "", "Fresh", "", "");
				}
			}
		}

		[HarmonyPatch("GetServers")]
		[HarmonyPatch(typeof(ZSteamMatchmaking))]
		private class PatchUpdateServerListGui
		{
			[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
			private static void Postfix(ref List<ServerStatus> allServers)
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				//IL_000a: Unknown result type (might be due to invalid IL or missing references)
				//IL_001a: Expected O, but got Unknown
				//IL_0015: Unknown result type (might be due to invalid IL or missing references)
				//IL_001b: Expected O, but got Unknown
				ServerStatus val = new ServerStatus((ServerJoinData)new ServerJoinDataDedicated("159.223.189.211")
				{
					m_serverName = "VRP Season 12"
				});
				val.m_playerCount = 69u;
				allServers.Add(val);
			}
		}

		[HarmonyPatch(typeof(Chat), "Awake")]
		private class textinputfix
		{
			[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
			private static void Postfix(ref Chat __instance)
			{
				__instance.m_worldTextTTL = 20f;
				((TMP_InputField)((Terminal)__instance).m_input).characterLimit = 300;
				__instance.m_hideDelay = 10f;
				Graphic[] componentsInChildren = ((Component)((Terminal)__instance).m_chatWindow).GetComponentsInChildren<Graphic>();
				for (int i = 0; i < componentsInChildren.Length; i++)
				{
					componentsInChildren[i].raycastTarget = false;
				}
			}
		}

		[HarmonyPatch(typeof(Talker), "Awake")]
		private class talkerrange
		{
			[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
			private static void Postfix(ref Talker __instance)
			{
				__instance.m_normalDistance = 25f;
				__instance.m_shoutDistance = 150f;
			}
		}

		[HarmonyPatch(typeof(Chat), "SendText")]
		private class notglobalshouts
		{
			[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
			private static bool Prefix(ref Type type, ref string text)
			{
				if (Object.op_Implicit((Object)(object)Player.m_localPlayer))
				{
					((Component)Player.m_localPlayer).GetComponent<Talker>().Say(type, text);
				}
				return false;
			}
		}

		[HarmonyPatch(typeof(Chat), "GetShoutWorldTexts")]
		private class nominimapshouts
		{
			[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
			private static void Postfix(ref List<WorldTextInstance> texts)
			{
				texts.Clear();
			}
		}

		[HarmonyPatch(typeof(Chat), "UpdateWorldTextField")]
		private static class nopings
		{
			[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
			private static void Postfix(ref WorldTextInstance wt)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Invalid comparison between Unknown and I4
				if ((int)wt.m_type == 3)
				{
					((TMP_Text)wt.m_textMeshField).text = "";
					wt.m_text = "";
				}
			}
		}

		[HarmonyPatch(typeof(Player), "FixedUpdate")]
		private class playerposty
		{
			[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
			private static void Postfix(ref Player __instance)
			{
				//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
				//IL_00da: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e0: Expected O, but got Unknown
				//IL_01c8: 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)
				if (!((Character)__instance).m_nview.IsValid() || !((Character)__instance).m_nview.IsOwner() || __instance.GetPlayerID() != Player.m_localPlayer.GetPlayerID())
				{
					return;
				}
				if ((Object)(object)InventoryGui.instance != (Object)null)
				{
					InventoryGui.instance.m_pvp.isOn = true;
				}
				if (!((Character)__instance).IsPVPEnabled())
				{
					__instance.SetPVP(true);
				}
				if (ateBadFood)
				{
					badFoodTimer -= Time.deltaTime;
					badFoodInterval -= Time.deltaTime;
					if (badFoodInterval <= 0f)
					{
						badFoodInterval = 5f;
						HitData val = new HitData
						{
							m_point = ((Character)__instance).GetCenterPoint(),
							m_damage = 
							{
								m_spirit = 1f
							},
							m_damage = 
							{
								m_poison = 5f
							},
							m_hitType = (HitType)7
						};
						((Character)__instance).ApplyDamage(val, true, true, (DamageModifier)0);
					}
					if (badFoodTimer <= 0f)
					{
						ateBadFood = false;
						badFoodTimer = 0f;
						((Character)__instance).m_seman.RemoveStatusEffect(StringExtensionMethods.GetStableHashCode("Poison"), false);
					}
				}
				if ((Object)(object)((Character)__instance).m_seman.GetStatusEffect(StringExtensionMethods.GetStableHashCode("Poozy")) != (Object)null)
				{
					((Character)__instance).m_swimDepth = 20f;
				}
				else
				{
					((Character)__instance).m_swimDepth = 1.5f;
				}
				StatusEffect statusEffect = ((Character)__instance).m_seman.GetStatusEffect(StringExtensionMethods.GetStableHashCode("Wounded"));
				PostProcessingBehaviour component = ((Component)GameCamera.instance).gameObject.GetComponent<PostProcessingBehaviour>();
				if (!((Object)(object)component != (Object)null))
				{
					return;
				}
				if ((Object)(object)statusEffect != (Object)null)
				{
					((PostProcessingModel)((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model).enabled = true;
					((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model.m_Settings.color = new Color(0f, 0f, 0f, 0.8f);
					((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model.m_Settings.intensity = 0.6f;
				}
				else if (((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model.m_Settings.intensity > 0.05f)
				{
					((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model.m_Settings.intensity = Mathf.Max(0.05f, ((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model.m_Settings.intensity - 0.001f);
				}
				else
				{
					((PostProcessingModel)((PostProcessingComponent<VignetteModel>)(object)component.m_Vignette).model).enabled = false;
				}
				if (!Object.op_Implicit((Object)(object)statusEffect) && ((PostProcessingComponent<ColorGradingModel>)(object)component.m_ColorGrading).model.m_Settings.basic.saturation != 1f)
				{
					if (((PostProcessingComponent<ColorGradingModel>)(object)component.m_ColorGrading).model.m_Settings.basic.saturation < 1f)
					{
						((PostProcessingComponent<ColorGradingModel>)(object)component.m_ColorGrading).model.m_Settings.basic.saturation = Mathf.Min(1f, ((PostProcessingComponent<ColorGradingModel>)(object)component.m_ColorGrading).model.m_Settings.basic.saturation + 0.01f);
					}
					else
					{
						((PostProcessingComponent<ColorGradingModel>)(object)component.m_ColorGrading).model.m_Settings.basic.saturation = Mathf.Max(1f, ((PostProcessingComponent<ColorGradingModel>)(object)component.m_ColorGrading).model.m_Settings.basic.saturation - 0.01f);
					}
					((PostProcessingComponent<ColorGradingModel>)(object)component.m_ColorGrading).model.isDirty = true;
				}
			}
		}

		[HarmonyPatch(typeof(Minimap), "UpdateExplore")]
		private class fixexplore
		{
			[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
			private static void Postfix(ref Minimap __instance, float dt, Player player)
			{
				//IL_0054: Unknown result type (might be due to invalid IL or missing references)
				float num = (((Object)(object)player.GetControlledShip() == (Object)null) ? __instance.m_exploreRadius : 180f);
				Minimap obj = __instance;
				obj.m_exploreTimer += Time.deltaTime;
				if (__instance.m_exploreTimer > __instance.m_exploreInterval)
				{
					__instance.m_exploreTimer = 0f;
					__instance.Explore(((Component)player).transform.position, num);
				}
			}
		}

		[HarmonyPatch(typeof(Fireplace), "Awake")]
		private class fixfireplace
		{
			[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
			private static void Postfix(ref Fireplace __instance)
			{
				Fireplace obj = __instance;
				obj.m_secPerFuel *= 5f;
			}
		}

		[HarmonyPatch(typeof(Fireplace), "UpdateFireplace")]
		private class updatefireplace
		{
			[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
			private static void Postfix(ref Fireplace __instance)
			{
				if (__instance.m_nview.IsValid() && __instance.m_nview.IsOwner() && __instance.m_nview.GetZDO().GetFloat("fuel", 0f) == 0f && !__instance.IsBurning() && (((Object)__instance).name == "fire_pit(Clone)" || ((Object)__instance).name == "rk_campfire(Clone)"))
				{
					WearNTear component = ((Component)__instance).gameObject.GetComponent<WearNTear>();
					if ((Object)(object)component != (Object)null)
					{
						component.Remove(false);
					}
				}
			}
		}

		[HarmonyPatch(typeof(Ship), "Awake")]
		public static class shipfix
		{
			[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
			private static void Postfix(ref Ship __instance)
			{
				__instance.m_minWaterImpactForce = 100f;
			}
		}

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

		[HarmonyPatch(typeof(Ship), "OnDestroyed")]
		private class shipDestroyed
		{
			[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
			private static void Postfix(ref Ship __instance)
			{
				//IL_0038: Unknown result type (might be due to invalid IL or missing references)
				//IL_004f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0054: Unknown result type (might be due to invalid IL or missing references)
				//IL_0074: Unknown result type (might be due to invalid IL or missing references)
				//IL_0079: Unknown result type (might be due to invalid IL or missing references)
				//IL_0099: 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)
				if (__instance.IsOwner() && Object.op_Implicit((Object)(object)__instance.m_nview) && __instance.m_nview.IsValid())
				{
					List<Player> list = new List<Player>();
					Player.GetPlayersInRange(((Component)__instance).transform.position, 30f, list);
					string text = ((Component)__instance).transform.position.x + " ";
					text = text + ((Component)__instance).transform.position.z + " ";
					text += ((Component)__instance).transform.position.y;
					SendModerationLog(string.Join(",", list.Select((Player p) => p.GetPlayerName())), ((Object)((Component)__instance).gameObject).name, "ship destroyed", __instance.m_nview.GetZDO().GetString("creatorName", ""), text);
				}
			}
		}

		[HarmonyPatch(typeof(Player), "StartDoodadControl")]
		private class shipControlled
		{
			[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
			private static void Postfix(ref ShipControlls shipControl)
			{
				Component controlledComponent = shipControl.GetControlledComponent();
				Ship val = (Ship)(object)((controlledComponent is Ship) ? controlledComponent : null);
				if ((Object)(object)val != (Object)null)
				{
					SendModerationLog(Game.instance.GetPlayerProfile().GetName(), ((Object)shipControl.GetControlledComponent().gameObject).name, "ship controlled", val.m_nview.GetZDO().GetString("creatorName", ""), "");
				}
			}
		}

		[HarmonyPatch(typeof(ShipControlls), "GetHoverText")]
		private class shipName
		{
			[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
			private static void Postfix(ref ShipControlls __instance, ref string __result)
			{
				Component controlledComponent = __instance.GetControlledComponent();
				Ship val = (Ship)(object)((controlledComponent is Ship) ? controlledComponent : null);
				if ((Object)(object)val != (Object)null)
				{
					__result = __result + Environment.NewLine + ((Object)((Component)val).gameObject).name + " " + val.m_nview.GetZDO().GetString("creatorName", "");
				}
			}
		}

		[HarmonyPatch(typeof(Ship), "UpdateUpsideDmg")]
		private class raftdmg
		{
			[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
			private static void Postfix(float dt, Ship __instance)
			{
				//IL_0067: Unknown result type (might be due to invalid IL or missing references)
				//IL_006c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0076: Invalid comparison between Unknown and I4
				//IL_0082: Unknown result type (might be due to invalid IL or missing references)
				//IL_0088: Expected O, but got Unknown
				//IL_009f: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
				//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
				//IL_00af: Unknown result type (might be due to invalid IL or missing references)
				raftdmgcounter += dt;
				if (!(raftdmgcounter > 2f))
				{
					return;
				}
				raftdmgcounter = 0f;
				if (__instance.IsOwner() && Object.op_Implicit((Object)(object)__instance.m_nview) && __instance.m_nview.IsValid() && ((Object)((Component)__instance).gameObject).name == "Raft(Clone)" && (int)Heightmap.FindBiome(((Component)__instance).transform.position) == 256)
				{
					IDestructible component = ((Component)__instance).GetComponent<IDestructible>();
					if (component != null)
					{
						HitData val = new HitData();
						val.m_damage.m_blunt = 1f;
						val.m_point = ((Component)__instance).transform.position;
						val.m_dir = Vector3.up;
						component.Damage(val);
					}
				}
			}
		}

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

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

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

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

		[HarmonyPatch(typeof(TextViewer), "ShowText")]
		private class textviewerfix
		{
			[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
			private static void Prefix(Style style, string topic, ref string textId, bool autoHide)
			{
				if (textId.Contains("lore_intro"))
				{
					string text = ConvertIntroText(_vrpLore.Value);
					textId = text;
				}
			}
		}

		[HarmonyPatch(typeof(Container), "Awake")]
		[<3410fd21-c857-4c99-a981-7ca28a98eb02>Nullable(0)]
		[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
		public static class ApplyContainerSizeChanges
		{
			private static void Prefix(ref Container __instance)
			{
				applyContainerSizes(__instance);
			}

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

		[HarmonyPatch(typeof(ConsoleCommand), "IsValid")]
		private static class cheatfix
		{
			[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
			private static bool Prefix(ref bool __result, ref Terminal context, ref ConsoleCommand __instance)
			{
				__result = Object.op_Implicit((Object)(object)ZNet.instance) && Object.op_Implicit((Object)(object)Player.m_localPlayer) && (!__instance.IsCheat || isAdmin());
				return false;
			}
		}

		[HarmonyPatch(typeof(Fish), "Interact")]
		private static class fishfix
		{
			[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
			private static bool Prefix(ref Humanoid character, bool repeat, bool alt, ref Fish __instance, ref bool __result)
			{
				__result = !repeat && __instance.Pickup(character);
				return false;
			}
		}

		[HarmonyPatch(typeof(Fish), "Start")]
		private static class fishhookfix
		{
			[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
			private static void Postfix(ref Fish __instance)
			{
				__instance.m_baseHookChance = 0.8f;
			}
		}

		[HarmonyPatch(typeof(FishingFloat), "Awake")]
		private static class floathfix
		{
			[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
			private static void Postfix(ref FishingFloat __instance)
			{
				__instance.m_range = 20f;
			}
		}

		[HarmonyPatch(typeof(Trader), "Start")]
		private static class traderbye
		{
			[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
			private static void Postfix(ref Trader __instance)
			{
				((Component)__instance).gameObject.SetActive(false);
			}
		}

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

		[HarmonyPatch(typeof(Piece), "DropResources")]
		private static class piecelogd
		{
			[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
			private static void Postfix(ref Piece __instance)
			{
				//IL_0029: Unknown result type (might be due to invalid IL or missing references)
				//IL_002e: Unknown result type (might be due to invalid IL or missing references)
				//IL_004e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0053: Unknown result type (might be due to invalid IL or missing references)
				//IL_0073: Unknown result type (might be due to invalid IL or missing references)
				//IL_0078: Unknown result type (might be due to invalid IL or missing references)
				//IL_0098: Unknown result type (might be due to invalid IL or missing references)
				if (Object.op_Implicit((Object)(object)__instance.m_nview) && __instance.m_nview.IsOwner())
				{
					string text = ((Component)__instance).transform.position.x + " ";
					text = text + ((Component)__instance).transform.position.z + " ";
					text += ((Component)__instance).transform.position.y;
					List<Player> list = new List<Player>();
					Player.GetPlayersInRange(((Component)__instance).transform.position, 30f, list);
					SendModerationLog(string.Join(",", list.Select((Player p) => p.GetPlayerName())), ((Object)((Component)__instance).gameObject).name, "piece destroyed", __instance.m_nview.GetZDO().GetString("creatorName", ""), text);
					ZRoutedRpc.instance.InvokeRoutedRPC("ServerSetWard", new object[2]
					{
						__instance.m_nview.GetZDO().GetString("creatorName", ""),
						false
					});
				}
			}
		}

		[HarmonyPatch(typeof(Container), "RPC_RequestOpen")]
		private static class chestlog
		{
			[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
			private static void Postfix(ref Container __instance, long uid, long playerID)
			{
				//IL_0090: Unknown result type (might be due to invalid IL or missing references)
				//IL_0095: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
				//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
				//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
				Player player = Player.GetPlayer(playerID);
				if (!((Object)(object)player != (Object)null) || !((Character)player).m_nview.IsValid() || !((Object)(object)__instance.m_nview != (Object)null) || !__instance.m_nview.IsValid())
				{
					return;
				}
				string creator = "";
				if ((Object)(object)__instance.m_piece != (Object)null)
				{
					ZDO zDO = __instance.m_piece.m_nview.GetZDO();
					if (zDO != null && zDO.IsValid())
					{
						creator = zDO.GetString("creatorName", "");
					}
				}
				string text = ((Component)__instance).transform.position.x + " ";
				text = text + ((Component)__instance).transform.position.z + " ";
				text += ((Component)__instance).transform.position.y;
				SendModerationLog(((Character)player).GetHoverName(), ((Object)((Component)__instance).gameObject).name, "chest open", creator, text);
			}
		}

		[HarmonyPatch(typeof(InventoryGui), "DoCrafting")]
		private static class craftlog
		{
			[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
			private static void Postfix(Player player, ref InventoryGui __instance)
			{
				SendModerationLog(((Character)player).GetHoverName(), __instance.m_craftRecipe.m_item.m_itemData.m_shared.m_name, "item created", "", "");
			}
		}

		[HarmonyPatch(typeof(Player), "Awake")]
		private static class playerawake
		{
			[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
			private static void Postfix(ref Player __instance)
			{
				__instance.m_hardDeathCooldown = 1f;
				__instance.m_baseHP = 50f;
			}
		}

		[HarmonyPatch(typeof(Player), "OnSpawned")]
		private static class novalk
		{
			[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
			private static bool Prefix(ref Player __instance, bool spawnValkyrie)
			{
				//IL_000e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0013: Unknown result type (might be due to invalid IL or missing references)
				__instance.m_spawnEffects.Create(((Component)__instance).transform.position, Quaternion.identity, (Transform)null, 1f, -1);
				if (spawnValkyrie)
				{
					__instance.SetIntro(true);
				}
				SetActiveRecursive(Minimap.instance.m_smallRoot, a: false);
				Image component = Minimap.instance.m_smallRoot.GetComponent<Image>();
				if (Object.op_Implicit((Object)(object)component))
				{
					((Behaviour)component).enabled = false;
				}
				if (__instance.m_timeSinceDeath < 30f)
				{
					((Character)__instance).m_seman.AddStatusEffect(StringExtensionMethods.GetStableHashCode("Panic"), false, 0, 0f);
				}
				if (__instance.m_timeSinceDeath < 1800f)
				{
					((Character)__instance).m_seman.AddStatusEffect(StringExtensionMethods.GetStableHashCode("Wounded"), false, 0, 0f).m_time = __instance.m_timeSinceDeath;
				}
				JotunnPatches.DurabilityIncrease();
				return false;
			}
		}

		[HarmonyPatch(typeof(Game), "Awake")]
		private static class noarrived
		{
			[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
			private static void Postfix(ref Game __instance)
			{
				__instance.m_firstSpawn = false;
			}
		}

		[HarmonyPatch(typeof(Player), "HaveSeenTutorial")]
		private static class notutorial
		{
			[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
			private static void Postfix(string name, ref bool __result)
			{
				__result = true;
			}
		}

		[HarmonyPatch(typeof(Player), "OnDeath")]
		private static class reworkdeath
		{
			[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
			private static bool Prefix(ref Player __instance)
			{
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				//IL_000c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0042: Unknown result type (might be due to invalid IL or missing references)
				//IL_0047: Unknown result type (might be due to invalid IL or missing references)
				//IL_0114: Unknown result type (might be due to invalid IL or missing references)
				//IL_0119: Unknown result type (might be due to invalid IL or missing references)
				//IL_01c8: 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_01ce: Unknown result type (might be due to invalid IL or missing references)
				//IL_0220: Expected I4, but got Unknown
				//IL_03ef: Unknown result type (might be due to invalid IL or missing references)
				//IL_0420: Unknown result type (might be due to invalid IL or missing references)
				//IL_0425: Unknown result type (might be due to invalid IL or missing references)
				//IL_0147: Unknown result type (might be due to invalid IL or missing references)
				//IL_014d: Invalid comparison between Unknown and I4
				//IL_045c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0482: Unknown result type (might be due to invalid IL or missing references)
				deathpoint = ((Component)__instance).transform.position;
				if (Object.op_Implicit((Object)(object)((Character)__instance).m_seman.GetStatusEffect(StringExtensionMethods.GetStableHashCode("Wounded"))))
				{
					woundeddeathcounter++;
					if (woundeddeathcounter > 1)
					{
						deathpoint = lumbyspawn;
						woundeddeathcounter = 0;
					}
				}
				else
				{
					woundeddeathcounter = 0;
				}
				float num = 100f;
				if (((Humanoid)__instance).m_chestItem != null)
				{
					((Humanoid)__instance).m_chestItem.m_durability = Mathf.Max(0f, ((Humanoid)__instance).m_chestItem.m_durability - num);
				}
				if (((Humanoid)__instance).m_legItem != null)
				{
					((Humanoid)__instance).m_legItem.m_durability = Mathf.Max(0f, ((Humanoid)__instance).m_legItem.m_durability - num);
				}
				if (((Humanoid)__instance).m_helmetItem != null)
				{
					((Humanoid)__instance).m_helmetItem.m_durability = Mathf.Max(0f, ((Humanoid)__instance).m_helmetItem.m_durability - num);
				}
				if (((Humanoid)__instance).m_shoulderItem != null)
				{
					((Humanoid)__instance).m_shoulderItem.m_durability = Mathf.Max(0f, ((Humanoid)__instance).m_shoulderItem.m_durability - num);
				}
				if (deathpoint == lumbyspawn)
				{
					foreach (ItemData allItem in ((Humanoid)__instance).m_inventory.GetAllItems())
					{
						if ((int)allItem.m_shared.m_itemType == 1 && new Random().Next(1, 10) >= 6)
						{
							allItem.m_stack = 1;
						}
					}
				}
				((Character)__instance).m_nview.GetZDO().Set("dead", true);
				((Character)__instance).m_nview.InvokeRPC(ZNetView.Everybody, "OnDeath", Array.Empty<object>());
				Game.instance.IncrementPlayerStat((PlayerStatType)0, 1f);
				HitType hitType = ((Character)__instance).m_lastHit.m_hitType;
				switch ((int)hitType)
				{
				case 0:
					Game.instance.IncrementPlayerStat((PlayerStatType)55, 1f);
					break;
				case 1:
					Game.instance.IncrementPlayerStat((PlayerStatType)56, 1f);
					break;
				case 2:
					Game.instance.IncrementPlayerStat((PlayerStatType)57, 1f);
					break;
				case 3:
					Game.instance.IncrementPlayerStat((PlayerStatType)58, 1f);
					break;
				case 4:
					Game.instance.IncrementPlayerStat((PlayerStatType)59, 1f);
					break;
				case 5:
					Game.instance.IncrementPlayerStat((PlayerStatType)60, 1f);
					break;
				case 6:
					Game.instance.IncrementPlayerStat((PlayerStatType)61, 1f);
					break;
				case 7:
					Game.instance.IncrementPlayerStat((PlayerStatType)62, 1f);
					break;
				case 8:
					Game.instance.IncrementPlayerStat((PlayerStatType)64, 1f);
					break;
				case 9:
					Game.instance.IncrementPlayerStat((PlayerStatType)63, 1f);
					break;
				case 10:
					Game.instance.IncrementPlayerStat((PlayerStatType)65, 1f);
					break;
				case 11:
					Game.instance.IncrementPlayerStat((PlayerStatType)66, 1f);
					break;
				case 12:
					Game.instance.IncrementPlayerStat((PlayerStatType)67, 1f);
					break;
				case 13:
					Game.instance.IncrementPlayerStat((PlayerStatType)68, 1f);
					break;
				case 14:
					Game.instance.IncrementPlayerStat((PlayerStatType)69, 1f);
					break;
				case 15:
					Game.instance.IncrementPlayerStat((PlayerStatType)70, 1f);
					break;
				case 16:
					Game.instance.IncrementPlayerStat((PlayerStatType)71, 1f);
					break;
				case 17:
					Game.instance.IncrementPlayerStat((PlayerStatType)72, 1f);
					break;
				case 18:
					Game.instance.IncrementPlayerStat((PlayerStatType)73, 1f);
					break;
				default:
					ZLog.LogWarning((object)("Not implemented death type " + ((object)(HitType)(ref ((Character)__instance).m_lastHit.m_hitType)).ToString()));
					break;
				}
				Game.instance.GetPlayerProfile().SetDeathPoint(((Component)__instance).transform.position);
				__instance.CreateDeathEffects();
				__instance.CreateTombStone();
				__instance.m_foods.Clear();
				((Character)__instance).m_seman.RemoveAllStatusEffects(false);
				if (deathpoint == lumbyspawn)
				{
					__instance.m_timeSinceDeath = 1810f;
				}
				else
				{
					__instance.m_timeSinceDeath = 0f;
				}
				Game.instance.GetPlayerProfile().SetLogoutPoint(((Component)__instance).transform.position);
				Game.instance.RequestRespawn(15f, false);
				Minimap.instance.AddPin(((Component)__instance).transform.position, (PinType)4, $"$hud_mapday {EnvMan.instance.GetDay(ZNet.instance.GetTimeSeconds())}", true, false, 0L, "");
				return false;
			}
		}

		[HarmonyPatch(typeof(Game), "SpawnPlayer")]
		private static class deathspawnlocation
		{
			[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
			private static void Prefix(ref Vector3 spawnPoint, Game __instance)
			{
				//IL_0000: Unknown result type (might be due to invalid IL or missing references)
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				//IL_0041: Unknown result type (might be due to invalid IL or missing references)
				//IL_0046: Unknown result type (might be due to invalid IL or missing references)
				if (deathpoint != Vector3.zero)
				{
					spawnPoint.x = deathpoint.x;
					spawnPoint.y = deathpoint.y;
					spawnPoint.z = deathpoint.z;
					deathpoint = Vector3.zero;
				}
			}
		}

		[HarmonyPatch(typeof(TombStone), "Awake")]
		private static class nocorpserun
		{
			[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
			private static void Postfix(ref TombStone __instance)
			{
				__instance.m_lootStatusEffect = null;
				__instance.m_worldText.text = "";
			}
		}

		[HarmonyPatch(typeof(TombStone), "Start")]
		private static class notombstonename
		{
			[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
			private static void Postfix(ref TombStone __instance)
			{
				__instance.m_worldText.text = "";
				if (Object.op_Implicit((Object)(object)Player.m_localPlayer) && Player.m_localPlayer.GetPlayerName() == __instance.m_nview.GetZDO().GetString("ownerName", ""))
				{
					__instance.m_worldText.text = "Mine";
				}
			}
		}

		[HarmonyPatch(typeof(TombStone), "Setup")]
		private static class notombstonename2
		{
			[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
			private static void Postfix(ref TombStone __instance)
			{
				__instance.m_worldText.text = "";
				if (Object.op_Implicit((Object)(object)Player.m_localPlayer) && Player.m_localPlayer.GetPlayerName() == __instance.m_nview.GetZDO().GetString("ownerName", ""))
				{
					__instance.m_worldText.text = "Mine";
				}
			}
		}

		[HarmonyPatch(typeof(TombStone), "GetHoverText")]
		private static class notombstonemessage
		{
			[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
			private static void Postfix(ref TombStone __instance, ref string __result)
			{
				__result = "dont touch";
			}
		}

		[HarmonyPatch(typeof(MapTable), "OnRead", new Type[]
		{
			typeof(Switch),
			typeof(Humanoid),
			typeof(ItemData),
			typeof(bool)
		})]
		private static class noaddmap
		{
			[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
			private static bool Prefix(Switch caller, Humanoid user, ItemData item, bool __result)
			{
				__result = false;
				return false;
			}
		}

		[HarmonyPatch(typeof(MapTable), "OnWrite")]
		private static class nogetmap
		{
			[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
			private static bool Prefix(Switch caller, Humanoid user, ItemData item, bool __result)
			{
				__result = false;
				return false;
			}
		}

		[HarmonyPatch(typeof(EnvMan), "GetCurrentEnvironment")]
		private static class smallerwaves
		{
			[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
			private static void Postfix(ref EnvSetup __result)
			{
				__result.m_windMin = 0.2f;
				__result.m_windMax = 0.5f;
			}
		}

		[HarmonyPatch(typeof(Door), "HaveKey")]
		private static class consumekeys
		{
			[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
			private static void Postfix(ref Humanoid player, ref Door __instance, ref bool __result)
			{
				//IL_0016: Unknown result type (might be due to invalid IL or missing references)
				//IL_001b: Unknown result type (might be due to invalid IL or missing references)
				//IL_003a: Unknown result type (might be due to invalid IL or missing references)
				//IL_003f: Unknown result type (might be due to invalid IL or missing references)
				//IL_005e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0063: Unknown result type (might be due to invalid IL or missing references)
				if (__result)
				{
					string raw = ((Component)__instance).transform.position.x + " " + ((Component)__instance).transform.position.z + " " + ((Component)__instance).transform.position.y;
					SendModerationLog(((Character)player).GetHoverName(), __instance.m_keyItem.m_itemData.m_shared.m_name, "Key", "", raw);
					player.GetInventory().RemoveItem(__instance.m_keyItem.m_itemData.m_shared.m_name, 1, -1, true);
				}
			}
		}

		[HarmonyPatch(typeof(Character), "InInterior", new Type[] { typeof(Transform) })]
		private static class buildindungeonlol
		{
			[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
			private static void Postfix(Transform me, ref bool __result)
			{
				if (isAdmin())
				{
					__result = false;
				}
			}
		}

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

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

		[HarmonyPatch(typeof(Vagon), "AttachTo")]
		private static class cartlogattach
		{
			[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
			private static void Postfix(Vagon __instance)
			{
				Piece component = ((Component)__instance).gameObject.GetComponent<Piece>();
				SendModerationLog(((Character)Player.m_localPlayer).GetHoverName(), ((Object)((Component)__instance).gameObject).name, "cart control", component.m_nview.GetZDO().GetString("creatorName", ""), "");
			}
		}

		[HarmonyPatch(typeof(Player), "GetTotalFoodValue")]
		private static class foodburntime
		{
			[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
			private static void Postfix(ref float hp, ref float stamina, ref float eitr, Player __instance)
			{
				hp = __instance.m_baseHP;
				stamina = __instance.m_baseStamina;
				eitr = 0f;
				foreach (Food food in __instance.m_foods)
				{
					hp += food.m_item.m_shared.m_food;
					stamina += food.m_item.m_shared.m_foodStamina;
					eitr += food.m_item.m_shared.m_foodEitr;
				}
			}
		}

		[HarmonyPatch(typeof(Incinerator), "Incinerate")]
		private static class incinlog
		{
			[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
			private static void Prefix(ref Incinerator __instance, long uid)
			{
				foreach (ItemData allItem in __instance.m_container.m_inventory.GetAllItems())
				{
					SendModerationLog(((Character)Player.m_localPlayer).GetHoverName(), allItem.m_shared.m_name, "incinerator", allItem.m_crafterName, allItem.m_shared.m_name + " " + allItem.m_stack);
				}
			}
		}

		[<3410fd21-c857-4c99-a981-7ca28a98eb02>Nullable(0)]
		[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
		[HarmonyPatch(typeof(Sign), "Awake")]
		private static class SignAwakePatch
		{
			private static void Prefix(Sign __instance)
			{
				//IL_0036: Unknown result type (might be due to invalid IL or missing references)
				//IL_003b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0058: 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_0069: 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_0081: Unknown result type (might be due to invalid IL or missing references)
				//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
				Transform val = Utils.FindChild(((Component)__instance).transform, "Text", (IterativeSearchType)0);
				if ((Object)(object)val != (Object)null)
				{
					Text component = ((Component)val).GetComponent<Text>();
					if ((Object)(object)component != (Object)null)
					{
						GameObject val2 = new GameObject("Text");
						val2.transform.SetParent(((Component)val).transform.parent);
						Transform transform = ((Component)val).transform;
						val2.transform.localPosition = transform.localPosition;
						val2.transform.localRotation = transform.localRotation;
						val2.transform.localScale = transform.localScale;
						TextMeshProUGUI val3 = val2.AddComponent<TextMeshProUGUI>();
						((TMP_Text)val3).text = component.text;
						((TMP_Text)val3).font = TMP_FontAsset.CreateFontAsset(component.font);
						((TMP_Text)val3).fontSize = component.fontSize;
						((Graphic)val3).color = ((Graphic)component).color;
						((TMP_Text)val3).alignment = (TextAlignmentOptions)514;
						__instance.m_textWidget = val3;
						Object.Destroy((Object)(object)((Component)component).gameObject);
					}
				}
			}

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

		[<3410fd21-c857-4c99-a981-7ca28a98eb02>Nullable(1)]
		public const string vrpversion = "1.0.0";

		[<3410fd21-c857-4c99-a981-7ca28a98eb02>Nullable(1)]
		public static List<string> groups = new List<string>();

		[<3410fd21-c857-4c99-a981-7ca28a98eb02>Nullable(1)]
		public static List<DbRecipe> recipes = new List<DbRecipe>();

		public static bool canWard = false;

		private static bool isAnonymous = false;

		private static float badFoodTimer = 0f;

		private static float badFoodInterval = 5f;

		private static bool ateBadFood = false;

		[<3410fd21-c857-4c99-a981-7ca28a98eb02>Nullable(1)]
		public static ConfigEntry<string> _vrpLore;

		[<3410fd21-c857-4c99-a981-7ca28a98eb02>Nullable(1)]
		public static List<string> admins = new List<string> { "ADMIN", "UNKNOWN" };

		private static float raftdmgcounter = 0f;

		private static Vector3 deathpoint = Vector3.zero;

		private static Vector3 lumbyspawn = new Vector3(0f, 35f, -4f);

		private static int woundeddeathcounter = 0;

		[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
		public static bool Contains(string source, string toCheck, StringComparison comp)
		{
			Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
			string text = source.ToUpperInvariant();
			string value = toCheck.ToUpperInvariant();
			return text.Contains(value);
		}

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

		[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
		public static bool isAdmin(string name)
		{
			return admins.Contains(name.ToUpperInvariant());
		}

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

		[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
		public static void SendBroadcast(string message)
		{
			if (ZRoutedRpc.instance != null && !ZRoutedRpc.instance.m_server && isAdmin())
			{
				ZRoutedRpc.instance.InvokeRoutedRPC("ServerBroadcast", new object[1] { message });
			}
		}

		public static int RandomRoll(int min = 1, int max = 100)
		{
			if (min > max)
			{
				int num = max;
				max = min;
				min = num;
			}
			return new Random(Environment.TickCount ^ Guid.NewGuid().GetHashCode()).Next(min, max + 1);
		}

		[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
		public static string ConvertIntroText(string otext)
		{
			ZLog.Log((object)"Intro text hashed");
			if (string.IsNullOrEmpty(otext))
			{
				return string.Empty;
			}
			return WebUtility.HtmlDecode(Regex.Replace(Regex.Replace(otext, "<br\\s*/?>", Environment.NewLine, RegexOptions.IgnoreCase), "<[^>]+>", string.Empty));
		}

		[<5794fd4f-8c8d-4a9b-8847-7f10d82090bb>NullableContext(1)]
		public static void playerEqp(ref ItemData item, ref Humanoid huma)
		{
			if (item != null && item.IsEquipable() && (Object)(object)huma != (Object)null && ((Character)huma).IsPlayer())
			{
				Humanoid obj = huma;
				Player val = (Player)(object)((obj is Player) ? obj : null);
				if ((Object)(object)val != (Object)null && ((Character)val).m_nview.IsValid() && (Object)(object)Player.m_localPlayer != (Object)null)
				{
					string raw = ((Character)val).GetHoverName() + " | equip | " + item.m_shared.m_name + ((item.m_crafterID == 0L) ? " | uncrafted | " : (" | crafted by | " + item.m_crafterName + " "));
					SendModerationLog(((Character)val).GetHoverName(), item.m_shared.m_name, "equip", (item.m_crafterID == 0L) ? " | uncrafted | " : (" | crafted by | " + item.m_crafterName + " "), raw);
				}
			}
		}

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