Decompiled source of Bestiary v1.2.1

plugins/Bestiary.dll

Decompiled a month 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.Reflection.Emit;
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 BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using CreatureManager;
using HarmonyLib;
using ItemManager;
using JetBrains.Annotations;
using LocalizationManager;
using Microsoft.CodeAnalysis;
using PieceManager;
using ServerSync;
using TMPro;
using UnityEngine;
using UnityEngine.Audio;
using YamlDotNet.Core;
using YamlDotNet.Core.Events;
using YamlDotNet.Core.ObjectPool;
using YamlDotNet.Core.Tokens;
using YamlDotNet.Helpers;
using YamlDotNet.Serialization;
using YamlDotNet.Serialization.BufferedDeserialization;
using YamlDotNet.Serialization.BufferedDeserialization.TypeDiscriminators;
using YamlDotNet.Serialization.Callbacks;
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: Guid("E74EB49A-461D-48EA-85BC-F462D60C98C4")]
[assembly: ComVisible(false)]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCopyright("Copyright ©  2025")]
[assembly: AssemblyProduct("Bestiary")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyTitle("Bestiary")]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: CompilationRelaxations(8)]
[assembly: AssemblyFileVersion("1.2.1")]
[assembly: AssemblyCompany("Radamanto")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.2.1.0")]
[module: <b10e2820-0e02-4606-905f-749cda436d68>RefSafetyRules(11)]
[module: UnverifiableCode]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[<a795ab83-1ead-4d2b-a7a1-664ab8e4c006>Embedded]
	internal sealed class <a795ab83-1ead-4d2b-a7a1-664ab8e4c006>EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[<a795ab83-1ead-4d2b-a7a1-664ab8e4c006>Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class <036635b6-4691-402f-bc8b-01650d48c534>NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public <036635b6-4691-402f-bc8b-01650d48c534>NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public <036635b6-4691-402f-bc8b-01650d48c534>NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	[<a795ab83-1ead-4d2b-a7a1-664ab8e4c006>Embedded]
	internal sealed class <b29a1023-2877-4ef1-bace-bda5d26a4acd>NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public <b29a1023-2877-4ef1-bace-bda5d26a4acd>NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	[<a795ab83-1ead-4d2b-a7a1-664ab8e4c006>Embedded]
	[CompilerGenerated]
	internal sealed class <b10e2820-0e02-4606-905f-749cda436d68>RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public <b10e2820-0e02-4606-905f-749cda436d68>RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace Bestiary
{
	[<b29a1023-2877-4ef1-bace-bda5d26a4acd>NullableContext(1)]
	[<036635b6-4691-402f-bc8b-01650d48c534>Nullable(0)]
	public static class ValheimSfxMixerFix
	{
		private static bool _started;

		public static void Initialize(BaseUnityPlugin plugin)
		{
			if (!((Object)(object)plugin == (Object)null) && !Application.isBatchMode && !_started)
			{
				AssetBundle val = ItemManager.PrefabManager.RegisterAssetBundle("rd_bestas");
				if (!((Object)(object)val == (Object)null))
				{
					_started = true;
					((MonoBehaviour)plugin).StartCoroutine(RouteWhenReady(val));
				}
			}
		}

		private static IEnumerator RouteWhenReady(AssetBundle bundle)
		{
			HashSet<AudioSource> sources = new HashSet<AudioSource>();
			HashSet<AudioMixer> bundledMixers = new HashSet<AudioMixer>();
			GameObject[] array = bundle.LoadAllAssets<GameObject>();
			foreach (GameObject prefab in array)
			{
				Collect(prefab, sources, bundledMixers);
			}
			while ((Object)(object)AudioMan.instance == (Object)null || (Object)(object)AudioMan.instance.m_masterMixer == (Object)null)
			{
				yield return null;
			}
			AudioMixer appliedMixer = null;
			WaitForSecondsRealtime retryDelay = new WaitForSecondsRealtime(5f);
			while (true)
			{
				AudioMixer liveMixer = (((Object)(object)AudioMan.instance != (Object)null) ? AudioMan.instance.m_masterMixer : null);
				if ((Object)(object)liveMixer != (Object)null && (Object)(object)liveMixer != (Object)(object)appliedMixer)
				{
					AudioMixerGroup sfx = FindSfx(liveMixer);
					if ((Object)(object)sfx != (Object)null)
					{
						if (bundledMixers.Count > 0)
						{
							AudioSource[] array2 = Resources.FindObjectsOfTypeAll<AudioSource>();
							foreach (AudioSource source in array2)
							{
								if (!((Object)(object)source == (Object)null))
								{
									AudioMixerGroup output = source.outputAudioMixerGroup;
									if ((Object)(object)output != (Object)null && (Object)(object)output.audioMixer != (Object)(object)liveMixer && bundledMixers.Contains(output.audioMixer))
									{
										sources.Add(source);
									}
								}
							}
						}
						int routed = 0;
						foreach (AudioSource source2 in sources)
						{
							if (!((Object)(object)source2 == (Object)null))
							{
								source2.outputAudioMixerGroup = sfx;
								routed++;
							}
						}
						sources.RemoveWhere((AudioSource s) => (Object)(object)s == (Object)null);
						appliedMixer = liveMixer;
						Debug.Log((object)$"[Bestiary] Routed {routed} AudioSources to the game's SFX mixer group.");
					}
				}
				yield return retryDelay;
			}
		}

		private static void Collect([<036635b6-4691-402f-bc8b-01650d48c534>Nullable(2)] GameObject prefab, HashSet<AudioSource> sources, HashSet<AudioMixer> bundledMixers)
		{
			if ((Object)(object)prefab == (Object)null)
			{
				return;
			}
			AudioSource[] componentsInChildren = prefab.GetComponentsInChildren<AudioSource>(true);
			foreach (AudioSource val in componentsInChildren)
			{
				if (!((Object)(object)val == (Object)null))
				{
					sources.Add(val);
					AudioMixerGroup outputAudioMixerGroup = val.outputAudioMixerGroup;
					if ((Object)(object)outputAudioMixerGroup != (Object)null && (Object)(object)outputAudioMixerGroup.audioMixer != (Object)null)
					{
						bundledMixers.Add(outputAudioMixerGroup.audioMixer);
					}
				}
			}
		}

		[return: <036635b6-4691-402f-bc8b-01650d48c534>Nullable(2)]
		private static AudioMixerGroup FindSfx(AudioMixer mixer)
		{
			AudioMixerGroup[] array = mixer.FindMatchingGroups(string.Empty);
			foreach (AudioMixerGroup val in array)
			{
				if ((Object)(object)val != (Object)null && string.Equals(((Object)val).name, "SFX", StringComparison.OrdinalIgnoreCase))
				{
					return val;
				}
			}
			return null;
		}
	}
	[<b29a1023-2877-4ef1-bace-bda5d26a4acd>NullableContext(1)]
	[<036635b6-4691-402f-bc8b-01650d48c534>Nullable(0)]
	internal static class AquaticDepthController
	{
		[<b29a1023-2877-4ef1-bace-bda5d26a4acd>NullableContext(0)]
		internal readonly struct Profile
		{
			internal readonly float MinExtraDepth;

			internal readonly float MaxExtraDepth;

			internal readonly float MinInterval;

			internal readonly float MaxInterval;

			internal readonly float DepthStep;

			internal readonly float StepInterval;

			internal readonly float CombatDepthStep;

			internal readonly float CombatStepInterval;

			internal readonly bool SurfaceWhenDetected;

			internal float IdleSpeed => Mathf.Max(0.01f, DepthStep) / Mathf.Max(0.01f, StepInterval);

			internal float SurfaceSpeed => Mathf.Max(0.01f, CombatDepthStep) / Mathf.Max(0.01f, CombatStepInterval);

			internal Profile(float minExtraDepth, float maxExtraDepth, float minInterval, float maxInterval, float depthStep, float stepInterval, float combatDepthStep, float combatStepInterval, bool surfaceWhenDetected)
			{
				MinExtraDepth = minExtraDepth;
				MaxExtraDepth = maxExtraDepth;
				MinInterval = minInterval;
				MaxInterval = maxInterval;
				DepthStep = depthStep;
				StepInterval = stepInterval;
				CombatDepthStep = combatDepthStep;
				CombatStepInterval = combatStepInterval;
				SurfaceWhenDetected = surfaceWhenDetected;
			}
		}

		private static readonly Dictionary<string, Profile> Profiles = new Dictionary<string, Profile>
		{
			["RDB_white_shark"] = new Profile(0.5f, 5f, 6f, 14f, 0.4f, 1f, 0.75f, 0.25f, surfaceWhenDetected: true),
			["RDB_Whale"] = new Profile(0.5f, 5f, 6f, 14f, 0.4f, 1f, 0.75f, 0.25f, surfaceWhenDetected: true),
			["RDB_turtle"] = new Profile(0.5f, 1f, 6f, 14f, 0.4f, 1f, 0.75f, 0.25f, surfaceWhenDetected: true)
		};

		internal static bool Enabled => BestiaryPlugin.CE_AquaticDepth_Enabled?.Value ?? true;

		internal static void Attach(Character character)
		{
			if (!((Object)(object)character == (Object)null) && TryGetProfile(((Component)character).gameObject, out var profile) && !((Object)(object)((Component)character).GetComponent<AquaticDepthRuntime>() != (Object)null))
			{
				((Component)character).gameObject.AddComponent<AquaticDepthRuntime>().Init(profile);
			}
		}

		internal static void RefreshLoaded()
		{
			if (!Enabled)
			{
				return;
			}
			foreach (Character allCharacter in Character.GetAllCharacters())
			{
				Attach(allCharacter);
			}
		}

		internal static bool TryGetProfile(GameObject go, out Profile profile)
		{
			profile = default(Profile);
			if ((Object)(object)go == (Object)null)
			{
				return false;
			}
			string prefabName = Utils.GetPrefabName(((Object)go).name);
			return Profiles.TryGetValue(prefabName, out profile);
		}
	}
	[<b29a1023-2877-4ef1-bace-bda5d26a4acd>NullableContext(1)]
	[<036635b6-4691-402f-bc8b-01650d48c534>Nullable(0)]
	internal sealed class AquaticDepthRuntime : MonoBehaviour
	{
		private const float MovingTickInterval = 0.25f;

		private const float RestingTickInterval = 1f;

		private const float RemoteTickInterval = 2f;

		private const float StateInterval = 0.5f;

		private const float SettledEpsilon = 0.01f;

		private const float SeabedMargin = 1f;

		private const float SurfaceHoldSeconds = 6f;

		private const float HurtMemorySeconds = 10f;

		private const float IdleSmoothTime = 1.5f;

		private const float UrgentSmoothTime = 0.35f;

		private const float SyncThreshold = 0.05f;

		private static readonly int SwimDepthKey = StringExtensionMethods.GetStableHashCode("RDB_swimDepth");

		private static readonly WaitForSeconds MovingWait = new WaitForSeconds(0.25f);

		private static readonly WaitForSeconds RestingWait = new WaitForSeconds(1f);

		private static readonly WaitForSeconds RemoteWait = new WaitForSeconds(2f);

		[<036635b6-4691-402f-bc8b-01650d48c534>Nullable(2)]
		private Character _character;

		[<036635b6-4691-402f-bc8b-01650d48c534>Nullable(2)]
		private BaseAI _ai;

		[<036635b6-4691-402f-bc8b-01650d48c534>Nullable(2)]
		private ZNetView _nview;

		private AquaticDepthController.Profile _profile;

		private float _baseSwimDepth;

		private float _idleTarget;

		private float _desiredDepth;

		private float _depthVelocity;

		private float _syncedDepth;

		private float _nextIdlePick;

		private float _nextStateCheck;

		private float _surfaceUntil;

		private float _lastMoveTime;

		private bool _urgent;

		private bool _wasOwner;

		[<036635b6-4691-402f-bc8b-01650d48c534>Nullable(2)]
		private Coroutine _tickRoutine;

		internal void Init(AquaticDepthController.Profile profile)
		{
			_profile = profile;
			_character = ((Component)this).GetComponent<Character>();
			_ai = ((Component)this).GetComponent<BaseAI>();
			_nview = ((Component)this).GetComponent<ZNetView>();
			if (!((Object)(object)_character == (Object)null) && !((Object)(object)_nview == (Object)null))
			{
				_baseSwimDepth = _character.m_swimDepth;
				_idleTarget = _baseSwimDepth;
				_desiredDepth = _baseSwimDepth;
				_syncedDepth = _baseSwimDepth;
				_nextIdlePick = Time.time + Random.Range(_profile.MinInterval, _profile.MaxInterval);
				if (_tickRoutine != null)
				{
					((MonoBehaviour)this).StopCoroutine(_tickRoutine);
				}
				_tickRoutine = ((MonoBehaviour)this).StartCoroutine(TickRoutine());
			}
		}

		private void OnDestroy()
		{
			if (_tickRoutine != null)
			{
				((MonoBehaviour)this).StopCoroutine(_tickRoutine);
			}
			if ((Object)(object)_character != (Object)null)
			{
				_character.m_swimDepth = _baseSwimDepth;
			}
		}

		private IEnumerator TickRoutine()
		{
			yield return (object)new WaitForSeconds(Random.Range(0f, 1f));
			while (true)
			{
				yield return Tick();
			}
		}

		private WaitForSeconds Tick()
		{
			if ((Object)(object)_character == (Object)null || (Object)(object)_nview == (Object)null || !_nview.IsValid() || !_nview.IsOwner())
			{
				_wasOwner = false;
				return RemoteWait;
			}
			float time = Time.time;
			if (!_wasOwner)
			{
				_wasOwner = true;
				ResumeSyncedDepth(time);
			}
			if (!AquaticDepthController.Enabled)
			{
				ReturnToDefaultDepth();
				return RemoteWait;
			}
			if (time >= _nextStateCheck)
			{
				_nextStateCheck = time + 0.5f;
				UpdateDesiredDepth(time);
				SyncDepth();
			}
			MoveTowardsDesired(Mathf.Min(time - _lastMoveTime, 1f));
			_lastMoveTime = time;
			return IsSettled() ? RestingWait : MovingWait;
		}

		private void ReturnToDefaultDepth()
		{
			_character.m_swimDepth = _baseSwimDepth;
			_idleTarget = _baseSwimDepth;
			_desiredDepth = _baseSwimDepth;
			_depthVelocity = 0f;
			_surfaceUntil = 0f;
			SyncDepth();
		}

		private bool IsSettled()
		{
			return Mathf.Abs(_character.m_swimDepth - _desiredDepth) < 0.01f && Mathf.Abs(_depthVelocity) < 0.01f;
		}

		private void ResumeSyncedDepth(float now)
		{
			float num = _nview.GetZDO().GetFloat(SwimDepthKey, _baseSwimDepth);
			float num2 = Mathf.Clamp(num, _baseSwimDepth, GetMaxAllowedDepth());
			_character.m_swimDepth = num2;
			_idleTarget = num2;
			_desiredDepth = num2;
			_depthVelocity = 0f;
			_syncedDepth = num;
			_lastMoveTime = now;
			_nextIdlePick = now + Random.Range(_profile.MinInterval, _profile.MaxInterval);
		}

		private void UpdateDesiredDepth(float now)
		{
			if (_profile.SurfaceWhenDetected && IsDetected())
			{
				_surfaceUntil = now + 6f;
			}
			bool flag = now < _surfaceUntil;
			float maxAllowedDepth = GetMaxAllowedDepth();
			_urgent = flag || _character.m_swimDepth > maxAllowedDepth + 0.05f;
			if (_character.IsDead() || !IsSwimmingContext() || flag)
			{
				_desiredDepth = _baseSwimDepth;
				return;
			}
			if (now >= _nextIdlePick)
			{
				_nextIdlePick = now + Random.Range(_profile.MinInterval, _profile.MaxInterval);
				_idleTarget = _baseSwimDepth + Random.Range(_profile.MinExtraDepth, _profile.MaxExtraDepth);
			}
			_desiredDepth = Mathf.Min(_idleTarget, maxAllowedDepth);
		}

		private void MoveTowardsDesired(float dt)
		{
			float swimDepth = _character.m_swimDepth;
			if (IsSettled())
			{
				_character.m_swimDepth = _desiredDepth;
				_depthVelocity = 0f;
			}
			else
			{
				float num = (_urgent ? _profile.SurfaceSpeed : _profile.IdleSpeed);
				float num2 = (_urgent ? 0.35f : 1.5f);
				_character.m_swimDepth = Mathf.SmoothDamp(swimDepth, _desiredDepth, ref _depthVelocity, num2, num, dt);
			}
		}

		private void SyncDepth()
		{
			float swimDepth = _character.m_swimDepth;
			if (!(Mathf.Abs(swimDepth - _syncedDepth) < 0.05f))
			{
				_syncedDepth = swimDepth;
				_nview.GetZDO().Set(SwimDepthKey, swimDepth);
			}
		}

		private float GetMaxAllowedDepth()
		{
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)_character == (Object)null || (Object)(object)ZoneSystem.instance == (Object)null)
			{
				return _baseSwimDepth;
			}
			float num = _character.GetLiquidLevel() - ZoneSystem.instance.GetGroundHeight(((Component)this).transform.position);
			return Mathf.Max(_baseSwimDepth, num - 1f);
		}

		private bool IsSwimmingContext()
		{
			return (Object)(object)_character != (Object)null && _character.m_canSwim && _character.InWater();
		}

		private bool IsDetected()
		{
			if (_character.InAttack())
			{
				return true;
			}
			if ((Object)(object)_ai == (Object)null)
			{
				return false;
			}
			return _ai.IsAlerted() || _ai.HaveTarget() || _ai.m_timeSinceHurt < 10f;
		}
	}
	[HarmonyPatch(typeof(Character), "Awake")]
	internal static class Patch_Character_Awake_AquaticDepthController
	{
		[<b29a1023-2877-4ef1-bace-bda5d26a4acd>NullableContext(1)]
		private static void Postfix(Character __instance)
		{
			if (AquaticDepthController.Enabled)
			{
				AquaticDepthController.Attach(__instance);
			}
		}
	}
	[BepInPlugin("radamanto.Bestiary", "Bestiary", "1.2.1")]
	[<036635b6-4691-402f-bc8b-01650d48c534>Nullable(0)]
	[<b29a1023-2877-4ef1-bace-bda5d26a4acd>NullableContext(1)]
	public class BestiaryPlugin : BaseUnityPlugin
	{
		[<b29a1023-2877-4ef1-bace-bda5d26a4acd>NullableContext(0)]
		private class ConfigurationManagerAttributes
		{
			public bool? Browsable = false;
		}

		internal const string ModName = "Bestiary";

		internal const string ModVersion = "1.2.1";

		internal const string Author = "radamanto";

		private const string ModGUID = "radamanto.Bestiary";

		private readonly Harmony _harmony = new Harmony("radamanto.Bestiary");

		private static bool _bootstrapped;

		internal static ConfigEntry<bool> CE_AquaticDepth_Enabled;

		[<036635b6-4691-402f-bc8b-01650d48c534>Nullable(2)]
		internal static ConfigSync ConfigSync;

		[<036635b6-4691-402f-bc8b-01650d48c534>Nullable(2)]
		private static ConfigEntry<bool> _serverConfigLocked;

		[<036635b6-4691-402f-bc8b-01650d48c534>Nullable(2)]
		private FileSystemWatcher _configWatcher;

		private long _lastCfgWrite;

		private bool _reloadScheduled;

		private bool _watcherReady;

		private void Awake()
		{
			Localizer.Load();
			if (!_bootstrapped)
			{
				bool saveOnConfigSet = ((BaseUnityPlugin)this).Config.SaveOnConfigSet;
				((BaseUnityPlugin)this).Config.SaveOnConfigSet = false;
				try
				{
					SetupServerSyncAndWatcher();
					BindConfiguration();
					Effect_Registry.RegisterEffects();
					Register_CreatureAttack.RegisterCreatureAttack();
					Creature_Registry.RegisterMobs();
					CreatureDeath_Registry.RegisterDeathMobs();
					Trophy_Registry.RegisterTrophy();
					_harmony.PatchAll();
					ValheimSfxMixerFix.Initialize((BaseUnityPlugin)(object)this);
					_bootstrapped = true;
				}
				finally
				{
					((BaseUnityPlugin)this).Config.SaveOnConfigSet = saveOnConfigSet;
				}
				((BaseUnityPlugin)this).Config.Save();
				SetupConfigWatcher();
			}
		}

		private void BindConfiguration()
		{
			CE_AquaticDepth_Enabled = config("02 - Aquatic Creatures", "Dynamic Swim Depth", value: true, "If true, sharks, whales and turtles dive to random depths while idle, stay above the seabed and rise to the surface when they detect someone. If false, they swim at their default depth.");
			CE_AquaticDepth_Enabled.SettingChanged += [<b29a1023-2877-4ef1-bace-bda5d26a4acd>NullableContext(0)] (object _, EventArgs _) =>
			{
				AquaticDepthController.RefreshLoaded();
			};
		}

		private void OnDestroy()
		{
			_watcherReady = false;
			if (_configWatcher != null)
			{
				_configWatcher.EnableRaisingEvents = false;
				_configWatcher.Dispose();
				_configWatcher = null;
			}
			_reloadScheduled = false;
		}

		public void SetupServerSyncAndWatcher()
		{
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Expected O, but got Unknown
			ConfigSync = new ConfigSync(((BaseUnityPlugin)this).Info.Metadata.GUID)
			{
				DisplayName = ((BaseUnityPlugin)this).Info.Metadata.Name,
				CurrentVersion = ((BaseUnityPlugin)this).Info.Metadata.Version.ToString(),
				MinimumRequiredVersion = ((BaseUnityPlugin)this).Info.Metadata.Version.ToString(),
				ModRequired = true
			};
			_serverConfigLocked = ((BaseUnityPlugin)this).Config.Bind<bool>("01 - General", "LockConfiguration", true, new ConfigDescription("If true, the server locks synchronized configs.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Browsable = false
				}
			}));
			ConfigSync.AddLockingConfigEntry<bool>(_serverConfigLocked);
		}

		private ConfigEntry<T> config<[<036635b6-4691-402f-bc8b-01650d48c534>Nullable(2)] T>(string group, string name, T value, ConfigDescription description, bool synchronizedSetting = true)
		{
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Expected O, but got Unknown
			ConfigDescription val = new ConfigDescription(description.Description + (synchronizedSetting ? " [Synced with Server]" : " [Not Synced with Server]"), description.AcceptableValues, description.Tags);
			ConfigEntry<T> val2 = ((BaseUnityPlugin)this).Config.Bind<T>(group, name, value, val);
			if (ConfigSync == null)
			{
				throw new InvalidOperationException("ServerSync has not been initialized.");
			}
			ConfigSync.AddConfigEntry<T>(val2).SynchronizedConfig = synchronizedSetting;
			return val2;
		}

		private ConfigEntry<T> config<[<036635b6-4691-402f-bc8b-01650d48c534>Nullable(2)] T>(string group, string name, T value, string description, bool synchronizedSetting = true)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Expected O, but got Unknown
			return config(group, name, value, new ConfigDescription(description, (AcceptableValueBase)null, Array.Empty<object>()), synchronizedSetting);
		}

		private void SetupConfigWatcher()
		{
			try
			{
				_watcherReady = false;
				_configWatcher?.Dispose();
				_configWatcher = new FileSystemWatcher(Path.GetDirectoryName(((BaseUnityPlugin)this).Config.ConfigFilePath), Path.GetFileName(((BaseUnityPlugin)this).Config.ConfigFilePath))
				{
					IncludeSubdirectories = false,
					NotifyFilter = (NotifyFilters.FileName | NotifyFilters.Size | NotifyFilters.LastWrite),
					SynchronizingObject = ThreadingHelper.SynchronizingObject
				};
				_configWatcher.Changed += OnConfigFileChanged;
				_configWatcher.Created += OnConfigFileChanged;
				_configWatcher.Renamed += [<b29a1023-2877-4ef1-bace-bda5d26a4acd>NullableContext(0)] (object _, RenamedEventArgs args) =>
				{
					OnConfigFileChanged(_, args);
				};
				_configWatcher.Error += [<b29a1023-2877-4ef1-bace-bda5d26a4acd>NullableContext(0)] (object _, ErrorEventArgs args) =>
				{
					((BaseUnityPlugin)this).Logger.LogWarning((object)$"Configuration watcher failed: {args.GetException()}");
				};
				_watcherReady = true;
				_configWatcher.EnableRaisingEvents = true;
			}
			catch (Exception arg)
			{
				_watcherReady = false;
				_configWatcher?.Dispose();
				_configWatcher = null;
				((BaseUnityPlugin)this).Logger.LogWarning((object)$"Automatic configuration reload is unavailable: {arg}");
			}
		}

		private void OnConfigFileChanged(object sender, FileSystemEventArgs args)
		{
			if (_watcherReady)
			{
				_lastCfgWrite = Stopwatch.GetTimestamp();
				if (!_reloadScheduled)
				{
					_reloadScheduled = true;
					((MonoBehaviour)this).StartCoroutine(ReloadConfigAfterQuietPeriod());
				}
			}
		}

		private IEnumerator ReloadConfigAfterQuietPeriod()
		{
			try
			{
				for (int attempt = 0; attempt < 3; attempt++)
				{
					if (!_watcherReady)
					{
						break;
					}
					while (_watcherReady && (double)(Stopwatch.GetTimestamp() - _lastCfgWrite) / (double)Stopwatch.Frequency < 0.75)
					{
						yield return null;
					}
					if (!_watcherReady || ((Object)(object)ZNet.instance != (Object)null && !ZNet.instance.IsServer()))
					{
						break;
					}
					bool saveOnSet = ((BaseUnityPlugin)this).Config.SaveOnConfigSet;
					bool retry = false;
					try
					{
						((BaseUnityPlugin)this).Config.SaveOnConfigSet = false;
						((BaseUnityPlugin)this).Config.Reload();
						((BaseUnityPlugin)this).Logger.LogInfo((object)"Configuration reloaded.");
					}
					catch (IOException ex)
					{
						IOException error = ex;
						retry = true;
						if (attempt == 2)
						{
							((BaseUnityPlugin)this).Logger.LogWarning((object)$"Configuration could not be read after 3 attempts: {error}");
						}
					}
					catch (Exception ex2)
					{
						Exception error2 = ex2;
						((BaseUnityPlugin)this).Logger.LogError((object)$"Configuration reload failed: {error2}");
					}
					finally
					{
						((BaseUnityPlugin)this).Config.SaveOnConfigSet = saveOnSet;
					}
					if (!retry)
					{
						break;
					}
					_lastCfgWrite = Stopwatch.GetTimestamp();
				}
			}
			finally
			{
				_reloadScheduled = false;
			}
		}
	}
	internal static class Register_CreatureAttack
	{
		public static void RegisterCreatureAttack()
		{
			Item item = new Item("rd_bestas", "Mino_Attack_01");
			item.Configurable = Configurability.Disabled;
			Item item2 = new Item("rd_bestas", "Mino_Attack_02");
			item2.Configurable = Configurability.Disabled;
			Item item3 = new Item("rd_bestas", "Mino_Attack_03");
			item3.Configurable = Configurability.Disabled;
			Item item4 = new Item("rd_bestas", "Mino_Attack_kick_01");
			item4.Configurable = Configurability.Disabled;
			Item item5 = new Item("rd_bestas", "Mino_Attack_kick_02");
			item5.Configurable = Configurability.Disabled;
			Item item6 = new Item("rd_bestas", "Vendigo_Attack_01");
			item6.Configurable = Configurability.Disabled;
			Item item7 = new Item("rd_bestas", "Vendigo_Attack_02");
			item7.Configurable = Configurability.Disabled;
			Item item8 = new Item("rd_bestas", "Vendigo_Attack_03");
			item8.Configurable = Configurability.Disabled;
			Item item9 = new Item("rd_bestas", "Vendigo_Attack_04");
			item9.Configurable = Configurability.Disabled;
			Item item10 = new Item("rd_bestas", "Ghost_Attack_01");
			item10.Configurable = Configurability.Disabled;
			Item item11 = new Item("rd_bestas", "Ghost_Attack_02");
			item11.Configurable = Configurability.Disabled;
			Item item12 = new Item("rd_bestas", "Ghost_Attack_03");
			item12.Configurable = Configurability.Disabled;
			Item item13 = new Item("rd_bestas", "smadrek_cold_attack");
			item13.Configurable = Configurability.Disabled;
			Item item14 = new Item("rd_bestas", "smadrek_fire_attack");
			item14.Configurable = Configurability.Disabled;
			Item item15 = new Item("rd_bestas", "smadrek_fire_clusterbomb");
			item15.Configurable = Configurability.Disabled;
			Item item16 = new Item("rd_bestas", "GrayWolf_Attack1");
			item16.Configurable = Configurability.Disabled;
			Item item17 = new Item("rd_bestas", "GrayWolf_Attack2");
			item17.Configurable = Configurability.Disabled;
			Item item18 = new Item("rd_bestas", "lizardwarrior_spear_01");
			item18.Configurable = Configurability.Disabled;
			Item item19 = new Item("rd_bestas", "lizardwarrior_spear_02");
			item19.Configurable = Configurability.Disabled;
			Item item20 = new Item("rd_bestas", "lizardwarrior_spear_03");
			item20.Configurable = Configurability.Disabled;
			Item item21 = new Item("rd_bestas", "lizardwarrior_spear_04");
			item21.Configurable = Configurability.Disabled;
			Item item22 = new Item("rd_bestas", "lizardwarrior_tongue_01");
			item22.Configurable = Configurability.Disabled;
			Item item23 = new Item("rd_bestas", "attack_claw");
			item23.Configurable = Configurability.Disabled;
			Item item24 = new Item("rd_bestas", "attack_jump_bite");
			item24.Configurable = Configurability.Disabled;
			Item item25 = new Item("rd_bestas", "attack_jump_claws");
			item25.Configurable = Configurability.Disabled;
			Item item26 = new Item("rd_bestas", "bee_attack_01");
			item26.Configurable = Configurability.Disabled;
			Item item27 = new Item("rd_bestas", "attack_shark");
			item27.Configurable = Configurability.Disabled;
			Item item28 = new Item("rd_bestas", "attack_crocodile");
			item28.Configurable = Configurability.Disabled;
			Item item29 = new Item("rd_bestas", "Lion_Attack1");
			item29.Configurable = Configurability.Disabled;
			Item item30 = new Item("rd_bestas", "Lion_Attack2");
			item30.Configurable = Configurability.Disabled;
			Item item31 = new Item("rd_bestas", "Lion_Attack3");
			item31.Configurable = Configurability.Disabled;
			Item item32 = new Item("rd_bestas", "Fox_Attack1");
			item32.Configurable = Configurability.Disabled;
			Item item33 = new Item("rd_bestas", "Fox_Attack2");
			item33.Configurable = Configurability.Disabled;
			Item item34 = new Item("rd_bestas", "ent_stomp");
			item34.Configurable = Configurability.Disabled;
			Item item35 = new Item("rd_bestas", "ent_claws_l");
			item35.Configurable = Configurability.Disabled;
			Item item36 = new Item("rd_bestas", "ent_claws_r");
			item36.Configurable = Configurability.Disabled;
			Item item37 = new Item("rd_bestas", "ent_claws_combo");
			item37.Configurable = Configurability.Disabled;
			Item item38 = new Item("rd_bestas", "rat_jumpbite");
			item38.Configurable = Configurability.Disabled;
			Item item39 = new Item("rd_bestas", "goat_attack_01");
			item39.Configurable = Configurability.Disabled;
			Item item40 = new Item("rd_bestas", "goat_attack_02");
			item40.Configurable = Configurability.Disabled;
			Item item41 = new Item("rd_bestas", "goat_attack_03");
			item41.Configurable = Configurability.Disabled;
			Item item42 = new Item("rd_bestas", "goat_combo_attack_01");
			item42.Configurable = Configurability.Disabled;
			Item item43 = new Item("rd_bestas", "goat_combo_attack_02");
			item43.Configurable = Configurability.Disabled;
			Item item44 = new Item("rd_bestas", "goat_combo_attack_03");
			item44.Configurable = Configurability.Disabled;
		}
	}
	internal static class CreatureDeath_Registry
	{
		public static void RegisterDeathMobs()
		{
			ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "RDB_Ent_death");
			ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "RDB_Goblin_Treasure_blue_death");
			ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "RDB_Goblin_Treasure_death");
			ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "RDB_Goblin_Treasure_red_death");
			ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "RDB_Wendigo_death");
			ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "RDB_Weregoat_death");
			ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "RDB_Werewolf_death");
			ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "RDB_crocodile_death");
			ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "RDB_fox_dead");
			ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "RDB_giant_rat_death");
			ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "RDB_graywolf_death");
			ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "RDB_lion_death");
			ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "RDB_lizardwarrior_death");
			ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "RDB_minotaur_death");
			ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "RDB_rabbit_death");
		}
	}
	internal static class Creature_Registry
	{
		public static void RegisterMobs()
		{
			//IL_0017: 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_032d: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0717: Unknown result type (might be due to invalid IL or missing references)
			//IL_083d: Unknown result type (might be due to invalid IL or missing references)
			//IL_09d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b65: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cf9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e8d: Unknown result type (might be due to invalid IL or missing references)
			//IL_1021: Unknown result type (might be due to invalid IL or missing references)
			//IL_1291: Unknown result type (might be due to invalid IL or missing references)
			//IL_1426: Unknown result type (might be due to invalid IL or missing references)
			//IL_15bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_1753: Unknown result type (might be due to invalid IL or missing references)
			//IL_18eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_1a83: Unknown result type (might be due to invalid IL or missing references)
			//IL_1bad: Unknown result type (might be due to invalid IL or missing references)
			//IL_1db3: Unknown result type (might be due to invalid IL or missing references)
			//IL_1edd: Unknown result type (might be due to invalid IL or missing references)
			//IL_2007: Unknown result type (might be due to invalid IL or missing references)
			Creature creature = new Creature("rd_bestas", "RDB_rabbit")
			{
				Biome = (Biome)1,
				SpecificSpawnArea = SpawnArea.Everywhere,
				RequiredAltitude = new CreatureManager.Range(1f, 1000f),
				RequiredOceanDepth = new CreatureManager.Range(-1f, 0f),
				ForestSpawn = Forest.Both,
				RequiredWeather = Weather.None,
				RequiredGlobalKey = GlobalKey.None,
				SpawnChance = 35f,
				GroupSize = new CreatureManager.Range(1f, 3f),
				CheckSpawnInterval = 900,
				SpecificSpawnTime = SpawnTime.Always,
				Maximum = 3,
				ConfigurationEnabled = true,
				CanHaveStars = true,
				CanSpawn = true,
				CanBeTamed = false
			};
			creature.Drops["BoneFragments"].Amount = new CreatureManager.Range(1f, 2f);
			creature.Drops["BoneFragments"].DropChance = 100f;
			creature.Drops["BoneFragments"].DropOnePerPlayer = false;
			creature.Drops["BoneFragments"].MultiplyDropByLevel = false;
			creature.Drops["LeatherScraps"].Amount = new CreatureManager.Range(1f, 2f);
			creature.Drops["LeatherScraps"].DropChance = 100f;
			creature.Drops["LeatherScraps"].DropOnePerPlayer = false;
			creature.Drops["LeatherScraps"].MultiplyDropByLevel = false;
			Creature creature2 = new Creature("rd_bestas", "RDB_Bee")
			{
				Biome = (Biome)1,
				SpecificSpawnArea = SpawnArea.Everywhere,
				RequiredAltitude = new CreatureManager.Range(1f, 1000f),
				RequiredOceanDepth = new CreatureManager.Range(-1f, 0f),
				ForestSpawn = Forest.Both,
				RequiredWeather = Weather.None,
				RequiredGlobalKey = GlobalKey.None,
				SpawnChance = 10f,
				GroupSize = new CreatureManager.Range(1f, 1f),
				CheckSpawnInterval = 3200,
				SpecificSpawnTime = SpawnTime.Always,
				Maximum = 1,
				ConfigurationEnabled = true,
				CanHaveStars = true,
				CanSpawn = true,
				CanBeTamed = false
			};
			creature2.Drops["Honey"].Amount = new CreatureManager.Range(1f, 10f);
			creature2.Drops["Honey"].DropChance = 100f;
			creature2.Drops["Honey"].DropOnePerPlayer = false;
			creature2.Drops["Honey"].MultiplyDropByLevel = false;
			creature2.Drops["QueenBee"].Amount = new CreatureManager.Range(1f, 1f);
			creature2.Drops["QueenBee"].DropChance = 50f;
			creature2.Drops["QueenBee"].DropOnePerPlayer = false;
			creature2.Drops["QueenBee"].MultiplyDropByLevel = false;
			Creature creature3 = new Creature("rd_bestas", "RDB_fox")
			{
				Biome = (Biome)1,
				SpecificSpawnArea = SpawnArea.Everywhere,
				RequiredAltitude = new CreatureManager.Range(1f, 1000f),
				RequiredOceanDepth = new CreatureManager.Range(-1f, 0f),
				ForestSpawn = Forest.Both,
				RequiredWeather = Weather.None,
				RequiredGlobalKey = GlobalKey.None,
				SpawnChance = 35f,
				GroupSize = new CreatureManager.Range(1f, 2f),
				CheckSpawnInterval = 1900,
				SpecificSpawnTime = SpawnTime.Always,
				Maximum = 2,
				ConfigurationEnabled = true,
				CanHaveStars = true,
				CanSpawn = true,
				CanBeTamed = false
			};
			creature3.Drops["LeatherScraps"].Amount = new CreatureManager.Range(1f, 4f);
			creature3.Drops["LeatherScraps"].DropChance = 100f;
			creature3.Drops["LeatherScraps"].DropOnePerPlayer = false;
			creature3.Drops["LeatherScraps"].MultiplyDropByLevel = false;
			creature3.Drops["BoneFragments"].Amount = new CreatureManager.Range(1f, 4f);
			creature3.Drops["BoneFragments"].DropChance = 50f;
			creature3.Drops["BoneFragments"].DropOnePerPlayer = false;
			creature3.Drops["BoneFragments"].MultiplyDropByLevel = false;
			Creature creature4 = new Creature("rd_bestas", "RDB_Ent")
			{
				Biome = (Biome)8,
				SpecificSpawnArea = SpawnArea.Everywhere,
				RequiredAltitude = new CreatureManager.Range(1f, 1000f),
				RequiredOceanDepth = new CreatureManager.Range(-1f, 0f),
				ForestSpawn = Forest.Both,
				RequiredWeather = Weather.None,
				RequiredGlobalKey = GlobalKey.KilledEikthyr,
				SpawnChance = 60f,
				GroupSize = new CreatureManager.Range(1f, 1f),
				CheckSpawnInterval = 3600,
				SpecificSpawnTime = SpawnTime.Always,
				Maximum = 1,
				ConfigurationEnabled = true,
				CanHaveStars = true,
				CanSpawn = true,
				CanBeTamed = false
			};
			creature4.Drops["FineWood"].Amount = new CreatureManager.Range(20f, 50f);
			creature4.Drops["FineWood"].DropChance = 100f;
			creature4.Drops["FineWood"].DropOnePerPlayer = false;
			creature4.Drops["FineWood"].MultiplyDropByLevel = false;
			creature4.Drops["Feathers"].Amount = new CreatureManager.Range(10f, 15f);
			creature4.Drops["Feathers"].DropChance = 100f;
			creature4.Drops["Feathers"].DropOnePerPlayer = false;
			creature4.Drops["Feathers"].MultiplyDropByLevel = false;
			creature4.Drops["AncientSeed"].Amount = new CreatureManager.Range(2f, 5f);
			creature4.Drops["AncientSeed"].DropChance = 100f;
			creature4.Drops["AncientSeed"].DropOnePerPlayer = false;
			creature4.Drops["AncientSeed"].MultiplyDropByLevel = false;
			creature4.Drops["Acorn"].Amount = new CreatureManager.Range(5f, 10f);
			creature4.Drops["Acorn"].DropChance = 100f;
			creature4.Drops["Acorn"].DropOnePerPlayer = false;
			creature4.Drops["Acorn"].MultiplyDropByLevel = false;
			Creature creature5 = new Creature("rd_bestas", "RDB_crocodile")
			{
				Biome = (Biome)8,
				SpecificSpawnArea = SpawnArea.Edge,
				RequiredAltitude = new CreatureManager.Range(-1f, 1f),
				RequiredOceanDepth = new CreatureManager.Range(-1f, 1f),
				ForestSpawn = Forest.Both,
				RequiredWeather = Weather.None,
				RequiredGlobalKey = GlobalKey.KilledEikthyr,
				SpawnChance = 45f,
				GroupSize = new CreatureManager.Range(1f, 2f),
				CheckSpawnInterval = 1800,
				SpecificSpawnTime = SpawnTime.Always,
				Maximum = 2,
				ConfigurationEnabled = true,
				CanHaveStars = true,
				CanSpawn = true,
				CanBeTamed = false
			};
			creature5.Drops["FishRaw"].Amount = new CreatureManager.Range(1f, 10f);
			creature5.Drops["FishRaw"].DropChance = 100f;
			creature5.Drops["FishRaw"].DropOnePerPlayer = false;
			creature5.Drops["FishRaw"].MultiplyDropByLevel = false;
			Creature creature6 = new Creature("rd_bestas", "RDB_minotaur")
			{
				Biome = (Biome)8,
				SpecificSpawnArea = SpawnArea.Everywhere,
				RequiredAltitude = new CreatureManager.Range(1f, 1000f),
				RequiredOceanDepth = new CreatureManager.Range(-1f, 0f),
				ForestSpawn = Forest.Both,
				RequiredWeather = Weather.None,
				RequiredGlobalKey = GlobalKey.KilledEikthyr,
				SpawnChance = 60f,
				GroupSize = new CreatureManager.Range(1f, 2f),
				CheckSpawnInterval = 1800,
				SpecificSpawnTime = SpawnTime.Always,
				Maximum = 2,
				ConfigurationEnabled = true,
				CanHaveStars = true,
				CanSpawn = true,
				CanBeTamed = false
			};
			creature6.Drops["RDB_minotaur_trophy"].Amount = new CreatureManager.Range(1f, 1f);
			creature6.Drops["RDB_minotaur_trophy"].DropChance = 5f;
			creature6.Drops["RDB_minotaur_trophy"].DropOnePerPlayer = false;
			creature6.Drops["RDB_minotaur_trophy"].MultiplyDropByLevel = false;
			creature6.Drops["Coins"].Amount = new CreatureManager.Range(20f, 50f);
			creature6.Drops["Coins"].DropChance = 100f;
			creature6.Drops["Coins"].DropOnePerPlayer = false;
			creature6.Drops["Coins"].MultiplyDropByLevel = false;
			Creature creature7 = new Creature("rd_bestas", "RDB_Genganger")
			{
				Biome = (Biome)8,
				SpecificSpawnArea = SpawnArea.Everywhere,
				RequiredAltitude = new CreatureManager.Range(1f, 1000f),
				RequiredOceanDepth = new CreatureManager.Range(-1f, 0f),
				ForestSpawn = Forest.Both,
				RequiredWeather = Weather.None,
				RequiredGlobalKey = GlobalKey.KilledEikthyr,
				SpawnChance = 45f,
				GroupSize = new CreatureManager.Range(1f, 2f),
				CheckSpawnInterval = 1800,
				SpecificSpawnTime = SpawnTime.Night,
				Maximum = 2,
				ConfigurationEnabled = true,
				CanHaveStars = true,
				CanSpawn = true,
				CanBeTamed = false
			};
			creature7.Drops["Coins"].Amount = new CreatureManager.Range(5f, 20f);
			creature7.Drops["Coins"].DropChance = 100f;
			creature7.Drops["Coins"].DropOnePerPlayer = false;
			creature7.Drops["Coins"].MultiplyDropByLevel = false;
			creature7.Drops["Ectoplasm"].Amount = new CreatureManager.Range(1f, 2f);
			creature7.Drops["Ectoplasm"].DropChance = 50f;
			creature7.Drops["Ectoplasm"].DropOnePerPlayer = false;
			creature7.Drops["Ectoplasm"].MultiplyDropByLevel = false;
			Creature creature8 = new Creature("rd_bestas", "RDB_Wendigo")
			{
				Biome = (Biome)2,
				SpecificSpawnArea = SpawnArea.Everywhere,
				RequiredAltitude = new CreatureManager.Range(-2f, 1000f),
				RequiredOceanDepth = new CreatureManager.Range(-1f, 1f),
				ForestSpawn = Forest.Both,
				RequiredWeather = Weather.None,
				RequiredGlobalKey = GlobalKey.KilledElder,
				SpawnChance = 45f,
				GroupSize = new CreatureManager.Range(1f, 1f),
				CheckSpawnInterval = 1900,
				SpecificSpawnTime = SpawnTime.Night,
				Maximum = 1,
				ConfigurationEnabled = true,
				CanHaveStars = true,
				CanSpawn = true,
				CanBeTamed = false
			};
			creature8.Drops["Entrails"].Amount = new CreatureManager.Range(1f, 4f);
			creature8.Drops["Entrails"].DropChance = 100f;
			creature8.Drops["Entrails"].DropOnePerPlayer = false;
			creature8.Drops["Entrails"].MultiplyDropByLevel = false;
			creature8.Drops["Root"].Amount = new CreatureManager.Range(1f, 2f);
			creature8.Drops["Root"].DropChance = 100f;
			creature8.Drops["Root"].DropOnePerPlayer = false;
			creature8.Drops["Root"].MultiplyDropByLevel = false;
			Creature creature9 = new Creature("rd_bestas", "RDB_lizardwarrior")
			{
				Biome = (Biome)2,
				SpecificSpawnArea = SpawnArea.Everywhere,
				RequiredAltitude = new CreatureManager.Range(-2f, 1000f),
				RequiredOceanDepth = new CreatureManager.Range(-1f, 1f),
				ForestSpawn = Forest.Both,
				RequiredWeather = Weather.None,
				RequiredGlobalKey = GlobalKey.KilledElder,
				SpawnChance = 35f,
				GroupSize = new CreatureManager.Range(1f, 3f),
				CheckSpawnInterval = 1200,
				SpecificSpawnTime = SpawnTime.Day,
				Maximum = 3,
				ConfigurationEnabled = true,
				CanHaveStars = true,
				CanSpawn = true,
				CanBeTamed = false
			};
			creature9.Drops["Entrails"].Amount = new CreatureManager.Range(1f, 4f);
			creature9.Drops["Entrails"].DropChance = 100f;
			creature9.Drops["Entrails"].DropOnePerPlayer = false;
			creature9.Drops["Entrails"].MultiplyDropByLevel = false;
			creature9.Drops["Root"].Amount = new CreatureManager.Range(1f, 2f);
			creature9.Drops["Root"].DropChance = 100f;
			creature9.Drops["Root"].DropOnePerPlayer = false;
			creature9.Drops["Root"].MultiplyDropByLevel = false;
			Creature creature10 = new Creature("rd_bestas", "RDB_giant_rat")
			{
				Biome = (Biome)2,
				SpecificSpawnArea = SpawnArea.Everywhere,
				RequiredAltitude = new CreatureManager.Range(-2f, 1000f),
				RequiredOceanDepth = new CreatureManager.Range(-1f, 1f),
				ForestSpawn = Forest.Both,
				RequiredWeather = Weather.None,
				RequiredGlobalKey = GlobalKey.KilledElder,
				SpawnChance = 50f,
				GroupSize = new CreatureManager.Range(3f, 5f),
				CheckSpawnInterval = 1900,
				SpecificSpawnTime = SpawnTime.Always,
				Maximum = 5,
				ConfigurationEnabled = true,
				CanHaveStars = true,
				CanSpawn = true,
				CanBeTamed = false
			};
			creature10.Drops["Entrails"].Amount = new CreatureManager.Range(1f, 4f);
			creature10.Drops["Entrails"].DropChance = 100f;
			creature10.Drops["Entrails"].DropOnePerPlayer = false;
			creature10.Drops["Entrails"].MultiplyDropByLevel = false;
			creature10.Drops["LeatherScraps"].Amount = new CreatureManager.Range(1f, 4f);
			creature10.Drops["LeatherScraps"].DropChance = 100f;
			creature10.Drops["LeatherScraps"].DropOnePerPlayer = false;
			creature10.Drops["LeatherScraps"].MultiplyDropByLevel = false;
			Creature creature11 = new Creature("rd_bestas", "RDB_Werewolf")
			{
				Biome = (Biome)4,
				SpecificSpawnArea = SpawnArea.Everywhere,
				RequiredAltitude = new CreatureManager.Range(1f, 1000f),
				RequiredOceanDepth = new CreatureManager.Range(-1f, 0f),
				ForestSpawn = Forest.Both,
				RequiredWeather = Weather.None,
				RequiredGlobalKey = GlobalKey.KilledBonemass,
				SpawnChance = 45f,
				GroupSize = new CreatureManager.Range(1f, 1f),
				CheckSpawnInterval = 1800,
				SpecificSpawnTime = SpawnTime.Night,
				Maximum = 1,
				ConfigurationEnabled = true,
				CanHaveStars = true,
				CanSpawn = true,
				CanBeTamed = false
			};
			creature11.Drops["TrophyFenring"].Amount = new CreatureManager.Range(1f, 1f);
			creature11.Drops["TrophyFenring"].DropChance = 5f;
			creature11.Drops["TrophyFenring"].DropOnePerPlayer = false;
			creature11.Drops["TrophyFenring"].MultiplyDropByLevel = false;
			creature11.Drops["WolfFang"].Amount = new CreatureManager.Range(1f, 2f);
			creature11.Drops["WolfFang"].DropChance = 100f;
			creature11.Drops["WolfFang"].DropOnePerPlayer = false;
			creature11.Drops["WolfFang"].MultiplyDropByLevel = false;
			creature11.Drops["JuteRed"].Amount = new CreatureManager.Range(1f, 2f);
			creature11.Drops["JuteRed"].DropChance = 50f;
			creature11.Drops["JuteRed"].DropOnePerPlayer = false;
			creature11.Drops["JuteRed"].MultiplyDropByLevel = false;
			creature11.Drops["Crystal"].Amount = new CreatureManager.Range(1f, 6f);
			creature11.Drops["Crystal"].DropChance = 50f;
			creature11.Drops["Crystal"].DropOnePerPlayer = false;
			creature11.Drops["Crystal"].MultiplyDropByLevel = false;
			Creature creature12 = new Creature("rd_bestas", "RDB_Weregoat")
			{
				Biome = (Biome)4,
				SpecificSpawnArea = SpawnArea.Everywhere,
				RequiredAltitude = new CreatureManager.Range(1f, 1000f),
				RequiredOceanDepth = new CreatureManager.Range(-1f, 0f),
				ForestSpawn = Forest.Both,
				RequiredWeather = Weather.None,
				RequiredGlobalKey = GlobalKey.KilledBonemass,
				SpawnChance = 55f,
				GroupSize = new CreatureManager.Range(2f, 3f),
				CheckSpawnInterval = 2400,
				SpecificSpawnTime = SpawnTime.Always,
				Maximum = 3,
				ConfigurationEnabled = true,
				CanHaveStars = true,
				CanSpawn = true,
				CanBeTamed = false
			};
			creature12.Drops["JuteRed"].Amount = new CreatureManager.Range(1f, 2f);
			creature12.Drops["JuteRed"].DropChance = 50f;
			creature12.Drops["JuteRed"].DropOnePerPlayer = false;
			creature12.Drops["JuteRed"].MultiplyDropByLevel = false;
			creature12.Drops["Crystal"].Amount = new CreatureManager.Range(1f, 6f);
			creature12.Drops["Crystal"].DropChance = 50f;
			creature12.Drops["Crystal"].DropOnePerPlayer = false;
			creature12.Drops["Crystal"].MultiplyDropByLevel = false;
			Creature creature13 = new Creature("rd_bestas", "RDB_lion")
			{
				Biome = (Biome)16,
				SpecificSpawnArea = SpawnArea.Everywhere,
				RequiredAltitude = new CreatureManager.Range(1f, 1000f),
				RequiredOceanDepth = new CreatureManager.Range(-1f, 0f),
				ForestSpawn = Forest.Both,
				RequiredWeather = Weather.None,
				RequiredGlobalKey = GlobalKey.KilledModer,
				SpawnChance = 35f,
				GroupSize = new CreatureManager.Range(1f, 2f),
				CheckSpawnInterval = 1900,
				SpecificSpawnTime = SpawnTime.Day,
				Maximum = 2,
				ConfigurationEnabled = true,
				CanHaveStars = true,
				CanSpawn = true,
				CanBeTamed = false
			};
			creature13.Drops["GoblinTotem"].Amount = new CreatureManager.Range(1f, 1f);
			creature13.Drops["GoblinTotem"].DropChance = 50f;
			creature13.Drops["GoblinTotem"].DropOnePerPlayer = false;
			creature13.Drops["GoblinTotem"].MultiplyDropByLevel = false;
			creature13.Drops["BlackMetalScrap"].Amount = new CreatureManager.Range(1f, 5f);
			creature13.Drops["BlackMetalScrap"].DropChance = 100f;
			creature13.Drops["BlackMetalScrap"].DropOnePerPlayer = false;
			creature13.Drops["BlackMetalScrap"].MultiplyDropByLevel = false;
			Creature creature14 = new Creature("rd_bestas", "RDB_graywolf")
			{
				Biome = (Biome)16,
				SpecificSpawnArea = SpawnArea.Everywhere,
				RequiredAltitude = new CreatureManager.Range(1f, 1000f),
				RequiredOceanDepth = new CreatureManager.Range(-1f, 0f),
				ForestSpawn = Forest.Both,
				RequiredWeather = Weather.None,
				RequiredGlobalKey = GlobalKey.KilledModer,
				SpawnChance = 35f,
				GroupSize = new CreatureManager.Range(1f, 2f),
				CheckSpawnInterval = 1600,
				SpecificSpawnTime = SpawnTime.Night,
				Maximum = 2,
				ConfigurationEnabled = true,
				CanHaveStars = true,
				CanSpawn = true,
				CanBeTamed = false
			};
			creature14.Drops["WolfMeat"].Amount = new CreatureManager.Range(1f, 3f);
			creature14.Drops["WolfMeat"].DropChance = 100f;
			creature14.Drops["WolfMeat"].DropOnePerPlayer = false;
			creature14.Drops["WolfMeat"].MultiplyDropByLevel = false;
			creature14.Drops["WolfFang"].Amount = new CreatureManager.Range(1f, 1f);
			creature14.Drops["WolfFang"].DropChance = 50f;
			creature14.Drops["WolfFang"].DropOnePerPlayer = false;
			creature14.Drops["WolfFang"].MultiplyDropByLevel = false;
			Creature creature15 = new Creature("rd_bestas", "RDB_Smadrek")
			{
				Biome = (Biome)512,
				SpecificSpawnArea = SpawnArea.Everywhere,
				RequiredAltitude = new CreatureManager.Range(1f, 1000f),
				RequiredOceanDepth = new CreatureManager.Range(-1f, 0f),
				ForestSpawn = Forest.Both,
				RequiredWeather = Weather.None,
				RequiredGlobalKey = GlobalKey.KilledYagluth,
				SpawnChance = 20f,
				GroupSize = new CreatureManager.Range(1f, 1f),
				CheckSpawnInterval = 3600,
				SpecificSpawnTime = SpawnTime.Always,
				Maximum = 1,
				ConfigurationEnabled = true,
				CanHaveStars = true,
				CanSpawn = true,
				CanBeTamed = false
			};
			creature15.Drops["Softtissue"].Amount = new CreatureManager.Range(1f, 5f);
			creature15.Drops["Softtissue"].DropChance = 100f;
			creature15.Drops["Softtissue"].DropOnePerPlayer = false;
			creature15.Drops["Softtissue"].MultiplyDropByLevel = false;
			creature15.Drops["Coins"].Amount = new CreatureManager.Range(1f, 100f);
			creature15.Drops["Coins"].DropChance = 100f;
			creature15.Drops["Coins"].DropOnePerPlayer = false;
			creature15.Drops["Coins"].MultiplyDropByLevel = false;
			Creature creature16 = new Creature("rd_bestas", "RDB_white_shark")
			{
				Biome = (Biome)256,
				SpecificSpawnArea = SpawnArea.Everywhere,
				RequiredAltitude = new CreatureManager.Range(-1000f, -0.5f),
				RequiredOceanDepth = new CreatureManager.Range(10f, 200f),
				ForestSpawn = Forest.Both,
				RequiredWeather = Weather.None,
				RequiredGlobalKey = GlobalKey.KilledElder,
				SpawnChance = 35f,
				GroupSize = new CreatureManager.Range(1f, 2f),
				CheckSpawnInterval = 1800,
				SpecificSpawnTime = SpawnTime.Always,
				Maximum = 2,
				ConfigurationEnabled = true,
				CanHaveStars = true,
				CanSpawn = true,
				CanBeTamed = false
			};
			creature16.Drops["SerpentScale"].Amount = new CreatureManager.Range(1f, 5f);
			creature16.Drops["SerpentScale"].DropChance = 100f;
			creature16.Drops["SerpentScale"].DropOnePerPlayer = false;
			creature16.Drops["SerpentScale"].MultiplyDropByLevel = false;
			creature16.Drops["SerpentMeat"].Amount = new CreatureManager.Range(1f, 5f);
			creature16.Drops["SerpentMeat"].DropChance = 100f;
			creature16.Drops["SerpentMeat"].DropOnePerPlayer = false;
			creature16.Drops["SerpentMeat"].MultiplyDropByLevel = false;
			Creature creature17 = new Creature("rd_bestas", "RDB_turtle")
			{
				Biome = (Biome)256,
				SpecificSpawnArea = SpawnArea.Everywhere,
				RequiredAltitude = new CreatureManager.Range(-1000f, -0.5f),
				RequiredOceanDepth = new CreatureManager.Range(10f, 200f),
				ForestSpawn = Forest.Both,
				RequiredWeather = Weather.None,
				RequiredGlobalKey = GlobalKey.KilledElder,
				SpawnChance = 50f,
				GroupSize = new CreatureManager.Range(1f, 2f),
				CheckSpawnInterval = 1600,
				SpecificSpawnTime = SpawnTime.Always,
				Maximum = 2,
				ConfigurationEnabled = true,
				CanHaveStars = true,
				CanSpawn = true,
				CanBeTamed = false
			};
			creature17.Drops["Chitin"].Amount = new CreatureManager.Range(1f, 10f);
			creature17.Drops["Chitin"].DropChance = 100f;
			creature17.Drops["Chitin"].DropOnePerPlayer = false;
			creature17.Drops["Chitin"].MultiplyDropByLevel = false;
			Creature creature18 = new Creature("rd_bestas", "RDB_Whale")
			{
				Biome = (Biome)256,
				SpecificSpawnArea = SpawnArea.Everywhere,
				RequiredAltitude = new CreatureManager.Range(-1000f, -0.5f),
				RequiredOceanDepth = new CreatureManager.Range(10f, 200f),
				ForestSpawn = Forest.Both,
				RequiredWeather = Weather.None,
				RequiredGlobalKey = GlobalKey.KilledElder,
				SpawnChance = 50f,
				GroupSize = new CreatureManager.Range(1f, 3f),
				CheckSpawnInterval = 7200,
				SpecificSpawnTime = SpawnTime.Always,
				Maximum = 3,
				ConfigurationEnabled = true,
				CanHaveStars = true,
				CanSpawn = true,
				CanBeTamed = false
			};
			creature18.Drops["SerpentScale"].Amount = new CreatureManager.Range(1f, 10f);
			creature18.Drops["SerpentScale"].DropChance = 100f;
			creature18.Drops["SerpentScale"].DropOnePerPlayer = false;
			creature18.Drops["SerpentScale"].MultiplyDropByLevel = false;
			creature18.Drops["Chitin"].Amount = new CreatureManager.Range(10f, 25f);
			creature18.Drops["Chitin"].DropChance = 100f;
			creature18.Drops["Chitin"].DropOnePerPlayer = false;
			creature18.Drops["Chitin"].MultiplyDropByLevel = false;
			creature18.Drops["SerpentMeat"].Amount = new CreatureManager.Range(1f, 10f);
			creature18.Drops["SerpentMeat"].DropChance = 100f;
			creature18.Drops["SerpentMeat"].DropOnePerPlayer = false;
			creature18.Drops["SerpentMeat"].MultiplyDropByLevel = false;
			Creature creature19 = new Creature("rd_bestas", "RDB_Goblin_Treasure")
			{
				Biome = (Biome)895,
				SpecificSpawnArea = SpawnArea.Everywhere,
				RequiredAltitude = new CreatureManager.Range(1f, 1000f),
				RequiredOceanDepth = new CreatureManager.Range(-1f, 0f),
				ForestSpawn = Forest.Both,
				RequiredWeather = Weather.None,
				RequiredGlobalKey = GlobalKey.KilledEikthyr,
				SpawnChance = 2f,
				GroupSize = new CreatureManager.Range(1f, 1f),
				CheckSpawnInterval = 7200,
				SpecificSpawnTime = SpawnTime.Always,
				Maximum = 1,
				ConfigurationEnabled = true,
				CanHaveStars = false,
				CanSpawn = true,
				CanBeTamed = false
			};
			creature19.Drops["Coins"].Amount = new CreatureManager.Range(1f, 250f);
			creature19.Drops["Coins"].DropChance = 100f;
			creature19.Drops["Coins"].DropOnePerPlayer = false;
			creature19.Drops["Coins"].MultiplyDropByLevel = false;
			Creature creature20 = new Creature("rd_bestas", "RDB_Goblin_Treasure_blue")
			{
				Biome = (Biome)895,
				SpecificSpawnArea = SpawnArea.Everywhere,
				RequiredAltitude = new CreatureManager.Range(1f, 1000f),
				RequiredOceanDepth = new CreatureManager.Range(-1f, 0f),
				ForestSpawn = Forest.Both,
				RequiredWeather = Weather.None,
				RequiredGlobalKey = GlobalKey.KilledBonemass,
				SpawnChance = 2f,
				GroupSize = new CreatureManager.Range(1f, 1f),
				CheckSpawnInterval = 7200,
				SpecificSpawnTime = SpawnTime.Always,
				Maximum = 1,
				ConfigurationEnabled = true,
				CanHaveStars = false,
				CanSpawn = true,
				CanBeTamed = false
			};
			creature20.Drops["Coins"].Amount = new CreatureManager.Range(1f, 500f);
			creature20.Drops["Coins"].DropChance = 100f;
			creature20.Drops["Coins"].DropOnePerPlayer = false;
			creature20.Drops["Coins"].MultiplyDropByLevel = false;
			Creature creature21 = new Creature("rd_bestas", "RDB_Goblin_Treasure_red")
			{
				Biome = (Biome)895,
				SpecificSpawnArea = SpawnArea.Everywhere,
				RequiredAltitude = new CreatureManager.Range(1f, 1000f),
				RequiredOceanDepth = new CreatureManager.Range(-1f, 0f),
				ForestSpawn = Forest.Both,
				RequiredWeather = Weather.None,
				RequiredGlobalKey = GlobalKey.KilledYagluth,
				SpawnChance = 2f,
				GroupSize = new CreatureManager.Range(1f, 1f),
				CheckSpawnInterval = 7200,
				SpecificSpawnTime = SpawnTime.Always,
				Maximum = 1,
				ConfigurationEnabled = true,
				CanHaveStars = false,
				CanSpawn = true,
				CanBeTamed = false
			};
			creature21.Drops["Coins"].Amount = new CreatureManager.Range(1f, 1000f);
			creature21.Drops["Coins"].DropChance = 100f;
			creature21.Drops["Coins"].DropOnePerPlayer = false;
			creature21.Drops["Coins"].MultiplyDropByLevel = false;
		}
	}
	public static class Effect_Registry
	{
		public static void RegisterEffects()
		{
			GameObject val = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_hatchling_alerted_rd_bestas");
			GameObject val2 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_hatchling_hurt_rd_bestas");
			GameObject val3 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_hatchling_idle_rd_bestas");
			GameObject val4 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_hatcling_hurt_rd_bestas");
			GameObject val5 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "fx_crit_rd_bestas");
			GameObject val6 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "fx_backstab_rd_bestas");
			GameObject val7 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_hatchling_death_rd_bestas");
			GameObject val8 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_hatchling_death_rd_bestas");
			GameObject val9 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_water_surface_rd_bestas");
			GameObject val10 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_HitSparks_rd_bestas");
			GameObject val11 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_greydwarf_attack_hit_rd_bestas");
			GameObject val12 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_GoblinShaman_fireball_launch_rd_bestas");
			GameObject val13 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "fx_shaman_fireball_expl_rd_bestas");
			GameObject val14 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_hatchling_coldball_start_rd_bestas");
			GameObject val15 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_corpse_destruction_small_rd_bestas");
			GameObject val16 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_corpse_destruction_medium_rd_bestas");
			GameObject val17 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_corpse_destruction_medium_ent_rd_bestas");
			GameObject val18 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_deer_hit_rd_bestas");
			GameObject val19 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_greydwarf_hit_rd_bestas");
			GameObject val20 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_goblin_death_rd_bestas");
			GameObject val21 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_goblin_death_rd_bestas");
			GameObject val22 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_goblin_alerted_rd_bestas");
			GameObject val23 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_goblin_idle_rd_bestas");
			GameObject val24 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_goblin_idle_coins_rd_bestas");
			GameObject val25 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "fx_footstep_jog_rd_bestas");
			GameObject val26 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "fx_footstep_run_rd_bestas");
			GameObject val27 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "fx_footstep_water_rd_bestas");
			GameObject val28 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "fx_footstep_mud_jog_rd_bestas");
			GameObject val29 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "fx_footstep_mud_run_rd_bestas");
			GameObject val30 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_footstep_swim_rd_bestas");
			GameObject val31 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_footstep_sneak_rd_bestas");
			GameObject val32 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "fx_footstep_climb_rd_bestas");
			GameObject val33 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "fx_footstep_snow_jog_rd_bestas");
			GameObject val34 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "fx_footstep_snow_run_rd_bestas");
			GameObject val35 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_neck_death_rd_bestas");
			GameObject val36 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_neck_death_rd_bestas");
			GameObject val37 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_neck_attack_rd_bestas");
			GameObject val38 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_neck_hit_rd_bestas");
			GameObject val39 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_neck_hit_rd_bestas");
			GameObject val40 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_neck_attack_hit_rd_bestas");
			GameObject val41 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "fx_bat_hit_rd_bestas");
			GameObject val42 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "fx_bat_death_rd_bestas");
			GameObject val43 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_vulture_death_rd_bestas");
			GameObject val44 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_vulture_alert_rd_bestas");
			GameObject val45 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_vulture_idle_rd_bestas");
			GameObject val46 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_clubhit_rd_bestas");
			GameObject val47 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_club_hit_rd_bestas");
			GameObject val48 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_wraith_attack_hit_rd_bestas");
			GameObject val49 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_vulture_attack_claw_rd_bestas");
			GameObject val50 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_hare_death_vocal_rd_bestas");
			GameObject val51 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "fx_hare_death_rd_bestas");
			GameObject val52 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_hare_footstep_run_rd_bestas");
			GameObject val53 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_hare_alerted_rd_bestas");
			GameObject val54 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_hare_idle_rd_bestas");
			GameObject val55 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_wolf_hit_rd_bestas");
			GameObject val56 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_wolf_hit_rd_bestas");
			GameObject val57 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_wolf_death_rd_bestas");
			GameObject val58 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_wolf_death_rd_bestas");
			GameObject val59 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_wolf_attack_hit_rd_bestas");
			GameObject val60 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_wolf_attack_rd_bestas");
			GameObject val61 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_wolf_alerted_rd_bestas");
			GameObject val62 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "fx_wolf_footstep_snow_run_rd_bestas");
			GameObject val63 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_foresttroll_hit_rd_bestas");
			GameObject val64 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_troll_hit_rd_bestas");
			GameObject val65 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_troll_death_rd_bestas");
			GameObject val66 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_troll_death_rd_bestas");
			GameObject val67 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "fx_troll_love_rd_bestas");
			GameObject val68 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_troll_alerted_rd_bestas");
			GameObject val69 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_troll_idle_rd_bestas");
			GameObject val70 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_troll_attack_hit_rd_bestas");
			GameObject val71 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_troll_attack_hit_rd_bestas");
			GameObject val72 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_troll_attacking_rd_bestas");
			GameObject val73 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "fx_swing_camshake_rd_bestas");
			GameObject val74 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "fx_hit_camshake_rd_bestas");
			GameObject val75 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_troll_log_hitground_rd_bestas");
			GameObject val76 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_troll_rock_destroyed_rd_bestas");
			GameObject val77 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_metal_blocked_rd_bestas");
			GameObject val78 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_blocked_rd_bestas");
			GameObject val79 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "fx_block_camshake_rd_bestas");
			GameObject val80 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_troll_footstep_rd_bestas");
			GameObject val81 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_troll_footstep_rd_bestas");
			GameObject val82 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_troll_footstep_water_rd_bestas");
			GameObject val83 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_troll_footstep_water_rd_bestas");
			GameObject val84 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_serpent_attack_hit_rd_bestas");
			GameObject val85 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_serpent_attack_rd_bestas");
			GameObject val86 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_serpent_attack_trigger_rd_bestas");
			GameObject val87 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_serpent_attack_trigger_rd_bestas");
			GameObject val88 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "fx_BonemawSerpent_Spit_Hit_rd_bestas");
			GameObject val89 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_bonemaw_serpent_spit_hit_rd_bestas");
			GameObject val90 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_bonemaw_serpent_spit_rd_bestas");
			GameObject val91 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_leech_attack_hit_rd_bestas");
			GameObject val92 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_serpent_idle_rd_bestas");
			GameObject val93 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_serpent_taunt_rd_bestas");
			GameObject val94 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_leech_hit_rd_bestas");
			GameObject val95 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_serpent_hurt_rd_bestas");
			GameObject val96 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_serpent_death_rd_bestas");
			GameObject val97 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_leech_death_rd_bestas");
			GameObject val98 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_serpent_watersurface_rd_bestas");
			GameObject val99 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "fx_shaman_iceball_expl_rd_bestas");
			GameObject val100 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_hjall_spit_hit_rd_bestas");
			GameObject val101 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_hatchling_alerted_poison_rd_bestas");
			GameObject val102 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_hatchling_idle_poison_rd_bestas");
			GameObject val103 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_hatchling_coldball_launch_rd_bestas");
			GameObject val104 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_wood_blocked_rd_bestas");
			GameObject val105 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_club_swing_rd_bestas");
			GameObject val106 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "fx_DvergerMage_Fire_hit_rd_bestas");
			GameObject val107 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_minotaur_attack_hit_rd_bestas");
			GameObject val108 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_minotaur_attack_rd_bestas");
			GameObject val109 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_minotaur_hit_rd_bestas");
			GameObject val110 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_minotaur_hit_rd_bestas");
			GameObject val111 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_minotaur_idle_rd_bestas");
			GameObject val112 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_minotaur_alerted_rd_bestas");
			GameObject val113 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_minotaur_death_rd_bestas");
			GameObject val114 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_minotaur_death_rd_bestas");
			GameObject val115 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_vendigo_alerted_rd_bestas");
			GameObject val116 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_vendigo_attack_hit_rd_bestas");
			GameObject val117 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_vendigo_attack_rd_bestas");
			GameObject val118 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_vendigo_death_rd_bestas");
			GameObject val119 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_vendigo_hit_rd_bestas");
			GameObject val120 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_vendigo_idle_rd_bestas");
			GameObject val121 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_vendigo_hit_rd_bestas");
			GameObject val122 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_genganger_death_rd_bestas");
			GameObject val123 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_genganger_attack_rd_bestas");
			GameObject val124 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_genganger_attack_hit_rd_bestas");
			GameObject val125 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_genganger_idle_rd_bestas");
			GameObject val126 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_genganger_death_rd_bestas");
			GameObject val127 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_genganger_hit_rd_bestas");
			GameObject val128 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_genganger_hit_rd_bestas");
			GameObject val129 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_genganger_alerted_rd_bestas");
			GameObject val130 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_HitSparks_genganger_rd_bestas");
			GameObject val131 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_smadrek_ColdBall_launch_rd_bestas");
			GameObject val132 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_smadrek_FireBall_launch_rd_bestas");
			GameObject val133 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_smadrek_ColdBall_Hit_rd_bestas");
			GameObject val134 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_smadrek_FireBall_Hit_rd_bestas");
			GameObject val135 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_smadrek_hatchling_coldball_explode_rd_bestas");
			GameObject val136 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_smadrek_hatchling_fireball_explode_rd_bestas");
			GameObject val137 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_smadrek_hatchling_coldball_launch_rd_bestas");
			GameObject val138 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_smadrek_hatchling_fireball_launch_rd_bestas");
			GameObject val139 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_smadrek_attack_hit_rd_bestas");
			GameObject val140 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_smadrek_coldball_start_rd_bestas");
			GameObject val141 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_smadrek_fireball_start_rd_bestas");
			GameObject val142 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_smadrek_death_rd_bestas");
			GameObject val143 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_smadrek_alerted_rd_bestas");
			GameObject val144 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_smadrek_idle_rd_bestas");
			GameObject val145 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_smadrek_flap_rd_bestas");
			GameObject val146 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "smadrek_cold_projectile");
			GameObject val147 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "smadrek_fire_projectile");
			GameObject val148 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "smadrek_fire_clusterbomb_projectile");
			GameObject val149 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "smadrek_fire_clusterbomb_aoe");
			GameObject val150 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "fx_rabbit_death_rd_bestas");
			GameObject val151 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_rabbit_alerted_rd_bestas");
			GameObject val152 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_rabbit_death_vocal_rd_bestas");
			GameObject val153 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_rabbit_footstep_run_rd_bestas");
			GameObject val154 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_rabbit_idle_rd_bestas");
			GameObject val155 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_lizardwarrior_hit_rd_bestas");
			GameObject val156 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_lizardwarrior_hit_rd_bestas");
			GameObject val157 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_lizardwarrior_death_rd_bestas");
			GameObject val158 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_lizardwarrior_death_rd_bestas");
			GameObject val159 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_lizardwarrior_alerted_rd_bestas");
			GameObject val160 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_lizardwarrior_idle_rd_bestas");
			GameObject val161 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_lizardwarrior_attack_hit_rd_bestas");
			GameObject val162 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_lizardwarrior_attack_rd_bestas");
			GameObject val163 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_lizardwarrior_attack_tongue_hit_rd_bestas");
			GameObject val164 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_lizardwarrior_attack_tongue_rd_bestas");
			GameObject val165 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_HitSparks_lizardwarrior_rd_bestas");
			GameObject val166 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_werewolf_howl_rd_bestas");
			GameObject val167 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_werewolf_death_rd_bestas");
			GameObject val168 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_werewolf_death_rd_bestas");
			GameObject val169 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_werewolf_hurt_rd_bestas");
			GameObject val170 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_werewolf_alerted_rd_bestas");
			GameObject val171 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_werewolf_idle_rd_bestas");
			GameObject val172 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_werewolf_attack_hit_rd_bestas");
			GameObject val173 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_werewolf_attack_rd_bestas");
			GameObject val174 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_goblin_red_death_rd_bestas");
			GameObject val175 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_goblin_blue_death_rd_bestas");
			GameObject val176 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_bee_attack_rd_bestas");
			GameObject val177 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "fx_bee_death_rd_bestas");
			GameObject val178 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "fx_bee_hit_rd_bestas");
			GameObject val179 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_shark_attack_hit_rd_bestas");
			GameObject val180 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_shark_attack_rd_bestas");
			GameObject val181 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_shark_hit_rd_bestas");
			GameObject val182 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_shark_idle_rd_bestas");
			GameObject val183 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_shark_death_rd_bestas");
			GameObject val184 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_shark_hurt_rd_bestas");
			GameObject val185 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_crocodile_alerted_rd_bestas");
			GameObject val186 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_crocodile_attack_hit_rd_bestas");
			GameObject val187 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_crocodile_attack_rd_bestas");
			GameObject val188 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_crocodile_death_rd_bestas");
			GameObject val189 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_crocodile_hit_rd_bestas");
			GameObject val190 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_crocodile_idle_rd_bestas");
			GameObject val191 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_crocodile_death_rd_bestas");
			GameObject val192 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_crocofile_hit_rd_bestas");
			GameObject val193 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_lion_attack_hit_rd_bestas");
			GameObject val194 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_lion_attack_rd_bestas");
			GameObject val195 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_lion_hit_rd_bestas");
			GameObject val196 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_lion_hit_rd_bestas");
			GameObject val197 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_lion_death_rd_bestas");
			GameObject val198 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_lion_death_rd_bestas");
			GameObject val199 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_lion_alerted_rd_bestas");
			GameObject val200 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_lion_idle_rd_bestas");
			GameObject val201 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_lion_roar_rd_bestas");
			GameObject val202 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_fox_hit_rd_bestas");
			GameObject val203 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_fox_hit_rd_bestas");
			GameObject val204 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_fox_death_rd_bestas");
			GameObject val205 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_fox_death_rd_bestas");
			GameObject val206 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_fox_idle_rd_bestas");
			GameObject val207 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_fox_attack_hit_rd_bestas");
			GameObject val208 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_fox_attack_rd_bestas");
			GameObject val209 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_wolf_howl_rd_bestas");
			GameObject val210 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_turtle_hit_rd_bestas");
			GameObject val211 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_turtle_death_rd_bestas");
			GameObject val212 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_turtle_hit_rd_bestas");
			GameObject val213 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_turtle_death_rd_bestas");
			GameObject val214 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_turtle_idle_rd_bestas");
			GameObject val215 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_goblin_hit_rd_bestas");
			GameObject val216 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_ent_attack_stomp_rd_bestas");
			GameObject val217 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_ent_groundslam_rd_bestas");
			GameObject val218 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_ent_rock_destroyed_rd_bestas");
			GameObject val219 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_ent_attacking_rd_bestas");
			GameObject val220 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_ent_attack_hit_rd_bestas");
			GameObject val221 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_ent_attack_hit_rd_bestas");
			GameObject val222 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_ent_hit_rd_bestas");
			GameObject val223 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_ent_hit_rd_bestas");
			GameObject val224 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_ent_alerted_rd_bestas");
			GameObject val225 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_ent_idle_rd_bestas");
			GameObject val226 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_ent_death_rd_bestas");
			GameObject val227 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_ent_death_rd_bestas");
			GameObject val228 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_rat_attack_hit_rd_bestas");
			GameObject val229 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_rat_attack_rd_bestas");
			GameObject val230 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_rat_hit_rd_bestas");
			GameObject val231 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_rat_hit_rd_bestas");
			GameObject val232 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_rat_alerted_rd_bestas");
			GameObject val233 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_rat_idle_rd_bestas");
			GameObject val234 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_rat_death_rd_bestas");
			GameObject val235 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_rat_death_rd_bestas");
			GameObject val236 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "fx_Puke_rd_bestas");
			GameObject val237 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_Puke_female_rd_bestas");
			GameObject val238 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_Puke_male_rd_bestas");
			GameObject val239 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_goat_attack_hit_rd_bestas");
			GameObject val240 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_goat_attack_rd_bestas");
			GameObject val241 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_goat_hit_rd_bestas");
			GameObject val242 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_goat_hit_rd_bestas");
			GameObject val243 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_goat_death_rd_bestas");
			GameObject val244 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_goat_death_rd_bestas");
			GameObject val245 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_goat_alerted_rd_bestas");
			GameObject val246 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_goat_idle_rd_bestas");
			GameObject val247 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "fx_infection_rd_bestas");
			GameObject val248 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "fx_frozen_rd_bestas");
			GameObject val249 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_whale_death_rd_bestas");
			GameObject val250 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_whale_idle_rd_bestas");
			GameObject val251 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_whale_death_rd_bestas");
			GameObject val252 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "vfx_whale_hit_rd_bestas");
			GameObject val253 = ItemManager.PrefabManager.RegisterPrefab("rd_bestas", "sfx_whale_hit_rd_bestas");
		}
	}
	internal static class Trophy_Registry
	{
		public static void RegisterTrophy()
		{
			Item item = new Item("rd_bestas", "RDB_minotaur_trophy");
			item.Configurable = Configurability.Disabled;
			MaterialReplacer.RegisterGameObjectForShaderSwap(item.Prefab, MaterialReplacer.ShaderType.UseUnityShader);
		}
	}
}
namespace PieceManager
{
	[<b29a1023-2877-4ef1-bace-bda5d26a4acd>NullableContext(1)]
	[<036635b6-4691-402f-bc8b-01650d48c534>Nullable(0)]
	[PublicAPI]
	public static class MaterialReplacer
	{
		[<b29a1023-2877-4ef1-bace-bda5d26a4acd>NullableContext(0)]
		public enum ShaderType
		{
			PieceShader,
			VegetationShader,
			RockShader,
			RugShader,
			GrassShader,
			CustomCreature,
			UseUnityShader
		}

		private static readonly Dictionary<GameObject, bool> ObjectToSwap;

		private static readonly Dictionary<string, Material> OriginalMaterials;

		private static readonly Dictionary<GameObject, ShaderType> ObjectsForShaderReplace;

		private static readonly Dictionary<string, Shader> CachedShaders;

		private static bool hasRun;

		static MaterialReplacer()
		{
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Expected O, but got Unknown
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Expected O, but got Unknown
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Expected O, but got Unknown
			CachedShaders = new Dictionary<string, Shader>(StringComparer.Ordinal);
			hasRun = false;
			OriginalMaterials = new Dictionary<string, Material>();
			ObjectToSwap = new Dictionary<GameObject, bool>();
			ObjectsForShaderReplace = new Dictionary<GameObject, ShaderType>();
			Harmony val = new Harmony("org.bepinex.helpers.PieceManager");
			val.Patch((MethodBase)AccessTools.DeclaredMethod(typeof(ZoneSystem), "Start", (Type[])null, (Type[])null), (HarmonyMethod)null, new HarmonyMethod(typeof(MaterialReplacer), "ReplaceAllMaterialsWithOriginal", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
			val.Patch((MethodBase)AccessTools.DeclaredMethod(typeof(FejdStartup), "Start", (Type[])null, (Type[])null), (HarmonyMethod)null, new HarmonyMethod(typeof(MaterialReplacer), "ReplaceAllMaterialsWithOriginal", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
		}

		public static void RegisterGameObjectForShaderSwap(GameObject go, ShaderType type)
		{
			if ((Object)(object)go != (Object)null && !ObjectsForShaderReplace.ContainsKey(go))
			{
				ObjectsForShaderReplace.Add(go, type);
			}
		}

		public static void RegisterGameObjectForMatSwap(GameObject go, bool isJotunnMock = false)
		{
			if ((Object)(object)go != (Object)null && !ObjectToSwap.ContainsKey(go))
			{
				ObjectToSwap.Add(go, isJotunnMock);
			}
		}

		private static void GetAllMaterials()
		{
			Material[] array = Resources.FindObjectsOfTypeAll<Material>();
			foreach (Material val in array)
			{
				OriginalMaterials[((Object)val).name] = val;
			}
		}

		[HarmonyPriority(700)]
		private static void ReplaceAllMaterialsWithOriginal()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Invalid comparison between Unknown and I4
			if ((int)SystemInfo.graphicsDeviceType == 4 || hasRun)
			{
				return;
			}
			if (ObjectToSwap.Count > 0 && OriginalMaterials.Count == 0)
			{
				GetAllMaterials();
			}
			foreach (KeyValuePair<GameObject, bool> item in ObjectToSwap)
			{
				GameObject key = item.Key;
				bool value = item.Value;
				ProcessGameObjectMaterials(key, value);
			}
			AssetBundle[] array = Resources.FindObjectsOfTypeAll<AssetBundle>();
			AssetBundle[] array2 = array;
			foreach (AssetBundle val in array2)
			{
				if ((Object)(object)val == (Object)null || val.isStreamedSceneAssetBundle)
				{
					continue;
				}
				IEnumerable<Shader> enumerable;
				try
				{
					enumerable = val.LoadAllAssets<Shader>();
				}
				catch (Exception)
				{
					continue;
				}
				if (enumerable == null)
				{
					continue;
				}
				foreach (Shader item2 in enumerable)
				{
					if ((Object)(object)item2 != (Object)null && !CachedShaders.ContainsKey(((Object)item2).name))
					{
						CachedShaders.Add(((Object)item2).name, item2);
					}
				}
			}
			foreach (KeyValuePair<GameObject, ShaderType> item3 in ObjectsForShaderReplace)
			{
				GameObject key2 = item3.Key;
				ShaderType value2 = item3.Value;
				ProcessGameObjectShaders(key2, value2);
			}
			hasRun = true;
		}

		private static void ProcessGameObjectMaterials(GameObject go, bool isJotunnMock)
		{
			if ((Object)(object)go == (Object)null)
			{
				return;
			}
			Renderer[] componentsInChildren = go.GetComponentsInChildren<Renderer>(true);
			Renderer[] array = componentsInChildren;
			foreach (Renderer val in array)
			{
				Material[] sharedMaterials = val.sharedMaterials.Select([<b29a1023-2877-4ef1-bace-bda5d26a4acd>NullableContext(0)] (Material material) => ((Object)(object)material == (Object)null) ? null : ReplaceMaterial(material, isJotunnMock)).ToArray();
				val.sharedMaterials = sharedMaterials;
			}
		}

		private static Material ReplaceMaterial(Material originalMaterial, bool isJotunnMock)
		{
			string text = (isJotunnMock ? "JVLmock_" : "_REPLACE_");
			if (!((Object)originalMaterial).name.StartsWith(text, StringComparison.Ordinal))
			{
				return originalMaterial;
			}
			string text2 = ((Object)originalMaterial).name.Replace(" (Instance)", "").Replace(text, "");
			if (OriginalMaterials.TryGetValue(text2, out var value))
			{
				return value;
			}
			Debug.LogWarning((object)("No suitable material found to replace: " + text2));
			return originalMaterial;
		}

		private static void ProcessGameObjectShaders(GameObject go, ShaderType shaderType)
		{
			if ((Object)(object)go == (Object)null)
			{
				return;
			}
			Renderer[] componentsInChildren = go.GetComponentsInChildren<Renderer>(true);
			Renderer[] array = componentsInChildren;
			foreach (Renderer val in array)
			{
				Material[] sharedMaterials = val.sharedMaterials;
				foreach (Material val2 in sharedMaterials)
				{
					if ((Object)(object)val2 != (Object)null && (Object)(object)val2.shader != (Object)null)
					{
						val2.shader = GetShaderForType(val2.shader, shaderType, ((Object)val2.shader).name);
					}
				}
			}
		}

		private static Shader GetShaderForType(Shader orig, ShaderType shaderType, string originalShaderName)
		{
			return (Shader)(shaderType switch
			{
				ShaderType.PieceShader => FindShaderWithName(orig, "Custom/Piece"), 
				ShaderType.VegetationShader => FindShaderWithName(orig, "Custom/Vegetation"), 
				ShaderType.RockShader => FindShaderWithName(orig, "Custom/StaticRock"), 
				ShaderType.RugShader => FindShaderWithName(orig, "Custom/Rug"), 
				ShaderType.GrassShader => FindShaderWithName(orig, "Custom/Grass"), 
				ShaderType.CustomCreature => FindShaderWithName(orig, "Custom/Creature"), 
				ShaderType.UseUnityShader => FindShaderWithName(orig, originalShaderName), 
				_ => FindShaderWithName(orig, "Standard"), 
			});
		}

		public static Shader FindShaderWithName(Shader origShader, string name)
		{
			Shader value;
			return CachedShaders.TryGetValue(name, out value) ? value : origShader;
		}
	}
}
namespace LocalizationManager
{
	[PublicAPI]
	[<036635b6-4691-402f-bc8b-01650d48c534>Nullable(0)]
	[<b29a1023-2877-4ef1-bace-bda5d26a4acd>NullableContext(1)]
	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;

		[<036635b6-4691-402f-bc8b-01650d48c534>Nullable(2)]
		private static BaseUnityPlugin _plugin;

		private static readonly List<string> fileExtensions;

		private static BaseUnityPlugin plugin
		{
			get
			{
				//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b2: 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([<b29a1023-2877-4ef1-bace-bda5d26a4acd>NullableContext(0)] (TypeInfo t) => t.IsClass && typeof(BaseUnityPlugin).IsAssignableFrom(t)));
				}
				return _plugin;
			}
		}

		[<036635b6-4691-402f-bc8b-01650d48c534>Nullable(2)]
		[method: <b29a1023-2877-4ef1-bace-bda5d26a4acd>NullableContext(2)]
		[field: <036635b6-4691-402f-bc8b-01650d48c534>Nullable(2)]
		public static event Action OnLocalizationComplete;

		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, [<b29a1023-2877-4ef1-bace-bda5d26a4acd>NullableContext(0)] (string current, KeyValuePair<string, Func<string>> kv) => current.Replace("{" + kv.Key + "}", kv.Value()));
			}
			localization.AddWord(key, text);
		}

		public static void AddPlaceholder<T>(string key, string placeholder, ConfigEntry<T> config, [<036635b6-4691-402f-bc8b-01650d48c534>Nullable(new byte[] { 2, 1, 1 })] 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 += [<b29a1023-2877-4ef1-bace-bda5d26a4acd>NullableContext(0)] (object _, EventArgs _) =>
			{
				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()
		{
			_ = plugin;
		}

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

		public static void SafeCallLocalizeComplete()
		{
			Localizer.OnLocalizationComplete?.Invoke();
		}

		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[] array = Path.GetFileNameWithoutExtension(item).Split(new char[1] { '.' });
				if (array.Length >= 2)
				{
					string text = array[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[] array2 = LoadTranslationFromAssembly("English");
			if (array2 == 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.");
			}
			string input = Encoding.UTF8.GetString(array2).TrimStart(new char[1] { '\ufeff' });
			Dictionary<string, string> dictionary2 = new DeserializerBuilder().IgnoreFields().Build().Deserialize<Dictionary<string, string>>(input);
			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.TryGetValue(language, out var value))
				{
					text2 = File.ReadAllText(value);
				}
				else
				{
					byte[] array3 = LoadTranslationFromAssembly(language);
					if (array3 != null)
					{
						text2 = Encoding.UTF8.GetString(array3);
					}
				}
			}
			if (text2 == null && dictionary.TryGetValue("English", out var value2))
			{
				text2 = File.ReadAllText(value2);
			}
			if (text2 != null)
			{
				text2 = text2.TrimStart(new char[1] { '\ufeff' });
				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_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Expected O, but got Unknown
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Expected O, but got Unknown
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Expected O, but got Unknown
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: 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>(2) { ".json", ".yml" };
			Harmony val = new Harmony("org.bepinex.helpers.LocalizationManager");
			val.Patch((MethodBase)AccessTools.DeclaredMethod(typeof(Localization), "SetupLanguage", (Type[])null, (Type[])null), (HarmonyMethod)null, new HarmonyMethod(AccessTools.DeclaredMethod(typeof(Localizer), "LoadLocalization", (Type[])null, (Type[])null)), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
			val.Patch((MethodBase)AccessTools.DeclaredMethod(typeof(FejdStartup), "SetupGui", (Type[])null, (Type[])null), (HarmonyMethod)null, new HarmonyMethod(AccessTools.DeclaredMethod(typeof(Localizer), "LoadLocalizationLater", (Type[])null, (Type[])null)), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
			val.Patch((MethodBase)AccessTools.DeclaredMethod(typeof(FejdStartup), "Start", (Type[])null, (Type[])null), (HarmonyMethod)null, new HarmonyMethod(AccessTools.DeclaredMethod(typeof(Localizer), "SafeCallLocalizeComplete", (Type[])null, (Type[])null)), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMe