{	
	"counters":
	[
		{
			"sid": "Counter_P1",
			"value": 0,
			"comment": "Workaround counter for setting the player to be player 1"
		},
		{
			"sid": "Counter_P1_Q1_1",
			"value": 0,
			"comment": "Counter for checking if university was visited"
		},
		{
			"sid": "Counter_P1_Q1_2",
			"value": 0,
			"comment": "Counter for checking if both gold mine and town were captured"
		},
		{
			"sid": "Counter_P2",
			"value": 0,
			"comment": "Workaround counter for setting the player to be player 2"
		},
		{
			"sid": "Counter_P2_Q1_1",
			"value": 0,
			"comment": "Counter for checking if circus was visited"
		},
		{
			"sid": "Counter_P2_Q1_2",
			"value": 0,
			"comment": "Counter for checking Infernal Cirque quest state"
		},
		{
			"sid": "Counter_P2_Q1_3",
			"value": 0,
			"comment": "Counter for checking if dragon lich dwelling was visited"
		},
		{
			"sid": "Counter_P3",
			"value": 0,
			"comment": "Workaround counter for setting the player to be player 3"
		},
		{
			"sid": "Counter_P3_Q1_1",
			"value": 0,
			"comment": "Counter for checking if tree of knowledge was visited"
		},
		{
			"sid": "Counter_P3_Q1_2",
			"value": 0,
			"comment": "Counter for checking if Lost Library was visited"
		},
		
		{
			"sid": "main_quest_finished",
			"value": 0,

			"comment": "counter for disabling sidequests when main is completed"
		}
	],

	"quests":
	[
		{
			"sid": "intro",
			"hidden": true,

			"activeOnStart": true,
			
			"sharing": "Clone",

			"comment": "intro (in dialogue checks which side player chose)",

			"subQuests":
			[	
				{
					"sid": "P1_intro",
					"activeOnStart": true,

					"triggers":
					[
						{
							"conditions":
							[
								{ "c": "StartTurn", "p": [ "1", "1" ] }
							],

							"actions":
							[	
								{ "a": "Dialog", "p": [ "vyr_Scenario1_Intro" ] }
							]
						}
					]
				}
			]
		},
		{
			"sid": "MainQuest",
			"main": true,
			"hidden": false,

			"activeOnStart": true,

			"sharing": "Clone",

			"comment": "main quest = defeat opponents + do not lose starting hero",
			
			"name": "tfp_quest_name_q1",
			"desc": "tfp_quest_desc_q1",

			"subQuests":
			[	
				{
					"sid": "MainQuest_1a",
					"activeOnStart": false,
					"name": "tfp_sub_name_q1_1",

					"triggers":
					[
						{
							"conditionsLogic": "And",
							"conditions":
							[
								{ "c": "PlayerDefeated", "p": [ "1" ] },
								{ "c": "PlayerDefeated", "p": [ "2" ] }
							],

							"actions":
							[	
								{ "a": "CurrentSubQuestDone" },
								{ "a": "SubQuestDone", "p" : [ "MainQuest", "MainQuest_2a" ]},
								{ "a": "CounterSet", "p": [ "main_quest_finished", "1" ] },
								{ "a": "GameVictory" }
							]
						}
					]
				},
				{
					"sid": "MainQuest_1b",
					"activeOnStart": false,
					"name": "tfp_sub_name_q1_1",

					"triggers":
					[
						{
							"conditionsLogic": "And",
							"conditions":
							[
								{ "c": "PlayerDefeated", "p": [ "0" ] },
								{ "c": "PlayerDefeated", "p": [ "2" ] }
							],

							"actions":
							[	
								{ "a": "CurrentSubQuestDone" },
								{ "a": "SubQuestDone", "p" : [ "MainQuest", "MainQuest_2b" ]},
								{ "a": "CounterSet", "p": [ "main_quest_finished", "1" ] },
								{ "a": "GameVictory" }
							]
						}
					]
				},
				{
					"sid": "MainQuest_1c",
					"activeOnStart": false,
					"name": "tfp_sub_name_q1_1",

					"triggers":
					[
						{
							"conditionsLogic": "And",
							"conditions":
							[
								{ "c": "PlayerDefeated", "p": [ "0" ] },
								{ "c": "PlayerDefeated", "p": [ "1" ] }
							],

							"actions":
							[	
								{ "a": "CurrentSubQuestDone" },
								{ "a": "SubQuestDone", "p" : [ "MainQuest", "MainQuest_2c" ]},
								{ "a": "CounterSet", "p": [ "main_quest_finished", "1" ] },
								{ "a": "GameVictory" }
							]
						}
					]
				},
				{
					"sid": "MainQuest_2a",
					"activeOnStart": false,
					"name": "tfp_sub_name_q1_2a",

					"triggers":
					[
						{
							"conditions":
							[
								{ "c": "HeroKill", "p": [ "dungeon_hero_6" ] }
							],

							"actions":
							[	
								{ "a": "GameLose" }
							]
						}
					]
				},
				{
					"sid": "MainQuest_2b",
					"activeOnStart": false,
					"name": "tfp_sub_name_q1_2b",

					"triggers":
					[
						{
							"conditions":
							[
								{ "c": "HeroKill", "p": [ "demon_hero_2" ] }
							],

							"actions":
							[	
								{ "a": "GameLose" }
							]
						}
					]
				},
				{
					"sid": "MainQuest_2c",
					"activeOnStart": false,
					"name": "tfp_sub_name_q1_2c",

					"triggers":
					[
						{
							"conditions":
							[
								{ "c": "HeroKill", "p": [ "nature_hero_11" ] }
							],

							"actions":
							[	
								{ "a": "GameLose" }
							]
						}
					]
				}
			]
		},
		{
			"sid": "setupQ",
			"hidden": true,

			"activeOnStart": true,

			"sharing": "Clone",

			"subQuests":
			[	
				{
					"sid": "1",
					"activeOnStart": true,

					"triggers":
					[
						{
							"conditions":
							[
								{ "c": "Counter", "p":[ "Counter_P1", "=", "1"] }
							],

							"actions":
							[	
								{ "a": "NextQuest", "p":["P1_Quest1"]},
								{ "a": "SubQuestActivate", "p":["P1_Quest1","P1_Quest1_1"]},
								{ "a": "SubQuestActivate", "p":["MainQuest","MainQuest_1a"]},
								{ "a": "SubQuestActivate", "p":["MainQuest","MainQuest_2a"]}
							]
						},
						{
							"conditions":
							[
								{ "c": "Counter", "p":[ "Counter_P2", "=", "1"] }
							],

							"actions":
							[	
								{ "a": "NextQuest", "p":["P2_Quest1"]},
								{ "a": "SubQuestActivate", "p":["P2_Quest1","P2_Quest1_1"]},
								{ "a": "SubQuestActivate", "p":["MainQuest","MainQuest_1b"]},
								{ "a": "SubQuestActivate", "p":["MainQuest","MainQuest_2b"]}
							]
						},
						{
							"conditions":
							[
								{ "c": "Counter", "p":[ "Counter_P3", "=", "1"] }
							],

							"actions":
							[	
								{ "a": "NextQuest", "p":["P3_Quest1"]},
								{ "a": "SubQuestActivate", "p":["P3_Quest1","P3_Quest1_1"]},
								{ "a": "SubQuestActivate", "p":["MainQuest","MainQuest_1c"]},
								{ "a": "SubQuestActivate", "p":["MainQuest","MainQuest_2c"]}
							]
						}
					]
				}
			]
		},

		{
			"sid": "P1_Quest1",
			"main": false,

			"comment": "Side Objective of the 1st player",
			"hidden":false,
			"activeOnStart": false,
			"sharing": "Clone",

			"name": "tfp_quest_name_q2a",
			"subQuests":
			[	
				{
					"sid": "P1_Quest1_1",
					"activeOnStart": false,
					"name": "tfp_sub_name_q2a_1",

					"triggers":
					[
						{
							"conditions":
							[
								{ "c": "Counter", "p":[ "Counter_P1_Q1_1", "=", "1"] }
							],

							"actions":
							[
								{ "a": "CurrentSubQuestDone"}
							]
						},
						{
							"conditions":
							[
								{ "c": "Counter", "p":[ "Counter_P1_Q1_1", "=", "2"] }
							],

							"actions":
							[
								{ "a": "SubQuestActivate", "p":["P1_Quest1","P1_Quest1_2a"]},
								{ "a": "SubQuestActivate", "p":["P1_Quest1","P1_Quest1_2b"]},
								
								{ "a": "SetActivePortal", "p": [ "portal_in", "true" ] }
							]
						},
						{
							"conditions":
							[
								{ "c": "Counter", "p":[ "main_quest_finished", "=", "1"] }
							],

							"actions":
							[	
								{ "a": "NextQuest" }
							]
						}
					]
				},
				{
					"sid": "P1_Quest1_2a",
					"activeOnStart": false,
					"name": "tfp_sub_name_q2a_2a",

					"triggers":
					[
						{
							"conditions":
							[
								{ "c": "ObjectCaptureEntity", "p": [ "gold_mine" ] }
							],

							"actions":
							[	
								{ "a": "CurrentSubQuestDone"},
								{ "a": "SetActiveQuestMarker", "p": [ "gold_mine", "false" ] }
							]
						},
						{
							"conditions":
							[
								{ "c": "Counter", "p":[ "Counter_P1_Q1_2", "=", "2"] }
							],

							"actions":
							[	
								{ "a": "Dialog", "p": [ "vyr_Scenario1_P1_dial2"] },
								{ "a": "GiveStatsHero","p": ["moral","dungeon_hero_6","3"] },
								{ "a": "GiveItemHero","p": ["holy_sigil_of_roph_artifact","dungeon_hero_6"] },
								{ "a": "CurrentSubQuestDone"},
								{ "a": "NextQuest"}
							]
						},
						{
							"conditions":
							[
								{ "c": "Counter", "p":[ "main_quest_finished", "=", "1"] }
							],

							"actions":
							[	
								{ "a": "NextQuest" }
							]
						}
					]
				},
				{
					"sid": "P1_Quest1_2b",
					"activeOnStart": false,
					"name": "tfp_sub_name_q2a_2b",

					"triggers":
					[
						{
							"conditions":
							[
								{ "c": "ObjectCaptureEntity", "p": [ "undead_city" ] }
							],

							"actions":
							[	
								{ "a": "CurrentSubQuestDone"},
								{ "a": "SetActiveQuestMarker", "p": [ "undead_city", "false" ] }
							]
						}
					]
				}
			]
		},

		{
			"sid": "P2_Quest1",
			"main": false,

			"comment": "Side Objective of the 2nd player",
			"hidden":false,
			"activeOnStart": false,
			"sharing": "Clone",

			"name": "tfp_quest_name_q2b",
			"subQuests":
			[	
				{
					"sid": "P2_Quest1_1",
					"activeOnStart": false,
					"name": "tfp_sub_name_q2b_1",

					"triggers":
					[
						{
							"conditions":
							[
								{ "c": "Counter", "p":[ "Counter_P2_Q1_1", "=", "1"] }
							],

							"actions":
							[	
								{ "a": "CurrentSubQuestDone"},
								{ "a": "NextSubQuest", "p":[ "P2_Quest1_2" ]}
							]
						},
						{
							"conditions":
							[
								{ "c": "Counter", "p":[ "main_quest_finished", "=", "1"] }
							],

							"actions":
							[	
								{ "a": "NextQuest" }
							]
						}
					]
				},
				{
					"sid": "P2_Quest1_2",
					"activeOnStart": false,
					"name": "tfp_sub_name_q2b_2",

					"triggers":
					[
						{
							"conditions":
							[
								{ "c": "SquadKill", "p":["InfernalCirqueHostiles"]}
							],
							"actions":
							[
								{ "a": "SetActiveQuestMarker", "p": [ "cirque", "false" ] },
								{ "a": "EntityActionsOff", "p": [ "cirque" ] },
								{ "a": "Dialog", "p": [ "vyr_Scenario1_P2_dial2"] }
							]
						},
						{
							"conditions":
							[
								{ "c": "Counter", "p":[ "Counter_P2_Q1_2", "=", "2"] }
							],

							"actions":
							[	
								{ "a": "CurrentSubQuestDone"}
							]
						},
						{
							"conditions":
							[
								{ "c": "Counter", "p":[ "Counter_P2_Q1_2", "=", "3"] }
							],

							"actions":
							[
								{ "a": "NextSubQuest", "p":[ "P2_Quest1_3" ]},
								
								{ "a": "SetActivePortal", "p": [ "portal_in", "true" ] }
							]
						},
						{
							"conditions":
							[
								{ "c": "Counter", "p":[ "main_quest_finished", "=", "1"] }
							],

							"actions":
							[	
								{ "a": "NextQuest" }
							]
						}
					]
				},
				{
					"sid": "P2_Quest1_3",
					"activeOnStart": false,
					"name": "tfp_sub_name_q2b_3",

					"triggers":
					[
						{
							"conditions":
							[
								{ "c": "Counter", "p":[ "Counter_P2_Q1_3", "=", "1"] }
							],

							"actions":
							[
								{ "a": "CurrentSubQuestDone"},
								{ "a": "NextQuest"}
							]
						},
						{
							"conditions":
							[
								{ "c": "Counter", "p":[ "main_quest_finished", "=", "1"] }
							],

							"actions":
							[	
								{ "a": "NextQuest" }
							]
						}
					]
				}
			]
		},
		{
			"sid": "P3_Quest1",
			"main": false,

			"comment": "Side Objective of the 3rd player",
			"hidden":false,
			"activeOnStart": false,
			"sharing": "Clone",

			"name": "tfp_quest_name_q2c",
			"subQuests":
			[	
				{
					"sid": "P3_Quest1_1",
					"activeOnStart": false,
					"name": "tfp_sub_name_q2c_1",

					"triggers":
					[
						{
							"conditions":
							[
								{ "c": "Counter", "p":[ "Counter_P3_Q1_1", "=", "1" ] }
							],

							"actions":
							[	
								{ "a": "CurrentSubQuestDone"}
							]
						},
						{
							"conditions":
							[
								{ "c": "Counter", "p":[ "Counter_P3_Q1_1", "=", "2" ] }
							],

							"actions":
							[
								{ "a": "NextSubQuest", "p":[ "P3_Quest1_2" ]},
								
								{ "a": "SetActivePortal", "p": [ "portal_in", "true" ] }
							]
						},
						{
							"conditions":
							[
								{ "c": "Counter", "p":[ "main_quest_finished", "=", "1" ] }
							],

							"actions":
							[	
								{ "a": "NextQuest" }
							]
						}
					]
				},
				{
					"sid": "P3_Quest1_2",
					"activeOnStart": false,
					"name": "tfp_sub_name_q2c_2",

					"triggers":
					[
						{
							"conditions":
							[
								{ "c": "Counter", "p":[ "Counter_P3_Q1_2", "=", "1"] }
							],

							"actions":
							[
								{ "a": "CurrentSubQuestDone"},
								{ "a": "NextQuest"}
							]
						},
						{
							"conditions":
							[
								{ "c": "Counter", "p":[ "main_quest_finished", "=", "1"] }
							],

							"actions":
							[	
								{ "a": "NextQuest" }
							]
						}
					]
				}
			]
		}
	]
}