Decompiled source of Mithril v420.0.9
MithrilMine.dll
Decompiled a month ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Concurrent; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.IO; using System.IO.Compression; using System.Linq; using System.Linq.Expressions; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Serialization; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using HarmonyLib; using ItemManager; using JetBrains.Annotations; using LocalizationManager; using LocationManager; using Microsoft.CodeAnalysis; using MithrilMine.Functions; using PieceManager; using ServerSync; using SoftReferenceableAssets; using TMPro; using UnityEngine; using UnityEngine.UI; using YamlDotNet.Core; using YamlDotNet.Core.Events; using YamlDotNet.Core.Tokens; using YamlDotNet.Helpers; using YamlDotNet.Serialization; using YamlDotNet.Serialization.Converters; using YamlDotNet.Serialization.EventEmitters; using YamlDotNet.Serialization.NamingConventions; using YamlDotNet.Serialization.NodeDeserializers; using YamlDotNet.Serialization.NodeTypeResolvers; using YamlDotNet.Serialization.ObjectFactories; using YamlDotNet.Serialization.ObjectGraphTraversalStrategies; using YamlDotNet.Serialization.ObjectGraphVisitors; using YamlDotNet.Serialization.Schemas; using YamlDotNet.Serialization.TypeInspectors; using YamlDotNet.Serialization.TypeResolvers; using YamlDotNet.Serialization.Utilities; using YamlDotNet.Serialization.ValueDeserializers; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("MithrilMine")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("blacks7ar")] [assembly: AssemblyProduct("MithrilMine")] [assembly: AssemblyCopyright("Copyright © 2025")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("8A93715A-276C-4B6A-BF7F-C593AA8FD600")] [assembly: AssemblyFileVersion("1.0.8")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.8.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } public class MBeacon : MonoBehaviour { public float m_range = 20f; public static List<MBeacon> m_instances = new List<MBeacon>(); public void Awake() { m_instances.Add(this); } public void OnDestroy() { m_instances.Remove(this); } public static MBeacon FindClosestBeaconInRange(Vector3 point) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Expected O, but got Unknown MBeacon mBeacon = null; float num = 999999f; foreach (MBeacon instance in m_instances) { float num2 = Vector3.Distance(point, ((Component)instance).transform.position); if (num2 < instance.m_range && ((Object)mBeacon == (Object)null || num2 < num)) { mBeacon = instance; num = num2; } } return mBeacon; } public static void FindBeaconsInRange(Vector3 point, List<MBeacon> beacons) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) foreach (MBeacon instance in m_instances) { if (Vector3.Distance(point, ((Component)instance).transform.position) < instance.m_range) { beacons.Add(instance); } } } } public class ElevatorShaft : MonoBehaviour { public bool m_canMove = true; public float m_speed = 2f; public int m_startPoint; public Transform[] m_points; private int i; private bool m_reverse; public void Start() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) ((Component)this).transform.position = m_points[m_startPoint].position; i = m_startPoint; } public void Update() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: 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) if (Vector3.Distance(((Component)this).transform.position, m_points[i].position) < 0.01f) { m_canMove = false; if (i == m_points.Length - 1) { m_reverse = true; i--; return; } if (i == 0) { m_reverse = false; i++; return; } if (m_reverse) { i--; } else { i++; } } if (m_canMove) { ((Component)this).transform.position = Vector3.MoveTowards(((Component)this).transform.position, m_points[i].position, m_speed * Time.deltaTime); } } } public class ElevatorShaftSwitch : MonoBehaviour, Hoverable, Interactable { public ElevatorShaft m_elevator; private string m_name = "$bmm_elevatorshaft"; public string GetHoverText() { return Localization.instance.Localize(m_name + "\n[<color=yellow><b>$KEY_Use</b></color>] $bmm_activate"); } public string GetHoverName() { return m_name; } public bool Interact(Humanoid user, bool hold, bool alt) { if (hold) { return false; } if (m_elevator.m_canMove) { return true; } m_elevator.m_canMove = true; return true; } public bool UseItem(Humanoid user, ItemData item) { return false; } } public class ParentPlatformShaft : MonoBehaviour { private void OnCollisionEnter(Collision other) { other.transform.SetParent(((Component)this).transform); other.gameObject.GetComponent<Rigidbody>().interpolation = (RigidbodyInterpolation)0; } private void OnCollisionExit(Collision other) { other.transform.SetParent((Transform)null); other.gameObject.GetComponent<Rigidbody>().interpolation = (RigidbodyInterpolation)1; } } namespace MithrilMine { [BepInPlugin("blacks7ar.MithrilMine", "MithrilMine", "1.0.8")] public class Plugin : BaseUnityPlugin { private enum Toggle { On = 1, Off = 0 } [HarmonyPatch] private static class Patches { private static readonly List<ZoneVegetation> _vegetationList = new List<ZoneVegetation>(); [HarmonyPostfix] [HarmonyPatch(typeof(ZNetScene), "Awake")] private static void ZNetSceneAwake_Postfix(ZNetScene __instance) { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: 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_0071: Expected O, but got Unknown //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_00a9: 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_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Expected O, but got Unknown if (!((Object)(object)__instance == (Object)null) && __instance.m_prefabs.Count > 0) { InitMine(__instance); Smelter component = __instance.GetPrefab("smelter").GetComponent<Smelter>(); component.m_conversion.AddRange(new List<ItemConversion> { new ItemConversion { m_from = __instance.GetPrefab("BMM_MithrilOre").GetComponent<ItemDrop>(), m_to = __instance.GetPrefab("BMM_Mithril").GetComponent<ItemDrop>() }, new ItemConversion { m_from = __instance.GetPrefab("BMM_MeteoriteOre").GetComponent<ItemDrop>(), m_to = __instance.GetPrefab("BMM_Meteorite").GetComponent<ItemDrop>() }, new ItemConversion { m_from = __instance.GetPrefab("BMM_WarpstoneOre").GetComponent<ItemDrop>(), m_to = __instance.GetPrefab("BMM_Warpstone").GetComponent<ItemDrop>() } }); ItemDrop component2 = __instance.GetPrefab("BMM_MithrilCultivator").GetComponent<ItemDrop>(); GameObject val = ((IEnumerable<GameObject>)Resources.FindObjectsOfTypeAll<GameObject>()).FirstOrDefault((Func<GameObject, bool>)((GameObject x) => ((Object)x).name == "_CultivatorPieceTable")); component2.m_itemData.m_shared.m_buildPieces = ((val != null) ? val.GetComponent<PieceTable>() : null); ItemDrop component3 = __instance.GetPrefab("BMM_MithrilHammer").GetComponent<ItemDrop>(); GameObject val2 = ((IEnumerable<GameObject>)Resources.FindObjectsOfTypeAll<GameObject>()).FirstOrDefault((Func<GameObject, bool>)((GameObject x) => ((Object)x).name == "_HammerPieceTable")); component3.m_itemData.m_shared.m_buildPieces = ((val2 != null) ? val2.GetComponent<PieceTable>() : null); ItemDrop component4 = __instance.GetPrefab("BMM_MithrilHoe").GetComponent<ItemDrop>(); GameObject val3 = ((IEnumerable<GameObject>)Resources.FindObjectsOfTypeAll<GameObject>()).FirstOrDefault((Func<GameObject, bool>)((GameObject x) => ((Object)x).name == "_HoePieceTable")); component4.m_itemData.m_shared.m_buildPieces = ((val3 != null) ? val3.GetComponent<PieceTable>() : null); ItemDrop component5 = __instance.GetPrefab("BMM_MithrilPickaxe").GetComponent<ItemDrop>(); ItemDrop component6 = __instance.GetPrefab("PickaxeBlackMetal").GetComponent<ItemDrop>(); component5.m_itemData.m_shared.m_spawnOnHitTerrain = component6?.m_itemData.m_shared.m_spawnOnHitTerrain; } } [HarmonyPostfix] [HarmonyPatch(typeof(EnvMan), "OnMorning")] private static void OnMorning_Postfix(EnvMan __instance) { if (_enableReset.Value == Toggle.Off) { return; } List<int> list = new List<int>(); for (int i = 1; i <= 1000 / _resetDay.Value; i++) { int item = _resetDay.Value * i; list.Add(item); } int currentDay = __instance.GetCurrentDay(); foreach (int item2 in list.Where((int num2) => num2 == currentDay)) { ResetMines(); Debug.Log((object)("MithrilMine reset day! Current Day: " + currentDay + " / Reset Day: " + item2)); } } [HarmonyPrefix] [HarmonyPatch(typeof(Terminal), "InputText")] private static bool InputText_Prefix(Terminal __instance) { string text = ((TMP_InputField)__instance.m_input).text.TrimEnd(Array.Empty<char>()).ToLower(); if (text != "/mithrilmines reset") { return true; } ResetMines(); __instance.AddString("Resetting mines.. Done!"); return false; } [HarmonyPrefix] [HarmonyPatch(typeof(ZoneSystem), "ValidateVegetation")] private static void ValidateVegetation_Prefix(ZoneSystem __instance) { //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0057: 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_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: 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_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Expected O, but got Unknown //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_014f: 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_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: 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_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Expected O, but got Unknown //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_020d: 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_0229: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_0252: 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_0268: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Unknown result type (might be due to invalid IL or missing references) //IL_0293: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: Expected O, but got Unknown foreach (ZoneVegetation vegetation in _vegetationList) { __instance.m_vegetation.Remove(vegetation); } _vegetationList.Clear(); ZoneVegetation item = new ZoneVegetation { m_prefab = _mithrilDeposit, m_enable = true, m_min = _mithrilDepositMin.Value, m_max = _mithrilDepositMax.Value, m_scaleMin = 1f, m_scaleMax = 1.2f, m_biome = _mithrilDepositBiome.Value, m_biomeArea = (BiomeArea)2, m_blockCheck = true, m_minAltitude = -0.5f, m_maxAltitude = 1000f, m_maxTerrainDelta = 2f, m_groundOffset = _mithrilDepositGroundOffset.Value, m_groupSizeMin = _mithrilDepositGroupSizeMin.Value, m_groupSizeMax = _mithrilDepositGroupSizeMax.Value, m_groupRadius = _mithrilDepositGroupRadius.Value }; ZoneVegetation item2 = new ZoneVegetation { m_prefab = _warpstoneDeposit, m_enable = true, m_min = _warpstoneDepositMin.Value, m_max = _warpstoneDepositMax.Value, m_scaleMin = 1f, m_scaleMax = 1.2f, m_biome = _warpstoneDepositBiome.Value, m_biomeArea = (BiomeArea)2, m_blockCheck = true, m_minAltitude = -0.5f, m_maxAltitude = 1000f, m_maxTerrainDelta = 2f, m_groundOffset = _warpstoneDepositGroundOffset.Value, m_groupSizeMin = _warpstoneDepositGroupSizeMin.Value, m_groupSizeMax = _warpstoneDepositGroupSizeMax.Value, m_groupRadius = _warpstoneDepositGroupRadius.Value }; ZoneVegetation item3 = new ZoneVegetation { m_prefab = _meteoriteDeposit, m_enable = true, m_min = _meteoriteDepositMin.Value, m_max = _meteoriteDepositMax.Value, m_scaleMin = 1f, m_scaleMax = 1.2f, m_biome = _meteoriteDepositBiome.Value, m_biomeArea = (BiomeArea)2, m_blockCheck = true, m_minAltitude = -0.5f, m_maxAltitude = 1000f, m_maxTerrainDelta = 2f, m_groundOffset = _meteoriteDepositGroundOffset.Value, m_groupSizeMin = _meteoriteDepositGroupSizeMin.Value, m_groupSizeMax = _meteoriteDepositGroupSizeMax.Value, m_groupRadius = _meteoriteDepositGroupRadius.Value }; _vegetationList.Add(item); _vegetationList.Add(item2); _vegetationList.Add(item3); foreach (ZoneVegetation vegetation2 in _vegetationList) { __instance.m_vegetation.Add(vegetation2); } } [HarmonyPostfix] [HarmonyPatch(typeof(Player), "GetTotalFoodValue")] private static void GetTotalFoodValue_Postfix(ref Player __instance, ref float eitr) { if (!((Object)(object)__instance == (Object)null)) { SetEitr(__instance, "bmm_eitrbelt_se", _eitrBeltEitrBonus.Value, ref eitr); SetEitr(__instance, "bmm_mithril_earring", _eitr.Value, ref eitr); } } private static void ResetMines() { DestroyAllVeins(); List<Location> s_allLocations = Location.s_allLocations; foreach (RandomSpawn[] item in from location in s_allLocations where ((Object)((Component)location).gameObject).name.Contains("MithrilMine") select ((Component)location).GetComponentsInChildren<RandomSpawn>(true)) { if (item == null || item.Length <= 0) { continue; } RandomSpawn[] array = item; foreach (RandomSpawn val in array) { Destructible[] componentsInChildren = ((Component)val).GetComponentsInChildren<Destructible>(true); Destructible[] array2 = componentsInChildren; foreach (Destructible val2 in array2) { if (!((Object)(object)val2 == (Object)null)) { ((Component)val2).gameObject.SetActive(true); } } MineRock[] componentsInChildren2 = ((Component)val).GetComponentsInChildren<MineRock>(true); MineRock[] array3 = componentsInChildren2; foreach (MineRock val3 in array3) { if (!((Object)(object)val3 == (Object)null)) { ((Component)val3).gameObject.SetActive(true); } } CreatureSpawner[] components = ((Component)val).GetComponents<CreatureSpawner>(); CreatureSpawner[] array4 = components; foreach (CreatureSpawner val4 in array4) { if (!((Object)(object)val4 == (Object)null)) { ((Component)val4).gameObject.SetActive(true); val4.m_respawnTimeMinuts = 0f; } } val.m_chanceToSpawn = _oreSpawnChance.Value; val.Prepare(); bool spawned = Random.Range(0f, 100f) <= val.m_chanceToSpawn; val.SetSpawned(spawned); } } } private static void DestroyAllVeins() { List<Location> s_allLocations = Location.s_allLocations; foreach (RandomSpawn[] item in from location in s_allLocations where ((Object)((Component)location).gameObject).name.Contains("MithrilMine") select ((Component)location).GetComponentsInChildren<RandomSpawn>(true)) { if (item == null || item.Length <= 0) { continue; } RandomSpawn[] array = item; foreach (RandomSpawn val in array) { Destructible[] componentsInChildren = ((Component)val).GetComponentsInChildren<Destructible>(false); Destructible[] array2 = componentsInChildren; foreach (Destructible val2 in array2) { if (!((Object)(object)val2 == (Object)null) && ((Behaviour)val2).isActiveAndEnabled) { ZNetScene.instance.Destroy(((Component)val2).gameObject); } } MineRock[] componentsInChildren2 = ((Component)val).GetComponentsInChildren<MineRock>(false); MineRock[] array3 = componentsInChildren2; foreach (MineRock val3 in array3) { if (!((Object)(object)val3 == (Object)null) && ((Behaviour)val3).isActiveAndEnabled) { ZNetScene.instance.Destroy(((Component)val3).gameObject); } } } } } } private const string modGUID = "blacks7ar.MithrilMine"; public const string modName = "MithrilMine"; public const string modAuthor = "blacks7ar"; public const string modVersion = "1.0.8"; public const string modLink = ""; private static readonly Harmony _harmony = new Harmony("blacks7ar.MithrilMine"); private static readonly ConfigSync _configSync = new ConfigSync("blacks7ar.MithrilMine") { DisplayName = "MithrilMine", CurrentVersion = "1.0.8", MinimumRequiredVersion = "1.0.8", ModRequired = true }; private static ConfigEntry<Toggle> _serverConfigLocked; private static ConfigEntry<int> _resetDay; private static ConfigEntry<Toggle> _enableReset; private static ConfigEntry<float> _oreSpawnChance; private static ConfigEntry<int> _mithrilMineDropMin; private static ConfigEntry<int> _mithrilMineDropMax; private static ConfigEntry<int> _mithrilMineMaxCount; private static ConfigEntry<float> _eitr; private static ConfigEntry<int> _mithrilDepositMin; private static ConfigEntry<int> _mithrilDepositMax; private static ConfigEntry<Biome> _mithrilDepositBiome; private static ConfigEntry<float> _mithrilDepositGroundOffset; private static ConfigEntry<int> _mithrilDepositGroupSizeMin; private static ConfigEntry<int> _mithrilDepositGroupSizeMax; private static ConfigEntry<float> _mithrilDepositGroupRadius; private static ConfigEntry<int> _warpstoneDepositMin; private static ConfigEntry<int> _warpstoneDepositMax; private static ConfigEntry<Biome> _warpstoneDepositBiome; private static ConfigEntry<float> _warpstoneDepositGroundOffset; private static ConfigEntry<int> _warpstoneDepositGroupSizeMin; private static ConfigEntry<int> _warpstoneDepositGroupSizeMax; private static ConfigEntry<float> _warpstoneDepositGroupRadius; private static ConfigEntry<int> _meteoriteDepositMin; private static ConfigEntry<int> _meteoriteDepositMax; private static ConfigEntry<Biome> _meteoriteDepositBiome; private static ConfigEntry<float> _meteoriteDepositGroundOffset; private static ConfigEntry<int> _meteoriteDepositGroupSizeMin; private static ConfigEntry<int> _meteoriteDepositGroupSizeMax; private static ConfigEntry<float> _meteoriteDepositGroupRadius; public static ConfigEntry<float> _dvergrBeltEitrRegen; public static ConfigEntry<float> _eitrBeltEitrBonus; public static ConfigEntry<float> _elementalistBeltSkillBonus; public static ConfigEntry<float> _hogwartsBeltDmgMultiplier; public static ConfigEntry<float> _necromancerBeltSkillBonus; private static AssetBundle _mithrilBundle; private static GameObject _mithrilMine01; private static GameObject _mithrilMine02; private static GameObject _mithrilDeposit; private static GameObject _warpstoneDeposit; private static GameObject _meteoriteDeposit; private static Localization english; private ConfigEntry<T> config<T>(string group, string name, T value, ConfigDescription description, bool synchronizedConfig = true) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown ConfigDescription val = new ConfigDescription(description.Description + (synchronizedConfig ? " [Synced with Server]" : " [Not Synced with Server]"), description.AcceptableValues, description.Tags); ConfigEntry<T> val2 = ((BaseUnityPlugin)this).Config.Bind<T>(group, name, value, val); SyncedConfigEntry<T> syncedConfigEntry = _configSync.AddConfigEntry<T>(val2); syncedConfigEntry.SynchronizedConfig = synchronizedConfig; return val2; } public void Awake() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Expected O, but got Unknown //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Expected O, but got Unknown //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Expected O, but got Unknown //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Expected O, but got Unknown //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Expected O, but got Unknown //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Expected O, but got Unknown //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Expected O, but got Unknown //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Expected O, but got Unknown //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Expected O, but got Unknown //IL_0296: Unknown result type (might be due to invalid IL or missing references) //IL_02a1: Expected O, but got Unknown //IL_02c4: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Expected O, but got Unknown //IL_02fd: Unknown result type (might be due to invalid IL or missing references) //IL_0308: Expected O, but got Unknown //IL_032b: Unknown result type (might be due to invalid IL or missing references) //IL_0336: Expected O, but got Unknown //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_0364: Expected O, but got Unknown //IL_0384: Unknown result type (might be due to invalid IL or missing references) //IL_038f: Expected O, but got Unknown //IL_03bd: Unknown result type (might be due to invalid IL or missing references) //IL_03c8: Expected O, but got Unknown //IL_03eb: Unknown result type (might be due to invalid IL or missing references) //IL_03f6: Expected O, but got Unknown //IL_0419: Unknown result type (might be due to invalid IL or missing references) //IL_0424: Expected O, but got Unknown //IL_0452: Unknown result type (might be due to invalid IL or missing references) //IL_045d: Expected O, but got Unknown //IL_0480: Unknown result type (might be due to invalid IL or missing references) //IL_048b: Expected O, but got Unknown //IL_04ae: Unknown result type (might be due to invalid IL or missing references) //IL_04b9: Expected O, but got Unknown //IL_04d9: Unknown result type (might be due to invalid IL or missing references) //IL_04e4: Expected O, but got Unknown //IL_0512: Unknown result type (might be due to invalid IL or missing references) //IL_051d: Expected O, but got Unknown //IL_0540: Unknown result type (might be due to invalid IL or missing references) //IL_054b: Expected O, but got Unknown //IL_056e: Unknown result type (might be due to invalid IL or missing references) //IL_0579: Expected O, but got Unknown //IL_05a7: Unknown result type (might be due to invalid IL or missing references) //IL_05b2: Expected O, but got Unknown //IL_05e0: Unknown result type (might be due to invalid IL or missing references) //IL_05eb: Expected O, but got Unknown //IL_0619: Unknown result type (might be due to invalid IL or missing references) //IL_0624: Expected O, but got Unknown //IL_0652: Unknown result type (might be due to invalid IL or missing references) //IL_065d: Expected O, but got Unknown //IL_068b: Unknown result type (might be due to invalid IL or missing references) //IL_0696: Expected O, but got Unknown //IL_06c4: Unknown result type (might be due to invalid IL or missing references) //IL_06cf: Expected O, but got Unknown //IL_0709: Unknown result type (might be due to invalid IL or missing references) //IL_0710: Unknown result type (might be due to invalid IL or missing references) //IL_0ede: Unknown result type (might be due to invalid IL or missing references) //IL_0ee5: Unknown result type (might be due to invalid IL or missing references) //IL_18c1: Unknown result type (might be due to invalid IL or missing references) //IL_18cb: Unknown result type (might be due to invalid IL or missing references) //IL_18d3: Unknown result type (might be due to invalid IL or missing references) //IL_18d8: Unknown result type (might be due to invalid IL or missing references) //IL_1998: Unknown result type (might be due to invalid IL or missing references) //IL_19a2: Unknown result type (might be due to invalid IL or missing references) //IL_19aa: Unknown result type (might be due to invalid IL or missing references) //IL_19af: Unknown result type (might be due to invalid IL or missing references) //IL_23fa: Unknown result type (might be due to invalid IL or missing references) //IL_24e4: Unknown result type (might be due to invalid IL or missing references) //IL_24fe: Unknown result type (might be due to invalid IL or missing references) //IL_2577: Unknown result type (might be due to invalid IL or missing references) //IL_2579: Unknown result type (might be due to invalid IL or missing references) //IL_26cd: Unknown result type (might be due to invalid IL or missing references) Localizer.Load(); ((BaseUnityPlugin)this).Config.SaveOnConfigSet = false; _serverConfigLocked = config("1- ServerSync", "Lock Configuration", Toggle.On, new ConfigDescription("If On, the configuration is locked and can be changed by server admins only.", (AcceptableValueBase)null, Array.Empty<object>())); _configSync.AddLockingConfigEntry<Toggle>(_serverConfigLocked); _enableReset = config("2- General", "Enable Mine Reset", Toggle.On, new ConfigDescription("If On, mines contents will be reset according to Reset Day value.", (AcceptableValueBase)null, Array.Empty<object>())); _resetDay = config("2- General", "Reset Day", 15, new ConfigDescription("How many in-game days needed to reset the content of the mine.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 200), Array.Empty<object>())); _oreSpawnChance = config("2- General", "Ore Veins Spawn Chance", 50f, new ConfigDescription("Percentage chance that the ore veins will spawn upon mine generation and reset.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 100f), Array.Empty<object>())); _mithrilMineDropMin = config("3- OreDeposits Drop Settings", "CoalMine DropMin", 6, new ConfigDescription("Minimum drops from coal deposits.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 10), Array.Empty<object>())); _mithrilMineDropMax = config("3- OreDeposits Drop Settings", "CoalMine DropMax", 8, new ConfigDescription("Maximum drops from coal deposits.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 15), Array.Empty<object>())); _mithrilMineMaxCount = config("2- General", "Mine Max Count", 50, new ConfigDescription("Maximum number of mines to be spawned per biome.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 100), Array.Empty<object>())); _mithrilBundle = Location.PrefabManager.RegisterAssetBundle("mithrilbundle"); _eitr = config("2- General", "Earrings Eitr", 34f, new ConfigDescription("Additional eitr given to player when equip.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 100f), Array.Empty<object>())); _mithrilDepositMin = config("3- Mithril Deposit", "Minimum", 3, new ConfigDescription("Minimum amount of mithril deposit to be spawned.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 20), Array.Empty<object>())); _mithrilDepositMax = config("3- Mithril Deposit", "Maximum", 5, new ConfigDescription("Maximum amount of mithril deposit to be spawned.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 20), Array.Empty<object>())); _mithrilDepositBiome = config<Biome>("3- Mithril Deposit", "Biome", (Biome)895, new ConfigDescription("Which biome does mithril deposits spawns to.", (AcceptableValueBase)null, Array.Empty<object>())); _mithrilDepositGroundOffset = config("3- Mithril Deposit", "Ground Offset", -2f, new ConfigDescription("How deep the mithril deposit will be spawned.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(-5f, 0f), Array.Empty<object>())); _mithrilDepositGroupSizeMin = config("3- Mithril Deposit", "Group Size Min", 1, new ConfigDescription("Minimum amount of mithril deposit to be spawned in a group.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 10), Array.Empty<object>())); _mithrilDepositGroupSizeMax = config("3- Mithril Deposit", "Group Size Max", 3, new ConfigDescription("Maximum amount of mithril deposit to be spawned in a group.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 10), Array.Empty<object>())); _mithrilDepositGroupRadius = config("3- Mithril Deposit", "Group Radius", 54f, new ConfigDescription("How far each group will be spawned.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 1000f), Array.Empty<object>())); _warpstoneDepositMin = config("4- Warpstone Deposit", "Minimum", 3, new ConfigDescription("Minimum amount of warpstone deposit to be spawned.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 20), Array.Empty<object>())); _warpstoneDepositMax = config("4- Warpstone Deposit", "Maximum", 5, new ConfigDescription("Maximum amount of warpstone deposit to be spawned.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 20), Array.Empty<object>())); _warpstoneDepositBiome = config<Biome>("4- Warpstone Deposit", "Biome", (Biome)895, new ConfigDescription("Which biome does warpstone deposits spawns to.", (AcceptableValueBase)null, Array.Empty<object>())); _warpstoneDepositGroundOffset = config("4- Warpstone Deposit", "Ground Offset", -2f, new ConfigDescription("How deep the warpstone deposit will be spawned.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(-5f, 0f), Array.Empty<object>())); _warpstoneDepositGroupSizeMin = config("4- Warpstone Deposit", "Group Size Min", 1, new ConfigDescription("Minimum amount of warpstone deposit to be spawned in a group.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 10), Array.Empty<object>())); _warpstoneDepositGroupSizeMax = config("4- Warpstone Deposit", "Group Size Max", 3, new ConfigDescription("Maximum amount of warpstone deposit to be spawned in a group.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 10), Array.Empty<object>())); _warpstoneDepositGroupRadius = config("4- Warpstone Deposit", "Group Radius", 54f, new ConfigDescription("How far each group will be spawned.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 1000f), Array.Empty<object>())); _meteoriteDepositMin = config("5- Meteorite Deposit", "Minimum", 3, new ConfigDescription("Minimum amount of meteorite deposit to be spawned.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 20), Array.Empty<object>())); _meteoriteDepositMax = config("5- Meteorite Deposit", "Maximum", 5, new ConfigDescription("Maximum amount of meteorite deposit to be spawned.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 20), Array.Empty<object>())); _meteoriteDepositBiome = config<Biome>("5- Meteorite Deposit", "Biome", (Biome)895, new ConfigDescription("Which biome does meteorite deposits spawns to.", (AcceptableValueBase)null, Array.Empty<object>())); _meteoriteDepositGroundOffset = config("5- Meteorite Deposit", "Ground Offset", -2f, new ConfigDescription("How deep the meteorite deposit will be spawned.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(-5f, 0f), Array.Empty<object>())); _meteoriteDepositGroupSizeMin = config("5- Meteorite Deposit", "Group Size Min", 1, new ConfigDescription("Minimum amount of meteorite deposit to be spawned in a group.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 10), Array.Empty<object>())); _meteoriteDepositGroupSizeMax = config("Meteorite Deposit", "Group Size Max", 3, new ConfigDescription("Maximum amount of meteorite deposit to be spawned in a group.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 10), Array.Empty<object>())); _meteoriteDepositGroupRadius = config("5- Meteorite Deposit", "Group Radius", 54f, new ConfigDescription("How far each group will be spawned.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 1000f), Array.Empty<object>())); _dvergrBeltEitrRegen = config("6- Belts", "Dvergr Belt Eitr Regen", 1f, new ConfigDescription("Dvergr belt eitr regen bonus.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 2f), Array.Empty<object>())); _eitrBeltEitrBonus = config("6- Belts", "Eitr Belt Eitr Bonus", 72f, new ConfigDescription("Eitr belt eitr bonus.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 200f), Array.Empty<object>())); _elementalistBeltSkillBonus = config("6- Belts", "Elementalist Belt Skill Bonus", 30f, new ConfigDescription("Skill bonus added to ElementalMagic skill level.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 50f), Array.Empty<object>())); _hogwartsBeltDmgMultiplier = config("6- Belts", "Hogwarts Belt Damage Multiplier", 3f, new ConfigDescription("Hogwarts belt elemental damage multiplier.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 5f), Array.Empty<object>())); _necromancerBeltSkillBonus = config("6- Belts", "Necromancer Belt Skill Bonus", 30f, new ConfigDescription("Skill bonus added to BloodMagic skill level.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 50f), Array.Empty<object>())); Location.ConfigurationEnabled = false; _mithrilMine01 = _mithrilBundle.LoadAsset<GameObject>("BMM_MithrilMine01"); Location location = new Location(_mithrilMine01) { CanSpawn = true, ClearArea = true, Biome = (Biome)64, SpawnArea = (BiomeArea)3, Count = _mithrilMineMaxCount.Value, GroupName = "OreMines", MinimumDistanceFromGroup = 500f, Rotation = Rotation.Slope, HeightDelta = new LocationManager.Range(0f, 40f), ForestThreshold = new LocationManager.Range(0f, 1f), SpawnAltitude = new LocationManager.Range(0.5f, 150f), SpawnDistance = new LocationManager.Range(500f, 10000f) }; ShaderReplacer.Replace(_mithrilMine01); location.CreatureSpawner.Add("Spawner_Ulv", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (1)", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (2)", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (3)", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (4)", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (5)", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (6)", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (7)", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (8)", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (9)", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (10)", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (11)", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (12)", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (13)", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (14)", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (15)", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (16)", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (17)", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (18)", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (19)", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (20)", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (21)", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (22)", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (23)", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (24)", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (25)", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (26)", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (27)", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (28)", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (29)", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (30)", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (31)", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (32)", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (33)", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (34)", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (35)", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (36)", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (37)", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (38)", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (39)", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (40)", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (41)", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (42)", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (43)", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (44)", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (45)", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (46)", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (47)", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (48)", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (49)", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (50)", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (51)", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (52)", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (54)", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (55)", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (56)", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (57)", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (58)", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (59)", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (60)", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (61)", "Wolf"); location.CreatureSpawner.Add("Spawner_Ulv (62)", "Wolf"); location.CreatureSpawner.Add("Spawner_Cultist", "Fenring_Cultist"); location.CreatureSpawner.Add("Spawner_Cultist (1)", "Fenring_Cultist"); location.CreatureSpawner.Add("Spawner_Cultist (2)", "Fenring_Cultist"); location.CreatureSpawner.Add("Spawner_Cultist (3)", "Fenring_Cultist"); location.CreatureSpawner.Add("Spawner_Cultist (4)", "Fenring_Cultist"); location.CreatureSpawner.Add("Spawner_Cultist (5)", "Fenring_Cultist"); location.CreatureSpawner.Add("Spawner_Cultist (6)", "Fenring_Cultist"); location.CreatureSpawner.Add("Spawner_Cultist (7)", "Fenring_Cultist"); location.CreatureSpawner.Add("Spawner_Cultist (8)", "Fenring_Cultist"); location.CreatureSpawner.Add("Spawner_Cultist (9)", "Fenring_Cultist"); location.CreatureSpawner.Add("Spawner_Cultist (10)", "Fenring_Cultist"); location.CreatureSpawner.Add("Spawner_Cultist (11)", "Fenring_Cultist"); location.CreatureSpawner.Add("Spawner_Cultist (12)", "Fenring_Cultist"); location.CreatureSpawner.Add("Spawner_Cultist (13)", "Fenring_Cultist"); location.CreatureSpawner.Add("Spawner_Cultist (14)", "Fenring_Cultist"); location.CreatureSpawner.Add("Spawner_Cultist (15)", "Fenring_Cultist"); location.CreatureSpawner.Add("ExteriorSpawner_Fenring", "Fenring"); location.CreatureSpawner.Add("ExteriorSpawner_Fenring (1)", "Fenring"); location.CreatureSpawner.Add("ExteriorSpawner_Fenring (2)", "Fenring"); location.CreatureSpawner.Add("ExteriorSpawner_Fenring (3)", "Fenring"); location.CreatureSpawner.Add("ExteriorSpawner_Fenring (4)", "Fenring"); location.CreatureSpawner.Add("ExteriorSpawner_Cultist", "Fenring_Cultist"); location.CreatureSpawner.Add("ExteriorSpawner_Cultist (1)", "Fenring_Cultist"); location.CreatureSpawner.Add("ExteriorSpawner_Cultist (2)", "Fenring_Cultist"); _mithrilMine02 = _mithrilBundle.LoadAsset<GameObject>("BMM_MithrilMine02"); Location location2 = new Location(_mithrilMine02) { CanSpawn = true, ClearArea = true, Biome = (Biome)16, SpawnArea = (BiomeArea)3, Count = _mithrilMineMaxCount.Value, GroupName = "OreMines", MinimumDistanceFromGroup = 500f, Rotation = Rotation.Slope, HeightDelta = new LocationManager.Range(0f, 40f), ForestThreshold = new LocationManager.Range(0f, 1f), SpawnAltitude = new LocationManager.Range(0.5f, 1000f), SpawnDistance = new LocationManager.Range(500f, 10000f) }; ShaderReplacer.Replace(_mithrilMine02); location2.CreatureSpawner.Add("Spawner_Goblin", "Goblin"); location2.CreatureSpawner.Add("Spawner_Goblin (1)", "Goblin"); location2.CreatureSpawner.Add("Spawner_Goblin (2)", "Goblin"); location2.CreatureSpawner.Add("Spawner_Goblin (3)", "Goblin"); location2.CreatureSpawner.Add("Spawner_Goblin (4)", "Goblin"); location2.CreatureSpawner.Add("Spawner_Goblin (5)", "Goblin"); location2.CreatureSpawner.Add("Spawner_Goblin (6)", "Goblin"); location2.CreatureSpawner.Add("Spawner_Goblin (7)", "Goblin"); location2.CreatureSpawner.Add("Spawner_Goblin (8)", "Goblin"); location2.CreatureSpawner.Add("Spawner_Goblin (9)", "Goblin"); location2.CreatureSpawner.Add("Spawner_Goblin (10)", "Goblin"); location2.CreatureSpawner.Add("Spawner_Goblin (11)", "Goblin"); location2.CreatureSpawner.Add("Spawner_Goblin (12)", "Goblin"); location2.CreatureSpawner.Add("Spawner_Goblin (13)", "Goblin"); location2.CreatureSpawner.Add("Spawner_Goblin (14)", "Goblin"); location2.CreatureSpawner.Add("Spawner_Goblin (15)", "Goblin"); location2.CreatureSpawner.Add("Spawner_Goblin (16)", "Goblin"); location2.CreatureSpawner.Add("Spawner_Goblin (17)", "Goblin"); location2.CreatureSpawner.Add("Spawner_Goblin (18)", "Goblin"); location2.CreatureSpawner.Add("Spawner_Goblin (19)", "Goblin"); location2.CreatureSpawner.Add("Spawner_Goblin (20)", "Goblin"); location2.CreatureSpawner.Add("Spawner_Goblin (21)", "Goblin"); location2.CreatureSpawner.Add("Spawner_Goblin (22)", "Goblin"); location2.CreatureSpawner.Add("Spawner_Goblin (23)", "Goblin"); location2.CreatureSpawner.Add("Spawner_Goblin (24)", "Goblin"); location2.CreatureSpawner.Add("Spawner_Goblin (25)", "Goblin"); location2.CreatureSpawner.Add("Spawner_Goblin (26)", "Goblin"); location2.CreatureSpawner.Add("Spawner_Goblin (27)", "Goblin"); location2.CreatureSpawner.Add("Spawner_Goblin (28)", "Goblin"); location2.CreatureSpawner.Add("Spawner_Goblin (29)", "Goblin"); location2.CreatureSpawner.Add("Spawner_Goblin (30)", "Goblin"); location2.CreatureSpawner.Add("Spawner_Goblin (31)", "Goblin"); location2.CreatureSpawner.Add("Spawner_Goblin (32)", "Goblin"); location2.CreatureSpawner.Add("Spawner_Goblin (33)", "Goblin"); location2.CreatureSpawner.Add("Spawner_Goblin (34)", "Goblin"); location2.CreatureSpawner.Add("Spawner_Goblin (35)", "Goblin"); location2.CreatureSpawner.Add("Spawner_Goblin (36)", "Goblin"); location2.CreatureSpawner.Add("Spawner_Goblin (37)", "Goblin"); location2.CreatureSpawner.Add("Spawner_Goblin (38)", "Goblin"); location2.CreatureSpawner.Add("Spawner_Goblin (39)", "Goblin"); location2.CreatureSpawner.Add("Spawner_Goblin (40)", "Goblin"); location2.CreatureSpawner.Add("Spawner_Goblin (41)", "Goblin"); location2.CreatureSpawner.Add("Spawner_Goblin (42)", "Goblin"); location2.CreatureSpawner.Add("Spawner_Goblin (43)", "Goblin"); location2.CreatureSpawner.Add("Spawner_Goblin (44)", "Goblin"); location2.CreatureSpawner.Add("Spawner_Goblin (45)", "Goblin"); location2.CreatureSpawner.Add("Spawner_Goblin (46)", "Goblin"); location2.CreatureSpawner.Add("Spawner_Goblin (47)", "Goblin"); location2.CreatureSpawner.Add("Spawner_Goblin (48)", "Goblin"); location2.CreatureSpawner.Add("Spawner_Goblin (49)", "Goblin"); location2.CreatureSpawner.Add("Spawner_Goblin (50)", "Goblin"); location2.CreatureSpawner.Add("Spawner_Goblin (51)", "Goblin"); location2.CreatureSpawner.Add("Spawner_Goblin (52)", "Goblin"); location2.CreatureSpawner.Add("Spawner_Goblin (53)", "Goblin"); location2.CreatureSpawner.Add("Spawner_Goblin (54)", "Goblin"); location2.CreatureSpawner.Add("Spawner_Goblin (55)", "Goblin"); location2.CreatureSpawner.Add("Spawner_Goblin (56)", "Goblin"); location2.CreatureSpawner.Add("Spawner_Goblin (57)", "Goblin"); location2.CreatureSpawner.Add("Spawner_Goblin (58)", "Goblin"); location2.CreatureSpawner.Add("Spawner_Goblin (59)", "Goblin"); location2.CreatureSpawner.Add("Spawner_Goblin (60)", "Goblin"); location2.CreatureSpawner.Add("Spawner_GoblinShaman", "GoblinShaman"); location2.CreatureSpawner.Add("Spawner_GoblinShaman (1)", "GoblinShaman"); location2.CreatureSpawner.Add("Spawner_GoblinShaman (2)", "GoblinShaman"); location2.CreatureSpawner.Add("Spawner_GoblinShaman (3)", "GoblinShaman"); location2.CreatureSpawner.Add("Spawner_GoblinShaman (4)", "GoblinShaman"); location2.CreatureSpawner.Add("Spawner_GoblinShaman (5)", "GoblinShaman"); location2.CreatureSpawner.Add("Spawner_GoblinShaman (6)", "GoblinShaman"); location2.CreatureSpawner.Add("Spawner_GoblinShaman (7)", "GoblinShaman"); location2.CreatureSpawner.Add("Spawner_GoblinShaman (8)", "GoblinShaman"); location2.CreatureSpawner.Add("Spawner_GoblinShaman (9)", "GoblinShaman"); location2.CreatureSpawner.Add("Spawner_GoblinShaman (10)", "GoblinShaman"); location2.CreatureSpawner.Add("Spawner_GoblinShaman (11)", "GoblinShaman"); location2.CreatureSpawner.Add("Spawner_GoblinShaman (12)", "GoblinShaman"); location2.CreatureSpawner.Add("Spawner_GoblinShaman (13)", "GoblinShaman"); location2.CreatureSpawner.Add("Spawner_GoblinShaman (14)", "GoblinShaman"); location2.CreatureSpawner.Add("Spawner_GoblinShaman (15)", "GoblinShaman"); location2.CreatureSpawner.Add("ExteriorSpawner_Goblin", "Goblin"); location2.CreatureSpawner.Add("ExteriorSpawner_Goblin (1)", "Goblin"); location2.CreatureSpawner.Add("ExteriorSpawner_Goblin (2)", "Goblin"); location2.CreatureSpawner.Add("ExteriorSpawner_Goblin (3)", "Goblin"); location2.CreatureSpawner.Add("ExteriorSpawner_GoblinBrute", "GoblinBrute"); location2.CreatureSpawner.Add("ExteriorSpawner_GoblinBrute (1)", "GoblinBrute"); location2.CreatureSpawner.Add("ExteriorSpawner_GoblinShaman", "GoblinShaman"); location2.CreatureSpawner.Add("ExteriorSpawner_GoblinShaman (1)", "GoblinShaman"); new Item(_mithrilBundle, "BMM_Mithril").Configurable = Configurability.Disabled; Item item = new Item(_mithrilBundle, "BMM_MithrilCoins"); item.Crafting.Add(ItemManager.CraftingTable.Forge, 1); item.RequiredItems.Add("BMM_Mithril", 1); item.CraftAmount = 10; item.Configurable = Configurability.Recipe; new Item(_mithrilBundle, "BMM_MithrilOre").Configurable = Configurability.Disabled; Item item2 = new Item(_mithrilBundle, "BMM_Earring_Eitr"); item2.Crafting.Add(ItemManager.CraftingTable.Forge, 1); item2.RequiredItems.Add("BMM_Mithril", 15); item2.RequiredItems.Add("Copper", 10); item2.Configurable = Configurability.Recipe; ItemData itemData = item2.Prefab.GetComponent<ItemDrop>().m_itemData; SE_AddEitr statEffect = ScriptableObject.CreateInstance<SE_AddEitr>(); ((Object)statEffect).name = "bmm_mithril_earring"; ((StatusEffect)statEffect).m_name = "$bmm_earring_eitr"; ((StatusEffect)statEffect).m_icon = itemData.GetIcon(); _eitr.SettingChanged += delegate { statEffect.SetEitr(_eitr.Value); }; statEffect.SetEitr(_eitr.Value); itemData.m_shared.m_equipStatusEffect = (StatusEffect)(object)statEffect; Item item3 = new Item(_mithrilBundle, "BMM_Earring_EitrRegen"); item3.Crafting.Add(ItemManager.CraftingTable.Forge, 1); item3.RequiredItems.Add("BMM_Mithril", 25); item3.RequiredItems.Add("Bronze", 20); item3.Configurable = Configurability.Recipe | Configurability.Stats; Item item4 = new Item(_mithrilBundle, "BMM_Earring_FireResist"); item4.Crafting.Add(ItemManager.CraftingTable.Forge, 1); item4.RequiredItems.Add("BMM_Mithril", 35); item4.RequiredItems.Add("Iron", 30); item4.Configurable = Configurability.Recipe; ItemData itemData2 = item4.Prefab.GetComponent<ItemDrop>().m_itemData; SE_Stats val = ScriptableObject.CreateInstance<SE_Stats>(); ((Object)val).name = "bmm_mithrilearring_fireresist"; ((StatusEffect)val).m_name = itemData2.m_shared.m_name; ((StatusEffect)val).m_icon = itemData2.GetIcon(); val.m_mods = new List<DamageModPair>(1) { new DamageModPair { m_type = (DamageType)32, m_modifier = (DamageModifier)5 } }; itemData2.m_shared.m_equipStatusEffect = (StatusEffect)(object)val; Item item5 = new Item(_mithrilBundle, "BMM_Earring_FrostResist"); item5.Crafting.Add(ItemManager.CraftingTable.Forge, 1); item5.RequiredItems.Add("BMM_Mithril", 45); item5.RequiredItems.Add("Silver", 40); item5.Configurable = Configurability.Recipe; ItemData itemData3 = item5.Prefab.GetComponent<ItemDrop>().m_itemData; SE_Stats val2 = ScriptableObject.CreateInstance<SE_Stats>(); ((Object)val2).name = "bmm_mithrilearring_frostresist"; ((StatusEffect)val2).m_name = itemData3.m_shared.m_name; ((StatusEffect)val2).m_icon = itemData3.GetIcon(); val2.m_mods = new List<DamageModPair>(1) { new DamageModPair { m_type = (DamageType)64, m_modifier = (DamageModifier)5 } }; itemData3.m_shared.m_equipStatusEffect = (StatusEffect)(object)val2; Item item6 = new Item(_mithrilBundle, "BMM_MithrilGreatSword"); item6.Crafting.Add(ItemManager.CraftingTable.Forge, 1); item6.RequiredItems.Add("BMM_Mithril", 35); item6.RequiredItems.Add("Silver", 40); item6.RequiredItems.Add("Iron", 34); item6.RequiredUpgradeItems.Add("BMM_Mithril", 17); item6.RequiredUpgradeItems.Add("Silver", 20); item6.Configurable = Configurability.Recipe | Configurability.Stats; Item item7 = new Item(_mithrilBundle, "BMM_MithrilKnife"); item7.Crafting.Add(ItemManager.CraftingTable.Forge, 1); item7.RequiredItems.Add("BMM_Mithril", 22); item7.RequiredItems.Add("Silver", 16); item7.RequiredItems.Add("Iron", 12); item7.RequiredUpgradeItems.Add("BMM_Mithril", 11); item7.RequiredUpgradeItems.Add("Silver", 8); item7.RequiredUpgradeItems.Add("Iron", 6); item7.Configurable = Configurability.Recipe | Configurability.Stats; Item item8 = new Item(_mithrilBundle, "BMM_MithrilSword"); item8.Crafting.Add(ItemManager.CraftingTable.Forge, 1); item8.RequiredItems.Add("BMM_Mithril", 28); item8.RequiredItems.Add("Silver", 34); item8.RequiredItems.Add("Iron", 26); item8.RequiredUpgradeItems.Add("BMM_Mithril", 14); item8.RequiredUpgradeItems.Add("Silver", 17); item8.RequiredUpgradeItems.Add("Iron", 13); item8.Configurable = Configurability.Recipe | Configurability.Stats; Item item9 = new Item(_mithrilBundle, "BMM_MithrilAxe"); item9.Crafting.Add(ItemManager.CraftingTable.Forge, 4); item9.RequiredItems.Add("AxeBlackMetal", 1); item9.RequiredItems.Add("BMM_Mithril", 55); item9.RequiredItems.Add("BlackMetal", 35); item9.RequiredItems.Add("Silver", 40); item9.Configurable = Configurability.Recipe | Configurability.Stats; Item item10 = new Item(_mithrilBundle, "BMM_MithrilCultivator"); item10.Crafting.Add(ItemManager.CraftingTable.Forge, 4); item10.RequiredItems.Add("Cultivator", 1); item10.RequiredItems.Add("BMM_Mithril", 30); item10.RequiredItems.Add("Silver", 20); item10.RequiredItems.Add("Iron", 15); item10.Configurable = Configurability.Recipe | Configurability.Stats; Item item11 = new Item(_mithrilBundle, "BMM_MithrilHammer"); item11.Crafting.Add(ItemManager.CraftingTable.Forge, 4); item11.RequiredItems.Add("Hammer", 1); item11.RequiredItems.Add("BMM_Mithril", 25); item11.RequiredItems.Add("Silver", 15); item11.RequiredItems.Add("Iron", 10); item11.Configurable = Configurability.Recipe | Configurability.Stats; Item item12 = new Item(_mithrilBundle, "BMM_MithrilHoe"); item12.Crafting.Add(ItemManager.CraftingTable.Forge, 4); item12.RequiredItems.Add("Hoe", 1); item12.RequiredItems.Add("BMM_Mithril", 15); item12.RequiredItems.Add("Silver", 10); item12.RequiredItems.Add("Iron", 10); item12.Configurable = Configurability.Recipe | Configurability.Stats; Item item13 = new Item(_mithrilBundle, "BMM_MithrilPickaxe"); item13.Crafting.Add(ItemManager.CraftingTable.Forge, 4); item13.RequiredItems.Add("PickaxeBlackMetal", 1); item13.RequiredItems.Add("BMM_Mithril", 40); item13.RequiredItems.Add("BlackMetal", 25); item13.RequiredItems.Add("Silver", 30); item13.Configurable = Configurability.Recipe | Configurability.Stats; Item item14 = new Item(_mithrilBundle, "BMM_GoldenWishbone"); ItemData itemData4 = item14.Prefab.GetComponent<ItemDrop>().m_itemData; SE_MithrilFinder sE_MithrilFinder = ScriptableObject.CreateInstance<SE_MithrilFinder>(); ((StatusEffect)sE_MithrilFinder).m_icon = itemData4.GetIcon(); itemData4.m_shared.m_equipStatusEffect = (StatusEffect)(object)sE_MithrilFinder; item14.DropsFrom.Add("Eikthyr", 1f, 1, 1, levelMultiplier: false); item14.Trade.Trader = Trader.Haldor; item14.Trade.Price = 2500u; item14.Trade.Stack = 1u; item14.Trade.RequiredGlobalKey = "defeated_eikthyr"; ShaderReplacer.Replace(item14.Prefab); BuildPiece buildPiece = new BuildPiece(_mithrilBundle, "BMM_MithrilStack"); buildPiece.Crafting.Set(PieceManager.CraftingTable.Workbench); buildPiece.Category.Set(BuildPieceCategory.Misc); buildPiece.RequiredItems.Add("BMM_Mithril", 30, recover: true); buildPiece.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; BuildPiece buildPiece2 = new BuildPiece(_mithrilBundle, "BMM_MeteoriteStack"); buildPiece2.Crafting.Set(PieceManager.CraftingTable.Workbench); buildPiece2.Category.Set(BuildPieceCategory.Misc); buildPiece2.RequiredItems.Add("BMM_Meteorite", 30, recover: true); buildPiece2.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; BuildPiece buildPiece3 = new BuildPiece(_mithrilBundle, "BMM_WarpstoneStack"); buildPiece3.Crafting.Set(PieceManager.CraftingTable.Workbench); buildPiece3.Category.Set(BuildPieceCategory.Misc); buildPiece3.RequiredItems.Add("BMM_Warpstone", 30, recover: true); buildPiece3.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; new Item(_mithrilBundle, "BMM_WarpstoneOre").Configurable = Configurability.Disabled; new Item(_mithrilBundle, "BMM_MeteoriteOre").Configurable = Configurability.Disabled; Item item15 = new Item(_mithrilBundle, "BMM_CorpseBonePowder"); item15["Corpse Bone Powder (BoneFragments)"].Crafting.Add(ItemManager.CraftingTable.Workbench, 1); item15["Corpse Bone Powder (BoneFragments)"].RequiredItems.Add("BoneFragments", 1); item15["Corpse Bone Powder (Chitin)"].Crafting.Add("BMM_MithrilTable", 1); item15["Corpse Bone Powder (Chitin)"].RequiredItems.Add("Chitin", 1); item15["Corpse Bone Powder (Chitin)"].CraftAmount = 2; item15.Configurable = Configurability.Recipe; Item item16 = new Item(_mithrilBundle, "BMM_MeteoriteDust"); item16.Crafting.Add(ItemManager.CraftingTable.Workbench, 1); item16.RequiredItems.Add("BMM_MeteoriteOre", 1); item16.RequiredItems.Add("BMM_CorpseBonePowder", 1); item16.Configurable = Configurability.Recipe; Item item17 = new Item(_mithrilBundle, "BMM_MithrilDust"); item17.Crafting.Add(ItemManager.CraftingTable.Workbench, 1); item17.RequiredItems.Add("BMM_MithrilOre", 1); item17.RequiredItems.Add("BMM_CorpseBonePowder", 1); item17.Configurable = Configurability.Recipe; Item item18 = new Item(_mithrilBundle, "BMM_WarpstoneDust"); item18.Crafting.Add(ItemManager.CraftingTable.Workbench, 1); item18.RequiredItems.Add("BMM_WarpstoneOre", 1); item18.RequiredItems.Add("BMM_CorpseBonePowder", 1); item18.Configurable = Configurability.Recipe; Item item19 = new Item(_mithrilBundle, "BMM_DvergrBelt"); item19.Crafting.Add(ItemManager.CraftingTable.ArtisanTable, 1); item19.RequiredItems.Add("Thunderstone", 6); item19.RequiredItems.Add("Amber", 10); item19.RequiredItems.Add("BlackMetal", 12); item19.RequiredItems.Add("YggdrasilWood", 18); item19.Configurable = Configurability.Recipe; DvergrBelt(item19.Prefab.GetComponent<ItemDrop>().m_itemData); Item item20 = new Item(_mithrilBundle, "BMM_EitrBelt"); item20.Crafting.Add(ItemManager.CraftingTable.ArtisanTable, 1); item20.RequiredItems.Add("Thunderstone", 6); item20.RequiredItems.Add("AmberPearl", 10); item20.RequiredItems.Add("BlackMetal", 12); item20.RequiredItems.Add("Eitr", 18); item20.Configurable = Configurability.Recipe; ItemData itemData5 = item20.Prefab.GetComponent<ItemDrop>().m_itemData; SE_AddEitr statEffect2 = ScriptableObject.CreateInstance<SE_AddEitr>(); ((Object)statEffect2).name = "bmm_eitrbelt_se"; ((StatusEffect)statEffect2).m_name = "Wizards Belt"; ((StatusEffect)statEffect2).m_icon = itemData5.GetIcon(); _eitrBeltEitrBonus.SettingChanged += delegate { statEffect2.SetEitr(_eitrBeltEitrBonus.Value); }; statEffect2.SetEitr(_eitrBeltEitrBonus.Value); itemData5.m_shared.m_equipStatusEffect = (StatusEffect)(object)statEffect2; Item item21 = new Item(_mithrilBundle, "BMM_ElementalistBelt"); item21.Crafting.Add(ItemManager.CraftingTable.ArtisanTable, 1); item21.RequiredItems.Add("Thunderstone", 6); item21.RequiredItems.Add("Ruby", 10); item21.RequiredItems.Add("BlackMetal", 12); item21.RequiredItems.Add("ElderBark", 18); item21.Configurable = Configurability.Recipe; ItemData itemData6 = item21.Prefab.GetComponent<ItemDrop>().m_itemData; SE_Stats val3 = ScriptableObject.CreateInstance<SE_Stats>(); ((Object)val3).name = "bmm_eitrbelt_se"; ((StatusEffect)val3).m_name = itemData6.m_shared.m_name; ((StatusEffect)val3).m_icon = itemData6.GetIcon(); val3.m_skillLevel = (SkillType)9; val3.m_skillLevelModifier = _elementalistBeltSkillBonus.Value; itemData6.m_shared.m_equipStatusEffect = (StatusEffect)(object)val3; Item item22 = new Item(_mithrilBundle, "BMM_HogwartsBelt"); item22.Crafting.Add(ItemManager.CraftingTable.ArtisanTable, 1); item22.RequiredItems.Add("Thunderstone", 6); item22.RequiredItems.Add("Ruby", 10); item22.RequiredItems.Add("BlackMetal", 12); item22.RequiredItems.Add("Eitr", 18); item22.Configurable = Configurability.Recipe; ItemData itemData7 = item22.Prefab.GetComponent<ItemDrop>().m_itemData; SE_Stats val4 = ScriptableObject.CreateInstance<SE_Stats>(); ((Object)val4).name = "bmm_hogwartsbelt_se"; ((StatusEffect)val4).m_name = itemData7.m_shared.m_name; ((StatusEffect)val4).m_icon = itemData7.GetIcon(); val4.m_modifyAttackSkill = (SkillType)9; val4.m_damageModifier = _hogwartsBeltDmgMultiplier.Value; val4.m_percentigeDamageModifiers = new DamageTypes { m_fire = _hogwartsBeltDmgMultiplier.Value / 10f, m_frost = _hogwartsBeltDmgMultiplier.Value / 10f, m_lightning = _hogwartsBeltDmgMultiplier.Value / 10f, m_poison = _hogwartsBeltDmgMultiplier.Value / 10f, m_spirit = _hogwartsBeltDmgMultiplier.Value / 10f }; itemData7.m_shared.m_equipStatusEffect = (StatusEffect)(object)val4; Item item23 = new Item(_mithrilBundle, "BMM_LightBelt"); item23.Crafting.Add(ItemManager.CraftingTable.Workbench, 1); item23.RequiredItems.Add("SurtlingCore", 4); item23.RequiredItems.Add("GreydwarfEye", 20); item23.RequiredItems.Add("Bronze", 22); item23.RequiredItems.Add("Resin", 28); item23.Configurable = Configurability.Recipe; Item item24 = new Item(_mithrilBundle, "BMM_NecromancerBelt"); item24.Crafting.Add(ItemManager.CraftingTable.ArtisanTable, 1); item24.RequiredItems.Add("YmirRemains", 6); item24.RequiredItems.Add("Eitr", 18); item24.RequiredItems.Add("BlackMetal", 12); item24.RequiredItems.Add("YggdrasilWood", 18); item24.Configurable = Configurability.Recipe; ItemData itemData8 = item24.Prefab.GetComponent<ItemDrop>().m_itemData; SE_Stats val5 = ScriptableObject.CreateInstance<SE_Stats>(); ((Object)val5).name = "bmm_necromancer_se"; ((StatusEffect)val5).m_name = itemData8.m_shared.m_name; ((StatusEffect)val5).m_icon = itemData8.GetIcon(); val5.m_skillLevel = (SkillType)10; val5.m_skillLevelModifier = _necromancerBeltSkillBonus.Value; itemData8.m_shared.m_equipStatusEffect = (StatusEffect)(object)val5; new Item(_mithrilBundle, "BMM_Meteorite").Configurable = Configurability.Disabled; Item item25 = new Item(_mithrilBundle, "BMM_MeteoriteCoins"); item25.Crafting.Add(ItemManager.CraftingTable.Forge, 1); item25.RequiredItems.Add("BMM_Meteorite", 1); item25.CraftAmount = 10; item25.Configurable = Configurability.Recipe; new Item(_mithrilBundle, "BMM_Warpstone").Configurable = Configurability.Disabled; Item item26 = new Item(_mithrilBundle, "BMM_WarpstoneCoins"); item26.Crafting.Add(ItemManager.CraftingTable.Forge, 1); item26.RequiredItems.Add("BMM_Warpstone", 1); item26.CraftAmount = 10; item26.Configurable = Configurability.Recipe; _mithrilDeposit = PrefabManager.RegisterPrefab(_mithrilBundle, "BMM_MineRock_Mithril"); _warpstoneDeposit = PrefabManager.RegisterPrefab(_mithrilBundle, "BMM_MineRock_Warpstone"); _meteoriteDeposit = PrefabManager.RegisterPrefab(_mithrilBundle, "BMM_MineRock_Meteorite"); GameObject gameObject = PrefabManager.RegisterPrefab(_mithrilBundle, "bmm_InteriorEnvironmentZoneForce"); ShaderReplacer.Replace(gameObject); PrefabManager.RegisterPrefab(_mithrilBundle, "_bmm_fx_block_camshake"); PrefabManager.RegisterPrefab(_mithrilBundle, "_bmm_fx_hit_camshake"); PrefabManager.RegisterPrefab(_mithrilBundle, "_bmm_fx_hit_camshake_knife"); PrefabManager.RegisterPrefab(_mithrilBundle, "_bmm_fx_swing_camshake"); PrefabManager.RegisterPrefab(_mithrilBundle, "_bmm_sfx_arrow_hit"); PrefabManager.RegisterPrefab(_mithrilBundle, "_bmm_sfx_axe_hit"); PrefabManager.RegisterPrefab(_mithrilBundle, "_bmm_sfx_axe_swing"); PrefabManager.RegisterPrefab(_mithrilBundle, "_bmm_sfx_build_cultivator"); PrefabManager.RegisterPrefab(_mithrilBundle, "_bmm_sfx_build_hammer_default"); PrefabManager.RegisterPrefab(_mithrilBundle, "_bmm_sfx_build_hammer_metal"); PrefabManager.RegisterPrefab(_mithrilBundle, "_bmm_sfx_build_hoe"); PrefabManager.RegisterPrefab(_mithrilBundle, "_bmm_sfx_knife_swing"); PrefabManager.RegisterPrefab(_mithrilBundle, "_bmm_sfx_kromsword_swing"); PrefabManager.RegisterPrefab(_mithrilBundle, "_bmm_sfx_metal_blocked"); PrefabManager.RegisterPrefab(_mithrilBundle, "_bmm_sfx_metalgate_close"); PrefabManager.RegisterPrefab(_mithrilBundle, "_bmm_sfx_metalgate_open"); PrefabManager.RegisterPrefab(_mithrilBundle, "_bmm_sfx_pickaxe_hit"); PrefabManager.RegisterPrefab(_mithrilBundle, "_bmm_sfx_pickaxe_swing"); PrefabManager.RegisterPrefab(_mithrilBundle, "_bmm_sfx_rock_destroyed"); PrefabManager.RegisterPrefab(_mithrilBundle, "_bmm_sfx_rock_hit"); PrefabManager.RegisterPrefab(_mithrilBundle, "_bmm_sfx_sword_hit"); PrefabManager.RegisterPrefab(_mithrilBundle, "_bmm_sfx_sword_swing"); PrefabManager.RegisterPrefab(_mithrilBundle, "_bmm_vfx_blocked"); PrefabManager.RegisterPrefab(_mithrilBundle, "_bmm_vfx_clubhit"); PrefabManager.RegisterPrefab(_mithrilBundle, "_bmm_vfx_HitSparks"); PrefabManager.RegisterPrefab(_mithrilBundle, "_bmm_vfx_Place_stone_floor"); PrefabManager.RegisterPrefab(_mithrilBundle, "_bmm_vfx_RockDestroyed"); PrefabManager.RegisterPrefab(_mithrilBundle, "_bmm_vfx_RockDestroyed_Obsidian"); PrefabManager.RegisterPrefab(_mithrilBundle, "_bmm_vfx_RockHit"); PrefabManager.RegisterPrefab(_mithrilBundle, "_bmm_vfx_RockHit_Obsidian"); GameObject gameObject2 = PrefabManager.RegisterPrefab(_mithrilBundle, "_bmm_vfx_WishbonePing"); ShaderReplacer.Replace(gameObject2); ((BaseUnityPlugin)this).Config.SaveOnConfigSet = true; ((BaseUnityPlugin)this).Config.Save(); Assembly executingAssembly = Assembly.GetExecutingAssembly(); _harmony.PatchAll(executingAssembly); } private void OnDestroy() { ((BaseUnityPlugin)this).Config.Save(); } private static void InitMine(ZNetScene zNetScene) { MineRock[] componentsInChildren = _mithrilMine01.GetComponentsInChildren<MineRock>(true); MineRock[] componentsInChildren2 = _mithrilMine02.GetComponentsInChildren<MineRock>(true); int mineDropMin; _mithrilMineDropMin.SettingChanged += delegate { mineDropMin = _mithrilMineDropMin.Value; }; mineDropMin = _mithrilMineDropMin.Value; int mineDropMax; _mithrilMineDropMax.SettingChanged += delegate { mineDropMax = _mithrilMineDropMax.Value; }; mineDropMax = _mithrilMineDropMax.Value; LinkDrop(zNetScene, componentsInChildren, mineDropMin, mineDropMax); LinkDrop(zNetScene, componentsInChildren2, mineDropMin, mineDropMax); } private static void LinkDrop(ZNetScene zNetScene, MineRock[] mineRock, int dropMin, int dropMax) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) if (mineRock != null) { foreach (MineRock val in mineRock) { val.m_dropItems.m_drops = new List<DropData>(2) { new DropData { m_item = zNetScene.GetPrefab("BMM_MithrilOre"), m_stackMin = 1, m_stackMax = 1, m_weight = 0.85f }, new DropData { m_item = zNetScene.GetPrefab("Stone"), m_stackMin = 1, m_stackMax = 1, m_weight = 1f } }; val.m_dropItems.m_dropMin = dropMin; val.m_dropItems.m_dropMax = dropMax; } } } private static void DvergrBelt(ItemData item) { _dvergrBeltEitrRegen.SettingChanged += delegate { item.m_shared.m_eitrRegenModifier = _dvergrBeltEitrRegen.Value; }; item.m_shared.m_eitrRegenModifier = _dvergrBeltEitrRegen.Value; } private static void SetEitr(Player player, string statEffect, float amount, ref float eitr) { if (((Character)player).GetSEMan().HaveStatusEffect(StringExtensionMethods.GetStableHashCode(statEffect))) { eitr += amount; } } } } namespace MithrilMine.Functions { public class SE_AddEitr : StatusEffect { public float m_eitr; public void Awake() { base.m_tooltip = $"Boost wearer's <color=orange>Eitr</color> by <color=orange>+{m_eitr}</color>."; } public void SetEitr(float eitr) { m_eitr = eitr; base.m_tooltip = $"Boost wearer's <color=orange>Eitr</color> by <color=orange>+{m_eitr}</color>."; } } public class SE_MithrilFinder : StatusEffect { public EffectList m_pingEffectNear = new EffectList(); public EffectList m_pingEffectMed = new EffectList(); public EffectList m_pingEffectFar = new EffectList(); public float m_closeTriggerDistance = 2f; public float m_furtherTriggerDistance = 4f; public float m_closeFrequency = 0.5f; public float m_distantFrequency = 5f; public float m_updateBeaconTimer; public float m_pingTimer; public MBeacon m_beacon; public float m_lastDistance; public void Awake() { ((Object)this).name = "SE_MithrilFinder"; base.m_name = "$bmm_mithrilfinder"; base.m_tooltip = "$bmm_mithrilfinder_tooltip"; } public override void Setup(Character character) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Expected O, but got Unknown //IL_0075: 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_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Expected O, but got Unknown //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Expected O, but got Unknown //IL_00dc: 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_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Expected O, but got Unknown //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Expected O, but got Unknown m_pingEffectNear.m_effectPrefabs = (EffectData[])(object)new EffectData[2] { new EffectData { m_prefab = ZNetScene.instance.GetPrefab("_bmm_vfx_WishbonePing"), m_enabled = true, m_variant = -1 }, new EffectData { m_prefab = ZNetScene.instance.GetPrefab("sfx_WishbonePing_near"), m_enabled = true, m_variant = -1 } }; m_pingEffectMed.m_effectPrefabs = (EffectData[])(object)new EffectData[2] { new EffectData { m_prefab = ZNetScene.instance.GetPrefab("_bmm_vfx_WishbonePing"), m_enabled = true, m_variant = -1 }, new EffectData { m_prefab = ZNetScene.instance.GetPrefab("sfx_WishbonePing_med"), m_enabled = true, m_variant = -1 } }; m_pingEffectFar.m_effectPrefabs = (EffectData[])(object)new EffectData[2] { new EffectData { m_prefab = ZNetScene.instance.GetPrefab("_bmm_vfx_WishbonePing"), m_enabled = true, m_variant = -1 }, new EffectData { m_prefab = ZNetScene.instance.GetPrefab("sfx_WishbonePing_far"), m_enabled = true, m_variant = -1 } }; ((StatusEffect)this).Setup(character); } public override void UpdateStatusEffect(float dt) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) m_updateBeaconTimer += dt; if (m_updateBeaconTimer > 1f) { m_updateBeaconTimer = 0f; MBeacon mBeacon = MBeacon.FindClosestBeaconInRange(((Component)base.m_character).transform.position); if ((Object)(object)mBeacon != (Object)(object)m_beacon) { m_beacon = mBeacon; if (Object.op_Implicit((Object)(object)m_beacon)) { m_lastDistance = Utils.DistanceXZ(((Component)base.m_character).transform.position, ((Component)mBeacon).transform.position); m_pingTimer = 0f; } } } if (!((Object)(object)m_beacon != (Object)null)) { return; } float num = Utils.DistanceXZ(((Component)base.m_character).transform.position, ((Component)m_beacon).transform.position); float num2 = Mathf.Clamp01(num / m_beacon.m_range); float num3 = Mathf.Lerp(m_closeFrequency, m_distantFrequency, num2); m_pingTimer += dt; if (!(m_pingTimer > num3)) { return; } m_pingTimer = 0f; if (!(num2 < 0.2f)) { if (num2 < 0.6f) { m_pingEffectMed.Create(((Component)base.m_character).transform.position, ((Component)base.m_character).transform.rotation, ((Component)base.m_character).transform, 1f, -1); } else { m_pingEffectNear.Create(((Component)base.m_character).transform.position, ((Component)base.m_character).transform.rotation, ((Component)base.m_character).transform, 1f, -1); } } else { m_pingEffectNear.Create(((Component)base.m_character).transform.position, ((Component)base.m_character).transform.rotation, ((Component)base.m_character).transform, 1f, -1); } } } public static class ShaderReplacer { private static readonly List<GameObject> GOToSwap; static ShaderReplacer() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Expected O, but got Unknown //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Expected O, but got Unknown GOToSwap = new List<GameObject>(); Harmony val = new Harmony("blacks7ar.utilities.ShaderReplacer"); val.Patch((MethodBase)AccessTools.DeclaredMethod(typeof(FejdStartup), "Awake", (Type[])null, (Type[])null), (HarmonyMethod)null, new HarmonyMethod(AccessTools.DeclaredMethod(typeof(ShaderReplacer), "ReplaceShaderPatch", (Type[])null, (Type[])null)), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } public static void Replace(GameObject gameObject) { GOToSwap.Add(gameObject); } [HarmonyPriority(700)] private static void ReplaceShaderPatch() { foreach (Material item in from gameObject in GOToSwap select gameObject.GetComponentsInChildren<Renderer>(true) into renderers from renderer in renderers where (Object)(object)renderer != (Object)null from material in renderer.sharedMaterials where (Object)(object)material != (Object)null select material) { Shader[] array = Resources.FindObjectsOfTypeAll<Shader>(); Shader[] array2 = array; foreach (Shader val in array2) { if (((Object)item.shader).name == ((Object)val).name) { item.shader = val; } } } } } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } } namespace ItemManager { [PublicAPI] internal enum CraftingTable { Disabled, Inventory, [InternalName("piece_workbench")] Workbench, [InternalName("piece_cauldron")] Cauldron, [InternalName("forge")] Forge, [InternalName("piece_artisanstation")] ArtisanTable, [InternalName("piece_stonecutter")] StoneCutter, [InternalName("piece_magetable")] MageTable, [InternalName("blackforge")] BlackForge, [InternalName("piece_preptable")] FoodPreparationTable, [InternalName("piece_MeadCauldron")] MeadKetill, Custom } [PublicAPI] internal enum ConversionPiece { Disabled, [InternalName("smelter")] Smelter, [InternalName("charcoal_kiln")] CharcoalKiln, [InternalName("blastfurnace")] BlastFurnace, [InternalName("windmill")] Windmill, [InternalName("piece_spinningwheel")] SpinningWheel, [InternalName("eitrrefinery")] EitrRefinery, Custom } internal class InternalName : Attribute { public readonly string internalName; public InternalName(string internalName) { this.internalName = internalName; } } [PublicAPI] internal class RequiredResourceList { public readonly List<Requirement> Requirements = new List<Requirement>(); public bool Free; public void Add(string itemName, int amount, int quality = 0) { Requirements.Add(new Requirement { itemName = itemName, amount = amount, quality = quality }); } public void Add(string itemName, ConfigEntry<int> amountConfig, int quality = 0) { Requirements.Add(new Requirement { itemName = itemName, amountConfig = amountConfig, quality = quality }); } } [PublicAPI] internal class CraftingStationList { public readonly List<CraftingStationConfig> Stations = new List<CraftingStationConfig>(); public void Add(CraftingTable table, int level) { Stations.Add(new CraftingStationConfig { Table = table, level = level }); } public void Add(string customTable, int level) { Stations.Add(new CraftingStationConfig { Table = CraftingTable.Custom, level = level, custom = customTable }); } } [PublicAPI] internal class ItemRecipe { public readonly RequiredResourceList RequiredItems = new RequiredResourceList(); public readonly RequiredResourceList RequiredUpgradeItems = new RequiredResourceList(); public readonly CraftingStationList Crafting = new CraftingStationList(); public int CraftAmount = 1; public bool RequireOnlyOneIngredient; public float QualityResultAmountMultiplier = 1f; public ConfigEntryBase? RecipeIsActive; } [PublicAPI] internal class Trade { public Trader Trader; public uint Price; public uint Stack = 1u; public string? RequiredGlobalKey; } [PublicAPI] [Flags] internal enum Trader { None = 0, Haldor = 1, Hildir = 2 } internal struct Requirement { public string itemName; public int amount; public ConfigEntry<int>? amountConfig; [Description("Set to a non-zero value to apply the requirement only for a specific quality")] public int quality; } internal struct CraftingStationConfig { public CraftingTable Table; public int level; public string? custom; } [Flags] internal enum Configurability { Disabled = 0, Recipe = 1, Stats = 2, Drop = 4, Trader = 8, Full = 0xF } [PublicAPI] internal class DropTargets { public readonly List<DropTarget> Drops = new List<DropTarget>(); public void Add(string creatureName, float chance, int min = 1, int? max = null, bool levelMultiplier = true) { Drops.Add(new DropTarget { creature = creatureName, chance = chance, min = min, max = max.GetValueOrDefault(min), levelMultiplier = levelMultiplier }); } } internal struct DropTarget { public string creature; public int min; public int max; public float chance; public bool levelMultiplier; } internal enum Toggle { On = 1, Off = 0 } [PublicAPI] internal class Item { private class ItemConfig { public ConfigEntry<string>? craft; public ConfigEntry<string>? upgrade; public ConfigEntry<CraftingTable> table; public ConfigEntry<int> tableLevel; public ConfigEntry<string> customTable; public ConfigEntry<int>? maximumTableLevel; public ConfigEntry<Toggle> requireOneIngredient; public ConfigEntry<float> qualityResultAmountMultiplier; } private class TraderConfig { public ConfigEntry<Trader> trader; public ConfigEntry<uint> price; public ConfigEntry<uint> stack; public ConfigEntry<string> requiredGlobalKey; } private class RequirementQuality { public int quality; } private class ConfigurationManagerAttributes { [UsedImplicitly] public int? Order; [UsedImplicitly] public bool? Browsable; [UsedImplicitly] public string? Category; [UsedImplicitly] public Action<ConfigEntryBase>? CustomDrawer; public Func<bool>? browsability; } [PublicAPI] public enum DamageModifier { Normal, Resistant, Weak, Immune, Ignore, VeryResistant, VeryWeak, None } private delegate void setDmgFunc(ref DamageTypes dmg, float value); private class SerializedRequirements { public readonly List<Requirement> Reqs; public SerializedRequirements(List<Requirement> reqs) { Reqs = reqs; } public SerializedRequirements(string reqs) : this(reqs.Split(new char[1] { ',' }).Select(delegate(string r) { string[] array = r.Split(new char[1] { ':' }); Requirement result = default(Requirement); result.itemName = array[0]; result.amount = ((array.Length <= 1 || !int.TryParse(array[1], out var result2)) ? 1 : result2); result.quality = ((array.Length > 2 && int.TryParse(array[2], out var result3)) ? result3 : 0); return result; }).ToList()) { } public override string ToString() { return string.Join(",", Reqs.Select((Requirement r) => $"{r.itemName}:{r.amount}" + ((r.quality > 0) ? $":{r.quality}" : ""))); } public static ItemDrop? fetchByName(ObjectDB objectDB, string name) { GameObject itemPrefab = objectDB.GetItemPrefab(name); ItemDrop obj = ((itemPrefab != null) ? itemPrefab.GetComponent<ItemDrop>() : null); if ((Object)(object)obj == (Object)null) { Debug.LogWarning((object)("The required item '" + name + "' does not exist.")); } return obj; } public static Requirement[] toPieceReqs(ObjectDB objectDB, SerializedRequirements craft, SerializedRequirements upgrade) { //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Expected O, but got Unknown //IL_0194: Expected O, but got Unknown //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Expected O, but got Unknown ObjectDB objectDB2 = objectDB; Dictionary<string, Requirement> dictionary = craft.Reqs.Where((Requirement r) => r.itemName != "").ToDictionary((Func<Requirement, string>)((Requirement r) => r.itemName), (Func<Requirement, Requirement>)delegate(Requirement r) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Expected O, but got Unknown ItemDrop val6 = ResItem(r); return (val6 != null) ? new Requirement { m_amount = (r.amountConfig?.Value ?? r.amount), m_resItem = val6, m_amountPerLevel = 0 } : ((Requirement)null); }); List<Requirement> list = dictionary.Values.Where((Requirement v) => v != null).ToList(); foreach (Requirement item in upgrade.Reqs.Where((Requirement r) => r.itemName != "")) { if (item.quality > 0) { ItemDrop val = ResItem(item); if (val != null) { Requirement val2 = new Requirement { m_resItem = val, m_amountPerLevel = (item.amountConfig?.Value ?? item.amount), m_amount = 0 }; list.Add(val2); requirementQuality.Add(val2, new RequirementQuality { quality = item.quality }); } continue; } if (!dictionary.TryGetValue(item.itemName, out var value) || value == null) { ItemDrop val3 = ResItem(item); if (val3 != null) { string itemName = item.itemName; Requirement val4 = new Requirement { m_resItem = val3, m_amount = 0 }; Requirement val5 = val4; dictionary[itemName] = val4; value = val5; list.Add(value); } } if (value != null) { value.m_amountPerLevel = item.amountConfig?.Value ?? item.amount; } } return list.ToArray(); ItemDrop? ResItem(Requirement r) { return fetchByName(objectDB2, r.itemName); } } } private class SerializedDrop { public readonly List<DropTarget> Drops; public SerializedDrop(List<DropTarget> drops) { Drops = drops; } public SerializedDrop(string drops) { Drops = ((drops == "") ? ((IEnumerable<string>)Array.Empty<string>()) : ((IEnumerable<string>)drops.Split(new char[1] { ',' }))).Select(delegate(string r) { string[] array = r.Split(new char[1] { ':' }); if (array.Length <= 2 || !int.TryParse(array[2], out var result)) { result = 1; } if (array.Length <= 3 || !int.TryParse(array[3], out var result2)) { result2 = result; } bool levelMultiplier = array.Length <= 4 || array[4] != "0"; DropTarget result3 = default(DropTarget); result3.creature = array[0]; result3.chance = ((array.Length > 1 && float.TryParse(array[1], out var result4)) ? result4 : 1f); result3.min = result; result3.max = result2; result3.levelMultiplier = levelMultiplier; return result3; }).ToList(); } public override string ToString() { return string.Join(",", Drops.Select((DropTarget r) => $"{r.creature}:{r.chance.ToString(CultureInfo.InvariantCulture)}:{r.min}:" + ((r.min == r.max) ? "" : $"{r.max}") + (r.levelMultiplier ? "" : ":0"))); } private static Character? fetchByName(ZNetScene netScene, string name) { GameObject prefab = netScene.GetPrefab(name); Character obj = ((prefab != null) ? prefab.GetComponent<Character>() : null); if ((Object)(object)obj == (Object)null) { Debug.LogWarning((object)("The drop target character '" + name + "' does not exist.")); } return obj; } public Dictionary<Character, Drop> toCharacterDrops(ZNetScene netScene, GameObject item) { //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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Expected O, but got Unknown Dictionary<Character, Drop> dictionary = new Dictionary<Character, Drop>(); foreach (DropTarget drop in Drops) { Character val = fetchByName(netScene, drop.creature); if (val != null) { dictionary[val] = new Drop { m_prefab = item, m_amountMin = drop.min, m_amountMax = drop.max, m_chance = drop.chance, m_levelMultiplier = drop.levelMultiplier }; } } return dictionary; } } private static readonly List<Item> registeredItems = new List<Item>(); private static readonly Dictionary<ItemDrop, Item> itemDropMap = new Dictionary<ItemDrop, Item>(); private static Dictionary<Item, Dictionary<string, List<Recipe>>> activeRecipes = new Dictionary<Item, Dictionary<string, List<Recipe>>>(); private static Dictionary<Recipe, ConfigEntryBase?> hiddenCraftRecipes = new Dictionary<Recipe, ConfigEntryBase>(); private static Dictionary<Recipe, ConfigEntryBase?> hiddenUpgradeRecipes = new Dictionary<Recipe, ConfigEntryBase>(); private static Dictionary<Item, Dictionary<string, ItemConfig>> itemCraftConfigs = new Dictionary<Item, Dictionary<string, ItemConfig>>(); private static Dictionary<Item, ConfigEntry<string>> itemDropConfigs = new Dictionary<Item, ConfigEntry<string>>(); private Dictionary<CharacterDrop, Drop> characterDrops = new Dictionary<CharacterDrop, Drop>(); private readonly Dictionary<ConfigEntryBase, Action> statsConfigs = new Dictionary<ConfigEntryBase, Action>(); private static readonly ConditionalWeakTable<Requirement, RequirementQuality> requirementQuality = new ConditionalWeakTable<Requirement, RequirementQuality>(); public static Configurability DefaultConfigurability = Configurability.Full; public Configurability? Configurable; private Configurability configurationVisible = Configurability.Full; private TraderConfig? traderConfig; public readonly GameObject Prefab; [Description("Specifies the maximum required crafting station level to upgrade and repair the item.\nDefault is calculated from crafting station level and maximum quality.")] public int MaximumRequiredStationLevel = int.MaxValue; [Description("Assigns the item as a drop item to a creature.\nUses a creature name, a drop chance and a minimum and maximum amount.")] public readonly DropTargets DropsFrom = new DropTargets(); [Description("Configures whether the item can be bought at the trader.\nDon't forget to set cost to something above 0 or the item will be sold for free.")] public readonly Trade Trade = new Trade(); internal List<Conversion> Conversions = new List<Conversion>(); internal List<ItemConversion> conversions = new List<ItemConversion>(); public Dictionary<string, ItemRecipe> Recipes = new Dictionary<string, ItemRecipe>(); private static object? configManager; private static Localization? _english; private static BaseUnityPlugin? _plugin; private static bool hasConfigSync = true; private static object? _configSync; private Configurability configurability => Configurable ?? DefaultConfigurability; [Description("Specifies the resources needed to craft the item.\nUse .Add to add resources with their internal ID and an amount.\nUse one .Add for each resource type the item should need.")] public RequiredResourceList RequiredItems => this[""].RequiredItems; [Description("Specifies the resources needed to upgrade the item.\nUse .Add to add resources with their internal ID and an amount. This amount will be multipled by the item quality level.\nUse one .Add for each resource type the upgrade should need.")] public RequiredResourceList RequiredUpgradeItems => this[""].RequiredUpgradeItems; [Description("Specifies the crafting station needed to craft the item.\nUse .Add to add a crafting station, using the CraftingTable enum and a minimum level for the crafting station.\nUse one .Add for each crafting station.")] public CraftingStationList Crafting => this[""].Crafting; [Description("Specifies a config entry which toggles whether a recipe is active.")] public ConfigEntryBase? RecipeIsActive { get { return this[""].RecipeIsActive; } set { this[""].RecipeIsActive = value; } } [Description("Specifies the number of items that should be given to the player with a single craft of the item.\nDefaults to 1.")] public int CraftAmount { get { return this[""].CraftAmount; } set { this[""].CraftAmount = value; } } public bool RequireOnlyOneIngredient { get { return this[""].RequireOnlyOneIngredient; } set { this[""].RequireOnlyOneIngredient = value; } } public float QualityResultAmountMultiplier { get { return this[""].QualityResultAmountMultiplier; } set { this[""].QualityResultAmountMultiplier = value; } } public ItemRecipe this[string name] { get { if (Recipes.TryGetValue(name, out ItemRecipe value)) { return value; } return Recipes[name] = new ItemRecipe(); } } private static Localization english => _english ?? (_english = LocalizationCache.ForLanguage("English")); private static BaseUnityPlugin plugin { get { //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Expected O, but got Unknown if (_plugin == null) { IEnumerable<TypeInfo> source; try { source = Assembly.GetExecutingAssembly().DefinedTypes.ToList(); } catch (ReflectionTypeLoadException ex) { source = from t in ex.Types where t != null select t.GetTypeInfo(); } _plugin = (BaseUnityPlugin)Chainloader.ManagerObject.GetComponent((Type)source.First((TypeInfo t) => t.IsClass && typeof(BaseUnityPlugin).IsAssignableFrom(t))); } return _plugin; } } private static object? configSync { get { if (_configSync == null && hasConfigSync) { Type type = Assembly.GetExecutingAssembly().GetType("ServerSync.ConfigSync"); if ((object)type != null) { _configSync = Activator.CreateInstance(type, plugin.Info.Metadata.GUID + " ItemManager"); type.GetField("CurrentVersion").SetValue(_configSync, plugin.Info.Metadata.Version.ToString()); type.GetProperty("IsLocked").SetValue(_configSync, true); } else { hasConfigSync = false; } } return _configSync; } } public Item(string assetBundleFileName, string prefabName, string folderName = "assets") : this(PrefabManager.RegisterAssetBundle(assetBundleFileName, folde