Decompiled source of DehyaCustomEnemy v1.0.0

DehyaEnemyAi.dll

Decompiled 4 hours ago
using System;
using System.Collections;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using DehyaEnemyAi.NetcodePatcher;
using GameNetcodeStuff;
using HarmonyLib;
using LethalLib.Modules;
using Unity.Netcode;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("DehyaEnemyAi")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DehyaEnemyAi")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("6bb45560-547b-4326-a7dc-c9807dc7233a")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
[module: NetcodePatchedAssembly]
internal class <Module>
{
	static <Module>()
	{
	}
}
namespace DehyaEnemyAI
{
	public class DehyaEnemyAI : EnemyAI
	{
		private enum State
		{
			SearchingForPlayers,
			HiredByPlayer,
			FightingEnemy,
			AttackingPlayers
		}

		private bool wasDancingLastFrame = false;

		private Vector3 previousPosition;

		private float timeSinceHitting = 0f;

		private float timeSinceBeingHit = 0f;

		private float regenerationTime = 0f;

		public float nonAggroTime = 0f;

		public float danceSheathTime = 1f;

		private Transform targetEnemy;

		private EnemyAI targetEnemyAI;

		public bool isHired;

		public bool isWithinHireRange;

		public float employerDetectionRange = 3f;

		public float displayRange = 3f;

		public LayerMask playerLayer;

		public LayerMask enemyLayer;

		public LayerMask obstacleLayer;

		public bool isDancing;

		private float angeredTimer = 0f;

		public float detectionRadius = 15f;

		public float BaseAcceleration = 55f;

		public float damageInterval = 3f;

		private float timeSinceLastDamage = 0f;

		private Vector3 spawnLoc;

		public PlayerControllerB playerWhoHired;

		public PlayerControllerB playerWhoHit;

		public AudioClip[] soundDehyaAttack;

		public AudioClip[] soundDehyaHit;

		public AudioClip[] soundDehyaNoise;

		public AudioClip soundDehyaKill;

		public AudioClip soundStartDance;

		public AudioClip[] soundDehyaJoinParty;

		private bool hasPlayedDanceSound = false;

		private bool hasPlayedBattleSound = false;

		public InteractTrigger hireTrigger;

		public Texture2D healthyBody;

		public Texture2D hurtBody;

		public override void Start()
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			((EnemyAI)this).Start();
			spawnLoc = ((Component)this).transform.position;
			base.isOutside = ((Component)this).transform.position.y > -80f;
			if (base.isOutside)
			{
				if (base.allAINodes == null || base.allAINodes.Length == 0)
				{
					base.allAINodes = GameObject.FindGameObjectsWithTag("OutsideAINode");
				}
				if ((Object)(object)GameNetworkManager.Instance.localPlayerController != (Object)null)
				{
					((EnemyAI)this).EnableEnemyMesh(!StartOfRound.Instance.hangarDoorsClosed || !GameNetworkManager.Instance.localPlayerController.isInHangarShipRoom, false);
				}
			}
			else if (base.allAINodes == null || base.allAINodes.Length == 0)
			{
				base.allAINodes = GameObject.FindGameObjectsWithTag("AINode");
			}
			((EnemyAI)this).StartSearch(((Component)this).transform.position, base.currentSearch);
			base.currentSearch.searchWidth = 180f;
			base.currentSearch.searchPrecision = 10f;
			base.moveTowardsDestination = true;
			((Behaviour)base.agent).enabled = true;
		}

		public override void DoAIInterval()
		{
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_0240: Unknown result type (might be due to invalid IL or missing references)
			((EnemyAI)this).DoAIInterval();
			if (base.isEnemyDead || StartOfRound.Instance.allPlayersDead)
			{
				return;
			}
			switch (base.currentBehaviourStateIndex)
			{
			case 0:
			{
				if (base.stunNormalizedTimer > 0f)
				{
					base.agent.speed = 0f;
				}
				else
				{
					base.agent.speed = 5f;
				}
				PlayerControllerB targetPlayer = base.targetPlayer;
				if (((EnemyAI)this).TargetClosestPlayer(3f, false, 0f))
				{
					base.agent.SetDestination(base.destination);
					base.moveTowardsDestination = true;
				}
				else
				{
					base.targetPlayer = targetPlayer;
				}
				if (!((Object)(object)base.targetPlayer != (Object)null) && (Object)(object)base.targetPlayer == (Object)null && !base.currentSearch.inProgress)
				{
					((EnemyAI)this).StartSearch(spawnLoc, base.currentSearch);
					base.currentSearch.searchWidth = 180f;
					base.currentSearch.searchPrecision = 10f;
				}
				break;
			}
			case 1:
				if (base.stunNormalizedTimer > 0f)
				{
					base.agent.speed = 0f;
				}
				else
				{
					base.agent.speed = 5f;
				}
				base.agent.stoppingDistance = 4f;
				base.addPlayerVelocityToDestination = 0f;
				if ((Object)(object)playerWhoHired == (Object)null)
				{
					if (((EnemyAI)this).TargetClosestPlayer(3f, true, 140f))
					{
						if (base.currentSearch.inProgress)
						{
							((EnemyAI)this).StopSearch(base.currentSearch, true);
						}
						((EnemyAI)this).SetMovingTowardsTargetPlayer(base.targetPlayer);
						base.agent.stoppingDistance = 4f;
					}
				}
				else
				{
					FollowEmployer();
				}
				if (!((Object)(object)base.targetPlayer != (Object)null) && (Object)(object)base.targetPlayer == (Object)null && !base.currentSearch.inProgress)
				{
					((EnemyAI)this).StartSearch(spawnLoc, base.currentSearch);
				}
				break;
			case 2:
				PlayStartCombatServerRpc();
				if (base.stunNormalizedTimer > 0f)
				{
					base.agent.speed = 0f;
				}
				else
				{
					base.agent.speed = 7f;
				}
				break;
			case 3:
				if (base.stunNormalizedTimer > 0f)
				{
					base.agent.speed = 0f;
				}
				else
				{
					base.agent.speed = 7f;
				}
				if (angeredTimer > 0f)
				{
					AttackPlayerServerRpc();
				}
				break;
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void SprintingServerRpc(bool running)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: 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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2910680899u, val, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref running, default(ForPrimitives));
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2910680899u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				if (running)
				{
					base.agent.speed = 9f;
					base.creatureAnimator.SetBool("Sprinting", true);
				}
				else
				{
					base.agent.speed = 5f;
					base.creatureAnimator.SetBool("Sprinting", false);
				}
				SprintingClientRpc(running);
			}
		}

		[ClientRpc]
		public void SprintingClientRpc(bool running)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: 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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1110503656u, val, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref running, default(ForPrimitives));
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1110503656u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				if (running)
				{
					base.agent.speed = 9f;
					base.creatureAnimator.SetBool("Sprinting", true);
				}
				else
				{
					base.agent.speed = 5f;
					base.creatureAnimator.SetBool("Sprinting", false);
				}
			}
		}

		public override void OnCollideWithEnemy(Collider other, EnemyAI collidedEnemy = null)
		{
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			((EnemyAI)this).OnCollideWithEnemy(other, collidedEnemy);
			if (!((Object)(object)collidedEnemy.enemyType == (Object)(object)base.enemyType) && isHired && !collidedEnemy.isEnemyDead && !base.isEnemyDead)
			{
				int currentBehaviourStateIndex = base.currentBehaviourStateIndex;
				if (currentBehaviourStateIndex == 2 && !(timeSinceHitting < 1f) && !(base.stunNormalizedTimer > 0f) && collidedEnemy.enemyType.canDie && ((NetworkBehaviour)this).IsOwner)
				{
					timeSinceHitting = 0f;
					NetworkObject component = ((Component)collidedEnemy).gameObject.GetComponent<NetworkObject>();
					AttackServerRpc(NetworkObjectReference.op_Implicit(component));
				}
			}
		}

		public override void OnCollideWithPlayer(Collider other)
		{
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			((EnemyAI)this).OnCollideWithPlayer(other);
			if (!(timeSinceHitting < 1f) && !(angeredTimer <= 0f) && !base.isEnemyDead)
			{
				PlayerControllerB val = ((EnemyAI)this).MeetsStandardPlayerCollisionConditions(other, base.inSpecialAnimation, false);
				if (angeredTimer > 0f)
				{
					timeSinceHitting = 0f;
					AttackPlayerEnemyClientRpc();
					val.DamagePlayer(40, true, true, (CauseOfDeath)13, 0, false, default(Vector3));
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void AttackServerRpc(NetworkObjectReference networkObject)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: 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_012c: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(658431256u, val, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref networkObject, default(ForNetworkSerializable));
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 658431256u, val, (RpcDelivery)0);
			}
			NetworkObject val3 = default(NetworkObject);
			EnemyAI val4 = default(EnemyAI);
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost) && ((NetworkObjectReference)(ref networkObject)).TryGet(ref val3, (NetworkManager)null) && ((Component)((Component)val3).transform).TryGetComponent<EnemyAI>(ref val4))
			{
				val4.HitEnemy(1, playerWhoHired, true, -1);
				if (val4.enemyHP < -1)
				{
					val4.KillEnemy(false);
				}
				AttackClientRpc(networkObject);
			}
		}

		[ClientRpc]
		public void AttackClientRpc(NetworkObjectReference networkObject)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: 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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(633428897u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref networkObject, default(ForNetworkSerializable));
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 633428897u, val, (RpcDelivery)0);
				}
				NetworkObject val3 = default(NetworkObject);
				EnemyAI val4 = default(EnemyAI);
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && ((NetworkObjectReference)(ref networkObject)).TryGet(ref val3, (NetworkManager)null) && ((Component)((Component)val3).transform).TryGetComponent<EnemyAI>(ref val4))
				{
					val4.HitEnemy(0, playerWhoHired, true, -1);
					base.creatureAnimator.SetTrigger("Attack");
					int num = RoundManager.PlayRandomClip(base.creatureVoice, soundDehyaAttack, true, 1f, 0, 1000);
					WalkieTalkie.TransmitOneShotAudio(base.creatureVoice, soundDehyaAttack[num], 1f);
				}
			}
		}

		[ClientRpc]
		public void AttackPlayerEnemyClientRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1201830463u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1201830463u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					base.creatureAnimator.SetTrigger("Attack");
					int num = RoundManager.PlayRandomClip(base.creatureVoice, soundDehyaAttack, true, 1f, 0, 1000);
					WalkieTalkie.TransmitOneShotAudio(base.creatureVoice, soundDehyaAttack[num], 1f);
				}
			}
		}

		public override void HitEnemy(int force = 1, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1)
		{
			((EnemyAI)this).HitEnemy(force, playerWhoHit, playHitSFX, hitID);
			if (!base.isEnemyDead && (!isHired || !((Object)(object)playerWhoHit != (Object)null)))
			{
				if (!base.inSpecialAnimation && (Object)(object)playerWhoHit != (Object)null)
				{
					base.creatureAnimator.SetTrigger("HurtEnemy");
				}
				if ((Object)(object)playerWhoHit != (Object)null)
				{
					((EnemyAI)this).SwitchToBehaviourState(3);
					this.playerWhoHit = playerWhoHit;
					angeredTimer += 15f;
				}
				base.enemyHP -= force;
				if (base.enemyHP != 0)
				{
					int num = RoundManager.PlayRandomClip(base.creatureVoice, soundDehyaHit, true, 1f, 0, 1000);
					WalkieTalkie.TransmitOneShotAudio(base.creatureVoice, soundDehyaHit[num], 1f);
				}
				if (base.enemyHP <= 0 && ((NetworkBehaviour)this).IsOwner)
				{
					((EnemyAI)this).KillEnemyOnOwnerClient(false);
				}
			}
		}

		public override void Update()
		{
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_0166: Unknown result type (might be due to invalid IL or missing references)
			//IL_0168: 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_0181: Unknown result type (might be due to invalid IL or missing references)
			//IL_034c: Unknown result type (might be due to invalid IL or missing references)
			//IL_035c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0494: Unknown result type (might be due to invalid IL or missing references)
			//IL_049f: Unknown result type (might be due to invalid IL or missing references)
			((EnemyAI)this).Update();
			if (base.isEnemyDead)
			{
				return;
			}
			CheckIfCooledOff();
			if ((Object)(object)playerWhoHired != (Object)null && playerWhoHired.isPlayerDead)
			{
				EmployerDeadServerRpc();
			}
			CalculateAnimationSpeedServerRpc();
			timeSinceHitting += Time.deltaTime;
			timeSinceBeingHit += Time.deltaTime;
			regenerationTime += Time.deltaTime;
			if (nonAggroTime > 0f)
			{
				nonAggroTime -= Time.deltaTime;
			}
			HandleHealthServerRpc();
			if ((Object)(object)playerWhoHired != (Object)null && isHired)
			{
				Vector3 position = ((Component)playerWhoHired).transform.position;
				float num = Vector3.Distance(position, ((Component)this).transform.position);
				if (base.currentBehaviourStateIndex == 2 && num > 25f)
				{
					hasPlayedBattleSound = false;
					((EnemyAI)this).SwitchToBehaviourServerRpc(1);
					nonAggroTime = 3f;
					targetEnemy = null;
					targetEnemyAI = null;
				}
				if (num > 60f && !playerWhoHired.isPlayerDead)
				{
					base.serverPosition = position;
					((Component)this).transform.position = position;
					base.agent.Warp(position);
					((EnemyAI)this).SyncPositionToClients();
				}
			}
			if (!isHired && angeredTimer <= 0f)
			{
				((Component)hireTrigger).gameObject.SetActive(true);
				base.creatureAnimator.SetBool("Angry", false);
			}
			if (isHired || base.isEnemyDead || angeredTimer > 0f)
			{
				((Component)hireTrigger).gameObject.SetActive(false);
			}
			if (angeredTimer > 0f)
			{
				angeredTimer -= Time.deltaTime;
				angeredTimer = Mathf.Max(angeredTimer, 0f);
			}
			if (timeSinceBeingHit > 30f && isHired && regenerationTime > Plugin.DehyaRegenTime.Value && base.enemyHP <= Plugin.DehyaHealth.Value)
			{
				base.enemyHP++;
				regenerationTime = 0f;
			}
			if (!isHired)
			{
				if (base.currentBehaviourStateIndex != 0)
				{
					return;
				}
				CheckForEmployers();
			}
			if (isHired && (Object)(object)targetEnemy == (Object)null)
			{
				FollowEmployer();
			}
			if (base.currentBehaviourStateIndex == 1 && nonAggroTime <= 0f)
			{
				LookForEnemiesNearbyServerRpc();
			}
			if (base.currentBehaviourStateIndex == 1)
			{
				float num2 = Vector3.Distance(((Component)this).transform.position, ((Component)playerWhoHired).transform.position);
				if (isHired)
				{
					if ((Object)(object)playerWhoHired != (Object)null && playerWhoHired.performingEmote)
					{
						int integer = playerWhoHired.playerBodyAnimator.GetInteger("emoteNumber");
						if (integer == 1 && !isDancing)
						{
							DancingStartServerRpc();
						}
					}
					else if (wasDancingLastFrame)
					{
						DancingStopServerRpc();
					}
				}
				if (num2 > 8f)
				{
					SprintingServerRpc(running: true);
				}
				else
				{
					SprintingServerRpc(running: false);
				}
			}
			if (base.currentBehaviourStateIndex == 2)
			{
				MoveToTargetEnemy();
				base.agent.speed = 9f;
				base.agent.stoppingDistance = 0f;
				if (isDancing)
				{
					DancingStopServerRpc();
				}
			}
			if (base.currentBehaviourStateIndex == 2 && ((Object)(object)targetEnemy != (Object)null || (Object)(object)targetEnemyAI != (Object)null) && Vector3.Distance(((Component)targetEnemy).transform.position, ((Component)this).transform.position) <= 3f)
			{
				timeSinceLastDamage += Time.deltaTime;
				if (timeSinceLastDamage >= damageInterval)
				{
					((EnemyAI)this).HitEnemy(1, (PlayerControllerB)null, false, -1);
					timeSinceLastDamage = 0f;
					timeSinceBeingHit = 0f;
				}
			}
		}

		private IEnumerator ToggleDancing()
		{
			base.creatureAnimator.SetBool("Dancing", true);
			isDancing = true;
			wasDancingLastFrame = true;
			yield return (object)new WaitForSeconds(0.3f);
		}

		private IEnumerator ToggleDancingNoNoise()
		{
			base.creatureAnimator.SetBool("Dancing", false);
			isDancing = false;
			wasDancingLastFrame = false;
			yield return (object)new WaitForSeconds(0.3f);
		}

		[ClientRpc]
		public void DancingStartClientRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1611076247u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1611076247u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				if (!hasPlayedDanceSound)
				{
					base.creatureVoice.PlayOneShot(soundStartDance);
					WalkieTalkie.TransmitOneShotAudio(base.creatureVoice, soundStartDance, 1f);
					hasPlayedDanceSound = true;
				}
				((MonoBehaviour)this).StartCoroutine(ToggleDancing());
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void DancingStartServerRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2643196835u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2643196835u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					DancingStartClientRpc();
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void DancingStopServerRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(590959896u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 590959896u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					DancingStopClientRpc();
				}
			}
		}

		[ClientRpc]
		public void DancingStopClientRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(953641871u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 953641871u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					hasPlayedDanceSound = false;
					((MonoBehaviour)this).StartCoroutine(ToggleDancingNoNoise());
				}
			}
		}

		public void PlayNoise(int soundClip)
		{
			base.creatureVoice.PlayOneShot(soundDehyaNoise[soundClip]);
			WalkieTalkie.TransmitOneShotAudio(base.creatureVoice, soundDehyaNoise[soundClip], 1f);
		}

		[ServerRpc(RequireOwnership = false)]
		public void LookForEnemiesNearbyServerRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0200: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3135527411u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3135527411u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost))
			{
				return;
			}
			Collider[] array = Physics.OverlapSphere(((Component)this).transform.position, detectionRadius, LayerMask.op_Implicit(enemyLayer));
			Collider[] array2 = array;
			foreach (Collider val3 in array2)
			{
				Transform root = ((Component)val3).transform.root;
				EnemyAI component = ((Component)root).GetComponent<EnemyAI>();
				if (!((Object)(object)component != (Object)null) || !IsVisible(root) || component is DehyaEnemyAI || !component.enemyType.canDie || component.isEnemyDead || !(component.enemyType.enemyName != "Blob") || !(component.enemyType.enemyName != "Docile Locust Bees") || !(component.enemyType.enemyName != "Manticoil"))
				{
					continue;
				}
				if (component.enemyType.enemyName == "Maneater")
				{
					CaveDwellerAI val4 = (CaveDwellerAI)(object)((component is CaveDwellerAI) ? component : null);
					if (val4 != null && ((Behaviour)val4.propScript).enabled)
					{
						continue;
					}
				}
				targetEnemy = root;
				targetEnemyAI = component;
				NetworkObject component2 = ((Component)targetEnemyAI).gameObject.GetComponent<NetworkObject>();
				LookForEnemiesNearbyClientRpc(targetEnemy.position, NetworkObjectReference.op_Implicit(component2));
				((EnemyAI)this).SwitchToBehaviourServerRpc(2);
				break;
			}
		}

		[ClientRpc]
		public void LookForEnemiesNearbyClientRpc(Vector3 targetPosition, NetworkObjectReference meow)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: 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_00eb: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(686919563u, val, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe(ref targetPosition);
				((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref meow, default(ForNetworkSerializable));
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 686919563u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost))
			{
				return;
			}
			try
			{
				targetEnemy.position = targetPosition;
				NetworkObject val3 = default(NetworkObject);
				EnemyAI val4 = default(EnemyAI);
				if (((NetworkObjectReference)(ref meow)).TryGet(ref val3, (NetworkManager)null) && ((Component)((Component)val3).transform).TryGetComponent<EnemyAI>(ref val4))
				{
					targetEnemyAI = val4;
				}
			}
			catch (NullReferenceException)
			{
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void PlayStartCombatServerRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(4018386844u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 4018386844u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost) && !hasPlayedBattleSound)
				{
					PlayStartCombatClientRpc();
					hasPlayedBattleSound = true;
				}
			}
		}

		[ClientRpc]
		public void PlayStartCombatClientRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1750625558u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1750625558u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					base.creatureVoice.PlayOneShot(soundDehyaNoise[0]);
					WalkieTalkie.TransmitOneShotAudio(base.creatureVoice, soundDehyaNoise[0], 1f);
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void PlayKillNoiseServerRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1234330584u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1234330584u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					PlayKillNoiseClientRpc();
				}
			}
		}

		[ClientRpc]
		public void PlayKillNoiseClientRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(629406205u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 629406205u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					PlayNoise(1);
				}
			}
		}

		private bool IsVisible(Transform target)
		{
			//IL_0002: 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_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			Vector3 val = target.position - ((Component)this).transform.position;
			float magnitude = ((Vector3)(ref val)).magnitude;
			if (!Physics.Raycast(((Component)this).transform.position, val, magnitude, LayerMask.op_Implicit(obstacleLayer)))
			{
				return true;
			}
			return false;
		}

		private void CheckIfCooledOff()
		{
			if (base.currentBehaviourStateIndex == 3 && angeredTimer <= 0f)
			{
				((EnemyAI)this).SwitchToBehaviourState(0);
			}
		}

		private void MoveToTargetEnemy()
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				if ((Object)(object)targetEnemy != (Object)null)
				{
					base.agent.SetDestination(targetEnemy.position);
					base.agent.speed = 9f;
				}
				if (targetEnemyAI.isEnemyDead)
				{
					hasPlayedBattleSound = false;
					targetEnemy = null;
					targetEnemyAI = null;
					((EnemyAI)this).SwitchToBehaviourState(1);
					PlayKillNoiseClientRpc();
				}
			}
			catch (NullReferenceException)
			{
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void HandleHealthServerRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(104498576u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 104498576u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					HandleHealthClientRpc();
				}
			}
		}

		[ClientRpc]
		public void HandleHealthClientRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(16918071u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 16918071u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				if (base.enemyHP <= 2)
				{
					((Renderer)((Component)((Component)this).transform.Find("DehyaSK").Find("Body")).GetComponent<SkinnedMeshRenderer>()).materials[1].mainTexture = (Texture)(object)hurtBody;
				}
				else
				{
					((Renderer)((Component)((Component)this).transform.Find("DehyaSK").Find("Body")).GetComponent<SkinnedMeshRenderer>()).materials[1].mainTexture = (Texture)(object)healthyBody;
				}
			}
		}

		private void CheckForEmployers()
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			if (base.currentBehaviourStateIndex == 0)
			{
				Collider[] array = Physics.OverlapSphere(((Component)this).transform.position, employerDetectionRange, LayerMask.op_Implicit(playerLayer));
				if (array.Length != 0)
				{
					OfferBlade(((Component)array[0]).transform);
					return;
				}
				base.creatureAnimator.SetBool("HandOut", false);
				isWithinHireRange = false;
			}
		}

		private void OfferBlade(Transform playerTransform)
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			base.agent.speed = 0f;
			Vector3 val = playerTransform.position - ((Component)this).transform.position;
			Vector3 normalized = ((Vector3)(ref val)).normalized;
			Quaternion val2 = Quaternion.LookRotation(new Vector3(normalized.x, 0f, normalized.z));
			((Component)this).transform.rotation = Quaternion.Slerp(((Component)this).transform.rotation, val2, Time.deltaTime * 5f);
			base.creatureAnimator.SetBool("HandOut", true);
		}

		public void AttemptHireCreature(PlayerControllerB player)
		{
			int playerId = (int)player.playerClientId;
			HireCreatureServerRpc(playerId);
		}

		[ServerRpc(RequireOwnership = false)]
		public void HireCreatureServerRpc(int playerId)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3762414434u, val, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val2, playerId);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3762414434u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				PlayerControllerB val3 = StartOfRound.Instance.allPlayerScripts[playerId];
				if ((Object)(object)val3.currentlyHeldObjectServer == (Object)null)
				{
					((MonoBehaviour)this).StartCoroutine(TemporarilyModifyComponent());
					return;
				}
				if (val3.currentlyHeldObjectServer.scrapValue < Plugin.HiringPrice.Value && val3.currentlyHeldObjectServer.itemProperties.itemName != "Dehya's Makeup")
				{
					((MonoBehaviour)this).StartCoroutine(TemporarilyModifyComponent());
					return;
				}
				((Component)hireTrigger).gameObject.SetActive(false);
				isHired = true;
				playerWhoHired = val3;
				HireCreatureClientRpc(playerId);
			}
		}

		private IEnumerator TemporarilyModifyComponent()
		{
			hireTrigger.hoverTip = "Requires worthwhile scrap as payment";
			TemporarilyDisableComponentClientRpc();
			yield return (object)new WaitForSeconds(5f);
			hireTrigger.hoverTip = "Hire Dehya [LMB]:";
			RestoreComponentClientRpc();
		}

		[ClientRpc]
		private void TemporarilyDisableComponentClientRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2563650984u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2563650984u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					hireTrigger.hoverTip = "Requires worthwhile scrap as payment";
				}
			}
		}

		[ClientRpc]
		private void RestoreComponentClientRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3594629067u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3594629067u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					hireTrigger.hoverTip = "Hire Dehya [LMB]:";
				}
			}
		}

		[ClientRpc]
		public void HireCreatureClientRpc(int playerId)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2493665608u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, playerId);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2493665608u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					PlayerControllerB val3 = StartOfRound.Instance.allPlayerScripts[playerId];
					Vector3 val4 = default(Vector3);
					((Vector3)(ref val4))..ctor(((Component)this).transform.position.x, ((Component)this).transform.position.y - 1000f, ((Component)this).transform.position.z);
					((Component)val3.currentlyHeldObjectServer).gameObject.SetActive(false);
					val3.DiscardHeldObject(true, (NetworkObject)null, val4, true);
					((Component)((Component)this).transform.Find("ScanNode")).GetComponent<ScanNodeProperties>().subText = "Hired by: " + val3.playerUsername;
					((Behaviour)HUDManager.Instance.itemSlotIcons[val3.currentItemSlot]).enabled = false;
					base.creatureAnimator.SetBool("HandOut", false);
					base.creatureAnimator.SetBool("Hired", true);
					base.agent.speed = 5f;
					isHired = true;
					playerWhoHired = val3;
					((Component)hireTrigger).gameObject.SetActive(false);
					int num = RoundManager.PlayRandomClip(base.creatureVoice, soundDehyaJoinParty, true, 1f, 0, 1000);
					WalkieTalkie.TransmitOneShotAudio(base.creatureVoice, soundDehyaJoinParty[num], 1f);
					((EnemyAI)this).SwitchToBehaviourServerRpc(1);
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void EmployerDeadServerRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(707678155u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 707678155u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					isHired = false;
					playerWhoHired = null;
					((EnemyAI)this).StartSearch(((Component)this).transform.position, base.currentSearch);
					base.currentSearch.searchWidth = 180f;
					base.currentSearch.searchPrecision = 10f;
					base.moveTowardsDestination = true;
					base.agent.speed = 5f;
					((Behaviour)base.agent).enabled = true;
					EmployerDeadClientRpc();
				}
			}
		}

		[ClientRpc]
		public void EmployerDeadClientRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2145476862u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2145476862u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					isHired = false;
					playerWhoHired = null;
					((Behaviour)base.agent).enabled = true;
					base.creatureAnimator.SetBool("Hired", false);
					((Component)((Component)this).transform.Find("ScanNode")).GetComponent<ScanNodeProperties>().subText = "";
					((Behaviour)hireTrigger).enabled = true;
					base.agent.speed = 5f;
					((EnemyAI)this).SwitchToBehaviourServerRpc(0);
				}
			}
		}

		private void FollowEmployer()
		{
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)playerWhoHired != (Object)null && ((Behaviour)base.agent).isActiveAndEnabled)
			{
				FollowEmployerServerRpc(((Component)playerWhoHired).transform.position);
			}
		}

		[ServerRpc(RequireOwnership = false)]
		private void FollowEmployerServerRpc(Vector3 destination)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3006074704u, val, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe(ref destination);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3006074704u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost) || !((Behaviour)base.agent).isActiveAndEnabled)
			{
				return;
			}
			try
			{
				base.agent.SetDestination(destination);
				base.agent.stoppingDistance = 4f;
			}
			catch (Exception)
			{
			}
		}

		[ServerRpc(RequireOwnership = false)]
		private void AttackPlayerServerRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1311575384u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1311575384u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				if ((Object)(object)playerWhoHit != (Object)null)
				{
					base.agent.SetDestination(((Component)playerWhoHit).transform.position);
					base.agent.stoppingDistance = 0f;
				}
				AttackPlayerClientRpc();
			}
		}

		[ClientRpc]
		private void AttackPlayerClientRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(4004154220u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4004154220u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					base.creatureAnimator.SetBool("Angry", true);
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		private void CalculateAnimationSpeedServerRpc(float maxSpeed = 1f)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: 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_00dd: 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_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3234949226u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref maxSpeed, default(ForPrimitives));
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3234949226u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					Vector3 val3 = Vector3.ClampMagnitude(((Component)this).transform.position - previousPosition, maxSpeed);
					float maxSpeed2 = ((Vector3)(ref val3)).magnitude / (Time.deltaTime * 3f);
					previousPosition = ((Component)this).transform.position;
					CalculateAnimationSpeedClientRpc(maxSpeed2);
				}
			}
		}

		[ClientRpc]
		private void CalculateAnimationSpeedClientRpc(float maxSpeed)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: 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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1252448632u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref maxSpeed, default(ForPrimitives));
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1252448632u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					base.creatureAnimator.SetBool("Walking", maxSpeed > 0.05f);
				}
			}
		}

		public override void KillEnemy(bool destroy = false)
		{
			((Component)hireTrigger).gameObject.SetActive(false);
			((EnemyAI)this).KillEnemy(destroy);
			base.agent.speed = 0f;
		}

		protected override void __initializeVariables()
		{
			((EnemyAI)this).__initializeVariables();
		}

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_DehyaEnemyAI()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Expected O, but got Unknown
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Expected O, but got Unknown
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Expected O, but got Unknown
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Expected O, but got Unknown
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Expected O, but got Unknown
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Expected O, but got Unknown
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Expected O, but got Unknown
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Expected O, but got Unknown
			//IL_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Expected O, but got Unknown
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Expected O, but got Unknown
			//IL_0155: Unknown result type (might be due to invalid IL or missing references)
			//IL_015f: Expected O, but got Unknown
			//IL_0170: Unknown result type (might be due to invalid IL or missing references)
			//IL_017a: Expected O, but got Unknown
			//IL_018b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0195: Expected O, but got Unknown
			//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b0: Expected O, but got Unknown
			//IL_01c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cb: Expected O, but got Unknown
			//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e6: Expected O, but got Unknown
			//IL_01f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0201: Expected O, but got Unknown
			//IL_0212: Unknown result type (might be due to invalid IL or missing references)
			//IL_021c: Expected O, but got Unknown
			//IL_022d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0237: Expected O, but got Unknown
			//IL_0248: Unknown result type (might be due to invalid IL or missing references)
			//IL_0252: Expected O, but got Unknown
			//IL_0263: Unknown result type (might be due to invalid IL or missing references)
			//IL_026d: Expected O, but got Unknown
			//IL_027e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0288: Expected O, but got Unknown
			//IL_0299: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a3: Expected O, but got Unknown
			//IL_02b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02be: Expected O, but got Unknown
			//IL_02cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d9: Expected O, but got Unknown
			//IL_02ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f4: Expected O, but got Unknown
			NetworkManager.__rpc_func_table.Add(2910680899u, new RpcReceiveHandler(__rpc_handler_2910680899));
			NetworkManager.__rpc_func_table.Add(1110503656u, new RpcReceiveHandler(__rpc_handler_1110503656));
			NetworkManager.__rpc_func_table.Add(658431256u, new RpcReceiveHandler(__rpc_handler_658431256));
			NetworkManager.__rpc_func_table.Add(633428897u, new RpcReceiveHandler(__rpc_handler_633428897));
			NetworkManager.__rpc_func_table.Add(1201830463u, new RpcReceiveHandler(__rpc_handler_1201830463));
			NetworkManager.__rpc_func_table.Add(1611076247u, new RpcReceiveHandler(__rpc_handler_1611076247));
			NetworkManager.__rpc_func_table.Add(2643196835u, new RpcReceiveHandler(__rpc_handler_2643196835));
			NetworkManager.__rpc_func_table.Add(590959896u, new RpcReceiveHandler(__rpc_handler_590959896));
			NetworkManager.__rpc_func_table.Add(953641871u, new RpcReceiveHandler(__rpc_handler_953641871));
			NetworkManager.__rpc_func_table.Add(3135527411u, new RpcReceiveHandler(__rpc_handler_3135527411));
			NetworkManager.__rpc_func_table.Add(686919563u, new RpcReceiveHandler(__rpc_handler_686919563));
			NetworkManager.__rpc_func_table.Add(4018386844u, new RpcReceiveHandler(__rpc_handler_4018386844));
			NetworkManager.__rpc_func_table.Add(1750625558u, new RpcReceiveHandler(__rpc_handler_1750625558));
			NetworkManager.__rpc_func_table.Add(1234330584u, new RpcReceiveHandler(__rpc_handler_1234330584));
			NetworkManager.__rpc_func_table.Add(629406205u, new RpcReceiveHandler(__rpc_handler_629406205));
			NetworkManager.__rpc_func_table.Add(104498576u, new RpcReceiveHandler(__rpc_handler_104498576));
			NetworkManager.__rpc_func_table.Add(16918071u, new RpcReceiveHandler(__rpc_handler_16918071));
			NetworkManager.__rpc_func_table.Add(3762414434u, new RpcReceiveHandler(__rpc_handler_3762414434));
			NetworkManager.__rpc_func_table.Add(2563650984u, new RpcReceiveHandler(__rpc_handler_2563650984));
			NetworkManager.__rpc_func_table.Add(3594629067u, new RpcReceiveHandler(__rpc_handler_3594629067));
			NetworkManager.__rpc_func_table.Add(2493665608u, new RpcReceiveHandler(__rpc_handler_2493665608));
			NetworkManager.__rpc_func_table.Add(707678155u, new RpcReceiveHandler(__rpc_handler_707678155));
			NetworkManager.__rpc_func_table.Add(2145476862u, new RpcReceiveHandler(__rpc_handler_2145476862));
			NetworkManager.__rpc_func_table.Add(3006074704u, new RpcReceiveHandler(__rpc_handler_3006074704));
			NetworkManager.__rpc_func_table.Add(1311575384u, new RpcReceiveHandler(__rpc_handler_1311575384));
			NetworkManager.__rpc_func_table.Add(4004154220u, new RpcReceiveHandler(__rpc_handler_4004154220));
			NetworkManager.__rpc_func_table.Add(3234949226u, new RpcReceiveHandler(__rpc_handler_3234949226));
			NetworkManager.__rpc_func_table.Add(1252448632u, new RpcReceiveHandler(__rpc_handler_1252448632));
		}

		private static void __rpc_handler_2910680899(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: 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_0044: 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)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				bool running = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref running, default(ForPrimitives));
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((DehyaEnemyAI)(object)target).SprintingServerRpc(running);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1110503656(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: 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_0044: 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)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				bool running = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref running, default(ForPrimitives));
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((DehyaEnemyAI)(object)target).SprintingClientRpc(running);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_658431256(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: 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_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				NetworkObjectReference networkObject = default(NetworkObjectReference);
				((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref networkObject, default(ForNetworkSerializable));
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((DehyaEnemyAI)(object)target).AttackServerRpc(networkObject);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_633428897(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: 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_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				NetworkObjectReference networkObject = default(NetworkObjectReference);
				((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref networkObject, default(ForNetworkSerializable));
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((DehyaEnemyAI)(object)target).AttackClientRpc(networkObject);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1201830463(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((DehyaEnemyAI)(object)target).AttackPlayerEnemyClientRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1611076247(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((DehyaEnemyAI)(object)target).DancingStartClientRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2643196835(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((DehyaEnemyAI)(object)target).DancingStartServerRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_590959896(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((DehyaEnemyAI)(object)target).DancingStopServerRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_953641871(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((DehyaEnemyAI)(object)target).DancingStopClientRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_3135527411(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((DehyaEnemyAI)(object)target).LookForEnemiesNearbyServerRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_686919563(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: 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_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				Vector3 targetPosition = default(Vector3);
				((FastBufferReader)(ref reader)).ReadValueSafe(ref targetPosition);
				NetworkObjectReference meow = default(NetworkObjectReference);
				((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref meow, default(ForNetworkSerializable));
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((DehyaEnemyAI)(object)target).LookForEnemiesNearbyClientRpc(targetPosition, meow);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_4018386844(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((DehyaEnemyAI)(object)target).PlayStartCombatServerRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1750625558(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((DehyaEnemyAI)(object)target).PlayStartCombatClientRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1234330584(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((DehyaEnemyAI)(object)target).PlayKillNoiseServerRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_629406205(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((DehyaEnemyAI)(object)target).PlayKillNoiseClientRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_104498576(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((DehyaEnemyAI)(object)target).HandleHealthServerRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_16918071(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((DehyaEnemyAI)(object)target).HandleHealthClientRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_3762414434(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				int playerId = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref playerId);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((DehyaEnemyAI)(object)target).HireCreatureServerRpc(playerId);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2563650984(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((DehyaEnemyAI)(object)target).TemporarilyDisableComponentClientRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_3594629067(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((DehyaEnemyAI)(object)target).RestoreComponentClientRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2493665608(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				int playerId = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref playerId);
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((DehyaEnemyAI)(object)target).HireCreatureClientRpc(playerId);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_707678155(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((DehyaEnemyAI)(object)target).EmployerDeadServerRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2145476862(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((DehyaEnemyAI)(object)target).EmployerDeadClientRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_3006074704(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				Vector3 destination = default(Vector3);
				((FastBufferReader)(ref reader)).ReadValueSafe(ref destination);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((DehyaEnemyAI)(object)target).FollowEmployerServerRpc(destination);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1311575384(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((DehyaEnemyAI)(object)target).AttackPlayerServerRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_4004154220(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((DehyaEnemyAI)(object)target).AttackPlayerClientRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_3234949226(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: 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_0044: 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)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				float maxSpeed = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref maxSpeed, default(ForPrimitives));
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((DehyaEnemyAI)(object)target).CalculateAnimationSpeedServerRpc(maxSpeed);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1252448632(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: 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_0044: 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)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				float maxSpeed = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref maxSpeed, default(ForPrimitives));
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((DehyaEnemyAI)(object)target).CalculateAnimationSpeedClientRpc(maxSpeed);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		protected internal override string __getTypeName()
		{
			return "DehyaEnemyAI";
		}
	}
	public static class Assets
	{
		public static AssetBundle DehyaAssetBundle;

		public static void PopulateAssets()
		{
			string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
			DehyaAssetBundle = AssetBundle.LoadFromFile(Path.Combine(directoryName, "dehya"));
			if ((Object)(object)DehyaAssetBundle == (Object)null)
			{
				Plugin.Logger.LogError((object)"Failed to load custom assets.");
			}
		}
	}
	[BepInPlugin("DehyaEnemy", "DehyaEnemy", "1.0.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		public static Harmony _harmony;

		public static EnemyType Dehya;

		internal static ManualLogSource Logger;

		public static ConfigEntry<int> SpawnProbability { get; private set; }

		public static ConfigEntry<int> HiringPrice { get; private set; }

		public static ConfigEntry<int> DehyaHealth { get; private set; }

		public static ConfigEntry<float> DehyaRegenTime { get; private set; }

		private void Awake()
		{
			//IL_01e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f2: Expected O, but got Unknown
			SpawnProbability = ((BaseUnityPlugin)this).Config.Bind<int>("Dehya", "Dehya Spawn Probability", 100, "Spawn rate of Dehya, Lethal Company's spawning system is done cumulativly, so 100 doesn't guarantee a Dehya to spawn every match");
			HiringPrice = ((BaseUnityPlugin)this).Config.Bind<int>("Dehya", "Dehya Hiring Cost", 40, "Price of the scrap item required to hire Dehya");
			DehyaHealth = ((BaseUnityPlugin)this).Config.Bind<int>("Dehya", "Dehya Health", 6, "Dehya's Hitpoints");
			DehyaRegenTime = ((BaseUnityPlugin)this).Config.Bind<float>("Dehya", "Dehya Regeneration Rate", 15f, "The amount of time between Dehya regenerating one hitpoint");
			Type[] types = Assembly.GetExecutingAssembly().GetTypes();
			Type[] array = types;
			foreach (Type type in array)
			{
				MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic);
				MethodInfo[] array2 = methods;
				foreach (MethodInfo methodInfo in array2)
				{
					object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false);
					if (customAttributes.Length != 0)
					{
						methodInfo.Invoke(null, null);
					}
				}
			}
			Logger = ((BaseUnityPlugin)this).Logger;
			Assets.PopulateAssets();
			Dehya = Assets.DehyaAssetBundle.LoadAsset<EnemyType>("Dehya");
			if ((Object)(object)Dehya == (Object)null)
			{
				Logger.LogInfo((object)"Dehya is null!");
			}
			TerminalNode val = Assets.DehyaAssetBundle.LoadAsset<TerminalNode>("DehyaTN");
			if ((Object)(object)val == (Object)null)
			{
				Logger.LogInfo((object)"TN is null!");
			}
			TerminalKeyword val2 = Assets.DehyaAssetBundle.LoadAsset<TerminalKeyword>("DehyaTK");
			if ((Object)(object)val2 == (Object)null)
			{
				Logger.LogInfo((object)"TK is null!");
			}
			GameObject val3 = Assets.DehyaAssetBundle.LoadAsset<GameObject>("DehyaNetworkManager");
			if ((Object)(object)val3 == (Object)null)
			{
				Logger.LogInfo((object)"gameObject is null!");
			}
			_harmony = new Harmony("com.dehya.enemypatch");
			_harmony.PatchAll();
			NetworkPrefabs.RegisterNetworkPrefab(Dehya.enemyPrefab);
			Enemies.RegisterEnemy(Dehya, SpawnProbability.Value, (LevelTypes)(-1), (SpawnType)0, val, val2);
			Logger.LogInfo((object)"Dehya is loaded!");
		}
	}
	public class NetworkHandler : NetworkBehaviour
	{
		public static NetworkHandler Instance { get; private set; }

		public static event Action<string> LevelEvent;

		public override void OnNetworkSpawn()
		{
			NetworkHandler.LevelEvent = null;
			if (NetworkManager.Singleton.IsHost || NetworkManager.Singleton.IsServer)
			{
				NetworkHandler instance = Instance;
				if (instance != null)
				{
					((Component)instance).gameObject.GetComponent<NetworkObject>().Despawn(true);
				}
			}
			Instance = this;
			((NetworkBehaviour)this).OnNetworkSpawn();
		}

		[ClientRpc]
		public void EventClientRpc(string eventName)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: 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_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1831896246u, val, (RpcDelivery)0);
				bool flag = eventName != null;
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
				if (flag)
				{
					((FastBufferWriter)(ref val2)).WriteValueSafe(eventName, false);
				}
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1831896246u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				NetworkHandler.LevelEvent?.Invoke(eventName);
			}
		}

		protected override void __initializeVariables()
		{
			((NetworkBehaviour)this).__initializeVariables();
		}

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_NetworkHandler()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			NetworkManager.__rpc_func_table.Add(1831896246u, new RpcReceiveHandler(__rpc_handler_1831896246));
		}

		p