Decompiled source of BossFinder v1.1.2

BossFinder.dll

Decompiled a month ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using HarmonyLib;
using Jotunn;
using Jotunn.Configs;
using Jotunn.Entities;
using Jotunn.Managers;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("BossFinder")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("BossFinder")]
[assembly: AssemblyCopyright("Copyright ©  2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("39c603ca-d1d8-430b-91b2-385a774e3baf")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace BossFinder;

[BepInPlugin("lizzardfyll.bossfinder", "Boss Finder", "1.1.2")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class BossFinderPlugin : BaseUnityPlugin
{
	public class RequirementData
	{
		public string Item { get; set; }

		public int Amount { get; set; }
	}

	public class BossData
	{
		public string LocationName { get; set; }

		public string PinNameKey { get; set; }

		public string ItemName { get; set; }

		public string DisplayNameKey { get; set; }

		public string DescriptionKey { get; set; }

		public string ClonePrefab { get; set; }

		public List<RequirementData> Requirements { get; set; }
	}

	public const string PluginGUID = "lizzardfyll.bossfinder";

	public const string PluginName = "Boss Finder";

	public const string PluginVersion = "1.1.2";

	private static ConfigEntry<string> _selectedLanguage;

	private static ConfigEntry<string> _selectedBoss;

	private static string _currentLanguage = "English";

	private static Dictionary<string, BossData> Bosses = new Dictionary<string, BossData>();

	private static Dictionary<string, Dictionary<string, string>> _translations = new Dictionary<string, Dictionary<string, string>>();

	private void Awake()
	{
		//IL_0049: Unknown result type (might be due to invalid IL or missing references)
		//IL_0053: Expected O, but got Unknown
		//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d1: Expected O, but got Unknown
		SetupLocalizations();
		InitBossesData();
		_selectedLanguage = ((BaseUnityPlugin)this).Config.Bind<string>("Language", "Language", "English", new ConfigDescription("Select language / Выберите язык (requires restart / требует перезапуска)", (AcceptableValueBase)(object)new AcceptableValueList<string>(new string[2] { "English", "Русский" }), Array.Empty<object>()));
		_currentLanguage = _selectedLanguage.Value;
		_selectedLanguage.SettingChanged += delegate
		{
			_currentLanguage = _selectedLanguage.Value;
			Logger.LogInfo((object)("Language changed to: " + _currentLanguage));
		};
		string[] bossNames = GetBossNames();
		_selectedBoss = ((BaseUnityPlugin)this).Config.Bind<string>("General", "Show Locations", Translate("None"), new ConfigDescription(Translate("Select a boss or trader to reveal their locations on the map"), (AcceptableValueBase)(object)new AcceptableValueList<string>(bossNames), Array.Empty<object>()));
		_selectedBoss.SettingChanged += delegate
		{
			if (_selectedBoss.Value != Translate("None"))
			{
				if (_selectedBoss.Value == Translate("Traders"))
				{
					ShowAllTraderLocations();
				}
				else
				{
					ShowBossLocations(_selectedBoss.Value);
				}
			}
		};
		PrefabManager.OnVanillaPrefabsAvailable += CreateItems;
		Harmony.CreateAndPatchAll(typeof(PlayerConsumePatch), (string)null);
		Logger.LogInfo((object)"Boss Finder mod loaded!");
	}

	private void SetupLocalizations()
	{
		Dictionary<string, string> dictionary = new Dictionary<string, string>();
		dictionary["None"] = "None";
		dictionary["Traders"] = "Show all traders";
		dictionary["Select a boss or trader to reveal their locations on the map"] = "Select a boss or trader to reveal their locations on the map";
		dictionary["Eikthyr"] = "Eikthyr";
		dictionary["Elder"] = "Elder";
		dictionary["Bonemass"] = "Bonemass";
		dictionary["Moder"] = "Moder";
		dictionary["Yagluth"] = "Yagluth";
		dictionary["Queen"] = "Queen";
		dictionary["Fader"] = "Fader";
		dictionary["Eikthyr's Map"] = "Eikthyr's Map";
		dictionary["Elder's Map"] = "Elder's Map";
		dictionary["Bonemass's Map"] = "Bonemass's Map";
		dictionary["Moder's Map"] = "Moder's Map";
		dictionary["Yagluth's Map"] = "Yagluth's Map";
		dictionary["Queen's Map"] = "Queen's Map";
		dictionary["Fader's Map"] = "Fader's Map";
		dictionary["Reveals all Eikthyr altar locations on the map"] = "Reveals all Eikthyr altar locations on the map";
		dictionary["Reveals all Elder altar locations on the map"] = "Reveals all Elder altar locations on the map";
		dictionary["Reveals all Bonemass altar locations on the map"] = "Reveals all Bonemass altar locations on the map";
		dictionary["Reveals all Moder altar locations on the map"] = "Reveals all Moder altar locations on the map";
		dictionary["Reveals all Yagluth altar locations on the map"] = "Reveals all Yagluth altar locations on the map";
		dictionary["Reveals all Queen altar locations on the map"] = "Reveals all Queen altar locations on the map";
		dictionary["Reveals all Fader altar locations on the map"] = "Reveals all Fader altar locations on the map";
		dictionary[" locations revealed on map!"] = " locations revealed on map!";
		dictionary["No "] = "No ";
		dictionary[" locations found in this world!"] = " locations found in this world!";
		dictionary["Haldor"] = "Haldor";
		dictionary["Hildir"] = "Hildir";
		dictionary["BogWitch"] = "Bog Witch";
		dictionary["Trader locations revealed on map!"] = "Trader locations revealed on map!";
		dictionary["Eikthyr Altar"] = "Eikthyr";
		dictionary["Elder Altar"] = "Elder";
		dictionary["Bonemass Altar"] = "Bonemass";
		dictionary["Moder Altar"] = "Moder";
		dictionary["Yagluth Altar"] = "Yagluth";
		dictionary["Queen Altar"] = "Queen ";
		dictionary["Fader Altar"] = "Fader";
		dictionary["Haldor Location"] = "Haldor";
		dictionary["Hildir Location"] = "Hildir";
		dictionary["BogWitch Location"] = "Bog Witch";
		dictionary["Fortune Potion"] = "Fortune Potion";
		dictionary["Fortune Potion_desc"] = "Drinking this potion will reveal all possible trader locations on your map. Any of them could be the correct one!";
		_translations["English"] = dictionary;
		Dictionary<string, string> dictionary2 = new Dictionary<string, string>();
		dictionary2["None"] = "Нет";
		dictionary2["Traders"] = "Показать всех торговцев";
		dictionary2["Select a boss or trader to reveal their locations on the map"] = "Выберите босса или торговца для открытия их локаций на карте";
		dictionary2["Eikthyr"] = "Эйктюр";
		dictionary2["Elder"] = "Древний";
		dictionary2["Bonemass"] = "Масса костей";
		dictionary2["Moder"] = "Матерь";
		dictionary2["Yagluth"] = "Ялгут";
		dictionary2["Queen"] = "Королева";
		dictionary2["Fader"] = "Прародитель";
		dictionary2["Eikthyr's Map"] = "Карта Эйктюр";
		dictionary2["Elder's Map"] = "Карта Древний";
		dictionary2["Bonemass's Map"] = "Карта Масса костей";
		dictionary2["Moder's Map"] = "Карта Матерь";
		dictionary2["Yagluth's Map"] = "Карта Ялгут";
		dictionary2["Queen's Map"] = "Карта Королева";
		dictionary2["Fader's Map"] = "Карта Прародитель";
		dictionary2["Reveals all Eikthyr altar locations on the map"] = "Покажет все точки для призыва босса Эйктюр на вашей карте";
		dictionary2["Reveals all Elder altar locations on the map"] = "Покажет все точки для призыва босса Древний на вашей карте";
		dictionary2["Reveals all Bonemass altar locations on the map"] = "Покажет все точки для призыва босса Масса костей на вашей карте";
		dictionary2["Reveals all Moder altar locations on the map"] = "Покажет все точки для призыва босса Матерь на вашей карте";
		dictionary2["Reveals all Yagluth altar locations on the map"] = "Покажет все точки для призыва босса Ялгут на вашей карте";
		dictionary2["Reveals all Queen altar locations on the map"] = "Покажет все точки для призыва босса Королева на вашей карте";
		dictionary2["Reveals all Fader altar locations on the map"] = "Покажет все точки для призыва босса Прародитель на вашей карте";
		dictionary2[" locations revealed on map!"] = " локации открыты на карте!";
		dictionary2["No "] = "Нет ";
		dictionary2[" locations found in this world!"] = " локаций найдено в этом мире!";
		dictionary2["Haldor"] = "Хальдор";
		dictionary2["Hildir"] = "Хильдир";
		dictionary2["BogWitch"] = "Болотная ведьма";
		dictionary2["Trader locations revealed on map!"] = "Локации торговцев открыты на карте!";
		dictionary2["Eikthyr Altar"] = "Эйктюр";
		dictionary2["Elder Altar"] = "Древний";
		dictionary2["Bonemass Altar"] = "Массы костей";
		dictionary2["Moder Altar"] = "Матерь";
		dictionary2["Yagluth Altar"] = "Ялгут";
		dictionary2["Queen Altar"] = "Королева";
		dictionary2["Fader Altar"] = "Прародитель";
		dictionary2["Haldor Location"] = "Хальдор";
		dictionary2["Hildir Location"] = "Хильдир";
		dictionary2["BogWitch Location"] = "Болотная ведьма";
		dictionary2["Fortune Potion"] = "Зелье вероятности";
		dictionary2["Fortune Potion_desc"] = "Выпив зелье, оно покажет вам все возможные места всех торговцев, любое из них будет верное.";
		_translations["Русский"] = dictionary2;
	}

	private static string Translate(string key)
	{
		if (_translations.ContainsKey(_currentLanguage) && _translations[_currentLanguage].ContainsKey(key))
		{
			return _translations[_currentLanguage][key];
		}
		if (_translations.ContainsKey("English") && _translations["English"].ContainsKey(key))
		{
			return _translations["English"][key];
		}
		return key;
	}

	private void InitBossesData()
	{
		Bosses["Eikthyr"] = new BossData
		{
			LocationName = "Eikthyrnir",
			PinNameKey = "Eikthyr Altar",
			ItemName = "EikthyrMap",
			DisplayNameKey = "Eikthyr's Map",
			DescriptionKey = "Reveals all Eikthyr altar locations on the map",
			ClonePrefab = "TrophyEikthyr",
			Requirements = new List<RequirementData>
			{
				new RequirementData
				{
					Item = "TrophyDeer",
					Amount = 2
				},
				new RequirementData
				{
					Item = "Coins",
					Amount = 200
				}
			}
		};
		Bosses["Elder"] = new BossData
		{
			LocationName = "GDKing",
			PinNameKey = "Elder Altar",
			ItemName = "ElderMap",
			DisplayNameKey = "Elder's Map",
			DescriptionKey = "Reveals all Elder altar locations on the map",
			ClonePrefab = "TrophyTheElder",
			Requirements = new List<RequirementData>
			{
				new RequirementData
				{
					Item = "AncientSeed",
					Amount = 3
				},
				new RequirementData
				{
					Item = "Coins",
					Amount = 250
				}
			}
		};
		Bosses["Bonemass"] = new BossData
		{
			LocationName = "Bonemass",
			PinNameKey = "Bonemass Altar",
			ItemName = "BonemassMap",
			DisplayNameKey = "Bonemass's Map",
			DescriptionKey = "Reveals all Bonemass altar locations on the map",
			ClonePrefab = "TrophyBonemass",
			Requirements = new List<RequirementData>
			{
				new RequirementData
				{
					Item = "WitheredBone",
					Amount = 10
				},
				new RequirementData
				{
					Item = "Coins",
					Amount = 300
				}
			}
		};
		Bosses["Moder"] = new BossData
		{
			LocationName = "Dragonqueen",
			PinNameKey = "Moder Altar",
			ItemName = "ModerMap",
			DisplayNameKey = "Moder's Map",
			DescriptionKey = "Reveals all Moder altar locations on the map",
			ClonePrefab = "TrophyDragonQueen",
			Requirements = new List<RequirementData>
			{
				new RequirementData
				{
					Item = "DragonEgg",
					Amount = 3
				},
				new RequirementData
				{
					Item = "Coins",
					Amount = 400
				}
			}
		};
		Bosses["Yagluth"] = new BossData
		{
			LocationName = "GoblinKing",
			PinNameKey = "Yagluth Altar",
			ItemName = "YagluthMap",
			DisplayNameKey = "Yagluth's Map",
			DescriptionKey = "Reveals all Yagluth altar locations on the map",
			ClonePrefab = "TrophyGoblinKing",
			Requirements = new List<RequirementData>
			{
				new RequirementData
				{
					Item = "GoblinTotem",
					Amount = 5
				},
				new RequirementData
				{
					Item = "Coins",
					Amount = 500
				}
			}
		};
		Bosses["Queen"] = new BossData
		{
			LocationName = "Mistlands_DvergrBossEntrance1",
			PinNameKey = "Queen Altar",
			ItemName = "QueenMap",
			DisplayNameKey = "Queen's Map",
			DescriptionKey = "Reveals all Queen altar locations on the map",
			ClonePrefab = "TrophySeekerQueen",
			Requirements = new List<RequirementData>
			{
				new RequirementData
				{
					Item = "TrophySeekerBrute",
					Amount = 3
				},
				new RequirementData
				{
					Item = "Coins",
					Amount = 500
				}
			}
		};
		Bosses["Fader"] = new BossData
		{
			LocationName = "FaderLocation",
			PinNameKey = "Fader Altar",
			ItemName = "FaderMap",
			DisplayNameKey = "Fader's Map",
			DescriptionKey = "Reveals all Fader altar locations on the map",
			ClonePrefab = "TrophyFader",
			Requirements = new List<RequirementData>
			{
				new RequirementData
				{
					Item = "Bell",
					Amount = 1
				},
				new RequirementData
				{
					Item = "Coins",
					Amount = 500
				}
			}
		};
	}

	private string[] GetBossNames()
	{
		List<string> list = new List<string>
		{
			Translate("None"),
			Translate("Traders")
		};
		foreach (KeyValuePair<string, BossData> boss in Bosses)
		{
			list.Add(Translate(boss.Key));
		}
		return list.ToArray();
	}

	private void CreateItems()
	{
		foreach (KeyValuePair<string, BossData> boss in Bosses)
		{
			CreateBossItem(boss.Value);
		}
		CreateFortunePotion();
		PrefabManager.OnVanillaPrefabsAvailable -= CreateItems;
		Logger.LogInfo((object)"All boss map items created!");
	}

	private void CreateFortunePotion()
	{
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Expected O, but got Unknown
		//IL_0090: 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_00bd: Expected O, but got Unknown
		//IL_0139: Unknown result type (might be due to invalid IL or missing references)
		//IL_0143: Expected O, but got Unknown
		CustomItem val = new CustomItem("FortunePotion", "MeadStaminaLingering");
		val.ItemDrop.m_itemData.m_shared.m_name = Translate("Fortune Potion");
		val.ItemDrop.m_itemData.m_shared.m_description = Translate("Fortune Potion_desc");
		val.ItemDrop.m_itemData.m_shared.m_weight = 0.1f;
		val.ItemDrop.m_itemData.m_shared.m_maxStackSize = 1;
		val.ItemDrop.m_itemData.m_shared.m_itemType = (ItemType)2;
		val.ItemDrop.m_itemData.m_shared.m_consumeStatusEffect = null;
		ItemManager.Instance.AddItem(val);
		RecipeConfig val2 = new RecipeConfig();
		val2.Name = "Recipe_FortunePotion";
		val2.Item = "FortunePotion";
		val2.Amount = 1;
		val2.CraftingStation = "piece_workbench";
		val2.MinStationLevel = 1;
		val2.Enabled = true;
		val2.AddRequirement("Feathers", 15, 0);
		val2.AddRequirement("GreydwarfEye", 30, 0);
		val2.AddRequirement("QueenBee", 1, 0);
		val2.AddRequirement("SurtlingCore", 3, 0);
		ItemManager.Instance.AddRecipe(new CustomRecipe(val2));
		Logger.LogInfo((object)"Created Fortune Potion with recipe!");
	}

	private void CreateBossItem(BossData bossData)
	{
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0013: Expected O, but got Unknown
		//IL_0094: 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_00ab: Expected O, but got Unknown
		//IL_013e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0148: Expected O, but got Unknown
		CustomItem val = new CustomItem(bossData.ItemName, bossData.ClonePrefab);
		val.ItemDrop.m_itemData.m_shared.m_name = Translate(bossData.DisplayNameKey);
		val.ItemDrop.m_itemData.m_shared.m_description = Translate(bossData.DescriptionKey);
		val.ItemDrop.m_itemData.m_shared.m_weight = 0.1f;
		val.ItemDrop.m_itemData.m_shared.m_maxStackSize = 1;
		val.ItemDrop.m_itemData.m_shared.m_itemType = (ItemType)2;
		ItemManager.Instance.AddItem(val);
		RecipeConfig val2 = new RecipeConfig();
		val2.Name = "Recipe_" + bossData.ItemName;
		val2.Item = bossData.ItemName;
		val2.Amount = 1;
		val2.CraftingStation = "piece_workbench";
		val2.MinStationLevel = 1;
		val2.Enabled = true;
		foreach (RequirementData requirement in bossData.Requirements)
		{
			val2.AddRequirement(requirement.Item, requirement.Amount, 0);
		}
		ItemManager.Instance.AddRecipe(new CustomRecipe(val2));
		Logger.LogInfo((object)("Created " + bossData.DisplayNameKey));
	}

	public static void ShowAllTraderLocations()
	{
		//IL_00ad: 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_00b4: 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_00bb: 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_00da: 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_00df: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0101: 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_0166: 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_019c: Unknown result type (might be due to invalid IL or missing references)
		//IL_019e: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)ZoneSystem.instance == (Object)null || (Object)(object)Minimap.instance == (Object)null)
		{
			return;
		}
		int num = 0;
		Dictionary<string, string> dictionary = new Dictionary<string, string>();
		dictionary["Haldor"] = "Vendor_BlackForest";
		dictionary["Hildir"] = "Hildir_camp";
		dictionary["BogWitch"] = "BogWitch_Camp";
		foreach (KeyValuePair<string, string> item in dictionary)
		{
			List<LocationInstance> list = new List<LocationInstance>();
			if (ZoneSystem.instance.FindLocations(item.Value, ref list) && list.Count > 0)
			{
				LocationInstance val = list[0];
				float num2 = Vector3.Distance(val.m_position, Vector3.zero);
				foreach (LocationInstance item2 in list)
				{
					float num3 = Vector3.Distance(item2.m_position, Vector3.zero);
					if (num3 < num2)
					{
						num2 = num3;
						val = item2;
					}
				}
				string text = Translate((item.Key == "Haldor") ? "Haldor Location" : ((item.Key == "Hildir") ? "Hildir Location" : "BogWitch Location"));
				Minimap.instance.DiscoverLocation(val.m_position, (PinType)0, text, true);
				num++;
				Logger.LogInfo((object)$"Found {item.Key} as '{item.Value}' at {val.m_position} (closest to center, {list.Count} total locations)");
			}
			else
			{
				Logger.LogWarning((object)("No " + item.Key + " location found as '" + item.Value + "'"));
			}
		}
		if ((Object)(object)Player.m_localPlayer != (Object)null)
		{
			if (num > 0)
			{
				((Character)Player.m_localPlayer).Message((MessageType)2, Translate("Trader locations revealed on map!"), 0, (Sprite)null);
			}
			else
			{
				((Character)Player.m_localPlayer).Message((MessageType)2, "<color=red>No traders found in this world!</color>", 0, (Sprite)null);
			}
		}
	}

	public static void ShowBossLocations(string bossName)
	{
		//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0104: 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)
		string text = null;
		foreach (KeyValuePair<string, BossData> boss in Bosses)
		{
			if (Translate(boss.Key) == bossName || boss.Key == bossName)
			{
				text = boss.Key;
				break;
			}
		}
		if (text == null || !Bosses.ContainsKey(text))
		{
			return;
		}
		BossData bossData = Bosses[text];
		if ((Object)(object)ZoneSystem.instance == (Object)null || (Object)(object)Minimap.instance == (Object)null)
		{
			return;
		}
		string text2 = Translate(bossData.PinNameKey);
		List<LocationInstance> list = new List<LocationInstance>();
		if (ZoneSystem.instance.FindLocations(bossData.LocationName, ref list))
		{
			foreach (LocationInstance item in list)
			{
				Minimap.instance.DiscoverLocation(item.m_position, (PinType)9, text2, true);
			}
			Logger.LogInfo((object)$"Added {list.Count} {text2} locations to map");
			if ((Object)(object)Player.m_localPlayer != (Object)null)
			{
				((Character)Player.m_localPlayer).Message((MessageType)2, "<color=orange>" + text2 + "</color> locations revealed on map!", 0, (Sprite)null);
			}
		}
		else
		{
			Logger.LogWarning((object)("No " + bossData.LocationName + " locations found!"));
			if ((Object)(object)Player.m_localPlayer != (Object)null)
			{
				((Character)Player.m_localPlayer).Message((MessageType)2, "<color=red>No " + text2 + " locations found in this world!</color>", 0, (Sprite)null);
			}
		}
	}
}
[HarmonyPatch(typeof(Player))]
public static class PlayerConsumePatch
{
	[CompilerGenerated]
	private sealed class <ShowLocationsWithDelay>d__3 : IEnumerator<object>, IDisposable, IEnumerator
	{
		private int <>1__state;

		private object <>2__current;

		public string bossName;

		object IEnumerator<object>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <ShowLocationsWithDelay>d__3(int <>1__state)
		{
			this.<>1__state = <>1__state;
		}

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Expected O, but got Unknown
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				<>2__current = (object)new WaitForSeconds(0.1f);
				<>1__state = 1;
				return true;
			case 1:
				<>1__state = -1;
				BossFinderPlugin.ShowBossLocations(bossName);
				return false;
			}
		}

		bool IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		[DebuggerHidden]
		void IEnumerator.Reset()
		{
			throw new NotSupportedException();
		}
	}

	[CompilerGenerated]
	private sealed class <ShowTraderLocationsWithDelay>d__2 : IEnumerator<object>, IDisposable, IEnumerator
	{
		private int <>1__state;

		private object <>2__current;

		object IEnumerator<object>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <ShowTraderLocationsWithDelay>d__2(int <>1__state)
		{
			this.<>1__state = <>1__state;
		}

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Expected O, but got Unknown
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				<>2__current = (object)new WaitForSeconds(0.1f);
				<>1__state = 1;
				return true;
			case 1:
				<>1__state = -1;
				BossFinderPlugin.ShowAllTraderLocations();
				return false;
			}
		}

		bool IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		[DebuggerHidden]
		void IEnumerator.Reset()
		{
			throw new NotSupportedException();
		}
	}

	private static Dictionary<string, string> ItemToBoss = new Dictionary<string, string>
	{
		{ "Eikthyr's Map", "Eikthyr" },
		{ "Elder's Map", "Elder" },
		{ "Bonemass's Map", "Bonemass" },
		{ "Moder's Map", "Moder" },
		{ "Yagluth's Map", "Yagluth" },
		{ "Queen's Map", "Queen" },
		{ "Fader's Map", "Fader" },
		{ "Карта Эйктюр", "Eikthyr" },
		{ "Карта Древний", "Elder" },
		{ "Карта Масса костей", "Bonemass" },
		{ "Карта Матерь", "Moder" },
		{ "Карта Ялгут", "Yagluth" },
		{ "Карта Королева", "Queen" },
		{ "Карта Прародитель", "Fader" },
		{ "Fortune Potion", "Traders" },
		{ "Зелье вероятности", "Traders" }
	};

	[HarmonyPrefix]
	[HarmonyPatch("ConsumeItem")]
	private static void OnConsumeItem(Player __instance, Inventory inventory, ItemData item, bool checkWorldLevel)
	{
		if ((Object)(object)__instance != (Object)(object)Player.m_localPlayer || item == null)
		{
			return;
		}
		string name = item.m_shared.m_name;
		if (ItemToBoss.ContainsKey(name))
		{
			if (InventoryGui.IsVisible())
			{
				InventoryGui.instance.Hide();
			}
			string text = ItemToBoss[name];
			if (text == "Traders")
			{
				((MonoBehaviour)__instance).StartCoroutine(ShowTraderLocationsWithDelay());
			}
			else
			{
				((MonoBehaviour)__instance).StartCoroutine(ShowLocationsWithDelay(text));
			}
		}
	}

	[IteratorStateMachine(typeof(<ShowTraderLocationsWithDelay>d__2))]
	private static IEnumerator ShowTraderLocationsWithDelay()
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <ShowTraderLocationsWithDelay>d__2(0);
	}

	[IteratorStateMachine(typeof(<ShowLocationsWithDelay>d__3))]
	private static IEnumerator ShowLocationsWithDelay(string bossName)
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <ShowLocationsWithDelay>d__3(0)
		{
			bossName = bossName
		};
	}
}