Decompiled source of EFT ALPHA CASE v1.2.0

EFT_ALPHA_CASE.dll

Decompiled 3 weeks ago
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using Atlas;
using Atlas.MappingComponents.Sandbox;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Logging;
using EFT_Frame;
using FistVR;
using H3MP;
using H3MP.Networking;
using HarmonyLib;
using NGA;
using OtherLoader;
using UnityEngine;
using UnityEngine.SceneManagement;
using Valve.VR;

[assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace JerryComponent
{
	public class AlphaCase : MonoBehaviour
	{
		public GameObject BoxPos;

		public GameObject box;

		public Collider colgrab;

		public Collider colgrabalt;

		public FVRPhysicalObject mainobj;

		public GameObject lock1;

		public GameObject lock2;

		public GameObject savevalue;

		public GameObject WaX;

		public GameObject WaY;

		public GameObject WaZ;

		public WaggleJoint X;

		public WaggleJoint Y;

		public WaggleJoint Z;

		public PlayerCrouch PC;

		public GameObject rot;

		public GameObject phymain;

		public GameObject phylid;

		public FVRInteractiveObject althold;

		private void Awake()
		{
		}

		private void Update()
		{
			//IL_02f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0349: Unknown result type (might be due to invalid IL or missing references)
			//IL_034e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_03fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c2: 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_0187: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
			//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_0274: 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_02bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_0213: Unknown result type (might be due to invalid IL or missing references)
			Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject);
			if ((Object)(object)GM.CurrentPlayerBody != (Object)null)
			{
				if ((Object)(object)((FVRInteractiveObject)mainobj).m_hand == (Object)null && (Object)(object)althold.m_hand == (Object)null)
				{
					BoxPos.transform.localPosition = new Vector3(0f, 0f, 0f);
					BoxPos.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
					phymain.SetActive(false);
					phylid.SetActive(false);
					((Component)this).gameObject.transform.position = ((Component)GM.CurrentPlayerBody.Head).transform.position;
					((Component)this).gameObject.transform.eulerAngles = ((Component)GM.CurrentPlayerBody.Head).transform.eulerAngles;
					((Behaviour)X).enabled = true;
					((Behaviour)Y).enabled = true;
					((Behaviour)Z).enabled = true;
					((Behaviour)PC).enabled = true;
				}
				else if ((Object)(object)((FVRInteractiveObject)mainobj).m_hand != (Object)null || (Object)(object)althold.m_hand != (Object)null)
				{
					if ((Object)(object)((FVRInteractiveObject)mainobj).m_hand != (Object)null)
					{
						BoxPos.transform.position = ((Component)((FVRInteractiveObject)mainobj).m_hand).transform.position;
						BoxPos.transform.eulerAngles = ((Component)((FVRInteractiveObject)mainobj).m_hand).transform.eulerAngles;
					}
					else if ((Object)(object)althold.m_hand != (Object)null)
					{
						BoxPos.transform.position = ((Component)althold.m_hand).transform.position;
						BoxPos.transform.eulerAngles = ((Component)althold.m_hand).transform.eulerAngles;
					}
					phymain.SetActive(true);
					phylid.SetActive(true);
					((Behaviour)X).enabled = false;
					((Behaviour)Y).enabled = false;
					((Behaviour)Z).enabled = false;
					WaX.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
					WaY.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
					WaZ.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
					((Behaviour)PC).enabled = false;
					rot.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
				}
			}
			Scene activeScene = SceneManager.GetActiveScene();
			if (((Scene)(ref activeScene)).name == "MainMenu3" || GM.IsDead())
			{
				box.SetActive(false);
				colgrab.enabled = false;
				colgrabalt.enabled = false;
			}
			else
			{
				Scene activeScene2 = SceneManager.GetActiveScene();
				if (((Scene)(ref activeScene2)).name != "MainMenu3" && !GM.IsDead())
				{
					box.SetActive(true);
					colgrab.enabled = true;
					colgrabalt.enabled = true;
				}
			}
			if (lock1.transform.localEulerAngles.x > 15f && lock2.transform.localEulerAngles.x > 15f)
			{
				savevalue.SetActive(true);
			}
			else if (lock1.transform.localEulerAngles.x < 15f || lock2.transform.localEulerAngles.x < 15f)
			{
				savevalue.SetActive(false);
			}
		}
	}
}
namespace JerrySecureCase
{
	[BepInPlugin("Jerry.SecureCase", "JerrySecureCase", "1.0.0")]
	[BepInDependency("nrgill28.Sodalite", "1.3.2")]
	[BepInProcess("h3vr.exe")]
	public class AlphaCasePlugin : BaseUnityPlugin
	{
		private GameObject AlphaCase = null;

		private float timer = 0f;

		private float UpdateRate = 0.2f;

		private void Start()
		{
		}

		private void Update()
		{
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)AlphaCase == (Object)null)
			{
			}
			timer += Time.deltaTime;
			if (!(timer > UpdateRate))
			{
				return;
			}
			timer -= UpdateRate;
			if (!((Object)(object)AlphaCase == (Object)null))
			{
				return;
			}
			Scene activeScene = SceneManager.GetActiveScene();
			if (!(((Scene)(ref activeScene)).name != "MainMenu3"))
			{
				return;
			}
			if (IM.OD.ContainsKey("JerryAlphaCase"))
			{
				AnvilCallback<GameObject> gameObjectAsync = ((AnvilAsset)IM.OD["JerryAlphaCase"]).GetGameObjectAsync();
				if (Object.op_Implicit((Object)(object)gameObjectAsync.Result))
				{
					AlphaCase = Object.Instantiate<GameObject>(gameObjectAsync.Result);
					Console.Write("AlphaCase:Initialed new AlphaCase");
				}
				else
				{
					Scene activeScene2 = SceneManager.GetActiveScene();
					Console.Write("AlphaCase:Can't find AlphaCase,please wait for the assets load or report a bug,current scene name : {0}", ((Scene)(ref activeScene2)).name);
				}
			}
			else
			{
				Scene activeScene3 = SceneManager.GetActiveScene();
				Console.Write("AlphaCase:Can't find AlphaCase,please wait for the assets load or report a bug,current scene name : {0}", ((Scene)(ref activeScene3)).name);
			}
		}
	}
}
namespace JerryComponent
{
	public class PlayerCrouch : MonoBehaviour
	{
		public GameObject crouch;

		[SerializeField]
		private Transform body;

		public Ray ray;

		public float rayLength;

		[SerializeField]
		private LayerMask terrainLayer;

		public float rayStartYOffset = 0f;

		public float rayMul;

		public float dis;

		public RaycastHit rayhit;

		private void Start()
		{
		}

		private void Update()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_013e: 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_0123: Unknown result type (might be due to invalid IL or missing references)
			//IL_0170: Unknown result type (might be due to invalid IL or missing references)
			ray = new Ray(body.position + Vector3.up * rayStartYOffset, Vector3.down);
			Physics.Raycast(ray, ref rayhit, rayLength, ((LayerMask)(ref terrainLayer)).value);
			if (((RaycastHit)(ref rayhit)).distance > 0.6f)
			{
				dis = 0.6f * rayMul;
				crouch.transform.localEulerAngles = new Vector3(dis, 0f, 0f);
			}
			else
			{
				dis = ((RaycastHit)(ref rayhit)).distance * rayMul;
				crouch.transform.localEulerAngles = new Vector3(dis, 0f, 0f);
			}
			if (crouch.transform.localEulerAngles.x > 60f)
			{
				crouch.transform.localEulerAngles = new Vector3(60f, 0f, 0f);
			}
			else if (crouch.transform.localEulerAngles.x < 0f)
			{
				crouch.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
			}
		}
	}
	public class VolumeSlot : MonoBehaviour
	{
		public Transform parent;

		private void OnTriggerStay(Collider other)
		{
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			GameObject gameObject = ((Component)other).gameObject;
			FVRPhysicalObject component = gameObject.GetComponent<FVRPhysicalObject>();
			if (!((Object)(object)component != (Object)null) || !((Object)(object)gameObject != (Object)(object)parent) || (int)component.QBSlotType != 0 || ((FVRInteractiveObject)component).m_isHeld || !((Object)(object)component.m_quickbeltSlot == (Object)null) || !((Object)(object)((Component)component).gameObject.GetComponent<FVRFireArm>() == (Object)null) || !((Object)(object)((Component)component).gameObject.GetComponent<FVRFireArmMagazine>() == (Object)null))
			{
				return;
			}
			float num = Vector3.Distance(((Component)component).transform.position, ((Component)GM.CurrentPlayerBody.LeftHand).transform.position);
			float num2 = Vector3.Distance(((Component)component).transform.position, ((Component)GM.CurrentPlayerBody.RightHand).transform.position);
			if (num < 0.25f || num2 < 0.25f)
			{
				Rigidbody component2 = gameObject.GetComponent<Rigidbody>();
				if ((Object)(object)component2 != (Object)null)
				{
					gameObject.transform.SetParent(((Component)parent).transform);
					component2.useGravity = false;
					component2.isKinematic = true;
				}
			}
		}

		private void OnTriggerExit(Collider other)
		{
			//IL_002d: 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_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			GameObject gameObject = ((Component)other).gameObject;
			FVRPhysicalObject component = gameObject.GetComponent<FVRPhysicalObject>();
			if ((Object)(object)component != (Object)null && (Object)(object)gameObject != (Object)(object)parent && (int)component.QBSlotType == 0 && ((FVRInteractiveObject)component).m_isHeld && (Object)(object)component.m_quickbeltSlot == (Object)null && (Object)(object)((Component)component).gameObject.GetComponent<FVRFireArm>() == (Object)null && (Object)(object)((Component)component).gameObject.GetComponent<FVRFireArmMagazine>() == (Object)null)
			{
				Rigidbody component2 = gameObject.GetComponent<Rigidbody>();
				if ((Object)(object)component2 != (Object)null)
				{
					Scene activeScene = SceneManager.GetActiveScene();
					gameObject.transform.SetParent((Transform)null);
					SceneManager.MoveGameObjectToScene(gameObject, activeScene);
					component2.useGravity = true;
					component2.isKinematic = false;
				}
			}
		}
	}
	public class Beacon : MonoBehaviour
	{
		private void Start()
		{
		}

		private void Update()
		{
		}
	}
	public class DeathActivate : MonoBehaviour
	{
		public float countdown = 2f;

		public bool isNGAInstalled;

		public float timer = 1f;

		public bool loadouted = false;

		private void Start()
		{
			isNGAInstalled = Chainloader.PluginInfos.ContainsKey("NGA.SafehouseMP");
		}

		private void EnterWithLoadOut()
		{
			//IL_0048: 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_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Expected O, but got Unknown
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Expected O, but got Unknown
			if (countdown >= 0f)
			{
				countdown -= Time.deltaTime;
			}
			if (!loadouted && countdown < 0f)
			{
				loadouted = true;
				Transform transform = new GameObject().transform;
				transform.position = ((Component)GM.CurrentPlayerBody).transform.position;
				VaultFile val = new VaultFile();
				if (!VaultSystem.LoadVaultFile(SafehouseMP.raid_extracted_loadout_filename, (VaultFileDisplayMode)1, ref val))
				{
					Debug.Log((object)"ERROR: Loading saved loadout failed.");
					return;
				}
				string text = default(string);
				if (!VaultSystem.SpawnObjects((VaultFileDisplayMode)1, val, ref text, transform, Vector3.zero))
				{
					Debug.Log((object)"ERROR: Spawning saved loadout failed.");
					return;
				}
				VaultFile val2 = new VaultFile();
				VaultSystem.SaveVaultFile(SafehouseMP.raid_extracted_loadout_filename, (VaultFileDisplayMode)1, val2);
			}
		}

		private void FixedUpdate()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			if (!isNGAInstalled)
			{
				return;
			}
			Scene activeScene = SceneManager.GetActiveScene();
			if (!(((Scene)(ref activeScene)).name == "FactoryExt"))
			{
				return;
			}
			timer -= Time.deltaTime;
			if (timer <= 0f)
			{
				timer = 0f;
				if (Vector3.Distance(((Component)this).transform.position, GM.CurrentMovementManager.Head.position) < 0.25f)
				{
					EnterWithLoadOut();
				}
			}
		}
	}
	public class DeathBody : MonoBehaviour
	{
		public GameObject deathswitch;

		public GameObject body;

		public Transform spawnpoint;

		public GameObject player;

		public bool dead = false;

		private DropItems deadbody;

		public FVRQuickBeltSlot headslotalive;

		public FVRQuickBeltSlot bodyslotalive;

		public FVRQuickBeltSlot maskslotalive;

		public FVRQuickBeltSlot armorslotalive;

		public FVRQuickBeltSlot beltslotalive;

		private FVRPhysicalObject helmet;

		private FVRPhysicalObject vest;

		private FVRPhysicalObject mask;

		private FVRPhysicalObject armor;

		private FVRPhysicalObject belt;

		public MeshRenderer armband;

		private void Start()
		{
		}

		private void Update()
		{
			//IL_000c: 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_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0116: Unknown result type (might be due to invalid IL or missing references)
			//IL_013b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0173: Unknown result type (might be due to invalid IL or missing references)
			//IL_0198: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_022d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0252: Unknown result type (might be due to invalid IL or missing references)
			//IL_0610: Unknown result type (might be due to invalid IL or missing references)
			//IL_0620: Unknown result type (might be due to invalid IL or missing references)
			//IL_028a: Unknown result type (might be due to invalid IL or missing references)
			//IL_02af: Unknown result type (might be due to invalid IL or missing references)
			if (deathswitch.transform.localEulerAngles.x < 45f)
			{
			}
			if (!(deathswitch.transform.localEulerAngles.x > 45f))
			{
				return;
			}
			if ((Object)(object)deadbody == (Object)null || !dead || (Object)(object)helmet == (Object)null || (Object)(object)vest == (Object)null || (Object)(object)mask == (Object)null || (Object)(object)armor == (Object)null || (Object)(object)belt == (Object)null)
			{
			}
			if ((Object)(object)deadbody != (Object)null && dead)
			{
				deadbody.dc.isdead = true;
				if ((Object)(object)helmet != (Object)null)
				{
					((Component)helmet).gameObject.transform.position = deadbody.headslot.position;
					((Component)helmet).gameObject.transform.eulerAngles = deadbody.headslot.eulerAngles;
				}
				if ((Object)(object)vest != (Object)null)
				{
					((Component)vest).gameObject.transform.position = deadbody.bodyslot.position;
					((Component)vest).gameObject.transform.eulerAngles = deadbody.bodyslot.eulerAngles;
				}
				if ((Object)(object)mask != (Object)null)
				{
					((Component)mask).gameObject.transform.position = deadbody.maskslot.position;
					((Component)mask).gameObject.transform.eulerAngles = deadbody.maskslot.eulerAngles;
				}
				if ((Object)(object)armor != (Object)null)
				{
					((Component)armor).gameObject.transform.position = deadbody.armorslot.position;
					((Component)armor).gameObject.transform.eulerAngles = deadbody.armorslot.eulerAngles;
				}
				if ((Object)(object)belt != (Object)null)
				{
					((Component)belt).gameObject.transform.position = deadbody.beltslot.position;
					((Component)belt).gameObject.transform.eulerAngles = deadbody.beltslot.eulerAngles;
				}
				if ((Object)(object)headslotalive.CurObject != (Object)null)
				{
					helmet = headslotalive.CurObject;
					headslotalive.CurObject.ClearQuickbeltState();
				}
				if ((Object)(object)maskslotalive.CurObject != (Object)null)
				{
					mask = maskslotalive.CurObject;
					maskslotalive.CurObject.ClearQuickbeltState();
				}
				if ((Object)(object)bodyslotalive.CurObject != (Object)null)
				{
					vest = bodyslotalive.CurObject;
					bodyslotalive.CurObject.ClearQuickbeltState();
				}
				if ((Object)(object)armorslotalive.CurObject != (Object)null)
				{
					armor = armorslotalive.CurObject;
					armorslotalive.CurObject.ClearQuickbeltState();
				}
				if ((Object)(object)beltslotalive.CurObject != (Object)null)
				{
					belt = beltslotalive.CurObject;
					beltslotalive.CurObject.ClearQuickbeltState();
				}
			}
			if (GM.IsDead())
			{
				for (int num = GM.CurrentPlayerBody.QuickbeltSlots.Count - 1; num >= 0; num--)
				{
					if ((Object)(object)GM.CurrentPlayerBody.QuickbeltSlots[num] != (Object)null && (Object)(object)GM.CurrentPlayerBody.QuickbeltSlots[num].CurObject != (Object)null)
					{
						FVRPhysicalObject curObject = GM.CurrentPlayerBody.QuickbeltSlots[num].CurObject;
						curObject.ClearQuickbeltState();
						curObject.DeRegisterQuickbeltSlots();
						curObject.SetIsKinematicLocked(false);
						curObject.SetQuickBeltSlot((FVRQuickBeltSlot)null);
						curObject.SetParentage((Transform)null);
						((FVRInteractiveObject)curObject).SetAllCollidersToLayer(false, "Default");
						((FVRInteractiveObject)curObject).BeginInteraction(GM.CurrentMovementManager.Hands[0]);
						((FVRInteractiveObject)curObject).EndInteraction(GM.CurrentMovementManager.Hands[0]);
						GM.CurrentPlayerBody.QuickbeltSlots[num].CurObject = null;
					}
				}
				if ((Object)(object)GM.CurrentMovementManager.Hands[0].CurrentInteractable != (Object)null)
				{
					GM.CurrentMovementManager.Hands[0].CurrentInteractable.IsHeld = false;
					GM.CurrentMovementManager.Hands[0].CurrentInteractable.EndInteraction(GM.CurrentMovementManager.Hands[0]);
					GM.CurrentMovementManager.Hands[0].EndInteractionIfHeld(GM.CurrentMovementManager.Hands[0].CurrentInteractable);
				}
				if ((Object)(object)GM.CurrentMovementManager.Hands[1].CurrentInteractable != (Object)null)
				{
					GM.CurrentMovementManager.Hands[1].CurrentInteractable.IsHeld = false;
					GM.CurrentMovementManager.Hands[1].CurrentInteractable.EndInteraction(GM.CurrentMovementManager.Hands[1]);
					GM.CurrentMovementManager.Hands[1].EndInteractionIfHeld(GM.CurrentMovementManager.Hands[1].CurrentInteractable);
				}
				DropQuickbeltContents();
				((Renderer)armband).enabled = false;
				player.SetActive(false);
				if (!dead)
				{
					int quickbeltPreset = GM.Options.QuickbeltOptions.QuickbeltPreset;
					GM.CurrentPlayerBody.ConfigureQuickbelt(quickbeltPreset + 1);
					deadbody = Object.Instantiate<GameObject>(body, ((Component)spawnpoint).transform.position, ((Component)spawnpoint).transform.rotation).GetComponent<DropItems>();
					dead = true;
				}
			}
			if (!GM.IsDead())
			{
				if ((Object)(object)deadbody != (Object)null)
				{
					deadbody.dc.cam.SetActive(false);
					deadbody.dc.isdead = false;
				}
				if (dead)
				{
					int quickbeltPreset2 = GM.Options.QuickbeltOptions.QuickbeltPreset;
					GM.CurrentPlayerBody.ConfigureQuickbelt(quickbeltPreset2);
				}
				if ((Object)(object)helmet != (Object)null)
				{
					((Component)helmet).transform.SetParent((Transform)null);
				}
				if ((Object)(object)vest != (Object)null)
				{
					((Component)vest).transform.SetParent((Transform)null);
				}
				if ((Object)(object)mask != (Object)null)
				{
					((Component)mask).transform.SetParent((Transform)null);
				}
				if ((Object)(object)armor != (Object)null)
				{
					((Component)armor).transform.SetParent((Transform)null);
				}
				if ((Object)(object)belt != (Object)null)
				{
					((Component)belt).transform.SetParent((Transform)null);
				}
				helmet = null;
				vest = null;
				mask = null;
				armor = null;
				belt = null;
				((Renderer)armband).enabled = true;
				player.SetActive(true);
				dead = false;
			}
		}

		public void DropQuickbeltContents()
		{
		}
	}
	public class DeathCamera : MonoBehaviour
	{
		public bool spawned = true;

		public bool isdead = true;

		public GameObject cam;

		public GameObject cam2;

		public GameObject camholderpos;

		public GameObject camholderrot;

		private void Start()
		{
			cam.SetActive(false);
			spawned = true;
		}

		private void Update()
		{
			//IL_002e: 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_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			if (isdead)
			{
				cam.SetActive(true);
				((Component)GM.CurrentMovementManager).transform.eulerAngles = cam2.transform.eulerAngles;
				camholderpos.transform.localPosition = -((Component)GM.CurrentPlayerBody.Head).gameObject.transform.localPosition;
				spawned = false;
			}
			if (!isdead)
			{
				cam.SetActive(false);
				if (!spawned)
				{
					((Component)GM.CurrentMovementManager).transform.position = GM.CurrentSceneSettings.DeathResetPoint.position;
					spawned = true;
				}
				((Component)GM.CurrentMovementManager).transform.eulerAngles = new Vector3(0f, ((Component)GM.CurrentMovementManager).transform.eulerAngles.y, 0f);
			}
		}

		private void OnDestroy()
		{
			cam.SetActive(false);
		}
	}
	public class DestroyOnAudioStop : MonoBehaviour
	{
		public GameObject thisobj;

		public AudioSource thisaudio;

		private void Start()
		{
			Object.DontDestroyOnLoad((Object)(object)thisobj);
		}

		private void Update()
		{
			if (!thisaudio.isPlaying)
			{
				Object.Destroy((Object)(object)thisobj);
			}
		}
	}
	public class DropItems : MonoBehaviour
	{
		public DeathCamera dc;

		public Rigidbody head;

		public Rigidbody pelvis;

		public Rigidbody spine;

		public Rigidbody thighL;

		public Rigidbody thighR;

		public Rigidbody calfL;

		public Rigidbody calfR;

		public Rigidbody upperarmL;

		public Rigidbody upperarmR;

		public Rigidbody forearmL;

		public Rigidbody forearmR;

		public Transform headslot;

		public Transform bodyslot;

		public Transform maskslot;

		public Transform armorslot;

		public Transform beltslot;

		private void Start()
		{
		}

		private void Update()
		{
			head.isKinematic = false;
			pelvis.isKinematic = false;
			spine.isKinematic = false;
			thighL.isKinematic = false;
			thighR.isKinematic = false;
			calfL.isKinematic = false;
			calfR.isKinematic = false;
			upperarmL.isKinematic = false;
			upperarmR.isKinematic = false;
			forearmL.isKinematic = false;
			forearmR.isKinematic = false;
		}
	}
	public class EFTMode : MonoBehaviour
	{
		public TextMesh countdowntext;

		public GameObject countdownboard;

		public float countdownstart = 3f;

		public bool startcount = false;

		public bool tele = true;

		public GameObject playerdetectpoint;

		public bool m_isLoading = false;

		public GameObject death;

		public GameObject escape;

		public float deathcountdownnum = 15f;

		public bool addcomp = false;

		private void Start()
		{
			escape.SetActive(false);
			death.SetActive(false);
		}

		private void FixedUpdate()
		{
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			//IL_016f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0184: Unknown result type (might be due to invalid IL or missing references)
			if (startcount)
			{
				countdownboard.SetActive(true);
				countdownstart -= Time.deltaTime;
				countdowntext.text = "SpawnLoadout" + countdownstart.ToString("f1");
			}
			if (countdownstart < 0f)
			{
				countdownboard.SetActive(false);
				startcount = false;
			}
			if (!addcomp && (Object)(object)GM.CurrentPlayerBody != (Object)null && (Object)(object)Object.FindObjectOfType<DeathActivate>() == (Object)null)
			{
				playerdetectpoint.AddComponent<DeathActivate>();
				startcount = true;
				addcomp = true;
			}
			if ((Object)(object)GM.CurrentMovementManager != (Object)null)
			{
				playerdetectpoint.transform.position = GM.CurrentMovementManager.Head.position;
				playerdetectpoint.transform.eulerAngles = GM.CurrentMovementManager.Head.eulerAngles;
			}
			if (!GM.IsDead())
			{
				return;
			}
			deathcountdownnum -= 1f * Time.deltaTime;
			if (deathcountdownnum < 10f)
			{
				death.SetActive(true);
				if (tele)
				{
					GM.CurrentMovementManager.TeleportToPoint(new Vector3(0f, 0f, 0f), true, new Vector3(0f, 0f, 0f));
					tele = false;
				}
			}
			if (!m_isLoading && deathcountdownnum < 0f)
			{
				m_isLoading = true;
			}
		}
	}
	public class Extractpoint : MonoBehaviour
	{
		public bool isNGAInstalled;

		public float telecountdown = 1f;

		public bool telecount = false;

		public bool telecount2 = false;

		public GameObject motherboard;

		public bool startcountdown = false;

		public EFTMode modemain;

		public float countdownnum = 12f;

		public bool sceneswitched = false;

		public GameObject countdownboard;

		public Transform hidepoint;

		public TextMesh countdowntext;

		private void OnTriggerStay(Collider other)
		{
			if ((Object)(object)((Component)other).gameObject == (Object)(object)modemain.playerdetectpoint)
			{
				startcountdown = true;
			}
		}

		private void OnTriggerExit(Collider other)
		{
			if ((Object)(object)((Component)other).gameObject == (Object)(object)modemain.playerdetectpoint)
			{
				startcountdown = false;
			}
		}

		private void Start()
		{
			isNGAInstalled = Chainloader.PluginInfos.ContainsKey("NGA.SafehouseMP");
			motherboard.SetActive(true);
		}

		private void FixedUpdate()
		{
			//IL_00e3: 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_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0164: Unknown result type (might be due to invalid IL or missing references)
			//IL_0188: Unknown result type (might be due to invalid IL or missing references)
			if (!isNGAInstalled)
			{
				((Component)this).gameObject.SetActive(false);
			}
			else if (isNGAInstalled)
			{
				if (telecount)
				{
					telecountdown -= Time.deltaTime;
				}
				if (telecountdown < 0f && !telecount2)
				{
					telecount = false;
					telecount2 = true;
					modemain.escape.SetActive(true);
					GM.CurrentMovementManager.TeleportToPoint(((Component)hidepoint).transform.position, true, ((Component)hidepoint).transform.localEulerAngles);
				}
				if (countdownnum < 2f)
				{
					motherboard.SetActive(false);
					SteamVR_Fade.Start(new Color(0f, 0f, 0f, 1f), 0.25f, false);
					telecount = true;
				}
				if (countdownnum < 0f && !sceneswitched)
				{
					Save();
					Escape();
					startcountdown = false;
					sceneswitched = true;
				}
				if (startcountdown)
				{
					countdownboard.SetActive(true);
					countdownboard.transform.position = ((Component)GM.CurrentMovementManager.Head).transform.position;
					countdownboard.transform.eulerAngles = ((Component)GM.CurrentMovementManager.Head).transform.eulerAngles;
					countdowntext.text = "Extract" + (countdownnum - 2f).ToString("f1");
					countdownnum -= 1f * Time.deltaTime;
				}
				if (!startcountdown)
				{
					countdownboard.SetActive(false);
					countdowntext.text = "Extract10";
					countdownnum = 12f;
				}
			}
		}

		private void Save()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Expected O, but got Unknown
			//IL_0061: 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_0087: Unknown result type (might be due to invalid IL or missing references)
			VaultFile val = new VaultFile();
			if (VaultSystem.FindAndScanObjectsInQuickbelt(val))
			{
				if (!VaultSystem.SaveVaultFile(SafehouseMP.raid_extracted_loadout_filename, (VaultFileDisplayMode)1, val))
				{
					Debug.Log((object)"ERROR: Saving loadout failed.");
				}
				else if (SafehouseMP.config_delete_loadout_on_save.Value)
				{
					VaultFile val2 = new VaultFile();
					FVRPlayerBody val3 = Object.FindObjectOfType<FVRPlayerBody>();
					Transform transform = new GameObject().transform;
					transform.position = ((Component)val3).transform.position;
					string text = default(string);
					if (!VaultSystem.SpawnObjects((VaultFileDisplayMode)1, val2, ref text, transform, Vector3.zero))
					{
						Debug.Log((object)("ERROR: Couldn't spawn empty loadout w status: " + text));
					}
				}
			}
			else
			{
				Debug.Log((object)"ERROR: Quickbelt scan failed.");
			}
		}

		private void Escape()
		{
			for (int i = 0; i < GM.CurrentSceneSettings.QuitReceivers.Count; i++)
			{
				GM.CurrentSceneSettings.QuitReceivers[i].BroadcastMessage("QUIT", (SendMessageOptions)1);
			}
			if (((AnvilCallbackBase)GM.LoadingCallback).IsCompleted)
			{
				CustomSceneInfo customScene = AtlasPlugin.GetCustomScene("EFTHideOut_SafeHouse");
				if (customScene != null)
				{
					AtlasPlugin.LoadCustomScene("EFTHideOut_SafeHouse");
				}
				else
				{
					SteamVR_LoadLevel.Begin("EFTHideOut_SafeHouse", false, 0f, 0f, 0f, 0f, 1f);
				}
			}
		}
	}
	public class Humansig : MonoBehaviour
	{
		public GameObject handL;

		public GameObject handR;

		public Sosig sosig;

		public GameObject body;

		private void Start()
		{
			sosig = ((Component)this).GetComponentInParent<Sosig>();
		}

		private void Update()
		{
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: 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_012b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0167: Unknown result type (might be due to invalid IL or missing references)
			//IL_0191: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)sosig == (Object)null)
			{
			}
			if ((Object)(object)sosig != (Object)null)
			{
				if ((int)sosig.BodyState != 0)
				{
					Object.Instantiate<GameObject>(body, ((Component)sosig).gameObject.transform.position, ((Component)sosig).gameObject.transform.rotation);
					Object.Destroy((Object)(object)((Component)sosig).gameObject);
					Object.Destroy((Object)(object)this);
				}
				sosig.Renderers[0].enabled = false;
				sosig.Renderers[1].enabled = false;
				sosig.Renderers[2].enabled = false;
				sosig.Renderers[3].enabled = false;
				if (sosig.Hand_Primary != null)
				{
					handR.transform.position = ((Component)sosig.Hand_Primary.Root).transform.position;
					handR.transform.eulerAngles = ((Component)sosig.Hand_Primary.Root).transform.eulerAngles;
				}
				if (sosig.Hand_Secondary != null)
				{
					handL.transform.position = ((Component)sosig.Hand_Secondary.Root).transform.position;
					handL.transform.eulerAngles = ((Component)sosig.Hand_Secondary.Root).transform.eulerAngles;
				}
			}
		}
	}
	public class Humansigconv : MonoBehaviour
	{
		public float countdown = 2f;

		public bool conved = false;

		public FVRObject body;

		public FVRObject bodySCAVBoss;

		private void Start()
		{
		}

		private void Update()
		{
			//IL_0165: Unknown result type (might be due to invalid IL or missing references)
			//IL_0185: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a9: 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)
			if (!conved)
			{
				countdown -= Time.deltaTime;
			}
			if (!(countdown < 0f) || conved)
			{
				return;
			}
			conved = true;
			Sosig[] array = Object.FindObjectsOfType<Sosig>();
			if (array == null)
			{
				return;
			}
			Sosig[] array2 = array;
			foreach (Sosig val in array2)
			{
				Debug.Log((object)"sosig found");
				if (((Object)((Component)val).gameObject).name == "Zosig_Rot(Clone)" && val.Renderers[0].enabled && (Object)(object)val.Links[0] != (Object)null)
				{
					GameObject val2 = Object.Instantiate<GameObject>(((AnvilAsset)bodySCAVBoss).GetGameObject(), ((Component)val.Links[0]).transform);
					val.CanBeKnockedOut = false;
					val.DoesDropWeaponsOnBallistic = false;
					val.DamMult_Blunt = 0.25f;
					val.DamMult_Chilling = 0.25f;
					val.DamMult_Cutting = 0.25f;
					val.DamMult_EMP = 0.15f;
					val.DamMult_Explosive = 0.55f;
					val.DamMult_Melee = 0.35f;
					val.DamMult_Piercing = 0.1f;
					val.DamMult_Projectile = 0.1f;
					val.DamMult_Thermal = 0.1f;
					if ((Object)(object)val2 != (Object)null)
					{
						val2.transform.localPosition = new Vector3(0f, 0f, 0f);
						val2.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
						Humansig component = val2.GetComponent<Humansig>();
						if ((Object)(object)component != (Object)null)
						{
							component.sosig = val;
						}
					}
					Debug.Log((object)"SCAVboss spawned on sosig");
				}
				if (!(((Object)((Component)val).gameObject).name != "Zosig_Rot(Clone)") || !val.Renderers[0].enabled || !((Object)(object)val.Links[0] != (Object)null))
				{
					continue;
				}
				GameObject val3 = Object.Instantiate<GameObject>(((AnvilAsset)body).GetGameObject(), ((Component)val.Links[0]).transform);
				val.DamMult_Blunt = 0.75f;
				val.DamMult_Chilling = 1f;
				val.DamMult_Cutting = 0.75f;
				val.DamMult_EMP = 0.5f;
				val.DamMult_Explosive = 1f;
				val.DamMult_Melee = 1.5f;
				val.DamMult_Piercing = 0.5f;
				val.DamMult_Projectile = 0.5f;
				val.DamMult_Thermal = 0.5f;
				if ((Object)(object)val3 != (Object)null)
				{
					val3.transform.localPosition = new Vector3(0f, 0f, 0f);
					val3.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
					Humansig component2 = val3.GetComponent<Humansig>();
					if ((Object)(object)component2 != (Object)null)
					{
						component2.sosig = val;
					}
				}
				Debug.Log((object)"USEC spawned on sosig");
			}
		}
	}
	public class AmITheFirst : MonoBehaviour
	{
		public string objname;

		public GameObject objtoenable;

		public FVRObject theobjname;

		private void Start()
		{
			if ((Object)(object)GameObject.Find(objname) == (Object)null)
			{
				objtoenable.SetActive(true);
				Object.Instantiate<GameObject>(((AnvilAsset)theobjname).GetGameObject(), ((Component)this).transform);
				Debug.Log((object)"first");
			}
			if ((Object)(object)GameObject.Find(objname) != (Object)null)
			{
				objtoenable.SetActive(false);
				Debug.Log((object)"not first");
			}
		}

		private void Update()
		{
		}
	}
	public class SpawnFVROBJ : MonoBehaviour
	{
		public bool spawnpicked = false;

		public Random Rand;

		public ObjectSpawnPoint[] IDs;

		public ObjectSpawnPoint ID;

		public int length;

		private void Start()
		{
			IDs = ((Component)this).GetComponents<ObjectSpawnPoint>();
			RandomPick();
		}

		private void FixedUpdate()
		{
			if ((Object)(object)ID == (Object)null)
			{
				Debug.Log((object)"Null");
			}
		}

		private void RandomPick()
		{
			if (!spawnpicked)
			{
				int num = Random.Range(0, IDs.Length);
				ID = IDs[num];
				if ((Object)(object)ID != (Object)null)
				{
					((Behaviour)ID).enabled = true;
					Debug.Log((object)"Loot spawned");
				}
				spawnpicked = true;
			}
		}
	}
	public class DrawDecal : MonoBehaviour
	{
		private void OnTriggerEnter(Collider other)
		{
			if (((Object)((Component)other).gameObject).name == "MarkeTail")
			{
				Object.Destroy((Object)(object)this);
			}
		}

		private void Start()
		{
		}

		private void Update()
		{
		}
	}
	public class DrawingTool : MonoBehaviour
	{
		public GameObject penref;

		public GameObject decal;

		private void OnTriggerStay(Collider other)
		{
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			if (((Object)((Component)other).gameObject).name == "MarkerTip")
			{
				penref.transform.position = ((Component)other).gameObject.transform.position;
				Object.Instantiate<GameObject>(decal, penref.transform.position, ((Component)this).transform.rotation, ((Component)this).transform);
			}
		}

		private void Start()
		{
		}

		private void FixedUpdate()
		{
		}
	}
	public class SnapToPointRigidbody : MonoBehaviour
	{
		public Transform snapTo;

		[NonSerialized]
		private Rigidbody body;

		public float snapTime = 2f;

		[NonSerialized]
		private float dropTimer;

		public void Start()
		{
			body = ((Component)this).GetComponent<Rigidbody>();
		}

		public void FixedUpdate()
		{
			//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)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0108: 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_0129: Unknown result type (might be due to invalid IL or missing references)
			//IL_013b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			dropTimer += Time.deltaTime / (snapTime / 2f);
			body.isKinematic = dropTimer > 1f;
			if (dropTimer > 1f)
			{
				((Component)this).transform.position = snapTo.position;
				((Component)this).transform.rotation = snapTo.rotation;
				return;
			}
			float num = Mathf.Pow(35f, dropTimer);
			body.velocity = Vector3.Lerp(body.velocity, Vector3.zero, Time.fixedDeltaTime * 4f);
			if (body.useGravity)
			{
				body.AddForce(-Physics.gravity);
			}
			((Component)this).transform.position = Vector3.Lerp(((Component)this).transform.position, snapTo.position, Time.fixedDeltaTime * num * 3f);
			((Component)this).transform.rotation = Quaternion.Slerp(((Component)this).transform.rotation, snapTo.rotation, Time.fixedDeltaTime * num * 2f);
		}
	}
}
namespace JerryAr.EFT_ALPHA_CASE
{
	[BepInPlugin("JerryAr.EFT_ALPHA_CASE", "EFT_ALPHA_CASE", "1.2.0")]
	[BepInProcess("h3vr.exe")]
	[Description("Built with MeatKit")]
	[BepInDependency("h3vr.otherloader", "1.3.0")]
	public class EFT_ALPHA_CASEPlugin : BaseUnityPlugin
	{
		private static readonly string BasePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

		internal static ManualLogSource Logger;

		private void Awake()
		{
			Logger = ((BaseUnityPlugin)this).Logger;
			LoadAssets();
		}

		private void LoadAssets()
		{
			Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "JerryAr.EFT_ALPHA_CASE");
			OtherLoader.RegisterDirectLoad(BasePath, "JerryAr.EFT_ALPHA_CASE", "", "", "jerryalphacase", "");
		}
	}
}
namespace JerryComponent
{
	public class MoveItemSpawner : MonoBehaviour
	{
		public GameObject itemspawner;

		public GameObject parent;

		private void Start()
		{
		}

		private void FixedUpdate()
		{
			if ((Object)(object)itemspawner == (Object)null)
			{
				if ((Object)(object)Object.FindObjectOfType<ItemSpawnerV2>() != (Object)null)
				{
					itemspawner = ((Component)Object.FindObjectOfType<ItemSpawnerV2>()).gameObject;
				}
			}
			else if ((Object)(object)itemspawner != (Object)null && (Object)(object)itemspawner.transform.parent != (Object)(object)parent.transform)
			{
				itemspawner.transform.SetParent(parent.transform);
			}
		}
	}
	public class RandomSpawn : MonoBehaviour
	{
		public bool spawnpicked = false;

		public bool exitpicked = false;

		public bool spawnremoved = false;

		public bool exitremoved = false;

		public Random Rand;

		public Random Randext1;

		public Random Randext2;

		public GameObject[] spawnpoints;

		public GameObject _Selected;

		public GameObject[] exitpoints1;

		public GameObject _Selectedexit1;

		public GameObject[] exitpoints2;

		public GameObject _Selectedexit2;

		public int _MaxNum;

		public int _Maxext1;

		public int _Maxext2;

		private void Start()
		{
			RandomPick();
			spawnpicked = false;
			RandomExit();
			exitpicked = false;
		}

		private void FixedUpdate()
		{
			if ((Object)(object)_Selected == (Object)null)
			{
			}
			if (GM.IsDead())
			{
				if (!spawnremoved)
				{
					_Selected.SetActive(false);
					spawnremoved = true;
				}
				RandomPick();
			}
			if (!GM.IsDead())
			{
				spawnremoved = false;
				spawnpicked = false;
			}
		}

		private void RandomPick()
		{
			if (!spawnpicked)
			{
				int num = Random.Range(0, _MaxNum);
				_Selected = spawnpoints[num];
				if ((Object)(object)_Selected != (Object)null)
				{
					_Selected.SetActive(true);
				}
				spawnpicked = true;
			}
		}

		private void RandomExit()
		{
			if (!exitpicked)
			{
				int num = Random.Range(0, _Maxext1);
				_Selectedexit1 = exitpoints1[num];
				if ((Object)(object)_Selectedexit1 != (Object)null)
				{
					_Selectedexit1.SetActive(true);
				}
				int num2 = Random.Range(0, _Maxext2);
				_Selectedexit2 = exitpoints2[num2];
				if ((Object)(object)_Selectedexit2 != (Object)null)
				{
					_Selectedexit2.SetActive(true);
				}
				exitpicked = true;
			}
		}
	}
}
public class AutoLoadAndSave : MonoBehaviour
{
	public bool saved = false;

	public bool isH3MPInstalled;

	public float countdown = 2f;

	public bool isNGAInstalled;

	public float timer = 1f;

	public bool sceneSpawned = false;

	public bool loadouted = false;

	private void Start()
	{
		isH3MPInstalled = Chainloader.PluginInfos.ContainsKey("VIP.TommySoucy.H3MP");
		isNGAInstalled = Chainloader.PluginInfos.ContainsKey("NGA.SafehouseMP");
	}

	private void EnterWithLoadOut()
	{
		//IL_0048: 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_0068: Unknown result type (might be due to invalid IL or missing references)
		//IL_006e: Expected O, but got Unknown
		//IL_009e: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d1: Expected O, but got Unknown
		if (countdown >= 0f)
		{
			countdown -= Time.deltaTime;
		}
		if (!loadouted && countdown < 0f)
		{
			loadouted = true;
			Transform transform = new GameObject().transform;
			transform.position = ((Component)GM.CurrentPlayerBody).transform.position;
			VaultFile val = new VaultFile();
			if (!VaultSystem.LoadVaultFile(SafehouseMP.raid_extracted_loadout_filename, (VaultFileDisplayMode)1, ref val))
			{
				Debug.Log((object)"ERROR: Loading saved loadout failed.");
				return;
			}
			string text = default(string);
			if (!VaultSystem.SpawnObjects((VaultFileDisplayMode)1, val, ref text, transform, Vector3.zero))
			{
				Debug.Log((object)"ERROR: Spawning saved loadout failed.");
				return;
			}
			VaultFile val2 = new VaultFile();
			VaultSystem.SaveVaultFile(SafehouseMP.raid_extracted_loadout_filename, (VaultFileDisplayMode)1, val2);
		}
	}

	private void FixedUpdate()
	{
		//IL_02de: Unknown result type (might be due to invalid IL or missing references)
		//IL_02fd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0199: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_0055: 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_03b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_03c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0342: Unknown result type (might be due to invalid IL or missing references)
		//IL_0349: Expected O, but got Unknown
		//IL_036e: Unknown result type (might be due to invalid IL or missing references)
		//IL_026c: Unknown result type (might be due to invalid IL or missing references)
		//IL_027b: Unknown result type (might be due to invalid IL or missing references)
		//IL_01fd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0203: Expected O, but got Unknown
		//IL_0128: Unknown result type (might be due to invalid IL or missing references)
		//IL_0137: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bf: Expected O, but got Unknown
		//IL_0227: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
		if (isH3MPInstalled)
		{
			if (Client.isFullyConnected)
			{
				if (!ThreadManager.host || !isNGAInstalled)
				{
					return;
				}
				if ((Object)(object)GM.CurrentPlayerBody != (Object)null)
				{
					((Component)this).gameObject.transform.position = GM.CurrentPlayerBody.Head.position;
					((Component)this).gameObject.transform.eulerAngles = GM.CurrentPlayerBody.Head.eulerAngles;
				}
				timer -= Time.deltaTime;
				if (!(timer <= 0f))
				{
					return;
				}
				timer = 0f;
				if (!sceneSpawned)
				{
					VaultFile val = new VaultFile();
					if (VaultSystem.DoesVaultFileExist((VaultFileDisplayMode)2, "EFTHideOut_Standard_Edition_SaveFile"))
					{
						VaultSystem.LoadVaultFile("EFTHideOut_Standard_Edition_SaveFile", (VaultFileDisplayMode)2, ref val);
						string text = default(string);
						VaultSystem.SpawnObjects((VaultFileDisplayMode)2, val, ref text, (Transform)null, Vector3.zero);
						Debug.Log((object)"SceneLoaded");
					}
					else if (!VaultSystem.DoesVaultFileExist((VaultFileDisplayMode)2, "EFTHideOut_Standard_Edition_SaveFile"))
					{
						Debug.Log((object)"Can't find scene save");
					}
					sceneSpawned = true;
				}
				if (Vector3.Distance(((Component)this).transform.position, GM.CurrentMovementManager.Head.position) < 0.25f)
				{
					EnterWithLoadOut();
				}
			}
			else
			{
				if (Client.isFullyConnected || !isNGAInstalled)
				{
					return;
				}
				if ((Object)(object)GM.CurrentPlayerBody != (Object)null)
				{
					((Component)this).gameObject.transform.position = GM.CurrentPlayerBody.Head.position;
					((Component)this).gameObject.transform.eulerAngles = GM.CurrentPlayerBody.Head.eulerAngles;
				}
				timer -= Time.deltaTime;
				if (!(timer <= 0f))
				{
					return;
				}
				timer = 0f;
				if (!sceneSpawned)
				{
					VaultFile val2 = new VaultFile();
					if (VaultSystem.DoesVaultFileExist((VaultFileDisplayMode)2, "EFTHideOut_Standard_Edition_SaveFile"))
					{
						VaultSystem.LoadVaultFile("EFTHideOut_Standard_Edition_SaveFile", (VaultFileDisplayMode)2, ref val2);
						string text2 = default(string);
						VaultSystem.SpawnObjects((VaultFileDisplayMode)2, val2, ref text2, (Transform)null, Vector3.zero);
						Debug.Log((object)"SceneLoaded");
					}
					else if (!VaultSystem.DoesVaultFileExist((VaultFileDisplayMode)2, "EFTHideOut_Standard_Edition_SaveFile"))
					{
						Debug.Log((object)"Can't find scene save");
					}
					sceneSpawned = true;
				}
				if (Vector3.Distance(((Component)this).transform.position, GM.CurrentMovementManager.Head.position) < 0.25f)
				{
					EnterWithLoadOut();
				}
			}
		}
		else
		{
			if (isH3MPInstalled || !isNGAInstalled)
			{
				return;
			}
			if ((Object)(object)GM.CurrentPlayerBody != (Object)null)
			{
				((Component)this).gameObject.transform.position = GM.CurrentPlayerBody.Head.position;
				((Component)this).gameObject.transform.eulerAngles = GM.CurrentPlayerBody.Head.eulerAngles;
			}
			timer -= Time.deltaTime;
			if (!(timer <= 0f))
			{
				return;
			}
			timer = 0f;
			if (!sceneSpawned)
			{
				VaultFile val3 = new VaultFile();
				if (VaultSystem.DoesVaultFileExist((VaultFileDisplayMode)2, "EFTHideOut_Standard_Edition_SaveFile"))
				{
					VaultSystem.LoadVaultFile("EFTHideOut_Standard_Edition_SaveFile", (VaultFileDisplayMode)2, ref val3);
					string text3 = default(string);
					VaultSystem.SpawnObjects((VaultFileDisplayMode)2, val3, ref text3, (Transform)null, Vector3.zero);
					Debug.Log((object)"SceneLoaded");
				}
				else if (!VaultSystem.DoesVaultFileExist((VaultFileDisplayMode)2, "EFTHideOut_Standard_Edition_SaveFile"))
				{
					Debug.Log((object)"Can't find scene save");
				}
				sceneSpawned = true;
			}
			if (Vector3.Distance(((Component)this).transform.position, GM.CurrentMovementManager.Head.position) < 0.25f)
			{
				EnterWithLoadOut();
			}
		}
	}
}
public class AutoLoadSceneOnStart : MonoBehaviour
{
	public bool isH3MPInstalled;

	private VaultFile FileToSpawn = new VaultFile();

	public bool saved = false;

	public string FileName;

	public string SceneVaultFileName;

	public string PluginDictionaryString;

	public float countdown = 2f;

	public float timer = 1f;

	public bool sceneSpawned = false;

	public bool loadouted = false;

	public bool loadonlyonce = false;

	public string newlySavedFileName;

	public bool isPMCStandard;

	private void Awake()
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Expected O, but got Unknown
		PluginInfo value = new PluginInfo();
		Chainloader.PluginInfos.TryGetValue(PluginDictionaryString, out value);
		string directoryName = Path.GetDirectoryName(value.Location);
		Load<VaultFile>(Path.Combine(directoryName, FileName), FileToSpawn);
	}

	private void Start()
	{
		isH3MPInstalled = Chainloader.PluginInfos.ContainsKey("VIP.TommySoucy.H3MP");
		isPMCStandard = Chainloader.PluginInfos.ContainsKey("JerryAr.EFT_PMC_ModPack");
	}

	public void Load<T>(string path, T objectToOverwrite)
	{
		string empty = string.Empty;
		Debug.Log((object)path);
		JsonUtility.FromJsonOverwrite(File.ReadAllText(path), (object)objectToOverwrite);
	}

	public void LoadSavedScene()
	{
		//IL_0045: Unknown result type (might be due to invalid IL or missing references)
		timer -= Time.deltaTime;
		if (timer <= 0f)
		{
			timer = 0f;
			if (!sceneSpawned)
			{
				string text = default(string);
				VaultSystem.SpawnObjects((VaultFileDisplayMode)2, FileToSpawn, ref text, (Transform)null, Vector3.zero);
				Debug.Log((object)"SceneLoaded");
				sceneSpawned = true;
			}
		}
	}

	private void Update()
	{
		if (!isPMCStandard || sceneSpawned)
		{
			return;
		}
		if (VaultSystem.DoesVaultFileExist((VaultFileDisplayMode)2, newlySavedFileName))
		{
			if (!loadonlyonce)
			{
				if (isH3MPInstalled && ThreadManager.host)
				{
					LoadSavedScene();
				}
				if (!isH3MPInstalled)
				{
					LoadSavedScene();
				}
			}
		}
		else
		{
			if (VaultSystem.DoesVaultFileExist((VaultFileDisplayMode)2, newlySavedFileName))
			{
				return;
			}
			if (isH3MPInstalled)
			{
				if (Client.isFullyConnected)
				{
					if (ThreadManager.host)
					{
						LoadSavedScene();
					}
				}
				else if (!Client.isFullyConnected)
				{
					LoadSavedScene();
				}
			}
			if (!isH3MPInstalled)
			{
				LoadSavedScene();
			}
		}
	}
}
namespace JerryComponent
{
	public class PutOnBody : MonoBehaviour
	{
		public bool isBEARInstalled;

		private EF_BuffSystem_GlobalObject GO;

		public bool spawned = false;

		private void Start()
		{
			isBEARInstalled = Chainloader.PluginInfos.ContainsKey("JerryAr.EFT_BEAR_Hands");
		}

		private void Update()
		{
			if (!isBEARInstalled || !((Object)(object)GM.CurrentPlayerBody != (Object)null))
			{
				return;
			}
			if (GameManager.playerPrefabID != "EFTBEARHANDS" && GameManager.playerPrefabID != "JilleyThePMC")
			{
				if (!spawned)
				{
					GameManager.SetPlayerPrefab("EFTBEARHANDS");
					spawned = true;
				}
			}
			else if (GameManager.playerPrefabID == "EFTBEARHANDS")
			{
				if (!spawned)
				{
					GO = EF_BuffSystem_GlobalObject.GetInstance();
					GO.Config.IsMale = true;
					GO.ReadConfig();
					spawned = true;
				}
			}
			else if (GameManager.playerPrefabID == "JilleyThePMC" && !spawned)
			{
				GO = EF_BuffSystem_GlobalObject.GetInstance();
				GO.Config.IsMale = false;
				GO.ReadConfig();
				spawned = true;
			}
		}
	}
	public class RandomLoot : MonoBehaviour
	{
		public bool isEFTFrameInstalled;

		public bool isHelmetInstalled;

		public bool big = false;

		public float countdown = 2f;

		public int type;

		public int amont;

		public Transform point;

		public GameObject rot;

		public float timer = 2f;

		public GameObject audiolooting;

		public bool isalreadylooted = false;

		public bool isinrange = false;

		private void Start()
		{
			isEFTFrameInstalled = Chainloader.PluginInfos.ContainsKey("JerryAr.EFT_Frame");
			isHelmetInstalled = Chainloader.PluginInfos.ContainsKey("Andrew_FTW-FTW_Arms_Modular_Helmets");
			if (!big)
			{
				type = Random.Range(1, 5);
			}
			else if (big)
			{
				type = Random.Range(1, 8);
			}
			if (type == 1)
			{
				amont = Random.Range(1, 5);
			}
			if (type == 2)
			{
				amont = Random.Range(1, 5);
			}
			if (type == 3)
			{
				amont = Random.Range(1, 30);
			}
			if (type == 4)
			{
				amont = Random.Range(1, 3);
			}
			if (type == 5)
			{
				amont = Random.Range(1, 5);
			}
			if (type == 6)
			{
				amont = Random.Range(1, 2);
			}
			if (type == 7)
			{
				amont = Random.Range(1, 2);
			}
			if (type == 8)
			{
				amont = 0;
			}
		}

		private void FixedUpdate()
		{
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0162: Unknown result type (might be due to invalid IL or missing references)
			//IL_10eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_10f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_031b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0320: Unknown result type (might be due to invalid IL or missing references)
			//IL_0468: Unknown result type (might be due to invalid IL or missing references)
			//IL_046d: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0300: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_02db: Unknown result type (might be due to invalid IL or missing references)
			//IL_07e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_07eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0448: Unknown result type (might be due to invalid IL or missing references)
			//IL_044d: Unknown result type (might be due to invalid IL or missing references)
			//IL_040c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0428: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ac4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ac9: Unknown result type (might be due to invalid IL or missing references)
			//IL_07c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_07cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_078a: Unknown result type (might be due to invalid IL or missing references)
			//IL_07a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0dca: Unknown result type (might be due to invalid IL or missing references)
			//IL_0dcf: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aa4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aa9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a68: 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_0f05: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f0a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0daa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0daf: 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_0d8a: Unknown result type (might be due to invalid IL or missing references)
			//IL_1071: Unknown result type (might be due to invalid IL or missing references)
			//IL_1076: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ee5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0eea: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ea9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ec5: Unknown result type (might be due to invalid IL or missing references)
			//IL_1051: Unknown result type (might be due to invalid IL or missing references)
			//IL_1056: Unknown result type (might be due to invalid IL or missing references)
			//IL_1015: Unknown result type (might be due to invalid IL or missing references)
			//IL_1031: Unknown result type (might be due to invalid IL or missing references)
			if (!isHelmetInstalled || !isEFTFrameInstalled)
			{
				return;
			}
			if ((Object)(object)GM.CurrentPlayerBody != (Object)null)
			{
				if (Vector3.Distance(((Component)GM.CurrentPlayerBody.LeftHand).transform.position, ((Component)this).gameObject.transform.position) <= 1f || Vector3.Distance(((Component)GM.CurrentPlayerBody.RightHand).transform.position, ((Component)this).gameObject.transform.position) <= 1f)
				{
					isinrange = true;
				}
				else if (Vector3.Distance(((Component)GM.CurrentPlayerBody.LeftHand).transform.position, ((Component)this).gameObject.transform.position) > 1f && Vector3.Distance(((Component)GM.CurrentPlayerBody.RightHand).transform.position, ((Component)this).gameObject.transform.position) > 1f)
				{
					isinrange = false;
				}
				if (countdown > 0f)
				{
					countdown -= Time.deltaTime;
				}
				else if (countdown <= 0f)
				{
					countdown = 0f;
				}
				if (rot.transform.localEulerAngles.x >= 45f)
				{
					if (countdown > 0f)
					{
						isalreadylooted = true;
					}
					if (isalreadylooted)
					{
						return;
					}
					if (!isinrange)
					{
						audiolooting.SetActive(false);
						timer = 2f;
					}
					else
					{
						if (!isinrange)
						{
							return;
						}
						if (amont > 0)
						{
							audiolooting.SetActive(true);
							timer -= Time.deltaTime;
							if (!(timer < 0f))
							{
								return;
							}
							if (type == 1)
							{
								string[] array = new string[7] { "EFT BeefCan", "EFT MRE", "EFT Kolbasa", "EFT WatterBottle", "EFT JuiceBox Green", "EFT JuiceBox Red", "EFT JuiceBox Yellow" };
								if (IM.OD.ContainsKey(array[Random.Range(0, 7)]))
								{
									AnvilCallback<GameObject> gameObjectAsync = ((AnvilAsset)IM.OD[array[Random.Range(0, 7)]]).GetGameObjectAsync();
									if (Object.op_Implicit((Object)(object)gameObjectAsync.Result))
									{
										GameObject val = Object.Instantiate<GameObject>(gameObjectAsync.Result);
										val.transform.position = ((Component)point).transform.position;
										val.transform.eulerAngles = ((Component)point).transform.eulerAngles;
										Console.Write("loot:Initialed new loot object");
									}
									else
									{
										Scene activeScene = SceneManager.GetActiveScene();
										Console.Write("loot:Can't find loot object,please wait for the assets load or report a bug,current scene name : {0}", ((Scene)(ref activeScene)).name);
									}
								}
								else
								{
									Scene activeScene2 = SceneManager.GetActiveScene();
									Console.Write("loot:Can't find loot object ID,please wait for the assets load or report a bug,current scene name : {0}", ((Scene)(ref activeScene2)).name);
								}
								amont--;
								timer = 2f;
							}
							if (type == 2)
							{
								string[] array2 = new string[7] { "Med_Analgin", "Med_Bandage", "Med_CAT", "Med_CMSK", "Med_GoldenStar", "Med_Propital", "AI2 Medkit" };
								if (IM.OD.ContainsKey(array2[Random.Range(0, 7)]))
								{
									AnvilCallback<GameObject> gameObjectAsync2 = ((AnvilAsset)IM.OD[array2[Random.Range(0, 7)]]).GetGameObjectAsync();
									if (Object.op_Implicit((Object)(object)gameObjectAsync2.Result))
									{
										GameObject val2 = Object.Instantiate<GameObject>(gameObjectAsync2.Result);
										val2.transform.position = ((Component)point).transform.position;
										val2.transform.eulerAngles = ((Component)point).transform.eulerAngles;
										Console.Write("loot:Initialed new loot object");
									}
									else
									{
										Scene activeScene3 = SceneManager.GetActiveScene();
										Console.Write("loot:Can't find loot object,please wait for the assets load or report a bug,current scene name : {0}", ((Scene)(ref activeScene3)).name);
									}
								}
								else
								{
									Scene activeScene4 = SceneManager.GetActiveScene();
									Console.Write("loot:Can't find loot object ID,please wait for the assets load or report a bug,current scene name : {0}", ((Scene)(ref activeScene4)).name);
								}
								amont--;
								timer = 2f;
							}
							if (type == 6)
							{
								string[] array3 = new string[63]
								{
									"MagazineAK12", "AKS74U", "AKM", "MagazineStanagUSGI30rnd", "AKS74UTactical", "RailAdapterRussianToPicatinny", "MagazineStanagUSGI10rnd", "MagazineAKMDrum", "MagazineDragonuv", "MagazineAKMTactical",
									"MagazineStanagUSGI25rnd", "AKForeShark", "MosinM1891", "H416", "762x54mmRStripperClip", "MagazineASVal20Rnd", "MagazineAKMTactical20rnd", "ASVAL", "MagazineAKS74U2", "Dragonuv",
									"MagazineAKM", "MagazineStanagUSGI5rnd", "MagazineStanagSM60rnd", "AK74N", "AKForeRomanian", "MagazineAKMTactical10rnd", "MagazineRPK", "Mosin91_30", "MagazineVSSVintorez10rnd", "SV98",
									"RPK", "MagazineAK74_20rnd", "MagazineSV98", "MagazineStanagPDDrum60rnd", "ScopeMosinPU", "MosinM38", "MagazineStanagUSGI30rndCustom", "FaTactical", "MagazineAK74N", "MagazineAKMHeirloom",
									"SR3M", "MagazineAK74Drum", "MagazineStanagUSGI20rnd", "AKMTactical", "Fal", "MagazineAKS74U", "MagazineAK74_10rnd", "Magazine_Stanag_PM_30rnd", "FalPara", "VSSVintorez",
									"MagazineFal20rnd", "M16", "M4A1Block2CQBR", "Mk18Mod0", "IZh18_12g", "KS23", "I37Classic", "M2ThreeGun", "Saiga12k", "MagazineSaiga12k20rnd",
									"MagazineSaiga12k12rnd", "Toz106", "MagazineToz106"
								};
								if (IM.OD.ContainsKey(array3[Random.Range(0, 63)]))
								{
									AnvilCallback<GameObject> gameObjectAsync3 = ((AnvilAsset)IM.OD[array3[Random.Range(0, 63)]]).GetGameObjectAsync();
									if (Object.op_Implicit((Object)(object)gameObjectAsync3.Result))
									{
										GameObject val3 = Object.Instantiate<GameObject>(gameObjectAsync3.Result);
										val3.transform.position = ((Component)point).transform.position;
										val3.transform.eulerAngles = ((Component)point).transform.eulerAngles;
										Console.Write("loot:Initialed new loot object");
									}
									else
									{
										Scene activeScene5 = SceneManager.GetActiveScene();
										Console.Write("loot:Can't find loot object,please wait for the assets load or report a bug,current scene name : {0}", ((Scene)(ref activeScene5)).name);
									}
								}
								else
								{
									Scene activeScene6 = SceneManager.GetActiveScene();
									Console.Write("loot:Can't find loot object ID,please wait for the assets load or report a bug,current scene name : {0}", ((Scene)(ref activeScene6)).name);
								}
								amont--;
								timer = 2f;
							}
							if (type == 7)
							{
								string[] array4 = new string[47]
								{
									"FTW.TankHelmet.helmet", "FTW.EXFILShieldB.helmet", "FTW.FASTAirsoft.helmetTan", "FTW.FastShield.attachment", "FTW.FastPic.attachment", "FTW.HeavyTrooper.attachment", "FTW.RysT.helmet", "FTW.RysTMask.helmet", "FTW.helmet.LSHZMask", "FTW.FastEars.attachment",
									"FTW.TC800.helmet", "FTW.Helmet.Jason", "ftw.altynmask.helmet", "FTW.EXFILShieldT.helmet", "FTW.SLAPPPlate.attachement", "FTW.FastVisor.attachment", "FTW.HeavyTrooper.attachmentB", "FTW.Caiman.helmet", "FTW.FAST.helmet", "FTW.EXFILt.helmet",
									"FTW.ZshShield.helmet", "FTW.HeavyTrooper.attachmentWolfe", "ftw.Airframe.helmet", "FTW.Kiver.helmet", "FTW.HeavyTrooper.attachmentT", "ftw.Bastion.helmet", "ftw.Bastionshield.helmet", "FTW.helmet.LSHZAventail", "FTW.FastEars.attachmentTan", "ftw.altyn.helmet",
									"FTW.EXFILEars.helmetB", "FTW.CaimanShield.helmet", "FTW.KiverShield.helmet", "FTW.FASTTan.helmet", "FTW.UNHelmet.helmet", "FTW.EXFILt.helmetTan", "FTW.FastMandible.attachment", "FTW.ZSH.helmet", "FTW.CaimanMandible.helmet", "FTW.CaimanFixedVisor.helmet",
									"FTW.Ushanka.helmet", "FTW.Helmet.Ronin", "FTW.EXFILEars.helmet", "ftw.Airframe.helmetEars", "FTW.HeavyTrooper.attachmentBT", "ftw.Airframe.helmetChops", "FTW.helmet.LSHZ"
								};
								if (IM.OD.ContainsKey(array4[Random.Range(0, 47)]))
								{
									AnvilCallback<GameObject> gameObjectAsync4 = ((AnvilAsset)IM.OD[array4[Random.Range(0, 47)]]).GetGameObjectAsync();
									if (Object.op_Implicit((Object)(object)gameObjectAsync4.Result))
									{
										GameObject val4 = Object.Instantiate<GameObject>(gameObjectAsync4.Result);
										val4.transform.position = ((Component)point).transform.position;
										val4.transform.eulerAngles = ((Component)point).transform.eulerAngles;
										Console.Write("loot:Initialed new loot object");
									}
									else
									{
										Scene activeScene7 = SceneManager.GetActiveScene();
										Console.Write("loot:Can't find loot object,please wait for the assets load or report a bug,current scene name : {0}", ((Scene)(ref activeScene7)).name);
									}
								}
								else
								{
									Scene activeScene8 = SceneManager.GetActiveScene();
									Console.Write("loot:Can't find loot object ID,please wait for the assets load or report a bug,current scene name : {0}", ((Scene)(ref activeScene8)).name);
								}
								amont--;
								timer = 2f;
							}
							if (type == 5)
							{
								string[] array5 = new string[51]
								{
									"TacticalFlashlight", "KlashLight", "CompactFlashlight2", "AKForeB10", "ForegripLarge", "ForegripLDAG", "ForegripMVG", "ForegripOffset", "ForegripRKO", "ForegripShift",
									"ForegripValk", "ForegripZG106", "HandstopKAG", "H416IronsFront", "H416IronsRear", "CantedSightsFront", "CantedSightsRear", "ANPEQ15", "TacticalLaser2", "Perst3Laser",
									"MuzzleBrakeCobra", "MuzzleBrakeCharon", "MuzzleBrakeOrbit", "MuzzleBrakeTruepoint", "RailRiserTall", "RailRiserShort", "RailRiserMed", "ReflexEG1", "ReflexOKP7OSA", "ReflexPK01VS",
									"ReflexPK120", "ReflexHolosightLong", "ReflexHolosightShort", "MagnifierPSO1", "T12Scope", "ScopeVRZ_6_36x56mmBronze", "ScopeVRZ_6_36x56mmBlack", "ScopeHAMComboScope4x24", "MagnifierGhostDRFDE", "MagnifierGhostDR",
									"ScopeEVU110x28mm", "ScopeAcog4x32", "ScopePVS30", "ScopePVS14", "SuppressorPBS4", "SuppressorPBS1", "SuppressorCorded", "SuppressorCordedTan", "SuppressorWrapped", "SuppressorSalvo",
									"AttachableBipodH"
								};
								if (IM.OD.ContainsKey(array5[Random.Range(0, 51)]))
								{
									AnvilCallback<GameObject> gameObjectAsync5 = ((AnvilAsset)IM.OD[array5[Random.Range(0, 51)]]).GetGameObjectAsync();
									if (Object.op_Implicit((Object)(object)gameObjectAsync5.Result))
									{
										GameObject val5 = Object.Instantiate<GameObject>(gameObjectAsync5.Result);
										val5.transform.position = ((Component)point).transform.position;
										val5.transform.eulerAngles = ((Component)point).transform.eulerAngles;
										Console.Write("loot:Initialed new loot object");
									}
									else
									{
										Scene activeScene9 = SceneManager.GetActiveScene();
										Console.Write("loot:Can't find loot object,please wait for the assets load or report a bug,current scene name : {0}", ((Scene)(ref activeScene9)).name);
									}
								}
								else
								{
									Scene activeScene10 = SceneManager.GetActiveScene();
									Console.Write("loot:Can't find loot object ID,please wait for the assets load or report a bug,current scene name : {0}", ((Scene)(ref activeScene10)).name);
								}
								amont--;
								timer = 2f;
							}
							if (type == 4)
							{
								string[] array6 = new string[5] { "PinnedGrenadeRG5", "PinnedGrenadeRGN", "PinnedGrenadeRGO", "PinnedGrenadeM67", "F-1 Russia (Remastered)" };
								if (IM.OD.ContainsKey(array6[Random.Range(0, 5)]))
								{
									AnvilCallback<GameObject> gameObjectAsync6 = ((AnvilAsset)IM.OD[array6[Random.Range(0, 5)]]).GetGameObjectAsync();
									if (Object.op_Implicit((Object)(object)gameObjectAsync6.Result))
									{
										GameObject val6 = Object.Instantiate<GameObject>(gameObjectAsync6.Result);
										val6.transform.position = ((Component)point).transform.position;
										val6.transform.eulerAngles = ((Component)point).transform.eulerAngles;
										Console.Write("loot:Initialed new loot object");
									}
									else
									{
										Scene activeScene11 = SceneManager.GetActiveScene();
										Console.Write("loot:Can't find loot object,please wait for the assets load or report a bug,current scene name : {0}", ((Scene)(ref activeScene11)).name);
									}
								}
								else
								{
									Scene activeScene12 = SceneManager.GetActiveScene();
									Console.Write("loot:Can't find loot object ID,please wait for the assets load or report a bug,current scene name : {0}", ((Scene)(ref activeScene12)).name);
								}
								amont--;
								timer = 2f;
							}
							if (type == 3)
							{
								string[] array7 = new string[10] { "545x39mmCartridgeAP", "556x45mmCartridgeAP", "762x54mmRCartridgeAP", "9x39mmCartridgeAP", "762x51mmCartridgeAP", "762x39mmCartridgeAP", "12GaugeShell00Buckshot", "23x75mmR_Buckshot", "23x75mmR_Flash", "12GaugeShellDragonsBreath" };
								if (IM.OD.ContainsKey(array7[Random.Range(0, 10)]))
								{
									AnvilCallback<GameObject> gameObjectAsync7 = ((AnvilAsset)IM.OD[array7[Random.Range(0, 10)]]).GetGameObjectAsync();
									if (Object.op_Implicit((Object)(object)gameObjectAsync7.Result))
									{
										GameObject val7 = Object.Instantiate<GameObject>(gameObjectAsync7.Result);
										val7.transform.position = ((Component)point).transform.position;
										val7.transform.eulerAngles = ((Component)point).transform.eulerAngles;
										Console.Write("loot:Initialed new loot object");
									}
									else
									{
										Scene activeScene13 = SceneManager.GetActiveScene();
										Console.Write("loot:Can't find loot object,please wait for the assets load or report a bug,current scene name : {0}", ((Scene)(ref activeScene13)).name);
									}
								}
								else
								{
									Scene activeScene14 = SceneManager.GetActiveScene();
									Console.Write("loot:Can't find loot object ID,please wait for the assets load or report a bug,current scene name : {0}", ((Scene)(ref activeScene14)).name);
								}
								amont--;
								timer = 2f;
							}
							if (type == 8)
							{
								Console.Write("loot:HA HA Nothing in here!!");
							}
						}
						else if (amont <= 0)
						{
							audiolooting.SetActive(false);
						}
					}
				}
				else if (rot.transform.localEulerAngles.x < 45f)
				{
					timer = 2f;
					audiolooting.SetActive(false);
				}
			}
			else if ((Object)(object)GM.CurrentPlayerBody == (Object)null)
			{
				timer = 2f;
				audiolooting.SetActive(false);
			}
		}
	}
	public class ScavWave : MonoBehaviour
	{
		public bool isH3MPInstalled;

		public bool isCustomSosigInstalled;

		public Transform point1;

		public Transform point2;

		public float countdown;

		public int whereto;

		public int whichhead;

		public int whichtorso;

		public int whichbackpack;

		public Collider col1;

		public Collider col2;

		public SosigSpawnPoint ssp1;

		public SosigSpawnPoint ssp2;

		public Sosig sos;

		public bool isboss = false;

		private void OnTriggerEnter(Collider other)
		{
			if ((Object)(object)((Component)other).gameObject.GetComponent<SosigLink>() != (Object)null)
			{
				sos = ((Component)other).gameObject.GetComponent<SosigLink>().S;
				col1.enabled = false;
				col2.enabled = false;
			}
		}

		private void Start()
		{
			isCustomSosigInstalled = Chainloader.PluginInfos.ContainsKey("Sosig_Squad.CustomSosigLoader");
			isH3MPInstalled = Chainloader.PluginInfos.ContainsKey("VIP.TommySoucy.H3MP");
			whereto = Random.Range(1, 2);
			countdown = Random.Range(15, 25);
			if (isH3MPInstalled)
			{
				if (Client.isFullyConnected)
				{
					if (ThreadManager.host && isCustomSosigInstalled)
					{
						if (whereto == 1)
						{
							ssp1.Spawn();
							col1.enabled = true;
						}
						else if (whereto == 2)
						{
							ssp2.Spawn();
							col2.enabled = true;
						}
					}
				}
				else if (!Client.isFullyConnected && isCustomSosigInstalled)
				{
					if (whereto == 1)
					{
						ssp1.Spawn();
						col1.enabled = true;
					}
					else if (whereto == 2)
					{
						ssp2.Spawn();
						col2.enabled = true;
					}
				}
			}
			else if (!isH3MPInstalled && isCustomSosigInstalled)
			{
				if (whereto == 1)
				{
					ssp1.Spawn();
					col1.enabled = true;
				}
				else if (whereto == 2)
				{
					ssp2.Spawn();
					col2.enabled = true;
				}
			}
		}

		private void FixedUpdate()
		{
			if (isH3MPInstalled)
			{
				if (Client.isFullyConnected)
				{
					if (!ThreadManager.host || !isCustomSosigInstalled)
					{
						return;
					}
					if ((Object)(object)sos == (Object)null)
					{
						countdown -= Time.deltaTime;
					}
					if (countdown <= 0f)
					{
						if (whereto == 1)
						{
							ssp1.Spawn();
							col1.enabled = true;
						}
						else if (whereto == 2)
						{
							ssp2.Spawn();
							col2.enabled = true;
						}
						countdown = Random.Range(30, 60);
						whereto = Random.Range(1, 2);
					}
				}
				else
				{
					if (Client.isFullyConnected || !isCustomSosigInstalled)
					{
						return;
					}
					if ((Object)(object)sos == (Object)null)
					{
						countdown -= Time.deltaTime;
					}
					if (countdown <= 0f)
					{
						if (whereto == 1)
						{
							ssp1.Spawn();
							col1.enabled = true;
						}
						else if (whereto == 2)
						{
							ssp2.Spawn();
							col2.enabled = true;
						}
						countdown = Random.Range(30, 60);
						whereto = Random.Range(1, 2);
					}
				}
			}
			else
			{
				if (isH3MPInstalled || !isCustomSosigInstalled)
				{
					return;
				}
				if ((Object)(object)sos == (Object)null)
				{
					countdown -= Time.deltaTime;
				}
				if (countdown <= 0f)
				{
					if (whereto == 1)
					{
						ssp1.Spawn();
						col1.enabled = true;
					}
					else if (whereto == 2)
					{
						ssp2.Spawn();
						col2.enabled = true;
					}
					countdown = Random.Range(30, 60);
					whereto = Random.Range(1, 2);
				}
			}
		}
	}
	public class SmallpocketSwitch : MonoBehaviour
	{
		public bool spawned = false;

		public GameObject BODY;

		public float timer = 2.5f;

		private FVRQuickBeltSlot[] slots;

		private void Start()
		{
		}

		private void FixedUpdate()
		{
			if ((Object)(object)BODY == (Object)null || slots == null)
			{
			}
			timer -= Time.deltaTime;
			if (!(timer < 0f))
			{
				return;
			}
			BODY = GameObject.Find("EFTBEARHANDS(Clone)");
			if ((Object)(object)GM.CurrentPlayerBody != (Object)null)
			{
				if ((Object)(object)BODY != (Object)null)
				{
					slots = ((Component)GM.CurrentPlayerBody.Torso).GetComponentsInChildren<FVRQuickBeltSlot>();
					if (slots.Length >= 1)
					{
						for (int num = slots.Length - 1; num >= 0; num--)
						{
							Object.Destroy((Object)(object)slots[num]);
						}
					}
					((Component)GM.CurrentPlayerBody.Torso).gameObject.SetActive(false);
					spawned = false;
				}
				else if ((Object)(object)BODY == (Object)null && !spawned)
				{
					((Component)GM.CurrentPlayerBody.Torso).gameObject.SetActive(true);
					GM.CurrentPlayerBody.ConfigureQuickbelt(7);
					spawned = true;
				}
			}
			timer = 2.5f;
		}
	}
	public class SpawnHAT : MonoBehaviour
	{
		public bool isEFTFrameInstalled = true;

		private GameObject HATsystem;

		private void Start()
		{
			isEFTFrameInstalled = Chainloader.PluginInfos.ContainsKey("JerryAr.EFT_Frame");
		}

		private void FixedUpdate()
		{
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			if (!isEFTFrameInstalled || EF_BuffSystem_GlobalObject.GetInstance().Config.DisableHATsystem || Object.op_Implicit((Object)(object)HATsystem))
			{
				return;
			}
			Scene activeScene = SceneManager.GetActiveScene();
			if (!(((Scene)(ref activeScene)).name != "MainMenu3") || !((Object)(object)GM.CurrentPlayerBody != (Object)null))
			{
				return;
			}
			if (IM.OD.ContainsKey("EFT Foods hAtSystem"))
			{
				AnvilCallback<GameObject> gameObjectAsync = ((AnvilAsset)IM.OD["EFT Foods hAtSystem"]).GetGameObjectAsync();
				if (Object.op_Implicit((Object)(object)gameObjectAsync.Result))
				{
					HATsystem = Object.Instantiate<GameObject>(gameObjectAsync.Result);
					Console.Write("hAtSystem:Initialed new hAt system object");
				}
				else
				{
					Scene activeScene2 = SceneManager.GetActiveScene();
					Console.Write("hAtSystem:Can't find hAt system object,please wait for the assets load or report a bug,current scene name : {0}", ((Scene)(ref activeScene2)).name);
				}
			}
			else
			{
				Scene activeScene3 = SceneManager.GetActiveScene();
				Console.Write("hAtSystem:Can't find hAt system object ID,please wait for the assets load or report a bug,current scene name : {0}", ((Scene)(ref activeScene3)).name);
			}
		}
	}
	public class SpawnPrefabOnPoint : MonoBehaviour
	{
		public bool isContinus = false;

		public Transform point;

		public GameObject obj;

		public string objname;

		public float timer = 2f;

		public string Name;

		private void Start()
		{
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0064: 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)
			if (IM.OD.ContainsKey(objname))
			{
				AnvilCallback<GameObject> gameObjectAsync = ((AnvilAsset)IM.OD[objname]).GetGameObjectAsync();
				if (Object.op_Implicit((Object)(object)gameObjectAsync.Result))
				{
					obj = Object.Instantiate<GameObject>(gameObjectAsync.Result);
					obj.transform.position = point.position;
					obj.transform.eulerAngles = point.eulerAngles;
					Console.Write("prefab:Initialed new prefab object");
				}
				else
				{
					Scene activeScene = SceneManager.GetActiveScene();
					Console.Write("prefab:Can't find prefab object,please wait for the assets load or report a bug,current scene name : {0}", ((Scene)(ref activeScene)).name);
				}
			}
			else
			{
				Scene activeScene2 = SceneManager.GetActiveScene();
				Console.Write("prefab:Can't find prefab object ID,please wait for the assets load or report a bug,current scene name : {0}", ((Scene)(ref activeScene2)).name);
			}
		}

		private void FixedUpdate()
		{
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: 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_00c1: 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)
			if (!isContinus)
			{
				return;
			}
			timer -= Time.deltaTime;
			if (!(timer <= 0f))
			{
				return;
			}
			timer = 2f;
			obj = GameObject.Find(Name);
			if (!((Object)(object)obj == (Object)null))
			{
				return;
			}
			if (IM.OD.ContainsKey(objname))
			{
				AnvilCallback<GameObject> gameObjectAsync = ((AnvilAsset)IM.OD[objname]).GetGameObjectAsync();
				if (Object.op_Implicit((Object)(object)gameObjectAsync.Result))
				{
					obj = Object.Instantiate<GameObject>(gameObjectAsync.Result);
					obj.transform.position = point.position;
					obj.transform.eulerAngles = point.eulerAngles;
					Console.Write("prefab:Initialed new prefab object");
				}
				else
				{
					Scene activeScene = SceneManager.GetActiveScene();
					Console.Write("prefab:Can't find prefab object,please wait for the assets load or report a bug,current scene name : {0}", ((Scene)(ref activeScene)).name);
				}
			}
			else
			{
				Scene activeScene2 = SceneManager.GetActiveScene();
				Console.Write("prefab:Can't find prefab object ID,please wait for the assets load or report a bug,current scene name : {0}", ((Scene)(ref activeScene2)).name);
			}
		}
	}
	public class SetOutpoint : MonoBehaviour
	{
		public bool isH3MPInstalled;

		public bool isNGAInstalled;

		public float telecountdown = 1f;

		public bool telecount = false;

		public bool telecount2 = false;

		public bool startcountdown = false;

		public EFTMode modemain;

		public float countdownnum = 3f;

		public bool sceneswitched = false;

		public GameObject countdownboard;

		public Transform hidepoint;

		private void OnTriggerStay(Collider other)
		{
			if ((Object)(object)((Component)other).gameObject == (Object)(object)modemain.playerdetectpoint)
			{
				startcountdown = true;
			}
		}

		private void OnTriggerExit(Collider other)
		{
			if ((Object)(object)((Component)other).gameObject == (Object)(object)modemain.playerdetectpoint)
			{
				startcountdown = false;
			}
		}

		private void Start()
		{
			isNGAInstalled = Chainloader.PluginInfos.ContainsKey("NGA.SafehouseMP");
			isH3MPInstalled = Chainloader.PluginInfos.ContainsKey("VIP.TommySoucy.H3MP");
		}

		private void FixedUpdate()
		{
			//IL_00d7: 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_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_017c: Unknown result type (might be due to invalid IL or missing references)
			if (!isNGAInstalled)
			{
				((Component)this).gameObject.SetActive(false);
			}
			else if (isNGAInstalled)
			{
				if (telecount)
				{
					telecountdown -= Time.deltaTime;
				}
				if (telecountdown < 0f && !telecount2)
				{
					telecount = false;
					telecount2 = true;
					modemain.escape.SetActive(true);
					GM.CurrentMovementManager.TeleportToPoint(((Component)hidepoint).transform.position, true, ((Component)hidepoint).transform.localEulerAngles);
				}
				if (countdownnum < 2f)
				{
					SteamVR_Fade.Start(new Color(0f, 0f, 0f, 1f), 0.25f, false);
					telecount = true;
				}
				if (countdownnum < 0f && !sceneswitched)
				{
					Save();
					Escape();
					startcountdown = false;
					sceneswitched = true;
				}
				if (startcountdown)
				{
					countdownboard.SetActive(true);
					countdownboard.transform.position = ((Component)GM.CurrentMovementManager.Head).transform.position;
					countdownboard.transform.eulerAngles = ((Component)GM.CurrentMovementManager.Head).transform.eulerAngles;
					countdownnum -= 1f * Time.deltaTime;
				}
				if (!startcountdown)
				{
					countdownboard.SetActive(false);
					countdownnum = 3f;
				}
			}
		}

		private void Save()
		{
			//IL_0325: Unknown result type (might be due to invalid IL or missing references)
			//IL_032c: Expected O, but got Unknown
			//IL_022d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0234: Expected O, but got Unknown
			//IL_0123: Unknown result type (might be due to invalid IL or missing references)
			//IL_012a: Expected O, but got Unknown
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Expected O, but got Unknown
			//IL_0380: Unknown result type (might be due to invalid IL or missing references)
			//IL_0387: Expected O, but got Unknown
			//IL_038e: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_028a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0291: Expected O, but got Unknown
			//IL_0180: Unknown result type (might be due to invalid IL or missing references)
			//IL_0187: Expected O, but got Unknown
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Expected O, but got Unknown
			if (isH3MPInstalled)
			{
				if (Client.isFullyConnected)
				{
					if (ThreadManager.host)
					{
						VaultFile val = new VaultFile();
						if (VaultSystem.FindAndScanObjectsInScene(val))
						{
							string text = "EFTHideOut_Standard_Edition_SaveFile";
							if (!VaultSystem.SaveVaultFile(text, (VaultFileDisplayMode)2, val))
							{
								Debug.Log((object)"ERROR: Scene Vault save failed");
							}
							else
							{
								int num = 0;
								if (num == 1)
								{
									VaultFile val2 = new VaultFile();
									if (VaultSystem.FindAndScanObjectsInScene(val2))
									{
										string text2 = DateTime.Now.ToString("yyyyMMdd_HHmmss");
										string text3 = SafehouseMP.GetSafehouseName() + "_" + SafehouseMP.safehouse_backup_filename + "_" + text2;
										if (!VaultSystem.SaveVaultFile(text3, (VaultFileDisplayMode)2, val2))
										{
											Debug.Log((object)"ERROR: BACKUP Scene Vault save failed");
										}
									}
								}
							}
						}
						else
						{
							Debug.Log((object)"ERROR: Scene scan failed");
						}
					}
				}
				else if (!Client.isFullyConnected)
				{
					VaultFile val3 = new VaultFile();
					if (VaultSystem.FindAndScanObjectsInScene(val3))
					{
						string text4 = "EFTHideOut_Standard_Edition_SaveFile";
						if (!VaultSystem.SaveVaultFile(text4, (VaultFileDisplayMode)2, val3))
						{
							Debug.Log((object)"ERROR: Scene Vault save failed");
						}
						else
						{
							int num2 = 0;
							if (num2 == 1)
							{
								VaultFile val4 = new VaultFile();
								if (VaultSystem.FindAndScanObjectsInScene(val4))
								{
									string text5 = DateTime.Now.ToString("yyyyMMdd_HHmmss");
									string text6 = SafehouseMP.GetSafehouseName() + "_" + SafehouseMP.safehouse_backup_filename + "_" + text5;
									if (!VaultSystem.SaveVaultFile(text6, (VaultFileDisplayMode)2, val4))
									{
										Debug.Log((object)"ERROR: BACKUP Scene Vault save failed");
									}
								}
							}
						}
					}
					else
					{
						Debug.Log((object)"ERROR: Scene scan failed");
					}
				}
			}
			else if (!isH3MPInstalled)
			{
				VaultFile val5 = new VaultFile();
				if (VaultSystem.FindAndScanObjectsInScene(val5))
				{
					string text7 = "EFTHideOut_Standard_Edition_SaveFile";
					if (!VaultSystem.SaveVaultFile(text7, (VaultFileDisplayMode)2, val5))
					{
						Debug.Log((object)"ERROR: Scene Vault save failed");
					}
					else
					{
						int num3 = 0;
						if (num3 == 1)
						{
							VaultFile val6 = new VaultFile();
							if (VaultSystem.FindAndScanObjectsInScene(val6))
							{
								string text8 = DateTime.Now.ToString("yyyyMMdd_HHmmss");
								string text9 = SafehouseMP.GetSafehouseName() + "_" + SafehouseMP.safehouse_backup_filename + "_" + text8;
								if (!VaultSystem.SaveVaultFile(text9, (VaultFileDisplayMode)2, val6))
								{
									Debug.Log((object)"ERROR: BACKUP Scene Vault save failed");
								}
							}
						}
					}
				}
				else
				{
					Debug.Log((object)"ERROR: Scene scan failed");
				}
			}
			VaultFile val7 = new VaultFile();
			if (VaultSystem.FindAndScanObjectsInQuickbelt(val7))
			{
				if (!VaultSystem.SaveVaultFile(SafehouseMP.raid_extracted_loadout_filename, (VaultFileDisplayMode)1, val7))
				{
					Debug.Log((object)"ERROR: Saving loadout failed.");
				}
				else if (SafehouseMP.config_delete_loadout_on_save.Value)
				{
					VaultFile val8 = new VaultFile();
					FVRPlayerBody val9 = Object.FindObjectOfType<FVRPlayerBody>();
					Transform transform = new GameObject().transform;
					transform.position = ((Component)val9).transform.position;
					string text10 = default(string);
					if (!VaultSystem.SpawnObjects((VaultFileDisplayMode)1, val8, ref text10, transform, Vector3.zero))
					{
						Debug.Log((object)("ERROR: Couldn't spawn empty loadout w status: " + text10));
					}
				}
			}
			else
			{
				Debug.Log((object)"ERROR: Quickbelt scan failed.");
			}
		}

		private void Escape()
		{
			for (int i = 0; i < GM.CurrentSceneSettings.QuitReceivers.Count; i++)
			{
				GM.CurrentSceneSettings.QuitReceivers[i].BroadcastMessage("QUIT", (SendMessageOptions)1);
			}
			if (((AnvilCallbackBase)GM.LoadingCallback).IsCompleted)
			{
				CustomSceneInfo customScene = AtlasPlugin.GetCustomScene("FactoryExt");
				if (customScene != null)
				{
					AtlasPlugin.LoadCustomScene("FactoryExt");
				}
				else
				{
					SteamVR_LoadLevel.Begin("FactoryExt", false, 0f, 0f, 0f, 0f, 1f);
				}
			}
		}
	}
	public class SpawnAIScene : MonoBehaviour
	{
		public bool moved = false;

		public bool spawn = false;

		private void Start()
		{
		}

		private void Awake()
		{
			Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject);
		}

		private void FixedUpdate()
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			if (!moved && (Object)(object)GameObject.Find("EFTAIDEC") == (Object)null)
			{
				SceneManager.MoveGameObjectToScene(((Component)this).gameObject, SceneManager.GetActiveScene());
				moved = true;
			}
			if ((Object)(object)GameObject.Find("AISP") != (Object)null)
			{
				if (spawn)
				{
					SceneManager.LoadScene("AISpawn", (LoadSceneMode)1);
					Object.Destroy((Object)(object)((Component)this).gameObject);
				}
				else if (!spawn)
				{
					Object.Destroy((Object)(object)((Component)this).gameObject);
				}
			}
		}
	}
	public class control_component : MonoBehaviour
	{
		public GameObject Comp;

		public GameObject Comp2;

		public GameObject Rot;

		private void Start()
		{
		}

		private void Update()
		{
			//IL_000c: 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)
			if (Rot.transform.localEulerAngles.x >= 45f)
			{
				Comp.SetActive(false);
				Comp2.SetActive(true);
			}
			else
			{
				Comp.SetActive(true);
				Comp2.SetActive(false);
			}
		}
	}
}