Decompiled source of AutoPickup v1.0.3

autopickup.dll

Decompiled 2 weeks ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using Microsoft.CodeAnalysis;
using On.RoR2;
using RoR2;
using UnityEngine;
using UnityEngine.Networking;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("autopickup")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("autopickup")]
[assembly: AssemblyTitle("autopickup")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace AutoCommandEssencePickup
{
	[BepInPlugin("com.gogogadgetjustice.autopickup", "Auto Pickup", "2.7.1")]
	public class AutoEssencePickup : BaseUnityPlugin
	{
		[CompilerGenerated]
		private sealed class <KeepDroppingBossHunters>d__15 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public AutoEssencePickup <>4__this;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <KeepDroppingBossHunters>d__15(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_0077: Unknown result type (might be due to invalid IL or missing references)
				//IL_0081: Expected O, but got Unknown
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					break;
				case 1:
					<>1__state = -1;
					break;
				}
				if ((Object)(object)<>4__this.currentBossHunterUser != (Object)null && (Object)(object)<>4__this.currentBossHunterUser.master != (Object)null)
				{
					<>4__this.DropSpecificEquipment(<>4__this.currentBossHunterUser, "BossHunter");
				}
				<>2__current = (object)new WaitForSeconds(2.5f);
				<>1__state = 1;
				return true;
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		public const string PluginGUID = "com.gogogadgetjustice.autopickup";

		public const string PluginName = "Auto Pickup";

		public const string PluginVersion = "2.7.1";

		private ConfigEntry<float> scanRadius;

		private ConfigEntry<bool> modEnabled;

		private ConfigEntry<bool> autoSelectSingleChoice;

		private float drifterBagTimer = 0f;

		private const float DRIFTER_BAG_DELAY = 3f;

		private Coroutine bossHunterCoroutine = null;

		private NetworkUser currentBossHunterUser = null;

		public void Awake()
		{
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Expected O, but got Unknown
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Expected O, but got Unknown
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Expected O, but got Unknown
			modEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Enabled", true, "Is the auto-pickup active?");
			scanRadius = ((BaseUnityPlugin)this).Config.Bind<float>("General", "ScanRadius", 1.5f, "Radius for interaction scan.");
			autoSelectSingleChoice = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "AutoSelectSingleChoice", true, "Automatically select and spawn items when there's only one choice (bypasses popup for boss items and elite equipment)");
			((BaseUnityPlugin)this).Logger.LogInfo((object)"AutoEssencePickup 2.7.1: Using bodyFlags instead of CharacterMotor");
			Chat.CCSay += new hook_CCSay(Chat_CCSay);
			Stage.Start += new hook_Start(Stage_Start);
			PickupPickerController.OnInteractionBegin += new hook_OnInteractionBegin(PickupPickerController_OnInteractionBegin);
		}

		private void PickupPickerController_OnInteractionBegin(orig_OnInteractionBegin orig, PickupPickerController self, Interactor activator)
		{
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			if (!autoSelectSingleChoice.Value || !NetworkServer.active)
			{
				orig.Invoke(self, activator);
				return;
			}
			if (self.options != null && self.options.Length == 1)
			{
				Option val = self.options[0];
				PickupIndex pickupIndex = val.pickup.pickupIndex;
				if (pickupIndex != PickupIndex.none)
				{
					CharacterBody component = ((Component)activator).GetComponent<CharacterBody>();
					if ((Object)(object)component != (Object)null)
					{
						Vector3 position = ((Component)self).transform.position;
						Vector3 val2 = Vector3.up * 10f;
						PickupDropletController.CreatePickupDroplet(pickupIndex, position, val2);
						NetworkServer.Destroy(((Component)self).gameObject);
						return;
					}
				}
			}
			orig.Invoke(self, activator);
		}

		private IEnumerator Stage_Start(orig_Start orig, Stage self)
		{
			drifterBagTimer = 0f;
			return orig.Invoke(self);
		}

		public void Update()
		{
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0204: Unknown result type (might be due to invalid IL or missing references)
			//IL_020a: Invalid comparison between Unknown and I4
			//IL_0220: Unknown result type (might be due to invalid IL or missing references)
			//IL_0226: Invalid comparison between Unknown and I4
			//IL_0237: Unknown result type (might be due to invalid IL or missing references)
			//IL_024f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0255: Invalid comparison between Unknown and I4
			if (!modEnabled.Value || !NetworkServer.active)
			{
				return;
			}
			LocalUser firstLocalUser = LocalUserManager.GetFirstLocalUser();
			if ((Object)(object)((firstLocalUser != null) ? firstLocalUser.cachedBody : null) == (Object)null)
			{
				return;
			}
			CharacterBody cachedBody = firstLocalUser.cachedBody;
			if (drifterBagTimer < 3f)
			{
				drifterBagTimer += Time.deltaTime;
			}
			else
			{
				if (cachedBody.isSprinting)
				{
					return;
				}
				Interactor component = ((Component)cachedBody).GetComponent<Interactor>();
				if ((Object)(object)component == (Object)null)
				{
					return;
				}
				Collider[] array = Physics.OverlapSphere(((Component)cachedBody).transform.position, scanRadius.Value);
				Collider[] array2 = array;
				foreach (Collider val in array2)
				{
					GameObject gameObject = ((Component)val).gameObject;
					string text = ((Object)gameObject).name.ToLowerInvariant();
					if (text.Contains("drifter") || text.Contains("scrap") || text.Contains("consume") || text.Contains("bag") || text.Contains("shrine") || text.Contains("duplicator") || text.Contains("printer") || text.Contains("teleporter") || text.Contains("scrapper") || text.Contains("chest") || text.Contains("barrel") || text.Contains("pod") || text.Contains("terminal") || text.Contains("portal") || text.Contains("equipmentpickup"))
					{
						continue;
					}
					GenericPickupController component2 = gameObject.GetComponent<GenericPickupController>();
					if ((Object)(object)component2 != (Object)null)
					{
						PickupDef pickupDef = PickupCatalog.GetPickupDef(component2.pickupIndex);
						if (pickupDef != null && (int)pickupDef.equipmentIndex != -1)
						{
							continue;
						}
						if (pickupDef != null && (int)pickupDef.itemIndex != -1)
						{
							ItemDef itemDef = ItemCatalog.GetItemDef(pickupDef.itemIndex);
							if ((Object)(object)itemDef != (Object)null && (int)itemDef.tier == 4)
							{
								continue;
							}
						}
					}
					component.AttemptInteraction(gameObject);
				}
			}
		}

		private void Chat_CCSay(orig_CCSay orig, ConCommandArgs args)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Expected O, but got Unknown
			//IL_0143: Unknown result type (might be due to invalid IL or missing references)
			//IL_0148: Unknown result type (might be due to invalid IL or missing references)
			//IL_0168: Expected O, but got Unknown
			//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01de: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0202: Unknown result type (might be due to invalid IL or missing references)
			//IL_0212: Expected O, but got Unknown
			//IL_086b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0870: Unknown result type (might be due to invalid IL or missing references)
			//IL_0872: Unknown result type (might be due to invalid IL or missing references)
			//IL_0875: Invalid comparison between Unknown and I4
			//IL_0881: Unknown result type (might be due to invalid IL or missing references)
			//IL_0883: Unknown result type (might be due to invalid IL or missing references)
			//IL_0888: Unknown result type (might be due to invalid IL or missing references)
			//IL_0891: Unknown result type (might be due to invalid IL or missing references)
			//IL_0896: Unknown result type (might be due to invalid IL or missing references)
			//IL_08a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_08a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_08aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_08ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_08b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_08c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_08c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_08c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_08ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_08db: Unknown result type (might be due to invalid IL or missing references)
			//IL_08dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0938: Unknown result type (might be due to invalid IL or missing references)
			//IL_093d: Unknown result type (might be due to invalid IL or missing references)
			//IL_093f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0942: Invalid comparison between Unknown and I4
			//IL_0951: Unknown result type (might be due to invalid IL or missing references)
			//IL_0953: Unknown result type (might be due to invalid IL or missing references)
			//IL_0958: Unknown result type (might be due to invalid IL or missing references)
			//IL_0961: Unknown result type (might be due to invalid IL or missing references)
			//IL_0966: Unknown result type (might be due to invalid IL or missing references)
			//IL_0970: Unknown result type (might be due to invalid IL or missing references)
			//IL_0975: Unknown result type (might be due to invalid IL or missing references)
			//IL_097a: Unknown result type (might be due to invalid IL or missing references)
			//IL_097e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0986: Unknown result type (might be due to invalid IL or missing references)
			//IL_0990: Unknown result type (might be due to invalid IL or missing references)
			//IL_0992: Unknown result type (might be due to invalid IL or missing references)
			//IL_0999: Unknown result type (might be due to invalid IL or missing references)
			//IL_099e: Unknown result type (might be due to invalid IL or missing references)
			//IL_09ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_09ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_09cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_09d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a51: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a56: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a66: Expected O, but got Unknown
			//IL_09da: Unknown result type (might be due to invalid IL or missing references)
			//IL_09df: Unknown result type (might be due to invalid IL or missing references)
			//IL_09ef: Expected O, but got Unknown
			//IL_0ab7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0abc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0acc: Expected O, but got Unknown
			orig.Invoke(args);
			if (!NetworkServer.active)
			{
				return;
			}
			string text = string.Join(" ", args.userArgs).ToLower().Trim();
			NetworkUser sender = args.sender;
			if ((Object)(object)((sender != null) ? sender.master : null) == (Object)null)
			{
				return;
			}
			Inventory inventory = sender.master.inventory;
			if (text == "666")
			{
				List<GenericPickupController> list = InstanceTracker.GetInstancesList<GenericPickupController>().ToList();
				foreach (GenericPickupController item in list)
				{
					if (Object.op_Implicit((Object)(object)item))
					{
						NetworkServer.Destroy(((Component)item).gameObject);
					}
				}
				Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage
				{
					baseToken = "<color=#ff0000>Items Purged.</color>"
				});
				return;
			}
			if (text == "777")
			{
				DistributeItems();
				return;
			}
			if (text.Contains("mountain") || text.Contains("oh hey"))
			{
				if (Object.op_Implicit((Object)(object)TeleporterInteraction.instance))
				{
					TeleporterInteraction.instance.AddShrineStack();
					Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage
					{
						baseToken = "<color=#bd6aff>" + sender.userName + " invoked the mountain!</color>"
					});
				}
				return;
			}
			if (text.Contains("what's in the box"))
			{
				CharacterBody body = sender.master.GetBody();
				if ((Object)(object)body != (Object)null)
				{
					GameObject val = Resources.Load<GameObject>("Prefabs/networkedobjects/chest/GoldChest");
					if ((Object)(object)val != (Object)null)
					{
						Vector3 val2 = ((Component)body).transform.position + ((Component)body).transform.forward * 4f;
						GameObject val3 = Object.Instantiate<GameObject>(val, val2, Quaternion.identity);
						NetworkServer.Spawn(val3);
						Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage
						{
							baseToken = "<color=#ffd700>What's in the box?!</color>"
						});
					}
				}
				return;
			}
			CreatePickupInfo val5;
			switch (text)
			{
			case "iddqd":
				GiveKit(inventory, new string[8] { "Bear", "Aegis", "Medkit", "FlatHealth", "Clover", "ItemDropChanceOnKill", "Knurl", "ShinyPearl" }, 20, "\"We do it wrong, being so majestical,\r\nTo offer it the show of violence,\r\nFor it is as the air, invulnerable,\r\nAnd our vain blows malicious mockery.\"");
				return;
			case "dqddi":
				GiveKit(inventory, new string[8] { "Bear", "Aegis", "Medkit", "FlatHealth", "Clover", "ItemDropChanceOnKill", "Knurl", "ShinyPearl" }, -20, "Alas.");
				return;
			case "idkfa":
				GiveKit(inventory, new string[14]
				{
					"IgniteOnKill", "ChainLightning", "ChainLightning", "Mushroom", "BleedOnHit", "Thorns", "Dagger", "ExplodeOnDeath", "Missile", "BleedOnHit",
					"Behemoth", "Headhunter", "Seed", "MoreMissle"
				}, 20, "idkfa");
				return;
			case "afkdi":
				GiveKit(inventory, new string[14]
				{
					"IgniteOnKill", "ChainLightning", "ChainLightning", "Mushroom", "BleedOnHit", "Thorns", "Dagger", "ExplodeOnDeath", "Missile", "BleedOnHit",
					"Behemoth", "HeadHunter", "Seed", "MoreMissile"
				}, -20, "afkdi");
				return;
			case "idspispopd":
				GiveKit(inventory, new string[11]
				{
					"Syringe", "CritGlasses", "Crowbar", "Missle", "Syringe", "CritGlasses", "CritDamage", "Crowbar", "Missile", "AttackSpeedOnCrit",
					"ExecuteLowHealthElite"
				}, 10, "If you prick us, do we not bleed?");
				return;
			case "idspud":
				GiveKit(inventory, new string[11]
				{
					"Syringe", "CritGlasses", "Crowbar", "Missle", "Syringe", "CritGlasses", "CritDamage", "Crowbar", "Missile", "AttackSpeedOnCrit",
					"ExecuteLowHealthElite"
				}, -10, "Stop bleeding everywhere");
				return;
			case "dpopsipsdi":
				GiveKit(inventory, new string[11]
				{
					"Syringe", "CritGlasses", "Crowbar", "Missle", "Syringe", "CritGlasses", "CritDamage", "Crowbar", "Missile", "AttackSpeedOnCrit",
					"ExecuteLowHealthElite"
				}, -10, "Stop bleeding every where");
				return;
			case "idclip":
				GiveKit(inventory, new string[7] { "SprintBoost", "JumpBoost", "Feather", "StealthOnHeal", "Hoof", "SprintBonus", "SprintOutOfCombat" }, 20, "Clip loaded");
				return;
			case "pilcdi":
				GiveKit(inventory, new string[7] { "SprintBoost", "JumpBoost", "Feather", "StealthOnHeal", "Hoof", "SprintBonus", "SprintOutOfCombat" }, -20, "Clip ejected");
				return;
			case "idfa":
				GiveKit(inventory, new string[19]
				{
					"Bear", "Aegis", "Medkit", "FlatHealth", "Clover", "Gasoline", "Ukulele", "ChainLightning", "Mushroom", "BleedOnHit",
					"Thorns", "Syringe", "CritGlasses", "Crowbar", "Missle", "SprintBoost", "JumpBoost", "Feather", "StealthOnHeal"
				}, 5, "To take arms against a sea of troubles");
				return;
			case "afdi":
				GiveKit(inventory, new string[19]
				{
					"Bear", "Aegis", "Medkit", "FlatHealth", "Clover", "Gasoline", "Ukulele", "ChainLightning", "Mushroom", "BleedOnHit",
					"Thorns", "Syringe", "CritGlasses", "Crowbar", "Missle", "SprintBoost", "JumpBoost", "Feather", "StealthOnHeal"
				}, -5, "And by opposing end them?");
				return;
			case "look around you":
			{
				CharacterBody body2 = sender.master.GetBody();
				if ((Object)(object)body2 != (Object)null)
				{
					EquipmentIndex val4 = EquipmentCatalog.FindEquipmentIndex("Scanner");
					if ((int)val4 != -1)
					{
						PickupIndex pickupIndex = PickupCatalog.FindPickupIndex(val4);
						Vector3 position = ((Component)body2).transform.position + Vector3.up * 2f;
						val5 = default(CreatePickupInfo);
						((CreatePickupInfo)(ref val5)).pickupIndex = pickupIndex;
						val5.position = position;
						val5.rotation = Quaternion.identity;
						val5.prefabOverride = null;
						CreatePickupInfo val6 = val5;
						GenericPickupController.CreatePickup(ref val6);
					}
				}
				return;
			}
			}
			if (text.Contains("cowards die many times") || text.Contains("coward"))
			{
				CharacterBody body3 = sender.master.GetBody();
				if (!((Object)(object)body3 != (Object)null))
				{
					return;
				}
				EquipmentIndex val7 = EquipmentCatalog.FindEquipmentIndex("HealAndRevive");
				if ((int)val7 != -1)
				{
					PickupIndex pickupIndex2 = PickupCatalog.FindPickupIndex(val7);
					Vector3 position2 = ((Component)body3).transform.position + Vector3.up * 2f;
					val5 = default(CreatePickupInfo);
					((CreatePickupInfo)(ref val5)).pickupIndex = pickupIndex2;
					val5.position = position2;
					val5.rotation = Quaternion.identity;
					val5.prefabOverride = null;
					CreatePickupInfo val8 = val5;
					GenericPickupController.CreatePickup(ref val8);
					HealthComponent healthComponent = body3.healthComponent;
					if (healthComponent != null)
					{
						healthComponent.Heal(99999f, default(ProcChainMask), true);
					}
					Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage
					{
						baseToken = "<color=#99ff99>Cowards die many times before their deaths. The valiant never taste of death but once.</color>"
					});
				}
			}
			else if (text == "chauncey, my rancor rifle" || text.Contains("chauncey"))
			{
				if (bossHunterCoroutine != null)
				{
					((MonoBehaviour)this).StopCoroutine(bossHunterCoroutine);
				}
				currentBossHunterUser = sender;
				bossHunterCoroutine = ((MonoBehaviour)this).StartCoroutine(KeepDroppingBossHunters());
				Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage
				{
					baseToken = "<color=#ff6600>Right away, sir. Rancor rifles incoming!</color>"
				});
			}
			else if ((text == "that'll do nicely, chauncey" || text.Contains("enough")) && bossHunterCoroutine != null)
			{
				((MonoBehaviour)this).StopCoroutine(bossHunterCoroutine);
				bossHunterCoroutine = null;
				currentBossHunterUser = null;
				Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage
				{
					baseToken = "<color=#ff6600>Very good, sir.</color>"
				});
			}
		}

		[IteratorStateMachine(typeof(<KeepDroppingBossHunters>d__15))]
		private IEnumerator KeepDroppingBossHunters()
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <KeepDroppingBossHunters>d__15(0)
			{
				<>4__this = this
			};
		}

		private void GiveKit(Inventory inventory, string[] items, int amount, string msg)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Invalid comparison between Unknown and I4
			//IL_0063: 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_0084: Expected O, but got Unknown
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			foreach (string text in items)
			{
				ItemIndex val = ItemCatalog.FindItemIndex(text);
				if ((int)val != -1)
				{
					if (amount > 0)
					{
						inventory.GiveItem(val, amount);
					}
					else
					{
						inventory.RemoveItem(val, inventory.GetItemCount(val));
					}
				}
			}
			if (!string.IsNullOrEmpty(msg))
			{
				Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage
				{
					baseToken = "<color=#ffff00>" + msg + "</color>"
				});
			}
		}

		private void DistributeItems()
		{
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Invalid comparison between Unknown and I4
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Invalid comparison between Unknown and I4
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			List<GenericPickupController> list = InstanceTracker.GetInstancesList<GenericPickupController>().ToList();
			List<CharacterMaster> list2 = (from p in PlayerCharacterMasterController.instances
				where (Object)(object)((p != null) ? p.master : null) != (Object)null
				select p.master).ToList();
			if (list2.Count == 0)
			{
				return;
			}
			for (int i = 0; i < list.Count; i++)
			{
				PickupDef pickupDef = PickupCatalog.GetPickupDef(list[i].pickupIndex);
				CharacterMaster val = list2[i % list2.Count];
				if ((int)pickupDef.itemIndex != -1)
				{
					val.inventory.GiveItem(pickupDef.itemIndex, 1);
				}
				else if ((int)pickupDef.equipmentIndex != -1)
				{
					val.inventory.SetEquipmentIndex(pickupDef.equipmentIndex);
				}
				NetworkServer.Destroy(((Component)list[i]).gameObject);
			}
		}

		private void DropSpecificEquipment(NetworkUser user, string equipName)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Invalid comparison between Unknown and I4
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: 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_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: 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)
			EquipmentIndex val = EquipmentCatalog.FindEquipmentIndex(equipName);
			if ((int)val != -1 && Object.op_Implicit((Object)(object)user.master.GetBody()))
			{
				PickupIndex val2 = PickupCatalog.FindPickupIndex(val);
				PickupDropletController.CreatePickupDroplet(val2, ((Component)user.master.GetBody()).transform.position + Vector3.up * 3f, ((Component)user.master.GetBody()).transform.forward * 10f);
			}
		}

		public void OnDestroy()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: 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
			Chat.CCSay -= new hook_CCSay(Chat_CCSay);
			Stage.Start -= new hook_Start(Stage_Start);
			PickupPickerController.OnInteractionBegin -= new hook_OnInteractionBegin(PickupPickerController_OnInteractionBegin);
		}
	}
}