WoC_timurids_1 = {
	slot = 1
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = {
		tag = TIM
		NOT = { map_setup = map_setup_random }
		has_dlc = "Winds of Change"
	}
	has_country_shield = yes
	
	TIM_rumors_of_rebellion = {
		icon = mission_eliminate_pretenders
		required_missions = { }
		position = 1
		provinces_to_highlight = {
			owned_by = QOM
		}
		trigger = {
			OR = {
				war_with = QOM
				has_won_war_against = { who = QOM }
				NOT = { exists = QOM }
			}
		}
		effect = {
			add_country_modifier = {
				name = TIM_rising_tensions
				duration = 7300
			}
			
			add_mil_power = 75
			
			custom_tooltip = " "
			
			complex_dynamic_effect = {
				first_custom_tooltip = TIM_twice_army_of_ajam
				first_limit = "
					OR = {
						army_strength = {
							who = QOM
							value = 2
						}
						NOT = { exists = QOM }
					}
				"
				first_effect = "
					add_power_projection_mission = { amount = 10 }
				"
			}
		}
	}
	
	TIM_mushasha = {
		icon = mission_arabian_fort
		required_missions = { TIM_traitor }
		position = 3
		provinces_to_highlight = {
			OR = {
				owned_by = MSY
				area = khuzestan_area
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			OR = {
				NOT = { exists = MSY }
				has_won_war_against = { who = MSY }
			}
			khuzestan_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT
			}
		}
		effect = {
			give_claims = { area = basra_area }
			give_claims = { area = iraq_arabi_area }
			give_claims = { area = al_jazira_area }
			give_claims = { area = shahrizor_area }
			
			custom_tooltip = " "
			
			country_event_with_effect_insight = {
				id = flavor_tim.5
				effect = "
					add_country_modifier = {
						name = TIM_resolved_the_mushasha_milleniarism #increase ruler expectancy due to assassination concerns
						duration = 10950
					}
					
					khuzestan_area = {
						add_base_manpower = 1
					}
				"
			}
		}
	}
}

WoC_timurids_1_persia = {
	slot = 1
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = {
		tag = TIM
		NOT = { map_setup = map_setup_random }
		has_dlc = "Winds of Change"
		TIM_persia_tree_trigger = yes
	}
	has_country_shield = yes
	
	TIM_trade_in_west = {
		icon = mission_cradle_of_civilization #mission_arabian_city
		required_missions = { TIM_mushasha TIM_qoyunlu }
		position = 5
		provinces_to_highlight = {
			owned_by = ROOT
			OR = {
				region = mashriq_region
				region = anatolia_region
				region = caucasia_region
				area = tabriz_area
			}
			province_has_center_of_trade_of_level = 1
			OR = {
				NOT = { has_trade_building_trigger = yes }
				NOT = { num_of_times_improved = 4 }
			}
		}
		trigger = {
			not_in_mission_preview_mode = { key = TIM }
			num_of_owned_provinces_with = {
				OR = {
					region = mashriq_region
					region = anatolia_region
					region = caucasia_region
					area = tabriz_area
				}
				province_has_center_of_trade_of_level = 1
				has_trade_building_trigger = yes
				num_of_times_improved = 4
				value = 5
			}
		}
		effect = {
			add_country_modifier = {
				name = TIM_western_markets
				duration = -1
			}
			
			add_years_of_trade_income = {
				years = 2
				custom_tooltip = BYZ_add_2_years_of_trade_income
			}
			
			custom_tooltip = " "
			
			add_mercantilism = 5
		}
	}
}

WoC_timurids_1_nomad = {
	slot = 1
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = {
		tag = TIM
		NOT = { map_setup = map_setup_random }
		has_dlc = "Winds of Change"
		TIM_nomad_tree_trigger = yes
	}
	has_country_shield = yes
	
	TIM_mamluks = {
		icon = mission_egyptian_mamluk_soldier
		required_missions = { TIM_qoyunlu }
		position = 5
		provinces_to_highlight = {
			OR = {
				region = egypt_region
				area = palestine_area
				area = trans_jordan_area
				area = syria_area
				area = syrian_desert_area
				area = aleppo_area
				owned_by = MAM
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			not_in_mission_preview_mode = { key = TIM }
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				OR = {
					region = egypt_region
					area = palestine_area
					area = trans_jordan_area
					area = syria_area
					area = syrian_desert_area
					area = aleppo_area
					is_core = MAM
				}
				value = 40
			}
			if = {
				limit = {
					exists = MAM
				}
				has_won_war_against = { who = MAM }
			}
		}
		effect = {
			add_country_modifier = {
				name = TIM_great_power_mam
				duration = -1
			}
			
			add_army_tradition_or_mil_power = { 
				amount = 15
			}
		}
	}
}

WoC_timurids_1_2 = {
	slot = 1
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = {
		tag = TIM
		NOT = { map_setup = map_setup_random }
		has_dlc = "Winds of Change"
	}
	has_country_shield = yes
	
	TIM_rightful_protector = {
		icon = mission_protect_albania
		required_missions = { }
		position = 6
		provinces_to_highlight = {
		}
		trigger = {
			if = {
				limit = {
					OR = {
						has_estate = estate_nobles
						has_estate = estate_church
						has_estate = estate_burghers
					}
				}
				OR = {
					if = {
						limit = {
							has_estate = estate_nobles
						}
						num_of_estate_agendas_completed = {
							estate = estate_nobles
							value = 1
						}
					}
					else = { 
						hidden_trigger = { always = no }
					}
					if = {
						limit = {
							has_estate = estate_burghers
						}
						num_of_estate_agendas_completed = {
							estate = estate_burghers
							value = 1
						}
					}
					else = { 
						hidden_trigger = { always = no }
					}
					if = {
						limit = {
							has_estate = estate_church
						}
						num_of_estate_agendas_completed = {
							estate = estate_church
							value = 1
						}
					}
					else = { 
						hidden_trigger = { always = no }
					}
				}
			}
			stability = 1
			has_adm_advisor = yes
			has_dip_advisor = yes
			has_mil_advisor = yes
		}
		effect = {
			country_event_with_option_insight = {
				id = flavor_tim.10
				option_1 = "
					custom_tooltip = TIM_revoking_yasa_will_be_easier
					set_country_flag = TIM_revoking_yasa_will_be_easier_flag
					
					custom_tooltip = \" \"
					
					add_legitimacy = 10
					
					custom_tooltip = \" \"
					
					add_country_modifier = {
						name = TIM_a_pious_ruler
						duration = 10950
					}
				"
				option_2 = "
					custom_tooltip = TIM_soyurghals_will_be_less_penalizing
					set_country_flag = TIM_soyurghals_will_be_less_penalizing_flag
					
					custom_tooltip = \" \"
					
					add_country_modifier = {
						name = TIM_approval_of_governors
						duration = 9125
					}
					
					add_mil_power = 100
				"
			}
		}
	}
	
	TIM_defy_the_yasa = {
		icon = mission_vedic_education
		required_missions = { TIM_rightful_protector }
		position = 7
		provinces_to_highlight = {
		}
		trigger = {
			NOT = { has_estate_privilege = estate_church_TIM_yasa_supremacy }
			num_of_converted_provinces = { amount = 5 }
			if = {
				limit = {
					has_estate = estate_church
				}
				OR = {
					estate_loyalty = {	
						estate = estate_church
						loyalty = 65
					}
					num_of_estate_privileges = {
						estate = estate_church
						value = 4 
					}
				}
			}
			monthly_adm = 8
			monthly_dip = 8
		}
		effect = {
			add_country_modifier = {
				name = TIM_centralization_reforms
				duration = 10950
			}
			
			define_advisor = {
				type = statesman
				skill = 3
				culture = ROOT
				religion = ROOT
				cost_multiplier = 0.33
			}
			
			custom_tooltip = " "
			
			add_dip_power = 100
		}
	}
	
	TIM_diwan = {
		icon = mission_deccanis
		required_missions = { TIM_defy_the_yasa TIM_land_tenure }
		position = 8
		provinces_to_highlight = {
		}
		trigger = {
			diplomatic_reputation = 2
			num_of_states = 20
			stability = 2
			num_accepted_cultures = 3
		}
		effect = {
			if = {
				limit = {
					OR = {
						has_dlc = "Res Publica"
						has_dlc = "Common Sense"
					}
				}
				country_event_with_insight = {
					id = flavor_tim.11 
					insight_tooltip = TIM_unlock_timurid_diwan_reform
				}
			}
			else = {
				#No event insight so our player won't get confused by something which they don't have access too I guess
				country_event = {
					id = flavor_tim.11 
				}
			}
		}
	}
	
	TIM_military = {
		icon = per_qizilbash_loyalty
		required_missions = { }
		position = 9
		provinces_to_highlight = {
		}
		trigger = {
			num_of_battles = { amount = 15 }
			OR = {
				is_ahead_of_time_in_technology = { tech = mil }
				monthly_mil = 9
			}
			if = {
				limit = {
					has_estate = estate_nobles
				}
				OR = {
					estate_loyalty = {
						estate = estate_nobles
						loyalty = 55
					}
					num_of_estate_privileges = {
						estate = estate_nobles
						value = 4
					}
				}
			}
		}
		effect = {
			add_country_modifier = {
				name = TIM_army_reorganization
				duration = 3650
			}
			
			define_advisor = {
				type = army_reformer 
				skill = 2
				culture = ROOT
				religion = ROOT
				cost_multiplier = 0.5
			}
		}
	}
	
	TIM_recruits = {
		icon = per_balance_of_power
		required_missions = { TIM_military }
		position = 10
		provinces_to_highlight = {
			culture_group = iranian
			NOT = { has_manpower_building_trigger = yes }
			owned_by = ROOT 
		}
		trigger = {
			num_of_owned_provinces_with = {
				has_manpower_building_trigger = yes
				culture_group = iranian
				value = 5
			}
			OR = {
				max_manpower = 50
				manpower_percentage = 0.5
			}
		}
		effect = {
			add_country_modifier = {
				name = TIM_fresh_recruits
				duration = 10950
			}
			
			custom_tooltip = TIM_3_most_developed_manpower_upgrade
			tooltip = {
				if = {
					limit = {
						any_owned_province = {
							has_manpower_building_trigger = yes
						}
					}
					random_owned_province = {
						limit = {
							NOT = {
								ROOT = {
									any_owned_province = {
										higher_development_than = PREV_PREV
									}
								}
							}
						}
						add_or_upgrade_manpower_building = yes 
					}
				}
				else = {
					random_owned_province = {
						add_or_upgrade_manpower_building = yes 
					}
				}
			}
			hidden_effect = {
				country_event = { id = flavor_tim.12 }
			}
			
			custom_tooltip = " "
			
			create_general_with_pips = {
				add_fire = 1
				add_shock = 1
				add_manuever = 1
				add_siege = 1
				tradition = 25
			}
		}
	}
}

WoC_timurids_1_2_persia = {
	slot = 1
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = {
		tag = TIM
		NOT = { map_setup = map_setup_random }
		has_dlc = "Winds of Change"
		TIM_persia_tree_trigger = yes
	}
	has_country_shield = yes
	
	TIM_rise_of_artillery = {
		icon = mission_gunpowder_warfare
		required_missions = { TIM_recruits TIM_chagatai_elites }
		position = 11
		provinces_to_highlight = {
		}
		trigger = {
			not_in_mission_preview_mode = { key = TIM }
			if = {
				limit = {
					has_dlc = "Cradle of Civilization"
				}
				OR = {
					army_professionalism = 0.4
					army_tradition = 75
				}
			}
			else = { 
				army_tradition = 60
			}
			
			OR = {
				is_ahead_of_time_in_technology = { tech = mil }
				monthly_mil = 9
			}
			num_of_artillery = 8 # modified
		}
		effect = {
			add_country_modifier = {
				name = TIM_gunpowder_empire
				duration = -1
			}
			
			create_general_with_pips = {
				tradition = 30
				add_siege = 3
			}
			
			custom_tooltip = " "
			
			add_mil_power = 50
		}
	}
}

WoC_timurids_1_2_nomad = {
	slot = 1
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = {
		tag = TIM
		NOT = { map_setup = map_setup_random }
		has_dlc = "Winds of Change"
		TIM_nomad_tree_trigger = yes
	}
	has_country_shield = yes
	
	TIM_horsemen_of_apocalypse = {
		icon = mission_control_the_ganges_delta
		required_missions = { TIM_recruits TIM_chagatai_elites }
		position = 11
		provinces_to_highlight = {
		}
		trigger = {
			not_in_mission_preview_mode = { key = TIM }
			OR = {
				num_of_cavalry = 35 # modified
				cavalry_fraction = 0.4
			}
			num_of_battles = { amount = 100 }
		}
		effect = {
			add_country_modifier = {
				name = TIM_horsemen_of_apocalypse_modifier
				duration = -1
			}
			
			create_general_with_pips = {
				tradition = 60
				add_shock = 2
			}
			
			custom_tooltip = " "
			
			custom_tooltip = TIM_upgrade_amirs_in_officer_corps_mission
			set_country_flag = TIM_upgrade_amirs_in_officer_corps_mission_flag
		}
	}
}

WoC_timurids_2 = {
	slot = 2
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = {
		tag = TIM
		NOT = { map_setup = map_setup_random }
		has_dlc = "Winds of Change"
	}
	has_country_shield = yes
	
	TIM_fresh_blood = {
		icon = mission_reconquer_ceuta
		required_missions = { }
		position = 1
		provinces_to_highlight = {
		}
		trigger = {
			num_of_battles = { amount = 15 }
			army_tradition = 40
			num_of_generals = 1
		}
		effect = {
			add_country_modifier = {
				name = TIM_fresh_blood_modifier
				duration = 5475
			}
			
			add_yearly_manpower = 0.5
			
			if = {
				limit = {
					has_estate = estate_nobles
				}
				custom_tooltip = " "
				complex_dynamic_effect = {
					first_custom_tooltip = TIM_nobles_60_loyalty
					first_limit = "
						estate_loyalty = {
							estate = estate_nobles
							loyalty = 60
						}
					"
					first_effect = "
						define_advisor = {
							type = commandant
							skill = 2
							culture = ROOT
							religion = ROOT
							cost_multiplier = 0.4
						}
					"
				}
			}
		}
	}
	
	TIM_traitor = {
		icon = per_establish_western_defenses
		required_missions = { TIM_rumors_of_rebellion }
		position = 2
		provinces_to_highlight = {
			OR = {
				owned_by = QOM 
				OR = {
					area = azerbaijan_area
					area = iraq_e_ajam_area
					area = isfahan_area
				}
			}
			NOT = { owned_by = ROOT }
		}
		trigger = {
			OR = {
				QOM = { is_subject_of = ROOT }
				num_of_owned_provinces_with = {
					OR = {
						area = azerbaijan_area
						area = iraq_e_ajam_area
						area = isfahan_area
					}
					value = 10
				}
			}
		}
		effect = {
			give_claims = { area = khuzestan_area }
			give_claims = { area = tabarestan_area }
			
			custom_tooltip = " "
			
			complex_dynamic_effect_without_alternative = {
				first_custom_tooltip = TIM_if_done_via_conquest
				first_limit = "
					num_of_owned_provinces_with = {
						OR = {
							area = azerbaijan_area
							area = iraq_e_ajam_area
							area = isfahan_area
						}
						value = 10
					}
				"
				first_effect = "
					add_army_tradition_or_mil_power = { amount = 10 }
					
					custom_tooltip = \" \"
					
					custom_tooltip = TIM_shiite_provs_lose_5_unrest
					hidden_effect = {
						every_owned_province = {
							limit = {
								religion = shiite
							}
							add_local_autonomy = -10
						}
					}
				"
				second_custom_tooltip = TIM_if_done_via_subjugation
				second_limit = "
					QOM = { is_subject_of = ROOT }
				"
				second_effect = "
					add_country_modifier = {
						name = TIM_an_example_to_the_rebels
						duration = 10950
					}
				"
			}
		}
	}
	
	TIM_qoyunlu = {
		icon = per_butcher_black_sheep
		required_missions = { TIM_traitor TIM_mushasha TIM_mazandaran }
		position = 4
		provinces_to_highlight = {
			OR = {
				area = azerbaijan_area
				area = shirvan_area
				area = tabriz_area
				area = armenia_area
				area = north_kurdistan_area
				area = basra_area
				area = iraq_arabi_area
				area = al_jazira_area
				area = shahrizor_area
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			azerbaijan_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT
			}
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				OR = {
					area = shirvan_area
					area = tabriz_area
					area = armenia_area
					area = north_kurdistan_area
					area = basra_area
					area = iraq_arabi_area
					area = al_jazira_area
					area = shahrizor_area
				}
				value = 24
			}
		}
		effect = {
			extra_claims_for_nomadic_path = {
				effect = "
					give_claims = { region = egypt_region }
					give_claims = { area = palestine_area }
					give_claims = { area = trans_jordan_area }
					give_claims = { area = syria_area }
					give_claims = { area = syrian_desert_area }
					give_claims = { area = aleppo_area }
					give_claims = { region = anatolia_region }
					give_claims = { region = balkan_region }
				"
			}
			
			country_event_with_effect_insight = {
				id = flavor_tim.7
				effect = "
					azerbaijan_area = {
						add_random_development = 1
						
						add_province_modifier = {
							name = TIM_conflict_with_qara_qoyunlu_over
							duration = 5475
						}
					}
				"
			}
		}
	}
}

WoC_timurids_2_nomad = {
	slot = 2
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = {
		tag = TIM
		NOT = { map_setup = map_setup_random }
		has_dlc = "Winds of Change"
		TIM_nomad_tree_trigger = yes
	}
	has_country_shield = yes
	
	TIM_ottomans = {
		icon = mission_ottoman_diplomacy
		required_missions = { TIM_qoyunlu }
		position = 5
		provinces_to_highlight = {
			OR = {
				region = anatolia_region
				region = balkan_region
				owned_by = TUR
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			not_in_mission_preview_mode = { key = TIM }
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				OR = {
					region = anatolia_region
					region = balkan_region
					is_core = TUR
				}
				value = 50
			}
			if = {
				limit = {
					exists = TUR
				}
				has_won_war_against = { who = TUR }
			}
		}
		effect = {
			add_country_modifier = {
				name = TIM_great_power_tur
				duration = -1
			}
			
			add_prestige_or_monarch_power = { amount = 25 }
			
			custom_tooltip = " "
			
			add_power_projection_mission = { amount = 20 }
		}
	}
	
	TIM_great_power = {
		icon = mission_islamic_golden_age
		required_missions = { TIM_ottomans TIM_caucasia TIM_mamluks }
		position = 6
		provinces_to_highlight = {
		}
		trigger = {
			not_in_mission_preview_mode = { key = TIM }
			total_development = 2000
			army_size = 100 # modified
			if = {
				limit = {
					OR = {
						has_dlc = "Rights of Man"
						has_dlc = "Emperor"
					}
				}
				NOT = { great_power_rank = 2 }
			}
		}
		effect = {
			hidden_effect = {
				remove_country_modifier = TIM_great_power_tur
				remove_country_modifier = TIM_great_power_mam
				add_country_modifier = {
					name = TIM_great_power
					duration = -1
				}
			}
			custom_tooltip = TIM_great_power_upgrade
			
			custom_tooltip = " "
			
			add_permanent_power_projection = {
				amount = 5
				type = TIM_hegemony_over_the_crescent
			}
		}
	}
}

WoC_timurids_2_2 = {
	slot = 2
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = {
		tag = TIM
		NOT = { map_setup = map_setup_random }
		has_dlc = "Winds of Change"
	}
	has_country_shield = yes
	
	TIM_land_tenure = {
		icon = mission_general_land_assessment
		required_missions = { TIM_rightful_protector }
		position = 7
		provinces_to_highlight = {
		}
		trigger = {
			NOT = { has_estate_privilege = estate_nobles_TIM_soyurghal_grants }
			
			custom_trigger_tooltip = {
				tooltip = TIM_at_least_25_tax_income
				variable_arithmetic_trigger = {
					export_to_variable = {
						which = current_tax_income
						value = monthly_income
					}
					export_to_variable = {
						which = tax_income_share
						value = trigger_value:tax_income_percentage
					}
					multiply_variable = { which = current_tax_income which = tax_income_share }
					check_variable = { which = current_tax_income value = 25 }
				}
			}
		}
		effect = {
			add_country_modifier = {
				name = TIM_recovery_of_treasury_funds
				duration = 9125
			}
			
			custom_tooltip = TIM_distribute_10_base_tax
			hidden_effect = {
				for = {
					amount = 10
					effect = "
						random_owned_province = {
							add_base_tax = 1
						}
					"
				}
			}
			
			custom_tooltip = " "
			
			define_advisor = {
				type = treasurer
				name = "Majd al-Din"
				skill = 3
				culture = ROOT
				religion = ROOT
				cost_multiplier = 0.33
			}
		}
	}
}

WoC_timurids_2_2_persia = {
	slot = 2
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = {
		tag = TIM
		NOT = { map_setup = map_setup_random }
		has_dlc = "Winds of Change"
		TIM_persia_tree_trigger = yes
	}
	has_country_shield = yes
	
	TIM_soyurghals = {
		icon = mission_conquer_rajputana
		required_missions = { TIM_land_tenure }
		position = 8
		provinces_to_highlight = {
		}
		trigger = {
			not_in_mission_preview_mode = { key = TIM }
			has_dip_advisor_3 = yes
			monthly_adm = 9
			monthly_mil = 9
			if = {
				limit = {
					tax_income_percentage = 0.01
				}
				custom_trigger_tooltip = {
					tooltip = TIM_at_least_75_tax_income
					variable_arithmetic_trigger = {
						export_to_variable = {
							which = current_tax_income
							value = monthly_income
						}
						export_to_variable = {
							which = tax_income_share
							value = trigger_value:tax_income_percentage
						}
						multiply_variable = { which = current_tax_income which = tax_income_share }
						check_variable = { which = current_tax_income value = 75 }
					}
				}
			}
			OR = {
				num_of_subjects = 3
				num_of_states = 40
			}
		}
		effect = {	
			custom_tooltip = TIM_soyurghals_unlocked
			set_country_flag = TIM_soyurghals_flag
			
			custom_tooltip = " "
			
			add_years_of_income = 1
		}
	}
	
	TIM_rugs = {
		icon = mission_finest_carpets
		required_missions = { TIM_persian_capital }
		position = 9
		provinces_to_highlight = {
			trade_goods = silk
			OR = {
				owned_by = ROOT 
				is_claim = ROOT 
				is_core = ROOT
				is_permanent_claim = ROOT
			}
		}
		trigger = {
			not_in_mission_preview_mode = { key = TIM }
			num_of_owned_provinces_with = {
				trade_goods = silk
				has_production_building_trigger = yes
				value = 10
			}
			development_in_provinces = {
				trade_goods = silk
				value = 200
			}
		}
		effect = {
			if = {
				limit = {
					has_dlc = "King of Kings"
				}
				custom_tooltip = TIM_do_persian_mission_easier
				custom_tooltip = " "
			}
			
			add_years_of_owned_provinces_production_income = {
				years = 20
				trigger = {
					trade_goods = silk
				}
				custom_tooltip = TIM_twenty_years_of_silk_income
			}
			
			custom_tooltip = " "
			
			custom_tooltip = TIM_distribute_10_random_dev
			hidden_effect = {
				for = {
					amount = 10
					effect = "
						random_owned_province = {
							add_random_development = 1
						}
					"
				}
			}
		}
	}
}

WoC_timurids_2_3 = {
	slot = 2
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = {
		tag = TIM
		NOT = { map_setup = map_setup_random }
		has_dlc = "Winds of Change"
	}
	has_country_shield = yes
	
	TIM_chagatai_elites = {
		icon = mission_into_the_west
		required_missions = { TIM_military }
		position = 10
		provinces_to_highlight = {
		}
		trigger = {
			army_tradition = 40
			num_of_battles = { amount = 50 }
			OR = {
				mil = 5
				monthly_mil = 9
			}
		}
		effect = {
			custom_tooltip = TIM_unlock_appease_the_elites_privilege
			set_country_flag = TIM_unlock_appease_the_elites_privilege_flag
			
			custom_tooltip = " "
			
			tooltip = {
				define_advisor = {
					type = commandant
					skill = 3
					culture = ROOT
					religion = ROOT
					cost_multiplier = 0.75
				}
			}
			
			complex_dynamic_effect = {
				first_custom_tooltip = TIM_60_army_trad
				first_limit = "
					army_tradition = 60
				"
				first_effect = "
					custom_tooltip = TIM_double_cheap
				"
			}
			hidden_effect = {
				if = {
					limit = {
						army_tradition = 60
					}
					define_advisor = {
						type = commandant
						skill = 3
						culture = ROOT
						religion = ROOT
						cost_multiplier = 0.5
					}
				}
				else = {
					define_advisor = {
						type = commandant
						skill = 3
						culture = ROOT
						religion = ROOT
						cost_multiplier = 0.75
					}
				}
			}
			
			custom_tooltip = " "
			
			add_mil_power = 50
		}
	}
}

WoC_timurids_2_3_persia = {
	slot = 2
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = {
		tag = TIM
		NOT = { map_setup = map_setup_random }
		has_dlc = "Winds of Change"
		TIM_persia_tree_trigger = yes
	}
	has_country_shield = yes
	
	TIM_ulugh_beg_observatory = {
		icon = qara_qoyunlu_maragheh_observatory
		required_missions = { TIM_persian_acculturation }
		position = 11
		provinces_to_highlight = {
			province_id = 454
		}
		trigger = {
			not_in_mission_preview_mode = { key = TIM }
			454 = {
				owned_by = ROOT
				province_is_or_accepts_culture = yes
				development = 35
			}
			
			if = {
				limit = {
					has_dlc = "Rule Britannia"
				}
				OR = {
					innovativeness = 20 
					AND = {
						has_adm_advisor_3 = yes
						has_dip_advisor_3 = yes
						has_mil_advisor_3 = yes
					}
				}
			}
			else = {
				has_adm_advisor_3 = yes
				has_dip_advisor_3 = yes
				has_mil_advisor_3 = yes
			}
		}
		effect = {
			454 = {
				add_or_upgrade_university_building = yes
				
				custom_tooltip = " "
				
				add_province_triggered_modifier = TIM_ulugh_beg_observatory_modifier
			}
		
			remove_comet_sighted_events = yes
			
			custom_tooltip = " "
			
			define_advisor = {
				type = natural_scientist
				skill = 3
				culture = ROOT
				religion = ROOT
				cost_multiplier = 0.33
			}
		}
	}
}

WoC_timurids_3 = {
	slot = 3
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = {
		tag = TIM
		NOT = { map_setup = map_setup_random }
		has_dlc = "Winds of Change"
	}
	has_country_shield = yes
	
	TIM_governors_at_bay = {
		icon = mission_conquer_malwa_mer
		required_missions = { }
		position = 1
		provinces_to_highlight = {
			owner = {
				is_subject_of = ROOT
				liberty_desire = 40
			}
		}
		trigger = {
			custom_trigger_tooltip = {
				tooltip = TIM_shah_rukh_died
				has_global_flag = death_of_shah_rukh
			}
			
			NOT = {
				any_subject_country = {
					liberty_desire = 40
				}
			}
			army_size = 10 # modified
		}
		effect = {
			country_event_with_option_insight = {
				id = flavor_tim.6
				option_1 = "
					custom_tooltip = TIM_upgrade_iqta_tax
					set_country_flag = TIM_upgrade_iqta_tax_flag
					
					custom_tooltip = \" \"
					
					add_adm_power = 50
				"
				option_2 = "
					custom_tooltip = TIM_upgrade_iqta_manpower
					set_country_flag = TIM_upgrade_iqta_manpower_flag
					
					custom_tooltip = \" \"
					
					add_mil_power = 50
				"
				option_3 = "
					custom_tooltip = TIM_upgrade_iqta_ld
					set_country_flag = TIM_upgrade_iqta_ld_flag
					
					custom_tooltip = \" \"
					
					add_dip_power = 50
				"
			}
		}
	}
	
	TIM_timurid_empire = {
		icon = mission_subdue_the_afghans
		required_missions = { TIM_governors_at_bay TIM_fresh_blood }
		position = 2
		provinces_to_highlight = {
		}
		trigger = {
			total_development = 600
			prestige = 60
			army_size = 35 # modified
		}
		effect = {
			override_country_name = TIM_GURKANI
			set_country_flag = has_overriden_name_flag
			set_country_flag = is_TIM_GURKANI_flag
			
			custom_tooltip = " "
			
			add_country_modifier_for_age = {
				name = TIM_timurid_empire_modifier
				age = age_of_discovery
				else = "	
					add_adm_power = 100
					add_dip_power = 100
					add_mil_power = 100
				"
			}
			
			enable_branching_mission_review = {
				key = TIM
				ai_event_id = flavor_tim.13
			}
		}
	}
	
	TIM_mazandaran = {
		icon = mission_conquer_algiers
		required_missions = { TIM_traitor }
		position = 3
		provinces_to_highlight = {
			area = tabarestan_area
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			tabarestan_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT
			}
		}
		effect = {
			give_claims = { area = dagestan_area }
			give_claims = { area = circassia_area }
			give_claims = { area = imereti_area }
			give_claims = { area = samtskhe_area }
			give_claims = { area = kartli_kakheti_area }
			give_claims = { area = shirvan_area }
			give_claims = { area = tabriz_area }
			give_claims = { area = armenia_area }
			give_claims = { area = north_kurdistan_area }
			
			custom_tooltip = " "
			
			4341 = { set_center_level_2_center_of_trade = yes }
			
			custom_tooltip = " "
			
			4341 = {
				add_trade_node_income = 12
			}
		}
	}
	
	TIM_caucasia = {
		icon = mission_conquer_mewar
		required_missions = { TIM_mazandaran TIM_qoyunlu }
		position = 5
		provinces_to_highlight = {
			OR = {
				area = dagestan_area
				area = circassia_area
				area = imereti_area
				area = samtskhe_area
				area = kartli_kakheti_area
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				OR = {
					area = dagestan_area
					area = circassia_area
					area = imereti_area
					area = samtskhe_area
					area = kartli_kakheti_area
				}
				value = 14
			}
		}
		effect = {
			extra_claims_for_nomadic_path = {
				effect = "
					give_claims = { region = crimea_region }
				"
			}
			
			add_country_modifier = {
				name = TIM_caucasia_modifier
				duration = -1
			}
			
			create_general_with_pips = {
				tradition = 60
				add_shock = 1
				add_fire = 1
			}
		}
	}
	
	TIM_herat = {
		icon = mission_herat
		required_missions = { }
		position = 6
		provinces_to_highlight = {
			province_id = 446
			OR = {
				NOT = { owned_by = ROOT }
				NOT = { development = 25 }
				NOT = { num_of_buildings_in_province = 2 }
			}
		}
		trigger = {
			446 = {
				owned_by = ROOT 
				development = 25
				num_of_buildings_in_province = 2
			}
		}
		effect = {
			446 = {
				if = {
                    limit = {
                        has_dlc = "Mandate of Heaven"
                    }
                    add_province_modifier = { 
                        name = TIM_pearl_of_khorasan
                        duration = -1
                    }
                }
                else = {
                    add_province_modifier = { 
                        name = TIM_pearl_of_khorasan_no_dlc
                        duration = -1
                    }
                }
				
				add_institution_embracement = {
					which = renaissance
					value = 50
				}
			}
			
			custom_tooltip = " "
			
			add_country_modifier = {
				name = TIM_start_of_a_renaissance
				duration = 10950
			}
		}
	}
	
	TIM_persian_capital = {
		icon = mission_into_persia_2
		required_missions = { TIM_herat }
		position = 8
		provinces_to_highlight = {
			province_id = 446
			OR = {
				NOT = { owned_by = ROOT }
				NOT = { development = 35 }
				NOT = { num_of_buildings_in_province = 5 }
				NOT = { has_tax_building_trigger = yes }
				NOT = { has_production_building_trigger = yes }
				NOT = { has_manpower_building_trigger = yes }
			}
		}
		trigger = {
			446 = {
				owned_by = ROOT 
				development = 35
				num_of_buildings_in_province = 5
				has_tax_building_trigger = yes
				has_production_building_trigger = yes
				has_manpower_building_trigger = yes
			}
		}
		effect = {
			446 = {
				add_or_upgrade_tax_building = yes
				custom_tooltip = " "
				add_or_upgrade_production_building = yes
				custom_tooltip = " "
				add_or_upgrade_manpower_building = yes	
			}
			
			custom_tooltip = " "
			
			custom_tooltip = TIM_for_every_adm
			tooltip = {
				change_government_reform_progress = 10
			}
			custom_tooltip = " "
			custom_tooltip = TIM_for_every_dip
			tooltip = {
				add_prestige_or_monarch_power = { amount = 5 }
			}
			custom_tooltip = " "
			custom_tooltip = TIM_for_every_mil
			tooltip = {
				add_army_tradition_or_mil_power = { amount = 5 }
			}
			hidden_effect = {
				for_every_level_of_advisor_do = {
					type = mil
					effect = "
						add_army_tradition_or_mil_power = { amount = 5 }
					"
				}
				for_every_level_of_advisor_do = {
					type = dip
					effect = "
						add_prestige_or_monarch_power = { amount = 10 }
					"
				}
				for_every_level_of_advisor_do = {
					type = adm
					effect = "
						change_government_reform_progress = 10
					"
				}
			}
		}
	}
}

WoC_timurids_3_nomad = {
	slot = 3
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = {
		tag = TIM
		NOT = { map_setup = map_setup_random }
		has_dlc = "Winds of Change"
		TIM_nomad_tree_trigger = yes
	}
	has_country_shield = yes
	
	TIM_seat_of_operations = {
		icon = mission_into_persia_1
		required_missions = { TIM_persian_capital }
		position = 10
		provinces_to_highlight = {
			is_capital_of = ROOT
			NOT = {
				OR = {
					num_of_times_used_pillage_capital = 3
					num_of_times_used_transfer_development = 10
					capital_scope = { development = 50 }
				}
			}
		}
		trigger = {
			not_in_mission_preview_mode = { key = TIM }
			if = {
				limit = {
					has_dlc = "Leviathan"
				}
				OR = {
					num_of_times_used_pillage_capital = 3
					num_of_times_used_transfer_development = 10
					capital_scope = { development = 50 }
				}
			}
			else = {
				capital_scope = {
					development = 45
				}
			}
			treasury = 2500 
		}
		effect = {
			add_country_modifier = {
				name = TIM_loot_and_plunder
				duration = -1
			}
			
			add_corruption = -2
		}
	}
}

WoC_timurids_3_persia = {
	slot = 3
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = {
		tag = TIM
		NOT = { map_setup = map_setup_random }
		has_dlc = "Winds of Change"
		TIM_persia_tree_trigger = yes
	}
	has_country_shield = yes
	
	TIM_persian_acculturation = {
		icon = mission_persian_lion
		required_missions = { TIM_persian_capital }
		position = 10
		provinces_to_highlight = {
			culture_group = iranian
		}
		trigger = {
			not_in_mission_preview_mode = { key = TIM }
			development_in_provinces = {
				culture_group = iranian
				value = 500
			}
			OR = {
				culture_group = iranian
				calc_true_if = {
					accepted_culture = persian
					accepted_culture = luri
					accepted_culture = azerbaijani
					accepted_culture = khorasani
					accepted_culture = baluchi
					accepted_culture = afghani
					accepted_culture = kurdish
					accepted_culture = mazandarani
					accepted_culture = turco_iranian
					amount = 3
				}
			}
		}
		effect = {
			country_event_with_option_insight = {
				id = flavor_tim.15
				option_1 = "
					change_primary_culture = persian
					
					custom_tooltip = TIM_will_be_necessary_to_form_persia
					
					custom_tooltip = \" \"
					 
					add_accepted_culture_or_dip_power_stated = {
						culture = uzbehk
						dip_reward = yes
					}
				"
				option_2 = "
					add_country_modifier = {
						name = TIM_dev_cost_until_persia_formation
						duration = -1
						desc = TIM_until_persia
					}
				"
			}
		}
	}
	
	TIM_heirs_of_ancients = {
		icon = mission_persianate_empire
		required_missions = { TIM_persian_acculturation }
		position = 11
		provinces_to_highlight = {
		}
		trigger = {
			not_in_mission_preview_mode = { key = TIM }
			num_of_provinces_developed = { amount = 250 }
		}
		effect = {
			if = {
				limit = {
					has_dlc = "Rights of Man"
				}
				custom_tooltip = TIM_legendary_architect
				set_country_flag = TIM_legendary_architect_flag
				custom_tooltip = " "
			}
			else = {
				add_country_modifier = {
					name = TIM_great_architects
					duration = -1
				}
			}
			
			add_corruption = -2
			
			custom_tooltip = " "
			
			add_years_of_income = 0.5
		}
	}
}

WoC_timurids_4 = {
	slot = 4
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = {
		tag = TIM
		NOT = { map_setup = map_setup_random }
		has_dlc = "Winds of Change"
	}
	has_country_shield = yes
	
	TIM_baluchistan = {
		icon = mission_abu_saids_dream
		required_missions = { TIM_east }
		position = 2
		provinces_to_highlight = {
			OR = {
				area = kalat_area
				area = makran_area
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				OR = {
					area = kalat_area
					area = makran_area
				}
				value = 6
			}
		}
		effect = {
			kalat_area = {
				limit = {
					country_or_non_sovereign_subject_holds = ROOT
				}
				add_local_autonomy = -25
				add_nationalism = -15
			}
			makran_area = {
				limit = {
					country_or_non_sovereign_subject_holds = ROOT
				}
				add_local_autonomy = -25
				add_nationalism = -15
			}
			
			custom_tooltip = " "
			
			give_claims = { area = sindh_area }
			give_claims = { area = northern_sindh_area }
			give_claims = { area = multan_area }
			
			custom_tooltip = " "
			
			add_yearly_manpower = 0.5
		}
	}
}

WoC_timurids_4_nomad = {
	slot = 4
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = {
		tag = TIM
		NOT = { map_setup = map_setup_random }
		has_dlc = "Winds of Change"
		TIM_nomad_tree_trigger = yes
	}
	has_country_shield = yes
	
	TIM_river = {	
		icon = mission_conquer_sindh_mer
		required_missions = { TIM_delhi TIM_baluchistan }
		position = 3
		provinces_to_highlight = {
			OR = {
				area = multan_area
				area = sindh_area
				area = northern_sindh_area
				area = marwar_area
				area = jangladesh_area
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			not_in_mission_preview_mode = { key = TIM }
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				OR = {
					area = multan_area
					area = sindh_area
					area = northern_sindh_area
					area = marwar_area
					area = jangladesh_area
				}
				value = 14
			}
		}
		effect = {
			create_general_with_pips = {
				tradition = 30
				add_fire = 2
				add_shock = 2
				add_siege = 1
			}
			
			custom_tooltip = " "
			
			add_country_modifier = {
				name = TIM_advancing_the_barriers
				duration = 10950
			}
			
			add_prestige_or_monarch_power = { amount = 20 }
		}
	}
}

WoC_timurids_4_persia = {
	slot = 4
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = {
		tag = TIM
		NOT = { map_setup = map_setup_random }
		has_dlc = "Winds of Change"
		TIM_persia_tree_trigger = yes
	}
	has_country_shield = yes
	
	TIM_frontiers = {
		icon = mission_conquer_mewar
		required_missions = { TIM_baluchistan TIM_delhi }
		position = 3
		provinces_to_highlight = {
			OR = {
				region = hindusthan_region
				area = makran_area
				area = kalat_area 
				area = sindh_area
				area = northern_sindh_area
			}
			OR = {
				NOT = { has_fort_building_trigger = yes }
				NOT = { base_manpower = 7 }
			}
		}
		trigger = {
			not_in_mission_preview_mode = { key = TIM }
			num_of_owned_provinces_with = {
				OR = {
					region = hindusthan_region
					area = makran_area
					area = kalat_area 
					area = sindh_area
					area = northern_sindh_area
				}
				has_fort_building_trigger = yes 
				base_manpower = 7
				value = 6
			}
		}
		effect = {
			custom_tooltip = TIM_upgrade_expand_the_fortifications
			set_country_flag = TIM_upgrade_expand_the_fortifications_flag
			
			custom_tooltip = " "
			
			custom_tooltip = TIM_nobility_loyalty_with_forts
			set_country_flag = TIM_nobility_loyalty_with_forts_flag
			
			custom_tooltip = " "
			
			504 = {
				add_trade_modifier = {
					who = ROOT
					duration = -1
					power = 30
					key = TIM_eastern_frontier_protection
				}
			}
			524 = {
				add_trade_modifier = {
					who = ROOT
					duration = -1
					power = 30
					key = TIM_eastern_frontier_protection
				}
			}
		}
	}
}

WoC_timurids_4_2 = {
	slot = 4
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = {
		tag = TIM
		NOT = { map_setup = map_setup_random }
		has_dlc = "Winds of Change"
	}
	has_country_shield = yes
	
	TIM_recover_north = {
		icon = mission_steppe_warriors
		required_missions = { TIM_northern_flank }
		position = 5
		provinces_to_highlight = {
			OR = { 
				area = syr_darya_area
				area = kyzylkum_area
				area = khiva_area
				area = transcaspia_area
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				OR = { 
					area = syr_darya_area
					area = kyzylkum_area
					area = khiva_area
					area = transcaspia_area
				}
				value = 12
			}
		}
		effect = {
			extra_claims_for_nomadic_path = {
				effect = "
					give_claims = { area = tambov_area }
					give_claims = { area = lower_yik_area }
					give_claims = { area = nogai_area }
					give_claims = { area = saratov_area }
					give_claims = { area = samara_area }
					give_claims = { area = bashkiria_area }
					give_claims = { area = volga_area }
					give_claims = { area = kazan_area }
					give_claims = { area = kama_area }
				"
			}
			
			add_country_modifier = {
				name = TIM_repulsing_nomadic_advancement
				duration = 10950
			}
			
			create_general_with_pips = {
				add_shock = 3
				tradition = 25
			}
			
			custom_tooltip = " "
			
			custom_tooltip = TIM_every_province_in_required_areas_loses_devastation
			hidden_effect = {
				every_owned_province = {
					limit = {
						OR = { 
							area = syr_darya_area
							area = kyzylkum_area
							area = khiva_area
							area = transcaspia_area
						}
					}
					add_devastation = -25
				}
			}
		}
	}
}

WoC_timurids_4_2_nomad = {
	slot = 4
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = {
		tag = TIM
		NOT = { map_setup = map_setup_random }
		has_dlc = "Winds of Change"
		TIM_nomad_tree_trigger = yes
	}
	has_country_shield = yes
	
	TIM_tokhtamysh = {
		icon = mission_destroy_the_horde
		required_missions = { TIM_recover_north TIM_caucasia }
		position = 6
		provinces_to_highlight = {
			OR = {
				region = crimea_region
				area = tambov_area
				area = lower_yik_area
				area = nogai_area
				area = saratov_area
				area = samara_area
				area = bashkiria_area
				area = volga_area
				area = kazan_area
				area = kama_area
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			not_in_mission_preview_mode = { key = TIM }
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				OR = {
					region = crimea_region
					area = tambov_area
					area = lower_yik_area
					area = nogai_area
					area = saratov_area
					area = samara_area
					area = bashkiria_area
					area = volga_area
					area = kazan_area
					area = kama_area
				}
				value = 40
			}
		}
		effect = {
			if = {
				limit = {
					has_dlc = "Rights of Man"
				}
				custom_tooltip = TIM_legendary_conqueror
				set_country_flag = TIM_legendary_conqueror_flag
				custom_tooltip = " "
			}
			else = {
				add_country_modifier = {
					name = TIM_legendary_conqueror_modifier
					duration = -1
				}
			}
			
			add_country_modifier_for_age = {
				name = TIM_golden_horde
				age = age_of_reformation
				else = "
					add_stability_or_adm_power = yes
					
					custom_tooltip = \" \"
					
					add_adm_power = 100
					add_dip_power = 100
					add_mil_power = 100
				"
			}
		}
	}
}

WoC_timurids_4_3 = {
	slot = 4
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = {
		tag = TIM
		NOT = { map_setup = map_setup_random }
		has_dlc = "Winds of Change"
	}
	has_country_shield = yes
	
	TIM_madrasa = {
		icon = mission_gawans_madrasar
		required_missions = { TIM_herat }
		position = 7
		provinces_to_highlight = {
			province_id = 446
		}
		trigger = {
			#TIM and more
			OR = {
				is_ahead_of_time_in_technology = { tech = adm }
				is_ahead_of_time_in_technology = { tech = dip }
				is_ahead_of_time_in_technology = { tech = mil }
			}
			446 = {
				has_tax_building_trigger = yes
				owned_by = ROOT
			}
			OR = {
				artist = 2
				has_adm_advisor_3 = yes
				has_estate_privilege = estate_burghers_patronage_of_the_arts
			}
		}
		effect = {
			446 = {
				add_or_upgrade_tax_building = yes
				add_or_upgrade_university_building = yes
			}
			
			custom_tooltip = " "
			
			if = {
				limit = {
					has_estate = estate_church
					has_dlc = "Rule Britannia"
				}
				custom_tooltip = TIM_unlock_privilege_for_innovativeness_gain
				set_country_flag = TIM_unlock_privilege_for_innovativeness_gain_flag
				
				custom_tooltip = " "
			}
			else = {
				add_country_modifier = {
					name = TIM_ijazah
					duration = 9125
				}
			}
			
			add_stability_or_adm_power = yes
		}
	}
	
	TIM_golden_age = {
		icon = mission_court_education
		required_missions = { TIM_madrasa TIM_persian_capital }
		position = 9
		provinces_to_highlight = {
		}
		trigger = {
			has_adm_advisor_3 = yes
			has_dip_advisor_3 = yes
			has_mil_advisor_3 = yes
			num_of_provinces_developed = { amount = 100 }
			OR = {
				custom_trigger_tooltip = {
					tooltip = TIM_has_1_yearly_prestige
					has_global_modifier_value = {
						which = prestige
						value = 1
					}
				}
				prestige = 90
			}
		}
		effect = {
			if = {
				limit = {
					has_dlc = "Rights of Man"
				}
				custom_tooltip = TIM_patron_of_art_personality_unlock
				set_country_flag = TIM_patron_of_art_personality_unlock_flag
				
				custom_tooltip = " "
			}
			
			if = {
				limit = {
					has_estate = estate_burghers
				}
				custom_tooltip = TIM_upgrade_patronage_of_arts_privilege
				set_country_flag = TIM_upgrade_patronage_of_arts_privilege_flag
				
				custom_tooltip = " "
			}
			else = {
				add_country_modifier = {
					name = TIM_patronage_of_arts_modifier
					duration = -1
				}
			}
			
			add_prestige_or_monarch_power = { amount = 40 }
		}
	}
	
	TIM_trade_with_india = {
		icon = mission_dharma_mission_the_riches_of_india
		required_missions = { }
		position = 10
		provinces_to_highlight = {
			OR = {
				AND = {
					province_id = 504
					NOT = {
						trade_share = {
							country = ROOT
							share = 15
						}
					}
				}
				AND = {
					province_id = 1340
					NOT = {
						trade_share = {
							country = ROOT
							share = 5
						}
					}
				}
			}
		}
		trigger = {
			504 = {
				trade_share = {
					country = ROOT
					share = 15
				}
			}
			1340 = {
				trade_share = {
					country = ROOT
					share = 5
				}
			}
		}
		effect = {
			add_years_of_trade_income = { years = 2 custom_tooltip = ME_add_2_years_of_trade_income }
			
			custom_tooltip = " "
			
			add_country_modifier = {
				name = TIM_indian_relations
				duration = 10950
			}
		}
	}
}

WoC_timurids_4_3_persia = {
	slot = 4
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = {
		tag = TIM
		NOT = { map_setup = map_setup_random }
		has_dlc = "Winds of Change"
		TIM_persia_tree_trigger = yes
	}
	has_country_shield = yes
	
	TIM_silk_road = {
		icon = mission_silk_road
		required_missions = { TIM_trade_with_india TIM_persian_riches }
		position = 12
		provinces_to_highlight = {
			province_id = 667
			NOT = {
				OR = {
					trade_share = {
						country = ROOT
						share = 25
					}
					owned_by = ROOT 
					owner = {
						has_opinion = {
							who = ROOT
							value = 100
						}
					}
				}
			}
		}
		trigger = {
			not_in_mission_preview_mode = { key = TIM }
			667 = {
				OR = {
					trade_share = {
						country = ROOT
						share = 25
					}
					owned_by = ROOT 
					owner = {
						has_opinion = {
							who = ROOT
							value = 100
						}
					}
				}
			}
			monthly_income = 400
			home_trade_node = {
				trade_node_value = 150
				highest_value_trade_node = yes
			}
		}
		effect = {
			country_event_with_option_insight = {
				id = flavor_tim.16
				option_1 = "
					add_country_modifier = {
						name = TIM_internal_benefits
						duration = -1
					}
					
					add_adm_power = 100
					
					custom_tooltip = \" \"
					
					custom_tooltip = TIM_distribute_15_dev_amongst_trade_centers
				"
				option_2 = "
					add_country_modifier = {
						name = TIM_external_benefits
						duration = -1
					}
					
					add_dip_power = 100
					
					custom_tooltip = \" \"
					
					custom_tooltip = TIM_gain_1_yearly_manpower_per_soyurghal_we_have
				"
			}
		}
	}
}

WoC_timurids_5 = {
	slot = 5
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = {
		tag = TIM
		NOT = { map_setup = map_setup_random }
		has_dlc = "Winds of Change"
	}
	has_country_shield = yes
	
	TIM_east = {
		icon = mission_afghan_frontier
		required_missions = { }
		position = 1
		provinces_to_highlight = {
			OR = {
				owned_by = SIS
				owned_by = AFG 
				province_id = 451
				province_id = 435
			}

			NOT = { owned_by = ROOT }
		}
		trigger = {
			NOT = { exists = SIS }
			NOT = { exists = AFG }
			owns = 451
			owns = 435
		}
		effect = {
			give_claims = { area = makran_area }
			give_claims = { area = kalat_area }
			give_claims = { area = kashmir_area }
			give_claims = { area = sind_sagar_area }
			give_claims = { area = lahore_area }
			give_claims = { area = sirhind_area }
			give_claims = { area = upper_doab_area }
			
			custom_tooltip = " "
			
			if = {
				limit = { is_year = 1750 }
				define_general = {
					name = "Ahmad Khan Abdali"
					shock = 1
					fire = 5
					manuever = 5
					siege = 2
					trait = master_of_arms_personality
				}
			}
			else_if = {
				limit = { is_year = 1700 }
				define_general = {
					name = "Nadir Quli Beg"
					fire = 3
					shock = 5
					manuever = 5
					siege = 1
					trait = master_of_arms_personality
				}
			}
			else_if = {
				limit = { is_year = 1650 }
				define_general = {
					name = "Aurangzeb Timurid"
					shock = 5
					fire = 5
					manuever = 2
					siege = 0
					trait = master_of_arms_personality
				}
			}
			else_if = {
				limit = { is_year = 1600 }
				define_general = {
					name = "Akbar Timurid"
					shock = 4
					fire = 4
					manuever = 2
					siege = 2
					trait = master_of_arms_personality
				}
			}
			else_if = {
				limit = { is_year = 1550 }
				define_general = {
					name = "Humayun Timurid"
					shock = 4
					fire = 4
					manuever = 2
					siege = 2
					trait = master_of_arms_personality
				}
			}
			else_if = {
				limit = { is_year = 1500 }
				define_general = {
					name = "Babur Timurid"
					shock = 5
					fire = 5
					manuever = 3
					siege = 1
					trait = master_of_arms_personality
				}
			}
			else_if = {
				limit = { is_year = 1450 }
				define_general = {
					name = "Abu Said Timurid"
					shock = 5
					fire = 4
					manuever = 3
					siege = 1
					trait = master_of_arms_personality
				}
			}
			else = {
				define_general = {
					name = "Abu Said Timurid"
					shock = 5
					fire = 4
					manuever = 3
					siege = 1
					trait = master_of_arms_personality
				}
			}
		}
	}
	
	TIM_delhi = {
		icon = mission_crush_delhi
		required_missions = { TIM_east }
		position = 2
		provinces_to_highlight = {
			OR = {
				area = kashmir_area
				area = sind_sagar_area
				area = lahore_area
				area = sirhind_area
				area = upper_doab_area
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				OR = {
					area = kashmir_area
					area = sind_sagar_area
					area = lahore_area
					area = sirhind_area
					area = upper_doab_area
				}
				value = 14
			}
		}
		effect = {
			extra_claims_for_nomadic_path = {
				effect = "
					give_claims = { area = marwar_area }
					give_claims = { area = jangladesh_area }
					give_claims = { area = multan_area }
					give_claims = { region = hindusthan_region }
				"
			}
		
			if = {
				limit = {
					tag = TIM
				}
				country_event_with_option_insight = {
					id = flavor_tim.8
					option_1 = "
						custom_tooltip = TIM_lock_mughal_formable
						set_country_flag = TIM_lock_mughal_formable
						
						custom_tooltip = \" \"
						
						add_country_modifier = {
							name = TIM_india_conquest
							duration = -1
							desc = TIM_for_as_long_as_we_are_tim
						}
						
						add_power_projection_mission = { amount = 25 }
					"
					option_2 = "
						add_power_projection_mission = { amount = 25 }
					"
				}
			}
			else = {
				add_power_projection_mission = { amount = 25 }
			}
		}
	}
}

WoC_timurids_5_nomad = {
	slot = 5
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = {
		tag = TIM
		NOT = { map_setup = map_setup_random }
		has_dlc = "Winds of Change"
		TIM_nomad_tree_trigger = yes
	}
	has_country_shield = yes
	
	TIM_hindusthan = {
		icon = mission_emperor_of_hindusthan
		required_missions = { TIM_delhi }
		position = 3
		provinces_to_highlight = {
			region = hindusthan_region
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			not_in_mission_preview_mode = { key = TIM }
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				region = hindusthan_region
				value = 25
			}
		}
		effect = {
			add_country_modifier = {
				name = TIM_destruction_of_india
				duration = -1
			}
			
			custom_tooltip = TIM_unlock_razing_gov_reform
			hidden_effect = {
				unlock_government_reform = {
					government_reform = TIM_plunder_economy
				}
			}
			change_government_reform_progress = 50
		}
	}
}

WoC_timurids_5_2 = {
	slot = 5
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = {
		tag = TIM
		NOT = { map_setup = map_setup_random }
		has_dlc = "Winds of Change"
	}
	has_country_shield = yes
	
	TIM_northern_flank = {
		icon = mission_central_asian_city
		required_missions = { }
		position = 4
		provinces_to_highlight = {
			OR = {
				owned_by = TRS 
				province_id = 454
				AND = {
					OR = {
						province_id = 4344
						province_id = 442
					}
					NOT = {
						ROOT = {
							OR = {
								owns = 4344
								owns = 442
							}
						}
					}
				}
			}
			NOT = { owned_by = ROOT }
		}
		trigger = {
			owns = 454 
			OR = {
				owns = 4344
				owns = 442
			}
			NOT = { exists = TRS }
		}
		effect = {
			give_claims = { area = shanshan_area }
			give_claims = { area = jetysuu_area }
			give_claims = { area = kashgaria_area }
			give_claims = { area = ferghana_area }
			give_claims = { area = arys_area }
			give_claims = { area = tarim_basin_area }
			give_claims = { area = zungaria_area }
			give_claims = { area = syr_darya_area }
			give_claims = { area = kyzylkum_area }
			give_claims = { area = khiva_area }
			give_claims = { area = transcaspia_area }
			
			custom_tooltip = " "
			
			add_mil_power = 75
			
			custom_tooltip = " "
			
			custom_tooltip = TIM_every_province_of_uzbek_culture
			tooltip = {
				add_province_modifier = { 
					name = TIM_uzbek_powerbase
					duration = 10950
				}
			}
			hidden_effect = {
				every_owned_province = {
					limit = {
						culture = uzbehk
					}
					add_province_modifier = { 
						name = TIM_uzbek_powerbase
						duration = 10950
					}
				}
			}
		}
	}
	
	TIM_moghulistan = {
		icon = mission_non-western_cavalry_raid
		required_missions = { TIM_northern_flank }
		position = 5 
		provinces_to_highlight = {
			OR = {
				area = shanshan_area
				area = jetysuu_area
				area = kashgaria_area
				area = ferghana_area
				area = arys_area
				area = tarim_basin_area
				area = zungaria_area
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				OR = {
					area = shanshan_area
					area = jetysuu_area
					area = kashgaria_area
					area = ferghana_area
					area = arys_area
					area = tarim_basin_area
					area = zungaria_area
				}
				value = 20
			}
		}
		effect = {
			extra_claims_for_nomadic_path = {
				effect = "
					give_claims = { region = mongolia_region }
				"
			}
			
			custom_tooltip = TIM_unlock_privilege_about_chagatai
			set_country_flag = TIM_unlock_privilege_about_chagatai_flag
			
			custom_tooltip = " "
			
			add_accepted_culture_or_dip_power_stated = { culture = kirgiz dip_reward = yes }
			
			custom_tooltip = " "
			
			if = {
				limit = {
					has_dlc = "Cradle of Civilization"
				}
				add_army_professionalism = 0.05
			}
			else = {
				add_army_tradition_or_mil_power = { amount = 10 }
			}
		}
	}
}

WoC_timurids_5_2_nomad = {
	slot = 5
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = {
		tag = TIM
		NOT = { map_setup = map_setup_random }
		has_dlc = "Winds of Change"
		TIM_nomad_tree_trigger = yes
	}
	has_country_shield = yes
	
	TIM_yuan = {
		icon = qng_end_yuan
		required_missions = { TIM_moghulistan TIM_recover_north }
		position = 6
		provinces_to_highlight = {
			OR = {
				owned_by = YUA
				region = mongolia_region
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			not_in_mission_preview_mode = { key = TIM }
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				region = mongolia_region
				value = 20
			}
			OR = {
				NOT = {
					exists = YUA
				}
				YUA = {
					is_subject_other_than_tributary_trigger = yes
					is_subject_of = ROOT
				}
			}
		}
		effect = {
			country_event_with_option_insight = {
				id = flavor_tim.14
				option_1 = "
				mongolia_region = { cede_province = YUA }
				north_china_region = { add_permanent_claim = YUA }
				south_china_region = { add_permanent_claim = YUA }
				custom_tooltip = \" \"
				create_subject = { subject = YUA subject_type = incorporated_vassal }
				custom_tooltip = TIM_what_is_integrated_vassal
				YUA = { set_country_flag = free_incorporated_vassal custom_tooltip = WoC_free_integrated_vassal_str }
				custom_tooltip = \" \"
				custom_tooltip = TIM_cb_to_get_china"
				option_2 = "
					give_claims = { region = north_china_region }
		
					custom_tooltip = \" \"
					
					add_power_projection_mission = { amount = 25 }
					
					custom_tooltip = \" \"
					
					add_country_modifier = {
						name = TIM_conquest_of_china
						duration = 5475
					}
				"
			}
		}
	}
}

WoC_timurids_5_3 = {
	slot = 5
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = {
		tag = TIM
		NOT = { map_setup = map_setup_random }
		has_dlc = "Winds of Change"
	}
	has_country_shield = yes
	
	TIM_sufi_support = {
		icon = mission_sufi_shrines
		required_missions = { }
		position = 7 
		provinces_to_highlight = {
		}
		trigger = {
			OR = {
				NOT = { piety = -0.75 }
				AND = {
					piety = 0.75
					religious_unity = 0.8
				}
			}
		}
		effect = {
			custom_tooltip = TIM_sufi_support_effect
			set_country_flag = TIM_piety_support
			
			custom_tooltip = " "
			
			if = {
				limit = { 
					has_dlc = "Golden Century"
				}
				custom_tooltip = TIM_give_access_to_sufi_orders
				set_country_flag = TIM_holy_orders
			}
			else = {
				add_country_modifier = {
					name = TIM_sufi_orders
					duration = -1
				}
			}
		}
	}
	
	TIM_ansari = {
		icon = mission_the_sultanate_restored
		required_missions = { TIM_sufi_support TIM_madrasa }
		position = 8 
		provinces_to_highlight = {
			province_id = 446
		}
		trigger = {
			446 = {
				has_tax_building_trigger = yes
				owned_by = ROOT
				development = 30
			}
			OR = {
				adm = 4
				monthly_adm = 9
			}
			if = {
				limit = {
					has_estate = estate_church
				}
				num_of_estate_agendas_completed = { estate = estate_church value = 2 }
			}
			OR = {
				has_adm_advisor_3 = yes
				inquisitor = 2
				theologian = 2
			}
		}
		effect = {
			if = {
				limit = {
					has_dlc = "Cradle of Civilization"
					religion_group = muslim
				}
				country_event_with_option_insight = {
					id = flavor_tim.9
					option_1 = "
						if = {
							limit = {
								NOT = {
									religious_school = {
										group = muslim
										school = hanbali_school
									}
								}
							}
							set_religious_school = {
								group = muslim
								school = hanbali_school
							}
						}
						else = { add_adm_power = 200 }
						
						custom_tooltip = \" \"
						
						add_piety = -0.5
					"
					option_2 = "
						if = {
							limit = {
								has_estate = estate_church
							}
							custom_tooltip = TIM_religious_diplomats_hanbali_tt
							custom_tooltip = \" \"
							add_estate_loyalty = { estate = estate_church loyalty = 15 }
						}
						else = {
							add_stability_or_adm_power = yes
						}
					"
				}
			}
			else_if = {
				limit = {
					religion_group = muslim
				}
				add_stability_or_adm_power = yes
				
				custom_tooltip = " "
				
				446 = {
					add_province_triggered_modifier = TIM_tomb_of_ansari
				}
			}
			else = {
				add_stability_or_adm_power = yes
				
				if = {
					limit = {
						has_estate = estate_church
					}
					custom_tooltip = " "
					add_estate_loyalty = { estate = estate_church loyalty = 15 }
				}
			}
		}
	}
	
	TIM_persian_gulf = {
		icon = mission_arabian_ports
		required_missions = { }
		position = 9
		provinces_to_highlight = {
		}
		trigger = {
			navy_size_percentage = 0.6
			has_dip_advisor = yes
		}
		effect = {
			give_claims = { area = pirate_coast_area }
			give_claims = { area = oman_area }
			give_claims = { area = mascat_area }
			give_claims = { id = 2999 }
			
			custom_tooltip = " "
			
			431 = {
				set_center_level_2_center_of_trade = yes
			}
		}
	}
	
	TIM_hormuz = {
		icon = mission_dominate_persian_gulf
		required_missions = { TIM_persian_gulf }
		position = 10
		provinces_to_highlight = {
			OR = {
				AND = {
					province_id = 1334
					NOT = { 
						trade_share = {
							country = ROOT
							share = 60
						}
					}
				}
				AND = {
					OR = {
						province_id = 431
						province_id = 2999
					}
					OR = {
						NOT = { owned_by = ROOT }
						NOT = { has_trade_building_trigger = yes }
					}
				}
			}
		}
		trigger = {
			1334 = {
				trade_share = {
					country = ROOT
					share = 60
				}
			}
			431 = {
				owned_by = ROOT
				has_trade_building_trigger = yes
			}
			2999 = {
				owned_by = ROOT
				has_trade_building_trigger = yes
			}
			
			
			if = {
				limit = {
					trade_income_percentage = 0.01
				}
				monthly_trade_income = 10
			}
		}
		effect = {
			431 = { add_or_upgrade_trade_building = yes }
			2999 = { add_or_upgrade_trade_building = yes }
			
			if = {
				limit = {
					has_estate = estate_burghers
				}
				custom_tooltip = " "
			
				custom_tooltip = TIM_unlock_institute_gulf_toll
			}
			else = {
				add_years_of_income = 1
			}
			set_country_flag = TIM_gulf_toll_privilege_flag
		}
	}
	
	TIM_persian_riches = {
		icon = mission_entrepot_of_india
		required_missions = { TIM_hormuz TIM_trade_with_india }
		position = 11
		provinces_to_highlight = {
			ROOT = {
				home_trade_node = {
					province_id = PREV_PREV
					NOT = { trade_node_value = 50 }
				}
			}
		}
		trigger = {
			monthly_income = 200
			if = {
				limit = {
					has_estate = estate_burghers
				}
				num_of_estate_agendas_completed = { estate = estate_burghers value = 5 }
			}
			home_trade_node = {
				trade_node_value = 50
			}
		}
		effect = {
			add_country_modifier_for_age = {
				name = TIM_persian_economic_hegemon
				age = age_of_reformation
				else = "
					add_adm_power = 100
					add_dip_power = 100
					add_mil_power = 100
					custom_tooltip = \" \"
				"
			}
			
			if = {
				limit = {
					has_estate = estate_burghers
				}
				custom_tooltip = TIM_above_gulf_toll_privilege
			}
			set_country_flag = TIM_gulf_toll_upgrade_flag
			
			custom_tooltip = " "
			
			change_government_reform_progress = 100
		}
	}
}