Decompiled source of RenegadeVikings v1.2.4

RenegadeVikings.dll

Decompiled 5 months ago
using System;
using System.Collections;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using JetBrains.Annotations;
using LocalizationManager;
using Microsoft.CodeAnalysis;
using RenegadeVikings.Functions;
using RenegadeVikings.Utilities;
using RenegadeVikings.VikingsData;
using ServerSync;
using TMPro;
using UnityEngine;
using UnityEngine.SceneManagement;
using YamlDotNet.Core;
using YamlDotNet.Core.Events;
using YamlDotNet.Core.Tokens;
using YamlDotNet.Helpers;
using YamlDotNet.Serialization;
using YamlDotNet.Serialization.BufferedDeserialization;
using YamlDotNet.Serialization.BufferedDeserialization.TypeDiscriminators;
using YamlDotNet.Serialization.Converters;
using YamlDotNet.Serialization.EventEmitters;
using YamlDotNet.Serialization.NamingConventions;
using YamlDotNet.Serialization.NodeDeserializers;
using YamlDotNet.Serialization.NodeTypeResolvers;
using YamlDotNet.Serialization.ObjectFactories;
using YamlDotNet.Serialization.ObjectGraphTraversalStrategies;
using YamlDotNet.Serialization.ObjectGraphVisitors;
using YamlDotNet.Serialization.Schemas;
using YamlDotNet.Serialization.TypeInspectors;
using YamlDotNet.Serialization.TypeResolvers;
using YamlDotNet.Serialization.Utilities;
using YamlDotNet.Serialization.ValueDeserializers;

[assembly: AssemblyFileVersion("1.2.4")]
[assembly: Guid("6DEB4E9C-1075-4C09-89F4-459880552C76")]
[assembly: ComVisible(false)]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyProduct("RenegadeVikings")]
[assembly: AssemblyCompany("blacks7ar")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyDescription("https://valheim.thunderstore.io/package/blacks7ar/RenegadeVikings/")]
[assembly: AssemblyTitle("RenegadeVikings")]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: CompilationRelaxations(8)]
[assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.2.4.0")]
[module: UnverifiableCode]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[<1c736a20-88a4-4158-9c66-2a4f445c31ef>Embedded]
	internal sealed class <1c736a20-88a4-4158-9c66-2a4f445c31ef>EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[<1c736a20-88a4-4158-9c66-2a4f445c31ef>Embedded]
	[CompilerGenerated]
	internal sealed class <76dbb81f-c00a-4805-bc46-3830935429da>IsReadOnlyAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	[<1c736a20-88a4-4158-9c66-2a4f445c31ef>Embedded]
	[CompilerGenerated]
	internal sealed class <1a5d10c7-97f0-4e8f-893a-64496abdd20d>NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public <1a5d10c7-97f0-4e8f-893a-64496abdd20d>NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public <1a5d10c7-97f0-4e8f-893a-64496abdd20d>NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[<1c736a20-88a4-4158-9c66-2a4f445c31ef>Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	[CompilerGenerated]
	internal sealed class <b321a511-462b-4050-8e68-e58ed19a8747>NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public <b321a511-462b-4050-8e68-e58ed19a8747>NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
}
namespace LocalizationManager
{
	[PublicAPI]
	public class Localizer
	{
		private static readonly Dictionary<string, Dictionary<string, Func<string>>> PlaceholderProcessors;

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

		private static readonly ConditionalWeakTable<Localization, string> localizationLanguage;

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

		[<1a5d10c7-97f0-4e8f-893a-64496abdd20d>Nullable(2)]
		private static BaseUnityPlugin _plugin;

		private static readonly List<string> fileExtensions;

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

		private static void UpdatePlaceholderText(Localization localization, string key)
		{
			localizationLanguage.TryGetValue(localization, out var value);
			string text = loadedTexts[value][key];
			if (PlaceholderProcessors.TryGetValue(key, out var value2))
			{
				text = value2.Aggregate(text, (string current, KeyValuePair<string, Func<string>> kv) => current.Replace("{" + kv.Key + "}", kv.Value()));
			}
			localization.AddWord(key, text);
		}

		public static void AddPlaceholder<[<1a5d10c7-97f0-4e8f-893a-64496abdd20d>Nullable(1)] T>(string key, string placeholder, ConfigEntry<T> config, [<1a5d10c7-97f0-4e8f-893a-64496abdd20d>Nullable(new byte[] { 2, 0, 0 })] Func<T, string> convertConfigValue = null)
		{
			if (convertConfigValue == null)
			{
				convertConfigValue = (T val) => val.ToString();
			}
			if (!PlaceholderProcessors.ContainsKey(key))
			{
				PlaceholderProcessors[key] = new Dictionary<string, Func<string>>();
			}
			config.SettingChanged += delegate
			{
				UpdatePlaceholder();
			};
			if (loadedTexts.ContainsKey(Localization.instance.GetSelectedLanguage()))
			{
				UpdatePlaceholder();
			}
			void UpdatePlaceholder()
			{
				PlaceholderProcessors[key][placeholder] = () => convertConfigValue(config.Value);
				UpdatePlaceholderText(Localization.instance, key);
			}
		}

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

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

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

		static Localizer()
		{
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Expected O, but got Unknown
			PlaceholderProcessors = new Dictionary<string, Dictionary<string, Func<string>>>();
			loadedTexts = new Dictionary<string, Dictionary<string, string>>();
			localizationLanguage = new ConditionalWeakTable<Localization, string>();
			localizationObjects = new List<WeakReference<Localization>>();
			fileExtensions = new List<string> { ".json", ".yml" };
			new Harmony("org.bepinex.helpers.LocalizationManager").Patch((MethodBase)AccessTools.DeclaredMethod(typeof(Localization), "LoadCSV", (Type[])null, (Type[])null), (HarmonyMethod)null, new HarmonyMethod(AccessTools.DeclaredMethod(typeof(Localizer), "LoadLocalization", (Type[])null, (Type[])null)), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
		}

		[return: <1a5d10c7-97f0-4e8f-893a-64496abdd20d>Nullable(2)]
		private static byte[] LoadTranslationFromAssembly(string language)
		{
			foreach (string fileExtension in fileExtensions)
			{
				byte[] array = ReadEmbeddedFileBytes("translations." + language + fileExtension);
				if (array != null)
				{
					return array;
				}
			}
			return null;
		}

		[<b321a511-462b-4050-8e68-e58ed19a8747>NullableContext(2)]
		public static byte[] ReadEmbeddedFileBytes([<1a5d10c7-97f0-4e8f-893a-64496abdd20d>Nullable(0)] string resourceFileName, Assembly containingAssembly = null)
		{
			using MemoryStream memoryStream = new MemoryStream();
			if ((object)containingAssembly == null)
			{
				containingAssembly = Assembly.GetCallingAssembly();
			}
			string text = containingAssembly.GetManifestResourceNames().FirstOrDefault((string str) => str.EndsWith(resourceFileName, StringComparison.Ordinal));
			if (text != null)
			{
				containingAssembly.GetManifestResourceStream(text)?.CopyTo(memoryStream);
			}
			return (memoryStream.Length == 0L) ? null : memoryStream.ToArray();
		}
	}
}
namespace RenegadeVikings
{
	[BepInPlugin("blacks7ar.RenegadeVikings", "RenegadeVikings", "1.2.4")]
	public class Plugin : BaseUnityPlugin
	{
		private const string modGUID = "blacks7ar.RenegadeVikings";

		public const string modName = "RenegadeVikings";

		public const string modAuthor = "blacks7ar";

		public const string modVersion = "1.2.4";

		public const string modLink = "https://valheim.thunderstore.io/package/blacks7ar/RenegadeVikings/";

		private static string configFileName = "blacks7ar.RenegadeVikings.cfg";

		private static string configFileFullPath;

		private static string traderYml;

		private static readonly string configPath;

		private static string ymlFullPath;

		public static readonly ManualLogSource RVLogger;

		private static readonly Harmony _harmony;

		private static readonly ConfigSync _configSync;

		private static ConfigEntry<Toggle> _serverConfigLocked;

		public static readonly CustomSyncedValue<List<TraderYaml>> _TraderYml;

		public static GameObject _PrefabContainer;

		public static readonly List<Character> _companionList;

		public static AssetBundle _renegadeBundle;

		public static GameObject _warHorn;

		public static GameObject _healingPill;

		public static GameObject _summonBatsSpawn;

		public static GameObject _summonSkeletonSpawn;

		public static GameObject _attackSummonSkeleton;

		public static GameObject _attackSummonBats;

		public static GameObject _summonedSkeleton;

		public static GameObject _summonedBats;

		public static GameObject _attackClusterBomb;

		public static Plugin _instance;

		public static List<TraderYaml> _traderItem { get; private set; }

		public ConfigEntry<T> config<T>(string group, string name, T value, ConfigDescription description, bool synchronizedConfig = true)
		{
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Expected O, but got Unknown
			ConfigDescription val = new ConfigDescription(description.Description + (synchronizedConfig ? " [Synced with Server]" : " [Not Synced with Server]"), description.AcceptableValues, description.Tags);
			ConfigEntry<T> val2 = ((BaseUnityPlugin)this).Config.Bind<T>(group, name, value, val);
			_configSync.AddConfigEntry<T>(val2).SynchronizedConfig = synchronizedConfig;
			return val2;
		}

		private void ConfigWatcher()
		{
			FileSystemWatcher fileSystemWatcher = new FileSystemWatcher(Paths.ConfigPath, configFileName);
			fileSystemWatcher.Changed += OnConfigChanged;
			fileSystemWatcher.Created += OnConfigChanged;
			fileSystemWatcher.Renamed += OnConfigChanged;
			fileSystemWatcher.IncludeSubdirectories = true;
			fileSystemWatcher.SynchronizingObject = ThreadingHelper.SynchronizingObject;
			fileSystemWatcher.EnableRaisingEvents = true;
			FileSystemWatcher fileSystemWatcher2 = new FileSystemWatcher(configPath, traderYml);
			fileSystemWatcher2.Changed += ReadTraderYaml;
			fileSystemWatcher2.Created += ReadTraderYaml;
			fileSystemWatcher2.Renamed += ReadTraderYaml;
			fileSystemWatcher2.IncludeSubdirectories = true;
			fileSystemWatcher2.SynchronizingObject = ThreadingHelper.SynchronizingObject;
			fileSystemWatcher2.EnableRaisingEvents = true;
		}

		private void ReadTraderYaml(object sender, FileSystemEventArgs e)
		{
			try
			{
				StreamReader streamReader = File.OpenText(ymlFullPath);
				_traderItem = Helper.ReadSerializedYml(streamReader.ReadToEnd());
				streamReader.Close();
				_TraderYml.AssignLocalValue(_traderItem);
			}
			catch
			{
				Logging.LogError("There was an issue loading you " + traderYml);
				Logging.LogError("Please check your entries for spelling and format!");
			}
		}

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

		public void Awake()
		{
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Expected O, but got Unknown
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0100: Expected O, but got Unknown
			//IL_0138: Unknown result type (might be due to invalid IL or missing references)
			//IL_0143: Expected O, but got Unknown
			//IL_017c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0187: Expected O, but got Unknown
			//IL_01b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c0: Expected O, but got Unknown
			//IL_01ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f9: Expected O, but got Unknown
			//IL_0227: Unknown result type (might be due to invalid IL or missing references)
			//IL_0232: Expected O, but got Unknown
			//IL_0260: Unknown result type (might be due to invalid IL or missing references)
			//IL_026b: Expected O, but got Unknown
			//IL_0299: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a4: Expected O, but got Unknown
			//IL_02d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02dd: Expected O, but got Unknown
			//IL_030b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0316: Expected O, but got Unknown
			//IL_034e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0359: Expected O, but got Unknown
			//IL_0391: Unknown result type (might be due to invalid IL or missing references)
			//IL_039c: Expected O, but got Unknown
			//IL_03ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d5: Expected O, but got Unknown
			//IL_0403: Unknown result type (might be due to invalid IL or missing references)
			//IL_040e: Expected O, but got Unknown
			//IL_043c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0447: Expected O, but got Unknown
			//IL_048a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0495: Expected O, but got Unknown
			//IL_04c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ce: Expected O, but got Unknown
			//IL_04fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0507: Expected O, but got Unknown
			//IL_0535: Unknown result type (might be due to invalid IL or missing references)
			//IL_0540: Expected O, but got Unknown
			//IL_0578: Unknown result type (might be due to invalid IL or missing references)
			//IL_0583: Expected O, but got Unknown
			//IL_05bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c6: Expected O, but got Unknown
			Localizer.Load();
			_instance = this;
			_renegadeBundle = GetAssetBundleFromResources("renegadebundle");
			_warHorn = _renegadeBundle.LoadAsset<GameObject>("BRV_WarHorn");
			SE_SummonCompanion sE_SummonCompanion = ScriptableObject.CreateInstance<SE_SummonCompanion>();
			((StatusEffect)sE_SummonCompanion).m_ttl = 0.25f;
			_warHorn.GetComponent<ItemDrop>().m_itemData.m_shared.m_consumeStatusEffect = (StatusEffect)(object)sE_SummonCompanion;
			_healingPill = _renegadeBundle.LoadAsset<GameObject>("BRV_HealingPill");
			_summonBatsSpawn = _renegadeBundle.LoadAsset<GameObject>("brv_summon_bats_spawn");
			_summonSkeletonSpawn = _renegadeBundle.LoadAsset<GameObject>("brv_summon_skeleton_spawn");
			_serverConfigLocked = config("1- ServerSync", "Lock Configuration", Toggle.On, new ConfigDescription("If On, the configuration is locked and can be changed by server admins only.", (AcceptableValueBase)null, Array.Empty<object>()));
			_configSync.AddLockingConfigEntry<Toggle>(_serverConfigLocked);
			ConfigData._neutralHealth = config("2- Neutral Vikings", "Health", 300f, new ConfigDescription("Base health points.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 500f), Array.Empty<object>()));
			ConfigData._neutralDmgLevel = config("2- Neutral Vikings", "Damage Level", 4, new ConfigDescription("Determines weapons quality level.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 10), new object[1]
			{
				new RenegadeVikings.Utilities.ConfigurationManagerAttributes
				{
					ShowRangeAsPercent = false
				}
			}));
			ConfigData._neutralArmorLevel = config("2- Neutral Vikings", "Armor Level", 10, new ConfigDescription("Determines armor quality level.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 10), new object[1]
			{
				new RenegadeVikings.Utilities.ConfigurationManagerAttributes
				{
					ShowRangeAsPercent = false
				}
			}));
			ConfigData._renegadeTier1Health = config("3- Renegade Vikings", "RenegadeViking Tier1 Health", 100f, new ConfigDescription("Base health points.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 500f), Array.Empty<object>()));
			ConfigData._renegadeTier2Health = config("3- Renegade Vikings", "RenegadeViking Tier2 Health", 150f, new ConfigDescription("Base health points.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 500f), Array.Empty<object>()));
			ConfigData._renegadeTier3Health = config("3- Renegade Vikings", "RenegadeViking Tier3 Health", 200f, new ConfigDescription("Base health points.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 500f), Array.Empty<object>()));
			ConfigData._renegadeTier4Health = config("3- Renegade Vikings", "RenegadeViking Tier4 Health", 250f, new ConfigDescription("Base health points.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 500f), Array.Empty<object>()));
			ConfigData._renegadeTier5Health = config("3- Renegade Vikings", "RenegadeViking Tier5 Health", 300f, new ConfigDescription("Base health points.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 500f), Array.Empty<object>()));
			ConfigData._renegadeTier6MagicHealth = config("3- Renegade Vikings", "RenegadeViking Tier6Magic Health", 350f, new ConfigDescription("Base health points.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 500f), Array.Empty<object>()));
			ConfigData._renegadeTier6MeleeHealth = config("3- Renegade Vikings", "RenegadeViking Tier6Melee Health", 350f, new ConfigDescription("Base health points.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 500f), Array.Empty<object>()));
			ConfigData._renegadeArmorLevel = config("3- Renegade Vikings", "Armor Level", 2, new ConfigDescription("Determines armor quality level.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 10), new object[1]
			{
				new RenegadeVikings.Utilities.ConfigurationManagerAttributes
				{
					ShowRangeAsPercent = false
				}
			}));
			ConfigData._renegadeDmgLevel = config("3- Renegade Vikings", "Damage Level", 3, new ConfigDescription("Determines weapon quality level.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 10), new object[1]
			{
				new RenegadeVikings.Utilities.ConfigurationManagerAttributes
				{
					ShowRangeAsPercent = false
				}
			}));
			ConfigData._overlordT1Health = config("4- Overlord Vikings", "OverlordViking Tier1 Health", 500f, new ConfigDescription("Base health points.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 1500f), Array.Empty<object>()));
			ConfigData._overlordT2Health = config("4- Overlord Vikings", "OverlordViking Tier2 Health", 2500f, new ConfigDescription("Base health points.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 5000f), Array.Empty<object>()));
			ConfigData._overlordT3Health = config("4- Overlord Vikings", "OverlordViking Tier3 Health", 5000f, new ConfigDescription("Base health points.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 7500f), Array.Empty<object>()));
			ConfigData._overlordT4Health = config("4- Overlord Vikings", "OverlordViking Tier4 Health", 7500f, new ConfigDescription("Base health points.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 10000f), new object[1]
			{
				new RenegadeVikings.Utilities.ConfigurationManagerAttributes
				{
					ShowRangeAsPercent = false
				}
			}));
			ConfigData._overlordT5Health = config("4- Overlord Vikings", "OverlordViking Tier5 Health", 10000f, new ConfigDescription("Base health points.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 12500f), Array.Empty<object>()));
			ConfigData._overlordT6Health = config("4- Overlord Vikings", "OverlordViking Tier6 Health", 12500f, new ConfigDescription("Base health points.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 15000f), Array.Empty<object>()));
			ConfigData._overlordT6SHealth = config("4- Overlord Vikings", "OverlordViking Tier6Summoner Health", 12500f, new ConfigDescription("Base health points.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 15000f), Array.Empty<object>()));
			ConfigData._overlordArmorLevel = config("4- Overlord Vikings", "Armor Level", 3, new ConfigDescription("Determines armor quality level.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 10), new object[1]
			{
				new RenegadeVikings.Utilities.ConfigurationManagerAttributes
				{
					ShowRangeAsPercent = false
				}
			}));
			ConfigData._overlordDmgLevel = config("4- Overlord Vikings", "Damage Level", 4, new ConfigDescription("Determines weapon quality level.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 10), new object[1]
			{
				new RenegadeVikings.Utilities.ConfigurationManagerAttributes
				{
					ShowRangeAsPercent = false
				}
			}));
			ConfigSetup.Init();
			Assembly executingAssembly = Assembly.GetExecutingAssembly();
			_harmony.PatchAll(executingAssembly);
			PrefabContainerInit();
			if (!File.Exists(ymlFullPath))
			{
				CreateTraderYml();
				Logging.LogWarning("File not found - " + traderYml + "!");
				Logging.LogWarning("Creating a new one..");
			}
			ReadTraderYaml(null, null);
			_TraderYml.ValueChanged += TraderYmlOnValueChanged;
			ConfigWatcher();
		}

		public static void TraderYmlOnValueChanged()
		{
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: 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_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Expected O, but got Unknown
			GameObject[] array = Resources.FindObjectsOfTypeAll<GameObject>();
			foreach (GameObject val in array)
			{
				if (!((Object)val).name.StartsWith("BLV_Trader"))
				{
					continue;
				}
				Trader component = val.GetComponent<Trader>();
				if (!Object.op_Implicit((Object)(object)component))
				{
					continue;
				}
				component.m_items.Clear();
				foreach (TraderYaml item in _traderItem)
				{
					component.m_items.Add(new TradeItem
					{
						m_prefab = ObjectDB.instance.GetItemPrefab(item.m_prefab).GetComponent<ItemDrop>(),
						m_stack = item.m_stack,
						m_price = item.m_price,
						m_requiredGlobalKey = item.m_requiredGlobalKey
					});
				}
			}
			Logging.LogDebug(traderYml + " changed..");
		}

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

		public static void PrefabContainerInit()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Expected O, but got Unknown
			_PrefabContainer = new GameObject("NpcPrefabs");
			_PrefabContainer.SetActive(false);
			Object.DontDestroyOnLoad((Object)(object)_PrefabContainer);
		}

		private static void CreateTraderYml()
		{
			List<TraderYaml> graph = new List<TraderYaml>
			{
				new TraderYaml
				{
					m_prefab = "MeadHealthMinor",
					m_stack = 1,
					m_price = 80,
					m_requiredGlobalKey = ""
				},
				new TraderYaml
				{
					m_prefab = "FishingRod",
					m_stack = 1,
					m_price = 450,
					m_requiredGlobalKey = ""
				},
				new TraderYaml
				{
					m_prefab = "BeltStrength",
					m_stack = 1,
					m_price = 1150,
					m_requiredGlobalKey = ""
				},
				new TraderYaml
				{
					m_prefab = "HelmetDverger",
					m_stack = 1,
					m_price = 700,
					m_requiredGlobalKey = ""
				},
				new TraderYaml
				{
					m_prefab = "FishingBait",
					m_stack = 20,
					m_price = 25,
					m_requiredGlobalKey = ""
				},
				new TraderYaml
				{
					m_prefab = "ChickenEgg",
					m_stack = 1,
					m_price = 2500,
					m_requiredGlobalKey = "defeated_eikthyr"
				}
			};
			using StreamWriter writer = new StreamWriter(ymlFullPath);
			new SerializerBuilder().WithNamingConvention(CamelCaseNamingConvention.Instance).Build().Serialize(writer, graph);
		}

		private static AssetBundle GetAssetBundleFromResources(string filename)
		{
			Assembly executingAssembly = Assembly.GetExecutingAssembly();
			string name = executingAssembly.GetManifestResourceNames().Single((string x) => x.EndsWith(filename));
			using Stream stream = executingAssembly.GetManifestResourceStream(name);
			return AssetBundle.LoadFromStream(stream);
		}

		static Plugin()
		{
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Expected O, but got Unknown
			string text = Paths.ConfigPath;
			char directorySeparatorChar = Path.DirectorySeparatorChar;
			configFileFullPath = text + directorySeparatorChar + configFileName;
			traderYml = "blacks7ar.RenegadeVikings.yml";
			configPath = Paths.ConfigPath;
			string text2 = Paths.ConfigPath;
			directorySeparatorChar = Path.DirectorySeparatorChar;
			ymlFullPath = text2 + directorySeparatorChar + traderYml;
			RVLogger = Logger.CreateLogSource("RenegadeVikings");
			_harmony = new Harmony("blacks7ar.RenegadeVikings");
			_configSync = new ConfigSync("blacks7ar.RenegadeVikings")
			{
				DisplayName = "RenegadeVikings",
				CurrentVersion = "1.2.4",
				MinimumRequiredVersion = "1.2.4"
			};
			_TraderYml = new CustomSyncedValue<List<TraderYaml>>(_configSync, "Trader Items", new List<TraderYaml>());
			_companionList = new List<Character>();
		}
	}
}
namespace RenegadeVikings.VikingsData
{
	public static class OverlordVikingT1
	{
		public static void Init(ZNetScene zNetScene)
		{
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0139: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			//IL_0150: Expected O, but got Unknown
			GameObject val = zNetScene.GetPrefab("Player").Clone("BLV_OverlordVikingT1");
			val.transform.SetParent(Plugin._PrefabContainer.transform, false);
			val.transform.localScale = new Vector3(1.7f, 1.5f, 1.6f);
			val.RemoveComponent(typeof(PlayerController));
			val.RemoveComponent(typeof(Player));
			val.RemoveComponent(typeof(Talker));
			val.RemoveComponent(typeof(Skills));
			SetHumanoid(val.AddComponent<Humanoid>(), zNetScene);
			SetMonsterAI(val.AddComponent<MonsterAI>(), zNetScene);
			ZNetView component = val.GetComponent<ZNetView>();
			component.m_persistent = true;
			component.m_distant = false;
			component.m_type = (ObjectType)0;
			component.m_syncInitialScale = false;
			ZSyncTransform component2 = val.GetComponent<ZSyncTransform>();
			component2.m_syncPosition = true;
			component2.m_syncRotation = true;
			component2.m_syncScale = false;
			component2.m_syncBodyVelocity = false;
			component2.m_characterParentSync = false;
			val.GetComponent<ZSyncAnimation>().m_smoothCharacterSpeeds = true;
			val.AddComponent<RenegadeSetup>();
			SetDropList(val.AddComponent<CharacterDrop>(), zNetScene);
			val.AddComponent<RandomAnimation>().m_values = new List<RandomValue>
			{
				new RandomValue
				{
					m_name = "idle",
					m_values = 5,
					m_interval = 3f,
					m_floatValue = false,
					m_floatTransition = 1f
				}
			};
			val.GetComponent<Rigidbody>().mass = 50f;
			val.AddComponent<EquipmentAdjustment>();
			val.AddComponent<BossPin>();
			zNetScene.AddClonedObject(val);
		}

		private static void SetHumanoid(Humanoid humanoid, ZNetScene zNetScene)
		{
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0154: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c7: Expected O, but got Unknown
			//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_01df: 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_01ee: Expected O, but got Unknown
			//IL_0206: Unknown result type (might be due to invalid IL or missing references)
			//IL_020b: Unknown result type (might be due to invalid IL or missing references)
			//IL_021c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0223: Unknown result type (might be due to invalid IL or missing references)
			//IL_022b: Expected O, but got Unknown
			//IL_0243: Unknown result type (might be due to invalid IL or missing references)
			//IL_0248: Unknown result type (might be due to invalid IL or missing references)
			//IL_0259: Unknown result type (might be due to invalid IL or missing references)
			//IL_0260: Unknown result type (might be due to invalid IL or missing references)
			//IL_0268: Expected O, but got Unknown
			//IL_0280: Unknown result type (might be due to invalid IL or missing references)
			//IL_0285: Unknown result type (might be due to invalid IL or missing references)
			//IL_0296: Unknown result type (might be due to invalid IL or missing references)
			//IL_029d: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a5: Expected O, but got Unknown
			//IL_02a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cc: Expected O, but got Unknown
			//IL_0310: Unknown result type (might be due to invalid IL or missing references)
			//IL_0319: 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_0329: Unknown result type (might be due to invalid IL or missing references)
			//IL_0331: Unknown result type (might be due to invalid IL or missing references)
			//IL_0339: 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_0359: Unknown result type (might be due to invalid IL or missing references)
			//IL_035e: Unknown result type (might be due to invalid IL or missing references)
			//IL_035f: Unknown result type (might be due to invalid IL or missing references)
			//IL_038e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0394: Expected O, but got Unknown
			((Character)humanoid).m_name = "$blv_overlordmeadows";
			((Character)humanoid).m_group = "OverlordVikingT1";
			((Character)humanoid).m_faction = (Faction)8;
			((Character)humanoid).m_boss = true;
			((Character)humanoid).m_dontHideBossHud = false;
			((Character)humanoid).m_bossEvent = "The Meadows Viking Overlord has awoken.";
			((Character)humanoid).m_crouchSpeed = 2f;
			((Character)humanoid).m_walkSpeed = 1.6f;
			((Character)humanoid).m_speed = 2f;
			((Character)humanoid).m_turnSpeed = 300f;
			((Character)humanoid).m_runSpeed = 5f;
			((Character)humanoid).m_runTurnSpeed = 300f;
			((Character)humanoid).m_acceleration = 0.6f;
			((Character)humanoid).m_jumpForce = 8f;
			((Character)humanoid).m_jumpForceForward = 2f;
			((Character)humanoid).m_jumpForceTiredFactor = 0.6f;
			((Character)humanoid).m_canSwim = true;
			((Character)humanoid).m_swimDepth = 1f;
			((Character)humanoid).m_swimSpeed = 2f;
			((Character)humanoid).m_swimTurnSpeed = 100f;
			((Character)humanoid).m_swimAcceleration = 0.05f;
			((Character)humanoid).m_groundTilt = (GroundTiltType)0;
			((Character)humanoid).m_groundTiltSpeed = 50f;
			((Character)humanoid).m_eye = Utils.FindChild(((Component)humanoid).gameObject.transform, "EyePos", (IterativeSearchType)0);
			((Character)humanoid).m_hitEffects.m_effectPrefabs = (EffectData[])(object)new EffectData[2]
			{
				new EffectData
				{
					m_prefab = zNetScene.GetPrefab("vfx_player_hit"),
					m_enabled = true,
					m_variant = -1
				},
				new EffectData
				{
					m_prefab = zNetScene.GetPrefab("sfx_hit"),
					m_enabled = true,
					m_variant = -1
				}
			};
			((Character)humanoid).m_critHitEffects.m_effectPrefabs = (EffectData[])(object)new EffectData[1]
			{
				new EffectData
				{
					m_prefab = zNetScene.GetPrefab("fx_crit"),
					m_enabled = true,
					m_variant = -1
				}
			};
			((Character)humanoid).m_backstabHitEffects.m_effectPrefabs = (EffectData[])(object)new EffectData[1]
			{
				new EffectData
				{
					m_prefab = zNetScene.GetPrefab("fx_backstab"),
					m_enabled = true,
					m_variant = -1
				}
			};
			((Character)humanoid).m_deathEffects.m_effectPrefabs = (EffectData[])(object)new EffectData[2]
			{
				new EffectData
				{
					m_prefab = zNetScene.GetPrefab("vfx_ghost_death"),
					m_enabled = true,
					m_variant = -1
				},
				new EffectData
				{
					m_prefab = zNetScene.GetPrefab("sfx_ghost_death"),
					m_enabled = true,
					m_variant = -1
				}
			};
			((Character)humanoid).m_tolerateWater = true;
			ConfigData._overlordT1Health.SettingChanged += delegate
			{
				((Character)humanoid).m_health = ConfigData._overlordT1Health.Value;
			};
			((Character)humanoid).m_health = ConfigData._overlordT1Health.Value;
			((Character)humanoid).m_damageModifiers = new DamageModifiers
			{
				m_blunt = (DamageModifier)0,
				m_slash = (DamageModifier)0,
				m_pierce = (DamageModifier)0,
				m_chop = (DamageModifier)3,
				m_pickaxe = (DamageModifier)3,
				m_fire = (DamageModifier)0,
				m_frost = (DamageModifier)0,
				m_lightning = (DamageModifier)0,
				m_spirit = (DamageModifier)3
			};
			((Character)humanoid).m_staggerWhenBlocked = true;
			((Character)humanoid).m_staggerDamageFactor = 0f;
			Humanoid obj = humanoid;
			ItemSet[] array = new ItemSet[1];
			ItemSet val = new ItemSet();
			val.m_items = (GameObject[])(object)new GameObject[3]
			{
				ObjectDB.instance.GetItemPrefab("ArmorBronzeChest"),
				ObjectDB.instance.GetItemPrefab("ArmorBronzeLegs"),
				ObjectDB.instance.GetItemPrefab("CapeWolf")
			};
			array[0] = val;
			obj.m_randomSets = (ItemSet[])(object)array;
		}

		private static void SetMonsterAI(MonsterAI monsterAI, ZNetScene zNetScene)
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: 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_005b: Expected O, but got Unknown
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Expected O, but got Unknown
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			((BaseAI)monsterAI).m_viewRange = 40f;
			((BaseAI)monsterAI).m_viewAngle = 90f;
			((BaseAI)monsterAI).m_hearRange = 9999f;
			((BaseAI)monsterAI).m_mistVision = false;
			((BaseAI)monsterAI).m_alertedEffects.m_effectPrefabs = (EffectData[])(object)new EffectData[1]
			{
				new EffectData
				{
					m_prefab = zNetScene.GetPrefab("sfx_dverger_vo_alerted"),
					m_enabled = true,
					m_variant = -1
				}
			};
			((BaseAI)monsterAI).m_idleSound.m_effectPrefabs = (EffectData[])(object)new EffectData[1]
			{
				new EffectData
				{
					m_prefab = zNetScene.GetPrefab("sfx_dverger_vo_idle"),
					m_enabled = true,
					m_variant = 0
				}
			};
			((BaseAI)monsterAI).m_idleSoundInterval = 10f;
			((BaseAI)monsterAI).m_idleSoundChance = 0.5f;
			((BaseAI)monsterAI).m_pathAgentType = (AgentType)2;
			((BaseAI)monsterAI).m_moveMinAngle = 90f;
			((BaseAI)monsterAI).m_smoothMovement = true;
			((BaseAI)monsterAI).m_serpentMovement = false;
			((BaseAI)monsterAI).m_jumpInterval = 0f;
			((BaseAI)monsterAI).m_randomCircleInterval = 2f;
			((BaseAI)monsterAI).m_randomMoveInterval = 10f;
			((BaseAI)monsterAI).m_randomMoveRange = 10f;
			((BaseAI)monsterAI).m_avoidFire = false;
			((BaseAI)monsterAI).m_afraidOfFire = false;
			((BaseAI)monsterAI).m_avoidWater = true;
			((BaseAI)monsterAI).m_aggravatable = false;
			monsterAI.m_alertRange = 9999f;
			monsterAI.m_fleeIfHurtWhenTargetCantBeReached = false;
			monsterAI.m_fleeIfNotAlerted = false;
			monsterAI.m_fleeIfLowHealth = 0f;
			monsterAI.m_circulateWhileCharging = false;
			monsterAI.m_circulateWhileChargingFlying = false;
			monsterAI.m_enableHuntPlayer = false;
			monsterAI.m_attackPlayerObjects = true;
			monsterAI.m_privateAreaTriggerTreshold = 4;
			monsterAI.m_interceptTimeMax = 2f;
			monsterAI.m_interceptTimeMin = 0f;
			monsterAI.m_maxChaseDistance = 0f;
			monsterAI.m_minAttackInterval = 0f;
			monsterAI.m_circleTargetInterval = 5f;
			monsterAI.m_circleTargetDuration = 2f;
			monsterAI.m_circleTargetDistance = 5f;
		}

		private static void SetDropList(CharacterDrop characterDrop, ZNetScene zNetScene)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: 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_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Expected O, but got Unknown
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: 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)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: 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_009b: Expected O, but got Unknown
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Expected O, but got Unknown
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: Expected O, but got Unknown
			//IL_0130: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_014d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0154: Unknown result type (might be due to invalid IL or missing references)
			//IL_015f: 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_016d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0179: Expected O, but got Unknown
			//IL_017a: Unknown result type (might be due to invalid IL or missing references)
			//IL_017f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0190: Unknown result type (might be due to invalid IL or missing references)
			//IL_0197: 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_01a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c3: Expected O, but got Unknown
			List<Drop> drops = new List<Drop>
			{
				new Drop
				{
					m_prefab = zNetScene.GetPrefab("Coins"),
					m_amountMin = 10,
					m_amountMax = 15,
					m_chance = 1f,
					m_onePerPlayer = false,
					m_levelMultiplier = true,
					m_dontScale = false
				},
				new Drop
				{
					m_prefab = zNetScene.GetPrefab("Amber"),
					m_amountMin = 2,
					m_amountMax = 2,
					m_chance = 0.1f,
					m_onePerPlayer = false,
					m_levelMultiplier = true,
					m_dontScale = false
				},
				new Drop
				{
					m_prefab = zNetScene.GetPrefab("AmberPearl"),
					m_amountMin = 2,
					m_amountMax = 2,
					m_chance = 0.1f,
					m_onePerPlayer = false,
					m_levelMultiplier = true,
					m_dontScale = false
				},
				new Drop
				{
					m_prefab = zNetScene.GetPrefab("Ruby"),
					m_amountMin = 2,
					m_amountMax = 2,
					m_chance = 0.1f,
					m_onePerPlayer = false,
					m_levelMultiplier = true,
					m_dontScale = false
				},
				new Drop
				{
					m_prefab = zNetScene.GetPrefab("SilverNecklace"),
					m_amountMin = 2,
					m_amountMax = 2,
					m_chance = 0.1f,
					m_onePerPlayer = false,
					m_levelMultiplier = true,
					m_dontScale = false
				},
				new Drop
				{
					m_prefab = zNetScene.GetPrefab("HardAntler"),
					m_amountMin = 3,
					m_amountMax = 3,
					m_chance = 1f,
					m_onePerPlayer = false,
					m_levelMultiplier = false,
					m_dontScale = true
				}
			};
			characterDrop.m_drops = drops;
		}
	}
	public static class OverlordVikingT2
	{
		public static void Init(ZNetScene zNetScene)
		{
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0139: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			//IL_0150: Expected O, but got Unknown
			GameObject val = zNetScene.GetPrefab("Player").Clone("BLV_OverlordVikingT2");
			val.transform.SetParent(Plugin._PrefabContainer.transform, false);
			val.transform.localScale = new Vector3(1.7f, 1.5f, 1.6f);
			val.RemoveComponent(typeof(PlayerController));
			val.RemoveComponent(typeof(Player));
			val.RemoveComponent(typeof(Talker));
			val.RemoveComponent(typeof(Skills));
			SetHumanoid(val.AddComponent<Humanoid>(), zNetScene);
			SetMonsterAI(val.AddComponent<MonsterAI>(), zNetScene);
			ZNetView component = val.GetComponent<ZNetView>();
			component.m_persistent = true;
			component.m_distant = false;
			component.m_type = (ObjectType)0;
			component.m_syncInitialScale = false;
			ZSyncTransform component2 = val.GetComponent<ZSyncTransform>();
			component2.m_syncPosition = true;
			component2.m_syncRotation = true;
			component2.m_syncScale = false;
			component2.m_syncBodyVelocity = false;
			component2.m_characterParentSync = false;
			val.GetComponent<ZSyncAnimation>().m_smoothCharacterSpeeds = true;
			val.AddComponent<RenegadeSetup>();
			SetDropList(val.AddComponent<CharacterDrop>(), zNetScene);
			val.AddComponent<RandomAnimation>().m_values = new List<RandomValue>
			{
				new RandomValue
				{
					m_name = "idle",
					m_values = 5,
					m_interval = 3f,
					m_floatValue = false,
					m_floatTransition = 1f
				}
			};
			val.GetComponent<Rigidbody>().mass = 50f;
			val.AddComponent<EquipmentAdjustment>();
			val.AddComponent<BossPin>();
			zNetScene.AddClonedObject(val);
		}

		private static void SetHumanoid(Humanoid humanoid, ZNetScene zNetScene)
		{
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0154: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c7: Expected O, but got Unknown
			//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_01df: 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_01ee: Expected O, but got Unknown
			//IL_0206: Unknown result type (might be due to invalid IL or missing references)
			//IL_020b: Unknown result type (might be due to invalid IL or missing references)
			//IL_021c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0223: Unknown result type (might be due to invalid IL or missing references)
			//IL_022b: Expected O, but got Unknown
			//IL_0243: Unknown result type (might be due to invalid IL or missing references)
			//IL_0248: Unknown result type (might be due to invalid IL or missing references)
			//IL_0259: Unknown result type (might be due to invalid IL or missing references)
			//IL_0260: Unknown result type (might be due to invalid IL or missing references)
			//IL_0268: Expected O, but got Unknown
			//IL_0280: Unknown result type (might be due to invalid IL or missing references)
			//IL_0285: Unknown result type (might be due to invalid IL or missing references)
			//IL_0296: Unknown result type (might be due to invalid IL or missing references)
			//IL_029d: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a5: Expected O, but got Unknown
			//IL_02a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cc: Expected O, but got Unknown
			//IL_0310: Unknown result type (might be due to invalid IL or missing references)
			//IL_0319: 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_0329: Unknown result type (might be due to invalid IL or missing references)
			//IL_0331: Unknown result type (might be due to invalid IL or missing references)
			//IL_0339: 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_0359: Unknown result type (might be due to invalid IL or missing references)
			//IL_035e: Unknown result type (might be due to invalid IL or missing references)
			//IL_035f: Unknown result type (might be due to invalid IL or missing references)
			//IL_038e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0394: Expected O, but got Unknown
			((Character)humanoid).m_name = "$blv_overlordblackforest";
			((Character)humanoid).m_group = "OverlordVikingT2";
			((Character)humanoid).m_faction = (Faction)8;
			((Character)humanoid).m_boss = true;
			((Character)humanoid).m_dontHideBossHud = false;
			((Character)humanoid).m_bossEvent = "The BlackForest Viking Overlord has awoken.";
			((Character)humanoid).m_crouchSpeed = 2f;
			((Character)humanoid).m_walkSpeed = 1.6f;
			((Character)humanoid).m_speed = 2f;
			((Character)humanoid).m_turnSpeed = 300f;
			((Character)humanoid).m_runSpeed = 5f;
			((Character)humanoid).m_runTurnSpeed = 300f;
			((Character)humanoid).m_acceleration = 0.6f;
			((Character)humanoid).m_jumpForce = 8f;
			((Character)humanoid).m_jumpForceForward = 2f;
			((Character)humanoid).m_jumpForceTiredFactor = 0.6f;
			((Character)humanoid).m_canSwim = true;
			((Character)humanoid).m_swimDepth = 1f;
			((Character)humanoid).m_swimSpeed = 2f;
			((Character)humanoid).m_swimTurnSpeed = 100f;
			((Character)humanoid).m_swimAcceleration = 0.05f;
			((Character)humanoid).m_groundTilt = (GroundTiltType)0;
			((Character)humanoid).m_groundTiltSpeed = 50f;
			((Character)humanoid).m_eye = Utils.FindChild(((Component)humanoid).gameObject.transform, "EyePos", (IterativeSearchType)0);
			((Character)humanoid).m_hitEffects.m_effectPrefabs = (EffectData[])(object)new EffectData[2]
			{
				new EffectData
				{
					m_prefab = zNetScene.GetPrefab("vfx_player_hit"),
					m_enabled = true,
					m_variant = -1
				},
				new EffectData
				{
					m_prefab = zNetScene.GetPrefab("sfx_hit"),
					m_enabled = true,
					m_variant = -1
				}
			};
			((Character)humanoid).m_critHitEffects.m_effectPrefabs = (EffectData[])(object)new EffectData[1]
			{
				new EffectData
				{
					m_prefab = zNetScene.GetPrefab("fx_crit"),
					m_enabled = true,
					m_variant = -1
				}
			};
			((Character)humanoid).m_backstabHitEffects.m_effectPrefabs = (EffectData[])(object)new EffectData[1]
			{
				new EffectData
				{
					m_prefab = zNetScene.GetPrefab("fx_backstab"),
					m_enabled = true,
					m_variant = -1
				}
			};
			((Character)humanoid).m_deathEffects.m_effectPrefabs = (EffectData[])(object)new EffectData[2]
			{
				new EffectData
				{
					m_prefab = zNetScene.GetPrefab("vfx_ghost_death"),
					m_enabled = true,
					m_variant = -1
				},
				new EffectData
				{
					m_prefab = zNetScene.GetPrefab("sfx_ghost_death"),
					m_enabled = true,
					m_variant = -1
				}
			};
			((Character)humanoid).m_tolerateWater = true;
			ConfigData._overlordT2Health.SettingChanged += delegate
			{
				((Character)humanoid).m_health = ConfigData._overlordT2Health.Value;
			};
			((Character)humanoid).m_health = ConfigData._overlordT2Health.Value;
			((Character)humanoid).m_damageModifiers = new DamageModifiers
			{
				m_blunt = (DamageModifier)0,
				m_slash = (DamageModifier)0,
				m_pierce = (DamageModifier)0,
				m_chop = (DamageModifier)3,
				m_pickaxe = (DamageModifier)3,
				m_fire = (DamageModifier)0,
				m_frost = (DamageModifier)0,
				m_lightning = (DamageModifier)0,
				m_spirit = (DamageModifier)3
			};
			((Character)humanoid).m_staggerWhenBlocked = true;
			((Character)humanoid).m_staggerDamageFactor = 0f;
			Humanoid obj = humanoid;
			ItemSet[] array = new ItemSet[1];
			ItemSet val = new ItemSet();
			val.m_items = (GameObject[])(object)new GameObject[3]
			{
				ObjectDB.instance.GetItemPrefab("ArmorIronChest"),
				ObjectDB.instance.GetItemPrefab("ArmorIronLegs"),
				ObjectDB.instance.GetItemPrefab("CapeWolf")
			};
			array[0] = val;
			obj.m_randomSets = (ItemSet[])(object)array;
		}

		private static void SetMonsterAI(MonsterAI monsterAI, ZNetScene zNetScene)
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: 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_005b: Expected O, but got Unknown
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Expected O, but got Unknown
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			((BaseAI)monsterAI).m_viewRange = 40f;
			((BaseAI)monsterAI).m_viewAngle = 90f;
			((BaseAI)monsterAI).m_hearRange = 9999f;
			((BaseAI)monsterAI).m_mistVision = false;
			((BaseAI)monsterAI).m_alertedEffects.m_effectPrefabs = (EffectData[])(object)new EffectData[1]
			{
				new EffectData
				{
					m_prefab = zNetScene.GetPrefab("sfx_dverger_vo_alerted"),
					m_enabled = true,
					m_variant = -1
				}
			};
			((BaseAI)monsterAI).m_idleSound.m_effectPrefabs = (EffectData[])(object)new EffectData[1]
			{
				new EffectData
				{
					m_prefab = zNetScene.GetPrefab("sfx_dverger_vo_idle"),
					m_enabled = true,
					m_variant = 0
				}
			};
			((BaseAI)monsterAI).m_idleSoundInterval = 10f;
			((BaseAI)monsterAI).m_idleSoundChance = 0.5f;
			((BaseAI)monsterAI).m_pathAgentType = (AgentType)2;
			((BaseAI)monsterAI).m_moveMinAngle = 90f;
			((BaseAI)monsterAI).m_smoothMovement = true;
			((BaseAI)monsterAI).m_serpentMovement = false;
			((BaseAI)monsterAI).m_jumpInterval = 0f;
			((BaseAI)monsterAI).m_randomCircleInterval = 2f;
			((BaseAI)monsterAI).m_randomMoveInterval = 10f;
			((BaseAI)monsterAI).m_randomMoveRange = 10f;
			((BaseAI)monsterAI).m_avoidFire = false;
			((BaseAI)monsterAI).m_afraidOfFire = false;
			((BaseAI)monsterAI).m_avoidWater = true;
			((BaseAI)monsterAI).m_aggravatable = false;
			monsterAI.m_alertRange = 9999f;
			monsterAI.m_fleeIfHurtWhenTargetCantBeReached = false;
			monsterAI.m_fleeIfNotAlerted = false;
			monsterAI.m_fleeIfLowHealth = 0f;
			monsterAI.m_circulateWhileCharging = false;
			monsterAI.m_circulateWhileChargingFlying = false;
			monsterAI.m_enableHuntPlayer = false;
			monsterAI.m_attackPlayerObjects = true;
			monsterAI.m_privateAreaTriggerTreshold = 4;
			monsterAI.m_interceptTimeMax = 2f;
			monsterAI.m_interceptTimeMin = 0f;
			monsterAI.m_maxChaseDistance = 0f;
			monsterAI.m_minAttackInterval = 0f;
			monsterAI.m_circleTargetInterval = 5f;
			monsterAI.m_circleTargetDuration = 2f;
			monsterAI.m_circleTargetDistance = 5f;
		}

		private static void SetDropList(CharacterDrop characterDrop, ZNetScene zNetScene)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: 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_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Expected O, but got Unknown
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: 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)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: 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_009b: Expected O, but got Unknown
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Expected O, but got Unknown
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: Expected O, but got Unknown
			//IL_0130: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_014d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0154: Unknown result type (might be due to invalid IL or missing references)
			//IL_015f: 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_016d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0179: Expected O, but got Unknown
			//IL_017a: Unknown result type (might be due to invalid IL or missing references)
			//IL_017f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0190: Unknown result type (might be due to invalid IL or missing references)
			//IL_0197: 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_01a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c3: Expected O, but got Unknown
			List<Drop> drops = new List<Drop>
			{
				new Drop
				{
					m_prefab = zNetScene.GetPrefab("Coins"),
					m_amountMin = 15,
					m_amountMax = 20,
					m_chance = 1f,
					m_onePerPlayer = false,
					m_levelMultiplier = true,
					m_dontScale = false
				},
				new Drop
				{
					m_prefab = zNetScene.GetPrefab("Amber"),
					m_amountMin = 4,
					m_amountMax = 4,
					m_chance = 0.1f,
					m_onePerPlayer = false,
					m_levelMultiplier = true,
					m_dontScale = false
				},
				new Drop
				{
					m_prefab = zNetScene.GetPrefab("AmberPearl"),
					m_amountMin = 4,
					m_amountMax = 4,
					m_chance = 0.1f,
					m_onePerPlayer = false,
					m_levelMultiplier = true,
					m_dontScale = false
				},
				new Drop
				{
					m_prefab = zNetScene.GetPrefab("Ruby"),
					m_amountMin = 4,
					m_amountMax = 4,
					m_chance = 0.1f,
					m_onePerPlayer = false,
					m_levelMultiplier = true,
					m_dontScale = false
				},
				new Drop
				{
					m_prefab = zNetScene.GetPrefab("SilverNecklace"),
					m_amountMin = 4,
					m_amountMax = 4,
					m_chance = 0.1f,
					m_onePerPlayer = false,
					m_levelMultiplier = true,
					m_dontScale = false
				},
				new Drop
				{
					m_prefab = zNetScene.GetPrefab("SurtlingCore"),
					m_amountMin = 5,
					m_amountMax = 5,
					m_chance = 1f,
					m_onePerPlayer = false,
					m_levelMultiplier = false,
					m_dontScale = true
				}
			};
			characterDrop.m_drops = drops;
		}
	}
	public static class OverlordVikingT3
	{
		public static void Init(ZNetScene zNetScene)
		{
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0139: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			//IL_0150: Expected O, but got Unknown
			GameObject val = zNetScene.GetPrefab("Player").Clone("BLV_OverlordVikingT3");
			val.transform.SetParent(Plugin._PrefabContainer.transform, false);
			val.transform.localScale = new Vector3(1.7f, 1.5f, 1.6f);
			val.RemoveComponent(typeof(PlayerController));
			val.RemoveComponent(typeof(Player));
			val.RemoveComponent(typeof(Talker));
			val.RemoveComponent(typeof(Skills));
			SetHumanoid(val.AddComponent<Humanoid>(), zNetScene);
			SetMonsterAI(val.AddComponent<MonsterAI>(), zNetScene);
			ZNetView component = val.GetComponent<ZNetView>();
			component.m_persistent = true;
			component.m_distant = false;
			component.m_type = (ObjectType)0;
			component.m_syncInitialScale = false;
			ZSyncTransform component2 = val.GetComponent<ZSyncTransform>();
			component2.m_syncPosition = true;
			component2.m_syncRotation = true;
			component2.m_syncScale = false;
			component2.m_syncBodyVelocity = false;
			component2.m_characterParentSync = false;
			val.GetComponent<ZSyncAnimation>().m_smoothCharacterSpeeds = true;
			val.AddComponent<RenegadeSetup>();
			SetDropList(val.AddComponent<CharacterDrop>(), zNetScene);
			val.AddComponent<RandomAnimation>().m_values = new List<RandomValue>
			{
				new RandomValue
				{
					m_name = "idle",
					m_values = 5,
					m_interval = 3f,
					m_floatValue = false,
					m_floatTransition = 1f
				}
			};
			val.GetComponent<Rigidbody>().mass = 50f;
			val.AddComponent<EquipmentAdjustment>();
			val.AddComponent<BossPin>();
			zNetScene.AddClonedObject(val);
		}

		private static void SetHumanoid(Humanoid humanoid, ZNetScene zNetScene)
		{
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0154: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c7: Expected O, but got Unknown
			//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_01df: 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_01ee: Expected O, but got Unknown
			//IL_0206: Unknown result type (might be due to invalid IL or missing references)
			//IL_020b: Unknown result type (might be due to invalid IL or missing references)
			//IL_021c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0223: Unknown result type (might be due to invalid IL or missing references)
			//IL_022b: Expected O, but got Unknown
			//IL_0243: Unknown result type (might be due to invalid IL or missing references)
			//IL_0248: Unknown result type (might be due to invalid IL or missing references)
			//IL_0259: Unknown result type (might be due to invalid IL or missing references)
			//IL_0260: Unknown result type (might be due to invalid IL or missing references)
			//IL_0268: Expected O, but got Unknown
			//IL_0280: Unknown result type (might be due to invalid IL or missing references)
			//IL_0285: Unknown result type (might be due to invalid IL or missing references)
			//IL_0296: Unknown result type (might be due to invalid IL or missing references)
			//IL_029d: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a5: Expected O, but got Unknown
			//IL_02a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cc: Expected O, but got Unknown
			//IL_0310: Unknown result type (might be due to invalid IL or missing references)
			//IL_0319: 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_0329: Unknown result type (might be due to invalid IL or missing references)
			//IL_0331: Unknown result type (might be due to invalid IL or missing references)
			//IL_0339: 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_0359: Unknown result type (might be due to invalid IL or missing references)
			//IL_035e: Unknown result type (might be due to invalid IL or missing references)
			//IL_035f: Unknown result type (might be due to invalid IL or missing references)
			//IL_038e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0394: Expected O, but got Unknown
			((Character)humanoid).m_name = "$blv_overlordswamps";
			((Character)humanoid).m_group = "OverlordVikingT3";
			((Character)humanoid).m_faction = (Faction)8;
			((Character)humanoid).m_boss = true;
			((Character)humanoid).m_dontHideBossHud = false;
			((Character)humanoid).m_bossEvent = "The Swamp Viking Overlord has awoken.";
			((Character)humanoid).m_crouchSpeed = 2f;
			((Character)humanoid).m_walkSpeed = 1.6f;
			((Character)humanoid).m_speed = 2f;
			((Character)humanoid).m_turnSpeed = 300f;
			((Character)humanoid).m_runSpeed = 5f;
			((Character)humanoid).m_runTurnSpeed = 300f;
			((Character)humanoid).m_acceleration = 0.6f;
			((Character)humanoid).m_jumpForce = 8f;
			((Character)humanoid).m_jumpForceForward = 2f;
			((Character)humanoid).m_jumpForceTiredFactor = 0.6f;
			((Character)humanoid).m_canSwim = true;
			((Character)humanoid).m_swimDepth = 1f;
			((Character)humanoid).m_swimSpeed = 2f;
			((Character)humanoid).m_swimTurnSpeed = 100f;
			((Character)humanoid).m_swimAcceleration = 0.05f;
			((Character)humanoid).m_groundTilt = (GroundTiltType)0;
			((Character)humanoid).m_groundTiltSpeed = 50f;
			((Character)humanoid).m_eye = Utils.FindChild(((Component)humanoid).gameObject.transform, "EyePos", (IterativeSearchType)0);
			((Character)humanoid).m_hitEffects.m_effectPrefabs = (EffectData[])(object)new EffectData[2]
			{
				new EffectData
				{
					m_prefab = zNetScene.GetPrefab("vfx_player_hit"),
					m_enabled = true,
					m_variant = -1
				},
				new EffectData
				{
					m_prefab = zNetScene.GetPrefab("sfx_hit"),
					m_enabled = true,
					m_variant = -1
				}
			};
			((Character)humanoid).m_critHitEffects.m_effectPrefabs = (EffectData[])(object)new EffectData[1]
			{
				new EffectData
				{
					m_prefab = zNetScene.GetPrefab("fx_crit"),
					m_enabled = true,
					m_variant = -1
				}
			};
			((Character)humanoid).m_backstabHitEffects.m_effectPrefabs = (EffectData[])(object)new EffectData[1]
			{
				new EffectData
				{
					m_prefab = zNetScene.GetPrefab("fx_backstab"),
					m_enabled = true,
					m_variant = -1
				}
			};
			((Character)humanoid).m_deathEffects.m_effectPrefabs = (EffectData[])(object)new EffectData[2]
			{
				new EffectData
				{
					m_prefab = zNetScene.GetPrefab("vfx_ghost_death"),
					m_enabled = true,
					m_variant = -1
				},
				new EffectData
				{
					m_prefab = zNetScene.GetPrefab("sfx_ghost_death"),
					m_enabled = true,
					m_variant = -1
				}
			};
			((Character)humanoid).m_tolerateWater = true;
			ConfigData._overlordT3Health.SettingChanged += delegate
			{
				((Character)humanoid).m_health = ConfigData._overlordT3Health.Value;
			};
			((Character)humanoid).m_health = ConfigData._overlordT3Health.Value;
			((Character)humanoid).m_damageModifiers = new DamageModifiers
			{
				m_blunt = (DamageModifier)0,
				m_slash = (DamageModifier)0,
				m_pierce = (DamageModifier)0,
				m_chop = (DamageModifier)3,
				m_pickaxe = (DamageModifier)3,
				m_fire = (DamageModifier)0,
				m_frost = (DamageModifier)0,
				m_lightning = (DamageModifier)0,
				m_spirit = (DamageModifier)3
			};
			((Character)humanoid).m_staggerWhenBlocked = true;
			((Character)humanoid).m_staggerDamageFactor = 0f;
			Humanoid obj = humanoid;
			ItemSet[] array = new ItemSet[1];
			ItemSet val = new ItemSet();
			val.m_items = (GameObject[])(object)new GameObject[3]
			{
				ObjectDB.instance.GetItemPrefab("ArmorWolfChest"),
				ObjectDB.instance.GetItemPrefab("ArmorWolfLegs"),
				ObjectDB.instance.GetItemPrefab("CapeWolf")
			};
			array[0] = val;
			obj.m_randomSets = (ItemSet[])(object)array;
		}

		private static void SetMonsterAI(MonsterAI monsterAI, ZNetScene zNetScene)
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: 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_005b: Expected O, but got Unknown
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Expected O, but got Unknown
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			((BaseAI)monsterAI).m_viewRange = 40f;
			((BaseAI)monsterAI).m_viewAngle = 90f;
			((BaseAI)monsterAI).m_hearRange = 9999f;
			((BaseAI)monsterAI).m_mistVision = false;
			((BaseAI)monsterAI).m_alertedEffects.m_effectPrefabs = (EffectData[])(object)new EffectData[1]
			{
				new EffectData
				{
					m_prefab = zNetScene.GetPrefab("sfx_dverger_vo_alerted"),
					m_enabled = true,
					m_variant = -1
				}
			};
			((BaseAI)monsterAI).m_idleSound.m_effectPrefabs = (EffectData[])(object)new EffectData[1]
			{
				new EffectData
				{
					m_prefab = zNetScene.GetPrefab("sfx_dverger_vo_idle"),
					m_enabled = true,
					m_variant = 0
				}
			};
			((BaseAI)monsterAI).m_idleSoundInterval = 10f;
			((BaseAI)monsterAI).m_idleSoundChance = 0.5f;
			((BaseAI)monsterAI).m_pathAgentType = (AgentType)2;
			((BaseAI)monsterAI).m_moveMinAngle = 90f;
			((BaseAI)monsterAI).m_smoothMovement = true;
			((BaseAI)monsterAI).m_serpentMovement = false;
			((BaseAI)monsterAI).m_jumpInterval = 0f;
			((BaseAI)monsterAI).m_randomCircleInterval = 2f;
			((BaseAI)monsterAI).m_randomMoveInterval = 10f;
			((BaseAI)monsterAI).m_randomMoveRange = 10f;
			((BaseAI)monsterAI).m_avoidFire = false;
			((BaseAI)monsterAI).m_afraidOfFire = false;
			((BaseAI)monsterAI).m_avoidWater = true;
			((BaseAI)monsterAI).m_aggravatable = false;
			monsterAI.m_alertRange = 9999f;
			monsterAI.m_fleeIfHurtWhenTargetCantBeReached = false;
			monsterAI.m_fleeIfNotAlerted = false;
			monsterAI.m_fleeIfLowHealth = 0f;
			monsterAI.m_circulateWhileCharging = false;
			monsterAI.m_circulateWhileChargingFlying = false;
			monsterAI.m_enableHuntPlayer = false;
			monsterAI.m_attackPlayerObjects = true;
			monsterAI.m_privateAreaTriggerTreshold = 4;
			monsterAI.m_interceptTimeMax = 2f;
			monsterAI.m_interceptTimeMin = 0f;
			monsterAI.m_maxChaseDistance = 0f;
			monsterAI.m_minAttackInterval = 0f;
			monsterAI.m_circleTargetInterval = 5f;
			monsterAI.m_circleTargetDuration = 2f;
			monsterAI.m_circleTargetDistance = 5f;
		}

		private static void SetDropList(CharacterDrop characterDrop, ZNetScene zNetScene)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: 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_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Expected O, but got Unknown
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: 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)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: 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_009b: Expected O, but got Unknown
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Expected O, but got Unknown
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: Expected O, but got Unknown
			//IL_0130: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_014d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0154: Unknown result type (might be due to invalid IL or missing references)
			//IL_015f: 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_016d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0179: Expected O, but got Unknown
			//IL_017a: Unknown result type (might be due to invalid IL or missing references)
			//IL_017f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0190: Unknown result type (might be due to invalid IL or missing references)
			//IL_0197: 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_01a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c3: Expected O, but got Unknown
			List<Drop> drops = new List<Drop>
			{
				new Drop
				{
					m_prefab = zNetScene.GetPrefab("Coins"),
					m_amountMin = 20,
					m_amountMax = 25,
					m_chance = 1f,
					m_onePerPlayer = false,
					m_levelMultiplier = true,
					m_dontScale = false
				},
				new Drop
				{
					m_prefab = zNetScene.GetPrefab("Amber"),
					m_amountMin = 6,
					m_amountMax = 6,
					m_chance = 0.1f,
					m_onePerPlayer = false,
					m_levelMultiplier = true,
					m_dontScale = false
				},
				new Drop
				{
					m_prefab = zNetScene.GetPrefab("AmberPearl"),
					m_amountMin = 6,
					m_amountMax = 6,
					m_chance = 0.1f,
					m_onePerPlayer = false,
					m_levelMultiplier = true,
					m_dontScale = false
				},
				new Drop
				{
					m_prefab = zNetScene.GetPrefab("Ruby"),
					m_amountMin = 6,
					m_amountMax = 6,
					m_chance = 0.1f,
					m_onePerPlayer = false,
					m_levelMultiplier = true,
					m_dontScale = false
				},
				new Drop
				{
					m_prefab = zNetScene.GetPrefab("SilverNecklace"),
					m_amountMin = 6,
					m_amountMax = 6,
					m_chance = 0.1f,
					m_onePerPlayer = false,
					m_levelMultiplier = true,
					m_dontScale = false
				},
				new Drop
				{
					m_prefab = zNetScene.GetPrefab("SurtlingCore"),
					m_amountMin = 5,
					m_amountMax = 5,
					m_chance = 1f,
					m_onePerPlayer = false,
					m_levelMultiplier = false,
					m_dontScale = true
				}
			};
			characterDrop.m_drops = drops;
		}
	}
	public static class OverlordVikingT4
	{
		public static void Init(ZNetScene zNetScene)
		{
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0139: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			//IL_0150: Expected O, but got Unknown
			GameObject val = zNetScene.GetPrefab("Player").Clone("BLV_OverlordVikingT4");
			val.transform.SetParent(Plugin._PrefabContainer.transform, false);
			val.transform.localScale = new Vector3(1.7f, 1.5f, 1.6f);
			val.RemoveComponent(typeof(PlayerController));
			val.RemoveComponent(typeof(Player));
			val.RemoveComponent(typeof(Talker));
			val.RemoveComponent(typeof(Skills));
			SetHumanoid(val.AddComponent<Humanoid>(), zNetScene);
			SetMonsterAI(val.AddComponent<MonsterAI>(), zNetScene);
			ZNetView component = val.GetComponent<ZNetView>();
			component.m_persistent = true;
			component.m_distant = false;
			component.m_type = (ObjectType)0;
			component.m_syncInitialScale = false;
			ZSyncTransform component2 = val.GetComponent<ZSyncTransform>();
			component2.m_syncPosition = true;
			component2.m_syncRotation = true;
			component2.m_syncScale = false;
			component2.m_syncBodyVelocity = false;
			component2.m_characterParentSync = false;
			val.GetComponent<ZSyncAnimation>().m_smoothCharacterSpeeds = true;
			val.AddComponent<RenegadeSetup>();
			SetDropList(val.AddComponent<CharacterDrop>(), zNetScene);
			val.AddComponent<RandomAnimation>().m_values = new List<RandomValue>
			{
				new RandomValue
				{
					m_name = "idle",
					m_values = 5,
					m_interval = 3f,
					m_floatValue = false,
					m_floatTransition = 1f
				}
			};
			val.GetComponent<Rigidbody>().mass = 50f;
			val.AddComponent<EquipmentAdjustment>();
			val.AddComponent<BossPin>();
			zNetScene.AddClonedObject(val);
		}

		private static void SetHumanoid(Humanoid humanoid, ZNetScene zNetScene)
		{
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0154: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c7: Expected O, but got Unknown
			//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_01df: 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_01ee: Expected O, but got Unknown
			//IL_0206: Unknown result type (might be due to invalid IL or missing references)
			//IL_020b: Unknown result type (might be due to invalid IL or missing references)
			//IL_021c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0223: Unknown result type (might be due to invalid IL or missing references)
			//IL_022b: Expected O, but got Unknown
			//IL_0243: Unknown result type (might be due to invalid IL or missing references)
			//IL_0248: Unknown result type (might be due to invalid IL or missing references)
			//IL_0259: Unknown result type (might be due to invalid IL or missing references)
			//IL_0260: Unknown result type (might be due to invalid IL or missing references)
			//IL_0268: Expected O, but got Unknown
			//IL_0280: Unknown result type (might be due to invalid IL or missing references)
			//IL_0285: Unknown result type (might be due to invalid IL or missing references)
			//IL_0296: Unknown result type (might be due to invalid IL or missing references)
			//IL_029d: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a5: Expected O, but got Unknown
			//IL_02a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cc: Expected O, but got Unknown
			//IL_0310: Unknown result type (might be due to invalid IL or missing references)
			//IL_0319: 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_0329: Unknown result type (might be due to invalid IL or missing references)
			//IL_0331: Unknown result type (might be due to invalid IL or missing references)
			//IL_0339: 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_0359: Unknown result type (might be due to invalid IL or missing references)
			//IL_035e: Unknown result type (might be due to invalid IL or missing references)
			//IL_035f: Unknown result type (might be due to invalid IL or missing references)
			//IL_038e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0394: Expected O, but got Unknown
			((Character)humanoid).m_name = "$blv_overlordmountains";
			((Character)humanoid).m_group = "OverlordVikingT4";
			((Character)humanoid).m_faction = (Faction)8;
			((Character)humanoid).m_boss = true;
			((Character)humanoid).m_dontHideBossHud = false;
			((Character)humanoid).m_bossEvent = "The Mountain Viking Overlord has awoken.";
			((Character)humanoid).m_crouchSpeed = 2f;
			((Character)humanoid).m_walkSpeed = 1.6f;
			((Character)humanoid).m_speed = 2f;
			((Character)humanoid).m_turnSpeed = 300f;
			((Character)humanoid).m_runSpeed = 5f;
			((Character)humanoid).m_runTurnSpeed = 300f;
			((Character)humanoid).m_acceleration = 0.6f;
			((Character)humanoid).m_jumpForce = 8f;
			((Character)humanoid).m_jumpForceForward = 2f;
			((Character)humanoid).m_jumpForceTiredFactor = 0.6f;
			((Character)humanoid).m_canSwim = true;
			((Character)humanoid).m_swimDepth = 1f;
			((Character)humanoid).m_swimSpeed = 2f;
			((Character)humanoid).m_swimTurnSpeed = 100f;
			((Character)humanoid).m_swimAcceleration = 0.05f;
			((Character)humanoid).m_groundTilt = (GroundTiltType)0;
			((Character)humanoid).m_groundTiltSpeed = 50f;
			((Character)humanoid).m_eye = Utils.FindChild(((Component)humanoid).gameObject.transform, "EyePos", (IterativeSearchType)0);
			((Character)humanoid).m_hitEffects.m_effectPrefabs = (EffectData[])(object)new EffectData[2]
			{
				new EffectData
				{
					m_prefab = zNetScene.GetPrefab("vfx_player_hit"),
					m_enabled = true,
					m_variant = -1
				},
				new EffectData
				{
					m_prefab = zNetScene.GetPrefab("sfx_hit"),
					m_enabled = true,
					m_variant = -1
				}
			};
			((Character)humanoid).m_critHitEffects.m_effectPrefabs = (EffectData[])(object)new EffectData[1]
			{
				new EffectData
				{
					m_prefab = zNetScene.GetPrefab("fx_crit"),
					m_enabled = true,
					m_variant = -1
				}
			};
			((Character)humanoid).m_backstabHitEffects.m_effectPrefabs = (EffectData[])(object)new EffectData[1]
			{
				new EffectData
				{
					m_prefab = zNetScene.GetPrefab("fx_backstab"),
					m_enabled = true,
					m_variant = -1
				}
			};
			((Character)humanoid).m_deathEffects.m_effectPrefabs = (EffectData[])(object)new EffectData[2]
			{
				new EffectData
				{
					m_prefab = zNetScene.GetPrefab("vfx_ghost_death"),
					m_enabled = true,
					m_variant = -1
				},
				new EffectData
				{
					m_prefab = zNetScene.GetPrefab("sfx_ghost_death"),
					m_enabled = true,
					m_variant = -1
				}
			};
			((Character)humanoid).m_tolerateWater = true;
			ConfigData._overlordT4Health.SettingChanged += delegate
			{
				((Character)humanoid).m_health = ConfigData._overlordT4Health.Value;
			};
			((Character)humanoid).m_health = ConfigData._overlordT4Health.Value;
			((Character)humanoid).m_damageModifiers = new DamageModifiers
			{
				m_blunt = (DamageModifier)0,
				m_slash = (DamageModifier)0,
				m_pierce = (DamageModifier)0,
				m_chop = (DamageModifier)3,
				m_pickaxe = (DamageModifier)3,
				m_fire = (DamageModifier)0,
				m_frost = (DamageModifier)0,
				m_lightning = (DamageModifier)0,
				m_spirit = (DamageModifier)3
			};
			((Character)humanoid).m_staggerWhenBlocked = true;
			((Character)humanoid).m_staggerDamageFactor = 0f;
			Humanoid obj = humanoid;
			ItemSet[] array = new ItemSet[1];
			ItemSet val = new ItemSet();
			val.m_items = (GameObject[])(object)new GameObject[3]
			{
				ObjectDB.instance.GetItemPrefab("ArmorPaddedCuirass"),
				ObjectDB.instance.GetItemPrefab("ArmorPaddedGreaves"),
				ObjectDB.instance.GetItemPrefab("CapeWolf")
			};
			array[0] = val;
			obj.m_randomSets = (ItemSet[])(object)array;
		}

		private static void SetMonsterAI(MonsterAI monsterAI, ZNetScene zNetScene)
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: 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_005b: Expected O, but got Unknown
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Expected O, but got Unknown
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			((BaseAI)monsterAI).m_viewRange = 40f;
			((BaseAI)monsterAI).m_viewAngle = 90f;
			((BaseAI)monsterAI).m_hearRange = 9999f;
			((BaseAI)monsterAI).m_mistVision = false;
			((BaseAI)monsterAI).m_alertedEffects.m_effectPrefabs = (EffectData[])(object)new EffectData[1]
			{
				new EffectData
				{
					m_prefab = zNetScene.GetPrefab("sfx_dverger_vo_alerted"),
					m_enabled = true,
					m_variant = -1
				}
			};
			((BaseAI)monsterAI).m_idleSound.m_effectPrefabs = (EffectData[])(object)new EffectData[1]
			{
				new EffectData
				{
					m_prefab = zNetScene.GetPrefab("sfx_dverger_vo_idle"),
					m_enabled = true,
					m_variant = 0
				}
			};
			((BaseAI)monsterAI).m_idleSoundInterval = 10f;
			((BaseAI)monsterAI).m_idleSoundChance = 0.5f;
			((BaseAI)monsterAI).m_pathAgentType = (AgentType)2;
			((BaseAI)monsterAI).m_moveMinAngle = 90f;
			((BaseAI)monsterAI).m_smoothMovement = true;
			((BaseAI)monsterAI).m_serpentMovement = false;
			((BaseAI)monsterAI).m_jumpInterval = 0f;
			((BaseAI)monsterAI).m_randomCircleInterval = 2f;
			((BaseAI)monsterAI).m_randomMoveInterval = 10f;
			((BaseAI)monsterAI).m_randomMoveRange = 10f;
			((BaseAI)monsterAI).m_avoidFire = false;
			((BaseAI)monsterAI).m_afraidOfFire = false;
			((BaseAI)monsterAI).m_avoidWater = true;
			((BaseAI)monsterAI).m_aggravatable = false;
			monsterAI.m_alertRange = 9999f;
			monsterAI.m_fleeIfHurtWhenTargetCantBeReached = false;
			monsterAI.m_fleeIfNotAlerted = false;
			monsterAI.m_fleeIfLowHealth = 0f;
			monsterAI.m_circulateWhileCharging = false;
			monsterAI.m_circulateWhileChargingFlying = false;
			monsterAI.m_enableHuntPlayer = false;
			monsterAI.m_attackPlayerObjects = true;
			monsterAI.m_privateAreaTriggerTreshold = 4;
			monsterAI.m_interceptTimeMax = 2f;
			monsterAI.m_interceptTimeMin = 0f;
			monsterAI.m_maxChaseDistance = 0f;
			monsterAI.m_minAttackInterval = 0f;
			monsterAI.m_circleTargetInterval = 5f;
			monsterAI.m_circleTargetDuration = 2f;
			monsterAI.m_circleTargetDistance = 5f;
		}

		private static void SetDropList(CharacterDrop characterDrop, ZNetScene zNetScene)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: 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_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Expected O, but got Unknown
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: 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)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: 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_009b: Expected O, but got Unknown
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Expected O, but got Unknown
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: Expected O, but got Unknown
			//IL_0130: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_014d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0154: Unknown result type (might be due to invalid IL or missing references)
			//IL_015f: 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_016d: Unknown result type (mi