Decompiled source of ValheimBossTrader v1.0.6

ValheimBossTrader.dll

Decompiled 2 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETFramework,Version=v4.8.1", FrameworkDisplayName = ".NET Framework 4.8.1")]
[assembly: AssemblyCompany("ValheimBossTrader")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+be8dd914e1078fb11deb98ed797bec5eb7019521")]
[assembly: AssemblyProduct("ValheimBossTrader")]
[assembly: AssemblyTitle("ValheimBossTrader")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
	internal static class IsExternalInit
	{
	}
}
namespace ValheimBossTrader
{
	public static class BankManager
	{
		private static string SaveDir => Path.Combine(Paths.ConfigPath, "BossTrader_Bank");

		private static string FilePath(string playerName)
		{
			return Path.Combine(SaveDir, playerName + ".dat");
		}

		private static string GetPlayerName()
		{
			Player localPlayer = Player.m_localPlayer;
			if (!((Object)(object)localPlayer == (Object)null))
			{
				return localPlayer.GetPlayerName();
			}
			return "unknown";
		}

		public static long GetBalance()
		{
			string path = FilePath(GetPlayerName());
			if (!File.Exists(path))
			{
				return 0L;
			}
			if (long.TryParse(File.ReadAllText(path).Trim(), out var result))
			{
				return result;
			}
			return 0L;
		}

		private static void SetBalance(long amount)
		{
			Directory.CreateDirectory(SaveDir);
			File.WriteAllText(FilePath(GetPlayerName()), amount.ToString());
		}

		public static void SetBalanceDebug(long amount)
		{
			SetBalance(amount);
			Plugin.Log.LogInfo((object)$"[Bank] Solde forcé à {amount} (debug).");
		}

		public static string GetCoinSharedName()
		{
			if ((Object)(object)StoreGui.instance?.m_coinPrefab != (Object)null)
			{
				return StoreGui.instance.m_coinPrefab.m_itemData.m_shared.m_name;
			}
			ObjectDB instance = ObjectDB.instance;
			GameObject obj = ((instance != null) ? instance.GetItemPrefab("Coins") : null);
			return ((obj == null) ? null : obj.GetComponent<ItemDrop>()?.m_itemData?.m_shared?.m_name) ?? "$item_coins";
		}

		public static int GetPlayerCoins()
		{
			Player localPlayer = Player.m_localPlayer;
			if ((Object)(object)localPlayer == (Object)null)
			{
				return 0;
			}
			return CountCoinsInInventory(((Humanoid)localPlayer).GetInventory());
		}

		private static int CountCoinsInInventory(Inventory inv)
		{
			string coinSharedName = GetCoinSharedName();
			int num = 0;
			foreach (ItemData allItem in inv.GetAllItems())
			{
				if (allItem.m_shared?.m_name == coinSharedName)
				{
					num += allItem.m_stack;
				}
			}
			return num;
		}

		public static bool Deposit(int amount, out string message)
		{
			if (amount <= 0)
			{
				message = "Montant invalide.";
				return false;
			}
			Player localPlayer = Player.m_localPlayer;
			if ((Object)(object)localPlayer == (Object)null)
			{
				message = "Joueur introuvable.";
				return false;
			}
			int playerCoins = GetPlayerCoins();
			if (playerCoins < amount)
			{
				message = $"Pas assez de pièces. Vous en avez {playerCoins}.";
				return false;
			}
			RemoveCoinsFromInventory(localPlayer, amount);
			SetBalance(GetBalance() + amount);
			message = $"Déposé {amount} pièces. Solde : {GetBalance()}";
			return true;
		}

		private static void RemoveCoinsFromInventory(Player player, int amount)
		{
			Inventory inventory = ((Humanoid)player).GetInventory();
			string coinSharedName = GetCoinSharedName();
			int num = amount;
			foreach (ItemData item in new List<ItemData>(inventory.GetAllItems()))
			{
				if (num <= 0)
				{
					break;
				}
				if (!(item.m_shared?.m_name != coinSharedName))
				{
					int num2 = Math.Min(num, item.m_stack);
					item.m_stack -= num2;
					num -= num2;
					if (item.m_stack <= 0)
					{
						inventory.RemoveItem(item);
					}
				}
			}
			inventory.Changed();
		}

		private static void AddCoinsToInventory(Inventory inv, int amount)
		{
			string coinSharedName = GetCoinSharedName();
			int num = amount;
			foreach (ItemData item in new List<ItemData>(inv.GetAllItems()))
			{
				if (num <= 0)
				{
					break;
				}
				if (!(item.m_shared?.m_name != coinSharedName))
				{
					int num2 = item.m_shared.m_maxStackSize - item.m_stack;
					if (num2 > 0)
					{
						int num3 = Math.Min(num, num2);
						item.m_stack += num3;
						num -= num3;
					}
				}
			}
			if (num > 0)
			{
				ObjectDB instance = ObjectDB.instance;
				GameObject obj = ((instance != null) ? instance.GetItemPrefab("Coins") : null);
				ItemDrop val = ((obj != null) ? obj.GetComponent<ItemDrop>() : null);
				if ((Object)(object)val != (Object)null)
				{
					int maxStackSize = val.m_itemData.m_shared.m_maxStackSize;
					while (num > 0)
					{
						ItemData val2 = val.m_itemData.Clone();
						val2.m_stack = Math.Min(num, maxStackSize);
						if (!inv.AddItem(val2))
						{
							break;
						}
						num -= val2.m_stack;
					}
				}
			}
			inv.Changed();
		}

		public static bool Withdraw(int amount, out string message)
		{
			if (amount <= 0)
			{
				message = "Montant invalide.";
				return false;
			}
			Player localPlayer = Player.m_localPlayer;
			if ((Object)(object)localPlayer == (Object)null)
			{
				message = "Joueur introuvable.";
				return false;
			}
			long balance = GetBalance();
			if (balance < amount)
			{
				message = $"Solde insuffisant : {balance} pièces.";
				return false;
			}
			Inventory inventory = ((Humanoid)localPlayer).GetInventory();
			bool flag = CountCoinsInInventory(inventory) > 0;
			bool flag2 = inventory.GetEmptySlots() > 0;
			if (!flag && !flag2)
			{
				message = "Inventaire plein ! Faites de la place.";
				return false;
			}
			SetBalance(balance - amount);
			AddCoinsToInventory(inventory, amount);
			message = $"Retiré {amount} pièces. Solde : {GetBalance()}";
			return true;
		}

		public static bool WithdrawAll(out string message)
		{
			long balance = GetBalance();
			if (balance <= 0)
			{
				message = "La banque est vide.";
				return false;
			}
			return Withdraw((int)Math.Min(balance, 2147483647L), out message);
		}
	}
	[HarmonyPatch(typeof(StoreGui), "Show")]
	public static class StoreGui_Show_BankPatch
	{
		[HarmonyPostfix]
		public static void Postfix()
		{
			//IL_0012: 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)
			if ((Object)(object)BankUI.Instance == (Object)null)
			{
				new GameObject("BossTrader_BankUI").AddComponent<BankUI>();
			}
			BankUI.Instance.Show();
			if ((Object)(object)CategoryFilterUI.Instance == (Object)null)
			{
				new GameObject("BossTrader_CategoryFilterUI").AddComponent<CategoryFilterUI>();
			}
			CategoryFilterUI.Instance.Show();
		}
	}
	[HarmonyPatch(typeof(StoreGui), "Hide")]
	public static class StoreGui_Hide_BankPatch
	{
		[HarmonyPostfix]
		public static void Postfix()
		{
			BankUI.Instance?.Hide();
			CategoryFilterUI.Instance?.Hide();
		}
	}
	[HarmonyPatch(typeof(StoreGui), "GetPlayerCoins")]
	public static class StoreGui_GetPlayerCoins_BankPatch
	{
		[HarmonyPostfix]
		public static void Postfix(ref int __result)
		{
			long balance = BankManager.GetBalance();
			if (balance > 0)
			{
				__result = (int)Math.Min(__result + balance, 2147483647L);
			}
		}
	}
	[HarmonyPatch(typeof(StoreGui), "BuySelectedItem")]
	public static class StoreGui_BuySelectedItem_BankPatch
	{
		[HarmonyPrefix]
		public static void Prefix(StoreGui __instance)
		{
			TradeItem selectedItem = __instance.m_selectedItem;
			if (selectedItem != null)
			{
				int num = selectedItem.m_price - BankManager.GetPlayerCoins();
				if (num > 0 && BankManager.GetBalance() >= num)
				{
					BankManager.Withdraw(num, out string _);
				}
			}
		}
	}
	[HarmonyPatch(typeof(Terminal), "TryRunCommand")]
	public static class Terminal_TryRunCommand_BankPatch
	{
		[HarmonyPrefix]
		public static bool Prefix(string text)
		{
			if (string.IsNullOrEmpty(text))
			{
				return true;
			}
			string[] array = text.Trim().Split(new char[1] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
			if (array.Length == 0 || array[0].ToLowerInvariant() != "bankset")
			{
				return true;
			}
			if (array.Length < 2 || !long.TryParse(array[1], out var result) || result < 0)
			{
				Plugin.Log.LogInfo((object)"[Bank] Usage : bankset <montant>");
				return false;
			}
			BankManager.SetBalanceDebug(result);
			Plugin.Log.LogInfo((object)$"[Bank] Solde bancaire → {result} pièces.");
			return false;
		}
	}
	public class BankUI : MonoBehaviour
	{
		private bool _visible;

		private string _amountStr = "";

		private string _feedback = "";

		private bool _feedbackOk = true;

		private Rect _windowRect;

		private bool _stylesReady;

		private GUIStyle _windowStyle;

		private GUIStyle _titleStyle;

		private GUIStyle _labelStyle;

		private GUIStyle _balanceStyle;

		private GUIStyle _fieldStyle;

		private GUIStyle _btnStyle;

		private GUIStyle _btnCloseStyle;

		private GUIStyle _separatorStyle;

		private GUIStyle _feedbackStyle;

		private Texture2D _texDarkWood;

		private Texture2D _texMedWood;

		private Texture2D _texAmber;

		private Texture2D _texBtnNormal;

		private Texture2D _texBtnHover;

		private Texture2D _texBtnActive;

		private Texture2D _texInputBg;

		private Texture2D _texInputFocus;

		private Texture2D _texInputHover;

		private Texture2D _texSeparator;

		private static readonly Color cDarkWood = new Color(0.07f, 0.042f, 0.015f, 0.97f);

		private static readonly Color cMedWood = new Color(0.16f, 0.1f, 0.038f, 1f);

		private static readonly Color cBtnNormal = new Color(0.2f, 0.12f, 0.045f, 1f);

		private static readonly Color cBtnHover = new Color(0.32f, 0.2f, 0.075f, 1f);

		private static readonly Color cBtnActive = new Color(0.46f, 0.29f, 0.09f, 1f);

		private static readonly Color cAmber = new Color(0.5f, 0.31f, 0.08f, 1f);

		private static readonly Color cGold = new Color(0.88f, 0.68f, 0.18f, 1f);

		private static readonly Color cCream = new Color(0.84f, 0.755f, 0.56f, 1f);

		private static readonly Color cDimAmber = new Color(0.7f, 0.51f, 0.21f, 1f);

		private static readonly Color cInputBg = new Color(0.04f, 0.024f, 0.008f, 1f);

		public static BankUI Instance { get; private set; }

		private void Awake()
		{
			//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)
			Instance = this;
			Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject);
			_windowRect = new Rect((float)Screen.width - 350f, (float)Screen.height / 2f - 165f, 310f, 330f);
		}

		private void OnDestroy()
		{
			if ((Object)(object)Instance == (Object)(object)this)
			{
				Instance = null;
			}
		}

		public void Show()
		{
			_feedback = "";
			_amountStr = "";
			_visible = true;
		}

		public void Hide()
		{
			_visible = false;
		}

		private void OnGUI()
		{
			//IL_0016: 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_0037: Expected O, but got Unknown
			//IL_0032: 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)
			if (_visible)
			{
				EnsureStyles();
				_windowRect = GUI.Window(9421, _windowRect, new WindowFunction(DrawWindow), "", _windowStyle);
			}
		}

		private void DrawWindow(int id)
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: 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_0411: Unknown result type (might be due to invalid IL or missing references)
			//IL_033a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0324: Unknown result type (might be due to invalid IL or missing references)
			GUI.DrawTexture(new Rect(0f, 0f, ((Rect)(ref _windowRect)).width, 38f), (Texture)(object)_texMedWood);
			GUI.Label(new Rect(0f, 5f, ((Rect)(ref _windowRect)).width, 28f), "⚜  COFFRE D'HALDOR  ⚜", _titleStyle);
			GUI.DrawTexture(new Rect(8f, 38f, ((Rect)(ref _windowRect)).width - 16f, 2f), (Texture)(object)_texAmber);
			GUILayout.Space(52f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Space(12f);
			GUILayout.Label($"✦  {BankManager.GetBalance():N0}  pièces", _balanceStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(((Rect)(ref _windowRect)).width - 24f) });
			GUILayout.EndHorizontal();
			GUILayout.Space(4f);
			GUILayout.Box("", _separatorStyle, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.Height(1f),
				GUILayout.Width(((Rect)(ref _windowRect)).width - 24f)
			});
			GUILayout.Space(10f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Space(12f);
			GUILayout.Label("Montant :", _labelStyle, Array.Empty<GUILayoutOption>());
			GUILayout.EndHorizontal();
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Space(12f);
			_amountStr = GUILayout.TextField(_amountStr, 9, _fieldStyle, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.Height(30f),
				GUILayout.Width(((Rect)(ref _windowRect)).width - 28f)
			});
			GUILayout.Space(4f);
			GUILayout.EndHorizontal();
			GUILayout.Space(10f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Space(12f);
			if (GUILayout.Button("Déposer", _btnStyle, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.Height(34f),
				GUILayout.Width(133f)
			}))
			{
				OnDeposit();
			}
			GUILayout.Space(6f);
			if (GUILayout.Button("Retirer", _btnStyle, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.Height(34f),
				GUILayout.Width(133f)
			}))
			{
				OnWithdraw();
			}
			GUILayout.Space(4f);
			GUILayout.EndHorizontal();
			GUILayout.Space(6f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Space(12f);
			if (GUILayout.Button("Tout retirer", _btnStyle, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.Height(28f),
				GUILayout.Width(((Rect)(ref _windowRect)).width - 28f)
			}))
			{
				OnWithdrawAll();
			}
			GUILayout.Space(4f);
			GUILayout.EndHorizontal();
			GUILayout.Space(6f);
			if (!string.IsNullOrEmpty(_feedback))
			{
				_feedbackStyle.normal.textColor = (_feedbackOk ? new Color(0.48f, 0.82f, 0.3f) : new Color(0.88f, 0.32f, 0.22f));
				GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
				GUILayout.Space(12f);
				GUILayout.Label(_feedback, _feedbackStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(((Rect)(ref _windowRect)).width - 28f) });
				GUILayout.EndHorizontal();
				GUILayout.Space(2f);
			}
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.FlexibleSpace();
			if (GUILayout.Button("Fermer", _btnCloseStyle, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.Height(24f),
				GUILayout.Width(80f)
			}))
			{
				Hide();
			}
			GUILayout.Space(10f);
			GUILayout.EndHorizontal();
			GUILayout.Space(6f);
			GUI.DragWindow(new Rect(0f, 0f, ((Rect)(ref _windowRect)).width, 38f));
		}

		private void OnDeposit()
		{
			if (!int.TryParse(_amountStr, out var result))
			{
				SetFeedback("Entrez un nombre valide.", ok: false);
			}
			else
			{
				SetFeedback(null, BankManager.Deposit(result, out string message), message);
			}
		}

		private void OnWithdraw()
		{
			if (!int.TryParse(_amountStr, out var result))
			{
				SetFeedback("Entrez un nombre valide.", ok: false);
			}
			else
			{
				SetFeedback(null, BankManager.Withdraw(result, out string message), message);
			}
		}

		private void OnWithdrawAll()
		{
			SetFeedback(null, BankManager.WithdrawAll(out string message), message);
		}

		private void SetFeedback(string direct, bool ok, string msg = null)
		{
			_feedback = direct ?? msg;
			_feedbackOk = ok;
			if (ok)
			{
				_amountStr = "";
			}
		}

		private void EnsureStyles()
		{
			//IL_0013: 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_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: 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_007f: 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_00cb: 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_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Expected O, but got Unknown
			//IL_010b: 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_011a: Expected O, but got Unknown
			//IL_011f: Expected O, but got Unknown
			//IL_0156: Unknown result type (might be due to invalid IL or missing references)
			//IL_015b: 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_016a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0176: Expected O, but got Unknown
			//IL_0181: Unknown result type (might be due to invalid IL or missing references)
			//IL_0196: 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_01a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01af: Expected O, but got Unknown
			//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01dc: 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_01ef: Expected O, but got Unknown
			//IL_01fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_020f: 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_021c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0228: Expected O, but got Unknown
			//IL_0275: 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_029f: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bf: Expected O, but got Unknown
			//IL_030c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0321: 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_0347: Unknown result type (might be due to invalid IL or missing references)
			//IL_034c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0354: Unknown result type (might be due to invalid IL or missing references)
			//IL_0360: Expected O, but got Unknown
			//IL_037a: Unknown result type (might be due to invalid IL or missing references)
			//IL_038f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0394: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b1: Expected O, but got Unknown
			//IL_03b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c2: Expected O, but got Unknown
			//IL_03e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f7: 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_040a: Expected O, but got Unknown
			if (!_stylesReady)
			{
				_stylesReady = true;
				_texDarkWood = MakeTex(1, 1, cDarkWood);
				_texMedWood = MakeTex(1, 1, cMedWood);
				_texAmber = MakeTex(1, 1, cAmber);
				_texBtnNormal = MakeTex(1, 1, cBtnNormal);
				_texBtnHover = MakeTex(1, 1, cBtnHover);
				_texBtnActive = MakeTex(1, 1, cBtnActive);
				_texInputBg = MakeTex(1, 1, cInputBg);
				_texInputFocus = MakeTex(1, 1, new Color(0.06f, 0.038f, 0.014f, 1f));
				_texInputHover = MakeTex(1, 1, new Color(0.05f, 0.03f, 0.012f, 1f));
				_texSeparator = MakeTex(1, 1, cAmber);
				_windowStyle = new GUIStyle(GUI.skin.window)
				{
					padding = new RectOffset(0, 0, 0, 6),
					border = new RectOffset(4, 4, 4, 4)
				};
				_windowStyle.normal.background = _texDarkWood;
				_windowStyle.onNormal.background = _texDarkWood;
				_titleStyle = new GUIStyle(GUI.skin.label)
				{
					fontSize = 15,
					fontStyle = (FontStyle)1,
					alignment = (TextAnchor)4
				};
				_titleStyle.normal.textColor = cGold;
				_labelStyle = new GUIStyle(GUI.skin.label)
				{
					fontSize = 12,
					fontStyle = (FontStyle)1
				};
				_labelStyle.normal.textColor = cDimAmber;
				_balanceStyle = new GUIStyle(GUI.skin.label)
				{
					fontSize = 18,
					fontStyle = (FontStyle)1,
					alignment = (TextAnchor)4
				};
				_balanceStyle.normal.textColor = cCream;
				_fieldStyle = new GUIStyle(GUI.skin.textField)
				{
					fontSize = 14,
					alignment = (TextAnchor)4
				};
				_fieldStyle.normal.background = _texInputBg;
				_fieldStyle.focused.background = _texInputFocus;
				_fieldStyle.hover.background = _texInputHover;
				_fieldStyle.normal.textColor = cCream;
				_fieldStyle.focused.textColor = Color.white;
				_btnStyle = new GUIStyle(GUI.skin.button)
				{
					fontSize = 13,
					fontStyle = (FontStyle)1,
					alignment = (TextAnchor)4
				};
				_btnStyle.normal.background = _texBtnNormal;
				_btnStyle.hover.background = _texBtnHover;
				_btnStyle.active.background = _texBtnActive;
				_btnStyle.normal.textColor = cCream;
				_btnStyle.hover.textColor = Color.white;
				_btnStyle.active.textColor = cGold;
				_btnCloseStyle = new GUIStyle(_btnStyle)
				{
					fontSize = 11,
					fontStyle = (FontStyle)0
				};
				_btnCloseStyle.normal.textColor = new Color(0.65f, 0.55f, 0.38f);
				_separatorStyle = new GUIStyle(GUI.skin.box)
				{
					padding = RectOffset(0),
					margin = new RectOffset(12, 12, 0, 0),
					border = RectOffset(0)
				};
				_separatorStyle.normal.background = _texSeparator;
				_feedbackStyle = new GUIStyle(GUI.skin.label)
				{
					fontSize = 12,
					wordWrap = true,
					fontStyle = (FontStyle)2,
					alignment = (TextAnchor)3
				};
			}
		}

		private static RectOffset RectOffset(int v)
		{
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Expected O, but got Unknown
			return new RectOffset(v, v, v, v);
		}

		private static Texture2D MakeTex(int w, int h, Color col)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_0017: 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)
			Texture2D val = new Texture2D(w, h);
			Color[] array = (Color[])(object)new Color[w * h];
			for (int i = 0; i < array.Length; i++)
			{
				array[i] = col;
			}
			val.SetPixels(array);
			val.Apply();
			return val;
		}
	}
	public static class BossKey
	{
		public const string Eikthyr = "defeated_eikthyr";

		public const string Elder = "defeated_gdking";

		public const string Bonemass = "defeated_bonemass";

		public const string Moder = "defeated_dragon";

		public const string Yagluth = "defeated_goblinking";

		public const string Queen = "defeated_queen";

		public const string Fader = "defeated_fader";
	}
	public static class CategoryFilter
	{
		private static readonly Dictionary<string, Category> _lookup = new Dictionary<string, Category>();

		private static List<TradeItem> _fullList = null;

		private static MethodInfo _fillListMethod;

		public static Category? Active { get; private set; } = null;


		public static void Register(string prefabName, Category cat)
		{
			_lookup[prefabName] = cat;
		}

		public static void ClearLookup()
		{
			_lookup.Clear();
			Active = null;
			_fullList = null;
		}

		public static void SetCategory(Category? cat)
		{
			StoreGui instance = StoreGui.instance;
			if ((Object)(object)instance?.m_trader == (Object)null)
			{
				return;
			}
			if (_fullList != null)
			{
				instance.m_trader.m_items = _fullList;
				_fullList = null;
			}
			Active = cat;
			if (cat.HasValue)
			{
				_fullList = new List<TradeItem>(instance.m_trader.m_items);
				List<TradeItem> list = new List<TradeItem>();
				foreach (TradeItem full in _fullList)
				{
					if (Matches(full))
					{
						list.Add(full);
					}
				}
				instance.m_trader.m_items = list;
			}
			RefreshList();
		}

		public static void Reset()
		{
			StoreGui instance = StoreGui.instance;
			if (_fullList != null && (Object)(object)instance?.m_trader != (Object)null)
			{
				instance.m_trader.m_items = _fullList;
			}
			_fullList = null;
			Active = null;
		}

		private static bool Matches(TradeItem item)
		{
			ItemDrop prefab = item.m_prefab;
			string text = ((prefab != null) ? ((Object)prefab).name : null);
			if (text != null && _lookup.TryGetValue(text, out var value))
			{
				return value == Active.Value;
			}
			return false;
		}

		private static void RefreshList()
		{
			if (!((Object)(object)StoreGui.instance == (Object)null))
			{
				if (_fillListMethod == null)
				{
					_fillListMethod = typeof(StoreGui).GetMethod("FillList", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
				}
				_fillListMethod?.Invoke(StoreGui.instance, null);
			}
		}
	}
	public class CategoryFilterUI : MonoBehaviour
	{
		private bool _visible;

		private Rect _windowRect;

		private bool _stylesReady;

		private bool _positionSet;

		private GUIStyle _windowStyle;

		private GUIStyle _titleStyle;

		private GUIStyle _btnStyle;

		private GUIStyle _btnActiveStyle;

		private GUIStyle _separatorStyle;

		private static readonly Color cDarkWood = new Color(0.07f, 0.042f, 0.015f, 0.97f);

		private static readonly Color cMedWood = new Color(0.16f, 0.1f, 0.038f, 1f);

		private static readonly Color cBtnNormal = new Color(0.2f, 0.12f, 0.045f, 1f);

		private static readonly Color cBtnHover = new Color(0.32f, 0.2f, 0.075f, 1f);

		private static readonly Color cAmber = new Color(0.5f, 0.31f, 0.08f, 1f);

		private static readonly Color cGold = new Color(0.88f, 0.68f, 0.18f, 1f);

		private static readonly Color cCream = new Color(0.84f, 0.755f, 0.56f, 1f);

		private static readonly Color cActiveText = new Color(0.1f, 0.06f, 0.02f, 1f);

		private Texture2D _texDarkWood;

		private Texture2D _texMedWood;

		private Texture2D _texAmber;

		private Texture2D _texAmberDim;

		private Texture2D _texBtnNormal;

		private Texture2D _texBtnHover;

		private Texture2D _texBtnActive;

		private Texture2D _texBtnActiveHover;

		private Texture2D _texSeparator;

		public static CategoryFilterUI Instance { get; private set; }

		private void Awake()
		{
			//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)
			Instance = this;
			Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject);
			_windowRect = new Rect(420f, 130f, 142f, 0f);
		}

		private void OnDestroy()
		{
			if ((Object)(object)Instance == (Object)(object)this)
			{
				Instance = null;
			}
		}

		public void Show()
		{
			_visible = true;
			_positionSet = false;
		}

		public void Hide()
		{
			_visible = false;
			CategoryFilter.Reset();
		}

		private void OnGUI()
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Expected O, but got Unknown
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			if (_visible)
			{
				EnsureStyles();
				TrySetPosition();
				_windowRect = GUI.Window(9424, _windowRect, new WindowFunction(DrawWindow), "", _windowStyle);
			}
		}

		private void TrySetPosition()
		{
			if (!_positionSet && !((Object)(object)StoreGui.instance?.m_rootPanel == (Object)null))
			{
				RectTransform component = StoreGui.instance.m_rootPanel.GetComponent<RectTransform>();
				if (!((Object)(object)component == (Object)null))
				{
					Vector3[] array = (Vector3[])(object)new Vector3[4];
					component.GetWorldCorners(array);
					((Rect)(ref _windowRect)).x = array[2].x + 6f;
					((Rect)(ref _windowRect)).y = (float)Screen.height - array[2].y;
					_positionSet = true;
				}
			}
		}

		private void DrawWindow(int id)
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: 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_0165: Unknown result type (might be due to invalid IL or missing references)
			GUI.DrawTexture(new Rect(0f, 0f, ((Rect)(ref _windowRect)).width, 32f), (Texture)(object)_texMedWood);
			GUI.Label(new Rect(0f, 5f, ((Rect)(ref _windowRect)).width, 22f), "CATÉGORIES", _titleStyle);
			GUI.DrawTexture(new Rect(6f, 32f, ((Rect)(ref _windowRect)).width - 12f, 2f), (Texture)(object)_texAmber);
			GUILayout.Space(40f);
			DrawBtn("Tout", null);
			GUILayout.Space(3f);
			GUILayout.Box("", _separatorStyle, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.Height(1f),
				GUILayout.ExpandWidth(true)
			});
			GUILayout.Space(3f);
			foreach (Category value in Enum.GetValues(typeof(Category)))
			{
				DrawBtn(GetLabel(value), value);
				GUILayout.Space(2f);
			}
			GUILayout.Space(6f);
			GUI.DragWindow(new Rect(0f, 0f, ((Rect)(ref _windowRect)).width, 32f));
		}

		private void DrawBtn(string label, Category? cat)
		{
			bool flag = CategoryFilter.Active == cat;
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Space(6f);
			if (GUILayout.Button(label, flag ? _btnActiveStyle : _btnStyle, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.Height(28f),
				GUILayout.Width(((Rect)(ref _windowRect)).width - 14f)
			}))
			{
				CategoryFilter.SetCategory((flag && cat.HasValue) ? null : cat);
			}
			GUILayout.Space(2f);
			GUILayout.EndHorizontal();
			GUILayout.Space(1f);
		}

		private static string GetLabel(Category cat)
		{
			return cat switch
			{
				Category.Materials => "Matériaux", 
				Category.Food => "Nourriture", 
				Category.Weapons => "Armes", 
				Category.Armor => "Armures", 
				Category.Ammo => "Munitions", 
				Category.Consumables => "Consommables", 
				Category.Misc => "Divers", 
				_ => cat.ToString(), 
			};
		}

		private void EnsureStyles()
		{
			//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_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Expected O, but got Unknown
			//IL_0061: Expected O, but got Unknown
			//IL_0064: 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_0088: 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_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: 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_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0130: Unknown result type (might be due to invalid IL or missing references)
			//IL_0176: Unknown result type (might be due to invalid IL or missing references)
			//IL_017b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0183: Unknown result type (might be due to invalid IL or missing references)
			//IL_018a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0196: Expected O, but got Unknown
			//IL_01a1: 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_01bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d6: Expected O, but got Unknown
			//IL_0223: Unknown result type (might be due to invalid IL or missing references)
			//IL_0238: Unknown result type (might be due to invalid IL or missing references)
			//IL_024d: Unknown result type (might be due to invalid IL or missing references)
			//IL_025e: 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_026f: Expected O, but got Unknown
			//IL_02a6: 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_02d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d5: 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)
			//IL_02e4: Expected O, but got Unknown
			//IL_02e4: 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_02f3: Expected O, but got Unknown
			//IL_02f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0302: Expected O, but got Unknown
			//IL_0307: Expected O, but got Unknown
			if (!_stylesReady)
			{
				_stylesReady = true;
				int length = Enum.GetValues(typeof(Category)).Length;
				int num = 36;
				((Rect)(ref _windowRect)).height = 92 + length * num + 20;
				_windowStyle = new GUIStyle(GUI.skin.window)
				{
					padding = new RectOffset(0, 0, 0, 4)
				};
				_texDarkWood = MakeTex(1, 1, cDarkWood);
				_texMedWood = MakeTex(1, 1, cMedWood);
				_texAmber = MakeTex(1, 1, cAmber);
				_texAmberDim = MakeTex(1, 1, new Color(0.35f, 0.22f, 0.06f, 1f));
				_texBtnNormal = MakeTex(1, 1, cBtnNormal);
				_texBtnHover = MakeTex(1, 1, cBtnHover);
				_texBtnActive = MakeTex(1, 1, cAmber);
				_texBtnActiveHover = MakeTex(1, 1, new Color(0.6f, 0.38f, 0.1f, 1f));
				_texSeparator = MakeTex(1, 1, new Color(0.35f, 0.22f, 0.06f, 1f));
				_windowStyle.normal.background = _texDarkWood;
				_windowStyle.onNormal.background = _texDarkWood;
				_titleStyle = new GUIStyle(GUI.skin.label)
				{
					fontSize = 12,
					fontStyle = (FontStyle)1,
					alignment = (TextAnchor)4
				};
				_titleStyle.normal.textColor = cGold;
				_btnStyle = new GUIStyle(GUI.skin.button)
				{
					fontSize = 12,
					fontStyle = (FontStyle)0,
					alignment = (TextAnchor)4
				};
				_btnStyle.normal.background = _texBtnNormal;
				_btnStyle.hover.background = _texBtnHover;
				_btnStyle.active.background = _texBtnActive;
				_btnStyle.normal.textColor = cCream;
				_btnStyle.hover.textColor = Color.white;
				_btnStyle.active.textColor = cGold;
				_btnActiveStyle = new GUIStyle(_btnStyle)
				{
					fontStyle = (FontStyle)1
				};
				_btnActiveStyle.normal.background = _texBtnActive;
				_btnActiveStyle.hover.background = _texBtnActiveHover;
				_btnActiveStyle.normal.textColor = cActiveText;
				_btnActiveStyle.hover.textColor = cActiveText;
				_separatorStyle = new GUIStyle(GUI.skin.box)
				{
					padding = new RectOffset(0, 0, 0, 0),
					margin = new RectOffset(6, 6, 0, 0),
					border = new RectOffset(0, 0, 0, 0)
				};
				_separatorStyle.normal.background = _texSeparator;
			}
		}

		private static Texture2D MakeTex(int w, int h, Color col)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_0017: 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)
			Texture2D val = new Texture2D(w, h);
			Color[] array = (Color[])(object)new Color[w * h];
			for (int i = 0; i < array.Length; i++)
			{
				array[i] = col;
			}
			val.SetPixels(array);
			val.Apply();
			return val;
		}
	}
	public static class ModConfig
	{
		public static ConfigEntry<float> PriceMultiplier;

		public static ConfigEntry<float> StackMultiplier;

		public static ConfigEntry<bool> EnableHaldor;

		public static ConfigEntry<bool> EnableHildir;

		public static ConfigEntry<bool> EnableBogWitch;

		public static ConfigEntry<bool> EnableMaterials;

		public static ConfigEntry<bool> EnableFood;

		public static ConfigEntry<bool> EnableWeapons;

		public static ConfigEntry<bool> EnableArmor;

		public static ConfigEntry<bool> EnableAmmo;

		public static ConfigEntry<bool> EnableConsumables;

		public static ConfigEntry<bool> EnableMisc;

		public static void Init(ConfigFile config)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Expected O, but got Unknown
			PriceMultiplier = config.Bind<float>("1 - Prix", "PriceMultiplier", 1f, new ConfigDescription("Multiplicateur appliqué à tous les prix.\nEx: 0.5 = moitié prix, 2.0 = double prix.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 10f), Array.Empty<object>()));
			StackMultiplier = config.Bind<float>("2 - Stacks", "StackMultiplier", 1f, new ConfigDescription("Multiplicateur appliqué à toutes les quantités par achat.\nEx: 2.0 = double la quantité achetée à chaque fois.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 10f), Array.Empty<object>()));
			EnableHaldor = config.Bind<bool>("3 - Marchands", "EnableHaldor", true, "Injecter les items chez Haldor.");
			EnableHildir = config.Bind<bool>("3 - Marchands", "EnableHildir", false, "Injecter les items chez Hildir.");
			EnableBogWitch = config.Bind<bool>("3 - Marchands", "EnableBogWitch", false, "Injecter les items chez la Bog Witch.");
			EnableMaterials = config.Bind<bool>("4 - Catégories", "EnableMaterials", true, "Activer la vente de matériaux / minerais / ressources.");
			EnableFood = config.Bind<bool>("4 - Catégories", "EnableFood", true, "Activer la vente de nourriture (crue et cuite).");
			EnableWeapons = config.Bind<bool>("4 - Catégories", "EnableWeapons", true, "Activer la vente d'armes.");
			EnableArmor = config.Bind<bool>("4 - Catégories", "EnableArmor", true, "Activer la vente d'armures et de capes.");
			EnableAmmo = config.Bind<bool>("4 - Catégories", "EnableAmmo", true, "Activer la vente de munitions (flèches, boulons, bombes).");
			EnableConsumables = config.Bind<bool>("4 - Catégories", "EnableConsumables", true, "Activer la vente de consommables (potions, hydromel, appâts).");
			EnableMisc = config.Bind<bool>("4 - Catégories", "EnableMisc", true, "Activer la vente des autres items (graines, trophées, outils, etc.).");
		}

		public static bool IsTraderEnabled(Trader trader)
		{
			string text = trader.m_name ?? ((Object)((Component)trader).gameObject).name;
			if (text.Contains("Haldor"))
			{
				return EnableHaldor.Value;
			}
			if (text.Contains("Hildir"))
			{
				return EnableHildir.Value;
			}
			if (text.Contains("BogWitch") || text.Contains("Bog_Witch") || text.Contains("Bog Witch"))
			{
				return EnableBogWitch.Value;
			}
			return true;
		}

		public static int ApplyPrice(int basePrice)
		{
			return Math.Max(1, (int)((float)basePrice * PriceMultiplier.Value));
		}

		public static int ApplyStack(int baseStack)
		{
			return Math.Max(1, (int)((float)baseStack * StackMultiplier.Value));
		}
	}
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("juliani.mods.valheim.bosstrader", "ValheimBossTrader", "1.0.6")]
	public class Plugin : BaseUnityPlugin
	{
		public const string PluginGuid = "juliani.mods.valheim.bosstrader";

		public const string PluginName = "ValheimBossTrader";

		public const string PluginVersion = "1.0.6";

		internal static ManualLogSource Log;

		private readonly Harmony _harmony = new Harmony("juliani.mods.valheim.bosstrader");

		private void Awake()
		{
			Log = ((BaseUnityPlugin)this).Logger;
			ModConfig.Init(((BaseUnityPlugin)this).Config);
			Log.LogInfo((object)string.Format("{0} v{1} chargé — {2} items configurés.", "ValheimBossTrader", "1.0.6", CountItems()));
			_harmony.PatchAll();
		}

		private void OnDestroy()
		{
			_harmony.UnpatchSelf();
		}

		private static int CountItems()
		{
			int num = 0;
			foreach (TraderItems.TradeItemDef item in TraderItems.GetAll())
			{
				_ = item;
				num++;
			}
			return num;
		}
	}
	public enum Category
	{
		Materials,
		Food,
		Weapons,
		Armor,
		Ammo,
		Consumables,
		Misc
	}
	public static class TraderItems
	{
		public class TradeItemDef
		{
			public string PrefabName { get; }

			public int Stack { get; }

			public int Price { get; }

			public string RequiredKey { get; }

			public Category Cat { get; }

			public TradeItemDef(string prefabName, int stack, int price, string requiredKey = null, Category cat = Category.Misc)
			{
				PrefabName = prefabName;
				Stack = stack;
				Price = price;
				RequiredKey = requiredKey;
				Cat = cat;
			}
		}

		[CompilerGenerated]
		private sealed class <GetAll>d__3 : IEnumerable<TradeItemDef>, IEnumerable, IEnumerator<TradeItemDef>, IDisposable, IEnumerator
		{
			private int <>1__state;

			private TradeItemDef <>2__current;

			private int <>l__initialThreadId;

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

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

			[DebuggerHidden]
			public <GetAll>d__3(int <>1__state)
			{
				this.<>1__state = <>1__state;
				<>l__initialThreadId = Environment.CurrentManagedThreadId;
			}

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

			private bool MoveNext()
			{
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = new TradeItemDef("Acorn", 20, 6, null, Category.Materials);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ArmorLeatherChest", 1, 99, null, Category.Armor);
					<>1__state = 2;
					return true;
				case 2:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ArmorLeatherLegs", 1, 99, null, Category.Armor);
					<>1__state = 3;
					return true;
				case 3:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ArmorRagsChest", 1, 50, null, Category.Armor);
					<>1__state = 4;
					return true;
				case 4:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ArmorRagsLegs", 1, 50, null, Category.Armor);
					<>1__state = 5;
					return true;
				case 5:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ArrowFire", 20, 78, null, Category.Ammo);
					<>1__state = 6;
					return true;
				case 6:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ArrowFlint", 20, 51, null, Category.Ammo);
					<>1__state = 7;
					return true;
				case 7:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ArrowWood", 20, 27, null, Category.Ammo);
					<>1__state = 8;
					return true;
				case 8:
					<>1__state = -1;
					<>2__current = new TradeItemDef("AxeFlint", 1, 54, null, Category.Weapons);
					<>1__state = 9;
					return true;
				case 9:
					<>1__state = -1;
					<>2__current = new TradeItemDef("AxeStone", 1, 30, null, Category.Weapons);
					<>1__state = 10;
					return true;
				case 10:
					<>1__state = -1;
					<>2__current = new TradeItemDef("BeechSeeds", 20, 5, null, Category.Materials);
					<>1__state = 11;
					return true;
				case 11:
					<>1__state = -1;
					<>2__current = new TradeItemDef("BirchSeeds", 20, 5, null, Category.Materials);
					<>1__state = 12;
					return true;
				case 12:
					<>1__state = -1;
					<>2__current = new TradeItemDef("Blueberries", 1, 5, null, Category.Food);
					<>1__state = 13;
					return true;
				case 13:
					<>1__state = -1;
					<>2__current = new TradeItemDef("BoarJerky", 1, 60, null, Category.Food);
					<>1__state = 14;
					return true;
				case 14:
					<>1__state = -1;
					<>2__current = new TradeItemDef("BoneFragments", 20, 5, null, Category.Materials);
					<>1__state = 15;
					return true;
				case 15:
					<>1__state = -1;
					<>2__current = new TradeItemDef("Bow", 1, 113, null, Category.Weapons);
					<>1__state = 16;
					return true;
				case 16:
					<>1__state = -1;
					<>2__current = new TradeItemDef("CapeDeerHide", 1, 75, null, Category.Armor);
					<>1__state = 17;
					return true;
				case 17:
					<>1__state = -1;
					<>2__current = new TradeItemDef("Carrot", 1, 10, null, Category.Food);
					<>1__state = 18;
					return true;
				case 18:
					<>1__state = -1;
					<>2__current = new TradeItemDef("CarrotSeeds", 20, 5, null, Category.Food);
					<>1__state = 19;
					return true;
				case 19:
					<>1__state = -1;
					<>2__current = new TradeItemDef("CarrotSoup", 1, 66, null, Category.Food);
					<>1__state = 20;
					return true;
				case 20:
					<>1__state = -1;
					<>2__current = new TradeItemDef("Club", 1, 22, null, Category.Weapons);
					<>1__state = 21;
					return true;
				case 21:
					<>1__state = -1;
					<>2__current = new TradeItemDef("Coal", 10, 6, null, Category.Materials);
					<>1__state = 22;
					return true;
				case 22:
					<>1__state = -1;
					<>2__current = new TradeItemDef("CookedDeerMeat", 1, 36, null, Category.Food);
					<>1__state = 23;
					return true;
				case 23:
					<>1__state = -1;
					<>2__current = new TradeItemDef("CookedMeat", 1, 36, null, Category.Food);
					<>1__state = 24;
					return true;
				case 24:
					<>1__state = -1;
					<>2__current = new TradeItemDef("Dandelion", 20, 5, null, Category.Materials);
					<>1__state = 25;
					return true;
				case 25:
					<>1__state = -1;
					<>2__current = new TradeItemDef("DeerHide", 20, 9, null, Category.Materials);
					<>1__state = 26;
					return true;
				case 26:
					<>1__state = -1;
					<>2__current = new TradeItemDef("DeerMeat", 1, 12, null, Category.Food);
					<>1__state = 27;
					return true;
				case 27:
					<>1__state = -1;
					<>2__current = new TradeItemDef("DeerStew", 1, 84, null, Category.Food);
					<>1__state = 28;
					return true;
				case 28:
					<>1__state = -1;
					<>2__current = new TradeItemDef("FeastMeadows", 1, 255, null, Category.Food);
					<>1__state = 29;
					return true;
				case 29:
					<>1__state = -1;
					<>2__current = new TradeItemDef("Feaster", 1, 66, null, Category.Food);
					<>1__state = 30;
					return true;
				case 30:
					<>1__state = -1;
					<>2__current = new TradeItemDef("Feathers", 20, 5, null, Category.Materials);
					<>1__state = 31;
					return true;
				case 31:
					<>1__state = -1;
					<>2__current = new TradeItemDef("FirCone", 20, 5, null, Category.Materials);
					<>1__state = 32;
					return true;
				case 32:
					<>1__state = -1;
					<>2__current = new TradeItemDef("Flint", 20, 5, null, Category.Materials);
					<>1__state = 33;
					return true;
				case 33:
					<>1__state = -1;
					<>2__current = new TradeItemDef("Hammer", 1, 18, null, Category.Weapons);
					<>1__state = 34;
					return true;
				case 34:
					<>1__state = -1;
					<>2__current = new TradeItemDef("HardAntler", 1, 600);
					<>1__state = 35;
					return true;
				case 35:
					<>1__state = -1;
					<>2__current = new TradeItemDef("HelmetLeather", 1, 99, null, Category.Armor);
					<>1__state = 36;
					return true;
				case 36:
					<>1__state = -1;
					<>2__current = new TradeItemDef("HelmetYule", 1, 36, null, Category.Armor);
					<>1__state = 37;
					return true;
				case 37:
					<>1__state = -1;
					<>2__current = new TradeItemDef("Hoe", 1, 24, null, Category.Weapons);
					<>1__state = 38;
					return true;
				case 38:
					<>1__state = -1;
					<>2__current = new TradeItemDef("Honey", 1, 31, null, Category.Food);
					<>1__state = 39;
					return true;
				case 39:
					<>1__state = -1;
					<>2__current = new TradeItemDef("KnifeFlint", 1, 51, null, Category.Weapons);
					<>1__state = 40;
					return true;
				case 40:
					<>1__state = -1;
					<>2__current = new TradeItemDef("LeatherScraps", 20, 6, null, Category.Materials);
					<>1__state = 41;
					return true;
				case 41:
					<>1__state = -1;
					<>2__current = new TradeItemDef("MeadBaseStrength", 1, 682, null, Category.Consumables);
					<>1__state = 42;
					return true;
				case 42:
					<>1__state = -1;
					<>2__current = new TradeItemDef("MeadBaseSwimmer", 1, 102, null, Category.Consumables);
					<>1__state = 43;
					return true;
				case 43:
					<>1__state = -1;
					<>2__current = new TradeItemDef("MinceMeatSauce", 1, 35, null, Category.Food);
					<>1__state = 44;
					return true;
				case 44:
					<>1__state = -1;
					<>2__current = new TradeItemDef("Mushroom", 1, 6, null, Category.Food);
					<>1__state = 45;
					return true;
				case 45:
					<>1__state = -1;
					<>2__current = new TradeItemDef("MushroomYellow", 1, 12, null, Category.Food);
					<>1__state = 46;
					return true;
				case 46:
					<>1__state = -1;
					<>2__current = new TradeItemDef("NeckTail", 1, 12);
					<>1__state = 47;
					return true;
				case 47:
					<>1__state = -1;
					<>2__current = new TradeItemDef("NeckTailGrilled", 1, 14);
					<>1__state = 48;
					return true;
				case 48:
					<>1__state = -1;
					<>2__current = new TradeItemDef("PickaxeAntler", 1, 136, null, Category.Weapons);
					<>1__state = 49;
					return true;
				case 49:
					<>1__state = -1;
					<>2__current = new TradeItemDef("PickaxeStone", 1, 34, null, Category.Weapons);
					<>1__state = 50;
					return true;
				case 50:
					<>1__state = -1;
					<>2__current = new TradeItemDef("PineCone", 20, 5, null, Category.Materials);
					<>1__state = 51;
					return true;
				case 51:
					<>1__state = -1;
					<>2__current = new TradeItemDef("Pukeberries", 20, 7, null, Category.Materials);
					<>1__state = 52;
					return true;
				case 52:
					<>1__state = -1;
					<>2__current = new TradeItemDef("QueenBee", 10, 90);
					<>1__state = 53;
					return true;
				case 53:
					<>1__state = -1;
					<>2__current = new TradeItemDef("QueensJam", 1, 75, null, Category.Food);
					<>1__state = 54;
					return true;
				case 54:
					<>1__state = -1;
					<>2__current = new TradeItemDef("Raspberry", 1, 5, null, Category.Food);
					<>1__state = 55;
					return true;
				case 55:
					<>1__state = -1;
					<>2__current = new TradeItemDef("RawMeat", 1, 10, null, Category.Food);
					<>1__state = 56;
					return true;
				case 56:
					<>1__state = -1;
					<>2__current = new TradeItemDef("Resin", 20, 5, null, Category.Materials);
					<>1__state = 57;
					return true;
				case 57:
					<>1__state = -1;
					<>2__current = new TradeItemDef("SharpeningStone", 1, 13, null, Category.Materials);
					<>1__state = 58;
					return true;
				case 58:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ShieldBoneTower", 1, 139, null, Category.Armor);
					<>1__state = 59;
					return true;
				case 59:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ShieldWood", 1, 79, null, Category.Armor);
					<>1__state = 60;
					return true;
				case 60:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ShieldWoodTower", 1, 76, null, Category.Armor);
					<>1__state = 61;
					return true;
				case 61:
					<>1__state = -1;
					<>2__current = new TradeItemDef("Sparkler", 20, 9, null, Category.Materials);
					<>1__state = 62;
					return true;
				case 62:
					<>1__state = -1;
					<>2__current = new TradeItemDef("SpearFlint", 1, 103, null, Category.Weapons);
					<>1__state = 63;
					return true;
				case 63:
					<>1__state = -1;
					<>2__current = new TradeItemDef("Stone", 20, 5, null, Category.Materials);
					<>1__state = 64;
					return true;
				case 64:
					<>1__state = -1;
					<>2__current = new TradeItemDef("Torch", 1, 12, null, Category.Weapons);
					<>1__state = 65;
					return true;
				case 65:
					<>1__state = -1;
					<>2__current = new TradeItemDef("TrophyBoar", 1, 33);
					<>1__state = 66;
					return true;
				case 66:
					<>1__state = -1;
					<>2__current = new TradeItemDef("TrophyDeer", 1, 40);
					<>1__state = 67;
					return true;
				case 67:
					<>1__state = -1;
					<>2__current = new TradeItemDef("TrophyNeck", 1, 27);
					<>1__state = 68;
					return true;
				case 68:
					<>1__state = -1;
					<>2__current = new TradeItemDef("Turnip", 1, 16, null, Category.Food);
					<>1__state = 69;
					return true;
				case 69:
					<>1__state = -1;
					<>2__current = new TradeItemDef("TurnipSeeds", 20, 6, null, Category.Food);
					<>1__state = 70;
					return true;
				case 70:
					<>1__state = -1;
					<>2__current = new TradeItemDef("Wood", 20, 5, null, Category.Materials);
					<>1__state = 71;
					return true;
				case 71:
					<>1__state = -1;
					<>2__current = new TradeItemDef("AncientSeed", 20, 39, "defeated_eikthyr", Category.Materials);
					<>1__state = 72;
					return true;
				case 72:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ArmorBronzeChest", 1, 601, "defeated_eikthyr", Category.Armor);
					<>1__state = 73;
					return true;
				case 73:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ArmorBronzeLegs", 1, 601, "defeated_eikthyr", Category.Armor);
					<>1__state = 74;
					return true;
				case 74:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ArmorLeatherChest", 1, 148, "defeated_eikthyr", Category.Armor);
					<>1__state = 75;
					return true;
				case 75:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ArmorLeatherLegs", 1, 148, "defeated_eikthyr", Category.Armor);
					<>1__state = 76;
					return true;
				case 76:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ArmorRagsChest", 1, 75, "defeated_eikthyr", Category.Armor);
					<>1__state = 77;
					return true;
				case 77:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ArmorRagsLegs", 1, 75, "defeated_eikthyr", Category.Armor);
					<>1__state = 78;
					return true;
				case 78:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ArmorTrollLeatherChest", 1, 415, "defeated_eikthyr", Category.Armor);
					<>1__state = 79;
					return true;
				case 79:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ArmorTrollLeatherLegs", 1, 415, "defeated_eikthyr", Category.Armor);
					<>1__state = 80;
					return true;
				case 80:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ArrowBronze", 20, 148, "defeated_eikthyr", Category.Ammo);
					<>1__state = 81;
					return true;
				case 81:
					<>1__state = -1;
					<>2__current = new TradeItemDef("AtgeirBronze", 1, 943, "defeated_eikthyr", Category.Weapons);
					<>1__state = 82;
					return true;
				case 82:
					<>1__state = -1;
					<>2__current = new TradeItemDef("AtgeirWood", 1, 196, "defeated_eikthyr", Category.Weapons);
					<>1__state = 83;
					return true;
				case 83:
					<>1__state = -1;
					<>2__current = new TradeItemDef("AxeBronze", 1, 687, "defeated_eikthyr", Category.Weapons);
					<>1__state = 84;
					return true;
				case 84:
					<>1__state = -1;
					<>2__current = new TradeItemDef("AxeFlint", 1, 81, "defeated_eikthyr", Category.Weapons);
					<>1__state = 85;
					return true;
				case 85:
					<>1__state = -1;
					<>2__current = new TradeItemDef("AxeStone", 1, 45, "defeated_eikthyr", Category.Weapons);
					<>1__state = 86;
					return true;
				case 86:
					<>1__state = -1;
					<>2__current = new TradeItemDef("AxeWood", 1, 137, "defeated_eikthyr", Category.Weapons);
					<>1__state = 87;
					return true;
				case 87:
					<>1__state = -1;
					<>2__current = new TradeItemDef("BBH_BlackForest_Bow", 1, 242, "defeated_eikthyr", Category.Weapons);
					<>1__state = 88;
					return true;
				case 88:
					<>1__state = -1;
					<>2__current = new TradeItemDef("BBH_BlackForest_Quiver", 1, 261, "defeated_eikthyr", Category.Weapons);
					<>1__state = 89;
					return true;
				case 89:
					<>1__state = -1;
					<>2__current = new TradeItemDef("BattleaxeWood", 1, 214, "defeated_eikthyr", Category.Weapons);
					<>1__state = 90;
					return true;
				case 90:
					<>1__state = -1;
					<>2__current = new TradeItemDef("Bow", 1, 169, "defeated_eikthyr", Category.Weapons);
					<>1__state = 91;
					return true;
				case 91:
					<>1__state = -1;
					<>2__current = new TradeItemDef("BowFineWood", 1, 541, "defeated_eikthyr", Category.Weapons);
					<>1__state = 92;
					return true;
				case 92:
					<>1__state = -1;
					<>2__current = new TradeItemDef("Bronze", 15, 105, "defeated_eikthyr", Category.Materials);
					<>1__state = 93;
					return true;
				case 93:
					<>1__state = -1;
					<>2__current = new TradeItemDef("BronzeNails", 50, 11, "defeated_eikthyr");
					<>1__state = 94;
					return true;
				case 94:
					<>1__state = -1;
					<>2__current = new TradeItemDef("BronzeScrap", 15, 44, "defeated_eikthyr", Category.Materials);
					<>1__state = 95;
					return true;
				case 95:
					<>1__state = -1;
					<>2__current = new TradeItemDef("CapeDeerHide", 1, 112, "defeated_eikthyr", Category.Armor);
					<>1__state = 96;
					return true;
				case 96:
					<>1__state = -1;
					<>2__current = new TradeItemDef("CapeTrollHide", 1, 698, "defeated_eikthyr", Category.Armor);
					<>1__state = 97;
					return true;
				case 97:
					<>1__state = -1;
					<>2__current = new TradeItemDef("Club", 1, 33, "defeated_eikthyr", Category.Weapons);
					<>1__state = 98;
					return true;
				case 98:
					<>1__state = -1;
					<>2__current = new TradeItemDef("Copper", 15, 30, "defeated_eikthyr", Category.Materials);
					<>1__state = 99;
					return true;
				case 99:
					<>1__state = -1;
					<>2__current = new TradeItemDef("CopperOre", 1, 22, "defeated_eikthyr", Category.Materials);
					<>1__state = 100;
					return true;
				case 100:
					<>1__state = -1;
					<>2__current = new TradeItemDef("CopperScrap", 15, 26, "defeated_eikthyr");
					<>1__state = 101;
					return true;
				case 101:
					<>1__state = -1;
					<>2__current = new TradeItemDef("CryptKey", 1, 1331, "defeated_eikthyr");
					<>1__state = 102;
					return true;
				case 102:
					<>1__state = -1;
					<>2__current = new TradeItemDef("Cultivator", 1, 415, "defeated_eikthyr");
					<>1__state = 103;
					return true;
				case 103:
					<>1__state = -1;
					<>2__current = new TradeItemDef("DustMagic", 1, 11, "defeated_eikthyr");
					<>1__state = 104;
					return true;
				case 104:
					<>1__state = -1;
					<>2__current = new TradeItemDef("EssenceMagic", 1, 11, "defeated_eikthyr");
					<>1__state = 105;
					return true;
				case 105:
					<>1__state = -1;
					<>2__current = new TradeItemDef("EtchedRunestoneMagic", 1, 14, "defeated_eikthyr");
					<>1__state = 106;
					return true;
				case 106:
					<>1__state = -1;
					<>2__current = new TradeItemDef("FeastBlackforest", 1, 1031, "defeated_eikthyr", Category.Food);
					<>1__state = 107;
					return true;
				case 107:
					<>1__state = -1;
					<>2__current = new TradeItemDef("FineWood", 20, 13, "defeated_eikthyr");
					<>1__state = 108;
					return true;
				case 108:
					<>1__state = -1;
					<>2__current = new TradeItemDef("GreydwarfEye", 20, 13, "defeated_eikthyr");
					<>1__state = 109;
					return true;
				case 109:
					<>1__state = -1;
					<>2__current = new TradeItemDef("Guck", 20, 55, "defeated_eikthyr");
					<>1__state = 110;
					return true;
				case 110:
					<>1__state = -1;
					<>2__current = new TradeItemDef("HelmetBronze", 1, 601, "defeated_eikthyr", Category.Armor);
					<>1__state = 111;
					return true;
				case 111:
					<>1__state = -1;
					<>2__current = new TradeItemDef("HelmetLeather", 1, 148, "defeated_eikthyr", Category.Armor);
					<>1__state = 112;
					return true;
				case 112:
					<>1__state = -1;
					<>2__current = new TradeItemDef("HelmetTrollLeather", 1, 462, "defeated_eikthyr", Category.Armor);
					<>1__state = 113;
					return true;
				case 113:
					<>1__state = -1;
					<>2__current = new TradeItemDef("HelmetYule", 1, 54, "defeated_eikthyr", Category.Armor);
					<>1__state = 114;
					return true;
				case 114:
					<>1__state = -1;
					<>2__current = new TradeItemDef("KnifeButcher", 1, 189, "defeated_eikthyr", Category.Weapons);
					<>1__state = 115;
					return true;
				case 115:
					<>1__state = -1;
					<>2__current = new TradeItemDef("KnifeCopper", 1, 365, "defeated_eikthyr", Category.Weapons);
					<>1__state = 116;
					return true;
				case 116:
					<>1__state = -1;
					<>2__current = new TradeItemDef("KnifeFlint", 1, 76, "defeated_eikthyr", Category.Weapons);
					<>1__state = 117;
					return true;
				case 117:
					<>1__state = -1;
					<>2__current = new TradeItemDef("KnifeWood", 1, 137, "defeated_eikthyr", Category.Weapons);
					<>1__state = 118;
					return true;
				case 118:
					<>1__state = -1;
					<>2__current = new TradeItemDef("LeatherBelt", 1, 112, "defeated_eikthyr");
					<>1__state = 119;
					return true;
				case 119:
					<>1__state = -1;
					<>2__current = new TradeItemDef("MaceBronze", 1, 704, "defeated_eikthyr", Category.Weapons);
					<>1__state = 120;
					return true;
				case 120:
					<>1__state = -1;
					<>2__current = new TradeItemDef("MaceWood", 1, 137, "defeated_eikthyr", Category.Weapons);
					<>1__state = 121;
					return true;
				case 121:
					<>1__state = -1;
					<>2__current = new TradeItemDef("MeadStrength", 10, 231, "defeated_eikthyr", Category.Consumables);
					<>1__state = 122;
					return true;
				case 122:
					<>1__state = -1;
					<>2__current = new TradeItemDef("MeadTrollPheromones", 10, 264, "defeated_eikthyr", Category.Consumables);
					<>1__state = 123;
					return true;
				case 123:
					<>1__state = -1;
					<>2__current = new TradeItemDef("MushroomBlue", 1, 30, "defeated_eikthyr", Category.Food);
					<>1__state = 124;
					return true;
				case 124:
					<>1__state = -1;
					<>2__current = new TradeItemDef("PickaxeBronze", 1, 693, "defeated_eikthyr", Category.Weapons);
					<>1__state = 125;
					return true;
				case 125:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ReagentMagic", 1, 11, "defeated_eikthyr");
					<>1__state = 126;
					return true;
				case 126:
					<>1__state = -1;
					<>2__current = new TradeItemDef("RunestoneMagic", 1, 14, "defeated_eikthyr");
					<>1__state = 127;
					return true;
				case 127:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ShardMagic", 1, 11, "defeated_eikthyr");
					<>1__state = 128;
					return true;
				case 128:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ShieldBanded", 1, 1079, "defeated_eikthyr", Category.Armor);
					<>1__state = 129;
					return true;
				case 129:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ShieldBoneTower", 1, 208, "defeated_eikthyr", Category.Armor);
					<>1__state = 130;
					return true;
				case 130:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ShieldBronzeBuckler", 1, 732, "defeated_eikthyr", Category.Armor);
					<>1__state = 131;
					return true;
				case 131:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ShieldWood", 1, 118, "defeated_eikthyr", Category.Armor);
					<>1__state = 132;
					return true;
				case 132:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ShieldWoodTower", 1, 114, "defeated_eikthyr", Category.Armor);
					<>1__state = 133;
					return true;
				case 133:
					<>1__state = -1;
					<>2__current = new TradeItemDef("SledgeWood", 1, 178, "defeated_eikthyr", Category.Weapons);
					<>1__state = 134;
					return true;
				case 134:
					<>1__state = -1;
					<>2__current = new TradeItemDef("SpearBronze", 1, 555, "defeated_eikthyr", Category.Weapons);
					<>1__state = 135;
					return true;
				case 135:
					<>1__state = -1;
					<>2__current = new TradeItemDef("SpearFlint", 1, 154, "defeated_eikthyr", Category.Weapons);
					<>1__state = 136;
					return true;
				case 136:
					<>1__state = -1;
					<>2__current = new TradeItemDef("SpearWood", 1, 137, "defeated_eikthyr", Category.Weapons);
					<>1__state = 137;
					return true;
				case 137:
					<>1__state = -1;
					<>2__current = new TradeItemDef("SurtlingCore", 10, 330, "defeated_eikthyr");
					<>1__state = 138;
					return true;
				case 138:
					<>1__state = -1;
					<>2__current = new TradeItemDef("SwordBronze", 1, 676, "defeated_eikthyr", Category.Weapons);
					<>1__state = 139;
					return true;
				case 139:
					<>1__state = -1;
					<>2__current = new TradeItemDef("SwordWood", 1, 137, "defeated_eikthyr", Category.Weapons);
					<>1__state = 140;
					return true;
				case 140:
					<>1__state = -1;
					<>2__current = new TradeItemDef("THSwordWood", 1, 178, "defeated_eikthyr", Category.Weapons);
					<>1__state = 141;
					return true;
				case 141:
					<>1__state = -1;
					<>2__current = new TradeItemDef("Tankard", 1, 90, "defeated_eikthyr");
					<>1__state = 142;
					return true;
				case 142:
					<>1__state = -1;
					<>2__current = new TradeItemDef("TankardOdin", 1, 151, "defeated_eikthyr");
					<>1__state = 143;
					return true;
				case 143:
					<>1__state = -1;
					<>2__current = new TradeItemDef("Thistle", 20, 13, "defeated_eikthyr");
					<>1__state = 144;
					return true;
				case 144:
					<>1__state = -1;
					<>2__current = new TradeItemDef("Tin", 15, 30, "defeated_eikthyr", Category.Materials);
					<>1__state = 145;
					return true;
				case 145:
					<>1__state = -1;
					<>2__current = new TradeItemDef("TinOre", 1, 22, "defeated_eikthyr", Category.Materials);
					<>1__state = 146;
					return true;
				case 146:
					<>1__state = -1;
					<>2__current = new TradeItemDef("TrinketBronzeHealth", 1, 567, "defeated_eikthyr", Category.Armor);
					<>1__state = 147;
					return true;
				case 147:
					<>1__state = -1;
					<>2__current = new TradeItemDef("TrollHide", 20, 48, "defeated_eikthyr", Category.Materials);
					<>1__state = 148;
					return true;
				case 148:
					<>1__state = -1;
					<>2__current = new TradeItemDef("TrophyForestTroll", 1, 286, "defeated_eikthyr");
					<>1__state = 149;
					return true;
				case 149:
					<>1__state = -1;
					<>2__current = new TradeItemDef("TrophyGreydwarf", 1, 49, "defeated_eikthyr");
					<>1__state = 150;
					return true;
				case 150:
					<>1__state = -1;
					<>2__current = new TradeItemDef("TrophyGreydwarfBrute", 1, 160, "defeated_eikthyr");
					<>1__state = 151;
					return true;
				case 151:
					<>1__state = -1;
					<>2__current = new TradeItemDef("TrophyGreydwarfShaman", 1, 143, "defeated_eikthyr");
					<>1__state = 152;
					return true;
				case 152:
					<>1__state = -1;
					<>2__current = new TradeItemDef("TrophySkeleton", 1, 61, "defeated_eikthyr");
					<>1__state = 153;
					return true;
				case 153:
					<>1__state = -1;
					<>2__current = new TradeItemDef("TrophySkeletonPoison", 1, 111, "defeated_eikthyr");
					<>1__state = 154;
					return true;
				case 154:
					<>1__state = -1;
					<>2__current = new TradeItemDef("TurretBoltWood", 1, 22, "defeated_eikthyr");
					<>1__state = 155;
					return true;
				case 155:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ArmorBronzeChest", 1, 1502, "defeated_gdking", Category.Armor);
					<>1__state = 156;
					return true;
				case 156:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ArmorBronzeLegs", 1, 1502, "defeated_gdking", Category.Armor);
					<>1__state = 157;
					return true;
				case 157:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ArmorIronChest", 1, 5698, "defeated_gdking", Category.Armor);
					<>1__state = 158;
					return true;
				case 158:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ArmorIronLegs", 1, 5698, "defeated_gdking", Category.Armor);
					<>1__state = 159;
					return true;
				case 159:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ArmorLeatherChest", 1, 247, "defeated_gdking", Category.Armor);
					<>1__state = 160;
					return true;
				case 160:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ArmorLeatherLegs", 1, 247, "defeated_gdking", Category.Armor);
					<>1__state = 161;
					return true;
				case 161:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ArmorRagsChest", 1, 125, "defeated_gdking", Category.Armor);
					<>1__state = 162;
					return true;
				case 162:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ArmorRagsLegs", 1, 125, "defeated_gdking", Category.Armor);
					<>1__state = 163;
					return true;
				case 163:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ArmorRootChest", 1, 1836, "defeated_gdking", Category.Armor);
					<>1__state = 164;
					return true;
				case 164:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ArmorRootLegs", 1, 1836, "defeated_gdking", Category.Armor);
					<>1__state = 165;
					return true;
				case 165:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ArmorTrollLeatherChest", 1, 1037, "defeated_gdking", Category.Armor);
					<>1__state = 166;
					return true;
				case 166:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ArmorTrollLeatherLegs", 1, 1037, "defeated_gdking", Category.Armor);
					<>1__state = 167;
					return true;
				case 167:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ArrowIron", 20, 319, "defeated_gdking", Category.Ammo);
					<>1__state = 168;
					return true;
				case 168:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ArrowPoison", 20, 504, "defeated_gdking", Category.Ammo);
					<>1__state = 169;
					return true;
				case 169:
					<>1__state = -1;
					<>2__current = new TradeItemDef("AtgeirBronze", 1, 2357, "defeated_gdking", Category.Weapons);
					<>1__state = 170;
					return true;
				case 170:
					<>1__state = -1;
					<>2__current = new TradeItemDef("AtgeirIron", 1, 8271, "defeated_gdking", Category.Weapons);
					<>1__state = 171;
					return true;
				case 171:
					<>1__state = -1;
					<>2__current = new TradeItemDef("AtgeirWood", 1, 490, "defeated_gdking", Category.Weapons);
					<>1__state = 172;
					return true;
				case 172:
					<>1__state = -1;
					<>2__current = new TradeItemDef("AxeBronze", 1, 1717, "defeated_gdking", Category.Weapons);
					<>1__state = 173;
					return true;
				case 173:
					<>1__state = -1;
					<>2__current = new TradeItemDef("AxeFlint", 1, 135, "defeated_gdking", Category.Weapons);
					<>1__state = 174;
					return true;
				case 174:
					<>1__state = -1;
					<>2__current = new TradeItemDef("AxeIron", 1, 4230, "defeated_gdking", Category.Weapons);
					<>1__state = 175;
					return true;
				case 175:
					<>1__state = -1;
					<>2__current = new TradeItemDef("AxeStone", 1, 75, "defeated_gdking", Category.Weapons);
					<>1__state = 176;
					return true;
				case 176:
					<>1__state = -1;
					<>2__current = new TradeItemDef("AxeWood", 1, 342, "defeated_gdking", Category.Weapons);
					<>1__state = 177;
					return true;
				case 177:
					<>1__state = -1;
					<>2__current = new TradeItemDef("BBH_BlackForest_Bow", 1, 605, "defeated_gdking", Category.Weapons);
					<>1__state = 178;
					return true;
				case 178:
					<>1__state = -1;
					<>2__current = new TradeItemDef("BBH_Surtling_Bow", 1, 15508, "defeated_gdking", Category.Weapons);
					<>1__state = 179;
					return true;
				case 179:
					<>1__state = -1;
					<>2__current = new TradeItemDef("Battleaxe", 1, 11565, "defeated_gdking", Category.Weapons);
					<>1__state = 180;
					return true;
				case 180:
					<>1__state = -1;
					<>2__current = new TradeItemDef("BattleaxeWood", 1, 535, "defeated_gdking", Category.Weapons);
					<>1__state = 181;
					return true;
				case 181:
					<>1__state = -1;
					<>2__current = new TradeItemDef("BlackSoup", 1, 270, "defeated_gdking", Category.Food);
					<>1__state = 182;
					return true;
				case 182:
					<>1__state = -1;
					<>2__current = new TradeItemDef("Bloodbag", 20, 86, "defeated_gdking");
					<>1__state = 183;
					return true;
				case 183:
					<>1__state = -1;
					<>2__current = new TradeItemDef("BombBlob_Poison", 20, 198, "defeated_gdking", Category.Ammo);
					<>1__state = 184;
					return true;
				case 184:
					<>1__state = -1;
					<>2__current = new TradeItemDef("BombBlob_PoisonElite", 20, 270, "defeated_gdking", Category.Ammo);
					<>1__state = 185;
					return true;
				case 185:
					<>1__state = -1;
					<>2__current = new TradeItemDef("BombOoze", 20, 144, "defeated_gdking", Category.Ammo);
					<>1__state = 186;
					return true;
				case 186:
					<>1__state = -1;
					<>2__current = new TradeItemDef("Bow", 1, 282, "defeated_gdking", Category.Weapons);
					<>1__state = 187;
					return true;
				case 187:
					<>1__state = -1;
					<>2__current = new TradeItemDef("BowFineWood", 1, 1352, "defeated_gdking", Category.Weapons);
					<>1__state = 188;
					return true;
				case 188:
					<>1__state = -1;
					<>2__current = new TradeItemDef("BowHuntsman", 1, 5152, "defeated_gdking", Category.Weapons);
					<>1__state = 189;
					return true;
				case 189:
					<>1__state = -1;
					<>2__current = new TradeItemDef("CapeDeerHide", 1, 187, "defeated_gdking", Category.Armor);
					<>1__state = 190;
					return true;
				case 190:
					<>1__state = -1;
					<>2__current = new TradeItemDef("CapeTrollHide", 1, 1745, "defeated_gdking", Category.Armor);
					<>1__state = 191;
					return true;
				case 191:
					<>1__state = -1;
					<>2__current = new TradeItemDef("Chain", 20, 486, "defeated_gdking");
					<>1__state = 192;
					return true;
				case 192:
					<>1__state = -1;
					<>2__current = new TradeItemDef("Chitin", 20, 100, "defeated_gdking", Category.Materials);
					<>1__state = 193;
					return true;
				case 193:
					<>1__state = -1;
					<>2__current = new TradeItemDef("Club", 1, 55, "defeated_gdking", Category.Weapons);
					<>1__state = 194;
					return true;
				case 194:
					<>1__state = -1;
					<>2__current = new TradeItemDef("DustRare", 1, 28, "defeated_gdking");
					<>1__state = 195;
					return true;
				case 195:
					<>1__state = -1;
					<>2__current = new TradeItemDef("Ectoplasm", 20, 378, "defeated_gdking");
					<>1__state = 196;
					return true;
				case 196:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ElderBark", 20, 36, "defeated_gdking", Category.Materials);
					<>1__state = 197;
					return true;
				case 197:
					<>1__state = -1;
					<>2__current = new TradeItemDef("Entrails", 20, 72, "defeated_gdking");
					<>1__state = 198;
					return true;
				case 198:
					<>1__state = -1;
					<>2__current = new TradeItemDef("EssenceRare", 1, 28, "defeated_gdking");
					<>1__state = 199;
					return true;
				case 199:
					<>1__state = -1;
					<>2__current = new TradeItemDef("EtchedRunestoneRare", 1, 37, "defeated_gdking");
					<>1__state = 200;
					return true;
				case 200:
					<>1__state = -1;
					<>2__current = new TradeItemDef("FeastOceans", 1, 1796, "defeated_gdking", Category.Food);
					<>1__state = 201;
					return true;
				case 201:
					<>1__state = -1;
					<>2__current = new TradeItemDef("FeastSwamps", 1, 1962, "defeated_gdking", Category.Food);
					<>1__state = 202;
					return true;
				case 202:
					<>1__state = -1;
					<>2__current = new TradeItemDef("Fish1", 20, 62, "defeated_gdking", Category.Food);
					<>1__state = 203;
					return true;
				case 203:
					<>1__state = -1;
					<>2__current = new TradeItemDef("Fish11", 20, 75, "defeated_gdking", Category.Food);
					<>1__state = 204;
					return true;
				case 204:
					<>1__state = -1;
					<>2__current = new TradeItemDef("Fish12", 20, 62, "defeated_gdking", Category.Food);
					<>1__state = 205;
					return true;
				case 205:
					<>1__state = -1;
					<>2__current = new TradeItemDef("Fish2", 20, 75, "defeated_gdking", Category.Food);
					<>1__state = 206;
					return true;
				case 206:
					<>1__state = -1;
					<>2__current = new TradeItemDef("Fish3", 20, 62, "defeated_gdking", Category.Food);
					<>1__state = 207;
					return true;
				case 207:
					<>1__state = -1;
					<>2__current = new TradeItemDef("FishCooked", 10, 113, "defeated_gdking", Category.Food);
					<>1__state = 208;
					return true;
				case 208:
					<>1__state = -1;
					<>2__current = new TradeItemDef("FishRaw", 20, 62, "defeated_gdking", Category.Food);
					<>1__state = 209;
					return true;
				case 209:
					<>1__state = -1;
					<>2__current = new TradeItemDef("FishingBait", 50, 12, "defeated_gdking", Category.Food);
					<>1__state = 210;
					return true;
				case 210:
					<>1__state = -1;
					<>2__current = new TradeItemDef("FishingBaitForest", 50, 25, "defeated_gdking", Category.Food);
					<>1__state = 211;
					return true;
				case 211:
					<>1__state = -1;
					<>2__current = new TradeItemDef("FishingBaitOcean", 50, 50, "defeated_gdking", Category.Food);
					<>1__state = 212;
					return true;
				case 212:
					<>1__state = -1;
					<>2__current = new TradeItemDef("FishingBaitSwamp", 50, 50, "defeated_gdking", Category.Food);
					<>1__state = 213;
					return true;
				case 213:
					<>1__state = -1;
					<>2__current = new TradeItemDef("FishingRod", 1, 936, "defeated_gdking", Category.Food);
					<>1__state = 214;
					return true;
				case 214:
					<>1__state = -1;
					<>2__current = new TradeItemDef("HelmetBronze", 1, 1502, "defeated_gdking", Category.Armor);
					<>1__state = 215;
					return true;
				case 215:
					<>1__state = -1;
					<>2__current = new TradeItemDef("HelmetFishingHat", 1, 243, "defeated_gdking", Category.Food);
					<>1__state = 216;
					return true;
				case 216:
					<>1__state = -1;
					<>2__current = new TradeItemDef("HelmetIron", 1, 5698, "defeated_gdking", Category.Armor);
					<>1__state = 217;
					return true;
				case 217:
					<>1__state = -1;
					<>2__current = new TradeItemDef("HelmetLeather", 1, 247, "defeated_gdking", Category.Armor);
					<>1__state = 218;
					return true;
				case 218:
					<>1__state = -1;
					<>2__current = new TradeItemDef("HelmetRoot", 1, 1863, "defeated_gdking", Category.Armor);
					<>1__state = 219;
					return true;
				case 219:
					<>1__state = -1;
					<>2__current = new TradeItemDef("HelmetTrollLeather", 1, 1155, "defeated_gdking", Category.Armor);
					<>1__state = 220;
					return true;
				case 220:
					<>1__state = -1;
					<>2__current = new TradeItemDef("HelmetYule", 1, 90, "defeated_gdking", Category.Armor);
					<>1__state = 221;
					return true;
				case 221:
					<>1__state = -1;
					<>2__current = new TradeItemDef("Iron", 15, 144, "defeated_gdking", Category.Materials);
					<>1__state = 222;
					return true;
				case 222:
					<>1__state = -1;
					<>2__current = new TradeItemDef("IronNails", 50, 21, "defeated_gdking");
					<>1__state = 223;
					return true;
				case 223:
					<>1__state = -1;
					<>2__current = new TradeItemDef("IronOre", 1, 64, "defeated_gdking");
					<>1__state = 224;
					return true;
				case 224:
					<>1__state = -1;
					<>2__current = new TradeItemDef("IronScrap", 15, 64, "defeated_gdking", Category.Materials);
					<>1__state = 225;
					return true;
				case 225:
					<>1__state = -1;
					<>2__current = new TradeItemDef("KnifeButcher", 1, 472, "defeated_gdking", Category.Weapons);
					<>1__state = 226;
					return true;
				case 226:
					<>1__state = -1;
					<>2__current = new TradeItemDef("KnifeChitin", 1, 3073, "defeated_gdking", Category.Weapons);
					<>1__state = 227;
					return true;
				case 227:
					<>1__state = -1;
					<>2__current = new TradeItemDef("KnifeCopper", 1, 912, "defeated_gdking", Category.Weapons);
					<>1__state = 228;
					return true;
				case 228:
					<>1__state = -1;
					<>2__current = new TradeItemDef("KnifeFlint", 1, 127, "defeated_gdking", Category.Weapons);
					<>1__state = 229;
					return true;
				case 229:
					<>1__state = -1;
					<>2__current = new TradeItemDef("KnifeWood", 1, 342, "defeated_gdking", Category.Weapons);
					<>1__state = 230;
					return true;
				case 230:
					<>1__state = -1;
					<>2__current = new TradeItemDef("MaceBronze", 1, 1760, "defeated_gdking", Category.Weapons);
					<>1__state = 231;
					return true;
				case 231:
					<>1__state = -1;
					<>2__current = new TradeItemDef("MaceIron", 1, 4257, "defeated_gdking", Category.Weapons);
					<>1__state = 232;
					return true;
				case 232:
					<>1__state = -1;
					<>2__current = new TradeItemDef("MaceWood", 1, 342, "defeated_gdking", Category.Weapons);
					<>1__state = 233;
					return true;
				case 233:
					<>1__state = -1;
					<>2__current = new TradeItemDef("MeadBaseHealthMedium", 10, 2716, "defeated_gdking", Category.Consumables);
					<>1__state = 234;
					return true;
				case 234:
					<>1__state = -1;
					<>2__current = new TradeItemDef("MeadBaseHealthMinor", 10, 2214, "defeated_gdking", Category.Consumables);
					<>1__state = 235;
					return true;
				case 235:
					<>1__state = -1;
					<>2__current = new TradeItemDef("MeadBasePoisonResist", 10, 2419, "defeated_gdking", Category.Consumables);
					<>1__state = 236;
					return true;
				case 236:
					<>1__state = -1;
					<>2__current = new TradeItemDef("MeadBaseStaminaMedium", 10, 3229, "defeated_gdking", Category.Consumables);
					<>1__state = 237;
					return true;
				case 237:
					<>1__state = -1;
					<>2__current = new TradeItemDef("MeadBaseStaminaMinor", 10, 2856, "defeated_gdking", Category.Consumables);
					<>1__state = 238;
					return true;
				case 238:
					<>1__state = -1;
					<>2__current = new TradeItemDef("MeadBaseTasty", 10, 2203, "defeated_gdking", Category.Consumables);
					<>1__state = 239;
					return true;
				case 239:
					<>1__state = -1;
					<>2__current = new TradeItemDef("MeadHealthMedium", 10, 486, "defeated_gdking", Category.Consumables);
					<>1__state = 240;
					return true;
				case 240:
					<>1__state = -1;
					<>2__current = new TradeItemDef("MeadHealthMinor", 10, 270, "defeated_gdking", Category.Consumables);
					<>1__state = 241;
					return true;
				case 241:
					<>1__state = -1;
					<>2__current = new TradeItemDef("MeadPoisonResist", 10, 432, "defeated_gdking", Category.Consumables);
					<>1__state = 242;
					return true;
				case 242:
					<>1__state = -1;
					<>2__current = new TradeItemDef("MeadStaminaMedium", 10, 486, "defeated_gdking", Category.Consumables);
					<>1__state = 243;
					return true;
				case 243:
					<>1__state = -1;
					<>2__current = new TradeItemDef("MeadStaminaMinor", 10, 270, "defeated_gdking", Category.Consumables);
					<>1__state = 244;
					return true;
				case 244:
					<>1__state = -1;
					<>2__current = new TradeItemDef("MeadSwimmer", 10, 378, "defeated_gdking", Category.Consumables);
					<>1__state = 245;
					return true;
				case 245:
					<>1__state = -1;
					<>2__current = new TradeItemDef("MeadTasty", 10, 216, "defeated_gdking", Category.Consumables);
					<>1__state = 246;
					return true;
				case 246:
					<>1__state = -1;
					<>2__current = new TradeItemDef("Ooze", 20, 36, "defeated_gdking");
					<>1__state = 247;
					return true;
				case 247:
					<>1__state = -1;
					<>2__current = new TradeItemDef("PickaxeIron", 1, 3409, "defeated_gdking", Category.Weapons);
					<>1__state = 248;
					return true;
				case 248:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ReagentRare", 1, 28, "defeated_gdking");
					<>1__state = 249;
					return true;
				case 249:
					<>1__state = -1;
					<>2__current = new TradeItemDef("Root", 20, 64, "defeated_gdking");
					<>1__state = 250;
					return true;
				case 250:
					<>1__state = -1;
					<>2__current = new TradeItemDef("RunestoneRare", 1, 37, "defeated_gdking");
					<>1__state = 251;
					return true;
				case 251:
					<>1__state = -1;
					<>2__current = new TradeItemDef("Sausages", 1, 144, "defeated_gdking", Category.Food);
					<>1__state = 252;
					return true;
				case 252:
					<>1__state = -1;
					<>2__current = new TradeItemDef("SerpentMeat", 1, 220, "defeated_gdking", Category.Food);
					<>1__state = 253;
					return true;
				case 253:
					<>1__state = -1;
					<>2__current = new TradeItemDef("SerpentMeatCooked", 1, 346, "defeated_gdking", Category.Food);
					<>1__state = 254;
					return true;
				case 254:
					<>1__state = -1;
					<>2__current = new TradeItemDef("SerpentScale", 20, 324, "defeated_gdking");
					<>1__state = 255;
					return true;
				case 255:
					<>1__state = -1;
					<>2__current = new TradeItemDef("SerpentStew", 1, 909, "defeated_gdking", Category.Food);
					<>1__state = 256;
					return true;
				case 256:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ShardRare", 1, 28, "defeated_gdking");
					<>1__state = 257;
					return true;
				case 257:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ShieldBanded", 1, 2697, "defeated_gdking", Category.Armor);
					<>1__state = 258;
					return true;
				case 258:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ShieldBoneTower", 1, 347, "defeated_gdking", Category.Armor);
					<>1__state = 259;
					return true;
				case 259:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ShieldBronzeBuckler", 1, 1830, "defeated_gdking", Category.Armor);
					<>1__state = 260;
					return true;
				case 260:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ShieldIronBuckler", 1, 2045, "defeated_gdking", Category.Armor);
					<>1__state = 261;
					return true;
				case 261:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ShieldIronSquare", 1, 1397, "defeated_gdking", Category.Armor);
					<>1__state = 262;
					return true;
				case 262:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ShieldIronTower", 1, 2280, "defeated_gdking", Category.Armor);
					<>1__state = 263;
					return true;
				case 263:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ShieldWood", 1, 197, "defeated_gdking", Category.Armor);
					<>1__state = 264;
					return true;
				case 264:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ShieldWoodTower", 1, 190, "defeated_gdking", Category.Armor);
					<>1__state = 265;
					return true;
				case 265:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ShocklateSmoothie", 1, 97, "defeated_gdking");
					<>1__state = 266;
					return true;
				case 266:
					<>1__state = -1;
					<>2__current = new TradeItemDef("SledgeIron", 1, 12442, "defeated_gdking", Category.Weapons);
					<>1__state = 267;
					return true;
				case 267:
					<>1__state = -1;
					<>2__current = new TradeItemDef("SledgeWood", 1, 445, "defeated_gdking", Category.Weapons);
					<>1__state = 268;
					return true;
				case 268:
					<>1__state = -1;
					<>2__current = new TradeItemDef("SpearBronze", 1, 1387, "defeated_gdking", Category.Weapons);
					<>1__state = 269;
					return true;
				case 269:
					<>1__state = -1;
					<>2__current = new TradeItemDef("SpearChitin", 1, 4671, "defeated_gdking", Category.Weapons);
					<>1__state = 270;
					return true;
				case 270:
					<>1__state = -1;
					<>2__current = new TradeItemDef("SpearElderbark", 1, 3042, "defeated_gdking", Category.Weapons);
					<>1__state = 271;
					return true;
				case 271:
					<>1__state = -1;
					<>2__current = new TradeItemDef("SpearFlint", 1, 257, "defeated_gdking", Category.Weapons);
					<>1__state = 272;
					return true;
				case 272:
					<>1__state = -1;
					<>2__current = new TradeItemDef("SpearWood", 1, 342, "defeated_gdking", Category.Weapons);
					<>1__state = 273;
					return true;
				case 273:
					<>1__state = -1;
					<>2__current = new TradeItemDef("SwordBronze", 1, 1690, "defeated_gdking", Category.Weapons);
					<>1__state = 274;
					return true;
				case 274:
					<>1__state = -1;
					<>2__current = new TradeItemDef("SwordIron", 1, 4234, "defeated_gdking", Category.Weapons);
					<>1__state = 275;
					return true;
				case 275:
					<>1__state = -1;
					<>2__current = new TradeItemDef("SwordWood", 1, 342, "defeated_gdking", Category.Weapons);
					<>1__state = 276;
					return true;
				case 276:
					<>1__state = -1;
					<>2__current = new TradeItemDef("THSwordWood", 1, 445, "defeated_gdking", Category.Weapons);
					<>1__state = 277;
					return true;
				case 277:
					<>1__state = -1;
					<>2__current = new TradeItemDef("TankardAnniversary", 1, 720, "defeated_gdking");
					<>1__state = 278;
					return true;
				case 278:
					<>1__state = -1;
					<>2__current = new TradeItemDef("TorchArrow", 20, 72, "defeated_gdking", Category.Weapons);
					<>1__state = 279;
					return true;
				case 279:
					<>1__state = -1;
					<>2__current = new TradeItemDef("TrinketBronzeStamina", 1, 1177, "defeated_gdking", Category.Armor);
					<>1__state = 280;
					return true;
				case 280:
					<>1__state = -1;
					<>2__current = new TradeItemDef("TrinketIronHealth", 1, 1076, "defeated_gdking", Category.Armor);
					<>1__state = 281;
					return true;
				case 281:
					<>1__state = -1;
					<>2__current = new TradeItemDef("TrinketIronStamina", 1, 1198, "defeated_gdking", Category.Armor);
					<>1__state = 282;
					return true;
				case 282:
					<>1__state = -1;
					<>2__current = new TradeItemDef("TrophyAbomination", 1, 643, "defeated_gdking");
					<>1__state = 283;
					return true;
				case 283:
					<>1__state = -1;
					<>2__current = new TradeItemDef("TrophyBlob", 1, 121, "defeated_gdking");
					<>1__state = 284;
					return true;
				case 284:
					<>1__state = -1;
					<>2__current = new TradeItemDef("TrophyDraugr", 1, 141, "defeated_gdking");
					<>1__state = 285;
					return true;
				case 285:
					<>1__state = -1;
					<>2__current = new TradeItemDef("TrophyDraugrElite", 1, 409, "defeated_gdking");
					<>1__state = 286;
					return true;
				case 286:
					<>1__state = -1;
					<>2__current = new TradeItemDef("TrophyDraugrFem", 1, 141, "defeated_gdking");
					<>1__state = 287;
					return true;
				case 287:
					<>1__state = -1;
					<>2__current = new TradeItemDef("TrophyGhost", 1, 222, "defeated_gdking");
					<>1__state = 288;
					return true;
				case 288:
					<>1__state = -1;
					<>2__current = new TradeItemDef("TrophyLeech", 1, 121, "defeated_gdking");
					<>1__state = 289;
					return true;
				case 289:
					<>1__state = -1;
					<>2__current = new TradeItemDef("TrophySurtling", 1, 182, "defeated_gdking");
					<>1__state = 290;
					return true;
				case 290:
					<>1__state = -1;
					<>2__current = new TradeItemDef("TrophyWraith", 1, 263, "defeated_gdking");
					<>1__state = 291;
					return true;
				case 291:
					<>1__state = -1;
					<>2__current = new TradeItemDef("TurnipStew", 1, 297, "defeated_gdking", Category.Food);
					<>1__state = 292;
					return true;
				case 292:
					<>1__state = -1;
					<>2__current = new TradeItemDef("Wishbone", 1, 3375, "defeated_gdking");
					<>1__state = 293;
					return true;
				case 293:
					<>1__state = -1;
					<>2__current = new TradeItemDef("WitheredBone", 20, 74, "defeated_gdking");
					<>1__state = 294;
					return true;
				case 294:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ArmorBronzeChest", 1, 2704, "defeated_bonemass", Category.Armor);
					<>1__state = 295;
					return true;
				case 295:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ArmorBronzeLegs", 1, 2704, "defeated_bonemass", Category.Armor);
					<>1__state = 296;
					return true;
				case 296:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ArmorFenringChest", 1, 1485, "defeated_bonemass", Category.Armor);
					<>1__state = 297;
					return true;
				case 297:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ArmorFenringLegs", 1, 1485, "defeated_bonemass", Category.Armor);
					<>1__state = 298;
					return true;
				case 298:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ArmorIronChest", 1, 25641, "defeated_bonemass", Category.Armor);
					<>1__state = 299;
					return true;
				case 299:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ArmorIronLegs", 1, 25641, "defeated_bonemass", Category.Armor);
					<>1__state = 300;
					return true;
				case 300:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ArmorLeatherChest", 1, 445, "defeated_bonemass", Category.Armor);
					<>1__state = 301;
					return true;
				case 301:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ArmorLeatherLegs", 1, 445, "defeated_bonemass", Category.Armor);
					<>1__state = 302;
					return true;
				case 302:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ArmorRagsChest", 1, 225, "defeated_bonemass", Category.Armor);
					<>1__state = 303;
					return true;
				case 303:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ArmorRagsLegs", 1, 225, "defeated_bonemass", Category.Armor);
					<>1__state = 304;
					return true;
				case 304:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ArmorRootChest", 1, 8262, "defeated_bonemass", Category.Armor);
					<>1__state = 305;
					return true;
				case 305:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ArmorRootLegs", 1, 8262, "defeated_bonemass", Category.Armor);
					<>1__state = 306;
					return true;
				case 306:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ArmorTrollLeatherChest", 1, 1867, "defeated_bonemass", Category.Armor);
					<>1__state = 307;
					return true;
				case 307:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ArmorTrollLeatherLegs", 1, 1867, "defeated_bonemass", Category.Armor);
					<>1__state = 308;
					return true;
				case 308:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ArmorWolfChest", 1, 7551, "defeated_bonemass", Category.Armor);
					<>1__state = 309;
					return true;
				case 309:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ArmorWolfLegs", 1, 7713, "defeated_bonemass", Category.Armor);
					<>1__state = 310;
					return true;
				case 310:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ArrowFrost", 20, 945, "defeated_bonemass", Category.Ammo);
					<>1__state = 311;
					return true;
				case 311:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ArrowObsidian", 20, 667, "defeated_bonemass", Category.Ammo);
					<>1__state = 312;
					return true;
				case 312:
					<>1__state = -1;
					<>2__current = new TradeItemDef("ArrowSilver", 20, 442, "defeated_bonemass", Category.Ammo);
					<>1__state = 313;
					return true;
				case 313:
					<>1__state = -1;
					<>2__current = new TradeItemDef("AtgeirBronze", 1, 4243, "defeated_bonemass", Category.Weapons);
					<>1__state = 314;
					return true;
				case 314:
					<>1__state = -1;
					<>2__current = new TradeItemDef("AtgeirIron", 1, 37219, "defeated_bonemass", Category.Weapons);
					<>1__state = 315;
					return true;
				case 315:
					<>1__state = -1;
					<>2__current = new TradeItemDef("AtgeirWood", 1, 882, "defeated_bonemass", Category.Weapons);
					<>1__state = 316;
					return true;
				case 316:
					<>1__state = -1;
					<>2__current = new TradeItemDef("AxeBronze", 1, 3091, "defeated_bonemass", Category.Weapons);
					<>1__state = 317;
					return true;
				case 317:
					<>1__state = -1;
					<>2__current = new TradeItemDef("AxeFlint", 1, 243, "defeated_bonemass", Category.Weapons);
					<>1__state = 318;
					return true;
				case 318:
					<>1__state = -1;
					<>2__current = new TradeItemDef("AxeIron", 1, 19035, "defeated_bonemass", Category.Weapons);
					<>1__state = 319;
					return true;
				case 319:
					<>1__state = -1;
					<>2__current = new TradeItemDef("AxeStone", 1, 135, "defeated_bonemass", Category.Weapons);
					<>1__state = 320;
					return true;
				case 320:
					<>1__state = -1;
					<>2__current = new TradeItemDef("AxeWood", 1, 616, "defeated_bonemass", Category.Weapons);
					<>1__state = 321;
					return true;
				case 321:
					<>1__state = -1;
					<>2__current = new TradeItemDef("BBH_BlackForest_Bow", 1, 1089, "defeated_bonemass", Category.Weapons);
					<>1__state = 322;
					return true;
				case 322:
					<>1__state = -1;
					<>2__current = new TradeItemDef("BBH_Surtling_Bow", 1, 69786, "defeated_bonemass", Category.Weapons);
					<>1__state = 323;
					return true;
				case 323:
					<>1__state = -1;
					<>2__current = new TradeItemDef("Battleaxe", 1, 52042, "defeated_bonemass", Category.Weapons);
					<>1__state = 324;
					return true;
				case 324:
					<>1__state = -1;
					<>2__current = new TradeItemDef("BattleaxeCrystal", 1, 1706, "defeated_bonemass", Category.Weapons);
					<>1__state = 325;
					return true;
				case 325:
					<>1__state = -1;
					<>2__current = new TradeItemDef("BattleaxeWood", 1, 963, "defeated_bonemass", Category.Weapons);
					<>1__state = 326;
					return true;
				case 326:
					<>1__state = -1;
					<>2__current = new TradeItemDef("BeltStrength", 1, 2400, "defeated_bonemass", Category.Armor);
					<>1__state = 327;
					return true;
				case 327:
					<>1__state = -1;
					<>2__current = new TradeItemDef("BombBlob_Frost", 20, 390, "defeated_bonemass", Category.Ammo);
					<>1__state = 328;
					return true;
				case 328:
					<>1__state = -1;
					<>2__current = new TradeItemDef("Bow", 1, 508, "defeated_bonemass", Category.Weapons);
					<>1__state = 329;
					return true;
				case 329:
					<>1__state = -1;
					<>2__current = new TradeItemDef("BowDraugrFang", 1, 9157, "defeated_bonemass", Category.Weapons);
					<>1__state = 330;
					return true;
				case 330:
					<>1__state = -1;
					<>2__current = new TradeItemDef("BowFineW