Decompiled source of IslandsOfValheim v1.1.0

IslandsOfValheim.dll

Decompiled 12 hours ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.Reflection;
using System.Runtime.CompilerServices;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using Jotunn.Configs;
using Jotunn.Entities;
using Jotunn.Managers;
using Jotunn.Utils;
using UnityEngine;
using UnityEngine.Rendering;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: AssemblyVersion("0.0.0.0")]
namespace IslandsOfValheim;

[HarmonyPatch(typeof(Terminal), "InitTerminal")]
internal static class Commands
{
	private static void Postfix()
	{
		//IL_0031: Unknown result type (might be due to invalid IL or missing references)
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		//IL_0022: Expected O, but got Unknown
		//IL_004f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0059: Expected O, but got Unknown
		//IL_0084: Unknown result type (might be due to invalid IL or missing references)
		//IL_0072: Unknown result type (might be due to invalid IL or missing references)
		//IL_007c: Expected O, but got Unknown
		new ConsoleCommand("iov_info", "- IslandsOfValheim: show how many islets of each tier this world has and where the closest ones are", (ConsoleEvent)delegate(ConsoleEventArgs args)
		{
			//IL_0035: 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_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01de: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0203: Unknown result type (might be due to invalid IL or missing references)
			//IL_021d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0224: Unknown result type (might be due to invalid IL or missing references)
			//IL_0298: Unknown result type (might be due to invalid IL or missing references)
			if (OnServer(args.Context))
			{
				Vector3 from = (((Object)(object)Player.m_localPlayer != (Object)null) ? ((Component)Player.m_localPlayer).transform.position : Vector3.zero);
				List<LocationInstance> list = Islets(null);
				if (list.Count == 0)
				{
					args.Context.AddString("This world has no islets. An existing world only gets them after `genloc` (devcommands), and only in ocean nobody has visited yet.");
				}
				else
				{
					foreach (IsletTier item in IsletTier.All)
					{
						int num = 0;
						int num2 = 0;
						foreach (LocationInstance item2 in list)
						{
							if (Is(item2, item))
							{
								num++;
								if (item2.m_placed)
								{
									num2++;
								}
							}
						}
						args.Context.AddString(item.Name + ": " + num + " islets (" + num2 + " already generated)");
					}
					if (WorldSize.Scale != 1f)
					{
						args.Context.AddString("World radius " + WorldSize.Radius.ToString("0", CultureInfo.InvariantCulture) + " m (Expand World Size): the tier rings are " + WorldSize.Scale.ToString("0.##", CultureInfo.InvariantCulture) + " times as far out as in vanilla.");
					}
					list.Sort((LocationInstance a, LocationInstance b) => Distance(a, from).CompareTo(Distance(b, from)));
					args.Context.AddString("Closest:");
					for (int num3 = 0; num3 < list.Count && num3 < 5; num3++)
					{
						Vector3 position = list[num3].m_position;
						args.Context.AddString("  " + TierName(list[num3]) + ", " + Distance(list[num3], from).ToString("0", CultureInfo.InvariantCulture) + " m away at (" + position.x.ToString("0", CultureInfo.InvariantCulture) + ", " + position.z.ToString("0", CultureInfo.InvariantCulture) + ")" + (list[num3].m_placed ? ", generated" : ""));
					}
					args.Context.AddString("Teleport to the closest new one: iov_goto [tier] (needs devcommands)");
				}
			}
		}, false, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false);
		new ConsoleCommand("iov_goto", "[tier] - IslandsOfValheim: teleport to the closest islet that hasn't been generated yet (of that tier: Meadows, Swamp, Plains, Mistlands, Ashlands)", (ConsoleEvent)delegate(ConsoleEventArgs args)
		{
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_014e: Unknown result type (might be due to invalid IL or missing references)
			//IL_015a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0180: Unknown result type (might be due to invalid IL or missing references)
			//IL_0182: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
			if (OnServer(args.Context) && !((Object)(object)Player.m_localPlayer == (Object)null))
			{
				IsletTier isletTier = null;
				if (args.Length > 1)
				{
					foreach (IsletTier item3 in IsletTier.All)
					{
						if (string.Equals(item3.Name, args[1], StringComparison.OrdinalIgnoreCase))
						{
							isletTier = item3;
						}
					}
					if (isletTier == null)
					{
						args.Context.AddString("Unknown tier " + args[1] + ". Use Meadows, Swamp, Plains, Mistlands or Ashlands.");
						return;
					}
				}
				Vector3 position = ((Component)Player.m_localPlayer).transform.position;
				bool flag = false;
				LocationInstance instance = default(LocationInstance);
				foreach (LocationInstance item4 in Islets(isletTier))
				{
					if (!item4.m_placed)
					{
						if (!flag || Distance(item4, position) < Distance(instance, position))
						{
							instance = item4;
						}
						flag = true;
					}
				}
				if (!flag)
				{
					args.Context.AddString("No islet left that hasn't been generated yet.");
				}
				else
				{
					Vector3 val = default(Vector3);
					((Vector3)(ref val))..ctor(instance.m_position.x, ZoneSystem.instance.m_waterLevel + 3f + 3f, instance.m_position.z);
					((Character)Player.m_localPlayer).TeleportTo(val, ((Component)Player.m_localPlayer).transform.rotation, true);
					args.Context.AddString("Teleporting " + Distance(instance, position).ToString("0", CultureInfo.InvariantCulture) + " m to a new " + TierName(instance) + " islet.");
				}
			}
		}, true, false, false, false, false, false, (ConsoleOptionsFetcher)delegate
		{
			List<string> list = new List<string>();
			foreach (IsletTier item5 in IsletTier.All)
			{
				list.Add(item5.Name);
			}
			return list;
		}, false, false, false);
	}

	private static bool OnServer(Terminal context)
	{
		if ((Object)(object)ZoneSystem.instance != (Object)null && (Object)(object)ZNet.instance != (Object)null && ZNet.instance.IsServer())
		{
			return true;
		}
		context.AddString("Island positions are only known on the server (single player or the host).");
		return false;
	}

	internal static List<LocationInstance> Islets(IsletTier only)
	{
		//IL_001a: 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_0046: Unknown result type (might be due to invalid IL or missing references)
		//IL_0050: Unknown result type (might be due to invalid IL or missing references)
		List<LocationInstance> list = new List<LocationInstance>();
		foreach (LocationInstance location in ZoneSystem.instance.GetLocationList())
		{
			if (location.m_location == null)
			{
				continue;
			}
			foreach (IsletTier item in IsletTier.All)
			{
				if ((only == null || only == item) && Is(location, item))
				{
					list.Add(location);
				}
			}
		}
		return list;
	}

	private static string TierName(LocationInstance instance)
	{
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		foreach (IsletTier item in IsletTier.All)
		{
			if (Is(instance, item))
			{
				return item.Name;
			}
		}
		return "?";
	}

	internal static bool Is(LocationInstance instance, IsletTier tier)
	{
		return instance.m_location.m_prefabName.StartsWith(tier.LocationPrefix);
	}

	internal static float Distance(LocationInstance instance, Vector3 from)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0026: 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)
		Vector3 position = instance.m_position;
		Vector2 val = new Vector2(position.x - from.x, position.z - from.z);
		return ((Vector2)(ref val)).magnitude;
	}
}
[HarmonyPatch(typeof(WearNTear), "Destroy")]
internal static class PieceBreakLog
{
	private static void Prefix(WearNTear __instance, HitData hitData, float ___m_support)
	{
		//IL_001c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_0022: Unknown result type (might be due to invalid IL or missing references)
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		//IL_0052: Unknown result type (might be due to invalid IL or missing references)
		//IL_0057: Unknown result type (might be due to invalid IL or missing references)
		if (Plugin.DebugLog.Value && !((Object)(object)__instance == (Object)null))
		{
			Vector3 position = ((Component)__instance).transform.position;
			Location location = Location.GetLocation(position, false);
			if (!((Object)(object)location == (Object)null) && ((Object)((Component)location).gameObject).name.StartsWith("IoV_"))
			{
				Vector3 val = ((Component)location).transform.InverseTransformPoint(position);
				Plugin.Debug("Islet piece broke: " + Utils.GetPrefabName(((Component)__instance).gameObject) + " at " + ((Vector3)(ref val)).ToString("F1") + " in " + ((Object)((Component)location).gameObject).name + ", support " + ___m_support.ToString("F0") + ((hitData == null) ? " (no hit: fell apart or was removed)" : " (hit)"));
			}
		}
	}
}
internal static class IsletBuilder
{
	internal enum RuinStyle
	{
		StoneHall,
		StiltHut,
		FulingCamp,
		DvergrRuin,
		GraustenFort
	}

	internal const float PlateauHeight = 3f;

	private const float Bottom = -30f;

	private const int Segments = 72;

	private const float RingStep = 1f;

	private const float FloorTop = 3.25f;

	internal const int Variants = 4;

	private static float plateauRadius;

	private static float shoreRadius;

	private static float maxRadius;

	private static float seed;

	private static float stretchX;

	private static float stretchZ;

	private static float cliffDeg;

	private static float coveDeg = float.NaN;

	private static float hillDeg = float.NaN;

	private static readonly string[] bigRocks = new string[5] { "rock4_coast", "rock1_mountain", "Rock_7", "rock3_mountain", "Rock_3" };

	private static readonly string[] smallRocks = new string[3] { "Rock_3", "rock4_coast", "rock1_mountain" };

	private static IsletTier tier;

	private static string locationName;

	private static GameObject root;

	private static Transform parent;

	private static int built;

	private static int missing;

	private static readonly string[] beacons = new string[3] { "bonfire", "piece_brazierfloor01", "fire_pit" };

	private static void SetVariant(int variant)
	{
		seed = tier.Seed + (float)variant * 53f;
		float num = 1f;
		stretchX = (stretchZ = 1f);
		coveDeg = (hillDeg = float.NaN);
		switch (variant)
		{
		case 0:
			cliffDeg = 206f;
			break;
		case 1:
			num = 1.1f;
			stretchX = 1.3f;
			stretchZ = 0.82f;
			cliffDeg = 20f;
			break;
		case 2:
			num = 1.05f;
			cliffDeg = 300f;
			coveDeg = cliffDeg + 140f;
			break;
		default:
			num = 0.95f;
			stretchX = 0.85f;
			stretchZ = 1.2f;
			cliffDeg = 110f;
			hillDeg = cliffDeg + 170f;
			break;
		}
		plateauRadius = 9.5f * num;
		shoreRadius = 20f * num;
		maxRadius = shoreRadius * Mathf.Max(stretchX, stretchZ) + 26f;
	}

	internal static void Register(IsletTier islet, int variant)
	{
		//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d4: Expected O, but got Unknown
		//IL_02aa: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b4: Expected O, but got Unknown
		tier = islet;
		locationName = tier.LocationName(variant);
		SetVariant(variant);
		root = ZoneManager.Instance.CreateLocationContainer(locationName);
		parent = root.transform;
		built = 0;
		missing = 0;
		Material m = BuildGround();
		PlaceRocks();
		PlaceRuins();
		PlaceHints();
		OneOf(new float[3] { 0.35f, 0.35f, 0.3f }, delegate
		{
			PlaceDock(cliffDeg + 229f);
		}, delegate
		{
			PlaceDock(cliffDeg + 140f);
		}, delegate
		{
		});
		OneOf(new float[3] { 0.35f, 0.3f, 0.35f }, delegate
		{
			PlaceWreck(cliffDeg + 194f);
		}, delegate
		{
			PlaceWreck(cliffDeg + 60f);
		}, delegate
		{
		});
		PlaceHoard();
		PlacePlants();
		PlacePickables();
		PlaceOutsideGuard();
		Plugin.Debug(locationName + " built: " + built + " parts, " + missing + " prefabs not found. Ground material: " + Describe(m));
		LocationConfig val = new LocationConfig();
		val.Biome = (Biome)256;
		val.BiomeArea = (BiomeArea)2;
		val.Quantity = (tier.Count.Value + ((variant == 0) ? 1 : 0)) / 4;
		val.Priotized = true;
		val.SnapToWater = true;
		val.RandomRotation = true;
		val.ClearArea = false;
		val.ExteriorRadius = 30f;
		val.MinAltitude = -1000f;
		val.MaxAltitude = -6f;
		val.MinTerrainDelta = 0f;
		val.MaxTerrainDelta = 1000f;
		val.MinDistance = tier.MinDistance;
		val.MaxDistance = tier.MaxDistance;
		val.Group = "IoV_Islets";
		val.MinDistanceFromSimilar = 300f;
		root.AddComponent<Location>().m_applyRandomDamage = true;
		ZoneManager.Instance.AddCustomLocation(new CustomLocation(root, false, val));
		Plugin.Log.LogInfo((object)("Registered location " + locationName + " (quantity " + val.Quantity + ")"));
	}

	private static float Noise(float x, float z)
	{
		return Mathf.PerlinNoise(x + seed, z + seed * 0.7f) * 2f - 1f;
	}

	private static float Shore(float angle)
	{
		float num = Mathf.Cos(angle);
		float num2 = Mathf.Sin(angle);
		float num3 = 1f / Mathf.Sqrt(num * num / (stretchX * stretchX) + num2 * num2 / (stretchZ * stretchZ));
		float num4 = 1f;
		if (!float.IsNaN(coveDeg))
		{
			float num5 = Mathf.Max(0f, Mathf.Cos(angle - coveDeg * ((float)Math.PI / 180f)));
			num4 = 1f - 0.3f * Mathf.Pow(num5, 10f);
		}
		float num6 = shoreRadius * num3 * num4 * (1f + 0.16f * Noise(num * 1.3f + 5f, num2 * 1.3f + 5f) + 0.08f * Noise(num * 3f + 11f, num2 * 3f + 11f));
		return Mathf.Max(num6, Plateau(angle) + 3f);
	}

	private static float Plateau(float angle)
	{
		return plateauRadius * (1f + 0.12f * Noise(Mathf.Cos(angle) * 2f + 21f, Mathf.Sin(angle) * 2f + 21f));
	}

	private static float Cliff(float angle)
	{
		float num = Mathf.Max(0f, Mathf.Cos(angle - cliffDeg * ((float)Math.PI / 180f)));
		return num * num * num;
	}

	internal static float Height(float x, float z)
	{
		float num = Mathf.Sqrt(x * x + z * z);
		float angle = Mathf.Atan2(z, x);
		float num2 = Shore(angle);
		float num3 = Plateau(angle);
		float num4 = Noise(x * 0.5f + 1f, z * 0.5f + 2f);
		if (num <= num3)
		{
			return 3f + num4 * 0.1f;
		}
		float num5 = Noise(x * 0.09f + 3f, z * 0.09f + 7f) + 0.5f * Noise(x * 0.2f + 13f, z * 0.2f + 17f) + 0.25f * Noise(x * 0.45f + 31f, z * 0.45f + 37f);
		float num6 = Noise(x * 0.9f + 41f, z * 0.9f + 43f) * 0.18f;
		if (num <= num2)
		{
			float num7 = (num - num3) / (num2 - num3);
			float num8 = Cliff(angle);
			float num9 = Mathf.Lerp(num7, num7 * num7 * num7, num8);
			float num10 = num9 * num9 * (3f - 2f * num9);
			float num11 = num8 * 2.4f * 4f * num7 * (1f - num7);
			float num12 = Mathf.Clamp01(num7 * 4f);
			return 3f * (1f - num10) + num11 + Hump(x, z, num3, num2) * Mathf.Sin((float)Math.PI * num7) + (num5 * 1.6f * Mathf.Sin((float)Math.PI * num7) + num4 * 0.35f + num6) * num12;
		}
		float num13 = num - num2;
		if (num13 <= 7f)
		{
			return (0f - num13) * 0.7f + num5 * 0.8f * (1f - num13 / 7f) + num6;
		}
		return Mathf.Max(-30f, -4.9f - (num13 - 7f) * 4f);
	}

	private static float Hump(float x, float z, float plateau, float shore)
	{
		//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)
		if (float.IsNaN(hillDeg))
		{
			return 0f;
		}
		Vector2 val = Polar(hillDeg, (plateau + shore) * 0.5f);
		float num = (x - val.x) * (x - val.x) + (z - val.y) * (z - val.y);
		return 3.2f * Mathf.Exp((0f - num) / 24.5f);
	}

	private static Vector3 Normal(float x, float z)
	{
		//IL_0041: Unknown result type (might be due to invalid IL or missing references)
		//IL_0046: Unknown result type (might be due to invalid IL or missing references)
		//IL_0049: Unknown result type (might be due to invalid IL or missing references)
		float num = Height(x + 0.35f, z) - Height(x - 0.35f, z);
		float num2 = Height(x, z + 0.35f) - Height(x, z - 0.35f);
		Vector3 val = new Vector3(0f - num, 0.7f, 0f - num2);
		return ((Vector3)(ref val)).normalized;
	}

	private static Material BuildGround()
	{
		//IL_004d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0058: Unknown result type (might be due to invalid IL or missing references)
		//IL_0072: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b6: Unknown result type (might be due to invalid IL or missing references)
		//IL_013e: Unknown result type (might be due to invalid IL or missing references)
		//IL_014d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0181: Unknown result type (might be due to invalid IL or missing references)
		//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0260: Unknown result type (might be due to invalid IL or missing references)
		//IL_0267: Expected O, but got Unknown
		//IL_02b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ba: Expected O, but got Unknown
		//IL_037d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0384: Expected O, but got Unknown
		//IL_0392: Unknown result type (might be due to invalid IL or missing references)
		//IL_0399: Expected O, but got Unknown
		//IL_03c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ca: Invalid comparison between Unknown and I4
		//IL_03ef: Unknown result type (might be due to invalid IL or missing references)
		//IL_03f1: Unknown result type (might be due to invalid IL or missing references)
		//IL_03fe: Unknown result type (might be due to invalid IL or missing references)
		//IL_0400: Unknown result type (might be due to invalid IL or missing references)
		//IL_040d: Unknown result type (might be due to invalid IL or missing references)
		//IL_040f: Unknown result type (might be due to invalid IL or missing references)
		//IL_041c: Unknown result type (might be due to invalid IL or missing references)
		//IL_041e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0536: Unknown result type (might be due to invalid IL or missing references)
		//IL_0558: Unknown result type (might be due to invalid IL or missing references)
		//IL_0565: Unknown result type (might be due to invalid IL or missing references)
		//IL_0576: Unknown result type (might be due to invalid IL or missing references)
		//IL_0583: Unknown result type (might be due to invalid IL or missing references)
		//IL_0591: Unknown result type (might be due to invalid IL or missing references)
		//IL_059b: Unknown result type (might be due to invalid IL or missing references)
		int num = Mathf.RoundToInt(maxRadius / 1f);
		int num2 = 73;
		List<Vector3> list = new List<Vector3>();
		List<Vector3> list2 = new List<Vector3>();
		List<Vector2> list3 = new List<Vector2>();
		List<int> list4 = new List<int>();
		for (int i = 0; i < num2; i++)
		{
			list.Add(new Vector3(0f, Height(0f, 0f), 0f));
			list2.Add(Vector3.up);
			list3.Add(new Vector2((float)i / 72f, 0f));
		}
		for (int j = 1; j <= num; j++)
		{
			for (int k = 0; k < num2; k++)
			{
				int num3 = k % 72;
				float num4 = ((float)k + 0.3f * Noise((float)j * 1.7f + 0.5f, (float)num3 * 1.3f + 0.5f)) * (float)Math.PI * 2f / 72f;
				float num5 = ((float)j + 0.3f * Noise((float)num3 * 2.1f + 7.5f, (float)j * 0.9f + 3.5f)) * 1f;
				float num6 = Mathf.Cos(num4) * num5;
				float num7 = Mathf.Sin(num4) * num5;
				float num8 = Height(num6, num7);
				list.Add(new Vector3(num6, num8, num7));
				list2.Add(Normal(num6, num7));
				list3.Add(new Vector2(num6 / (2f * maxRadius) + 0.5f, num7 / (2f * maxRadius) + 0.5f));
			}
		}
		Color32 biomeColor = Heightmap.GetBiomeColor(tier.Biome);
		List<Color32> list5 = new List<Color32>(list.Count);
		for (int l = 0; l < list.Count; l++)
		{
			list5.Add(biomeColor);
		}
		for (int m = 0; m < num; m++)
		{
			int num9 = m * num2;
			int num10 = (m + 1) * num2;
			for (int n = 0; n < 72; n++)
			{
				list4.Add(num9 + n);
				list4.Add(num9 + n + 1);
				list4.Add(num10 + n);
				list4.Add(num9 + n + 1);
				list4.Add(num10 + n + 1);
				list4.Add(num10 + n);
			}
		}
		Mesh val = new Mesh();
		((Object)val).name = "IoV_IsletGround";
		val.SetVertices(list);
		val.SetNormals(list2);
		val.SetUVs(0, list3);
		val.SetColors(list5);
		val.SetTriangles(list4, 0);
		val.RecalculateTangents();
		val.RecalculateBounds();
		GameObject val2 = new GameObject("IoV_Ground");
		val2.layer = LayerMask.NameToLayer("static_solid");
		val2.transform.SetParent(root.transform, false);
		val2.AddComponent<MeshFilter>().sharedMesh = val;
		MeshRenderer val3 = val2.AddComponent<MeshRenderer>();
		val2.AddComponent<MeshCollider>().sharedMesh = val;
		Material val4 = null;
		Heightmap val5 = (((Object)(object)ZoneSystem.instance != (Object)null && (Object)(object)ZoneSystem.instance.m_zonePrefab != (Object)null) ? ZoneSystem.instance.m_zonePrefab.GetComponentInChildren<Heightmap>(true) : null);
		if ((Object)(object)val5 != (Object)null && (Object)(object)val5.m_material != (Object)null && Plugin.GroundStyle.Value == "Terrain")
		{
			val4 = new Material(val5.m_material);
			((Object)val4).name = "IoV_IsletTerrain";
			Texture2D val6 = new Texture2D(2, 2);
			((Object)val6).name = "IoV_IsletPaintMask";
			((Texture)val6).wrapMode = (TextureWrapMode)1;
			Color val7 = default(Color);
			((Color)(ref val7))..ctor(0f, 0f, 0f, ((int)tier.Biome == 32) ? 0f : 1f);
			val6.SetPixels((Color[])(object)new Color[4] { val7, val7, val7, val7 });
			val6.Apply();
			val4.SetTexture("_ClearedMaskTex", (Texture)(object)val6);
			val4.SetFloat("_LodHideDistance", 10000f);
			LogProperties(val4);
			((Renderer)val3).sharedMaterial = val4;
			Plugin.Debug("Ground uses the terrain material " + ((Object)val5.m_material).name);
			return val4;
		}
		if (Plugin.GroundStyle.Value == "Terrain")
		{
			Plugin.Log.LogWarning((object)"Terrain material not found, the islet ground falls back to a rock material.");
		}
		string[] array = bigRocks;
		foreach (string text in array)
		{
			GameObject prefab = PrefabManager.Instance.GetPrefab(text);
			if (!((Object)(object)prefab == (Object)null))
			{
				MeshRenderer componentInChildren = prefab.GetComponentInChildren<MeshRenderer>(true);
				if ((Object)(object)componentInChildren != (Object)null && (Object)(object)((Renderer)componentInChildren).sharedMaterial != (Object)null)
				{
					val4 = ((Renderer)componentInChildren).sharedMaterial;
					Plugin.Debug("Ground material taken from " + text);
					break;
				}
			}
		}
		if ((Object)(object)val4 != (Object)null)
		{
			((Renderer)val3).sharedMaterial = val4;
		}
		for (int num12 = 0; num12 < list.Count; num12++)
		{
			float num13 = Mathf.Clamp(list[num12].y, -6f, 6f);
			list3[num12] = new Vector2(list[num12].x + list2[num12].x * num13, list[num12].z + list2[num12].z * num13) / 8f;
		}
		val.SetUVs(0, list3);
		return val4;
	}

	private static float GroundMin(float x, float z, float radius)
	{
		float num = Height(x, z);
		for (int i = 0; i < 8; i++)
		{
			float num2 = (float)i * (float)Math.PI / 4f;
			num = Mathf.Min(num, Height(x + Mathf.Cos(num2) * radius, z + Mathf.Sin(num2) * radius));
		}
		return num;
	}

	private static Vector2 Polar(float degrees, float radius)
	{
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		float num = degrees * ((float)Math.PI / 180f);
		return new Vector2(Mathf.Cos(num) * radius, Mathf.Sin(num) * radius);
	}

	private static float ShoreAt(float degrees)
	{
		return Shore(degrees * ((float)Math.PI / 180f));
	}

	private static float PlateauAt(float degrees)
	{
		return Plateau(degrees * ((float)Math.PI / 180f));
	}

	private static GameObject Find(string[] candidates)
	{
		foreach (string text in candidates)
		{
			GameObject prefab = PrefabManager.Instance.GetPrefab(text);
			if ((Object)(object)prefab != (Object)null)
			{
				return prefab;
			}
		}
		missing++;
		Plugin.Debug("None of these prefabs exist: " + string.Join(", ", candidates));
		return null;
	}

	private static GameObject OnGround(string[] candidates, Vector2 at, float rotY, float size, float sink)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		return OnGround(candidates, at, rotY, size, sink, strip: true);
	}

	private static GameObject OnGround(string[] candidates, Vector2 at, float rotY, float size, float sink, bool strip)
	{
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0026: 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_0033: Unknown result type (might be due to invalid IL or missing references)
		//IL_003f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: Unknown result type (might be due to invalid IL or missing references)
		//IL_0076: Unknown result type (might be due to invalid IL or missing references)
		//IL_0086: Unknown result type (might be due to invalid IL or missing references)
		GameObject val = Copy(candidates, new Vector3(0f, rotY, 0f), size, strip);
		if ((Object)(object)val == (Object)null)
		{
			return null;
		}
		Bounds b = LocalBounds(val);
		float radius = 0.4f * Mathf.Max(((Bounds)(ref b)).size.x, ((Bounds)(ref b)).size.z);
		float num = GroundMin(at.x, at.y, radius) - sink * ((Bounds)(ref b)).size.y;
		Move(val, b, new Vector3(at.x, num, at.y), alignTop: false);
		return val;
	}

	private static GameObject At(string name, Vector3 pos, Vector3 euler, bool alignTop)
	{
		//IL_000c: 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_002a: 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_0095: Unknown result type (might be due to invalid IL or missing references)
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_004f: Unknown result type (might be due to invalid IL or missing references)
		GameObject val = Copy(new string[1] { name }, euler, 0f, strip: false);
		if ((Object)(object)val == (Object)null)
		{
			return null;
		}
		Bounds b = SolidBounds(val);
		if (!alignTop)
		{
			float num = GroundMin(pos.x, pos.z, 0.35f * Mathf.Max(((Bounds)(ref b)).size.x, ((Bounds)(ref b)).size.z));
			if (pos.y > num - 0.1f && pos.y < num + 0.6f)
			{
				pos.y = num - 0.3f;
			}
		}
		Move(val, b, pos, alignTop);
		return val;
	}

	private static GameObject Copy(string[] candidates, Vector3 euler, float size, bool strip)
	{
		//IL_0040: Unknown result type (might be due to invalid IL or missing references)
		//IL_0041: Unknown result type (might be due to invalid IL or missing references)
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0072: Unknown result type (might be due to invalid IL or missing references)
		//IL_0075: Unknown result type (might be due to invalid IL or missing references)
		//IL_0081: Unknown result type (might be due to invalid IL or missing references)
		//IL_009f: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
		GameObject val = Find(candidates);
		if ((Object)(object)val == (Object)null)
		{
			return null;
		}
		if (!strip)
		{
			val = PlantOrSelf(((Object)val).name);
		}
		GameObject val2 = Object.Instantiate<GameObject>(val, parent, false);
		((Object)val2).name = ((Object)val).name;
		val2.transform.localRotation = Quaternion.Euler(euler);
		val2.transform.localPosition = Vector3.zero;
		if (strip)
		{
			Strip(val2);
		}
		if (size > 0f)
		{
			Bounds val3 = LocalBounds(val2);
			float num = Mathf.Max(((Bounds)(ref val3)).size.x, ((Bounds)(ref val3)).size.z);
			if (num > 0.01f)
			{
				val2.transform.localScale = Vector3.one * (size / num);
			}
		}
		built++;
		return val2;
	}

	private static void Move(GameObject go, Bounds b, Vector3 pos, bool alignTop)
	{
		//IL_0022: 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_003d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0052: Unknown result type (might be due to invalid IL or missing references)
		//IL_005d: Unknown result type (might be due to invalid IL or missing references)
		//IL_008b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0090: Unknown result type (might be due to invalid IL or missing references)
		float num = (alignTop ? (pos.y - ((Bounds)(ref b)).max.y) : (pos.y - ((Bounds)(ref b)).min.y));
		go.transform.localPosition = new Vector3(pos.x - ((Bounds)(ref b)).center.x, num, pos.z - ((Bounds)(ref b)).center.z);
		string[] array = new string[6]
		{
			"  ",
			((Object)go).name,
			" size ",
			null,
			null,
			null
		};
		Vector3 size = ((Bounds)(ref b)).size;
		array[3] = ((Vector3)(ref size)).ToString("F1");
		array[4] = " at ";
		array[5] = ((Vector3)(ref pos)).ToString("F1");
		Plugin.Debug(string.Concat(array));
	}

	private static void Strip(GameObject go)
	{
		for (int i = 0; i < 4; i++)
		{
			MonoBehaviour[] componentsInChildren = go.GetComponentsInChildren<MonoBehaviour>(true);
			if (componentsInChildren.Length == 0)
			{
				break;
			}
			for (int num = componentsInChildren.Length - 1; num >= 0; num--)
			{
				Object.DestroyImmediate((Object)(object)componentsInChildren[num]);
			}
		}
		Rigidbody[] componentsInChildren2 = go.GetComponentsInChildren<Rigidbody>(true);
		foreach (Rigidbody val in componentsInChildren2)
		{
			Object.DestroyImmediate((Object)(object)val);
		}
	}

	private static Bounds LocalBounds(GameObject go)
	{
		//IL_0004: 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_004e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0053: Unknown result type (might be due to invalid IL or missing references)
		//IL_005e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0065: Unknown result type (might be due to invalid IL or missing references)
		//IL_008b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0090: Unknown result type (might be due to invalid IL or missing references)
		//IL_0095: Unknown result type (might be due to invalid IL or missing references)
		//IL_009a: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b3: 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)
		//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
		bool flag = false;
		Bounds result = default(Bounds);
		MeshFilter[] componentsInChildren = go.GetComponentsInChildren<MeshFilter>(true);
		foreach (MeshFilter val in componentsInChildren)
		{
			if ((Object)(object)val.sharedMesh == (Object)null || !ActiveBelow(((Component)val).transform, go.transform))
			{
				continue;
			}
			Bounds bounds = val.sharedMesh.bounds;
			for (int j = 0; j < 8; j++)
			{
				Vector3 val2 = ((Bounds)(ref bounds)).center + Vector3.Scale(((Bounds)(ref bounds)).extents, new Vector3((float)(((j & 1) != 0) ? 1 : (-1)), (float)(((j & 2) != 0) ? 1 : (-1)), (float)(((j & 4) != 0) ? 1 : (-1))));
				Vector3 val3 = root.transform.InverseTransformPoint(((Component)val).transform.TransformPoint(val2));
				if (!flag)
				{
					result = new Bounds(val3, Vector3.zero);
					flag = true;
				}
				else
				{
					((Bounds)(ref result)).Encapsulate(val3);
				}
			}
		}
		return result;
	}

	private static Bounds SolidBounds(GameObject go)
	{
		//IL_0004: Unknown result type (might be due to invalid IL or missing references)
		//IL_014b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0145: Unknown result type (might be due to invalid IL or missing references)
		//IL_0060: Unknown result type (might be due to invalid IL or missing references)
		//IL_0067: Unknown result type (might be due to invalid IL or missing references)
		//IL_0099: 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_00a9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00db: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
		//IL_0103: Unknown result type (might be due to invalid IL or missing references)
		//IL_011b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0108: Unknown result type (might be due to invalid IL or missing references)
		//IL_010a: 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)
		//IL_0114: Unknown result type (might be due to invalid IL or missing references)
		bool flag = false;
		Bounds result = default(Bounds);
		Collider[] componentsInChildren = go.GetComponentsInChildren<Collider>(true);
		Bounds bounds = default(Bounds);
		foreach (Collider val in componentsInChildren)
		{
			if (val.isTrigger || !ActiveBelow(((Component)val).transform, go.transform))
			{
				continue;
			}
			BoxCollider val2 = (BoxCollider)(object)((val is BoxCollider) ? val : null);
			MeshCollider val3 = (MeshCollider)(object)((val is MeshCollider) ? val : null);
			if ((Object)(object)val2 != (Object)null)
			{
				((Bounds)(ref bounds))..ctor(val2.center, val2.size);
			}
			else
			{
				if (!((Object)(object)val3 != (Object)null) || !((Object)(object)val3.sharedMesh != (Object)null))
				{
					continue;
				}
				bounds = val3.sharedMesh.bounds;
			}
			for (int j = 0; j < 8; j++)
			{
				Vector3 val4 = ((Bounds)(ref bounds)).center + Vector3.Scale(((Bounds)(ref bounds)).extents, new Vector3((float)(((j & 1) != 0) ? 1 : (-1)), (float)(((j & 2) != 0) ? 1 : (-1)), (float)(((j & 4) != 0) ? 1 : (-1))));
				Vector3 val5 = root.transform.InverseTransformPoint(((Component)val).transform.TransformPoint(val4));
				if (!flag)
				{
					result = new Bounds(val5, Vector3.zero);
					flag = true;
				}
				else
				{
					((Bounds)(ref result)).Encapsulate(val5);
				}
			}
		}
		if (!flag)
		{
			return LocalBounds(go);
		}
		return result;
	}

	private static bool ActiveBelow(Transform t, Transform top)
	{
		while ((Object)(object)t != (Object)null && (Object)(object)t != (Object)(object)top)
		{
			if (!((Component)t).gameObject.activeSelf)
			{
				return false;
			}
			t = t.parent;
		}
		return true;
	}

	private static void PlaceRocks()
	{
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
		float[] array = new float[8] { 159f, 209f, 249f, 304f, 354f, 29f, 84f, 124f };
		float[] array2 = new float[8] { 7f, 4.5f, 6f, 5f, 9f, 7.5f, 6f, 4f };
		for (int i = 0; i < array.Length; i++)
		{
			float num = cliffDeg + array[i];
			OnGround(bigRocks, Polar(num, ShoreAt(num) - 2f), num * 3f, array2[i], 0.4f);
		}
		float[] array3 = new float[5] { 120f, 185f, 215f, 265f, 20f };
		float[] array4 = new float[5] { 4f, 5f, 4.5f, 3.5f, 3f };
		for (int j = 0; j < array3.Length; j++)
		{
			float radius = (PlateauAt(array3[j]) + ShoreAt(array3[j])) * 0.5f;
			OnGround(bigRocks, Polar(array3[j], radius), array3[j] * 2f, array4[j], 0.5f);
		}
		float[] small = new float[6] { 40f, 75f, 170f, 250f, 310f, 345f };
		for (int k = 0; k < small.Length; k++)
		{
			int k2 = k;
			Optional(0.6f, delegate
			{
				//IL_003e: Unknown result type (might be due to invalid IL or missing references)
				OnGround(smallRocks, Polar(small[k2], ShoreAt(small[k2]) - 4f - (float)(k2 % 3)), small[k2], 1.2f + (float)(k2 % 3) * 0.6f, 0.3f);
			});
		}
	}

	private static void PlaceDock(float deg)
	{
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		//IL_0031: Unknown result type (might be due to invalid IL or missing references)
		//IL_0039: Unknown result type (might be due to invalid IL or missing references)
		//IL_003e: Unknown result type (might be due to invalid IL or missing references)
		//IL_006f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0081: Unknown result type (might be due to invalid IL or missing references)
		//IL_0086: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a2: 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_0106: Unknown result type (might be due to invalid IL or missing references)
		//IL_010c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0111: Unknown result type (might be due to invalid IL or missing references)
		//IL_011b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0120: Unknown result type (might be due to invalid IL or missing references)
		//IL_0125: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d2: Unknown result type (might be due to invalid IL or missing references)
		float num = ShoreAt(deg);
		Vector2 val = Polar(deg, 1f);
		Vector2 val2 = default(Vector2);
		((Vector2)(ref val2))..ctor(0f - val.y, val.x);
		float num2 = 90f - deg;
		Vector2 val3 = val * (num - 2f);
		float num3 = Mathf.Max(0.9f, GroundMin(val3.x, val3.y, 1f) + 0.1f);
		for (int i = 0; i < 2; i++)
		{
			Vector2 val4 = val * (num - 1f + (float)i * 2f);
			At(tier.JettyFloor, new Vector3(val4.x, num3, val4.y), new Vector3(0f, num2, 0f), alignTop: true);
		}
		float[] array = new float[3]
		{
			num + 0.1f,
			num + 1.9f,
			num + 3.9f
		};
		for (int j = 0; j < array.Length; j++)
		{
			for (int k = -1; k <= 1; k += 2)
			{
				Vector2 val5 = val * array[j] + val2 * (0.9f * (float)k);
				float num4 = ((j == 2) ? (num3 + 0.6f - (float)k * 0.25f) : num3);
				float num5 = GroundMin(val5.x, val5.y, 0.2f);
				float num6 = num5 - 0.3f;
				int num7 = Mathf.Max(1, Mathf.CeilToInt((num4 - num6) / 2f));
				for (int l = 0; l < num7; l++)
				{
					float num8 = num4 - 2f * (float)(num7 - l);
					if (!(num8 + 2f < num5 + 0.1f))
					{
						At(tier.JettyPole, new Vector3(val5.x, num8, val5.y), new Vector3(0f, num2, 0f), alignTop: false);
					}
				}
			}
		}
	}

	private static void PlaceWreck(float deg)
	{
		//IL_0030: 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_00bc: Unknown result type (might be due to invalid IL or missing references)
		OnGround(new string[1] { tier.Wreck[0] }, Polar(deg - 8f, ShoreAt(deg - 8f) - 3f), deg + 88f, 0f, 0.25f);
		OnGround(new string[1] { tier.Wreck[1] }, Polar(deg + 8f, ShoreAt(deg + 8f) - 1.5f), deg + 128f, 0f, 0.3f);
		OnGround(new string[1] { tier.Wreck[2] }, Polar(deg, ShoreAt(deg) - 2.5f), deg + 108f, 0f, 0.2f);
	}

	private static void PlaceHoard()
	{
		Optional(0.125f, delegate
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: 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_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			float num = cliffDeg + 95f;
			float num2 = (PlateauAt(num) + ShoreAt(num)) * 0.5f;
			Vector2 val = Polar(num, num2);
			OnGround(bigRocks, Polar(num - 9f, num2 + 0.5f), num * 2f, 4.5f, 0.45f);
			OnGround(bigRocks, Polar(num + 9f, num2 - 0.5f), num * 3f, 3.5f, 0.45f);
			PlaceNetworked(tier.HoardName, new Vector3(val.x, GroundMin(val.x, val.y, 0.6f), val.y), 90f - num);
			Prop(new string[1] { "treasure_pile" }, Polar(num + 3f, num2 + 1.3f), 0f, 0.1f);
			Prop(new string[1] { "treasure_stack" }, Polar(num - 3f, num2 - 1.2f), 40f, 0.05f);
		});
		Optional(0.3f, delegate
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			PlaceNetworked(new string[1] { tier.RuneStone }, Polar(cliffDeg + 250f, PlateauAt(cliffDeg + 250f) + 1.5f), cliffDeg, 0f);
		});
	}

	private static void PlacePlants()
	{
		float[] angles = new float[6] { 60f, 110f, 170f, 235f, 280f, 345f };
		for (int i = 0; i < angles.Length; i++)
		{
			int k = i;
			Optional(0.7f, delegate
			{
				//IL_0043: Unknown result type (might be due to invalid IL or missing references)
				OnGround(tier.Bushes, Polar(angles[k], PlateauAt(angles[k]) + 1.5f + (float)(k % 2)), angles[k] * 5f, 0f, 0.15f, strip: false);
			});
		}
		Optional(0.8f, delegate
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			OnGround(tier.Trees, Polar(320f, PlateauAt(320f) + 0.5f), 45f, 0f, 0.05f, strip: false);
		});
		Optional(0.6f, delegate
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			OnGround(tier.Trees, Polar(30f, PlateauAt(30f) + 2f), 160f, 0f, 0.05f, strip: false);
		});
		Optional(0.7f, delegate
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			OnGround(tier.SmallTrees, Polar(140f, PlateauAt(140f) + 1f), 200f, 0f, 0.05f, strip: false);
		});
	}

	private static void PlacePickables()
	{
		Optional(0.8f, delegate
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			PlaceNetworked(tier.Berries, Polar(80f, PlateauAt(80f) + 1f), 30f, 0f);
		});
		Optional(0.8f, delegate
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			PlaceNetworked(tier.Berries, Polar(255f, PlateauAt(255f) + 2f), 200f, 0f);
		});
		Optional(0.6f, delegate
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			PlaceNetworked(tier.Berries, Polar(170f, PlateauAt(170f) + 1.5f), 90f, 0f);
		});
		Optional(0.7f, delegate
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			PlaceNetworked(tier.Mushrooms, Polar(130f, PlateauAt(130f) + 0.5f), 0f, 0f);
		});
		Optional(0.7f, delegate
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			PlaceNetworked(tier.Mushrooms, Polar(300f, PlateauAt(300f) + 1.5f), 0f, 0f);
		});
		float[] shore = new float[5] { 15f, 105f, 160f, 245f, 315f };
		for (int num = 0; num < shore.Length; num++)
		{
			int k = num;
			Optional(0.75f, delegate
			{
				//IL_0050: Unknown result type (might be due to invalid IL or missing references)
				PlaceNetworked(new string[1] { (k % 2 == 0) ? "Pickable_Flint" : "Pickable_Stone" }, Polar(shore[k], ShoreAt(shore[k]) - 3f), shore[k], 0f);
			});
		}
		Optional(0.7f, delegate
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			PlaceNetworked(new string[1] { "Pickable_Branch" }, Polar(25f, ShoreAt(25f) - 4f), 80f, 0f);
		});
		Optional(0.7f, delegate
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			PlaceNetworked(new string[1] { "Pickable_Branch" }, Polar(185f, PlateauAt(185f) + 2f), 10f, 0f);
		});
	}

	private static void CourtyardGuardsAndChest(float floor, Vector3 chest, float chestRotY)
	{
		//IL_0026: 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_006a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0083: Unknown result type (might be due to invalid IL or missing references)
		float num = floor + 0.2f;
		string[] guards = tier.Guards;
		PlaceNetworked(IsletTier.SpawnerName(guards[0]), new Vector3(1.5f, num, 0.5f), 0f);
		PlaceNetworked(IsletTier.SpawnerName(guards[1]), new Vector3(-1f, num, -1.5f), 0f);
		PlaceNetworked(IsletTier.SpawnerName(guards[2]), new Vector3(0f, num, 1.5f), 0f);
		PlaceNetworked(tier.ChestName, chest, chestRotY);
	}

	private static void PlaceOutsideGuard()
	{
		//IL_0035: Unknown result type (might be due to invalid IL or missing references)
		float degrees = cliffDeg + 194f;
		PlaceNetworked(new string[1] { IsletTier.SpawnerName(tier.Guards[3]) }, Polar(degrees, ShoreAt(degrees) - 6f), 0f, 0.3f);
	}

	private static void RidgeGuard()
	{
		//IL_0035: Unknown result type (might be due to invalid IL or missing references)
		float degrees = cliffDeg + 19f;
		PlaceNetworked(new string[1] { IsletTier.SpawnerName(tier.Guards[4]) }, Polar(degrees, PlateauAt(degrees) - 1f), 0f, 0.3f);
	}

	private static void Optional(float chance, Action build)
	{
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		//IL_000b: Expected O, but got Unknown
		GameObject val = new GameObject("IoV_Optional");
		val.transform.SetParent(parent, false);
		val.AddComponent<RandomSpawn>().m_chanceToSpawn = chance * 100f;
		Transform val2 = parent;
		parent = val.transform;
		build();
		parent = val2;
	}

	private static void OneOf(params Action[] designs)
	{
		float[] array = new float[designs.Length];
		for (int i = 0; i < array.Length; i++)
		{
			array[i] = 1f;
		}
		OneOf(array, designs);
	}

	private static void OneOf(float[] weights, params Action[] designs)
	{
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		//IL_000b: Expected O, but got Unknown
		//IL_003d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0044: Expected O, but got Unknown
		//IL_0057: Unknown result type (might be due to invalid IL or missing references)
		//IL_005e: Expected O, but got Unknown
		GameObject val = new GameObject("IoV_OneOf");
		val.transform.SetParent(parent, false);
		RandomObject val2 = val.AddComponent<RandomObject>();
		val2.m_objects = new List<ObjectEntry>();
		Transform val3 = parent;
		for (int i = 0; i < designs.Length; i++)
		{
			GameObject val4 = new GameObject("IoV_Design");
			val4.transform.SetParent(val.transform, false);
			ObjectEntry val5 = new ObjectEntry();
			val5.m_object = val4;
			val5.m_weight = weights[i];
			val2.m_objects.Add(val5);
			parent = val4.transform;
			designs[i]();
		}
		parent = val3;
	}

	private static void PlaceNetworked(string[] candidates, Vector2 at, float rotY, float lift)
	{
		//IL_004e: Unknown result type (might be due to invalid IL or missing references)
		string name = candidates[0];
		foreach (string text in candidates)
		{
			if ((Object)(object)PlantOrSelf(text) != (Object)null)
			{
				name = text;
				break;
			}
		}
		PlaceNetworked(name, new Vector3(at.x, Height(at.x, at.y) + lift, at.y), rotY);
	}

	private static GameObject PlantOrSelf(string name)
	{
		GameObject prefab = PrefabManager.Instance.GetPrefab(IsletPrefabs.PlantName(name));
		if (!((Object)(object)prefab != (Object)null))
		{
			return PrefabManager.Instance.GetPrefab(name);
		}
		return prefab;
	}

	private static void PlaceNetworked(string name, Vector3 pos, float rotY)
	{
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: Unknown result type (might be due to invalid IL or missing references)
		GameObject val = PlantOrSelf(name);
		if ((Object)(object)val == (Object)null)
		{
			missing++;
			Plugin.Debug("Prefab " + name + " missing");
			return;
		}
		GameObject val2 = Object.Instantiate<GameObject>(val, parent, false);
		((Object)val2).name = ((Object)val).name;
		val2.transform.localPosition = pos;
		val2.transform.localRotation = Quaternion.Euler(0f, rotY, 0f);
		built++;
		Plugin.Debug("  " + name + " at " + ((Vector3)(ref pos)).ToString("F1"));
	}

	private static void LogProperties(Material m)
	{
		//IL_0039: Unknown result type (might be due to invalid IL or missing references)
		//IL_003e: Unknown result type (might be due to invalid IL or missing references)
		//IL_003f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0041: Invalid comparison between Unknown and I4
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_0045: Invalid comparison between Unknown and I4
		//IL_0080: Unknown result type (might be due to invalid IL or missing references)
		if (!Plugin.DebugLog.Value || (Object)(object)m.shader == (Object)null)
		{
			return;
		}
		List<string> list = new List<string>();
		for (int i = 0; i < m.shader.GetPropertyCount(); i++)
		{
			string propertyName = m.shader.GetPropertyName(i);
			ShaderPropertyType propertyType = m.shader.GetPropertyType(i);
			if ((int)propertyType == 2 || (int)propertyType == 3)
			{
				list.Add(propertyName + "=" + m.GetFloat(propertyName));
				continue;
			}
			list.Add(string.Concat(propertyName, "(", propertyType, ")"));
		}
		Plugin.Debug("Terrain shader " + ((Object)m.shader).name + " keywords [" + string.Join(" ", m.shaderKeywords) + "] properties: " + string.Join(", ", list.ToArray()));
	}

	private static string Describe(Material m)
	{
		if ((Object)(object)m == (Object)null)
		{
			return "none";
		}
		return ((Object)m).name + " (shader " + (((Object)(object)m.shader != (Object)null) ? ((Object)m.shader).name : "?") + ")";
	}

	private static void PlaceHints()
	{
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		for (int i = 0; i < 3; i++)
		{
			PlaceNetworked(new string[1] { "IoV_Spawner_Gull" }, Polar(cliffDeg + 60f + (float)i * 120f, 3.5f), 0f, 0.3f);
		}
		PlaceBeacon();
	}

	private static void PlaceBeacon()
	{
		//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00db: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
		//IL_011a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0129: Unknown result type (might be due to invalid IL or missing references)
		//IL_013b: Unknown result type (might be due to invalid IL or missing references)
		GameObject val = Find(beacons);
		if ((Object)(object)val == (Object)null)
		{
			return;
		}
		GameObject val2 = Object.Instantiate<GameObject>(val, parent, false);
		((Object)val2).name = ((Object)val).name;
		Fireplace[] componentsInChildren = val2.GetComponentsInChildren<Fireplace>(true);
		foreach (Fireplace val3 in componentsInChildren)
		{
			GameObject[] array = (GameObject[])(object)new GameObject[2] { val3.m_enabledObject, val3.m_enabledObjectHigh };
			foreach (GameObject val4 in array)
			{
				if ((Object)(object)val4 != (Object)null)
				{
					val4.SetActive(true);
				}
			}
		}
		Strip(val2);
		val2.AddComponent<NightFire>();
		built++;
		float degrees = cliffDeg + 16f;
		Vector2 val5 = Polar(degrees, PlateauAt(degrees) + 3.5f);
		Bounds b = LocalBounds(val2);
		float num = GroundMin(val5.x, val5.y, 0.4f * Mathf.Max(((Bounds)(ref b)).size.x, ((Bounds)(ref b)).size.z)) - 0.1f * ((Bounds)(ref b)).size.y;
		Move(val2, b, new Vector3(val5.x, num, val5.y), alignTop: false);
	}

	private static void PlaceRuins()
	{
		switch (tier.Style)
		{
		case RuinStyle.StoneHall:
			MainRuin(StoneHall, FishingCamp);
			Ridge(StoneTower);
			break;
		case RuinStyle.StiltHut:
			MainRuin(StiltHut, SunkenShrine);
			Ridge(Graves);
			break;
		case RuinStyle.FulingCamp:
			MainRuin(FulingCamp, FulingRuin);
			Ridge(FulingLookout);
			break;
		case RuinStyle.DvergrRuin:
			MainRuin(DvergrRuin, DvergrOutpost);
			Ridge(DvergrColumn);
			break;
		case RuinStyle.GraustenFort:
			MainRuin(GraustenFort, AshlandsArches);
			Ridge(GraustenPillar);
			break;
		}
	}

	private static void MainRuin(Action a, Action b)
	{
		if (tier.Nest == null)
		{
			OneOf(Turned(a, 0f), Turned(a, 180f), Turned(b, 90f), Turned(b, 270f));
			return;
		}
		OneOf(new float[5] { 0.19f, 0.19f, 0.19f, 0.19f, 0.24f }, Turned(a, 0f), Turned(a, 180f), Turned(b, 90f), Turned(b, 270f), NestSite);
	}

	private static Action Turned(Action design, float yaw)
	{
		return delegate
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			design();
			parent.localRotation = Quaternion.Euler(0f, yaw, 0f);
		};
	}

	private static void NestSite()
	{
		//IL_002f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		//IL_005b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0060: Unknown result type (might be due to invalid IL or missing references)
		//IL_0077: Unknown result type (might be due to invalid IL or missing references)
		//IL_007c: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00dd: 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_00f9: Unknown result type (might be due to invalid IL or missing references)
		//IL_0124: Unknown result type (might be due to invalid IL or missing references)
		//IL_0168: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0203: Unknown result type (might be due to invalid IL or missing references)
		//IL_0208: Unknown result type (might be due to invalid IL or missing references)
		//IL_0222: Unknown result type (might be due to invalid IL or missing references)
		Vector2[] array = tier.NestCount switch
		{
			1 => (Vector2[])(object)new Vector2[1] { Vector2.zero }, 
			2 => (Vector2[])(object)new Vector2[2]
			{
				new Vector2(-1.6f, 0.3f),
				new Vector2(1.7f, -0.4f)
			}, 
			_ => (Vector2[])(object)new Vector2[4]
			{
				new Vector2(-1.4f, 1.2f),
				new Vector2(1.5f, 1f),
				new Vector2(-1.2f, -1.5f),
				new Vector2(1.3f, -1.3f)
			}, 
		};
		for (int i = 0; i < array.Length; i++)
		{
			PlaceNetworked(new string[1] { tier.Nest }, array[i], (float)i * 77f, 0f);
		}
		float[] array2 = new float[4] { 30f, 140f, 250f, 320f };
		for (int j = 0; j < array2.Length; j++)
		{
			OnGround(bigRocks, Polar(array2[j], 4.8f), array2[j] * 2f, 2f + (float)(j % 2) * 0.8f, 0.4f);
		}
		PropAtMost(tier.NestProps[0], Polar(95f, 3.6f), 30f, 0.15f, 2.4f);
		PropAtMost(tier.NestProps[1], Polar(290f, 3.2f), 200f, 0.05f, 1.6f);
		Vector2 val = Polar(200f, 3.2f);
		CourtyardGuardsAndChest(3f, new Vector3(val.x, 3f, val.y), 20f);
	}

	private static void Ridge(Action build)
	{
		Optional(0.75f, delegate
		{
			build();
			RidgeGuard();
		});
	}

	private static void StoneHall()
	{
		//IL_006f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0083: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00de: Unknown result type (might be due to invalid IL or missing references)
		//IL_0106: Unknown result type (might be due to invalid IL or missing references)
		//IL_010b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0134: Unknown result type (might be due to invalid IL or missing references)
		//IL_0139: Unknown result type (might be due to invalid IL or missing references)
		//IL_0163: Unknown result type (might be due to invalid IL or missing references)
		//IL_0168: Unknown result type (might be due to invalid IL or missing references)
		//IL_0185: Unknown result type (might be due to invalid IL or missing references)
		//IL_018a: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e4: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f8: Unknown result type (might be due to invalid IL or missing references)
		//IL_0214: Unknown result type (might be due to invalid IL or missing references)
		//IL_0228: Unknown result type (might be due to invalid IL or missing references)
		//IL_0244: Unknown result type (might be due to invalid IL or missing references)
		//IL_0258: Unknown result type (might be due to invalid IL or missing references)
		//IL_0274: Unknown result type (might be due to invalid IL or missing references)
		//IL_0279: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a3: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c9: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e9: Unknown result type (might be due to invalid IL or missing references)
		//IL_02fd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0319: Unknown result type (might be due to invalid IL or missing references)
		//IL_031e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0348: Unknown result type (might be due to invalid IL or missing references)
		//IL_034d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0377: Unknown result type (might be due to invalid IL or missing references)
		//IL_037c: Unknown result type (might be due to invalid IL or missing references)
		//IL_03a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ab: Unknown result type (might be due to invalid IL or missing references)
		//IL_03dd: Unknown result type (might be due to invalid IL or missing references)
		//IL_03e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0402: Unknown result type (might be due to invalid IL or missing references)
		//IL_0416: Unknown result type (might be due to invalid IL or missing references)
		//IL_0436: Unknown result type (might be due to invalid IL or missing references)
		//IL_044a: Unknown result type (might be due to invalid IL or missing references)
		//IL_046a: Unknown result type (might be due to invalid IL or missing references)
		//IL_003a: Unknown result type (might be due to invalid IL or missing references)
		//IL_003f: Unknown result type (might be due to invalid IL or missing references)
		for (int i = -3; i <= 3; i += 2)
		{
			for (int j = -3; j <= 3; j += 2)
			{
				if ((i != 3 || j != 3) && (i != -3 || j != -1) && (i != 1 || j != -3) && (i != 3 || j != -1))
				{
					At("stone_floor_2x2", new Vector3((float)i, 3.25f, (float)j), Vector3.zero, alignTop: true);
				}
			}
		}
		At("stone_floor_2x2", new Vector3(6f, 3.25f, 3.5f), new Vector3(8f, 30f, -6f), alignTop: true);
		At("stone_floor_2x2", new Vector3(-5.5f, 3.2f, -4.5f), new Vector3(-5f, 70f, 7f), alignTop: true);
		float num = 3.2f;
		float num2 = Top(At("stone_wall_4x2", new Vector3(-2f, num, 4f), Vector3.zero, alignTop: false), num + 2f);
		float num3 = Top(At("stone_wall_4x2", new Vector3(2f, num, 4f), Vector3.zero, alignTop: false), num + 2f);
		float num4 = Top(At("stone_wall_4x2", new Vector3(-2f, num2, 4f), Vector3.zero, alignTop: false), num2 + 2f);
		At("stone_wall_2x1", new Vector3(1f, num3, 4f), Vector3.zero, alignTop: false);
		At("stone_wall_1x1", new Vector3(-3.5f, num4, 4f), Vector3.zero, alignTop: false);
		float num5 = Top(At("stone_wall_4x2", new Vector3(-4f, num, 2f), new Vector3(0f, 90f, 0f), alignTop: false), num + 2f);
		At("stone_wall_2x1", new Vector3(-4f, num5, 3f), new Vector3(0f, 90f, 0f), alignTop: false);
		At("stone_wall_2x1", new Vector3(-4f, num, -1f), new Vector3(0f, 90f, 0f), alignTop: false);
		At("stone_wall_1x1", new Vector3(-4f, num, -3.5f), new Vector3(0f, 90f, 0f), alignTop: false);
		float num6 = Top(At("stone_pillar", new Vector3(4f, num, 4f), Vector3.zero, alignTop: false), num + 2f);
		At("stone_pillar", new Vector3(4f, num6, 4f), Vector3.zero, alignTop: false);
		At("stone_pillar", new Vector3(4f, num, 0f), Vector3.zero, alignTop: false);
		At("stone_pillar", new Vector3(5.6f, 2.9f, -1.5f), new Vector3(0f, 25f, 90f), alignTop: false);
		float num7 = Top(At("stone_pillar", new Vector3(-1.5f, num, -4f), Vector3.zero, alignTop: false), num + 2f);
		num7 = Top(At("stone_pillar", new Vector3(-1.5f, num7, -4f), Vector3.zero, alignTop: false), num7 + 2f);
		float num8 = Top(At("stone_pillar", new Vector3(1.5f, num, -4f), Vector3.zero, alignTop: false), num + 2f);
		num8 = Top(At("stone_pillar", new Vector3(1.5f, num8, -4f), Vector3.zero, alignTop: false), num8 + 2f);
		At("stone_arch", new Vector3(0f, Mathf.Min(num7, num8), -4f), Vector3.zero, alignTop: true);
		At("stone_wall_1x1", new Vector3(-6f, 2.85f, 1f), new Vector3(10f, 35f, 80f), alignTop: false);
		At("stone_wall_1x1", new Vector3(2.5f, 2.85f, 6.2f), new Vector3(-8f, 60f, 5f), alignTop: false);
		CourtyardGuardsAndChest(3.25f, new Vector3(-2f, 3.25f, 2.8f), 180f);
	}

	private static void StoneTower()
	{
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Unknown result type (might be due to invalid IL or missing references)
		//IL_004f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0050: Unknown result type (might be due to invalid IL or missing references)
		//IL_006c: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0089: Unknown result type (might be due to invalid IL or missing references)
		//IL_008a: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ac: 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_00c9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ed: 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)
		//IL_0110: Unknown result type (might be due to invalid IL or missing references)
		//IL_0132: 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)
		RidgeSpot(2.8f, out var centre, out var turn, out var bottom);
		Local("stone_wall_4x2", centre, turn, 0f, 1.5f, bottom, 0f);
		Local("stone_wall_4x2", centre, turn, -1.5f, 0f, bottom, 90f);
		Local("stone_wall_4x2", centre, turn, 1.5f, 0f, bottom, 90f);
		Local("stone_wall_1x1", centre, turn, -1.5f, -1.5f, bottom, 0f);
		Local("stone_wall_1x1", centre, turn, -1.5f, -1.5f, bottom + 1f, 0f);
		Local("stone_wall_1x1", centre, turn, 1.5f, -1.5f, bottom, 0f);
		Local("stone_wall_4x2", centre, turn, 0f, 1.5f, bottom + 2f, 0f);
		Local("stone_wall_4x2", centre, turn, -1.5f, 0f, bottom + 2f, 90f);
		Local("stone_wall_2x1", centre, turn, 1.5f, 1f, bottom + 2f, 90f);
		Local("stone_wall_1x1", centre, turn, -0.5f, 1.5f, bottom + 4f, 0f);
		LyingBeams("wood_beam", "wood_pole2");
	}

	private static void StiltHut()
	{
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		//IL_001e: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_00ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
		//IL_011a: 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_014a: Unknown result type (might be due to invalid IL or missing references)
		//IL_015e: Unknown result type (might be due to invalid IL or missing references)
		//IL_017a: Unknown result type (might be due to invalid IL or missing references)
		//IL_017f: Unknown result type (might be due to invalid IL or missing references)
		//IL_019b: Unknown result type (might be due to invalid IL or missing references)
		//IL_01af: Unknown result type (might be due to invalid IL or missing references)
		//IL_01cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_01df: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ff: Unknown result type (might be due to invalid IL or missing references)
		//IL_0213: Unknown result type (might be due to invalid IL or missing references)
		//IL_022f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0243: Unknown result type (might be due to invalid IL or missing references)
		//IL_0263: Unknown result type (might be due to invalid IL or missing references)
		//IL_0277: Unknown result type (might be due to invalid IL or missing references)
		//IL_0297: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ab: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0305: Unknown result type (might be due to invalid IL or missing references)
		//IL_0336: Unknown result type (might be due to invalid IL or missing references)
		//IL_0356: Unknown result type (might be due to invalid IL or missing references)
		//IL_0074: Unknown result type (might be due to invalid IL or missing references)
		//IL_0079: Unknown result type (might be due to invalid IL or missing references)
		float num = 4f;
		for (int i = -1; i <= 1; i += 2)
		{
			for (int j = -2; j <= 2; j += 2)
			{
				At("wood_floor", new Vector3((float)i, num, (float)j), Vector3.zero, alignTop: true);
			}
		}
		for (int k = -2; k <= 2; k += 4)
		{
			for (int l = -3; l <= 3; l += 2)
			{
				float num2 = GroundMin(k, l, 0.2f) - 0.5f;
				At("wood_pole2", new Vector3((float)k, Mathf.Min(num2, num - 2f), (float)l), Vector3.zero, alignTop: false);
			}
		}
		At("woodwall", new Vector3(-1f, num, 3f), Vector3.zero, alignTop: false);
		At("woodwall", new Vector3(1f, num, 3f), Vector3.zero, alignTop: false);
		At("woodwall", new Vector3(-2f, num, 1f), new Vector3(0f, 90f, 0f), alignTop: false);
		At("woodwall", new Vector3(-2f, num, -1f), new Vector3(0f, 90f, 0f), alignTop: false);
		At("woodwall", new Vector3(2f, num, 1f), new Vector3(0f, 90f, 0f), alignTop: false);
		At("woodwall", new Vector3(-1f, num, -3f), Vector3.zero, alignTop: false);
		At("wood_wall_half", new Vector3(2f, num, -2f), new Vector3(0f, 90f, 0f), alignTop: false);
		At("wood_roof", new Vector3(0.5f, num, -0.5f), new Vector3(10f, 20f, 0f), alignTop: false);
		At("wood_roof", new Vector3(4f, 2.9f, -1f), new Vector3(15f, 80f, 20f), alignTop: false);
		At("wood_beam", new Vector3(1f, num, -2.5f), new Vector3(0f, 30f, 0f), alignTop: false);
		At("wood_fence", new Vector3(-4.5f, 2.95f, -2f), new Vector3(0f, 80f, 0f), alignTop: false);
		At("wood_fence", new Vector3(-4f, 2.95f, -5f), new Vector3(0f, 30f, 8f), alignTop: false);
		Prop(new string[1] { "skull_pile" }, new Vector2(3.5f, 4.5f), 40f, 0.1f);
		Prop(new string[1] { "bone_stack" }, new Vector2(-4f, 3.5f), 110f, 0.1f);
		Prop(new string[1] { "crypt_skeleton_laying" }, new Vector2(3f, -4.5f), 200f, 0.05f);
		CourtyardGuardsAndChest(num, new Vector3(-1f, num, 2.2f), 180f);
	}

	private static void Graves()
	{
		//IL_002b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0043: 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_004d: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0096: Unknown result type (might be due to invalid IL or missing references)
		//IL_009d: Unknown result type (might be due to invalid IL or missing references)
		RidgeSpot(2.5f, out var centre, out var turn, out var _);
		float[,] array = new float[4, 2]
		{
			{ -1.5f, 0f },
			{ 0f, 0.3f },
			{ 1.5f, -0.2f },
			{ 0.7f, 1.6f }
		};
		for (int i = 0; i < array.GetLength(0); i++)
		{
			Vector3 val = turn * new Vector3(array[i, 0], 0f, array[i, 1]);
			Prop(new string[2]
			{
				(i % 2 == 0) ? "marker01" : "marker02",
				"marker01"
			}, new Vector2(centre.x + val.x, centre.y + val.z), ((Quaternion)(ref turn)).eulerAngles.y + (float)i * 7f, 0.15f);
		}
		Prop(new string[1] { "crypt_skeleton_laying" }, centre, ((Quaternion)(ref turn)).eulerAngles.y + 90f, 0.05f);
	}

	private static void FulingCamp()
	{
		//IL_0098: Unknown result type (might be due to invalid IL or missing references)
		//IL_009d: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
		//IL_010b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0127: Unknown result type (might be due to invalid IL or missing references)
		//IL_013b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0157: Unknown result type (might be due to invalid IL or missing references)
		//IL_015c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0178: Unknown result type (might be due to invalid IL or missing references)
		//IL_017d: Unknown result type (might be due to invalid IL or missing references)
		//IL_019a: Unknown result type (might be due to invalid IL or missing references)
		//IL_019f: Unknown result type (might be due to invalid IL or missing references)
		//IL_01bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ec: Unknown result type (might be due to invalid IL or missing references)
		//IL_0200: Unknown result type (might be due to invalid IL or missing references)
		//IL_021c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0230: Unknown result type (might be due to invalid IL or missing references)
		//IL_0259: Unknown result type (might be due to invalid IL or missing references)
		//IL_028a: Unknown result type (might be due to invalid IL or missing references)
		//IL_02bb: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ec: Unknown result type (might be due to invalid IL or missing references)
		//IL_0314: 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_0029: Unknown result type (might be due to invalid IL or missing references)
		//IL_0056: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		for (int i = 0; i < 16; i++)
		{
			float num = (float)i * 22.5f;
			if (num != 270f && i != 3 && i != 10)
			{
				Vector2 val = Polar(num, 6.5f);
				At("goblin_fence", new Vector3(val.x, Height(val.x, val.y) - 0.2f, val.y), new Vector3(0f, 0f - (num + 90f), 0f), alignTop: false);
			}
		}
		float num2 = 2.95f;
		float num3 = Mathf.Min(Top(At("goblin_woodwall_2m", new Vector3(-1f, num2, 3.5f), Vector3.zero, alignTop: false), num2 + 2f), Top(At("goblin_woodwall_2m", new Vector3(1f, num2, 3.5f), Vector3.zero, alignTop: false), num2 + 2f));
		At("goblin_woodwall_2m_ribs", new Vector3(-2f, num2, 2.5f), new Vector3(0f, 90f, 0f), alignTop: false);
		At("goblin_woodwall_2m", new Vector3(2f, num2, 2.5f), new Vector3(0f, 90f, 0f), alignTop: false);
		At("goblin_pole", new Vector3(-2f, num2, 3.5f), Vector3.zero, alignTop: false);
		At("goblin_pole", new Vector3(2f, num2, 3.5f), Vector3.zero, alignTop: false);
		At("goblin_roof_45d", new Vector3(0f, num3, 3f), Vector3.zero, alignTop: false);
		At("goblin_roof_45d", new Vector3(0f, num3, 2f), new Vector3(0f, 180f, 0f), alignTop: false);
		At("goblin_totempole", new Vector3(2.5f, num2, -5.2f), new Vector3(0f, 160f, 0f), alignTop: false);
		At("goblin_banner", new Vector3(-2.5f, num2, -5.5f), new Vector3(0f, 200f, 0f), alignTop: false);
		Prop(new string[1] { "goblin_strawpile" }, new Vector2(-3.5f, 0.5f), 30f, 0.1f);
		Prop(new string[1] { "goblin_strawpile" }, new Vector2(3.8f, -0.5f), 300f, 0.1f);
		Prop(new string[1] { "goblin_trashpile" }, new Vector2(4f, 3.5f), 60f, 0.1f);
		Prop(new string[1] { "fire_pit" }, new Vector2(0f, -1f), 0f, 0.05f);
		CourtyardGuardsAndChest(3f, new Vector3(-0.8f, 3f, 2.4f), 180f);
	}

	private static void FulingLookout()
	{
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: 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_0039: Unknown result type (might be due to invalid IL or missing references)
		//IL_005b: 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_0089: Unknown result type (might be due to invalid IL or missing references)
		RidgeSpot(2f, out var centre, out var turn, out var bottom);
		Local("goblin_totempole", centre, turn, -1f, 0f, bottom + 0.2f, 0f);
		Local("goblin_totempole", centre, turn, 1.2f, 0.4f, bottom + 0.2f, 40f);
		Local("goblin_banner", centre, turn, 0f, 1f, bottom + 0.2f, 0f);
		Prop(new string[1] { "goblin_trashpile" }, centre, 0f, 0.1f);
	}

	private static void DvergrRuin()
	{
		//IL_007d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0082: Unknown result type (might be due to invalid IL or missing references)
		//IL_0193: Unknown result type (might be due to invalid IL or missing references)
		//IL_0198: Unknown result type (might be due to invalid IL or missing references)
		//IL_01af: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
		//IL_01fe: Unknown result type (might be due to invalid IL or missing references)
		//IL_0203: Unknown result type (might be due to invalid IL or missing references)
		//IL_0220: Unknown result type (might be due to invalid IL or missing references)
		//IL_0225: Unknown result type (might be due to invalid IL or missing references)
		//IL_0257: Unknown result type (might be due to invalid IL or missing references)
		//IL_0288: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b9: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_0312: 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_00f1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_002a: Unknown result type (might be due to invalid IL or missing references)
		//IL_002f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0140: Unknown result type (might be due to invalid IL or missing references)
		//IL_0145: Unknown result type (might be due to invalid IL or missing references)
		for (int i = -2; i <= 2; i += 2)
		{
			for (int j = -2; j <= 2; j += 2)
			{
				if ((i != 2 || j != 2) && (i != -2 || j != -2))
				{
					At("blackmarble_floor", new Vector3((float)i, 3.25f, (float)j), Vector3.zero, alignTop: true);
				}
			}
		}
		float num = 3.2f;
		float[] array = new float[7] { 30f, 90f, 150f, 210f, 255f, 285f, 330f };
		float num2 = num + 4f;
		for (int k = 0; k < array.Length; k++)
		{
			Vector2 val = Polar(array[k], 4.2f);
			if (array[k] == 150f)
			{
				At("blackmarble_column_1", new Vector3(val.x * 1.4f, 2.9f, val.y * 1.4f), new Vector3(0f, 20f, 90f), alignTop: false);
				continue;
			}
			float num3 = Top(At("blackmarble_column_1", new Vector3(val.x, num, val.y), Vector3.zero, alignTop: false), num + 2f);
			if (array[k] == 90f || array[k] == 255f || array[k] == 285f)
			{
				num3 = Top(At("blackmarble_column_2", new Vector3(val.x, num3, val.y), Vector3.zero, alignTop: false), num3 + 2f);
			}
			if (array[k] == 255f)
			{
				num2 = num3;
			}
		}
		Vector2 val2 = Polar(270f, 4.2f * Mathf.Cos((float)Math.PI / 12f));
		At("blackmarble_arch", new Vector3(val2.x, num2, val2.y), Vector3.zero, alignTop: true);
		float num4 = Top(At("blackmarble_2x2x1", new Vector3(-1f, num, 3.6f), Vector3.zero, alignTop: false), num + 1f);
		At("blackmarble_2x2x1", new Vector3(1f, num, 3.6f), Vector3.zero, alignTop: false);
		At("blackmarble_2x1x1", new Vector3(-1f, num4, 3.6f), Vector3.zero, alignTop: false);
		Prop(new string[2] { "blackmarble_head_big01", "blackmarble_head01" }, new Vector2(5.5f, -3f), 120f, 0.25f);
		Prop(new string[1] { "dvergrprops_crate" }, new Vector2(2.5f, 2.2f), 15f, 0.05f);
		Prop(new string[1] { "dvergrprops_barrel" }, new Vector2(-2.8f, 1.5f), 0f, 0.05f);
		Prop(new string[1] { "blackmarble_pile" }, new Vector2(-5f, -2.5f), 70f, 0.2f);
		CourtyardGuardsAndChest(3.25f, new Vector3(0.2f, 3.25f, 1.6f), 180f);
	}

	private static void DvergrColumn()
	{
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		//IL_003e: Unknown result type (might be due to invalid IL or missing references)
		//IL_003f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0067: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: Unknown result type (might be due to invalid IL or missing references)
		//IL_0092: Unknown result type (might be due to invalid IL or missing references)
		//IL_009d: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
		RidgeSpot(1.5f, out var centre, out var turn, out var bottom);
		float num = Top(Local("blackmarble_base_1", centre, turn, 0f, 0f, bottom, 0f), bottom + 1f);
		num = Top(Local("blackmarble_column_3", centre, turn, 0f, 0f, num, 0f), num + 3f);
		Local("blackmarble_tip", centre, turn, 0f, 0f, num, 0f);
		Prop(new string[1] { "blackmarble_pile" }, centre + new Vector2(1.5f, 1f), 30f, 0.2f);
	}

	private static void GraustenFort()
	{
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		//IL_003b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0040: 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_0070: Unknown result type (might be due to invalid IL or missing references)
		//IL_008c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0091: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00db: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0100: Unknown result type (might be due to invalid IL or missing references)
		//IL_0114: Unknown result type (might be due to invalid IL or missing references)
		//IL_0134: Unknown result type (might be due to invalid IL or missing references)
		//IL_0148: Unknown result type (might be due to invalid IL or missing references)
		//IL_016e: Unknown result type (might be due to invalid IL or missing references)
		//IL_019c: Unknown result type (might be due to invalid IL or missing references)
		//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
		At("Ashlands_Ruins_Floor_6x6_broken1", new Vector3(0f, 3.25f, 0f), Vector3.zero, alignTop: true);
		float num = 3.2f;
		At("Ashlands_Ruins_Wall_Broken3_4x6", new Vector3(-1f, num, 3.5f), Vector3.zero, alignTop: false);
		At("Ashlands_Ruins_Wall_Window_4x6_broken2", new Vector3(-3.5f, num, 0.5f), new Vector3(0f, 90f, 0f), alignTop: false);
		At("Ashlands_Pillar4", new Vector3(3.5f, num, 3.5f), Vector3.zero, alignTop: false);
		Prop(new string[1] { "Ashlands_Pillar4_tip_broken1" }, new Vector2(5.5f, 2f), 70f, 0.2f);
		At("Ashlands_Arch2_Broken1", new Vector3(0.5f, num, -3.5f), Vector3.zero, alignTop: false);
		At("Piece_grausten_wall_2x2", new Vector3(5f, 2.85f, -1f), new Vector3(0f, 30f, 85f), alignTop: false);
		At("Piece_grausten_wall_1x2", new Vector3(-5.5f, 2.85f, -3.5f), new Vector3(80f, 60f, 0f), alignTop: false);
		Prop(new string[1] { "grausten_pile" }, new Vector2(4.5f, -4f), 0f, 0.2f);
		Prop(new string[1] { "ashland_pot1_red" }, new Vector2(-2f, 2f), 0f, 0.02f);
		Prop(new string[1] { "ashland_pot2_green" }, new Vector2(2.4f, 2.4f), 40f, 0.02f);
		CourtyardGuardsAndChest(3.25f, new Vector3(-1.5f, 3.25f, 2.2f), 180f);
	}

	private static void GraustenPillar()
	{
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		//IL_002d: 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_0042: Unknown result type (might be due to invalid IL or missing references)
		//IL_0047: Unknown result type (might be due to invalid IL or missing references)
		//IL_0082: Unknown result type (might be due to invalid IL or missing references)
		RidgeSpot(2f, out var centre, out var turn, out var bottom);
		Local("Ashlands_Fortress_Wall_Pillar_base", centre, turn, 0f, 0f, bottom, 0f);
		Vector3 val = turn * new Vector3(2f, 0f, -1.5f);
		Prop(new string[2] { "Ashlands_Fortress_Wall_PillarTopStone", "Ashlands_Ruins_TopStone" }, new Vector2(centre.x + val.x, centre.y + val.z), 40f, 0.2f);
		LyingBeams("Piece_grausten_pillarbeam_small", "Piece_grausten_pillarbeam_medium");
	}

	private static void FishingCamp()
	{
		//IL_004f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0054: Unknown result type (might be due to invalid IL or missing references)
		//IL_0070: Unknown result type (might be due to invalid IL or missing references)
		//IL_0075: Unknown result type (might be due to invalid IL or missing references)
		//IL_0091: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0105: Unknown result type (might be due to invalid IL or missing references)
		//IL_0121: Unknown result type (might be due to invalid IL or missing references)
		//IL_0126: Unknown result type (might be due to invalid IL or missing references)
		//IL_0142: Unknown result type (might be due to invalid IL or missing references)
		//IL_0156: Unknown result type (might be due to invalid IL or missing references)
		//IL_001e: 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_019d: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
		//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ef: Unknown result type (might be due to invalid IL or missing references)
		//IL_0203: Unknown result type (might be due to invalid IL or missing references)
		//IL_0237: Unknown result type (might be due to invalid IL or missing references)
		//IL_0271: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ab: Unknown result type (might be due to invalid IL or missing references)
		//IL_02dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_02fc: Unknown result type (might be due to invalid IL or missing references)
		float num = 3.05f;
		for (int i = -1; i <= 1; i += 2)
		{
			for (int j = 1; j <= 3; j += 2)
			{
				At("wood_floor", new Vector3((float)i, num, (float)j + 0.5f), Vector3.zero, alignTop: true);
			}
		}
		At("woodwall", new Vector3(-1f, num, 4.5f), Vector3.zero, alignTop: false);
		At("woodwall", new Vector3(1f, num, 4.5f), Vector3.zero, alignTop: false);
		At("woodwall", new Vector3(-2f, num, 3.5f), new Vector3(0f, 90f, 0f), alignTop: false);
		At("woodwall", new Vector3(-2f, num, 1.5f), new Vector3(0f, 90f, 0f), alignTop: false);
		At("woodwall", new Vector3(2f, num, 3.5f), new Vector3(0f, 90f, 0f), alignTop: false);
		At("woodwall", new Vector3(1f, num, 0.5f), Vector3.zero, alignTop: false);
		At("wood_roof", new Vector3(0.3f, num, 2.2f), new Vector3(8f, 15f, 0f), alignTop: false);
		for (int k = 0; k < 2; k++)
		{
			float num2 = -4.5f + (float)k * 1.2f;
			float num3 = -1.5f - (float)k * 1.5f;
			float num4 = Top(At("wood_pole2", new Vector3(num2, 3f, num3 - 1f), Vector3.zero, alignTop: false), 4.9f);
			At("wood_pole2", new Vector3(num2, 3f, num3 + 1f), Vector3.zero, alignTop: false);
			At("wood_beam", new Vector3(num2, num4 - 0.25f, num3), new Vector3(0f, 90f, 0f), alignTop: false);
		}
		Prop(new string[1] { "fire_pit" }, new Vector2(2.5f, -2f), 0f, 0.05f);
		Prop(new string[2] { "barrell_static", "barrell" }, new Vector2(3f, 1.5f), 20f, 0.05f);
		Prop(new string[2] { "barrell_static", "barrell" }, new Vector2(3.6f, 0.6f), 80f, 0.05f);
		Prop(new string[1] { "wood_stack" }, new Vector2(-3.2f, 3f), 90f, 0.05f);
		CourtyardGuardsAndChest(num, new Vector3(0.6f, num, 3.6f), 180f);
	}

	private static void SunkenShrine()
	{
		//IL_0058: Unknown result type (might be due to invalid IL or missing references)
		//IL_005d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0079: Unknown result type (might be due to invalid IL or missing references)
		//IL_007e: Unknown result type (might be due to invalid IL or missing references)
		//IL_009a: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_00de: Unknown result type (might be due to invalid IL or missing references)
		//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_0125: Unknown result type (might be due to invalid IL or missing references)
		//IL_0156: Unknown result type (might be due to invalid IL or missing references)
		//IL_0187: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_0026: Unknown result type (might be due to invalid IL or missing references)
		for (int i = -2; i <= 2; i += 2)
		{
			for (int j = -2; j <= 2; j += 2)
			{
				if (i != 2 || j != -2)
				{
					At("stone_floor_2x2", new Vector3((float)i, 3.25f, (float)j), Vector3.zero, alignTop: true);
				}
			}
		}
		float num = 3.2f;
		At("SunkenKit_int_wall_2x4", new Vector3(-1f, num, 3.4f), Vector3.zero, alignTop: false);
		At("SunkenKit_int_wall_2x4", new Vector3(1f, num, 3.4f), Vector3.zero, alignTop: false);
		At("SunkenKit_int_wall_1x4", new Vector3(-3.4f, num, 1.5f), new Vector3(0f, 90f, 0f), alignTop: false);
		At("SunkenKit_int_wall_1x2", new Vector3(3.4f, num, 2f), new Vector3(0f, 90f, 0f), alignTop: false);
		At("SunkenKit_int_arch", new Vector3(0f, num, -3.4f), Vector3.zero, alignTop: false);
		Prop(new string[1] { "sunken_crypt_gate" }, new Vector2(0f, 2.7f), 0f, 0.1f);
		Prop(new string[1] { "crypt_skeleton_laying" }, new Vector2(2f, -1f), 60f, 0.05f);
		Prop(new string[1] { "bone_stack" }, new Vector2(-2.5f, -2.5f), 10f, 0.1f);
		Prop(new string[1] { "skull_pile" }, new Vector2(4.5f, -3f), 140f, 0.1f);
		CourtyardGuardsAndChest(3.25f, new Vector3(-2f, 3.25f, 1.2f), 90f);
	}

	private static void FulingRuin()
	{
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		//IL_001b: 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_003c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0058: Unknown result type (might be due to invalid IL or missing references)
		//IL_006c: 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_00a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_0106: Unknown result type (might be due to invalid IL or missing references)
		//IL_010b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0127: Unknown result type (might be due to invalid IL or missing references)
		//IL_013b: Unknown result type (might be due to invalid IL or missing references)
		//IL_016e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0173: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ee: Unknown result type (might be due to invalid IL or missing references)
		//IL_021f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0250: Unknown result type (might be due to invalid IL or missing references)
		//IL_0281: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_02da: Unknown result type (might be due to invalid IL or missing references)
		float num = 2.95f;
		At("stone_wall_4x2", new Vector3(-2f, num, 4f), Vector3.zero, alignTop: false);
		At("stone_wall_2x1", new Vector3(1f, num, 4f), Vector3.zero, alignTop: false);
		float num2 = Top(At("stone_wall_4x2", new Vector3(-4f, num, 2f), new Vector3(0f, 90f, 0f), alignTop: false), num + 2f);
		At("stone_wall_2x1", new Vector3(-4f, num2, 2.5f), new Vector3(0f, 90f, 0f), alignTop: false);
		At("stone_pillar", new Vector3(3.5f, num, 3.5f), Vector3.zero, alignTop: false);
		At("goblin_woodwall_2m", new Vector3(3f, num, 4f), Vector3.zero, alignTop: false);
		At("goblin_pole", new Vector3(-4f, num, -2f), Vector3.zero, alignTop: false);
		At("goblin_banner", new Vector3(-1f, num, -5f), new Vector3(0f, 180f, 0f), alignTop: false);
		float[] array = new float[6] { 200f, 240f, 300f, 340f, 20f, 60f };
		float[] array2 = array;
		foreach (float num3 in array2)
		{
			Vector2 val = Polar(num3, 6.2f);
			At("piece_sharpstakes", new Vector3(val.x, Height(val.x, val.y) - 0.1f, val.y), new Vector3(0f, 90f - num3, 0f), alignTop: false);
		}
		Prop(new string[1] { "goblin_strawpile" }, new Vector2(-2.5f, 2.2f), 10f, 0.1f);
		Prop(new string[1] { "goblin_strawpile" }, new Vector2(2.5f, 1.8f), 200f, 0.1f);
		Prop(new string[1] { "goblin_trashpile" }, new Vector2(4f, -2.5f), 0f, 0.1f);
		Prop(new string[1] { "fire_pit" }, new Vector2(0.5f, -1.5f), 0f, 0.05f);
		Prop(new string[1] { "goblin_stepladder" }, new Vector2(-1f, 3.2f), 0f, 0.05f);
		CourtyardGuardsAndChest(3f, new Vector3(0.5f, 3f, 3.1f), 180f);
	}

	private static void DvergrOutpost()
	{
		//IL_004d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0052: Unknown result type (might be due to invalid IL or missing references)
		//IL_006e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0073: Unknown result type (might be due to invalid IL or missing references)
		//IL_008f: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
		//IL_010b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0123: Unknown result type (might be due to invalid IL or missing references)
		//IL_015a: Unknown result type (might be due to invalid IL or missing references)
		//IL_018b: Unknown result type (might be due to invalid IL or missing references)
		//IL_01bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ed: Unknown result type (might be due to invalid IL or missing references)
		//IL_021e: Unknown result type (might be due to invalid IL or missing references)
		//IL_024f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0277: Unknown result type (might be due to invalid IL or missing references)
		for (int i = -1; i <= 1; i += 2)
		{
			for (int j = -1; j <= 1; j += 2)
			{
				At("blackmarble_floor", new Vector3((float)i, 3.25f, (float)j), Vector3.zero, alignTop: true);
			}
		}
		float num = 2.95f;
		At("dvergrprops_wood_wall", new Vector3(-1.2f, num, 3.2f), Vector3.zero, alignTop: false);
		At("dvergrprops_wood_wall", new Vector3(1.4f, num, 3.2f), Vector3.zero, alignTop: false);
		At("dvergrprops_wood_wall", new Vector3(-3.2f, num, 0.8f), new Vector3(0f, 90f, 0f), alignTop: false);
		float[] array = new float[4] { 240f, 300f, 340f, 20f };
		float[] array2 = array;
		foreach (float num2 in array2)
		{
			Vector2 val = Polar(num2, 5.5f);
			At("dvergrprops_wood_stakewall", new Vector3(val.x, Height(val.x, val.y) - 0.1f, val.y), new Vector3(0f, 0f - (num2 + 90f), 0f), alignTop: false);
		}
		Prop(new string[1] { "dvergrprops_crate" }, new Vector2(2.6f, 2f), 15f, 0.05f);
		Prop(new string[1] { "dvergrprops_crate_long" }, new Vector2(-2.4f, -2.6f), 80f, 0.05f);
		Prop(new string[1] { "dvergrprops_barrel" }, new Vector2(-2.6f, 2.2f), 0f, 0.05f);
		Prop(new string[1] { "dvergrprops_barrel" }, new Vector2(3.2f, -1.2f), 0f, 0.05f);
		Prop(new string[1] { "dvergrprops_lantern_standing" }, new Vector2(2f, -3f), 0f, 0.05f);
		Prop(new string[1] { "dvergrprops_table" }, new Vector2(0.3f, -2.6f), 10f, 0.05f);
		CourtyardGuardsAndChest(3.25f, new Vector3(0f, 3.25f, 2f), 180f);
	}

	private static void AshlandsArches()
	{
		//IL_0066: Unknown result type (might be due to invalid IL or missing references)
		//IL_006b: Unknown result type (might be due to