Decompiled source of Crusader Armour v1.0.1

CrusaderArmour.dll

Decompiled 2 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using HoremvoreAssembly;
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.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("CrusaderArmour")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CrusaderArmour")]
[assembly: AssemblyCopyright("Copyright ©  2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("f62a678d-579b-4f00-bef7-ac258811ae6f")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace CrusaderArmour;

[BepInPlugin("crusader.armour.horemvore", "Crusader Armor", "1.0.0")]
[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
internal class CrusaderArmourBundle : BaseUnityPlugin
{
	public const string PluginGUID = "crusader.armour.horemvore";

	public const string PluginName = "Crusader Armor";

	public const string PluginVersion = "1.0.0";

	public AssetBundle myBundle;

	public CustomLocalization LocalMyMod;

	public ConfigEntry<bool> ModEnable;

	public ConfigEntry<bool> LoggingEnable;

	public string[] sfxList = new string[1] { "SFX_SetBuff_CA" };

	public string[] seStatsList = new string[11]
	{
		"SE_ElementalDamage_20_CA", "SE_ElementalResistance_Resistant_CA", "SE_Endurance_20_CA", "SE_Healing_40_CA", "SE_MoveSpeed_15_CA", "SE_Naturalism_CA", "SE_PhysicalDamage_20_CA", "SE_PhysicalResistance_Resistant_CA", "SE_Rejuvination_40_CA", "SE_Resolute_20_CA",
		"SE_Stamina_40_CA"
	};

	public string[] seRandomList = new string[3] { "SE_SetEffect_CrusaderArmour_90_CA", "SE_SetEffect_CrusaderArmour_75_CA", "SE_SetEffect_CrusaderArmour_60_CA" };

	public void CreateConfigurationValues()
	{
		//IL_002e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Unknown result type (might be due to invalid IL or missing references)
		//IL_003c: Expected O, but got Unknown
		//IL_003c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0046: Expected O, but got Unknown
		//IL_006b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0070: Unknown result type (might be due to invalid IL or missing references)
		//IL_0079: Expected O, but got Unknown
		//IL_0079: Unknown result type (might be due to invalid IL or missing references)
		//IL_0083: Expected O, but got Unknown
		((BaseUnityPlugin)this).Config.SaveOnConfigSet = true;
		ModEnable = ((BaseUnityPlugin)this).Config.Bind<bool>("1 Crusader Armour", "Enable", true, new ConfigDescription("Admin only, Enables this mod", (AcceptableValueBase)null, new object[1] { (object)new ConfigurationManagerAttributes
		{
			IsAdminOnly = true
		} }));
		LoggingEnable = ((BaseUnityPlugin)this).Config.Bind<bool>("2 Logging", "Enable", true, new ConfigDescription("Admin only, Enables logging", (AcceptableValueBase)null, new object[1] { (object)new ConfigurationManagerAttributes
		{
			IsAdminOnly = true
		} }));
	}

	private void DoSync()
	{
		SynchronizationManager.OnConfigurationSynchronized += delegate(object obj, ConfigurationSynchronizationEventArgs attr)
		{
			if (attr.InitialSynchronization)
			{
				Logger.LogMessage((object)"Initial Config sync event received for Crusader Armour Mod");
			}
			else
			{
				Logger.LogMessage((object)"Config sync event received for Crusader Armour Mod");
			}
		};
		SynchronizationManager.OnAdminStatusChanged += delegate
		{
			Logger.LogMessage((object)("Admin status sync event received, Crusader Armour Mod: " + (SynchronizationManager.Instance.PlayerIsAdmin ? "You're admin now" : "Downvoted, boy")));
		};
		PrefabManager.OnPrefabsRegistered -= DoSync;
	}

	private void Awake()
	{
		try
		{
			CreateConfigurationValues();
			if (ModEnable.Value)
			{
				AddLocalization();
				LoadBundle();
				AddSEStatsEffects();
				AddSERandomEffects();
				AddSFX();
				AddCrusaderArmourBronze();
				AddCrusaderArmourIron();
				AddCrusaderArmourSilver();
				PrefabManager.OnPrefabsRegistered += FixSFX;
				PrefabManager.OnPrefabsRegistered += DoSync;
			}
		}
		catch (Exception arg)
		{
			((BaseUnityPlugin)this).Logger.LogWarning((object)$"Exception caught while initalizing plugin: {arg}");
		}
	}

	public void AddLocalization()
	{
		try
		{
			LocalMyMod = LocalizationManager.Instance.GetLocalization();
			CustomLocalization localMyMod = LocalMyMod;
			string text = "English";
			localMyMod.AddTranslation(ref text, new Dictionary<string, string>
			{
				{ "effect_effect_ca", "Effect:\n" },
				{ "effect_seteffect_crusaderarmour_ca", "Crusader" },
				{ "effect_seteffect_crusaderarmour_tooltip_ca", "Grants a random boon.\nEffect:" },
				{ "effect_elementaldamage_20_ca", "Elementalist" },
				{ "effect_physicaldamage_20_ca", "Mauler" },
				{ "effect_elementalresistance_resistant_ca", "Druidic" },
				{ "effect_physicalresistance_resistant_ca", "Defender" },
				{ "effect_endurance_20_ca", "Endurance" },
				{ "effect_healing_40_ca", "Healing" },
				{ "effect_movespeed_15_ca", "Swift" },
				{ "effect_naturalism_ca", "Naturalism" },
				{ "effect_rejuvination_40_ca", "Rejuvination" },
				{ "effect_resolute_20_ca", "Resolute" },
				{ "effect_stamina_40_ca", "Energaized" },
				{ "item_armor_platebronze_chest_ah", "Bronze Plate Chest" },
				{ "item_armor_platebronze_chest_desc_ah", "Durable plate armour" },
				{ "item_armor_platebronze_legs_ah", "Bronze Plate Legs" },
				{ "item_armor_platebronze_legs_desc_ah", "Durable plate armour" },
				{ "item_armor_platebronze_helm_ah", "Bronze Plate Helm" },
				{ "item_armor_platebronze_helm_desc_ah", "Durable plate armour" },
				{ "item_armor_plateiron_chest_ah", "Iron Plate Chest" },
				{ "item_armor_plateiron_chest_desc_ah", "Durable plate armour" },
				{ "item_armor_plateiron_legs_ah", "Iron Plate Legs" },
				{ "item_armor_plateiron_legs_desc_ah", "Durable plate armour" },
				{ "item_armor_plateiron_helm_ah", "Iron Plate Helm" },
				{ "item_armor_plateiron_helm_desc_ah", "Durable plate armour" },
				{ "item_armor_platesilver_chest_ah", "Silver Plate Chest" },
				{ "item_armor_platesilver_chest_desc_ah", "Durable plate armour" },
				{ "item_armor_platesilver_legs_ah", "Silver Plate Legs" },
				{ "item_armor_platesilver_legs_desc_ah", "Durable plate armour" },
				{ "item_armor_platesilver_helm_ah", "Silver Plate Helm" },
				{ "item_armor_platesilver_helm_desc_ah", "Durable plate armour" }
			});
		}
		catch (Exception arg)
		{
			((BaseUnityPlugin)this).Logger.LogWarning((object)$"Exception caught while adding Localication: {arg}");
		}
	}

	public void LoadBundle()
	{
		try
		{
			myBundle = AssetUtils.LoadAssetBundleFromResources("crusaderarmour", Assembly.GetExecutingAssembly());
		}
		catch (Exception arg)
		{
			((BaseUnityPlugin)this).Logger.LogWarning((object)$"Exception caught while loading Bundle: {arg}");
		}
	}

	public void AddSEStatsEffects()
	{
		//IL_0030: Unknown result type (might be due to invalid IL or missing references)
		//IL_0037: Expected O, but got Unknown
		try
		{
			string[] array = seStatsList;
			foreach (string text in array)
			{
				SE_Stats val = myBundle.LoadAsset<SE_Stats>(text);
				if ((Object)(object)val != (Object)null)
				{
					CustomStatusEffect val2 = new CustomStatusEffect((StatusEffect)(object)val, true);
					ItemManager.Instance.AddStatusEffect(val2);
					((BaseUnityPlugin)this).Logger.LogMessage((object)("Added: " + text + " to the Status Effect database"));
				}
			}
		}
		catch (Exception arg)
		{
			((BaseUnityPlugin)this).Logger.LogWarning((object)$"Exception caught while adding SE_Stats Effects: {arg}");
		}
	}

	public void AddSERandomEffects()
	{
		//IL_0030: Unknown result type (might be due to invalid IL or missing references)
		//IL_0037: Expected O, but got Unknown
		try
		{
			string[] array = seRandomList;
			foreach (string text in array)
			{
				SE_AddRandomEffect_HS val = myBundle.LoadAsset<SE_AddRandomEffect_HS>(text);
				if ((Object)(object)val != (Object)null)
				{
					CustomStatusEffect val2 = new CustomStatusEffect((StatusEffect)(object)val, true);
					ItemManager.Instance.AddStatusEffect(val2);
					((BaseUnityPlugin)this).Logger.LogMessage((object)("Added: " + text + " to the Status Effect database"));
				}
			}
		}
		catch (Exception arg)
		{
			((BaseUnityPlugin)this).Logger.LogWarning((object)$"Exception caught while adding SE_Stats Effects: {arg}");
		}
	}

	private void AddSFX()
	{
		//IL_0022: Unknown result type (might be due to invalid IL or missing references)
		//IL_0029: Expected O, but got Unknown
		try
		{
			string[] array = sfxList;
			foreach (string text in array)
			{
				GameObject val = myBundle.LoadAsset<GameObject>(text);
				CustomPrefab val2 = new CustomPrefab(val, false);
				PrefabManager.Instance.AddPrefab(val2);
				if (LoggingEnable.Value)
				{
					((BaseUnityPlugin)this).Logger.LogMessage((object)("Added: " + text + " to the Object database"));
				}
			}
		}
		catch (Exception arg)
		{
			((BaseUnityPlugin)this).Logger.LogWarning((object)$"Exception caught while adding sfx prefabs: {arg}");
		}
	}

	private void AddCrusaderArmourBronze()
	{
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		//IL_001c: Expected O, but got Unknown
		//IL_0045: Unknown result type (might be due to invalid IL or missing references)
		//IL_004a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0056: Unknown result type (might be due to invalid IL or missing references)
		//IL_005e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0067: Expected O, but got Unknown
		//IL_0069: Unknown result type (might be due to invalid IL or missing references)
		//IL_006e: Unknown result type (might be due to invalid IL or missing references)
		//IL_007a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0082: Unknown result type (might be due to invalid IL or missing references)
		//IL_008b: Expected O, but got Unknown
		//IL_008d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0092: Unknown result type (might be due to invalid IL or missing references)
		//IL_009e: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00af: Expected O, but got Unknown
		//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bd: Expected O, but got Unknown
		//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e3: Expected O, but got Unknown
		//IL_010c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0111: Unknown result type (might be due to invalid IL or missing references)
		//IL_011d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0125: Unknown result type (might be due to invalid IL or missing references)
		//IL_012e: Expected O, but got Unknown
		//IL_0130: Unknown result type (might be due to invalid IL or missing references)
		//IL_0135: Unknown result type (might be due to invalid IL or missing references)
		//IL_0141: Unknown result type (might be due to invalid IL or missing references)
		//IL_0149: Unknown result type (might be due to invalid IL or missing references)
		//IL_0152: Expected O, but got Unknown
		//IL_0154: Unknown result type (might be due to invalid IL or missing references)
		//IL_0159: Unknown result type (might be due to invalid IL or missing references)
		//IL_0165: Unknown result type (might be due to invalid IL or missing references)
		//IL_016d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0176: Expected O, but got Unknown
		//IL_017e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0184: Expected O, but got Unknown
		//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ac: Expected O, but got Unknown
		//IL_01d5: 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_01e6: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ee: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f7: Expected O, but got Unknown
		//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
		//IL_01fe: Unknown result type (might be due to invalid IL or missing references)
		//IL_020a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0212: Unknown result type (might be due to invalid IL or missing references)
		//IL_021b: Expected O, but got Unknown
		//IL_021d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0222: Unknown result type (might be due to invalid IL or missing references)
		//IL_022e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0236: Unknown result type (might be due to invalid IL or missing references)
		//IL_023f: Expected O, but got Unknown
		//IL_0247: Unknown result type (might be due to invalid IL or missing references)
		//IL_024e: Expected O, but got Unknown
		try
		{
			GameObject val = myBundle.LoadAsset<GameObject>("ArmorBronzePlateChest_AH");
			ItemConfig val2 = new ItemConfig();
			val2.Amount = 1;
			val2.CraftingStation = "forge";
			val2.MinStationLevel = 1;
			val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[3]
			{
				new RequirementConfig
				{
					Item = "Bronze",
					Amount = 7,
					AmountPerLevel = 4
				},
				new RequirementConfig
				{
					Item = "DeerHide",
					Amount = 3,
					AmountPerLevel = 1
				},
				new RequirementConfig
				{
					Item = "TrophyGreydwarfBrute",
					Amount = 1,
					AmountPerLevel = 0
				}
			};
			CustomItem val3 = new CustomItem(val, true, val2);
			ItemManager.Instance.AddItem(val3);
			GameObject val4 = myBundle.LoadAsset<GameObject>("ArmorBronzePlateLegs_AH");
			val2 = new ItemConfig();
			val2.Amount = 1;
			val2.CraftingStation = "forge";
			val2.MinStationLevel = 1;
			val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[3]
			{
				new RequirementConfig
				{
					Item = "Bronze",
					Amount = 7,
					AmountPerLevel = 4
				},
				new RequirementConfig
				{
					Item = "DeerHide",
					Amount = 3,
					AmountPerLevel = 1
				},
				new RequirementConfig
				{
					Item = "TrophyGreydwarfBrute",
					Amount = 1,
					AmountPerLevel = 0
				}
			};
			CustomItem val5 = new CustomItem(val4, true, val2);
			ItemManager.Instance.AddItem(val5);
			GameObject val6 = myBundle.LoadAsset<GameObject>("ArmorBronzePlateHelm_AH");
			val2 = new ItemConfig();
			val2.Amount = 1;
			val2.CraftingStation = "forge";
			val2.MinStationLevel = 1;
			val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[3]
			{
				new RequirementConfig
				{
					Item = "Bronze",
					Amount = 7,
					AmountPerLevel = 4
				},
				new RequirementConfig
				{
					Item = "DeerHide",
					Amount = 3,
					AmountPerLevel = 1
				},
				new RequirementConfig
				{
					Item = "TrophyGreydwarfBrute",
					Amount = 1,
					AmountPerLevel = 0
				}
			};
			CustomItem val7 = new CustomItem(val6, true, val2);
			ItemManager.Instance.AddItem(val7);
		}
		catch (Exception arg)
		{
			((BaseUnityPlugin)this).Logger.LogWarning((object)$"Exception caught while adding CrusaderArmourBronze: {arg}");
		}
	}

	private void AddCrusaderArmourIron()
	{
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		//IL_001c: Expected O, but got Unknown
		//IL_0045: Unknown result type (might be due to invalid IL or missing references)
		//IL_004a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0056: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: Expected O, but got Unknown
		//IL_006a: Unknown result type (might be due to invalid IL or missing references)
		//IL_006f: Unknown result type (might be due to invalid IL or missing references)
		//IL_007b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0083: Unknown result type (might be due to invalid IL or missing references)
		//IL_008c: Expected O, but got Unknown
		//IL_008e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0093: 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_00a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b0: Expected O, but got Unknown
		//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d4: Expected O, but got Unknown
		//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e2: Expected O, but got Unknown
		//IL_0101: Unknown result type (might be due to invalid IL or missing references)
		//IL_0108: 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_0142: Unknown result type (might be due to invalid IL or missing references)
		//IL_014b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0154: Expected O, but got Unknown
		//IL_0156: Unknown result type (might be due to invalid IL or missing references)
		//IL_015b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0167: Unknown result type (might be due to invalid IL or missing references)
		//IL_016f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0178: Expected O, but got Unknown
		//IL_017a: Unknown result type (might be due to invalid IL or missing references)
		//IL_017f: Unknown result type (might be due to invalid IL or missing references)
		//IL_018b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0193: Unknown result type (might be due to invalid IL or missing references)
		//IL_019c: Expected O, but got Unknown
		//IL_019e: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a3: 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_01b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c0: Expected O, but got Unknown
		//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ce: Expected O, but got Unknown
		//IL_01ef: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f6: Expected O, but got Unknown
		//IL_021f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0224: Unknown result type (might be due to invalid IL or missing references)
		//IL_0230: Unknown result type (might be due to invalid IL or missing references)
		//IL_0239: Unknown result type (might be due to invalid IL or missing references)
		//IL_0242: Expected O, but got Unknown
		//IL_0244: Unknown result type (might be due to invalid IL or missing references)
		//IL_0249: Unknown result type (might be due to invalid IL or missing references)
		//IL_0255: Unknown result type (might be due to invalid IL or missing references)
		//IL_025d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0266: Expected O, but got Unknown
		//IL_0268: Unknown result type (might be due to invalid IL or missing references)
		//IL_026d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0279: Unknown result type (might be due to invalid IL or missing references)
		//IL_0281: Unknown result type (might be due to invalid IL or missing references)
		//IL_028a: Expected O, but got Unknown
		//IL_028c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0291: Unknown result type (might be due to invalid IL or missing references)
		//IL_029d: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ae: Expected O, but got Unknown
		//IL_02b6: Unknown result type (might be due to invalid IL or missing references)
		//IL_02bd: Expected O, but got Unknown
		try
		{
			GameObject val = myBundle.LoadAsset<GameObject>("ArmorIronPlateChest_AH");
			ItemConfig val2 = new ItemConfig();
			val2.Amount = 1;
			val2.CraftingStation = "forge";
			val2.MinStationLevel = 2;
			val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[4]
			{
				new RequirementConfig
				{
					Item = "Iron",
					Amount = 25,
					AmountPerLevel = 6
				},
				new RequirementConfig
				{
					Item = "DeerHide",
					Amount = 3,
					AmountPerLevel = 0
				},
				new RequirementConfig
				{
					Item = "Chain",
					Amount = 1,
					AmountPerLevel = 1
				},
				new RequirementConfig
				{
					Item = "TrophyAbomination",
					Amount = 1,
					AmountPerLevel = 0
				}
			};
			CustomItem val3 = new CustomItem(val, true, val2);
			ItemManager.Instance.AddItem(val3);
			GameObject val4 = myBundle.LoadAsset<GameObject>("ArmorIronPlateLegs_AH");
			val2 = new ItemConfig();
			val2.Amount = 1;
			val2.CraftingStation = "forge";
			val2.MinStationLevel = 2;
			val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[4]
			{
				new RequirementConfig
				{
					Item = "Iron",
					Amount = 25,
					AmountPerLevel = 6
				},
				new RequirementConfig
				{
					Item = "DeerHide",
					Amount = 3,
					AmountPerLevel = 1
				},
				new RequirementConfig
				{
					Item = "Chain",
					Amount = 1,
					AmountPerLevel = 1
				},
				new RequirementConfig
				{
					Item = "TrophyAbomination",
					Amount = 1,
					AmountPerLevel = 0
				}
			};
			CustomItem val5 = new CustomItem(val4, true, val2);
			ItemManager.Instance.AddItem(val5);
			GameObject val6 = myBundle.LoadAsset<GameObject>("ArmorIronPlateHelm_AH");
			val2 = new ItemConfig();
			val2.Amount = 1;
			val2.CraftingStation = "forge";
			val2.MinStationLevel = 2;
			val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[4]
			{
				new RequirementConfig
				{
					Item = "Iron",
					Amount = 25,
					AmountPerLevel = 6
				},
				new RequirementConfig
				{
					Item = "DeerHide",
					Amount = 3,
					AmountPerLevel = 1
				},
				new RequirementConfig
				{
					Item = "Chain",
					Amount = 1,
					AmountPerLevel = 1
				},
				new RequirementConfig
				{
					Item = "TrophyAbomination",
					Amount = 1,
					AmountPerLevel = 0
				}
			};
			CustomItem val7 = new CustomItem(val6, true, val2);
			ItemManager.Instance.AddItem(val7);
		}
		catch (Exception arg)
		{
			((BaseUnityPlugin)this).Logger.LogWarning((object)$"Exception caught while adding CrusaderArmourBronze: {arg}");
		}
	}

	private void AddCrusaderArmourSilver()
	{
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		//IL_001c: Expected O, but got Unknown
		//IL_0045: Unknown result type (might be due to invalid IL or missing references)
		//IL_004a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0056: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: Expected O, but got Unknown
		//IL_006a: Unknown result type (might be due to invalid IL or missing references)
		//IL_006f: Unknown result type (might be due to invalid IL or missing references)
		//IL_007b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0083: Unknown result type (might be due to invalid IL or missing references)
		//IL_008c: Expected O, but got Unknown
		//IL_008e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0093: 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_00a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b0: Expected O, but got Unknown
		//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d4: Expected O, but got Unknown
		//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e2: Expected O, but got Unknown
		//IL_0101: Unknown result type (might be due to invalid IL or missing references)
		//IL_0108: 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_0142: Unknown result type (might be due to invalid IL or missing references)
		//IL_014b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0154: Expected O, but got Unknown
		//IL_0156: Unknown result type (might be due to invalid IL or missing references)
		//IL_015b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0167: Unknown result type (might be due to invalid IL or missing references)
		//IL_016f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0178: Expected O, but got Unknown
		//IL_017a: Unknown result type (might be due to invalid IL or missing references)
		//IL_017f: Unknown result type (might be due to invalid IL or missing references)
		//IL_018b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0193: Unknown result type (might be due to invalid IL or missing references)
		//IL_019c: Expected O, but got Unknown
		//IL_019e: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a3: 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_01b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c0: Expected O, but got Unknown
		//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ce: Expected O, but got Unknown
		//IL_01ef: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f6: Expected O, but got Unknown
		//IL_021f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0224: Unknown result type (might be due to invalid IL or missing references)
		//IL_0230: Unknown result type (might be due to invalid IL or missing references)
		//IL_0239: Unknown result type (might be due to invalid IL or missing references)
		//IL_0242: Expected O, but got Unknown
		//IL_0244: Unknown result type (might be due to invalid IL or missing references)
		//IL_0249: Unknown result type (might be due to invalid IL or missing references)
		//IL_0255: Unknown result type (might be due to invalid IL or missing references)
		//IL_025d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0266: Expected O, but got Unknown
		//IL_0268: Unknown result type (might be due to invalid IL or missing references)
		//IL_026d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0279: Unknown result type (might be due to invalid IL or missing references)
		//IL_0281: Unknown result type (might be due to invalid IL or missing references)
		//IL_028a: Expected O, but got Unknown
		//IL_028c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0291: Unknown result type (might be due to invalid IL or missing references)
		//IL_029d: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ae: Expected O, but got Unknown
		//IL_02b6: Unknown result type (might be due to invalid IL or missing references)
		//IL_02bd: Expected O, but got Unknown
		try
		{
			GameObject val = myBundle.LoadAsset<GameObject>("ArmorSilverPlateChest_AH");
			ItemConfig val2 = new ItemConfig();
			val2.Amount = 1;
			val2.CraftingStation = "forge";
			val2.MinStationLevel = 2;
			val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[4]
			{
				new RequirementConfig
				{
					Item = "Silver",
					Amount = 25,
					AmountPerLevel = 6
				},
				new RequirementConfig
				{
					Item = "WolfPelt",
					Amount = 3,
					AmountPerLevel = 1
				},
				new RequirementConfig
				{
					Item = "Chain",
					Amount = 2,
					AmountPerLevel = 0
				},
				new RequirementConfig
				{
					Item = "TrophySGolem",
					Amount = 1,
					AmountPerLevel = 0
				}
			};
			CustomItem val3 = new CustomItem(val, true, val2);
			ItemManager.Instance.AddItem(val3);
			GameObject val4 = myBundle.LoadAsset<GameObject>("ArmorSilverPlateLegs_AH");
			val2 = new ItemConfig();
			val2.Amount = 1;
			val2.CraftingStation = "forge";
			val2.MinStationLevel = 2;
			val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[4]
			{
				new RequirementConfig
				{
					Item = "Silver",
					Amount = 25,
					AmountPerLevel = 6
				},
				new RequirementConfig
				{
					Item = "WolfPelt",
					Amount = 3,
					AmountPerLevel = 1
				},
				new RequirementConfig
				{
					Item = "Chain",
					Amount = 1,
					AmountPerLevel = 0
				},
				new RequirementConfig
				{
					Item = "TrophySGolem",
					Amount = 1,
					AmountPerLevel = 0
				}
			};
			CustomItem val5 = new CustomItem(val4, true, val2);
			ItemManager.Instance.AddItem(val5);
			GameObject val6 = myBundle.LoadAsset<GameObject>("ArmorSilverPlateHelm_AH");
			val2 = new ItemConfig();
			val2.Amount = 1;
			val2.CraftingStation = "forge";
			val2.MinStationLevel = 2;
			val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[4]
			{
				new RequirementConfig
				{
					Item = "Silver",
					Amount = 25,
					AmountPerLevel = 6
				},
				new RequirementConfig
				{
					Item = "WolfPelt",
					Amount = 3,
					AmountPerLevel = 1
				},
				new RequirementConfig
				{
					Item = "Chain",
					Amount = 1,
					AmountPerLevel = 0
				},
				new RequirementConfig
				{
					Item = "TrophySGolem",
					Amount = 1,
					AmountPerLevel = 0
				}
			};
			CustomItem val7 = new CustomItem(val6, true, val2);
			ItemManager.Instance.AddItem(val7);
		}
		catch (Exception arg)
		{
			((BaseUnityPlugin)this).Logger.LogWarning((object)$"Exception caught while adding CrusaderArmourBronze: {arg}");
		}
	}

	private void FixSFX()
	{
		try
		{
			AudioSource prefab = Cache.GetPrefab<AudioSource>("sfx_arrow_hit");
			string[] array = sfxList;
			foreach (string text in array)
			{
				GameObject prefab2 = Cache.GetPrefab<GameObject>(text);
				prefab2.GetComponentInChildren<AudioSource>().outputAudioMixerGroup = prefab.outputAudioMixerGroup;
				if (LoggingEnable.Value)
				{
					((BaseUnityPlugin)this).Logger.LogMessage((object)("Audio Mixer, SFX, set on: " + text));
				}
			}
		}
		catch
		{
			((BaseUnityPlugin)this).Logger.LogWarning((object)"SFX Fix Failed");
		}
		finally
		{
			PrefabManager.OnPrefabsRegistered -= FixSFX;
		}
	}

	public void UnloadBundle()
	{
		try
		{
			AssetBundle obj = myBundle;
			if (obj != null)
			{
				obj.Unload(false);
			}
		}
		catch (Exception arg)
		{
			((BaseUnityPlugin)this).Logger.LogWarning((object)$"Exception caught while unloading Bundle: {arg}");
		}
	}
}