Decompiled source of HailfrostExtension v1.0.0

plugins/HailfrostExtension.dll

Decompiled a month ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using NodeCanvas.DialogueTrees;
using NodeCanvas.Framework;
using NodeCanvas.Tasks.Actions;
using NodeCanvas.Tasks.Conditions;
using UnityEngine;
using UnityEngine.SceneManagement;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("OutwardModTemplate")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("OutwardModTemplate")]
[assembly: AssemblyCopyright("Copyright ©  2021")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("c5450fe0-edcf-483f-b9ea-4b1ef9d36da7")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace HailfrostExtension;

[BepInPlugin("johbenji.hailfrostextension", "Hailfrost Extension", "1.0.0")]
public class HailfrostExtensionPlugin : BaseUnityPlugin
{
	public class RemoveItemTask : ActionTask
	{
		public int Amount;

		public int ItemID;

		public RemoveItemTask(int amount, int itemID)
		{
			Amount = amount;
			ItemID = itemID;
		}

		public override void OnExecute()
		{
			Character value = ((Task)this).blackboard.GetVariable<Character>("gInstigator").GetValue();
			if (Object.op_Implicit((Object)(object)value))
			{
				if (ItemID == 9000010)
				{
					value.Inventory.RemoveMoney(Amount, false);
				}
				else
				{
					value.Inventory.RemoveItem(ItemID, Amount);
				}
				((ActionTask)this).EndAction(true);
			}
			((ActionTask)this).EndAction(false);
		}
	}

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

		private object <>2__current;

		public HailfrostExtensionPlugin <>4__this;

		private GameObject <blacksmithDialogue>5__1;

		private DialogueTreeController <dialogueTreeController>5__2;

		private DialogueTreeExt <blacksmithGraph>5__3;

		private MultipleChoiceNodeExt <moddedWeaponsSelectionNode>5__4;

		private MultipleChoiceNodeExt <blacksmithSelectTypeOrModdedItem>5__5;

		private Statement <statementBlacksmithSelectTypeOrModdedItem>5__6;

		private List<Choice> <newHailFrostWeaponChoices>5__7;

		private Statement <statementBow>5__8;

		private Statement <statementChakram>5__9;

		private Statement <statementShield>5__10;

		private Statement <statementNo>5__11;

		private FinishNode <finishNode>5__12;

		private StatementNodeExt <materialsMissingNode>5__13;

		private ConditionNode <checkBowConditionNode>5__14;

		private ConditionNode <checkChakramConditionNode>5__15;

		private ConditionNode <checkShieldConditionNode>5__16;

		private ActionNode <giveBowActionNode>5__17;

		private ActionNode <giveChakramActionNode>5__18;

		private ActionNode <giveShieldActionNode>5__19;

		private ActionNode <removeBowActionNode>5__20;

		private ActionNode <removeChakramActionNode>5__21;

		private ActionNode <removeShieldActionNode>5__22;

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

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

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

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<blacksmithDialogue>5__1 = null;
			<dialogueTreeController>5__2 = null;
			<blacksmithGraph>5__3 = null;
			<moddedWeaponsSelectionNode>5__4 = null;
			<blacksmithSelectTypeOrModdedItem>5__5 = null;
			<statementBlacksmithSelectTypeOrModdedItem>5__6 = null;
			<newHailFrostWeaponChoices>5__7 = null;
			<statementBow>5__8 = null;
			<statementChakram>5__9 = null;
			<statementShield>5__10 = null;
			<statementNo>5__11 = null;
			<finishNode>5__12 = null;
			<materialsMissingNode>5__13 = null;
			<checkBowConditionNode>5__14 = null;
			<checkChakramConditionNode>5__15 = null;
			<checkShieldConditionNode>5__16 = null;
			<giveBowActionNode>5__17 = null;
			<giveChakramActionNode>5__18 = null;
			<giveShieldActionNode>5__19 = null;
			<removeBowActionNode>5__20 = null;
			<removeChakramActionNode>5__21 = null;
			<removeShieldActionNode>5__22 = null;
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Expected O, but got Unknown
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Expected O, but got Unknown
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Expected O, but got Unknown
			//IL_01bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e3: Expected O, but got Unknown
			//IL_0205: Unknown result type (might be due to invalid IL or missing references)
			//IL_020a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0211: Unknown result type (might be due to invalid IL or missing references)
			//IL_0218: Unknown result type (might be due to invalid IL or missing references)
			//IL_0229: Expected O, but got Unknown
			//IL_024b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0250: Unknown result type (might be due to invalid IL or missing references)
			//IL_0257: 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_026f: Expected O, but got Unknown
			//IL_0291: Unknown result type (might be due to invalid IL or missing references)
			//IL_0296: Unknown result type (might be due to invalid IL or missing references)
			//IL_029d: 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_02b5: Expected O, but got Unknown
			//IL_02c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d3: Expected O, but got Unknown
			//IL_02e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f0: Expected O, but got Unknown
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				<>2__current = (object)new WaitForSeconds(5f);
				<>1__state = 1;
				return true;
			case 1:
				<>1__state = -1;
				<blacksmithDialogue>5__1 = GameObject.Find("Building/BuildingVisual/prf_env_bld_BaseBuild_Blacksmith_A/5-Upgrade_B/UNPC_DLC2_BlacksmithStore/BlacksmithMerchant_Dialog/NPC/ShopDialogue");
				if ((Object)(object)<blacksmithDialogue>5__1 != (Object)null)
				{
					<dialogueTreeController>5__2 = <blacksmithDialogue>5__1.GetComponent<DialogueTreeController>();
					if ((Object)(object)<dialogueTreeController>5__2 != (Object)null)
					{
						<blacksmithGraph>5__3 = ((GraphOwner<DialogueTreeExt>)(object)<dialogueTreeController>5__2)._graph;
						if ((Object)(object)<blacksmithGraph>5__3 != (Object)null)
						{
							<moddedWeaponsSelectionNode>5__4 = ((Graph)<blacksmithGraph>5__3).AddNode<MultipleChoiceNodeExt>();
							<blacksmithSelectTypeOrModdedItem>5__5 = (MultipleChoiceNodeExt)((Graph)<blacksmithGraph>5__3)._nodes[12];
							<statementBlacksmithSelectTypeOrModdedItem>5__6 = <>4__this.getStatement("I want a weapon from your extended weaponry.");
							<blacksmithSelectTypeOrModdedItem>5__5.availableChoices.Add(new Choice
							{
								condition = null,
								isUnfolded = true,
								statement = <statementBlacksmithSelectTypeOrModdedItem>5__6
							});
							((Graph)<blacksmithGraph>5__3).ConnectNodes(((Graph)<blacksmithGraph>5__3)._nodes[12], (Node)(object)<moddedWeaponsSelectionNode>5__4, 3, -1);
							<newHailFrostWeaponChoices>5__7 = new List<Choice>();
							<moddedWeaponsSelectionNode>5__4.availableChoices = <newHailFrostWeaponChoices>5__7;
							<moddedWeaponsSelectionNode>5__4.availableTime = 0f;
							<moddedWeaponsSelectionNode>5__4.isWaitingChoice = false;
							<moddedWeaponsSelectionNode>5__4.saySelection = false;
							((Node)<moddedWeaponsSelectionNode>5__4).graph = (Graph)(object)<blacksmithGraph>5__3;
							<statementBow>5__8 = <>4__this.getStatement("Hailfrost Bow - Militia Bow + Cold Stone + 300 Silver");
							<moddedWeaponsSelectionNode>5__4.availableChoices.Add(new Choice
							{
								condition = null,
								isUnfolded = true,
								statement = <statementBow>5__8
							});
							<statementChakram>5__9 = <>4__this.getStatement("Hailfrost Chakram - Militia Chakram + Cold Stone + 150 Silver");
							<moddedWeaponsSelectionNode>5__4.availableChoices.Add(new Choice
							{
								condition = null,
								isUnfolded = true,
								statement = <statementChakram>5__9
							});
							<statementShield>5__10 = <>4__this.getStatement("Hailfrost Shield - Militia Shield + Cold Stone + 150 Silver");
							<moddedWeaponsSelectionNode>5__4.availableChoices.Add(new Choice
							{
								condition = null,
								isUnfolded = true,
								statement = <statementShield>5__10
							});
							<statementNo>5__11 = <>4__this.getStatement("No, thanks.");
							<moddedWeaponsSelectionNode>5__4.availableChoices.Add(new Choice
							{
								condition = null,
								isUnfolded = true,
								statement = <statementNo>5__11
							});
							<finishNode>5__12 = (FinishNode)((Graph)<blacksmithGraph>5__3)._nodes[64];
							<materialsMissingNode>5__13 = (StatementNodeExt)((Graph)<blacksmithGraph>5__3)._nodes[63];
							<checkBowConditionNode>5__14 = <>4__this.AddConditionRemoveItemsNode(<blacksmithGraph>5__3, 2200150, 300);
							<checkChakramConditionNode>5__15 = <>4__this.AddConditionRemoveItemsNode(<blacksmithGraph>5__3, 5110106, 150);
							<checkShieldConditionNode>5__16 = <>4__this.AddConditionRemoveItemsNode(<blacksmithGraph>5__3, 2300350, 150);
							<giveBowActionNode>5__17 = <>4__this.AddActionGiveItemNode(<blacksmithGraph>5__3, 2200160);
							<giveChakramActionNode>5__18 = <>4__this.AddActionGiveItemNode(<blacksmithGraph>5__3, 5110103);
							<giveShieldActionNode>5__19 = <>4__this.AddActionGiveItemNode(<blacksmithGraph>5__3, 2300330);
							<removeBowActionNode>5__20 = <>4__this.AddActionRemoveItemsNode(<blacksmithGraph>5__3, 2200150, 300);
							<removeChakramActionNode>5__21 = <>4__this.AddActionRemoveItemsNode(<blacksmithGraph>5__3, 5110106, 150);
							<removeShieldActionNode>5__22 = <>4__this.AddActionRemoveItemsNode(<blacksmithGraph>5__3, 2300350, 150);
							((Graph)<blacksmithGraph>5__3).ConnectNodes((Node)(object)<moddedWeaponsSelectionNode>5__4, (Node)(object)<checkBowConditionNode>5__14, 0, 0);
							((Graph)<blacksmithGraph>5__3).ConnectNodes((Node)(object)<moddedWeaponsSelectionNode>5__4, (Node)(object)<checkChakramConditionNode>5__15, 1, 0);
							((Graph)<blacksmithGraph>5__3).ConnectNodes((Node)(object)<moddedWeaponsSelectionNode>5__4, (Node)(object)<checkShieldConditionNode>5__16, 2, 0);
							((Graph)<blacksmithGraph>5__3).ConnectNodes((Node)(object)<checkBowConditionNode>5__14, (Node)(object)<giveBowActionNode>5__17, 0, 0);
							((Graph)<blacksmithGraph>5__3).ConnectNodes((Node)(object)<checkChakramConditionNode>5__15, (Node)(object)<giveChakramActionNode>5__18, 0, 0);
							((Graph)<blacksmithGraph>5__3).ConnectNodes((Node)(object)<checkShieldConditionNode>5__16, (Node)(object)<giveShieldActionNode>5__19, 0, 0);
							((Graph)<blacksmithGraph>5__3).ConnectNodes((Node)(object)<checkBowConditionNode>5__14, (Node)(object)<materialsMissingNode>5__13, 1, 0);
							((Graph)<blacksmithGraph>5__3).ConnectNodes((Node)(object)<checkChakramConditionNode>5__15, (Node)(object)<materialsMissingNode>5__13, 1, 0);
							((Graph)<blacksmithGraph>5__3).ConnectNodes((Node)(object)<checkShieldConditionNode>5__16, (Node)(object)<materialsMissingNode>5__13, 1, 0);
							((Graph)<blacksmithGraph>5__3).ConnectNodes((Node)(object)<giveBowActionNode>5__17, (Node)(object)<removeBowActionNode>5__20, 0, 0);
							((Graph)<blacksmithGraph>5__3).ConnectNodes((Node)(object)<giveChakramActionNode>5__18, (Node)(object)<removeChakramActionNode>5__21, 0, 0);
							((Graph)<blacksmithGraph>5__3).ConnectNodes((Node)(object)<giveShieldActionNode>5__19, (Node)(object)<removeShieldActionNode>5__22, 0, 0);
							((Graph)<blacksmithGraph>5__3).ConnectNodes((Node)(object)<removeBowActionNode>5__20, (Node)(object)<finishNode>5__12, 0, -1);
							((Graph)<blacksmithGraph>5__3).ConnectNodes((Node)(object)<removeChakramActionNode>5__21, (Node)(object)<finishNode>5__12, 0, -1);
							((Graph)<blacksmithGraph>5__3).ConnectNodes((Node)(object)<removeShieldActionNode>5__22, (Node)(object)<finishNode>5__12, 0, -1);
							((Graph)<blacksmithGraph>5__3).ConnectNodes((Node)(object)<moddedWeaponsSelectionNode>5__4, (Node)(object)<finishNode>5__12, 3, -1);
							((Graph)<blacksmithGraph>5__3).UpdateNodeIDs(false);
							<moddedWeaponsSelectionNode>5__4 = null;
							<blacksmithSelectTypeOrModdedItem>5__5 = null;
							<statementBlacksmithSelectTypeOrModdedItem>5__6 = null;
							<newHailFrostWeaponChoices>5__7 = null;
							<statementBow>5__8 = null;
							<statementChakram>5__9 = null;
							<statementShield>5__10 = null;
							<statementNo>5__11 = null;
							<finishNode>5__12 = null;
							<materialsMissingNode>5__13 = null;
							<checkBowConditionNode>5__14 = null;
							<checkChakramConditionNode>5__15 = null;
							<checkShieldConditionNode>5__16 = null;
							<giveBowActionNode>5__17 = null;
							<giveChakramActionNode>5__18 = null;
							<giveShieldActionNode>5__19 = null;
							<removeBowActionNode>5__20 = null;
							<removeChakramActionNode>5__21 = null;
							<removeShieldActionNode>5__22 = null;
						}
						else
						{
							Log.LogMessage((object)"Blacksmith graph not found");
						}
						<blacksmithGraph>5__3 = null;
					}
					else
					{
						Log.LogMessage((object)"Blacksmith dialogue tree controller not found");
					}
					<dialogueTreeController>5__2 = null;
				}
				return false;
			}
		}

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

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

	public const string GUID = "johbenji.hailfrostextension";

	public const string NAME = "Hailfrost Extension";

	public const string VERSION = "1.0.0";

	internal static ManualLogSource Log;

	public List<string> validScenes = new List<string>();

	public static HailfrostExtensionPlugin Instance { get; private set; }

	internal void Awake()
	{
		//IL_002a: Unknown result type (might be due to invalid IL or missing references)
		Instance = this;
		Log = ((BaseUnityPlugin)this).Logger;
		SceneManager.sceneLoaded += SceneManager_sceneLoaded;
		new Harmony("johbenji.hailfrostextension").PatchAll();
		AppendValidScenes();
	}

	private void AppendValidScenes()
	{
		validScenes.Add("CierzoTutorial");
		validScenes.Add("CierzoNewTerrain");
		validScenes.Add("CierzoDestroyed");
		validScenes.Add("ChersoneseNewTerrain");
		validScenes.Add("Chersonese_Dungeon1");
		validScenes.Add("Chersonese_Dungeon2");
		validScenes.Add("Chersonese_Dungeon3");
		validScenes.Add("Chersonese_Dungeon4_BlueChamber");
		validScenes.Add("Chersonese_Dungeon4_CommonPath");
		validScenes.Add("Chersonese_Dungeon4_HolyMission");
		validScenes.Add("Chersonese_Dungeon4_Levant");
		validScenes.Add("Chersonese_Dungeon5");
		validScenes.Add("Chersonese_Dungeon6");
		validScenes.Add("Chersonese_Dungeon7");
		validScenes.Add("Chersonese_Dungeon8");
		validScenes.Add("Chersonese_Dungeon9");
		validScenes.Add("ChersoneseDungeonsSmall");
		validScenes.Add("ChersoneseDungeonsBosses");
		validScenes.Add("Levant");
		validScenes.Add("Abrassar");
		validScenes.Add("Abrassar_Dungeon1");
		validScenes.Add("Abrassar_Dungeon2");
		validScenes.Add("Abrassar_Dungeon3");
		validScenes.Add("Abrassar_Dungeon4");
		validScenes.Add("Abrassar_Dungeon5");
		validScenes.Add("Abrassar_Dungeon6");
		validScenes.Add("AbrassarDungeonsBosses");
		validScenes.Add("AbrassarDungeonsSmall");
		validScenes.Add("Harmattan");
		validScenes.Add("AntiqueField");
		validScenes.Add("AntiqueField_Dungeon1");
		validScenes.Add("AntiqueField_Dungeon2");
		validScenes.Add("AntiqueField_Dungeon3");
		validScenes.Add("AntiqueField_Dungeon4");
		validScenes.Add("AntiqueField_Dungeon5");
		validScenes.Add("AntiqueField_Dungeon6");
		validScenes.Add("AntiqueField_Dungeon7");
		validScenes.Add("AntiqueField_Dungeon8");
		validScenes.Add("AntiqueField_Dungeon9");
		validScenes.Add("AntiqueFieldDungeonsBosses");
		validScenes.Add("AntiqueFieldDungeonsSmall");
		validScenes.Add("Berg");
		validScenes.Add("Emercar");
		validScenes.Add("Emercar_Dungeon1");
		validScenes.Add("Emercar_Dungeon2");
		validScenes.Add("Emercar_Dungeon3");
		validScenes.Add("Emercar_Dungeon4");
		validScenes.Add("Emercar_Dungeon5");
		validScenes.Add("Emercar_Dungeon6");
		validScenes.Add("EmercarDungeonsBosses");
		validScenes.Add("EmercarDungeonsSmall");
		validScenes.Add("Monsoon");
		validScenes.Add("HallowedMarshNewTerrain");
		validScenes.Add("Hallowed_Dungeon1");
		validScenes.Add("Hallowed_Dungeon2");
		validScenes.Add("Hallowed_Dungeon3");
		validScenes.Add("Hallowed_Dungeon4_Interior");
		validScenes.Add("Hallowed_Dungeon5");
		validScenes.Add("Hallowed_Dungeon6");
		validScenes.Add("Hallowed_Dungeon7");
		validScenes.Add("HallowedDungeonsBosses");
		validScenes.Add("HallowedDungeonsSmall");
		validScenes.Add("NewSirocco");
		validScenes.Add("Caldera");
		validScenes.Add("Caldera_Dungeon1");
		validScenes.Add("Caldera_Dungeon2");
		validScenes.Add("Caldera_Dungeon3");
		validScenes.Add("Caldera_Dungeon4");
		validScenes.Add("Caldera_Dungeon5");
		validScenes.Add("Caldera_Dungeon6");
		validScenes.Add("Caldera_Dungeon7");
		validScenes.Add("Caldera_Dungeon8");
		validScenes.Add("Caldera_Dungeon9");
		validScenes.Add("Caldera_Dungeon10");
		validScenes.Add("CalderaDungeonsBosses");
		validScenes.Add("CalderaDungeonsSmall");
		validScenes.Add("DreamWorld");
	}

	internal void SceneManager_sceneLoaded(Scene Scene, LoadSceneMode LoadMode)
	{
		Log.LogMessage((object)("SceneManager loading " + ((Scene)(ref Scene)).name));
		if (validScenes.Contains(((Scene)(ref Scene)).name))
		{
			((MonoBehaviour)Instance).StartCoroutine(BlackSmithEditor());
		}
	}

	[IteratorStateMachine(typeof(<BlackSmithEditor>d__12))]
	public IEnumerator BlackSmithEditor()
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <BlackSmithEditor>d__12(0)
		{
			<>4__this = this
		};
	}

	private ActionNode AddActionGiveItemNode(DialogueTreeExt dialogueTree, int itemID)
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_000e: Expected O, but got Unknown
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		//IL_0025: Unknown result type (might be due to invalid IL or missing references)
		//IL_002b: Expected O, but got Unknown
		//IL_0031: Unknown result type (might be due to invalid IL or missing references)
		//IL_0038: Expected O, but got Unknown
		//IL_0048: Unknown result type (might be due to invalid IL or missing references)
		//IL_004f: Expected O, but got Unknown
		ActionNode val = ((Graph)dialogueTree).AddNode<ActionNode>();
		ActionList val2 = new ActionList();
		((Task)val2).ownerSystem = (ITaskSystem)(object)dialogueTree;
		val2.executionMode = (ActionsExecutionMode)0;
		val.action = (ActionTask)(object)val2;
		GiveReward val3 = new GiveReward();
		List<ItemQuantity> list = new List<ItemQuantity>();
		ItemQuantity val4 = new ItemQuantity();
		list.Add(val4);
		BBParameter<ItemReference> val5 = new BBParameter<ItemReference>();
		ItemReference val6 = new ItemReference();
		val6.ItemID = itemID;
		val5.value = val6;
		BBParameter<int> val7 = new BBParameter<int>();
		val7.value = 1;
		BBParameter<bool> val8 = new BBParameter<bool>();
		val8.value = false;
		val4.Item = val5;
		val4.Quantity = val7;
		val4.TryToEquip = val8;
		val3.ItemReward = list;
		val2.AddAction((ActionTask)(object)val3);
		return val;
	}

	private ActionNode AddActionRemoveItemsNode(DialogueTreeExt dialogueTree, int itemID, int silverAmount)
	{
		//IL_0010: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: Expected O, but got Unknown
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		ActionNode val = ((Graph)dialogueTree).AddNode<ActionNode>();
		((Node)val).graph = (Graph)(object)dialogueTree;
		ActionList val2 = new ActionList();
		((Task)val2).ownerSystem = (ITaskSystem)(object)dialogueTree;
		val2.executionMode = (ActionsExecutionMode)0;
		val.action = (ActionTask)(object)val2;
		RemoveItemTask removeItemTask = new RemoveItemTask(1, itemID);
		RemoveItemTask removeItemTask2 = new RemoveItemTask(1, 6500020);
		RemoveItemTask removeItemTask3 = new RemoveItemTask(silverAmount, 9000010);
		val2.AddAction((ActionTask)(object)removeItemTask);
		val2.AddAction((ActionTask)(object)removeItemTask2);
		val2.AddAction((ActionTask)(object)removeItemTask3);
		return val;
	}

	private ConditionNode AddConditionRemoveItemsNode(DialogueTreeExt dialogueTree, int itemID, int silverAmount)
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_000e: Expected O, but got Unknown
		//IL_0010: Unknown result type (might be due to invalid IL or missing references)
		ConditionNode val = ((Graph)dialogueTree).AddNode<ConditionNode>();
		ConditionList val2 = new ConditionList();
		val2.checkMode = (ConditionsCheckMode)0;
		((ConditionTask)val2).invert = false;
		((Task)val2).ownerSystem = (ITaskSystem)(object)dialogueTree;
		val.condition = (ConditionTask)(object)val2;
		Condition_OwnsItem val3 = checkItem(itemID, 1);
		Condition_OwnsItem val4 = checkItem(6500020, 1);
		Condition_OwnsItem val5 = checkItem(9000010, silverAmount);
		val2.AddCondition((ConditionTask)(object)val3);
		val2.AddCondition((ConditionTask)(object)val4);
		val2.AddCondition((ConditionTask)(object)val5);
		return val;
	}

	private Statement getStatement(string text)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Expected O, but got Unknown
		Statement val = new Statement();
		val.audio = (Sounds)0;
		val.meta = "";
		val.text = text;
		return val;
	}

	private Condition_OwnsItem checkItem(int itemID, int amount)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Expected O, but got Unknown
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0013: Expected O, but got Unknown
		Condition_OwnsItem val = new Condition_OwnsItem();
		BBParameter<ItemReference> val2 = new BBParameter<ItemReference>();
		ItemReference val3 = new ItemReference();
		val3.ItemID = itemID;
		val2.value = val3;
		BBParameter<bool> val4 = new BBParameter<bool>();
		val4.value = false;
		BBParameter<int> val5 = new BBParameter<int>();
		val5.value = amount;
		val.item = val2;
		val.itemMustBeEquiped = val4;
		val.minAmount = val5;
		val.character = new BBParameter<Character>();
		return val;
	}
}