using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.IO.Compression; using System.Linq; using System.Reflection; 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 BepInEx.Logging; using Common; using HarmonyLib; using JetBrains.Annotations; using Jotunn; using Jotunn.Configs; using Jotunn.Entities; using Jotunn.Extensions; using Jotunn.Managers; using Jotunn.Utils; using Microsoft.CodeAnalysis; using More_World_Locations_AIO.Managers; using More_World_Locations_AIO.RPCs; using More_World_Locations_AIO.Shipments; using More_World_Locations_AIO.Shrines; using More_World_Locations_AIO.Traders; using More_World_Locations_AIO.Utils; using More_World_Locations_AIO.Waystones; using More_World_Locations_AIO.tutorials; using Newtonsoft.Json; using ServerSync; using SoftReferenceableAssets; using Splatform; using TMPro; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.Networking; using UnityEngine.SceneManagement; using UnityEngine.UI; using UpgradeWorld; using YamlDotNet.RepresentationModel; using YamlDotNet.Serialization; using YamlDotNet.Serialization.NamingConventions; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("More_World_Locations_AIO")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("warpalicious")] [assembly: AssemblyProduct("More_World_Locations_AIO")] [assembly: AssemblyCopyright("Copyright © 2022")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("E0E2F92E-557C-4A05-9D89-AA92A0BD75C4")] [assembly: AssemblyFileVersion("4.7.2")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("4.7.2.0")] [module: UnverifiableCode] 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; } } } namespace Common { public class AssetManager { public static AssetBundle assetBundle; public static string bundleName; public static void LoadAssetBundle() { assetBundle = AssetUtils.LoadAssetBundleFromResources(bundleName, Assembly.GetExecutingAssembly()); if ((Object)(object)assetBundle == (Object)null) { WarpLogger.Logger.LogError((object)("Failed to load asset bundle with name: " + bundleName)); } } } public class ConfigurationManager { public enum Toggle { On = 1, Off = 0 } } public static class CreatureManager { public static void SetupCreatures(LocationManager.LocationPosition position, string creatureListName, GameObject jotunnLocationContainer, int creatureCount, string creatureYAMLContent) { if (creatureCount != 0) { if (position == LocationManager.LocationPosition.Exterior) { List creatureList = CreateCreatureList(creatureListName, creatureCount, creatureYAMLContent); List exteriorCreatureSpawners = GetExteriorCreatureSpawners(jotunnLocationContainer); AddCreaturestoSpawnerList(exteriorCreatureSpawners, creatureList); } else { List creatureList2 = CreateCreatureList(creatureListName, creatureCount, creatureYAMLContent); List interiorCreatureSpawners = GetInteriorCreatureSpawners(jotunnLocationContainer); AddCreaturestoSpawnerList(interiorCreatureSpawners, creatureList2); } } } public static void SetupCreatures(string creatureListName, GameObject gameObject, string creatureYAMLContent) { Debug.Log((object)("Seting up creatures for location with name: " + ((Object)gameObject).name + " using creature list name: " + creatureListName)); int count = GetCreatureSpawners(gameObject).Count; if (count != 0) { List creatureList = CreateCreatureList(creatureListName, count, creatureYAMLContent); List creatureSpawners = GetCreatureSpawners(gameObject); AddCreaturestoSpawnerList(creatureSpawners, creatureList); } } public static List GetCreatureSpawners(GameObject gameObject) { return gameObject.GetComponentsInChildren().ToList(); } public static GameObject GetCreaturePrefab(string prefabName) { GameObject prefab = Cache.GetPrefab(prefabName); if ((Object)(object)prefab != (Object)null) { return prefab; } WarpLogger.Logger.LogError((object)("Prefab not found for name:" + prefabName)); return null; } public static void AddCreaturetoSpawner(CreatureSpawner creatureSpawner, string creaturePrefab) { GameObject creaturePrefab2 = GetCreaturePrefab(creaturePrefab); if ((Object)(object)creaturePrefab2 != (Object)null) { creatureSpawner.m_creaturePrefab = creaturePrefab2; WarpLogger.Logger.LogDebug((object)("Creature with name " + creaturePrefab + " was added to " + (object)creatureSpawner)); } else { WarpLogger.Logger.LogError((object)("Creature not found for name: " + creaturePrefab)); } } public static void AddCreaturestoSpawnerList(List CreatureSpawnerList, List CreatureList) { if (CreatureList.Count == 0) { return; } int num = 0; foreach (CreatureSpawner CreatureSpawner in CreatureSpawnerList) { string creaturePrefab = CreatureList[num % CreatureList.Count]; AddCreaturetoSpawner(CreatureSpawner, creaturePrefab); num++; } } public static List GetExteriorCreatureSpawners(GameObject location) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) List list = new List(); CreatureSpawner[] componentsInChildren = location.GetComponentsInChildren(); CreatureSpawner[] array = componentsInChildren; foreach (CreatureSpawner val in array) { if ((Object)(object)((Component)val).transform.parent != (Object)null && ((Component)val).transform.position.y <= 5000f) { list.Add(val); WarpLogger.Logger.LogDebug((object)("Exterior creature spawner found in " + ((object)location)?.ToString() + "with name: " + ((Object)val).name)); } } return list; } public static List GetInteriorCreatureSpawners(GameObject location) { //IL_0039: Unknown result type (might be due to invalid IL or missing references) List list = new List(); CreatureSpawner[] componentsInChildren = location.GetComponentsInChildren(); CreatureSpawner[] array = componentsInChildren; foreach (CreatureSpawner val in array) { if ((Object)(object)((Component)val).transform.parent != (Object)null && ((Component)val).transform.position.y >= 5000f) { list.Add(val); WarpLogger.Logger.LogDebug((object)("Interior creature spawner found in " + ((object)location)?.ToString() + " with name: " + ((Object)((Component)val).transform.parent).name)); } } return list; } public static List CreateCreatureList(string creatureListName, int creatureCount, string yamlContent) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Expected O, but got Unknown //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Expected O, but got Unknown //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Expected O, but got Unknown //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Expected O, but got Unknown List list = new List(); YamlStream val = new YamlStream(); val.Load((TextReader)new StringReader(yamlContent)); YamlMappingNode val2 = (YamlMappingNode)val.Documents[0].RootNode; if (((IDictionary)val2.Children).ContainsKey((YamlNode)new YamlScalarNode(creatureListName))) { YamlNode obj = ((IDictionary)val2.Children)[(YamlNode)new YamlScalarNode(creatureListName)]; YamlSequenceNode val3 = (YamlSequenceNode)(object)((obj is YamlSequenceNode) ? obj : null); int count = val3.Children.Count; int num = Random.Range(0, count - 1); for (int i = 0; i < creatureCount; i++) { int index = (num + i) % count; YamlScalarNode val4 = (YamlScalarNode)val3.Children[index]; list.Add(val4.Value); } } return list; } public static List CreateCreatureList(string creatureListName, string yamlContent) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Expected O, but got Unknown //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Expected O, but got Unknown //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Expected O, but got Unknown List list = new List(); YamlStream val = new YamlStream(); val.Load((TextReader)new StringReader(yamlContent)); YamlMappingNode val2 = (YamlMappingNode)val.Documents[0].RootNode; if (((IDictionary)val2.Children).ContainsKey((YamlNode)new YamlScalarNode(creatureListName))) { YamlNode obj = ((IDictionary)val2.Children)[(YamlNode)new YamlScalarNode(creatureListName)]; YamlSequenceNode val3 = (YamlSequenceNode)(object)((obj is YamlSequenceNode) ? obj : null); foreach (YamlNode child in val3.Children) { YamlScalarNode val4 = (YamlScalarNode)(object)((child is YamlScalarNode) ? child : null); if (val4 != null) { list.Add(val4.Value); } } } return list; } } public static class CreatureManager_v2 { public static void AddCreatureToSpawner(GameObject spawnerPrefab, List creaturePrefabs) { CreatureSpawner component = spawnerPrefab.GetComponent(); int index = Random.Range(0, creaturePrefabs.Count); component.m_creaturePrefab = creaturePrefabs[index]; } public static GameObject GetCreaturePrefab(string prefabName) { GameObject prefab = Cache.GetPrefab(prefabName); if ((Object)(object)prefab != (Object)null) { return prefab; } WarpLogger.Logger.LogError((object)("Prefab not found for name:" + prefabName)); return null; } public static List CreateCreatureList(string creatureListName, string yamlContent) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Expected O, but got Unknown //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Expected O, but got Unknown //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Expected O, but got Unknown List list = new List(); YamlStream val = new YamlStream(); val.Load((TextReader)new StringReader(yamlContent)); YamlMappingNode val2 = (YamlMappingNode)val.Documents[0].RootNode; if (((IDictionary)val2.Children).ContainsKey((YamlNode)new YamlScalarNode(creatureListName))) { YamlNode obj = ((IDictionary)val2.Children)[(YamlNode)new YamlScalarNode(creatureListName)]; YamlSequenceNode val3 = (YamlSequenceNode)(object)((obj is YamlSequenceNode) ? obj : null); foreach (YamlNode child in val3.Children) { YamlScalarNode val4 = (YamlScalarNode)(object)((child is YamlScalarNode) ? child : null); if (val4 != null) { list.Add(GetCreaturePrefab(val4.Value)); } } } return list; } } public class DebugUtils { public static void NullCheck(T obj, string name) where T : class { if (obj == null) { Debug.Log((object)(name + " is null")); } else { Debug.Log((object)(name + " is not null")); } } } public class LocationConfiguration { public ConfigEntry Quantity { get; set; } public ConfigEntry CreatureYaml { get; set; } public ConfigEntry CreatureList { get; set; } public ConfigEntry LootYaml { get; set; } public ConfigEntry LootList { get; set; } public ConfigEntry PickableItemYaml { get; set; } public ConfigEntry PickableItemList { get; set; } public LocationConfiguration(ConfigFile config, string locationName, int spawnQuantity) { Quantity = ConfigFileExtensions.BindConfigInOrder(config, locationName, "Spawn Quantity", spawnQuantity, "Amount of this location the game will attempt to place during world generation", true, true, true, (AcceptableValueBase)null, (Action)null, (ConfigurationManagerAttributes)null); } public LocationConfiguration(ConfigFile config, string locationName, int spawnQuantity, string customCreatureListName, string customLootListName) { Quantity = ConfigFileExtensions.BindConfigInOrder(config, locationName, "Spawn Quantity", spawnQuantity, "Amount of this location the game will attempt to place during world generation", true, true, true, (AcceptableValueBase)null, (Action)null, (ConfigurationManagerAttributes)null); CreatureYaml = ConfigFileExtensions.BindConfigInOrder(config, locationName, "Use Custom Creature YAML file", ConfigurationManager.Toggle.Off, "When Off, location will spawn default creatures. When On, location will select creatures from the list in the warpalicious.More_World_Locations_CreatureLists.yml file in the BepInEx config folder", true, true, true, (AcceptableValueBase)null, (Action)null, (ConfigurationManagerAttributes)null); CreatureList = ConfigFileExtensions.BindConfigInOrder(config, locationName, "Name of Creature List", customCreatureListName, "The name of the creature list to use from warpalicious.More_World_Locations_CreatureLists.yml file", true, true, true, (AcceptableValueBase)null, (Action)null, (ConfigurationManagerAttributes)null); LootYaml = ConfigFileExtensions.BindConfigInOrder(config, locationName, "Use Custom Loot YAML file", ConfigurationManager.Toggle.Off, "When Off, location will use default loot. When On, location will select loot from the list in the warpalicious.More_World_Locations_LootLists.yml file in the BepInEx config folder", true, true, true, (AcceptableValueBase)null, (Action)null, (ConfigurationManagerAttributes)null); LootList = ConfigFileExtensions.BindConfigInOrder(config, locationName, "Name of Loot List", customLootListName, "The name of the loot list to use from warpalicious.More_World_Locations_LootLists.yml file", true, true, true, (AcceptableValueBase)null, (Action)null, (ConfigurationManagerAttributes)null); } public LocationConfiguration(ConfigFile config, string locationName, int spawnQuantity, string customCreatureListName, string customLootListName, string pickableItemListName) { Quantity = ConfigFileExtensions.BindConfigInOrder(config, locationName, "Spawn Quantity", spawnQuantity, "Amount of this location the game will attempt to place during world generation", true, true, true, (AcceptableValueBase)null, (Action)null, (ConfigurationManagerAttributes)null); CreatureYaml = ConfigFileExtensions.BindConfigInOrder(config, locationName, "Use Custom Creature YAML file", ConfigurationManager.Toggle.Off, "When Off, location will spawn default creatures. When On, location will select creatures from the list in the warpalicious.More_World_Locations_CreatureLists.yml file in the BepInEx config folder", true, true, true, (AcceptableValueBase)null, (Action)null, (ConfigurationManagerAttributes)null); CreatureList = ConfigFileExtensions.BindConfigInOrder(config, locationName, "Name of Creature List", customCreatureListName, "The name of the creature list to use from warpalicious.More_World_Locations_CreatureLists.yml file", true, true, true, (AcceptableValueBase)null, (Action)null, (ConfigurationManagerAttributes)null); LootYaml = ConfigFileExtensions.BindConfigInOrder(config, locationName, "Use Custom Loot YAML file", ConfigurationManager.Toggle.Off, "When Off, location will use default loot. When On, location will select loot from the list in the warpalicious.More_World_Locations_LootLists.yml file in the BepInEx config folder", true, true, true, (AcceptableValueBase)null, (Action)null, (ConfigurationManagerAttributes)null); LootList = ConfigFileExtensions.BindConfigInOrder(config, locationName, "Name of Loot List", customLootListName, "The name of the loot list to use from warpalicious.More_World_Locations_LootLists.yml file", true, true, true, (AcceptableValueBase)null, (Action)null, (ConfigurationManagerAttributes)null); PickableItemYaml = ConfigFileExtensions.BindConfigInOrder(config, locationName, "Use Custom PickableItem YAML file", ConfigurationManager.Toggle.Off, "When Off, location will use default loot. When On, dungeon will select loot from list in the custom YAML file in BepinEx config folder", true, true, true, (AcceptableValueBase)null, (Action)null, (ConfigurationManagerAttributes)null); PickableItemList = ConfigFileExtensions.BindConfigInOrder(config, locationName, "Name of PickableItem List", pickableItemListName, "The name of the loot list to use from YAML file", true, true, true, (AcceptableValueBase)null, (Action)null, (ConfigurationManagerAttributes)null); } } public class LocationManager { public enum LocationPosition { Interior, Exterior } public static LocationManager instance; public static LocationManager Instance => instance ?? (instance = new LocationManager()); public static void AddLocation(AssetBundle assetBundle, string locationName, string creatureYAMLContent, string creatureListName, string lootYAMLContent, string lootListName, LocationConfig locationConfig) { //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Expected O, but got Unknown GameObject val = assetBundle.LoadAsset(locationName); GameObject val2 = ZoneManager.Instance.CreateLocationContainer(val); CreatureManager.SetupCreatures(creatureListName, val2, creatureYAMLContent); if (LootManager.isLootListVersion2(lootYAMLContent)) { List lootList = LootManager.ParseContainerYaml_v2(lootListName, lootYAMLContent); List locationsContainers = LootManager.GetLocationsContainers(val2); LootManager.SetupChestLoot(locationsContainers, lootList); } else { List lootList2 = LootManager.CreateLootList(lootListName, lootYAMLContent); List locationsContainers2 = LootManager.GetLocationsContainers(val2); LootManager.SetupChestLoot(locationsContainers2, lootList2); } CustomLocation val3 = new CustomLocation(val2, true, locationConfig); ZoneManager.Instance.AddCustomLocation(val3); } public static void AddLocation(AssetBundle assetBundle, string locationName, LocationConfiguration locationConfiguration, LocationConfig locationConfig, YAMLManager yamlManager) { //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Expected O, but got Unknown GameObject val = assetBundle.LoadAsset(locationName); GameObject val2 = ZoneManager.Instance.CreateLocationContainer(val); CreatureManager.SetupCreatures(locationConfiguration.CreatureList.Value, val2, yamlManager.GetCreatureYamlContent(locationConfiguration.CreatureYaml.Value)); if (LootManager.isLootListVersion2(yamlManager.GetLootYamlContent(locationConfiguration.LootYaml.Value))) { List lootList = LootManager.ParseContainerYaml_v2(locationConfiguration.LootList.Value, yamlManager.GetLootYamlContent(locationConfiguration.LootYaml.Value)); List locationsContainers = LootManager.GetLocationsContainers(val2); LootManager.SetupChestLoot(locationsContainers, lootList); } else { List lootList2 = LootManager.CreateLootList(locationConfiguration.LootList.Value, yamlManager.GetLootYamlContent(locationConfiguration.LootYaml.Value)); List locationsContainers2 = LootManager.GetLocationsContainers(val2); LootManager.SetupChestLoot(locationsContainers2, lootList2); } CustomLocation val3 = new CustomLocation(val2, true, locationConfig); ZoneManager.Instance.AddCustomLocation(val3); } public static void AddLocation(AssetBundle assetBundle, string locationName, LocationConfig locationConfig) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown GameObject val = assetBundle.LoadAsset(locationName); GameObject val2 = ZoneManager.Instance.CreateLocationContainer(val); CustomLocation val3 = new CustomLocation(val2, true, locationConfig); ZoneManager.Instance.AddCustomLocation(val3); } public static void AddLocation(AssetBundle assetBundle, string locationName, string lootYAMLContent, string lootListName, LocationConfig locationConfig) { //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown GameObject val = assetBundle.LoadAsset(locationName); GameObject val2 = ZoneManager.Instance.CreateLocationContainer(val); if (LootManager.isLootListVersion2(lootYAMLContent)) { List lootList = LootManager.ParseContainerYaml_v2(lootListName, lootYAMLContent); List locationsContainers = LootManager.GetLocationsContainers(val2); LootManager.SetupChestLoot(locationsContainers, lootList); } else { List lootList2 = LootManager.CreateLootList(lootListName, lootYAMLContent); List locationsContainers2 = LootManager.GetLocationsContainers(val2); LootManager.SetupChestLoot(locationsContainers2, lootList2); } CustomLocation val3 = new CustomLocation(val2, true, locationConfig); ZoneManager.Instance.AddCustomLocation(val3); } public static void AddLocation(GameObject locationGameObject, LocationConfig locationConfig) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown GameObject val = ZoneManager.Instance.CreateLocationContainer(locationGameObject); CustomLocation val2 = new CustomLocation(val, true, locationConfig); ZoneManager.Instance.AddCustomLocation(val2); } public static void AddEventLocation(AssetBundle assetBundle, string locationName, string creatureYAMLContent, string creatureListName, string lootYAMLContent, string lootListName, LocationConfig locationConfig) { //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Expected O, but got Unknown GameObject val = assetBundle.LoadAsset(locationName); GameObject val2 = ZoneManager.Instance.CreateLocationContainer(val); CreatureManager.SetupCreatures(creatureListName, val2, creatureYAMLContent); if (LootManager.isLootListVersion2(lootYAMLContent)) { List lootList = LootManager.ParseContainerYaml_v2(lootListName, lootYAMLContent); List locationsContainers = LootManager.GetLocationsContainers(val2); LootManager.SetupChestLoot(locationsContainers, lootList); } else { List lootList2 = LootManager.CreateLootList(lootListName, lootYAMLContent); List locationsContainers2 = LootManager.GetLocationsContainers(val2); LootManager.SetupChestLoot(locationsContainers2, lootList2); } GameObject gameObject = ((Component)ExposedGameObjectExtension.FindDeepChild(val2, "MWL_EventStone", (IterativeSearchType)1)).gameObject; if (!Object.op_Implicit((Object)(object)gameObject)) { WarpLogger.Logger.LogDebug((object)"Failed to find EventStone"); } gameObject.GetComponent().m_statusEffect = "GoblinShaman_shield"; CustomLocation val3 = new CustomLocation(val2, true, locationConfig); ZoneManager.Instance.AddCustomLocation(val3); } public static void AddLocation(string locationName, LocationConfiguration locationConfiguration, LocationConfig locationConfig, YAMLManager yamlManager) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown string locationName2 = locationName; LocationConfig locationConfig2 = locationConfig; SoftReference softReference = AssetManager.Instance.GetSoftReference(locationName2); AssetManager.Instance.ResolveMocksOnLoad(softReference.m_assetID, (Transform)null, (Action)delegate(Object resolvedObj) { CreatureDB.SetupCreatures(LocationCreatureMapping.GetCreatureListForLocation(locationName2), (GameObject)(object)((resolvedObj is GameObject) ? resolvedObj : null)); }); AssetManager.Instance.ResolveMocksOnLoad(softReference.m_assetID, (Transform)null, (Action)delegate(Object resolvedObj) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) LootDB.SetupLoot(locationConfig2.Biome, (GameObject)(object)((resolvedObj is GameObject) ? resolvedObj : null)); }); CustomLocation val = new CustomLocation(softReference, true, locationConfig2); ZoneManager.Instance.AddCustomLocation(val); } public static void AddLocation(string locationName, LocationConfig locationConfig) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: 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_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Expected O, but got Unknown SoftReference softReference = AssetManager.Instance.GetSoftReference(locationName); AssetManager.Instance.ResolveMocksOnLoad(softReference.m_assetID, (Transform)null, (Action)null); CustomLocation val = new CustomLocation(softReference, true, locationConfig); ZoneManager.Instance.AddCustomLocation(val); } } public static class LootManager_v2 { public static void SetupContainers(GameObject gameObject, string yamlContent) { List containers = GetContainers(gameObject); List drops = ParseContainerYAML(yamlContent); foreach (Container item in containers) { item.m_defaultItems.m_drops = drops; } } public static void SetupPickableItems(GameObject gameObject, string yamlContent, string listName) { List pickableItems = GetPickableItems(gameObject); List list = ParsePickableYaml(listName, yamlContent); RandomItem[] randomItemPrefabs = list.ToArray(); foreach (PickableItem item in pickableItems) { item.m_randomItemPrefabs = randomItemPrefabs; } } public static List ParseContainerYAML(string yamlContent) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) List list = new List(); IDeserializer val = new DeserializerBuilder().Build(); Dictionary>> dictionary = val.Deserialize>>>(yamlContent); foreach (List> value in dictionary.Values) { foreach (Dictionary item2 in value) { string text = item2["item"].ToString(); GameObject prefab = Cache.GetPrefab(text); if ((Object)(object)prefab != (Object)null) { DropData val2 = default(DropData); val2.m_item = prefab; val2.m_stackMin = int.Parse(item2["stackMin"].ToString()); val2.m_stackMax = int.Parse(item2["stackMax"].ToString()); val2.m_weight = float.Parse(item2["weight"].ToString()); val2.m_dontScale = false; DropData item = val2; list.Add(item); } } } return list; } public static List ParsePickableYaml(string pickablelootListName, string yamlContent) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) List list = new List(); IDeserializer val = new DeserializerBuilder().Build(); Dictionary>> dictionary = val.Deserialize>>>(yamlContent); if (dictionary.ContainsKey(pickablelootListName)) { WarpLogger.Logger.LogDebug((object)("Found loot list with name " + pickablelootListName + " in pickable list Yaml file")); foreach (Dictionary item2 in dictionary[pickablelootListName]) { string text = item2["item"].ToString(); GameObject prefab = Cache.GetPrefab(text); if ((Object)(object)prefab != (Object)null) { ItemDrop component = prefab.GetComponent(); if ((Object)(object)component != (Object)null) { RandomItem val2 = default(RandomItem); val2.m_itemPrefab = component; val2.m_stackMin = int.Parse(item2["stackMin"].ToString()); val2.m_stackMax = int.Parse(item2["stackMax"].ToString()); RandomItem item = val2; list.Add(item); WarpLogger.Logger.LogDebug((object)("Added item with name: " + text + " to pickable list " + pickablelootListName + " with stackMin: " + item.m_stackMin + ", stackMax: " + item.m_stackMax)); } } else { WarpLogger.Logger.LogWarning((object)("Prefab for item " + text + " not found.")); } } } else { WarpLogger.Logger.LogError((object)("Failed to find loot list with name: " + pickablelootListName + " in loot list Yaml file")); } return list; } public static List GetContainers(GameObject room) { return room.GetComponentsInChildren().ToList(); } public static List GetPickableItems(GameObject room) { return room.GetComponentsInChildren().ToList(); } } public class PieceManager { public static void ReplaceResourceDrops(CustomLocation location) { Piece[] componentsInChildren = location.Prefab.GetComponentsInChildren(); Piece[] array = componentsInChildren; foreach (Piece val in array) { if (!((Object)(object)((Component)val).transform.parent != (Object)null)) { continue; } WarpLogger.Logger.LogDebug((object)("Piece with name " + ((object)val)?.ToString() + " found in location with name: " + (object)location)); Requirement[] resources = val.m_resources; Requirement[] array2 = resources; foreach (Requirement val2 in array2) { if (val2 != null) { WarpLogger.Logger.LogDebug((object)("Resource with name " + ((object)val2)?.ToString() + " found in piece with name: " + ((Object)((Component)val).transform.parent).name)); } } } } } public static class TraderManager { public class TradeItemYAML { public string PrefabName { get; set; } public int Stack { get; set; } = 1; public int Price { get; set; } public string RequiredGlobalKey { get; set; } = ""; public string NotRequiredGlobalKey { get; set; } = ""; } public static Dictionary> buyItemLists = new Dictionary>(); public static void AddTraderBuyItems(GameObject locationContainer, List traderItems) { Trader componentInChildren = locationContainer.GetComponentInChildren(); if ((Object)(object)componentInChildren == (Object)null) { WarpLogger.Logger.LogWarning((object)("Failed to find Trader script in location with name: " + (object)locationContainer)); } else { componentInChildren.m_items = traderItems; } } public static void BuildBuyItemList(string traderItemYamlContent, string traderName) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Expected O, but got Unknown List list = new List(); IDeserializer val = ((BuilderSkeleton)new DeserializerBuilder()).WithNamingConvention(CamelCaseNamingConvention.Instance).Build(); Dictionary> dictionary = val.Deserialize>>(traderItemYamlContent); if (dictionary == null || !dictionary.ContainsKey(traderName)) { WarpLogger.Logger.LogWarning((object)("Parsed data is null or trader name: " + traderName + " does not exist in the YAML content.")); return; } List list2 = dictionary[traderName]; foreach (TradeItemYAML item2 in list2) { GameObject prefab = Cache.GetPrefab(item2.PrefabName); if ((Object)(object)prefab == (Object)null) { WarpLogger.Logger.LogWarning((object)("Failed to find prefab with name: " + item2.PrefabName)); continue; } ItemDrop component = prefab.GetComponent(); if ((Object)(object)component == (Object)null) { WarpLogger.Logger.LogWarning((object)("Failed to find ItemDrop component on prefab: " + item2.PrefabName)); continue; } TradeItem item = new TradeItem { m_prefab = component, m_stack = item2.Stack, m_price = item2.Price, m_requiredGlobalKey = item2.RequiredGlobalKey }; list.Add(item); Debug.Log((object)("Added item with name: " + item2.PrefabName + " to trader buy list with name: " + traderName)); } buyItemLists.Add(traderName, list); } } public class WarpLocation { public string LocationName { get; set; } public int SpawnQuantity { get; set; } public string CreatureYaml { get; set; } public string LootYaml { get; set; } public LocationConfiguration BepinExConfig { get; set; } public LocationConfig JotunnLocationConfig { get; set; } public WarpLocation(ConfigFile config, string locationName, int spawnQuantity, string creatureYaml, string lootYaml) { BepinExConfig = new LocationConfiguration(config, locationName, spawnQuantity, creatureYaml, lootYaml); } } public class WarpLogger { public static readonly ManualLogSource Logger = Logger.CreateLogSource("MoreWorldLocations"); } public class LootManager : MonoBehaviour { public static List CreateLootList(string lootListName, string yamlContent) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Expected O, but got Unknown //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Expected O, but got Unknown YamlStream val = new YamlStream(); val.Load((TextReader)new StringReader(yamlContent)); YamlMappingNode val2 = (YamlMappingNode)val.Documents[0].RootNode; List list = new List(); if (((IDictionary)val2.Children).ContainsKey((YamlNode)new YamlScalarNode(lootListName))) { WarpLogger.Logger.LogDebug((object)("Found loot list with name " + lootListName + " in loot list Yaml file")); YamlNode obj = ((IDictionary)val2.Children)[(YamlNode)new YamlScalarNode(lootListName)]; YamlSequenceNode val3 = (YamlSequenceNode)(object)((obj is YamlSequenceNode) ? obj : null); foreach (YamlNode item in val3) { YamlScalarNode val4 = (YamlScalarNode)(object)((item is YamlScalarNode) ? item : null); list.Add(val4.Value); WarpLogger.Logger.LogDebug((object)("Added item with name: " + ((object)item)?.ToString() + " to loot list with name " + lootListName)); } } else { WarpLogger.Logger.LogError((object)("Failed to find loot list with name: " + lootListName + " in loot list Yaml file")); } return list; } public static bool isLootListVersion2(string yamlContent) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected O, but got Unknown //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Expected O, but got Unknown YamlStream val = new YamlStream(); val.Load((TextReader)new StringReader(yamlContent)); YamlMappingNode val2 = (YamlMappingNode)val.Documents[0].RootNode; if (((IDictionary)val2.Children).ContainsKey((YamlNode)new YamlScalarNode("version"))) { YamlScalarNode val3 = (YamlScalarNode)((IDictionary)val2.Children)[(YamlNode)new YamlScalarNode("version")]; string value = val3.Value; if (value == "2.0") { WarpLogger.Logger.LogDebug((object)"Version is 2"); return true; } return false; } WarpLogger.Logger.LogDebug((object)"Version not found in YAML file"); return false; } public static List ParseContainerYaml_v1(string lootListName, string yamlContent) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Expected O, but got Unknown //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Expected O, but got Unknown YamlStream val = new YamlStream(); val.Load((TextReader)new StringReader(yamlContent)); YamlMappingNode val2 = (YamlMappingNode)val.Documents[0].RootNode; List list = new List(); if (((IDictionary)val2.Children).ContainsKey((YamlNode)new YamlScalarNode(lootListName))) { WarpLogger.Logger.LogDebug((object)("Found loot list with name " + lootListName + " in loot list Yaml file")); YamlNode obj = ((IDictionary)val2.Children)[(YamlNode)new YamlScalarNode(lootListName)]; YamlSequenceNode val3 = (YamlSequenceNode)(object)((obj is YamlSequenceNode) ? obj : null); foreach (YamlNode item in val3) { YamlScalarNode val4 = (YamlScalarNode)(object)((item is YamlScalarNode) ? item : null); list.Add(val4.Value); WarpLogger.Logger.LogDebug((object)("Added item with name: " + ((object)item)?.ToString() + " to loot list with name " + lootListName)); } } else { WarpLogger.Logger.LogError((object)("Failed to find loot list with name: " + lootListName + " in loot list Yaml file")); } return list; } public static List ParseContainerYaml_v2(string lootListName, string yamlContent) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) List list = new List(); string text = RemoveVersionFromYaml(yamlContent); IDeserializer val = new DeserializerBuilder().Build(); Dictionary>> dictionary = val.Deserialize>>>(text); if (dictionary.ContainsKey(lootListName)) { WarpLogger.Logger.LogDebug((object)("Found loot list with name " + lootListName + " in loot list Yaml file")); foreach (Dictionary item2 in dictionary[lootListName]) { string text2 = item2["item"].ToString(); GameObject prefab = Cache.GetPrefab(text2); if ((Object)(object)prefab != (Object)null) { if (!int.TryParse(item2["stackMin"].ToString(), NumberStyles.Integer, CultureInfo.InvariantCulture, out var result)) { result = 2; WarpLogger.Logger.LogWarning((object)("Failed to parse stackMin for item " + text2 + ". Defaulting to " + result)); } if (!int.TryParse(item2["stackMax"].ToString(), NumberStyles.Integer, CultureInfo.InvariantCulture, out var result2)) { result2 = 3; WarpLogger.Logger.LogWarning((object)("Failed to parse stackMax for item " + text2 + ". Defaulting to " + result2)); } if (!float.TryParse(item2["weight"].ToString(), NumberStyles.Float, CultureInfo.InvariantCulture, out var result3)) { result3 = 1f; WarpLogger.Logger.LogWarning((object)("Failed to parse weight for item " + text2 + ". Defaulting to " + result3)); } DropData val2 = default(DropData); val2.m_item = prefab; val2.m_stackMin = result; val2.m_stackMax = result2; val2.m_weight = result3; val2.m_dontScale = false; DropData item = val2; list.Add(item); WarpLogger.Logger.LogDebug((object)("Added item with name: " + text2 + " to loot list " + lootListName + " with stackMin: " + item.m_stackMin + ", stackMax: " + item.m_stackMax + ", weight: " + item.m_weight)); } else { WarpLogger.Logger.LogWarning((object)("Prefab for item " + text2 + " not found.")); } } } else { WarpLogger.Logger.LogError((object)("Failed to find loot list with name: " + lootListName + " in loot list Yaml file")); } return list; } private static string RemoveVersionFromYaml(string yamlContent) { string[] array = yamlContent.Split(new char[1] { '\n' }, StringSplitOptions.RemoveEmptyEntries); List list = new List(); bool flag = false; string[] array2 = array; foreach (string text in array2) { if (text.TrimStart(Array.Empty()).StartsWith("version")) { flag = true; } else { list.Add(text); } } if (flag) { WarpLogger.Logger.LogDebug((object)"Version key found and removed from YAML content."); } return string.Join("\n", list); } public static List GetLocationsContainers(GameObject location) { List list = new List(); Container[] componentsInChildren = location.GetComponentsInChildren(); if (componentsInChildren.Length != 0) { Container[] array = componentsInChildren; foreach (Container val in array) { list.Add(val); WarpLogger.Logger.LogDebug((object)("Container found in " + ((object)location)?.ToString() + "with name: " + ((Object)val).name)); } } return list; } public static List GetLocationsContainers(GameObject location, LocationManager.LocationPosition locationPosition) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) List list = new List(); Container[] componentsInChildren = location.GetComponentsInChildren(); Container[] array = componentsInChildren; foreach (Container val in array) { if (((Component)val).transform.position.y <= 5000f) { list.Add(val); WarpLogger.Logger.LogDebug((object)("Container found in " + ((object)location)?.ToString() + "with name: " + ((Object)val).name)); } } return list; } public static void SetupChestLoot(List containerList, List lootList) { foreach (Container container in containerList) { DropTable defaultItems = CreateDropTable(lootList, 2, 3); container.m_defaultItems = defaultItems; WarpLogger.Logger.LogDebug((object)("Container with name " + ((Object)container).name + " has received new dropTable")); } } public static void SetupChestLoot(List containerList, List lootList) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown DropTable val = new DropTable(); val.m_dropMin = 2; val.m_dropMax = 3; val.m_drops = lootList; if (containerList.Count == 0) { return; } foreach (Container container in containerList) { container.m_defaultItems = val; WarpLogger.Logger.LogDebug((object)("Container with name " + ((Object)container).name + " has received new dropTable")); } } public static List GetLocationsDropOnDestroyeds(GameObject location, LocationManager.LocationPosition locationPosition) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) List list = new List(); DropOnDestroyed[] componentsInChildren = location.GetComponentsInChildren(); DropOnDestroyed[] array = componentsInChildren; foreach (DropOnDestroyed val in array) { if (((Object)val).name.StartsWith("loot_drop") && ((Component)val).transform.position.y <= 5000f) { list.Add(val); WarpLogger.Logger.LogDebug((object)("DropOnDestroyed found in " + ((object)location)?.ToString() + "with name: " + ((Object)val).name)); } } if (list.Count > 0) { return list; } return null; } public static void SetupDropOnDestroyedLoot(List dropOnDestroyedList, List lootList) { foreach (DropOnDestroyed dropOnDestroyed in dropOnDestroyedList) { DropTable dropWhenDestroyed = CreateDropTable(lootList, 1, 2); dropOnDestroyed.m_dropWhenDestroyed = dropWhenDestroyed; } } public static DropTable CreateDropTable(List itemNames, int dropMin, int dropMax) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) DropTable val = new DropTable { m_dropMin = dropMin, m_dropMax = dropMax, m_dropChance = 1f, m_oneOfEach = true }; foreach (string itemName in itemNames) { WarpLogger.Logger.LogDebug((object)("Attempting to add item with name " + itemName)); GameObject prefab = Cache.GetPrefab(itemName); if ((Object)(object)prefab != (Object)null) { DropData val2 = default(DropData); val2.m_item = prefab; val2.m_stackMin = 2; val2.m_stackMax = 4; val2.m_weight = 1f; val2.m_dontScale = false; DropData item = val2; val.m_drops.Add(item); WarpLogger.Logger.LogDebug((object)("Added item with name " + itemName)); } else { WarpLogger.Logger.LogError((object)("Prefab for " + itemName + " not found")); } } return val; } public static void AddContainerToChild(GameObject parentGameObject, string childName, DropTable dropTable) { Transform val = parentGameObject.transform.Find(childName); if ((Object)(object)val != (Object)null) { Container val2 = ((Component)val).gameObject.AddComponent(); if ((Object)(object)val2 != (Object)null) { val2.m_defaultItems = dropTable; val2.m_name = "Chest"; val2.m_width = 4; val2.m_height = 2; } } else { WarpLogger.Logger.LogError((object)("Child GameObject (" + childName + ") not found in parent GameObject (" + ((object)parentGameObject)?.ToString() + ")")); } } } public class YAMLManager { public enum Toggle { On = 1, Off = 0 } public string creatureYAMLContent; public string lootYAMLContent; public string defaultCreatureYamlContent; public string customCreatureYamlContent; public Dictionary> creatureListDictionary = new Dictionary>(); public string defaultlootYamlContent; public string customlootYamlContent; public Dictionary> lootListDictionary = new Dictionary>(); public string defaultPickableItemContent; public string customPickableItemContent; public List pickableList; public string defaultTraderYamlContent; public string customTraderYamlContent; public void ParseDefaultYamls() { defaultCreatureYamlContent = AssetUtils.LoadTextFromResources("warpalicious.More_World_Locations_CreatureLists.yml"); defaultlootYamlContent = AssetUtils.LoadTextFromResources("warpalicious.More_World_Locations_LootLists.yml"); } public void ParseCustomYamls(ConfigurationManager.Toggle useCustomLocationYAML) { string path = Path.Combine(Paths.ConfigPath, "warpalicious.More_World_Locations_CreatureLists.yml"); string path2 = Path.Combine(Paths.ConfigPath, "warpalicious.More_World_Locations_LootLists.yml"); if (File.Exists(path)) { try { customCreatureYamlContent = File.ReadAllText(path); WarpLogger.Logger.LogInfo((object)"Successfully loaded warpalicious.More_World_Locations_CreatureLists.yml from BepInEx config folder"); } catch (Exception ex) { WarpLogger.Logger.LogError((object)("Failed to load custom creature YAML: " + ex.Message)); } } if (File.Exists(path2)) { try { customlootYamlContent = File.ReadAllText(path2); WarpLogger.Logger.LogInfo((object)"Successfully loaded warpalicious.More_World_Locations_LootLists.yml from BepInEx config folder"); } catch (Exception ex2) { WarpLogger.Logger.LogError((object)("Failed to load custom loot YAML: " + ex2.Message)); } } } public void ParseCreatureYaml(string filename) { defaultCreatureYamlContent = AssetUtils.LoadTextFromResources(filename + "_CreatureLists.yml"); string path = Path.Combine(Paths.ConfigPath, filename + "_CreatureLists.yml"); if (File.Exists(path)) { customCreatureYamlContent = File.ReadAllText(path); WarpLogger.Logger.LogInfo((object)("Successfully loaded + " + filename + "_CreatureLists.yml file from BepinEx config folder")); } } public void ParseTraderYaml(string filename, ConfigurationManager.Toggle useCustomTraderYaml) { defaultTraderYamlContent = AssetUtils.LoadTextFromResources(filename); string path = Path.Combine(Paths.ConfigPath, filename); if (useCustomTraderYaml == ConfigurationManager.Toggle.On && !File.Exists(path)) { try { File.WriteAllText(path, defaultTraderYamlContent); WarpLogger.Logger.LogInfo((object)("Auto-extracted " + filename + " to BepInEx config folder")); } catch (Exception ex) { WarpLogger.Logger.LogError((object)("Failed to extract " + filename + ": " + ex.Message)); } } if (File.Exists(path)) { try { customTraderYamlContent = File.ReadAllText(path); WarpLogger.Logger.LogInfo((object)("Successfully loaded " + filename + " from BepInEx config folder")); } catch (Exception ex2) { WarpLogger.Logger.LogError((object)("Failed to load custom trader YAML: " + ex2.Message)); } } } public void ParseContainerYaml(string filename) { defaultlootYamlContent = AssetUtils.LoadTextFromResources(filename + "_ContainerLists.yml"); string path = Path.Combine(Paths.ConfigPath, filename + "_ContainerLists.yml"); if (File.Exists(path)) { customlootYamlContent = File.ReadAllText(path); WarpLogger.Logger.LogInfo((object)("Successfully loaded + " + filename + "_ContainerLists.yml file from BepinEx config folder")); } } public void ParsePickableItemYaml(string filename) { defaultPickableItemContent = AssetUtils.LoadTextFromResources(filename + "_PickableItemLists.yml"); string path = Path.Combine(Paths.ConfigPath, filename + "_PickableItemLists.yml"); if (File.Exists(path)) { customPickableItemContent = File.ReadAllText(path); WarpLogger.Logger.LogInfo((object)("Successfully loaded + " + filename + "_PickableItemLists.yml file from BepinEx config folder")); } } public string GetCreatureYamlContent(ConfigurationManager.Toggle useCustomCreatureYaml) { if (useCustomCreatureYaml == ConfigurationManager.Toggle.On && !string.IsNullOrEmpty(customCreatureYamlContent)) { return customCreatureYamlContent; } return defaultCreatureYamlContent; } public string GetLootYamlContent(ConfigurationManager.Toggle useCustomLootYaml) { if (useCustomLootYaml == ConfigurationManager.Toggle.On && !string.IsNullOrEmpty(customlootYamlContent)) { return customlootYamlContent; } return defaultlootYamlContent; } public string GetPickableItemContent(ConfigurationManager.Toggle useCustomPickableItemYAML) { if (useCustomPickableItemYAML == ConfigurationManager.Toggle.On) { return customPickableItemContent; } return defaultPickableItemContent; } public string GetTraderYamlContent(ConfigurationManager.Toggle useCustomTraderYaml) { if (useCustomTraderYaml == ConfigurationManager.Toggle.On && !string.IsNullOrEmpty(customTraderYamlContent)) { return customTraderYamlContent; } return defaultTraderYamlContent; } public void BuildCreatureLists(ConfigurationManager.Toggle useCustomCreatureYAML, string creatureListName) { if (useCustomCreatureYAML == ConfigurationManager.Toggle.On) { List value = CreatureManager_v2.CreateCreatureList(creatureListName, customCreatureYamlContent); creatureListDictionary.Add(creatureListName, value); } else { List value2 = CreatureManager_v2.CreateCreatureList(creatureListName, defaultCreatureYamlContent); creatureListDictionary.Add(creatureListName, value2); } } public void BuildLootList(ConfigurationManager.Toggle useCustomLootYAML, string lootListName) { if (useCustomLootYAML == ConfigurationManager.Toggle.On) { List value = LootManager.ParseContainerYaml_v2(lootListName, customlootYamlContent); lootListDictionary.Add(lootListName, value); } else { List value2 = LootManager.ParseContainerYaml_v2(lootListName, defaultlootYamlContent); lootListDictionary.Add(lootListName, value2); } } public void BuildPickableList(ConfigurationManager.Toggle useCustomPickableYAML, string pickableListName) { if (useCustomPickableYAML == ConfigurationManager.Toggle.On) { pickableList = LootManager_v2.ParsePickableYaml(pickableListName, customPickableItemContent); } else { pickableList = LootManager_v2.ParsePickableYaml(pickableListName, defaultPickableItemContent); } } } public static class Analytics { [CompilerGenerated] private sealed class d__3 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public string modId; public string modVersion; public string instanceId; private string 5__1; private byte[] 5__2; private UnityWebRequest 5__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__3(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { int num = <>1__state; if (num == -3 || num == 1) { try { } finally { <>m__Finally1(); } } 5__1 = null; 5__2 = null; 5__3 = null; <>1__state = -2; } private bool MoveNext() { //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Expected O, but got Unknown //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Expected O, but got Unknown //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Expected O, but got Unknown //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Invalid comparison between Unknown and I4 bool result; try { switch (<>1__state) { default: result = false; break; case 0: <>1__state = -1; 5__1 = "{\"mod_id\":\"" + Escape(modId) + "\",\"mod_version\":\"" + Escape(modVersion) + "\",\"instance_id\":\"" + Escape(instanceId) + "\"}"; 5__2 = Encoding.UTF8.GetBytes(5__1); 5__3 = new UnityWebRequest("https://mod-analytics.vercel.app/api/ping", "POST"); <>1__state = -3; 5__3.uploadHandler = (UploadHandler)new UploadHandlerRaw(5__2); 5__3.downloadHandler = (DownloadHandler)new DownloadHandlerBuffer(); 5__3.SetRequestHeader("Content-Type", "application/json"); 5__3.timeout = 10; <>2__current = 5__3.SendWebRequest(); <>1__state = 1; result = true; break; case 1: <>1__state = -3; if ((int)5__3.result == 1) { WarpLogger.Logger.LogDebug((object)"Analytics ping sent"); } else { WarpLogger.Logger.LogDebug((object)("Analytics ping failed: " + 5__3.error)); } result = false; <>m__Finally1(); break; } } catch { //try-fault ((IDisposable)this).Dispose(); throw; } return result; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } private void <>m__Finally1() { <>1__state = -1; if (5__3 != null) { ((IDisposable)5__3).Dispose(); } } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private const string PingUrl = "https://mod-analytics.vercel.app/api/ping"; private static bool _hasSentPing; public static void Init(ConfigFile config, string modId, string modVersion) { if (!_hasSentPing) { ConfigEntry val = config.Bind("Analytics", "Enabled", ConfigurationManager.Toggle.On, "Send a single anonymous ping when the game starts. No gameplay data is collected."); ConfigEntry val2 = config.Bind("Analytics", "InstanceID", Guid.NewGuid().ToString(), "Random anonymous ID. Change or delete to reset."); if (val.Value == ConfigurationManager.Toggle.Off) { WarpLogger.Logger.LogDebug((object)"Analytics disabled by config"); return; } _hasSentPing = true; ((MonoBehaviour)ThreadingHelper.Instance).StartCoroutine(SendPing(modId, modVersion, val2.Value)); } } [IteratorStateMachine(typeof(d__3))] private static IEnumerator SendPing(string modId, string modVersion, string instanceId) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__3(0) { modId = modId, modVersion = modVersion, instanceId = instanceId }; } private static string Escape(string s) { return s.Replace("\\", "\\\\").Replace("\"", "\\\""); } } } namespace UpgradeWorld { public class CommandRegistration { public string name = ""; public string description = ""; public string[] commands = new string[0]; public void AddCommand() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown //IL_0022: Unknown result type (might be due to invalid IL or missing references) new ConsoleCommand(name, description, (ConsoleEvent)delegate(ConsoleEventArgs args) { string[] array = commands; foreach (string text in array) { args.Context.TryRunCommand(text, false, false); } }, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false); } } public static class Upgrade { private static List registrations = new List(); public const string GUID = "upgrade_world"; private static bool Patched = false; public static void Register(string name, string description, params string[] commands) { if (Chainloader.PluginInfos.ContainsKey("upgrade_world")) { PatchIfNeeded(); registrations.Add(new CommandRegistration { name = name, description = description, commands = commands }); } } private static void PatchIfNeeded() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Expected O, but got Unknown if (!Patched) { Patched = true; Harmony val = new Harmony("helpers.upgrade_world"); MethodInfo methodInfo = AccessTools.Method(typeof(Terminal), "InitTerminal", (Type[])null, (Type[])null); MethodInfo methodInfo2 = AccessTools.Method(typeof(Upgrade), "AddCommands", (Type[])null, (Type[])null); val.Patch((MethodBase)methodInfo, (HarmonyMethod)null, new HarmonyMethod(methodInfo2), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } } private static void AddCommands() { foreach (CommandRegistration registration in registrations) { registration.AddCommand(); } } } } namespace More_World_Locations_AIO { public static class MWLLocalizations { private const string LocalizationFileName = "warpalicious.More_World_Locations_Localization"; public static void Load(PortInit.Toggle useCustom) { CustomLocalization localization = LocalizationManager.Instance.GetLocalization(); string text = AssetUtils.LoadTextFromResources("warpalicious.More_World_Locations_Localization.yml"); localization.AddYamlFile("English", text); if (useCustom != PortInit.Toggle.On) { return; } string[] files = Directory.GetFiles(Paths.ConfigPath, "warpalicious.More_World_Locations_Localization.*.yml"); if (files.Length == 0) { string path = Path.Combine(Paths.ConfigPath, "warpalicious.More_World_Locations_Localization.English.yml"); try { File.WriteAllText(path, text); More_World_Locations_AIOPlugin.More_World_Locations_AIOLogger.LogInfo((object)"Auto-extracted warpalicious.More_World_Locations_Localization.English.yml to BepInEx config folder"); return; } catch (Exception ex) { More_World_Locations_AIOPlugin.More_World_Locations_AIOLogger.LogError((object)("Failed to extract localization YAML: " + ex.Message)); return; } } string[] array = files; foreach (string path2 in array) { string text2 = Path.GetFileNameWithoutExtension(path2).Substring("warpalicious.More_World_Locations_Localization".Length + 1); string text3 = File.ReadAllText(path2); localization.AddYamlFile(text2, text3); } } } public class AssetBundles { [HarmonyPatch(typeof(EntryPointSceneLoader), "Start")] public static class EntryPatch { public static void Prefix() { string manifest = GetManifest(); if (manifest != null) { Runtime.AddManifest(manifest); } } } public static string manifestFull = "assetBundleManifest_Full"; public static string manifestLower = "assetBundleManifest_full"; public static string manifestPath = Path.Combine(Paths.PluginPath, "warpalicious-More_World_Locations_AIO", manifestFull); public static string GetManifest() { string location = Assembly.GetExecutingAssembly().Location; string directoryName = Path.GetDirectoryName(location); string[] files = Directory.GetFiles(directoryName); string[] array = files; foreach (string text in array) { if (text.EndsWith(manifestFull, StringComparison.OrdinalIgnoreCase)) { Debug.Log((object)("Found manifest file: " + text)); manifestPath = text; } else if (text.EndsWith(manifestLower, StringComparison.OrdinalIgnoreCase)) { Debug.Log((object)("Found manifest file: " + text)); manifestPath = text; } } return manifestPath; } public static void BuildCombinedManifest(string bundleFolder, string suffix, string[] assetPathsInBundleFull) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Expected O, but got Unknown //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) Debug.Log((object)("Building combined manifest from folder: " + bundleFolder)); string text = Path.Combine(Paths.PluginPath, "assetBundleManifest_" + suffix); string text2 = "./Bundles"; AssetBundleManifest val = new AssetBundleManifest(text2); string[] array = (from f in Directory.GetFiles(bundleFolder, "*", SearchOption.TopDirectoryOnly) where !f.EndsWith(".manifest", StringComparison.OrdinalIgnoreCase) select f).ToArray(); string[] array2 = array; AssetLocation val3 = default(AssetLocation); foreach (string text3 in array2) { string fileName = Path.GetFileName(text3); string path = text3 + ".manifest"; Debug.Log((object)("Processing bundle: " + fileName)); foreach (string text4 in assetPathsInBundleFull) { if (text4.EndsWith(".prefab", StringComparison.OrdinalIgnoreCase)) { string value = Path.GetFileNameWithoutExtension(text4).ToLower(); if (fileName.StartsWith(value, StringComparison.OrdinalIgnoreCase)) { AssetID val2 = AssetManager.Instance.GenerateAssetID(text4); ((AssetLocation)(ref val3))..ctor(fileName, text4); val.AddAssetLocation(val2, val3); Debug.Log((object)(" Added " + text4 + " to bundle " + fileName)); } } } if (File.Exists(path)) { string[] array3 = ExtractDependenciesFromTextManifest(path); val.AddBundleDependencies(fileName, array3); } } val.SerializeToDisk(text, (SerializationFormat)1); Debug.Log((object)("Combined manifest written to " + text)); } private static string[] ExtractDependenciesFromTextManifest(string manifestPath) { if (!File.Exists(manifestPath)) { Debug.LogWarning((object)("Manifest file not found: " + manifestPath)); return new string[0]; } try { string[] array = File.ReadAllLines(manifestPath); bool flag = false; List list = new List(); string[] array2 = array; foreach (string text in array2) { if (text.StartsWith("Dependencies:")) { flag = true; } else if (flag && text.StartsWith("- ")) { string path = text.Substring(2).Trim(); string fileName = Path.GetFileName(path); list.Add(fileName); } else if (flag && !text.StartsWith("- ") && !string.IsNullOrWhiteSpace(text)) { break; } } Debug.Log((object)string.Format("Found {0} dependencies: {1}", list.Count, string.Join(", ", list))); return list.ToArray(); } catch (Exception ex) { Debug.LogError((object)("Failed to parse manifest file " + manifestPath + ": " + ex.Message)); return new string[0]; } } } public class BepinexConfigs { public static ConfigFile Config; public static ConfigEntry EnableShrines; public static ConfigEntry EnableWaystones; public static ConfigEntry EnableTraders; public static ConfigEntry EnableTrainers; public static ConfigEntry UseCustomTraderConfigs; public static ConfigEntry UseCustomLocationYAML; public static ConfigEntry UseCustomLocalization; public static void BindFeatureConfigs() { EnableShrines = ConfigFileExtensions.BindConfig(PortInit.plugin.Config, "0 - Features", "Enable Shrines", PortInit.Toggle.On, "If Off, shrine ward objects will be destroyed on load", true, (int?)null, (AcceptableValueBase)null, (Action)null, (ConfigurationManagerAttributes)null); EnableWaystones = ConfigFileExtensions.BindConfig(PortInit.plugin.Config, "0 - Features", "Enable Waystones", PortInit.Toggle.On, "If Off, waystone ward objects will be destroyed on load", true, (int?)null, (AcceptableValueBase)null, (Action)null, (ConfigurationManagerAttributes)null); EnableTraders = ConfigFileExtensions.BindConfig(PortInit.plugin.Config, "0 - Features", "Enable Traders", PortInit.Toggle.On, "If Off, trader locations (taverns, blacksmiths, material vendors) will not spawn", true, (int?)null, (AcceptableValueBase)null, (Action)null, (ConfigurationManagerAttributes)null); EnableTrainers = ConfigFileExtensions.BindConfig(PortInit.plugin.Config, "0 - Features", "Enable Trainers", PortInit.Toggle.On, "If Off, trainer locations (skill book vendors) will not spawn", true, (int?)null, (AcceptableValueBase)null, (Action)null, (ConfigurationManagerAttributes)null); UseCustomTraderConfigs = ConfigFileExtensions.BindConfig(PortInit.plugin.Config, "0 - Features", "Use Custom Trader Configs", PortInit.Toggle.Off, "If On, uses warpalicious.More_World_Locations_TraderItems.yml from config folder. Auto-extracts default if missing.", true, (int?)null, (AcceptableValueBase)null, (Action)null, (ConfigurationManagerAttributes)null); UseCustomLocationYAML = ConfigFileExtensions.BindConfig(PortInit.plugin.Config, "0 - Features", "Use Custom Location YAML", PortInit.Toggle.Off, "If On, location spawn quantities will be loaded from warpalicious.More_World_Locations_LocationConfigs.yml in BepInEx config folder. Auto-extracts defaults if missing.", true, (int?)null, (AcceptableValueBase)null, (Action)null, (ConfigurationManagerAttributes)null); UseCustomLocalization = ConfigFileExtensions.BindConfig(PortInit.plugin.Config, "0 - Features", "Use Custom Localization", PortInit.Toggle.Off, "If On, loads localization YAML files from BepInEx config folder. Place warpalicious.More_World_Locations_Localization.{Language}.yml in config folder. Auto-extracts English template if missing.", false, (int?)null, (AcceptableValueBase)null, (Action)null, (ConfigurationManagerAttributes)null); } } public static class LocationDB { public static readonly MWLLocation[] All; private static readonly Dictionary _byName; static LocationDB() { All = LocationDefinitions.Meadows.Concat(LocationDefinitions.BlackForest).Concat(LocationDefinitions.Swamp).Concat(LocationDefinitions.Mountains) .Concat(LocationDefinitions.Plains) .Concat(LocationDefinitions.Mistlands) .Concat(LocationDefinitions.Ashlands) .Concat(LocationDefinitions.Ports) .Concat(LocationDefinitions.Traders) .Concat(LocationDefinitions.Trainers) .ToArray(); _byName = All.ToDictionary((MWLLocation l) => l.Name); } public static void RegisterAll() { Register(LocationDefinitions.Meadows); Register(LocationDefinitions.BlackForest); Register(LocationDefinitions.Swamp); Register(LocationDefinitions.Mountains); Register(LocationDefinitions.Plains); Register(LocationDefinitions.Mistlands); Register(LocationDefinitions.Ashlands); if (PortInit.EnablePortLocations.Value != 0) { Register(LocationDefinitions.Ports); } if (BepinexConfigs.EnableTraders.Value != 0) { Register(LocationDefinitions.Traders); } if (BepinexConfigs.EnableTrainers.Value != 0) { Register(LocationDefinitions.Trainers); } ZoneManager.OnVanillaLocationsAvailable -= RegisterAll; } public static MWLLocation GetLocation(string name) { MWLLocation value; return _byName.TryGetValue(name, out value) ? value : null; } public static LocationConfig GetLocationConfig(string name) { MWLLocation value; return _byName.TryGetValue(name, out value) ? value.Config : null; } public static string[] GetAllAssetPaths() { return All.Select((MWLLocation l) => l.AssetPath).ToArray(); } public static string[] GetLocationNames(Biome biome) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) return (from l in All where l.Config.Biome == biome select l.Name).ToArray(); } private static void Register(MWLLocation[] pack) { foreach (MWLLocation mWLLocation in pack) { mWLLocation.Register(); } } } public static class LocationDefinitions { public struct LocationRing { public int MinDistance { get; set; } public int MaxDistance { get; set; } public LocationRing(int minDistance, int maxDistance) { MinDistance = minDistance; MaxDistance = maxDistance; } } public static class LocationRings { public static LocationRing Ring1 { get; set; } = new LocationRing(0, 500); public static LocationRing Ring2 { get; set; } = new LocationRing(500, 2000); public static LocationRing Ring3 { get; set; } = new LocationRing(1500, 3000); public static LocationRing Ring4 { get; set; } = new LocationRing(2500, 4000); public static LocationRing Ring5 { get; set; } = new LocationRing(3500, 6000); public static LocationRing Ring6 { get; set; } = new LocationRing(4500, 8500); public static LocationRing Ring7 { get; set; } = new LocationRing(5000, 10500); } public static readonly MWLLocation[] Meadows = new MWLLocation[28] { new MWLLocation { Name = "MWL_Ruins1", AssetPath = "Assets/WarpProjects/More World Locations/Meadows/MWL_Ruins1.prefab", Config = new LocationConfig { Biome = (Biome)1, Priotized = true, ExteriorRadius = 8f, ClearArea = true, RandomRotation = false, Group = "Ruins_small", MinDistanceFromSimilar = 256f, MaxTerrainDelta = 2f, MinAltitude = 1f, MinDistance = LocationRings.Ring1.MinDistance, MaxDistance = LocationRings.Ring1.MaxDistance, InForest = false } }, new MWLLocation { Name = "MWL_Ruins2", AssetPath = "Assets/WarpProjects/More World Locations/Meadows/MWL_Ruins2.prefab", Config = new LocationConfig { Biome = (Biome)1, Priotized = true, ExteriorRadius = 8f, ClearArea = true, RandomRotation = false, Group = "Ruins_medium", MinDistanceFromSimilar = 512f, MaxTerrainDelta = 3f, MinAltitude = 1f, MinDistance = LocationRings.Ring2.MinDistance, MaxDistance = LocationRings.Ring2.MaxDistance, InForest = false } }, new MWLLocation { Name = "MWL_Ruins3", AssetPath = "Assets/WarpProjects/More World Locations/Meadows/MWL_Ruins3.prefab", Config = new LocationConfig { Biome = (Biome)1, Priotized = true, ExteriorRadius = 8f, ClearArea = true, RandomRotation = false, Group = "Ruins_small", MinDistanceFromSimilar = 256f, MaxTerrainDelta = 3f, MinAltitude = 1f, MinDistance = LocationRings.Ring1.MinDistance, MaxDistance = LocationRings.Ring1.MaxDistance, InForest = false } }, new MWLLocation { Name = "MWL_Ruins6", AssetPath = "Assets/WarpProjects/More World Locations/Meadows/MWL_Ruins6.prefab", Config = new LocationConfig { Biome = (Biome)1, Priotized = true, ExteriorRadius = 14f, ClearArea = true, RandomRotation = false, Group = "Ruins_small", MinDistanceFromSimilar = 256f, MaxTerrainDelta = 3f, MinAltitude = 1f, MinDistance = LocationRings.Ring3.MinDistance, MaxDistance = LocationRings.Ring3.MaxDistance, InForest = false } }, new MWLLocation { Name = "MWL_Ruins7", AssetPath = "Assets/WarpProjects/More World Locations/Meadows/MWL_Ruins7.prefab", Config = new LocationConfig { Biome = (Biome)1, Priotized = true, ExteriorRadius = 7f, ClearArea = true, RandomRotation = false, Group = "Ruins_medium", MinDistanceFromSimilar = 512f, MaxTerrainDelta = 5f, MinAltitude = 1f, MinDistance = LocationRings.Ring1.MinDistance, MaxDistance = LocationRings.Ring1.MaxDistance, InForest = false } }, new MWLLocation { Name = "MWL_Ruins8", AssetPath = "Assets/WarpProjects/More World Locations/Meadows/MWL_Ruins8.prefab", Config = new LocationConfig { Biome = (Biome)1, Priotized = true, ExteriorRadius = 11f, ClearArea = true, RandomRotation = false, Group = "Ruins_small", MinDistanceFromSimilar = 256f, MaxTerrainDelta = 5f, MinAltitude = 1f, MinDistance = LocationRings.Ring3.MinDistance, MaxDistance = LocationRings.Ring3.MaxDistance, InForest = false } }, new MWLLocation { Name = "MWL_RuinsArena1", AssetPath = "Assets/WarpProjects/More World Locations/Meadows/MWL_RuinsArena1.prefab", Config = new LocationConfig { Biome = (Biome)1, Priotized = true, ExteriorRadius = 20f, ClearArea = true, RandomRotation = false, Group = "Ruins_medium", MinDistanceFromSimilar = 512f, MaxTerrainDelta = 3f, MinAltitude = 1f, MinDistance = LocationRings.Ring3.MinDistance, MaxDistance = LocationRings.Ring3.MaxDistance, InForest = true, ForestTresholdMin = 1.2f, ForestTrasholdMax = 2f } }, new MWLLocation { Name = "MWL_RuinsArena3", AssetPath = "Assets/WarpProjects/More World Locations/Meadows/MWL_RuinsArena3.prefab", Config = new LocationConfig { Biome = (Biome)1, Priotized = true, ExteriorRadius = 15f, ClearArea = true, RandomRotation = false, Group = "Ruins_small", MinDistanceFromSimilar = 512f, MaxTerrainDelta = 3f, MinAltitude = 1f, MinDistance = LocationRings.Ring2.MinDistance, MaxDistance = LocationRings.Ring2.MaxDistance, InForest = true, ForestTresholdMin = 0f, ForestTrasholdMax = 1f } }, new MWLLocation { Name = "MWL_RuinsChurch1", AssetPath = "Assets/WarpProjects/More World Locations/Meadows/MWL_RuinsChurch1.prefab", Config = new LocationConfig { Biome = (Biome)1, Priotized = true, ExteriorRadius = 15f, ClearArea = true, RandomRotation = false, Group = "Ruins_medium", MinDistanceFromSimilar = 256f, MaxTerrainDelta = 3f, MinAltitude = 1f, MinDistance = LocationRings.Ring2.MinDistance, MaxDistance = LocationRings.Ring2.MaxDistance, InForest = true, ForestTresholdMin = 1.2f, ForestTrasholdMax = 2f } }, new MWLLocation { Name = "MWL_RuinsWell1", AssetPath = "Assets/WarpProjects/More World Locations/Meadows/MWL_RuinsWell1.prefab", Config = new LocationConfig { Biome = (Biome)1, Priotized = true, ExteriorRadius = 5f, ClearArea = true, RandomRotation = false, Group = "Ruins_well", MinDistanceFromSimilar = 256f, MaxTerrainDelta = 2f, MinAltitude = 1f, MinDistance = LocationRings.Ring1.MinDistance, MaxDistance = LocationRings.Ring1.MaxDistance, InForest = false } }, new MWLLocation { Name = "MWL_MaypoleHut1", AssetPath = "Assets/WarpProjects/More World Locations/Meadows/MWL_MaypoleHut1.prefab", Config = new LocationConfig { Biome = (Biome)1, Priotized = true, ExteriorRadius = 10f, ClearArea = true, RandomRotation = false, Group = "Ruins_small", MinDistanceFromSimilar = 512f, MaxTerrainDelta = 2f, MinAltitude = 1f, MinDistance = LocationRings.Ring4.MinDistance, InForest = false } }, new MWLLocation { Name = "MWL_DeerShrine1", AssetPath = "Assets/WarpProjects/More World Locations/Meadows/MWL_DeerShrine1.prefab", Config = new LocationConfig { Biome = (Biome)1, BiomeArea = (BiomeArea)3, Group = "Ruins_shrine", Priotized = true, RandomRotation = false, MinDistanceFromSimilar = 1024f, MaxTerrainDelta = 2f, MinAltitude = 1f, MinDistance = LocationRings.Ring1.MinDistance, MaxDistance = LocationRings.Ring3.MaxDistance, InForest = false } }, new MWLLocation { Name = "MWL_DeerShrine2", AssetPath = "Assets/WarpProjects/More World Locations/Meadows/MWL_DeerShrine2.prefab", Config = new LocationConfig { Biome = (Biome)1, BiomeArea = (BiomeArea)3, Group = "Ruins_shrine", Priotized = true, RandomRotation = false, MinDistanceFromSimilar = 1024f, MaxTerrainDelta = 2f, MinAltitude = 1f, MinDistance = LocationRings.Ring4.MinDistance, InForest = false } }, new MWLLocation { Name = "MWL_MeadowsBarn1", AssetPath = "Assets/WarpProjects/More World Locations/Meadows/MWL_MeadowsBarn1.prefab", Config = new LocationConfig { Biome = (Biome)1, BiomeArea = (BiomeArea)2, Group = "Wood_small", Priotized = true, RandomRotation = false, MinDistanceFromSimilar = 512f, MaxTerrainDelta = 3f, MinAltitude = 1f, MinDistance = LocationRings.Ring1.MinDistance, MaxDistance = LocationRings.Ring2.MaxDistance, InForest = false } }, new MWLLocation { Name = "MWL_VikingSacrifice1", AssetPath = "Assets/WarpProjects/More World Locations/Meadows/MWL_VikingSacrifice1.prefab", Config = new LocationConfig { Biome = (Biome)1, Priotized = true, ExteriorRadius = 20f, ClearArea = true, RandomRotation = false, Group = "Ruins_shrine", MinDistanceFromSimilar = 1024f, MaxTerrainDelta = 2f, MinAltitude = 1f, MinDistance = LocationRings.Ring3.MinDistance, InForest = false } }, new MWLLocation { Name = "MWL_MeadowsHouse2", AssetPath = "Assets/WarpProjects/More World Locations/Meadows/MWL_MeadowsHouse2.prefab", Config = new LocationConfig { Biome = (Biome)1, BiomeArea = (BiomeArea)3, Group = "Wood_small", Priotized = true, RandomRotation = false, MinDistanceFromSimilar = 1024f, MaxTerrainDelta = 2f, MinAltitude = 1f, MinDistance = LocationRings.Ring5.MinDistance, InForest = true } }, new MWLLocation { Name = "MWL_MeadowsRuin1", AssetPath = "Assets/WarpProjects/More World Locations/Meadows/MWL_MeadowsRuin1.prefab", Config = new LocationConfig { Biome = (Biome)1, BiomeArea = (BiomeArea)3, Group = "Ruins_small", Priotized = true, RandomRotation = false, MinDistanceFromSimilar = 1024f, MaxTerrainDelta = 2f, MinAltitude = 1f, MinDistance = LocationRings.Ring1.MinDistance, MaxDistance = LocationRings.Ring4.MaxDistance, InForest = false } }, new MWLLocation { Name = "MWL_MeadowsTomb4", AssetPath = "Assets/WarpProjects/More World Locations/Meadows/MWL_MeadowsTomb4.prefab", Config = new LocationConfig { Biome = (Biome)1, BiomeArea = (BiomeArea)3, Group = "Environment_medium", Priotized = true, RandomRotation = false, MinDistanceFromSimilar = 512f, MaxTerrainDelta = 4f, MinAltitude = -1f, MaxAltitude = 1f, MinDistance = LocationRings.Ring2.MinDistance, MaxDistance = LocationRings.Ring4.MaxDistance, InForest = false } }, new MWLLocation { Name = "MWL_MeadowsTower1", AssetPath = "Assets/WarpProjects/More World Locations/Meadows/MWL_MeadowsTower1.prefab", Config = new LocationConfig { Biome = (Biome)1, BiomeArea = (BiomeArea)3, Group = "Ruins_small", Priotized = true, RandomRotation = false, MinDistanceFromSimilar = 1024f, MaxTerrainDelta = 3f, MinAltitude = 1f, MinDistance = LocationRings.Ring2.MinDistance, MaxDistance = LocationRings.Ring5.MaxDistance, InForest = false } }, new MWLLocation { Name = "MWL_OakHut1", AssetPath = "Assets/WarpProjects/More World Locations/Meadows/MWL_OakHut1.prefab", Config = new LocationConfig { Biome = (Biome)1, BiomeArea = (BiomeArea)3, Group = "Wood_small", Priotized = true, RandomRotation = false, MinDistanceFromSimilar = 1024f, MaxTerrainDelta = 2f, MinAltitude = 1f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false } }, new MWLLocation { Name = "MWL_SmallHouse1", AssetPath = "Assets/WarpProjects/More World Locations/Meadows/MWL_SmallHouse1.prefab", Config = new LocationConfig { Biome = (Biome)1, BiomeArea = (BiomeArea)3, Group = "Ruins_medium", Priotized = true, RandomRotation = false, MinDistanceFromSimilar = 1024f, MaxTerrainDelta = 3f, MinAltitude = 1f, MinDistance = LocationRings.Ring3.MinDistance, InForest = false } }, new MWLLocation { Name = "MWL_MeadowsFarm1", AssetPath = "Assets/WarpProjects/More World Locations/Meadows/MWL_MeadowsFarm1.prefab", Config = new LocationConfig { Biome = (Biome)1, BiomeArea = (BiomeArea)3, Group = "Structure_large", Priotized = true, RandomRotation = false, MinDistanceFromSimilar = 1024f, MaxTerrainDelta = 2f, MinAltitude = 1f, MinDistance = LocationRings.Ring3.MinDistance, InForest = false } }, new MWLLocation { Name = "MWL_MeadowsLighthouse1", AssetPath = "Assets/WarpProjects/More World Locations/Meadows/MWL_MeadowsLighthouse1.prefab", Config = new LocationConfig { Biome = (Biome)1, BiomeArea = (BiomeArea)3, Group = "Structure_large", Priotized = true, RandomRotation = false, MinDistanceFromSimilar = 1024f, MaxTerrainDelta = 1.5f, MinAltitude = 1f, MinDistance = LocationRings.Ring3.MinDistance, InForest = false } }, new MWLLocation { Name = "MWL_MeadowsSawmill1", AssetPath = "Assets/WarpProjects/More World Locations/Meadows/MWL_MeadowsSawmill1.prefab", Config = new LocationConfig { Biome = (Biome)1, BiomeArea = (BiomeArea)2, Group = "Structure_large", Priotized = true, RandomRotation = false, MinDistanceFromSimilar = 1024f, MaxTerrainDelta = 2f, MinAltitude = 1f, MinDistance = LocationRings.Ring4.MinDistance, InForest = false } }, new MWLLocation { Name = "MWL_MeadowsWall1", AssetPath = "Assets/WarpProjects/More World Locations/Meadows/MWL_MeadowsWall1.prefab", Config = new LocationConfig { Biome = (Biome)1, BiomeArea = (BiomeArea)3, Group = "Structure_large", Priotized = true, RandomRotation = false, MinDistanceFromSimilar = 1024f, MaxTerrainDelta = 1.5f, MinAltitude = 1f, MinDistance = LocationRings.Ring3.MinDistance, InForest = false } }, new MWLLocation { Name = "MWL_MeadowsTavern1", AssetPath = "Assets/WarpProjects/More World Locations/Meadows/MWL_MeadowsTavern1.prefab", Config = new LocationConfig { Biome = (Biome)1, BiomeArea = (BiomeArea)3, Group = "Structure_large", Priotized = true, RandomRotation = false, MinDistanceFromSimilar = 1024f, MaxTerrainDelta = 2f, MinAltitude = 1f, MinDistance = LocationRings.Ring3.MinDistance, InForest = true } }, new MWLLocation { Name = "MWL_StoneShrine2", AssetPath = "Assets/WarpProjects/More World Locations/Meadows/MWL_StoneShrine2.prefab", Config = new LocationConfig { Biome = (Biome)1, BiomeArea = (BiomeArea)3, Group = "Shrine", Priotized = true, RandomRotation = false, MinDistanceFromSimilar = 1024f, MaxTerrainDelta = 2f, MinAltitude = 1f, MinDistance = LocationRings.Ring4.MinDistance, InForest = false } }, new MWLLocation { Name = "MWL_StoreHouseStone1", AssetPath = "Assets/WarpProjects/More World Locations/Meadows/MWL_StoreHouseStone1.prefab", Config = new LocationConfig { Biome = (Biome)1, BiomeArea = (BiomeArea)3, Group = "Structure_large", Priotized = true, RandomRotation = false, MinDistanceFromSimilar = 1024f, MaxTerrainDelta = 2f, MinAltitude = 1f, MinDistance = LocationRings.Ring3.MinDistance, InForest = false } } }; public static readonly MWLLocation[] BlackForest = new MWLLocation[37] { new MWLLocation { Name = "MWL_RuinsArena2", AssetPath = "Assets/WarpProjects/More World Locations/Blackforest/MWL_RuinsArena2.prefab", Config = new LocationConfig { Biome = (Biome)8, Priotized = true, ExteriorRadius = 20f, ClearArea = true, RandomRotation = false, Group = "Ruins_large", MinDistanceFromSimilar = 1024f, MaxTerrainDelta = 2f, MinAltitude = 1f, MinDistance = LocationRings.Ring4.MinDistance, MaxDistance = LocationRings.Ring4.MaxDistance, InForest = false } }, new MWLLocation { Name = "MWL_RuinsCastle1", AssetPath = "Assets/WarpProjects/More World Locations/Blackforest/MWL_RuinsCastle1.prefab", Config = new LocationConfig { Biome = (Biome)8, Priotized = true, ExteriorRadius = 12.5f, ClearArea = true, RandomRotation = false, Group = "Ruins_medium", MinDistanceFromSimilar = 512f, MaxTerrainDelta = 2f, MinAltitude = 1f, MinDistance = LocationRings.Ring2.MinDistance, MaxDistance = LocationRings.Ring2.MaxDistance, InForest = false } }, new MWLLocation { Name = "MWL_RuinsCastle3", AssetPath = "Assets/WarpProjects/More World Locations/Blackforest/MWL_RuinsCastle3.prefab", Config = new LocationConfig { Biome = (Biome)8, Priotized = true, ExteriorRadius = 20f, ClearArea = true, RandomRotation = false, Group = "Ruins_large", MinDistanceFromSimilar = 512f, MaxTerrainDelta = 2f, MinAltitude = 0f, MaxAltitude = 2f, MinDistance = LocationRings.Ring3.MinDistance, MaxDistance = LocationRings.Ring3.MaxDistance, InForest = false } }, new MWLLocation { Name = "MWL_RuinsTower3", AssetPath = "Assets/WarpProjects/More World Locations/Blackforest/MWL_RuinsTower3.prefab", Config = new LocationConfig { Biome = (Biome)8, Priotized = true, ExteriorRadius = 8f, ClearArea = true, RandomRotation = false, Group = "Ruins_medium", MinDistanceFromSimilar = 512f, MaxTerrainDelta = 2f, MinAltitude = 1f, MinDistance = LocationRings.Ring2.MinDistance, MaxDistance = LocationRings.Ring2.MaxDistance, InForest = false } }, new MWLLocation { Name = "MWL_RuinsTower6", AssetPath = "Assets/WarpProjects/More World Locations/Blackforest/MWL_RuinsTower6.prefab", Config = new LocationConfig { Biome = (Biome)8, Priotized = true, ExteriorRadius = 8f, ClearArea = true, RandomRotation = false, Group = "Ruins_large", MinDistanceFromSimilar = 512f, MinDistance = LocationRings.Ring2.MinDistance, MaxAltitude = 1f } }, new MWLLocation { Name = "MWL_RuinsTower8", AssetPath = "Assets/WarpProjects/More World Locations/Blackforest/MWL_RuinsTower8.prefab", Config = new LocationConfig { Biome = (Biome)8, Priotized = true, ExteriorRadius = 15f, ClearArea = true, RandomRotation = true, Group = "Ruins_medium", MinDistanceFromSimilar = 512f, MinAltitude = -2f, MaxAltitude = 0.5f, MinDistance = LocationRings.Ring2.MinDistance, MaxDistance = LocationRings.Ring2.MaxDistance, InForest = false } }, new MWLLocation { Name = "MWL_Tavern1", AssetPath = "Assets/WarpProjects/More World Locations/Blackforest/MWL_Tavern1.prefab", Config = new LocationConfig { Biome = (Biome)8, Priotized = true, ExteriorRadius = 12f, ClearArea = true, RandomRotation = false, Group = "Wood_small", MinDistanceFromSimilar = 256f, MaxTerrainDelta = 2f, MinAltitude = 1f, MinDistance = LocationRings.Ring3.MinDistance, MaxDistance = LocationRings.Ring3.MaxDistance, InForest = false } }, new MWLLocation { Name = "MWL_SupplyBarn1", AssetPath = "Assets/WarpProjects/More World Locations/Blackforest/MWL_SupplyBarn1.prefab", Config = new LocationConfig { Biome = (Biome)8, Priotized = true, ExteriorRadius = 20f, ClearArea = true, RandomRotation = false, Group = "Wood_small", MinDistanceFromSimilar = 512f, MaxTerrainDelta = 2f, MinAltitude = 1f, MinDistance = LocationRings.Ring4.MinDistance, InForest = false } }, new MWLLocation { Name = "MWL_WoodTower1", AssetPath = "Assets/WarpProjects/More World Locations/Blackforest/MWL_WoodTower1.prefab", Config = new LocationConfig { Biome = (Biome)8, Priotized = true, ExteriorRadius = 8f, ClearArea = true, RandomRotation = false, Group = "Wood_small", MinDistanceFromSimilar = 256f, MaxTerrainDelta = 2f, MinAltitude = 1f, MinDistance = LocationRings.Ring2.MinDistance, MaxDistance = LocationRings.Ring2.MaxDistance, InForest = false } }, new MWLLocation { Name = "MWL_WoodTower2", AssetPath = "Assets/WarpProjects/More World Locations/Blackforest/MWL_WoodTower2.prefab", Config = new LocationConfig { Biome = (Biome)8, Priotized = true, ExteriorRadius = 8f, ClearArea = true, RandomRotation = false, Group = "Wood_small", MinDistanceFromSimilar = 256f, MaxTerrainDelta = 2f, MinAltitude = 1f, MinDistance = LocationRings.Ring3.MinDistance, MaxDistance = LocationRings.Ring3.MaxDistance, InForest = false } }, new MWLLocation { Name = "MWL_WoodTower3", AssetPath = "Assets/WarpProjects/More World Locations/Blackforest/MWL_WoodTower3.prefab", Config = new LocationConfig { Biome = (Biome)8, Priotized = true, ExteriorRadius = 24f, ClearArea = true, RandomRotation = false, Group = "Wood_medium", MinDistanceFromSimilar = 512f, MaxTerrainDelta = 2f, MinAltitude = 1f, MinDistance = LocationRings.Ring3.MinDistance, MaxDistance = LocationRings.Ring3.MaxDistance, InForest = false } }, new MWLLocation { Name = "MWL_ForestForge1", AssetPath = "Assets/WarpProjects/More World Locations/Blackforest/MWL_ForestForge1.prefab", Config = new LocationConfig { Biome = (Biome)8, Group = "Forge_small", Priotized = true, RandomRotation = false, ExteriorRadius = 12f, ClearArea = true, MinDistanceFromSimilar = 512f, MaxTerrainDelta = 3f, MinAltitude = 2f, MinDistance = LocationRings.Ring2.MinDistance, MaxDistance = LocationRings.Ring6.MaxDistance } }, new MWLLocation { Name = "MWL_ForestForge2", AssetPath = "Assets/WarpProjects/More World Locations/Blackforest/MWL_ForestForge2.prefab", Config = new LocationConfig { Biome = (Biome)8, Group = "Forge_small", Priotized = true, RandomRotation = false, ExteriorRadius = 16f, ClearArea = true, MinDistanceFromSimilar = 512f, MaxTerrainDelta = 3f, MinAltitude = 2f, MinDistance = LocationRings.Ring2.MinDistance, MaxDistance = LocationRings.Ring6.MaxDistance } }, new MWLLocation { Name = "MWL_ForestGreatHouse2", AssetPath = "Assets/WarpProjects/More World Locations/Blackforest/MWL_ForestGreatHouse2.prefab", Config = new LocationConfig { Biome = (Biome)8, Group = "House_large", Priotized = true, RandomRotation = false, ExteriorRadius = 10f, ClearArea = true, MinDistanceFromSimilar = 512f, MaxTerrainDelta = 4f, MinAltitude = 2f, MinDistance = LocationRings.Ring3.MinDistance, MaxDistance = LocationRings.Ring3.MaxDistance } }, new MWLLocation { Name = "MWL_ForestHouse2", AssetPath = "Assets/WarpProjects/More World Locations/Blackforest/MWL_ForestHouse2.prefab", Config = new LocationConfig { Biome = (Biome)8, Group = "House_small", Priotized = true, RandomRotation = false, ExteriorRadius = 10f, ClearArea = true, MinDistanceFromSimilar = 1024f, MaxTerrainDelta = 2f, MinAltitude = 10f, MinDistance = LocationRings.Ring4.MinDistance, MaxDistance = LocationRings.Ring5.MaxDistance } }, new MWLLocation { Name = "MWL_ForestRuin1", AssetPath = "Assets/WarpProjects/More World Locations/Blackforest/MWL_ForestRuin1.prefab", Config = new LocationConfig { Biome = (Biome)8, Group = "Ruins_large", Priotized = true, RandomRotation = false, ExteriorRadius = 8f, ClearArea = true, MinDistanceFromSimilar = 1024f, MaxTerrainDelta = 2f, MinAltitude = 8f, MinDistance = LocationRings.Ring2.MinDistance, MaxDistance = LocationRings.Ring5.MaxDistance } }, new MWLLocation { Name = "MWL_ForestTower2", AssetPath = "Assets/WarpProjects/More World Locations/Blackforest/MWL_ForestTower2.prefab", Config = new LocationConfig { Biome = (Biome)8, Group = "Tower_medium", Priotized = true, RandomRotation = false, ExteriorRadius = 10f, ClearArea = true, MinDistanceFromSimilar = 1024f, MaxTerrainDelta = 2f, MinAltitude = 2f, MinDistance = LocationRings.Ring2.MinDistance, MaxDistance = LocationRings.Ring2.MaxDistance } }, new MWLLocation { Name = "MWL_ForestTower3", AssetPath = "Assets/WarpProjects/More World Locations/Blackforest/MWL_ForestTower3.prefab", Config = new LocationConfig { Biome = (Biome)8, Group = "Tower_large", Priotized = true, RandomRotation = false, ExteriorRadius = 10f, ClearArea = true, MinDistanceFromSimilar = 1024f, MaxTerrainDelta = 3f, MinAltitude = 10f, MinDistance = LocationRings.Ring3.MinDistance, MaxDistance = LocationRings.Ring5.MaxDistance } }, new MWLLocation { Name = "MWL_MassGrave1", AssetPath = "Assets/WarpProjects/More World Locations/Blackforest/MWL_MassGrave1.prefab", Config = new LocationConfig { Biome = (Biome)8, Group = "Grave_large", Priotized = true, RandomRotation = false, ExteriorRadius = 3f, ClearArea = true, MinDistanceFromSimilar = 1024f, MaxTerrainDelta = 2f, MinAltitude = 10f, MinDistance = LocationRings.Ring2.MinDistance, MaxDistance = LocationRings.Ring2.MaxDistance } }, new MWLLocation { Name = "MWL_StoneFormation1", AssetPath = "Assets/WarpProjects/More World Locations/Blackforest/MWL_StoneFormation1.prefab", Config = new LocationConfig { Biome = (Biome)8, Group = "Stone_small", Priotized = true, RandomRotation = false, ExteriorRadius = 5f, ClearArea = true, MinDistanceFromSimilar = 1024f, MaxTerrainDelta = 2f, MinAltitude = 10f, MinDistance = LocationRings.Ring2.MinDistance } }, new MWLLocation { Name = "MWL_GuardTower1", AssetPath = "Assets/WarpProjects/More World Locations/Blackforest/MWL_GuardTower1.prefab", Config = new LocationConfig { Biome = (Biome)8, Group = "Ruins_large", Priotized = true, RandomRotation = false, ExteriorRadius = 5f, ClearArea = true, MinDistanceFromSimilar = 1024f, MaxTerrainDelta = 2f, MinAltitude = 6f, MinDistance = LocationRings.Ring3.MinDistance } }, new MWLLocation { Name = "MWL_RootRuins1", AssetPath = "Assets/WarpProjects/More World Locations/Blackforest/MWL_RootRuins1.prefab", Config = new LocationConfig { Biome = (Biome)8, Group = "Ruins_small", Priotized = true, RandomRotation = false, ExteriorRadius = 5f, ClearArea = true, MinDistanceFromSimilar = 1024f, MaxTerrainDelta = 2f, MinAltitude = 10f, MinDistance = LocationRings.Ring2.MinDistance, MaxDistance = LocationRings.Ring4.MaxDistance } }, new MWLLocation { Name = "MWL_RootsTower1", AssetPath = "Assets/WarpProjects/More World Locations/Blackforest/MWL_RootsTower1.prefab", Config = new LocationConfig { Biome = (Biome)8, Group = "Ruins_medium", Priotized = true, RandomRotation = false, ExteriorRadius = 5f, ClearArea = true, MinDistanceFromSimilar = 1024f, MaxTerrainDelta = 2f, MinAltitude = 10f, MinDistance = LocationRings.Ring3.MinDistance, MaxDistance = LocationRings.Ring6.MaxDistance } }, new MWLLocation { Name = "MWL_RootsTower2", AssetPath = "Assets/WarpProjects/More World Locations/Blackforest/MWL_RootsTower2.prefab", Config = new LocationConfig { Biome = (Biome)8, Group = "Ruins_medium", Priotized = true, RandomRotation = false, ExteriorRadius = 5f, ClearArea = true, MinDistanceFromSimilar = 1024f, MaxTerrainDelta = 2f, MinAltitude = 10f, MinDistance = LocationRings.Ring2.MinDistance } }, new MWLLocation { Name = "MWL_RuinedRootTower5", AssetPath = "Assets/WarpProjects/More World Locations/Blackforest/MWL_RuinedRootTower5.prefab", Config = new LocationConfig { Biome = (Biome)8, Group = "Ruins_medium", Priotized = true, RandomRotation = false, ExteriorRadius = 5f, ClearArea = true, MinDistanceFromSimilar = 1024f, MaxTerrainDelta = 2f, MinAltitude = 10f, MinDistance = LocationRings.Ring2.MinDistance } }, new MWLLocation { Name = "MWL_ForestRuin2", AssetPath = "Assets/WarpProjects/More World Locations/Blackforest/MWL_ForestRuin2.prefab", Config = new LocationConfig { Biome = (Biome)8, Group = "Ruins_medium", Priotized = true, RandomRotation = false, ClearArea = true, MinDistanceFromSimilar = 1024f, MinAltitude = 2f, MinDistance = LocationRings.Ring2.MinDistance } }, new MWLLocation { Name = "MWL_ForestRuin3", AssetPath = "Assets/WarpProjects/More World Locations/Blackforest/MWL_ForestRuin3.prefab", Config = new LocationConfig { Biome = (Biome)8, Group = "Ruins_medium", Priotized = true, RandomRotation = false, ClearArea = true, MinDistanceFromSimilar = 1024f, MaxTerrainDelta = 2f, MinAltitude = 2f, MinDistance = LocationRings.Ring3.MinDistance } }, new MWLLocation { Name = "MWL_ForestSkull1", AssetPath = "Assets/WarpProjects/More World Locations/Blackforest/MWL_ForestSkull1.prefab", Config = new LocationConfig { Biome = (Biome)8, Group = "Ruins_small", Priotized = true, RandomRotation = false, ClearArea = true, MinDistanceFromSimilar = 1024f, MaxTerrainDelta = 2f, MinAltitude = 2f, MinDistance = LocationRings.Ring4.MinDistance } }, new MWLLocation { Name = "MWL_ForestTower4", AssetPath = "Assets/WarpProjects/More World Locations/Blackforest/MWL_ForestTower4.prefab", Config = new LocationConfig { Biome = (Biome)8, Group = "Ruins_medium", Priotized = true, RandomRotation = false, ClearArea = true, MinDistanceFromSimilar = 1024f, MaxTerrainDelta = 2f, MinAltitude = 2f, MinDistance = LocationRings.Ring3.MinDistance } }, new MWLLocation { Name = "MWL_ForestTower5", AssetPath = "Assets/WarpProjects/More World Locations/Blackforest/MWL_ForestTower5.prefab", Config = new LocationConfig { Biome = (Biome)8, Group = "Ruins_medium", Priotized = true, RandomRotation = false, ClearArea = true, MinDistanceFromSimilar = 1024f, MaxTerrainDelta = 3f, MinAltitude = 2f, MinDistance = LocationRings.Ring4.MinDistance, MaxDistance = LocationRings.Ring5.MaxDistance } }, new MWLLocation { Name = "MWL_ForestPillar1", AssetPath = "Assets/WarpProjects/More World Locations/Blackforest/MWL_ForestPillar1.prefab", Config = new LocationConfig { Biome = (Biome)8, Group = "Ruins_small", Priotized = true, RandomRotation = false, ClearArea = true, MinDistanceFromSimilar = 512f, MaxTerrainDelta = 3f, MinAltitude = 2f, MaxDistance = LocationRings.Ring3.MaxDistance } }, new MWLLocation { Name = "MWL_CoastTower1", AssetPath = "Assets/WarpProjects/More World Locations/Blackforest/MWL_CoastTower1.prefab", Config = new LocationConfig { Biome = (Biome)8, Group = "Coastal", Priotized = true, RandomRotation = false, ClearArea = true, MinDistanceFromSimilar = 512f, MinAltitude = -1f, MaxAltitude = 0f } }, new MWLLocation { Name = "MWL_ForestGrove1", AssetPath = "Assets/WarpProjects/More World Locations/Blackforest/MWL_ForestGrove1.prefab", Config = new LocationConfig { Biome = (Biome)8, Group = "Grove", Priotized = true, RandomRotation = false, ExteriorRadius = 10f, ClearArea = true, MinDistanceFromSimilar = 1024f, MaxTerrainDelta = 3f, MinAltitude = 1.5f, BiomeArea = (BiomeArea)2 } }, new MWLLocation { Name = "MWL_RockShrine1", AssetPath = "Assets/WarpProjects/More World Locations/Blackforest/MWL_RockShrine1.prefab", Config = new LocationConfig { Biome = (Biome)8, Group = "Shrine", Priotized = true, RandomRotation = false, ExteriorRadius = 10f, ClearArea = true, MinDistanceFromSimilar = 512f, MaxTerrainDelta = 3f, MinAltitude = 1.5f, BiomeArea = (BiomeArea)2 } }, new MWLLocation { Name = "MWL_ForestCamp1", AssetPath = "Assets/WarpProjects/More World Locations/Blackforest/MWL_ForestCamp1.prefab", Config = new LocationConfig { Biome = (Biome)8, Priotized = true, ExteriorRadius = 20f, ClearArea = true, RandomRotation = false, Group = "Camp", MinDistanceFromSimilar = 1024f, MaxTerrainDelta = 3f, MinAltitude = 2f, MinDistance = LocationRings.Ring1.MinDistance, MaxDistance = LocationRings.Ring7.MaxDistance } }, new MWLLocation { Name = "MWL_RuinedTower1", AssetPath = "Assets/WarpProjects/More World Locations/Blackforest/MWL_RuinedTower1.prefab", Config = new LocationConfig { Biome = (Biome)8, Priotized = true, ExteriorRadius = 20f, ClearArea = true, RandomRotation = false, Group = "RuinedTower1", MinDistanceFromSimilar = 512f, MaxTerrainDelta = 4f, MinAltitude = 2f, MinDistance = LocationRings.Ring1.MinDistance, MaxDistance = LocationRings.Ring7.MaxDistance } }, new MWLLocation { Name = "MWL_StoneTower3", AssetPath = "Assets/WarpProjects/More World Locations/Blackforest/MWL_StoneTower3.prefab", Config = new LocationConfig { Biome = (Biome)8, Group = "Tower_large", Priotized = true, RandomRotation = false, ExteriorRadius = 10f, ClearArea = true, MinDistanceFromSimilar = 1024f, MaxTerrainDelta = 3f, MinAltitude = 2f, MinDistance = LocationRings.Ring2.MinDistance, MaxDistance = LocationRings.Ring6.MaxDistance } } }; public static readonly MWLLocation[] Swamp = new MWLLocation[27] { new MWLLocation { Name = "MWL_GuckPit1", AssetPath = "Assets/WarpProjects/More World Locations/Swamp/MWL_GuckPit1.prefab", Config = new LocationConfig { Biome = (Biome)2, Group = "Swamp_small", Priotized = true, RandomRotation = false, ExteriorRadius = 8f, ClearArea = true, MinDistanceFromSimilar = 256f, MinTerrainDelta = 0f, MaxTerrainDelta = 5f, MinAltitude = 0f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)2 } }, new MWLLocation { Name = "MWL_SwampAltar1", AssetPath = "Assets/WarpProjects/More World Locations/Swamp/MWL_SwampAltar1.prefab", Config = new LocationConfig { Biome = (Biome)2, Group = "Swamp_altar", Priotized = true, RandomRotation = false, ExteriorRadius = 8f, ClearArea = true, MinDistanceFromSimilar = 512f, MinTerrainDelta = 0f, MaxTerrainDelta = 8f, MinAltitude = -1f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)2 } }, new MWLLocation { Name = "MWL_SwampAltar2", AssetPath = "Assets/WarpProjects/More World Locations/Swamp/MWL_SwampAltar2.prefab", Config = new LocationConfig { Biome = (Biome)2, Group = "Swamp_altar", Priotized = true, RandomRotation = false, ExteriorRadius = 15f, ClearArea = true, MinDistanceFromSimilar = 512f, MinTerrainDelta = 0f, MaxTerrainDelta = 8f, MinAltitude = -1f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)2 } }, new MWLLocation { Name = "MWL_SwampAltar3", AssetPath = "Assets/WarpProjects/More World Locations/Swamp/MWL_SwampAltar3.prefab", Config = new LocationConfig { Biome = (Biome)2, Group = "Swamp_altar", Priotized = true, RandomRotation = false, ExteriorRadius = 15f, ClearArea = true, MinDistanceFromSimilar = 512f, MinTerrainDelta = 0f, MaxTerrainDelta = 8f, MinAltitude = -1f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)2 } }, new MWLLocation { Name = "MWL_SwampAltar4", AssetPath = "Assets/WarpProjects/More World Locations/Swamp/MWL_SwampAltar4.prefab", Config = new LocationConfig { Biome = (Biome)2, Group = "Swamp_altar", Priotized = true, RandomRotation = false, ExteriorRadius = 15f, ClearArea = true, MinDistanceFromSimilar = 512f, MinTerrainDelta = 0f, MaxTerrainDelta = 8f, MinAltitude = -1f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)2 } }, new MWLLocation { Name = "MWL_SwampCastle2", AssetPath = "Assets/WarpProjects/More World Locations/Swamp/MWL_SwampCastle2.prefab", Config = new LocationConfig { Biome = (Biome)2, Group = "Swamp_medium", Priotized = true, RandomRotation = false, ExteriorRadius = 15f, ClearArea = true, MinDistanceFromSimilar = 512f, MinTerrainDelta = 0f, MaxTerrainDelta = 8f, MinAltitude = 0f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)2 } }, new MWLLocation { Name = "MWL_SwampStakeFort1", AssetPath = "Assets/WarpProjects/More World Locations/Swamp/MWL_SwampStakeFort1.prefab", Config = new LocationConfig { Biome = (Biome)2, Group = "Swamp_medium", Priotized = true, RandomRotation = false, ExteriorRadius = 20f, ClearArea = true, MinDistanceFromSimilar = 1024f, MinTerrainDelta = 0f, MaxTerrainDelta = 8f, MinAltitude = 0f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)2 } }, new MWLLocation { Name = "MWL_SwampGrave1", AssetPath = "Assets/WarpProjects/More World Locations/Swamp/MWL_SwampGrave1.prefab", Config = new LocationConfig { Biome = (Biome)2, Group = "Swamp_medium", Priotized = true, RandomRotation = false, ExteriorRadius = 15f, ClearArea = true, MinDistanceFromSimilar = 512f, MinTerrainDelta = 0f, MaxTerrainDelta = 8f, MinAltitude = 0f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)2 } }, new MWLLocation { Name = "MWL_SwampHouse1", AssetPath = "Assets/WarpProjects/More World Locations/Swamp/MWL_SwampHouse1.prefab", Config = new LocationConfig { Biome = (Biome)2, Group = "Swamp_small", Priotized = true, RandomRotation = false, ExteriorRadius = 15f, ClearArea = true, MinDistanceFromSimilar = 256f, MinTerrainDelta = 0f, MaxTerrainDelta = 8f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)2 } }, new MWLLocation { Name = "MWL_SwampRuin1", AssetPath = "Assets/WarpProjects/More World Locations/Swamp/MWL_SwampRuin1.prefab", Config = new LocationConfig { Biome = (Biome)2, Group = "Swamp_medium", Priotized = true, RandomRotation = false, ExteriorRadius = 15f, ClearArea = true, MinDistanceFromSimilar = 512f, MinTerrainDelta = 0f, MaxTerrainDelta = 8f, MinAltitude = -1f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)2 } }, new MWLLocation { Name = "MWL_SwampTower1", AssetPath = "Assets/WarpProjects/More World Locations/Swamp/MWL_SwampTower1.prefab", Config = new LocationConfig { Biome = (Biome)2, Group = "Swamp_small", Priotized = true, RandomRotation = false, ExteriorRadius = 15f, ClearArea = true, MinDistanceFromSimilar = 256f, MinTerrainDelta = 0f, MaxTerrainDelta = 8f, MinAltitude = 0f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)2 } }, new MWLLocation { Name = "MWL_SwampTower2", AssetPath = "Assets/WarpProjects/More World Locations/Swamp/MWL_SwampTower2.prefab", Config = new LocationConfig { Biome = (Biome)2, Group = "Swamp_tower", Priotized = true, RandomRotation = false, ExteriorRadius = 15f, ClearArea = true, MinDistanceFromSimilar = 1024f, MinTerrainDelta = 0f, MaxTerrainDelta = 8f, MinAltitude = 0f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)2 } }, new MWLLocation { Name = "MWL_SwampTower3", AssetPath = "Assets/WarpProjects/More World Locations/Swamp/MWL_SwampTower3.prefab", Config = new LocationConfig { Biome = (Biome)2, Group = "Swamp_large", Priotized = true, RandomRotation = false, ExteriorRadius = 15f, ClearArea = true, MinDistanceFromSimilar = 1024f, MinTerrainDelta = 0f, MaxTerrainDelta = 8f, MinAltitude = 0f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)2 } }, new MWLLocation { Name = "MWL_SwampWell1", AssetPath = "Assets/WarpProjects/More World Locations/Swamp/MWL_SwampWell1.prefab", Config = new LocationConfig { Biome = (Biome)2, Group = "Swamp_small", Priotized = true, RandomRotation = false, ExteriorRadius = 15f, ClearArea = true, MinDistanceFromSimilar = 256f, MinTerrainDelta = 0f, MaxTerrainDelta = 8f, MinAltitude = 0f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false } }, new MWLLocation { Name = "MWL_AbandonedHouse1", AssetPath = "Assets/WarpProjects/More World Locations/Swamp/MWL_AbandonedHouse1.prefab", Config = new LocationConfig { Biome = (Biome)2, Group = "Swamp_medium", Priotized = true, RandomRotation = false, ExteriorRadius = 15f, ClearArea = true, MinDistanceFromSimilar = 512f, MinTerrainDelta = 0f, MaxTerrainDelta = 8f, MinAltitude = 2f, MinDistance = LocationRings.Ring3.MinDistance, InForest = false } }, new MWLLocation { Name = "MWL_Treehouse1", AssetPath = "Assets/WarpProjects/More World Locations/Swamp/MWL_Treehouse1.prefab", Config = new LocationConfig { Biome = (Biome)2, Group = "Treehouse", Priotized = true, RandomRotation = false, ExteriorRadius = 15f, ClearArea = true, MinDistanceFromSimilar = 512f, MinTerrainDelta = 0f, MaxTerrainDelta = 8f, MinAltitude = 0f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false } }, new MWLLocation { Name = "MWL_Shipyard1", AssetPath = "Assets/WarpProjects/More World Locations/Swamp/MWL_Shipyard1.prefab", Config = new LocationConfig { Biome = (Biome)2, Group = "Swamp_ship", Priotized = true, RandomRotation = false, ExteriorRadius = 15f, ClearArea = true, MinDistanceFromSimilar = 512f, MinTerrainDelta = 0f, MaxTerrainDelta = 8f, MinAltitude = 2f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false } }, new MWLLocation { Name = "MWL_FortBakkarhalt1", AssetPath = "Assets/WarpProjects/More World Locations/Swamp/MWL_FortBakkarhalt1.prefab", Config = new LocationConfig { Biome = (Biome)2, Group = "Swamp_Huge", Priotized = true, RandomRotation = false, ExteriorRadius = 15f, ClearArea = true, MinDistanceFromSimilar = 1024f, MinTerrainDelta = 0f, MaxTerrainDelta = 8f, MinAltitude = 0f, MinDistance = LocationRings.Ring3.MinDistance, InForest = false } }, new MWLLocation { Name = "MWL_Belmont1", AssetPath = "Assets/WarpProjects/More World Locations/Swamp/MWL_Belmont1.prefab", Config = new LocationConfig { Biome = (Biome)2, Group = "Swamp_Huge", Priotized = true, RandomRotation = false, ExteriorRadius = 15f, ClearArea = true, MinDistanceFromSimilar = 1024f, MaxTerrainDelta = 8f, MinAltitude = 3f, MinDistance = LocationRings.Ring4.MinDistance, InForest = false } }, new MWLLocation { Name = "MWL_SwampCourtyard1", AssetPath = "Assets/WarpProjects/More World Locations/Swamp/MWL_SwampCourtyard1.prefab", Config = new LocationConfig { Biome = (Biome)2, Group = "Swamp_medium", Priotized = true, RandomRotation = false, ExteriorRadius = 15f, ClearArea = true, MinDistanceFromSimilar = 1024f, MaxTerrainDelta = 8f, MinAltitude = 3f, InForest = false } }, new MWLLocation { Name = "MWL_SwampBrokenTower1", AssetPath = "Assets/WarpProjects/More World Locations/Swamp/MWL_SwampBrokenTower1.prefab", Config = new LocationConfig { Biome = (Biome)2, Group = "Swamp_medium", Priotized = true, RandomRotation = false, ExteriorRadius = 15f, ClearArea = true, MinDistanceFromSimilar = 1024f, MaxTerrainDelta = 8f, MinAltitude = 3f, MinDistance = LocationRings.Ring4.MinDistance, InForest = false } }, new MWLLocation { Name = "MWL_SwampBrokenTower3", AssetPath = "Assets/WarpProjects/More World Locations/Swamp/MWL_SwampBrokenTower3.prefab", Config = new LocationConfig { Biome = (Biome)2, Group = "Swamp_small", Priotized = true, RandomRotation = false, ExteriorRadius = 15f, ClearArea = true, MinDistanceFromSimilar = 1024f, MaxTerrainDelta = 8f, MinAltitude = 3f, InForest = false } }, new MWLLocation { Name = "MWL_StoneCircle1", AssetPath = "Assets/WarpProjects/More World Locations/Swamp/MWL_StoneCircle1.prefab", Config = new LocationConfig { Biome = (Biome)2, Group = "Swamp_small", Priotized = true, RandomRotation = false, ExteriorRadius = 15f, ClearArea = true, MinDistanceFromSimilar = 512f, MaxTerrainDelta = 8f, MinAltitude = 0f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)2 } }, new MWLLocation { Name = "MWL_SwampTemple1", AssetPath = "Assets/WarpProjects/More World Locations/Swamp/MWL_SwampTemple1.prefab", Config = new LocationConfig { Biome = (Biome)2, Group = "Swamp_small", Priotized = true, RandomRotation = false, ExteriorRadius = 15f, ClearArea = true, MinDistanceFromSimilar = 512f, MaxTerrainDelta = 8f, MinAltitude = 0f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)2 } }, new MWLLocation { Name = "MWL_CastleCorner1", AssetPath = "Assets/WarpProjects/More World Locations/Swamp/MWL_CastleCorner1.prefab", Config = new LocationConfig { Biome = (Biome)2, Priotized = true, ExteriorRadius = 20f, ClearArea = true, RandomRotation = false, Group = "Swamp_Ruins", MinDistanceFromSimilar = 512f, MaxTerrainDelta = 3f, MinAltitude = 1f, MinDistance = LocationRings.Ring2.MinDistance, MaxDistance = LocationRings.Ring7.MaxDistance, InForest = false } }, new MWLLocation { Name = "MWL_TreeTowers1", AssetPath = "Assets/WarpProjects/More World Locations/Swamp/MWL_TreeTowers1.prefab", Config = new LocationConfig { Biome = (Biome)2, Priotized = true, ExteriorRadius = 20f, ClearArea = true, RandomRotation = false, Group = "TreeTowers1", MinDistanceFromSimilar = 512f, MaxTerrainDelta = 3f, MinAltitude = 1f, MinDistance = LocationRings.Ring1.MinDistance, MaxDistance = LocationRings.Ring7.MaxDistance } }, new MWLLocation { Name = "MWL_StoneBeacon1", AssetPath = "Assets/WarpProjects/More World Locations/Swamp/MWL_StoneBeacon1.prefab", Config = new LocationConfig { Biome = (Biome)2, Priotized = true, ExteriorRadius = 8f, ClearArea = true, RandomRotation = false, Group = "Swamp_Ruins", MinDistanceFromSimilar = 512f, MaxTerrainDelta = 3f, MinAltitude = 1f, MinDistance = LocationRings.Ring2.MinDistance, MaxDistance = LocationRings.Ring7.MaxDistance, InForest = false } } }; public static readonly MWLLocation[] Mountains = new MWLLocation[21] { new MWLLocation { Name = "MWL_StoneCastle1", AssetPath = "Assets/WarpProjects/More World Locations/Mountain/MWL_StoneCastle1.prefab", Config = new LocationConfig { Biome = (Biome)4, Group = "Mountain_Stone_Large", Priotized = true, RandomRotation = false, ExteriorRadius = 20f, ClearArea = true, MinDistanceFromSimilar = 1024f, SlopeRotation = true, MinTerrainDelta = 10f, MaxTerrainDelta = 15f, MinAltitude = 80f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false } }, new MWLLocation { Name = "MWL_StoneFort1", AssetPath = "Assets/WarpProjects/More World Locations/Mountain/MWL_StoneFort1.prefab", Config = new LocationConfig { Biome = (Biome)4, Group = "Mountain_Stone_Small", Priotized = true, RandomRotation = false, ExteriorRadius = 20f, ClearArea = true, MinDistanceFromSimilar = 256f, MinTerrainDelta = 0f, MaxTerrainDelta = 10f, MinAltitude = 70f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false } }, new MWLLocation { Name = "MWL_StoneHall1", AssetPath = "Assets/WarpProjects/More World Locations/Mountain/MWL_StoneHall1.prefab", Config = new LocationConfig { Biome = (Biome)4, Group = "Mountain_Stone_Medium", Priotized = true, RandomRotation = false, ExteriorRadius = 15f, ClearArea = true, MinDistanceFromSimilar = 512f, MinTerrainDelta = 0f, MaxTerrainDelta = 10f, MinAltitude = 80f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false } }, new MWLLocation { Name = "MWL_StoneTavern1", AssetPath = "Assets/WarpProjects/More World Locations/Mountain/MWL_StoneTavern1.prefab", Config = new LocationConfig { Biome = (Biome)4, Group = "Mountain_Stone_Medium", Priotized = true, RandomRotation = false, ExteriorRadius = 15f, ClearArea = true, MinDistanceFromSimilar = 512f, MinTerrainDelta = 0f, MaxTerrainDelta = 18f, MinAltitude = 75f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false } }, new MWLLocation { Name = "MWL_StoneTower1", AssetPath = "Assets/WarpProjects/More World Locations/Mountain/MWL_StoneTower1.prefab", Config = new LocationConfig { Biome = (Biome)4, Group = "Mountain_Stone_Small", Priotized = true, RandomRotation = false, ExteriorRadius = 8f, ClearArea = true, MinDistanceFromSimilar = 256f, MinTerrainDelta = 0f, MinAltitude = 80f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false } }, new MWLLocation { Name = "MWL_StoneTower2", AssetPath = "Assets/WarpProjects/More World Locations/Mountain/MWL_StoneTower2.prefab", Config = new LocationConfig { Biome = (Biome)4, Group = "Mountain_Stone_Small", Priotized = true, RandomRotation = false, ExteriorRadius = 10f, ClearArea = true, MinDistanceFromSimilar = 256f, MinTerrainDelta = 0f, MaxTerrainDelta = 10f, MinAltitude = 70f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false } }, new MWLLocation { Name = "MWL_MountainsTower1", AssetPath = "Assets/WarpProjects/More World Locations/Mountain/MWL_MountainsTower1.prefab", Config = new LocationConfig { Biome = (Biome)4, Group = "Mountain_Stone_Medium", Priotized = true, RandomRotation = false, ExteriorRadius = 20f, ClearArea = true, MinDistanceFromSimilar = 512f, MinTerrainDelta = 0f, MaxTerrainDelta = 10f, MinAltitude = 70f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false } }, new MWLLocation { Name = "MWL_MountainsPagota1", AssetPath = "Assets/WarpProjects/More World Locations/Mountain/MWL_MountainsPagota1.prefab", Config = new LocationConfig { Biome = (Biome)4, Group = "Mountain_Stone_Medium", Priotized = true, RandomRotation = false, ExteriorRadius = 20f, ClearArea = true, MinDistanceFromSimilar = 512f, MinTerrainDelta = 0f, MaxTerrainDelta = 10f, MinAltitude = 70f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false } }, new MWLLocation { Name = "MWL_MountainsHogan1", AssetPath = "Assets/WarpProjects/More World Locations/Mountain/MWL_MountainsHogan1.prefab", Config = new LocationConfig { Biome = (Biome)4, Group = "Mountain_Stone_Medium", Priotized = true, RandomRotation = false, ExteriorRadius = 20f, ClearArea = true, MinDistanceFromSimilar = 512f, MinTerrainDelta = 0f, MaxTerrainDelta = 10f, MinAltitude = 70f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false } }, new MWLLocation { Name = "MWL_WoodBarn1", AssetPath = "Assets/WarpProjects/More World Locations/Mountain/MWL_WoodBarn1.prefab", Config = new LocationConfig { Biome = (Biome)4, Group = "Mountain_Wood_1", Priotized = true, RandomRotation = false, ExteriorRadius = 20f, ClearArea = true, MinDistanceFromSimilar = 512f, MinTerrainDelta = 0f, MaxTerrainDelta = 3f, MinAltitude = 80f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false } }, new MWLLocation { Name = "MWL_WoodFarm1", AssetPath = "Assets/WarpProjects/More World Locations/Mountain/MWL_WoodFarm1.prefab", Config = new LocationConfig { Biome = (Biome)4, Group = "Mountain_Wood_1", Priotized = true, RandomRotation = false, ExteriorRadius = 18f, ClearArea = true, MinDistanceFromSimilar = 512f, MinTerrainDelta = 0f, MaxTerrainDelta = 7f, MinAltitude = 70f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false } }, new MWLLocation { Name = "MWL_WoodHouse1", AssetPath = "Assets/WarpProjects/More World Locations/Mountain/MWL_WoodHouse1.prefab", Config = new LocationConfig { Biome = (Biome)4, Group = "Mountain_Wood_2", Priotized = true, RandomRotation = false, ExteriorRadius = 10f, ClearArea = true, MinDistanceFromSimilar = 512f, MaxTerrainDelta = 10f, MinAltitude = 90f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false } }, new MWLLocation { Name = "MWL_TempleShrine1", AssetPath = "Assets/WarpProjects/More World Locations/Mountain/MWL_TempleShrine1.prefab", Config = new LocationConfig { Biome = (Biome)4, Group = "Mountain_Stone_Large", Priotized = true, RandomRotation = false, ExteriorRadius = 10f, ClearArea = true, MinDistanceFromSimilar = 512f, MaxTerrainDelta = 10f, MinAltitude = 90f, MinDistance = LocationRings.Ring3.MinDistance, InForest = false } }, new MWLLocation { Name = "MWL_StoneAltar1", AssetPath = "Assets/WarpProjects/More World Locations/Mountain/MWL_StoneAltar1.prefab", Config = new LocationConfig { Biome = (Biome)4, Group = "Mountain_Stone_Medium", Priotized = true, RandomRotation = false, ExteriorRadius = 10f, ClearArea = true, MinDistanceFromSimilar = 512f, MaxTerrainDelta = 10f, MinAltitude = 75f, InForest = false } }, new MWLLocation { Name = "MWL_MountainDvergrShrine1", AssetPath = "Assets/WarpProjects/More World Locations/Mountain/MWL_MountainDvergrShrine1.prefab", Config = new LocationConfig { Biome = (Biome)4, Priotized = true, ExteriorRadius = 20f, ClearArea = true, RandomRotation = false, Group = "Shrine", MinDistanceFromSimilar = 1024f, MaxTerrainDelta = 4f, MinAltitude = 2f, MinDistance = LocationRings.Ring5.MinDistance, MaxDistance = LocationRings.Ring7.MaxDistance, BiomeArea = (BiomeArea)2 } }, new MWLLocation { Name = "MWL_MountainDvergrShrine2", AssetPath = "Assets/WarpProjects/More World Locations/Mountain/MWL_MountainDvergrShrine2.prefab", Config = new LocationConfig { Biome = (Biome)4, Priotized = true, ExteriorRadius = 20f, ClearArea = true, RandomRotation = false, Group = "Shrine", MinDistanceFromSimilar = 1024f, MaxTerrainDelta = 4f, MinAltitude = 2f, MinDistance = LocationRings.Ring5.MinDistance, MaxDistance = LocationRings.Ring7.MaxDistance, BiomeArea = (BiomeArea)2 } }, new MWLLocation { Name = "MWL_MountainOverlook1", AssetPath = "Assets/WarpProjects/More World Locations/Mountain/MWL_MountainOverlook1.prefab", Config = new LocationConfig { Biome = (Biome)4, Priotized = true, ExteriorRadius = 15f, ClearArea = true, RandomRotation = false, Group = "Mountain_medium", MinDistanceFromSimilar = 512f, MaxTerrainDelta = 4f, MinAltitude = 2f, MinDistance = LocationRings.Ring2.MinDistance, MaxDistance = LocationRings.Ring7.MaxDistance } }, new MWLLocation { Name = "MWL_MountainCultShrine1", AssetPath = "Assets/WarpProjects/More World Locations/Mountain/MWL_MountainCultShrine1.prefab", Config = new LocationConfig { Biome = (Biome)4, Priotized = true, ExteriorRadius = 15f, ClearArea = true, RandomRotation = false, Group = "Shrine", MinDistanceFromSimilar = 512f, MaxTerrainDelta = 2f, MinAltitude = 2f, MinDistance = LocationRings.Ring2.MinDistance, MaxDistance = LocationRings.Ring7.MaxDistance } }, new MWLLocation { Name = "MWL_RuinsChurch2", AssetPath = "Assets/WarpProjects/More World Locations/Mountain/MWL_RuinsChurch2.prefab", Config = new LocationConfig { Biome = (Biome)4, Priotized = true, ExteriorRadius = 15f, ClearArea = true, RandomRotation = false, Group = "Mountain_medium", MinDistanceFromSimilar = 512f, MaxTerrainDelta = 2f, MinAltitude = 2f, MinDistance = LocationRings.Ring2.MinDistance, MaxDistance = LocationRings.Ring7.MaxDistance } }, new MWLLocation { Name = "MWL_MountainShrine1", AssetPath = "Assets/WarpProjects/More World Locations/Mountain/MWL_MountainShrine1.prefab", Config = new LocationConfig { Biome = (Biome)4, Priotized = true, ExteriorRadius = 20f, ClearArea = true, RandomRotation = false, Group = "Shrine", MinDistanceFromSimilar = 512f, MaxTerrainDelta = 4f, MinAltitude = 2f, MinDistance = LocationRings.Ring4.MinDistance, MaxDistance = LocationRings.Ring7.MaxDistance } }, new MWLLocation { Name = "MWL_MountainsAedicule1", AssetPath = "Assets/WarpProjects/More World Locations/Mountain/MWL_MountainsAedicule1.prefab", Config = new LocationConfig { Biome = (Biome)4, Priotized = true, ExteriorRadius = 10f, ClearArea = true, RandomRotation = false, Group = "Shrine", MinDistanceFromSimilar = 512f, MaxTerrainDelta = 4f, MinAltitude = 2f, MinDistance = LocationRings.Ring2.MinDistance, MaxDistance = LocationRings.Ring7.MaxDistance } } }; public static readonly MWLLocation[] Plains = new MWLLocation[26] { new MWLLocation { Name = "MWL_GoblinFort1", AssetPath = "Assets/WarpProjects/More World Locations/Plains/MWL_GoblinFort1.prefab", Config = new LocationConfig { Biome = (Biome)16, Group = "PlainsFort", Priotized = true, RandomRotation = false, ExteriorRadius = 8f, ClearArea = true, MinDistanceFromSimilar = 1024f, MinTerrainDelta = 0f, MaxTerrainDelta = 10f, MinAltitude = 0f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)2 } }, new MWLLocation { Name = "MWL_PlainsArena2", AssetPath = "Assets/WarpProjects/More World Locations/Plains/MWL_PlainsArena2.prefab", Config = new LocationConfig { Biome = (Biome)16, Group = "PlainsFort", Priotized = true, RandomRotation = false, ExteriorRadius = 22f, ClearArea = true, MinDistanceFromSimilar = 1024f, MinTerrainDelta = 0f, MaxTerrainDelta = 10f, MinAltitude = 2f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)2 } }, new MWLLocation { Name = "MWL_FulingRock1", AssetPath = "Assets/WarpProjects/More World Locations/Plains/MWL_FulingRock1.prefab", Config = new LocationConfig { Biome = (Biome)16, Group = "PlainsRock", Priotized = true, RandomRotation = false, ExteriorRadius = 8f, ClearArea = true, MinDistanceFromSimilar = 1024f, MinTerrainDelta = 0f, MaxTerrainDelta = 6f, MinAltitude = 0f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)3 } }, new MWLLocation { Name = "MWL_FulingTarPit1", AssetPath = "Assets/WarpProjects/More World Locations/Plains/MWL_FulingTarPit1.prefab", Config = new LocationConfig { Biome = (Biome)16, Group = "PlainsCamp", Priotized = true, RandomRotation = false, ExteriorRadius = 20f, ClearArea = true, MinDistanceFromSimilar = 1024f, MinTerrainDelta = 0f, MaxTerrainDelta = 8f, MinAltitude = 2f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)2 } }, new MWLLocation { Name = "MWL_FulingVillage1", AssetPath = "Assets/WarpProjects/More World Locations/Plains/MWL_FulingVillage1.prefab", Config = new LocationConfig { Biome = (Biome)16, Group = "PlainsVillage", Priotized = true, RandomRotation = false, ExteriorRadius = 8f, ClearArea = true, MinDistanceFromSimilar = 1024f, MinTerrainDelta = 0f, MaxTerrainDelta = 10f, MinAltitude = 0f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)2 } }, new MWLLocation { Name = "MWL_FulingVillage2", AssetPath = "Assets/WarpProjects/More World Locations/Plains/MWL_FulingVillage2.prefab", Config = new LocationConfig { Biome = (Biome)16, Group = "PlainsVillage", Priotized = true, RandomRotation = false, ExteriorRadius = 8f, ClearArea = true, MinDistanceFromSimilar = 1024f, MinTerrainDelta = 0f, MaxTerrainDelta = 10f, MinAltitude = 0f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)2 } }, new MWLLocation { Name = "MWL_PlainsPillar1", AssetPath = "Assets/WarpProjects/More World Locations/Plains/MWL_PlainsPillar1.prefab", Config = new LocationConfig { Biome = (Biome)16, Group = "PlainsRock", Priotized = true, RandomRotation = false, ExteriorRadius = 8f, ClearArea = true, MinDistanceFromSimilar = 1024f, MinTerrainDelta = 0f, MaxTerrainDelta = 10f, MinAltitude = 0f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)3 } }, new MWLLocation { Name = "MWL_FulingTemple1", AssetPath = "Assets/WarpProjects/More World Locations/Plains/MWL_FulingTemple1.prefab", Config = new LocationConfig { Biome = (Biome)16, Group = "PlainsTemple", Priotized = true, RandomRotation = false, ExteriorRadius = 8f, ClearArea = true, MinDistanceFromSimilar = 1024f, MinTerrainDelta = 0f, MaxTerrainDelta = 10f, MinAltitude = 0f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)3 } }, new MWLLocation { Name = "MWL_FulingTemple2", AssetPath = "Assets/WarpProjects/More World Locations/Plains/MWL_FulingTemple2.prefab", Config = new LocationConfig { Biome = (Biome)16, Group = "PlainsTemple", Priotized = true, RandomRotation = false, ExteriorRadius = 8f, ClearArea = true, MinDistanceFromSimilar = 1024f, MinTerrainDelta = 0f, MaxTerrainDelta = 6f, MinAltitude = 0f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)3 } }, new MWLLocation { Name = "MWL_FulingTemple3", AssetPath = "Assets/WarpProjects/More World Locations/Plains/MWL_FulingTemple3.prefab", Config = new LocationConfig { Biome = (Biome)16, Group = "PlainsTemple", Priotized = true, RandomRotation = false, ExteriorRadius = 8f, ClearArea = true, MinDistanceFromSimilar = 1024f, MaxTerrainDelta = 5f, MinAltitude = 0f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)3 } }, new MWLLocation { Name = "MWL_FulingTempleBroken1", AssetPath = "Assets/WarpProjects/More World Locations/Plains/MWL_FulingTempleBroken1.prefab", Config = new LocationConfig { Biome = (Biome)16, Group = "PlainsTemple", Priotized = true, RandomRotation = false, ExteriorRadius = 8f, ClearArea = true, MinDistanceFromSimilar = 1024f, MaxTerrainDelta = 4f, MinAltitude = 0f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)3 } }, new MWLLocation { Name = "MWL_FulingTemple4", AssetPath = "Assets/WarpProjects/More World Locations/Plains/MWL_FulingTemple4.prefab", Config = new LocationConfig { Biome = (Biome)16, Group = "PlainsTemple", Priotized = true, RandomRotation = false, ExteriorRadius = 8f, ClearArea = true, MinDistanceFromSimilar = 1024f, MaxTerrainDelta = 3f, MinAltitude = 0f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)3 } }, new MWLLocation { Name = "MWL_PlainsOracle1", AssetPath = "Assets/WarpProjects/More World Locations/Plains/MWL_PlainsOracle1.prefab", Config = new LocationConfig { Biome = (Biome)16, Group = "PlainsTemple", Priotized = true, RandomRotation = false, ExteriorRadius = 26f, ClearArea = true, MinDistanceFromSimilar = 1024f, MinTerrainDelta = 0f, MaxTerrainDelta = 6f, MinAltitude = 0f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)3 } }, new MWLLocation { Name = "MWL_FulingWall1", AssetPath = "Assets/WarpProjects/More World Locations/Plains/MWL_FulingWall1.prefab", Config = new LocationConfig { Biome = (Biome)16, Group = "PlainsCamp", Priotized = true, RandomRotation = false, ExteriorRadius = 8f, ClearArea = true, MinDistanceFromSimilar = 1024f, MinTerrainDelta = 0f, MaxTerrainDelta = 10f, MinAltitude = 0f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)3 } }, new MWLLocation { Name = "MWL_FulingTower1", AssetPath = "Assets/WarpProjects/More World Locations/Plains/MWL_FulingTower1.prefab", Config = new LocationConfig { Biome = (Biome)16, Group = "PlainsCamp", Priotized = true, RandomRotation = false, ExteriorRadius = 8f, ClearArea = true, MinDistanceFromSimilar = 1024f, MaxTerrainDelta = 8f, MinAltitude = 0f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)3 } }, new MWLLocation { Name = "MWL_RockGarden1", AssetPath = "Assets/WarpProjects/More World Locations/Plains/MWL_RockGarden1.prefab", Config = new LocationConfig { Biome = (Biome)16, Group = "PlainsRock", Priotized = true, RandomRotation = false, ExteriorRadius = 8f, ClearArea = true, MinDistanceFromSimilar = 1024f, MaxTerrainDelta = 6f, MinAltitude = 0f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)2 } }, new MWLLocation { Name = "MWL_MinddripHallow1", AssetPath = "Assets/WarpProjects/More World Locations/Plains/MWL_MinddripHallow1.prefab", Config = new LocationConfig { Biome = (Biome)16, Group = "PlainsInterior", Priotized = true, RandomRotation = false, ExteriorRadius = 8f, ClearArea = true, MinDistanceFromSimilar = 1024f, MaxTerrainDelta = 4f, MinAltitude = 8f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)2 } }, new MWLLocation { Name = "MWL_StoneTopHouse1", AssetPath = "Assets/WarpProjects/More World Locations/Plains/MWL_StoneTopHouse1.prefab", Config = new LocationConfig { Biome = (Biome)16, Group = "PlainsHouse", Priotized = true, RandomRotation = false, ExteriorRadius = 8f, ClearArea = true, MinDistanceFromSimilar = 1024f, MaxTerrainDelta = 4f, MinAltitude = 0f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)3 } }, new MWLLocation { Name = "MWL_FulingTemple5", AssetPath = "Assets/WarpProjects/More World Locations/Plains/MWL_FulingTemple5.prefab", Config = new LocationConfig { Biome = (Biome)16, Group = "PlainsTemple", Priotized = true, RandomRotation = false, ExteriorRadius = 8f, ClearArea = true, MinDistanceFromSimilar = 1024f, MaxTerrainDelta = 4f, MinAltitude = 0f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)3 } }, new MWLLocation { Name = "MWL_FulingStoneHouse1", AssetPath = "Assets/WarpProjects/More World Locations/Plains/MWL_FulingStoneHouse1.prefab", Config = new LocationConfig { Biome = (Biome)16, Group = "PlainsHouse", Priotized = true, RandomRotation = false, ExteriorRadius = 8f, ClearArea = true, MinDistanceFromSimilar = 1024f, MaxTerrainDelta = 3f, MinAltitude = 1f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)3 } }, new MWLLocation { Name = "MWL_FulingStoneHouse2", AssetPath = "Assets/WarpProjects/More World Locations/Plains/MWL_FulingStoneHouse2.prefab", Config = new LocationConfig { Biome = (Biome)16, Group = "PlainsHouse", Priotized = true, RandomRotation = false, ExteriorRadius = 8f, ClearArea = true, MinDistanceFromSimilar = 1024f, MaxTerrainDelta = 3f, MinAltitude = 1f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)3 } }, new MWLLocation { Name = "MWL_FulingStoneHouse3", AssetPath = "Assets/WarpProjects/More World Locations/Plains/MWL_FulingStoneHouse3.prefab", Config = new LocationConfig { Biome = (Biome)16, Group = "PlainsHouse", Priotized = true, RandomRotation = false, ExteriorRadius = 8f, ClearArea = true, MinDistanceFromSimilar = 1024f, MaxTerrainDelta = 3f, MinAltitude = 1f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)3 } }, new MWLLocation { Name = "MWL_FulingStoneHouse4", AssetPath = "Assets/WarpProjects/More World Locations/Plains/MWL_FulingStoneHouse4.prefab", Config = new LocationConfig { Biome = (Biome)16, Group = "PlainsHouse", Priotized = true, RandomRotation = false, ExteriorRadius = 8f, ClearArea = true, MinDistanceFromSimilar = 1024f, MaxTerrainDelta = 4f, MinAltitude = 1f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)3 } }, new MWLLocation { Name = "MWL_FulingStoneHouse5", AssetPath = "Assets/WarpProjects/More World Locations/Plains/MWL_FulingStoneHouse5.prefab", Config = new LocationConfig { Biome = (Biome)16, Group = "PlainsHouse", Priotized = true, RandomRotation = false, ExteriorRadius = 8f, ClearArea = true, MinDistanceFromSimilar = 1024f, MaxTerrainDelta = 4f, MinAltitude = 1f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)3 } }, new MWLLocation { Name = "MWL_FulingStoneOpen1", AssetPath = "Assets/WarpProjects/More World Locations/Plains/MWL_FulingStoneOpen1.prefab", Config = new LocationConfig { Biome = (Biome)16, Group = "PlainsHouse", Priotized = true, RandomRotation = false, ExteriorRadius = 8f, ClearArea = true, MinDistanceFromSimilar = 1024f, MaxTerrainDelta = 4f, MinAltitude = 0f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)3 } }, new MWLLocation { Name = "MWL_FulingStoneOpen2", AssetPath = "Assets/WarpProjects/More World Locations/Plains/MWL_FulingStoneOpen2.prefab", Config = new LocationConfig { Biome = (Biome)16, Group = "PlainsHouse", Priotized = true, RandomRotation = false, ExteriorRadius = 8f, ClearArea = true, MinDistanceFromSimilar = 1024f, MaxTerrainDelta = 4f, MinAltitude = 0f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)3 } } }; public static readonly MWLLocation[] Mistlands = new MWLLocation[21] { new MWLLocation { Name = "MWL_MistFort2", AssetPath = "Assets/WarpProjects/More World Locations/Mistlands/MWL_MistFort2.prefab", Config = new LocationConfig { Biome = (Biome)512, Priotized = true, ExteriorRadius = 8f, ClearArea = true, RandomRotation = false, Group = "Mist3", MinDistanceFromSimilar = 256f, MinTerrainDelta = 0f, MaxTerrainDelta = 15f, MinAltitude = 0f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)3 } }, new MWLLocation { Name = "MWL_SecretRoom1", AssetPath = "Assets/WarpProjects/More World Locations/Mistlands/MWL_SecretRoom1.prefab", Config = new LocationConfig { Biome = (Biome)512, Priotized = true, ExteriorRadius = 15f, ClearArea = true, RandomRotation = false, Group = "Mist1", MinDistanceFromSimilar = 256f, MinTerrainDelta = 0f, MaxTerrainDelta = 15f, MinAltitude = 0f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)3 } }, new MWLLocation { Name = "MWL_MistWorkshop1", AssetPath = "Assets/WarpProjects/More World Locations/Mistlands/MWL_MistWorkshop1.prefab", Config = new LocationConfig { Biome = (Biome)512, Priotized = true, ExteriorRadius = 15f, ClearArea = true, RandomRotation = false, Group = "Mist2", MinDistanceFromSimilar = 256f, MinTerrainDelta = 0f, MaxTerrainDelta = 10f, MinAltitude = 1f, MaxAltitude = 6f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)3 } }, new MWLLocation { Name = "MWL_MistTower1", AssetPath = "Assets/WarpProjects/More World Locations/Mistlands/MWL_MistTower1.prefab", Config = new LocationConfig { Biome = (Biome)512, Priotized = true, ExteriorRadius = 15f, ClearArea = true, RandomRotation = false, Group = "Mist3", MinDistanceFromSimilar = 256f, MinTerrainDelta = 0f, MaxTerrainDelta = 15f, MinAltitude = 0f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)3 } }, new MWLLocation { Name = "MWL_MistWall1", AssetPath = "Assets/WarpProjects/More World Locations/Mistlands/MWL_MistWall1.prefab", Config = new LocationConfig { Biome = (Biome)512, Priotized = true, ExteriorRadius = 15f, ClearArea = true, RandomRotation = false, Group = "Mist2", MinDistanceFromSimilar = 256f, MinTerrainDelta = 0f, MaxTerrainDelta = 8f, MinAltitude = 1f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)3 } }, new MWLLocation { Name = "MWL_MistTower2", AssetPath = "Assets/WarpProjects/More World Locations/Mistlands/MWL_MistTower2.prefab", Config = new LocationConfig { Biome = (Biome)512, Priotized = true, ExteriorRadius = 15f, ClearArea = true, RandomRotation = false, Group = "Mist3", MinDistanceFromSimilar = 256f, MinTerrainDelta = 0f, MaxTerrainDelta = 15f, MinAltitude = -2f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)3 } }, new MWLLocation { Name = "MWL_MistHut1", AssetPath = "Assets/WarpProjects/More World Locations/Mistlands/MWL_MistHut1.prefab", Config = new LocationConfig { Biome = (Biome)512, Priotized = true, ExteriorRadius = 15f, ClearArea = true, RandomRotation = false, Group = "Mist3", MinDistanceFromSimilar = 256f, MinTerrainDelta = 0f, MaxTerrainDelta = 15f, MinAltitude = 5f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)3 } }, new MWLLocation { Name = "MWL_DvergrEitrSingularity1", AssetPath = "Assets/WarpProjects/More World Locations/Mistlands/MWL_DvergrEitrSingularity1.prefab", Config = new LocationConfig { Biome = (Biome)512, Priotized = true, ExteriorRadius = 15f, ClearArea = true, RandomRotation = false, Group = "Mist5", MinDistanceFromSimilar = 512f, MinTerrainDelta = 0f, MaxTerrainDelta = 15f, MinAltitude = 5f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)3 } }, new MWLLocation { Name = "MWL_DvergrHouse1", AssetPath = "Assets/WarpProjects/More World Locations/Mistlands/MWL_DvergrHouse1.prefab", Config = new LocationConfig { Biome = (Biome)512, Priotized = true, ExteriorRadius = 15f, ClearArea = true, RandomRotation = false, Group = "Mist4", MinDistanceFromSimilar = 512f, MinTerrainDelta = 0f, MaxTerrainDelta = 15f, MinAltitude = 5f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)1 } }, new MWLLocation { Name = "MWL_DvergrHouseWood1", AssetPath = "Assets/WarpProjects/More World Locations/Mistlands/MWL_DvergrHouseWood1.prefab", Config = new LocationConfig { Biome = (Biome)512, Priotized = true, ExteriorRadius = 15f, ClearArea = true, RandomRotation = false, Group = "Mist4", MinDistanceFromSimilar = 512f, MinTerrainDelta = 0f, MaxTerrainDelta = 8f, MinAltitude = 2f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)3 } }, new MWLLocation { Name = "MWL_DvergrHouseWood2", AssetPath = "Assets/WarpProjects/More World Locations/Mistlands/MWL_DvergrHouseWood2.prefab", Config = new LocationConfig { Biome = (Biome)512, Priotized = true, ExteriorRadius = 15f, ClearArea = true, RandomRotation = false, Group = "Mist4", MinDistanceFromSimilar = 512f, MinTerrainDelta = 0f, MaxTerrainDelta = 8f, MinAltitude = 2f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)3 } }, new MWLLocation { Name = "MWL_MarbleJail1", AssetPath = "Assets/WarpProjects/More World Locations/Mistlands/MWL_MarbleJail1.prefab", Config = new LocationConfig { Biome = (Biome)512, Priotized = true, ExteriorRadius = 15f, ClearArea = true, RandomRotation = false, Group = "Mist4", MinDistanceFromSimilar = 512f, MinTerrainDelta = 0f, MaxTerrainDelta = 8f, MinAltitude = 2f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)3 } }, new MWLLocation { Name = "MWL_MarbleHome1", AssetPath = "Assets/WarpProjects/More World Locations/Mistlands/MWL_MarbleHome1.prefab", Config = new LocationConfig { Biome = (Biome)512, Priotized = true, ExteriorRadius = 15f, ClearArea = true, RandomRotation = false, Group = "Mist4", MinDistanceFromSimilar = 512f, MinTerrainDelta = 0f, MinAltitude = 0f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)3 } }, new MWLLocation { Name = "MWL_MarbleHome2", AssetPath = "Assets/WarpProjects/More World Locations/Mistlands/MWL_MarbleHome2.prefab", Config = new LocationConfig { Biome = (Biome)512, Priotized = true, ExteriorRadius = 15f, ClearArea = true, RandomRotation = false, Group = "Mist4", MinDistanceFromSimilar = 512f, MinTerrainDelta = 0f, MinAltitude = 0f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)3 } }, new MWLLocation { Name = "MWL_MarbleCliffAltar1", AssetPath = "Assets/WarpProjects/More World Locations/Mistlands/MWL_MarbleCliffAltar1.prefab", Config = new LocationConfig { Biome = (Biome)512, Priotized = true, ExteriorRadius = 15f, ClearArea = true, RandomRotation = false, Group = "Mist4", MinDistanceFromSimilar = 512f, MinTerrainDelta = 0f, MinAltitude = 0f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)3 } }, new MWLLocation { Name = "MWL_MistPond1", AssetPath = "Assets/WarpProjects/More World Locations/Mistlands/MWL_MistPond1.prefab", Config = new LocationConfig { Biome = (Biome)512, Priotized = true, ExteriorRadius = 15f, ClearArea = true, RandomRotation = false, Group = "Mist4", MinDistanceFromSimilar = 512f, MinTerrainDelta = 0f, MinAltitude = 0f, MaxAltitude = 4f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)2 } }, new MWLLocation { Name = "MWL_MarbleCage1", AssetPath = "Assets/WarpProjects/More World Locations/Mistlands/MWL_MarbleCage1.prefab", Config = new LocationConfig { Biome = (Biome)512, Priotized = true, ExteriorRadius = 15f, ClearArea = true, RandomRotation = false, Group = "Mist4", MinDistanceFromSimilar = 512f, MinTerrainDelta = 0f, MinAltitude = 0f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)3 } }, new MWLLocation { Name = "MWL_DvergrKnowledgeExtractor1", AssetPath = "Assets/WarpProjects/More World Locations/Mistlands/MWL_DvergrKnowledgeExtractor1.prefab", Config = new LocationConfig { Biome = (Biome)512, Priotized = true, ExteriorRadius = 15f, ClearArea = true, RandomRotation = false, Group = "Mist5", MinDistanceFromSimilar = 512f, MinTerrainDelta = 0f, MaxTerrainDelta = 15f, MinAltitude = 5f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)2 } }, new MWLLocation { Name = "MWL_AncientShrine1", AssetPath = "Assets/WarpProjects/More World Locations/Mistlands/MWL_AncientShrine1.prefab", Config = new LocationConfig { Biome = (Biome)512, Priotized = true, ExteriorRadius = 15f, ClearArea = true, RandomRotation = false, Group = "Mist6", MinDistanceFromSimilar = 512f, MaxTerrainDelta = 15f, MinAltitude = -2f, MaxAltitude = 2f, InForest = false, BiomeArea = (BiomeArea)1 } }, new MWLLocation { Name = "MWL_MistShrine1", AssetPath = "Assets/WarpProjects/More World Locations/Mistlands/MWL_MistShrine1.prefab", Config = new LocationConfig { Biome = (Biome)512, Priotized = true, ExteriorRadius = 15f, ClearArea = true, RandomRotation = false, Group = "Mist6", MinDistanceFromSimilar = 512f, MaxTerrainDelta = 15f, MaxAltitude = 20f, MinAltitude = 3f, InForest = false, BiomeArea = (BiomeArea)2 } }, new MWLLocation { Name = "MWL_MistHut2", AssetPath = "Assets/WarpProjects/More World Locations/Mistlands/MWL_MistHut2.prefab", Config = new LocationConfig { Biome = (Biome)512, Priotized = true, ExteriorRadius = 20f, ClearArea = true, RandomRotation = false, Group = "Camp", MinDistanceFromSimilar = 512f, MaxTerrainDelta = 5f, MinAltitude = 5f, MinDistance = LocationRings.Ring1.MinDistance, MaxDistance = LocationRings.Ring7.MaxDistance } } }; public static readonly MWLLocation[] Ashlands = new MWLLocation[6] { new MWLLocation { Name = "MWL_AshlandsFort1", AssetPath = "Assets/WarpProjects/More World Locations/Ashlands/MWL_AshlandsFort1.prefab", Config = new LocationConfig { Biome = (Biome)32, Priotized = true, ClearArea = true, RandomRotation = false, Group = "Ashlands_Fort", MinDistanceFromSimilar = 512f, MaxTerrainDelta = 5f, MinAltitude = 1f, InForest = false } }, new MWLLocation { Name = "MWL_AshlandsFort2", AssetPath = "Assets/WarpProjects/More World Locations/Ashlands/MWL_AshlandsFort2.prefab", Config = new LocationConfig { Biome = (Biome)32, Priotized = true, ClearArea = true, RandomRotation = false, Group = "Ashlands_Fort", MinDistanceFromSimilar = 512f, MaxTerrainDelta = 5f, MinAltitude = 1f, InForest = false } }, new MWLLocation { Name = "MWL_AshlandsFort3", AssetPath = "Assets/WarpProjects/More World Locations/Ashlands/MWL_AshlandsFort3.prefab", Config = new LocationConfig { Biome = (Biome)32, Priotized = true, ClearArea = true, RandomRotation = false, Group = "Ashlands_Fort", MinDistanceFromSimilar = 512f, MaxTerrainDelta = 5f, MinAltitude = 1f, InForest = false } }, new MWLLocation { Name = "MWL_AshTower1", AssetPath = "Assets/WarpProjects/More World Locations/Ashlands/MWL_AshTower1.prefab", Config = new LocationConfig { Biome = (Biome)32, Priotized = true, ClearArea = true, RandomRotation = false, Group = "Ashlands_Tower", MinDistanceFromSimilar = 512f, MaxTerrainDelta = 5f, MinAltitude = 1f, InForest = false } }, new MWLLocation { Name = "MWL_AshlandsFort4", AssetPath = "Assets/WarpProjects/More World Locations/Ashlands/MWL_AshlandsFort4.prefab", Config = new LocationConfig { Biome = (Biome)32, Priotized = true, ClearArea = true, RandomRotation = false, Group = "Ashlands_Fort", MinDistanceFromSimilar = 512f, MaxTerrainDelta = 5f, MinAltitude = 1f, InForest = false } }, new MWLLocation { Name = "MWL_AshWallPost1", AssetPath = "Assets/WarpProjects/More World Locations/Ashlands/MWL_AshWallPost1.prefab", Config = new LocationConfig { Biome = (Biome)32, Priotized = true, ClearArea = true, RandomRotation = false, Group = "Ashlands_Fort", MinDistanceFromSimilar = 512f, MaxTerrainDelta = 5f, MinAltitude = 1f, InForest = false } } }; public static readonly MWLLocation[] Ports = new MWLLocation[5] { new MWLLocation { Name = "MWL_Port1", AssetPath = "Assets/WarpProjects/More World Locations/Ports/MWL_Port1.prefab", Config = new LocationConfig { Biome = (Biome)1, Priotized = true, ExteriorRadius = 20f, ClearArea = true, RandomRotation = false, MinDistanceFromSimilar = 1024f, MaxTerrainDelta = 3f, MinAltitude = -2f, MaxAltitude = 1f, SlopeRotation = true, Group = "MWL_Ports" } }, new MWLLocation { Name = "MWL_Port2", AssetPath = "Assets/WarpProjects/More World Locations/Ports/MWL_Port2.prefab", Config = new LocationConfig { Biome = (Biome)16, Priotized = true, ExteriorRadius = 20f, ClearArea = true, RandomRotation = false, MinDistanceFromSimilar = 1024f, MaxTerrainDelta = 3f, MinAltitude = -2f, MaxAltitude = 1f, SlopeRotation = true, Group = "MWL_Ports", BiomeArea = (BiomeArea)1 } }, new MWLLocation { Name = "MWL_Port3", AssetPath = "Assets/WarpProjects/More World Locations/Ports/MWL_Port3.prefab", Config = new LocationConfig { Biome = (Biome)512, Priotized = true, ExteriorRadius = 20f, ClearArea = true, RandomRotation = false, MinDistanceFromSimilar = 1024f, MaxTerrainDelta = 10f, MinAltitude = -1f, MaxAltitude = 2f, SlopeRotation = true, Group = "MWL_Ports" } }, new MWLLocation { Name = "MWL_Port4", AssetPath = "Assets/WarpProjects/More World Locations/Ports/MWL_Port4.prefab", Config = new LocationConfig { Biome = (Biome)8, Priotized = true, ExteriorRadius = 20f, ClearArea = true, RandomRotation = false, MinDistanceFromSimilar = 1024f, MaxTerrainDelta = 4f, MinAltitude = -1f, MaxAltitude = 1f, SlopeRotation = true, Group = "MWL_Ports" } }, new MWLLocation { Name = "MWL_Port5", AssetPath = "Assets/WarpProjects/More World Locations/Ports/MWL_Port5.prefab", Config = new LocationConfig { Biome = (Biome)32, Priotized = true, ExteriorRadius = 20f, ClearArea = true, RandomRotation = false, MinDistanceFromSimilar = 1024f, MaxTerrainDelta = 6f, MinAltitude = -0.5f, MaxAltitude = 2f, SlopeRotation = true, Group = "MWL_Ports", MaxDistance = 9100f } } }; public static readonly MWLLocation[] Traders = new MWLLocation[7] { new MWLLocation { Name = "MWL_PlainsTavern1", AssetPath = "Assets/WarpProjects/MoreWorldTraders/MWL_PlainsTavern1.prefab", Config = new LocationConfig { Biome = (Biome)16, Priotized = true, ExteriorRadius = 32f, ClearArea = true, RandomRotation = false, Group = "MWL_Trader", MinDistanceFromSimilar = 1024f, MinTerrainDelta = 0f, MaxTerrainDelta = 5f, MinAltitude = 0f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)2, Unique = true, IconPlaced = true } }, new MWLLocation { Name = "MWL_OceanTavern1", AssetPath = "Assets/WarpProjects/MoreWorldTraders/MWL_OceanTavern1.prefab", Config = new LocationConfig { Biome = (Biome)256, Priotized = true, ExteriorRadius = 50f, ClearArea = false, RandomRotation = false, Group = "MWL_Trader", MinDistanceFromSimilar = 1024f, MinDistance = LocationRings.Ring2.MinDistance, BiomeArea = (BiomeArea)2, Unique = true, IconPlaced = true } }, new MWLLocation { Name = "MWL_PlainsCamp1", AssetPath = "Assets/WarpProjects/MoreWorldTraders/MWL_PlainsCamp1.prefab", Config = new LocationConfig { Biome = (Biome)16, Priotized = true, ExteriorRadius = 20f, ClearArea = true, RandomRotation = false, Group = "MWL_Trader", MinDistanceFromSimilar = 1024f, MinTerrainDelta = 0f, MaxTerrainDelta = 5f, MinAltitude = 0f, MinDistance = LocationRings.Ring2.MinDistance, BiomeArea = (BiomeArea)2, Unique = true, IconPlaced = true } }, new MWLLocation { Name = "MWL_BlackForestBlacksmith1", AssetPath = "Assets/WarpProjects/MoreWorldTraders/MWL_BlackForestBlacksmith1.prefab", Config = new LocationConfig { Biome = (Biome)8, Priotized = true, ExteriorRadius = 20f, ClearArea = true, RandomRotation = false, Group = "MWL_Trader", MinDistanceFromSimilar = 1024f, MinTerrainDelta = 0f, MaxTerrainDelta = 6f, MinAltitude = 0f, MinDistance = LocationRings.Ring2.MinDistance, BiomeArea = (BiomeArea)2, Unique = true, IconPlaced = true } }, new MWLLocation { Name = "MWL_BlackForestBlacksmith2", AssetPath = "Assets/WarpProjects/MoreWorldTraders/MWL_BlackForestBlacksmith2.prefab", Config = new LocationConfig { Biome = (Biome)8, Priotized = true, ExteriorRadius = 20f, ClearArea = true, RandomRotation = false, Group = "MWL_Trader", MinDistanceFromSimilar = 1024f, MinTerrainDelta = 0f, MaxTerrainDelta = 6f, MinAltitude = 0f, MinDistance = LocationRings.Ring2.MinDistance, BiomeArea = (BiomeArea)2, Unique = true, IconPlaced = true } }, new MWLLocation { Name = "MWL_MountainsBlacksmith1", AssetPath = "Assets/WarpProjects/MoreWorldTraders/MWL_MountainsBlacksmith1.prefab", Config = new LocationConfig { Biome = (Biome)4, Priotized = true, ExteriorRadius = 20f, ClearArea = true, RandomRotation = false, Group = "MWL_Trader", MinDistanceFromSimilar = 1024f, MinTerrainDelta = 0f, MaxTerrainDelta = 6f, MinAltitude = 0f, MinDistance = LocationRings.Ring2.MinDistance, BiomeArea = (BiomeArea)2, Unique = true, IconPlaced = true } }, new MWLLocation { Name = "MWL_MistlandsBlacksmith1", AssetPath = "Assets/WarpProjects/MoreWorldTraders/MWL_MistlandsBlacksmith1.prefab", Config = new LocationConfig { Biome = (Biome)512, Priotized = true, ExteriorRadius = 20f, ClearArea = true, RandomRotation = false, Group = "MWL_Trader", MinDistanceFromSimilar = 1024f, MinTerrainDelta = 0f, MaxTerrainDelta = 12f, MinAltitude = 1f, InForest = false, BiomeArea = (BiomeArea)2, Unique = true, IconPlaced = true } } }; public static readonly MWLLocation[] Trainers = new MWLLocation[4] { new MWLLocation { Name = "MWL_MeadowsTrainer1", AssetPath = "Assets/WarpProjects/MoreWorldTraders/MWL_MeadowsTrainer1.prefab", Config = new LocationConfig { Biome = (Biome)1, Priotized = true, ExteriorRadius = 20f, ClearArea = true, RandomRotation = false, Group = "MWL_Trader", MinDistanceFromSimilar = 1024f, MinTerrainDelta = 0f, MaxTerrainDelta = 5f, MinAltitude = 1f, MinDistance = LocationRings.Ring3.MinDistance, InForest = false, BiomeArea = (BiomeArea)2, Unique = true, IconPlaced = true } }, new MWLLocation { Name = "MWL_SwampTrainer1", AssetPath = "Assets/WarpProjects/MoreWorldTraders/MWL_SwampTrainer1.prefab", Config = new LocationConfig { Biome = (Biome)2, Priotized = true, ExteriorRadius = 20f, ClearArea = true, RandomRotation = false, Group = "MWL_Trader", MinDistanceFromSimilar = 1024f, MinTerrainDelta = 0f, MaxTerrainDelta = 8f, MinAltitude = 0f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)2, Unique = true, IconPlaced = true } }, new MWLLocation { Name = "MWL_PlainsTrainer1", AssetPath = "Assets/WarpProjects/MoreWorldTraders/MWL_PlainsTrainer1.prefab", Config = new LocationConfig { Biome = (Biome)16, Priotized = true, ExteriorRadius = 20f, ClearArea = true, RandomRotation = false, Group = "MWL_Trader", MinDistanceFromSimilar = 1024f, MinTerrainDelta = 0f, MaxTerrainDelta = 5f, MinAltitude = 0f, MinDistance = LocationRings.Ring2.MinDistance, InForest = false, BiomeArea = (BiomeArea)2, Unique = true, IconPlaced = true } }, new MWLLocation { Name = "MWL_MistTrainer1", AssetPath = "Assets/WarpProjects/MoreWorldTraders/MWL_MistTrainer1.prefab", Config = new LocationConfig { Biome = (Biome)512, Priotized = true, ExteriorRadius = 20f, ClearArea = true, RandomRotation = false, Group = "MWL_Trader", MinDistanceFromSimilar = 1024f, MinTerrainDelta = 0f, MaxTerrainDelta = 12f, MinAltitude = -3f, MaxAltitude = 0f, InForest = false, BiomeArea = (BiomeArea)3, Unique = true, IconPlaced = true } } }; } public static class LocationQuantityManager { private const int CurrentVersion = 1; private static readonly string YamlFilePath = Path.Combine(Paths.ConfigPath, "warpalicious.More_World_Locations_LocationConfigs.yml"); private static Dictionary _quantities = new Dictionary(); private static Dictionary _biomeByLocation = new Dictionary(); private static bool _defaultsLoaded; private static readonly string[] BiomeOrder = new string[10] { "Meadows", "BlackForest", "Swamp", "Mountains", "Plains", "Mistlands", "Ashlands", "Ports", "Traders", "Trainers" }; private static readonly HashSet OldBepInExSections = new HashSet { "MWL_Ruins1", "MWL_Ruins2", "MWL_Ruins3", "MWL_Ruins6", "MWL_Ruins7", "MWL_Ruins8", "MWL_RuinsArena1", "MWL_RuinsArena3", "MWL_RuinsChurch1", "MWL_RuinsWell1", "MWL_DeerShrine1", "MWL_DeerShrine2", "MWL_MeadowsBarn1", "MWL_MeadowsHouse2", "MWL_MeadowsRuin1", "MWL_MeadowsTomb4", "MWL_MeadowsTower1", "MWL_OakHut1", "MWL_SmallHouse1", "MWL_MeadowsFarm1", "MWL_MeadowsLighthouse1", "MWL_MeadowsSawmill1", "MWL_MeadowsWall1", "MWL_MeadowsTavern1", "MWL_RuinsArena2", "MWL_RuinsCastle1", "MWL_RuinsCastle3", "MWL_RuinsTower3", "MWL_RuinsTower8", "MWL_Tavern1", "MWL_WoodTower1", "MWL_WoodTower2", "MWL_WoodTower3", "MWL_RuinsTower6", "MWL_AshlandsFort1", "MWL_AshlandsFort2", "MWL_AshlandsFort3", "MWL_PlainsTavern1", "MWL_PlainsCamp1", "MWL_BlackForestBlacksmith1", "MWL_BlackForestBlacksmith2", "MWL_MountainsBlacksmith1", "MWL_MistlandsBlacksmith1", "MWL_OceanTavern1", "MWL_MeadowsTrainer1", "MWL_SwampTrainer1", "MWL_PlainsTrainer1", "MWL_MistTrainer1", "MaypoleHut1", "ForestForge1", "ForestForge2", "ForestGreatHouse2", "ForestHouse2", "ForestRuin1", "ForestTower2", "ForestTower3", "MassGrave1", "StoneFormation1", "GuardTower1", "RootRuins1", "RootsTower1", "RootsTower2", "RuinedRootTower5", "StoneOutlook1", "ForestRuin2", "ForestRuin3", "ForestSkull1", "ForestTower4", "ForestTower5", "ForestPillar1", "CoastTower1", "ForestGrove1", "RockShrine1", "GuckPit1", "SwampAltar1", "SwampAltar2", "SwampAltar3", "SwampAltar4", "SwampCastle2", "SwampGrave1", "SwampHouse1", "SwampRuin1", "SwampTower1", "SwampTower2", "SwampTower3", "SwampWell1", "AbandonedHouse1", "Treehouse1", "Shipyard1", "FortBakkarhalt1", "Belmont1", "SwampCourtyard1", "SwampBrokenTower1", "SwampBrokenTower3", "StoneCircle1", "SwampTemple1", "StoneCastle1", "StoneFort1", "StoneHall1", "StoneTavern1", "StoneTower1", "StoneTower2", "WoodBarn1", "WoodFarm1", "WoodHouse1", "TempleShrine1", "StoneAltar1", "GoblinFort1", "FulingRock1", "FulingVillage1", "FulingVillage2", "PlainsPillar1", "FulingTemple1", "FulingTemple2", "FulingTemple3", "FulingTempleBroken1", "FulingTemple4", "FulingWall1", "FulingTower1", "RockGarden1", "MistFort2", "SecretRoom1", "MistWorkshop1", "MistTower1", "MistWall1", "MistTower2", "MistHut1", "DvergrEitrSingularity1", "DvergrHouse1", "DvergrHouseWood1", "DvergrHouseWood2", "MarbleJail1", "MarbleHome1", "MarbleHome2", "MarbleCliffAltar1", "MistPond1", "MarbleCage1", "DvergrKnowledgeExtractor1", "AncientShrine1", "MistShrine1", "CastleCorner1", "ForestCamp1", "Misthut2", "MountainDvergrShrine1", "MountainDvergrShrine2", "MountainOverlook1", "MountainCultShrine1", "RuinsChurch2", "MountainShrine1", "RuinedTower1", "TreeTowers1", "Port1", "Port2", "Port3", "Port4" }; private static string StripSectionPrefix(string section) { return Regex.Replace(section, "^\\d+\\s*-\\s*", ""); } public static void LoadOrMigrateConfigs(ConfigFile config) { _quantities = new Dictionary(); _biomeByLocation = new Dictionary(); _defaultsLoaded = false; EnsureDefaultsLoaded(); Dictionary dictionary = AccessTools.Property(typeof(ConfigFile), "OrphanedEntries")?.GetValue(config) as Dictionary; bool flag = dictionary?.Any((KeyValuePair e) => e.Key.Key == "Spawn Quantity" && OldBepInExSections.Contains(StripSectionPrefix(e.Key.Section))) ?? false; if (BepinexConfigs.UseCustomLocationYAML.Value == PortInit.Toggle.Off) { if (flag) { ClearOrphanedEntries(config, dictionary); } return; } if (!File.Exists(YamlFilePath)) { if (flag) { MigrateFromBepInEx(dictionary); ClearOrphanedEntries(config, dictionary); WriteYamlFile(); More_World_Locations_AIOPlugin.More_World_Locations_AIOLogger.LogInfo((object)"Migrated location quantities from BepInEx config to YAML."); } else { string contents = AssetUtils.LoadTextFromResources("warpalicious.More_World_Locations_LocationConfigs.yml"); File.WriteAllText(YamlFilePath, contents); More_World_Locations_AIOPlugin.More_World_Locations_AIOLogger.LogInfo((object)("Auto-extracted default location config to: " + YamlFilePath)); } } else if (flag) { ClearOrphanedEntries(config, dictionary); } LoadFromYaml(); More_World_Locations_AIOPlugin.More_World_Locations_AIOLogger.LogInfo((object)("Location quantity config loaded from: " + YamlFilePath)); } private static void ParseQuantitiesFromContent(string yamlContent) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) if (string.IsNullOrEmpty(yamlContent)) { return; } IDeserializer val = new DeserializerBuilder().Build(); Dictionary dictionary = val.Deserialize>(yamlContent); if (dictionary == null) { return; } foreach (KeyValuePair item in dictionary) { if (item.Key == "version" || !(item.Value is Dictionary dictionary2)) { continue; } foreach (KeyValuePair item2 in dictionary2) { string key = item2.Key.ToString(); if (int.TryParse(item2.Value?.ToString(), out var result)) { _quantities[key] = result; } _biomeByLocation[key] = item.Key; } } } private static void EnsureDefaultsLoaded() { if (!_defaultsLoaded) { _defaultsLoaded = true; string yamlContent = AssetUtils.LoadTextFromResources("warpalicious.More_World_Locations_LocationConfigs.yml"); ParseQuantitiesFromContent(yamlContent); } } public static int GetQuantity(string locationName) { if (!_defaultsLoaded) { EnsureDefaultsLoaded(); } int value; return _quantities.TryGetValue(locationName, out value) ? value : 0; } private static void MigrateFromBepInEx(Dictionary orphanedEntries) { if (orphanedEntries == null || orphanedEntries.Count == 0) { More_World_Locations_AIOPlugin.More_World_Locations_AIOLogger.LogInfo((object)"No orphaned BepInEx entries found. Using default quantities."); return; } int num = 0; foreach (KeyValuePair orphanedEntry in orphanedEntries) { if (!(orphanedEntry.Key.Key != "Spawn Quantity")) { string text = StripSectionPrefix(orphanedEntry.Key.Section); string key = (text.StartsWith("MWL_") ? text : ("MWL_" + text)); if (_quantities.ContainsKey(key) && int.TryParse(orphanedEntry.Value, out var result)) { _quantities[key] = result; num++; } } } if (num > 0) { More_World_Locations_AIOPlugin.More_World_Locations_AIOLogger.LogInfo((object)$"Migrated {num} location quantities from BepInEx config to YAML."); } } private static void ClearOrphanedEntries(ConfigFile config, Dictionary orphanedEntries) { if (orphanedEntries == null) { return; } List list = orphanedEntries.Keys.Where((ConfigDefinition k) => OldBepInExSections.Contains(StripSectionPrefix(k.Section))).ToList(); foreach (ConfigDefinition item in list) { orphanedEntries.Remove(item); } if (list.Count > 0) { config.Save(); More_World_Locations_AIOPlugin.More_World_Locations_AIOLogger.LogInfo((object)$"Cleared {list.Count} orphaned BepInEx config entries."); } } private static void LoadFromYaml() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) try { string text = File.ReadAllText(YamlFilePath); IDeserializer val = new DeserializerBuilder().Build(); Dictionary dictionary = val.Deserialize>(text); if (dictionary == null) { return; } int result = 1; if (dictionary.TryGetValue("version", out var value)) { int.TryParse(value?.ToString(), out result); } if (result > 1) { More_World_Locations_AIOPlugin.More_World_Locations_AIOLogger.LogWarning((object)($"YAML config version {result} is newer than expected {1}. " + "Loading what we can — some fields may be ignored.")); } HashSet yamlLocationNames = new HashSet(); foreach (KeyValuePair item in dictionary) { if (item.Key == "version" || !(item.Value is Dictionary dictionary2)) { continue; } foreach (KeyValuePair item2 in dictionary2) { string text2 = item2.Key.ToString(); yamlLocationNames.Add(text2); if (int.TryParse(item2.Value?.ToString(), out var result2)) { _quantities[text2] = result2; } if (!_biomeByLocation.ContainsKey(text2)) { More_World_Locations_AIOPlugin.More_World_Locations_AIOLogger.LogWarning((object)("Unknown location in YAML config: " + text2 + " (in section " + item.Key + "). Check for typos — this entry will be ignored.")); } } } if (_biomeByLocation.Keys.Any((string name) => !yamlLocationNames.Contains(name))) { WriteYamlFile(); More_World_Locations_AIOPlugin.More_World_Locations_AIOLogger.LogInfo((object)"Updated YAML config with new location entries."); } } catch (Exception ex) { More_World_Locations_AIOPlugin.More_World_Locations_AIOLogger.LogError((object)("Error loading YAML config: " + ex.Message + ". Using defaults.")); } } private static void WriteYamlFile() { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.AppendLine("# More World Locations AIO - Location Quantity Configuration"); stringBuilder.AppendLine("# Quantity = number of this location the game will attempt to place during world generation"); stringBuilder.AppendLine("# Set to 0 to disable a location"); stringBuilder.AppendLine(); stringBuilder.AppendLine("version: 1"); string[] biomeOrder = BiomeOrder; foreach (string biome in biomeOrder) { stringBuilder.AppendLine(); stringBuilder.AppendLine(biome + ":"); List> list = (from kv in _biomeByLocation where kv.Value == biome orderby kv.Key select kv).ToList(); foreach (KeyValuePair item in list) { int value; int num = (_quantities.TryGetValue(item.Key, out value) ? value : 0); stringBuilder.AppendLine($" {item.Key}: {num}"); } } File.WriteAllText(YamlFilePath, stringBuilder.ToString()); } } public class MWLLocation { public string Name { get; set; } public string AssetPath { get; set; } public LocationConfig Config { get; set; } public void Register() { Config.Quantity = LocationQuantityManager.GetQuantity(Name); Common.LocationManager.AddLocation(Name, Config); } } [BepInPlugin("warpalicious.More_World_Locations_AIO", "More_World_Locations_AIO", "4.7.2")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class More_World_Locations_AIOPlugin : BaseUnityPlugin { internal const string ModName = "More_World_Locations_AIO"; internal const string ModVersion = "4.7.2"; internal const string Author = "warpalicious"; private const string ModGUID = "warpalicious.More_World_Locations_AIO"; private static string ConfigFileName = "warpalicious.More_World_Locations_AIO.cfg"; private static string ConfigFileFullPath; internal static string ConnectionError; private readonly Harmony _harmony = new Harmony("warpalicious.More_World_Locations_AIO"); public static readonly ManualLogSource More_World_Locations_AIOLogger; public static YAMLManager YAMLManager; public static GameObject root; private static readonly Version MinJotunnVersion; private const string MoreWorldTradersGUID = "warpalicious.More_World_Traders"; public void Start() { if (Chainloader.PluginInfos.ContainsKey("warpalicious.More_World_Traders")) { More_World_Locations_AIOLogger.LogError((object)"More World Traders (warpalicious.More_World_Traders) is loaded alongside More World Locations AIO. Traders are fully integrated into More World Locations AIO as of version 4.0.0. Please remove the More World Traders mod."); } } public void Awake() { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown Analytics.Init(((BaseUnityPlugin)this).Config, "warpalicious.More_World_Locations_AIO", "4.7.2"); BepinexConfigs.Config = ((BaseUnityPlugin)this).Config; bool saveOnConfigSet = BepinexConfigs.Config.SaveOnConfigSet; BepinexConfigs.Config.SaveOnConfigSet = false; root = new GameObject("root"); Object.DontDestroyOnLoad((Object)(object)root); root.SetActive(false); PortInit.Init(root); BepinexConfigs.BindFeatureConfigs(); YAMLManager.ParseTraderYaml("warpalicious.More_World_Locations_TraderItems.yml", (ConfigurationManager.Toggle)BepinexConfigs.UseCustomTraderConfigs.Value); UpgradeWorldCommands.AddUpgradeWorldCommands(); Assembly executingAssembly = Assembly.GetExecutingAssembly(); _harmony.PatchAll(executingAssembly); SetupWatcher(); Prefabs.LoadPrefabBundles(); PortPrefabs.LoadPrefabBundles(); MinimapTraderIcons.LoadIcons(); MinimapTraderIcons.BuildLocationSpriteData(); LocationQuantityManager.LoadOrMigrateConfigs(((BaseUnityPlugin)this).Config); PrefabManager.OnVanillaPrefabsAvailable += Initialize; ZoneManager.OnVanillaLocationsAvailable += LocationDB.RegisterAll; ItemManager.OnItemsRegistered += StatusEffectDB.BuildStatusEffects; ItemManager.OnItemsRegistered += ShrineDB.BuildShrineConfigs; ItemManager.OnItemsRegistered += WaystoneDB.BuildWaystoneConfigs; try { Assembly assembly = typeof(Main).Assembly; Version version = assembly.GetName().Version; if (version.CompareTo(MinJotunnVersion) < 0) { More_World_Locations_AIOLogger.LogError((object)($"More World Locations requires Jotunn {MinJotunnVersion} or newer, but found {version}. " + "Please update Jotunn or the text in the mod will be broken!")); } MWLLocalizations.Load(BepinexConfigs.UseCustomLocalization.Value); } catch (Exception ex) { More_World_Locations_AIOLogger.LogError((object)("Failed to load YAML localizations: " + ex.Message + ". Localized text will show as raw tokens. Please update Jotunn to 2.28.0 or newer.")); } if (saveOnConfigSet) { BepinexConfigs.Config.SaveOnConfigSet = saveOnConfigSet; BepinexConfigs.Config.Save(); } } private void Initialize() { More_World_Locations_AIOLogger.LogInfo((object)"Initializing LootDB and CreatureDB..."); LootDB.InitializeLootTables(); CreatureDB.InitializeCreatureLists(); Prefabs.AddAllPrefabs(); LocationCustomPrefabs.AddMarbleJail1Prefabs(); LocationCustomPrefabs.AddMarbleCliffAltar1Prefabs(); PortPrefabs.AddPortPrefabs(); if (BepinexConfigs.EnableTraders.Value == PortInit.Toggle.On || BepinexConfigs.EnableTrainers.Value == PortInit.Toggle.On) { TraderItems.CreateCustomItems(); } if (BepinexConfigs.EnableTraders.Value == PortInit.Toggle.On) { TraderPrefabs.AddTraderPrefabs(); } if (BepinexConfigs.EnableTrainers.Value == PortInit.Toggle.On) { TraderPrefabs.AddTrainerPrefabs(); } More_World_Locations_AIOLogger.LogInfo((object)"LootDB and CreatureDB initialized successfully."); PrefabManager.OnVanillaPrefabsAvailable -= Initialize; } private void OnDestroy() { BepinexConfigs.Config.Save(); } private void SetupWatcher() { FileSystemWatcher fileSystemWatcher = new FileSystemWatcher(Paths.ConfigPath, ConfigFileName); fileSystemWatcher.Changed += ReadConfigValues; fileSystemWatcher.Created += ReadConfigValues; fileSystemWatcher.Renamed += ReadConfigValues; fileSystemWatcher.IncludeSubdirectories = true; fileSystemWatcher.SynchronizingObject = ThreadingHelper.SynchronizingObject; fileSystemWatcher.EnableRaisingEvents = true; } private void ReadConfigValues(object sender, FileSystemEventArgs e) { if (!File.Exists(ConfigFileFullPath)) { return; } try { More_World_Locations_AIOLogger.LogDebug((object)"ReadConfigValues called"); BepinexConfigs.Config.Reload(); } catch { More_World_Locations_AIOLogger.LogError((object)("There was an issue loading your " + ConfigFileName)); More_World_Locations_AIOLogger.LogError((object)"Please check your config entries for spelling and format!"); } } static More_World_Locations_AIOPlugin() { string configPath = Paths.ConfigPath; char directorySeparatorChar = Path.DirectorySeparatorChar; ConfigFileFullPath = configPath + directorySeparatorChar + ConfigFileName; ConnectionError = ""; More_World_Locations_AIOLogger = Logger.CreateLogSource("More_World_Locations_AIO"); YAMLManager = new YAMLManager(); root = null; MinJotunnVersion = new Version(2, 28, 0); } } public static class PortInit { public enum Toggle { On = 1, Off = 0 } private static BaseUnityPlugin? _plugin; private static bool hasConfigSync = true; private static object? _configSync; public static GameObject root = null; public static ConfigEntry EnablePortLocations = null; public static BaseUnityPlugin plugin { get { //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Expected O, but got Unknown if (_plugin == null) { IEnumerable source; try { source = Assembly.GetExecutingAssembly().DefinedTypes.ToList(); } catch (ReflectionTypeLoadException ex) { source = from t in ex.Types where t != null select t.GetTypeInfo(); } _plugin = (BaseUnityPlugin)Chainloader.ManagerObject.GetComponent((Type)source.First((TypeInfo t) => t.IsClass && typeof(BaseUnityPlugin).IsAssignableFrom(t))); } return _plugin; } } public static object? configSync { get { if (_configSync == null && hasConfigSync) { Type type = Assembly.GetExecutingAssembly().GetType("ServerSync.ConfigSync"); if ((object)type != null) { _configSync = Activator.CreateInstance(type, plugin.Info.Metadata.GUID + " RS_PortInitManager"); type.GetField("CurrentVersion").SetValue(_configSync, plugin.Info.Metadata.Version.ToString()); type.GetProperty("IsLocked").SetValue(_configSync, true); } else { hasConfigSync = false; } } return _configSync; } } private static void SetupManagers() { ((Component)plugin).gameObject.AddComponent(); ((Component)plugin).gameObject.AddComponent(); } private static void SetupConfigs() { //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) EnablePortLocations = ConfigFileExtensions.BindConfig(plugin.Config, "0 - Shipment Ports", "Enable Port Locations", Toggle.On, "If Off, port locations will not spawn in the world", true, (int?)null, (AcceptableValueBase)null, (Action)null, (ConfigurationManagerAttributes)null); PortUI.PanelPositionConfig = ConfigFileExtensions.BindConfig(plugin.Config, "0 - Shipment Ports", "Panel Position", new Vector3(1760f, 850f, 0f), "[Legacy] No longer used", false, (int?)null, (AcceptableValueBase)null, (Action)null, (ConfigurationManagerAttributes)null); PortUI.PanelOffsetConfig = ConfigFileExtensions.BindConfig(plugin.Config, "0 - Shipment Ports", "Panel Offset", new Vector2(-160f, -230f), "Offset from top-right corner (drag with Left Alt to reposition)", false, (int?)null, (AcceptableValueBase)null, (Action)null, (ConfigurationManagerAttributes)null); PortUI.BkgOption = ConfigFileExtensions.BindConfig(plugin.Config, "0 - Shipment Ports", "Background", PortUI.BackgroundOption.Opaque, "Set background type", false, (int?)null, (AcceptableValueBase)null, (Action)null, (ConfigurationManagerAttributes)null); PortUI.BkgOption.SettingChanged += PortUI.OnBackgroundOptionChange; ShipmentManager.TransitByDistance = ConfigFileExtensions.BindConfig(plugin.Config, "0 - Shipment Ports", "Time Per Meter", 0.5f, "Set seconds per meter for shipment transit", true, (int?)null, (AcceptableValueBase)null, (Action)null, (ConfigurationManagerAttributes)null); ShipmentManager.CurrencyConfig = ConfigFileExtensions.BindConfig(plugin.Config, "0 - Shipment Ports", "Shipment Currency", "Coins", "Set item prefab to use as currency to ship items", true, (int?)null, (AcceptableValueBase)null, (Action)null, (ConfigurationManagerAttributes)null); ShipmentManager.CurrencyConfig.SettingChanged += delegate { ShipmentManager._currencyItem = null; }; ShipmentManager.OverrideTransitTime = ConfigFileExtensions.BindConfig(plugin.Config, "0 - Shipment Ports", "Override Transit Duration", Toggle.Off, "If on, transit time will be based off override instead of calculated based off distance", true, (int?)null, (AcceptableValueBase)null, (Action)null, (ConfigurationManagerAttributes)null); ShipmentManager.TransitTime = ConfigFileExtensions.BindConfig(plugin.Config, "0 - Shipment Ports", "Transit Duration", 1800f, "Set override transit duration in seconds, 1800 = 30min", true, (int?)null, (AcceptableValueBase)null, (Action)null, (ConfigurationManagerAttributes)null); ShipmentManager.ExpirationEnabled = ConfigFileExtensions.BindConfig(plugin.Config, "0 - Shipment Ports", "Expires", Toggle.Off, "If on, shipments can expire", true, (int?)null, (AcceptableValueBase)null, (Action)null, (ConfigurationManagerAttributes)null); ShipmentManager.ExpirationTime = ConfigFileExtensions.BindConfig(plugin.Config, "0 - Shipment Ports", "Expiration Time", 7200f, "Set time until expiration, 3600 = 1 hour", true, (int?)null, (AcceptableValueBase)null, (Action)null, (ConfigurationManagerAttributes)null); PortUI.UseTeleportTab = ConfigFileExtensions.BindConfig(plugin.Config, "0 - Shipment Ports", "Teleport To Ports", Toggle.On, "If on, players can teleport to ports", true, (int?)null, (AcceptableValueBase)null, (Action)null, (ConfigurationManagerAttributes)null); PortUI.UseTeleportTab.SettingChanged += PortUI.OnUseTeleportTabChange; PortUI.TeleportCostPerMeter = ConfigFileExtensions.BindConfig(plugin.Config, "0 - Shipment Ports", "Teleport Cost Per Meter", 0.01f, "Coins charged per meter when teleporting. Set to 0 for free teleports. Default 0.01 = 1 coin per 100 meters", true, (int?)null, (AcceptableValueBase)null, (Action)null, (ConfigurationManagerAttributes)null); } private static void SetupPort() { Blueprint blueprint2 = new Blueprint("portbundle", "MWL_PortTrader"); blueprint2.Prefab.AddComponent(); blueprint2.OnCreated += delegate(Blueprint blueprint) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown Trader val2 = default(Trader); foreach (Transform item in blueprint.Prefab.transform) { Transform val = item; if (((Component)val).TryGetComponent(ref val2)) { ((Object)((Component)val).gameObject).name = "PortTrader"; PortTrader portTrader = ((Component)val).gameObject.AddComponent(); portTrader.m_standRange = val2.m_standRange; portTrader.m_greetRange = val2.m_greetRange; portTrader.m_byeRange = val2.m_byeRange; portTrader.m_hideDialogDelay = val2.m_hideDialogDelay; portTrader.m_randomTalkInterval = val2.m_randomTalkInterval; portTrader.m_dialogHeight = val2.m_dialogHeight; portTrader.m_randomTalkFX = val2.m_randomTalkFX; portTrader.m_randomGreetFX = val2.m_randomGreetFX; portTrader.m_randomGoodbyeFX = val2.m_randomGoodbyeFX; } ((Component)val).gameObject.RemoveAllComponents(includeChildren: false, new Type[1] { typeof(PortTrader) }); } PrefabManager.RegisterPrefab(blueprint.Prefab); }; } private static void SetupManifests() { Clone clone = new Clone("piece_chest_wood", "MWL_port_chest_wood"); clone.OnCreated += delegate(GameObject prefab) { Sprite icon5 = prefab.GetComponent().m_icon; EffectList placeEffect5 = prefab.GetComponent().m_placeEffect; prefab.RemoveComponent(); prefab.RemoveComponent(); prefab.GetComponent().m_persistent = false; Manifest manifest5 = new Manifest("Wooden Shipment", prefab.GetComponent()); manifest5.CostToShip = 50; manifest5.Recipe.Add("Wood", 10); manifest5.Recipe.Add("Resin", 5); manifest5.Icon = icon5; manifest5.PlaceEffect = placeEffect5; }; Clone clone2 = new Clone("piece_chest_barrel", "MWL_port_chest_barrel"); clone2.OnCreated += delegate(GameObject prefab) { Sprite icon4 = prefab.GetComponent().m_icon; EffectList placeEffect4 = prefab.GetComponent().m_placeEffect; prefab.RemoveComponent(); prefab.RemoveComponent(); prefab.GetComponent().m_persistent = false; Manifest manifest4 = new Manifest("Barrel Shipment", prefab.GetComponent()); manifest4.CostToShip = 55; manifest4.Recipe.Add("Wood", 10); manifest4.Recipe.Add("BarrelRings", 1); manifest4.Icon = icon4; manifest4.PlaceEffect = placeEffect4; }; Clone clone3 = new Clone("piece_chest", "MWL_port_chest_finewood"); clone3.OnCreated += delegate(GameObject prefab) { Sprite icon3 = prefab.GetComponent().m_icon; EffectList placeEffect3 = prefab.GetComponent().m_placeEffect; prefab.RemoveComponent(); prefab.RemoveComponent(); prefab.GetComponent().m_persistent = false; Manifest manifest3 = new Manifest("Fine Shipment", prefab.GetComponent()); manifest3.CostToShip = 100; manifest3.Recipe.Add("FineWood", 10); manifest3.Recipe.Add("Iron", 2); manifest3.Recipe.Add("BlackMetal", 6); manifest3.Icon = icon3; manifest3.PlaceEffect = placeEffect3; }; Clone clone4 = new Clone("piece_chest_blackmetal", "MWL_port_chest_blackmetal"); clone4.OnCreated += delegate(GameObject prefab) { Sprite icon2 = prefab.GetComponent().m_icon; EffectList placeEffect2 = prefab.GetComponent().m_placeEffect; prefab.RemoveComponent(); prefab.RemoveComponent(); prefab.GetComponent().m_persistent = false; Manifest manifest2 = new Manifest("Fuling Shipment", prefab.GetComponent()); manifest2.CostToShip = 280; manifest2.Recipe.Add("FineWood", 10); manifest2.Recipe.Add("Tar", 2); manifest2.Recipe.Add("BlackMetal", 6); manifest2.Icon = icon2; manifest2.PlaceEffect = placeEffect2; }; Clone clone5 = new Clone("TreasureChest_dvergrtower", "MWL_port_chest_dvergr"); clone5.OnCreated += delegate(GameObject prefab) { Sprite icon = prefab.GetComponent().m_icon; EffectList placeEffect = Cache.GetPrefab("piece_chest_blackmetal").m_placeEffect; prefab.RemoveComponent(); prefab.RemoveComponent(); prefab.GetComponent().m_persistent = false; Container component = prefab.GetComponent(); component.m_width = 8; component.m_height = 5; component.m_defaultItems.m_drops.Clear(); Manifest manifest = new Manifest("Dvergr Shipment", prefab.GetComponent()); manifest.CostToShip = 410; manifest.Recipe.Add("YggdrasilWood", 10); manifest.Recipe.Add("Copper", 2); manifest.PlaceEffect = placeEffect; }; } public static void Init(GameObject m_root) { root = m_root; Commands.Setup(); SetupManagers(); SetupConfigs(); ShipmentManager.PrefabsToSearch.Add("MWL_PortTrader"); SetupPort(); SetupManifests(); PortTutorial.Setup(); } } public static class Commands { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static ConsoleEvent <>9__1_0; public static ConsoleEvent <>9__1_1; public static ConsoleEvent <>9__1_2; public static ConsoleEvent <>9__1_3; internal void b__1_0(ConsoleEventArgs args) { if (ShipmentManager.Shipments.Count == 0) { args.Context.AddString("No shipments found"); return; } foreach (Shipment value in ShipmentManager.Shipments.Values) { foreach (string item in value.LogPrint()) { args.Context.AddString(item); } } } internal void b__1_1(ConsoleEventArgs args) { //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)Minimap.instance) || !Object.op_Implicit((Object)(object)ZNet.instance) || !ZNet.instance.LocalPlayerIsAdminOrHost()) { return; } foreach (PinData tempPin in tempPins) { Minimap.instance.RemovePin(tempPin); } tempPins.Clear(); foreach (PortManager.PortLocation portLocation in PortManager.GetPortLocations()) { PinData item = Minimap.instance.AddPin(portLocation.Position.ToVector3(), (PinType)3, portLocation.PrefabName, false, false, 0L, default(PlatformUserID)); tempPins.Add(item); } } internal void b__1_2(ConsoleEventArgs args) { if (!Object.op_Implicit((Object)(object)Minimap.instance)) { return; } foreach (PinData tempPin in tempPins) { Minimap.instance.RemovePin(tempPin); } tempPins.Clear(); } internal void b__1_3(ConsoleEventArgs args) { if (Object.op_Implicit((Object)(object)Player.m_localPlayer)) { Player.m_localPlayer.ResetKnownPorts(); } } } private static readonly List tempPins = new List(); public static void Setup() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Expected O, but got Unknown //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Expected O, but got Unknown //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Expected O, but got Unknown //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Expected O, but got Unknown //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Expected O, but got Unknown //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Expected O, but got Unknown object obj = <>c.<>9__1_0; if (obj == null) { ConsoleEvent val = delegate(ConsoleEventArgs args) { if (ShipmentManager.Shipments.Count == 0) { args.Context.AddString("No shipments found"); return; } foreach (Shipment value in ShipmentManager.Shipments.Values) { foreach (string item2 in value.LogPrint()) { args.Context.AddString(item2); } } }; <>c.<>9__1_0 = val; obj = (object)val; } ConsoleCommand val2 = new ConsoleCommand("mwl_shipments", "list of all shipments", (ConsoleEvent)obj, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false); object obj2 = <>c.<>9__1_1; if (obj2 == null) { ConsoleEvent val3 = delegate { //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)Minimap.instance) || !Object.op_Implicit((Object)(object)ZNet.instance) || !ZNet.instance.LocalPlayerIsAdminOrHost()) { return; } foreach (PinData tempPin in tempPins) { Minimap.instance.RemovePin(tempPin); } tempPins.Clear(); foreach (PortManager.PortLocation portLocation in PortManager.GetPortLocations()) { PinData item = Minimap.instance.AddPin(portLocation.Position.ToVector3(), (PinType)3, portLocation.PrefabName, false, false, 0L, default(PlatformUserID)); tempPins.Add(item); } }; <>c.<>9__1_1 = val3; obj2 = (object)val3; } ConsoleCommand val4 = new ConsoleCommand("mwl_ports", "pins port locations on map", (ConsoleEvent)obj2, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false); object obj3 = <>c.<>9__1_2; if (obj3 == null) { ConsoleEvent val5 = delegate { if (Object.op_Implicit((Object)(object)Minimap.instance)) { foreach (PinData tempPin2 in tempPins) { Minimap.instance.RemovePin(tempPin2); } tempPins.Clear(); } }; <>c.<>9__1_2 = val5; obj3 = (object)val5; } ConsoleCommand val6 = new ConsoleCommand("mwl_clear_ports", "removes port pins from map", (ConsoleEvent)obj3, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false); object obj4 = <>c.<>9__1_3; if (obj4 == null) { ConsoleEvent val7 = delegate { if (Object.op_Implicit((Object)(object)Player.m_localPlayer)) { Player.m_localPlayer.ResetKnownPorts(); } }; <>c.<>9__1_3 = val7; obj4 = (object)val7; } ConsoleCommand val8 = new ConsoleCommand("mwl_clear_known_ports", "removes known ports from player save", (ConsoleEvent)obj4, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false); } } public static class KnownPorts { [HarmonyPatch(typeof(Player), "Load")] private static class Player_Load_Patch { [UsedImplicitly] private static void Postfix(Player __instance) { localKnownPorts = new SerializedGuid(__instance); } } [HarmonyPatch(typeof(Player), "Save")] private static class Player_Save_Patch { [UsedImplicitly] private static void Prefix(Player __instance) { localKnownPorts?.Save(__instance); } } private class SerializedGuid { private readonly List GUIDs = new List(); public SerializedGuid(Player player) { if (!player.m_customData.TryGetValue("MWL_KnownPorts", out var value) || string.IsNullOrEmpty(value)) { return; } try { List list = JsonConvert.DeserializeObject>(value); if (list == null) { player.ResetKnownPorts(); } else { GUIDs = list; } } catch { player.ResetKnownPorts(); } } public void Save(Player player) { player.m_customData["MWL_KnownPorts"] = ToJson(); } private string ToJson() { return JsonConvert.SerializeObject((object)GUIDs); } public bool IsKnownPort(ShipmentManager.PortID portID) { return GUIDs.Contains(portID.GUID); } public void Add(ShipmentManager.PortID portID) { if (!IsKnownPort(portID)) { GUIDs.Add(portID.GUID); } } } private const string CustomDataKey = "MWL_KnownPorts"; private static SerializedGuid? localKnownPorts; public static bool IsKnownPort(this Player player, ShipmentManager.PortID portID) { if (localKnownPorts == null) { localKnownPorts = new SerializedGuid(player); } return localKnownPorts.IsKnownPort(portID); } public static void AddKnownPort(this Player player, ShipmentManager.PortID portID) { if (localKnownPorts == null) { localKnownPorts = new SerializedGuid(player); } localKnownPorts.Add(portID); } public static void ResetKnownPorts(this Player player) { player.m_customData.Remove("MWL_KnownPorts"); } } public static class LocalKeys { public static readonly string Shipments = "$label_shipment"; public static readonly string Port = "$label_port"; public static readonly string Deliveries = "$label_delivery"; public static readonly string Manifest = "$label_manifest"; public static readonly string OpenMap = "$label_open_map"; public static readonly string Teleport = "$label_teleport"; public static readonly string InTransit = "$label_in_transit"; public static readonly string Discovered = "$label_delivered"; public static readonly string Expired = "$label_expired"; public static readonly string Open = "$label_open"; public static readonly string SuccessfullySent = "$msg_successfully_sent"; public static readonly string FailedToSend = "$msg_failed_to_send"; public static readonly string FailedToLoadDelivery = "$msg_failed_to_load_delivery"; public static readonly string CurrentShipments = "$label_current_shipments"; public static readonly string Cost = "$label_cost"; public static readonly string NrOfItems = "$label_nr_of_items"; public static readonly string TotalWeight = "$label_total_weight"; public static readonly string Contents = "$label_contents"; public static readonly string EstimatedShipTime = "$label_estimated_ship_time"; public static readonly string Origin = "$label_origin"; public static readonly string Destination = "$label_destination"; public static readonly string PortTooltip = "$tooltip_port"; public static readonly string ShipmentTooltip = "$tooltip_shipment"; public static readonly string DeliveryTooltip = "$tooltip_delivery"; public static readonly string ManifestTooltip = "$tooltip_manifest"; public static readonly string TeleportTooltip = "$tooltip_teleport"; public static readonly string Exit = "$label_exit"; public static readonly string Purchase = "$label_purchase"; public static readonly string OpenDelivery = "$label_open_delivery"; public static readonly string MaximumShipments = "$msg_max_shipments"; public static readonly string SendShipment = "$msg_send_shipment"; public static readonly string OriginPort = "$label_origin_port"; public static readonly string DestinationPort = "$label_destination_port"; public static readonly string State = "$label_state"; public static readonly string Items = "$label_items"; public static readonly string RequiredToDefeat = "$label_required_to_defeat"; public static readonly string Capacity = "$label_capacity"; public static readonly string CostToShip = "$label_cost_to_ship"; public static readonly string DeliveryCollected = "$msg_delivery_collected"; public static string ToKey(this ShipmentState state) { if (1 == 0) { } string result = state switch { ShipmentState.InTransit => InTransit, ShipmentState.Delivered => Discovered, ShipmentState.Expired => Expired, _ => Discovered, }; if (1 == 0) { } return result; } } [PublicAPI] public class Manifest { public class ManifestRecipe { public readonly List Requirements = new List(); public void Add(string itemName, int amount) { if (Requirements.Count < 4) { GameObject prefab = Helpers.GetPrefab(itemName); ItemDrop val = default(ItemDrop); if (prefab != null && prefab.TryGetComponent(ref val)) { Requirements.Add(new Requirement { Item = val.m_itemData, Amount = amount }); } } } } public record struct Requirement { public ItemData Item; public int Amount; } public static readonly Dictionary Manifests = new Dictionary(); public string Name; public int ChestStableHashCode; public Container Chest; public ManifestRecipe Recipe = new ManifestRecipe(); public string RequiredDefeatKey = ""; public int CostToShip = 50; public Sprite? Icon; public EffectList? PlaceEffect; public bool IsPurchased; private static StringBuilder sb = new StringBuilder(); private string _creatureName = string.Empty; private static Dictionary _defeatKeyToCreatureMap = new Dictionary(); private string CreatureName { get { if (string.IsNullOrEmpty(_creatureName) && DefeatKeyToCreatureMap.TryGetValue(RequiredDefeatKey, out string value)) { _creatureName = value ?? string.Empty; } return _creatureName; } } private static Dictionary DefeatKeyToCreatureMap { get { if (_defeatKeyToCreatureMap.Count > 0 || !Object.op_Implicit((Object)(object)ZNetScene.instance)) { return _defeatKeyToCreatureMap; } Character val = default(Character); foreach (GameObject prefab in ZNetScene.instance.m_prefabs) { if (prefab.TryGetComponent(ref val) && !string.IsNullOrEmpty(val.m_defeatSetGlobalKey)) { string name = val.m_name; _defeatKeyToCreatureMap[val.m_defeatSetGlobalKey] = name; } } return _defeatKeyToCreatureMap; } } public Manifest(string name, Container container) { Name = name; Chest = container; ChestStableHashCode = StringExtensionMethods.GetStableHashCode(((Object)container).name); if (Manifests.ContainsKey(ChestStableHashCode)) { More_World_Locations_AIOPlugin.More_World_Locations_AIOLogger.LogDebug((object)(Name + ": " + ((Object)Chest).name + " is already registered")); } else { Manifests[ChestStableHashCode] = this; } } public string GetTooltip() { int num = Chest.m_width * Chest.m_height; sb.Clear(); if (!string.IsNullOrEmpty(CreatureName)) { sb.Append("\n" + LocalKeys.RequiredToDefeat + ": " + CreatureName + ""); } sb.Append($"\n{LocalKeys.Capacity}: {num}"); sb.Append($"\n{LocalKeys.CostToShip}: {CostToShip}"); return sb.ToString(); } public static void ResetPurchasedManifests() { foreach (Manifest value in Manifests.Values) { value.IsPurchased = false; } } } public static class ManifestHelpers { public static Manifest.Requirement? GetRequirement(this Manifest manifest, int index) { if (index < 0 || index >= manifest.Recipe.Requirements.Count) { return null; } return manifest.Recipe.Requirements[index]; } public static bool IsKnownManifest(this Player player, Manifest manifest) { Player player2 = player; if (player2.NoCostCheat()) { return true; } return manifest.Recipe.Requirements.All((Manifest.Requirement requirement) => player2.IsKnownMaterial(requirement.Item.m_shared.m_name)); } public static void Purchase(this Player player, Manifest manifest) { if (!player.NoCostCheat()) { Inventory inventory = ((Humanoid)player).GetInventory(); foreach (Manifest.Requirement requirement in manifest.Recipe.Requirements) { inventory.RemoveItem(requirement.Item.m_shared.m_name, requirement.Amount, -1, true); } } manifest.IsPurchased = true; } public static bool HasRequirements(this Player player, Manifest manifest) { if (player.NoCostCheat()) { return true; } if (!string.IsNullOrEmpty(manifest.RequiredDefeatKey) && !ZoneSystem.instance.GetGlobalKey(manifest.RequiredDefeatKey) && !player.GetUniqueKeys().Contains(manifest.RequiredDefeatKey)) { return false; } Inventory inventory = ((Humanoid)player).GetInventory(); foreach (Manifest.Requirement requirement in manifest.Recipe.Requirements) { int num = inventory.CountItems(requirement.Item.m_shared.m_name, -1, true); if (num >= requirement.Amount) { continue; } return false; } return true; } } public static class NameGenerator { private static readonly string[] Prefixes = new string[26] { "Skjold", "Ravn", "Drakkar", "Storm", "Mist", "Iron", "Njord", "Vargr", "Jotun", "Hrafn", "Skald", "Seidr", "Frost", "Ulf", "Elder", "Orm", "Dyr", "Bjorn", "Thor", "Loki", "Fenr", "Gald", "Svein", "Eik", "Grim", "Kald" }; private static readonly string[] Middles = new string[20] { "", "", "", "ar", "en", "ul", "ir", "or", "an", "und", "vin", "str", "gard", "heim", "skar", "vik", "lod", "oth", "brand", "stein" }; private static readonly string[] Suffixes = new string[14] { "havn", "vik", "fjord", "sund", "holm", "nes", "strand", "gard", "heim", "lund", "berg", "skog", "fjordr", "torp" }; private static readonly Random rng = new Random(); public static string GenerateName() { string text = Prefixes[rng.Next(Prefixes.Length)]; string text2 = Middles[rng.Next(Middles.Length)]; string text3 = Suffixes[rng.Next(Suffixes.Length)]; return text + text2 + text3; } } public class Port : MonoBehaviour, Interactable, Hoverable { private class TempItems { public readonly List Items = new List(); private float GetTotalWeight() { return Items.Sum((ShipmentItem i) => i.Weight); } private int GetTotalStack() { return Items.Sum((ShipmentItem i) => i.Stack); } public string GetTooltip() { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append($"\n{LocalKeys.NrOfItems}: {GetTotalStack()}"); stringBuilder.Append($"\n{LocalKeys.TotalWeight}: {GetTotalWeight():0.0}"); stringBuilder.Append("\n" + LocalKeys.Contents + ":"); foreach (ShipmentItem item in Items) { stringBuilder.Append($"\n{item.SharedName} x{item.Stack}"); } return stringBuilder.ToString(); } public void Clear() { Items.Clear(); } public void Add(ShipmentItem shipmentItem) { Items.Add(shipmentItem); } public void Add(params Container[] containers) { Items.Add(containers); } } public class ContainerPlacement { public readonly List Placements = new List(); public Container? GetOrCreate(int chestID) { foreach (TempContainer placement in Placements) { if (placement.IsSpawned) { Manifest? manifest = placement.manifest; if (manifest != null && manifest.ChestStableHashCode == chestID) { return placement.SpawnedContainer; } } } if (!Manifest.Manifests.TryGetValue(chestID, out Manifest value)) { More_World_Locations_AIOPlugin.More_World_Locations_AIOLogger.LogDebug((object)("Failed to find manifest: " + chestID)); return null; } foreach (TempContainer placement2 in Placements) { if (placement2.IsSpawned) { continue; } placement2.manifest = value; return placement2.Spawn(); } More_World_Locations_AIOPlugin.More_World_Locations_AIOLogger.LogDebug((object)"All container placements are used!"); return null; } public Container[] GetSpawnedContainers() { List list = new List(); foreach (TempContainer placement in Placements) { if ((Object)(object)placement.SpawnedContainer != (Object)null) { list.Add(placement.SpawnedContainer); } } return list.ToArray(); } public bool HasItems() { Container[] spawnedContainers = GetSpawnedContainers(); foreach (Container val in spawnedContainers) { if (val.GetInventory().HasItems()) { return true; } } return false; } public int GetCost() { List list = new List(); foreach (TempContainer placement in Placements) { if (placement.manifest != null) { list.Add(placement.manifest); } } return list.Sum((Manifest i) => i.CostToShip); } public List GetManifests() { List list = new List(); foreach (TempContainer placement in Placements) { if (placement.manifest != null) { list.Add(placement.manifest); } } return list; } } public class TempContainer { private readonly Transform transform; public Manifest? manifest; public Container? SpawnedContainer; public bool IsSpawned => (Object)(object)SpawnedContainer != (Object)null; public TempContainer(Transform transform) { this.transform = transform; } public Container? Spawn() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) if (manifest == null) { return null; } int chestStableHashCode = manifest.ChestStableHashCode; ZDO val = ZDOMan.instance.CreateNewZDO(transform.position, chestStableHashCode); val.Persistent = false; val.Type = (ObjectType)0; val.Distant = false; val.SetPrefab(chestStableHashCode); val.SetRotation(transform.rotation); val.SetOwner(ZDOMan.GetSessionID()); GameObject val2 = ZNetScene.instance.CreateObject(val); Container result = (SpawnedContainer = val2.GetComponent()); manifest.IsPurchased = true; EffectList? placeEffect = manifest.PlaceEffect; if (placeEffect != null) { placeEffect.Create(val2.transform.position, val2.transform.rotation, (Transform)null, 1f, -1); } return result; } public void Destroy() { if (!((Object)(object)SpawnedContainer == (Object)null) && SpawnedContainer.m_nview.IsValid()) { if (manifest != null) { manifest.IsPurchased = false; manifest = null; } SpawnedContainer.m_nview.ClaimOwnership(); SpawnedContainer.m_nview.Destroy(); SpawnedContainer = null; } } } public class PortInfo { public readonly ShipmentManager.PortID portID; public readonly Vector3 position; public readonly List deliveries; public readonly List shipments; private double _estimatedDuration; private static readonly StringBuilder sb = new StringBuilder(); private double EstimatedDuration { get { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) if (_estimatedDuration != 0.0 || PortUI.instance == null || PortUI.instance.m_currentPort == null) { return _estimatedDuration; } float distance = Utils.DistanceXZ(((Component)PortUI.instance.m_currentPort).transform.position, position); _estimatedDuration = Shipment.CalculateDistanceTime(distance); return _estimatedDuration; } } public PortInfo(ZDO zdo) { //IL_0035: 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) portID = new ShipmentManager.PortID(zdo.GetString(PortVars.GUID, ""), zdo.GetString(PortVars.Name, "")); position = zdo.GetPosition(); deliveries = ShipmentManager.GetDeliveries(portID.GUID); shipments = ShipmentManager.GetShipments(portID.GUID); } public void Reload() { deliveries.Clear(); shipments.Clear(); deliveries.AddRange(ShipmentManager.GetDeliveries(portID.GUID)); shipments.AddRange(ShipmentManager.GetShipments(portID.GUID)); ShipmentManager.OnShipmentsUpdated -= Reload; } public float GetDistance(Player player) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) return Vector3.Distance(((Component)player).transform.position, position); } public string GetTooltip() { sb.Clear(); sb.Append(LocalKeys.EstimatedShipTime + ": " + Shipment.FormatTime(EstimatedDuration) + "\n"); sb.Append($"\n{LocalKeys.Deliveries}({deliveries.Count}): "); foreach (Shipment delivery in deliveries) { double totalSeconds = ((delivery.State == ShipmentState.InTransit) ? delivery.GetTimeToArrivalSeconds() : delivery.GetTimeToExpirationSeconds()); string text = Shipment.FormatTime(totalSeconds); sb.AppendFormat("\n{3}: {0} ({1}{2})", delivery.OriginPortName, delivery.State.ToKey(), string.IsNullOrEmpty(text) ? "" : (", " + text), LocalKeys.Origin); } sb.Append($"\n\nShipments ({shipments.Count}): "); foreach (Shipment shipment in shipments) { double totalSeconds2 = ((shipment.State == ShipmentState.InTransit) ? shipment.GetTimeToArrivalSeconds() : shipment.GetTimeToExpirationSeconds()); string text2 = Shipment.FormatTime(totalSeconds2); sb.AppendFormat("\n{3}: {0} ({1}{2})", shipment.DestinationPortName, shipment.State.ToKey(), string.IsNullOrEmpty(text2) ? "" : (", " + text2), LocalKeys.Destination); } return sb.ToString(); } } private static class PortVars { public static readonly int Name = StringExtensionMethods.GetStableHashCode("PortName"); public static readonly int GUID = StringExtensionMethods.GetStableHashCode("PortGUID"); public static readonly int Items = StringExtensionMethods.GetStableHashCode("PortItems"); public static readonly int TraderName = StringExtensionMethods.GetStableHashCode("PortTraderName"); } [CompilerGenerated] private sealed class d__11 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public Port <>4__this; private int 5__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__11(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = null; <>1__state = 1; return true; case 1: <>1__state = -1; 5__1 = 0; goto IL_009b; case 2: { <>1__state = -1; goto IL_008a; } IL_009b: if (5__1 >= 20 || <>4__this.m_initialized) { break; } <>4__this.EnsureInitialized(); if (!<>4__this.m_initialized) { <>2__current = (object)new WaitForSeconds(0.5f); <>1__state = 2; return true; } goto IL_008a; IL_008a: 5__1++; goto IL_009b; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public ZNetView m_view = null; public ShipmentManager.PortID m_portID; public string m_name = "Port"; public string m_traderName = "Haldor"; public readonly ContainerPlacement m_containers = new ContainerPlacement(); public Shipment? m_selectedDelivery; public Humanoid? m_currentHumanoid; private readonly TempItems m_tempItems = new TempItems(); private bool m_initialized; public void Awake() { m_view = ((Component)this).GetComponent(); if (m_view.IsValid()) { m_name = m_view.GetZDO().GetString(PortVars.Name, NameGenerator.GenerateName()); m_portID.GUID = m_view.GetZDO().GetString(PortVars.GUID, Guid.NewGuid().ToString()); m_portID.Name = m_name; m_view.GetZDO().Set(PortVars.GUID, m_portID.GUID); m_view.GetZDO().Set(PortVars.Name, m_name); m_traderName = m_view.GetZDO().GetString(PortVars.TraderName, TraderNames.GetRandomName()); m_view.GetZDO().Set(PortVars.TraderName, m_traderName); } } public void Start() { if (m_view.IsValid()) { ((MonoBehaviour)this).StartCoroutine(InitCoroutine()); } } [IteratorStateMachine(typeof(d__11))] private IEnumerator InitCoroutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__11(0) { <>4__this = this }; } private void EnsureInitialized() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) if (m_initialized) { return; } LocationProxy locationInRange = WorldUtils.GetLocationInRange(((Component)this).transform.position, 10f); if ((Object)(object)locationInRange == (Object)null) { return; } Transform transform = ((Component)locationInRange).transform; foreach (Transform item2 in transform.FindAllRecursive("containerPosition")) { TempContainer item = new TempContainer(item2); m_containers.Placements.Add(item); } if (m_containers.Placements.Count != 0) { LoadSavedItems(); m_initialized = true; } } public void OnDestroy() { DestroyContainers(); Manifest.ResetPurchasedManifests(); } public void SaveItems() { //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown m_tempItems.Clear(); if (!m_view.IsValid()) { More_World_Locations_AIOPlugin.More_World_Locations_AIOLogger.LogDebug((object)"ZNETVIEW not valid when trying to save items"); } else if (m_containers.HasItems()) { m_tempItems.Add(m_containers.GetSpawnedContainers()); ZPackage val = new ZPackage(); val.Write(m_tempItems.Items.Count); foreach (ShipmentItem item in m_tempItems.Items) { item.Write(val); } m_view.GetZDO().Set(PortVars.Items, val.GetBase64()); } else { m_view.GetZDO().Set(PortVars.Items, ""); } } private bool LoadSavedItems() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown string @string = m_view.GetZDO().GetString(PortVars.Items, ""); if (string.IsNullOrWhiteSpace(@string)) { return false; } ZPackage val = new ZPackage(@string); int num = val.ReadInt(); for (int i = 0; i < num; i++) { ShipmentItem shipmentItem = new ShipmentItem(val); m_tempItems.Add(shipmentItem); } return LoadItems(m_tempItems.Items); } public Container? SpawnContainer(Manifest manifest) { EnsureInitialized(); foreach (TempContainer placement in m_containers.Placements) { if (placement.IsSpawned) { continue; } placement.manifest = manifest; Container val = placement.Spawn(); if ((Object)(object)val == (Object)null) { return null; } val.GetInventory().m_onChanged = OnContainersChanged; return val; } return null; } public void DestroyContainers() { foreach (TempContainer placement in m_containers.Placements) { placement.Destroy(); } } public void OnContainersChanged() { if ((Object)(object)ShipmentManager.instance == (Object)null) { return; } SaveItems(); if (!m_containers.HasItems() && m_selectedDelivery != null) { m_selectedDelivery.OnCollected(); m_selectedDelivery = null; if ((Object)(object)m_currentHumanoid != (Object)null) { ((Character)m_currentHumanoid).Message((MessageType)2, LocalKeys.DeliveryCollected, 0, (Sprite)null); } DestroyContainers(); } } public bool Interact(Humanoid user, bool hold, bool alt) { if ((Object)(object)PortUI.instance == (Object)null) { return false; } ShipmentManager.RequestShipments(); PortUI.instance.Show(this); ((Player)(object)((user is Player) ? user : null))?.AddKnownPort(m_portID); m_currentHumanoid = user; return false; } public bool UseItem(Humanoid user, ItemData item) { return false; } public string GetHoverText() { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append(m_traderName); stringBuilder.Append("\n[$KEY_Use] " + LocalKeys.Open); return Localization.instance.Localize(stringBuilder.ToString()); } private bool LoadItems(List items) { Container[] spawnedContainers = m_containers.GetSpawnedContainers(); foreach (Container val in spawnedContainers) { val.GetInventory().m_onChanged = null; } foreach (ShipmentItem item in items) { Container orCreate = m_containers.GetOrCreate(item.ChestID); if ((Object)(object)orCreate == (Object)null) { More_World_Locations_AIOPlugin.More_World_Locations_AIOLogger.LogDebug((object)$"Failed to create container: {item.ChestID}, max container spawned ??"); } else if (!item.AddItem(orCreate)) { More_World_Locations_AIOPlugin.More_World_Locations_AIOLogger.LogDebug((object)("Failed to add item: " + item.ItemName)); } } Container[] spawnedContainers2 = m_containers.GetSpawnedContainers(); foreach (Container val2 in spawnedContainers2) { val2.GetInventory().m_onChanged = OnContainersChanged; } OnContainersChanged(); return true; } public bool LoadDelivery(Shipment delivery) { EnsureInitialized(); if (m_containers.HasItems()) { if ((Object)(object)m_currentHumanoid != (Object)null) { ((Character)m_currentHumanoid).Message((MessageType)2, LocalKeys.FailedToLoadDelivery, 0, (Sprite)null); } return false; } LoadItems(delivery.Items); m_selectedDelivery = delivery; OnContainersChanged(); return m_containers.HasItems(); } public bool SendShipment(PortInfo selectedPort) { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) if (!m_containers.HasItems()) { if ((Object)(object)m_currentHumanoid != (Object)null) { ((Character)m_currentHumanoid).Message((MessageType)2, LocalKeys.FailedToSend, 0, (Sprite)null); } return false; } float distance = Utils.DistanceXZ(((Component)this).transform.position, selectedPort.position); Shipment shipment = new Shipment(m_portID, selectedPort.portID, distance); Container[] spawnedContainers = m_containers.GetSpawnedContainers(); shipment.Items.Add(spawnedContainers); shipment.SendToServer(); DestroyContainers(); m_tempItems.Clear(); m_view.GetZDO().Set(PortVars.Items, ""); if ((Object)(object)m_currentHumanoid != (Object)null) { ((Character)m_currentHumanoid).Message((MessageType)2, LocalKeys.SuccessfullySent, 0, (Sprite)null); } return true; } public string GetHoverName() { return Localization.instance.Localize(m_traderName); } public string GetTooltip() { if (!m_containers.HasItems()) { return ""; } StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append(LocalKeys.CurrentShipments + ":"); stringBuilder.Append(string.Format("\n{0}: {1} x{2}", LocalKeys.Cost, ShipmentManager.CurrencyItem?.m_shared.m_name ?? "$item_coins", m_containers.GetCost())); stringBuilder.Append("\n" + m_tempItems.GetTooltip()); return stringBuilder.ToString(); } } [HarmonyPatch(typeof(ZoneSystem), "GenerateLocationsIfNeeded")] public static class ZoneSystem_GenerateLocationsIfNeeded_Patch { [UsedImplicitly] private static void Postfix() { if (!((Object)(object)PortManager.instance == (Object)null)) { ((MonoBehaviour)PortManager.instance).Invoke("UpdatePortLocations", 10f); } } } public class PortManager : MonoBehaviour { [Serializable] public class PortLocations { public List ports = new List(); public PortLocations(List ports) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) foreach (LocationInstance port in ports) { this.ports.Add(new PortLocation(port.m_location.m_prefabName, port.m_position, port.m_placed)); } } public PortLocations(string json) { PortLocations portLocations = JsonConvert.DeserializeObject(json); if (portLocations != null) { ports = portLocations.ports; More_World_Locations_AIOPlugin.More_World_Locations_AIOLogger.LogDebug((object)$"Received {ports.Count} PortLocations from server"); } } public PortLocations() { } public string ToJson() { return JsonConvert.SerializeObject((object)this); } } [Serializable] public class PortLocation { public string PrefabName; public SerializedVector Position; public bool IsPlaced; public PortLocation(string prefabName, Vector3 position, bool isPlaced) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) PrefabName = prefabName; Position = new SerializedVector(position); IsPlaced = isPlaced; } } [Serializable] public struct SerializedVector { public float x; public float y; public float z; public SerializedVector(Vector3 vector) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) x = vector.x; y = vector.y; z = vector.z; } public Vector3 ToVector3() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) return new Vector3(x, y, z); } } private static CustomSyncedValue? ServerSyncedPortLocations; private static PortLocations? locations; public static PortManager? instance; public void Awake() { instance = this; if (!(PortInit.configSync is ConfigSync configSync)) { return; } ServerSyncedPortLocations = new CustomSyncedValue(configSync, "ServerPortLocations", ""); ServerSyncedPortLocations.ValueChanged += delegate { if (Object.op_Implicit((Object)(object)ZNet.instance) && !ZNet.instance.IsServer() && !string.IsNullOrEmpty(ServerSyncedPortLocations.Value)) { locations = new PortLocations(ServerSyncedPortLocations.Value); } }; } public static List GetPortLocations() { return locations?.ports ?? new List(); } public void UpdatePortLocations() { if (!Object.op_Implicit((Object)(object)ZNet.instance) || !ZNet.instance.IsServer() || !Object.op_Implicit((Object)(object)ZoneSystem.instance)) { return; } Dictionary.ValueCollection locationList = ZoneSystem.instance.GetLocationList(); List list = locationList.Where((LocationInstance location) => location.m_location.m_group == "MWL_Ports").ToList(); if (list.Count != 0) { More_World_Locations_AIOPlugin.More_World_Locations_AIOLogger.LogDebug((object)$"Registered {list.Count} ports"); locations = new PortLocations(list); if (ServerSyncedPortLocations != null) { ServerSyncedPortLocations.Value = locations.ToJson(); } } } } [Obsolete] public static class PortNames { private static readonly Dictionary Tokens = new Dictionary { { "$MWL_PortName_Skjoldhavn", "Port of Skjoldhavn" }, { "$MWL_PortName_Ravensvik", "Ravensvik Port" }, { "$MWL_PortName_Drakkarsund", "Drakkarsund" }, { "$MWL_PortName_Jotunfjord", "Port of Jotunfjord" }, { "$MWL_PortName_Miststrand", "Miststrand Port" }, { "$MWL_PortName_Ironvik", "Ironvik" }, { "$MWL_PortName_Stormhavn", "Port of Stormhavn" }, { "$MWL_PortName_Eirsholm", "Eirsholm Port" }, { "$MWL_PortName_Njordhavn", "Njordhavn" }, { "$MWL_PortName_Hrafnnes", "Port of Hrafnnes" }, { "$MWL_PortName_Vargrvik", "Vargrvik Port" }, { "$MWL_PortName_Skeldholm", "Skeldholm" }, { "$MWL_PortName_Frostsund", "Port of Frostsund" }, { "$MWL_PortName_Ulfsfjord", "Ulfsfjord Port" }, { "$MWL_PortName_Runavik", "Runavik" }, { "$MWL_PortName_Ormsvik", "Port of Ormsvik" }, { "$MWL_PortName_Dyrhavn", "Dyrhavn Port" }, { "$MWL_PortName_Eldersund", "Eldersund" }, { "$MWL_PortName_Seidrholm", "Port of Seidrholm" }, { "$MWL_PortName_Skaldhavn", "Skaldhavn Port" } }; private static readonly List UsedTokens = new List(); public static void Setup() { } public static string GetRandomName() { if (UsedTokens.Count >= Tokens.Count) { UsedTokens.Clear(); } List list = Tokens.Keys.Where((string t) => !UsedTokens.Contains(t)).ToList(); if (list.Count == 0) { return "Port"; } string text = list[Random.Range(0, list.Count)]; UsedTokens.Add(text); return text; } } public class PortTrader : MonoBehaviour { public float m_standRange = 15f; public float m_greetRange = 5f; public float m_byeRange = 5f; public float m_hideDialogDelay = 5f; public float m_randomTalkInterval = 30f; public float m_dialogHeight = 1.5f; public static List m_randomTalk; public static List m_randomGreets; public static List m_randomGoodbye; public EffectList m_randomTalkFX = new EffectList(); public EffectList m_randomGreetFX = new EffectList(); public EffectList m_randomGoodbyeFX = new EffectList(); public bool m_didGreet; public bool m_didGoodbye; public Animator m_animator = null; public LookAt m_lookAt = null; private static readonly int stand = Animator.StringToHash("Stand"); public void Awake() { InitializeLocalizationKeys(); } private void InitializeLocalizationKeys() { m_randomTalk = new List { "$msg_randomPortTalk_1", "$msg_randomPortTalk_2", "$msg_randomPortTalk_3", "$msg_randomPortTalk_4", "$msg_randomPortTalk_5", "$msg_randomPortTalk_6", "$msg_randomPortTalk_7", "$msg_randomPortTalk_8" }; m_randomGreets = new List { "$msg_randomGreet_1", "$msg_randomGreet_2", "$msg_randomGreet_3", "$msg_randomGreet_4", "$msg_randomGreet_5", "$msg_randomGreet_6", "$msg_randomGreet_7", "$msg_randomGreet_8" }; m_randomGoodbye = new List { "$msg_randomGoodbye_1", "$msg_randomGoodbye_2", "$msg_randomGoodbye_3", "$msg_randomGoodbye_4", "$msg_randomGoodbye_5", "$msg_randomGoodbye_6", "$msg_randomGoodbye_7", "$msg_randomGoodbye_8" }; } public void Start() { m_animator = ((Component)this).GetComponentInChildren(); m_lookAt = ((Component)this).GetComponentInChildren(); ((MonoBehaviour)this).InvokeRepeating("RandomTalk", m_randomTalkInterval, m_randomTalkInterval); } public void Update() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) Player closestPlayer = Player.GetClosestPlayer(((Component)this).transform.position, Mathf.Max(m_byeRange + 3f, m_standRange)); if (Object.op_Implicit((Object)(object)closestPlayer)) { float num = Vector3.Distance(((Component)closestPlayer).transform.position, ((Component)this).transform.position); if ((double)num < (double)m_standRange) { m_animator.SetBool(stand, true); m_lookAt.SetLoockAtTarget(((Character)closestPlayer).GetHeadPoint()); } if (!m_didGreet && (double)num < (double)m_greetRange) { m_didGreet = true; Say(m_randomGreets, "Greet"); m_randomGreetFX.Create(((Component)this).transform.position, Quaternion.identity, (Transform)null, 1f, -1); } if (m_didGreet && !m_didGoodbye && !((double)num <= (double)m_byeRange)) { m_didGoodbye = true; Say(m_randomGoodbye, "Greet"); m_randomGoodbyeFX.Create(((Component)this).transform.position, Quaternion.identity, (Transform)null, 1f, -1); } } else { m_animator.SetBool(stand, false); m_lookAt.ResetTarget(); } } public void RandomTalk() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0059: 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) if (m_animator.GetBool(stand) && !StoreGui.IsVisible() && Player.IsPlayerInRange(((Component)this).transform.position, m_greetRange)) { Say(m_randomTalk, "Talk"); m_randomTalkFX.Create(((Component)this).transform.position, Quaternion.identity, (Transform)null, 1f, -1); } } public void Say(List texts, string trigger) { Say(texts[Random.Range(0, texts.Count)], trigger); } public void Say(string text, string trigger) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) Chat.instance.SetNpcText(((Component)this).gameObject, Vector3.up * m_dialogHeight, 20f, m_hideDialogDelay, "", text, false); if (trigger.Length > 0) { m_animator.SetTrigger(trigger); } } } [HarmonyPatch(typeof(InventoryGui), "Awake")] public static class LoadPortUI { [UsedImplicitly] private static void Postfix(InventoryGui __instance) { //IL_0389: Unknown result type (might be due to invalid IL or missing references) //IL_03a0: Unknown result type (might be due to invalid IL or missing references) //IL_03b7: Unknown result type (might be due to invalid IL or missing references) //IL_03de: Unknown result type (might be due to invalid IL or missing references) //IL_03d7: Unknown result type (might be due to invalid IL or missing references) GameObject val = AssetBundleManager.LoadAsset("portbundle", "PortUI"); if ((Object)(object)val == (Object)null) { More_World_Locations_AIOPlugin.More_World_Locations_AIOLogger.LogDebug((object)"PortUI is null"); return; } GameObject gameObject = ((Component)__instance.m_crafting).gameObject; if ((Object)(object)gameObject == (Object)null) { More_World_Locations_AIOPlugin.More_World_Locations_AIOLogger.LogDebug((object)"CraftingPanel is null"); return; } PortUI._tooltipPrefab = gameObject.GetComponentInChildren().m_tooltipPrefab; GameObject val2 = Object.Instantiate(val, ((Component)__instance).transform.parent.Find("HUD")); ((Object)val2).name = "PortUI"; val2.AddComponent(); Text[] componentsInChildren = val2.GetComponentsInChildren(true); Text[] componentsInChildren2 = PortUI.ListItem.GetComponentsInChildren(true); val2.CopySpriteAndMaterial(gameObject, "Panel/Selected", "selected_frame/selected (1)"); val2.CopySpriteAndMaterial(gameObject, "Panel/bkg", "Bkg"); val2.CopySpriteAndMaterial(gameObject, "Panel/TitlePanel/BraidLineHorisontalMedium (1)", "TitlePanel/BraidLineHorisontalMedium (1)"); val2.CopySpriteAndMaterial(gameObject, "Panel/TitlePanel/BraidLineHorisontalMedium (2)", "TitlePanel/BraidLineHorisontalMedium (2)"); val2.CopySpriteAndMaterial(gameObject, "Panel/Tabs/Port", "TabsButtons/Craft"); val2.CopySpriteAndMaterial(gameObject, "Panel/Tabs/Port/Selected", "TabsButtons/Craft/Selected"); val2.CopyButtonState(gameObject, "Panel/Tabs/Port", "TabsButtons/Craft"); val2.CopySpriteAndMaterial(gameObject, "Panel/Tabs/Shipment", "TabsButtons/Craft"); val2.CopySpriteAndMaterial(gameObject, "Panel/Tabs/Shipment/Selected", "TabsButtons/Craft/Selected"); val2.CopyButtonState(gameObject, "Panel/Tabs/Shipment", "TabsButtons/Craft"); val2.CopySpriteAndMaterial(gameObject, "Panel/Tabs/Delivery", "TabsButtons/Craft"); val2.CopySpriteAndMaterial(gameObject, "Panel/Tabs/Delivery/Selected", "TabsButtons/Craft/Selected"); val2.CopyButtonState(gameObject, "Panel/Tabs/Delivery", "TabsButtons/Craft"); val2.CopySpriteAndMaterial(gameObject, "Panel/Tabs/Manifests", "TabsButtons/Craft"); val2.CopySpriteAndMaterial(gameObject, "Panel/Tabs/Manifests/Selected", "TabsButtons/Craft/Selected"); val2.CopyButtonState(gameObject, "Panel/Tabs/Manifests", "TabsButtons/Craft"); val2.CopySpriteAndMaterial(gameObject, "Panel/Tabs/Teleport", "TabsButtons/Craft"); val2.CopySpriteAndMaterial(gameObject, "Panel/Tabs/Teleport/Selected", "TabsButtons/Craft/Selected"); val2.CopyButtonState(gameObject, "Panel/Tabs/Teleport", "TabsButtons/Craft"); val2.CopySpriteAndMaterial(gameObject, "Panel/Separator", "TabsButtons/TabBorder"); val2.CopySpriteAndMaterial(gameObject, "Panel/LeftPanel/Viewport", "RecipeList/Recipes"); val2.CopySpriteAndMaterial(gameObject, "Panel/Description", "Decription"); val2.CopySpriteAndMaterial(gameObject, "Panel/Description/Icon", "Decription/Icon"); val2.CopySpriteAndMaterial(gameObject, "Panel/Description/SendButton", "Decription/craft_button_panel/CraftButton"); val2.CopyButtonState(gameObject, "Panel/Description/SendButton", "Decription/craft_button_panel/CraftButton"); val2.CopySpriteAndMaterial(gameObject, "Panel/Description/Requirements/1", "Decription/requirements/res_bkg"); val2.CopySpriteAndMaterial(gameObject, "Panel/Description/Requirements/2", "Decription/requirements/res_bkg"); val2.CopySpriteAndMaterial(gameObject, "Panel/Description/Requirements/3", "Decription/requirements/res_bkg"); val2.CopySpriteAndMaterial(gameObject, "Panel/Description/Requirements/4", "Decription/requirements/res_bkg"); val2.CopySpriteAndMaterial(gameObject, "Panel/Description/Requirements/1/Icon", "Decription/requirements/res_bkg/res_icon"); val2.CopySpriteAndMaterial(gameObject, "Panel/Description/Requirements/2/Icon", "Decription/requirements/res_bkg/res_icon"); val2.CopySpriteAndMaterial(gameObject, "Panel/Description/Requirements/3/Icon", "Decription/requirements/res_bkg/res_icon"); val2.CopySpriteAndMaterial(gameObject, "Panel/Description/Requirements/4/Icon", "Decription/requirements/res_bkg/res_icon"); val2.CopySpriteAndMaterial(gameObject, "Panel/Description/Requirements/level", "Decription/requirements/level"); val2.CopySpriteAndMaterial(gameObject, "Panel/Description/Requirements/level/MinLevel", "Decription/requirements/level/MinLevel"); val2.CopySpriteAndMaterial(gameObject, "Panel/HowToButton", "RepairButton"); val2.CopyButtonState(gameObject, "Panel/HowToButton", "RepairButton"); val2.CopySpriteAndMaterial(gameObject, "Panel/HowToButton/Glow", "RepairButton/Glow"); val2.CopySpriteAndMaterial(gameObject, "Panel/RepairSimple", "RepairSimple"); RectTransform component = val2.GetComponent(); component.anchorMin = new Vector2(1f, 1f); component.anchorMax = new Vector2(1f, 1f); component.pivot = new Vector2(1f, 1f); component.anchoredPosition = (Vector2)(((??)PortUI.PanelOffsetConfig?.Value) ?? new Vector2(-160f, -230f)); PortUI.ListItem.CopySpriteAndMaterial(gameObject, "Icon", "RecipeList/Recipes/RecipeElement/icon"); GameObject sfxPrefab = gameObject.GetComponentInChildren().m_sfxPrefab; ButtonSfx[] componentsInChildren3 = val2.GetComponentsInChildren(true); foreach (ButtonSfx val3 in componentsInChildren3) { val3.m_sfxPrefab = sfxPrefab; } FontManager.SetFont(componentsInChildren); FontManager.SetFont(componentsInChildren2); } } [HarmonyPatch(typeof(Player), "TakeInput")] public static class PlayerTakeInput_Patch { [UsedImplicitly] private static void Postfix(ref bool __result) { __result &= !PortUI.IsVisible(); } } [HarmonyPatch(typeof(PlayerController), "InInventoryEtc")] public static class PlayerController_InInventoryEtc_Patch { [UsedImplicitly] private static void Postfix(ref bool __result) { __result |= PortUI.IsVisible(); } } [HarmonyPatch(typeof(InventoryGui), "IsVisible")] public static class InventoryGui_IsVisible_Patch { [UsedImplicitly] private static void Postfix(ref bool __result) { __result |= PortUI.IsVisible(); } } public class PortUI : MonoBehaviour, IDragHandler, IEventSystemHandler, IBeginDragHandler, IEndDragHandler { public enum BackgroundOption { Opaque, Transparent } private enum TabOption { Ports, Shipments, Delivery, Manifest, Teleport } private class TempListItem { private readonly GameObject? Prefab; private readonly Button? Button; private readonly Image? Icon; private readonly Text? Label; private readonly GameObject? Selected; private bool IsSelected => (Object)(object)Selected != (Object)null && Selected.activeInHierarchy; public TempListItem(GameObject prefab) { Prefab = prefab; Button = Prefab.GetComponent