﻿{
	"counters":
	[
		{
			"sid": "starting_side",
			"value": 0,

			"comment": "0 - игрок начал за людей, 1 - игрок начал за сильван"
		},

		{
			"sid": "main_quest",
			"value": 0, 

			"comment": "флаг, поговорил ли филакус сам с собой"
		},
		{
			"sid": "main_quest_ignat_spirit_dialog",
			"value": 0, 

			"comment": "флаг, поговорил ли филакус с призраком игната"
		},		
		{
			"sid": "main_quest_ignat_first_dialog",
			"value": 0, 

			"comment": "флаг, говорили ли мы уже с игнатом"
		},
		{
			"sid": "find_druid_quest",
			"value": 0, 

			"comment": "флаг - выдан квест найти игнасиуса"
		},	
		{
			"sid": "defeat_enemy_quest",
			"value": 0, 

			"comment": "флаг - выдан квест победить оппонента"
		},		
		{
			"sid": "go_to_burning_man_quest",
			"value": 0, 

			"comment": "флаг - оппонент уже был побежден, выдан квест пройти к горящему человеку"
		},	
		{
			"sid": "main_quest_opponent_defeated",
			"value": 0, 

			"comment": "флаг, одержали ли победу над противником"
		},
		{
			"sid": "main_quest_druid_kill",
			"value": 0, 

			"comment": "флаг, был ли убит друид"
		},
		{
			"sid": "found_burning_man",
			"value": 0, 

			"comment": "флаг, был ли найден горящий человек"
		},



		{
			"sid": "construction_quest",
			"value": 0, 

			"comment": "флаг для трекинга Q2; 1 - нужно принести ресурсы; 2 - закончил стройку, помог людям; 3 - прогнал людей/сжег стройку"
		},
		
		{
			"sid": "spy_quest",
			"value": 0, 

			"comment": "1 - игрок нашел шпиона, сняты блоки на пути к дневнику; 2 - найден дневник"
		},

		{
			"sid": "sister_quest",
			"value": 0, 

			"comment": "флаг для трекинга Q4, 1 - квест начат, 2 - произошла вторая встреча, 3 - произошла последняя встреча / конец квеста"
		},
		

		{
			"sid": "preacher_quest",
			"value": 0, 

			"comment": "флаг для трекинга Q5, 1 - начал квест, 2 - закончил проповедовать, 3 - забросил квест, 4 - поверил эльфам, 5 - квест полностью завершен"
		},
		{
			"sid": "pagan_dwelling_visited",
			"value": 0, 

			"comment": "вспомогательный флаг для Q5, меняет диалоги для последующих встреч с эльфами внутри квеста"
		},
		{
			"sid": "pagan_squad_defeated",
			"value": 0, 

			"comment": "вспомогательный флаг для Q5, счетчик побежденных охрандля проигрывания диалогов"
		},

		{
			"sid": "stargazer_quest",
			"value": 0, 

			"comment": "флаг для трекинга Q6, 0 - квест не начат, 1 - загадки разгаданы, 2 - загадки провалены"
		},
		{
			"sid": "knows_all_schools",
			"value": 0, 

			"comment": "вспомогательный флаг для Q6"
		}
	],

	"interruptions":
	[
		{
			"sid": "first_interaction_with_druid",
			"interruption": "BeforeIamVsHero",
			"activeOnStart": true,
			"p": [ "campaign_M4_hero_sylvan_1" ],

			"actions":
			[
				{ "a": "DisableInterruption", "p": [ "first_interaction_with_druid" ] },
				{ "a": "EnableInterruption", "p": [ "interaction_with_druid" ] },
				{ "a": "Dialog", "p": [ "M4Q1_dial3" ] }
			]
		},
		{
			"sid": "interaction_with_druid",
			"interruption": "BeforeIamVsHero",
			"activeOnStart": false,
			"p": [ "campaign_M4_hero_sylvan_1" ],

			"actions":
			[
				{ "a": "DialogIfCounter", "p": [ "M4Q1_dial4", "go_to_burning_man_quest", "=", "0" ] },
				{ "a": "DialogIfCounter", "p": [ "M4Q1_dial11", "go_to_burning_man_quest", "=", "1" ] }
			]
		},
		{
			"sid": "after_fight",
			"interruption": "AfterIamWinVsHero",
			"activeOnStart": true,
			"p": [ "campaign_M4_hero_sylvan_1" ],

			"actions":
			[
				{ "a": "Dialog", "p": [ "M4Q1_dial6" ] },
				{ "a": "CounterSet", "p": [ "main_quest_druid_kill", "1" ] }
			]
		},
		{
			"sid": "after_fight_lost",
			"interruption": "AfterIamLoseVsHero",
			"activeOnStart": true,
			"p": [ "campaign_M4_hero_sylvan_1" ],

			"actions":
			[
				{ "a": "Dialog", "p": [ "M4Q1_dial10" ] }
			]
		},


		{
			"sid": "before_fight_opponent_sylvan1",
			"interruption": "BeforeIamVsHero",
			"activeOnStart": true,
			"p": [ "campaign_M4_hero_sylvan_2" ],

			"actions":
			[
				{ "a": "DisableInterruption", "p": [ "before_fight_opponent_sylvan1" ] },
				{ "a": "DisableInterruption", "p": [ "before_fight_opponent_sylvan2" ] },
				{ "a": "Dialog", "p": [ "M4Q1_dial9a" ] }
			]
		},
		{
			"sid": "before_fight_opponent_sylvan2",
			"interruption": "BeforeIamVsHero",
			"activeOnStart": true,
			"p": [ "campaign_M4_hero_sylvan_3" ],

			"actions":
			[
				{ "a": "DisableInterruption", "p": [ "before_fight_opponent_sylvan1" ] },
				{ "a": "DisableInterruption", "p": [ "before_fight_opponent_sylvan2" ] },
				{ "a": "Dialog", "p": [ "M4Q1_dial9b" ] }
			]
		},
		{
			"sid": "before_fight_opponent_temple1",
			"interruption": "BeforeIamVsHero",
			"activeOnStart": true,
			"p": [ "campaign_M4_hero_temple_2" ],

			"actions":
			[
				{ "a": "DisableInterruption", "p": [ "before_fight_opponent_temple1" ] },
				{ "a": "DisableInterruption", "p": [ "before_fight_opponent_temple2" ] },
				{ "a": "Dialog", "p": [ "M4Q1_dial9a" ] }
			]
		},
		{
			"sid": "before_fight_opponent_temple2",
			"interruption": "BeforeIamVsHero",
			"activeOnStart": true,
			"p": [ "campaign_M4_hero_temple_3" ],

			"actions":
			[
				{ "a": "DisableInterruption", "p": [ "before_fight_opponent_temple1" ] },
				{ "a": "DisableInterruption", "p": [ "before_fight_opponent_temple2" ] },
				{ "a": "Dialog", "p": [ "M4Q1_dial9b" ] }
			]
		},


		{
			"sid": "interaction_with_preacher1",
			"interruption": "BeforeIamVsHero",
			"activeOnStart": true,
			"p": [ "campaign_M4_hero_preacher" ],

			"actions":
			[
				{ "a": "DisableInterruption", "p": [ "interaction_with_preacher1" ] },
				{ "a": "EnableInterruption", "p": [ "interaction_with_preacher2" ] },
				{ "a": "Dialog", "p": [ "M4Q5_dial1" ] }
			]
		},
		
		{
			"sid": "interaction_with_preacher2",
			"interruption": "BeforeIamVsHero",
			"activeOnStart": false,
			"p": [ "campaign_M4_hero_preacher" ],

			"actions":
			[
				{ "a": "DialogIfCounter", "p": [ "M4Q5_dial8", "preacher_quest", "=", "1" ] },
				{ "a": "DialogIfCounter", "p": [ "M4Q5_dial5", "preacher_quest", "=", "2" ] },
				{ "a": "DialogIfCounter", "p": [ "M4Q5_dial7", "preacher_quest", "=", "3" ] },
				{ "a": "DialogIfCounter", "p": [ "M4Q5_dial6", "preacher_quest", "=", "4" ] }
			]
		}
	],

	"quests":
	[
		{
			"sid": "intro",

			"hidden": true,

			"comment": "intro",

			"activeOnStart": true,
			"name": "1",
			"sharing": "Clone",

			"subQuests":
			[	
				{
					"sid": "1",
					"activeOnStart": true,

					"triggers":
					[
						{
							"conditions":
							[
								{ "c": "StartTurn", "p": [ "1", "1" ] }
							],

							"actions":
							[
								{ "a": "CounterSet", "p": [ "starting_side", "1" ] },
								
								{ "a": "CounterSet", "p": [ "main_quest_ignat_spirit_dialog", "0" ] },
								{ "a": "CounterSet", "p": [ "main_quest_ignat_first_dialog", "0" ] },
								{ "a": "CounterSet", "p": [ "main_quest_opponent_defeated", "0" ] },

								{ "a": "Dialog", "p": [ "M4Q1_dial1" ] },

								{ "a": "DisableAiHero", "p": [ "campaign_M4_hero_sylvan_1" ] },
								{ "a": "DisableAiResurrect", "p": [ "campaign_M4_hero_sylvan_1" ] },
								{ "a": "HeroToNode", "p": [ "campaign_M4_hero_sylvan_1", "588" ] },

								{ "a": "DisableAiHero", "p": [ "campaign_M4_hero_unfrozen" ] },
								{ "a": "DisableAiResurrect", "p": [ "campaign_M4_hero_unfrozen" ] },
								{ "a": "AddBuffHeroDays", "p": [ "campaign_infinite_moves_buff", "campaign_M4_hero_unfrozen", "9999" ] },

								{ "a": "DisableAiHero", "p": [ "campaign_M4_hero_preacher" ] },
								{ "a": "DisableAiResurrect", "p": [ "campaign_M4_hero_preacher" ] },
								{ "a": "HeroToNode", "p": [ "campaign_M4_hero_preacher", "1858" ] },
								{ "a": "GiveItemHero", "p": [ "angelic_alliance_sandals_of_the_saint_artifact", "campaign_M4_hero_preacher" ] },

								{ "a": "CreateVFX", "p": [ "fx_quest_mark_gold_02", "588", "false", "false", "em_ignacius" ] },
								{ "a": "CreateVFX", "p": [ "fx_quest_mark_gold_01", "3407", "false", "true", "qm_portal1" ] },
								{ "a": "CreateVFX", "p": [ "fx_quest_mark_gold_01", "1071", "false", "true", "qm_portal2" ] },
								{ "a": "CreateVFX", "p": [ "fx_quest_mark_gold_01", "258", "false", "true", "qm_portal3" ] },
								{ "a": "CreateVFX", "p": [ "fx_quest_mark_gold_01", "588", "false", "true", "qm_ignacius" ] },
								{ "a": "CreateVFX", "p": [ "fx_quest_mark_silver_01", "1858", "false", "true", "qm_preacher" ] },
								{ "a": "CreateVFX", "p": [ "fx_quest_mark_silver_01", "1041", "false", "true", "qm_sister1" ] },
								{ "a": "SetQuestMarker", "p": [ "spy", "effects/global_map/quest_mark_silver_01" ] },
								{ "a": "SetQuestMarker", "p": [ "builders", "effects/global_map/quest_mark_silver_01" ] },
								{ "a": "SetQuestMarker", "p": [ "stargazer", "effects/global_map/quest_mark_silver_01" ] },
								{ "a": "SetQuestMarker", "p": [ "construction_site_guard", "effects/global_map/quest_mark_silver_01" ] },							

								{ "a": "AiBanArea", "p": [ "3342" ] },
								{ "a": "AiBanArea", "p": [ "195" ] },
								{ "a": "AiBanArea", "p": [ "1006" ] },
								{ "a": "AiBanArea", "p": [ "333" ] },
								{ "a": "AiBanArea", "p": [ "977" ] },
								{ "a": "AiBanArea", "p": [ "2015" ] },
								{ "a": "AiBanArea", "p": [ "3313" ] },
								{ "a": "AiBanArea", "p": [ "3834" ] },
								{ "a": "AiBanArea", "p": [ "3899" ] },
								{ "a": "AiBanArea", "p": [ "1923" ] },
								{ "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": "GiveUnitHero", "p": [ "twinkle_upg_alt",		"15",	"campaign_M4_hero_sylvan_1" ] },
								{ "a": "GiveUnitHero", "p": [ "elf_tracker_upg",		"25",	"campaign_M4_hero_sylvan_1" ] },
								{ "a": "GiveUnitHero", "p": [ "druid_upg_alt",			"5",	"campaign_M4_hero_sylvan_1" ] },
								{ "a": "GiveUnitHero", "p": [ "ent_upg",				"10",	"campaign_M4_hero_sylvan_1" ] },
								{ "a": "GiveUnitHero", "p": [ "druid_upg",				"5",	"campaign_M4_hero_sylvan_1" ] },
								{ "a": "GiveUnitHero", "p": [ "elf_tracker_upg_alt",	"25",	"campaign_M4_hero_sylvan_1" ] },
								{ "a": "GiveUnitHero", "p": [ "twinkle_upg",			"15",	"campaign_M4_hero_sylvan_1" ] },

								{ "a": "UnlockBuildingCity", "p": [ "Build_Wall", "1", "ded_city" ] },
								{ "a": "CreateBuildingCity", "p": [ "Build_Wall", "1", "ded_city" ] },
								
								{ "a": "AddBuffHeroDays", "p": [ "campaign_heroStatBuff_easy_enemy_half", "campaign_M4_hero_temple_2", "-1" ] },
								{ "a": "AddBuffHeroDays", "p": [ "campaign_heroStatBuff_easy_enemy_half", "campaign_M4_hero_temple_3", "-1" ] },
								{ "a": "AddBuffHeroDays", "p": [ "campaign_heroStatBuff_easy_2", "campaign_hero_1", "-1" ] },
								{ "a": "AddBuffHeroDays", "p": [ "campaign_heroStatBuff_easy_2", "campaign_hero_2", "-1" ] }
							]
						},
						{
							"conditionsLogic": "And",

							"conditions":
							[
								{ "c": "StartTurn", "p": [ "1", "1" ] },
								{ "c": "Difficulty", "p": [ "1" ] }
							],

							"actions":
							[
								{ "a": "GiveUnitHero", "p": [ "twinkle_upg_alt",		"15",	"campaign_M4_hero_sylvan_1" ] },
								{ "a": "GiveUnitHero", "p": [ "elf_tracker_upg",		"25",	"campaign_M4_hero_sylvan_1" ] },
								{ "a": "GiveUnitHero", "p": [ "druid_upg_alt",			"5",	"campaign_M4_hero_sylvan_1" ] },
								{ "a": "GiveUnitHero", "p": [ "ent_upg",				"10",	"campaign_M4_hero_sylvan_1" ] },
								{ "a": "GiveUnitHero", "p": [ "druid_upg",				"5",	"campaign_M4_hero_sylvan_1" ] },
								{ "a": "GiveUnitHero", "p": [ "elf_tracker_upg_alt",	"25",	"campaign_M4_hero_sylvan_1" ] },
								{ "a": "GiveUnitHero", "p": [ "twinkle_upg",			"15",	"campaign_M4_hero_sylvan_1" ] },

								{ "a": "GiveUnitHero", "p": [ "sunlight_cavalry",		"1",	"campaign_M4_hero_temple_2" ] },
								{ "a": "GiveUnitHero", "p": [ "sunlight_cavalry",		"1",	"campaign_M4_hero_temple_3" ] },
								
								{ "a": "GiveStatsHero", "p": [ "offence", "campaign_M4_hero_preacher", "1" ] }, { "a": "GiveStatsHero", "p": [ "defence", "campaign_M4_hero_preacher", "1" ] }, { "a": "GiveStatsHero", "p": [ "spellPower", "campaign_M4_hero_preacher", "2" ] }, { "a": "GiveStatsHero", "p": [ "intelligence", "campaign_M4_hero_preacher", "2" ] },
								{ "a": "GiveStatsHero", "p": [ "offence", "campaign_M4_hero_sylvan_1", "2" ] }, { "a": "GiveStatsHero", "p": [ "defence", "campaign_M4_hero_sylvan_1", "2" ] }, { "a": "GiveStatsHero", "p": [ "spellPower", "campaign_M4_hero_sylvan_1", "3" ] }, { "a": "GiveStatsHero", "p": [ "intelligence", "campaign_M4_hero_sylvan_1", "3" ] },
								{ "a": "GiveStatsHero", "p": [ "offence", "campaign_M4_hero_temple_2", "2" ] }, { "a": "GiveStatsHero", "p": [ "defence", "campaign_M4_hero_temple_2", "2" ] }, { "a": "GiveStatsHero", "p": [ "spellPower", "campaign_M4_hero_temple_2", "2" ] }, { "a": "GiveStatsHero", "p": [ "intelligence", "campaign_M4_hero_temple_2", "2" ] },
								{ "a": "GiveStatsHero", "p": [ "offence", "campaign_M4_hero_temple_3", "2" ] }, { "a": "GiveStatsHero", "p": [ "defence", "campaign_M4_hero_temple_3", "2" ] }, { "a": "GiveStatsHero", "p": [ "spellPower", "campaign_M4_hero_temple_3", "2" ] }, { "a": "GiveStatsHero", "p": [ "intelligence", "campaign_M4_hero_temple_3", "2" ] },
								
								{ "a": "AddBuffHeroDays", "p": [ "campaign_heroStatBuff_easy_enemy_quarter", "campaign_M4_hero_sylvan_2", "-1" ] },
								{ "a": "AddBuffHeroDays", "p": [ "campaign_heroStatBuff_easy_enemy_quarter", "campaign_M4_hero_sylvan_3", "-1" ] },

								{ "a": "CreateBuildingCity", "p": [ "Build_Wall", "1", "enemy_city" ] },
								
								{ "a": "UnlockBuildingCity", "p": [ "Build_Wall", "1", "ded_city" ] },
								{ "a": "CreateBuildingCity", "p": [ "Build_Wall", "1", "ded_city" ] }
							]
						},
						{
							"conditionsLogic": "And",

							"conditions":
							[
								{ "c": "StartTurn", "p": [ "1", "1" ] },
								{ "c": "Difficulty", "p": [ "2" ] }
							],

							"actions":
							[
								{ "a": "GiveUnitHero", "p": [ "twinkle_upg_alt",		"30",	"campaign_M4_hero_sylvan_1" ] },
								{ "a": "GiveUnitHero", "p": [ "elf_tracker_upg",		"50",	"campaign_M4_hero_sylvan_1" ] },
								{ "a": "GiveUnitHero", "p": [ "druid_upg_alt",			"10",	"campaign_M4_hero_sylvan_1" ] },
								{ "a": "GiveUnitHero", "p": [ "ent_upg",				"20",	"campaign_M4_hero_sylvan_1" ] },
								{ "a": "GiveUnitHero", "p": [ "druid_upg",				"10",	"campaign_M4_hero_sylvan_1" ] },
								{ "a": "GiveUnitHero", "p": [ "elf_tracker_upg_alt",	"50",	"campaign_M4_hero_sylvan_1" ] },
								{ "a": "GiveUnitHero", "p": [ "twinkle_upg",			"30",	"campaign_M4_hero_sylvan_1" ] },

								{ "a": "GiveUnitHero", "p": [ "sunlight_cavalry",		"2",	"campaign_M4_hero_temple_2" ] },
								{ "a": "GiveUnitHero", "p": [ "sunlight_cavalry",		"2",	"campaign_M4_hero_temple_3" ] },
								
								{ "a": "GiveStatsHero", "p": [ "offence", "campaign_M4_hero_preacher", "2" ] }, { "a": "GiveStatsHero", "p": [ "defence", "campaign_M4_hero_preacher", "2" ] }, { "a": "GiveStatsHero", "p": [ "spellPower", "campaign_M4_hero_preacher", "4" ] }, { "a": "GiveStatsHero", "p": [ "intelligence", "campaign_M4_hero_preacher", "4" ] },
								{ "a": "GiveStatsHero", "p": [ "offence", "campaign_M4_hero_sylvan_1", "4" ] }, { "a": "GiveStatsHero", "p": [ "defence", "campaign_M4_hero_sylvan_1", "4" ] }, { "a": "GiveStatsHero", "p": [ "spellPower", "campaign_M4_hero_sylvan_1", "6" ] }, { "a": "GiveStatsHero", "p": [ "intelligence", "campaign_M4_hero_sylvan_1", "6" ] },
								{ "a": "GiveStatsHero", "p": [ "offence", "campaign_M4_hero_temple_2", "4" ] }, { "a": "GiveStatsHero", "p": [ "defence", "campaign_M4_hero_temple_2", "4" ] }, { "a": "GiveStatsHero", "p": [ "spellPower", "campaign_M4_hero_temple_2", "4" ] }, { "a": "GiveStatsHero", "p": [ "intelligence", "campaign_M4_hero_temple_2", "4" ] },
								{ "a": "GiveStatsHero", "p": [ "offence", "campaign_M4_hero_temple_3", "4" ] }, { "a": "GiveStatsHero", "p": [ "defence", "campaign_M4_hero_temple_3", "4" ] }, { "a": "GiveStatsHero", "p": [ "spellPower", "campaign_M4_hero_temple_3", "4" ] }, { "a": "GiveStatsHero", "p": [ "intelligence", "campaign_M4_hero_temple_3", "4" ] },

								{ "a": "AddBuffHeroDays", "p": [ "campaign_heroStatBuff_magic_day_1", "campaign_M4_hero_temple_2", "9999" ] },
								{ "a": "AddBuffHeroDays", "p": [ "campaign_heroStatBuff_magic_day_1", "campaign_M4_hero_temple_3", "9999" ] },

								{ "a": "CreateBuildingCity", "p": [ "Build_Wall", "1", "enemy_city" ] },
								{ "a": "CreateBuildingCity", "p": [ "Build_Wall", "2", "enemy_city" ] },
								{ "a": "UnlockBuildingCity", "p": [ "Build_Wall", "1", "ded_city" ] },
								{ "a": "CreateBuildingCity", "p": [ "Build_Wall", "1", "ded_city" ] },
								{ "a": "UnlockBuildingCity", "p": [ "Build_Wall", "2", "ded_city" ] },
								{ "a": "CreateBuildingCity", "p": [ "Build_Wall", "2", "ded_city" ] },

								{ "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": [ "twinkle_upg_alt",		"45",	"campaign_M4_hero_sylvan_1" ] },
								{ "a": "GiveUnitHero", "p": [ "elf_tracker_upg",		"75",	"campaign_M4_hero_sylvan_1" ] },
								{ "a": "GiveUnitHero", "p": [ "druid_upg_alt",			"15",	"campaign_M4_hero_sylvan_1" ] },
								{ "a": "GiveUnitHero", "p": [ "ent_upg",				"30",	"campaign_M4_hero_sylvan_1" ] },
								{ "a": "GiveUnitHero", "p": [ "druid_upg",				"15",	"campaign_M4_hero_sylvan_1" ] },
								{ "a": "GiveUnitHero", "p": [ "elf_tracker_upg_alt",	"75",	"campaign_M4_hero_sylvan_1" ] },
								{ "a": "GiveUnitHero", "p": [ "twinkle_upg",			"45",	"campaign_M4_hero_sylvan_1" ] },

								{ "a": "GiveUnitHero", "p": [ "sunlight_cavalry",		"3",	"campaign_M4_hero_temple_2" ] },
								{ "a": "GiveUnitHero", "p": [ "sunlight_cavalry",		"3",	"campaign_M4_hero_temple_3" ] },
								
								{ "a": "GiveStatsHero", "p": [ "offence", "campaign_M4_hero_preacher", "4" ] }, { "a": "GiveStatsHero", "p": [ "defence", "campaign_M4_hero_preacher", "4" ] }, { "a": "GiveStatsHero", "p": [ "spellPower", "campaign_M4_hero_preacher", "8" ] }, { "a": "GiveStatsHero", "p": [ "intelligence", "campaign_M4_hero_preacher", "8" ] },
								{ "a": "GiveStatsHero", "p": [ "offence", "campaign_M4_hero_sylvan_1", "8" ] }, { "a": "GiveStatsHero", "p": [ "defence", "campaign_M4_hero_sylvan_1", "8" ] }, { "a": "GiveStatsHero", "p": [ "spellPower", "campaign_M4_hero_sylvan_1", "12" ] }, { "a": "GiveStatsHero", "p": [ "intelligence", "campaign_M4_hero_sylvan_1", "12" ] },
								{ "a": "GiveStatsHero", "p": [ "offence", "campaign_M4_hero_temple_2", "6" ] }, { "a": "GiveStatsHero", "p": [ "defence", "campaign_M4_hero_temple_2", "6" ] }, { "a": "GiveStatsHero", "p": [ "spellPower", "campaign_M4_hero_temple_2", "6" ] }, { "a": "GiveStatsHero", "p": [ "intelligence", "campaign_M4_hero_temple_2", "6" ] },
								{ "a": "GiveStatsHero", "p": [ "offence", "campaign_M4_hero_temple_3", "6" ] }, { "a": "GiveStatsHero", "p": [ "defence", "campaign_M4_hero_temple_3", "6" ] }, { "a": "GiveStatsHero", "p": [ "spellPower", "campaign_M4_hero_temple_3", "6" ] }, { "a": "GiveStatsHero", "p": [ "intelligence", "campaign_M4_hero_temple_3", "6" ] },

								{ "a": "AddBuffHeroDays", "p": [ "campaign_heroStatBuff_magic_day_2", "campaign_M4_hero_temple_2", "9999" ] },
								{ "a": "AddBuffHeroDays", "p": [ "campaign_heroStatBuff_magic_day_2", "campaign_M4_hero_temple_3", "9999" ] },

								{ "a": "UnlockBuildingCity", "p": [ "Build_Wall", "3", "enemy_city" ] },
								{ "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": "UnlockBuildingCity", "p": [ "Build_Wall", "1", "ded_city" ] },
								{ "a": "CreateBuildingCity", "p": [ "Build_Wall", "1", "ded_city" ] },
								{ "a": "UnlockBuildingCity", "p": [ "Build_Wall", "2", "ded_city" ] },
								{ "a": "CreateBuildingCity", "p": [ "Build_Wall", "2", "ded_city" ] },
								{ "a": "UnlockBuildingCity", "p": [ "Build_Wall", "3", "ded_city" ] },
								{ "a": "CreateBuildingCity", "p": [ "Build_Wall", "3", "ded_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", "1", "enemy_city" ] },
								{ "a": "CreateBuildingCity", "p": [ "Build_Tier_4", "1", "enemy_city" ] }
							]
						}
					]
				}
			]
		},

		{
			"sid": "Questlog0",
			"main": true,

			"comment": "Квест 'Герои не должны умереть'",

			"activeOnStart": true,
			"sharing": "Clone",

			"name": "quest_name_genericQ0",

			"subQuests":
			[
				{
					"sid": "Questlog0_1",
					"activeOnStart": true,
					
					"name": "quest_sub_M4Q0_1",

					"triggers":
					[
						{
							"conditions":
							[
								{ "c": "Counter", "p": [ "found_burning_man", "=", "1" ] }
							],

							"actions":
							[
								{ "a": "CurrentSubQuestDone" }
							]
						},
						{
							"conditionsLogic": "Or",
							"conditions":
							[
								{ "c": "HeroKill", "p": [ "campaign_hero_1" ] },
								{ "c": "HeroKill", "p": [ "campaign_hero_2" ] }
							],

							"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": "AddBuffHeroDays", "p": [ "campaign_movement_buff", "campaign_hero_2" ] },
								{ "a": "SetHeroMovePoints", "p": [ "campaign_hero_1", "350" ] },
								{ "a": "SetHeroMovePoints", "p": [ "campaign_hero_2", "350" ] }
							]
						}
					]
				}
			]
		},

			{
				"sid": "setupQuestlog1",
				"hidden": true,

				"comment": "quest to setup main quest",

				"activeOnStart": true,
				"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": "main quest - 1) find portal, 2) visit druid, 3) defeat opponent, 4) reach burning man; druid can be killed at any moment to skip to the end",

			"sharing": "Clone",

			"name": "quest_name_M4bQ1",
			"desc": "quest_desc_M4bQ1",

			"subQuests":
			[	
				{
					"sid": "Questlog1_1",
					"activeOnStart": true,
					
					"comment": "find a portal",
					
					"name": "quest_sub_M4bQ1_1",

					"triggers":
					[
						{
							"conditions":
							[
								{ "c": "Counter", "p": [ "find_druid_quest", ">", "0" ] }
							],

							"actions":
							[
								{ "a": "CurrentSubQuestDone" },
								{ "a": "NextSubQuest", "p": [ "Questlog1_2" ] },

								{ "a": "SetActiveVFX", "p": [ "qm_ignacius", "false" ] },
								{ "a": "SetActiveVFX", "p": [ "em_ignacius", "true" ] }
							]
						},
						{
							"conditions":
							[
								{ "c": "Counter", "p": [ "main_quest_druid_kill", ">", "0" ] }
							],

							"actions":
							[
								{ "a": "NextSubQuest", "p": [ "Questlog1_4" ] },
								
								{ "a": "SetActiveVFX", "p": [ "qm_ignacius", "false" ] },
								{ "a": "SetActiveVFX", "p": [ "qm_portal1", "false" ] },
								{ "a": "SetActiveVFX", "p": [ "qm_portal2", "false" ] },
								{ "a": "SetActiveVFX", "p": [ "qm_portal3", "false" ] }
							]
						},
						{
							"conditions":
							[
								{ "c": "Counter", "p": [ "defeat_enemy_quest", "=", "1" ] }
							],

							"actions":
							[
								{ "a": "NextSubQuest", "p": [ "Questlog1_3" ] },
								
								{ "a": "SetActiveVFX", "p": [ "qm_ignacius", "false" ] },
								{ "a": "SetActiveVFX", "p": [ "qm_portal1", "false" ] },
								{ "a": "SetActiveVFX", "p": [ "qm_portal2", "false" ] },
								{ "a": "SetActiveVFX", "p": [ "qm_portal3", "false" ] }
							]
						},			
						{
							"conditions":
							[
								{ "c": "Counter", "p": [ "go_to_burning_man_quest", "=", "1" ] }
							],

							"actions":
							[
								{ "a": "NextSubQuest", "p": [ "Questlog1_4" ] },
								
								{ "a": "SetActiveVFX", "p": [ "qm_portal1", "false" ] },
								{ "a": "SetActiveVFX", "p": [ "qm_portal2", "false" ] },
								{ "a": "SetActiveVFX", "p": [ "qm_portal3", "false" ] },
								{ "a": "CreateVFX", "p": [ "fx_quest_mark_gold_03", "3407", "false", "true", "pm_portal1" ] },
								{ "a": "CreateVFX", "p": [ "fx_quest_mark_gold_03", "1071", "false", "true", "pm_portal2" ] },
								{ "a": "CreateVFX", "p": [ "fx_quest_mark_gold_03", "258", "false", "true", "pm_portal3" ] }
							]
						}
					]
				},
				{
					"sid": "Questlog1_2",
					"activeOnStart": false,
					
					"comment": "find Ignacius",
					
					"name": "quest_sub_M4bQ1_2",

					"triggers":
					[
						{
							"conditions":
							[
								{ "c": "Counter", "p": [ "main_quest_ignat_first_dialog", ">", "0" ] }
							],

							"actions":
							[
								{ "a": "CurrentSubQuestDone" }
							]
						},
						{
							"conditions":
							[
								{ "c": "Counter", "p": [ "main_quest_druid_kill", ">", "0" ] }
							],

							"actions":
							[
								{ "a": "NextSubQuest", "p": [ "Questlog1_4" ] },
								
								{ "a": "SetActiveVFX", "p": [ "em_ignacius", "false" ] }
							]
						},
						{
							"conditions":
							[
								{ "c": "Counter", "p": [ "defeat_enemy_quest", "=", "1" ] }
							],

							"actions":
							[
								{ "a": "NextSubQuest", "p": [ "Questlog1_3" ] }
							]
						},
						{
							"conditions":
							[
								{ "c": "Counter", "p": [ "go_to_burning_man_quest", "=", "1" ] }
							],

							"actions":
							[
								{ "a": "NextSubQuest", "p": [ "Questlog1_4" ] },

								{ "a": "SetActiveVFX", "p": [ "em_ignacius", "false" ] },
								{ "a": "CreateVFX", "p": [ "fx_quest_mark_gold_03", "3407", "false", "true", "pm_portal1" ] },
								{ "a": "CreateVFX", "p": [ "fx_quest_mark_gold_03", "1071", "false", "true", "pm_portal2" ] },
								{ "a": "CreateVFX", "p": [ "fx_quest_mark_gold_03", "258", "false", "true", "pm_portal3" ] }
							]
						}
					]
				},
				{
					"sid": "Questlog1_3",
					"activeOnStart": false,
					
					"comment": "defeat your opponents",
					
					"name": "quest_sub_M4bQ1_3",

					"triggers":
					[
						{
							"conditions":
							[
								{ "c": "Counter", "p": [ "main_quest_opponent_defeated", ">", "0" ] }
							],

							"actions":
							[
								{ "a": "CurrentSubQuestDone" }
							]
						},
						{
							"conditions":
							[
								{ "c": "Counter", "p": [ "go_to_burning_man_quest", "=", "1" ] }
							],

							"actions":
							[
								{ "a": "NextSubQuest", "p": [ "Questlog1_4" ] },
								
								{ "a": "SetActiveVFX", "p": [ "em_ignacius", "false" ] },
								{ "a": "CreateVFX", "p": [ "fx_quest_mark_gold_03", "3407", "false", "true", "pm_portal1" ] },
								{ "a": "CreateVFX", "p": [ "fx_quest_mark_gold_03", "1071", "false", "true", "pm_portal2" ] },
								{ "a": "CreateVFX", "p": [ "fx_quest_mark_gold_03", "258", "false", "true", "pm_portal3" ] }
							]
						},
						{
							"conditions":
							[
								{ "c": "Counter", "p": [ "main_quest_druid_kill", ">", "0" ] }
							],

							"actions":
							[
								{ "a": "NextSubQuest", "p": [ "Questlog1_4" ] },
								
								{ "a": "SetActiveVFX", "p": [ "em_ignacius", "false" ] }
							]
						}
					]
				},
				{
					"sid": "Questlog1_4",
					"activeOnStart": false,
					
					"comment": "go to the mystery energy source (burning man)",
					
					"name": "quest_sub_M4bQ1_4",

					"triggers":
					[
						{
							"conditions":
							[
								{ "c": "Counter", "p": [ "found_burning_man", "=", "1" ] }
							],

							"actions":
							[
								{ "a": "CurrentSubQuestDone" }
							]
						}
					]
				}
			]
		},
			{
				"sid": "supportQuestlog1",
				"hidden": true,

				"comment": "quest to activate dialog upon entering grove + defeating opponents",

				"activeOnStart": true,
				"sharing": "Clone",

				"subQuests":
				[	
					{
						"sid": "1",
						"activeOnStart": true,					

						"triggers":
						[
							{
								"conditionsLogic": "Or",
								"conditions":
								[
									{ "c": "ObjectInteractionAfter", "p": [ "portal1" ] },
									{ "c": "ObjectInteractionAfter", "p": [ "portal2" ] },
									{ "c": "ObjectInteractionAfter", "p": [ "portal3" ] }
								],

								"actions":
								[
									{ "a": "Dialog", "p": [ "M4Q1_dial8" ] }
								]
							},
							{
								"conditions":
								[
									{ "c": "PlayerDefeated", "p": [ "1" ] }
								],

								"actions":
								[
									{ "a": "Dialog", "p": [ "M4Q1_dial5" ] }
								]
							}
						]
					}
				]
			},
		
			{
				"sid": "setupQuestlog2",
				"hidden": true,

				"comment": "quest to setup construction quest",

				"activeOnStart": true,
				"sharing": "Clone",

				"subQuests":
				[	
					{
						"sid": "1",
						"activeOnStart": true,					

						"triggers":
						[
							{
								"conditions":
								[
									{ "c": "Counter", "p": [ "construction_quest", "=", "1" ] }
								],

								"actions":
								[
									{ "a": "NextQuest", "p": [ "Questlog2" ] }
								]
							}
						]
					}
				]
			},
		{
			"sid": "Questlog2",

			"comment": "construction quest",

			"activeOnStart": false,
			"sharing": "Clone",

			"name": "quest_name_M4Q2_1",

			"subQuests":
			[	
				{
					"sid": "Questlog2_1",
					"activeOnStart": true,
					
					"name": "quest_sub_M4Q2_1",

					"triggers":
					[
						{
							"conditions":
							[
								{ "c": "Counter", "p": [ "construction_quest", "=", "2" ] }
							],

							"actions":
							[
								{ "a": "CurrentSubQuestDone" },
								{ "a": "NextQuest" }
							]
						},
						{
							"conditions":
							[
								{ "c": "Counter", "p": [ "construction_quest", "=", "3" ] }
							],

							"actions":
							[
								{ "a": "NextQuest" }
							]
						}
					]
				}
			]
		},

			{
				"sid": "setupQuestlog3",
				"hidden": true,

				"comment": "quest to setup spy quest",

				"activeOnStart": true,
				"sharing": "Clone",

				"subQuests":
				[	
					{
						"sid": "setupQuestlog3_1",
						"activeOnStart": true,					

						"triggers":
						[
							{
								"conditions":
								[
									{ "c": "Counter", "p": [ "spy_quest", "=", "1" ] }
								],

								"actions":
								[
									{ "a": "NextQuest", "p": [ "Questlog3" ] },

									{ "a": "SetQuestMarker", "p": [ "diary", "effects/global_map/quest_mark_silver_02" ] }
								]
							}
						]
					}
				]
			},
		{
			"sid": "Questlog3",

			"comment": "spy quest",

			"activeOnStart": false,
			"sharing": "Clone",

			"name": "quest_name_M4Q3_1",

			"subQuests":
			[
				{
					"sid": "Questlog3_1",
					"activeOnStart": true,
					
					"name": "quest_sub_M4Q3_1",

					"triggers":
					[
						{
							"conditions":
							[
								{ "c": "Counter", "p": [ "spy_quest", "=", "2" ] }
							],

							"actions":
							[
								{ "a": "CurrentSubQuestDone" },
								{ "a": "NextQuest" }
							]
						}
					]
				}
			]
		},
		
			{
				"sid": "setupQuestlog5",
				"hidden": true,

				"comment": "quest to setup preacher quest",

				"activeOnStart": true,
				"sharing": "Clone",

				"subQuests":
				[	
					{
						"sid": "setupQuestlog5_1",
						"activeOnStart": true,					

						"triggers":
						[
							{
								"conditions":
								[
									{ "c": "Counter", "p": [ "preacher_quest", "=", "1" ] }
								],

								"actions":
								[
									{ "a": "NextQuest", "p": [ "Questlog5" ] },
									
									{ "a": "SetActiveVFX", "p": [ "qm_preacher", "false" ] },
									{ "a": "CreateVFX", "p": [ "fx_quest_mark_silver_02", "1858", "false", "true", "em_preacher" ] },
									{ "a": "SetQuestMarker", "p": [ "pagan_dwelling1", "effects/global_map/quest_mark_silver_02" ] },
									{ "a": "SetQuestMarker", "p": [ "pagan_dwelling2", "effects/global_map/quest_mark_silver_02" ] },
									{ "a": "SetQuestMarker", "p": [ "pagan_dwelling3", "effects/global_map/quest_mark_silver_02" ] }
								]
							}
						]
					}
				]
			},
		{
			"sid": "Questlog5",

			"comment": "preacher quest",

			"activeOnStart": false,
			"sharing": "Clone",

			"name": "quest_name_M4Q5_1",
			"desc": "quest_desc_M4Q5_1",

			"subQuests":
			[
				{
					"sid": "Questlog5_1",
					"activeOnStart": true,
					
					"name": "quest_sub_M4Q5_1",

					"triggers":
					[
						{
							"conditions":
							[
								{ "c": "Counter", "p": [ "preacher_quest", "=", "2" ] }
							],

							"actions":
							[
								{ "a": "CurrentSubQuestDone" },
								{ "a": "NextSubQuest", "p": [ "Questlog5_2" ] }
							]
						},
						{
							"conditions":
							[
								{ "c": "Counter", "p": [ "preacher_quest", "=", "4" ] }
							],

							"actions":
							[
								{ "a": "NextSubQuest", "p": [ "Questlog5_3" ] }
							]
						},
						{
							"conditions":
							[
								{ "c": "Counter", "p": [ "preacher_quest", "=", "3" ] }
							],

							"actions":
							[
								{ "a": "NextQuest" },

								{ "a": "SetActiveVFX", "p": [ "em_preacher", "false" ] }
							]
						}
					]
				},
				{
					"sid": "Questlog5_2",
					
					"name": "quest_sub_M4Q5_2",

					"triggers":
					[
						{
							"conditions":
							[
								{ "c": "Counter", "p": [ "preacher_quest", "=", "5" ] }
							],

							"actions":
							[
								{ "a": "CurrentSubQuestDone" },
								{ "a": "NextQuest" },

								{ "a": "SetActiveVFX", "p": [ "em_preacher", "false" ] }
							]
						}
					]
				},
				{
					"sid": "Questlog5_3",
					
					"name": "quest_sub_M4Q5_3",

					"triggers":
					[
						{
							"conditions":
							[
								{ "c": "Counter", "p": [ "preacher_quest", "=", "5" ] }
							],

							"actions":
							[
								{ "a": "CurrentSubQuestDone" },
								{ "a": "NextQuest" },

								{ "a": "SetActiveVFX", "p": [ "em_preacher", "false" ] }
							]
						}
					]
				}
			]
		},	
			{
				"sid": "supportQuestlog5",

				"comment": "preacher quest",
				"hidden": true,
				"activeOnStart": true,
				"sharing": "Clone",

				"subQuests":
				[
					{
						"sid": "1",
						"activeOnStart": true,

						"triggers":
						[
							{
								"conditions":
								[
									{ "c": "SquadKill", "p": [ "pagan_squad1" ] }
								],

								"actions":
								[
									{ "a": "CaptureObject", "p": [ "pagan_dwelling1" ] },
									{ "a": "CounterPlus", "p": [ "pagan_squad_defeated", "1" ] }									
								]
							},
							{
								"conditions":
								[
									{ "c": "SquadKill", "p": [ "pagan_squad2" ] }
								],

								"actions":
								[
									{ "a": "CaptureObject", "p": [ "pagan_dwelling2" ] },
									{ "a": "CounterPlus", "p": [ "pagan_squad_defeated", "1" ] }
								]
							},
							{
								"conditions":
								[
									{ "c": "SquadKill", "p": [ "pagan_squad3" ] }
								],

								"actions":
								[
									{ "a": "CaptureObject", "p": [ "pagan_dwelling3" ] },
									{ "a": "CounterPlus", "p": [ "pagan_squad_defeated", "1" ] }
								]
							},
							{
								"conditions":
								[
									{ "c": "Counter", "p": [ "pagan_squad_defeated", "=", "1" ] }
								],

								"actions":
								[
									{ "a": "Dialog", "p": [ "M4Q5_dial10" ] }
								]
							},
							{
								"conditions":
								[
									{ "c": "Counter", "p": [ "pagan_squad_defeated", "=", "2" ] }
								],

								"actions":
								[
									{ "a": "Dialog", "p": [ "M4Q5_dial11" ] }
								]
							}
						]
					}
				]
			}	
	]
}