Decompiled source of Skittering Madness v0.1.6

SkitteringMadness.dll

Decompiled 7 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using Jotunn;
using Jotunn.Configs;
using Jotunn.Entities;
using Jotunn.Managers;
using Jotunn.Utils;
using SpawnThat.Spawners;
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("Wildlife")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Wildlife")]
[assembly: AssemblyCopyright("Copyright ©  2022")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("f247181f-9da0-443a-8cd2-7b38a43a08c5")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace SkitteringMadness;

[BepInPlugin("horemvore.SkitteringMadness", "SkitteringMadness", "0.1.6")]
[BepInIncompatibility("Azumatt.AzuDevMod")]
[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
internal class scorpionBundle : BaseUnityPlugin
{
	public const string PluginGUID = "horemvore.SkitteringMadness";

	public const string PluginName = "SkitteringMadness";

	public const string PluginVersion = "0.1.6";

	public static bool isModded = true;

	public AssetBundle ScorpionBundle;

	public AssetBundle ScorpionLocBundle;

	private CustomLocalization Localization;

	internal static ManualLogSource Log;

	public ConfigEntry<bool> ModEnable;

	public ConfigEntry<bool> LoggingEnable;

	public string[] itemList = new string[28]
	{
		"Scorpion_Attack1_SM", "Scorpion_Attack2_SM", "Scorpion_AttackSting_SM", "ScorpionAL_Attack1_SM", "ScorpionAL_Attack2_SM", "ScorpionAL_AttackSting_SM", "ScorpionDN_Attack1_SM", "ScorpionDN_Attack2_SM", "ScorpionDN_AttackSting_SM", "ScorpionM_Attack1_SM",
		"ScorpionM_Attack2_SM", "ScorpionM_AttackSting_SM", "ScorpionBoss_Attack1_SM", "ScorpionBoss_Attack2_SM", "ScorpionBoss_AttackAoE_SM", "ScorpionBoss_AttackCombo_SM", "ScorpionBoss_AttackSpawn_SM", "ScorpionBoss_AttackSting_SM", "Trophy_ScorpionBlack_SM", "Trophy_ScorpionBlue_SM",
		"Trophy_ScorpionBrown_SM", "Trophy_ScorpionBoss_SM", "Trophy_ScorpionGreen_SM", "Trophy_ScorpionPink_SM", "Trophy_ScorpionPurple_SM", "Trophy_ScorpionRed_SM", "Trophy_ScorpionWhite_SM", "Trophy_ScorpionYellow_SM"
	};

	public string[] prefabList = new string[15]
	{
		"ScorpionBoss_Spawn_SM", "AoE_ScorpionBoss_SM", "VFX_SpawnArrive_SM", "VFX_HitSparks_SM", "VFX_GetHit_SM", "ScorpionBlack_RD_SM", "ScorpionBlue_RD_SM", "ScorpionBoss_RD_SM", "ScorpionBrown_RD_SM", "ScorpionGreen_RD_SM",
		"ScorpionPink_RD_SM", "ScorpionPurple_RD_SM", "ScorpionRed_RD_SM", "ScorpionWhite_RD_SM", "ScorpionYellow_RD_SM"
	};

	public string[] fxList = new string[8] { "FX_Backstab_SM", "FX_Crit_SM", "SFX_BossAttackSpawn_SM", "SFX_ScorpionAlert_SM", "SFX_ScorpionAttack1_SM", "SFX_ScorpionDeath_SM", "SFX_ScorpionHit_SM", "SFX_ScorpionIdle_SM" };

	private void Awake()
	{
		Log = ((BaseUnityPlugin)this).Logger;
		CreateConfigurationValues();
		AddLocalizations();
		LoadBundle();
		AddPrefabs();
		AddSFX();
		CreateItems();
		AddScorpions();
		PrefabManager.OnVanillaPrefabsAvailable += FixSFX;
		try
		{
			SpawnerConfigurationManager.OnConfigure += ConfigureBiomeSpawners;
		}
		catch (Exception value)
		{
			Console.WriteLine(value);
		}
	}

	public void CreateConfigurationValues()
	{
		//IL_002e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Unknown result type (might be due to invalid IL or missing references)
		//IL_003c: Expected O, but got Unknown
		//IL_003c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0046: Expected O, but got Unknown
		//IL_006b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0070: Unknown result type (might be due to invalid IL or missing references)
		//IL_0079: Expected O, but got Unknown
		//IL_0079: Unknown result type (might be due to invalid IL or missing references)
		//IL_0083: Expected O, but got Unknown
		((BaseUnityPlugin)this).Config.SaveOnConfigSet = true;
		ModEnable = ((BaseUnityPlugin)this).Config.Bind<bool>("1 Enable Mod", "Enable", true, new ConfigDescription("Enables the mod", (AcceptableValueBase)null, new object[1] { (object)new ConfigurationManagerAttributes
		{
			IsAdminOnly = true
		} }));
		LoggingEnable = ((BaseUnityPlugin)this).Config.Bind<bool>("99 Logging", "Enable", true, new ConfigDescription("Enables logging.", (AcceptableValueBase)null, new object[1] { (object)new ConfigurationManagerAttributes
		{
			IsAdminOnly = true
		} }));
		SynchronizationManager.OnConfigurationSynchronized += delegate(object obj, ConfigurationSynchronizationEventArgs attr)
		{
			if (attr.InitialSynchronization)
			{
				Logger.LogMessage((object)"Initial Config sync event received for Skittering Madness");
			}
			else
			{
				Logger.LogMessage((object)"Config sync event received for Skittering Madness");
			}
		};
	}

	private void AddLocalizations()
	{
		try
		{
			Localization = LocalizationManager.Instance.GetLocalization();
			CustomLocalization localization = Localization;
			string text = "English";
			localization.AddTranslation(ref text, new Dictionary<string, string>
			{
				{ "item_trophy_scorpionred_sm", "Scorpion" },
				{ "item_trophy_scorpionred_desc_sm", "Animated Trophy of a Scorpion" },
				{ "item_trophy_scorpionbrown_sm", "Scorpion" },
				{ "item_trophy_scorpionbrown_desc_sm", "Animated Trophy of a Scorpion" },
				{ "item_trophy_scorpionblue_sm", "Scorpion" },
				{ "item_trophy_scorpionblue_desc_sm", "Animated Trophy of a Scorpion" },
				{ "item_trophy_scorpiongreen_sm", "Scorpion" },
				{ "item_trophy_scorpiongreen_desc_sm", "Animated Trophy of a Scorpion" },
				{ "item_trophy_scorpionpink_sm", "Scorpion" },
				{ "item_trophy_scorpionpink_desc_sm", "Animated Trophy of a Scorpion" },
				{ "item_trophy_scorpionpurple_sm", "Scorpion" },
				{ "item_trophy_scorpionpurple_desc_sm", "Animated Trophy of a Scorpion" },
				{ "item_trophy_scorpionwhite_sm", "Scorpion" },
				{ "item_trophy_scorpionwhite_desc_sm", "Animated Trophy of a Scorpion" },
				{ "item_trophy_scorpionyellow_sm", "Scorpion" },
				{ "item_trophy_scorpionyellow_desc_sm", "Animated Trophy of a Scorpion" },
				{ "item_trophy_scorpionblack_sm", "Scorpion" },
				{ "item_trophy_scorpionblack_desc_sm", "Animated Trophy of a Scorpion" },
				{ "item_trophy_scorpionboss_sm", "Scorpion" },
				{ "item_trophy_scorpionboss_desc_sm", "Animated Trophy of a Sarkoth" },
				{ "enemy_scorpion_sm", "Scorpion" },
				{ "enemy_scorpionboss_sm", "Sarkoth" }
			});
			CustomLocalization localization2 = Localization;
			text = "Russian";
			localization2.AddTranslation(ref text, new Dictionary<string, string>
			{
				{ "item_trophy_scorpionred_sm", "Скорпион" },
				{ "item_trophy_scorpionred_desc_sm", "Анимированный трофей скорпиона" },
				{ "item_trophy_scorpionbrown_sm", "Скорпион" },
				{ "item_trophy_scorpionbrown_desc_sm", "Анимированный трофей скорпиона" },
				{ "item_trophy_scorpionblue_sm", "Скорпион" },
				{ "item_trophy_scorpionblue_desc_sm", "Анимированный трофей скорпиона" },
				{ "item_trophy_scorpiongreen_sm", "Скорпион" },
				{ "item_trophy_scorpiongreen_desc_sm", "Анимированный трофей скорпиона" },
				{ "item_trophy_scorpionpink_sm", "Скорпион" },
				{ "item_trophy_scorpionpink_desc_sm", "Анимированный трофей скорпиона" },
				{ "item_trophy_scorpionpurple_sm", "Скорпион" },
				{ "item_trophy_scorpionpurple_desc_sm", "Анимированный трофей скорпиона" },
				{ "item_trophy_scorpionwhite_sm", "Скорпион" },
				{ "item_trophy_scorpionwhite_desc_sm", "Анимированный трофей скорпиона" },
				{ "item_trophy_scorpionyellow_sm", "Скорпион" },
				{ "item_trophy_scorpionyellow_desc_sm", "Анимированный трофей скорпиона" },
				{ "item_trophy_scorpionblack_sm", "Скорпион" },
				{ "item_trophy_scorpionblack_desc_sm", "Анимированный трофей скорпиона" },
				{ "item_trophy_scorpionboss_sm", "Скорпион" },
				{ "item_trophy_scorpionboss_desc_sm", "Анимированный трофей Саркота" },
				{ "enemy_scorpion_sm", "Скорпион" },
				{ "enemy_scorpionboss_sm", "Саркот" }
			});
			CustomLocalization localization3 = Localization;
			text = "German";
			localization3.AddTranslation(ref text, new Dictionary<string, string>
			{
				{ "item_trophy_scorpionred_sm", "Skorpion" },
				{ "item_trophy_scorpionred_desc_sm", "Animierte Trophäe eines Skorpions" },
				{ "item_trophy_scorpionbrown_sm", "Skorpion" },
				{ "item_trophy_scorpionbrown_desc_sm", "Animierte Trophäe eines Skorpions" },
				{ "item_trophy_scorpionblue_sm", "Skorpion" },
				{ "item_trophy_scorpionblue_desc_sm", "Animierte Trophäe eines Skorpions" },
				{ "item_trophy_scorpiongreen_sm", "Skorpion" },
				{ "item_trophy_scorpiongreen_desc_sm", "Animierte Trophäe eines Skorpions" },
				{ "item_trophy_scorpionpink_sm", "Skorpion" },
				{ "item_trophy_scorpionpink_desc_sm", "Animierte Trophäe eines Skorpions" },
				{ "item_trophy_scorpionpurple_sm", "Skorpion" },
				{ "item_trophy_scorpionpurple_desc_sm", "Animierte Trophäe eines Skorpions" },
				{ "item_trophy_scorpionwhite_sm", "Skorpion" },
				{ "item_trophy_scorpionwhite_desc_sm", "Animierte Trophäe eines Skorpions" },
				{ "item_trophy_scorpionyellow_sm", "Skorpion" },
				{ "item_trophy_scorpionyellow_desc_sm", "Animierte Trophäe eines Skorpions" },
				{ "item_trophy_scorpionblack_sm", "Skorpion" },
				{ "item_trophy_scorpionblack_desc_sm", "Animierte Trophäe eines Skorpions" },
				{ "item_trophy_scorpionboss_sm", "Skorpion" },
				{ "item_trophy_scorpionboss_desc_sm", "Animierte Trophäe eines Sarkoth" },
				{ "enemy_scorpion_sm", "Skorpion" },
				{ "enemy_scorpionboss_sm", "Sarkoth" }
			});
			CustomLocalization localization4 = Localization;
			text = "Turkish";
			localization4.AddTranslation(ref text, new Dictionary<string, string>
			{
				{ "item_trophy_scorpionred_sm", "Akrep" },
				{ "item_trophy_scorpionred_desc_sm", "Bir Akrep Animasyonlu Trophy" },
				{ "item_trophy_scorpionbrown_sm", "Akrep" },
				{ "item_trophy_scorpionbrown_desc_sm", "Bir Akrep Animasyonlu Trophy" },
				{ "item_trophy_scorpionblue_sm", "Akrep" },
				{ "item_trophy_scorpionblue_desc_sm", "Bir Akrep Animasyonlu Trophy" },
				{ "item_trophy_scorpiongreen_sm", "Akrep" },
				{ "item_trophy_scorpiongreen_desc_sm", "Bir Akrep Animasyonlu Trophy" },
				{ "item_trophy_scorpionpink_sm", "Akrep" },
				{ "item_trophy_scorpionpink_desc_sm", "Bir Akrep Animasyonlu Trophy" },
				{ "item_trophy_scorpionpurple_sm", "Akrep" },
				{ "item_trophy_scorpionpurple_desc_sm", "Bir Akrep Animasyonlu Trophy" },
				{ "item_trophy_scorpionwhite_sm", "Akrep" },
				{ "item_trophy_scorpionwhite_desc_sm", "Bir Akrep Animasyonlu Trophy" },
				{ "item_trophy_scorpionyellow_sm", "Akrep" },
				{ "item_trophy_scorpionyellow_desc_sm", "Bir Akrep Animasyonlu Trophy" },
				{ "item_trophy_scorpionblack_sm", "Akrep" },
				{ "item_trophy_scorpionblack_desc_sm", "Bir Akrep Animasyonlu Trophy" },
				{ "item_trophy_scorpionboss_sm", "Akrep" },
				{ "item_trophy_scorpionboss_desc_sm", "Bir Sarkoth Animasyonlu Trophy" },
				{ "enemy_scorpion_sm", "Akrep" },
				{ "enemy_scorpionboss_sm", "Sarkoth" }
			});
		}
		catch (Exception arg)
		{
			((BaseUnityPlugin)this).Logger.LogWarning((object)$"Exception caught while adding Localication for Deds Army: {arg}");
		}
	}

	public void LoadBundle()
	{
		ScorpionBundle = AssetUtils.LoadAssetBundleFromResources("scorpions", Assembly.GetExecutingAssembly());
	}

	private void AddPrefabs()
	{
		//IL_0041: Unknown result type (might be due to invalid IL or missing references)
		//IL_0048: Expected O, but got Unknown
		try
		{
			string[] array = prefabList;
			foreach (string text in array)
			{
				GameObject prefab = PrefabManager.Instance.GetPrefab(text);
				if ((Object)(object)prefab == (Object)null)
				{
					GameObject val = ScorpionBundle.LoadAsset<GameObject>(text);
					CustomPrefab val2 = new CustomPrefab(val, true);
					PrefabManager.Instance.AddPrefab(val2);
					if (LoggingEnable.Value)
					{
						((BaseUnityPlugin)this).Logger.LogMessage((object)("Added: " + text + " to the Object database"));
					}
				}
				else if (LoggingEnable.Value)
				{
					((BaseUnityPlugin)this).Logger.LogMessage((object)("Failed to add: " + text + " to the Object database, this is due to it already been added by another mod"));
				}
			}
		}
		catch (Exception arg)
		{
			((BaseUnityPlugin)this).Logger.LogWarning((object)$"Exception caught while adding Prefabs: {arg}");
		}
	}

	private void AddSFX()
	{
		//IL_0041: Unknown result type (might be due to invalid IL or missing references)
		//IL_0048: Expected O, but got Unknown
		try
		{
			string[] array = fxList;
			foreach (string text in array)
			{
				GameObject prefab = PrefabManager.Instance.GetPrefab(text);
				if ((Object)(object)prefab == (Object)null)
				{
					GameObject val = ScorpionBundle.LoadAsset<GameObject>(text);
					CustomPrefab val2 = new CustomPrefab(val, false);
					PrefabManager.Instance.AddPrefab(val2);
					if (LoggingEnable.Value)
					{
						((BaseUnityPlugin)this).Logger.LogMessage((object)("Added: " + text + " to the Object database"));
					}
				}
				else if (LoggingEnable.Value)
				{
					((BaseUnityPlugin)this).Logger.LogMessage((object)("Failed to add: " + text + " to the Object database, this is due to it already been added by another mod"));
				}
			}
		}
		catch (Exception arg)
		{
			((BaseUnityPlugin)this).Logger.LogWarning((object)$"Exception caught while adding fx prefabs: {arg}");
		}
	}

	private void CreateItems()
	{
		//IL_0041: Unknown result type (might be due to invalid IL or missing references)
		//IL_0048: Expected O, but got Unknown
		try
		{
			string[] array = itemList;
			foreach (string text in array)
			{
				GameObject prefab = PrefabManager.Instance.GetPrefab(text);
				if ((Object)(object)prefab == (Object)null)
				{
					GameObject val = ScorpionBundle.LoadAsset<GameObject>(text);
					CustomItem val2 = new CustomItem(val, true);
					ItemManager.Instance.AddItem(val2);
					if (LoggingEnable.Value)
					{
						((BaseUnityPlugin)this).Logger.LogMessage((object)("Added: " + text + " to the Item database"));
					}
				}
				else if (LoggingEnable.Value)
				{
					((BaseUnityPlugin)this).Logger.LogMessage((object)("Failed to add: " + text + " to the Item database, this is due to it already been added by another mod"));
				}
			}
		}
		catch (Exception arg)
		{
			((BaseUnityPlugin)this).Logger.LogWarning((object)$"Exception caught while adding class items: {arg}");
		}
	}

	private void AddScorpions()
	{
		//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bb: Expected O, but got Unknown
		//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00df: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f5: Expected O, but got Unknown
		//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0108: Unknown result type (might be due to invalid IL or missing references)
		//IL_0110: Unknown result type (might be due to invalid IL or missing references)
		//IL_0118: Unknown result type (might be due to invalid IL or missing references)
		//IL_0125: Expected O, but got Unknown
		//IL_012c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0133: Expected O, but got Unknown
		//IL_0142: Unknown result type (might be due to invalid IL or missing references)
		//IL_0149: Expected O, but got Unknown
		//IL_0153: Unknown result type (might be due to invalid IL or missing references)
		//IL_0158: Unknown result type (might be due to invalid IL or missing references)
		//IL_0164: Unknown result type (might be due to invalid IL or missing references)
		//IL_016d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0176: Unknown result type (might be due to invalid IL or missing references)
		//IL_0183: Expected O, but got Unknown
		//IL_0185: Unknown result type (might be due to invalid IL or missing references)
		//IL_018a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0196: Unknown result type (might be due to invalid IL or missing references)
		//IL_019e: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b3: Expected O, but got Unknown
		//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c1: Expected O, but got Unknown
		//IL_01d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d7: Expected O, but got Unknown
		//IL_01e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e6: 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_01fb: 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_0211: Expected O, but got Unknown
		//IL_0213: Unknown result type (might be due to invalid IL or missing references)
		//IL_0218: Unknown result type (might be due to invalid IL or missing references)
		//IL_0224: Unknown result type (might be due to invalid IL or missing references)
		//IL_022c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0234: Unknown result type (might be due to invalid IL or missing references)
		//IL_0241: Expected O, but got Unknown
		//IL_0248: Unknown result type (might be due to invalid IL or missing references)
		//IL_024f: Expected O, but got Unknown
		//IL_025e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0265: Expected O, but got Unknown
		//IL_026f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0274: Unknown result type (might be due to invalid IL or missing references)
		//IL_0280: Unknown result type (might be due to invalid IL or missing references)
		//IL_0289: Unknown result type (might be due to invalid IL or missing references)
		//IL_0292: Unknown result type (might be due to invalid IL or missing references)
		//IL_029f: Expected O, but got Unknown
		//IL_02a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_02cf: Expected O, but got Unknown
		//IL_02d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_02dd: Expected O, but got Unknown
		//IL_02ed: Unknown result type (might be due to invalid IL or missing references)
		//IL_02f4: Expected O, but got Unknown
		//IL_02fe: Unknown result type (might be due to invalid IL or missing references)
		//IL_0303: Unknown result type (might be due to invalid IL or missing references)
		//IL_030f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0318: Unknown result type (might be due to invalid IL or missing references)
		//IL_0321: Unknown result type (might be due to invalid IL or missing references)
		//IL_032e: Expected O, but got Unknown
		//IL_0330: Unknown result type (might be due to invalid IL or missing references)
		//IL_0335: Unknown result type (might be due to invalid IL or missing references)
		//IL_0341: Unknown result type (might be due to invalid IL or missing references)
		//IL_0349: Unknown result type (might be due to invalid IL or missing references)
		//IL_0351: Unknown result type (might be due to invalid IL or missing references)
		//IL_035e: Expected O, but got Unknown
		//IL_0365: Unknown result type (might be due to invalid IL or missing references)
		//IL_036c: Expected O, but got Unknown
		//IL_037c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0383: Expected O, but got Unknown
		//IL_038d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0392: Unknown result type (might be due to invalid IL or missing references)
		//IL_039e: Unknown result type (might be due to invalid IL or missing references)
		//IL_03a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_03b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_03bd: Expected O, but got Unknown
		//IL_03bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_03c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_03d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_03d8: Unknown result type (might be due to invalid IL or missing references)
		//IL_03e0: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ed: Expected O, but got Unknown
		//IL_03f4: Unknown result type (might be due to invalid IL or missing references)
		//IL_03fb: Expected O, but got Unknown
		//IL_040b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0412: Expected O, but got Unknown
		//IL_041c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0421: Unknown result type (might be due to invalid IL or missing references)
		//IL_042d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0436: Unknown result type (might be due to invalid IL or missing references)
		//IL_043f: Unknown result type (might be due to invalid IL or missing references)
		//IL_044c: Expected O, but got Unknown
		//IL_044e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0453: Unknown result type (might be due to invalid IL or missing references)
		//IL_045f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0467: Unknown result type (might be due to invalid IL or missing references)
		//IL_046f: Unknown result type (might be due to invalid IL or missing references)
		//IL_047c: Expected O, but got Unknown
		//IL_0483: Unknown result type (might be due to invalid IL or missing references)
		//IL_048a: Expected O, but got Unknown
		//IL_049a: Unknown result type (might be due to invalid IL or missing references)
		//IL_04a1: Expected O, but got Unknown
		//IL_04ab: Unknown result type (might be due to invalid IL or missing references)
		//IL_04b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_04bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_04c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_04ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_04db: Expected O, but got Unknown
		//IL_04dd: Unknown result type (might be due to invalid IL or missing references)
		//IL_04e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_04ee: Unknown result type (might be due to invalid IL or missing references)
		//IL_04f6: Unknown result type (might be due to invalid IL or missing references)
		//IL_04fe: Unknown result type (might be due to invalid IL or missing references)
		//IL_050b: Expected O, but got Unknown
		//IL_0512: Unknown result type (might be due to invalid IL or missing references)
		//IL_0519: Expected O, but got Unknown
		//IL_0529: Unknown result type (might be due to invalid IL or missing references)
		//IL_0530: Expected O, but got Unknown
		//IL_053a: Unknown result type (might be due to invalid IL or missing references)
		//IL_053f: Unknown result type (might be due to invalid IL or missing references)
		//IL_054b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0554: Unknown result type (might be due to invalid IL or missing references)
		//IL_055d: Unknown result type (might be due to invalid IL or missing references)
		//IL_056a: Expected O, but got Unknown
		//IL_056c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0571: Unknown result type (might be due to invalid IL or missing references)
		//IL_057d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0585: Unknown result type (might be due to invalid IL or missing references)
		//IL_058d: Unknown result type (might be due to invalid IL or missing references)
		//IL_059a: Expected O, but got Unknown
		//IL_05a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_05a8: Expected O, but got Unknown
		//IL_05b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_05bf: Expected O, but got Unknown
		//IL_05c9: Unknown result type (might be due to invalid IL or missing references)
		//IL_05ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_05da: Unknown result type (might be due to invalid IL or missing references)
		//IL_05e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_05ec: Unknown result type (might be due to invalid IL or missing references)
		//IL_05f9: Expected O, but got Unknown
		//IL_05fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0600: Unknown result type (might be due to invalid IL or missing references)
		//IL_060c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0614: Unknown result type (might be due to invalid IL or missing references)
		//IL_061c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0629: Expected O, but got Unknown
		//IL_0630: Unknown result type (might be due to invalid IL or missing references)
		//IL_0637: Expected O, but got Unknown
		try
		{
			GameObject val = ScorpionBundle.LoadAsset<GameObject>("ScorpionBlack_SM");
			GameObject val2 = ScorpionBundle.LoadAsset<GameObject>("ScorpionBlue_SM");
			GameObject val3 = ScorpionBundle.LoadAsset<GameObject>("ScorpionBrown_SM");
			GameObject val4 = ScorpionBundle.LoadAsset<GameObject>("ScorpionGreen_SM");
			GameObject val5 = ScorpionBundle.LoadAsset<GameObject>("ScorpionPink_SM");
			GameObject val6 = ScorpionBundle.LoadAsset<GameObject>("ScorpionPurple_SM");
			GameObject val7 = ScorpionBundle.LoadAsset<GameObject>("ScorpionRed_SM");
			GameObject val8 = ScorpionBundle.LoadAsset<GameObject>("ScorpionWhite_SM");
			GameObject val9 = ScorpionBundle.LoadAsset<GameObject>("ScorpionYellow_SM");
			GameObject val10 = ScorpionBundle.LoadAsset<GameObject>("ScorpionBoss_SM");
			CreatureConfig val11 = new CreatureConfig();
			val11.DropConfigs = (DropConfig[])(object)new DropConfig[2]
			{
				new DropConfig
				{
					Item = "Coins",
					MinAmount = 17,
					MaxAmount = 34,
					Chance = 100f
				},
				new DropConfig
				{
					Item = "Trophy_ScorpionBlack_SM",
					MinAmount = 1,
					MaxAmount = 1,
					Chance = 2f
				}
			};
			CustomCreature val12 = new CustomCreature(val, true, val11);
			CreatureManager.Instance.AddCreature(val12);
			val11 = new CreatureConfig();
			val11.DropConfigs = (DropConfig[])(object)new DropConfig[2]
			{
				new DropConfig
				{
					Item = "Coins",
					MinAmount = 17,
					MaxAmount = 34,
					Chance = 100f
				},
				new DropConfig
				{
					Item = "Trophy_ScorpionBlue_SM",
					MinAmount = 1,
					MaxAmount = 1,
					Chance = 2f
				}
			};
			CustomCreature val13 = new CustomCreature(val2, true, val11);
			CreatureManager.Instance.AddCreature(val13);
			val11 = new CreatureConfig();
			val11.DropConfigs = (DropConfig[])(object)new DropConfig[2]
			{
				new DropConfig
				{
					Item = "Coins",
					MinAmount = 17,
					MaxAmount = 34,
					Chance = 100f
				},
				new DropConfig
				{
					Item = "Trophy_ScorpionBrown_SM",
					MinAmount = 1,
					MaxAmount = 1,
					Chance = 2f
				}
			};
			CustomCreature val14 = new CustomCreature(val3, true, val11);
			CreatureManager.Instance.AddCreature(val14);
			val11 = new CreatureConfig();
			val11.DropConfigs = (DropConfig[])(object)new DropConfig[2]
			{
				new DropConfig
				{
					Item = "Coins",
					MinAmount = 17,
					MaxAmount = 34,
					Chance = 100f
				},
				new DropConfig
				{
					Item = "Trophy_ScorpionGreen_SM",
					MinAmount = 1,
					MaxAmount = 1,
					Chance = 2f
				}
			};
			CustomCreature val15 = new CustomCreature(val4, true, val11);
			CreatureManager.Instance.AddCreature(val15);
			val11 = new CreatureConfig();
			val11.DropConfigs = (DropConfig[])(object)new DropConfig[2]
			{
				new DropConfig
				{
					Item = "Coins",
					MinAmount = 17,
					MaxAmount = 34,
					Chance = 100f
				},
				new DropConfig
				{
					Item = "Trophy_ScorpionPink_SM",
					MinAmount = 1,
					MaxAmount = 1,
					Chance = 2f
				}
			};
			CustomCreature val16 = new CustomCreature(val5, true, val11);
			CreatureManager.Instance.AddCreature(val16);
			val11 = new CreatureConfig();
			val11.DropConfigs = (DropConfig[])(object)new DropConfig[2]
			{
				new DropConfig
				{
					Item = "Coins",
					MinAmount = 17,
					MaxAmount = 34,
					Chance = 100f
				},
				new DropConfig
				{
					Item = "Trophy_ScorpionPurple_SM",
					MinAmount = 1,
					MaxAmount = 1,
					Chance = 2f
				}
			};
			CustomCreature val17 = new CustomCreature(val6, true, val11);
			CreatureManager.Instance.AddCreature(val17);
			val11 = new CreatureConfig();
			val11.DropConfigs = (DropConfig[])(object)new DropConfig[2]
			{
				new DropConfig
				{
					Item = "Coins",
					MinAmount = 17,
					MaxAmount = 34,
					Chance = 100f
				},
				new DropConfig
				{
					Item = "Trophy_ScorpionRed_SM",
					MinAmount = 1,
					MaxAmount = 1,
					Chance = 2f
				}
			};
			CustomCreature val18 = new CustomCreature(val7, true, val11);
			CreatureManager.Instance.AddCreature(val18);
			val11 = new CreatureConfig();
			val11.DropConfigs = (DropConfig[])(object)new DropConfig[2]
			{
				new DropConfig
				{
					Item = "Coins",
					MinAmount = 17,
					MaxAmount = 34,
					Chance = 100f
				},
				new DropConfig
				{
					Item = "Trophy_ScorpionWhite_SM",
					MinAmount = 1,
					MaxAmount = 1,
					Chance = 2f
				}
			};
			CustomCreature val19 = new CustomCreature(val8, true, val11);
			CreatureManager.Instance.AddCreature(val19);
			val11 = new CreatureConfig();
			val11.DropConfigs = (DropConfig[])(object)new DropConfig[2]
			{
				new DropConfig
				{
					Item = "Coins",
					MinAmount = 17,
					MaxAmount = 34,
					Chance = 100f
				},
				new DropConfig
				{
					Item = "Trophy_ScorpionYellow_SM",
					MinAmount = 1,
					MaxAmount = 1,
					Chance = 2f
				}
			};
			CustomCreature val20 = new CustomCreature(val9, true, val11);
			CreatureManager.Instance.AddCreature(val20);
			val11 = new CreatureConfig();
			val11.DropConfigs = (DropConfig[])(object)new DropConfig[2]
			{
				new DropConfig
				{
					Item = "Coins",
					MinAmount = 17,
					MaxAmount = 34,
					Chance = 100f
				},
				new DropConfig
				{
					Item = "Trophy_ScorpionBoss_SM",
					MinAmount = 1,
					MaxAmount = 1,
					Chance = 25f
				}
			};
			CustomCreature val21 = new CustomCreature(val10, true, val11);
			CreatureManager.Instance.AddCreature(val21);
		}
		catch (Exception arg)
		{
			((BaseUnityPlugin)this).Logger.LogWarning((object)$"Exception caught while adding Skittering Madness creatures: {arg}");
		}
	}

	private void AddLocations()
	{
		//IL_0039: Unknown result type (might be due to invalid IL or missing references)
		//IL_003e: Unknown result type (might be due to invalid IL or missing references)
		//IL_004a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0052: 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_0066: Unknown result type (might be due to invalid IL or missing references)
		//IL_0072: Unknown result type (might be due to invalid IL or missing references)
		//IL_007a: Unknown result type (might be due to invalid IL or missing references)
		//IL_008b: Expected O, but got Unknown
		//IL_0086: Unknown result type (might be due to invalid IL or missing references)
		//IL_0090: Expected O, but got Unknown
		ScorpionLocBundle = AssetUtils.LoadAssetBundleFromResources("scorpionsloc", Assembly.GetExecutingAssembly());
		try
		{
			GameObject val = ZoneManager.Instance.CreateLocationContainer(ScorpionLocBundle.LoadAsset<GameObject>("Loc_ScorpionBoss_SM"));
			ZoneManager.Instance.AddCustomLocation(new CustomLocation(val, true, new LocationConfig
			{
				Biome = (Biome)512,
				Quantity = 4,
				Priotized = true,
				ExteriorRadius = 12f,
				MinAltitude = 2f,
				ClearArea = true,
				MinDistanceFromSimilar = 1000f
			}));
		}
		catch (Exception arg)
		{
			((BaseUnityPlugin)this).Logger.LogWarning((object)$"Exception caught while adding Skittering Madness Locations: {arg}");
		}
		finally
		{
			ScorpionLocBundle.Unload(false);
		}
	}

	private void AddSpawners()
	{
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		//IL_001b: Expected O, but got Unknown
		try
		{
			GameObject val = ScorpionBundle.LoadAsset<GameObject>("Spawner_Scorpion_SM");
			CustomPrefab val2 = new CustomPrefab(val, false);
			PrefabManager.Instance.AddPrefab(val2);
		}
		catch (Exception arg)
		{
			((BaseUnityPlugin)this).Logger.LogWarning((object)$"Exception caught while adding Skittering Madness spawner prefabs: {arg}");
		}
	}

	private void FixSFX()
	{
		try
		{
			AudioSource prefab = Cache.GetPrefab<AudioSource>("sfx_arrow_hit");
			GameObject prefab2 = Cache.GetPrefab<GameObject>("SFX_ScorpionAlert_SM");
			GameObject prefab3 = Cache.GetPrefab<GameObject>("SFX_ScorpionAttack1_SM");
			GameObject prefab4 = Cache.GetPrefab<GameObject>("SFX_ScorpionDeath_SM");
			GameObject prefab5 = Cache.GetPrefab<GameObject>("SFX_ScorpionHit_SM");
			GameObject prefab6 = Cache.GetPrefab<GameObject>("SFX_ScorpionIdle_SM");
			GameObject prefab7 = Cache.GetPrefab<GameObject>("SFX_BossAttackSpawn_SM");
			if ((Object)(object)prefab2 != (Object)null)
			{
				prefab2.GetComponent<AudioSource>().outputAudioMixerGroup = prefab.outputAudioMixerGroup;
			}
			if ((Object)(object)prefab3 != (Object)null)
			{
				prefab3.GetComponent<AudioSource>().outputAudioMixerGroup = prefab.outputAudioMixerGroup;
			}
			if ((Object)(object)prefab4 != (Object)null)
			{
				prefab4.GetComponent<AudioSource>().outputAudioMixerGroup = prefab.outputAudioMixerGroup;
			}
			if ((Object)(object)prefab5 != (Object)null)
			{
				prefab5.GetComponent<AudioSource>().outputAudioMixerGroup = prefab.outputAudioMixerGroup;
			}
			if ((Object)(object)prefab6 != (Object)null)
			{
				prefab6.GetComponent<AudioSource>().outputAudioMixerGroup = prefab.outputAudioMixerGroup;
			}
			if ((Object)(object)prefab7 != (Object)null)
			{
				prefab7.GetComponent<AudioSource>().outputAudioMixerGroup = prefab.outputAudioMixerGroup;
			}
		}
		catch
		{
			Debug.LogWarning((object)"Naga Tribes: SFX Fix Failed");
		}
	}

	public static void ConfigureBiomeSpawners(ISpawnerConfigurationCollection config)
	{
		try
		{
			ConfigureWorldSpawner(config);
		}
		catch (Exception ex)
		{
			Console.WriteLine("Something went horribly wrong adding spawners for There Be Orcs: " + ex.Message + "\nStackTrace:\n" + ex.StackTrace);
		}
	}

	private static void ConfigureWorldSpawner(ISpawnerConfigurationCollection config)
	{
		try
		{
			ISpawnerConfigurationCollectionWorldSpawnerExtensions.ConfigureWorldSpawner(config, 26709u).SetPrefabName("ScorpionRed_SM").SetTemplateName("Red Scorpion")
				.SetConditionBiomes((Biome[])(object)new Biome[1] { (Biome)1 })
				.SetSpawnChance(18f)
				.SetSpawnInterval(TimeSpan.FromSeconds(300.0))
				.SetPackSizeMin(1u)
				.SetPackSizeMax(2u)
				.SetMaxSpawned(1u)
				.SetConditionAltitudeMin(1f)
				.SetConditionRequiredGlobalKey("defeated_goblinking");
			ISpawnerConfigurationCollectionWorldSpawnerExtensions.ConfigureWorldSpawner(config, 26708u).SetPrefabName("ScorpionBrown_SM").SetTemplateName("Brown Scorpion")
				.SetConditionBiomes((Biome[])(object)new Biome[1] { (Biome)8 })
				.SetSpawnChance(18f)
				.SetSpawnInterval(TimeSpan.FromSeconds(300.0))
				.SetPackSizeMin(1u)
				.SetPackSizeMax(2u)
				.SetMaxSpawned(1u)
				.SetConditionAltitudeMin(1f)
				.SetConditionRequiredGlobalKey("killed_scorpionred");
			ISpawnerConfigurationCollectionWorldSpawnerExtensions.ConfigureWorldSpawner(config, 26707u).SetPrefabName("ScorpionGreen_SM").SetTemplateName("Green Scorpion")
				.SetConditionBiomes((Biome[])(object)new Biome[1] { (Biome)2 })
				.SetSpawnChance(18f)
				.SetSpawnInterval(TimeSpan.FromSeconds(300.0))
				.SetPackSizeMin(1u)
				.SetPackSizeMax(2u)
				.SetMaxSpawned(1u)
				.SetConditionAltitudeMin(1f)
				.SetConditionRequiredGlobalKey("killed_scorpionbrown");
			ISpawnerConfigurationCollectionWorldSpawnerExtensions.ConfigureWorldSpawner(config, 26706u).SetPrefabName("ScorpionBlue_SM").SetTemplateName("Blue Scorpion")
				.SetConditionBiomes((Biome[])(object)new Biome[1] { (Biome)4 })
				.SetSpawnChance(18f)
				.SetSpawnInterval(TimeSpan.FromSeconds(300.0))
				.SetPackSizeMin(1u)
				.SetPackSizeMax(2u)
				.SetMaxSpawned(1u)
				.SetConditionAltitudeMin(1f)
				.SetConditionRequiredGlobalKey("killed_scorpiongreen");
			ISpawnerConfigurationCollectionWorldSpawnerExtensions.ConfigureWorldSpawner(config, 26705u).SetPrefabName("ScorpionPink_SM").SetTemplateName("Pink Scorpion")
				.SetConditionBiomes((Biome[])(object)new Biome[1] { (Biome)16 })
				.SetSpawnChance(18f)
				.SetSpawnInterval(TimeSpan.FromSeconds(300.0))
				.SetPackSizeMin(1u)
				.SetPackSizeMax(2u)
				.SetMaxSpawned(1u)
				.SetConditionAltitudeMin(1f)
				.SetConditionRequiredGlobalKey("killed_scorpionblue");
			ISpawnerConfigurationCollectionWorldSpawnerExtensions.ConfigureWorldSpawner(config, 26704u).SetPrefabName("ScorpionPurple_SM").SetTemplateName("Purple Scorpion")
				.SetConditionBiomes((Biome[])(object)new Biome[1] { (Biome)16 })
				.SetSpawnChance(18f)
				.SetSpawnInterval(TimeSpan.FromSeconds(300.0))
				.SetPackSizeMin(1u)
				.SetPackSizeMax(2u)
				.SetMaxSpawned(1u)
				.SetConditionAltitudeMin(1f)
				.SetConditionRequiredGlobalKey("killed_scorpionpink");
			ISpawnerConfigurationCollectionWorldSpawnerExtensions.ConfigureWorldSpawner(config, 26703u).SetPrefabName("ScorpionYellow_SM").SetTemplateName("Yellow Scorpion")
				.SetConditionBiomes((Biome[])(object)new Biome[1] { (Biome)512 })
				.SetSpawnChance(18f)
				.SetSpawnInterval(TimeSpan.FromSeconds(300.0))
				.SetPackSizeMin(1u)
				.SetPackSizeMax(2u)
				.SetMaxSpawned(1u)
				.SetConditionAltitudeMin(1f)
				.SetConditionRequiredGlobalKey("killed_scorpionpurple");
			ISpawnerConfigurationCollectionWorldSpawnerExtensions.ConfigureWorldSpawner(config, 26702u).SetPrefabName("ScorpionWhite_SM").SetTemplateName("White Scorpion")
				.SetConditionBiomes((Biome[])(object)new Biome[1] { (Biome)64 })
				.SetSpawnChance(18f)
				.SetSpawnInterval(TimeSpan.FromSeconds(300.0))
				.SetPackSizeMin(1u)
				.SetPackSizeMax(2u)
				.SetMaxSpawned(1u)
				.SetConditionAltitudeMin(1f)
				.SetConditionRequiredGlobalKey("killed_scorpionyellow");
			ISpawnerConfigurationCollectionWorldSpawnerExtensions.ConfigureWorldSpawner(config, 26701u).SetPrefabName("ScorpionBlack_SM").SetTemplateName("Black Scorpion")
				.SetConditionBiomes((Biome[])(object)new Biome[1] { (Biome)32 })
				.SetSpawnChance(18f)
				.SetSpawnInterval(TimeSpan.FromSeconds(300.0))
				.SetPackSizeMin(1u)
				.SetPackSizeMax(2u)
				.SetMaxSpawned(1u)
				.SetConditionAltitudeMin(1f)
				.SetConditionRequiredGlobalKey("killed_scorpionwhite");
			ISpawnerConfigurationCollectionWorldSpawnerExtensions.ConfigureWorldSpawner(config, 26700u).SetPrefabName("ScorpionBoss_SM").SetTemplateName("Sarkoth")
				.SetConditionBiomes((Biome[])(object)new Biome[1] { (Biome)32 })
				.SetSpawnChance(100f)
				.SetSpawnInterval(TimeSpan.FromSeconds(14400.0))
				.SetPackSizeMin(1u)
				.SetPackSizeMax(1u)
				.SetMaxSpawned(1u)
				.SetConditionAltitudeMin(1f)
				.SetMinDistanceToOther(1250f)
				.SetConditionRequiredGlobalKey("killed_scorpionblack");
		}
		catch (Exception ex)
		{
			Log.LogError((object)ex);
		}
	}
}