﻿{
	"counters":
	[
		{
			"sid": "starting_side",
			"value": 0,

			"comment": "0 - игрок начал за людей, 1 - игрок начал за некромантов"
		},

		{
			"sid": "main_quest",
			"value": 0,

			"comment": "1 = квест начат"
		},

		{
			"sid": "opponent_defeated",
			"value": 0,

			"comment": "0 = враг не выполнен, 1 = враг побежден"
		},
		{
			"sid": "graverobber_quest",
			"value": 0,

			"comment": "0 = еще не встречался с гробовщиком, 1 = выбрал воскрешать разведчицу, 2 = выбрал документы, но еще не выкрал, 3 = уже выкрал бумаги, 4 = принес артефакт, возрождение начинается, 5 = отказался помогать, квест закончен"
		},
		{
			"sid": "scout_found",
			"value": 0,

			"comment": "1 = игрок нашел тело разведчицы"
		},
		{
			"sid": "scout_resurrection",
			"value": 0,

			"comment": "1 = начинается воскрешение разведчицы"
		},
		{
			"sid": "scout_quest_finished",
			"value": 0,

			"comment": "0 = квест не выполнен, 1 = квест выполнен"
		},
		
		{
			"sid": "priestess_quest",
			"value": 0,

			"comment": "0 = квест не начат, 1 = квест начат; 2 = квест провален, игрок помогает некромантам; 3 = освободил жриц; 4 = квест закончен; "
		},
		{
			"sid": "abbey_plundered",
			"value": 0,

			"comment": "вспомогательный бинарный счетчик, разграбил ли игрок аббатство"
		},
		{
			"sid": "undead_guard_attacked",
			"value": 0,

			"comment": "вспомогательный бинарный счетчик, инициировал ли игрок бой с охраной алтаря"
		},
		{
			"sid": "altar_previously_visited",
			"value": 0,

			"comment": "вспомогательный бинарный счетчик для воспроизведения укороченного диалога на алтаре при повторном посещении без принятия квеста"
		},
		{
			"sid": "sacrifice_quest",
			"value": 0,

			"comment": "перекрывающий квест, если согласился помочь некромантам совершить ритуал; 0 = квест не начат, 1 = в процессе, 2 = жрицы пойманы; 3 = жрицы отданы некромантам; 4 = квест завершен"
		},
		{
			"sid": "shard_counter",
			"value": 0,

			"comment": "0 = игрок не встречал shard of serenity, 1 = встречал, но не собрал, 2 = собрал"
		},

		{
			"sid": "pixie_quest",
			"value": 0,

			"comment": "0 - квест не начат; 1 - свиток №1; 2 - свиток №2; 3 - свиток №3; 4 - свиток №4; 5 - квест выполнен; 6 - квест провален"
		},
		{
			"sid": "pixie_tricked",
			"value": 0,

			"comment": "вспомогательный счетчик, сколько раз игрок удалил свиток"
		},

		{
			"sid": "conscription_quest",
			"value": 0,

			"comment": "квест с призывом Q7: 0 - не начат, 1 - в процессе, 2 - завершен/провален"
		},
		{
			"sid": "villages_visited",

			"comment": "вспомогательный каунтер Q7 - счетчик посещенных деревень"
		},
		{
			"sid": "healing_quest",
			"value": 0,

			"comment": "вспомогательный квест по лечению деревни внутри Q7: 0 - не начат, 1 - в процессе, 2 - завершен/провален"
		},
		{
			"sid": "item_quest",
			"value": 0,

			"comment": "счетчик того что игрок рядом с артефактом для пропуска хода, 0 = далеко от артефакта, 1 = рядом, 2 = квест окончен"
		}
	],

	"interruptions":
	[
		{
			"sid": "fight_1a",
			"interruption": "BeforeIamVsHero",
			"activeOnStart": true,
			"p": [ "campaign_M3_hero_undead" ],

			"actions":
			[
				{ "a": "Dialog", "p": [ "M3aQ1_dial2" ] },
				{ "a": "DisableInterruption", "p": [ "fight_1a" ] },
				{ "a": "EnableInterruption", "p": [ "fight_2a" ] }
			]
		},
		{
			"sid": "fight_2a",
			"interruption": "BeforeIamVsHero",
			"p": [ "campaign_M3_hero_undead" ],

			"actions":
			[
				{ "a": "Dialog", "p": [ "M3aQ1_dial3" ] },
				{ "a": "DisableInterruption", "p": [ "fight_2a" ] }
			]
		},
		{
			"sid": "fight_1b",
			"interruption": "BeforeIamVsHero",
			"activeOnStart": true,
			"p": [ "campaign_M3_hero_temple" ],

			"actions":
			[
				{ "a": "Dialog", "p": [ "M3bQ1_dial2" ] },
				{ "a": "DisableInterruption", "p": [ "fight_1b" ] },
				{ "a": "EnableInterruption", "p": [ "fight_2b" ] }
			]
		},
		{
			"sid": "fight_2b",
			"interruption": "BeforeIamVsHero",
			"p": [ "campaign_M3_hero_temple" ],

			"actions":
			[
				{ "a": "Dialog", "p": [ "M3bQ1_dial3" ] },
				{ "a": "DisableInterruption", "p": [ "fight_2b" ] }
			]
		}
	],

	"quests":
	[
		{
			"sid": "intro",
			"hidden": true,

			"comment": "intro",

			"activeOnStart": true,
			"sharing": "Clone",

			"name": "1",

			"subQuests":
			[	
				{
					"sid": "1",
					"activeOnStart": true,

					"triggers":
					[
						{
							"conditions":
							[
								{ "c": "StartTurn", "p": [ "1", "1" ] }
							],

							"actions":
							[
								{ "a": "CounterSet", "p": [ "starting_side", "0" ] },
								{ "a": "Dialog", "p": [ "M3aQ1_dial1" ] },

								{ "a": "CreateVFX", "p": [ "fx_quest_mark_gold_01", "2643", "false", "true", "qm_scout" ] },
								{ "a": "SetQuestMarker", "p": [ "deathknight", "effects/global_map/quest_mark_silver_01" ] },
								{ "a": "SetQuestMarker", "p": [ "colonel", "effects/global_map/quest_mark_silver_01" ] },
								{ "a": "SetQuestMarker", "p": [ "priestess", "effects/global_map/quest_mark_silver_01" ] },
								{ "a": "SetQuestMarker", "p": [ "sacrificial_altar", "effects/global_map/quest_mark_silver_01" ] },
								{ "a": "SetQuestMarker", "p": [ "spy", "effects/global_map/quest_mark_silver_01" ] },

								{ "a": "AiBanArea", "p": [ "669" ] },
								{ "a": "AiBanArea", "p": [ "160" ] },
								{ "a": "AiBanArea", "p": [ "2080" ] },
								{ "a": "AiBanArea", "p": [ "2645" ] },
								{ "a": "AiBanArea", "p": [ "3401" ] },
								{ "a": "AiSetStartAreas", "p": [ ] }
							]
						}
					]
				},
				{
					"sid": "2",
					"activeOnStart": true,
					"comment": "difficulty settings",

					"triggers":
					[
						{
							"conditionsLogic": "And",

							"conditions":
							[
								{ "c": "StartTurn", "p": [ "1", "1" ] },
								{ "c": "Difficulty", "p": [ "0" ] }
							],

							"actions":
							[
								{ "a": "AddBuffHeroDays", "p": [ "campaign_heroStatBuff_easy_enemy", "campaign_M3_hero_undead", "-1" ] },
								{ "a": "AddBuffHeroDays", "p": [ "campaign_heroStatBuff_easy_2", "campaign_hero_1", "-1" ] }
							]
						},
						{
							"conditionsLogic": "And",

							"conditions":
							[
								{ "c": "StartTurn", "p": [ "1", "1" ] },
								{ "c": "Difficulty", "p": [ "1" ] }
							],

							"actions":
							[
								{ "a": "GiveUnitHero", "p": [ "skeleton",		"10",	"campaign_M3_hero_undead" ] },
								{ "a": "GiveUnitHero", "p": [ "flicker",		"5",	"campaign_M3_hero_undead" ] },
								{ "a": "GiveUnitHero", "p": [ "pet",			"4",	"campaign_M3_hero_undead" ] },
								{ "a": "AddBuffHeroDays", "p": [ "campaign_heroStatBuff_easy_enemy_half", "campaign_M3_hero_undead", "-1" ] },
								{ "a": "AddSkillHero", "p": [ "skill_siege", "campaign_M3_hero_undead" ] },

								{ "a": "CreateBuildingCity", "p": [ "Build_Wall", "1", "enemy_city" ] }
							]
						},
						{
							"conditionsLogic": "And",

							"conditions":
							[
								{ "c": "StartTurn", "p": [ "1", "1" ] },
								{ "c": "Difficulty", "p": [ "2" ] }
							],

							"actions":
							[
								{ "a": "GiveUnitHero", "p": [ "skeleton",		"20",	"campaign_M3_hero_undead" ] },
								{ "a": "GiveUnitHero", "p": [ "flicker",		"10",	"campaign_M3_hero_undead" ] },
								{ "a": "GiveUnitHero", "p": [ "pet",			"8",	"campaign_M3_hero_undead" ] },
								{ "a": "AddBuffHeroDays", "p": [ "campaign_heroStatBuff_magic_night_1", "campaign_M3_hero_undead", "9999" ] },
								{ "a": "AddBuffHeroDays", "p": [ "campaign_heroStatBuff_campaign_M3_hero_undead_1", "campaign_M3_hero_undead", "9999" ] },
								{ "a": "AddSkillHero", "p": [ "skill_siege", "campaign_M3_hero_undead" ] },
								{ "a": "AddSkillHero", "p": [ "skill_siege", "campaign_M3_hero_undead" ] },

								{ "a": "CreateBuildingCity", "p": [ "Build_Wall", "1", "enemy_city" ] },
								{ "a": "CreateBuildingCity", "p": [ "Build_Wall", "2", "enemy_city" ] },

								{ "a": "GiveStatsHero", "p": [ "offence", "campaign_M3_hero_undead", "1" ] },
								{ "a": "GiveStatsHero", "p": [ "defence", "campaign_M3_hero_undead", "1" ] },
								{ "a": "GiveStatsHero", "p": [ "spellPower", "campaign_M3_hero_undead", "1" ] },
								{ "a": "GiveStatsHero", "p": [ "intelligence", "campaign_M3_hero_undead", "1" ] },

								{ "a": "CreateBuildingCity", "p": [ "Build_Tier_1", "2", "enemy_city" ] },
								{ "a": "CreateBuildingCity", "p": [ "Build_Tier_2", "1", "enemy_city" ] },
								{ "a": "CreateBuildingCity", "p": [ "Build_Tier_3", "1", "enemy_city" ] }
							]
						},
						{
							"conditionsLogic": "And",

							"conditions":
							[
								{ "c": "StartTurn", "p": [ "1", "1" ] },
								{ "c": "Difficulty", "p": [ "3" ] }
							],

							"actions":
							[
								{ "a": "GiveUnitHero", "p": [ "skeleton",		"30",	"campaign_M3_hero_undead" ] },
								{ "a": "GiveUnitHero", "p": [ "flicker",		"15",	"campaign_M3_hero_undead" ] },
								{ "a": "GiveUnitHero", "p": [ "pet",			"12",	"campaign_M3_hero_undead" ] },
								{ "a": "AddBuffHeroDays", "p": [ "campaign_heroStatBuff_magic_night_2", "campaign_M3_hero_undead", "9999" ] },
								{ "a": "AddBuffHeroDays", "p": [ "campaign_heroStatBuff_campaign_M3_hero_undead_2", "campaign_M3_hero_undead", "9999" ] },
								{ "a": "AddSkillHero", "p": [ "skill_siege", "campaign_M3_hero_undead" ] },
								{ "a": "AddSkillHero", "p": [ "skill_siege", "campaign_M3_hero_undead" ] },
								{ "a": "AddSkillHero", "p": [ "skill_siege", "campaign_M3_hero_undead" ] },

								{ "a": "GiveStatsHero", "p": [ "offence", "campaign_M3_hero_undead", "2" ] },
								{ "a": "GiveStatsHero", "p": [ "defence", "campaign_M3_hero_undead", "2" ] },
								{ "a": "GiveStatsHero", "p": [ "spellPower", "campaign_M3_hero_undead", "2" ] },
								{ "a": "GiveStatsHero", "p": [ "intelligence", "campaign_M3_hero_undead", "2" ] },

								{ "a": "CreateBuildingCity", "p": [ "Build_Wall", "1", "enemy_city" ] },
								{ "a": "CreateBuildingCity", "p": [ "Build_Wall", "2", "enemy_city" ] },
								{ "a": "CreateBuildingCity", "p": [ "Build_Wall", "3", "enemy_city" ] },

								{ "a": "CreateBuildingCity", "p": [ "Build_Tier_1", "2", "enemy_city" ] },
								{ "a": "CreateBuildingCity", "p": [ "Build_Tier_2", "2", "enemy_city" ] },
								{ "a": "CreateBuildingCity", "p": [ "Build_Tier_3", "2", "enemy_city" ] },
								{ "a": "CreateBuildingCity", "p": [ "Build_Tier_4", "1", "enemy_city" ] }
							]
						}
					]
				}
			]
		},

		{
			"sid": "enemy_attack_stoper",
			"hidden": true,

			"comment": "yolo enemy attack stoper",

			"activeOnStart": true,
			"name": "1",
			"sharing": "Clone",

			"subQuests":
			[	
				{
					"sid": "1",
					"activeOnStart": true,

					"triggers":
					[
						{
							"repeat": true,

							"conditions":
							[
								{ "c": "HeroKill", "p": [ "campaign_M3_hero_undead" ] }
							],

							"actions":
							[
								{ "a": "AiHardStrategy", "p": [ ] }							
							]
						}
					]
				}
			]
		},

		{
			"sid": "enemy_attack_1",
			"hidden": true,

			"comment": "yolo enemy attack",

			"activeOnStart": true,
			"name": "1",
			"sharing": "Clone",

			"subQuests":
			[	
				{
					"sid": "1",
					"activeOnStart": true,

					"triggers":
					[
						{
							"conditionsLogic": "And",

							"conditions":
							[
								{ "c": "StartTurn", "p": [ "2", "1" ] },
								{ "c": "Difficulty", "p": [ "1" ] }
							],

							"actions":
							[
								{ "a": "AiHardStrategy", "p": [ "one_hero_M3_yolo_attack" ] },
								{ "a": "TeleportHero", "p": [ "campaign_M3_hero_undead", "381", "3950" ] },
								{ "a": "AiOnSelectHero", "p": [  ] }
							]
						},
						{
							"conditionsLogic": "And",

							"conditions":
							[
								{ "c": "StartTurn", "p": [ "2", "1" ] },
								{ "c": "Difficulty", "p": [ "2" ] }
							],

							"actions":
							[
								{ "a": "AiHardStrategy", "p": [ "one_hero_M3_yolo_attack" ] },
								{ "a": "TeleportHero", "p": [ "campaign_M3_hero_undead", "381", "3950" ] },
								{ "a": "GiveUnitHero", "p": [ "lich",			"4",	"campaign_M3_hero_undead" ] },
								{ "a": "AiOnSelectHero", "p": [  ] }
							]
						},
						{
							"conditionsLogic": "And",

							"conditions":
							[
								{ "c": "StartTurn", "p": [ "2", "1" ] },
								{ "c": "Difficulty", "p": [ "3" ] }
							],

							"actions":
							[
								{ "a": "AiHardStrategy", "p": [ "one_hero_M3_yolo_attack" ] },
								{ "a": "TeleportHero", "p": [ "campaign_M3_hero_undead", "381", "3950" ] },
								{ "a": "GiveUnitHero", "p": [ "lich",			"8",	"campaign_M3_hero_undead" ] },
								{ "a": "AiOnSelectHero", "p": [  ] }
							]
						}
					]
				}
			]
		},

		{
			"sid": "enemy_attack_2",
			"hidden": true,

			"comment": "yolo enemy attack",

			"activeOnStart": true,
			"name": "1",
			"sharing": "Clone",

			"subQuests":
			[	
				{
					"sid": "1",
					"activeOnStart": true,

					"triggers":
					[
						{
							"conditionsLogic": "And",

							"conditions":
							[
								{ "c": "StartTurn", "p": [ "4", "1" ] },
								{ "c": "Difficulty", "p": [ "1" ] }
							],

							"actions":
							[
								{ "a": "AiHardStrategy", "p": [ "one_hero_M3_yolo_attack" ] },
								{ "a": "TeleportHero", "p": [ "campaign_M3_hero_undead", "381", "3950" ] },
								{ "a": "GiveUnitHero", "p": [ "lich",			"6",	"campaign_M3_hero_undead" ] },
								{ "a": "AiOnSelectHero", "p": [  ] }
							]
						},
						{
							"conditionsLogic": "And",

							"conditions":
							[
								{ "c": "StartTurn", "p": [ "4", "1" ] },
								{ "c": "Difficulty", "p": [ "2" ] }
							],

							"actions":
							[
								{ "a": "AiHardStrategy", "p": [ "one_hero_M3_yolo_attack" ] },
								{ "a": "TeleportHero", "p": [ "campaign_M3_hero_undead", "381", "3950" ] },
								{ "a": "GiveUnitHero", "p": [ "lich",			"12",	"campaign_M3_hero_undead" ] },
								{ "a": "AiOnSelectHero", "p": [  ] }
							]
						},
						{
							"conditionsLogic": "And",

							"conditions":
							[
								{ "c": "StartTurn", "p": [ "4", "1" ] },
								{ "c": "Difficulty", "p": [ "3" ] }
							],

							"actions":
							[
								{ "a": "AiHardStrategy", "p": [ "one_hero_M3_yolo_attack" ] },
								{ "a": "TeleportHero", "p": [ "campaign_M3_hero_undead", "381", "3950" ] },
								{ "a": "GiveUnitHero", "p": [ "lich",			"24",	"campaign_M3_hero_undead" ] },
								{ "a": "AiOnSelectHero", "p": [  ] }
							]
						}
					]
				}
			]
		},

		{
			"sid": "Questlog0",
			"main": true,

			"comment": "Квест 'Герои не должны умереть'",

			"activeOnStart": true,
			"sharing": "Clone",

			"name": "quest_name_genericQ0",

			"subQuests":
			[
				{
					"sid": "Questlog0_1",
					"activeOnStart": true,
					
					"name": "quest_sub_M1Q0_1",

					"triggers":
					[
						{
							"conditionsLogic": "And",
							"conditions":
							[
								{ "c": "Counter", "p": [ "opponent_defeated", "=", "1" ] },
								{ "c": "Counter", "p": [ "scout_quest_finished", "=", "1" ] }
							],

							"actions":
							[
								{ "a": "CurrentSubQuestDone" },
								{ "a": "Dialog", "p": [ "M3_victory_dial1" ] }
							]
						},
						{
							"conditions":
							[
								{ "c": "HeroKill", "p": [ "campaign_hero_1" ] }
							],

							"actions":
							[
								{ "a": "GameLose" }
							]
						}
					]
				}
			]
		},
		{
			"sid": "bonus_movement",

			"comment": "'unlimited' movepoints once the AI is defeated",

			"activeOnStart": true,
			"hidden": true,
			"sharing": "Clone",

			"name": "1",

			"subQuests":
			[
				{
					"sid": "Questlog0_1_1",
					"activeOnStart": true,

					"triggers":
					[
						{
							"conditions":
							[
								{ "c": "PlayerDefeated", "p": [ "1" ] }
							],

							"actions":
							[
								{ "a": "AddBuffHeroDays", "p": [ "campaign_movement_buff", "campaign_hero_1" ] },
								{ "a": "SetHeroMovePoints", "p": [ "campaign_hero_1", "350" ] }
							]
						}
					]
				}
			]
		},
		
			{
				"sid": "setupQuestlog1",
				"hidden": true,
				"activeOnStart": true,

				"comment": "setup for defeating enemy",

				"sharing": "Clone",

				"subQuests":
				[	
					{
						"sid": "1",
						"activeOnStart": true,

						"triggers":
						[						
							{
								"conditions":
								[
									{ "c": "Counter", "p": [ "main_quest", "=", "1" ] }
								],

								"actions":
								[
									{ "a": "NextQuest", "p": [ "Questlog1" ] }
								]
							}
						]
					}				
				]
			},
		{
			"sid": "Questlog1",
			"main": true,
			"activeOnStart": false,

			"comment": "defeat enemy",

			"sharing": "Clone",
			
			"name": "quest_name_M3Q1",
			"desc": "quest_desc_M3Q1",

			"subQuests":
			[	
				{
					"sid": "Questlog1_1",
					"activeOnStart": true,

					"name": "quest_sub_M3Q1_1",

					"triggers":
					[						
						{
							"conditions":
							[
								{ "c": "PlayerDefeated", "p": [ "1" ] }
							],

							"actions":
							[
								{ "a": "Dialog", "p": [ "M3aQ1_dial4" ] },
								{ "a": "CounterSet", "p": [ "opponent_defeated", "1" ] },
								{ "a": "CurrentSubQuestDone" },
								{ "a": "NextQuest" },
								{ "a": "AutoSave" }
							]
						}
					]
				}				
			]
		},
		
			{
				"sid": "setupQuestlog2",
				"hidden": true,
				"activeOnStart": true,

				"comment": "setup for finding scout",

				"sharing": "Clone",

				"subQuests":
				[	
					{
						"sid": "1",
						"activeOnStart": true,

						"triggers":
						[						
							{
								"conditions":
								[
									{ "c": "Counter", "p": [ "main_quest", "=", "1" ] }
								],

								"actions":
								[
									{ "a": "NextQuest", "p": [ "Questlog2" ] }
								]
							}
						]
					}				
				]
			},
		{
			"sid": "Questlog2",
			"main": true,
			"activeOnStart": false,

			"comment": "find scout",

			"sharing": "Clone",

			"name": "quest_name_M3Q2",
			"desc": "quest_desc_M3Q2",

			"subQuests":
			[
				{
					"sid": "Questlog2_1",
					"activeOnStart": true,

					"name": "quest_sub_M3Q2_1",

					"triggers":
					[
						{
							"conditions":
							[
								{ "c": "Counter", "p": [ "scout_found", "=", "1" ] }
							],

							"actions":
							[
								{ "a": "CurrentSubQuestDone" }
							]
						},
						{
							"conditions":
							[
								{ "c": "Counter", "p": [ "graverobber_quest", "=", "1" ] }
							],

							"actions":
							[
								{ "a": "RevealFogOfWar", "p": [ "1116", "3" ]},
								{ "a": "NextSubQuest", "p": [ "Questlog2_2" ]},

								{ "a": "SetQuestMarker", "p": [ "graverobber", "effects/global_map/quest_mark_gold_02" ] },
								{ "a": "SetQuestMarker", "p": [ "shard", "effects/global_map/quest_mark_gold_02" ] }
							]
						},
						{
							"conditions":
							[
								{ "c": "Counter", "p": [ "graverobber_quest", "=", "2" ] }
							],

							"actions":
							[
								{ "a": "NextSubQuest", "p": [ "Questlog2_3" ]},

								{ "a": "SetQuestMarker", "p": [ "spy", "effects/global_map/quest_mark_gold_02" ] }
							]
						},
						{
							"conditions":
							[
								{ "c": "Counter", "p": [ "graverobber_quest", "=", "4" ] }
							],

							"actions":
							[
								{ "a": "NextQuest" }
							]
						}
					]
				},
				{
					"sid": "Questlog2_2",
					"name": "quest_sub_M3Q2_2",

					"comment": "find the shard of serenity",

					"triggers":
					[
						{
							"conditions":
							[
								{ "c": "Counter", "p": [ "graverobber_quest", "=", "4" ] }
							],

							"actions":
							[
								{ "a": "CurrentSubQuestDone" },
								{ "a": "NextQuest", "p": [] }
							]
						}
					]
				},
				{
					"sid": "Questlog2_2a",
					"name": "quest_sub_M3Q2_2",

					"comment": "DUPLICATE FOR DECIDING TO HELP AFTER TRIED TO FIND THE SPY - find the shard of serenity",

					"triggers":
					[
						{
							"conditions":
							[
								{ "c": "Counter", "p": [ "graverobber_quest", "=", "4" ] }
							],

							"actions":
							[
								{ "a": "CurrentSubQuestDone" },
								{ "a": "NextQuest", "p": [] }
							]
						}
					]
				},
				{
					"sid": "Questlog2_3",

					"name": "quest_sub_M3Q2_3",

					"triggers":
					[
						{
							"conditions":
							[
								{ "c": "Counter", "p": [ "graverobber_quest", "=", "3" ] }
							],

							"actions":
							[
								{ "a": "CurrentSubQuestDone" },
								{ "a": "NextQuest" }
							]
						},
						{
							"conditions":
							[
								{ "c": "Counter", "p": [ "graverobber_quest", "=", "1" ] }
							],

							"actions":
							[
								{ "a": "NextSubQuest", "p": [ "Questlog2_2a" ]}
							]
						},
						{
							"conditions":
							[
								{ "c": "Counter", "p": [ "graverobber_quest", "=", "4" ] }
							],

							"actions":
							[
								{ "a": "NextQuest" }
							]
						}
					]
				}
			]
		},
			{
				"sid": "supportQuestlog2",
				"hidden": true,

				"comment": "scout resurrection event + shard of serenity interaction",

				"activeOnStart": true,
				"sharing": "Clone",
				
				"name": "1",

				"subQuests":
				[	
					{
						"sid": "1",
						"activeOnStart": true,

						"comment": "scout resurrection event",

						"triggers":
						[						
							{
								"conditions":
								[
									{ "c": "Counter", "p": [ "scout_resurrection", "=", "1" ] }
								],

								"actions":
								[
									{ "a": "DeleteEntity", "p": [ "scout_body" ] },
									{ "a": "SpawnSquad", "p": [ "squad_c_spirit", "2643", "1", "false", "spirit"] },
									{ "a": "SetFlagEscape", "p": [ "spirit", "false" ] },
									{ "a": "SetFlagAutobattle", "p": [ "spirit", "true" ] },
									{ "a": "ChangeSquadReactionType", "p": [ "spirit", "Aggressive" ] },
									{ "a": "Dialog", "p": [ "M3aQ2_dial5" ] }
								]
							},
							{
								"conditions":
								[
									{ "c": "SquadKill", "p": [ "spirit" ] }
								],

								"actions":
								[
									{ "a": "Dialog", "p": [ "M3aQ2_dial6" ] },
									{ "a": "AutoSave" }
								]
							}
						]
					},
					{
						"sid": "2",
						"activeOnStart": true,
	
						"comment": "shard of serenity interaction",

						"triggers":
						[
							{
								"repeat": true,

								"conditions":
								[
									{ "c": "CounterEqualityInDays", "p": [ "item_quest", "1" ], "counter": 1 }
								],
	
								"actions":
								[
									{ "a": "CounterSet", "p": [ "item_quest", "2" ] },
									{ "a": "Dialog", "p": [ "M3Q8_dial2" ] },
									{ "a": "EntityActionsOff", "p": [ "shard" ] },
									{ "a": "DeleteEntity", "p": [ "zone_item_on" ] },
									{ "a": "DeleteEntity", "p": [ "zone_item_off1" ] },
									{ "a": "DeleteEntity", "p": [ "zone_item_off2" ] },
									{ "a": "AutoSave" }
								]
							},
							{
								"conditions":
								[
									{ "c": "ItemOwnHero", "p": [ "tranquility_ring_of_serenity_artifact", "campaign_hero_1" ] }
								],
	
								"actions":
								[
									{ "a": "CounterSet", "p": [ "shard_counter", "2" ] },
									
									{ "a": "SetAchievement", "p": [ "achievement_12" ] }
								]
							}
						]
					}				
				]
			},

			{
				"sid": "supportQuestlog3",
				"hidden": true,
				"activeOnStart": true,

				"comment": "processing interactions between deathknight and scared swordsmen",

				"sharing": "Clone",

				"subQuests":
				[	
					{
						"sid": "1",
						"activeOnStart": true,

						"triggers":
						[
							{
								"conditions":
								[
									{ "c": "SquadKill", "p": [ "deserter_swordsmen" ] }
								],

								"actions":
								[										
									{ "a": "DeleteEntity", "p": [ "swordsman1" ] },
									{ "a": "DeleteEntity", "p": [ "swordsman2" ] },
									{ "a": "DeleteEntity", "p": [ "swordsman3" ] }
								]
							},
							{
								"conditions":
								[
									{ "c": "SquadKill", "p": [ "scared_swordsmen" ] }
								],

								"actions":
								[										
									{ "a": "DeleteEntity", "p": [ "swordsman1" ] },
									{ "a": "DeleteEntity", "p": [ "swordsman2" ] },
									{ "a": "DeleteEntity", "p": [ "swordsman3" ] },
									{ "a": "Dialog", "p": [ "M3Q3_dial2" ] }
								]
							}
						]
					}
				]
			},

			{
				"sid": "setupQuestlog4",
				"hidden": true,
				"activeOnStart": true,

				"comment": "priestess quest setup",

				"sharing": "Clone",

				"subQuests":
				[	
					{
						"sid": "1",
						"activeOnStart": true,

						"triggers":
						[
							{
								"conditions":
								[
									{ "c": "Counter", "p": [ "priestess_quest", "=", "1" ] }
								],

								"actions":
								[
									{ "a": "NextQuest", "p": [ "Questlog4a" ] },

									{ "a": "SetQuestMarker", "p": [ "sacrificial_altar", "effects/global_map/quest_mark_silver_02" ] }
								]
							},
							{
								"conditions":
								[
									{ "c": "Counter", "p": [ "priestess_quest", "=", "3" ] }
								],

								"actions":
								[
									{ "a": "NextQuest", "p": [ "Questlog4b" ] },
								
									{ "a": "SetQuestMarker", "p": [ "abbey", "effects/global_map/quest_mark_silver_02" ] }	
								]
							},
							{
								"conditions":
								[
									{ "c": "Counter", "p": [ "priestess_quest", "=", "2" ] }
								],

								"actions":
								[
									{ "a": "NextQuest" }
								]
							}
						]
					}
				]
			},
		{
			"sid": "Questlog4a",
			"activeOnStart": false,

			"comment": "Priestess quest",

			"sharing": "Clone",

			"name": "quest_name_M3Q4",

			"subQuests":
			[	
				{
					"sid": "Questlog4a_1",
					"activeOnStart": true,
					"name": "quest_sub_M3Q4_1",

					"triggers":
					[
						{
							"conditions":
							[
								{ "c": "Counter", "p": [ "priestess_quest", "=", "3" ] }
							],

							"actions":
							[
								{ "a": "CurrentSubQuestDone" },
								{ "a": "NextSubQuest", "p": [ "Questlog4a_2" ] },
								
								{ "a": "SetQuestMarker", "p": [ "abbey", "effects/global_map/quest_mark_silver_02" ] }	
							]
						},						
						{
							"conditions":
							[
								{ "c": "Counter", "p": [ "priestess_quest", "=", "2" ] }
							],

							"actions":
							[
								{ "a": "NextQuest" }
							]
						}
					]
				},
				{
					"sid": "Questlog4a_2",
					"name": "quest_sub_M3Q4_2",

					"triggers":
					[
						{
							"conditions":
							[
								{ "c": "Counter", "p": [ "priestess_quest", "=", "4" ] }
							],

							"actions":
							[
								{ "a": "CurrentSubQuestDone" },
								{ "a": "NextQuest" },
								
								{ "a": "SetActiveQuestMarker", "p": [ "abbey", "false" ] }				
							]
						}
					]
				}
			]
		},
		{
			"sid": "Questlog4b",
			"activeOnStart": false,

			"comment": "Priestess quest when started from the altar",

			"sharing": "Clone",

			"name": "quest_name_M3Q4",

			"subQuests":
			[	
				{
					"sid": "Questlog4b_1",
					"activeOnStart": true,
					"name": "quest_sub_M3Q4_2",

					"triggers":
					[
						{
							"conditions":
							[
								{ "c": "Counter", "p": [ "priestess_quest", "=", "4" ] }
							],

							"actions":
							[
								{ "a": "CurrentSubQuestDone" },
								{ "a": "NextQuest" },
								
								{ "a": "SetActiveQuestMarker", "p": [ "abbey", "false" ] }			
							]
						}
					]
				}
			]
		},
			{
				"sid": "supportQuestlog4_1",
				"hidden": true,
				"activeOnStart": true,

				"comment": "tracking defeating undead_guard, plundering abbey",

				"sharing": "Clone",

				"subQuests":
				[	
					{
						"sid": "1",
						"activeOnStart": true,

						"triggers":
						[
							{
								"conditions":
								[
									{ "c": "SquadKill", "p": [ "undead_guard" ] }
								],
	
								"actions":
								[
									{ "a": "Dialog", "p": [ "M3Q4_dial9" ] }
								]
							},
							{
								"conditions":
								[
									{ "c": "Counter", "p": [ "abbey_plundered", "=", "1" ] }
								],

								"actions":
								[
									{ "a": "SetActiveQuestMarker", "p": [ "abbey", "false" ] }
								]
							}
						]
					}
				]
			},
			{
				"sid": "supportQuestlog4_2",
				"hidden": true,
				"activeOnStart": true,

				"comment": "dialog after losing all priestesses, only until player fights undead guards",

				"sharing": "Clone",

				"subQuests":
				[
					{
						"sid": "1",
						"activeOnStart": true,

						"triggers":
						[
							{
								"conditions":
								[
									{ "c": "UnitLose", "p": [ "lightweaver_upg_alt" ], "counter": 10 }
								],

								"actions":
								[
									{ "a": "Dialog", "p": [ "M3Q4_dial7" ] }
								]
							},
							{
								"conditions":
								[
									{ "c": "Counter", "p": [ "undead_guard_attacked", "=", "1" ] }
								],

								"actions":
								[
									{ "a": "NextQuest" }
								]
							}
						]
					}
				]
			},
		
			{
				"sid": "setupQuestlog5",
				"hidden": true,
				"activeOnStart": true,

				"comment": "pixie quest setup",

				"sharing": "Clone",

				"subQuests":
				[	
					{
						"sid": "1",
						"activeOnStart": true,

						"triggers":
						[
							{
								"conditions":
								[
									{ "c": "Counter", "p": [ "pixie_quest", "=", "1" ] }
								],

								"actions":
								[
									{ "a": "NextQuest", "p": [ "Questlog5" ] },

									{ "a": "SetQuestMarker", "p": [ "pixie_artifact", "effects/global_map/quest_mark_silver_02" ] }
								]
							}
						]
					}
				]
			},
		{
			"sid": "Questlog5",
			"activeOnStart": false,

			"comment": "pixie quest",

			"sharing": "Clone",
			
			"name": "quest_name_M3Q5",
			"desc": "quest_desc_M3Q5",

			"subQuestGroups":
			[
				{
					"sid": "Questlog5Group",
					"subQuests": [ "Questlog5_3", "Questlog5_4" ]
				}
			],

			"subQuests":
			[	
				{
					"sid": "Questlog5_1",
					"activeOnStart": true,

					"name": "quest_sub_M3Q5_1",
					"comment": "get rid of spell #1",

					"triggers":
					[
						{
							"conditions":
							[
								{ "c": "SpellCast", "p": [ "day_6_magic_cleansing_ray" ], "counter": 1 }
							],

							"actions":
							[
								{ "a": "RemoveItem", "p": [ "magic_scroll_artifact_day_6_magic_cleansing_ray" ] },
								{ "a": "Dialog", "p": [ "M3Q5_dial1_fair" ] },
								{ "a": "CurrentSubQuestDone" },
								{ "a": "NextSubQuest", "p": [ "Questlog5_1_back" ] }
							]
						},
						{
							"conditions":
							[
								{ "c": "ItemDestroyed", "p": [ "magic_scroll_artifact_day_6_magic_cleansing_ray" ] }
							],

							"actions":
							[
								{ "a": "Dialog", "p": [ "M3Q5_dial1_tricked" ] },
								{ "a": "CounterPlus", "p": [ "pixie_tricked", "1" ] },
								{ "a": "CurrentSubQuestDone" },
								{ "a": "NextSubQuest", "p": [ "Questlog5_1_back" ] }
							]
						},
						{
							"conditions":
							[
								{ "c": "Counter", "p": [ "pixie_quest", "=", "6" ] }
							],

							"actions":
							[
								{ "a": "NextQuest", "p": [] }
							]
						}
					]
				},
					{
						"sid": "Questlog5_1_back",
						"activeOnStart": false,

						"name": "quest_sub_M3Q5_1_back",
						"comment": "return after spell #1",

						"triggers":
						[
							{
								"conditions":
								[
									{ "c": "Counter", "p": [ "pixie_quest", "=", "2" ] }
								],

								"actions":
								[
									{ "a": "NextSubQuest", "p": [ "Questlog5_2" ] }
								]
							},
							{
								"conditions":
								[
									{ "c": "Counter", "p": [ "pixie_quest", "=", "6" ] }
								],

								"actions":
								[
									{ "a": "NextQuest", "p": [] }
								]
							}
						]
					},
				{
					"sid": "Questlog5_2",
					
					"name": "quest_sub_M3Q5_2",
					"comment": "get rid of spell #2",

					"triggers":
					[
						{
							"conditions":
							[
								{ "c": "SpellCast", "p": [ "night_5_magic_shade_cloak" ], "counter": 1 }
							],

							"actions":
							[
								{ "a": "RemoveItem", "p": [ "magic_scroll_artifact_night_5_magic_shade_cloak" ] },
								{ "a": "Dialog", "p": [ "M3Q5_dial2_fair" ] },
								{ "a": "CurrentSubQuestDone" },
								{ "a": "NextSubQuest", "p": [ "Questlog5_2_back" ] }
							]
						},
						{
							"conditions":
							[
								{ "c": "ItemDestroyed", "p": [ "magic_scroll_artifact_night_5_magic_shade_cloak" ] }
							],

							"actions":
							[
								{ "a": "Dialog", "p": [ "M3Q5_dial2_tricked" ] },
								{ "a": "CounterPlus", "p": [ "pixie_tricked", "1" ] },
								{ "a": "CurrentSubQuestDone" },
								{ "a": "NextSubQuest", "p": [ "Questlog5_2_back" ] }
							]
						},
						{
							"conditions":
							[
								{ "c": "Counter", "p": [ "pixie_quest", "=", "6" ] }
							],

							"actions":
							[
								{ "a": "NextQuest", "p": [] }
							]
						}
					]
				},
					{
						"sid": "Questlog5_2_back",
						"activeOnStart": false,

						"name": "quest_sub_M3Q5_2_back",
						"comment": "return after spell #2",

						"triggers":
						[
							{
								"conditions":
								[
									{ "c": "Counter", "p": [ "pixie_quest", "=", "3" ] }
								],

								"actions":
								[					
									{ "a": "NextSubQuest", "p": [ "Questlog5_3" ] }
								]
							},
							{
								"conditions":
								[
									{ "c": "Counter", "p": [ "pixie_quest", "=", "6" ] }
								],

								"actions":
								[
									{ "a": "NextQuest", "p": [] }
								]
							}
						]
					},
				{
					"sid": "Questlog5_3",
					
					"name": "quest_sub_M3Q5_3",
					"comment": "get rid of spell #3",

					"triggers":
					[
						{
							"conditions":
							[
								{ "c": "SpellCast", "p": [ "primal_8_magic_cave_in" ], "counter": 1 }
							],

							"actions":
							[
								{ "a": "RemoveItem", "p": [ "magic_scroll_artifact_primal_8_magic_cave_in" ] },
								{ "a": "Dialog", "p": [ "M3Q5_dial3_fair" ] },
								{ "a": "CurrentSubQuestDone" },
								{ "a": "NextSubQuest", "p": [ "Questlog5_3_back" ] }
							]
						},
						{
							"conditions":
							[
								{ "c": "ItemDestroyed", "p": [ "magic_scroll_artifact_primal_8_magic_cave_in" ] }
							],

							"actions":
							[
								{ "a": "Dialog", "p": [ "M3Q5_dial3_tricked" ] },
								{ "a": "CounterPlus", "p": [ "pixie_tricked", "1" ] },
								{ "a": "CurrentSubQuestDone" },
								{ "a": "NextSubQuest", "p": [ "Questlog5_3_back" ] }
							]
						},
						{
							"conditions":
							[
								{ "c": "Counter", "p": [ "pixie_quest", "=", "6" ] }
							],

							"actions":
							[
								{ "a": "NextQuest", "p": [] }
							]
						}
					]
				},
					{
						"sid": "Questlog5_3_back",
						"activeOnStart": false,

						"name": "quest_sub_M3Q5_3_back",
						"comment": "return after spell #3",

						"triggers":
						[
							{
								"conditions":
								[
									{ "c": "Counter", "p": [ "pixie_quest", "=", "4" ] }
								],

								"actions":
								[						
									{ "a": "NextSubQuest", "p": [ "Questlog5_4" ] }
								]
							},
							{
								"conditions":
								[
									{ "c": "Counter", "p": [ "pixie_quest", "=", "6" ] }
								],

								"actions":
								[
									{ "a": "NextQuest", "p": [] }
								]
							}
						]
					},
				{
					"sid": "Questlog5_4",
					
					"name": "quest_sub_M3Q5_4",
					"comment": "get rid of spell #4",

					"triggers":
					[
						{
							"conditions":
							[
								{ "c": "SpellCast", "p": [ "space_15_magic_trap_snare" ], "counter": 1 }
							],

							"actions":
							[
								{ "a": "RemoveItem", "p": [ "magic_scroll_artifact_space_15_magic_trap_snare" ] },
								{ "a": "Dialog", "p": [ "M3Q5_dial4_fair" ] },
								{ "a": "CurrentSubQuestDone" },
								{ "a": "NextSubQuest", "p": [ "Questlog5_4_back" ] }
							]
						},
						{
							"conditions":
							[
								{ "c": "ItemDestroyed", "p": [ "magic_scroll_artifact_space_15_magic_trap_snare" ] }
							],

							"actions":
							[
								{ "a": "Dialog", "p": [ "M3Q5_dial4_tricked" ] },
								{ "a": "CounterPlus", "p": [ "pixie_tricked", "1" ] },
								{ "a": "CurrentSubQuestDone" },
								{ "a": "NextSubQuest", "p": [ "Questlog5_4_back" ] }
							]
						},
						{
							"conditions":
							[
								{ "c": "Counter", "p": [ "pixie_quest", "=", "6" ] }
							],

							"actions":
							[
								{ "a": "NextQuest", "p": [] }
							]
						}
					]
				},
					{
						"sid": "Questlog5_4_back",
						"activeOnStart": false,

						"name": "quest_sub_M3Q5_4_back",
						"comment": "return after spell #4",

						"triggers":
						[
							{
								"conditions":
								[
									{ "c": "Counter", "p": [ "pixie_quest", "=", "5" ] }
								],

								"actions":
								[
									{ "a": "CurrentSubQuestDone" },							
									{ "a": "NextQuest" }
								]
							},
							{
								"conditions":
								[
									{ "c": "Counter", "p": [ "pixie_quest", "=", "6" ] }
								],

								"actions":
								[
									{ "a": "NextQuest", "p": [] }
								]
							}
						]
					}
			]
		},
			{
				"sid": "setupQuestlog6",
				"hidden": true,
				"activeOnStart": true,

				"comment": "sacrifice quest setup",

				"sharing": "Clone",

				"subQuests":
				[	
					{
						"sid": "1",
						"activeOnStart": true,

						"triggers":
						[
							{
								"conditions":
								[
									{ "c": "Counter", "p": [ "sacrifice_quest", "=", "1" ] }
								],

								"actions":
								[
									{ "a": "NextQuest", "p": [ "Questlog6" ] },

									{ "a": "SetQuestMarker", "p": [ "priestess", "effects/global_map/quest_mark_silver_02" ] }
								]
							}
						]
					}
				]
			},
		{
			"sid": "Questlog6",
			"activeOnStart": false,

			"comment": "Sacrifice quest",

			"sharing": "Clone",
			"name": "quest_name_M3Q6",
			"desc": "quest_desc_M3Q6",

			"subQuests":
			[	
				{
					"sid": "Questlog6_1",
					"activeOnStart": true,
					"name": "quest_sub_M3Q6_1",

					"triggers":
					[
						{
							"conditions":
								[
									{ "c": "Counter", "p": [ "sacrifice_quest", "=", "2" ] }
								],

								"actions":
								[
									{ "a": "CurrentSubQuestDone" },
									{ "a": "NextSubQuest", "p": [ "Questlog6_2" ] },
									
									{ "a": "SetQuestMarker", "p": [ "sacrificial_altar", "effects/global_map/quest_mark_silver_02" ] }
								]
						}
					]
				},
				{
					"sid": "Questlog6_2",
					"name": "quest_sub_M3Q6_2",

					"triggers":
					[
						{
							"conditions":
								[
									{ "c": "Counter", "p": [ "sacrifice_quest", "=", "3" ] }
								],

								"actions":
								[
									{ "a": "CurrentSubQuestDone" }
								]
						},
						{
							"conditions":
								[
									{ "c": "Counter", "p": [ "sacrifice_quest", "=", "4" ] }
								],

								"actions":
								[
									{ "a": "NextQuest" },
									
									{ "a": "SetActiveQuestMarker", "p": [ "sacrificial_altar", "false" ] }
								]
						}
					]
				}
			]
		},

			{
				"sid": "setupQuestlog7",
				"hidden": true,
				"activeOnStart": true,

				"comment": "conscription quest setup",

				"sharing": "Clone",

				"subQuests":
				[	
					{
						"sid": "1",
						"activeOnStart": true,
	
						"triggers":
						[
							{
								"conditions":
								[
									{ "c": "Counter", "p": [ "conscription_quest", "=", "1" ] }
								],
	
								"actions":
								[
									{ "a": "NextQuest", "p": [ "Questlog7" ] },

									{ "a": "SetQuestMarker", "p": [ "village1", "effects/global_map/quest_mark_silver_02" ] },
									{ "a": "SetQuestMarker", "p": [ "village2", "effects/global_map/quest_mark_silver_02" ] },
									{ "a": "SetQuestMarker", "p": [ "village3", "effects/global_map/quest_mark_silver_02" ] }
								]
							},
							{
								"conditions":
								[
									{ "c": "Counter", "p": [ "starting_side", "=", "1" ] }
								],
	
								"actions":
								[
									{ "a": "DeleteEntity", "p": [ "zone_conscription1" ] },
									{ "a": "DeleteEntity", "p": [ "zone_conscription2" ] },
									{ "a": "DeleteEntity", "p": [ "zone_conscription3" ] },
									{ "a": "DeleteEntity", "p": [ "zone_conscription4" ] },
									{ "a": "DeleteEntity", "p": [ "colonel" ] },
									{ "a": "NextQuest", "p": [] }
								]
							}
						]
					}
				]
			},
		{
			"sid": "Questlog7",
			"activeOnStart": false,

			"comment": "Conscription quest",

			"sharing": "Clone",
			"name": "quest_name_M3Q7",

			"subQuests":
			[	
				{
					"sid": "Questlog7_1",
					"activeOnStart": true,
					"name": "quest_sub_M3Q7_1",

					"triggers":
					[
						{
							"conditions":
							[
								{ "c": "SquadKill", "p": [ "peasant1" ] }
							],

							"actions":
							[
								{ "a": "Dialog", "p": [ "M3aQ7_dial3" ] }
							]
						},
						{
							"conditions":
							[
								{ "c": "Counter", "p": [ "villages_visited", "=", "3" ] }
							],

							"actions":
							[
								{ "a": "CurrentSubQuestDone" },
								{ "a": "NextQuest" },
								{ "a": "Dialog", "p": [ "M3aQ7_dial6" ] }
							]
						}
					]
				}
			]
		},
			{
				"sid": "setupQuestlog8",
				"hidden": true,
				"activeOnStart": true,

				"comment": "healing item sidesidequest setup",

				"sharing": "Clone",

				"subQuests":
				[	
					{
						"sid": "1",
						"activeOnStart": true,

						"triggers":
						[
							{
								"conditions":
								[
									{ "c": "Counter", "p": [ "healing_quest", "=", "1" ] }
								],

								"actions":
								[
									{ "a": "NextQuest", "p": [ "Questlog8" ] },
									
									{ "a": "SetQuestMarker", "p": [ "healing_item", "effects/global_map/quest_mark_silver_02" ] }
								]
							}
						]
					}
				]
			},
		{
			"sid": "Questlog8",
			"activeOnStart": false,

			"comment": "Healing item sideside quest",

			"sharing": "Clone",
			"name": "quest_name_M3Q8",
			"desc": "quest_desc_M3Q8",

			"subQuests":
			[	
				{
					"sid": "Questlog8_1",
					"activeOnStart": true,
					"name": "quest_sub_M3Q8_1",

					"triggers":
					[
						{
							"conditions":
							[
								{ "c": "Counter", "p": [ "healing_quest", "=", "2" ] }
							],

							"actions":
							[
								{ "a": "CurrentSubQuestDone" },
								{ "a": "NextQuest" }
							]
						}
					]
				}
			]
		}
	]
}