Decompiled source of OreMines v1.1.3
OreMines.dll
Decompiled 2 months 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 OreMines.Functions; using ServerSync; using SoftReferenceableAssets; using TMPro; using UnityEngine; 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("OreMines")] [assembly: AssemblyDescription("https://thunderstore.io/c/valheim/p/blacks7ar/OreMines/")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("blacks7ar")] [assembly: AssemblyProduct("OreMines")] [assembly: AssemblyCopyright("Copyright © 2024")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("41E3DA5A-E3B3-4DB1-910A-BFA3A359B1CA")] [assembly: AssemblyFileVersion("1.1.3")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.1.3.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.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; } } [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; } } } namespace OreMines { [BepInPlugin("blacks7ar.OreMines", "OreMines", "1.1.3")] public class Plugin : BaseUnityPlugin { public enum Toggle { On = 1, Off = 0 } private const string modGUID = "blacks7ar.OreMines"; public const string modName = "OreMines"; public const string modAuthor = "blacks7ar"; public const string modVersion = "1.1.3"; public const string modLink = "https://thunderstore.io/c/valheim/p/blacks7ar/OreMines/"; private static readonly Harmony _harmony = new Harmony("blacks7ar.OreMines"); private static readonly ConfigSync _configSync = new ConfigSync("blacks7ar.OreMines") { DisplayName = "OreMines", CurrentVersion = "1.1.3", MinimumRequiredVersion = "1.1.3", ModRequired = true }; private static ConfigEntry<Toggle> _serverConfigLocked; public static ConfigEntry<int> _resetDay; public static ConfigEntry<Toggle> _enableReset; public static ConfigEntry<float> _oreSpawnChance; public static ConfigEntry<Toggle> _consumableKeys; public static ConfigEntry<Toggle> _stackableKeys; public static ConfigEntry<int> _coalMineDropMin; public static ConfigEntry<int> _coalMineDropMax; public static ConfigEntry<int> _copperMineDropMin; public static ConfigEntry<int> _copperMineDropMax; public static ConfigEntry<int> _flintMineDropMin; public static ConfigEntry<int> _flintMineDropMax; public static ConfigEntry<int> _ironMineDropMin; public static ConfigEntry<int> _ironMineDropMax; public static ConfigEntry<int> _silverMineDropMin; public static ConfigEntry<int> _silverMineDropMax; public static ConfigEntry<int> _tinMineDropMin; public static ConfigEntry<int> _tinMineDropMax; public static ConfigEntry<int> _blackMetalMineDropMin; public static ConfigEntry<int> _blackMetalMineDropMax; public static ConfigEntry<int> _flametalMineDropMin; public static ConfigEntry<int> _flametalMineDropMax; 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); _configSync.AddConfigEntry<T>(val2).SynchronizedConfig = synchronizedConfig; return val2; } public void Awake() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Expected O, but got Unknown //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Expected O, but got Unknown //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Expected O, but got Unknown //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Expected O, but got Unknown //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Expected O, but got Unknown //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Expected O, but got Unknown //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Expected O, but got Unknown //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Expected O, but got Unknown //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Expected O, but got Unknown //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Expected O, but got Unknown //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_0265: Expected O, but got Unknown //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_0293: Expected O, but got Unknown //IL_02b6: Unknown result type (might be due to invalid IL or missing references) //IL_02c1: Expected O, but got Unknown //IL_02e4: Unknown result type (might be due to invalid IL or missing references) //IL_02ef: Expected O, but got Unknown //IL_0312: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Expected O, but got Unknown //IL_0340: Unknown result type (might be due to invalid IL or missing references) //IL_034b: Expected O, but got Unknown //IL_036e: Unknown result type (might be due to invalid IL or missing references) //IL_0379: Expected O, but got Unknown //IL_039c: Unknown result type (might be due to invalid IL or missing references) //IL_03a7: Expected O, but got Unknown //IL_03ca: Unknown result type (might be due to invalid IL or missing references) //IL_03d5: Expected O, but got Unknown //IL_03f8: Unknown result type (might be due to invalid IL or missing references) //IL_0403: Expected O, but got Unknown 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>())); _consumableKeys = config("2- General", "Consumable Keys", Toggle.Off, new ConfigDescription("If On, keys are consumed when you open a mine.", (AcceptableValueBase)null, Array.Empty<object>())); _stackableKeys = config("2- General", "Stackable Keys", Toggle.Off, new ConfigDescription("If On, keys are stackable upto 10. (Requires a Logout)", (AcceptableValueBase)null, Array.Empty<object>())); _coalMineDropMin = 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>())); _coalMineDropMax = 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>())); _copperMineDropMin = config("3- OreDeposits Drop Settings", "CopperMine DropMin", 4, new ConfigDescription("Minimum drops from copper ore deposits.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 10), Array.Empty<object>())); _copperMineDropMax = config("3- OreDeposits Drop Settings", "CopperMine DropMax", 6, new ConfigDescription("Maximum drops from copper ore deposits.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 15), Array.Empty<object>())); _flintMineDropMin = config("3- OreDeposits Drop Settings", "FlintMine DropMin", 6, new ConfigDescription("Minimum drops from flint deposits.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 10), Array.Empty<object>())); _flintMineDropMax = config("3- OreDeposits Drop Settings", "FlintMine DropMax", 8, new ConfigDescription("Maximum drops from flint deposits.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 15), Array.Empty<object>())); _ironMineDropMin = config("3- OreDeposits Drop Settings", "IronMine DropMin", 4, new ConfigDescription("Minimum drops from iron ore deposits.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 15), Array.Empty<object>())); _ironMineDropMax = config("3- OreDeposits Drop Settings", "IronMine DropMax", 6, new ConfigDescription("Maximum drops from iron ore deposits.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 15), Array.Empty<object>())); _silverMineDropMin = config("3- OreDeposits Drop Settings", "SilverMine DropMin", 4, new ConfigDescription("Minimum drops from silver ore deposits.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 10), Array.Empty<object>())); _silverMineDropMax = config("3- OreDeposits Drop Settings", "SilverMine DropMax", 6, new ConfigDescription("Maximum drops from silver ore deposits.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 15), Array.Empty<object>())); _tinMineDropMin = config("3- OreDeposits Drop Settings", "TinMine DropMin", 6, new ConfigDescription("Minimum drops from tin ore deposits.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 10), Array.Empty<object>())); _tinMineDropMax = config("3- OreDeposits Drop Settings", "TinMine DropMax", 8, new ConfigDescription("Maximum drops from tin deposits.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 15), Array.Empty<object>())); _blackMetalMineDropMin = config("3- OreDeposits Drop Settings", "BlackMetalMine DropMin", 4, new ConfigDescription("Minimum drops from blackmetal scrap deposits.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 10), Array.Empty<object>())); _blackMetalMineDropMax = config("3- OreDeposits Drop Settings", "BlackMetalMine DropMax", 6, new ConfigDescription("Maximum drops from blackmetal scrap deposits.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 15), Array.Empty<object>())); _flametalMineDropMin = config("3- OreDeposits Drop Settings", "FlametalMine DropMin", 4, new ConfigDescription("Minimum drops from flametal ore deposits.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 10), Array.Empty<object>())); _flametalMineDropMax = config("3- OreDeposits Drop Settings", "FlametalMine DropMax", 6, new ConfigDescription("Maximum drops from flametal ore deposits.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 15), Array.Empty<object>())); MineSetup.Init(); ((BaseUnityPlugin)this).Config.SaveOnConfigSet = true; ((BaseUnityPlugin)this).Config.Save(); Assembly executingAssembly = Assembly.GetExecutingAssembly(); _harmony.PatchAll(executingAssembly); } private void OnDestroy() { ((BaseUnityPlugin)this).Config.Save(); } } } namespace OreMines.Functions { public static class MineSetup { private static AssetBundle _mineBundle; private static GameObject _flintMine01; private static GameObject _flintMine02; private static GameObject _copperMine01; private static GameObject _copperMine02; private static GameObject _tinMine01; private static GameObject _tinMine02; private static GameObject _coalMine01; private static GameObject _coalMine02; private static GameObject _ironMine01; private static GameObject _ironMine02; private static GameObject _silverMine01; private static GameObject _silverMine02; private static GameObject _blackMetalMine01; private static GameObject _blackMetalMine02; private static GameObject _flametalMine01; private static GameObject _flametalMine02; public static void Init() { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_040c: Unknown result type (might be due to invalid IL or missing references) //IL_0413: Unknown result type (might be due to invalid IL or missing references) //IL_0696: Unknown result type (might be due to invalid IL or missing references) //IL_069d: Unknown result type (might be due to invalid IL or missing references) //IL_08f6: Unknown result type (might be due to invalid IL or missing references) //IL_08fd: Unknown result type (might be due to invalid IL or missing references) //IL_0baa: Unknown result type (might be due to invalid IL or missing references) //IL_0bb1: Unknown result type (might be due to invalid IL or missing references) //IL_0e34: Unknown result type (might be due to invalid IL or missing references) //IL_0e3b: Unknown result type (might be due to invalid IL or missing references) //IL_1094: Unknown result type (might be due to invalid IL or missing references) //IL_109b: Unknown result type (might be due to invalid IL or missing references) //IL_139d: Unknown result type (might be due to invalid IL or missing references) //IL_13a4: Unknown result type (might be due to invalid IL or missing references) //IL_1652: Unknown result type (might be due to invalid IL or missing references) //IL_1659: Unknown result type (might be due to invalid IL or missing references) //IL_195a: Unknown result type (might be due to invalid IL or missing references) //IL_1961: Unknown result type (might be due to invalid IL or missing references) //IL_1c0e: Unknown result type (might be due to invalid IL or missing references) //IL_1c15: Unknown result type (might be due to invalid IL or missing references) //IL_1e72: Unknown result type (might be due to invalid IL or missing references) //IL_1e79: Unknown result type (might be due to invalid IL or missing references) //IL_2100: Unknown result type (might be due to invalid IL or missing references) //IL_2107: Unknown result type (might be due to invalid IL or missing references) //IL_2361: Unknown result type (might be due to invalid IL or missing references) //IL_2368: Unknown result type (might be due to invalid IL or missing references) //IL_2616: Unknown result type (might be due to invalid IL or missing references) //IL_261d: Unknown result type (might be due to invalid IL or missing references) _mineBundle = Location.PrefabManager.RegisterAssetBundle("minebundle"); Location.ConfigurationEnabled = false; _flintMine01 = _mineBundle.LoadAsset<GameObject>("BOM_FlintMine01"); Location obj = new Location(_flintMine01) { CanSpawn = true, ClearArea = true, Biome = (Biome)1, SpawnArea = (BiomeArea)2, Count = 70, GroupName = "OreMines", MinimumDistanceFromGroup = 400f, 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(400f, 10000f) }; ShaderReplacer.Replace(_flintMine01); obj.CreatureSpawner.Add("Spawner_Neck", "Neck"); obj.CreatureSpawner.Add("Spawner_Neck2", "Neck"); obj.CreatureSpawner.Add("Spawner_Neck3", "Neck"); obj.CreatureSpawner.Add("Spawner_Neck4", "Neck"); obj.CreatureSpawner.Add("Spawner_Neck5", "Neck"); obj.CreatureSpawner.Add("Spawner_Neck6", "Neck"); obj.CreatureSpawner.Add("Spawner_Neck7", "Neck"); obj.CreatureSpawner.Add("Spawner_Neck8", "Neck"); obj.CreatureSpawner.Add("Spawner_Neck9", "Neck"); obj.CreatureSpawner.Add("Spawner_Neck10", "Neck"); obj.CreatureSpawner.Add("ExteriorSpawner_Neck", "Neck"); obj.CreatureSpawner.Add("ExteriorSpawner_Neck (1)", "Neck"); obj.CreatureSpawner.Add("ExteriorSpawner_Neck (2)", "Neck"); obj.CreatureSpawner.Add("ExteriorSpawner_Neck (3)", "Neck"); _flintMine02 = _mineBundle.LoadAsset<GameObject>("BOM_FlintMine02"); Location obj2 = new Location(_flintMine02) { CanSpawn = true, ClearArea = true, Biome = (Biome)1, SpawnArea = (BiomeArea)1, Count = 70, GroupName = "OreMines", MinimumDistanceFromGroup = 400f, 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(400f, 10000f) }; ShaderReplacer.Replace(_flintMine02); obj2.CreatureSpawner.Add("Spawner_Neck", "Neck"); obj2.CreatureSpawner.Add("Spawner_Neck2", "Neck"); obj2.CreatureSpawner.Add("Spawner_Neck3", "Neck"); obj2.CreatureSpawner.Add("Spawner_Neck4", "Neck"); obj2.CreatureSpawner.Add("Spawner_Neck5", "Neck"); obj2.CreatureSpawner.Add("Spawner_Neck6", "Neck"); obj2.CreatureSpawner.Add("Spawner_Neck7", "Neck"); obj2.CreatureSpawner.Add("Spawner_Neck8", "Neck"); obj2.CreatureSpawner.Add("Spawner_Neck9", "Neck"); obj2.CreatureSpawner.Add("Spawner_Neck10", "Neck"); obj2.CreatureSpawner.Add("ExteriorSpawner_Boar", "Boar"); obj2.CreatureSpawner.Add("ExteriorSpawner_Boar (1)", "Boar"); obj2.CreatureSpawner.Add("ExteriorSpawner_Boar (2)", "Boar"); obj2.CreatureSpawner.Add("ExteriorSpawner_Boar (3)", "Boar"); _copperMine01 = _mineBundle.LoadAsset<GameObject>("BOM_CopperMine01"); Location obj3 = new Location(_copperMine01) { CanSpawn = true, ClearArea = true, Biome = (Biome)8, SpawnArea = (BiomeArea)2, Count = 70, GroupName = "OreMines", MinimumDistanceFromGroup = 400f, Rotation = Rotation.Slope, HeightDelta = new LocationManager.Range(0f, 40f), ForestThreshold = new LocationManager.Range(0f, 3f), SpawnAltitude = new LocationManager.Range(0.5f, 150f), SpawnDistance = new LocationManager.Range(400f, 10000f) }; ShaderReplacer.Replace(_copperMine01); obj3.CreatureSpawner.Add("Spawner_Skeleton", "Skeleton"); obj3.CreatureSpawner.Add("Spawner_Skeleton2", "Skeleton"); obj3.CreatureSpawner.Add("Spawner_Skeleton3", "Skeleton"); obj3.CreatureSpawner.Add("Spawner_Skeleton4", "Skeleton"); obj3.CreatureSpawner.Add("Spawner_Skeleton5", "Skeleton"); obj3.CreatureSpawner.Add("Spawner_Skeleton6", "Skeleton"); obj3.CreatureSpawner.Add("Spawner_Skeleton7", "Skeleton"); obj3.CreatureSpawner.Add("Spawner_Skeleton8", "Skeleton"); obj3.CreatureSpawner.Add("Spawner_Skeleton9", "Skeleton"); obj3.CreatureSpawner.Add("Spawner_Skeleton10", "Skeleton"); obj3.CreatureSpawner.Add("Spawner_Skeleton11", "Skeleton"); obj3.CreatureSpawner.Add("Spawner_Skeleton12", "Skeleton"); obj3.CreatureSpawner.Add("Spawner_Skeleton13", "Skeleton"); obj3.CreatureSpawner.Add("Spawner_Skeleton14", "Skeleton"); obj3.CreatureSpawner.Add("Spawner_Skeleton15", "Skeleton"); obj3.CreatureSpawner.Add("Spawner_Skeleton16", "Skeleton"); obj3.CreatureSpawner.Add("Spawner_Skeleton17", "Skeleton"); obj3.CreatureSpawner.Add("Spawner_Skeleton18", "Skeleton"); obj3.CreatureSpawner.Add("ExteriorSpawner_Skeleton", "Skeleton"); obj3.CreatureSpawner.Add("ExteriorSpawner_Skeleton (1)", "Skeleton"); obj3.CreatureSpawner.Add("ExteriorSpawner_Skeleton (2)", "Skeleton"); obj3.CreatureSpawner.Add("ExteriorSpawner_Skeleton (3)", "Skeleton"); _copperMine02 = _mineBundle.LoadAsset<GameObject>("BOM_CopperMine02"); Location obj4 = new Location(_copperMine02) { CanSpawn = true, ClearArea = true, Biome = (Biome)8, SpawnArea = (BiomeArea)1, Count = 70, GroupName = "OreMines", MinimumDistanceFromGroup = 400f, Rotation = Rotation.Slope, HeightDelta = new LocationManager.Range(0f, 40f), ForestThreshold = new LocationManager.Range(0f, 3f), SpawnAltitude = new LocationManager.Range(0.5f, 150f), SpawnDistance = new LocationManager.Range(400f, 10000f) }; ShaderReplacer.Replace(_copperMine02); obj4.CreatureSpawner.Add("Spawner_Skeleton", "Skeleton"); obj4.CreatureSpawner.Add("Spawner_Skeleton2", "Skeleton"); obj4.CreatureSpawner.Add("Spawner_Skeleton3", "Skeleton"); obj4.CreatureSpawner.Add("Spawner_Skeleton4", "Skeleton"); obj4.CreatureSpawner.Add("Spawner_Skeleton5", "Skeleton"); obj4.CreatureSpawner.Add("Spawner_Skeleton6", "Skeleton"); obj4.CreatureSpawner.Add("Spawner_Skeleton7", "Skeleton"); obj4.CreatureSpawner.Add("Spawner_Skeleton8", "Skeleton"); obj4.CreatureSpawner.Add("Spawner_Skeleton9", "Skeleton"); obj4.CreatureSpawner.Add("Spawner_Skeleton10", "Skeleton"); obj4.CreatureSpawner.Add("Spawner_Skeleton11", "Skeleton"); obj4.CreatureSpawner.Add("Spawner_Skeleton12", "Skeleton"); obj4.CreatureSpawner.Add("Spawner_Skeleton13", "Skeleton"); obj4.CreatureSpawner.Add("Spawner_Skeleton14", "Skeleton"); obj4.CreatureSpawner.Add("Spawner_Skeleton15", "Skeleton"); obj4.CreatureSpawner.Add("Spawner_Skeleton16", "Skeleton"); obj4.CreatureSpawner.Add("ExteriorSpawner_Skeleton", "Skeleton"); obj4.CreatureSpawner.Add("ExteriorSpawner_Skeleton (1)", "Skeleton"); obj4.CreatureSpawner.Add("ExteriorSpawner_Skeleton (2)", "Skeleton"); obj4.CreatureSpawner.Add("ExteriorSpawner_Skeleton (3)", "Skeleton"); _tinMine01 = _mineBundle.LoadAsset<GameObject>("BOM_TinMine01"); Location obj5 = new Location(_tinMine01) { CanSpawn = true, ClearArea = true, Biome = (Biome)8, SpawnArea = (BiomeArea)2, Count = 70, GroupName = "OreMines", MinimumDistanceFromGroup = 400f, Rotation = Rotation.Slope, HeightDelta = new LocationManager.Range(0f, 40f), ForestThreshold = new LocationManager.Range(0f, 3f), SpawnAltitude = new LocationManager.Range(0.5f, 150f), SpawnDistance = new LocationManager.Range(400f, 10000f) }; ShaderReplacer.Replace(_tinMine01); obj5.CreatureSpawner.Add("Spawner_Skeleton", "Skeleton"); obj5.CreatureSpawner.Add("Spawner_Skeleton2", "Skeleton"); obj5.CreatureSpawner.Add("Spawner_Skeleton3", "Skeleton"); obj5.CreatureSpawner.Add("Spawner_Skeleton4", "Skeleton"); obj5.CreatureSpawner.Add("Spawner_Skeleton5", "Skeleton"); obj5.CreatureSpawner.Add("Spawner_Skeleton6", "Skeleton"); obj5.CreatureSpawner.Add("Spawner_Skeleton7", "Skeleton"); obj5.CreatureSpawner.Add("Spawner_Skeleton8", "Skeleton"); obj5.CreatureSpawner.Add("Spawner_Skeleton9", "Skeleton"); obj5.CreatureSpawner.Add("Spawner_Skeleton10", "Skeleton"); obj5.CreatureSpawner.Add("Spawner_Skeleton11", "Skeleton"); obj5.CreatureSpawner.Add("Spawner_Skeleton12", "Skeleton"); obj5.CreatureSpawner.Add("Spawner_Skeleton13", "Skeleton"); obj5.CreatureSpawner.Add("Spawner_Skeleton14", "Skeleton"); obj5.CreatureSpawner.Add("Spawner_Skeleton15", "Skeleton"); obj5.CreatureSpawner.Add("Spawner_Skeleton16", "Skeleton"); obj5.CreatureSpawner.Add("Spawner_Skeleton17", "Skeleton"); obj5.CreatureSpawner.Add("Spawner_Skeleton18", "Skeleton"); obj5.CreatureSpawner.Add("Spawner_Skeleton19", "Skeleton"); obj5.CreatureSpawner.Add("Spawner_Skeleton20", "Skeleton"); obj5.CreatureSpawner.Add("ExteriorSpawner_Greydwarf", "Greydwarf"); obj5.CreatureSpawner.Add("ExteriorSpawner_Greydwarf (1)", "Greydwarf"); obj5.CreatureSpawner.Add("ExteriorSpawner_Greydwarf (2)", "Greydwarf"); obj5.CreatureSpawner.Add("ExteriorSpawner_GreydwarfElite(3)", "Greydwarf_Elite"); _tinMine02 = _mineBundle.LoadAsset<GameObject>("BOM_TinMine02"); Location obj6 = new Location(_tinMine02) { CanSpawn = true, ClearArea = true, Biome = (Biome)8, SpawnArea = (BiomeArea)1, Count = 70, GroupName = "OreMines", MinimumDistanceFromGroup = 400f, Rotation = Rotation.Slope, HeightDelta = new LocationManager.Range(0f, 40f), ForestThreshold = new LocationManager.Range(0f, 3f), SpawnAltitude = new LocationManager.Range(0.5f, 150f), SpawnDistance = new LocationManager.Range(400f, 10000f) }; ShaderReplacer.Replace(_tinMine02); obj6.CreatureSpawner.Add("Spawner_Skeleton", "Skeleton"); obj6.CreatureSpawner.Add("Spawner_Skeleton2", "Skeleton"); obj6.CreatureSpawner.Add("Spawner_Skeleton3", "Skeleton"); obj6.CreatureSpawner.Add("Spawner_Skeleton4", "Skeleton"); obj6.CreatureSpawner.Add("Spawner_Skeleton5", "Skeleton"); obj6.CreatureSpawner.Add("Spawner_Skeleton6", "Skeleton"); obj6.CreatureSpawner.Add("Spawner_Skeleton7", "Skeleton"); obj6.CreatureSpawner.Add("Spawner_Skeleton8", "Skeleton"); obj6.CreatureSpawner.Add("Spawner_Skeleton9", "Skeleton"); obj6.CreatureSpawner.Add("Spawner_Skeleton10", "Skeleton"); obj6.CreatureSpawner.Add("Spawner_Skeleton11", "Skeleton"); obj6.CreatureSpawner.Add("Spawner_Skeleton12", "Skeleton"); obj6.CreatureSpawner.Add("Spawner_Skeleton13", "Skeleton"); obj6.CreatureSpawner.Add("Spawner_Skeleton14", "Skeleton"); obj6.CreatureSpawner.Add("Spawner_Skeleton15", "Skeleton"); obj6.CreatureSpawner.Add("Spawner_Skeleton16", "Skeleton"); obj6.CreatureSpawner.Add("Spawner_Skeleton17", "Skeleton"); obj6.CreatureSpawner.Add("Spawner_Skeleton18", "Skeleton"); obj6.CreatureSpawner.Add("ExteriorSpawner_Greydwarf", "Greydwarf"); obj6.CreatureSpawner.Add("ExteriorSpawner_Greydwarf (1)", "Greydwarf"); obj6.CreatureSpawner.Add("ExteriorSpawner_Greydwarf (2)", "Greydwarf"); obj6.CreatureSpawner.Add("ExteriorSpawner_GreydwarfShaman (3)", "Greydwarf_Shaman"); _coalMine01 = _mineBundle.LoadAsset<GameObject>("BOM_CoalMine01"); Location obj7 = new Location(_coalMine01) { CanSpawn = true, ClearArea = true, Biome = (Biome)6, SpawnArea = (BiomeArea)2, Count = 70, GroupName = "OreMines", MinimumDistanceFromGroup = 300f, Rotation = Rotation.Slope, HeightDelta = new LocationManager.Range(0f, 40f), ForestThreshold = new LocationManager.Range(0f, 3f), SpawnAltitude = new LocationManager.Range(0.5f, 1000f), SpawnDistance = new LocationManager.Range(400f, 10000f) }; ShaderReplacer.Replace(_coalMine01); obj7.CreatureSpawner.Add("Spawner_Skeleton", "Skeleton"); obj7.CreatureSpawner.Add("Spawner_Skeleton2", "Skeleton"); obj7.CreatureSpawner.Add("Spawner_Skeleton3", "Skeleton"); obj7.CreatureSpawner.Add("Spawner_Skeleton4", "Skeleton"); obj7.CreatureSpawner.Add("Spawner_Skeleton5", "Skeleton"); obj7.CreatureSpawner.Add("Spawner_Skeleton6", "Skeleton"); obj7.CreatureSpawner.Add("Spawner_Skeleton7", "Skeleton"); obj7.CreatureSpawner.Add("Spawner_Skeleton8", "Skeleton"); obj7.CreatureSpawner.Add("Spawner_Skeleton9", "Skeleton"); obj7.CreatureSpawner.Add("Spawner_Skeleton10", "Skeleton"); obj7.CreatureSpawner.Add("Spawner_Skeleton11", "Skeleton"); obj7.CreatureSpawner.Add("Spawner_Skeleton12", "Skeleton"); obj7.CreatureSpawner.Add("Spawner_Skeleton13", "Skeleton"); obj7.CreatureSpawner.Add("Spawner_Skeleton14", "Skeleton"); obj7.CreatureSpawner.Add("Spawner_Skeleton15", "Skeleton"); obj7.CreatureSpawner.Add("Spawner_Skeleton16", "Skeleton"); obj7.CreatureSpawner.Add("ExteriorSpawner_Skeleton", "Skeleton"); obj7.CreatureSpawner.Add("ExteriorSpawner_Skeleton (1)", "Skeleton"); obj7.CreatureSpawner.Add("ExteriorSpawner_Skeleton (2)", "Skeleton"); obj7.CreatureSpawner.Add("ExteriorSpawner_Skeleton (3)", "Skeleton"); _coalMine02 = _mineBundle.LoadAsset<GameObject>("BOM_CoalMine02"); Location obj8 = new Location(_coalMine02) { CanSpawn = true, ClearArea = true, Biome = (Biome)6, SpawnArea = (BiomeArea)1, Count = 70, GroupName = "OreMines", MinimumDistanceFromGroup = 300f, Rotation = Rotation.Slope, HeightDelta = new LocationManager.Range(0f, 40f), ForestThreshold = new LocationManager.Range(0f, 3f), SpawnAltitude = new LocationManager.Range(0.5f, 1000f), SpawnDistance = new LocationManager.Range(400f, 10000f) }; ShaderReplacer.Replace(_coalMine02); obj8.CreatureSpawner.Add("Spawner_Skeleton", "Skeleton"); obj8.CreatureSpawner.Add("Spawner_Skeleton2", "Skeleton"); obj8.CreatureSpawner.Add("Spawner_Skeleton3", "Skeleton"); obj8.CreatureSpawner.Add("Spawner_Skeleton4", "Skeleton"); obj8.CreatureSpawner.Add("Spawner_Skeleton5", "Skeleton"); obj8.CreatureSpawner.Add("Spawner_Skeleton6", "Skeleton"); obj8.CreatureSpawner.Add("Spawner_Skeleton7", "Skeleton"); obj8.CreatureSpawner.Add("Spawner_Skeleton8", "Skeleton"); obj8.CreatureSpawner.Add("Spawner_Skeleton9", "Skeleton"); obj8.CreatureSpawner.Add("Spawner_Skeleton10", "Skeleton"); obj8.CreatureSpawner.Add("Spawner_Skeleton11", "Skeleton"); obj8.CreatureSpawner.Add("Spawner_Skeleton12", "Skeleton"); obj8.CreatureSpawner.Add("Spawner_Skeleton13", "Skeleton"); obj8.CreatureSpawner.Add("Spawner_Skeleton14", "Skeleton"); obj8.CreatureSpawner.Add("Spawner_Skeleton15", "Skeleton"); obj8.CreatureSpawner.Add("Spawner_Skeleton16", "Skeleton"); obj8.CreatureSpawner.Add("Spawner_Skeleton17", "Skeleton"); obj8.CreatureSpawner.Add("Spawner_Skeleton18", "Skeleton"); obj8.CreatureSpawner.Add("Spawner_Skeleton19", "Skeleton"); obj8.CreatureSpawner.Add("Spawner_Skeleton20", "Skeleton"); obj8.CreatureSpawner.Add("Spawner_Skeleton21", "Skeleton"); obj8.CreatureSpawner.Add("Spawner_Skeleton22", "Skeleton"); obj8.CreatureSpawner.Add("Spawner_Skeleton23", "Skeleton"); obj8.CreatureSpawner.Add("Spawner_Skeleton24", "Skeleton"); obj8.CreatureSpawner.Add("ExteriorSpawner_Skeleton", "Skeleton"); obj8.CreatureSpawner.Add("ExteriorSpawner_Skeleton (1)", "Skeleton"); obj8.CreatureSpawner.Add("ExteriorSpawner_Skeleton (2)", "Skeleton"); obj8.CreatureSpawner.Add("ExteriorSpawner_Skeleton (3)", "Skeleton"); _ironMine01 = _mineBundle.LoadAsset<GameObject>("BOM_IronMine01"); Location obj9 = new Location(_ironMine01) { CanSpawn = true, ClearArea = true, Biome = (Biome)18, SpawnArea = (BiomeArea)2, Count = 70, GroupName = "OreMines", MinimumDistanceFromGroup = 400f, Rotation = Rotation.Slope, HeightDelta = new LocationManager.Range(0f, 40f), ForestThreshold = new LocationManager.Range(0f, 3f), SpawnAltitude = new LocationManager.Range(0.5f, 1000f), SpawnDistance = new LocationManager.Range(400f, 10000f) }; ShaderReplacer.Replace(_ironMine01); obj9.CreatureSpawner.Add("Spawner_Draugr", "Draugr"); obj9.CreatureSpawner.Add("Spawner_Draugr2", "Draugr"); obj9.CreatureSpawner.Add("Spawner_Draugr3", "Draugr"); obj9.CreatureSpawner.Add("Spawner_Draugr4", "Draugr"); obj9.CreatureSpawner.Add("Spawner_Draugr5", "Draugr"); obj9.CreatureSpawner.Add("Spawner_Draugr6", "Draugr"); obj9.CreatureSpawner.Add("Spawner_Draugr7", "Draugr"); obj9.CreatureSpawner.Add("Spawner_Draugr8", "Draugr"); obj9.CreatureSpawner.Add("Spawner_Draugr9", "Draugr"); obj9.CreatureSpawner.Add("Spawner_Draugr10", "Draugr"); obj9.CreatureSpawner.Add("Spawner_Draugr11", "Draugr"); obj9.CreatureSpawner.Add("Spawner_Draugr12", "Draugr"); obj9.CreatureSpawner.Add("Spawner_Draugr13", "Draugr"); obj9.CreatureSpawner.Add("Spawner_Draugr14", "Draugr"); obj9.CreatureSpawner.Add("Spawner_Draugr15", "Draugr"); obj9.CreatureSpawner.Add("Spawner_Draugr16", "Draugr"); obj9.CreatureSpawner.Add("Spawner_Draugr17", "Draugr"); obj9.CreatureSpawner.Add("Spawner_Draugr18", "Draugr"); obj9.CreatureSpawner.Add("Spawner_Draugr19", "Draugr"); obj9.CreatureSpawner.Add("Spawner_Draugr20", "Draugr"); obj9.CreatureSpawner.Add("ExteriorSpawner_Draugr", "Draugr"); obj9.CreatureSpawner.Add("ExteriorSpawner_Draugr (1)", "Draugr"); obj9.CreatureSpawner.Add("ExteriorSpawner_Draugr (2)", "Draugr"); obj9.CreatureSpawner.Add("ExteriorSpawner_Draugr (3)", "Draugr"); _ironMine02 = _mineBundle.LoadAsset<GameObject>("BOM_IronMine02"); Location obj10 = new Location(_ironMine02) { CanSpawn = true, ClearArea = true, Biome = (Biome)18, SpawnArea = (BiomeArea)1, Count = 70, GroupName = "OreMines", MinimumDistanceFromGroup = 400f, Rotation = Rotation.Slope, HeightDelta = new LocationManager.Range(0f, 40f), ForestThreshold = new LocationManager.Range(0f, 3f), SpawnAltitude = new LocationManager.Range(0.5f, 1000f), SpawnDistance = new LocationManager.Range(400f, 10000f) }; ShaderReplacer.Replace(_ironMine02); obj10.CreatureSpawner.Add("Spawner_Draugr", "Draugr"); obj10.CreatureSpawner.Add("Spawner_Draugr2", "Draugr"); obj10.CreatureSpawner.Add("Spawner_Draugr3", "Draugr"); obj10.CreatureSpawner.Add("Spawner_Draugr4", "Draugr"); obj10.CreatureSpawner.Add("Spawner_Draugr5", "Draugr"); obj10.CreatureSpawner.Add("Spawner_Draugr6", "Draugr"); obj10.CreatureSpawner.Add("Spawner_Draugr7", "Draugr"); obj10.CreatureSpawner.Add("Spawner_Draugr8", "Draugr"); obj10.CreatureSpawner.Add("Spawner_Draugr9", "Draugr"); obj10.CreatureSpawner.Add("Spawner_Draugr10", "Draugr"); obj10.CreatureSpawner.Add("Spawner_Draugr11", "Draugr"); obj10.CreatureSpawner.Add("Spawner_Draugr12", "Draugr"); obj10.CreatureSpawner.Add("Spawner_Draugr13", "Draugr"); obj10.CreatureSpawner.Add("Spawner_Draugr14", "Draugr"); obj10.CreatureSpawner.Add("Spawner_Draugr15", "Draugr"); obj10.CreatureSpawner.Add("Spawner_Draugr16", "Draugr"); obj10.CreatureSpawner.Add("Spawner_Draugr17", "Draugr"); obj10.CreatureSpawner.Add("Spawner_Draugr18", "Draugr"); obj10.CreatureSpawner.Add("Spawner_Draugr19", "Draugr"); obj10.CreatureSpawner.Add("Spawner_Draugr20", "Draugr"); obj10.CreatureSpawner.Add("Spawner_Draugr21", "Draugr"); obj10.CreatureSpawner.Add("Spawner_Draugr22", "Draugr"); obj10.CreatureSpawner.Add("Spawner_Draugr23", "Draugr"); obj10.CreatureSpawner.Add("Spawner_Draugr24", "Draugr"); obj10.CreatureSpawner.Add("ExteriorSpawner_Draugr", "Draugr"); obj10.CreatureSpawner.Add("ExteriorSpawner_Draugr (1)", "Draugr"); obj10.CreatureSpawner.Add("ExteriorSpawner_Draugr (2)", "Draugr"); obj10.CreatureSpawner.Add("ExteriorSpawner_Draugr (3)", "Draugr"); _silverMine01 = _mineBundle.LoadAsset<GameObject>("BOM_SilverMine01"); Location obj11 = new Location(_silverMine01) { CanSpawn = true, ClearArea = true, Biome = (Biome)4, SpawnArea = (BiomeArea)3, Count = 70, GroupName = "OreMines", MinimumDistanceFromGroup = 300f, 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(350f, 10000f) }; ShaderReplacer.Replace(_silverMine01); obj11.CreatureSpawner.Add("Spawner_Fenring", "Ulv"); obj11.CreatureSpawner.Add("Spawner_Fenring2", "Ulv"); obj11.CreatureSpawner.Add("Spawner_Fenring3", "Ulv"); obj11.CreatureSpawner.Add("Spawner_Fenring4", "Ulv"); obj11.CreatureSpawner.Add("Spawner_Fenring5", "Ulv"); obj11.CreatureSpawner.Add("Spawner_Fenring6", "Ulv"); obj11.CreatureSpawner.Add("Spawner_Fenring7", "Ulv"); obj11.CreatureSpawner.Add("Spawner_Fenring8", "Ulv"); obj11.CreatureSpawner.Add("Spawner_Fenring9", "Ulv"); obj11.CreatureSpawner.Add("Spawner_Fenring10", "Ulv"); obj11.CreatureSpawner.Add("Spawner_Fenring11", "Ulv"); obj11.CreatureSpawner.Add("Spawner_Fenring12", "Ulv"); obj11.CreatureSpawner.Add("Spawner_Fenring13", "Ulv"); obj11.CreatureSpawner.Add("Spawner_Fenring14", "Ulv"); obj11.CreatureSpawner.Add("Spawner_Fenring15", "Ulv"); obj11.CreatureSpawner.Add("Spawner_Fenring16", "Ulv"); obj11.CreatureSpawner.Add("Spawner_Fenring17", "Ulv"); obj11.CreatureSpawner.Add("Spawner_Fenring18", "Ulv"); obj11.CreatureSpawner.Add("Spawner_Fenring19", "Ulv"); obj11.CreatureSpawner.Add("Spawner_Fenring20", "Ulv"); obj11.CreatureSpawner.Add("ExteriorSpawner_Wolf", "Wolf"); obj11.CreatureSpawner.Add("ExteriorSpawner_Wolf (1)", "Wolf"); obj11.CreatureSpawner.Add("ExteriorSpawner_Wolf (2)", "Wolf"); obj11.CreatureSpawner.Add("ExteriorSpawner_Wolf (3)", "Wolf"); _silverMine02 = _mineBundle.LoadAsset<GameObject>("BOM_SilverMine02"); Location obj12 = new Location(_silverMine02) { CanSpawn = true, ClearArea = true, Biome = (Biome)4, SpawnArea = (BiomeArea)3, Count = 70, GroupName = "OreMines", MinimumDistanceFromGroup = 300f, 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(350f, 10000f) }; ShaderReplacer.Replace(_silverMine02); obj12.CreatureSpawner.Add("Spawner_Fenring", "Ulv"); obj12.CreatureSpawner.Add("Spawner_Fenring2", "Ulv"); obj12.CreatureSpawner.Add("Spawner_Fenring3", "Ulv"); obj12.CreatureSpawner.Add("Spawner_Fenring4", "Ulv"); obj12.CreatureSpawner.Add("Spawner_Fenring5", "Ulv"); obj12.CreatureSpawner.Add("Spawner_Fenring6", "Ulv"); obj12.CreatureSpawner.Add("Spawner_Fenring7", "Ulv"); obj12.CreatureSpawner.Add("Spawner_Fenring8", "Ulv"); obj12.CreatureSpawner.Add("Spawner_Fenring9", "Ulv"); obj12.CreatureSpawner.Add("Spawner_Fenring10", "Ulv"); obj12.CreatureSpawner.Add("Spawner_Fenring11", "Ulv"); obj12.CreatureSpawner.Add("Spawner_Fenring12", "Ulv"); obj12.CreatureSpawner.Add("Spawner_Fenring13", "Ulv"); obj12.CreatureSpawner.Add("Spawner_Fenring14", "Ulv"); obj12.CreatureSpawner.Add("Spawner_Fenring15", "Ulv"); obj12.CreatureSpawner.Add("Spawner_Fenring16", "Ulv"); obj12.CreatureSpawner.Add("ExteriorSpawner_Wolf", "Wolf"); obj12.CreatureSpawner.Add("ExteriorSpawner_Wolf (1)", "Wolf"); obj12.CreatureSpawner.Add("ExteriorSpawner_Wolf (2)", "Wolf"); obj12.CreatureSpawner.Add("ExteriorSpawner_Wolf (3)", "Wolf"); _blackMetalMine01 = _mineBundle.LoadAsset<GameObject>("BOM_BlackMetalMine01"); Location obj13 = new Location(_blackMetalMine01) { CanSpawn = true, ClearArea = true, Biome = (Biome)528, SpawnArea = (BiomeArea)2, Count = 70, GroupName = "OreMines", MinimumDistanceFromGroup = 400f, Rotation = Rotation.Slope, HeightDelta = new LocationManager.Range(0f, 40f), ForestThreshold = new LocationManager.Range(0f, 3f), SpawnAltitude = new LocationManager.Range(0.5f, 1000f), SpawnDistance = new LocationManager.Range(400f, 10000f) }; ShaderReplacer.Replace(_blackMetalMine01); obj13.CreatureSpawner.Add("Spawner_Goblin", "Goblin"); obj13.CreatureSpawner.Add("Spawner_Goblin2", "Goblin"); obj13.CreatureSpawner.Add("Spawner_Goblin3", "Goblin"); obj13.CreatureSpawner.Add("Spawner_Goblin4", "Goblin"); obj13.CreatureSpawner.Add("Spawner_Goblin5", "Goblin"); obj13.CreatureSpawner.Add("Spawner_Goblin6", "Goblin"); obj13.CreatureSpawner.Add("Spawner_Goblin7", "Goblin"); obj13.CreatureSpawner.Add("Spawner_Goblin8", "Goblin"); obj13.CreatureSpawner.Add("Spawner_Goblin9", "Goblin"); obj13.CreatureSpawner.Add("Spawner_Goblin10", "Goblin"); obj13.CreatureSpawner.Add("Spawner_Goblin11", "Goblin"); obj13.CreatureSpawner.Add("Spawner_Goblin12", "Goblin"); obj13.CreatureSpawner.Add("Spawner_Goblin13", "Goblin"); obj13.CreatureSpawner.Add("Spawner_Goblin14", "Goblin"); obj13.CreatureSpawner.Add("Spawner_Goblin15", "Goblin"); obj13.CreatureSpawner.Add("Spawner_Goblin16", "Goblin"); obj13.CreatureSpawner.Add("Spawner_Goblin17", "Goblin"); obj13.CreatureSpawner.Add("Spawner_Goblin18", "Goblin"); obj13.CreatureSpawner.Add("ExteriorSpawner_Goblin", "Goblin"); obj13.CreatureSpawner.Add("ExteriorSpawner_Goblin (1)", "Goblin"); obj13.CreatureSpawner.Add("ExteriorSpawner_Goblin (2)", "Goblin"); obj13.CreatureSpawner.Add("ExteriorSpawner_GoblinBrute (3)", "GoblinBrute"); _blackMetalMine02 = _mineBundle.LoadAsset<GameObject>("BOM_BlackMetalMine02"); Location obj14 = new Location(_blackMetalMine02) { CanSpawn = true, ClearArea = true, Biome = (Biome)528, SpawnArea = (BiomeArea)1, Count = 70, GroupName = "OreMines", MinimumDistanceFromGroup = 400f, Rotation = Rotation.Slope, HeightDelta = new LocationManager.Range(0f, 40f), ForestThreshold = new LocationManager.Range(0f, 3f), SpawnAltitude = new LocationManager.Range(0.5f, 1000f), SpawnDistance = new LocationManager.Range(400f, 10000f) }; ShaderReplacer.Replace(_blackMetalMine02); obj14.CreatureSpawner.Add("Spawner_Goblin", "Goblin"); obj14.CreatureSpawner.Add("Spawner_Goblin2", "Goblin"); obj14.CreatureSpawner.Add("Spawner_Goblin3", "Goblin"); obj14.CreatureSpawner.Add("Spawner_Goblin4", "Goblin"); obj14.CreatureSpawner.Add("Spawner_Goblin5", "Goblin"); obj14.CreatureSpawner.Add("Spawner_Goblin6", "Goblin"); obj14.CreatureSpawner.Add("Spawner_Goblin7", "Goblin"); obj14.CreatureSpawner.Add("Spawner_Goblin8", "Goblin"); obj14.CreatureSpawner.Add("Spawner_Goblin9", "Goblin"); obj14.CreatureSpawner.Add("Spawner_Goblin10", "Goblin"); obj14.CreatureSpawner.Add("Spawner_Goblin11", "Goblin"); obj14.CreatureSpawner.Add("Spawner_Goblin12", "Goblin"); obj14.CreatureSpawner.Add("Spawner_Goblin13", "Goblin"); obj14.CreatureSpawner.Add("Spawner_Goblin14", "Goblin"); obj14.CreatureSpawner.Add("Spawner_Goblin15", "Goblin"); obj14.CreatureSpawner.Add("Spawner_Goblin16", "Goblin"); obj14.CreatureSpawner.Add("ExteriorSpawner_Goblin", "Goblin"); obj14.CreatureSpawner.Add("ExteriorSpawner_Goblin (1)", "Goblin"); obj14.CreatureSpawner.Add("ExteriorSpawner_Goblin (2)", "Goblin"); obj14.CreatureSpawner.Add("ExteriorSpawner_GoblinShaman (3)", "GoblinShaman"); _flametalMine01 = _mineBundle.LoadAsset<GameObject>("BOM_FlametalMine01"); Location obj15 = new Location(_flametalMine01) { CanSpawn = true, ClearArea = true, Biome = (Biome)32, SpawnArea = (BiomeArea)2, Count = 70, GroupName = "OreMines", MinimumDistanceFromGroup = 300f, Rotation = Rotation.Slope, HeightDelta = new LocationManager.Range(0f, 40f), ForestThreshold = new LocationManager.Range(0f, 3f), SpawnAltitude = new LocationManager.Range(0.5f, 1000f), SpawnDistance = new LocationManager.Range(300f, 10000f) }; ShaderReplacer.Replace(_flametalMine01); obj15.CreatureSpawner.Add("Spawner_CharredMelee", "Charred_Melee"); obj15.CreatureSpawner.Add("Spawner_CharredMelee2", "Charred_Melee"); obj15.CreatureSpawner.Add("Spawner_CharredMelee3", "Charred_Melee"); obj15.CreatureSpawner.Add("Spawner_CharredMelee4", "Charred_Melee"); obj15.CreatureSpawner.Add("Spawner_CharredMelee5", "Charred_Melee"); obj15.CreatureSpawner.Add("Spawner_CharredMelee6", "Charred_Melee"); obj15.CreatureSpawner.Add("Spawner_CharredMelee7", "Charred_Melee"); obj15.CreatureSpawner.Add("Spawner_CharredMelee8", "Charred_Melee"); obj15.CreatureSpawner.Add("Spawner_CharredMelee9", "Charred_Melee"); obj15.CreatureSpawner.Add("Spawner_CharredMelee10", "Charred_Melee"); obj15.CreatureSpawner.Add("Spawner_CharredMelee11", "Charred_Melee"); obj15.CreatureSpawner.Add("Spawner_CharredMelee12", "Charred_Melee"); obj15.CreatureSpawner.Add("Spawner_CharredMelee13", "Charred_Melee"); obj15.CreatureSpawner.Add("Spawner_CharredMelee14", "Charred_Melee"); obj15.CreatureSpawner.Add("Spawner_CharredMelee15", "Charred_Melee"); obj15.CreatureSpawner.Add("Spawner_CharredMelee16", "Charred_Melee"); obj15.CreatureSpawner.Add("Spawner_CharredMelee17", "Charred_Melee"); obj15.CreatureSpawner.Add("Spawner_CharredMelee18", "Charred_Melee"); obj15.CreatureSpawner.Add("Spawner_CharredMelee19", "Charred_Melee"); obj15.CreatureSpawner.Add("Spawner_CharredMelee20", "Charred_Melee"); obj15.CreatureSpawner.Add("ExteriorSpawner_CharredMelee", "Charred_Melee"); obj15.CreatureSpawner.Add("ExteriorSpawner_CharredMelee (1)", "Charred_Melee"); obj15.CreatureSpawner.Add("ExteriorSpawner_CharredMelee (2)", "Charred_Melee"); obj15.CreatureSpawner.Add("ExteriorSpawner_CharredArcher (3)", "Charred_Archer"); _flametalMine02 = _mineBundle.LoadAsset<GameObject>("BOM_FlametalMine02"); Location obj16 = new Location(_flametalMine02) { CanSpawn = true, ClearArea = true, Biome = (Biome)32, SpawnArea = (BiomeArea)1, Count = 70, GroupName = "OreMines", MinimumDistanceFromGroup = 300f, Rotation = Rotation.Slope, HeightDelta = new LocationManager.Range(0f, 40f), ForestThreshold = new LocationManager.Range(0f, 3f), SpawnAltitude = new LocationManager.Range(0.5f, 1000f), SpawnDistance = new LocationManager.Range(300f, 10000f) }; ShaderReplacer.Replace(_flametalMine02); obj16.CreatureSpawner.Add("Spawner_CharredMelee", "Charred_Melee"); obj16.CreatureSpawner.Add("Spawner_CharredMelee2", "Charred_Melee"); obj16.CreatureSpawner.Add("Spawner_CharredMelee3", "Charred_Melee"); obj16.CreatureSpawner.Add("Spawner_CharredMelee4", "Charred_Melee"); obj16.CreatureSpawner.Add("Spawner_CharredMelee5", "Charred_Melee"); obj16.CreatureSpawner.Add("Spawner_CharredMelee6", "Charred_Melee"); obj16.CreatureSpawner.Add("Spawner_CharredMelee7", "Charred_Melee"); obj16.CreatureSpawner.Add("Spawner_CharredMelee8", "Charred_Melee"); obj16.CreatureSpawner.Add("Spawner_CharredMelee9", "Charred_Melee"); obj16.CreatureSpawner.Add("Spawner_CharredMelee10", "Charred_Melee"); obj16.CreatureSpawner.Add("Spawner_CharredMelee11", "Charred_Melee"); obj16.CreatureSpawner.Add("Spawner_CharredMelee12", "Charred_Melee"); obj16.CreatureSpawner.Add("Spawner_CharredMelee13", "Charred_Melee"); obj16.CreatureSpawner.Add("Spawner_CharredMelee14", "Charred_Melee"); obj16.CreatureSpawner.Add("Spawner_CharredMelee15", "Charred_Melee"); obj16.CreatureSpawner.Add("Spawner_CharredMelee16", "Charred_Melee"); obj16.CreatureSpawner.Add("Spawner_CharredMelee17", "Charred_Melee"); obj16.CreatureSpawner.Add("Spawner_CharredMelee18", "Charred_Melee"); obj16.CreatureSpawner.Add("ExteriorSpawner_CharredMelee", "Charred_Melee"); obj16.CreatureSpawner.Add("ExteriorSpawner_CharredMelee (1)", "Charred_Melee"); obj16.CreatureSpawner.Add("ExteriorSpawner_CharredMelee (2)", "Charred_Melee"); obj16.CreatureSpawner.Add("ExteriorSpawner_CharredMage (3)", "Charred_Mage"); ShaderReplacer.Replace(_mineBundle.LoadAsset<GameObject>("bom_InteriorEnvironmentZoneForce")); Item item = new Item(_mineBundle, "BOM_BonemassKey"); item.DropsFrom.Add("Bonemass", 1f, 1, 1, levelMultiplier: false); item.Configurable = Configurability.Disabled; Item item2 = new Item(_mineBundle, "BOM_EikthyrKey"); item2.DropsFrom.Add("Eikthyr", 1f, 1, 1, levelMultiplier: false); item2.Configurable = Configurability.Disabled; Item item3 = new Item(_mineBundle, "BOM_CrystalKey"); item3.DropsFrom.Add("Dragon", 1f, 1, 1, levelMultiplier: false); item3.Configurable = Configurability.Disabled; Item item4 = new Item(_mineBundle, "BOM_LavaKey"); item4.DropsFrom.Add("SeekerQueen", 1f, 1, 1, levelMultiplier: false); item4.Configurable = Configurability.Disabled; PrefabManager.RegisterPrefab(_mineBundle, "bom_sfx_rock_destroyed"); PrefabManager.RegisterPrefab(_mineBundle, "bom_sfx_rock_hit"); PrefabManager.RegisterPrefab(_mineBundle, "bom_vfx_RockDestroyed_Obsidian"); PrefabManager.RegisterPrefab(_mineBundle, "bom_vfx_RockHit_Obsidian"); PrefabManager.RegisterPrefab(_mineBundle, "bom_sfx_metalgate_close"); PrefabManager.RegisterPrefab(_mineBundle, "bom_sfx_metalgate_open"); } public static void InitMine(ZNetScene zNetScene) { FlintMine01(zNetScene); FlintMine02(zNetScene); CopperMine01(zNetScene); CopperMine02(zNetScene); TinMine01(zNetScene); TinMine02(zNetScene); CoalMine01(zNetScene); CoalMine02(zNetScene); IronMine01(zNetScene); IronMine02(zNetScene); SilverMine01(zNetScene); SilverMine02(zNetScene); BlackMetalMine01(zNetScene); BlackMetalMine02(zNetScene); FlametalMine01(zNetScene); FlametalMine02(zNetScene); } private static void FlintMine01(ZNetScene zNetScene) { //IL_003c: 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) DropOnDestroyed[] componentsInChildren = _flintMine01.GetComponentsInChildren<DropOnDestroyed>(true); if (componentsInChildren == null) { return; } DropOnDestroyed[] array = componentsInChildren; foreach (DropOnDestroyed drop in array) { drop.m_dropWhenDestroyed.m_drops = new List<DropData>(1) { new DropData { m_item = zNetScene.GetPrefab(StringExtensionMethods.GetStableHashCode("Flint")), m_stackMin = 1, m_stackMax = 1, m_weight = 1f } }; Plugin._flintMineDropMin.SettingChanged += delegate { drop.m_dropWhenDestroyed.m_dropMin = Plugin._flintMineDropMin.Value; }; drop.m_dropWhenDestroyed.m_dropMin = Plugin._flintMineDropMin.Value; Plugin._flintMineDropMax.SettingChanged += delegate { drop.m_dropWhenDestroyed.m_dropMax = Plugin._flintMineDropMax.Value; }; drop.m_dropWhenDestroyed.m_dropMax = Plugin._flintMineDropMax.Value; } } private static void FlintMine02(ZNetScene zNetScene) { //IL_003c: 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) DropOnDestroyed[] componentsInChildren = _flintMine02.GetComponentsInChildren<DropOnDestroyed>(true); if (componentsInChildren == null) { return; } DropOnDestroyed[] array = componentsInChildren; foreach (DropOnDestroyed drop in array) { drop.m_dropWhenDestroyed.m_drops = new List<DropData>(1) { new DropData { m_item = zNetScene.GetPrefab(StringExtensionMethods.GetStableHashCode("Flint")), m_stackMin = 1, m_stackMax = 1, m_weight = 1f } }; Plugin._flintMineDropMin.SettingChanged += delegate { drop.m_dropWhenDestroyed.m_dropMin = Plugin._flintMineDropMin.Value; }; drop.m_dropWhenDestroyed.m_dropMin = Plugin._flintMineDropMin.Value; Plugin._flintMineDropMax.SettingChanged += delegate { drop.m_dropWhenDestroyed.m_dropMax = Plugin._flintMineDropMax.Value; }; drop.m_dropWhenDestroyed.m_dropMax = Plugin._flintMineDropMax.Value; } } private static void CopperMine01(ZNetScene zNetScene) { //IL_0041: 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_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) MineRock[] componentsInChildren = _copperMine01.GetComponentsInChildren<MineRock>(true); if (componentsInChildren != null) { MineRock[] array = componentsInChildren; foreach (MineRock mine in array) { mine.m_dropItems.m_drops = new List<DropData>(2) { new DropData { m_item = zNetScene.GetPrefab(StringExtensionMethods.GetStableHashCode("CopperOre")), m_stackMin = 1, m_stackMax = 1, m_weight = 0.85f }, new DropData { m_item = zNetScene.GetPrefab(StringExtensionMethods.GetStableHashCode("Stone")), m_stackMin = 1, m_stackMax = 1, m_weight = 1f } }; Plugin._copperMineDropMin.SettingChanged += delegate { mine.m_dropItems.m_dropMin = Plugin._copperMineDropMin.Value; }; mine.m_dropItems.m_dropMin = Plugin._copperMineDropMin.Value; Plugin._copperMineDropMax.SettingChanged += delegate { mine.m_dropItems.m_dropMax = Plugin._copperMineDropMax.Value; }; mine.m_dropItems.m_dropMax = Plugin._copperMineDropMax.Value; } } Door componentInChildren = _copperMine01.GetComponentInChildren<Door>(true); if (!((Object)(object)componentInChildren == (Object)null)) { componentInChildren.m_keyItem = zNetScene.GetPrefab(StringExtensionMethods.GetStableHashCode("BOM_EikthyrKey")).GetComponent<ItemDrop>(); componentInChildren.m_keyItem.m_itemData.m_shared.m_maxStackSize = ((Plugin._stackableKeys.Value != Plugin.Toggle.On) ? 1 : 10); } } private static void CopperMine02(ZNetScene zNetScene) { //IL_0041: 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_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) MineRock[] componentsInChildren = _copperMine02.GetComponentsInChildren<MineRock>(true); if (componentsInChildren != null) { MineRock[] array = componentsInChildren; foreach (MineRock mine in array) { mine.m_dropItems.m_drops = new List<DropData>(2) { new DropData { m_item = zNetScene.GetPrefab(StringExtensionMethods.GetStableHashCode("CopperOre")), m_stackMin = 1, m_stackMax = 1, m_weight = 0.85f }, new DropData { m_item = zNetScene.GetPrefab(StringExtensionMethods.GetStableHashCode("Stone")), m_stackMin = 1, m_stackMax = 1, m_weight = 1f } }; Plugin._copperMineDropMin.SettingChanged += delegate { mine.m_dropItems.m_dropMin = Plugin._copperMineDropMin.Value; }; mine.m_dropItems.m_dropMin = Plugin._copperMineDropMin.Value; Plugin._copperMineDropMax.SettingChanged += delegate { mine.m_dropItems.m_dropMax = Plugin._copperMineDropMax.Value; }; mine.m_dropItems.m_dropMax = Plugin._copperMineDropMax.Value; } } Door componentInChildren = _copperMine02.GetComponentInChildren<Door>(true); if (!((Object)(object)componentInChildren == (Object)null)) { componentInChildren.m_keyItem = zNetScene.GetPrefab(StringExtensionMethods.GetStableHashCode("BOM_EikthyrKey")).GetComponent<ItemDrop>(); componentInChildren.m_keyItem.m_itemData.m_shared.m_maxStackSize = ((Plugin._stackableKeys.Value != Plugin.Toggle.On) ? 1 : 10); } } private static void TinMine01(ZNetScene zNetScene) { //IL_0041: 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) DropOnDestroyed[] componentsInChildren = _tinMine01.GetComponentsInChildren<DropOnDestroyed>(true); if (componentsInChildren != null) { DropOnDestroyed[] array = componentsInChildren; foreach (DropOnDestroyed drop in array) { drop.m_dropWhenDestroyed.m_drops = new List<DropData>(1) { new DropData { m_item = zNetScene.GetPrefab(StringExtensionMethods.GetStableHashCode("TinOre")), m_stackMin = 1, m_stackMax = 1, m_weight = 1f } }; Plugin._tinMineDropMin.SettingChanged += delegate { drop.m_dropWhenDestroyed.m_dropMin = Plugin._tinMineDropMin.Value; }; drop.m_dropWhenDestroyed.m_dropMin = Plugin._tinMineDropMin.Value; Plugin._tinMineDropMax.SettingChanged += delegate { drop.m_dropWhenDestroyed.m_dropMax = Plugin._tinMineDropMax.Value; }; drop.m_dropWhenDestroyed.m_dropMax = Plugin._tinMineDropMax.Value; } } Door componentInChildren = _tinMine01.GetComponentInChildren<Door>(true); if (!((Object)(object)componentInChildren == (Object)null)) { componentInChildren.m_keyItem = zNetScene.GetPrefab(StringExtensionMethods.GetStableHashCode("BOM_EikthyrKey")).GetComponent<ItemDrop>(); componentInChildren.m_keyItem.m_itemData.m_shared.m_maxStackSize = ((Plugin._stackableKeys.Value != Plugin.Toggle.On) ? 1 : 10); } } private static void TinMine02(ZNetScene zNetScene) { //IL_0041: 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) DropOnDestroyed[] componentsInChildren = _tinMine02.GetComponentsInChildren<DropOnDestroyed>(true); if (componentsInChildren != null) { DropOnDestroyed[] array = componentsInChildren; foreach (DropOnDestroyed drop in array) { drop.m_dropWhenDestroyed.m_drops = new List<DropData>(1) { new DropData { m_item = zNetScene.GetPrefab(StringExtensionMethods.GetStableHashCode("TinOre")), m_stackMin = 1, m_stackMax = 1, m_weight = 1f } }; Plugin._tinMineDropMin.SettingChanged += delegate { drop.m_dropWhenDestroyed.m_dropMin = Plugin._tinMineDropMin.Value; }; drop.m_dropWhenDestroyed.m_dropMin = Plugin._tinMineDropMin.Value; Plugin._tinMineDropMax.SettingChanged += delegate { drop.m_dropWhenDestroyed.m_dropMax = Plugin._tinMineDropMax.Value; }; drop.m_dropWhenDestroyed.m_dropMax = Plugin._tinMineDropMax.Value; } } Door componentInChildren = _tinMine02.GetComponentInChildren<Door>(true); if (!((Object)(object)componentInChildren == (Object)null)) { componentInChildren.m_keyItem = zNetScene.GetPrefab(StringExtensionMethods.GetStableHashCode("BOM_EikthyrKey")).GetComponent<ItemDrop>(); componentInChildren.m_keyItem.m_itemData.m_shared.m_maxStackSize = ((Plugin._stackableKeys.Value != Plugin.Toggle.On) ? 1 : 10); } } private static void CoalMine01(ZNetScene zNetScene) { //IL_0041: 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) DropOnDestroyed[] componentsInChildren = _coalMine01.GetComponentsInChildren<DropOnDestroyed>(true); if (componentsInChildren != null) { DropOnDestroyed[] array = componentsInChildren; foreach (DropOnDestroyed drop in array) { drop.m_dropWhenDestroyed.m_drops = new List<DropData>(1) { new DropData { m_item = zNetScene.GetPrefab(StringExtensionMethods.GetStableHashCode("Coal")), m_stackMin = 1, m_stackMax = 1, m_weight = 1f } }; Plugin._coalMineDropMin.SettingChanged += delegate { drop.m_dropWhenDestroyed.m_dropMin = Plugin._coalMineDropMin.Value; }; drop.m_dropWhenDestroyed.m_dropMin = Plugin._coalMineDropMin.Value; Plugin._coalMineDropMax.SettingChanged += delegate { drop.m_dropWhenDestroyed.m_dropMax = Plugin._coalMineDropMax.Value; }; drop.m_dropWhenDestroyed.m_dropMax = Plugin._coalMineDropMax.Value; } } Door componentInChildren = _coalMine01.GetComponentInChildren<Door>(true); if (!((Object)(object)componentInChildren == (Object)null)) { componentInChildren.m_keyItem = zNetScene.GetPrefab(StringExtensionMethods.GetStableHashCode("CryptKey")).GetComponent<ItemDrop>(); componentInChildren.m_keyItem.m_itemData.m_shared.m_maxStackSize = ((Plugin._stackableKeys.Value != Plugin.Toggle.On) ? 1 : 10); } } private static void CoalMine02(ZNetScene zNetScene) { //IL_0041: 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) DropOnDestroyed[] componentsInChildren = _coalMine02.GetComponentsInChildren<DropOnDestroyed>(true); if (componentsInChildren != null) { DropOnDestroyed[] array = componentsInChildren; foreach (DropOnDestroyed drop in array) { drop.m_dropWhenDestroyed.m_drops = new List<DropData>(1) { new DropData { m_item = zNetScene.GetPrefab(StringExtensionMethods.GetStableHashCode("Coal")), m_stackMin = 1, m_stackMax = 1, m_weight = 1f } }; Plugin._coalMineDropMin.SettingChanged += delegate { drop.m_dropWhenDestroyed.m_dropMin = Plugin._coalMineDropMin.Value; }; drop.m_dropWhenDestroyed.m_dropMin = Plugin._coalMineDropMin.Value; Plugin._coalMineDropMax.SettingChanged += delegate { drop.m_dropWhenDestroyed.m_dropMax = Plugin._coalMineDropMax.Value; }; drop.m_dropWhenDestroyed.m_dropMax = Plugin._coalMineDropMax.Value; } } Door componentInChildren = _coalMine02.GetComponentInChildren<Door>(true); if (!((Object)(object)componentInChildren == (Object)null)) { componentInChildren.m_keyItem = zNetScene.GetPrefab(StringExtensionMethods.GetStableHashCode("CryptKey")).GetComponent<ItemDrop>(); componentInChildren.m_keyItem.m_itemData.m_shared.m_maxStackSize = ((Plugin._stackableKeys.Value != Plugin.Toggle.On) ? 1 : 10); } } private static void IronMine01(ZNetScene zNetScene) { //IL_0041: 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_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) MineRock[] componentsInChildren = _ironMine01.GetComponentsInChildren<MineRock>(true); if (componentsInChildren != null) { MineRock[] array = componentsInChildren; foreach (MineRock mine in array) { mine.m_dropItems.m_drops = new List<DropData>(2) { new DropData { m_item = zNetScene.GetPrefab(StringExtensionMethods.GetStableHashCode("IronOre")), m_stackMin = 1, m_stackMax = 1, m_weight = 0.65f }, new DropData { m_item = zNetScene.GetPrefab(StringExtensionMethods.GetStableHashCode("Stone")), m_stackMin = 1, m_stackMax = 1, m_weight = 1f } }; Plugin._ironMineDropMin.SettingChanged += delegate { mine.m_dropItems.m_dropMin = Plugin._ironMineDropMin.Value; }; mine.m_dropItems.m_dropMin = Plugin._ironMineDropMin.Value; Plugin._ironMineDropMax.SettingChanged += delegate { mine.m_dropItems.m_dropMax = Plugin._ironMineDropMax.Value; }; mine.m_dropItems.m_dropMax = Plugin._ironMineDropMax.Value; } } Door componentInChildren = _ironMine01.GetComponentInChildren<Door>(true); if (!((Object)(object)componentInChildren == (Object)null)) { componentInChildren.m_keyItem = zNetScene.GetPrefab(StringExtensionMethods.GetStableHashCode("CryptKey")).GetComponent<ItemDrop>(); componentInChildren.m_keyItem.m_itemData.m_shared.m_maxStackSize = ((Plugin._stackableKeys.Value != Plugin.Toggle.On) ? 1 : 10); } } private static void IronMine02(ZNetScene zNetScene) { //IL_0041: 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_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) MineRock[] componentsInChildren = _ironMine02.GetComponentsInChildren<MineRock>(true); if (componentsInChildren != null) { MineRock[] array = componentsInChildren; foreach (MineRock mine in array) { mine.m_dropItems.m_drops = new List<DropData>(2) { new DropData { m_item = zNetScene.GetPrefab(StringExtensionMethods.GetStableHashCode("IronOre")), m_stackMin = 1, m_stackMax = 1, m_weight = 0.65f }, new DropData { m_item = zNetScene.GetPrefab(StringExtensionMethods.GetStableHashCode("Stone")), m_stackMin = 1, m_stackMax = 1, m_weight = 1f } }; Plugin._ironMineDropMin.SettingChanged += delegate { mine.m_dropItems.m_dropMin = Plugin._ironMineDropMin.Value; }; mine.m_dropItems.m_dropMin = Plugin._ironMineDropMin.Value; Plugin._ironMineDropMax.SettingChanged += delegate { mine.m_dropItems.m_dropMax = Plugin._ironMineDropMax.Value; }; mine.m_dropItems.m_dropMax = Plugin._ironMineDropMax.Value; } } Door componentInChildren = _ironMine02.GetComponentInChildren<Door>(true); if (!((Object)(object)componentInChildren == (Object)null)) { componentInChildren.m_keyItem = zNetScene.GetPrefab(StringExtensionMethods.GetStableHashCode("CryptKey")).GetComponent<ItemDrop>(); componentInChildren.m_keyItem.m_itemData.m_shared.m_maxStackSize = ((Plugin._stackableKeys.Value != Plugin.Toggle.On) ? 1 : 10); } } private static void SilverMine01(ZNetScene zNetScene) { //IL_0041: 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_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) MineRock[] componentsInChildren = _silverMine01.GetComponentsInChildren<MineRock>(true); if (componentsInChildren != null) { MineRock[] array = componentsInChildren; foreach (MineRock mine in array) { mine.m_dropItems.m_drops = new List<DropData>(2) { new DropData { m_item = zNetScene.GetPrefab(StringExtensionMethods.GetStableHashCode("SilverOre")), m_stackMin = 1, m_stackMax = 1, m_weight = 0.65f }, new DropData { m_item = zNetScene.GetPrefab(StringExtensionMethods.GetStableHashCode("Stone")), m_stackMin = 1, m_stackMax = 1, m_weight = 1f } }; Plugin._silverMineDropMin.SettingChanged += delegate { mine.m_dropItems.m_dropMin = Plugin._silverMineDropMin.Value; }; mine.m_dropItems.m_dropMin = Plugin._silverMineDropMin.Value; Plugin._silverMineDropMax.SettingChanged += delegate { mine.m_dropItems.m_dropMax = Plugin._silverMineDropMax.Value; }; mine.m_dropItems.m_dropMax = Plugin._silverMineDropMax.Value; } } Door componentInChildren = _silverMine01.GetComponentInChildren<Door>(true); if (!((Object)(object)componentInChildren == (Object)null)) { componentInChildren.m_keyItem = zNetScene.GetPrefab(StringExtensionMethods.GetStableHashCode("BOM_BonemassKey")).GetComponent<ItemDrop>(); componentInChildren.m_keyItem.m_itemData.m_shared.m_maxStackSize = ((Plugin._stackableKeys.Value != Plugin.Toggle.On) ? 1 : 10); } } private static void SilverMine02(ZNetScene zNetScene) { //IL_0041: 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_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) MineRock[] componentsInChildren = _silverMine02.GetComponentsInChildren<MineRock>(true); if (componentsInChildren != null) { MineRock[] array = componentsInChildren; foreach (MineRock mine in array) { mine.m_dropItems.m_drops = new List<DropData>(2) { new DropData { m_item = zNetScene.GetPrefab(StringExtensionMethods.GetStableHashCode("SilverOre")), m_stackMin = 1, m_stackMax = 1, m_weight = 0.65f }, new DropData { m_item = zNetScene.GetPrefab(StringExtensionMethods.GetStableHashCode("Stone")), m_stackMin = 1, m_stackMax = 1, m_weight = 1f } }; Plugin._silverMineDropMin.SettingChanged += delegate { mine.m_dropItems.m_dropMin = Plugin._silverMineDropMin.Value; }; mine.m_dropItems.m_dropMin = Plugin._silverMineDropMin.Value; Plugin._silverMineDropMax.SettingChanged += delegate { mine.m_dropItems.m_dropMax = Plugin._silverMineDropMax.Value; }; mine.m_dropItems.m_dropMax = Plugin._silverMineDropMax.Value; } } Door componentInChildren = _silverMine02.GetComponentInChildren<Door>(true); if (!((Object)(object)componentInChildren == (Object)null)) { componentInChildren.m_keyItem = zNetScene.GetPrefab(StringExtensionMethods.GetStableHashCode("BOM_BonemassKey")).GetComponent<ItemDrop>(); componentInChildren.m_keyItem.m_itemData.m_shared.m_maxStackSize = ((Plugin._stackableKeys.Value != Plugin.Toggle.On) ? 1 : 10); } } private static void BlackMetalMine01(ZNetScene zNetScene) { //IL_0041: 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_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) MineRock[] componentsInChildren = _blackMetalMine01.GetComponentsInChildren<MineRock>(true); if (componentsInChildren != null) { MineRock[] array = componentsInChildren; foreach (MineRock mine in array) { mine.m_dropItems.m_drops = new List<DropData>(2) { new DropData { m_item = zNetScene.GetPrefab(StringExtensionMethods.GetStableHashCode("BlackMetalScrap")), m_stackMin = 1, m_stackMax = 1, m_weight = 0.85f }, new DropData { m_item = zNetScene.GetPrefab(StringExtensionMethods.GetStableHashCode("Stone")), m_stackMin = 1, m_stackMax = 1, m_weight = 1f } }; Plugin._blackMetalMineDropMin.SettingChanged += delegate { mine.m_dropItems.m_dropMin = Plugin._blackMetalMineDropMin.Value; }; mine.m_dropItems.m_dropMin = Plugin._blackMetalMineDropMin.Value; Plugin._blackMetalMineDropMax.SettingChanged += delegate { mine.m_dropItems.m_dropMax = Plugin._blackMetalMineDropMax.Value; }; mine.m_dropItems.m_dropMax = Plugin._blackMetalMineDropMax.Value; } } Door componentInChildren = _blackMetalMine01.GetComponentInChildren<Door>(true); if (!((Object)(object)componentInChildren == (Object)null)) { componentInChildren.m_keyItem = zNetScene.GetPrefab(StringExtensionMethods.GetStableHashCode("BOM_CrystalKey")).GetComponent<ItemDrop>(); componentInChildren.m_keyItem.m_itemData.m_shared.m_maxStackSize = ((Plugin._stackableKeys.Value != Plugin.Toggle.On) ? 1 : 10); } } private static void BlackMetalMine02(ZNetScene zNetScene) { //IL_0041: 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_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) MineRock[] componentsInChildren = _blackMetalMine02.GetComponentsInChildren<MineRock>(true); if (componentsInChildren != null) { MineRock[] array = componentsInChildren; foreach (MineRock mine in array) { mine.m_dropItems.m_drops = new List<DropData>(2) { new DropData { m_item = zNetScene.GetPrefab(StringExtensionMethods.GetStableHashCode("BlackMetalScrap")), m_stackMin = 1, m_stackMax = 1, m_weight = 0.85f }, new DropData { m_item = zNetScene.GetPrefab(StringExtensionMethods.GetStableHashCode("Stone")), m_stackMin = 1, m_stackMax = 1, m_weight = 1f } }; Plugin._blackMetalMineDropMin.SettingChanged += delegate { mine.m_dropItems.m_dropMin = Plugin._blackMetalMineDropMin.Value; }; mine.m_dropItems.m_dropMin = Plugin._blackMetalMineDropMin.Value; Plugin._blackMetalMineDropMax.SettingChanged += delegate { mine.m_dropItems.m_dropMax = Plugin._blackMetalMineDropMax.Value; }; mine.m_dropItems.m_dropMax = Plugin._blackMetalMineDropMax.Value; } } Door componentInChildren = _blackMetalMine02.GetComponentInChildren<Door>(true); if (!((Object)(object)componentInChildren == (Object)null)) { componentInChildren.m_keyItem = zNetScene.GetPrefab(StringExtensionMethods.GetStableHashCode("BOM_CrystalKey")).GetComponent<ItemDrop>(); componentInChildren.m_keyItem.m_itemData.m_shared.m_maxStackSize = ((Plugin._stackableKeys.Value != Plugin.Toggle.On) ? 1 : 10); } } private static void FlametalMine01(ZNetScene zNetScene) { //IL_0041: 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_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) MineRock[] componentsInChildren = _flametalMine01.GetComponentsInChildren<MineRock>(true); if (componentsInChildren != null) { MineRock[] array = componentsInChildren; foreach (MineRock mine in array) { mine.m_dropItems.m_drops = new List<DropData>(2) { new DropData { m_item = zNetScene.GetPrefab(StringExtensionMethods.GetStableHashCode("FlametalOreNew")), m_stackMin = 1, m_stackMax = 1, m_weight = 0.85f }, new DropData { m_item = zNetScene.GetPrefab(StringExtensionMethods.GetStableHashCode("Stone")), m_stackMin = 1, m_stackMax = 1, m_weight = 1f } }; Plugin._flametalMineDropMin.SettingChanged += delegate { mine.m_dropItems.m_dropMin = Plugin._flametalMineDropMin.Value; }; mine.m_dropItems.m_dropMin = Plugin._flametalMineDropMin.Value; Plugin._flametalMineDropMax.SettingChanged += delegate { mine.m_dropItems.m_dropMax = Plugin._flametalMineDropMax.Value; }; mine.m_dropItems.m_dropMax = Plugin._flametalMineDropMax.Value; } } Door componentInChildren = _flametalMine01.GetComponentInChildren<Door>(true); if (!((Object)(object)componentInChildren == (Object)null)) { componentInChildren.m_keyItem = zNetScene.GetPrefab(StringExtensionMethods.GetStableHashCode("BOM_LavaKey")).GetComponent<ItemDrop>(); componentInChildren.m_keyItem.m_itemData.m_shared.m_maxStackSize = ((Plugin._stackableKeys.Value != Plugin.Toggle.On) ? 1 : 10); } } private static void FlametalMine02(ZNetScene zNetScene) { //IL_0041: 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_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) MineRock[] componentsInChildren = _flametalMine02.GetComponentsInChildren<MineRock>(true); if (componentsInChildren != null) { MineRock[] array = componentsInChildren; foreach (MineRock mine in array) { mine.m_dropItems.m_drops = new List<DropData>(2) { new DropData { m_item = zNetScene.GetPrefab(StringExtensionMethods.GetStableHashCode("FlametalOreNew")), m_stackMin = 1, m_stackMax = 1, m_weight = 0.85f }, new DropData { m_item = zNetScene.GetPrefab(StringExtensionMethods.GetStableHashCode("Stone")), m_stackMin = 1, m_stackMax = 1, m_weight = 1f } }; Plugin._flametalMineDropMin.SettingChanged += delegate { mine.m_dropItems.m_dropMin = Plugin._flametalMineDropMin.Value; }; mine.m_dropItems.m_dropMin = Plugin._flametalMineDropMin.Value; Plugin._flametalMineDropMax.SettingChanged += delegate { mine.m_dropItems.m_dropMax = Plugin._flametalMineDropMax.Value; }; mine.m_dropItems.m_dropMax = Plugin._flametalMineDropMax.Value; } } Door componentInChildren = _flametalMine02.GetComponentInChildren<Door>(true); if (!((Object)(object)componentInChildren == (Object)null)) { componentInChildren.m_keyItem = zNetScene.GetPrefab(StringExtensionMethods.GetStableHashCode("BOM_LavaKey")).GetComponent<ItemDrop>(); componentInChildren.m_keyItem.m_itemData.m_shared.m_maxStackSize = ((Plugin._stackableKeys.Value != Plugin.Toggle.On) ? 1 : 10); } } } [HarmonyPatch] public class Patches { [HarmonyPostfix] [HarmonyPatch(typeof(ZNetScene), "Awake")] private static void Awake_Postfix(ZNetScene __instance) { MineSetup.InitMine(__instance); } [HarmonyPostfix] [HarmonyPatch(typeof(EnvMan), "OnMorning")] private static void OnMorning_Postfix(EnvMan __instance) { if (Plugin._enableReset.Value == Plugin.Toggle.Off) { return; } List<int> list = new List<int>(); for (int i = 1; i <= 1000 / Plugin._resetDay.Value; i++) { int item = Plugin._resetDay.Value * i; list.Add(item); } int currentDay = __instance.GetCurrentDay(); foreach (int item2 in list.Where((int num2) => num2 == currentDay)) { ResetMines(); Debug.Log((object)("Today is reset day! Current Day: " + currentDay + " / Reset Day: " + item2)); } } [HarmonyPrefix] [HarmonyPatch(typeof(Terminal), "InputText")] private static bool InputText_Prefix(Terminal __instance) { if (((TMP_InputField)__instance.m_input).text.TrimEnd(Array.Empty<char>()).ToLower() != "/mines reset") { return true; } ResetMines(); __instance.AddString("Resetting mines.. Done!"); return false; } private static void ResetMines() { DestroyAllVeins(); foreach (RandomSpawn[] item in from location in Location.s_allLocations where ((Object)((Component)location).gameObject).name.StartsWith("BOM_") && ((Object)((Component)location).gameObject).name.Contains("Mine") 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); foreach (Destructible val2 in componentsInChildren) { if (!((Object)(object)val2 == (Object)null)) { ((Component)val2).gameObject.SetActive(true); } } MineRock[] componentsInChildren2 = ((Component)val).GetComponentsInChildren<MineRock>(true); foreach (MineRock val3 in componentsInChildren2) { if (!((Object)(object)val3 == (Object)null)) { ((Component)val3).gameObject.SetActive(true); } } CreatureSpawner[] components = ((Component)val).GetComponents<CreatureSpawner>(); foreach (CreatureSpawner val4 in components) { if (!((Object)(object)val4 == (Object)null)) { ((Component)val4).gameObject.SetActive(true); val4.m_respawnTimeMinuts = 0f; } } val.m_chanceToSpawn = Plugin._oreSpawnChance.Value; val.Prepare(); bool spawned = Random.Range(0f, 100f) <= val.m_chanceToSpawn; val.SetSpawned(spawned); } } } private static void DestroyAllVeins() { foreach (RandomSpawn[] item in from location in Location.s_allLocations where ((Object)((Component)location).gameObject).name.StartsWith("BOM_") && ((Object)((Component)location).gameObject).name.Contains("Mine") 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); foreach (Destructible val2 in componentsInChildren) { if (!((Object)(object)val2 == (Object)null) && ((Behaviour)val2).isActiveAndEnabled) { ZNetScene.instance.Destroy(((Component)val2).gameObject); } } MineRock[] componentsInChildren2 = ((Component)val).GetComponentsInChildren<MineRock>(false); foreach (MineRock val3 in componentsInChildren2) { if (!((Object)(object)val3 == (Object)null) && ((Behaviour)val3).isActiveAndEnabled) { ZNetScene.instance.Destroy(((Component)val3).gameObject); } } } } } [HarmonyPostfix] [HarmonyPatch(typeof(Door), "Interact")] private static void Interact_Postfix(Door __instance, Humanoid character, ref bool __result) { Player localPlayer = Player.m_localPlayer; if (!__result || !Object.op_Implicit((Object)(object)character) == Object.op_Implicit((Object)(object)localPlayer)) { return; } ItemDrop keyItem = __instance.m_keyItem; if ((Object)(object)keyItem == (Object)null || (!keyItem.m_itemData.m_shared.m_name.StartsWith("$bom_") && !keyItem.m_itemData.m_shared.m_name.Contains("cryptkey")) || !__instance.HaveKey(character, true) || Plugin._consumableKeys.Value != Plugin.Toggle.On) { return; } Inventory inventory = character.GetInventory(); string name = __instance.m_name; if (name == null) { return; } switch (name.Length) { case 17: switch (name[5]) { default: return; case 'c': if (!(name == "$bom_coalminegate")) { return; } break; case 'i': if (!(name == "$bom_ironminegate")) { return; } break; } inventory.RemoveItem("$item_cryptkey", 1, -1, true); break; case 19: switch (name[5]) { default: return; case 'c': break; case 's': if (name == "$bom_silverminegate") { inventory.RemoveItem("$bom_bonemasskey", 1, -1, true); } return; } if (!(name == "$bom_copperminegate")) { break; } goto IL_0161; case 16: if (!(name == "$bom_tinminegate")) { break; } goto IL_0161; case 23: if (name == "$bom_blackmetalminegate") { inventory.RemoveItem("$bom_crystalkey", 1, -1, true); } break; case 21: if (name == "$bom_flametalminegate") { inventory.RemoveItem("$bom_lavakey", 1, -1, true); } break; case 18: case 20: case 22: break; IL_0161: inventory.RemoveItem("$bom_eikthyrkey", 1, -1, true); break; } } } 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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Expected O, but got Unknown GOToSwap = new List<GameObject>(); new Harmony("blacks7ar.utilities.ShaderReplacer").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>(); foreach (Shader val in array) { if (((Object)item.shader).name == ((Object)val).name) { item.shader = val; } } } } } } namespace ItemManager { [PublicAPI] public 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, Custom } [PublicAPI] public enum ConversionPiece { Disabled, [InternalName("smelter")] Smelter, [InternalName("charcoal_kiln")] CharcoalKiln, [InternalName("blastfurnace")] BlastFurnace, [InternalName("windmill")] Windmill, [InternalName("piece_spinningwheel")] SpinningWheel, [InternalName("eitrrefinery")] EitrRefinery, Custom } public class InternalName : Attribute { public readonly string internalName; public InternalName(string internalName) { this.internalName = internalName; } } [PublicAPI] public 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] public 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] public 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] public class Trade { public Trader Trader; public uint Price; public uint Stack = 1u; public string? RequiredGlobalKey; } [PublicAPI] [Flags] public enum Trader { None = 0, Haldor = 1, Hildir = 2 } public 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; } public struct CraftingStationConfig { public CraftingTable Table; public int level; public string? custom; } [Flags] public enum Configurability { Disabled = 0, Recipe = 1, Stats = 2, Drop = 4, Trader = 8, Full = 0xF } [PublicAPI] public 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 ?? min), levelMultiplier = levelMultiplier }); } } public struct DropTarget { public string creature; public int min; public int max; public float chance; public bool levelMultiplier; } public enum Toggle { On = 1, Off = 0 } [PublicAPI] public 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 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(objectDB, 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 DropsFro