##Made by Ogele 'Comrade Flan'
#No mission tree from me shall ever be as big as this one...
tur_conquest_of_europe = {
	slot = 1
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Domination"
	}
	potential = {
		has_dlc = "Domination"
		tag = TUR
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes

	tur_the_crescent_fleet = {
		icon = mission_arabian_ports
		required_missions = {  }
		position = 1
		provinces_to_highlight = {
		}
		trigger = {
			num_of_galley = 10
			navy_size_percentage = 0.9
		}
		effect = {
			create_admiral = {
				tradition = 50
			}
		}

		ai_weight = {
			factor = 250
		}
	}

	tur_maritime_presence = {
		icon = mission_arabian_sea_trade
		required_missions = { tur_the_crescent_fleet }
		position = 2
		provinces_to_highlight = {
			OR = {
				province_id = 377
				province_id = 358
				province_id = 137
			}
			NOT = {
				trade_share = {
					country = ROOT
					share = 20
				}
			}
		}
		trigger = {
			num_ships_protecting_trade = 10
			OR = {
				377 = {
					trade_share = {
						country = ROOT
						share = 20
					}
				}
				358 = {
					trade_share = {
						country = ROOT
						share = 20
					}
				}
				137 = {
					trade_share = {
						country = ROOT
						share = 20
					}
				}
			}
		}
		effect = {
			hidden_effect = {
				home_trade_node_effect_scope = {
					random_trade_node_member_province = {
						limit = {
							owned_by = ROOT
						}
						save_event_target_as = reward_province
					}
					random_trade_node_member_province = {
						limit = {
							owned_by = ROOT
							has_port = yes
						}
						save_event_target_as = reward_province
					}
					random_trade_node_member_province = {
						limit = {
							owned_by = ROOT
							is_capital = yes
						}
						save_event_target_as = reward_province
					}
					random_trade_node_member_province = {
						limit = {
							owned_by = ROOT
							is_capital = yes
							has_port = yes
						}
						save_event_target_as = reward_province
					}
					random_trade_node_member_province = {
						limit = {
							owned_by = ROOT
							development = CAPITAL
							is_capital = no
						}
						save_event_target_as = reward_province
					}
					random_trade_node_member_province = {
						limit = {
							owned_by = ROOT
							development = CAPITAL
							is_capital = no
							has_port = yes
						}
						save_event_target_as = reward_province
					}
					random_trade_node_member_province = {
						limit = {
							owned_by = ROOT
							development = CAPITAL
							is_capital = no
							development = 20
						}
						save_event_target_as = reward_province
					}
					random_trade_node_member_province = {
						limit = {
							owned_by = ROOT
							development = CAPITAL
							is_capital = no
							development = 20
							has_port = yes
						}
						save_event_target_as = reward_province
					}
					random_trade_node_member_province = {
						limit = {
							owned_by = ROOT
							development = CAPITAL
							is_capital = no
							development = 25
						}
						save_event_target_as = reward_province
					}
					random_trade_node_member_province = {
						limit = {
							owned_by = ROOT
							development = CAPITAL
							is_capital = no
							development = 25
							has_port = yes
						}
						save_event_target_as = reward_province
					}
					random_trade_node_member_province = {
						limit = {
							owned_by = ROOT
							development = CAPITAL
							is_capital = no
							development = 30
						}
						save_event_target_as = reward_province
					}
					random_trade_node_member_province = {
						limit = {
							owned_by = ROOT
							development = CAPITAL
							is_capital = no
							development = 30
							has_port = yes
						}
						save_event_target_as = reward_province
					}
				}
			}
			if = {
				limit = { has_saved_event_target = reward_province }
				event_target:reward_province = {
					add_province_modifier = {
						name = "dominant_trade_hub"
						duration = -1
					}
					add_latest_building = {
						builder = ROOT
						trade = yes
					}
				}
			}
			else = {
				custom_tooltip = tur_maritime_presence_tt
			}
		}

		ai_weight = {
			factor = 250
		}
	}

	tur_venetian_relations = {
		icon = personal_diplomacy
		required_missions = {
			tur_maritime_presence
			tur_city_of_worlds_desire
		}
		position = 4
		provinces_to_highlight = {
			is_capital_of = VEN
		}
		trigger = {
			if = {
				limit = {
					exists = VEN
				}
				VEN = {
					OR = {
						AND = {
							alliance_with = ROOT
							has_opinion = {
								who = ROOT
								value = 100
							}
						}
						is_subject_of = ROOT
						AND = {
							has_been_insulted_by_root = yes
							ROOT = {
								has_won_war_against = {
									max_years_since = 25
									who = VEN
								}
							}
						}
					}
				}
				num_of_galley = VEN
				num_of_heavy_ship = VEN
				naval_forcelimit = VEN
			}
			else = {
				num_of_galley = 20
				num_of_heavy_ship = 5
				naval_forcelimit = 40
			}
		}
		effect = {
			add_navy_tradition = 15
			if = {
				limit = {
					exists = VEN
				}
				custom_tooltip = tur_venetian_relations_at
				if = {
					limit = {
						VEN = { alliance_with = ROOT }
					}
					custom_tooltip = BONUS_REWARD_YES
				}
				else = { custom_tooltip = BONUS_REWARD_NO }
				tooltip = {
					country_event_with_insight = {
						id = flavor_tur.200
						insight_tooltip = tur_venetian_relations_bt
					}
				}
				custom_tooltip = mission_alternatively_tt
				if = {
					limit = {
						VEN = {
							OR = {
								is_subject_of = ROOT
								exists = no
								AND = {
									has_been_insulted_by_root = yes
									ROOT = {
										has_won_war_against = {
											max_years_since = 25
											who = PREV
										}
									}
								}
							}
						}
					}
					custom_tooltip = BONUS_REWARD_YES
				}
				else = { custom_tooltip = BONUS_REWARD_NO }
				tooltip = {
					add_mercantilism = 3
					add_country_modifier = {
						name = tur_preperation_for_naval_war
						duration = 7300
					}
				}
				hidden_effect = {
					if = {
						limit = { VEN = { alliance_with = ROOT } }
						country_event_with_insight = {
							id = flavor_tur.200
							insight_tooltip = tur_venetian_relations_bt
						}
					}
					else = {
						add_mercantilism = 3
						add_country_modifier = {
							name = tur_preperation_for_naval_war
							duration = 7300
						}
					}
				}
			}
			else = {
				add_mercantilism = 3
				add_country_modifier = {
					name = tur_preperation_for_naval_war
					duration = 7300
				}
			}
		}

		ai_weight = {
			factor = 250
		}
	}

	tur_the_bospborus_control = {
		icon = mission_the_bospborus
		required_missions = {
			tur_venetian_relations
			tur_conquer_greece
		}
		position = 5
		provinces_to_highlight = {
			if = {
				limit = { has_saved_global_event_target = tur_ottoman_trade_partner }
				is_capital = yes
				owner = {
					tag = event_target:tur_ottoman_trade_partner
					NOT = {
						has_opinion = {
							who = ROOT
							value = 190
						}
					}
				}
			}
			else = {
				OR = {
					area = aegean_archipelago_area
					province_id = 163
					province_id = 142
					province_id = 321
					province_id = 4698
				}
				NOT = { country_or_non_sovereign_subject_holds = ROOT }
			}
		}
		trigger = {
			if = {
				limit = {
					OR = {
						has_country_flag = tur_is_in_event
						NOT = { mission_completed = tur_venetian_relations }
					}
				}
				custom_trigger_tooltip = {
					tooltip = tur_the_bospborus_control_at
					always = no
				}
				custom_trigger_tooltip = {
					tooltip = tur_the_bospborus_control_bt
					always = no
				}
				aegean_archipelago_area = {
					country_or_non_sovereign_subject_holds = ROOT
					type = all
				}
				owns_or_non_sovereign_subject_of = 163
				owns_or_non_sovereign_subject_of = 142
				owns_or_non_sovereign_subject_of = 321
				owns_or_non_sovereign_subject_of = 4698
			}
			else = {
				if = {
					limit = {
						has_country_modifier = tur_ottoman_venetian_trade_deal_modifier
						has_saved_global_event_target = tur_ottoman_trade_partner
					}
					OR = {
						reverse_has_opinion = {
							who = event_target:tur_ottoman_trade_partner
							value = 190
						}
						home_trade_node = {
							is_strongest_trade_power = event_target:tur_ottoman_trade_partner
						}
					}
				}
				else = {
					aegean_archipelago_area = {
						country_or_non_sovereign_subject_holds = ROOT
						type = all
					}
					owns_or_non_sovereign_subject_of = 163
					owns_or_non_sovereign_subject_of = 142
					owns_or_non_sovereign_subject_of = 321
					owns_or_non_sovereign_subject_of = 4698
				}
			}
		}
		effect = {
			simple_dynamic_effect = {
				first_custom_tooltip = tur_the_bospborus_control_ct
				first_limit = "has_saved_global_event_target = tur_ottoman_trade_partner"
				first_effect = "
				country_event_with_insight = {
					id = flavor_tur.202
					insight_tooltip = tur_the_bospborus_control_dt
				}"
				second_limit = "NOT = { has_saved_global_event_target = tur_ottoman_trade_partner }"
				second_effect = "
				add_mercantilism = 5
				home_trade_node_effect_scope = {
					add_trade_modifier = {
						who = ROOT
						duration = -1
						power = 50
						key = TUR_GRIP_OVER_THE_BOSPBORUS
					}
				}
				add_country_modifier = {
					name = tur_economical_reforms
					duration = -1
				}
				add_treasury = 250"
			}
		}

		ai_weight = {
			factor = 250
		}
	}

	tur_conquer_hungary = {
		icon = mission_destroy_the_hungarians
		required_missions = { tur_push_into_the_balkans }
		position = 6
		provinces_to_highlight = {
			OR = {
				area = slovakia_area
				area = transylvania_area
				area = southern_transylvania_area
				area = alfold_area
				area = transdanubia_area
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				OR = {
					area = slovakia_area
					area = transylvania_area
					area = southern_transylvania_area
					area = alfold_area
					area = transdanubia_area
				}
				value = 15
			}
		}
		effect = {
			if = {
				limit = {
					HUN = {
						is_subject_of = ROOT
					}
				}
				if = {
					limit = { HUN = { is_subject_of_type = eyalet } }
					HUN = {
						hidden_effect = {
							grant_independence = yes
						}
					}
					create_subject = {
						who = HUN
						subject_type = core_eyalet
					}
					add_dip_power = 100
				}
				else = {
					country_event_with_insight = {
						id = flavor_tur.209
						insight_tooltip = IS_EYALET_EVENT_TT
					}
				}
			}
			else = {
				add_mil_power = 100
			}
			austria_proper_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			inner_austria_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			carinthia_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			tirol_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
		}

		ai_weight = {
			factor = 250
		}
	}

	tur_conquer_vienna = {
		icon = humiliate_austria
		required_missions = { tur_conquer_hungary }
		position = 7
		provinces_to_highlight = {
			OR = {
				area = austria_proper_area
				area = inner_austria_area
				area = carinthia_area
				area = tirol_area
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			OR = {
				custom_trigger_tooltip = {
					tooltip = tur_conquer_vienna_tt
					has_country_flag = tur_gateway_to_europe
				}
				owns_or_non_sovereign_subject_of = 134
			}
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				OR = {
					area = austria_proper_area
					area = inner_austria_area
					area = carinthia_area
					area = tirol_area
				}
				value = 10
			}
		}
		effect = {
			if = {
				limit = {
					owns_or_non_sovereign_subject_of = 134
					NOT = { has_country_flag = tur_gateway_to_europe }
				}
				custom_tooltip = flavor_tur.211.a.tt
				hidden_effect = {
					every_known_country = {
						limit = {
							capital_scope = {
								OR = {
									region = north_german_region
									region = south_german_region
									region = italy_region
								}
							}
							religion_group = christian
						}
						country_event = {
							id = flavor_tur.212
						}
					}
				}
			}
			add_power_projection = {
				type = mission_rewards_power_projection
				amount = 25
			}
			venetia_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			po_valley_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			emilia_romagna_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			lombardy_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			piedmont_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			liguria_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
		}

		ai_weight = {
			factor = 250
		}
	}

	tur_conquer_italy = {
		icon = mission_conquer_north_italy
		required_missions = { tur_conquer_vienna }
		position = 8
		provinces_to_highlight = {
			OR = {
				area = venetia_area
				area = po_valley_area
				area = emilia_romagna_area
				area = lombardy_area
				area = piedmont_area
				area = liguria_area
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				OR = {
					area = venetia_area
					area = po_valley_area
					area = emilia_romagna_area
					area = lombardy_area
					area = piedmont_area
					area = liguria_area
				}
				value = 10
			}
		}
		effect = {
			add_prestige_or_monarch_power = {
				amount = 50
			}
			add_country_modifier = {
				name = tur_march_for_rome
				duration = 9125
			}
			tuscany_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			central_italy_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			lazio_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
		}

		ai_weight = {
			factor = 250
		}
	}

	tur_devleti_rum = {
		icon = mission_the_roman_sultan
		required_missions = { tur_conquer_italy }
		position = 9
		provinces_to_highlight = {
			OR = {
				AND = {
					province_id = 151
					OR = {
						NOT = { owned_by = ROOT }
						NOT = { is_core = ROOT }
						NOT = { religion = ROOT }
					}
				}
				AND = {
					province_id = 118
					OR = {
						NOT = { owned_by = ROOT }
						NOT = { is_core = ROOT }
						NOT = { religion = ROOT }
					}
				}
				AND = {
					NOT = { province_id = 118 }
					OR = {
						area = tuscany_area
						area = central_italy_area
						area = lazio_area
					}
					NOT = { country_or_non_sovereign_subject_holds = ROOT }
				}
			}
		}
		trigger = {
			151 = {
				owned_by = ROOT
				is_core = ROOT
				religion = ROOT
			}
			118 = {
				owned_by = ROOT
				is_core = ROOT
				religion = ROOT
			}
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				OR = {
					area = tuscany_area
					area = central_italy_area
					area = lazio_area
				}
				value = 10
			}
		}
		effect = {
			country_event_with_insight = {
				id = flavor_tur.216
				insight_tooltip = INSIGHT_JUST_TOOLTIP
				effect_tooltip = "
				add_country_modifier = {
					name = tur_crown_of_rome_modifier
					duration = -1
				}"
			}
			italy_region = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
		}

		ai_weight = {
			factor = 250
		}
	}

	tur_address_firman = {

		icon = mission_the_firman
		required_missions = {  }
		position = 10
		provinces_to_highlight = {
			OR = {
				owned_by = GRA
				owned_by = ADU
				province_id = 1294
			}
		}
		trigger = {
			OR = {
				custom_trigger_tooltip = {
					tooltip = tur_moriscos_were_expelled_tt
					OR = {
						NOT = { exists = GRA }
						has_global_flag = expulsion_of_the_moriscos_flag
					}
				}
				custom_trigger_tooltip = {
					tooltip = tur_allied_married_to_gra_and_tt
					OR = {
						AND = {
							alliance_with = ADU
							marriage_with = ADU
						}
						AND = {
							alliance_with = GRA
							marriage_with = GRA
						}
					}
				}
				GRA = { is_subject_of = ROOT }
				ADU = { is_subject_of = ROOT }
			}
			1294 = {
				transports_in_province = 15
				transports_in_province = ROOT
			}
		}
		effect = {
			custom_tooltip = tur_alliance_exchange_population_and_historical_friendship_tt
			if = {
				limit = {
					OR = {
						AND = {
							alliance_with = ADU
							marriage_with = ADU
						}
						AND = {
							alliance_with = GRA
							marriage_with = GRA
						}
						GRA = { is_subject_of = ROOT }
						ADU = { is_subject_of = ROOT }
					}
				}
				custom_tooltip = BONUS_REWARD_YES
			}
			else = { custom_tooltip = BONUS_REWARD_NO }
			tooltip = {
				custom_tooltip = tur_alliance_exchange_population_and_historical_friendship_at
				tur_address_firman_effect_a = yes
			}
			custom_tooltip = mission_alternatively_tt
			custom_tooltip = tur_expelling_annexation_of_moriscos_grants_tt
			if = {
				limit = {
					OR = {
						NOT = { exists = GRA }
						has_country_modifier = mor_andalucian_moors
					}
				}
				custom_tooltip = BONUS_REWARD_YES
			}
			else = { custom_tooltip = BONUS_REWARD_NO }
			tooltip = {
				tur_address_firman_effect_b = yes
			}
			hidden_effect = {
				if = {
					limit = {
						OR = {
							AND = {
								alliance_with = ADU
								marriage_with = ADU
							}
							AND = {
								alliance_with = GRA
								marriage_with = GRA
							}
							GRA = { is_subject_of = ROOT }
							ADU = { is_subject_of = ROOT }
						}
					}
					custom_tooltip = tur_alliance_exchange_population_and_historical_friendship_at
					tur_address_firman_effect_a = yes
				}
				else = {
					tur_address_firman_effect_b = yes
				}
			}
		}

		ai_weight = {
			factor = 250
		}
	}

	tur_al_andalus_eyalet = {
		icon = mission_eyalet_andalusia
		required_missions = {
			tur_address_firman
			tur_the_algerian_corsairs
		}
		position = 11
		provinces_to_highlight = {
			region = iberia_region
			NOT = { owned_by = ROOT }
		}
		trigger = {
			OR = {
				custom_trigger_tooltip = {
					tooltip = tur_al_andalus_eyalet_ct
					OR = {
						any_subject_country = {
							religion = ROOT
							owns = 225
							owns = 223
							owns = 226
							owns = 224
							num_of_owned_provinces_with = {
								region = iberia_region
								value = 10
							}
							capital_scope = {
								region = iberia_region
							}
						}
						any_ally = {
							religion = ROOT
							owns = 225
							owns = 223
							owns = 226
							owns = 224
							num_of_owned_provinces_with = {
								region = iberia_region
								value = 10
							}
							capital_scope = {
								region = iberia_region
							}
						}
					}
				}
				AND = {
					owns = 225
					owns = 223
					owns = 226
					owns = 224
					num_of_owned_provinces_with = {
						region = iberia_region
						value = 10
					}
				}
			}
		}
		effect = {
			simple_dynamic_effect = {
				first_custom_tooltip = tur_al_andalus_eyalet_at
				first_limit = "tur_al_andalus_eyalet_limit_a = yes"
				first_effect = "tur_al_andalus_eyalet_effect_a = yes"
				second_limit = "
				owns = 225
				owns = 223
				owns = 226
				owns = 224
				num_of_owned_provinces_with = {
					region = iberia_region
					value = 10
				}"
				second_effect = "
				add_country_modifier = {
					name = tur_conquest_of_iberia
					duration = -1
				}"
			}
		}

		ai_weight = {
			factor = 250
		}
	}

	tur_embrace_the_military_doctrines = {
		icon = mission_early_janissaries
		required_missions = {  }
		position = 13
		provinces_to_highlight = {
			OR = {
				AND = {
					province_id = 151
					OR = {
						NOT = { is_core = ROOT }
						NOT = { owned_by = ROOT }
						NOT = { has_building = soldier_households }
					}
				}
				AND = {
					NOT = { has_manpower_building_trigger = yes }
					country_or_non_sovereign_subject_holds = ROOT
				}
			}
		}
		trigger = {
			151 = {
				owned_by = ROOT
				is_core = ROOT
				has_building = soldier_households
			}
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				has_manpower_building_trigger = yes
				value = 40
			}
		}
		effect = {
			country_event_with_insight = {
				id = flavor_tur.246
				insight_tooltip = INSIGHT_JUST_TOOLTIP
				effect_tooltip = "
				define_advisor = {
					type = commandant
					skill = 3
					discount = yes
				}
				if = {
					limit = {
						has_dlc = \"Cradle of Civilization\"
					}
					add_army_professionalism = 0.05
				}
				else = {
					add_army_tradition = 10
				}
				151 = {
					add_province_modifier = {
						name = tur_imperial_school_of_military_engineering
						duration = -1
					}
				}"
			}
		}

		ai_weight = {
			factor = 250
		}
	}
}

tur_african_conquest = {
	slot = 2
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Domination"
	}
	potential = {
		has_dlc = "Domination"
		tag = TUR
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes

	tur_establish_the_pashas = {
		icon = mission_pasha
		required_missions = {  }
		position = 1
		provinces_to_highlight = {
			owned_by = ROOT
			NOT = { culture_group = ROOT }
			if = {
				limit = {
					has_dlc = "Cradle of Civilization"
				}
				has_pasha = no
			}
			else = {
				nationalism = 1
			}
		}
		trigger = {
			#num_of_pashas = 5
			stability = 1
			num_of_owned_provinces_with = {
				NOT = { culture_group = ROOT }
				if = {
					limit = {
						has_dlc = "Cradle of Civilization"
					}
					has_pasha = yes
				}
				else = {
					NOT = { nationalism = 1 }
				}
				value = 50
			}
		}
		effect = {
			if = {
				limit = {
					has_dlc = "Cradle of Civilization"
				}
				custom_tooltip = tur_improved_pashas_ct
			}
			else = {
				add_adm_power = 150
			}
			hidden_effect = {
				set_country_flag = tur_improved_pashas
				every_owned_province = {
					limit = { NOT = { culture_group = ROOT } has_pasha = yes }
					add_province_modifier = { name = tur_competent_pashas duration = -1 hidden = yes }
				}
			}
			custom_tooltip = tur_establish_the_pashas_ct
			hidden_effect = {
				random_owned_province = { limit = { NOT = { has_province_flag = received_reward } NOT = { culture_group = ROOT }  if = { limit = { has_dlc = "Cradle of Civilization" } has_pasha = yes } else = { NOT = { nationalism = 1 } } } add_base_manpower = 1 set_province_flag = received_reward }
				random_owned_province = { limit = { NOT = { has_province_flag = received_reward } NOT = { culture_group = ROOT }  if = { limit = { has_dlc = "Cradle of Civilization" } has_pasha = yes } else = { NOT = { nationalism = 1 } } } add_base_manpower = 1 set_province_flag = received_reward }
				random_owned_province = { limit = { NOT = { has_province_flag = received_reward } NOT = { culture_group = ROOT }  if = { limit = { has_dlc = "Cradle of Civilization" } has_pasha = yes } else = { NOT = { nationalism = 1 } } } add_base_manpower = 1 set_province_flag = received_reward }
				random_owned_province = { limit = { NOT = { has_province_flag = received_reward } NOT = { culture_group = ROOT }  if = { limit = { has_dlc = "Cradle of Civilization" } has_pasha = yes } else = { NOT = { nationalism = 1 } } } add_base_manpower = 1 set_province_flag = received_reward }
				random_owned_province = { limit = { NOT = { has_province_flag = received_reward } NOT = { culture_group = ROOT }  if = { limit = { has_dlc = "Cradle of Civilization" } has_pasha = yes } else = { NOT = { nationalism = 1 } } } add_base_manpower = 1 set_province_flag = received_reward }
				random_owned_province = { limit = { NOT = { has_province_flag = received_reward } NOT = { culture_group = ROOT }  if = { limit = { has_dlc = "Cradle of Civilization" } has_pasha = yes } else = { NOT = { nationalism = 1 } } } add_base_manpower = 1 set_province_flag = received_reward }
				random_owned_province = { limit = { NOT = { has_province_flag = received_reward } NOT = { culture_group = ROOT }  if = { limit = { has_dlc = "Cradle of Civilization" } has_pasha = yes } else = { NOT = { nationalism = 1 } } } add_base_manpower = 1 set_province_flag = received_reward }
				random_owned_province = { limit = { NOT = { has_province_flag = received_reward } NOT = { culture_group = ROOT }  if = { limit = { has_dlc = "Cradle of Civilization" } has_pasha = yes } else = { NOT = { nationalism = 1 } } } add_base_manpower = 1 set_province_flag = received_reward }
				random_owned_province = { limit = { NOT = { has_province_flag = received_reward } NOT = { culture_group = ROOT }  if = { limit = { has_dlc = "Cradle of Civilization" } has_pasha = yes } else = { NOT = { nationalism = 1 } } } add_base_manpower = 1 set_province_flag = received_reward }
				random_owned_province = { limit = { NOT = { has_province_flag = received_reward } NOT = { culture_group = ROOT }  if = { limit = { has_dlc = "Cradle of Civilization" } has_pasha = yes } else = { NOT = { nationalism = 1 } } } add_base_manpower = 1 set_province_flag = received_reward }
				every_owned_province = {
					limit = {
						has_province_flag = received_reward
					}
					clr_province_flag = received_reward
				}
				#For 1.36
				#every_owned_province = {
				#	limit = {
				#		NOT = { culture_group = ROOT }
				#		has_pasha = yes
				#	}
				#	add_base_manpower = 1
				#	type = random
				#	amount = 10
				#}
			}
		}

		ai_weight = {
			factor = 250
		}
	}

	tur_guns_of_urban = {
		icon = mission_guns_of_urban
		required_missions = {  }
		position = 2
		provinces_to_highlight = {
		}
		completed_by = 1455.1.1
		trigger = {
			has_mil_advisor_2 = yes
		}
		effect = {
			if = {
				limit = { NOT = { mil_tech = 7 } }
				capital_scope = {
					large_cast_bronze_mortar = ROOT
					large_cast_bronze_mortar = ROOT
					large_cast_bronze_mortar = ROOT
					large_cast_bronze_mortar = ROOT
				}
				custom_tooltip = tur_guns_of_urban_ct
			}
			else = {
				capital_scope = {
					artillery = ROOT
					artillery = ROOT
					artillery = ROOT
					artillery = ROOT
				}
			}
			if = {
				limit = {
					NOT = { mil_tech = 6 }
					employed_advisor = {
						name = "Urban"
						type = army_reformer
						religion = catholic
						culture = hungarian
						category = mil
					}
				}
				custom_tooltip = tur_guns_of_urban_at
				add_country_modifier = {
					name = tur_early_cannons_modifier
					duration = 3650
				}
			}
			else = {
				custom_tooltip = tur_guns_of_urban_at
				tooltip = {
					add_country_modifier = {
						name = tur_early_cannons_modifier
						duration = 3650
					}
				}
			}
		}

		ai_weight = {
			factor = 250
		}
	}

	tur_conquer_greece = {
		icon = mission_parthenon
		required_missions = { tur_city_of_worlds_desire }
		position = 4
		provinces_to_highlight = {
			OR = {
				province_id = 145
				province_id = 146
				province_id = 1773
				province_id = 4701
				province_id = 4699
				province_id = 4698
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			owns_or_non_sovereign_subject_of = 145
			owns_or_non_sovereign_subject_of = 146
			owns_or_non_sovereign_subject_of = 1773
			owns_or_non_sovereign_subject_of = 4701
			owns_or_non_sovereign_subject_of = 4699
			owns_or_non_sovereign_subject_of = 4698
		}
		effect = {
			add_prestige = 5
			custom_tooltip = tur_conquer_greece_ct
			hidden_effect = {
				every_owned_province = {
					limit = {
						culture = greek
					}
					add_local_autonomy = -100
					add_nationalism = -20
				}
			}
			balkan_region = {
				limit = {
					NOT = { is_permanent_claim = ROOT }
					NOT = { is_core = ROOT }
				}
				add_permanent_claim = ROOT
			}
		}

		ai_weight = {
			factor = 250
		}
	}

	tur_push_into_the_balkans = {
		icon = mission_balkan_conquest
		required_missions = { tur_conquer_greece }
		position = 5
		provinces_to_highlight = {
			OR = {
				area = serbia_area
				area = rascia_area
				area = albania_area
				area = croatia_area
				area = east_adriatic_coast_area
				area = bosnia_area
				area = slavonia_area
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				OR = {
					area = serbia_area
					area = rascia_area
					area = albania_area
					area = croatia_area
					area = east_adriatic_coast_area
					area = bosnia_area
					area = slavonia_area
				}
				value = 20
			}
		}
		effect = {
			custom_tooltip = tur_push_into_the_balkans_ct
			tooltip = {
				add_province_modifier = {
					name = tur_local_millet_rule
					duration = 7300
				}
			}
			hidden_effect = {
				balkan_region = {
					limit = {
						country_or_non_sovereign_subject_holds = ROOT
					}
					add_province_modifier = {
						name = tur_local_millet_rule
						duration = 7300
					}
				}
			}
			carpathia_region = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			if = {
				limit = {
					WAL = {
						exists = yes
						is_subject = no
					}
				}
				add_casus_belli = {
					type = cb_ottoman_subjugation_war
					target = WAL
					months = 240
				}
				WAL = {
					set_country_flag = got_invasion_cb_fabricated_by_@ROOT
				}
			}
			if = {
				limit = {
					HUN = {
						exists = yes
						is_subject = no
					}
				}
				add_casus_belli = {
					type = cb_ottoman_subjugation_war
					target = HUN
					months = 240
				}
				HUN = {
					set_country_flag = got_invasion_cb_fabricated_by_@ROOT
				}
			}
			if = {
				limit = {
					MOL = {
						exists = yes
						is_subject = no
					}
				}
				add_casus_belli = {
					type = cb_ottoman_subjugation_war
					target = MOL
					months = 240
				}
				MOL = {
					set_country_flag = got_invasion_cb_fabricated_by_@ROOT
				}
			}
		}

		ai_weight = {
			factor = 250
		}
	}

	tur_subjugate_romania = {
		icon = mission_impaled_soldies
		required_missions = { tur_push_into_the_balkans }
		position = 6
		provinces_to_highlight = {
			OR = {
				area = moldavia_area
				area = wallachia_area
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				OR = {
					area = moldavia_area
					area = wallachia_area
				}
				value = 5
			}
		}
		effect = {
			if = {
				limit = {
					WAL = { is_subject_of = ROOT }
				}
				WAL = {
					add_liberty_desire = -100
				}
			}
			else = {
				custom_tooltip = tur_subjugate_romania_at
			}
			if = {
				limit = {
					MOL = { is_subject_of = ROOT }
				}
				MOL = {
					add_liberty_desire = -100
				}
			}
			else = {
				custom_tooltip = tur_subjugate_romania_bt
			}
			add_country_modifier = {
				name = tur_romanian_tribute
				duration = 9125
			}
			add_yearly_manpower = 0.25
			add_army_tradition = 10
		}

		ai_weight = {
			factor = 250
		}
	}

	tur_expand_the_devshirme_system = {
		icon = mission_devshirme_system
		required_missions = {
			tur_conquer_hungary
			tur_subjugate_romania
		}
		position = 7
		provinces_to_highlight = {
		}
		trigger = {
			if = {
				limit = {
					OR = {
						has_reform = ottoman_government
						has_reform = modernized_ottoman_government
						has_reform = reorganized_ottoman_government
					}
				}
				OR = {
					has_reform = devshirme_system_reform
					custom_trigger_tooltip = {
						tooltip = tur_has_abolished_devshirme_system
						has_country_flag = tur_abolished_devshirme_for_good
					}
				}
				OR = {
					has_completed_idea_group_of_category = {
						mil_ideas = yes
					}
					if = {
						limit = {
							#Promote Advisors - +2
							has_dlc = "Cradle of Civilization"
							#National Focus - +2
							has_dlc = "Res Publica"
							has_dlc = "Common Sense"
						}
						monthly_mil = 15
					}
					else_if = {
						limit = {
							OR = {
								has_dlc = "Cradle of Civilization"
								has_dlc = "Res Publica"
								has_dlc = "Common Sense"
							}
						}
						monthly_mil = 13
					}
					else = {
						monthly_mil = 11
					}
				}
				reform_level = 5
			}
			else = {
				NOT = { has_reform = ottoman_government }
				NOT = { has_reform = modernized_ottoman_government }
				NOT = { has_reform = reorganized_ottoman_government }
			}
		}
		effect = {
			if = {
				limit = { NOT = { has_country_flag = tur_abolished_devshirme_for_good } }
				country_event_with_insight = {
					id = flavor_tur.247
					insight_tooltip = INSIGHT_JUST_TOOLTIP
					effect_tooltip = "
					add_mil_power = 100
					unlock_government_reform = {
						government_reform = expanded_devshirme_system_reform
					}
					add_government_reform = expanded_devshirme_system_reform"
				}
			}
			else = {
				country_event_with_insight = {
					id = flavor_tur.287
					insight_tooltip = INSIGHT_JUST_TOOLTIP
					effect_tooltip = "
					add_mil_power = 100
					unlock_government_reform = {
						government_reform = reformed_ottoman_conscription_reform
					}
					add_government_reform = reformed_ottoman_conscription_reform"
				}
			}
		}

		ai_weight = {
			factor = 250
		}
	}

	tur_dismantle_hre = {
		icon = mission_dismantle_hre
		required_missions = { tur_conquer_vienna }
		position = 8
		provinces_to_highlight = {
			OR = {
				owned_by = HLR
				AND = {
					is_capital = yes
					owner = {
						OR = {
							is_emperor = yes
							is_elector = yes
						}
					}
					NOT = { controlled_by = ROOT }
				}
			}
		}
		trigger = {
			if = {
				limit = { is_emperor = no }
				NOT = { hre_size = 1 }
				NOT = { exists = HLR }
			}
			else = {
				if = {
					limit = {
						has_dlc = "Emperor"
					}
					OR = {
						hre_reform_passed = emperor_erbkaisertum
						tag = HLR
					}
				}
				else = {
					OR = {
						hre_reform_passed = erbkaisertum
						tag = HLR
					}
				}
			}
		}
		effect = {
			if = {
				limit = {
					is_emperor = yes
				}
				add_imperial_influence = 15
			}
			add_permanent_power_projection = {
				type = 25_permanent_power_projection
				amount = 25
			}
		}

		ai_weight = {
			factor = 250
		}
	}

	tur_conquer_tunis = {
		icon = mission_conquer_tunisia
		required_missions = { tur_conquer_egypt }
		position = 9
		provinces_to_highlight = {
			OR = {
				area = tunisia_area
				area = kabylia_area
				area = djerba_area
				area = tripolitania_area
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				OR = {
					area = tunisia_area
					area = kabylia_area
					area = djerba_area
					area = tripolitania_area
				}
				value = 10
			}
		}
		effect = {
			if = {
				limit = {
					TUN = {
						is_subject_of = ROOT
					}
				}
				if = {
					limit = { TUN = { is_subject_of_type = eyalet } }
					TUN = {
						hidden_effect = {
							grant_independence = yes
						}
					}
					create_subject = {
						who = TUN
						subject_type = core_eyalet
					}
					add_dip_power = 100
				}
				else = {
					country_event_with_insight = {
						id = flavor_tur.221
						insight_tooltip = IS_EYALET_EVENT_TT
					}
				}
			}
			else = {
				add_mil_power = 100
			}
			barbary_coast_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			hautes_plaines_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			algiers_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
		}

		ai_weight = {
			factor = 250
		}
	}

	tur_the_algerian_corsairs = {
		icon = mission_construct_a_corsair_fleet
		required_missions = { tur_conquer_tunis }
		position = 10
		provinces_to_highlight = {
			OR = {
				area = barbary_coast_area
				area = hautes_plaines_area
				area = algiers_area
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				OR = {
					area = barbary_coast_area
					area = hautes_plaines_area
					area = algiers_area
				}
				value = 6
			}
		}
		effect = {
			add_navy_tradition = 25
			if = {
				limit = { exists = MOR }
				add_casus_belli = {
					type = cb_ottoman_subjugation_war
					target = MOR
					months = 240
				}
				MOR = {
					set_country_flag = got_invasion_cb_fabricated_by_@ROOT
				}
			}
			western_morocco_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			northern_morocco_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			tafilalt_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			marrekesh_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			upper_andalucia_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			lower_andalucia_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			alentejo_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			toledo_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
		}

		ai_weight = {
			factor = 250
		}
	}

	tur_conquer_morocco = {
		icon = mission_the_sultan_of_morocco
		required_missions = { tur_the_algerian_corsairs }
		position = 11
		provinces_to_highlight = {
			OR = {
				area = western_morocco_area
				area = northern_morocco_area
				area = tafilalt_area
				area = marrekesh_area
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				OR = {
					area = western_morocco_area
					area = northern_morocco_area
					area = tafilalt_area
					area = marrekesh_area
				}
				value = 10
			}
		}
		effect = {
			add_country_modifier = {
				name = tur_barbary_pirates
				duration = -1
			}
			if = {
				limit = {
					MOR = {
						is_subject_of = ROOT
					}
				}
				if = {
					limit = { MOR = { is_subject_of_type = eyalet } }
					MOR = {
						hidden_effect = {
							grant_independence = yes
						}
					}
					create_subject = {
						who = MOR
						subject_type = core_eyalet
					}
					add_dip_power = 100
				}
				else = {
					country_event_with_insight = {
						id = flavor_tur.225
						insight_tooltip = IS_EYALET_EVENT_TT
					}
				}
			}
			else = {
				create_explorer = {
					tradition = 100
				}
			}
			maghreb_region = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
		}

		ai_weight = {
			factor = 250
		}
	}

	tur_trade_with_india = {
		icon = mission_steer_trade_to_bengal
		required_missions = { tur_establish_the_eyalet_of_adal }
		position = 12
		provinces_to_highlight = {
			OR = {
				AND = {
					province_id = 4346
					NOT = {
						trade_share = {
							country = ROOT
							share = 50
						}
					}
				}
				AND = {
					province_id = 1334
					NOT = {
						trade_share = {
							country = ROOT
							share = 50
						}
					}
				}
				AND = {
					province_id = 1335
					NOT = {
						trade_share = {
							country = ROOT
							share = 50
						}
					}
				}
				AND = {
					province_id = 504
					NOT = {
						trade_share = {
							country = ROOT
							share = 20
						}
					}
				}
				AND = {
					province_id = 1340
					NOT = {
						trade_share = {
							country = ROOT
							share = 20
						}
					}
				}
			}
		}
		trigger = {
			OR = {
				4346 = {
					trade_share = {
						country = ROOT
						share = 50
					}
				}
				1334 = {
					trade_share = {
						country = ROOT
						share = 50
					}
				}
				1335 = {
					trade_share = {
						country = ROOT
						share = 50
					}
				}
			}
			OR = {
				504 = {
					trade_share = {
						country = ROOT
						share = 50
					}
				}
				1340 = {
					trade_share = {
						country = ROOT
						share = 50
					}
				}
			}
			OR = {
				any_ally = {
					capital_scope = { superregion = india_superregion }
					has_opinion = {
						who = ROOT
						value = 150
					}
					if = {
						limit = { has_dlc = "Leviathan" }
						trust = {
							who = ROOT
							value = 80
						}
					}
				}
				num_of_owned_provinces_with = {
					province_has_center_of_trade_of_level = 1
					superregion = india_superregion
					value = 3
				}
			}
		}
		effect = {
			country_event_with_insight = {
				id = flavor_tur.248
				insight_tooltip = tur_trade_with_india_at
			}
		}

		ai_weight = {
			factor = 250
		}
	}

	tur_collect_the_siyasah = {
		icon = mission_suleiman
		required_missions = {  }
		position = 13
		provinces_to_highlight = {
		}
		trigger = {
			stability = 2
			reform_level = 6
			if = {
				limit = { has_estate = estate_nobles }
				num_of_estate_agendas_completed = {
					estate = estate_nobles
					value = 4
				}
			}
			else = {
				NOT = { has_estate = estate_nobles }
			}
			if = {
				limit = { has_estate = estate_burghers }
				num_of_estate_agendas_completed = {
					estate = estate_burghers
					value = 4
				}
			}
			else = {
				NOT = { has_estate = estate_burghers }
			}
			if = {
				limit = { has_estate = estate_church }
				num_of_estate_agendas_completed = {
					estate = estate_church
					value = 4
				}
			}
			else = {
				NOT = { has_estate = estate_church }
			}
			if = {
				limit = { has_estate = estate_dhimmi }
				num_of_estate_agendas_completed = {
					estate = estate_dhimmi
					value = 4
				}
			}
			else = {
				NOT = { has_estate = estate_dhimmi }
			}
		}
		effect = {
			country_event_with_insight = {
				id = flavor_tur.249
				insight_tooltip = INSIGHT_JUST_TOOLTIP
				effect_tooltip = "
				add_adm_power = 100
				unlock_government_reform = {
					government_reform = ottoman_siyasah_tax_reform
				}
				add_government_reform = ottoman_siyasah_tax_reform"
			}
		}

		ai_weight = {
			factor = 250
		}
	}
}

tur_egyptian_conquest = {
	slot = 3
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Domination"
	}
	potential = {
		has_dlc = "Domination"
		tag = TUR
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes

	tur_aftermath_of_varna = {
		icon = mission_battle_of_varna
		required_missions = {  }
		position = 1
		provinces_to_highlight = {
		}
		trigger = {
			army_size = 30
			num_of_generals = 2
			OR = {
				custom_trigger_tooltip = {
					tooltip = tur_aftermath_of_varna_ct
					has_country_flag = tur_had_varna_event
				}
				is_year = 1450
			}
		}
		effect = {
			add_permanent_claim_province = { province = 151 }
			add_permanent_claim_province = { province = 146 }
			add_permanent_claim_province = { province = 4701 }
			add_permanent_claim_province = { province = 145 }
			add_permanent_claim_province = { province = 1773 }
			add_permanent_claim_province = { province = 4699 }
			add_permanent_claim_province = { province = 4698 }
			add_permanent_claim_province = { province = 1764 }
			add_prestige = 5
		}

		ai_weight = {
			factor = 250
		}
	}

	tur_city_of_worlds_desire = {
		icon = mission_fall_of_constantinople
		required_missions = {
			tur_guns_of_urban
			tur_aftermath_of_varna
		}
		position = 3
		provinces_to_highlight = {
			province_id = 151
			NOT = { owned_by = ROOT }
		}
		trigger = {
			151 = {
				owned_by = ROOT
				is_capital_of = ROOT
			}
		}
		effect = {
			country_event_with_insight = {
				id = flavor_tur.205
				insight_tooltip = INSIGHT_JUST_TOOLTIP
				effect_tooltip = "
				add_country_modifier = {
					name = defeated_byzantine_empire
					duration = 5475
				}
				151 = {
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
					add_province_modifier = {
						name = tur_resettlement_of_constantinople
						duration = 9125
					}
				}"
			}
		}

		ai_weight = {
			factor = 250
		}
	}

	tur_rebuild_the_hagia_sophia = {
		icon = byz_city_of_worlds_desire
		required_missions = { tur_city_of_worlds_desire }
		position = 4
		provinces_to_highlight = {
			province_id = 151
			OR = {
				NOT = { owned_by = ROOT }
				if = {
					limit = { has_dlc = "Leviathan" }
					NOT = {
						has_great_project = {
							type = hagia_sophia
							tier = 2
						}
					}
					NOT = {
						has_great_project = {
							type = hagia_sophia
							tier = 3
						}
					}
				}
				NOT = { base_tax = 20 }
				NOT = { has_tax_building_trigger = yes }
			}
		}
		trigger = {
			151 = {
				owned_by = ROOT
				if = {
					limit = {
						has_dlc = "Leviathan"
					}
					OR = {
						has_great_project = {
							type = hagia_sophia
							tier = 2
						}
						has_great_project = {
							type = hagia_sophia
							tier = 3
						}
					}
				}
				has_tax_building_trigger = yes
			}
			OR = {
				inquisitor = 3
				theologian = 3
				has_idea_group = religious_ideas
				has_idea_group = theocracy_gov_ideas
			}
		}
		effect = {
			151 = {
				if = {
					limit = {
						NOT = { has_building = cathedral }
					}
					hidden_effect = {
						if = {
							limit = { has_building = temple }
							remove_building = temple
						}
					}
					add_building = cathedral
				}
				else = {
					add_base_tax = 3
				}
				add_province_modifier = {
					name = tur_imperial_muslim_center
					duration = -1
				}
			}
			if = {
				limit = { has_estate = estate_church }
				add_estate_loyalty = {
					estate = estate_church
					loyalty = 20
				}
			}
		}

		ai_weight = {
			factor = 250
		}
	}

	tur_develop_constantinople = {
		icon = mission_constantinople
		required_missions = { tur_rebuild_the_hagia_sophia }
		position = 5
		provinces_to_highlight = {
			province_id = 151
			OR = {
				NOT = { owned_by = ROOT }
				NOT = { development = 50 }
				devastation = 1
			}
		}
		trigger = {
			151 = {
				owned_by = ROOT
				development = 50
				NOT = { devastation = 1 }
			}
		}
		effect = {
			151 = {
				set_center_level_3_center_of_trade = yes
				add_province_modifier = {
					name = tur_the_imperial_capital
					duration = -1
				}
			}
		}

		ai_weight = {
			factor = 250
		}
	}

	tur_expand_the_city = {
		icon = mission_the_grand_bazaar
		required_missions = { tur_develop_constantinople }
		position = 6
		provinces_to_highlight = {
			province_id = 151
			OR = {
				NOT = { owned_by = ROOT }
				NOT = { development = 75 }
				NOT = { has_manufactory_trigger = yes }
				NOT = { has_production_building_trigger = yes }
				NOT = { has_trade_building_trigger = yes }
				NOT = { has_manpower_building_trigger = yes }
				NOT = { has_fort_building_trigger = yes }
				if = {
					limit = { has_dlc = "Mandate of Heaven" }
					is_prosperous = no
				}
			}
		}
		trigger = {
			151 = {
				owned_by = ROOT
				development = 75
				has_manufactory_trigger = yes
				has_production_building_trigger = yes
				has_trade_building_trigger = yes
				has_manpower_building_trigger = yes
				has_fort_building_trigger = yes
				if = {
					limit = { has_dlc = "Mandate of Heaven" }
					is_prosperous = yes
				}
			}
		}
		effect = {
			151 = {
				add_province_modifier = {
					name = tur_the_gem_of_worlds_desire
					duration = -1
				}
			}
		}

		ai_weight = {
			factor = 250
		}
	}

	tur_defeat_the_mamluks = {
		icon = mission_egyptian_mamluk_soldier
		required_missions = {  }
		position = 7
		provinces_to_highlight = {
			OR = {
				area = aleppo_area
				area = syria_area
				area = syrian_desert_area
				area = palestine_area
				area = trans_jordan_area
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				OR = {
					area = aleppo_area
					area = syria_area
					area = syrian_desert_area
					area = palestine_area
					area = trans_jordan_area
				}
				value = 6
			}
			OR = {
				owns_or_non_sovereign_subject_of = 382
				owns_or_non_sovereign_subject_of = 379
			}
		}
		effect = {
			if = {
				limit = {
					exists = MAM
					NOT = { exists = EGY }
				}
				add_casus_belli = {
					type = cb_ottoman_invasion
					target = MAM
					months = 600
				}
				custom_tooltip = tur_defeat_the_mamluks_at
			}
			else_if = {
				limit = { exists = EGY }
				add_casus_belli = {
					type = cb_ottoman_subjugation_war
					target = EGY
					months = 600
				}
			}
			egypt_region = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			custom_tooltip = tur_defeat_the_mamluks_tt
			hidden_effect = {
				bahrain_area = {
					limit = {
						NOT = { is_core = ROOT }
						NOT = { is_permanent_claim = ROOT }
					}
					add_permanent_claim = ROOT
				}
				tabuk_area = {
					limit = {
						NOT = { is_core = ROOT }
						NOT = { is_permanent_claim = ROOT }
					}
					add_permanent_claim = ROOT
				}
				nafud_area = {
					limit = {
						NOT = { is_core = ROOT }
						NOT = { is_permanent_claim = ROOT }
					}
					add_permanent_claim = ROOT
				}
				qasim_area = {
					limit = {
						NOT = { is_core = ROOT }
						NOT = { is_permanent_claim = ROOT }
					}
					add_permanent_claim = ROOT
				}
				medina_area = {
					limit = {
						NOT = { is_core = ROOT }
						NOT = { is_permanent_claim = ROOT }
					}
					add_permanent_claim = ROOT
				}
				mecca_area = {
					limit = {
						NOT = { is_core = ROOT }
						NOT = { is_permanent_claim = ROOT }
					}
					add_permanent_claim = ROOT
				}
			}
		}

		ai_weight = {
			factor = 250
		}
	}

	tur_conquer_egypt = {
		icon = mission_break_the_mamluks
		required_missions = { tur_defeat_the_mamluks }
		position = 8
		provinces_to_highlight = {
			region = egypt_region
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				region = egypt_region
				value = 25
			}
		}
		effect = {
			if = {
				limit = { exists = TUN }
				add_casus_belli = {
					type = cb_ottoman_subjugation_war
					target = TUN
					months = 240
				}
				TUN = {
					set_country_flag = got_invasion_cb_fabricated_by_@ROOT
				}
			}
			tunisia_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			kabylia_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			djerba_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			tripolitania_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
		}

		ai_weight = {
			factor = 250
		}
	}

	tur_handle_the_egyptian_eyalet = {
		icon = mission_eyalet_egypt
		required_missions = { tur_conquer_egypt }
		position = 9
		provinces_to_highlight = {
			if = {
				limit = { exists = EGY ROOT = { has_country_flag = tur_decided_to_go_eyalet } }
				is_capital_of = EGY
			}
			else_if = {
				limit = { ROOT = { has_country_flag = tur_decided_to_go_eyalet } }
				region = egypt_region
				NOT = { country_or_non_sovereign_subject_holds = ROOT }
			}
			else = {
				OR = {
					AND = {
						region = egypt_region
						OR = {
							NOT = { country_or_non_sovereign_subject_holds = ROOT }
							NOT = { local_autonomy_above_min = 10 }
						}
					}
					AND = {
						OR = {
							area = bahari_area
							area = delta_area
						}
						NOT = { num_of_times_improved = 4 }
					}
				}
			}
		}
		trigger = {
			if = {
				limit = {
					NOT = { mission_completed = tur_conquer_egypt }
					NOT = { has_country_flag = tur_decided_to_go_eyalet }
				}
				custom_trigger_tooltip = {
					tooltip = tur_handle_the_egyptian_eyalet_at
					always = no
				}
			}
			else_if = {
				limit = {
					has_country_flag = tur_decided_to_go_eyalet
				}
				OR = {
					AND = {
						has_dip_advisor_3 = yes
						EGY = {
							is_subject_of = ROOT
							NOT = { liberty_desire = 10 }
							has_opinion = {
								who = ROOT
								value = 100
							}
						}
					}
					AND = {
						NOT = { exists = EGY }
						egypt_region = {
							country_or_non_sovereign_subject_holds = ROOT
							type = all
						}
					}
				}
			}
			else = {
				egypt_region = {
					country_or_non_sovereign_subject_holds = ROOT
					NOT = { local_autonomy_above_min = 10 }
					type = all
				}
				bahari_area = {
					type = all
					country_or_non_sovereign_subject_holds = ROOT
					num_of_times_improved = 4
				}
				delta_area = {
					type = all
					country_or_non_sovereign_subject_holds = ROOT
					num_of_times_improved = 4
				}
			}
		}
		effect = {
			if = {
				limit = {
					NOT = { mission_completed = tur_conquer_egypt }
					NOT = { has_country_flag = tur_decided_to_go_eyalet }
				}
				custom_tooltip = tur_handle_the_egyptian_eyalet_bt
			}
			else_if = {
				limit = {
					has_country_flag = tur_decided_to_go_eyalet
					exists = EGY
				}
				EGY = {
					remove_country_modifier = tur_mamlukian_administration
				}
				change_ruler_stat = {
					type = dip
					amount = 2
				}
			}
			else = {
				custom_tooltip = tur_handle_the_egyptian_eyalet_ct
				hidden_effect = {
					#egypt_region = {
					#	limit = {
					#		country_or_non_sovereign_subject_holds = ROOT
					#	}
					#	add_base_production = 1
					#
					#	type = random
					#	amount = 10
					#}
					bahari_area = {
						limit = {
							country_or_non_sovereign_subject_holds = ROOT
						}
						add_base_production = 1
					}
					delta_area = {
						limit = {
							country_or_non_sovereign_subject_holds = ROOT
						}
						add_base_production = 1
					}
					vostani_area = {
						limit = {
							country_or_non_sovereign_subject_holds = ROOT
						}
						add_base_production = 1
					}
				}
			}
			country_event_with_insight = {
				id = flavor_tur.244
				insight_tooltip = INSIGHT_JUST_TOOLTIP
				effect_tooltip = "
				add_adm_power = 100
				egypt_region = {
					limit = {
						country_or_non_sovereign_subject_holds = ROOT
					}
					add_province_modifier = {
						name = tur_investment_into_infrastructure
						duration = 9125
					}
				}"
			}
		}

		ai_weight = {
			factor = 250
		}
	}

	tur_control_the_red_sea = {
		icon = mission_control_the_red_sea
		required_missions = { tur_seize_the_caliphate }
		position = 10
		provinces_to_highlight = {
			OR = {
				area = yemen_area
				area = upper_yemen_area
				area = tihama_al_yemen_area
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			owns_or_non_sovereign_subject_of = 387
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				OR = {
					area = yemen_area
					area = upper_yemen_area
					area = tihama_al_yemen_area
				}
				value = 6
			}
		}
		effect = {
			4346 = {
				add_trade_modifier = {
					who = ROOT
					duration = 18250
					power = 30
					key = TUR_OTTOMAN_RED_SEA_ACCESS
				}
			}
			if = {
				limit = {
					YEM = {
						is_subject_of = ROOT
					}
				}
				if = {
					limit = { YEM = { is_subject_of_type = eyalet } }
					YEM = {
						hidden_effect = {
							grant_independence = yes
						}
					}
					create_subject = {
						who = YEM
						subject_type = core_eyalet
					}
					add_dip_power = 100
				}
				else = {
					country_event_with_insight = {
						id = flavor_tur.233
						insight_tooltip = IS_EYALET_EVENT_TT
					}
				}
			}
			else = {
				add_mercantilism = 3
			}
			if = {
				limit = {
					exists = ADA
				}
				add_casus_belli = {
					type = cb_ottoman_subjugation_war
					target = ADA
					months = 240
				}
				ADA = {
					set_country_flag = got_invasion_cb_fabricated_by_@ROOT
				}
			}
			red_sea_coast_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			tigray_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			aussa_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			ifat_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			central_ethiopia_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
		}

		ai_weight = {
			factor = 250
		}
	}

	tur_establish_the_eyalet_of_adal = {
		icon = mission_eyalet_adal
		required_missions = { tur_control_the_red_sea }
		position = 11
		provinces_to_highlight = {
			OR = {
				area = red_sea_coast_area
				area = tigray_area
				area = aussa_area
				area = ifat_area
				area = central_ethiopia_area
			}
		}
		trigger = {
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				OR = {
					area = red_sea_coast_area
					area = tigray_area
					area = aussa_area
					area = ifat_area
					area = central_ethiopia_area
				}
				value = 12
			}
		}
		effect = {
			if = {
				limit = {
					ADA = {
						is_subject_of = ROOT
					}
				}
				if = {
					limit = { ADA = { is_subject_of_type = eyalet } }
					ADA = {
						hidden_effect = {
							grant_independence = yes
						}
					}
					create_subject = {
						who = ADA
						subject_type = core_eyalet
					}
					add_dip_power = 100
				}
				else = {
					country_event_with_insight = {
						id = flavor_tur.227
						insight_tooltip = IS_EYALET_EVENT_TT
					}
				}
			}
			else = {
				add_army_tradition = 20
			}
			horn_of_africa_region = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			add_country_modifier = {
				name = tur_control_over_the_red_sea
				duration = 9125
			}
		}

		ai_weight = {
			factor = 250
		}
	}

	tur_trade_with_indonesia = {
		icon = mission_dominate_persian_gulf
		required_missions = { tur_establish_the_eyalet_of_adal }
		position = 12
		provinces_to_highlight = {
			OR = {
				province_id = 1343
				province_id = 1357
				province_id = 1397
			}
			NOT = {
				trade_share = {
					country = ROOT
					share = 35
				}
			}
		}
		trigger = {
			1343 = {
				trade_share = {
					country = ROOT
					share = 35
				}
			}
			1361 = {
				trade_share = {
					country = ROOT
					share = 35
				}
			}
			1357 = {
				trade_share = {
					country = ROOT
					share = 35
				}
			}
			1397 = {
				trade_share = {
					country = ROOT
					share = 35
				}
			}
			OR = {
				1343 = { has_trader = ROOT }
				1361 = { has_trader = ROOT }
				1357 = { has_trader = ROOT }
				1397 = { has_trader = ROOT }
			}
		}
		effect = {
			define_advisor = {
				type = trader
				skill = 3
				cost_multiplier = 0.25
			}
			add_mercantilism = 5
			add_country_modifier = {
				name = tur_indonesian_trade
				duration = 7300
			}
		}

		ai_weight = {
			factor = 250
		}
	}

	tur_most_humble_ottoman_ceo = {
		icon = mission_turkish_merchants
		required_missions = {
			tur_trade_with_india
			tur_trade_with_indonesia
		}
		position = 13
		provinces_to_highlight = {
		}
		trigger = {
			home_trade_node = {
				highest_value_trade_node = yes
				trade_share = {
					country = ROOT
					share = 90
				}
			}
			monthly_income = 500
			is_bankrupt = no
			NOT = { corruption = 2 }
			NOT = { inflation = 1 }
			NOT = { num_of_loans = 6 }
		}
		effect = {
			capital_scope = {
				add_province_modifier = {
					name = tur_center_of_ottoman_commerce
					duration = -1
				}
			}
		}

		ai_weight = {
			factor = 250
		}
	}

	tur_pax_ottomana = {
		icon = mission_pax_ottomana
		required_missions = {
			tur_embrace_the_military_doctrines
			tur_collect_the_siyasah
			tur_most_humble_ottoman_ceo
			tur_issue_the_kannuname
			tur_second_islamic_golden_age
		}
		position = 13
		provinces_to_highlight = {
		}
		trigger = {
			has_any_disaster = no
			is_bankrupt = no
			stability = 3
			prestige = 75
			total_own_and_non_tributary_subject_development = 4000
			if = {
				limit = {
					OR = {
						has_dlc = "Rights of Man"
						has_dlc = "Emperor"
					}
				}
				NOT = { great_power_rank = 2 }
			}
			if = {
				limit = { has_dlc = "Emperor" }
				is_hegemon = yes
			}
		}
		effect = {
			add_country_modifier = {
				name = tur_pax_ottomana
				duration = -1
			}
		}

		ai_weight = {
			factor = 250
		}
	}
}

tur_arabian_conquest = {
	slot = 4
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Domination"
	}
	potential = {
		has_dlc = "Domination"
		tag = TUR
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes

	tur_train_the_janissary = {
		icon = mission_janissary_soldier
		required_missions = {  }
		position = 1
		provinces_to_highlight = {
		}
		trigger = {
			if = {
				limit = {
					ai = no	#Because I don't trust the AI to be competent
					has_government_attribute = enables_estate_janissaries
				}
				num_of_janissaries = 10
			}
			else = {
				army_size = 35
			}
		}
		effect = {
			add_country_modifier = {
				name = tur_janissary_example
				duration = 9125
			}
			if = {
				limit = { has_estate = estate_janissaries }
				add_estate_loyalty = {
					estate = estate_janissaries
					loyalty = 10
				}
			}
			else_if = {
				limit = { has_estate = estate_nobles }
				add_estate_loyalty = {
					estate = estate_nobles
					loyalty = 10
				}
			}
			else = {
				add_mil_power = 50
			}
		}

		ai_weight = {
			factor = 250
		}
	}

	tur_grant_first_janissary_privileges = {
		icon = mission_janissaries
		required_missions = {
			tur_train_the_janissary
			tur_refill_the_ortas
		}
		position = 2
		provinces_to_highlight = {
		}
		trigger = {
			if = {
				limit = {
					has_estate = estate_janissaries
					ai = no	#Again, no trust in the AI
				}
				num_of_estate_privileges = {
					estate = estate_janissaries
					value = 2
				}
			}
			else_if = {
				limit = {
					ai = no
				}
				stability = 2
			}
			else = {
				army_size_percentage = 0.8
			}
		}
		effect = {
			country_event_with_insight = {
				id = flavor_tur.208
				insight_tooltip = INSIGHT_JUST_TOOLTIP
				effect_tooltip = "
				add_mil_power = 25
				add_country_modifier = {
					name = tur_janissary_loyalty
					duration = 36500
				}"
			}
		}

		ai_weight = {
			factor = 250
		}
	}

	tur_fate_of_the_patriarchate = {
		icon = mission_hagia_sophia
		required_missions = { tur_city_of_worlds_desire }
		position = 4
		provinces_to_highlight = {
			OR = {
				AND = {
					province_id = 151
					NOT = { is_capital_of = ROOT }
				}
				owned_by = BYZ
			}
		}
		trigger = {
			custom_trigger_tooltip = {
				tooltip = tur_fate_of_the_patriarchate_tt
				has_country_flag = tur_had_fate_of_patriarchate_event
			}
			if = {
				limit = {
					NOT = { has_country_flag = tur_allowed_patriarchate_to_exist }
					NOT = { has_country_flag = tur_closed_patriarchate_down }
				}
				custom_trigger_tooltip = {
					tooltip = tur_fate_of_the_patriarchate_ct
					always = no
				}
			}
			else_if = {
				limit = {
					has_country_flag = tur_allowed_patriarchate_to_exist
				}
				if = {
					limit = {
						has_estate = estate_dhimmi
					}
					num_of_estate_agendas_completed = {
						estate = estate_dhimmi
						value = 2
					}
					num_of_estate_privileges = {
						estate = estate_dhimmi
						value = 4
					}
				}
				else = {
					religious_unity = 1
				}
			}
			else = {
				if = {
					limit = {
						has_estate = estate_church
					}
					num_of_estate_agendas_completed = {
						estate = estate_church
						value = 2
					}
					num_of_estate_privileges = {
						estate = estate_church
						value = 4
					}
				}
				else = {
					religious_unity = 1
				}
			}
		}
		effect = {
			if = {
				limit = {
					NOT = { has_country_flag = tur_allowed_patriarchate_to_exist }
					NOT = { has_country_flag = tur_closed_patriarchate_down }
				}
				custom_tooltip = tur_fate_of_the_patriarchate_at
			}
			else_if = {
				limit = {
					has_country_flag = tur_allowed_patriarchate_to_exist
				}
				if = {
					limit = {
						has_estate = estate_dhimmi
					}
					add_estate_loyalty = {
						estate = estate_dhimmi
						loyalty = 15
					}
				}
				add_country_modifier = {
					name = tur_respected_the_patriarchate
					duration = 9125
				}
				define_advisor = {
					name = "Gennadios II"
					type = theologian
					skill = 3
					cost_multiplier = 0.25
					culture = greek
					religion = orthodox
				}
			}
			else = {
				if = {
					limit = {
						has_estate = estate_church
					}
					add_estate_loyalty = {
						estate = estate_church
						loyalty = 15
					}
				}
				add_country_modifier = {
					name = tur_removed_the_patriarchate
					duration = 9125
				}
				capital_scope = {
					add_base_tax = 3
					add_base_production = 2
					add_base_manpower = 2
				}
			}
		}

		ai_weight = {
			factor = 250
		}
	}

	tur_conquer_mesopotomia = {
		icon = mission_cradle_of_civilization
		required_missions = { tur_unify_anatolia }
		position = 5
		provinces_to_highlight = {
			OR = {
				area = basra_area
				area = iraq_arabi_area
				area = al_jazira_area
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				OR = {
					area = basra_area
					area = iraq_arabi_area
					area = al_jazira_area
				}
				value = 8
			}
			owns_or_non_sovereign_subject_of = 408
			owns_or_non_sovereign_subject_of = 410
		}
		effect = {
			country_event_with_insight = {
				id = flavor_tur.250
				insight_tooltip = INSIGHT_JUST_TOOLTIP
				effect_tooltip = "
				if = {
					limit = {
						has_dlc = \"Cradle of Civilization\"
					}
					if = {
						limit = {
							religion_group = muslim
						}
						enable_baseline_invite_scholar_no_privilege = yes
					}
					else = {
						hidden_effect = { enable_baseline_invite_scholar_no_privilege = yes }
						add_adm_power = 100
					}
				}
				else = {
					add_adm_power = 100
				}
				add_country_modifier = {
					name = tur_baghdad_city_of_learning
					duration = 10950
				}"
			}
		}

		ai_weight = {
			factor = 250
		}
	}

	tur_crimean_khaganate = {
		icon = mission_chinese_general_riding
		required_missions = {  }
		position = 6
		provinces_to_highlight = {
			OR = {
				area = azov_area
				area = crimea_area
				province_id = 2412
				province_id = 1974
				province_id = 2411
			}
		}
		trigger = {
			OR = {
				CRI = {
					OR = {
						is_subject_of = ROOT
						alliance_with = ROOT
					}
					has_opinion = {
						who = ROOT
						value = 150
					}
					if = {
						limit = { has_dlc = "Leviathan" }
						trust = {
							who = ROOT
							value = 60
						}
					}
				}
				AND = {
					azov_area = {
						type = all
						country_or_non_sovereign_subject_holds = ROOT
					}
					crimea_area = {
						type = all
						country_or_non_sovereign_subject_holds = ROOT
					}
					2412 = { country_or_non_sovereign_subject_holds = ROOT }
					1974 = { country_or_non_sovereign_subject_holds = ROOT }
					2411 = { country_or_non_sovereign_subject_holds = ROOT }
				}
			}
		}
		effect = {
			custom_tooltip = tur_subject_crimea_reward_tt
			if = {
				limit = {
					CRI = { is_subject_of = ROOT }
				}
				custom_tooltip = BONUS_REWARD_YES
			}
			else = { custom_tooltip = BONUS_REWARD_NO }
			tooltip = {
				tur_crimean_khaganate_effect_a = yes
			}
			custom_tooltip = mission_alternatively_tt
			custom_tooltip = tur_alliance_cri_tt
			if = {
				limit = {
					alliance_with = CRI
				}
				custom_tooltip = BONUS_REWARD_YES
			}
			else = { custom_tooltip = BONUS_REWARD_NO }
			tooltip = {
				custom_tooltip = tur_alliance_cri_at
				set_country_flag = tur_guarantee_cri_flag
				add_dip_power = 50
			}
			custom_tooltip = mission_alternatively_tt
			custom_tooltip = tur_alternatively_gain_access_to_tatar_vanguard_merc_comp_and_following_reward_tt
			if = {
				limit = {
					azov_area = {
						type = all
						country_or_non_sovereign_subject_holds = ROOT
					}
					crimea_area = {
						type = all
						country_or_non_sovereign_subject_holds = ROOT
					}
					2412 = { country_or_non_sovereign_subject_holds = ROOT }
					1974 = { country_or_non_sovereign_subject_holds = ROOT }
					2411 = { country_or_non_sovereign_subject_holds = ROOT }
				}
				custom_tooltip = BONUS_REWARD_YES
			}
			else = { custom_tooltip = BONUS_REWARD_NO }
			tooltip = {
				unlock_merc_company = {
					merc_company = merc_tatar_vanguard
				}
				country_event_with_insight = {
					id = flavor_tur.251
					insight_tooltip = INSIGHT_JUST_TOOLTIP
					effect_tooltip = "
					add_country_modifier = {
						name = tur_allowed_tatars_in_sipahi_modifier
						duration = 7300
					}"
				}
			}

			hidden_effect = {
				if = {
					limit = { CRI = { is_subject_of = ROOT } }
					tur_crimean_khaganate_effect_a = yes
				}
				else_if = {
					limit = { alliance_with = CRI }
					custom_tooltip = tur_alliance_cri_at
					set_country_flag = tur_guarantee_cri_flag
					add_dip_power = 50
				}
				else_if = {
					limit = {
						azov_area = {
							type = all
							country_or_non_sovereign_subject_holds = ROOT
						}
						crimea_area = {
							type = all
							country_or_non_sovereign_subject_holds = ROOT
						}
						2412 = { country_or_non_sovereign_subject_holds = ROOT }
						1974 = { country_or_non_sovereign_subject_holds = ROOT }
						2411 = { country_or_non_sovereign_subject_holds = ROOT }
					}
					unlock_merc_company = {
						merc_company = merc_tatar_vanguard
					}
					country_event_with_insight = {
						id = flavor_tur.251
						insight_tooltip = INSIGHT_JUST_TOOLTIP
						effect_tooltip = "
						add_country_modifier = {
							name = tur_allowed_tatars_in_sipahi_modifier
							duration = 7300
						}"
					}
				}
			}
		}

		ai_weight = {
			factor = 250
		}
	}

	tur_black_sea_dominance = {
		icon = mission_control_the_black_sea
		required_missions = {
			tur_crimean_khaganate
			tur_conquer_the_causcasus
		}
		position = 7
		provinces_to_highlight = {
			OR = {
				area = crimea_area
				area = yedisan_area
				area = kastamonu_area
				area = hudavendigar_area
				area = thrace_area
				area = silistria_area
				area = moldavia_area
				area = zaporizhia_area
				area = azov_area
				area = circassia_area
				area = imereti_area
				area = samtskhe_area
				area = erzurum_area
			}
			has_port = yes
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			custom_trigger_tooltip = {
				tooltip = tur_black_sea_dominance_tt
				crimea_area = { OR = { has_port = no country_or_non_sovereign_subject_holds = ROOT } type = all }
				yedisan_area = { OR = { has_port = no country_or_non_sovereign_subject_holds = ROOT } type = all }
				kastamonu_area = { OR = { has_port = no country_or_non_sovereign_subject_holds = ROOT } type = all }
				hudavendigar_area = { OR = { has_port = no country_or_non_sovereign_subject_holds = ROOT } type = all }
				thrace_area = { OR = { has_port = no country_or_non_sovereign_subject_holds = ROOT } type = all }
				silistria_area = { OR = { has_port = no country_or_non_sovereign_subject_holds = ROOT } type = all }
				moldavia_area = { OR = { has_port = no country_or_non_sovereign_subject_holds = ROOT } type = all }
				zaporizhia_area = { OR = { has_port = no country_or_non_sovereign_subject_holds = ROOT } type = all }
				azov_area = { OR = { has_port = no country_or_non_sovereign_subject_holds = ROOT } type = all }
				circassia_area = { OR = { has_port = no country_or_non_sovereign_subject_holds = ROOT } type = all }
				imereti_area = { OR = { has_port = no country_or_non_sovereign_subject_holds = ROOT } type = all }
				samtskhe_area = { OR = { has_port = no country_or_non_sovereign_subject_holds = ROOT } type = all }
				erzurum_area = { OR = { has_port = no country_or_non_sovereign_subject_holds = ROOT } type = all }
			}
		}
		effect = {
			add_mercantilism = 3
			add_treasury = 500
			1322 = {
				add_trade_modifier = {
					who = ROOT
					duration = -1
					power = 20
					key = TUR_PONTIC_TRADE
				}
			}
			464 = {
				add_trade_modifier = {
					who = ROOT
					duration = -1
					power = 20
					key = TUR_PONTIC_TRADE
				}
			}
		}

		ai_weight = {
			factor = 250
		}
	}

	tur_conquer_arabia = {
		icon = mission_bedouins
		required_missions = { tur_defeat_the_mamluks }
		position = 8
		provinces_to_highlight = {
			OR = {
				area = bahrain_area
				area = tabuk_area
				area = nafud_area
				area = qasim_area
				area = medina_area
				area = mecca_area
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				OR = {
					area = bahrain_area
					area = tabuk_area
					area = nafud_area
					area = qasim_area
					area = medina_area
					area = mecca_area
				}
				value = 20
			}
		}
		effect = {
			if = {
				limit = { exists = YEM }
				add_casus_belli = {
					type = cb_ottoman_subjugation_war
					target = YEM
					months = 240
				}
				YEM = {
					set_country_flag = got_invasion_cb_fabricated_by_@ROOT
				}
			}
			arabia_region = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
		}

		ai_weight = {
			factor = 250
		}
	}

	tur_seize_the_caliphate = {
		icon = mission_the_caliph
		required_missions = {
			tur_conquer_egypt
			tur_conquer_arabia
		}
		position = 9
		provinces_to_highlight = {
			OR = {
				province_id = 361
				province_id = 385
				province_id = 410
				province_id = 379
				province_id = 384
			}
			OR = {
				NOT = { religion = ROOT }
				NOT = { country_or_non_sovereign_subject_holds = ROOT }
			}
		}
		trigger = {
			361 = {
				religion = ROOT
				country_or_non_sovereign_subject_holds = ROOT
			}
			385 = {
				religion = ROOT
				country_or_non_sovereign_subject_holds = ROOT
			}
			410 = {
				religion = ROOT
				country_or_non_sovereign_subject_holds = ROOT
			}
			379 = {
				religion = ROOT
				country_or_non_sovereign_subject_holds = ROOT
			}
			384 = {
				religion = ROOT
				country_or_non_sovereign_subject_holds = ROOT
			}
			prestige = 50
			if = {
				limit = { religion = sunni }
				has_ruler_modifier = khalifah
			}
		}
		effect = {
			if = {
				limit = { religion_group = muslim }
				enable_branching_mission_review = {
					key = TUR
					ai_event_id = flavor_tur.229
				}
				custom_tooltip = tur_seize_the_caliphate_at
			}
			else = {
				country_event_with_insight = {
					id = flavor_tur.230
					insight_tooltip = INSIGHT_JUST_TOOLTIP
					effect_tooltip = "
					custom_tooltip = tur_non_muslim_path_tt
					swap_non_generic_missions = yes
					add_country_modifier = {
						name = tur_end_of_the_caliphate_modifier
						duration = 18250
					}"
				}
			}
		}

		ai_weight = {
			factor = 250
		}
	}
}

#Branching missions regarding the caliphate
tur_dummy_missions_path = {
	slot = 4
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Domination"
	}
	potential = {
		has_dlc = "Domination"
		tag = TUR
		NOT = { map_setup = map_setup_random }
		NOT = { has_country_flag = tur_chose_legalism }
		NOT = { has_country_flag = tur_chose_mysticism }
		NOT = { has_country_flag = tur_non_muslim_path_flag }
	}
	has_country_shield = yes

	tur_dummy_mission_1 = {
		icon = mission_unknown_mission
		required_missions = { tur_seize_the_caliphate }
		position = 10
		provinces_to_highlight = {
		}
		trigger = {
			custom_trigger_tooltip = {
				tooltip = selectable_mission_trigger_tt
				always = no
			}
			religion_group = muslim
			OR = {
				AND = {
					custom_trigger_tooltip = {
						tooltip = tur_legalism_path_trigger_tt
						always = no
					}
					if = {
						limit = { has_dlc = "Cradle of Civilization" }
						piety = 0.75
					}
					else = {
						OR = {
							NOT = { has_estate = estate_church }
							estate_loyalty = {
								estate = estate_church
								loyalty = 60
							}
						}
					}
				}
				AND = {
					custom_trigger_tooltip = {
						tooltip = tur_mysticism_path_trigger_tt
						always = no
					}
					if = {
						limit = { has_dlc = "Cradle of Civilization" }
						NOT = { piety = -0.74 }
					}
					else = {
						OR = {
							NOT = { has_estate = estate_dhimmi }
							estate_loyalty = {
								estate = estate_dhimmi
								loyalty = 60
							}
						}
					}
				}
			}
		}
		effect = {
			custom_tooltip = tur_legalism_path_effects_tt
			add_country_modifier = {
				name = tur_religious_legal_code_level_1
				duration = -1
			}
			custom_tooltip = upgradable_modifier_tt
			custom_tooltip = tur_mysticism_path_effects_tt
			add_country_modifier = {
				name = tur_spiritual_focus_level_1
				duration = -1
			}
			custom_tooltip = upgradable_modifier_tt
		}

		ai_weight = {
			factor = 250
		}
	}

	tur_dummy_mission_2 = {
		icon = mission_unknown_mission
		required_missions = { tur_dummy_mission_1 }
		position = 11
		provinces_to_highlight = {
		}
		trigger = {
			custom_trigger_tooltip = {
				tooltip = selectable_mission_trigger_tt
				always = no
			}
			religion_group = muslim
			OR = {
				AND = {
					custom_trigger_tooltip = {
						tooltip = tur_legalism_path_trigger_tt
						always = no
					}
					num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
						religion = ROOT
						has_tax_building_trigger = yes
						value = 45
					}
					calc_true_if = {
						all_subject_country = {
							religion = ROOT
						}
						amount = 3
					}
					if = {
						limit = { has_estate = estate_church }
						estate_loyalty = {
							estate = estate_church
							loyalty = 60
						}
					}
				}
				AND = {
					custom_trigger_tooltip = {
						tooltip = tur_mysticism_path_trigger_tt
						always = no
					}
					num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
						NOT = { religion_group = ROOT }
						has_tax_building_trigger = yes
						value = 45
					}
					calc_true_if = {
						all_subject_country = {
							NOT = { religion_group = ROOT }
						}
						amount = 3
					}
					if = {
						limit = { has_estate = estate_dhimmi }
						estate_loyalty = {
							estate = estate_dhimmi
							loyalty = 60
						}
					}
				}
			}
		}
		effect = {
			custom_tooltip = tur_legalism_path_effects_tt
			remove_country_modifier = tur_religious_legal_code_level_1
			add_country_modifier = {
				name = tur_religious_legal_code_level_2
				duration = -1
			}
			custom_tooltip = upgradable_modifier_tt
			custom_tooltip = tur_mysticism_path_effects_tt
			remove_country_modifier = tur_spiritual_focus_level_1
			add_country_modifier = {
				name = tur_spiritual_focus_level_2
				duration = -1
			}
			custom_tooltip = upgradable_modifier_tt
		}

		ai_weight = {
			factor = 250
		}
	}

	tur_dummy_mission_3 = {
		icon = mission_unknown_mission
		required_missions = { tur_dummy_mission_2 }
		position = 12
		provinces_to_highlight = {
		}
		trigger = {
			custom_trigger_tooltip = {
				tooltip = selectable_mission_trigger_tt
				always = no
			}
			religion_group = muslim
			OR = {
				AND = {
					custom_trigger_tooltip = {
						tooltip = tur_legalism_path_trigger_tt
						always = no
					}
					if = {
						limit = {
							has_estate = estate_church
						}
						estate_loyalty = {
							estate = estate_church
							loyalty = 70
						}
						num_of_estate_privileges = {
							estate = estate_church
							value = 4
						}
					}
					OR = {
						inquisitor = 3
						theologian = 3
					}
					OR = {
						calc_true_if = {
							all_subject_country = {
								OR = {
									is_subject_of_type = eyalet
									is_subject_of_type = core_eyalet
								}
								religion = ROOT
							}
							amount = 6
						}
						reform_level = 8
					}
				}
				AND = {
					custom_trigger_tooltip = {
						tooltip = tur_mysticism_path_trigger_tt
						always = no
					}
					if = {
						limit = {
							has_estate = estate_dhimmi
						}
						estate_loyalty = {
							estate = estate_dhimmi
							loyalty = 70
						}
						num_of_estate_privileges = {
							estate = estate_dhimmi
							value = 4
						}
					}
					OR = {
						philosopher = 3
						theologian = 3
					}
					calc_true_if = {
						all_subject_country = {
							OR = {
								is_subject_of_type = eyalet
								is_subject_of_type = core_eyalet
							}
							NOT = { religion_group = ROOT }
						}
						amount = 6
					}
				}
			}
		}
		effect = {
			custom_tooltip = tur_legalism_path_effects_tt
			country_event_with_insight = {
				id = flavor_tur.257
				insight_tooltip = INSIGHT_JUST_TOOLTIP
				effect_tooltip = "
				add_adm_power = 100
				unlock_government_reform = {
					government_reform = fiqh_laws_reform
				}
				add_government_reform = fiqh_laws_reform"
			}
			remove_country_modifier = tur_religious_legal_code_level_2
			add_country_modifier = {
				name = tur_religious_legal_code_level_3
				duration = -1
			}
			custom_tooltip = tur_mysticism_path_effects_tt
			country_event_with_insight = {
				id = flavor_tur.258
				insight_tooltip = INSIGHT_JUST_TOOLTIP
				effect_tooltip = "
				add_adm_power = 100
				unlock_government_reform = {
					government_reform = sufism_decree_reform
				}
				add_government_reform = sufism_decree_reform"
			}
			remove_country_modifier = tur_spiritual_focus_level_2
			add_country_modifier = {
				name = tur_spiritual_focus_level_3
				duration = -1
			}
		}

		ai_weight = {
			factor = 250
		}
	}
}

tur_legalism_path = {
	slot = 4
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Domination"
	}
	potential = {
		has_dlc = "Domination"
		tag = TUR
		NOT = { map_setup = map_setup_random }
		has_country_flag = tur_chose_legalism
	}
	has_country_shield = yes

	tur_embrace_legalism = {
		icon = mission_quran
		required_missions = { tur_seize_the_caliphate }
		position = 10
		provinces_to_highlight = {
		}
		trigger = {
			not_in_mission_preview_mode = { key = TUR }
			religion_group = muslim
			if = {
				limit = { has_dlc = "Cradle of Civilization" }
				piety = 0.75
			}
			else = {
				OR = {
					NOT = { has_estate = estate_church }
					estate_loyalty = {
						estate = estate_church
						loyalty = 60
					}
				}
			}
		}
		effect = {
			add_country_modifier = {
				name = tur_religious_legal_code_level_1
				duration = -1
			}
			custom_tooltip = upgradable_modifier_tt
		}

		ai_weight = {
			factor = 250
		}
	}

	tur_islamize_the_empire = {
		icon = mission_mustansiriya_madrasah
		required_missions = { tur_embrace_legalism }
		position = 11
		provinces_to_highlight = {
			country_or_non_sovereign_subject_holds = ROOT
			religion = ROOT
			NOT = { has_tax_building_trigger = yes }
		}
		trigger = {
			not_in_mission_preview_mode = { key = TUR }
			religion_group = muslim
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				religion = ROOT
				has_tax_building_trigger = yes
				value = 45
			}
			calc_true_if = {
				all_subject_country = {
					religion = ROOT
				}
				amount = 3
			}
			if = {
				limit = { has_estate = estate_church }
				estate_loyalty = {
					estate = estate_church
					loyalty = 60
				}
			}
		}
		effect = {
			remove_country_modifier = tur_religious_legal_code_level_1
			add_country_modifier = {
				name = tur_religious_legal_code_level_2
				duration = -1
			}
			custom_tooltip = upgradable_modifier_tt
		}

		ai_weight = {
			factor = 250
		}
	}

	tur_rework_the_devshirme_system = {
		icon = mission_fiqh_laws
		required_missions = { tur_islamize_the_empire }
		position = 12
		provinces_to_highlight = {
		}
		trigger = {
			not_in_mission_preview_mode = { key = TUR }
			religion_group = muslim
			if = {
				limit = {
					has_estate = estate_church
				}
				estate_loyalty = {
					estate = estate_church
					loyalty = 70
				}
				num_of_estate_privileges = {
					estate = estate_church
					value = 4
				}
			}
			OR = {
				inquisitor = 3
				theologian = 3
			}
			OR = {
				calc_true_if = {
					all_subject_country = {
						OR = {
							is_subject_of_type = eyalet
							is_subject_of_type = core_eyalet
						}
						religion = ROOT
					}
					amount = 6
				}
				reform_level = 8
			}
		}
		effect = {
			country_event_with_insight = {
				id = flavor_tur.257
				insight_tooltip = INSIGHT_JUST_TOOLTIP
				effect_tooltip = "
				add_adm_power = 100
				unlock_government_reform = {
					government_reform = fiqh_laws_reform
				}
				add_government_reform = fiqh_laws_reform"
			}
			remove_country_modifier = tur_religious_legal_code_level_2
			add_country_modifier = {
				name = tur_religious_legal_code_level_3
				duration = -1
			}
		}

		ai_weight = {
			factor = 250
		}
	}
}

tur_mysticism_path = {
	slot = 4
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Domination"
	}
	potential = {
		has_dlc = "Domination"
		tag = TUR
		NOT = { map_setup = map_setup_random }
		has_country_flag = tur_chose_mysticism
	}
	has_country_shield = yes

	tur_embrace_mysticism = {
		icon = mission_sufism
		required_missions = { tur_seize_the_caliphate }
		position = 10
		provinces_to_highlight = {
		}
		trigger = {
			not_in_mission_preview_mode = { key = TUR }
			religion_group = muslim
			if = {
				limit = { has_dlc = "Cradle of Civilization" }
				NOT = { piety = -0.74 }
			}
			else = {
				OR = {
					NOT = { has_estate = estate_dhimmi }
					estate_loyalty = {
						estate = estate_dhimmi
						loyalty = 60
					}
				}
			}
		}
		effect = {
			add_country_modifier = {
				name = tur_spiritual_focus_level_1
				duration = -1
			}
			custom_tooltip = upgradable_modifier_tt
		}

		ai_weight = {
			factor = 250
		}
	}

	tur_expand_the_dhimmi = {
		icon = mission_dhimmi
		required_missions = { tur_embrace_mysticism }
		position = 11
		provinces_to_highlight = {
			country_or_non_sovereign_subject_holds = ROOT
			NOT = { religion_group = ROOT }
			OR = {
				NOT = { has_tax_building_trigger = yes }
			}
		}
		trigger = {
			not_in_mission_preview_mode = { key = TUR }
			religion_group = muslim
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				NOT = { religion_group = ROOT }
				has_tax_building_trigger = yes
				value = 45
			}
			calc_true_if = {
				all_subject_country = {
					NOT = { religion_group = ROOT }
				}
				amount = 3
			}
			if = {
				limit = { has_estate = estate_dhimmi }
				estate_loyalty = {
					estate = estate_dhimmi
					loyalty = 60
				}
			}
		}
		effect = {
			remove_country_modifier = tur_spiritual_focus_level_1
			add_country_modifier = {
				name = tur_spiritual_focus_level_2
				duration = -1
			}
			custom_tooltip = upgradable_modifier_tt
		}

		ai_weight = {
			factor = 250
		}
	}

	tur_develop_the_devshime_system_further = {
		icon = mission_bektashi
		required_missions = { tur_expand_the_dhimmi }
		position = 12
		provinces_to_highlight = {
		}
		trigger = {
			not_in_mission_preview_mode = { key = TUR }
			religion_group = muslim
			if = {
				limit = {
					has_estate = estate_dhimmi
				}
				estate_loyalty = {
					estate = estate_dhimmi
					loyalty = 70
				}
				num_of_estate_privileges = {
					estate = estate_dhimmi
					value = 4
				}
			}
			OR = {
				philosopher = 3
				theologian = 3
			}
			if = {
				limit = { has_government_attribute = has_eyalets }
				calc_true_if = {
					all_subject_country = {
						is_eyalet_trigger = yes
						NOT = { religion_group = ROOT }
					}
					amount = 6
				}
			}
		}
		effect = {
			country_event_with_insight = {
				id = flavor_tur.258
				insight_tooltip = INSIGHT_JUST_TOOLTIP
				effect_tooltip = "
				add_adm_power = 100
				unlock_government_reform = {
					government_reform = sufism_decree_reform
				}
				add_government_reform = sufism_decree_reform"
			}
			remove_country_modifier = tur_spiritual_focus_level_2
			add_country_modifier = {
				name = tur_spiritual_focus_level_3
				duration = -1
			}
		}

		ai_weight = {
			factor = 250
		}
	}
}

tur_non_muslim_path = {
	slot = 4
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Domination"
	}
	potential = {
		has_dlc = "Domination"
		tag = TUR
		NOT = { map_setup = map_setup_random }
		has_country_flag = tur_non_muslim_path_flag
	}
	has_country_shield = yes

	tur_one_faith_empire = {
		icon = mission_hands_praying
		required_missions = { tur_seize_the_caliphate }
		position = 10
		provinces_to_highlight = {
			owned_by = ROOT
			NOT = { religion = ROOT }
		}
		trigger = {
			not_in_mission_preview_mode = { key = TUR }
			all_owned_province = {
				religion = ROOT
			}
		}
		effect = {
			if = {
				limit = {
					has_estate = estate_church
				}
				add_estate_loyalty = {
					estate = estate_church
					loyalty = 20
				}
			}
			add_country_modifier = {
				name = tur_one_faith_empire_mod
				duration = 10850
			}
		}

		ai_weight = {
			factor = 250
		}
	}

	tur_spread_the_true_faith = {
		icon = mission_buddhist_monk_praying
		required_missions = { tur_one_faith_empire }
		position = 12
		provinces_to_highlight = {
		}
		trigger = {
			not_in_mission_preview_mode = { key = TUR }
			OR = {
				custom_trigger_tooltip = {
					tooltip = tur_spread_the_true_faith_at
					check_variable = {
						which = num_of_forced_conversions
						value = 15
					}
				}
				custom_trigger_tooltip = {
					tooltip = tur_spread_the_true_faith_bt
					check_variable = {
						which = num_converted_religion
						value = 150
					}
				}
			}
		}
		effect = {
			add_country_modifier = {
				name = tur_religious_empire
				duration = -1
			}
			change_ruler_stat = {
				type = adm
				amount = 1
			}
			change_ruler_stat = {
				type = dip
				amount = 1
			}
			change_ruler_stat = {
				type = mil
				amount = 1
			}
		}

		ai_weight = {
			factor = 250
		}
	}
}

#Back to normal
tur_issue_the_kannuname_slot = {
	slot = 4
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Domination"
	}
	potential = {
		has_dlc = "Domination"
		tag = TUR
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes

	tur_issue_the_kannuname = {
		icon = mission_ottoman_law
		required_missions = {  }
		position = 13
		provinces_to_highlight = {
			owned_by = ROOT
			NOT = { has_courthouse_building_trigger = yes }
			has_owner_religion = no
		}
		trigger = {
			num_of_owned_provinces_with = {
				has_owner_religion = no
				OR = {
					has_building = courthouse
					has_building = town_hall
				}
				value = 10
			}
			if = {
				limit = { has_estate = estate_dhimmi }
				OR = {
					estate_loyalty = {
						estate = estate_dhimmi
						loyalty = 80
					}
					custom_trigger_tooltip = {
						tooltip = tur_3_toh_tt
						has_global_modifier_value = {
							which = tolerance_heathen
							value = 3
						}
					}
				}
			}
			else = { monthly_adm = 10 }
		}
		effect = {
			country_event_with_insight = {
				id = flavor_tur.254
				insight_tooltip = INSIGHT_JUST_TOOLTIP
				effect_tooltip = "
				change_ruler_stat = {
					type = adm
					amount = 2
				}
				add_ruler_modifier = {
					name = tur_legendary_lawgiver_modifier
					duration = -1
				}"
			}
		}

		ai_weight = {
			factor = 250
		}
	}
}

tur_persian_conquest = {
	slot = 5
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Domination"
	}
	potential = {
		has_dlc = "Domination"
		tag = TUR
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes

	tur_refill_the_ortas = {
		icon = mission_ottoman_early_army
		required_missions = {  }
		position = 1
		provinces_to_highlight = {
		}
		trigger = {
			army_size_percentage = 0.9
		}
		effect = {
			custom_tooltip = tur_refill_the_ortas_tt
			hidden_effect = {
				anatolia_region = {
					limit = {
						OR = {
							culture = turkish
							culture = oghuz_culture # Religions & Cultures Expanded
						}
						NOT = { is_core = ROOT }
						NOT = { is_permanent_claim = ROOT }
					}
					add_permanent_claim = ROOT
				}
				mashriq_region = {
					limit = {
						OR = {
							culture = turkish
							culture = oghuz_culture # Religions & Cultures Expanded
						}
						NOT = { is_core = ROOT }
						NOT = { is_permanent_claim = ROOT }
					}
					add_permanent_claim = ROOT
				}
			}
		}

		ai_weight = {
			factor = 250
		}
	}

	tur_conquer_anatolian_beyliks = {
		icon = mission_the_great_conqueror
		required_missions = { tur_refill_the_ortas }
		position = 2
		provinces_to_highlight = {
			OR = {
				culture = turkish
				culture = oghuz_culture # Religions & Cultures Expanded
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				OR = {
					culture = turkish
					culture = oghuz_culture # Religions & Cultures Expanded
				}
				value = 30
			}
		}
		effect = {
			add_adm_power = 100
			anatolia_region = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
		}

		ai_weight = {
			factor = 250
		}
	}

	tur_unify_anatolia = {
		icon = mission_unify_anatolia
		required_missions = {
			tur_city_of_worlds_desire
			tur_conquer_anatolian_beyliks
		}
		position = 4
		provinces_to_highlight = {
			region = anatolia_region
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				region = anatolia_region
				value = 40
			}
		}
		effect = {
			country_event_with_insight = {
				id = flavor_tur.231
				insight_tooltip = INSIGHT_JUST_TOOLTIP
				effect_tooltip = "
				anatolia_region = {
					limit = { country_or_non_sovereign_subject_holds = ROOT }
					add_province_modifier = {
						name = tur_integration_in_the_ottoman_government_modifier
						duration = 5475
					}
				}"
			}
			mashriq_region = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			caucasia_region = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
		}

		ai_weight = {
			factor = 250
		}
	}

	tur_conquer_the_causcasus = {
		icon = mission_the_caucasus_tur
		required_missions = { tur_unify_anatolia }
		position = 6
		provinces_to_highlight = {
			region = caucasia_region
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				region = caucasia_region
				value = 20
			}
		}
		effect = {
			country_event_with_insight = {
				id = flavor_tur.232
				insight_tooltip = INSIGHT_JUST_TOOLTIP
				effect_tooltip = "
				add_mil_power = 50
				caucasia_region = {
					limit = {
						country_or_non_sovereign_subject_holds = ROOT
					}
					add_province_modifier = {
						name = tur_caucasian_conquest
						duration = 9125
					}
				}"
			}
			persia_region = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
		}

		ai_weight = {
			factor = 250
		}
	}

	tur_conquer_persia = {
		icon = mission_persian_lion
		required_missions = { tur_conquer_the_causcasus }
		position = 8
		provinces_to_highlight = {
			region = persia_region
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				region = persia_region
				value = 20
			}
		}
		effect = {
			country_event_with_insight = {
				id = flavor_tur.237
				insight_tooltip = INSIGHT_JUST_TOOLTIP
				effect_tooltip = "
				khorasan_region = {
					limit = {
						NOT = { is_core = ROOT }
						NOT = { is_permanent_claim = ROOT }
					}
					add_permanent_claim = ROOT
				}
				add_splendor = 200
				add_prestige_or_monarch_power = {
					amount = 50
				}
				add_country_modifier = {
					name = tur_conquest_of_persia
					duration = 18250
				}"
			}
		}

		ai_weight = {
			factor = 250
		}
	}

	tur_creation_of_persian_eyalet = {
		icon = mission_persian_eyalet
		required_missions = { tur_conquer_persia }
		position = 9
		provinces_to_highlight = {
			if = {
				limit = { ROOT = { has_country_flag = tur_created_persian_eyalet } }
				region = persia_region
				NOT = { country_or_non_sovereign_subject_holds = ROOT }
			}
			else = {
				OR = {
					AND = {
						region = egypt_region
						OR = {
							NOT = { country_or_non_sovereign_subject_holds = ROOT }
							local_autonomy_above_min = 10
						}
					}
					AND = {
						OR = {
							area = bahari_area
							area = delta_area
						}
						NOT = { num_of_times_improved = 4 }
					}
				}
			}
		}
		trigger = {
			OR = {
				custom_trigger_tooltip = {
					tooltip = tur_creation_of_persian_eyalet_at
					OR = {
						has_country_flag = tur_created_persian_eyalet
						has_country_flag = tur_keeps_persia_for_themselves
					}
				}
				NOT = { has_government_attribute = has_eyalets }
			}
			if = {
				limit = {
					NOT = { has_country_flag = tur_created_persian_eyalet }
					NOT = { has_country_flag = tur_keeps_persia_for_themselves }
					has_government_attribute = has_eyalets
				}
				custom_trigger_tooltip = {
					tooltip = tur_creation_of_persian_eyalet_bt
					always = no
				}
			}
			else_if = {
				limit = { has_country_flag = tur_created_persian_eyalet }
				OR = {
					AND = {
						has_dip_advisor_3 = yes
						any_subject_country = {
							NOT = { liberty_desire = 10 }
							has_opinion = {
								who = ROOT
								value = 100
							}
							capital_scope = {
								region = persia_region
							}
							OR = {
								is_subject_of_type = eyalet
								is_subject_of_type = core_eyalet
							}
						}
					}
					AND = {
						NOT = { exists = EGY }
						persia_region = {
							country_or_non_sovereign_subject_holds = ROOT
							type = all
						}
					}
				}
			}
			else = {
				egypt_region = {
					country_or_non_sovereign_subject_holds = ROOT
					NOT = { local_autonomy_above_min = 10 }
					type = all
				}
				bahari_area = {
					type = all
					country_or_non_sovereign_subject_holds = ROOT
					num_of_times_improved = 4
				}
				delta_area = {
					type = all
					country_or_non_sovereign_subject_holds = ROOT
					num_of_times_improved = 4
				}
			}
		}
		effect = {
			change_ruler_stat = {
				type = dip
				amount = 2
			}
			country_event_with_insight = {
				id = flavor_tur.259
				insight_tooltip = INSIGHT_JUST_TOOLTIP
				effect_tooltip = "
				add_adm_power = 100
				persia_region = {
					limit = {
						country_or_non_sovereign_subject_holds = ROOT
					}
					add_province_modifier = {
						name = tur_investment_into_infrastructure
						duration = 9125
					}
				}"
			}
		}

		ai_weight = {
			factor = 250
		}
	}

	tur_the_silk_road = {
		icon = mission_silk_road
		required_missions = { tur_creation_of_persian_eyalet }
		position = 10
		provinces_to_highlight = {
			area = tabarestan_area
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			treasury = 1250
			tabarestan_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT
			}
			if = {
				limit = { has_dlc = "Dharma" }
				4341 = { province_has_center_of_trade_of_level = 3 }
			}
			else = {
				4341 = { base_production = 12 }
			}
			4341 = { has_trade_building_trigger = yes }
		}
		effect = {
			add_mercantilism = 5
			4341 = {
				set_center_level_3_center_of_trade = yes
				add_province_modifier = {
					name = tur_silk_road_main_trade_post
					duration = -1
				}
			}
		}
	}

	tur_imperial_fabrics = {

		icon = mission_finest_carpets
		required_missions = { tur_the_silk_road }
		position = 11
		provinces_to_highlight = {
		}
		trigger = {
			trading_bonus = {
				trade_goods = cotton
				value = yes
			}
			trading_bonus = {
				trade_goods = cloth
				value = yes
			}
			trading_bonus = {
				trade_goods = silk
				value = yes
			}
			trading_bonus = {
				trade_goods = wool
				value = yes
			}
			trading_bonus = {
				trade_goods = dyes
				value = yes
			}
			1320 = {
				trade_share = {
					country = ROOT
					share = 80
				}
			}
			377 = {
				trade_share = {
					country = ROOT
					share = 75
				}
			}
			358 = {
				trade_share = {
					country = ROOT
					share = 75
				}
			}
			4341 = {
				trade_share = {
					country = ROOT
					share = 75
				}
			}
		}
		effect = {
			country_event_with_insight = {
				id = flavor_tur.252
				insight_tooltip = INSIGHT_JUST_TOOLTIP
				effect_tooltip = "
				custom_tooltip = tur_25_goods_fabrics_tt
				add_country_modifier = {
					name = tur_golden_silk_modifier
					duration = -1
				}"
			}
		}

		ai_weight = {
			factor = 250
		}
	}

	tur_second_islamic_golden_age = {
		icon = mission_islamic_golden_age
		required_missions = {  }
		position = 13
		provinces_to_highlight = {
			OR = {
				province_id = 504
				province_id = 225
				province_id = 151
				province_id = 410
				province_id = 385
				province_id = 384
				province_id = 124
				province_id = 125
				province_id = 425
				province_id = 382
				province_id = 454
				province_id = 347
				province_id = 388
				province_id = 400
			}
			OR = {
				NOT = { country_or_non_sovereign_subject_holds = ROOT }
				AND = {
					OR = {
						province_id = 385
						province_id = 410
						province_id = 379
						province_id = 384
					}
					OR = {
						NOT = { religion = ROOT }
						NOT = { development = 25 }
					}
				}
			}
		}
		trigger = {
			OR = {
				mission_completed = tur_rework_the_devshirme_system
				mission_completed = tur_develop_the_devshime_system_further
				if = {
					limit = { has_country_flag = tur_non_muslim_path_flag }
					mission_completed = tur_spread_the_true_faith
				}
			}
			if = {
				limit = {
					religion_group = muslim
				}
				religion_group = muslim
				if = {
					limit = { has_dlc = "Star and Crescent" }
					has_country_modifier = unified_islam
				}
				else = {
					owns_or_vassal_of = 504
					owns_or_vassal_of = 225
					owns_or_vassal_of = 151
					owns_or_vassal_of = 410
					owns_or_vassal_of = 385
					owns_or_vassal_of = 384
					owns_or_vassal_of = 124
					owns_or_vassal_of = 125
					owns_or_vassal_of = 425
					owns_or_vassal_of = 382
					owns_or_vassal_of = 454
					owns_or_vassal_of = 347
					owns_or_vassal_of = 388
					owns_or_vassal_of = 400
				}
				custom_trigger_tooltip = {
					tooltip = tur_any_islamic_nation_higher_dev_or_army_tt
					NOT = {
						any_country = {
							religion_group = muslim
							army_size = ROOT
							total_development = ROOT
						}
					}
				}
			}
			religious_unity = 1
			385 = {
				country_or_non_sovereign_subject_holds = ROOT
				religion = ROOT
				development = 25
			}
			410 = {
				country_or_non_sovereign_subject_holds = ROOT
				religion = ROOT
				development = 25
			}
			379 = {
				country_or_non_sovereign_subject_holds = ROOT
				religion = ROOT
				development = 25
			}
			384 = {
				country_or_non_sovereign_subject_holds = ROOT
				religion = ROOT
				development = 25
			}
		}
		effect = {
			if = {
				limit = {
					religion_group = muslim
				}
				country_event_with_insight = {
					id = flavor_tur.255
					insight_tooltip = INSIGHT_JUST_TOOLTIP
					effect_tooltip = "
					if = {
						limit = { has_dlc = \"Mandate of Heaven\" }
						custom_tooltip = tur_enable_second_golden_era_decision_tt
						hidden_effect = {
							set_country_flag = tur_enable_second_golden_era_decision
						}
					}
					else = {
						add_country_modifier = {
							name = tur_second_islamic_golden_era_modifier
							duration = 18250
						}
					}
					custom_tooltip = flavor_tur.255.a.tt"
				}
			}
			else = {
				add_adm_power = 200
				add_dip_power = 200
				add_mil_power = 200
				add_splendor = 800
			}
		}

		ai_weight = {
			factor = 250
		}
	}
}

#Missions about the Stagnation of the Ottomans
tur_stagnation_slot_1 = {
	slot = 1
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Domination"
	}
	potential = {
		has_dlc = "Domination"
		tag = TUR
		NOT = { map_setup = map_setup_random }
		has_country_flag = tur_unlocked_disaster_missions
	}
	has_country_shield = yes

	tur_oppose_the_janissaries = {
		icon = mission_late_janissaries
		required_missions = {  }
		position = 14
		provinces_to_highlight = {
		}
		trigger = {
			if = {
				limit = { has_disaster = tur_disaster_ottoman_power_struggle }
				custom_trigger_tooltip = {
					tooltip = tur_had_power_struggle_for_three_years_tt
					had_country_flag = {
						flag = tur_has_ottoman_power_struggle
						days = 1095
					}
				}
				if = {
					limit = { has_disaster = tur_disaster_janissary_coup }
					NOT = { num_of_rebel_armies = 1 }
					NOT = { num_of_rebel_controlled_provinces = 1 }
					monthly_mil = 9
					custom_trigger_tooltip = {
						tooltip = tur_oppose_the_janissaries_bt
						had_country_flag = {
							flag = tur_has_janissary_coup
							days = 365
						}
					}
				}
				else = {
					estate_loyalty = {
						estate = estate_janissaries
						loyalty = 80
					}
					NOT = { janissary_percentage = 0.5 }
					legitimacy = 90
					custom_trigger_tooltip = {
						tooltip = tur_oppose_the_janissaries_at
						NOT = { has_disaster = tur_disaster_janissary_coup }
					}
				}
			}
			else = {
				monthly_mil = 9
				OR = {
					NOT = { has_estate = estate_janissaries }
					NOT = {
						estate_influence = {
							estate = estate_janissaries
							influence = 60
						}
					}
				}
			}
		}
		effect = {
			if = {
				limit = { has_disaster = tur_disaster_ottoman_power_struggle }
				custom_tooltip = tur_oppose_the_janissaries_ct
				hidden_effect = {
					set_country_flag = tur_unlocked_first_janissary_slaughter
					set_country_flag = tur_unlocked_janissary_negotiations
				}
				add_stability_or_adm_power = yes
				add_yearly_manpower = 2
				add_mil_power = 100
			}
			else = {
				add_mil_power = 200
			}
		}

		ai_weight = {
			factor = 250
		}
	}

	tur_establish_the_new_army = {
		icon = mission_modern_ottoman_soldiers
		required_missions = { tur_oppose_the_janissaries }
		position = 15
		provinces_to_highlight = {
		}
		trigger = {
			if = {
				limit = { has_disaster = tur_disaster_ottoman_power_struggle }
				if = {
					limit = { has_disaster = tur_disaster_janissary_coup }
					army_size_percentage = 0.8
					has_mil_advisor_3 = yes
					monthly_mil = 12
					is_monarch_leader = yes
					OR = {
						AND = {
							custom_trigger_tooltip = {
								tooltip = tur_establish_the_new_army_at
								has_country_flag = tur_fight_against_the_janissaries_1_flag
							}
							NOT = { has_spawned_rebels = janissary_rebels }
						}
						NOT = {
							num_of_estate_privileges = {
								estate = estate_janissaries
								value = 6
							}
						}
					}
				}
				else = {
					army_size_percentage = 1
					NOT = { janissary_percentage = 0.1 }
					OR = {
						NOT = { has_estate = estate_janissaries }
						NOT = {
							estate_influence = {
								estate = estate_janissaries
								influence = 50
							}
						}
					}
					legitimacy = 90
					stability = 2
					has_mil_advisor_3 = yes
					monthly_mil = 12
					custom_trigger_tooltip = {
						tooltip = tur_oppose_the_janissaries_at
						NOT = { has_disaster = tur_disaster_janissary_coup }
					}
				}
			}
			else = {
				army_size_percentage = 1
				NOT = { janissary_percentage = 0.1 }
				OR = {
					NOT = { has_estate = estate_janissaries }
					NOT = {
						estate_influence = {
							estate = estate_janissaries
							influence = 50
						}
					}
				}
			}
		}
		effect = {
			if = {
				limit = { has_disaster = tur_disaster_ottoman_power_struggle }
				if = {
					limit = { NOT = { has_country_flag = tur_unlocked_second_janissary_slaughter } }
					custom_tooltip = tur_establish_the_new_army_bt
					hidden_effect = {
						set_country_flag = tur_unlocked_second_janissary_slaughter
					}
				}
				else = {
					custom_tooltip = tur_establish_the_new_army_ct
					hidden_effect = {
						set_country_flag = tur_unlocked_third_janissary_slaughter
					}
				}
				add_stability_or_adm_power = yes
				add_yearly_manpower = 2
				add_mil_power = 100
				add_army_professionalism = 0.05
				add_army_tradition = 25
				add_legitimacy = 25
			}
			add_country_modifier = {
				name = tur_the_turkish_national_force
				duration = 9125
			}
		}

		ai_weight = {
			factor = 250
		}
	}

	tur_the_mansure_reforms = {
		icon = mission_mansure_army
		required_missions = {
			tur_establish_the_new_army
			tur_revoke_the_privileges
		}
		position = 16
		provinces_to_highlight = {
		}
		trigger = {
			if = {
				limit = { has_disaster = tur_disaster_ottoman_power_struggle }
				OR = {
					custom_trigger_tooltip = {
						tooltip = tur_the_mansure_reforms_ct
						has_country_flag = tur_had_janissary_coup
					}
					AND = {
						if = {
							limit = { has_dlc = "Cradle of Civilization" }
							OR = {
								num_of_completed_idea_groups_by_category = {
									type = mil
									amount = 2
								}
								army_professionalism = 0.65
							}
						}

						OR = {
							num_of_completed_idea_groups_by_category = {
								type = mil
								amount = 2
							}
							army_tradition = 70
						}
						has_mil_advisor_3 = yes
						stability = 3
						NOT = { has_spawned_rebels = janissary_rebels }
						OR = {
							NOT = { has_estate = estate_janissaries }
							NOT = {
								estate_influence = {
									estate = estate_janissaries
									influence = 40
								}
							}
						}
					}
				}
			}
			else = {
				OR = {
					num_of_completed_idea_groups_by_category = {
						type = mil
						amount = 2
					}
					army_tradition = 70
				}
				has_mil_advisor_3 = yes
				stability = 3
				NOT = { has_spawned_rebels = janissary_rebels }
				OR = {
					NOT = { has_estate = estate_janissaries }
					NOT = {
						estate_influence = {
							estate = estate_janissaries
							influence = 40
						}
					}
				}
			}
		}
		effect = {
			custom_tooltip = tur_the_mansure_reforms_at
			if = {
				limit = {
					has_country_flag = tur_fight_against_the_janissaries_1_flag
					has_country_flag = tur_fight_against_the_janissaries_2_flag
					has_country_flag = tur_fight_against_the_janissaries_3_flag
				}
				custom_tooltip = BONUS_REWARD_YES
			}
			else = { custom_tooltip = BONUS_REWARD_NO }
			tooltip = {
				country_event_with_insight = {
					id = flavor_tur.288
					insight_tooltip = INSIGHT_JUST_TOOLTIP
					effect_tooltip = "
					unlock_government_reform = {
						government_reform = mansure_army_reform
					}
					add_government_reform = mansure_army_reform
					change_technology_group = western
					change_unit_type = western"
				}
			}
			custom_tooltip = mission_alternatively_tt
			if = {
				limit = {
					OR = {
						NOT = { has_country_flag = tur_fight_against_the_janissaries_1_flag }
						NOT = { has_country_flag = tur_fight_against_the_janissaries_2_flag }
						NOT = { has_country_flag = tur_fight_against_the_janissaries_3_flag }
					}
				}
				custom_tooltip = BONUS_REWARD_YES
			}
			else = { custom_tooltip = BONUS_REWARD_NO }
			tooltip = {
				country_event_with_insight = {
					id = flavor_tur.289
					insight_tooltip = INSIGHT_JUST_TOOLTIP
					effect_tooltip = "
					unlock_government_reform = {
						government_reform = janissary_military_reform
					}
					add_government_reform = janissary_military_reform
					add_estate_loyalty = {
						estate = estate_janissaries
						loyalty = 100
					}"
				}
			}
			hidden_effect = {
				if = {
					limit = {
						has_country_flag = tur_fight_against_the_janissaries_1_flag
						has_country_flag = tur_fight_against_the_janissaries_2_flag
						has_country_flag = tur_fight_against_the_janissaries_3_flag
					}
					country_event = {
						id = flavor_tur.288
					}
				}
				else = {
					country_event = {
						id = flavor_tur.289
					}
				}
			}
		}

		ai_weight = {
			factor = 250
		}
	}
}

tur_stagnation_slot_2 = {
	slot = 2
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Domination"
	}
	potential = {
		has_dlc = "Domination"
		tag = TUR
		NOT = { map_setup = map_setup_random }
		has_country_flag = tur_unlocked_disaster_missions
	}
	has_country_shield = yes

	tur_revoke_the_privileges = {
		icon = mission_late_ottoman_reforms
		required_missions = { tur_oppose_the_janissaries }
		position = 15
		provinces_to_highlight = {
		}
		trigger = {
			NOT = { has_estate_privilege = estate_janissary_janissaries_from_muslims }
			OR = {
				has_global_modifier_value = {
					which = discipline
					value = 0.25
				}
				land_morale = 5
				army_size_percentage = 0.8
			}
			NOT = { has_spawned_rebels = janissary_rebels }
			if = {
				limit = { NOT = { has_disaster = tur_disaster_ottoman_power_struggle } }
				OR = {
					NOT = { has_estate = estate_janissaries }
					NOT = {
						estate_influence = {
							estate = estate_janissaries
							influence = 40
						}
					}
				}
			}
		}
		effect = {
			if = {
				limit = { has_disaster = tur_disaster_ottoman_power_struggle }
				if = {
					limit = { NOT = { has_country_flag = tur_unlocked_second_janissary_slaughter } }
					custom_tooltip = tur_establish_the_new_army_bt
					hidden_effect = {
						set_country_flag = tur_unlocked_second_janissary_slaughter
					}
				}
				else = {
					custom_tooltip = tur_establish_the_new_army_ct
					hidden_effect = {
						set_country_flag = tur_unlocked_third_janissary_slaughter
					}
				}
				country_event_with_insight = {
					id = flavor_tur.286
					insight_tooltip = INSIGHT_JUST_TOOLTIP
					effect_tooltip = "
					add_piety = 0.25
					add_government_reform = ottoman_conscription_reform
					if = {
						limit = { has_unlocked_government_reform = { government_reform = expanded_devshirme_system_reform } }
						add_government_reform = reformed_ottoman_conscription_reform
					}
					add_yearly_manpower = 3"
				}
			}
			else = {
				add_mil_power = 200
			}
		}

		ai_weight = {
			factor = 250
		}
	}
}

tur_stagnation_slot_3 = {
	slot = 3
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Domination"
	}
	potential = {
		has_dlc = "Domination"
		tag = TUR
		NOT = { map_setup = map_setup_random }
		has_country_flag = tur_unlocked_disaster_missions
	}
	has_country_shield = yes

	tur_crush_the_eyalet_rebellion = {
		icon = mission_eyalet_crisis
		required_missions = {  }
		position = 15
		provinces_to_highlight = {
		}
		trigger = {
			if = {
				limit = { has_disaster = tur_disaster_ottoman_power_struggle }
				custom_trigger_tooltip = {
					tooltip = tur_had_power_struggle_for_three_years_tt
					had_country_flag = {
						flag = tur_has_ottoman_power_struggle
						days = 1095
					}
				}
				OR = {
					NOT = { has_disaster = tur_disaster_eyalet_rebellion }
					custom_trigger_tooltip = {
						tooltip = tur_crush_the_eyalet_rebellion_at
						had_country_flag = {
							flag = tur_has_eyalet_rebellion
							days = 365
						}
					}
				}
				NOT = {
					any_subject_country = {
						OR = {
							has_spawned_rebels = renegade_sultan_son_rebels
							has_spawned_rebels = independence_rebels
						}
					}
				}
			}
			else = {
				num_of_subjects = 12
				NOT = {
					any_subject_country = {
						OR = {
							liberty_desire = 20
							num_of_rebel_armies = 1
							num_of_rebel_controlled_provinces = 1
						}
					}
				}
				stability = 3
				NOT = { num_of_rebel_armies = 1 }
				NOT = { num_of_rebel_controlled_provinces = 1 }
			}
		}
		effect = {
			add_stability_or_adm_power = yes
			add_country_modifier = {
				name = tur_reigned_the_eyalets
				duration = 10950
			}
		}

		ai_weight = {
			factor = 250
		}
	}

	tur_centralize_the_power = {
		icon = mission_crush_eyalet_rebellion
		required_missions = { tur_crush_the_eyalet_rebellion }
		position = 16
		provinces_to_highlight = {
		}
		trigger = {
			if = {
				limit = {
					is_absolutism_active = yes
				}
				absolutism = 70
			}
			NOT = { num_of_rebel_armies = 1 }
			NOT = { num_of_rebel_controlled_provinces = 1 }
			if = {
				limit = { has_disaster = tur_disaster_eyalet_rebellion }
				NOT = {
					any_subject_country = {
						OR = {
							is_subject_of_type = eyalet
							is_subject_of_type = core_eyalet
						}
						OR = {
							liberty_desire = 10
							num_of_rebel_armies = 1
							num_of_rebel_controlled_provinces = 1
						}
					}
				}
				monthly_dip = 12
			}
			else = {
				NOT = {
					any_subject_country = {
						liberty_desire = 10
					}
				}
			}
		}
		effect = {
			custom_tooltip = tur_centralize_the_power_at
			add_stability_or_adm_power = yes
			set_country_flag = tur_reduced_requirements_for_core_eyalet
		}

		ai_weight = {
			factor = 250
		}
	}

	tur_a_new_dawn = {
		icon = mission_ottoman_new_dawn
		required_missions = {
			tur_the_mansure_reforms
			tur_the_reign_of_women
			tur_centralize_the_power
			tur_remove_pashas_from_power
		}
		position = 17
		provinces_to_highlight = {
		}
		trigger = {
			has_any_disaster = no
			is_bankrupt = no
			stability = 3
			NOT = { corruption = 2 }
			NOT = { num_of_loans = 6 }
		}
		effect = {
			add_power_projection = {
				type = tur_a_reborn_empire
				amount = 100
			}
			if = {
				limit = { is_revolutionary = no }
				add_country_modifier = {
					name = tur_a_reborn_empire_modifier
					duration = -1
				}
			}
			else = {
				add_country_modifier = {
					name = tur_the_republic_of_turkiye
					duration = -1
				}
			}
		}

		ai_weight = {
			factor = 250
		}
	}
}

tur_stagnation_slot_4 = {
	slot = 4
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Domination"
	}
	potential = {
		has_dlc = "Domination"
		tag = TUR
		NOT = { map_setup = map_setup_random }
		has_country_flag = tur_unlocked_disaster_missions
	}
	has_country_shield = yes

	tur_restructure_the_administration = {
		icon = mission_muslim_administrators
		required_missions = {  }
		position = 15
		provinces_to_highlight = {
			owned_by = ROOT
			OR = {
				local_autonomy_above_min = 5
				has_province_modifier = pasha_removed_modifier
				controlled_by = REB
			}
		}
		trigger = {
			reform_level = 7
			if = {
				limit = {
					#Promote Advisors - +2
					has_dlc = "Cradle of Civilization"
					#National Focus - +2
					has_dlc = "Res Publica"
					has_dlc = "Common Sense"
				}
				monthly_adm = 15
			}
			else_if = {
				limit = {
					OR = {
						has_dlc = "Cradle of Civilization"
						has_dlc = "Res Publica"
						has_dlc = "Common Sense"
					}
				}
				monthly_adm = 13
			}
			else = {
				monthly_adm = 11
			}
			has_adm_advisor_3 = yes
			OR = {
				num_of_completed_idea_groups_by_category = {
					type = adm
					amount = 2
				}
				AND = {
					NOT = { corruption = 0.5 }
					NOT = { average_autonomy_above_min = 15 }
				}
			}
		}
		effect = {
			country_event_with_insight = {
				id = flavor_tur.290
				insight_tooltip = INSIGHT_JUST_TOOLTIP
				effect_tooltip = "
				unlock_government_reform = {
					government_reform = standardized_millets_reform
				}
				add_government_reform = standardized_millets_reform
				add_adm_power = 200"
			}
		}

		ai_weight = {
			factor = 250
		}
	}

	tur_remove_pashas_from_power = {
		icon = mission_pasha_staff
		required_missions = { tur_restructure_the_administration }
		position = 16
		provinces_to_highlight = {
		}
		trigger = {
			if = {
				limit = { has_disaster = tur_disaster_ottoman_power_struggle }
				custom_trigger_tooltip = {
					tooltip = tur_had_power_struggle_for_three_years_tt
					had_country_flag = {
						flag = tur_has_ottoman_power_struggle
						days = 1095
					}
				}
			}
			OR = {
				NOT = { has_disaster = tur_disaster_pasha_decadence }
				custom_trigger_tooltip = {
					tooltip = tur_remove_pashas_from_power_ct
					had_country_flag = {
						flag = tur_has_pasha_decadence
						days = 1825
					}
				}
			}
			NOT = { num_of_rebel_armies = 1 }
			NOT = { num_of_rebel_controlled_provinces = 1 }
			OR = {
				NOT = {
					any_owned_province = {
						has_pasha = yes
					}
				}
				num_of_owned_provinces_with = {
					NOT = { culture = ROOT }
					has_pasha = yes
					value = 125
				}
			}
			NOT = {
				any_owned_province = {
					has_province_modifier = pasha_removed_modifier
				}
			}
			stability = 2
		}
		effect = {
			custom_tooltip = tur_remove_pashas_from_power_tt
			add_adm_power = 350
			add_dip_power = 350
			add_mil_power = 350
		}

		ai_weight = {
			factor = 250
		}
	}
}

tur_stagnation_slot_5 = {
	slot = 5
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Domination"
	}
	potential = {
		has_dlc = "Domination"
		tag = TUR
		NOT = { map_setup = map_setup_random }
		has_country_flag = tur_unlocked_disaster_missions
	}
	has_country_shield = yes

	tur_regulate_the_harem = {
		icon = mission_harem
		required_missions = {  }
		position = 14
		provinces_to_highlight = {
		}
		trigger = {
			if = {
				limit = { has_disaster = tur_disaster_ottoman_power_struggle }
				custom_trigger_tooltip = {
					tooltip = tur_had_power_struggle_for_three_years_tt
					had_country_flag = {
						flag = tur_has_ottoman_power_struggle
						days = 1095
					}
				}
			}
			OR = {
				NOT = { has_disaster = tur_disaster_plot_of_the_harem }
				custom_trigger_tooltip = {
					tooltip = tur_regulate_the_harem_ct
					had_country_flag = {
						flag = tur_has_plot_of_the_harem
						days = 1095
					}
				}
			}
			OR = {
				has_country_modifier = tur_weakened_the_harem
				AND = {
					has_adm_advisor_3 = yes
					has_dip_advisor_3 = yes
					has_mil_advisor_3 = yes
					legitimacy = 60
				}
			}
		}
		effect = {
			if = {
				limit = { NOT = { has_country_modifier = tur_weakened_the_harem } }
				add_country_modifier = {
					name = tur_secured_loyalty_of_the_harem
					duration = -1
				}
			}
			else = {
				add_legitimacy = 25
				add_prestige_or_monarch_power = {
					amount = 25
				}
			}
		}

		ai_weight = {
			factor = 250
		}
	}

	tur_the_reign_of_women = {
		icon = mission_reign_of_women
		required_missions = { tur_regulate_the_harem }
		position = 16
		provinces_to_highlight = {
		}
		trigger = {
			if = {
				limit = { NOT = { has_country_modifier = tur_weakened_the_harem } }
				legitimacy = 90
				NOT = { has_spawned_rebels = pretender_rebels }
				stability = 3
				OR = {
					full_idea_group = court_ideas
					prestige = 100
				}
			}
			else = {
				legitimacy = 100
			}
		}
		effect = {
			custom_tooltip = tur_the_reign_of_women_tt
			if = {
				limit = { NOT = { has_country_modifier = tur_weakened_the_harem } }
				custom_tooltip = tur_the_reign_of_women_bt
			}
			else = {
				custom_tooltip = tur_the_reign_of_women_ct
			}
			if = {
				limit = {
					has_dlc = "Mandate of Heaven"
				}
				add_splendor = 400
			}
			else = {
				add_dip_power = 100
			}
		}

		ai_weight = {
			factor = 250
		}
	}
}