woc_tatars_1 = {
	slot = 1
	generic = no
	ai = yes
	has_country_shield = yes
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = {
		if = {
			limit = {
				OR = {
					is_tatar_nation = yes
					is_mongol_nation = yes
					is_moghulistan_nation = yes
					was_tatar_nation = yes
					was_mongol_nation = yes
					was_moghulistan_nation = yes
				}
			}
			OR = {
				is_tatar_nation = yes
				AND = {
					was_tatar_nation = yes
					OR = {
						is_mongol_nation = yes
						is_moghulistan_nation = yes
						tag = MGE
						tag = YUA
						tag = ILK
						tag = GLH
					}
				}
			}
			NOT = { was_mongol_nation = yes }
			NOT = { was_moghulistan_nation = yes }
		}
		else = {
			tag = GLH
		}
		has_dlc = "Winds of Change"
	}

	tatars_fall_of_ryazan = {
		icon = mission_cossack_cavalry
		position = 2
		required_missions = { tatars_russian_yoke } 
		provinces_to_highlight = {  
			OR = {
				province_id = 301
				province_id = 300
				province_id = 4255
				province_id = 2408
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		} 

		trigger = {  
			301 = {
				country_or_non_sovereign_subject_holds = ROOT
			}
			300 = {
				country_or_non_sovereign_subject_holds = ROOT
			}
			4255 = {
				country_or_non_sovereign_subject_holds = ROOT
			}
			2408 = {
				country_or_non_sovereign_subject_holds = ROOT
			}
		} 

		effect = {  
			add_country_modifier = {
				name = tatars_fall_of_ryazan_modifier
				duration = 5475
			}
			
			add_legitimacy_equivalent = { amount = 10 republican_tradition = 5 }
		} 
	}

	tatars_strengthen_raids = {
		icon = mission_non-western_cavalry_raid
		position = 3

		trigger = {  
			if = {
				limit = {
					has_government_attribute = raze_province
				}
				custom_trigger_tooltip = {
					tooltip = TATARS_RAIZED_20_PROVINCES
					check_variable = {
						which = HordeProvincesRazed
						value = 20
					}
				}
			}
			else = {
				army_size = 10 # modified
			}
		} 

		effect = {  
			add_country_modifier = {
				name = tatars_raiding_traditions
				duration = 5475
			}
			
			if = {
				limit = {
					has_dlc = "Rights of Man"
				}
				custom_tooltip = HORDES_UNLOCK_REAVER_RULER_PERSONALITY
				set_country_flag = unlocked_reaver_personality_flag
			}
			else = {
				change_mil = 2
			}
		}  
	}

	tatars_caucasia = {
		icon = mission_the_caucasus_rus
		position = 4
		required_missions = { tatars_strengthen_raids } 
		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 = 15
			}
		} 

		effect = {  
			custom_tooltip = HORDES_GRANT_HORDE_UNITY_PER_MOUNTAIN_PROVINCE_IN_REGION
			hidden_effect = {
				every_owned_province = {
					limit = {
						region = caucasia_region
						OR = {
							has_terrain = mountain
							has_terrain = hills
						}
					}
					owner = {
						add_legitimacy_equivalent = { amount = 2 republican_tradition = 2 }
					}
				}
			}
			
			custom_tooltip = SEPERATOR_TOOLTIP
			
			add_army_tradition_or_mil_power = { amount = 10 }
		} 
	}

	tatars_heart_of_persia = {
		icon = mission_into_persia_1
		position = 6
		required_missions = { tatars_into_iran } 
		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 = {  
			custom_tooltip = TATARS_GAIN_DIP_POWER_PER_COT_IN_PERSIA
			hidden_effect = {
				every_owned_province = {
					limit = {
						region = persia_region
						province_has_center_of_trade_of_level = 1
					}
					owner = {
						add_dip_power = 25
					}
				}
			}
			
			custom_tooltip = SEPERATOR_TOOLTIP
			
			give_claims = { region = mashriq_region }
			give_claims = { region = anatolia_region }
		}
	}

	tatars_into_egypt = {
		icon = mission_egyptian_mamluk_soldier
		position = 8
		required_missions = { tatars_restoration_of_ilkhanate } 
		provinces_to_highlight = {
			OR = {
				region = mashriq_region
				region = egypt_region
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		} 

		trigger = {  
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				OR = {
					region = mashriq_region
					region = egypt_region
				}
				value = 25
			}
		}

		effect = {
			if = {
				limit = {
					has_government_attribute = raze_province
				}
				custom_tooltip = TATARS_RAZING_CHURCHES_NOW_GRANTS_DUCATS
				set_country_flag = tatars_curch_raze_flag
				
				custom_tooltip = SEPERATOR_TOOLTIP
				
				complex_dynamic_effect = {
					first_custom_tooltip = TATARS_IF_CAIRO_AND_BAGHDAD_HAVE_BEEN_RAZED
					first_limit = "
						410 = {
							has_province_modifier = province_razed
						}
						361 = {
							has_province_modifier = province_razed
						}
					"
					first_effect = "
						change_innovativeness = 5
						add_adm_power = 50
						add_dip_power = 50
						add_mil_power = 50
					"
				}
			}
			else = {
				add_mil_power = 100
				add_prestige_or_monarch_power = { amount = 20 }
			}
		} 
	}
}

woc_tatars_2 = {
	slot = 2
	generic = no
	ai = yes
	has_country_shield = yes
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = {
		if = {
			limit = {
				OR = {
					is_tatar_nation = yes
					is_mongol_nation = yes
					is_moghulistan_nation = yes
					was_tatar_nation = yes
					was_mongol_nation = yes
					was_moghulistan_nation = yes
				}
			}
			OR = {
				is_tatar_nation = yes
				AND = {
					was_tatar_nation = yes
					OR = {
						is_mongol_nation = yes
						is_moghulistan_nation = yes
						tag = MGE
						tag = YUA
						tag = ILK
						tag = GLH
					}
				}
			}
			NOT = { was_mongol_nation = yes }
			NOT = { was_moghulistan_nation = yes }
		}
		else = {
			tag = GLH
		}
		has_dlc = "Winds of Change"
	}

	tatars_russian_yoke = {
		icon = mission_break_the_tatar_yoke
		position = 1
		provinces_to_highlight = {  
			region = russia_region
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		} 

		trigger = {  
			OR = {
				num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
					value = 3
					region = russia_region
				}
				war_score_against = {
					who = MOS
					value = 25
				}
			}
		} 

		effect = {  
			add_estate_loyalty = {
				estate = estate_nomadic_tribes
				loyalty = 10
			}
			
			custom_tooltip = SEPERATOR_TOOLTIP
			
			give_claims = { area = galich_area }
			give_claims = { area = suzdal_area }
			give_claims = { id = 2423 }
			give_claims = { id = 1778 }
		} 
	}

	tatars_meddling_in_muscovite_civil_war = {
		icon = mission_defeat_muscovy
		position = 2
		required_missions = { tatars_russian_yoke } 
		provinces_to_highlight = {  
			area = moscow_area
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		} 

		trigger = {  
			moscow_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT
			}
		} 

		effect = {  
			add_years_of_income = 0.5
			
			custom_tooltip = SEPERATOR_TOOLTIP
			
			custom_tooltip = MOGHULISTAN_ORGANIZER_GRANTS_RAZE_GAIN
			set_country_flag = moghulistan_organizer_flag
		} 
	}

	tatars_restoration_of_the_yoke = {
		icon = mission_plc_break_the_rus
		position = 3
		required_missions = {
			tatars_seizing_nizhny_novgorod
			tatars_meddling_in_muscovite_civil_war
			tatars_fall_of_ryazan
		}
		provinces_to_highlight = {  
			region = russia_region
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		} 
	
		trigger = {  
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				value = 35
				region = russia_region
				country_or_non_sovereign_subject_holds = ROOT
			}
		} 
	
		effect = {
			if = {
				limit = {
					has_dlc = "The Cossacks"
				}
				add_country_modifier = {
					name = hordes_cossacks
					duration = -1
				}
			}
			else = {
				add_yearly_manpower = 1.5
				add_mil_power = 100
			}
			
			add_prestige_or_monarch_power = { amount = 20 }
		} 
	}

	tatars_return_in_carpathia = {
		icon = mission_destroy_the_hungarians
		position = 4
		required_missions = {
			tatars_raid_ruthenia
			tatars_restoration_of_the_yoke
			tatars_strengthen_raids
		}
		provinces_to_highlight = {  
			region = carpathia_region
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		} 

		trigger = {  
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				region = carpathia_region
				value = 20
			}
		}

		effect = {  
			country_event_with_effect_insight = {
				id = horde_mission_events.1
				effect = "
					custom_tooltip = HORDES_UNLOCK_HUNGARIAN_COMPANIES
					set_country_flag = hordes_unlock_hungarian_mercenaries_flag
					
					custom_tooltip = SEPERATOR_TOOLTIP
					
					if =  {
						limit = { 
							has_dlc = \"Rights of Man\"
							NOT = { num_of_ruler_traits = { amount = 3 } }
						}
						add_ruler_personality = reaver_personality 
					}
				"
			}
		}   
	}

	tatars_into_iran = {
		icon = per_protect_the_west_iranian
		position = 5
		required_missions = { tatars_march_into_central_asia } 
		provinces_to_highlight = {  
			region = khorasan_region
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		} 

		trigger = {  
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				region = khorasan_region
				value = 15
			}
		} 

		effect = {  
			add_years_of_income = 0.6
			
			custom_tooltip = SEPERATOR_TOOLTIP
			
			add_country_modifier = {
				name = hordes_khan_of_khans
				duration = -1
			}

			give_claims = { region = persia_region }
		}
	}

	tatars_restoration_of_ilkhanate = {
		icon = mission_ilkhanate
		position = 7
		required_missions = {
			tatars_heart_of_persia
			tatars_into_iran
		}
		provinces_to_highlight = {  
			OR = {
				region = khorasan_region
				region = persia_region
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		} 

		trigger = {  
			khorasan_region = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT
			}
			persia_region = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT
			}
		}

		effect = {
			custom_tooltip = TATARS_MODIFY_KHAN_OF_KHANS_1
			
			custom_tooltip = SEPERATOR_TOOLTIP
			
			hidden_effect = {
				remove_country_modifier = hordes_khan_of_khans
				add_country_modifier = {
					name = hordes_khan_of_khans_1
					duration = -1
				}
			}
			
			country_event_with_option_insight = {
				id = horde_mission_events.5
				option_1 = "
					custom_tooltip = HORDES_RESTORE_YUAN_IN_PERSIA
				"
				option_2 = "
					add_adm_power = 100
					add_mercantilism_or_monarch_power = { amount = 3 }
				"
			}
		} 
	}

	tatars_anatolia = {
		icon = anatolian_frontier
		position = 8
		required_missions = { tatars_restoration_of_ilkhanate } 
		provinces_to_highlight = {  
			region = anatolia_region
			province_is_on_an_island = no
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		} 
	
		trigger = {  
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				region = anatolia_region
				province_is_on_an_island = no
				value = 15
			}
		}

		effect = {  
			custom_tooltip = TATARS_MODIFY_KHAN_OF_KHANS_2
			hidden_effect = {
				remove_country_modifier = hordes_khan_of_khans_1
				add_country_modifier = {
					name = hordes_khan_of_khans_2
					duration = -1
				}
			}
			
			custom_tooltip = SEPERATOR_TOOLTIP
			
			add_estate_loyalty = {
				estate = estate_nomadic_tribes
				loyalty = 15
			}
		} 
	}

	tatars_japan = {
		icon = jap_train_samurai
		position = 9
		required_missions = { tatars_korea } 
		provinces_to_highlight = {  
			region = japan_region
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		} 

		trigger = {  
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				region = japan_region
				value = 20
			}
		} 

		effect = {  
			define_advisor = {
				type = army_reformer
				skill = 2
				cost_multiplier = 0.5
			}
			
			custom_tooltip = SEPERATOR_TOOLTIP
			
			if = {
				limit = {
					has_dlc = "Rule Britannia"
				}
				set_country_flag = unlocked_japanese_atakebuna_doctrine_flag
				custom_tooltip = HORDES_UNLOCK_JAPANESE_NAVAL_DOCTRINE
			}
			else = {
				add_navy_tradition = 15
				add_dip_power = 100
			}
		} 
	}
}
woc_tatars_3 = {
	slot = 3
	generic = no
	ai = yes
	has_country_shield = yes
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = {
		if = {
			limit = {
				OR = {
					is_tatar_nation = yes
					is_mongol_nation = yes
					is_moghulistan_nation = yes
					was_tatar_nation = yes
					was_mongol_nation = yes
					was_moghulistan_nation = yes
				}
			}
			OR = {
				is_tatar_nation = yes
				AND = {
					was_tatar_nation = yes
					OR = {
						is_mongol_nation = yes
						is_moghulistan_nation = yes
						tag = MGE
						tag = YUA
						tag = ILK
						tag = GLH
					}
				}
			}
			NOT = { was_mongol_nation = yes }
			NOT = { was_moghulistan_nation = yes }
		}
		else = {
			tag = GLH
		}
		has_dlc = "Winds of Change"
	}

	tatars_seizing_nizhny_novgorod = {
		icon = mission_conquer_50_development
		position = 2
		required_missions = { tatars_russian_yoke } 
		provinces_to_highlight = {  
			area = galich_area
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		} 

		trigger = {  
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				area = galich_area
				value = 3
			}
			306 = {
				country_or_non_sovereign_subject_holds = ROOT
			}
		} 

		effect = {  
			add_mil_power = 50
			
			custom_tooltip = SEPERATOR_TOOLTIP
			
			give_claims = { region = russia_region }
			
			custom_tooltip = SEPERATOR_TOOLTIP
			
			306 = {
				add_center_of_trade_level = 1
			}
		}
	}

	tatars_raid_ruthenia = {
		icon = mission_rule_ruthenia
		position = 3
		provinces_to_highlight = {  
			region = ruthenia_region
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		} 

		trigger = {  
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				region = ruthenia_region
				value = 25
			}
		} 

		effect = {  
			distribute_development = {
				type = manpower
				amount = 5
			}
			
			add_stability = 1
			
			custom_tooltip = SEPERATOR_TOOLTIP
			
			give_claims = { region = carpathia_region }
		} 
	}

	tatars_revenge_against_timur = {
		icon = aq_qoyunlu_dethrone_the_timurids
		position = 5
		provinces_to_highlight = {  
			if = {
				limit = {
					exists = TIM
				}
				is_capital_of = TIM
			}
			else = {
				province_id = 454
				NOT = { country_or_non_sovereign_subject_holds = ROOT }
			}
		} 

		trigger = {  
			if = {
				limit = {
					exists = TIM
				}
				OR = {
					has_won_war_against = {
						who = TIM
						max_years_since = 25
					}
					war_score_against = {
						who = TIM
						value = 80
					}
				}
			}
			else = {
				454 = {
					country_or_non_sovereign_subject_holds = ROOT
				}
			}
		} 

		effect = {  
			give_claims = { region = khorasan_region }
			
			custom_tooltip = SEPERATOR_TOOLTIP
			
			create_general_with_pips = { tradition = 60 add_siege = 1 }
		} 
	}

	tatars_invasion_of_india = {
		icon = mission_indian_empire
		position = 6
		required_missions = { tatars_revenge_against_timur tatars_into_iran } 
		provinces_to_highlight = {  
			region = hindusthan_region
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		} 

		trigger = {  
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				region = hindusthan_region
				value = 20
			}
			522 = {
				country_or_non_sovereign_subject_holds = ROOT
			}
		}

		effect = {  
			add_country_modifier = {
				name = hordes_fall_of_hindustan
				duration = 5475
			}
			
			change_ruler_stat = {
				type = mil
				amount = 1
			}
		} 
	}

	tatars_korea = {
		icon = mjz_into_korea
		position = 8
		required_missions = { tatars_dragons_gate } 
		provinces_to_highlight = {  
			region = korea_region
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		} 

		trigger = {  
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				region = korea_region
				value = 15
			}
		}

		effect = {  
			custom_tooltip = HORDES_SHARE_SPOILS_GRANTS_TECH_COST_REDUCTION
			set_country_flag = hordes_share_spoils_buff_flag
			
			custom_tooltip = SEPERATOR_TOOLTIP
			
			add_legitimacy_equivalent = { amount = 10 republican_tradition = 5 }

			custom_tooltip = SEPERATOR_TOOLTIP

			give_claims = { region = japan_region }
		}
	}

	tatars_pax_mongolica = {
		icon = mission_mongol_peace
		position = 10
		required_missions = {
			tatars_the_dragon_throne
			tatars_japan
		}

		trigger = {  
			tag = MGE
			mission_completed = tatars_anatolia
			mission_completed = tatars_return_in_carpathia
		} 

		effect = {
			country_event_with_effect_insight = {
				id = horde_mission_events.7
				effect = "
					custom_tooltip = HORDES_CREATE_PAX_MONGOLICA_MODIFIER
            
					custom_tooltip = SEPERATOR_TOOLTIP
					
					if = {
						limit = {
							has_dlc = \"Rights of Man\"
						}
						custom_tooltip = HORDES_CONQUERORS_GUARANTEED
						set_country_flag = hordes_guaranteed_conquerors
					}
					else = {
						change_mil = 2
						add_mil_power = 100
					}
				"
			}
		} 
	}
}
woc_tatars_4 = {
	slot = 4
	generic = no
	ai = yes
	has_country_shield = yes
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = {
		if = {
			limit = {
				OR = {
					is_tatar_nation = yes
					is_mongol_nation = yes
					is_moghulistan_nation = yes
					was_tatar_nation = yes
					was_mongol_nation = yes
					was_moghulistan_nation = yes
				}
			}
			OR = {
				is_tatar_nation = yes
				AND = {
					was_tatar_nation = yes
					OR = {
						is_mongol_nation = yes
						is_moghulistan_nation = yes
						tag = MGE
						tag = YUA
						tag = ILK
						tag = GLH
					}
				}
			}
			NOT = { was_mongol_nation = yes }
			NOT = { was_moghulistan_nation = yes }
		}
		else = {
			tag = GLH
		}
		has_dlc = "Winds of Change"
	}

	tatars_southern_steppes = {
		icon = mission_lit_harness_steppes
		position = 2
		required_missions = { tatars_successors_of_the_golden_horde } 
		provinces_to_highlight = {  
			region = crimea_region
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		} 

		trigger = {
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				region = crimea_region
				value = 10
			}
			466 = {
				owned_by = ROOT
			}
		} 

		effect = {
			add_legitimacy_equivalent = { amount = 10 republican_tradition = 5 }
			
			custom_tooltip = SEPERATOR_TOOLTIP
			
			add_prestige_or_monarch_power = { amount = 10 }
			
			custom_tooltip = SEPERATOR_TOOLTIP
			
			if = {
				limit = {
					466 = {
						NOT = { is_capital_of = ROOT }
					}
				}
				country_event_with_option_insight = {
					id = horde_mission_events.2
					option_1 = "
						set_capital = 466
						466 = {
							add_base_tax = 1
							add_base_manpower = 1
						}
					"
					
					option_2 = "
						capital_scope = {
							add_base_tax = 1
							add_base_manpower = 1
						}
					"
				}
			}
			else = {
				capital_scope = {
					add_base_tax = 1
					add_base_manpower = 1
				}
			}
		} 
	}

	tatars_unify_golden_horde = {
		icon = mission_ulug_ulus
		position = 3
		required_missions = {
			tatars_southern_steppes
			tatars_consolidate_urals
		}

		trigger = {  
			OR = {
				tag = GLH
				tag = MGE
			}
		} 

		effect = {  
			change_ruler_stat = {
				type = mil
				amount = 2
			}
			
			custom_tooltip = SEPERATOR_TOOLTIP
			
			add_prestige_or_monarch_power = { amount = 25 }
			
			custom_tooltip = SEPERATOR_TOOLTIP
			
			country_event_with_option_insight = {
				id = horde_mission_events.3
				option_1 = "
					override_country_name = ULUG_ULUS
					
					custom_tooltip = SEPERATOR_TOOLTIP
				"
				
				option_2 = "
					custom_tooltip = HORDES_RETAIN_GOLDEN_HORDE_NAME
				"
			}
		} 
	}

	tatars_march_into_central_asia = {
		icon = mission_central_asian_city
		position = 4
		required_missions = {
			tatars_unify_golden_horde
			tatars_kazakhs
		}
		provinces_to_highlight = {  
			region = central_asia_region
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		} 

		trigger = {  
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				region = central_asia_region
				value = 30
			}
		} 

		effect = {  
			give_claims = { region = khorasan_region }

			custom_tooltip = SEPERATOR_TOOLTIP

			add_estate_loyalty = {
				estate = estate_nomadic_tribes
				loyalty = 10
			}
			
			custom_tooltip = SEPERATOR_TOOLTIP
			
			add_mil_power = 50
			
			custom_tooltip = SEPERATOR_TOOLTIP
			
			complex_dynamic_effect = {
				first_custom_tooltip = TATAR_IF_KAZAKH_IS_OUR_VASSAL
				first_limit = "
					KZH = {
						is_subject_of = ROOT
					}
				"
				first_effect = "
					create_subject = {
						subject_type = incorporated_vassal
						subject = KZH
					}
					KZH = {
						set_country_flag = free_incorporated_vassal
						custom_tooltip = WoC_free_integrated_vassal_str
					}
				"
			}
		} 
	}

	tatars_control_over_northern_yuan = {
		icon = qng_end_yuan
		position = 6
		required_missions = {
			tatars_contact_with_oirat
			tatars_march_into_central_asia
		}
		provinces_to_highlight = {  
			region = mongolia_region
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		} 

		trigger = {  
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				region = mongolia_region
				value = 15
			}
		} 

		effect = {  
			add_country_modifier = {
				name = tatars_like_a_dragon
				duration = -1
			}
			
			give_claims = { region = north_china_region }
			give_claims = { region = manchuria_region }
		} 
	}

	tatars_dragons_gate = {
		icon = mch_bypass_great_wall
		position = 7
		required_missions = { tatars_control_over_northern_yuan } 
		provinces_to_highlight = {  
			OR = {
				area = ordos_area
				area = gansu_area
				area = west_gansu_area
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		} 

		trigger = {  
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				OR = {
					area = ordos_area
					area = gansu_area
					area = west_gansu_area
				}
				value = 6
			}
			698 = {
				country_or_non_sovereign_subject_holds = ROOT
			}
		}

		effect = {  
			give_claims = { region = korea_region }
			country_event_with_effect_insight = {
				id = horde_mission_events.8
				effect = "
					add_army_tradition_or_mil_power = { amount = 10 }
		
					custom_tooltip = SEPERATOR_TOOLTIP
		
					if = {
						limit = {
							has_dlc = \"Leviathan\"
						}
						custom_tooltip = HORDES_UNLOCK_GREAT_WALL_OF_CHINA
						set_country_flag = hordes_unlocked_wall_of_china
					}
					else = {
						698 = {
							add_or_upgrade_fort_building = yes
						}
					}
				"
			}
		}
	}

	tatars_control_over_the_north = {
		icon = mission_tumu_crisis
		position = 8
		required_missions = { tatars_dragons_gate } 
		provinces_to_highlight = {  
			region = north_china_region
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		} 

		trigger = {  
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				region = north_china_region
				value = 20
			}
			1816 = {
				country_or_non_sovereign_subject_holds = ROOT
			}
		}

		effect = {
			give_claims = { region = south_china_region }
			give_claims = { region = xinan_region }
			give_claims = { region = tibet_region }
			
			custom_tooltip = SEPERATOR_TOOLTIP
		
			add_prestige_or_monarch_power = { amount = 10 }
			
			custom_tooltip = SEPERATOR_TOOLTIP
			
			custom_tooltip = TATARS_MODIFY_LIKE_A_DRAGON_MODIFIER_1
			hidden_effect = {
				remove_country_modifier = tatars_like_a_dragon
				add_country_modifier = {
					name = tatars_like_a_dragon_1
					duration = -1
				}
			}
		}
	}

	tatars_the_dragon_throne = {
		icon = mission_seize_the_dragon_throne
		position = 9
		required_missions = {
			tatars_control_over_the_north
			tatars_southern_china
		}
		provinces_to_highlight = {  
			OR = {
				region = north_china_region
				region = south_china_region
				region = xinan_region
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		} 

		trigger = {
			1816 = {
				country_or_non_sovereign_subject_holds = ROOT
			}
			1821 = {
				country_or_non_sovereign_subject_holds = ROOT
			}
			667 = {
				country_or_non_sovereign_subject_holds = ROOT
			}
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				OR = {
					region = north_china_region
					region = south_china_region
					region = xinan_region
				}
				value = 100
			}
		}

		effect = {
			add_country_modifier_for_age = {
				name = hordes_fall_of_china
				age = age_of_reformation
			}
			
			add_legitimacy_equivalent = { amount = 15 republican_tradition = 10 }
			
			custom_tooltip = SEPERATOR_TOOLTIP
			
			custom_tooltip = TATARS_MODIFY_LIKE_A_DRAGON_MODIFIER_2
			hidden_effect = {
				remove_country_modifier = tatars_like_a_dragon_1
				add_country_modifier = {
					name = tatars_like_a_dragon_2
					duration = -1
				}
			}
		} 
	}
}
woc_tatars_5 = {
	slot = 5
	generic = no
	ai = yes
	has_country_shield = yes
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = {
		if = {
			limit = {
				OR = {
					is_tatar_nation = yes
					is_mongol_nation = yes
					is_moghulistan_nation = yes
					was_tatar_nation = yes
					was_mongol_nation = yes
					was_moghulistan_nation = yes
				}
			}
			OR = {
				is_tatar_nation = yes
				AND = {
					was_tatar_nation = yes
					OR = {
						is_mongol_nation = yes
						is_moghulistan_nation = yes
						tag = MGE
						tag = YUA
						tag = ILK
						tag = GLH
					}
				}
			}
			NOT = { was_mongol_nation = yes }
			NOT = { was_moghulistan_nation = yes }
		}
		else = {
			tag = GLH
		}
		has_dlc = "Winds of Change"
	}

	tatars_successors_of_the_golden_horde = {
		icon = mission_steppe_warriors
		position = 1

		trigger = {  
			OR = {
				army_size_percentage = 0.9
				army_size = 8 # modified
			}
		} 

		effect = {  
			give_claims = { region = ural_region }
			give_claims = { region = crimea_region }
			
			custom_tooltip = SEPERATOR_TOOLTIP
			
			create_general_with_pips = { tradition = 40 add_shock = 1 }
		} 
	}

	tatars_consolidate_urals = {
		icon = mission_beyond_the_urals
		position = 2
		required_missions = { tatars_successors_of_the_golden_horde } 
		provinces_to_highlight = {  
			region = ural_region
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
			is_city = yes
		} 

		trigger = {  
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				region = ural_region
				is_city = yes
				value = 30
			}
		} 

		effect = {
			add_army_tradition_or_mil_power = { amount = 10 }
			
			custom_tooltip = SEPERATOR_TOOLTIP
			
			add_accepted_culture_or_dip_power=  { culture = kazani value = 100 } 
			
			custom_tooltip = SEPERATOR_TOOLTIP
			
			custom_tooltip = TATARS_CULTURE_CONVERT_URALIC_PROVINCES
			hidden_effect = {
				every_owned_province = {
					limit = {
						culture = uralic
					}
					change_culture = kazani
				}
			}
		}
	}

	tatars_kazakhs = {
		icon = mission_kazakh_tribes
		position = 3
		provinces_to_highlight = {  
			region = central_asia_region
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		} 

		trigger = {  
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				region = central_asia_region
				value = 10
			}
			army_size = 8 # modified
		} 

		effect = {  
			add_yearly_manpower = 1
			
			complex_dynamic_effect = {
				first_custom_tooltip = TATAR_IF_WE_OWN_KAZAKH_PROVINCE
				first_limit = "
					NOT = { exists = KZH }
					any_owned_province = {
						is_core = KZH
					}
				"
				first_effect = "
					country_event_with_option_insight = {
						id = horde_mission_events.4
						option_1 = \"
							custom_tooltip = TATARS_RELEASE_KAZAKH
						\"
						
						option_2 = \"
							add_adm_power = 100
						\"
					}
				"
			}
		} 
	}

	tatars_contact_with_oirat = {
		icon = mission_oirat
		position = 5
		provinces_to_highlight = {  
			region = mongolia_region
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		} 
	
		trigger = {  
			OR = {
				AND = {
					OR = {
						OIR = {
							has_been_insulted_by_root = yes
						}
						is_enemy = OIR
					}
					army_size = 10 # modified
				}
				num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
					region = mongolia_region
					value = 10
				}
			}
		}
	
		effect = {  
			give_claims = { region = mongolia_region }
			
			custom_tooltip = SEPERATOR_TOOLTIP
			
			custom_tooltip = TATARS_UNLOCK_YUAN_RESTORATION_DECISION
			
			set_country_flag = hordes_yuan_restoration
		} 
	}

	tatars_manchuria = {
		icon = mission_manchu_warrior
		position = 7
		required_missions = { tatars_control_over_northern_yuan } 
		provinces_to_highlight = {  
			region = manchuria_region
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		} 

		trigger = {  
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				region = manchuria_region
				value = 20
			}
		} 

		effect = {
			capital_scope = {
				add_base_manpower = 1
				add_base_tax = 2
			}
			
			custom_tooltip = SEPERATOR_TOOLTIP
			
			custom_tooltip = TATARS_RAZING_GRANTS_TRIBES_LOYALTY
			set_country_flag = hordes_unlock_tribes_loyalty_through_razing_flag
		} 
	}

	tatars_southern_china = {
		icon = qng_conquer_south_china
		position = 8
		required_missions = { tatars_dragons_gate } 
		provinces_to_highlight = {  
			OR = {
				region = south_china_region
				region = xinan_region
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		} 

		trigger = {  
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				OR = {
					region = south_china_region
					region = xinan_region
				}
				value = 25
			}
		} 

		effect = {
			add_prestige_or_monarch_power = { amount = 10 }
			
			custom_tooltip = SEPERATOR_TOOLTIP
			
			if = {
				limit = {
					has_dlc = "Rights of Man"
					NOT = { num_of_ruler_traits = { amount = 3 } }
					NOT = { ruler_has_personality = conqueror_personality }
				}
				add_ruler_personality = legendary_conqueror_personality
				
				custom_tooltip = SEPERATOR_TOOLTIP
			}
			else_if = {
				limit = {
					has_dlc = "Rights of Man"
					ruler_has_personality = conqueror_personality
				}
				
				remove_ruler_personality = conqueror_personality	
				add_ruler_personality = legendary_conqueror_personality
				
				custom_tooltip = SEPERATOR_TOOLTIP
			}
			
			complex_dynamic_effect = {
				first_custom_tooltip = TATARS_IF_YUAN_SUBJECT
				first_limit = "
					YUA = {
						is_subject_of = ROOT
					}
				"
				first_effect = "
					add_army_tradition_or_mil_power = { amount = 5 }
					
					custom_tooltip = SEPERATOR_TOOLTIP
					
					create_general_with_pips = { tradition = 60 add_shock = 1 add_manuever = 1 }
				"
			}
		} 
	}
}
