Decompiled source of jtv additions v1.1.12

jtv.dll

Decompiled 10 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security.Permissions;
using BepInEx;
using HarmonyLib;
using Jotunn;
using Jotunn.Configs;
using Jotunn.Entities;
using Jotunn.Managers;
using Jotunn.Utils;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("jtv")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("jtv")]
[assembly: AssemblyCopyright("Copyright ©  2022")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("e3243d22-4307-4008-ba36-9f326008cde5")]
[assembly: AssemblyFileVersion("1.1.8.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.1.8.0")]
namespace jtv;

[HarmonyPatch(typeof(OfferingBowl), "Awake")]
public static class AlterOfferBowlAwake
{
	public static void Prefix(OfferingBowl __instance)
	{
		if ((Object)(object)__instance == (Object)null)
		{
			return;
		}
		Logger.LogDebug((object)("Calling OfferingBowl.Awake for " + ((Object)__instance).name));
		GameObject val = GameObject.Find("JotunnAltar(Clone)");
		if ((Object)(object)val != (Object)null)
		{
			GameObject prefab = ZNetScene.instance.GetPrefab("RRRM_Jotunn");
			if ((Object)(object)prefab != (Object)null)
			{
				((Character)prefab.GetComponent<Humanoid>()).m_staggerWhenBlocked = false;
				((Character)prefab.GetComponent<Humanoid>()).m_staggerDamageFactor = 0f;
				OfferingBowl componentInChildren = val.gameObject.GetComponentInChildren<OfferingBowl>();
				componentInChildren.m_name = ((Character)prefab.gameObject.GetComponent<Humanoid>()).m_name;
				componentInChildren.m_bossPrefab = prefab.gameObject;
			}
			else
			{
				Logger.LogDebug((object)"Did not find boss <RRRM_Jotunn>");
			}
		}
		else
		{
			Logger.LogDebug((object)"Did not find altar <JotunnAltar>");
		}
		GameObject val2 = GameObject.Find("BlazingDamnedOneAltar(Clone)");
		if ((Object)(object)val2 != (Object)null)
		{
			GameObject prefab2 = ZNetScene.instance.GetPrefab("RRRM_DamnedOne");
			GameObject prefab3 = ZNetScene.instance.GetPrefab("RRRM_BlazingDamnedOne");
			if ((Object)(object)prefab2 != (Object)null && (Object)(object)prefab3 != (Object)null)
			{
				((Character)prefab2.GetComponent<Humanoid>()).m_staggerWhenBlocked = false;
				((Character)prefab2.GetComponent<Humanoid>()).m_staggerDamageFactor = 0f;
				((Character)prefab3.GetComponent<Humanoid>()).m_staggerWhenBlocked = false;
				((Character)prefab3.GetComponent<Humanoid>()).m_staggerDamageFactor = 0f;
				OfferingBowl componentInChildren2 = val2.gameObject.GetComponentInChildren<OfferingBowl>();
				componentInChildren2.m_name = ((Character)prefab2.gameObject.GetComponent<Humanoid>()).m_name;
				componentInChildren2.m_bossPrefab = prefab2.gameObject;
			}
			else
			{
				Logger.LogDebug((object)"Did not find boss <RRRM_DamnedOne>");
			}
		}
		else
		{
			Logger.LogDebug((object)"Did not find altar <BlazingDamnedOneAltar>");
		}
	}
}
[BepInPlugin("thedefside.jtv", "jtv", "1.1.8")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency("MonsterLabZ", "2.4.1")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
internal class Jtv : BaseUnityPlugin
{
	public const string PluginGUID = "thedefside.jtv";

	public const string PluginName = "jtv";

	public const string PluginVersion = "1.1.8";

	private AssetBundle bundle;

	private GameObject MineRock_Salt;

	private GameObject Salt;

	private Harmony _harmony;

	public static CustomLocalization Localization = LocalizationManager.Instance.GetLocalization();

	private void Awake()
	{
		_harmony = Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "thedefside.jtv");
		bundle = AssetUtils.LoadAssetBundleFromResources("jtvbundle", typeof(Jtv).Assembly);
		LoadPrefabs();
		PrefabManager.OnVanillaPrefabsAvailable += AddVegetation;
		PrefabManager.OnVanillaPrefabsAvailable += AddItems;
		PieceManager.OnPiecesRegistered += AddForges;
		PrefabManager.OnVanillaPrefabsAvailable += AddCreatures;
		PrefabManager.OnVanillaPrefabsAvailable += UpdateVegvisirs;
	}

	private void LoadPrefabs()
	{
		MineRock_Salt = bundle.LoadAsset<GameObject>("MineRock_Salt");
		Salt = bundle.LoadAsset<GameObject>("SaltCube");
	}

	private void AddVegetation()
	{
		//IL_0022: Unknown result type (might be due to invalid IL or missing references)
		//IL_0027: Unknown result type (might be due to invalid IL or missing references)
		//IL_003d: Expected O, but got Unknown
		//IL_003f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0044: Unknown result type (might be due to invalid IL or missing references)
		//IL_005a: Expected O, but got Unknown
		//IL_006b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0070: Unknown result type (might be due to invalid IL or missing references)
		//IL_007b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0082: Unknown result type (might be due to invalid IL or missing references)
		//IL_0089: Unknown result type (might be due to invalid IL or missing references)
		//IL_0094: Unknown result type (might be due to invalid IL or missing references)
		//IL_009b: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_00be: Expected O, but got Unknown
		//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c3: Expected O, but got Unknown
		Logger.LogInfo((object)"Adding JTV Vegetation");
		try
		{
			MineRock_Salt.GetComponent<Destructible>().m_destroyedEffect.m_effectPrefabs = (EffectData[])(object)new EffectData[2]
			{
				new EffectData
				{
					m_prefab = PrefabManager.Instance.GetPrefab("vfx_RockDestroyed_Obsidian")
				},
				new EffectData
				{
					m_prefab = PrefabManager.Instance.GetPrefab("sfx_rock_destroyed")
				}
			};
			ZoneManager.Instance.AddCustomVegetation(new CustomVegetation(MineRock_Salt, false, new VegetationConfig
			{
				Max = 3f,
				GroupSizeMin = 1,
				GroupSizeMax = 2,
				GroupRadius = 15f,
				BlockCheck = true,
				Biome = (Biome)64,
				MinAltitude = 0f,
				MaxTilt = 30f
			}));
		}
		catch (Exception ex)
		{
			Logger.LogError((object)(ex.Message + ex.StackTrace));
		}
		finally
		{
			PrefabManager.OnVanillaPrefabsAvailable -= AddVegetation;
		}
	}

	private void AddForges()
	{
		//IL_009a: Unknown result type (might be due to invalid IL or missing references)
		//IL_009f: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c5: Expected O, but got Unknown
		//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00da: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f2: Expected O, but got Unknown
		//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
		//IL_0100: Unknown result type (might be due to invalid IL or missing references)
		//IL_0107: Unknown result type (might be due to invalid IL or missing references)
		//IL_010e: Unknown result type (might be due to invalid IL or missing references)
		//IL_011f: Expected O, but got Unknown
		//IL_0140: Unknown result type (might be due to invalid IL or missing references)
		//IL_0145: Unknown result type (might be due to invalid IL or missing references)
		//IL_014c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0153: Unknown result type (might be due to invalid IL or missing references)
		//IL_015a: Unknown result type (might be due to invalid IL or missing references)
		//IL_016b: Expected O, but got Unknown
		//IL_016d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0172: Unknown result type (might be due to invalid IL or missing references)
		//IL_0179: Unknown result type (might be due to invalid IL or missing references)
		//IL_0180: Unknown result type (might be due to invalid IL or missing references)
		//IL_0187: Unknown result type (might be due to invalid IL or missing references)
		//IL_0198: Expected O, but got Unknown
		//IL_019a: Unknown result type (might be due to invalid IL or missing references)
		//IL_019f: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c5: Expected O, but got Unknown
		//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d3: Unknown result type (might be due to invalid IL or missing references)
		//IL_01da: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f2: Expected O, but got Unknown
		try
		{
			Logger.LogInfo((object)"Repurposing Crafting Stations");
			GameObject prefab = PrefabManager.Instance.GetPrefab("piece_alchemystation");
			Renderer[] componentsInChildren = prefab.GetComponentsInChildren<Renderer>();
			foreach (Renderer obj in componentsInChildren)
			{
				obj.materials = ((IEnumerable<Material>)obj.materials).Select((Func<Material, Material>)((Material m) => new Material(m)
				{
					color = new Color(0.2f, 0.8f, 1.3f)
				})).ToArray();
			}
			prefab.GetComponent<CraftingStation>().m_name = "Cold Forge";
			Piece component = prefab.GetComponent<Piece>();
			component.m_name = "Cold Forge";
			component.m_description = "A table for crafting Frometal weapons and armor.";
			component.m_resources = (Requirement[])(object)new Requirement[3]
			{
				new Requirement
				{
					m_amount = 1,
					m_amountPerLevel = 0,
					m_recover = true,
					m_resItem = Cache.GetPrefab<ItemDrop>("QueenDrop")
				},
				new Requirement
				{
					m_amount = 8,
					m_amountPerLevel = 0,
					m_recover = true,
					m_resItem = Cache.GetPrefab<ItemDrop>("BlackMetal")
				},
				new Requirement
				{
					m_amount = 6,
					m_amountPerLevel = 0,
					m_recover = true,
					m_resItem = Cache.GetPrefab<ItemDrop>("FreezeGland")
				}
			};
			PrefabManager.Instance.GetPrefab("piece_thorsforge").GetComponent<Piece>().m_resources = (Requirement[])(object)new Requirement[4]
			{
				new Requirement
				{
					m_amount = 2,
					m_amountPerLevel = 0,
					m_recover = true,
					m_resItem = Cache.GetPrefab<ItemDrop>("JotunnBone")
				},
				new Requirement
				{
					m_amount = 4,
					m_amountPerLevel = 0,
					m_recover = true,
					m_resItem = Cache.GetPrefab<ItemDrop>("Thunderstone")
				},
				new Requirement
				{
					m_amount = 6,
					m_amountPerLevel = 0,
					m_recover = true,
					m_resItem = Cache.GetPrefab<ItemDrop>("BurningWorldTreeFragment")
				},
				new Requirement
				{
					m_amount = 6,
					m_amountPerLevel = 0,
					m_recover = true,
					m_resItem = Cache.GetPrefab<ItemDrop>("Tar")
				}
			};
		}
		finally
		{
			PieceManager.OnPiecesRegistered -= AddForges;
		}
	}

	private void AddItems()
	{
		//IL_001c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0026: Expected O, but got Unknown
		//IL_008c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0096: Expected O, but got Unknown
		//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
		//IL_0109: Unknown result type (might be due to invalid IL or missing references)
		//IL_0119: Expected O, but got Unknown
		//IL_0114: Unknown result type (might be due to invalid IL or missing references)
		//IL_011a: Expected O, but got Unknown
		//IL_0184: Unknown result type (might be due to invalid IL or missing references)
		//IL_023e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0245: Expected O, but got Unknown
		//IL_0283: Unknown result type (might be due to invalid IL or missing references)
		//IL_0288: Unknown result type (might be due to invalid IL or missing references)
		//IL_028f: Unknown result type (might be due to invalid IL or missing references)
		//IL_029b: Expected O, but got Unknown
		//IL_029d: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a2: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a9: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b5: Expected O, but got Unknown
		//IL_02bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c2: Expected O, but got Unknown
		//IL_02fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0302: Expected O, but got Unknown
		//IL_0341: Unknown result type (might be due to invalid IL or missing references)
		//IL_0346: Unknown result type (might be due to invalid IL or missing references)
		//IL_034e: Unknown result type (might be due to invalid IL or missing references)
		//IL_035a: Expected O, but got Unknown
		//IL_035c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0361: Unknown result type (might be due to invalid IL or missing references)
		//IL_0369: Unknown result type (might be due to invalid IL or missing references)
		//IL_0375: Expected O, but got Unknown
		//IL_037c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0383: Expected O, but got Unknown
		//IL_039a: Unknown result type (might be due to invalid IL or missing references)
		//IL_039f: Unknown result type (might be due to invalid IL or missing references)
		//IL_03aa: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ba: Expected O, but got Unknown
		//IL_03b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_03bc: Expected O, but got Unknown
		//IL_047e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0483: Unknown result type (might be due to invalid IL or missing references)
		//IL_048e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0499: Unknown result type (might be due to invalid IL or missing references)
		//IL_04a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_04b4: Expected O, but got Unknown
		//IL_04af: Unknown result type (might be due to invalid IL or missing references)
		//IL_04b6: Expected O, but got Unknown
		//IL_04cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_04d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_04dd: Unknown result type (might be due to invalid IL or missing references)
		//IL_04ed: Expected O, but got Unknown
		//IL_04e8: Unknown result type (might be due to invalid IL or missing references)
		//IL_04ef: Expected O, but got Unknown
		//IL_0534: Unknown result type (might be due to invalid IL or missing references)
		//IL_053b: Expected O, but got Unknown
		//IL_0579: Unknown result type (might be due to invalid IL or missing references)
		//IL_057e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0585: Unknown result type (might be due to invalid IL or missing references)
		//IL_0591: Expected O, but got Unknown
		//IL_0593: Unknown result type (might be due to invalid IL or missing references)
		//IL_0598: Unknown result type (might be due to invalid IL or missing references)
		//IL_059f: Unknown result type (might be due to invalid IL or missing references)
		//IL_05ab: Expected O, but got Unknown
		//IL_05b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_05b9: Expected O, but got Unknown
		//IL_067b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0682: Expected O, but got Unknown
		//IL_06c1: Unknown result type (might be due to invalid IL or missing references)
		//IL_06c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_06ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_06da: Expected O, but got Unknown
		//IL_06dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_06e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_06e9: Unknown result type (might be due to invalid IL or missing references)
		//IL_06f5: Expected O, but got Unknown
		//IL_06fc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0703: Expected O, but got Unknown
		//IL_071a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0721: Expected O, but got Unknown
		//IL_075f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0764: Unknown result type (might be due to invalid IL or missing references)
		//IL_076b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0777: Expected O, but got Unknown
		//IL_0779: Unknown result type (might be due to invalid IL or missing references)
		//IL_077e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0785: Unknown result type (might be due to invalid IL or missing references)
		//IL_0791: Expected O, but got Unknown
		//IL_0793: Unknown result type (might be due to invalid IL or missing references)
		//IL_0798: Unknown result type (might be due to invalid IL or missing references)
		//IL_079f: Unknown result type (might be due to invalid IL or missing references)
		//IL_07ab: Expected O, but got Unknown
		//IL_07ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_07b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_07b9: Unknown result type (might be due to invalid IL or missing references)
		//IL_07c5: Expected O, but got Unknown
		//IL_07cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_07d3: Expected O, but got Unknown
		//IL_08e7: Unknown result type (might be due to invalid IL or missing references)
		//IL_08ee: Expected O, but got Unknown
		//IL_092d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0932: Unknown result type (might be due to invalid IL or missing references)
		//IL_093a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0946: Expected O, but got Unknown
		//IL_0948: Unknown result type (might be due to invalid IL or missing references)
		//IL_094d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0955: Unknown result type (might be due to invalid IL or missing references)
		//IL_0961: Expected O, but got Unknown
		//IL_0963: Unknown result type (might be due to invalid IL or missing references)
		//IL_0968: Unknown result type (might be due to invalid IL or missing references)
		//IL_0970: Unknown result type (might be due to invalid IL or missing references)
		//IL_097c: Expected O, but got Unknown
		//IL_097e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0983: Unknown result type (might be due to invalid IL or missing references)
		//IL_098b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0997: Expected O, but got Unknown
		//IL_099e: Unknown result type (might be due to invalid IL or missing references)
		//IL_09a5: Expected O, but got Unknown
		//IL_09bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_09c3: Expected O, but got Unknown
		//IL_0a01: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a06: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a0d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a19: Expected O, but got Unknown
		//IL_0a1b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a20: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a27: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a33: Expected O, but got Unknown
		//IL_0a35: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a3a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a41: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a4d: Expected O, but got Unknown
		//IL_0a54: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a5b: Expected O, but got Unknown
		//IL_0b02: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b09: Expected O, but got Unknown
		//IL_0b48: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b4d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b55: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b61: Expected O, but got Unknown
		//IL_0b63: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b68: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b70: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b7c: Expected O, but got Unknown
		//IL_0b7e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b83: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b8b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b97: Expected O, but got Unknown
		//IL_0b9e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ba5: Expected O, but got Unknown
		//IL_0bd7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bdc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0be9: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bf3: Expected O, but got Unknown
		//IL_0c05: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c0c: Expected O, but got Unknown
		//IL_0c3a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c3f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c4a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c52: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c5a: Expected O, but got Unknown
		//IL_0c5c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c61: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c6c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c74: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c7c: Expected O, but got Unknown
		//IL_0c7e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c83: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c8e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c95: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c9d: Expected O, but got Unknown
		//IL_0c9f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ca4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0caf: Unknown result type (might be due to invalid IL or missing references)
		//IL_0cb6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0cbe: Expected O, but got Unknown
		//IL_0cc5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ccc: Expected O, but got Unknown
		//IL_0cea: Unknown result type (might be due to invalid IL or missing references)
		//IL_0cf1: Expected O, but got Unknown
		//IL_0d1f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d24: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d2f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d36: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d3e: Expected O, but got Unknown
		//IL_0d40: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d45: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d50: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d57: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d5f: Expected O, but got Unknown
		//IL_0d66: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d6d: Expected O, but got Unknown
		//IL_0dbb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0dc2: Expected O, but got Unknown
		//IL_0eaf: Unknown result type (might be due to invalid IL or missing references)
		//IL_0eb6: Expected O, but got Unknown
		//IL_0ee4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ee9: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ef4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0efc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f04: Expected O, but got Unknown
		//IL_0f06: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f0b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f16: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f1e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f26: Expected O, but got Unknown
		//IL_0f28: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f2d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f38: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f3f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f47: Expected O, but got Unknown
		//IL_0f49: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f4e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f59: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f60: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f68: Expected O, but got Unknown
		//IL_0f6f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f76: Expected O, but got Unknown
		//IL_0e4d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e54: Expected O, but got Unknown
		//IL_10b3: Unknown result type (might be due to invalid IL or missing references)
		Logger.LogInfo((object)"Adding Food");
		try
		{
			ItemManager.Instance.AddItem(new CustomItem(Salt, false));
			foreach (string item in new List<string> { "Amethyst", "JotunnBone", "FrozenRemains", "BurnedRemains", "SpiderSilk" })
			{
				try
				{
					GameObject val = bundle.LoadAsset<GameObject>(item);
					ItemManager.Instance.AddItem(new CustomItem(val, false));
				}
				catch (Exception ex)
				{
					Logger.LogError((object)("Error Adding item: " + item + " " + ex.Message + ex.StackTrace));
				}
			}
			CustomItem val2 = new CustomItem("Banana", "WolfFang", new ItemConfig
			{
				Name = "Banana",
				Description = "A sweet fruit packed with nutrients that increase stamina."
			});
			MeshRenderer[] componentsInChildren = val2.ItemPrefab.GetComponentsInChildren<MeshRenderer>();
			foreach (MeshRenderer obj in componentsInChildren)
			{
				((Renderer)obj).materials = ((IEnumerable<Material>)((Renderer)obj).materials).Select((Func<Material, Material>)((Material m) => new Material(m)
				{
					color = Color.yellow
				})).ToArray();
			}
			val2.ItemDrop.m_itemData.m_shared.m_itemType = (ItemType)2;
			val2.ItemDrop.m_itemData.m_shared.m_food = 15f;
			val2.ItemDrop.m_itemData.m_shared.m_foodStamina = 50f;
			val2.ItemDrop.m_itemData.m_shared.m_foodBurnTime = 900f;
			val2.ItemDrop.m_itemData.m_shared.m_foodRegen = 2f;
			val2.ItemDrop.m_autoPickup = true;
			Sprite val3 = LoadEmbeddedSprite("bananas_icon");
			val2.ItemDrop.m_itemData.m_shared.m_icons = (Sprite[])(object)new Sprite[1] { val3 };
			ItemManager.Instance.AddItem(val2);
			ItemConfig val4 = new ItemConfig();
			val4.Amount = 1;
			val4.CraftingStation = "piece_cauldron";
			val4.MinStationLevel = 4;
			val4.Name = "Banana Bread Dough";
			val4.Description = "Dough that when baked in the oven will produce Banana Bread";
			val4.Requirements = (RequirementConfig[])(object)new RequirementConfig[2]
			{
				new RequirementConfig
				{
					Amount = 5,
					Item = "BarleyFlour"
				},
				new RequirementConfig
				{
					Amount = 3,
					Item = "Banana"
				}
			};
			CustomItem val5 = new CustomItem("BananaBreadDough", "BreadDough", val4);
			Sprite val6 = LoadEmbeddedSprite("BananaBreadDough");
			val5.ItemDrop.m_itemData.m_shared.m_icons = (Sprite[])(object)new Sprite[1] { val6 };
			ItemManager.Instance.AddItem(val5);
			RecipeConfig val7 = new RecipeConfig();
			val7.Amount = 20;
			val7.Item = "BananaBreadDough";
			val7.CraftingStation = "piece_cauldron";
			val7.MinStationLevel = 4;
			val7.Name = "Banana Bread Dough x20";
			val7.Requirements = (RequirementConfig[])(object)new RequirementConfig[2]
			{
				new RequirementConfig
				{
					Amount = 100,
					Item = "BarleyFlour"
				},
				new RequirementConfig
				{
					Amount = 60,
					Item = "Banana"
				}
			};
			CustomRecipe val8 = new CustomRecipe(val7);
			ItemManager.Instance.AddRecipe(val8);
			CustomItem val9 = new CustomItem("BananaBread", "Bread", new ItemConfig
			{
				Name = "Banana Bread",
				Description = "A powerful stamina booster containing nutrients from bananas combined with the energy from the bread carbs."
			});
			val9.ItemDrop.m_itemData.m_shared.m_food = 90f;
			val9.ItemDrop.m_itemData.m_shared.m_foodStamina = 115f;
			val9.ItemDrop.m_itemData.m_shared.m_foodEitr = 75f;
			val9.ItemDrop.m_itemData.m_shared.m_foodBurnTime = 1800f;
			val9.ItemDrop.m_itemData.m_shared.m_foodRegen = 6f;
			Sprite val10 = LoadEmbeddedSprite("BananaBread");
			val9.ItemDrop.m_itemData.m_shared.m_icons = (Sprite[])(object)new Sprite[1] { val10 };
			ItemManager.Instance.AddItem(val9);
			CustomItemConversion val11 = new CustomItemConversion((ConversionConfig)new CookingConversionConfig
			{
				Station = "piece_oven",
				FromItem = "BananaBreadDough",
				ToItem = "BananaBread",
				CookTime = 60f
			});
			ItemManager.Instance.AddItemConversion(val11);
			CustomItem val12 = new CustomItem("Liver", "Entrails", new ItemConfig
			{
				Name = "Liver",
				Description = "The liver of an elf. Full of iron and other nutrients."
			});
			Sprite val13 = LoadEmbeddedSprite("Liver");
			val12.ItemDrop.m_itemData.m_shared.m_icons = (Sprite[])(object)new Sprite[1] { val13 };
			ItemManager.Instance.AddItem(val12);
			val4 = new ItemConfig();
			val4.Name = "Smoky Liver and Onions";
			val4.Description = "The charred remains of what used to be men mixed with onions. An acquired taste.";
			val4.Amount = 1;
			val4.CraftingStation = "piece_cauldron";
			val4.MinStationLevel = 4;
			val4.Requirements = (RequirementConfig[])(object)new RequirementConfig[2]
			{
				new RequirementConfig
				{
					Amount = 2,
					Item = "Liver"
				},
				new RequirementConfig
				{
					Amount = 3,
					Item = "Onion"
				}
			};
			CustomItem val14 = new CustomItem("LiverAndOnions", "OnionSoup", val4);
			val14.ItemDrop.m_itemData.m_shared.m_food = 115f;
			val14.ItemDrop.m_itemData.m_shared.m_foodStamina = 90f;
			val14.ItemDrop.m_itemData.m_shared.m_foodEitr = 75f;
			val14.ItemDrop.m_itemData.m_shared.m_foodBurnTime = 1800f;
			val14.ItemDrop.m_itemData.m_shared.m_foodRegen = 6f;
			Sprite val15 = LoadEmbeddedSprite("LiverAndOnions");
			val14.ItemDrop.m_itemData.m_shared.m_icons = (Sprite[])(object)new Sprite[1] { val15 };
			ItemManager.Instance.AddItem(val14);
			val7 = new RecipeConfig();
			val7.Amount = 10;
			val7.Item = "LiverAndOnions";
			val7.CraftingStation = "piece_cauldron";
			val7.MinStationLevel = 4;
			val7.Name = "Liver and Onions x10";
			val7.Requirements = (RequirementConfig[])(object)new RequirementConfig[2]
			{
				new RequirementConfig
				{
					Amount = 20,
					Item = "Liver"
				},
				new RequirementConfig
				{
					Amount = 30,
					Item = "Onion"
				}
			};
			CustomRecipe val16 = new CustomRecipe(val7);
			ItemManager.Instance.AddRecipe(val16);
			val4 = new ItemConfig();
			val4.Name = "$chicken_noodle_soup";
			val4.Description = "$chicken_noodle_description";
			val4.Amount = 1;
			val4.CraftingStation = "piece_cauldron";
			val4.MinStationLevel = 4;
			val4.Requirements = (RequirementConfig[])(object)new RequirementConfig[4]
			{
				new RequirementConfig
				{
					Amount = 2,
					Item = "BarleyFlour"
				},
				new RequirementConfig
				{
					Amount = 3,
					Item = "ChickenEgg"
				},
				new RequirementConfig
				{
					Amount = 1,
					Item = "CookedChickenMeat"
				},
				new RequirementConfig
				{
					Amount = 1,
					Item = "SaltCube"
				}
			};
			CustomItem val17 = new CustomItem("ChickenNoodleSoup", "TurnipStew", val4);
			val17.ItemDrop.m_itemData.m_shared.m_food = 35f;
			val17.ItemDrop.m_itemData.m_shared.m_foodStamina = 100f;
			val17.ItemDrop.m_itemData.m_shared.m_foodBurnTime = 1800f;
			val17.ItemDrop.m_itemData.m_shared.m_foodRegen = 6f;
			Sprite val18 = LoadEmbeddedSprite("ChickenNoodleIcon");
			Texture2D chickenNoodleTexture = LoadEmbeddedTexture("ChickenNoodleSoup");
			val17.ItemDrop.m_itemData.m_shared.m_icons = (Sprite[])(object)new Sprite[1] { val18 };
			componentsInChildren = val17.ItemPrefab.GetComponentsInChildren<MeshRenderer>();
			foreach (MeshRenderer obj2 in componentsInChildren)
			{
				((Renderer)obj2).materials = ((IEnumerable<Material>)((Renderer)obj2).materials).Select((Func<Material, Material>)((Material m) => new Material(m)
				{
					mainTexture = (Texture)(object)chickenNoodleTexture
				})).ToArray();
			}
			ItemManager.Instance.AddItem(val17);
			val7 = new RecipeConfig();
			val7.Amount = 10;
			val7.Item = "ChickenNoodleSoup";
			val7.CraftingStation = "piece_cauldron";
			val7.MinStationLevel = 4;
			val7.Name = "Chicken Noodle Soup x10";
			val7.Requirements = (RequirementConfig[])(object)new RequirementConfig[4]
			{
				new RequirementConfig
				{
					Amount = 20,
					Item = "BarleyFlour"
				},
				new RequirementConfig
				{
					Amount = 30,
					Item = "ChickenEgg"
				},
				new RequirementConfig
				{
					Amount = 10,
					Item = "CookedChickenMeat"
				},
				new RequirementConfig
				{
					Amount = 10,
					Item = "SaltCube"
				}
			};
			CustomRecipe val19 = new CustomRecipe(val7);
			ItemManager.Instance.AddRecipe(val19);
			val4 = new ItemConfig();
			val4.Name = "$salted_meat";
			val4.Description = "$salted_meat_description";
			val4.Amount = 1;
			val4.CraftingStation = "piece_cauldron";
			val4.MinStationLevel = 4;
			val4.Requirements = (RequirementConfig[])(object)new RequirementConfig[3]
			{
				new RequirementConfig
				{
					Amount = 2,
					Item = "CookedLoxMeat"
				},
				new RequirementConfig
				{
					Amount = 1,
					Item = "CookedWolfMeat"
				},
				new RequirementConfig
				{
					Amount = 3,
					Item = "SaltCube"
				}
			};
			CustomItem val20 = new CustomItem("SaltedMeat", "CookedLoxMeat", val4);
			val20.ItemDrop.m_itemData.m_shared.m_food = 100f;
			val20.ItemDrop.m_itemData.m_shared.m_foodStamina = 35f;
			val20.ItemDrop.m_itemData.m_shared.m_foodBurnTime = 1800f;
			val20.ItemDrop.m_itemData.m_shared.m_foodRegen = 6f;
			Sprite val21 = LoadEmbeddedSprite("SaltedMeat");
			val20.ItemDrop.m_itemData.m_shared.m_icons = (Sprite[])(object)new Sprite[1] { val21 };
			ItemManager.Instance.AddItem(val20);
			val7 = new RecipeConfig();
			val7.Amount = 20;
			val7.Item = "SaltedMeat";
			val7.CraftingStation = "piece_cauldron";
			val7.MinStationLevel = 4;
			val7.Name = "Salted Meat x20";
			val7.Requirements = (RequirementConfig[])(object)new RequirementConfig[3]
			{
				new RequirementConfig
				{
					Amount = 40,
					Item = "CookedLoxMeat"
				},
				new RequirementConfig
				{
					Amount = 20,
					Item = "CookedWolfMeat"
				},
				new RequirementConfig
				{
					Amount = 60,
					Item = "SaltCube"
				}
			};
			CustomRecipe val22 = new CustomRecipe(val7);
			ItemManager.Instance.AddRecipe(val22);
			GameObject val23 = bundle.LoadAsset<GameObject>("ObsidianGolemTrophy");
			val23.GetComponent<ItemDrop>().m_itemData.m_shared.m_trophyPos = new Vector2Int(5, 5);
			ItemManager.Instance.AddItem(new CustomItem(val23, true));
			GameObject obj3 = bundle.LoadAsset<GameObject>("FrometalWarhammer");
			val4 = new ItemConfig();
			val4.Name = "$frometal_warhammer";
			val4.Description = "$frometal_warhammer_description";
			val4.CraftingStation = "piece_alchemystation";
			val4.Requirements = (RequirementConfig[])(object)new RequirementConfig[4]
			{
				new RequirementConfig
				{
					Item = "FrometalBar",
					Amount = 15,
					AmountPerLevel = 7
				},
				new RequirementConfig
				{
					Item = "Silver",
					Amount = 10,
					AmountPerLevel = 3
				},
				new RequirementConfig
				{
					Item = "ArcticWolfPelt",
					Amount = 4,
					AmountPerLevel = 2
				},
				new RequirementConfig
				{
					Item = "YggdrasilWood",
					Amount = 4,
					AmountPerLevel = 2
				}
			};
			CustomItem val24 = new CustomItem(obj3, false, val4);
			ItemManager.Instance.AddItem(val24);
			GameObject obj4 = bundle.LoadAsset<GameObject>("ShieldFrometalBuckler");
			val4 = new ItemConfig();
			val4.Name = "$frometal_buckler";
			val4.Description = "$frometal_buckler_description";
			val4.CraftingStation = "piece_alchemystation";
			val4.Requirements = (RequirementConfig[])(object)new RequirementConfig[2]
			{
				new RequirementConfig
				{
					Item = "FrometalBar",
					Amount = 8,
					AmountPerLevel = 2
				},
				new RequirementConfig
				{
					Item = "YggdrasilWood",
					Amount = 4,
					AmountPerLevel = 2
				}
			};
			CustomItem val25 = new CustomItem(obj4, false, val4);
			ItemManager.Instance.AddItem(val25);
			componentsInChildren = ItemManager.Instance.GetItem("ShieldFrometal").ItemPrefab.GetComponentsInChildren<MeshRenderer>();
			foreach (MeshRenderer val26 in componentsInChildren)
			{
				List<Material> list = new List<Material>();
				Material[] materials = ((Renderer)val26).materials;
				for (int j = 0; j < materials.Length; j++)
				{
					Material val27 = new Material(materials[j]);
					val27.SetTexture("_BumpMap", (Texture)(object)LoadEmbeddedTexture("bam2"));
					list.Add(val27);
				}
				((Renderer)val26).materials = list.ToArray();
			}
			componentsInChildren = ItemManager.Instance.GetItem("ShieldFrometalTower").ItemPrefab.GetComponentsInChildren<MeshRenderer>();
			foreach (MeshRenderer val28 in componentsInChildren)
			{
				List<Material> list2 = new List<Material>();
				Material[] materials = ((Renderer)val28).materials;
				for (int j = 0; j < materials.Length; j++)
				{
					Material val29 = new Material(materials[j]);
					val29.SetTexture("_BumpMap", (Texture)(object)LoadEmbeddedTexture("bam2"));
					list2.Add(val29);
				}
				((Renderer)val28).materials = list2.ToArray();
			}
			GameObject obj5 = bundle.LoadAsset<GameObject>("FlametalWarhammer");
			val4 = new ItemConfig();
			val4.Name = "$flametal_warhammer";
			val4.Description = "$flametal_warhammer_description";
			val4.CraftingStation = "piece_thorsforge";
			val4.Requirements = (RequirementConfig[])(object)new RequirementConfig[4]
			{
				new RequirementConfig
				{
					Item = "Flametal",
					Amount = 15,
					AmountPerLevel = 7
				},
				new RequirementConfig
				{
					Item = "Silver",
					Amount = 10,
					AmountPerLevel = 3
				},
				new RequirementConfig
				{
					Item = "SpiderSilk",
					Amount = 4,
					AmountPerLevel = 2
				},
				new RequirementConfig
				{
					Item = "BurningWorldTreeFragment",
					Amount = 4,
					AmountPerLevel = 2
				}
			};
			CustomItem val30 = new CustomItem(obj5, false, val4);
			val30.ItemPrefab.GetComponent<ItemDrop>().m_itemData.m_shared.m_damagesPerLevel.m_frost = 0f;
			ItemManager.Instance.AddItem(val30);
			foreach (string item2 in new List<string>
			{
				"BowFlametal", "AtgeirFlametal", "SledgeFlametal", "BattleaxeFlametal", "SpearFlametal", "KnifeFlametal", "MaceFlametal", "GreatSwordFlametal", "SwordFlametal", "ShieldFlametal",
				"ShieldFlametalTower", "AxeFlametal", "PickaxeFlametal"
			})
			{
				componentsInChildren = ItemManager.Instance.GetItem(item2).ItemPrefab.GetComponentsInChildren<MeshRenderer>();
				foreach (MeshRenderer val31 in componentsInChildren)
				{
					for (int k = 0; k < ((Renderer)val31).materials.Length; k++)
					{
						if (((Object)((Renderer)val31).materials[k]).name.StartsWith("Flametal_Color"))
						{
							((Renderer)val31).materials[k].SetColor("_EmissionColor", new Color(1.5f, 0.7f, 0.1f));
						}
					}
				}
			}
		}
		catch (Exception ex2)
		{
			Logger.LogError((object)(ex2.Message + ex2.StackTrace));
		}
		finally
		{
			PrefabManager.OnVanillaPrefabsAvailable -= AddItems;
			bundle.Unload(false);
		}
	}

	private void AddCreatures()
	{
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Expected O, but got Unknown
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		//IL_0057: Expected O, but got Unknown
		//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c7: Expected O, but got Unknown
		//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e4: Expected O, but got Unknown
		//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0112: Expected O, but got Unknown
		//IL_0114: Unknown result type (might be due to invalid IL or missing references)
		//IL_0119: Unknown result type (might be due to invalid IL or missing references)
		//IL_012f: Expected O, but got Unknown
		//IL_0131: Unknown result type (might be due to invalid IL or missing references)
		//IL_0136: Unknown result type (might be due to invalid IL or missing references)
		//IL_014c: Expected O, but got Unknown
		//IL_0167: Unknown result type (might be due to invalid IL or missing references)
		//IL_016e: Expected O, but got Unknown
		//IL_0191: Unknown result type (might be due to invalid IL or missing references)
		//IL_0196: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01af: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c9: Expected O, but got Unknown
		//IL_01cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_01db: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_01eb: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f6: Unknown result type (might be due to invalid IL or missing references)
		//IL_01fd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0205: Expected O, but got Unknown
		//IL_0207: Unknown result type (might be due to invalid IL or missing references)
		//IL_020c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0217: Unknown result type (might be due to invalid IL or missing references)
		//IL_021e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0225: Unknown result type (might be due to invalid IL or missing references)
		//IL_0230: Unknown result type (might be due to invalid IL or missing references)
		//IL_0237: Unknown result type (might be due to invalid IL or missing references)
		//IL_023f: Expected O, but got Unknown
		//IL_0246: Unknown result type (might be due to invalid IL or missing references)
		//IL_024c: Expected O, but got Unknown
		//IL_0266: Unknown result type (might be due to invalid IL or missing references)
		//IL_029b: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a2: Expected O, but got Unknown
		//IL_02c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d5: Unknown result type (might be due to invalid IL or missing references)
		//IL_02dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ee: Unknown result type (might be due to invalid IL or missing references)
		//IL_02f5: Unknown result type (might be due to invalid IL or missing references)
		//IL_02fd: Expected O, but got Unknown
		//IL_02ff: Unknown result type (might be due to invalid IL or missing references)
		//IL_0304: Unknown result type (might be due to invalid IL or missing references)
		//IL_030f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0316: Unknown result type (might be due to invalid IL or missing references)
		//IL_031d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0328: Unknown result type (might be due to invalid IL or missing references)
		//IL_032f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0337: Expected O, but got Unknown
		//IL_033e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0344: Expected O, but got Unknown
		//IL_038b: Unknown result type (might be due to invalid IL or missing references)
		try
		{
			CreatureConfig val = new CreatureConfig();
			val.Name = "$swedish_chef";
			val.Faction = (Faction)2;
			val.Consumables = new string[3] { "Resin", "PineCone", "FirCone" };
			CustomCreature val2 = new CustomCreature("SwedishChef_JTV", "Greydwarf_Purple_Shroom", val);
			Humanoid component = val2.Prefab.GetComponent<Humanoid>();
			((Character)component).m_name = "$swedish_chef";
			component.m_defaultItems = (GameObject[])(object)new GameObject[2]
			{
				PrefabManager.Instance.GetPrefab("Greydwarf_attack"),
				PrefabManager.Instance.GetPrefab("Greydwarf_throw")
			};
			((Character)component).m_hitEffects.m_effectPrefabs = (EffectData[])(object)new EffectData[2]
			{
				new EffectData
				{
					m_prefab = PrefabManager.Instance.GetPrefab("vfx_greydwarf_hit")
				},
				new EffectData
				{
					m_prefab = PrefabManager.Instance.GetPrefab("sfx_greydwarf_hit")
				}
			};
			((Character)component).m_deathEffects.m_effectPrefabs = (EffectData[])(object)new EffectData[3]
			{
				new EffectData
				{
					m_prefab = PrefabManager.Instance.GetPrefab("vfx_greydwarf_death")
				},
				new EffectData
				{
					m_prefab = PrefabManager.Instance.GetPrefab("sfx_greydwarf_death")
				},
				new EffectData
				{
					m_prefab = PrefabManager.Instance.GetPrefab("Greydwarf_Purple_ragdoll")
				}
			};
			CreatureManager.Instance.AddCreature(val2);
			val = new CreatureConfig();
			val.Name = "$obsidian_golem";
			val.Faction = (Faction)5;
			val.DropConfigs = (DropConfig[])(object)new DropConfig[3]
			{
				new DropConfig
				{
					Item = "ObsidianGolemTrophy",
					MinAmount = 1,
					MaxAmount = 1,
					Chance = 5f,
					OnePerPlayer = false,
					LevelMultiplier = false
				},
				new DropConfig
				{
					Item = "Obsidian",
					MinAmount = 10,
					MaxAmount = 15,
					Chance = 100f,
					OnePerPlayer = false,
					LevelMultiplier = true
				},
				new DropConfig
				{
					Item = "Crystal",
					MinAmount = 3,
					MaxAmount = 6,
					Chance = 100f,
					OnePerPlayer = false,
					LevelMultiplier = true
				}
			};
			CustomCreature val3 = new CustomCreature("ObsidianGolem_JTV", "ObsidianGolem", val);
			val3.Prefab.transform.localScale = new Vector3(0.75f, 0.75f, 0.75f);
			((Character)val3.Prefab.GetComponent<Humanoid>()).m_name = "$obsidian_golem";
			CreatureManager.Instance.AddCreature(val3);
			val = new CreatureConfig();
			val.Name = "$molluscan";
			val.Faction = (Faction)3;
			val.DropConfigs = (DropConfig[])(object)new DropConfig[2]
			{
				new DropConfig
				{
					Item = "FishRaw",
					MinAmount = 1,
					MaxAmount = 2,
					Chance = 60f,
					OnePerPlayer = false,
					LevelMultiplier = true
				},
				new DropConfig
				{
					Item = "Chitin",
					MinAmount = 2,
					MaxAmount = 4,
					Chance = 100f,
					OnePerPlayer = false,
					LevelMultiplier = true
				}
			};
			CustomCreature val4 = new CustomCreature("Molluscan_JTV", "Molluscan", val);
			((Character)val4.Prefab.GetComponent<Humanoid>()).m_name = "$molluscan";
			((Character)val4.Prefab.GetComponent<Humanoid>()).m_health = 240f;
			val4.Prefab.GetComponent<BaseAI>().m_avoidWater = false;
			val4.Prefab.GetComponent<BaseAI>().m_pathAgentType = (AgentType)8;
			val4.Prefab.GetComponent<Character>().m_tolerateWater = true;
			CreatureManager.Instance.AddCreature(val4);
		}
		catch (Exception ex)
		{
			Logger.LogError((object)(ex.Message + ex.StackTrace));
		}
		finally
		{
			PrefabManager.OnVanillaPrefabsAvailable -= AddCreatures;
		}
	}

	private void UpdateVegvisirs()
	{
		try
		{
			PrefabManager.Instance.GetPrefab("Vegvisir_BlazingDamnedOne").GetComponentInChildren<Vegvisir>().m_pinName = "Damned One";
		}
		catch (Exception ex)
		{
			Logger.LogError((object)(ex.Message + ex.StackTrace));
		}
		finally
		{
			PrefabManager.OnVanillaPrefabsAvailable -= UpdateVegvisirs;
		}
	}

	private Sprite LoadEmbeddedSprite(string imageName)
	{
		//IL_0078: Unknown result type (might be due to invalid IL or missing references)
		//IL_007e: Expected O, but got Unknown
		//IL_009f: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
		Assembly executingAssembly = Assembly.GetExecutingAssembly();
		string text = executingAssembly.GetManifestResourceNames().SingleOrDefault((string str) => str.EndsWith("." + imageName + ".png"));
		if (text == null)
		{
			throw new Exception(imageName + ".png not found.");
		}
		Logger.LogDebug((object)("Resource name : " + text));
		byte[] array = ReadFully(executingAssembly.GetManifestResourceStream(text));
		Logger.LogDebug((object)$"Byte array length : {array.Length}");
		Texture2D val = new Texture2D(2, 2);
		ImageConversion.LoadImage(val, array);
		return Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), Vector2.zero);
	}

	private Texture2D LoadEmbeddedTexture(string imageName)
	{
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0064: Unknown result type (might be due to invalid IL or missing references)
		//IL_006b: Expected O, but got Unknown
		//IL_006d: Expected O, but got Unknown
		Assembly executingAssembly = Assembly.GetExecutingAssembly();
		string text = executingAssembly.GetManifestResourceNames().Single((string str) => str.EndsWith("." + imageName + ".png"));
		Logger.LogDebug((object)("Resource name : " + text));
		byte[] array = ReadFully(executingAssembly.GetManifestResourceStream(text));
		Logger.LogDebug((object)$"Byte array length : {array.Length}");
		Texture2D val = new Texture2D(2, 2);
		ImageConversion.LoadImage(val, array);
		return val;
	}

	public static byte[] ReadFully(Stream input)
	{
		using MemoryStream memoryStream = new MemoryStream();
		input.CopyTo(memoryStream);
		return memoryStream.ToArray();
	}
}

MonsterMobs.dll

Decompiled 10 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security.Permissions;
using BepInEx;
using Jotunn;
using Jotunn.Configs;
using Jotunn.Entities;
using Jotunn.Managers;
using Jotunn.Utils;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("MonsterMobs")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("MonsterMobs")]
[assembly: AssemblyCopyright("Copyright ©  2021")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("e3243d22-4307-4008-ba36-9f326008cde5")]
[assembly: AssemblyFileVersion("1.1.10.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.1.10.0")]
namespace MonsterMobs;

[BepInPlugin("thedefside.MonsterMobs", "MonsterMobs", "1.1.10")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency("MonsterLabZ", "2.4.1")]
[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
internal class MonsterMobs : BaseUnityPlugin
{
	public const string PluginGUID = "thedefside.MonsterMobs";

	public const string PluginName = "MonsterMobs";

	public const string PluginVersion = "1.1.10";

	public static bool Debug = false;

	private AssetBundle bundle;

	public static CustomLocalization Localization = LocalizationManager.Instance.GetLocalization();

	private void Awake()
	{
		bundle = AssetUtils.LoadAssetBundleFromResources("mmbundle", typeof(MonsterMobs).Assembly);
		PrefabManager.OnVanillaPrefabsAvailable += AddClonedItems;
	}

	private void AddClonedItems()
	{
		//IL_03a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_03a6: Expected O, but got Unknown
		//IL_045d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0462: Unknown result type (might be due to invalid IL or missing references)
		//IL_046a: Expected O, but got Unknown
		//IL_046c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0471: Unknown result type (might be due to invalid IL or missing references)
		//IL_0487: Expected O, but got Unknown
		//IL_0489: Unknown result type (might be due to invalid IL or missing references)
		//IL_048e: Unknown result type (might be due to invalid IL or missing references)
		//IL_04a4: Expected O, but got Unknown
		//IL_0509: Unknown result type (might be due to invalid IL or missing references)
		//IL_0510: Expected O, but got Unknown
		//IL_05cf: Unknown result type (might be due to invalid IL or missing references)
		//IL_05d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_05dd: Expected O, but got Unknown
		//IL_05df: Unknown result type (might be due to invalid IL or missing references)
		//IL_05e4: Unknown result type (might be due to invalid IL or missing references)
		//IL_05fa: Expected O, but got Unknown
		//IL_05fc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0601: Unknown result type (might be due to invalid IL or missing references)
		//IL_0617: Expected O, but got Unknown
		//IL_066c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0673: Expected O, but got Unknown
		//IL_06ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_06d3: Unknown result type (might be due to invalid IL or missing references)
		//IL_06dc: Expected O, but got Unknown
		//IL_06de: Unknown result type (might be due to invalid IL or missing references)
		//IL_06e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_06f9: Expected O, but got Unknown
		//IL_06fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0700: Unknown result type (might be due to invalid IL or missing references)
		//IL_0716: Expected O, but got Unknown
		//IL_0740: Unknown result type (might be due to invalid IL or missing references)
		//IL_0745: Unknown result type (might be due to invalid IL or missing references)
		//IL_0752: Unknown result type (might be due to invalid IL or missing references)
		//IL_075c: Expected O, but got Unknown
		//IL_0789: Unknown result type (might be due to invalid IL or missing references)
		//IL_07d1: Unknown result type (might be due to invalid IL or missing references)
		//IL_07d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_07df: Expected O, but got Unknown
		//IL_07e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_07e6: Unknown result type (might be due to invalid IL or missing references)
		//IL_07ef: Expected O, but got Unknown
		//IL_080b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0812: Expected O, but got Unknown
		//IL_083e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0845: Expected O, but got Unknown
		//IL_0885: Unknown result type (might be due to invalid IL or missing references)
		//IL_088c: Expected O, but got Unknown
		//IL_08b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_08bf: Expected O, but got Unknown
		//IL_08e4: Unknown result type (might be due to invalid IL or missing references)
		//IL_08e9: Unknown result type (might be due to invalid IL or missing references)
		//IL_0921: Unknown result type (might be due to invalid IL or missing references)
		//IL_0928: Expected O, but got Unknown
		//IL_0956: Unknown result type (might be due to invalid IL or missing references)
		//IL_095b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0962: Unknown result type (might be due to invalid IL or missing references)
		//IL_096d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0975: Expected O, but got Unknown
		//IL_0985: Unknown result type (might be due to invalid IL or missing references)
		//IL_098c: Expected O, but got Unknown
		//IL_0a38: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a3f: Expected O, but got Unknown
		//IL_0a6b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a72: Expected O, but got Unknown
		//IL_0aa6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0aab: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ae2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ae7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0af4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0afe: Expected O, but got Unknown
		//IL_0b24: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b29: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b36: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b40: Expected O, but got Unknown
		//IL_0b5b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b60: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b6b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b7b: Expected O, but got Unknown
		//IL_0b76: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b80: Expected O, but got Unknown
		//IL_0b92: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b99: Expected O, but got Unknown
		//IL_0bdf: Unknown result type (might be due to invalid IL or missing references)
		//IL_0be4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0beb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bf6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bfe: Expected O, but got Unknown
		//IL_0c05: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c0c: Expected O, but got Unknown
		//IL_0c33: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c3a: Expected O, but got Unknown
		//IL_0c60: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c65: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c6c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c77: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c7f: Expected O, but got Unknown
		//IL_0c81: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c86: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c8d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c99: Expected O, but got Unknown
		//IL_0c9b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ca0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ca7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0cb2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0cba: Expected O, but got Unknown
		//IL_0cc1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ccb: Expected O, but got Unknown
		//IL_0ce6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ced: Expected O, but got Unknown
		//IL_0d13: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d18: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d1f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d2a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d32: Expected O, but got Unknown
		//IL_0d34: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d39: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d40: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d4c: Expected O, but got Unknown
		//IL_0d4e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d53: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d5a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d65: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d6d: Expected O, but got Unknown
		//IL_0d74: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d7e: Expected O, but got Unknown
		//IL_0d96: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d9d: Expected O, but got Unknown
		//IL_0dd1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0dd8: Expected O, but got Unknown
		//IL_0e08: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e0d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e36: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e3d: Expected O, but got Unknown
		//IL_0e71: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e78: Expected O, but got Unknown
		//IL_0ea8: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ead: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ed6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0edd: Expected O, but got Unknown
		//IL_0f09: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f10: Expected O, but got Unknown
		//IL_0f40: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f45: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f6e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f75: Expected O, but got Unknown
		//IL_0fa1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fa8: Expected O, but got Unknown
		//IL_0fd8: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fdd: Unknown result type (might be due to invalid IL or missing references)
		//IL_1006: Unknown result type (might be due to invalid IL or missing references)
		//IL_100d: Expected O, but got Unknown
		//IL_1039: Unknown result type (might be due to invalid IL or missing references)
		//IL_1040: Expected O, but got Unknown
		//IL_1070: Unknown result type (might be due to invalid IL or missing references)
		//IL_1075: Unknown result type (might be due to invalid IL or missing references)
		//IL_109e: Unknown result type (might be due to invalid IL or missing references)
		//IL_10a5: Expected O, but got Unknown
		//IL_10d1: Unknown result type (might be due to invalid IL or missing references)
		//IL_10d8: Expected O, but got Unknown
		//IL_1108: Unknown result type (might be due to invalid IL or missing references)
		//IL_110d: Unknown result type (might be due to invalid IL or missing references)
		//IL_1136: Unknown result type (might be due to invalid IL or missing references)
		//IL_113d: Expected O, but got Unknown
		//IL_1169: Unknown result type (might be due to invalid IL or missing references)
		//IL_1170: Expected O, but got Unknown
		//IL_11a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_11a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_11dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_11e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_11ee: Unknown result type (might be due to invalid IL or missing references)
		//IL_11f8: Expected O, but got Unknown
		//IL_121e: Unknown result type (might be due to invalid IL or missing references)
		//IL_1223: Unknown result type (might be due to invalid IL or missing references)
		//IL_1230: Unknown result type (might be due to invalid IL or missing references)
		//IL_123a: Expected O, but got Unknown
		//IL_1252: Unknown result type (might be due to invalid IL or missing references)
		//IL_1259: Expected O, but got Unknown
		//IL_1285: Unknown result type (might be due to invalid IL or missing references)
		//IL_128c: Expected O, but got Unknown
		//IL_12c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_12e9: Unknown result type (might be due to invalid IL or missing references)
		//IL_12ee: Unknown result type (might be due to invalid IL or missing references)
		//IL_09c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_09cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_09db: Unknown result type (might be due to invalid IL or missing references)
		//IL_09ea: Expected O, but got Unknown
		//IL_139a: Unknown result type (might be due to invalid IL or missing references)
		//IL_139f: Unknown result type (might be due to invalid IL or missing references)
		//IL_132d: Unknown result type (might be due to invalid IL or missing references)
		//IL_1332: Unknown result type (might be due to invalid IL or missing references)
		//IL_1333: Unknown result type (might be due to invalid IL or missing references)
		//IL_1342: Expected O, but got Unknown
		Cache.GetPrefab<GameObject>("TentaRoot").AddComponent<CharacterDrop>();
		foreach (Clone item in new List<Clone>
		{
			new Clone("Deathsquito", "AshMosquito", "AshMosquito"),
			new Clone("Fenring", "DevourerFenring", "DevourerFenring"),
			new Clone("Fenring_ragdoll", "DevourerFenring_ragdoll", "DevourerFenring"),
			new Clone("Troll", "Jotunn_mm", "Jotunn"),
			new Clone("Troll_ragdoll", "Jotunn_ragdoll_mm", "Jotunn"),
			new Clone("Fenring", "PolarFenring", "PolarFenring"),
			new Clone("Fenring_ragdoll", "PolarFenring_ragdoll", "PolarFenring"),
			new Clone("Lox", "PolarLox", "PolarLox"),
			new Clone("lox_ragdoll", "PolarLox_ragdoll", "PolarLox"),
			new Clone("Fenring", "StormFenring", "StormFenring"),
			new Clone("Fenring_ragdoll", "StormFenring_ragdoll", "StormFenring"),
			new Clone("Wolf", "StormWolf", "StormWolf"),
			new Clone("Wolf_Ragdoll", "StormWolf_ragdoll", "StormWolf"),
			new Clone("Draugr", "SwollenBody", "SwollenBody"),
			new Clone("Draugr_ragdoll", "SwollenBody_ragdoll", "SwollenBody"),
			new Clone("NormalSkeletonWarrior", "BurnedBones", "BurnedBones"),
			new Clone("TreeSpider", "DarkSpider", "DarkSpider"),
			new Clone("TreeSpider_ragdoll", "DarkSpider_ragdoll", "DarkSpider"),
			new Clone("TreeSpider", "MotherDarkSpider", "MotherDarkSpider"),
			new Clone("Wolf", "ArcticWolf", "ArcticWolf"),
			new Clone("Wolf_Ragdoll", "ArcticWolf_ragdoll", "ArcticWolf"),
			new Clone("TentaRoot", "Froot", "Froot")
		})
		{
			try
			{
				Logger.LogDebug((object)("Creating new Prefab: " + item.NewPrefab + " from " + item.BasePrefab));
				GameObject val = PrefabManager.Instance.CreateClonedPrefab(item.NewPrefab, item.BasePrefab);
				Logger.LogDebug((object)("Setting texture: " + item.Texture + ".png"));
				Texture2D texture = LoadEmbeddedTexture(item.Texture);
				val.ChangeTexture(texture);
				Logger.LogDebug((object)("Add Prefab: " + item.NewPrefab));
				PrefabManager.Instance.AddPrefab(val);
			}
			catch (Exception ex)
			{
				Logger.LogError((object)("Adding prefab failed for " + item.NewPrefab));
				Logger.LogError((object)ex.Message);
				Logger.LogError((object)ex.StackTrace);
			}
		}
		GameObject val2 = bundle.LoadAsset<GameObject>("AshHatchling");
		PrefabManager.Instance.AddPrefab(val2);
		GameObject val3 = PrefabManager.Instance.CreateClonedPrefab("AshHatchling_ragdoll", "Hatchling_ragdoll");
		Transform val4 = val3.transform.Find("Hatchling_mountain");
		SkinnedMeshRenderer component = ((Component)((Component)val4).transform.Find("eyes")).GetComponent<SkinnedMeshRenderer>();
		Material val5 = new Material(((Renderer)component).material);
		val5.SetTexture("_MainTex", (Texture)(object)LoadEmbeddedTexture("AshHatchling"));
		val5.SetTexture("_BumpMap", (Texture)(object)LoadEmbeddedTexture("Hatchling_n"));
		val5.SetTexture("_EmissionMap", (Texture)(object)LoadEmbeddedTexture("Hatchling_E"));
		((Renderer)component).material = val5;
		((Renderer)((Component)((Component)val4).transform.Find("Hatchling")).GetComponent<SkinnedMeshRenderer>()).material = val5;
		((Renderer)((Component)((Component)val4).transform.Find("Hatchling.001")).GetComponent<SkinnedMeshRenderer>()).material = val5;
		((Renderer)((Component)((Component)val4).transform.Find("Horns")).GetComponent<SkinnedMeshRenderer>()).material = val5;
		PrefabManager.Instance.AddPrefab(val3);
		((Character)val2.GetComponent<Humanoid>()).m_deathEffects.m_effectPrefabs = (EffectData[])(object)new EffectData[3]
		{
			new EffectData
			{
				m_prefab = val3
			},
			new EffectData
			{
				m_prefab = PrefabManager.Instance.GetPrefab("vfx_hatchling_death")
			},
			new EffectData
			{
				m_prefab = PrefabManager.Instance.GetPrefab("sfx_hatchling_death")
			}
		};
		GameObject val6 = bundle.LoadAsset<GameObject>("StormHatchling");
		PrefabManager.Instance.AddPrefab(val6);
		GameObject val7 = PrefabManager.Instance.CreateClonedPrefab("StormHatchling_ragdoll", "Hatchling_ragdoll");
		Transform obj = val7.transform.Find("Hatchling_mountain");
		SkinnedMeshRenderer component2 = ((Component)((Component)val4).transform.Find("eyes")).GetComponent<SkinnedMeshRenderer>();
		Material val8 = new Material(((Renderer)component2).material);
		val8.SetTexture("_MainTex", (Texture)(object)LoadEmbeddedTexture("StormHatchling"));
		val8.SetTexture("_BumpMap", (Texture)(object)LoadEmbeddedTexture("Hatchling_n"));
		val8.SetTexture("_Emission", (Texture)(object)LoadEmbeddedTexture("Hatchling_E"));
		((Renderer)component2).material = val8;
		((Renderer)((Component)((Component)obj).transform.Find("Hatchling")).GetComponent<SkinnedMeshRenderer>()).material = val8;
		((Renderer)((Component)((Component)obj).transform.Find("Hatchling.001")).GetComponent<SkinnedMeshRenderer>()).material = val8;
		((Renderer)((Component)((Component)obj).transform.Find("Horns")).GetComponent<SkinnedMeshRenderer>()).material = val8;
		PrefabManager.Instance.AddPrefab(val7);
		((Character)val6.GetComponent<Humanoid>()).m_deathEffects.m_effectPrefabs = (EffectData[])(object)new EffectData[3]
		{
			new EffectData
			{
				m_prefab = val7
			},
			new EffectData
			{
				m_prefab = PrefabManager.Instance.GetPrefab("vfx_hatchling_death")
			},
			new EffectData
			{
				m_prefab = PrefabManager.Instance.GetPrefab("sfx_hatchling_death")
			}
		};
		GameObject val9 = bundle.LoadAsset<GameObject>("AshNeck");
		PrefabManager.Instance.AddPrefab(val9);
		GameObject val10 = PrefabManager.Instance.CreateClonedPrefab("AshNeck_ragdoll1", "Neck_Ragdoll");
		SkinnedMeshRenderer component3 = ((Component)val10.transform.Find("Body")).GetComponent<SkinnedMeshRenderer>();
		Material val11 = new Material(((Renderer)component3).material);
		val11.SetTexture("_MainTex", (Texture)(object)LoadEmbeddedTexture("AshNeck"));
		((Renderer)component3).material = val11;
		((Renderer)((Component)val10.transform.Find("Lillies")).GetComponent<SkinnedMeshRenderer>()).material = val11;
		PrefabManager.Instance.AddPrefab(val10);
		((Character)val9.GetComponent<Humanoid>()).m_deathEffects.m_effectPrefabs = (EffectData[])(object)new EffectData[3]
		{
			new EffectData
			{
				m_prefab = val10
			},
			new EffectData
			{
				m_prefab = PrefabManager.Instance.GetPrefab("vfx_neck_death")
			},
			new EffectData
			{
				m_prefab = PrefabManager.Instance.GetPrefab("sfx_dragon_death")
			}
		};
		GameObject val12 = bundle.LoadAsset<GameObject>("AshNeckTrophy");
		val12.GetComponent<ItemDrop>().m_itemData.m_shared.m_trophyPos = new Vector2Int(0, 8);
		ItemManager.Instance.AddItem(new CustomItem(val12, false));
		GameObject val13 = PrefabManager.Instance.CreateClonedPrefab("fx_polarlox_death", "fx_lox_death");
		((Component)val13.transform.Find("skinflakes")).GetComponent<ParticleSystem>().startColor = Color.white;
		PrefabManager.Instance.AddPrefab(val13);
		GameObject prefab = PrefabManager.Instance.GetPrefab("PolarLox");
		GameObject prefab2 = PrefabManager.Instance.GetPrefab("PolarLox_ragdoll");
		((Character)prefab.GetComponent<Humanoid>()).m_deathEffects.m_effectPrefabs = (EffectData[])(object)new EffectData[2]
		{
			new EffectData
			{
				m_prefab = prefab2
			},
			new EffectData
			{
				m_prefab = val13
			}
		};
		Sprite val14 = LoadEmbeddedSprite("ArcticWolfPeltIcon");
		ItemConfig val15 = new ItemConfig();
		val15.Name = "Arctic Wolf Pelt";
		val15.Description = "The fur of an Arctic Wolf";
		val15.Icons = (Sprite[])(object)new Sprite[1] { val14 };
		CustomItem val16 = new CustomItem("ArcticWolfPelt", "WolfPelt", val15);
		Texture2D texture2 = LoadEmbeddedTexture("ArcticWolfPelt");
		val16.ItemPrefab.ChangeMeshTexture(texture2);
		ItemManager.Instance.AddItem(val16);
		Sprite val17 = LoadEmbeddedSprite("ArcticWolfTrophy");
		val15 = new ItemConfig();
		val15.Name = "Arctic Wolf Trophy";
		val15.Description = "The head of the beast";
		val15.Icons = (Sprite[])(object)new Sprite[1] { val17 };
		CustomItem val18 = new CustomItem("ArcticWolfTrophy", "TrophyWolf", val15);
		Texture2D texture3 = LoadEmbeddedTexture("ArcticWolf");
		val18.ItemPrefab.GetComponent<ItemDrop>().m_itemData.m_shared.m_trophyPos = new Vector2Int(0, 7);
		val18.ItemPrefab.ChangeMeshTexture(texture3);
		ItemManager.Instance.AddItem(val18);
		Sprite icon = LoadEmbeddedSprite("ArcticWolfRugIcon");
		PieceConfig val19 = new PieceConfig();
		val19.Name = "Arctic Wolf Rug";
		val19.Description = "A rug made from the fur of the frozen beast.";
		val19.PieceTable = "Hammer";
		val19.Requirements = (RequirementConfig[])(object)new RequirementConfig[1]
		{
			new RequirementConfig
			{
				Amount = 4,
				Item = "ArcticWolfPelt",
				Recover = true
			}
		};
		val19.Icon = icon;
		CustomPiece val20 = new CustomPiece("ArcticWolfRug", "rug_wolf", val19);
		MeshRenderer[] componentsInChildren = val20.PiecePrefab.GetComponentsInChildren<MeshRenderer>();
		foreach (MeshRenderer val21 in componentsInChildren)
		{
			List<Material> list = new List<Material>();
			Material[] materials = ((Renderer)val21).materials;
			foreach (Material val22 in materials)
			{
				list.Add(new Material(val22)
				{
					color = new Color(1.5f, 1.5f, 1.5f)
				});
			}
			((Renderer)val21).materials = list.ToArray();
		}
		PieceManager.Instance.AddPiece(val20);
		Sprite val23 = LoadEmbeddedSprite("StormWolfTrophy");
		val15 = new ItemConfig();
		val15.Name = "Storm Wolf Trophy";
		val15.Description = "The head of a Storm Wolf";
		val15.Icons = (Sprite[])(object)new Sprite[1] { val23 };
		CustomItem val24 = new CustomItem("StormWolfTrophy", "TrophyWolf", val15);
		Texture2D texture4 = LoadEmbeddedTexture("StormWolf");
		val24.ItemPrefab.ChangeMeshTexture(texture4);
		val24.ItemPrefab.GetComponent<ItemDrop>().m_itemData.m_shared.m_trophyPos = new Vector2Int(2, 5);
		ItemManager.Instance.AddItem(val24);
		GameObject val25 = bundle.LoadAsset<GameObject>("StormHatchlingTrophy");
		val25.GetComponent<ItemDrop>().m_itemData.m_shared.m_trophyPos = new Vector2Int(3, 5);
		ItemManager.Instance.AddItem(new CustomItem(val25, false));
		GameObject val26 = bundle.LoadAsset<GameObject>("AshHatchlingTrophy");
		val26.GetComponent<ItemDrop>().m_itemData.m_shared.m_trophyPos = new Vector2Int(1, 8);
		ItemManager.Instance.AddItem(new CustomItem(val26, false));
		GameObject val27 = bundle.LoadAsset<GameObject>("StormWolfPelt");
		ItemManager.Instance.AddItem(new CustomItem(val27, false, new ItemConfig
		{
			Name = "Storm Wolf Pelt",
			Description = "The pelt of a Storm Wolf"
		}));
		GameObject obj2 = bundle.LoadAsset<GameObject>("StormWolfRug");
		val19 = new PieceConfig();
		val19.CraftingStation = "piece_workbench";
		val19.PieceTable = "Hammer";
		val19.Category = "Furniture";
		val19.Name = "Storm Wolf Rug";
		val19.Description = "It's soft and warm and makes your hair stand on end";
		val19.Requirements = (RequirementConfig[])(object)new RequirementConfig[1]
		{
			new RequirementConfig
			{
				Amount = 4,
				Item = "StormWolfPelt",
				Recover = true
			}
		};
		CustomPiece val28 = new CustomPiece(obj2, false, val19);
		PieceManager.Instance.AddPiece(val28);
		GameObject val29 = bundle.LoadAsset<GameObject>("StormWolfCape");
		ItemManager instance = ItemManager.Instance;
		val15 = new ItemConfig();
		val15.Amount = 1;
		val15.CraftingStation = "piece_workbench";
		val15.MinStationLevel = 1;
		val15.Requirements = (RequirementConfig[])(object)new RequirementConfig[3]
		{
			new RequirementConfig
			{
				Amount = 8,
				Item = "StormWolfPelt",
				AmountPerLevel = 2
			},
			new RequirementConfig
			{
				Amount = 1,
				Item = "StormWolfTrophy"
			},
			new RequirementConfig
			{
				Amount = 1,
				Item = "Thunderstone",
				AmountPerLevel = 1
			}
		};
		instance.AddItem(new CustomItem(val29, false, val15));
		GameObject val30 = bundle.LoadAsset<GameObject>("ArcticWolfCape");
		ItemManager instance2 = ItemManager.Instance;
		val15 = new ItemConfig();
		val15.Amount = 1;
		val15.CraftingStation = "piece_alchemystation";
		val15.MinStationLevel = 1;
		val15.Requirements = (RequirementConfig[])(object)new RequirementConfig[3]
		{
			new RequirementConfig
			{
				Amount = 8,
				Item = "ArcticWolfPelt",
				AmountPerLevel = 2
			},
			new RequirementConfig
			{
				Amount = 1,
				Item = "ArcticWolfTrophy"
			},
			new RequirementConfig
			{
				Amount = 1,
				Item = "FrometalBar",
				AmountPerLevel = 1
			}
		};
		instance2.AddItem(new CustomItem(val30, false, val15));
		Sprite val31 = LoadEmbeddedSprite("StormFenringTrophy");
		val15 = new ItemConfig();
		val15.Amount = 1;
		val15.Name = "Storm Fenring Trophy";
		val15.Description = "All that remains from the mighty beast";
		val15.Icons = (Sprite[])(object)new Sprite[1] { val31 };
		CustomItem val32 = new CustomItem("StormFenringTrophy", "TrophyFenring", val15);
		val32.ItemPrefab.ChangeMeshTexture(LoadEmbeddedTexture("StormFenring"));
		val32.ItemPrefab.GetComponent<ItemDrop>().m_itemData.m_shared.m_trophyPos = new Vector2Int(4, 5);
		ItemManager.Instance.AddItem(val32);
		Sprite val33 = LoadEmbeddedSprite("DevourerFenringTrophy");
		val15 = new ItemConfig();
		val15.Amount = 1;
		val15.Name = "Blood-thirsty Fenring Trophy";
		val15.Description = "A blood-soaked arm of a Fenring";
		val15.Icons = (Sprite[])(object)new Sprite[1] { val33 };
		CustomItem val34 = new CustomItem("DevourerFenringTrophy", "TrophyFenring", val15);
		val34.ItemPrefab.ChangeMeshTexture(LoadEmbeddedTexture("DevourerFenring"));
		val34.ItemPrefab.GetComponent<ItemDrop>().m_itemData.m_shared.m_trophyPos = new Vector2Int(1, 7);
		ItemManager.Instance.AddItem(val34);
		Sprite val35 = LoadEmbeddedSprite("PolarLoxTrophy");
		val15 = new ItemConfig();
		val15.Name = "Ice-breaker Lox Trophy";
		val15.Description = "The head of a Polar Lox";
		val15.Icons = (Sprite[])(object)new Sprite[1] { val35 };
		CustomItem val36 = new CustomItem("PolarLoxTrophy", "TrophyLox", val15);
		val36.ItemPrefab.ChangeMeshTexture(LoadEmbeddedTexture("PolarLox"));
		val36.ItemPrefab.GetComponent<ItemDrop>().m_itemData.m_shared.m_trophyPos = new Vector2Int(2, 7);
		ItemManager.Instance.AddItem(val36);
		Sprite val37 = LoadEmbeddedSprite("BurnedBonesTrophy");
		val15 = new ItemConfig();
		val15.Name = "Burned Bones Trophy";
		val15.Description = "The head of a Burned Bones";
		val15.Icons = (Sprite[])(object)new Sprite[1] { val37 };
		CustomItem val38 = new CustomItem("BurnedBonesTrophy", "TrophySkeleton", val15);
		val38.ItemPrefab.ChangeMeshTexture(LoadEmbeddedTexture("BurnedBonesTex"));
		val38.ItemPrefab.GetComponent<ItemDrop>().m_itemData.m_shared.m_trophyPos = new Vector2Int(2, 8);
		ItemManager.Instance.AddItem(val38);
		Sprite val39 = LoadEmbeddedSprite("FrozenCorpseTrophy");
		val15 = new ItemConfig();
		val15.Name = "Frozen Corpse Trophy";
		val15.Description = "The head of a Frozen Corpse";
		val15.Icons = (Sprite[])(object)new Sprite[1] { val39 };
		CustomItem val40 = new CustomItem("FrozenCorpseTrophy", "TrophySkeleton", val15);
		val40.ItemPrefab.ChangeMeshTexture(LoadEmbeddedTexture("FrozenCorpse"));
		val40.ItemPrefab.GetComponent<ItemDrop>().m_itemData.m_shared.m_trophyPos = new Vector2Int(5, 7);
		ItemManager.Instance.AddItem(val40);
		Sprite val41 = LoadEmbeddedSprite("SwollenBodyTrophy");
		val15 = new ItemConfig();
		val15.Name = "Swollen Body Trophy";
		val15.Description = "A foul piece of rotting flesh";
		val15.Icons = (Sprite[])(object)new Sprite[1] { val41 };
		CustomItem val42 = new CustomItem("SwollenBodyTrophy", "TrophyDraugr", val15);
		val42.ItemPrefab.ChangeMeshTexture(LoadEmbeddedTexture("SwollenBody"));
		val42.ItemPrefab.GetComponent<ItemDrop>().m_itemData.m_shared.m_trophyPos = new Vector2Int(4, 8);
		ItemManager.Instance.AddItem(val42);
		Sprite val43 = LoadEmbeddedSprite("PolarFenringTrophy");
		val15 = new ItemConfig();
		val15.Name = "Pale-coat Fenring Trophy";
		val15.Description = "The arm of a Polar Fenring";
		val15.Icons = (Sprite[])(object)new Sprite[1] { val43 };
		CustomItem val44 = new CustomItem("PolarFenringTrophy", "TrophyFenring", val15);
		val44.ItemPrefab.ChangeMeshTexture(LoadEmbeddedTexture("PolarFenring"));
		val44.ItemPrefab.GetComponent<ItemDrop>().m_itemData.m_shared.m_trophyPos = new Vector2Int(6, 7);
		ItemManager.Instance.AddItem(val44);
		GameObject val45 = bundle.LoadAsset<GameObject>("JotunnTrophy");
		val45.GetComponent<ItemDrop>().m_itemData.m_shared.m_trophyPos = new Vector2Int(3, 7);
		ItemManager.Instance.AddItem(new CustomItem(val45, false));
		GameObject val46 = bundle.LoadAsset<GameObject>("SmallPolarSerpentTrophy");
		val46.GetComponent<ItemDrop>().m_itemData.m_shared.m_trophyPos = new Vector2Int(4, 7);
		ItemManager.Instance.AddItem(new CustomItem(val46, false));
		Sprite val47 = LoadEmbeddedSprite("SilverGolemTrophyIcon");
		val15 = new ItemConfig();
		val15.Name = "Silver Golem Trophy";
		val15.Description = "The massive head of a defeated Silver Golem";
		val15.Icons = (Sprite[])(object)new Sprite[1] { val47 };
		CustomItem val48 = new CustomItem("SilverGolemTrophy", "TrophySGolem", val15);
		Object.DestroyImmediate((Object)(object)((Component)((Component)val48.ItemPrefab.transform.Find("attach")).transform.Find("Particle System")).gameObject);
		val48.ItemPrefab.GetComponentInChildren<Light>().color = Color.gray;
		val48.ItemPrefab.GetComponent<ItemDrop>().m_itemData.m_shared.m_trophyPos = new Vector2Int(4, 6);
		componentsInChildren = val48.ItemPrefab.GetComponentsInChildren<MeshRenderer>();
		foreach (MeshRenderer val49 in componentsInChildren)
		{
			List<Material> list2 = new List<Material>();
			Material[] materials = ((Renderer)val49).materials;
			foreach (Material val50 in materials)
			{
				list2.Add(new Material(val50)
				{
					color = Color.gray
				});
			}
			((Renderer)val49).materials = list2.ToArray();
		}
		ItemManager.Instance.AddItem(val48);
		ItemDrop component4 = PrefabManager.Instance.GetPrefab("TrophyHelDemon").GetComponent<ItemDrop>();
		component4.m_itemData.m_shared.m_trophyPos = new Vector2Int(3, 8);
		component4.m_itemData.m_shared.m_name = "Blazing Damned One Trophy";
		PrefabManager.OnVanillaPrefabsAvailable -= AddClonedItems;
		bundle.Unload(false);
	}

	private Texture2D LoadEmbeddedTexture(string imageName)
	{
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0064: Unknown result type (might be due to invalid IL or missing references)
		//IL_006b: Expected O, but got Unknown
		//IL_006d: Expected O, but got Unknown
		Assembly executingAssembly = Assembly.GetExecutingAssembly();
		string text = executingAssembly.GetManifestResourceNames().Single((string str) => str == "MonsterMobs.Assets." + imageName + ".png");
		Logger.LogDebug((object)("Resource name : " + text));
		byte[] array = ReadFully(executingAssembly.GetManifestResourceStream(text));
		Logger.LogDebug((object)$"Byte array length : {array.Length}");
		Texture2D val = new Texture2D(2, 2);
		ImageConversion.LoadImage(val, array);
		return val;
	}

	private Sprite LoadEmbeddedSprite(string imageName)
	{
		//IL_0078: Unknown result type (might be due to invalid IL or missing references)
		//IL_007e: Expected O, but got Unknown
		//IL_009f: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
		Assembly executingAssembly = Assembly.GetExecutingAssembly();
		string text = executingAssembly.GetManifestResourceNames().SingleOrDefault((string str) => str == "MonsterMobs.Assets.Sprites." + imageName + ".png");
		if (text == null)
		{
			throw new Exception(imageName + ".png not found.");
		}
		Logger.LogDebug((object)("Resource name : " + text));
		byte[] array = ReadFully(executingAssembly.GetManifestResourceStream(text));
		Logger.LogDebug((object)$"Byte array length : {array.Length}");
		Texture2D val = new Texture2D(2, 2);
		ImageConversion.LoadImage(val, array);
		return Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), Vector2.zero);
	}

	public static byte[] ReadFully(Stream input)
	{
		using MemoryStream memoryStream = new MemoryStream();
		input.CopyTo(memoryStream);
		return memoryStream.ToArray();
	}

	public static void WriteChildren(Transform go)
	{
		if (go.childCount == 0)
		{
			DebugLog(((Object)go).name);
			return;
		}
		for (int i = 0; i < go.childCount; i++)
		{
			Transform child = go.GetChild(i);
			DebugLog($"{((Object)go).name} {i} {((Object)child).name}");
			WriteChildren(((Component)child).transform);
		}
	}

	public static void DebugLog(string message)
	{
		if (Debug)
		{
			Logger.LogInfo((object)("DEBUG | " + message));
		}
	}
}
public static class GameObjectExtensions
{
	public static GameObject ChangeTexture(this GameObject go, Texture2D texture)
	{
		MonsterMobs.DebugLog("Changing texture for " + ((Object)go).name);
		if ((Object)(object)texture == (Object)null)
		{
			MonsterMobs.DebugLog("Texture is null for " + ((Object)go).name);
		}
		Renderer[] componentsInChildren = go.GetComponentsInChildren<Renderer>();
		foreach (Renderer val in componentsInChildren)
		{
			MonsterMobs.DebugLog("Changing texture for material " + ((Object)val).name);
			val.materials = ((IEnumerable<Material>)val.materials).Select((Func<Material, Material>)((Material m) => new Material(m)
			{
				mainTexture = (Texture)(object)texture
			})).ToArray();
		}
		return go;
	}

	public static GameObject ChangeMeshTexture(this GameObject go, Texture2D texture)
	{
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0031: Unknown result type (might be due to invalid IL or missing references)
		//IL_003d: Expected O, but got Unknown
		MeshRenderer[] componentsInChildren = go.GetComponentsInChildren<MeshRenderer>();
		foreach (MeshRenderer val in componentsInChildren)
		{
			List<Material> list = new List<Material>();
			Material[] materials = ((Renderer)val).materials;
			foreach (Material val2 in materials)
			{
				list.Add(new Material(val2)
				{
					mainTexture = (Texture)(object)texture
				});
			}
			((Renderer)val).materials = list.ToArray();
		}
		return go;
	}
}
public struct Clone
{
	public string BasePrefab { get; set; }

	public string NewPrefab { get; set; }

	public string Texture { get; set; }

	public Clone(string basePrefab, string newPrefab, string texture)
	{
		BasePrefab = basePrefab;
		NewPrefab = newPrefab;
		Texture = texture;
	}
}