ming_missions_1 = {
	slot = 1
	generic = no
	ai = yes
	potential = {
		has_dlc = "Domination"
		culture_group = east_asian
		NOT = { primary_culture = manchu_new }
		NOT = { primary_culture = tibetan_new }
		NOT = { primary_culture = altaic_new }
		NOT = { primary_culture = vietnamese_new }
		NOT = { primary_culture = korean_new }
		NOT = { map_setup = map_setup_random }
		tag = MNG
	}
	has_country_shield = yes 
	
	mng_tumu_crisis = { 
		icon = mission_tumu_crisis
		provinces_to_highlight = {
			owned_by = OIR
		}
		required_missions = { }
		position = 1
		trigger = {
			is_at_war = no 
			OIR = {
				OR = { 
					AND = {
						is_subject_of = ROOT 
						NOT = { liberty_desire = 40 } 
						has_opinion = {
							who = ROOT 
							value = 50 
						}
					}
					NOT = { total_development = 75 }
				}
			}
		}
		effect = {
			if = { 
				limit = {
					gansu_area = { country_or_non_sovereign_subject_holds = ROOT }	
				}
				gansu_area = { 
					add_prosperity = 10 
					add_base_tax = 1 
				}
			}
			if = {
				limit = { 
					708 = { country_or_non_sovereign_subject_holds = ROOT }
				}
				708 = { add_base_manpower = 1 }
			}
			if = {
				limit = { 
					2182 = { country_or_non_sovereign_subject_holds = ROOT }
				}
				2182 = { add_base_manpower = 1 }
			}
			if = {
				limit = { 
					2184 = { country_or_non_sovereign_subject_holds = ROOT }
				}
				2184 = { add_base_manpower = 1 }
			}
			country_event = { id = flavor_mng.27 }
		}
	}
	
	mng_restore_royal_road = {
		icon = mission_the_grand_trunk_road_dlh 
		required_missions = { mng_tumu_crisis mng_expand_great_wall }
		position = 2 
		provinces_to_highlight = {
			AND = {
				owned_by = ROOT 
				trade_goods = silk 
			}
		}
		trigger = {
			OR = { 
				any_ally = { 
					total_development = 200 
					capital_scope = {
						OR = { 
							superregion = india_superregion 
							superregion = persia_superregion 
						}
					}
					has_opinion = {
						who = ROOT 
						value = 150 
					}
					trust = {
						who = ROOT 
						value = 70 
					}
				}
				any_subject_country = {
					total_development = 200 
					capital_scope = {
						OR = { 
							superregion = india_superregion 
							superregion = persia_superregion 
						}
					}
					has_opinion = {
						who = ROOT 
						value = 150 
					}
					trust = {
						who = ROOT 
						value = 70 
					}
				}
			}
			development_in_provinces = {
				value = 135 
				owned_by = ROOT 
				trade_goods = silk 
			}
		}
		effect = {
			if = { 
				limit = { 
					NOT = { has_global_flag = popular_silk_happened }
				}
				add_country_modifier = {
					name = mng_reinstated_silk_road_modifier
					duration = 9125 
				}
			}
			if = {
				limit = { 
					NOT = {
						any_ally = {
							total_development = 200 
							capital_scope = {
								OR = { 
									superregion = india_superregion 
									superregion = persia_superregion 
								}
							}
							has_opinion = {
								who = ROOT 
								value = 150 
							}
							trust = {
								who = ROOT 
								value = 70 
							}
						}
					}
				}
				custom_tooltip = mng_decide_silk_road_route_2tt
			}
			else = {
				custom_tooltip = mng_decide_silk_road_route_tt
				tooltip = {
					random_ally = {
						limit = {
							total_development = 200 
							capital_scope = {
								OR = { 
									superregion = india_superregion 
									superregion = persia_superregion 
								}
							}
							has_opinion = {
								who = ROOT 
								value = 150 
							}
							trust = {
								who = ROOT 
								value = 70 
							}
						}
						capital_scope = { 
							region = {
								limit = { trade_goods = silk }
								add_base_production = 1 
							}
						}
						add_country_modifier = {
							name = mng_keepers_of_the_silk_road_modifier
							duration = 9125 
						}
					}
				}
			}
			hidden_effect = {
				random_subject_country = {
					limit = {
						total_development = 200 
						capital_scope = {
							OR = { 
								superregion = india_superregion 
								superregion = persia_superregion 
							}
						}
						has_opinion = {
							who = ROOT 
							value = 150 
						}
						trust = {
							who = ROOT 
							value = 70 
						}
					}
					add_country_modifier = {
						name = mng_keepers_of_the_silk_road_modifier
						duration = 9125 
					}
					capital_scope = { 
						region = {
							limit = { trade_goods = silk }
							add_base_production = 1 
						}
					}
				}
				random_ally = {
					limit = {
						total_development = 200 
						capital_scope = {
							OR = { 
								superregion = india_superregion 
								superregion = persia_superregion 
							}
						}
						has_opinion = {
							who = ROOT 
							value = 150 
						}
						trust = {
							who = ROOT 
							value = 70 
						}
					}
					capital_scope = { 
						region = {
							limit = { trade_goods = silk }
							add_base_production = 1 
						}
					}
					add_country_modifier = {
						name = mng_keepers_of_the_silk_road_modifier
						duration = 9125 
					}
				}
			}
		}
	}
}

DOM_Qing_Related_Missions_1 = { 
	slot = 1
	generic = no
	ai = yes
	#potential_on_load = { has_dlc = "Mandate of Heaven" }
	potential = {
		has_dlc = "Domination"
		OR = {
			tag = MJZ
			tag = MCH
			tag = QNG
			#tag = KRC
			tag = MYR
			tag = EJZ
			tag = NHX
			tag = MHX
		}
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes
	
	qng_eight_banners = { 
		icon = mission_chinese_general_riding
		required_missions = { }
		position = 1
		trigger = {
			if = {
				limit = {
					has_dlc = "Mandate of Heaven"
				}
				num_of_banners = 8
				army_size_percentage = 0.9 
			}
			else = {
				army_size_percentage = 0.9
				cavalry_fraction = 0.4
			}
			if = { 
				limit = { has_dlc = "Cradle of Civilization" } 
				OR = { 
					AND = { 
						army_professionalism = 0.5 
						army_tradition = 70
					}
					has_mil_advisor = yes 
				}
			}
			else = { 
				OR = { 
					army_tradition = 70 
					has_mil_advisor = yes 
				} 
			}
		}
		
		effect = { 
			if = { 
				limit = { has_dlc = "Mandate of Heaven" } 
				add_country_modifier = {
					name = mjz_eight_banners_modifier2
					duration = -1 
				}
				custom_tooltip = mjz_banners_cost_no_corruption_tt
				set_country_flag = refund_partial_corruption_on_banner_recruited_flag 
			}
			else = { 
				add_country_modifier = {
					name = mjz_eight_banners_modifier
					duration = -1 
				}
			}
			if = { 
				limit = { has_country_modifier = mjz_dominance_of_the_horselords_modifier } 
				custom_tooltip = mjz_extend_dominance_modifier_tt
				hidden_effect = {
					remove_country_modifier = mjz_dominance_of_the_horselords_modifier
					add_country_modifier = {
						name = mjz_dominance_of_the_horselords_modifier 
						duration = 3650 
					}
				}
			}
		}
	}
	
	
	qng_end_yuan = { 
		icon = qng_end_yuan
		required_missions = { 
			qng_eight_banners 
			mjz_dominate_rival_jurchens 
		}
		position = 3
		provinces_to_highlight = {
			OR = {
				area = xilin_gol_area
				area = outer_mongolia_area
				area = central_mongolia_area
				area = inner_mongolia_area
				province_id = 2116
				province_id = 4203 
				province_id = 2115
			}
			NOT = { country_or_subject_holds = ROOT } 
		}
		
		trigger = {
			num_of_provinces_owned_or_owned_by_subjects_with = {
				OR = {
					area = xilin_gol_area
					area = outer_mongolia_area
					area = central_mongolia_area
					area = inner_mongolia_area
					province_id = 2116
					province_id = 4203 
					province_id = 2115
				}
				value = 15 
			}
		}
		
		effect = { 
			add_power_projection = {
				type = mission_rewards_power_projection
				amount = 50 
			}
			add_prestige_or_monarch_power = { amount = 20 } 
			if = { 
				limit = { is_emperor_of_china = yes } 
				add_mandate = 10 
			}
			if = { 
				limit = { has_country_modifier = mjz_dominance_of_the_horselords_modifier } 
				custom_tooltip = mjz_extend_dominance_modifier_tt
				hidden_effect = {
					remove_country_modifier = mjz_dominance_of_the_horselords_modifier
					add_country_modifier = {
						name = mjz_dominance_of_the_horselords_modifier 
						duration = 3650 
					}
				}
			}
		}
	}
}

chinese_kingdoms_1 = {
	slot = 1
	generic = no
	ai = yes
	potential = {
		has_dlc = "Domination"
		OR = {
			tag = YAN
			tag = JIN
			tag = QIN
			tag = QIC
			tag = CSH
			tag = LNG
			tag = TNG
			tag = CXI
			tag = CHC
			tag = WUU
			tag = NNG
			tag = MIN
			tag = HUA
			tag = YUE
			tag = CMI
			tag = CYI
			tag = CDL
			tag = CGS
			tag = FRM
			
			#New changed in MMETR
			AND = {
				tag = SHU
				started_in = 280.1.1
			}
		}
		started_in = 1368.1.1		#New added in MMETR mod, to exclude new Ancient/Medieval Chinese Warlord missions
		NOT = { map_setup = map_setup_random }
	}
	
	solidify_our_borders = {
		icon = mission_chinese_general_riding
		required_missions = { } 
		position = 1 
		trigger = {
			grown_by_development = 100
		}
		effect = {
			add_country_modifier = {
				name = chi_warring_era_kingdoms_modifier
				duration = 9125 
			}
		}
	}
	
	mandate_cities = {
		icon = mission_tumu_crisis
		required_missions = { solidify_our_borders } 
		position = 2
		provinces_to_highlight = {
			OR = {
				AND = {
					ROOT = { 
						capital_scope = { region = xinan_region } 
					}
					province_id = 667 
				}
				AND = {
					ROOT = { 
						capital_scope = { region = south_china_region } 
					}
					OR = { 
						province_id = 1821
						province_id = 667
					}
				}
				AND = {
					ROOT = { 
						capital_scope = { region = north_china_region } 
					}
					province_id = 1816
				}
			}
		}
		trigger = {
			if = {	
				limit = { 
					capital_scope = { region = xinan_region }
				}
				667 = {
					owned_by = ROOT 
					if = { 
						limit = { has_dlc = "Mandate of Heaven" } 
						NOT = { devastation = 1 } 
					}
					OR = {
						is_capital_of = ROOT 
						development = 30 
					}
				}
			}
			else_if = {
				limit = { 
					capital_scope = { region = south_china_region }
				}
				OR = {
					667 = {
						owned_by = ROOT 
						if = { 
							limit = { has_dlc = "Mandate of Heaven" } 
							NOT = { devastation = 1 } 
						}
						OR = { 
							num_of_times_improved = 5 
							is_capital_of = ROOT 
						}
					}
					1821 = {
						owned_by = ROOT 
						if = { 
							limit = { has_dlc = "Mandate of Heaven" } 
							NOT = { devastation = 1 } 
						}
						OR = { 
							num_of_times_improved = 5 
							is_capital_of = ROOT 
						}
					}
				}
			}
			else = {
				1816 = {
					owned_by = ROOT 
					if = { 
						limit = { has_dlc = "Mandate of Heaven" } 
						NOT = { devastation = 1 } 
					}
					OR = { 
						num_of_times_improved = 5 
						is_capital_of = ROOT 
					}
				}
			}
			prestige = 25 
			
		}
		effect = {
			add_prestige_or_monarch_power = { amount = 25 } 
			add_power_projection = {
				type = mission_rewards_power_projection
				amount = 20
			}
		}
	}
	
	fate_of_the_mandate = {
		icon = mission_great_wall
		required_missions = { mandate_cities } 
		position = 3 
		trigger = {
			OR = { 
				war_score_against = {
					who = event_target:EmperorOfChina 
					value = 90
				}
				is_emperor_of_china = yes
			}
			custom_trigger_tooltip = {
				tooltip = chi_strongest_warlord_tt
				any_country = { 
					capital_scope = { superregion = china_superregion }
					NOT = { army_size = ROOT } 
					NOT = { total_development = ROOT }
				}	
			}
		}
		effect = {	
			if = {
				limit = { 
					has_dlc = "Rights of Man" 
					NOT = { num_of_ruler_traits = { amount = 3 } }
				}
				add_ruler_personality = conqueror_personality
			}
			change_ruler_stat = {
				stat = adm
				amount = 3
			}
			change_ruler_stat = {
				stat = dip
				amount = 3
			}
			change_ruler_stat = {
				stat = mil
				amount = 3
			}
			custom_tooltip = chi_warscore_reward_tt
			tooltip = {
				if = {
					limit = { has_dlc = "Mandate of Heaven" } 
					set_emperor_of_china = ROOT 
					add_mandate = 50 
				}
				else = {
					add_prestige_or_monarch_power = { amount = 100 }
				}
			}
			hidden_effect = {
				if = {
					limit = { has_dlc = "Mandate of Heaven" } 
					set_emperor_of_china = ROOT 
					add_mandate = 50 
				}
				else = {
					add_prestige_or_monarch_power = { amount = 100 }
				}
			}
		}
	}
}

ming_missions_1_b = {
	slot = 1
	generic = no
	ai = yes
	potential = {
		has_dlc = "Domination"
		is_emperor_of_china = yes 
		OR = { 
			tag = QNG 
			culture_group = east_asian
			has_country_flag = enable_emperor_of_china_missions_flag
		}
		capital_scope = { continent = asia }
		
		started_in = 1368.1.1		#New added in MMETR mod, to exclude new Ancient/Medieval Chinese Warlord missions
		NOT = { tag = HND }		#New added in MMETR mod
		NOT = { tag = SNG }		#New added in MMETR mod
		if = {
			limit = {	
				tag = SHU
			}
			started_in = 280.1.1
		}
		if = {
			limit = {	
				tag = WEI
			}
			started_in = 280.1.1
		}
	}
	has_country_shield = yes 

	mng_cornerstone_empire = {
		icon = mission_cornerstone_empire 
		required_missions = {  }
		position = 5
		provinces_to_highlight = {
		}
		trigger = {
			OR = {
				AND = {
					estate_loyalty = {
						estate = estate_eunuchs 
						loyalty = 60 
					}
					num_of_estate_privileges = {
						estate = estate_eunuchs
						value = 5
					}
				}
				AND = { 
					custom_trigger_tooltip = {
						tooltip = mng_kept_restrictions_tt
						has_country_flag = mng_kept_restrictions_flag
					}
					has_adm_advisor = yes 
					has_dip_advisor = yes 
					has_mil_advisor = yes 
					crown_land_share = 40
				}
			}
		}
		
		effect = {
			custom_tooltip = mng_bow_to_eunuchs_tt
			tooltip = {
				add_country_modifier = { 
					name = mng_increased_eunuch_influence_modifier
					duration = 18250
				}
			}
			custom_tooltip = pol_alternatively_tt
			tooltip = { 
				if = {
					limit = { 
						has_dlc = "Mandate of Heaven" 
						is_emperor_of_china = yes 
					} 
					custom_tooltip = mng_palace_bureaucracy_benefits_tt
				}
				else = { 
					change_estate_land_share = {
						estate = all 
						share = -10
					}
					add_stability_or_adm_power = yes 
				}
			}
			hidden_effect = {
				if = {
					limit = { 
						has_country_flag = mng_kept_restrictions_flag
						has_adm_advisor = yes 
						has_dip_advisor = yes 
						has_mil_advisor = yes 
						crown_land_share = 40
						has_dlc = "Mandate of Heaven" 
						is_emperor_of_china = yes 
					}
					clr_country_flag = mng_kept_restrictions_flag 
					set_country_flag = mng_expanded_palace_bureaucracy_flag 
				}
				else_if = {
					limit = { 
						has_country_flag = mng_kept_restrictions_flag
						has_adm_advisor = yes 
						has_dip_advisor = yes 
						has_mil_advisor = yes 
						crown_land_share = 40
					}
					change_estate_land_share = {
						estate = all 
						share = -10
					}
					add_stability_or_adm_power = yes 
				}
				else = {
					add_country_modifier = { 
						name = mng_increased_eunuch_influence_modifier
						duration = 18250
					}
				}
			}
		}
	}
	
	mng_censorate = {
		icon = mission_censorate 
		required_missions = { mng_cornerstone_empire }
		position = 7
		
		trigger = {
			NOT = { corruption = 1 } 
			has_adm_advisor_3 = yes 
			has_dip_advisor_3 = yes 
			has_mil_advisor_3 = yes 
			stability = 3 
			NOT = { average_unrest = -5 } 
			num_of_owned_provinces_with = { 
				has_courthouse_building_trigger = yes 
				value = 15 
			}
		}
		
		effect = {
			country_event = { id = flavor_mng.28 }
			custom_tooltip = mng_insight_28_tt
		}
	}
	
	mng_promote_grand_coordinators = {
		icon = mission_kowtow
		required_missions = { mng_censorate }
		position = 8 
		
		trigger = { 
			if = { 
				limit = { is_emperor_of_china = yes } 
				meritocracy = 90 
			}
			else = { legitimacy_equivalent = 90 } 
			if = {
				limit = { is_emperor_of_china = yes } 
				OR = {
					empire_of_china_has_active_decree = issue_the_great_warnings_decree
					AND = {
						monthly_adm = 10 
						estate_loyalty = {
							estate = estate_eunuchs
							loyalty = 60 
						}
						estate_influence = {
							estate = estate_eunuchs 
							influence = 60 
						}
					}
				}
			}
		}
		
		effect = {
			custom_tooltip = mng_enable_3_grand_coordinators_offices_tt
			set_country_flag = mng_enable_3_grand_coordinators_offices_flag 
		}
	}
}

ming_missions_1_c = {
	slot = 1
	generic = no
	ai = yes
	potential = {
		has_dlc = "Domination"
		is_emperor_of_china = yes 
		tag = MNG
	}
	has_country_shield = yes 
	
	mng_crisis_ming_dynasty = {
		icon = mission_crisis_ming_dynasty
		required_missions = { mng_promote_grand_coordinators }
		position = 9 
		
		trigger = {
			OR = {
				custom_trigger_tooltip = {
					tooltip = mng_has_had_crisis_disaster_tt
					has_country_flag = ming_crisis_happened
				}
				AND = {
					NOT = { current_age = age_of_discovery }
					NOT = { current_age = age_of_reformation }
					imperial_mandate = 95 
				}
			}
			OR = {
				AND = { 
					empire_of_china_num_reforms_passed = 6 
					absolutism = 50 
				}
				if = {
					limit = { has_dlc = "Mandate of Heaven" }
					AND = {
						crown_land_share = 95
						imperial_mandate = 90  
						meritocracy = 90 
						stability = 3 
					}
				}
				else = {
					AND = {
						crown_land_share = 95 
						legitimacy_equivalent = 90
						stability = 3 
					}
				}
			}
		}
		
		effect = {
			country_event = { id = flavor_mng.29 }
			custom_tooltip = mng_insight_29_tt
		}
	}
}

DOM_Qing_Missions_1_b_formable = { 
	slot = 1
	generic = no
	ai = yes
	#potential_on_load = { has_dlc = "Mandate of Heaven" }
	potential = {
		has_dlc = "Domination"
		tag = QNG
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes
	
	qng_north_china = { 
		icon = jap_conquer_north_china
		required_missions = { }
		position = 10
		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 = 35 
			}
		}
		effect = {
			custom_tooltip = qng_north_china_gets_tt
			tooltip = {
				add_local_autonomy = -10 
				add_devastation = -10 
			}
			if = { 
				limit = { is_emperor_of_china = yes } 
				add_mandate = 20 
			}
			else = { add_legitimacy = 25 }
			hidden_effect = {
				north_china_region = {
					limit = { country_or_non_sovereign_subject_holds = ROOT } 
					add_local_autonomy = -10 
					add_devastation = -10 
				}
			}
			
			if = {
				limit = { stability = 3 } 
				change_estate_land_share = {
					estate = all 
					share = -5
				}
			}
			else = { custom_tooltip = qng_complete_3_stab_5_crownland_tt }
		}
	}
	
	qng_green_standard_army = {
		icon = mission_asian_cannon
		required_missions = { qng_north_china qng_incorporate_han }
		position = 11
		trigger = {
			if = { 
				limit = { has_dlc = "Cradle of Civilization" } 
				OR = { 
					army_professionalism = 0.5 
					army_tradition = 80 
				}
			}
			else = { army_tradition = 80 } 
			army_size = 150 
			
		}
		effect = {
			country_event = { id = mch_missions.3 }
		}
	}
	
	qng_modernize_the_banners = {
		icon = qng_modernize_the_banners
		required_missions = { qng_green_standard_army }
		position = 12
		trigger = {
			if = {
				limit = { has_dlc = "Mandate of Heaven" } 
				num_of_banners = 32 
			}
			else = { num_of_cavalry = 50 } 
			empire_of_china_reform_passed = modernize_the_banners_decision
			OR = {
				national_focus = MIL 
				army_reformer = 3 
			}
			has_completed_idea_group_of_category = { mil_ideas = yes }
			reform_level = 7 
			mission_completed = qng_eight_banners 
		}
		effect = {
			if = { 
				limit = { has_dlc = "Mandate of Heaven" } 
				add_country_modifier = {
					name = qng_new_banners_modifier
					duration = -1 
				}
			}
			else = {
				add_country_modifier = {
					name = qng_new_banners2_modifier
					duration = -1 
				}
			}
			add_mil_power = 100 
		}
	}
	
	qng_annex_tibet = {
		icon = mission_buddhist_monk_praying
		required_missions = { qng_ten_grand_campaigns }
		provinces_to_highlight = {
			region = tibet_region
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		position = 14
		trigger = {
			tibet_region = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT 
			}
		}
		effect = {
			add_army_tradition = 20
			4520 = { 
				add_province_modifier = {
					name = qng_gate_to_the_east_modifier
					duration = -1 
				}
				add_base_manpower = 3
			}
			if = { 
				limit = { is_emperor_of_china = yes } 
				add_mandate = 20
			}
			else = { add_stability_or_adm_power = yes }
		}
	}
}	

ming_missions_2 = {
	slot = 2
	generic = no
	ai = yes
	potential = {
		# culture_group = east_asian
		# NOT = { primary_culture = manchu_new }
		# NOT = { primary_culture = tibetan_new }
		# NOT = { primary_culture = altaic_new }
		# NOT = { primary_culture = vietnamese_new }
		# NOT = { primary_culture = korean_new }
		has_dlc = "Domination"
		NOT = { map_setup = map_setup_random }
		tag = MNG
	}
	has_country_shield = yes 	
	
	mng_expand_great_wall = {
		icon = mission_expand_great_wall
		required_missions = { } 
		provinces_to_highlight = { 
			OR = {
				province_id = 697
				province_id = 708
				province_id = 698
			}
			OR = {
				NOT = { num_of_times_expanded_infrastructure = 1 }
				NOT = { num_of_times_improved = 3 }
				has_fort_building_trigger = no
			}
		}
		
		trigger = {
			if = {
				limit = { has_dlc = "Leviathan" }
				OR = {
					698 = {
						OR = {
							has_great_project = {
								type = the_great_wall_of_china
								tier = 2 
							}
							has_great_project = {
								type = the_great_wall_of_china
								tier = 3
							}
						}
					}
					AND = {
						698 = { 
							has_fort_building_trigger = yes 
							OR = {
								num_of_times_improved = 3
								num_of_times_expanded_infrastructure = 1 
							}
						}
						708 = { 
							has_fort_building_trigger = yes 
							OR = {
								num_of_times_improved = 3
								num_of_times_expanded_infrastructure = 1 
							}
						}
						697 = { 
							has_fort_building_trigger = yes 
							OR = {
								num_of_times_improved = 3
								num_of_times_expanded_infrastructure = 1 
							}
						}
					}
				}
			}
			else = {
				AND = {
					698 = { 
						has_fort_building_trigger = yes 
						OR = {
							num_of_times_improved = 3
							num_of_times_expanded_infrastructure = 1 
						}
					}
					708 = { 
						has_fort_building_trigger = yes 
						OR = {
							num_of_times_improved = 3
							num_of_times_expanded_infrastructure = 1 
						}
					}
					697 = { 
						has_fort_building_trigger = yes 
						OR = {
							num_of_times_improved = 3
							num_of_times_expanded_infrastructure = 1 
						}
					}
				}
			}
		}
		
		effect = {
			custom_tooltip = mng_less_than_3_with_leviathan_tt
			tooltip = {
				698 = { 
					add_great_project_tier = {
						type = the_great_wall_of_china 
						tier = 1 
					}
					add_building = ramparts 
				}
				add_army_tradition = 15
			}
			custom_tooltip = pol_alternatively_great_wall_expansion_tt
			tooltip = {
				add_province_modifier = {
					name = mng_great_wall_china_expanded_modifier
					duration = -1 
					desc = until_it_is_conquered_desc
				}
			}
			hidden_effect = {
				if = {
					limit = { 
						has_dlc = "Leviathan" 
						698 = { 
							NOT = { 
								has_great_project = {
									type = the_great_wall_of_china 
									tier = 3 
								}
							}
						}
					}
					698 = {
						add_great_project_tier = {
							type = the_great_wall_of_china 
							tier = 1 
						}
						if = {
							limit = { 
								NOT = { has_building = ramparts } 
							}
							add_building = ramparts 
						}
					}
					add_army_tradition = 15
				}
				else = {
					698 = {
						if = { 
							limit = { country_or_non_sovereign_subject_holds = ROOT }
							add_province_modifier = {
								name = mng_great_wall_china_expanded_modifier
								duration = -1 
								desc = until_it_is_conquered_desc
							}
						}
					}
					4223 = {
						if = { 
							limit = { country_or_non_sovereign_subject_holds = ROOT }
							add_province_modifier = {
								name = mng_great_wall_china_expanded_modifier
								duration = -1 
								desc = until_it_is_conquered_desc
							}
						}
					}
					702 = {
						if = { 
							limit = { country_or_non_sovereign_subject_holds = ROOT }
							add_province_modifier = {
								name = mng_great_wall_china_expanded_modifier
								duration = -1 
								desc = until_it_is_conquered_desc
							}
						}
					}
					697 = {
						if = { 
							limit = { country_or_non_sovereign_subject_holds = ROOT }
							add_province_modifier = {
								name = mng_great_wall_china_expanded_modifier
								duration = -1 
								desc = until_it_is_conquered_desc
							}
						}
					}
					2136 = {
						if = { 
							limit = { country_or_non_sovereign_subject_holds = ROOT }
							add_province_modifier = {
								name = mng_great_wall_china_expanded_modifier
								duration = -1 
								desc = until_it_is_conquered_desc
							}
						}
					}
					1816 = {
						if = { 
							limit = { country_or_non_sovereign_subject_holds = ROOT }
							add_province_modifier = {
								name = mng_great_wall_china_expanded_modifier
								duration = -1 
								desc = until_it_is_conquered_desc
							}
						}
					}
				}
			}
		}
	}
	
	mng_sail_east = {
		icon = mission_look_west
		required_missions = { mng_inward_perfection } 
		position = 4
		trigger = {
			OR = {
				AND = {
					exploration_ideas = 1 
					dip_tech = 7 
					num_of_light_ship = 25
				}
				AND = {
					has_idea_group = trade_ideas 
					OR = {
                        north_america = { has_discovered = ROOT }
                        south_america = { has_discovered = ROOT }
                        new_world = { has_discovered = ROOT }
                    } 
				}
			}
		}
		
		effect = {
			custom_tooltip = mng_explo_ideas_tt
			tooltip = {
				add_country_modifier = {
					name = mng_imperial_explorers_corps_of_the_ming_dynasty_modifier
					duration = 7300 
				}
			}
			
			custom_tooltip = mng_trade_ideas_tt
			tooltip = {
				add_country_modifier = {
					name = mng_social_and_mercantile_exchanges_with_the_new_world_modifier
					duration = 9125 
				}
			}
			
			if = { 
				limit = { has_dlc = "Rule Britannia" }
				custom_tooltip = mng_circumnavigate_bonus_tt
			}
			hidden_effect = {
				if = {
					limit = {
						exploration_ideas = 1 
						dip_tech = 7 
						num_of_light_ship = 25
					}
					add_country_modifier = {
						name = mng_imperial_explorers_corps_of_the_ming_dynasty_modifier
						duration = 7300 
					}
				}
				if = {
					limit = {
						trade_ideas = 1 
						OR = {
							north_america = { has_discovered = ROOT }
							south_america = { has_discovered = ROOT }
							new_world = { has_discovered = ROOT }
						} 
					}
					add_country_modifier = {
						name = mng_social_and_mercantile_exchanges_with_the_new_world_modifier
						duration = 9125 
					}
				}
				if = { 
					limit = { has_dlc = "Rule Britannia" }
					change_innovativeness = 5 
				}
			}
		}
	}
}

DOM_Qing_Missions_2 = { 
	slot = 2
	generic = no
	ai = yes
	#potential_on_load = { has_dlc = "Mandate of Heaven" }
	potential = {
		has_dlc = "Domination"
		OR = {
			tag = MJZ
			tag = MCH
			tag = QNG
			#tag = KRC
			tag = MYR
			tag = EJZ
			tag = NHX
			tag = MHX
		}
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes
	
	mjz_unite_home_provinces = { 
		icon = mission_unite_home_region
		required_missions = { }
		position = 1
		provinces_to_highlight = {
			OR = { 
				area = jilin_area 
				area = ningguta_area
				area = furdan_area 
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT } 
		}
		trigger = {
			ningguta_area = { 
				type = all 
				country_or_non_sovereign_subject_holds = ROOT 
			}
			jilin_area = { 
				type = all 
				country_or_non_sovereign_subject_holds = ROOT 
			}
			furdan_area = { 
				type = all 
				country_or_non_sovereign_subject_holds = ROOT 
			}
		}
		effect = {
			manchuria_region = { 
				limit = { 
					NOT = { is_core = ROOT } 
					NOT = { country_or_non_sovereign_subject_holds = ROOT } 
				}
				add_permanent_claim = ROOT 
			}
			if = { 
				limit = { mil_tech = 23 } 
				custom_tooltip = mjz_receive_8_advanced_cav_units_tt 
				hidden_effect = { 
					capital_scope = { 
						steppe_uhlans = ROOT 
						steppe_uhlans = ROOT 
						steppe_uhlans = ROOT 
						steppe_uhlans = ROOT 
						steppe_uhlans = ROOT 
						steppe_uhlans = ROOT 
						steppe_uhlans = ROOT 
						steppe_uhlans = ROOT 
					}
				}
			}
			else_if = {
				limit = { mil_tech = 18 }
				custom_tooltip = mjz_receive_8_advanced_cav_units_tt 
				hidden_effect = { 
					capital_scope = { 
						steppe_cavalry = ROOT 
						steppe_cavalry = ROOT 
						steppe_cavalry = ROOT 
						steppe_cavalry = ROOT 
						steppe_cavalry = ROOT 
						steppe_cavalry = ROOT 
						steppe_cavalry = ROOT 
						steppe_cavalry = ROOT 
					}
				}
			}
			else_if = {
				limit = { mil_tech = 14 }
				custom_tooltip = mjz_receive_8_advanced_cav_units_tt 
				hidden_effect = { 
					capital_scope = { 
						steppe_raiders = ROOT 
						steppe_raiders = ROOT 
						steppe_raiders = ROOT 
						steppe_raiders = ROOT 
						steppe_raiders = ROOT 
						steppe_raiders = ROOT 
						steppe_raiders = ROOT 
						steppe_raiders = ROOT 
					}
				}
			}
			else_if = {
				limit = { mil_tech = 10 }
				custom_tooltip = mjz_receive_4_advanced_cav_units_tt 
				hidden_effect = { 
					capital_scope = { 
						steppe_lancers = ROOT 
						steppe_lancers = ROOT 
						steppe_lancers = ROOT 
						steppe_lancers = ROOT
					}
				}
			}
			else = {
				custom_tooltip = mjz_receive_2_advanced_cav_units_tt 
				hidden_effect = { 
					capital_scope = { 
						steppe_riders = ROOT 
						steppe_riders = ROOT 
					}
				}
			}
			if = { 
				limit = { has_country_modifier = mjz_dominance_of_the_horselords_modifier } 
				custom_tooltip = mjz_extend_dominance_modifier_tt
				hidden_effect = {
					remove_country_modifier = mjz_dominance_of_the_horselords_modifier
					add_country_modifier = {
						name = mjz_dominance_of_the_horselords_modifier 
						duration = 3650 
					}
				}
			}
		}
	}
	
	mjz_dominate_rival_jurchens = {
		icon = mission_manchu_warrior
		required_missions = { mjz_unite_home_provinces mjz_unite_jurchen_tribes }
		position = 2
		provinces_to_highlight = {
			region = manchuria_region 
			NOT = { country_or_non_sovereign_subject_holds = ROOT } 
		}
		trigger = { 
			tag = MCH 
			army_size = 25 
			OR = { 
				power_projection = 50 
				grown_by_development = 150 
			}
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				region = manchuria_region 
				value = 20 
			}
		}
		
		effect = { 
			country_event = { id = flavor_mch.9 } 
			custom_tooltip = mch_event_insight_9_tt 
			if = { 
				limit = { has_country_modifier = mjz_dominance_of_the_horselords_modifier } 
				custom_tooltip = mjz_extend_dominance_modifier_tt
				hidden_effect = {
					remove_country_modifier = mjz_dominance_of_the_horselords_modifier
					add_country_modifier = {
						name = mjz_dominance_of_the_horselords_modifier 
						duration = 3650 
					}
				}
			}
		}
	}
	
	mch_issue_seven_grievances = {
		icon = mission_non-western_cavalry_raid
		required_missions = { mjz_dominate_rival_jurchens }
		position = 3
		provinces_to_highlight = {
			is_capital = yes 
			owner = { is_emperor_of_china = yes } 
		}
		trigger = {
			if = { 
				limit = { 
					any_country = {
						is_emperor_of_china = yes 
						NOT = { tag = ROOT } 
					}
				}
				any_country = { 
					is_emperor_of_china = yes 
					OR = { 
						has_opinion_modifier = {
							who = ROOT  
							modifier = insulted
						}
						has_opinion_modifier = {
							who = ROOT  
							modifier = scornfully_insulted
						}
						NOT = { army_size = ROOT } 
						NOT = { prestige = ROOT } 
						has_any_disaster = yes 
						NOT = { imperial_mandate = 50 }
					}
				}
			}
			total_development = 300
			manpower_percentage = 0.75
		}
		
		effect = { 
			country_event = { id = flavor_mch.10 }
			custom_tooltip = mch_event_insight_10_tt
			if = { 
				limit = { has_country_modifier = mjz_dominance_of_the_horselords_modifier } 
				custom_tooltip = mjz_extend_dominance_modifier_tt
				hidden_effect = {
					remove_country_modifier = mjz_dominance_of_the_horselords_modifier
					add_country_modifier = {
						name = mjz_dominance_of_the_horselords_modifier 
						duration = 3650 
					}
				}
			}
		}
	}
	
	mch_proclaim_later_jin = {
		icon = mch_proclaim_later_jin
		required_missions = { mch_issue_seven_grievances }
		position = 4
		provinces_to_highlight = {
			region = manchuria_region 
			NOT = { country_or_non_sovereign_subject_holds = ROOT } 
		}
		trigger = {
			custom_trigger_tooltip = {
				tooltip = mch_manchuria_region_minus_2_provinces_tt
				manchuria_region = {  
					type = all 
					OR = {
						country_or_non_sovereign_subject_holds = ROOT 
						province_id = 1033
						province_id = 4658
					}
				}
			}
			mission_completed = mch_bypass_great_wall
		}
		effect = { 
			if = {
				limit = { 
					NOT = { tag = QNG } 
				}
				override_country_name = LJN 
				set_country_flag = is_LJN_flag
			}
			add_prestige_or_monarch_power = { amount = 25 } 
			if = { 
				limit = { 
					has_dlc = "Mandate of Heaven" 
					is_emperor_of_china = yes 
				}
				add_mandate = 20
				add_country_modifier = { 
					name = qng_new_heavenly_era_modifier
					duration = 7300 
				}
			}
			else = { 
				if = {
					limit = { 
						NOT = { has_country_flag = has_had_nurhaci_reforms_event_flag } 
					}
					country_event = { id = flavor_mch.1 } 
					custom_tooltip = mch_event_insight_1_tt 
				}
			}
			if = { 
				limit = { national_focus = ADM } 
				add_adm_power = 100 
			}
			else_if = { 
				limit = { national_focus = DIP } 
				add_dip_power = 100 
			}
			else = { add_mil_power = 100 } 
			if = { 
				limit = { has_country_modifier = mjz_dominance_of_the_horselords_modifier } 
				custom_tooltip = mjz_extend_dominance_modifier_tt
				hidden_effect = {
					remove_country_modifier = mjz_dominance_of_the_horselords_modifier
					add_country_modifier = {
						name = mjz_dominance_of_the_horselords_modifier 
						duration = 3650 
					}
				}
			}
		}
	}			
}

chinese_kingdoms_2 = {
	slot = 2
	generic = no
	ai = yes
	potential = {
		has_dlc = "Domination"
		OR = {
			tag = YAN
			tag = JIN
			tag = QIN
			tag = QIC
			tag = CSH
			tag = LNG
			tag = TNG
			tag = CXI
			tag = CHC
			tag = WUU
			tag = NNG
			tag = MIN
			tag = HUA
			tag = YUE
			tag = CMI
			tag = CYI
			tag = CDL
			tag = CGS
			tag = FRM
			
			#New changed in MMETR
			AND = {
				tag = SHU
				started_in = 280.1.1
			}
		}
		started_in = 1368.1.1		#New added in MMETR mod, to exclude new Ancient/Medieval Chinese Warlord missions
		NOT = { map_setup = map_setup_random }
	}
	
	conquer_xinan = {
		icon = mission_unite_home_region 
		required_missions = { chi_independence } 
		position = 2 
		provinces_to_highlight = {
			region = xinan_region 
			NOT = { country_or_non_sovereign_subject_holds = ROOT } 
		}
		trigger = {
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				region = xinan_region 
				value = 15 
			}
			679 = { country_or_non_sovereign_subject_holds = ROOT } 
		}
		effect = {
			if = {
				limit = { has_dlc = "Leviathan" }
				679 = {
					add_great_project_tier = {
						type = dujiangyan
						tier = 1 
					}
				}
			}
			else = { 
				679 = { add_base_tax = 2 add_base_production = 2 add_base_manpower = 2 } 
			}
			tibet_region = {
				limit = { 
					NOT = { is_core = ROOT } 
					NOT = { owned_by = ROOT } 
				}
				add_permanent_claim = ROOT 
			}
			burma_region = {
				limit = { 
					NOT = { is_core = ROOT } 
					NOT = { owned_by = ROOT } 
				}
				add_permanent_claim = ROOT 
			}
		}
	}
	
	tributaries_or_conquest = {
		icon = mission_war_chest 
		required_missions = { fate_of_the_mandate chi_unify_china } 
		position = 4 
		trigger = {
			OR = { 
				if = {
					limit = { has_dlc = "Mandate of Heaven" }
					calc_true_if = {
						all_subject_country = {
							OR = { 
								is_subject_of_type = tributary_state 
								is_subject_of_type = march 
								is_subject_of_type = vassal 
							}
						}
						amount = 8 
					}
				}
				else = {
					calc_true_if = {
						all_subject_country = {
							OR = {
								is_subject_of_type = march 
								is_subject_of_type = vassal 
							}
						}
						amount = 4 
					}
				}
				grown_by_development = 1250
			}
		}
		effect = {
			if = { 
				limit = { 
					has_dlc = "Mandate of Heaven" 
					is_emperor_of_china = yes
				}
				custom_tooltip = chi_subject_reward_tt
			}
			else = { custom_tooltip = chi_mana_per_subject_tt }
			tooltip = { 
				add_country_modifier = {
					name = chi_new_emperor_modifier
					duration = -1 
				}
			}
			
			custom_tooltip = chi_outwards_expansion_reward_tt
			tooltip = {
				add_country_modifier = {
					name = chi_absolutist_rule_china_modifier
					duration = -1 
				}
			}
			
			hidden_effect = {
				if = {
					limit = { has_dlc = "Mandate of Heaven" num_of_subjects = 8 }
					if = {
						limit = { is_emperor_of_china = yes }
						every_subject_country = { 
							overlord = { add_mandate = 10 } 
						}
					}
					else = {
						every_subject_country = { 
							limit = { is_subject_of = ROOT } 
							overlord = { add_adm_power = 25 add_dip_power = 25 add_mil_power = 25 } 
						}
					}
					add_country_modifier = {
						name = chi_new_emperor_modifier
						duration = -1 
					}
				}
				else_if = {
					limit = { 
						NOT = { has_dlc = "Mandate of Heaven" } 
						num_of_subjects = 4 
					}
					if = {
						limit = { is_emperor_of_china = yes }
						every_subject_country = { 
							overlord = { add_mandate = 10 } 
						}
					}
					else = {
						every_subject_country = { 
							limit = { is_subject_of = ROOT } 
							overlord = { add_adm_power = 25 add_dip_power = 25 add_mil_power = 25 } 
						}
					}
					add_country_modifier = {
						name = chi_new_emperor_modifier
						duration = -1 
					}
				}
				else = {
					add_country_modifier = {
						name = chi_absolutist_rule_china_modifier
						duration = -1 
					}
				}
			}
		}
	}
}

ming_missions_2_b = {
	slot = 2
	generic = no
	ai = yes
	potential = {
		has_dlc = "Domination"
		is_emperor_of_china = yes 
		OR = { 
			tag = QNG 
			culture_group = east_asian
			has_country_flag = enable_emperor_of_china_missions_flag
		}
		capital_scope = { continent = asia }
		
		started_in = 1368.1.1		#New added in MMETR mod, to exclude new Ancient/Medieval Chinese Warlord missions
		NOT = { tag = HND }		#New added in MMETR mod
		NOT = { tag = SNG }		#New added in MMETR mod
		if = {
			limit = {	
				tag = SHU
			}
			started_in = 280.1.1
		}
		if = {
			limit = {	
				tag = WEI
			}
			started_in = 280.1.1
		}
	}
	has_country_shield = yes 
	
	mng_reform_civil_registration = {
		icon = mission_plc_governance_act 
		required_missions = { } 
		position = 5
		
		trigger = {
			if = {
				limit = {
					is_emperor_of_china = yes 
					has_dlc = "Mandate of Heaven" 
				}
				OR = { 
					empire_of_china_reform_passed = reform_civil_registration_decision
					imperial_mandate = 85 
				}
			}
			OR = {
				absolutism = 50
				custom_trigger_tooltip = {
					tooltip = mng_all_available_estates_granted_land_rights_tt
					if = {
						limit = { has_estate = estate_eunuchs } 
						has_estate_privilege = estate_eunuchs_land_rights_privilege
					}
					if = {
						limit = { has_estate = estate_burghers } 
						has_estate_privilege = estate_burghers_land_rights 
					}
					if = {
						limit = { has_estate = estate_nobles } 
						has_estate_privilege = estate_nobles_land_rights 
					}
					if = {
						limit = { has_estate = estate_church } 
						has_estate_privilege = estate_church_land_rights 
					}
					if = {
						limit = { has_estate = estate_nomadic_tribes } 
						has_estate_privilege = estate_nomadic_tribes_land_rights
					}
				}
				AND = {
					empire_of_china_has_active_decree = conduct_census_decree
					if = {
						limit = { has_estate = estate_eunuchs } 
						estate_loyalty = {
							estate = estate_eunuchs
							loyalty = 60 
						}
					}
					if = {
						limit = { has_estate = estate_burghers } 
						estate_loyalty = {
							estate = estate_burghers
							loyalty = 60 
						}
					}
					if = {
						limit = { has_estate = estate_nobles } 
						estate_loyalty = {
							estate = estate_nobles
							loyalty = 60 
						}
					}
					if = {
						limit = { has_estate = estate_church } 
						estate_loyalty = {
							estate = estate_church
							loyalty = 60 
						}
					}
					if = {
						limit = { has_estate = estate_nomadic_tribes } 
						estate_loyalty = {
							estate = estate_nomadic_tribes
							loyalty = 60 
						}
					}
					government_reform_progress = 150 
				}
			}
		}
		
		effect = {
			custom_tooltip = mng_estates_govcap_now_grants_another_50_gov_cap_tt
			tooltip = {
				add_ruler_modifier = {
					name = mng_cabinet_cooperation_modifier
					duration = -1 
				}
			}
			
			custom_tooltip = mng_alternatively_pop_census_improved
			tooltip = {
				if = {
					limit = { 
						has_dlc = "Rights of Man" 
						NOT = { num_of_ruler_traits = { amount = 3 } }
					}
					change_government_reform_progress = -150 
					add_ruler_personality = reformist_personality
				}
				else = { change_government_reform_progress = -100 }
			}
			
			hidden_effect = {
				if = {
					limit = {
						has_estate_privilege = estate_burghers_land_rights
						has_estate_privilege = estate_eunuchs_land_rights_privilege
						has_estate_privilege = estate_church_land_rights
						has_estate_privilege = estate_nobles_land_rights 
					}
					set_country_flag = mng_increased_land_rights_flag 
					add_ruler_modifier = {
						name = mng_cabinet_cooperation_modifier
						duration = -1 
					}
				}
				else_if = {
					limit = { 
						has_dlc = "Rights of Man" 
						has_dlc = "Mandate of Heaven" 
						NOT = { num_of_ruler_traits = { amount = 3 } }
					}
					change_government_reform_progress = -150 
					add_ruler_personality = reformist_personality
					set_country_flag = mng_empowered_pop_census_flag 
				}
				else = { 
					change_adm = 1 
					change_government_reform_progress = -100 
					set_country_flag = mng_empowered_pop_census_flag 
				}
			}
		}
	}
	
	mng_examination_system = {
		icon = mission_vedic_education 
		required_missions = { mng_cornerstone_empire mng_reform_civil_registration }
		position = 6 
		
		trigger = {
			OR = {
				has_reform = examination_system_reform
				AND = {
					government_reform_progress = 250 
					reform_level = 3 
					NOT = { has_reform = examination_system_reform }
				}
			}
			crown_land_share = 45 
			stability = 3 
			700 = { owned_by = ROOT }
		}
		
		effect = {
			custom_tooltip = mng_exam_system_reward_tt
			tooltip = { 
				country_event = { id = flavor_mng.30 } 
			}
			custom_tooltip = mng_insight_30_tt
			
			custom_tooltip = mng_cmb_reward_tt #Reduce Malus of the starting negative modifier by -10% 
			
			if = {
				limit = {
					NOT = { has_harmonized_with = pagan }
					NOT = { has_harmonized_with = vajrayana }
					religion = confucianism
				}
				custom_tooltip = mng_db_reward_1_tt
				tooltip = {
					add_harmonized_religion = pagan
					add_harmonized_religion = vajrayana
					add_harmony = 10
				}
			}
			else = {
				custom_tooltip = mng_db_reward_1_tt
				tooltip = {
					add_country_modifier = {
						name = mng_decentralized_migration_modifier
						duration = -1 
					}
				}
			}
			
			custom_tooltip = mng_erc_reward_tt #20 mana per Eunuch privilege 
			
			custom_tooltip = mng_rf_reward_tt 
			
			custom_tooltip = mng_rc_reward_tt
			
			custom_tooltip = mng_rotc_reward_tt
			tooltip = {
				if = {
					limit = { 
						has_dlc = "Rights of Man" 
						NOT = { num_of_ruler_traits = { amount = 3 } }
						NOT = { dip = 6 } 
					}
					change_dip = 1
					add_ruler_personality = silver_tongue_personality
				}
				else_if = { 
					limit = { 
						NOT = { dip = 5 } 
					}
					change_dip = 1
					add_dip_power = 100 
				} 
				else = { add_dip_power = 200 }
			}
			
			custom_tooltip = mng_cc_reward_tt
			tooltip = { 
				create_explorer = { tradition = 80 } 
				add_country_modifier = { 
					name = mng_colonial_focus
					duration = 7300 
				}
			}
			hidden_effect = {
				if = {	
					limit = { has_reform = examination_system_reform }
					country_event = { id = flavor_mng.30 }
				}
				else = { change_government_reform_progress = -250 }
				
				if = {
					limit = { 
						has_country_modifier = mng_starting_malus_5_modifier 
						OR = {
							has_reform = centralize_empire_reform
							has_reform = centralize_reform 
						}
					}
					remove_country_modifier = mng_starting_malus_5_modifier 
					add_country_modifier = {
						name = mng_starting_malus_4_modifier
						duration = -1 
					}
				}
				else_if = {
					limit = { 
						has_country_modifier = mng_starting_malus_4_modifier 
						OR = {
							has_reform = centralize_empire_reform
							has_reform = centralize_reform 
						}
					}
					remove_country_modifier = mng_starting_malus_4_modifier
					add_country_modifier = {
						name = mng_starting_malus_3_modifier
						duration = -1 
					}
				}
				else_if = {
					limit = { 
						has_country_modifier = mng_starting_malus_3_modifier 
						OR = {
							has_reform = centralize_empire_reform
							has_reform = centralize_reform 
						}
					}
					remove_country_modifier = mng_starting_malus_3_modifier
					add_country_modifier = {
						name = mng_starting_malus_2_modifier
						duration = -1 
					}
				}
				else_if = {
					limit = { 
						has_country_modifier = mng_starting_malus_2_modifier 
						OR = {
							has_reform = centralize_empire_reform
							has_reform = centralize_reform 
						}
					}
					remove_country_modifier = mng_starting_malus_1_modifier
					add_country_modifier = {
						name = mng_starting_malus_2_modifier
						duration = -1 
					}
				}
				else_if = {
					limit = { 
						has_country_modifier = mng_starting_malus_1_modifier 
						OR = {
							has_reform = centralize_empire_reform
							has_reform = centralize_reform 
						}
					}
					remove_country_modifier = mng_starting_malus_1_modifier
				}
				else_if = {
					limit = { 
						is_emperor_of_china = yes 
						OR = {
							has_reform = centralize_empire_reform
							has_reform = centralize_reform 
						}
					} 
					add_mandate = 5
				}
				else_if = {
					limit = { 
						is_emperor_of_china = no 
						OR = {
							has_reform = centralize_empire_reform
							has_reform = centralize_reform 
						}
					} 
					add_adm_power = 200 
				}
				
				if = {
					limit = {
						OR = {
							NOT = { has_harmonized_with = pagan }
							NOT = { has_harmonized_with = vajrayana }
						}
						religion = confucianism
						has_reform = decentralize_reform
					}
					add_harmonized_religion = pagan
					add_harmonized_religion = vajrayana
					add_harmony = 10 
					change_government_reform_progress = -250
				}
				else_if = {
					limit = { has_reform = decentralize_reform } 
					add_country_modifier = {
						name = mng_decentralized_migration_modifier
						duration = -1 
					}
				}
				if = {
					limit = { has_reform = expand_imperial_court_reform }
					add_country_modifier = {
						name = mng_expanded_eunuch_palatial_rights_modifier  
						duration = -1 
					}
					set_estate_privilege = estate_eunuchs_bookkeepers_privilege
					if = {
						limit = { 
							num_of_estate_privileges = {
								estate = estate_eunuchs 
								value = 6 
							}
						}
						add_adm_power = 120 
						add_dip_power = 120 
						add_mil_power = 120 
					}
					else_if = {
						limit = { 
							num_of_estate_privileges = {
								estate = estate_eunuchs 
								value = 5 
							}
						}
						add_adm_power = 100
						add_dip_power = 100 
						add_mil_power = 100
					}
					else_if = {
						limit = { 
							num_of_estate_privileges = {
								estate = estate_eunuchs 
								value = 4 
							}
						}
						add_adm_power = 80
						add_dip_power = 80 
						add_mil_power = 80
					}
					else_if = {
						limit = { 
							num_of_estate_privileges = {
								estate = estate_eunuchs 
								value = 3 
							}
						}
						add_adm_power = 60
						add_dip_power = 60 
						add_mil_power = 60
					}
					else_if = {
						limit = { 
							num_of_estate_privileges = {
								estate = estate_eunuchs 
								value = 2 
							}
						}
						add_adm_power = 40
						add_dip_power = 40 
						add_mil_power = 40
					}
					else = {
						add_adm_power = 20
						add_dip_power = 20 
						add_mil_power = 20
					}
				}
				if = {
					limit = { has_reform = limit_imperial_court_reform }
					define_advisor = {
						name = "Buwei Zhao" 
						type = natural_scientist
						cost_multiplier = 0.5 
						skill = 2
					}
					define_advisor = {
						name = "Yilong Ma" 
						type = trader
						cost_multiplier = 0.5 
						skill = 2
					}
					define_advisor = {
						name = "Chao Meng" 
						type = quartermaster
						cost_multiplier = 0.5 
						skill = 2
					}
				}
				if = {
					limit = { has_reform = regional_council_reform }
					every_owned_province = {
						limit = { has_courthouse_building_trigger = yes development = 15 } 
						add_building = town_hall
						add_base_tax = 1 
					}
				}
				if = {
					limit = { 
						has_reform = representation_of_the_crown_reform
						has_dlc = "Rights of Man" 
						NOT = { num_of_ruler_traits = { amount = 3 } }
						NOT = { dip = 6 } 
					}
					every_subject_country = {
						add_trust = {
							who = ROOT 
							value = 20
							mutual = yes 
						}
						add_liberty_desire = -25 
					}
					change_dip = 1
					add_ruler_personality = silver_tongue_personality
				}
				else_if = { 
					limit = { 
						has_reform = representation_of_the_crown_reform
						NOT = { dip = 5 } 
					}
					change_dip = 1
					add_dip_power = 100 
				} 
				else_if = { 
					limit = { has_reform = representation_of_the_crown_reform } 
					add_dip_power = 200 
				}
				
				if = {
					limit = { has_reform = penal_colonies_reform } 
					create_explorer = { tradition = 80 } 
					add_country_modifier = { 
						name = mng_colonial_focus
						duration = 7300 
					}
				}
			}
		}
	}
	
	mng_mutual_trade_system = {
		icon = mission_diplomatic_relation 
		required_missions = { mng_censorate mng_examination_system }
		position = 8
		
		trigger = {
			OR = {
				custom_trigger_tooltip = {
					tooltip = mng_5_tribs_with_opinion_and_lib_desire_tt
					calc_true_if = {
						all_subject_country = {
							is_subject_of_type_with_overlord = { who = ROOT type = tributary_state }
							NOT = { liberty_desire = 10 } 
							has_opinion = { 
								who = ROOT 
								value = 120 
							}
						}
						amount = 5
					}
				}
				calc_true_if = {
					all_ally = {
						has_opinion = {
							who = ROOT 
							value = 150 
						}
						trust = {
							who = ROOT 
							value = 70
						}
					}
					amount = 4 
				}
			}
			government_reform_progress = 150 
		}
		
		effect = { 
			custom_tooltip = mng_ally_reward_tt
			tooltip = {
				add_country_modifier = {
					name = mng_trade_access_in_china_modifier
					duration = -1 
					desc = as_long_as_we_stay_allies_desc
				}
			}
			
			if = { 
				limit = {
					has_dlc = "Mandate of Heaven" 
					is_emperor_of_china = yes 
				}
				custom_tooltip = mng_5_mandate_per_ally_tt
			}
			else = { custom_tooltip = mng_25_mp_per_ally_tt } 
			tooltip = {
				add_country_modifier = {
					name = mng_foreign_merchant_influx_modifier
					duration = 7300 
				}
			}
			
			custom_tooltip = mng_trib_reward_tt
			tooltip = { 
				country_event = { id = flavor_mng.31 }
			}
			custom_tooltip = mng_insight_31_tt
			hidden_effect = {
				if = {
					limit = { 
						calc_true_if = {
							all_ally = {
								has_opinion = {
									who = ROOT 
									value = 150 
								}
								trust = {
									who = ROOT 
									value = 70
								}
							}
							amount = 4 
						}
					}
					every_ally = { 
						limit = { 
							has_opinion = {
								who = ROOT 
								value = 150 
							}
							trust = {
								who = ROOT 
								value = 70
							}
						}
						add_country_modifier = {
							name = mng_trade_access_in_china_modifier
							duration = -1 
							desc = as_long_as_we_stay_allies_desc
						}
					}
					add_country_modifier = {
						name = mng_foreign_merchant_influx_modifier
						duration = 7300 
					}
					if = {
						limit = { has_dlc = "Mandate of Heaven" } 
						every_ally = { 
							limit = { 
								has_opinion = {
									who = ROOT 
									value = 150 
								}
								trust = {
									who = ROOT 
									value = 70
								}
							}
							ROOT = { add_mandate = 5 } 
						}
					}
					else = { 
						every_ally = { 
							limit = { 
								has_opinion = {
									who = ROOT 
									value = 150 
								}
								trust = {
									who = ROOT 
									value = 70
								}
							}
							ROOT = { 
								add_adm_power = 25 
								add_dip_power = 25 
								add_mil_power = 25 
							}
						}
					}
				}
				else = { 
					country_event = { id = flavor_mng.31 }
				}
			}
		}
	}
}

DOM_Qing_Missions_2_b = { 
	slot = 2
	generic = no
	ai = yes
	#potential_on_load = { has_dlc = "Mandate of Heaven" }
	potential = {
		has_dlc = "Domination"
		tag = QNG
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes
	
	qng_incorporate_han = {
		icon = mission_rice_field
		required_missions = { } 
		position = 10
		provinces_to_highlight = {
			owned_by = ROOT 
			local_autonomy_above_min = 10
		}
		trigger = {
			NOT = { average_autonomy_above_min = 10 } 
			NOT = { average_unrest = 1 } 
			if = {
				limit = { is_emperor_of_china = yes } 
				meritocracy = 85 
			}
			else = { prestige = 50 }
			stability = 3 
		}
		
		effect = { 
			add_country_modifier = {
				name = qng_han_cooperation_modifier
				duration = 9125 
			}
			if = {
				limit = { is_emperor_of_china = yes has_dlc = "Mandate of Heaven" }
				set_country_flag = qng_passing_decree_reduces_autonomy_everywhere_by_5_flag
				custom_tooltip = qng_passing_decree_reduces_autonomy_everywhere_by_5_tt
			}
		}
	}
	
	qng_extinguish_ming = {
		icon = mission_crisis_ming_dynasty
		required_missions = { qng_green_standard_army qng_conquer_south_china }
		position = 12 
		provinces_to_highlight = {
			owned_by = MNG
		}
		trigger ={
			NOT = { exists = MNG }
		}
		effect = {
			if = {
				limit = {
					has_dlc = "Mandate of Heaven"
					is_emperor_of_china = yes
				}
				add_mandate = 20
			}
			else = {
				add_legitimacy = 25
			}
			custom_tooltip = extinguish_ming_tt
			hidden_effect = {
				china_superregion = {
					limit = {
						NOT = { owned_by = ROOT }
						NOT = { is_core = ROOT }
					}
					add_core = ROOT
				}
			}
			change_ruler_stat = {
				stat = adm
				amount = 1
			}
			change_ruler_stat = {
				stat = dip
				amount = 1
			}
			change_ruler_stat = {
				stat = mil
				amount = 1
			}
		}
	}
	
	qng_ten_grand_campaigns = {
		icon = qng_ten_grand_campaigns
		required_missions = { qng_extinguish_ming }
		position = 13
		trigger = {
			army_size_percentage = 0.9
			manpower_percentage = 0.8
			if = {
				limit = {
					has_dlc = "Mandate of Heaven"
				}
				num_of_banners = 25
			}
		}
		effect = {
			add_country_modifier = {
				name = qng_ten_campaigns_planning_modifier
				duration = 7300 
			}
			tibet_region = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			taiwan_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			korea_region = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			mongolia_region = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			shanshan_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			kashgaria_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			tarim_basin_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			vietnam_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			red_river_delta_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
		}
	}
	
	qng_campaign_in_burma = {
		icon = mission_indian_soldier_elephant
		required_missions = { qng_ten_grand_campaigns }
		position = 14
		provinces_to_highlight = { 
			OR = {
				area = karenni_area
				area = shan_hill_area
				area = kachin_area
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			karenni_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT
			}
			shan_hill_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT
			}
			kachin_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT
			}
			lower_burma_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT
			}
		}
		effect = {
			add_mil_power = 200
			country_event = { id = flavor_mch.12 }
			custom_tooltip = qng_event_insight_12_tt
		}
	}
}

chinese_kingdoms_3 = {
	slot = 3
	generic = no
	ai = yes
	potential = {
		has_dlc = "Domination"
		OR = {
			tag = YAN
			tag = JIN
			tag = QIN
			tag = QIC
			tag = CSH
			tag = LNG
			tag = TNG
			tag = CXI
			tag = CHC
			tag = WUU
			tag = NNG
			tag = MIN
			tag = HUA
			tag = YUE
			tag = CMI
			tag = CYI
			tag = CDL
			tag = CGS
			tag = FRM
			
			#New changed in MMETR
			AND = {
				tag = SHU
				started_in = 280.1.1
			}
		}
		started_in = 1368.1.1		#New added in MMETR mod, to exclude new Ancient/Medieval Chinese Warlord missions
		NOT = { map_setup = map_setup_random }
	}
	
	chi_independence = {
		icon = mission_subdue_rajputana
		required_missions = { } 
		position = 1 
		trigger = {
			OR = { 
				has_reform = chinese_warlord
				AND = { 
					is_subject = yes 
					num_of_allies = 3 
				}
				is_subject = no 
			}
			if = {
				limit = { is_subject = yes } 
				overlord = { 
					OR = {
						has_opinion_modifier = {
							who = ROOT  
							modifier = insulted
						}
						has_opinion_modifier = {
							who = ROOT  
							modifier = scornfully_insulted
						}
					}
				}
			}
			army_size_percentage = 0.8 
		}
		effect = {
			add_manpower = 10
			create_general = { tradition = 75 } 
			custom_tooltip = chi_25_ws_against_overlord_or_more_tt
			tooltip = { add_mil_tech = 1 }
			
			custom_tooltip = pol_alternatively_tt
			tooltip = { 
				add_adm_power = 150 
				add_dip_power = 150 
				add_mil_power = 150 
			}
			hidden_effect = {
				if = {
					limit = { 
						is_in_war = {
							attackers = ROOT 
							casus_belli = cb_independence_war
							war_score = 25 
						}
					}
					add_mil_tech = 1 
				}
				else = {
					add_adm_power = 100 
					add_dip_power = 100 
					add_mil_power = 100 
				}
			}
		}
	}
	
	conquer_north_china = {
		icon = jap_conquer_north_china
		required_missions = { chi_independence } 
		position = 2
		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 = 25
			}
			1816 = { country_or_non_sovereign_subject_holds = ROOT } 
		}
		effect = {
			manchuria_region = {
				limit = { 
					NOT = { is_core = ROOT } 
					NOT = { owned_by = ROOT } 
				}
				add_permanent_claim = ROOT 
			}
			if = {
				limit = { is_emperor_of_china = ROOT } 
				add_mandate = 25 
			}
			else = {
				add_stability_or_adm_power = yes 
			}
			if = {
				limit = { has_dlc = "Leviathan" } 
				1816 = { 
					add_great_project_tier = {
						type = forbidden_city 
						tier = 1 
					}
				}
			}
			else = {
				1816 = {
					add_base_tax = 2 
					add_base_production = 2 
					add_base_manpower = 2
				}
			}
		}
	}
	
	chi_unify_china = {
		icon = mng_heavens_will
		required_missions = { conquer_xinan conquer_north_china conquer_south_china } 
		position = 3
		provinces_to_highlight = {
			superregion = china_superregion
			NOT = { country_or_non_sovereign_subject_holds = ROOT } 
		}
		trigger = { 
			china_superregion = {
				type = all 
				country_or_non_sovereign_subject_holds = ROOT
			}
			if = {
				limit = { has_dlc = "Mandate of Heaven" } 
				OR = { 
					in_golden_age = yes 
					monthly_income = 150 
					is_emperor_of_china = yes 
				}
			}
			else = { monthly_income = 150 }
			prestige = 80 
		}
		effect = {
			if = {
				limit = { is_emperor_of_china = yes } 
				add_country_modifier = {
					name = chi_rising_dynasty_modifier
					duration = -1
				}
			}
			else = {
				add_country_modifier = {
					name = chi_rising_dynasty_modifier2
					duration = -1 
				}
			}
			if = {
				limit = { in_golden_age = yes } 
				extend_golden_age = 120
			}
			else = {
				add_power_projection = { 
					type = 25_permanent_power_projection
					amount = 25 
				}
				custom_tooltip = chi_permanent_pp
			}
		}
	}
	
	chi_project_strength = {
		icon = mission_invade_the_deccan_ori
		required_missions = { chi_unify_china } 
		position = 4
		
		trigger = {
			OR = {
				crown_land_share = 95 
				absolutism = 50 
			}
			power_projection = 50 
			if = {
				limit = {
					OR = {
						has_dlc = "Emperor" 
						has_dlc = "Rights of Man"
					}
				}
				NOT = { great_power_rank = 2 } 
			}
			total_development = 1500 
		}
		effect = {
			add_country_modifier = {
				name = era_of_the_great_dragon_modifier
				duration = -1 
			}
		}
	}
}
	
ming_missions_3 = {
	slot = 3
	generic = no
	ai = yes
	potential = {
		tag = MNG
		has_dlc = "Domination"
	}
	has_country_shield = yes 
	
	mng_nomadic_frontier = {
		icon = mng_nomadic_frontier
		required_missions = { } 
		position = 1 
		provinces_to_highlight = {
			owner = { 
				is_neighbor_of = ROOT 
				OR = {
					culture_group = altaic
					culture_group = tartar
					primary_culture = altaic_new 
					primary_culture = manchu
					primary_culture = altaic 
					primary_culture = manchu_new
				}
				OR = {
					has_reform = steppe_horde
					has_reform = great_mongol_state_reform
				}
			}
		}
		trigger = {
			if = { 
				limit = { 
					OR = { 
						OIR = {
							exists = yes 
							is_neighbor_of = ROOT 
							OR = { 
								is_subject_of = ROOT 
								AND = {
									is_subject = no 
									NOT = { alliance_with = ROOT }
								}
							}
						}
						KHA = {
							exists = yes 
							is_neighbor_of = ROOT 
							OR = { 
								is_subject_of = ROOT 
								AND = {
									is_subject = no 
									NOT = { alliance_with = ROOT }
								}
							}
						}
						KRC = {
							exists = yes 
							is_neighbor_of = ROOT 
							OR = { 
								is_subject_of = ROOT 
								AND = {
									is_subject = no 
									NOT = { alliance_with = ROOT }
								}
							}
						}
						MHX = {
							exists = yes 
							is_neighbor_of = ROOT 
							OR = { 
								is_subject_of = ROOT 
								AND = {
									is_subject = no 
									NOT = { alliance_with = ROOT }
								}
							}
						}
						MJZ = {
							exists = yes 
							is_neighbor_of = ROOT 
							OR = { 
								is_subject_of = ROOT 
								AND = {
									is_subject = no 
									NOT = { alliance_with = ROOT }
								}
							}
						}
						MCH = {
							exists = yes 
							is_neighbor_of = ROOT 
							OR = { 
								is_subject_of = ROOT 
								AND = {
									is_subject = no 
									NOT = { alliance_with = ROOT }
								}
							}
						}
					}
				}
				
				if = { 
					limit = { 
						OIR = {
							exists = yes 
							is_neighbor_of = ROOT 
							OR = { 
								is_subject_of = ROOT 
								AND = {
									is_subject = no 
									NOT = { alliance_with = ROOT }
								}
							}
						}
					}
					OIR = {
						OR = {
							is_subject_of = ROOT
							alliance_with = ROOT 
						}
						OR = { 
							has_opinion = {
								who = ROOT 
								value = 150 
							}
							has_liberty_desire_modifier = bestowed_gifts 
							NOT = { liberty_desire = 15 }
						}
					}
				}
				if = { 
					limit = { 
						KHA = {
							exists = yes 
							is_neighbor_of = ROOT 
							OR = { 
								is_subject_of = ROOT 
								AND = {
									is_subject = no 
									NOT = { alliance_with = ROOT }
								}
							}
						}
					}
					KHA = {
						OR = {
							is_subject_of = ROOT
							alliance_with = ROOT 
						}
						OR = { 
							has_opinion = {
								who = ROOT 
								value = 150 
							}
							has_liberty_desire_modifier = bestowed_gifts 
							NOT = { liberty_desire = 15 }
						}
					}
				}
				if = { 
					limit = { 
						KRC = {
							exists = yes 
							is_neighbor_of = ROOT 
							OR = { 
								is_subject_of = ROOT 
								AND = {
									is_subject = no 
									NOT = { alliance_with = ROOT }
								}
							}
						}
					}
					KRC = {
						OR = {
							is_subject_of = ROOT
							alliance_with = ROOT 
						}
						OR = { 
							has_opinion = {
								who = ROOT 
								value = 150 
							}
							has_liberty_desire_modifier = bestowed_gifts 
							NOT = { liberty_desire = 15 }
						}
					}
				}
				if = { 
					limit = { 
						MHX = {
							exists = yes 
							is_neighbor_of = ROOT 
							OR = { 
								is_subject_of = ROOT 
								AND = {
									is_subject = no 
									NOT = { alliance_with = ROOT }
								}
							}
						}
					}
					MHX = {
						OR = {
							is_subject_of = ROOT
							alliance_with = ROOT 
						}
						OR = { 
							has_opinion = {
								who = ROOT 
								value = 150 
							}
							has_liberty_desire_modifier = bestowed_gifts 
							NOT = { liberty_desire = 15 }
						}
					}
				}
				if = { 
					limit = { 
						MJZ = {
							exists = yes 
							is_neighbor_of = ROOT 
							OR = { 
								is_subject_of = ROOT 
								AND = {
									is_subject = no 
									NOT = { alliance_with = ROOT }
								}
							}
						}
					}
					MJZ = {
						OR = {
							is_subject_of = ROOT
							alliance_with = ROOT 
						}
						OR = { 
							has_opinion = {
								who = ROOT 
								value = 150 
							}
							has_liberty_desire_modifier = bestowed_gifts 
							NOT = { liberty_desire = 15 }
						}
					}
				}
				if = { 
					limit = { 
						MCH = {
							exists = yes 
							is_neighbor_of = ROOT 
							OR = { 
								is_subject_of = ROOT 
								AND = {
									is_subject = no 
									NOT = { alliance_with = ROOT }
								}
							}
						}
					}
					MCH = {
						OR = {
							is_subject_of = ROOT
							alliance_with = ROOT 
						}
						OR = { 
							has_opinion = {
								who = ROOT 
								value = 150 
							}
							has_liberty_desire_modifier = bestowed_gifts 
							NOT = { liberty_desire = 15 }
						}
					}
				}
			}
			else = {
				jilin_area = {
					type = all 
					country_or_subject_holds = ROOT 
				}
				any_country = {
					is_neighbor_of = ROOT 
					NOT = { army_size = ROOT } 
					NOT = { development = 300 }
				}		
			}
		}
		
		effect = {
			custom_tooltip = mng_if_completed_via_diplomacy_tt
			tooltip = {
				if = {
					limit = { has_dlc = "Mandate of Heaven" }
					add_country_modifier = {
						name = mng_banner_recruitment_modifier
						duration = 9125 
					}
				}
				else = { 
					add_country_modifier = {
						name = mng_banner_recruitment_2_modifier
						duration = 9125 
					}
				}
			}
			
			custom_tooltip = mng_if_completed_via_conquest_tt
			tooltip = {
				country_event = { id = flavor_mng.32 } 
			}
			custom_tooltip = mng_insight_32_tt
			
			hidden_effect = {
				if = {
					limit = { 
						jilin_area = {
							type = all 
							country_or_non_sovereign_subject_holds = ROOT 
						}
					}
					country_event = { id = flavor_mng.32 } 
				}
				else_if = {
					limit = { has_dlc = "Mandate of Heaven" }
					add_country_modifier = {
						name = mng_banner_recruitment_modifier
						duration = 9125 
					}
					capital_scope = {
						add_province_modifier = {
							name = allow_local_banners_modifier
							duration = 9125
							hidden = yes 
						}
					}
				}
				else = {
					add_country_modifier = {
						name = mng_banner_recruitment_2_modifier
						duration = 9125 
					}
				}
			}
		}
	}	

	mng_deal_kama_kagyu = {
		icon = mng_deal_kama_kagyu
		required_missions = { mng_nomadic_frontier }
		position = 2 
		provinces_to_highlight = {
			province_id = 677
			NOT = { country_or_subject_holds = ROOT } 
		}
		
		trigger = { 
			OR = { 
				677 = { country_or_subject_holds = ROOT }
				677 = {
					owner = {
						has_opinion = {
							who = ROOT 
							value = 120
						}
						has_opinion_modifier = {
							who = ROOT
							modifier = sent_gift
						}
					}
				}
			}
		}
		
		effect = {
			custom_tooltip = mng_relations_gift_reward_tt
			tooltip = {
				677 = {
					owner = {
						country_event = { id = flavor_mng.33 } 
					}
				}
			}
			custom_tooltip = mng_insight_33_tt
			
			custom_tooltip = mng_else_if_tributary_tt
			tooltip = {
				if = { 
					limit = { has_dlc = "Mandate of Heaven" } 
					add_mandate = 5 
				}
				else = { add_prestige_or_monarch_power = { amount = 35 } } 
				add_country_modifier = {
					name = mng_tibetan_horses_monopoly_modifier
					duration = -1 
					desc = as_long_as_we_or_subject_owns_this_province_desc
				}
			}
			
			hidden_effect = {
				if = {
					limit = { 
						677 = {
							owner = { 
								has_opinion = {
									who = ROOT 
									value = 120
								}
								has_opinion_modifier = {
									who = ROOT
									modifier = sent_gift
								}
							}
						}
					}
					677 = {
						owner = { 
							country_event = { id = flavor_mng.33 }
						}
					}
				}
				else = {
					add_country_modifier = {
						name = mng_tibetan_horses_monopoly_modifier
						duration = -1 
						desc = as_long_as_we_or_subject_owns_this_province_desc 
					}
				}
				if = { 
					limit = { has_dlc = "Mandate of Heaven" } 
					add_mandate = 5 
				}
				else = { add_prestige_or_monarch_power = { amount = 35 } } 
			}
		}
	}
	
	mng_inward_perfection = { 
		icon = mng_inward_perfection 
		required_missions = { mng_restore_royal_road mng_deal_kama_kagyu mng_kingdom_joseon }
		position = 3
		
		trigger = {
			OR = {
				AND = { 
					has_estate_privilege = estate_church_inwards_perfection
					if = {
						limit = { has_estate = estate_eunuchs } 
						estate_loyalty = {
							estate = estate_eunuchs 
							loyalty = 60 
						}
					}
					if = {
						limit = { has_estate = estate_burghers } 
						estate_loyalty = {
							estate = estate_burghers 
							loyalty = 60 
						}
					}
					if = {
						limit = { has_estate = estate_nobles } 
						estate_loyalty = {
							estate = estate_nobles 
							loyalty = 60 
						}
					}
					if = {
						limit = { has_estate = estate_church } 
						estate_loyalty = {
							estate = estate_church 
							loyalty = 60 
						}
					}
					if = {
						limit = { has_estate = estate_nomadic_tribes } 
						estate_loyalty = {
							estate = estate_nomadic_tribes 
							loyalty = 60 
						}
					}
					stability = 2 
					NOT = { num_of_rebel_controlled_provinces = 1 } 
					if = { 
						limit = { is_emperor_of_china = yes } 
						imperial_mandate = 80 
					}
				}
				AND = {
					NOT = { has_estate_privilege = estate_church_inwards_perfection } 
					grown_by_states = 6 
					if = { 
						limit = { 
							OR = { 
								has_dlc = "Emperor" 
								has_dlc = "Rights of Man"
							}
						}
						OR = {
							grown_by_development = 500 
							NOT = { great_power_rank = 2 }
						}
					}
					else = { grown_by_development = 350 } 
				}
			}
		} 
		
		effect = {
			custom_tooltip = mng_inward_perfection_reward_tt
			
			custom_tooltip = mng_no_inward_perfection_reward_tt
			tooltip = {
				add_country_modifier = {
					name = mng_dragon_roars_modifier
					duration = 18250
				}
				set_estate_privilege = estate_eunuchs_outwards_perfection_privilege
			}			
			hidden_effect = {
				if = {
					limit = { NOT = { has_estate_privilege = estate_church_inwards_perfection } } 
					add_country_modifier = {
						name = mng_dragon_roars_modifier
						duration = 18250
					}
					set_country_flag = mng_outward_perfection_flag
					set_estate_privilege = estate_eunuchs_outwards_perfection_privilege
				}
				else = { 
					set_country_flag = mng_amplify_inward_perfection_flag
				}
			}
		}
	}

	mng_survey_ocean_shores = {
		icon = mng_survey_ocean_shores 
		required_missions = { mng_inward_perfection }
		position = 4
		provinces_to_highlight = {
			OR = { 
				province_id = 1365
				province_id = 1361
				province_id = 1343
				province_id = 1341
			}
			OR = { 
				NOT = { galleys_in_province = 10 } 
				NOT = { heavy_ships_in_province = 3 }
			}
		}
		trigger = {
			1365 = {
				OR = { 
					galleys_in_province = 10 
					heavy_ships_in_province = 3 
				}
			}
			1361 = {
				OR = { 
					galleys_in_province = 10 
					heavy_ships_in_province = 3 
				}
			}
			1343 = {
				OR = { 
					galleys_in_province = 10 
					heavy_ships_in_province = 3 
				}
			}
			1341 = {
				OR = { 
					galleys_in_province = 10 
					heavy_ships_in_province = 3 
				}
			}
			calc_true_if = {
				all_country = {
					OR = { 
						is_neighbor_of_province = 1365 
						is_neighbor_of_province = 1361 
						is_neighbor_of_province = 1343 
						is_neighbor_of_province = 1341 
					}
					NOT = { is_subject_of = ROOT } 
					OR = { 
						has_opinion_modifier = {
							who = PREV 
							modifier = great_power_influence
						}
						has_opinion_modifier = {
							who = PREV 
							modifier = sent_gift
						}
					}
				}
				amount = 4 
			}
		}
		
		effect = {
			
			if = { 
				limit = { is_emperor_of_china = yes } 
				custom_tooltip = mng_trib_cb_every_nation_applicable_tt
				tooltip = {
					every_country = {
						limit = {
							OR = { 
								is_neighbor_of_province = 1365 
								is_neighbor_of_province = 1361 
								is_neighbor_of_province = 1343 
								is_neighbor_of_province = 1341 
							}
							NOT = { is_subject_of = ROOT } 
							OR = { 
								has_opinion_modifier = {
									who = PREV 
									modifier = great_power_influence
								}
								has_opinion_modifier = {
									who = PREV 
									modifier = sent_gift
								}
							}
						}
						reverse_add_casus_belli = {
							target = MNG
							type = cb_force_tributary_mission
							months = 360
						}
					}
				}
			}
			else = {
				custom_tooltip = mng_subj_cb_every_nation_applicable_tt
				tooltip = {
					every_country = {
						limit = {
							OR = { 
								is_neighbor_of_province = 1365 
								is_neighbor_of_province = 1361 
								is_neighbor_of_province = 1343 
								is_neighbor_of_province = 1341 
							}
							NOT = { is_subject_of = ROOT } 
							OR = { 
								has_opinion_modifier = {
									who = PREV 
									modifier = great_power_influence
								}
								has_opinion_modifier = {
									who = PREV 
									modifier = sent_gift
								}
							}
						}
						reverse_add_casus_belli = {
							target = MNG
							type = cb_vassalize_mission
							months = 360
						}
					}
				}
			}
			hidden_effect = { 
				every_country = {
					limit = { 
						OR = { 
							is_neighbor_of_province = 1365 
							is_neighbor_of_province = 1361 
							is_neighbor_of_province = 1343 
							is_neighbor_of_province = 1341 
						}
						NOT = { is_subject_of = MNG } 
						OR = { 
							has_opinion_modifier = {
								who = MNG 
								modifier = great_power_influence
							}
							has_opinion_modifier = {
								who = MNG 
								modifier = sent_gift
							}
						}
					}
					if = {
						limit = { has_dlc = "Mandate of Heaven" }
						reverse_add_casus_belli = {
							target = MNG
							type = cb_force_tributary_mission
							months = 360
						}
					}
					else = { 
						reverse_add_casus_belli = {
							target = MNG
							type = cb_vassalize_mission
							months = 360
						}
					}
				}
			}
			
			add_power_projection = { 
				type = 25_permanent_power_projection
				amount = 25 
			}
		}
	}
}

DOM_Qing_Missions_3 = { 
	slot = 3
	generic = no
	ai = yes
	#potential_on_load = { has_dlc = "Mandate of Heaven" }
	potential = {
		has_dlc = "Domination"
		OR = {
			tag = MJZ
			tag = MCH
			tag = QNG
			#tag = KRC
			tag = MYR
			tag = EJZ
			tag = NHX
			tag = MHX
		}
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes	
	
	mjz_unite_jurchen_tribes = { 
		icon = mission_steppe_warriors
		required_missions = { }
		position = 1
		provinces_to_highlight = {
			owner = { 
				AND = {
					NOT = { tag = ROOT } 
					culture = ROOT 
					army_size = ROOT
				}
			}
		}
		trigger = {
			custom_trigger_tooltip = { 
				tooltip = mjz_all_country_of_manchuria_of_root_culture_less_army_than_root_tt
				NOT = {
					any_known_country = {
						capital_scope = {
							region = manchuria_region 
						}
						culture = ROOT 
						army_size = ROOT
					}
				}
			}
			grown_by_development = 60
			num_of_cavalry = 12
			OR = { 
				NOT = { average_autonomy_above_min = 10 }
				NOT = { average_effective_unrest = 2 }
			}
		}
		
		effect = { 
			add_country_modifier = {
				name = mjz_united_jurchens_modifier
				duration = 7300
			}
			custom_tooltip = mjz_every_province_10_autonomy_tt
			hidden_effect = { 
				every_owned_province = { add_local_autonomy = -10 }
			}
			if = { 
				limit = { has_country_modifier = mjz_dominance_of_the_horselords_modifier } 
				custom_tooltip = mjz_extend_dominance_modifier_tt
				hidden_effect = {
					remove_country_modifier = mjz_dominance_of_the_horselords_modifier
					add_country_modifier = {
						name = mjz_dominance_of_the_horselords_modifier 
						duration = 3650 
					}
				}
			}
		}
	}
	
	mjz_for_the_horde = {
		icon = mjz_for_the_horde
		required_missions = { mjz_unite_jurchen_tribes }
		position = 2
		provinces_to_highlight = {
			owner = { culture_group = altaic }
			is_capital = yes 
		}
		trigger = { 
			OR = { 
				any_ally = { 
					culture_group = altaic
					has_opinion = {
						who = ROOT 
						value = 150 
					}
					marriage_with = ROOT 
				}
				any_subject_country = {
					culture_group = altaic
					has_opinion = {
						who = ROOT 
						value = 150 
					}
					marriage_with = ROOT 
					NOT = { liberty_desire = 25 } 
				}
				custom_trigger_tooltip = {
					tooltip = accepts_any_altaic_cg_tt
					OR = {
						accepted_culture = mongol
						accepted_culture = chahar
						accepted_culture = khalkha
						accepted_culture = oirats
						accepted_culture = uzbehk
						accepted_culture = turkmeni
						accepted_culture = uyghur 
						accepted_culture = khazak
						accepted_culture = kirgiz
					}
				}
			}
			OR = { 
				national_focus = DIP 
				monthly_dip = 8 
				stability = 1 
			}
		}
		
		effect = { 
			if = { 
				limit = { has_country_modifier = mjz_dominance_of_the_horselords_modifier } 
				custom_tooltip = mjz_extend_dominance_modifier_tt
				hidden_effect = {
					remove_country_modifier = mjz_dominance_of_the_horselords_modifier
					add_country_modifier = {
						name = mjz_dominance_of_the_horselords_modifier 
						duration = 3650 
					}
				}
			}
			custom_tooltip = mjz_alliance_reward_tt
			tooltip = {
				add_country_modifier = { 
					name = mjz_horde_diplomatic_ties_modifier
					duration = 9125
				}
				define_advisor = { 
					type = diplomat 
					skill = 2
					cost_multiplier = 0.5
				}
			}
			
			custom_tooltip = mjz_subjugation_reaward_tt
			tooltip = {	
				add_country_modifier = {
					name = mjz_hordesons_modifier
					duration = 9125 
				}
			}
			
			custom_tooltip = mjz_accept_any_altaic_tt
			tooltip = {
				add_country_modifier = {
					name = mjz_horde_cooperation_modifier
					duration = 7300
				}
			}
			
			hidden_effect = {
				if = { 
					limit = { 
						any_ally = { 
							culture_group = altaic
							has_opinion = {
								who = ROOT 
								value = 150 
							}
							marriage_with = ROOT 
						}
					}
					random_ally = { 
						limit = { 
							culture_group = altaic
							has_opinion = {
								who = ROOT 
								value = 150 
							}
							marriage_with = ROOT 
						}
						add_country_modifier = { 
							name = mjz_horde_diplomatic_ties_modifier
							duration = 9125
						}
						define_advisor = { 
							type = diplomat 
							cost_multiplier = 0.5
						}
					}
					add_country_modifier = { 
						name = mjz_horde_diplomatic_ties_modifier
						duration = 9125
					}
					define_advisor = { 
						type = diplomat 
						cost_multiplier = 0.5
					}
				}
				else_if = {
					limit = { 
						any_subject_country = {
							culture_group = altaic
							has_opinion = {
								who = ROOT 
								value = 150 
							}
							marriage_with = ROOT 
							NOT = { liberty_desire = 25 } 
						}
					}
					add_country_modifier = {
						name = mjz_hordesons_modifier
						duration = 9125 
					}
				}
				else = {
					add_country_modifier = {
						name = mjz_horde_cooperation_modifier
						duration = 7300
					}
				}
			}
		}
	}
	
	mch_adopt_alphabet = {
		icon = mch_adopt_alphabet
		required_missions = { mjz_for_the_horde mjz_dominate_rival_jurchens }
		position = 3
		
		trigger = { 
			is_lacking_institutions = no 
			OR = {
				adm_power = 500 
				monthly_adm = 9
			}
			NOT = { num_of_loans = 1 } 
			is_in_deficit = no 
			if = {
				limit = { current_age = age_of_discovery }
				adm_tech = 5
			}
			else = {
				OR = {
					full_idea_group = innovativeness_ideas 
					adm = 5 
					innovativeness = 40 
					AND = {
						government_reform_progress = 300
						has_adm_advisor_3 = yes 
					}
				}
			}
		}
		
		effect = { 
			if = { 
				limit = { 
					NOT = { tag = QNG } 
				}
				add_country_modifier = { 
					name = mch_first_manchu_alphabet_modifier
					duration = -1 
					desc = until_we_reform_our_administration_as_qng_desc
				}
			}
			else = {
				if = { 
					limit = { has_dlc = "Rule Britannia" } 
					change_innovativeness = 5 
				}
				else = { 
					change_ruler_stat = {
						stat = adm
						amount = 2
					}
				}
			}
		}
	}
	
	mch_bypass_great_wall = { 
		icon = mch_bypass_great_wall
		required_missions = { mch_issue_seven_grievances }
		position = 4
		provinces_to_highlight = {
			area = liaoning_area 
			NOT = { country_or_non_sovereign_subject_holds = ROOT } 
		}
		trigger = {
			OR = { 
				AND = { 
					726 = { controlled_by = ROOT } 
					event_target:EmperorOfChina = {  
						NOT = { 
							war_score_against = {
								who = ROOT 
								value = -50 
							}	 
						}
					}
				}
				liaoning_area = {
					type = all 
					country_or_non_sovereign_subject_holds = ROOT 
				}
			}
		}
		
		effect = {
			custom_tooltip = mch_war_with_eoc_reward_tt
			tooltip = {
				add_yearly_manpower = 2 
				add_war_exhaustion = -2
			}
			
			custom_tooltip = pol_alternatively_tt
			tooltip = {
				liaoning_area = {
					add_base_manpower = 1
				}
				add_stability_or_adm_power = yes 
			}
			
			hidden_effect = { 
				if = {
					limit = { 
						AND = { 
							726 = { controlled_by = ROOT } 
							event_target:EmperorOfChina = {  
								war_with = ROOT 
								NOT = { 
									war_score_against = {
										who = ROOT 
										value = -50 
									}	 
								}
							}
						}
					}
					add_yearly_manpower = 2 
					add_war_exhaustion = -2
					event_target:EmperorOfChina = { 
						every_owned_province = {
							limit = { 
								controlled_by = PREV 
								has_fort_building_trigger = yes 
							}
							add_devastation = 10 
						}
					}
				}
				else = {
					liaoning_area = {
						add_base_manpower = 1
					}
					add_stability_or_adm_power = yes 
				}
			}
			if = { 
				limit = { has_country_modifier = mjz_dominance_of_the_horselords_modifier } 
				custom_tooltip = mjz_extend_dominance_modifier_tt
				hidden_effect = {
					remove_country_modifier = mjz_dominance_of_the_horselords_modifier
					add_country_modifier = {
						name = mjz_dominance_of_the_horselords_modifier 
						duration = 3650 
					}
				}
			}
		}	
	}	
}

ming_missions_3_b = {
	slot = 3
	generic = no
	ai = yes
	potential = {
		has_dlc = "Domination"
		is_emperor_of_china = yes 
		OR = { 
			tag = QNG 
			culture_group = east_asian
			has_country_flag = enable_emperor_of_china_missions_flag
		}
		capital_scope = { continent = asia }
		
		started_in = 1368.1.1		#New added in MMETR mod, to exclude new Ancient/Medieval Chinese Warlord missions
		NOT = { tag = HND }		#New added in MMETR mod
		NOT = { tag = SNG }		#New added in MMETR mod
		if = {
			limit = {	
				tag = SHU
			}
			started_in = 280.1.1
		}
		if = {
			limit = {	
				tag = WEI
			}
			started_in = 280.1.1
		}
	}
	has_country_shield = yes 
	
	mng_tame_china_sorrow = {
		icon = mng_tame_china_sorrow
		required_missions = { } 
		position = 5
		provinces_to_highlight = { 
			OR = {
				province_id = 2142
				province_id = 4196
				province_id = 2141
				province_id = 688
				province_id = 1836
			}
			OR = { 
				NOT = { controlled_by = ROOT }
				devastation = 1
				NOT = { num_of_times_improved = 3 } 
			}	
		}
		
		trigger = {
			2142 = { 
				num_of_times_improved = 3 
				owned_by = ROOT 
				if = {
					limit = { has_dlc = "Mandate of Heaven" }
					NOT = { devastation = 1 } 
				}
			}
			4196 = { 
				num_of_times_improved = 3 
				owned_by = ROOT 
				if = {
					limit = { has_dlc = "Mandate of Heaven" }
					NOT = { devastation = 1 } 
				}
			}
			2141 = { 
				num_of_times_improved = 3 
				owned_by = ROOT 
				if = {
					limit = { has_dlc = "Mandate of Heaven" }
					NOT = { devastation = 1 } 
				}
			}
			688 = { 
				num_of_times_improved = 3 
				owned_by = ROOT 
				if = {
					limit = { has_dlc = "Mandate of Heaven" }
					NOT = { devastation = 1 } 
				}
			}
			1836 = { 
				num_of_times_improved = 3 
				owned_by = ROOT 
				if = {
					limit = { has_dlc = "Mandate of Heaven" }
					NOT = { devastation = 1 } 
				}
			}
		}
		
		effect = { 
			country_event = { id = flavor_mng.35 }
			custom_tooltip = mng_insight_35_tt
		}
	}
	
	mng_single_whip_law = {
		icon = mission_african_gold 
		required_missions = { mng_examination_system }
		position = 7 
		provinces_to_highlight = { 
			OR = {
				province_id = 2174 
				province_id = 2139 
			}
			NOT = { base_production = 12 }
		}
		
		trigger = {
			empire_of_china_reform_passed = reform_land_tax_decision
			2174 = { 
				owned_by = ROOT 
				base_production = 12 
			}
			2139 = { 
				owned_by = ROOT 
				base_production = 12 
			}
			if = { 
				limit = { tag = MNG }
				has_idea = single_whip_law
			}
			NOT = { inflation = 1 }
			NOT = { num_of_loans = 1 } 
			current_income_balance = 35
			OR = {
				has_estate_privilege = estate_eunuchs_single_whip_law_privilege 
				government_reform_progress = 250 
			}
		}
		
		effect = {
			country_event = { id = flavor_mng.36 }
			custom_tooltip = mng_insight_36_tt
		}
	}
	
	mng_pure_land = {
		icon = mng_pure_land 
		required_missions = { }
		position = 8 
		provinces_to_highlight = { 
			province_id = 2140 
			OR = {
				NOT = { has_tax_building_trigger = yes } 
				NOT = { num_of_times_improved = 5 } 
			}
		}
		
		trigger = {
			num_of_owned_provinces_with = {
				has_tax_building_trigger = yes 
				value = 15 
			}
			2140 = {
				num_of_times_improved = 5 
				has_tax_building_trigger = yes 
			}
			if = {
				limit = { 
					has_dlc = "Mandate of Heaven" 
					religion = confucianism 
				} 
				harmony = 90 
			}
			else_if = {
				limit = { has_estate = estate_church } 
				estate_loyalty = {
					estate = estate_church 
					loyalty = 65 
				}
			}
			else = { prestige = 40 } 
		}
		
		effect = {
			if = {
				limit = { 
					has_dlc = "Leviathan" 
					2140 = {
						NOT = { 
							has_great_project = {
								type = temple_of_confucius 
								tier = 3 
							}
						}
					}
				}
				2140 = {
					add_great_project_tier = {
						type = temple_of_confucius 
						tier = 1 
					}
				}
			}
			else = {
				2140 = {
					add_base_tax = 3 
					add_base_production = 3 
				}
			}
			2140 = { 
				add_building = cathedral 
				remove_building = temple 
			}
			add_stability_or_adm_power = yes 
		}
	}
	
	mng_shengshi_zhishi = {
		icon = mng_shengshi_zhishi 
		required_missions = { mng_mutual_trade_system mng_pure_land mng_expand_yongle_dadian }
		position = 9		
		trigger = {
			if = {
				limit = { 
					has_dlc = "Mandate of Heaven" 
					is_emperor_of_china = yes 
				}
				empire_of_china_num_reforms_passed = 10
				imperial_mandate = 95 
			}
			else = { prestige = 90 } 
			NOT = { 
				num_of_estate_privileges = {	
					estate = estate_eunuchs 
					value = 1
				}
			}
			NOT = { 
				num_of_estate_privileges = {	
					estate = estate_nobles  
					value = 1 
				}
			}
			NOT = { 
				num_of_estate_privileges = {	
					estate = estate_burghers  
					value = 1 
				}
			}
			NOT = { 
				num_of_estate_privileges = {	
					estate = estate_church  
					value = 1 
				}
			}
			NOT = {
				estate_influence = {
					estate = estate_nobles 
					influence = 40 
				}
			}
			NOT = {
				estate_influence = {
					estate = estate_church 
					influence = 40 
				}
			}
			NOT = {
				estate_influence = {
					estate = estate_burghers  
					influence = 40 
				}
			}
			NOT = {
				estate_influence = {
					estate = estate_eunuchs  
					influence = 40 
				}
			}
			monthly_adm = 12 
			NOT = { num_of_loans = 1 } 
			OR = { 
				in_golden_age = yes  
				monthly_income = 500 
			}
		}
		
		effect = {
			custom_tooltip = mng_zhishi_reward_tt
			tooltip = {
				add_country_modifier = {
					name = mng_well_governed_era_modifier 
					duration = 9125 
				}
				add_power_projection = {
					type = 25_permanent_power_projection
					amount = 10
				}
				change_ruler_stat = {
					stat = adm
					amount = 1
				}
				change_ruler_stat = {
					stat = dip
					amount = 1
				}
				change_ruler_stat = {
					stat = mil
					amount = 1
				}
			}
			
			custom_tooltip = mng_shengshi_reward_tt
			tooltip = {
				add_country_modifier = { 
					name = mng_prosperous_era_modifier
					duration = -1 
				}
				if = { 
					limit = { has_dlc = "Mandate of Heaven" }
					if = {
						limit = { has_had_golden_age = yes } 
						reset_golden_age = yes 
					}
					else_if = {
						limit = { in_golden_age = yes } 
						extend_golden_age = 240
					}
				}
				add_power_projection = {
					type = 25_permanent_power_projection
					amount = 25
				}
			}
			custom_tooltip = mng_passing_reform_grants_10_estate_loyalty_tt 
			
			hidden_effect = {
				if = {
					limit = { 
						OR = { 
							in_golden_age = yes  
							monthly_income = 500 
						}
						monthly_adm = 12 
					}
					add_country_modifier = { 
						name = mng_prosperous_era_modifier
						duration = -1 
					}
					if = { 
						limit = { has_dlc = "Mandate of Heaven" }
						if = {
							limit = { has_had_golden_age = yes } 
							reset_golden_age = yes 
						}
						else_if = {
							limit = { in_golden_age = yes } 
							extend_golden_age = 240
						}
					}
					add_power_projection = {
						type = 25_permanent_power_projection
						amount = 25
					}
					custom_tooltip = mng_passing_reform_grants_10_estate_loyalty_tt
					set_country_flag = mng_shengshi_reward_flag 
				}
				else = {
					add_country_modifier = {
						name = mng_well_governed_era_modifier 
						duration = 9125 
					}
					add_power_projection = {
						type = 25_permanent_power_projection
						amount = 10
					}
					change_ruler_stat = {
						stat = adm
						amount = 1
					}
					change_ruler_stat = {
						stat = dip
						amount = 1
					}
					change_ruler_stat = {
						stat = mil
						amount = 1
					}
				}
			}
		}
	}	
}

DOM_Qing_Missions_3_b = { 
	slot = 3
	generic = no
	ai = yes
	#potential_on_load = { has_dlc = "Mandate of Heaven" }
	potential = {
		has_dlc = "Domination"
		tag = QNG
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes
	
	qng_three_feudatories = {
		icon = mng_thirteen_provinces
		position = 10
		required_missions = {  }
		provinces_to_highlight = {
			OR = {
				region = south_china_region
				region = xinan_region
			}
			NOT = {
				owned_by = ROOT
			}
		}
		trigger = {
			is_at_war = no
			num_of_owned_provinces_with = {
				OR = {
					region = south_china_region
					region = xinan_region
				}
				value = 20
			}
			if = {
				limit = {
					exists = YUE
					YUE = {
						OR = {
							AND = {
								is_subject_of = MNG
								OR = {
									is_subject_of_type = vassal
									is_subject_of_type = march
								}
							}
							is_subject = no
						}
					}
				}
				YUE = {
					is_at_war = no
				}
			}
			if = {
				limit = {
					exists = WUU
					WUU = {
						OR = {
							AND = {
								is_subject_of = MNG
								OR = {
									is_subject_of_type = vassal
									is_subject_of_type = march
								}
							}
							is_subject = no
						}
					}
				}
				WUU = {
					is_at_war = no
				}
			}
			if = {
				limit = {
					exists = CDL
					CDL = {
						OR = {
							AND = {
								is_subject_of = MNG
								OR = {
									is_subject_of_type = vassal
									is_subject_of_type = march
								}
							}
							is_subject = no
						}
					}
				}
				CDL = {
					is_at_war = no
				}
			}
		}
		effect = {
			if = { 
				limit = { is_emperor_of_china = yes } 
				add_mandate = 20 
			}
			if = {
				limit = {
					exists = YUE
					YUE = {
						is_at_war = no
						OR = {
							AND = {
								is_subject_of = MNG
								OR = {
									is_subject_of_type = vassal
									is_subject_of_type = march
								}
							}
							is_subject = no
						}
					}
				}
				add_casus_belli = {
					target = YUE
					type = cb_vassalize_mission
					months = 180
				}
			}
			else = {
				add_prestige = 25
				add_army_tradition = 10
			}
			if = {
				limit = {
					exists = WUU
					WUU = {
						is_at_war = no
						OR = {
							AND = {
								is_subject_of = MNG
								OR = {
									is_subject_of_type = vassal
									is_subject_of_type = march
								}
							}
							is_subject = no
						}
					}
				}
				add_casus_belli = {
					target = WUU
					type = cb_vassalize_mission
					months = 180
				}
			}
			if = {
				limit = {
					exists = CDL
					CDL = {
						is_at_war = no
						OR = {
							AND = {
								is_subject_of = MNG
								OR = {
									is_subject_of_type = vassal
									is_subject_of_type = march
								}
							}
							is_subject = no
						}
					}
				}
				add_casus_belli = {
					target = WUU
					type = cb_vassalize_mission
					months = 180
				}
				if = {
					limit = {
						has_leader = "Wu Sangui"
						CDL = { is_subject_of = ROOT } 
					}
					CDL = {
						define_ruler = {
							name = "Sangui"
							dynasty = "Wu"
							adm = 3
							dip = 3
							mil = 4
						}
						change_tag = CZH
						on_change_tag_effect = yes
					}
					kill_leader = { type = "Wu Sangui" }
				}
			}
			if = {	
				limit = { 
					has_dlc = "Rights of Man" 
					NOT = { num_of_ruler_traits = { amount = 3 } }
					is_emperor_of_china = yes 
				}
				add_ruler_personality = benevolent_personality
			}
			else = { add_dip_power = 50 }
		}
	}
	
	qng_conquer_south_china = {
		icon = qng_conquer_south_china 
		required_missions = { qng_three_feudatories } 
		position = 11 
		provinces_to_highlight = { 
			OR = {
				region = xinan_region 
				region = south_china_region 
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT } 
		}
		
		trigger = {
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				OR = { 
					region = xinan_region
					region = south_china_region
				}
				value = 50 
			}
		}
		
		effect = {
			add_country_modifier = {
				name = qng_riches_of_china_modifier
				duration = 9125
			}
			define_advisor = {
				type = commandant 
				skill = 3 
				cost_multiplier = 0.25 
			}
		}
	}
	
	qng_junji_chu = {
		icon = qng_junji_chu 
		required_missions = { qng_extinguish_ming qng_high_qing_era } 
		position = 13
		trigger = {
			has_final_tier_reforms_trigger = yes
			if = { 
				limit = { is_emperor_of_china = yes }
				imperial_mandate = 90 
			}
			else = { legitimacy = 90 }
			crown_land_share = 90 
		}
		
		effect = { 
			add_government_reform = qng_grand_council_reform
			add_adm_power = 100 
		}
	}

	qng_integrate_taiwan = {
		icon = mission_junk_boat
		required_missions = { qng_ten_grand_campaigns }
		provinces_to_highlight = {
			area = taiwan_area
			NOT = { owned_by = ROOT }
		}
		trigger = {
			taiwan_area = {
				type = all
				owned_by = ROOT
			}
			738 = { 
				has_dock_building_trigger = yes 
				has_trade_building_trigger = yes 
				has_shipyard_building_trigger = yes 
				num_of_times_improved = 5
			}
		}
		
		effect = {
			738 = { 
				center_of_trade = 2 
				add_province_modifier = {
					name = qng_port_of_sakam_modifier
					duration = -1
				}
			} 
			add_navy_tradition = 20
			
			luzon_area = {
				limit = { 
					NOT = { owned_by = ROOT } 
					NOT = { is_core = ROOT } 
				}
				add_permanent_claim = ROOT 
			}
			
			southern_luzon_area = {
				limit = { 
					NOT = { owned_by = ROOT } 
					NOT = { is_core = ROOT } 
				}
				add_permanent_claim = ROOT 
			}
		}
	}
}

chinese_kingdoms_4 = {
	slot = 4
	generic = no
	ai = yes
	potential = {
		has_dlc = "Domination"
		OR = {
			tag = YAN
			tag = JIN
			tag = QIN
			tag = QIC
			tag = CSH
			tag = LNG
			tag = TNG
			tag = CXI
			tag = CHC
			tag = WUU
			tag = NNG
			tag = MIN
			tag = HUA
			tag = YUE
			tag = CMI
			tag = CYI
			tag = CDL
			tag = CGS
			tag = FRM
			
			#New changed in MMETR
			AND = {
				tag = SHU
				started_in = 280.1.1
			}
		}
		started_in = 1368.1.1		#New added in MMETR mod, to exclude new Ancient/Medieval Chinese Warlord missions
		NOT = { map_setup = map_setup_random }
	}
	
	conquer_south_china = {
		icon = qng_conquer_south_china
		required_missions = { chi_independence } 
		position = 2
		provinces_to_highlight = {
			region = south_china_region 
			NOT = { country_or_non_sovereign_subject_holds = ROOT } 
		}
		trigger = {
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				region = south_china_region 
				value = 30
			}
			1821 = { country_or_non_sovereign_subject_holds = ROOT } 
			667 = { country_or_non_sovereign_subject_holds = ROOT }			
		}
		effect = {
			indo_china_region = {
				limit = { 
					NOT = { is_core = ROOT } 
					NOT = { owned_by = ROOT } 
				}
				add_permanent_claim = ROOT 
			}
			if = {
				limit = { is_emperor_of_china = ROOT } 
				add_mandate = 25 
			}
			else = {
				add_stability_or_adm_power = yes 
			}
			if = {
				limit = { has_dlc = "Leviathan" } 
				1821 = { 
					add_great_project_tier = {
						type = porcelain_tower_nanjing 
						tier = 1 
					}
				}
			}
			else = {
				1821 = {
					add_base_tax = 2 
					add_base_production = 2 
					add_base_manpower = 2
				}
			}
		}
	}
	
	issue_trade_policy = {
		icon = dominant_economy 
		required_missions = { conquer_south_china renovate_capital } 
		position = 3
		trigger = {
			home_trade_node = { is_strongest_trade_power = ROOT }
			trader = 3
			num_of_owned_provinces_with = {
				has_trade_building_trigger = yes
				value = 5
			}
			if = {
				limit = { has_dlc = "Dharma" } 
				num_of_owned_provinces_with = {	
					province_has_center_of_trade_of_level = 2 
					value = 4 
				}
			}
			else = { 
				num_of_owned_provinces_with = {	
					province_has_center_of_trade_of_level = 1
					value = 4 
				}
			}
		}
		effect = {
			if = {
				limit = { 
					has_dlc = "Rights of Man" 
					NOT = { num_of_ruler_traits = { amount = 3 } }
				}
				add_ruler_personality = entrepreneur_personality
			}
			else = { add_mercantilism = 3 }
			custom_tooltip = chi_every_center_of_trade_or_marketplace_gets_tt
			tooltip = { add_base_production = 2 }
			hidden_effect = {
				every_owned_province = {
					limit = { province_has_center_of_trade_of_level = 1 }
					add_base_production = 2
				}
			}
		}
	}
}		

ming_missions_4 = {
	slot = 4
	generic = no
	ai = yes
	potential = {
		tag = MNG
		has_dlc = "Domination" 
	}
	has_country_shield = yes 
	
	mng_kingdom_joseon = {
		icon = mng_kingdom_joseon 
		required_missions = { mng_nomadic_frontier } 
		position = 2 
		provinces_to_highlight = { 
			OR = { 
				area = pyongan_area 
				area = hamgyeong_area 
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT } 
		} 
		
		trigger = { 
			OR = { 
				KOR = { 
					OR = { 
						alliance_with = ROOT 
						is_subject_of = ROOT 
					}
					has_opinion = {
						who = ROOT 
						value = 175 
					}
					if = { 
						limit = { 
							OR = {
								has_dlc = "Rights of Man" 
								has_dlc = "Emperor" 
							}
						}
						has_opinion_modifier = {
							who = ROOT  
							modifier = great_power_influence
						}
					}
				}
				AND = {
					pyongan_area = {
						type = all 
						country_or_non_sovereign_subject_holds = ROOT 
						NOT = { owned_by = KOR }
					}
					hamgyeong_area = {
						type = all 
						country_or_non_sovereign_subject_holds = ROOT 
						NOT = { owned_by = KOR }
					}
				}
			}
		}
		
		effect = {
			custom_tooltip = mng_dip_korea_reward_tt
			tooltip = {
				KOR = { add_historical_friend = PREV } 
				add_historical_friend = KOR 
				country_event = { id = flavor_mng.37 }
				custom_tooltip = mng_insight_37_tt
			}
			
			custom_tooltip = mng_complete_via_owning_areas_tt
			tooltip = { 
				korea_region = {
					limit = { 
						NOT = { owned_by = ROOT } 
						NOT = { is_core = ROOT } 
					}
					add_permanent_claim = ROOT 
				}
			}
			
			hidden_effect = {
				if = { 
					limit = { 
						pyongan_area = {
							type = all 
							country_or_non_sovereign_subject_holds = ROOT 
							NOT = { owned_by = KOR }
						}
						hamgyeong_area = {
							type = all 
							country_or_non_sovereign_subject_holds = ROOT 
							NOT = { owned_by = KOR }
						}
					}
					korea_region = {
						limit = { 
							NOT = { owned_by = ROOT } 
							NOT = { is_core = ROOT } 
						}
						add_permanent_claim = ROOT 
					}
					update_entire_culture_foreign = {
						culture = korean
					}
				}
				else = {
					country_event = { id = flavor_mng.37 }
					add_historical_friend = KOR 
					KOR = { add_historical_friend = PREV } 
				}
			}
		}
	}
}

ming_missions_4_generic = {
	slot = 4
	generic = no
	ai = yes
	potential = {
		tag = MNG
		has_dlc = "Domination" 
		NOT = { has_country_flag = mng_dynamic_1 }
		NOT = { has_country_flag = mng_dynamic_2 }
	}
	has_country_shield = yes 
	
	mng_repeal_or_improve_haijin = {
		icon = mission_unknown_mission 
		required_missions = { mng_inward_perfection mng_end_sengoku_jidai } 
		position = 4
		provinces_to_highlight = {  } 
		
		trigger = { 
			custom_trigger_tooltip = {
				tooltip = mng_repeal_requirements_tt
				always = no 
			}
			OR = { 
				full_idea_group = trade_ideas 
				dip = 6 
				has_reform = free_trade_reform
			}
			is_lacking_institutions = no 
			num_of_owned_provinces_with = { 
				province_has_center_of_trade_of_level = 1
				num_of_times_improved = 10 
				value = 3 
			}
			if = { 
				limit = { has_estate = estate_eunuchs } 
				OR = {
					estate_loyalty = {
						estate = estate_eunuchs 
						loyalty = 60 
					}
					NOT = {
						estate_influence = {
							estate = estate_eunuchs 
							influence = 50 
						}
					}
					NOT = { 
						num_of_estate_privileges = {
							estate = estate_eunuchs 
							value = 2 
						}
					}
				}
			}
			custom_trigger_tooltip = {
				tooltip = mng_improve_requirements_tt
				always = no 
			}
			OR = { 
				has_reform = mercantilistic_approach_reform
				dip = 6 
			}
			OR = {
				num_of_owned_provinces_with = {
					has_port = yes 
					OR = {
						has_river_estuary_trigger = yes 
						province_has_center_of_trade_of_level = 1 
					}
					has_trade_building_trigger = yes 
					value = 3
				}
				if = { 
					limit = { 
						is_emperor_of_china = yes 
						has_dlc = "Mandate of Heaven"
					}
					AND = {
						empire_of_china_has_active_decree = increase_tariff_control_decree
						if = { 
							limit = { has_estate = estate_burghers } 
							estate_loyalty = { 
								estate = estate_burghers 
								loyalty = 60 
							}
						}
						imperial_mandate = 90 
					}
				}
			}
			if = {
				limit = { has_estate = estate_eunuchs }
				OR = {
					estate_loyalty = {
						estate = estate_eunuchs 
						loyalty = 60 
					}
					NOT = { 
						num_of_estate_privileges = {
							estate = estate_eunuchs 
							value = 4 
						}
					}
				}
			}
		}
		
		effect = {
			if = {
				limit = { has_country_modifier = haijin_policy_modifier }
				remove_country_modifier = haijin_policy_modifier 
			}
			custom_tooltip = mng_repeal_and_replace_tt
			add_country_modifier = {
				name = mng_great_market_of_china_modifier
				duration = -1 
			}
			
			custom_tooltip = mng_every_manufactory_1_base_production_tt
			
			custom_tooltip = mng_separate_line_reward_tt
			
			custom_tooltip = mng_replace_haijin_policy_modifier 
			tooltip = {
				add_country_modifier = {
					name = mng_reform_haijin_policy_modifier
					duration = -1 
				}
			}
			
			custom_tooltip = mng_every_coastal_province_with_20_trade_power_gains_1_base_prod_tt
		}
	}
}

ming_missions_4_dynamic_1 = {
	slot = 4
	generic = no
	ai = yes
	potential = {
		tag = MNG
		has_dlc = "Domination" 
		has_country_flag = mng_dynamic_1
	}
	has_country_shield = yes 
	
	mng_improve_haijin_policy = {
		icon = mission_asian_trader 
		required_missions = { mng_inward_perfection mng_end_sengoku_jidai } 
		position = 4
		provinces_to_highlight = { 
			owned_by = ROOT 
			has_port = yes 
			OR = { 
				province_has_center_of_trade_of_level = 1 
				has_river_estuary_trigger = yes 
			}
		} 
		
		trigger = { 
			OR = { 
				has_reform = mercantilistic_approach_reform
				dip = 6 
			}
			OR = {
				num_of_owned_provinces_with = {
					has_port = yes 
					OR = {
						has_river_estuary_trigger = yes 
						province_has_center_of_trade_of_level = 1 
					}
					has_trade_building_trigger = yes 
					value = 3
				}
				if = { 
					limit = { 
						is_emperor_of_china = yes 
						has_dlc = "Mandate of Heaven"
					}
					AND = {
						empire_of_china_has_active_decree = increase_tariff_control_decree
						if = { 
							limit = { has_estate = estate_burghers } 
							estate_loyalty = { 
								estate = estate_burghers 
								loyalty = 60 
							}
						}
						imperial_mandate = 90 
					}
				}
			}
			if = {
				limit = { has_estate = estate_eunuchs }
				OR = {
					estate_loyalty = {
						estate = estate_eunuchs 
						loyalty = 60 
					}
					NOT = { 
						num_of_estate_privileges = {
							estate = estate_eunuchs 
							value = 4 
						}
					}
				}
			}
		}	
		
		effect = {
			custom_tooltip = mng_replace_haijin_policy_modifier 
			tooltip = {
				add_country_modifier = {
					name = mng_reform_haijin_policy_modifier
					duration = -1 
				}
			}
			
			custom_tooltip = mng_every_coastal_province_with_20_trade_power_gains_1_base_prod_tt
			
			hidden_effect = { 
				remove_country_modifier = haijin_policy_modifier 
				add_country_modifier = {
					name = mng_reform_haijin_policy_modifier
					duration = -1 
				}
				every_owned_province = {
					limit = { province_trade_power = 20 }
					add_base_production = 1 
				}
			}
		}
	}
}

ming_missions_4_dynamic_2 = {
	slot = 4
	generic = no
	ai = yes
	potential = {
		has_dlc = "Domination"
		tag = MNG 
		has_country_flag = mng_dynamic_2
	}
	has_country_shield = yes 
	
	mng_repeal_haijin_policy = {
		icon = mission_dominate_persian_gulf 
		required_missions = { mng_inward_perfection mng_end_sengoku_jidai } 
		position = 4
		provinces_to_highlight = { 
			owned_by = ROOT 
			has_port = yes 
			NOT = { num_of_times_improved = 10 } 
			province_has_center_of_trade_of_level = 1  
		}
		
		trigger = { 
			OR = { 
				full_idea_group = trade_ideas 
				dip = 6 
				has_reform = free_trade_reform
			}
			is_lacking_institutions = no 
			num_of_owned_provinces_with = { 
				province_has_center_of_trade_of_level = 1
				num_of_times_improved = 10 
				value = 3 
			}
			if = { 
				limit = { has_estate = estate_eunuchs } 
				OR = {
					estate_loyalty = {
						estate = estate_eunuchs 
						loyalty = 60 
					}
					NOT = {
						estate_influence = {
							estate = estate_eunuchs 
							influence = 50 
						}
					}
					NOT = { 
						num_of_estate_privileges = {
							estate = estate_eunuchs 
							value = 2 
						}
					}
				}
			}
		}
		
		effect = {
			custom_tooltip = mng_repeal_and_replace_tt 
			if = {
				limit = { has_country_modifier = haijin_policy_modifier }
				remove_country_modifier = haijin_policy_modifier 
			}
			add_country_modifier = {
				name = mng_great_market_of_china_modifier
				duration = -1 
			}
			
			custom_tooltip = mng_every_manufactory_1_base_production_tt
			hidden_effect = {
				every_owned_province = {
					limit = { has_manufactory_trigger = yes } 
					add_base_production = 1 
				}
			}
		}
	}
}

DOM_Qing_Missions_4 = { 
	slot = 4
	generic = no
	ai = yes
	#potential_on_load = { has_dlc = "Mandate of Heaven" }
	potential = {
		has_dlc = "Domination"
		OR = {
			tag = MJZ
			tag = MCH
			tag = QNG
			#tag = KRC
			tag = MYR
			tag = EJZ
			tag = NHX
			tag = MHX
		}
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes	
	
	mjz_into_korea = {
		icon = mjz_into_korea
		required_missions = { mjz_break_through_korea }
		position = 2
		provinces_to_highlight = {
			region = korea_region 
			NOT = { country_or_subject_holds = ROOT } 
		}
		trigger = {
			num_of_provinces_owned_or_owned_by_subjects_with = {
				region = korea_region 
				value = 16
			}
			735 = { country_or_subject_holds = ROOT } 
		}
		effect = {
			country_event = { id = flavor_mch.11 } 
			custom_tooltip = mch_event_insight_11_tt
			if = { 
				limit = { has_country_modifier = mjz_dominance_of_the_horselords_modifier } 
				custom_tooltip = mjz_extend_dominance_modifier_tt
				hidden_effect = {
					remove_country_modifier = mjz_dominance_of_the_horselords_modifier
					add_country_modifier = {
						name = mjz_dominance_of_the_horselords_modifier 
						duration = 3650 
					}
				}
			}
		}
	}
	
	mch_ensure_internal_stability = { 
		icon = balance_the_estates
		required_missions = { mch_issue_seven_grievances qng_formalize_ritual_practices }
		position = 4
		trigger = {
			has_adm_advisor_3 = yes 
			has_dip_advisor_3 = yes 
			has_mil_advisor_3 = yes 
			crown_land_share = 40
			stability = 2 
			is_in_deficit = no 
		}
		
		effect = {
			add_country_modifier = {
				name = mch_5_trusted_companions_modifier
				duration = 7300
			}
			if = { 
				limit = { is_emperor_of_china = yes }
				add_meritocracy = 10 
				change_government_reform_progress = 100 
			}
			else = { change_government_reform_progress = 150 }
			if = { 
				limit = { has_country_modifier = mjz_dominance_of_the_horselords_modifier } 
				custom_tooltip = mjz_extend_dominance_modifier_tt
				hidden_effect = {
					remove_country_modifier = mjz_dominance_of_the_horselords_modifier
					add_country_modifier = {
						name = mjz_dominance_of_the_horselords_modifier 
						duration = 3650 
					}
				}
			}
		}
	}
}


ming_missions_4_b = {
	slot = 4
	generic = no
	ai = yes
	potential = {
		has_dlc = "Domination"
		is_emperor_of_china = yes
		OR = { 
			tag = QNG 
			culture_group = east_asian
			has_country_flag = enable_emperor_of_china_missions_flag
		}
		capital_scope = { continent = asia }
		
		started_in = 1368.1.1		#New added in MMETR mod, to exclude new Ancient/Medieval Chinese Warlord missions
		NOT = { tag = HND }		#New added in MMETR mod
		NOT = { tag = SNG }		#New added in MMETR mod
		if = {
			limit = {	
				tag = SHU
			}
			started_in = 280.1.1
		}
		if = {
			limit = {	
				tag = WEI
			}
			started_in = 280.1.1
		}
	}
	has_country_shield = yes 	
	
	mng_expand_bogue = {
		icon = mng_expand_bogue 
		required_missions = {  } 
		position = 5
		provinces_to_highlight = { 
			province_id = 667 
			NOT = { num_of_times_improved = 4 } 
			OR = {
				num_of_times_expanded_infrastructure = 1 
				has_trade_building_trigger = no 
			}
		} 
		
		trigger = { 
			667 = {
				num_of_times_improved = 4 
				OR = {
					num_of_times_expanded_infrastructure = 1 
					has_trade_building_trigger = yes 
				}
			}
			if = { 
				limit = { has_estate = estate_burghers }
				estate_loyalty = {
					estate = estate_burghers 
					loyalty = 60 
				}
			}
		}
		
		effect = {
			custom_tooltip = mng_pearly_estuary_upgraded_tt
			hidden_effect = {
				667 = {
					remove_province_modifier = pearl_estuary_modifier
					add_province_modifier = {
						name = mng_bogue_modifier 
						duration = -1 
					}
				}
				if = { 
					limit = { has_dlc = "Leviathan" }
					custom_tooltip = mng_10_loyalty_for_burghers_on_expand_infr_tt
					set_country_flag = mng_10_loyalty_for_burghers_on_expand_infr_flag
				}
				else = { add_adm_power = 100 }
			}
		}
	}
	
	mng_jing_hang_grand_canal = {
		icon = mng_jing_hang_grand_canal 
		required_missions = { mng_tame_china_sorrow mng_expand_bogue } 
		position = 6
		provinces_to_highlight = { 
			OR = { 
				province_id = 684 
				province_id = 1822 
				province_id = 2145 
				province_id = 1821
			}
			OR = { 
				NOT = { num_of_buildings_in_province = 3 }
				has_production_building_trigger = no 
				NOT = { num_of_times_expanded_infrastructure = 1 }
			}
		}
		
		trigger = {
			if = { 
				limit = { has_dlc = "Leviathan" }
				684 = {
					OR = { 
						has_great_project = {
							type = grand_canal_1
							tier = 2 
						}
						AND = {
							num_of_buildings_in_province = 3
							has_production_building_trigger = yes 
							num_of_times_expanded_infrastructure = 1 
						}
					}
				}
			}
			else = { 
				684 = { num_of_times_improved = 5 }
			} 
			if = {
				limit = { has_dlc = "Mandate of Heaven" }
				684 = {
					NOT = { devastation = 1 } 
				}
			}
			else = { 
				684 = {
					NOT = { local_autonomy_above_min = 5 } 
				}
			}
			if = { 
				limit = { has_dlc = "Leviathan" }
				1822 = { 
					OR = { 
						has_great_project = {
							type = grand_canal_2
							tier = 2 
						}
						AND = {
							num_of_buildings_in_province = 3
							has_production_building_trigger = yes 
							num_of_times_expanded_infrastructure = 1 
						}
					}
				}
			}
			else = { 
				1822 = { num_of_times_improved = 5 }
			} 
			if = {
				limit = { has_dlc = "Mandate of Heaven" }
				1822 = {
					NOT = { devastation = 1 } 
				}
			}
			else = { 
				1822 = {
					NOT = { local_autonomy_above_min = 5 } 
				}
			}
			if = { 
				limit = { has_dlc = "Leviathan" }
				2145 = { 
					OR = { 
						has_great_project = {
							type = grand_canal_3
							tier = 2 
						}
						AND = {
							num_of_buildings_in_province = 3
							has_production_building_trigger = yes 
							num_of_times_expanded_infrastructure = 1 
						}
					}
				}
			}
			else = { 
				2145 = { num_of_times_improved = 5 }
			} 
			if = {
				limit = { has_dlc = "Mandate of Heaven" }
				2145 = {
					NOT = { devastation = 1 } 
				}
			}
			else = { 
				2145 = {
					NOT = { local_autonomy_above_min = 5 } 
				}
			}
			if = { 
				limit = { has_dlc = "Leviathan" }
				1821 = { 
					OR = { 
						has_great_project = {
							type = grand_canal_4
							tier = 2 
						}
						AND = {
							num_of_buildings_in_province = 3
							has_production_building_trigger = yes 
							num_of_times_expanded_infrastructure = 1 
						}
					}
				}
			}
			else = { 
				1821 = { num_of_times_improved = 5 }
			} 
			if = {
				limit = { has_dlc = "Mandate of Heaven" }
				1821 = {
					NOT = { devastation = 1 } 
				}
			}
			else = { 
				1821 = {
					NOT = { local_autonomy_above_min = 5 } 
				}
			}
		}
		
		effect = { 
			country_event = { id = flavor_mng.34 }
			custom_tooltip = mng_insight_34_tt 
		}
	}
	
	mng_expand_yongle_dadian = {
		icon = mng_expand_yongle_dadian 
		required_missions = { mng_single_whip_law mng_fortify_coast  } 
		position = 8
		provinces_to_highlight = {
			owned_by = ROOT 
			trade_goods = paper 
			OR = {
				NOT = { base_production = 10 }
				has_production_building_trigger = no
			}
		}
		
		trigger = {
			if = { 
				limit = { 
					has_dlc = "Mandate of Heaven" 
					is_emperor_of_china = yes 
				}
				imperial_mandate = 80 
			}
			else = { prestige = 40 }
			num_of_owned_provinces_with = { 
				trade_goods = paper 
				base_production = 10 
				has_production_building_trigger = yes 
				value = 4 
			}
			OR = { 
				if = { 
					limit = { has_dlc = "Rights of Man" }
					ruler_has_personality = free_thinker_personality 
				}
				else = { monthly_adm = 9 } 
				if = { 
					limit = { has_dlc = "Rights of Man" }
					ruler_has_personality = scholar_personality 
				}
				else = { has_adm_advisor_3 = yes }
				full_idea_group = innovativeness_ideas 
				has_institution = printing_press 
			}	
		}
		
		effect = {
			if = { 
				limit = { has_dlc = "Rule Britannia" }
				change_innovativeness = 5 
			}
			else = { add_adm_power = 50 add_dip_power = 50 add_mil_power = 50 } 
			
			custom_tooltip = mng_every_province_requirements_tt
			tooltip = { 
				add_province_modifier = { 
					name = mng_imperial_printing_center_modifier
					duration = -1 
				}
			}
			
			custom_tooltip = mng_before_printing_press_embraced_tt
			hidden_effect = { 
				every_owned_province = { 
					limit = {
						trade_goods = paper 
						base_production = 10 
						has_production_building_trigger = yes 
					}
					add_institution_embracement = {
						which = printing_press 
						value = 100 
					}
					add_province_modifier = { 
						name = mng_imperial_printing_center_modifier
						duration = -1 
					}
				}
			}
		}
	}
}

ming_missions_4_moh = {
	slot = 4
	generic = no
	ai = yes
	potential = {
		is_emperor_of_china = yes 
		OR = { 
			tag = QNG 
			culture_group = east_asian
			has_country_flag = enable_emperor_of_china_missions_flag
		}
		capital_scope = { continent = asia }
		has_dlc = "Mandate of Heaven" 
		has_dlc = "Domination"
		
		started_in = 1368.1.1		#New added in MMETR mod, to exclude new Ancient/Medieval Chinese Warlord missions
		NOT = { tag = HND }		#New added in MMETR mod
		NOT = { tag = SNG }		#New added in MMETR mod
		if = {
			limit = {	
				tag = SHU
			}
			started_in = 280.1.1
		}
		if = {
			limit = {	
				tag = WEI
			}
			started_in = 280.1.1
		}
	}
	has_country_shield = yes 

	mng_heavens_will = {
		icon = mng_heavens_will 
		required_missions = { mng_expand_yongle_dadian } 
		position = 9 
		
		trigger = { 
			empire_of_china_num_reforms_passed = 15 
			is_emperor_of_china = yes 
			stability = 3 
			if = { 
				limit = { has_dlc = "Emperor" }
				is_hegemon = yes 
			}
			else = { total_development = 2000 }
			has_regency = no 
		}
		
		effect = {
			country_event = { id = flavor_mng.38 } 
			set_country_flag = mng_mandate_unleashed_flag
			custom_tooltip = mng_insight_38_tt
		}
	}
}

DOM_Qing_Missions_4_b = { 
	slot = 4
	generic = no
	ai = yes
	#potential_on_load = { has_dlc = "Mandate of Heaven" }
	potential = {
		tag = QNG
		NOT = { map_setup = map_setup_random }
		has_dlc = "Domination"
	}
	has_country_shield = yes
	
	qng_balance_mandate = {
		icon = qng_balance_mandate 
		required_missions = {  } 
		position = 10
		trigger = {
			if = {
				limit = { is_emperor_of_china = yes } 
				imperial_mandate = 75 
				empire_of_china_num_reforms_passed = 1
				meritocracy = 80 
			}
			else = { 
				legitimacy_equivalent = 90 
				has_adm_advisor_3 = yes 
				has_dip_advisor_3 = yes 
				has_mil_advisor_3 = yes 
			}
			stability = 3 
			OR = { 
				monthly_adm = 10 
				monthly_dip = 10 
				monthly_mil = 10 
			}
		}
		
		effect = {
			if = { 
				limit = { is_emperor_of_china = yes } 
				add_country_modifier = {
					name = qng_new_chinese_dynasty_modifier
					duration = 7300 
				}
			}
			else = {
				change_ruler_stat = {
					stat = adm
					amount = 2
				}
			}
			add_prestige_or_monarch_power = { amount = 25 } 
		}
	}
	
	qng_high_qing_era = {
		icon = qng_high_qing_era 
		required_missions = { qng_balance_mandate } 
		position = 12
		trigger = {
			OR = { 
				AND = { 
					in_golden_age = yes 
					monthly_income = 300 
				}
				AND = {
					grown_by_development = 1250
					if = { 
						limit = { 
							OR = { 
								has_dlc = "Rights of Man" 
								has_dlc = "Emperor"
							}
						}
						NOT = { great_power_rank = 4 }
					}
				}
				AND = { 
					is_emperor_of_china = yes 
					stability = 3 
					imperial_mandate = 85
					empire_of_china_num_reforms_passed = 8
				}
			}
		}
		effect = {
			country_event = { id = flavor_mch.13 }
		}
	}
	
	qng_library_four_treasuries = {
		icon = mission_scholar_officials
		required_missions = { qng_high_qing_era }
		trigger = {
			if = {
				limit = {
					is_revolutionary = no
				}
				absolutism = 50
			}
			num_of_owned_provinces_with = {
				has_building = university 
				value = 20 
			}
		}
		effect = {
			add_country_modifier = {
				name = "library_of_the_four_treasuries"
				duration = -1
			}
			if = {
				limit = { has_dlc = "Rule Britannia" }
				change_innovativeness = 3 
			}
		}
	}
}

chinese_kingdoms_5 = {
	slot = 5
	generic = no
	ai = yes
	potential = {
		has_dlc = "Domination"
		OR = {
			tag = YAN
			tag = JIN
			tag = QIN
			tag = QIC
			tag = CSH
			tag = LNG
			tag = TNG
			tag = CXI
			tag = CHC
			tag = WUU
			tag = NNG
			tag = MIN
			tag = HUA
			tag = YUE
			tag = CMI
			tag = CYI
			tag = CDL
			tag = CGS
			tag = FRM
			
			#New changed in MMETR
			AND = {
				tag = SHU
				started_in = 280.1.1
			}
		}
		started_in = 1368.1.1		#New added in MMETR mod, to exclude new Ancient/Medieval Chinese Warlord missions
		NOT = { map_setup = map_setup_random }
	}
	
	settle_internal_affairs = {
		icon = balance_the_estates 
		required_missions = {  } 
		position = 1
		
		trigger = {
			if = {
				limit = { has_estate = estate_burghers }
				estate_loyalty = {
					estate = estate_burghers 
					loyalty = 55
				}
			}
			if = {
				limit = { has_estate = estate_nobles }
				estate_loyalty = {
					estate = estate_nobles 
					loyalty = 55 
				}
			}
			if = {
				limit = { has_estate = estate_church }
				estate_loyalty = {
					estate = estate_church 
					loyalty = 55 
				}
			}
			if = {
				limit = { has_estate = estate_eunuchs }
				estate_loyalty = {
					estate = estate_eunuchs 
					loyalty = 55 
				}
			}
			NOT = { num_of_loans = 1 } 
			stability = 1
		}
		
		effect = {
			add_country_modifier = {
				name = chi_stable_court_modifier
				duration = 9125 
			}
		}
	}
	
	renovate_capital = {
		icon = mission_pol_develop_countryside 
		required_missions = { settle_internal_affairs } 
		position = 2
		provinces_to_highlight = { is_capital_of = ROOT }
		trigger = {
			capital_scope = {
				num_of_times_improved = 10 
				has_tax_building_trigger = yes 
				has_trade_building_trigger = yes 
			}
		}
		
		effect = {
			if = {
				limit = { is_emperor_of_china = yes }
				add_meritocracy = 10 
				add_mandate = 15
			}
			else = { 
				add_legitimacy = 25 
			}
			capital_scope = { 
				add_next_institution_embracement = 25 
				if = {
					limit = { has_dlc = "Mandate of Heaven" } 
					
					add_prosperity = 100 
				}
			}
			if = {
				limit = { has_dlc = "Mandate of Heaven" }
				add_splendor = 200 
			}
			else = { add_adm_power = 100 } 
		}
	}
	
	china_prime_entrepot = {
		icon = mission_growth_of_surat 
		required_missions = { renovate_capital } 
		position = 4
		provinces_to_highlight = {
			OR = {
				province_id = 679
				province_id = 667
				province_id = 1821
				province_id = 1816
			}
			OR = {
				NOT = { country_or_non_sovereign_subject_holds = ROOT  } 
				NOT = { base_production = 15 }
				NOT = { province_trade_power = 100 }
				has_trade_building_trigger = no 
			}
		}
		trigger = {
			OR = {
				679 = { 
					country_or_non_sovereign_subject_holds = ROOT 
					has_trade_building_trigger = yes 
					OR = {
						base_production = 15 
						province_trade_power = 100
					}
				}
				667 = { 
					country_or_non_sovereign_subject_holds = ROOT 
					has_trade_building_trigger = yes 
					OR = {
						base_production = 15 
						province_trade_power = 100
					}
				}
				1821 = { 
					country_or_non_sovereign_subject_holds = ROOT 
					has_trade_building_trigger = yes 
					OR = {
						base_production = 15 
						province_trade_power = 100
					}
				}
				1816 = { 
					country_or_non_sovereign_subject_holds = ROOT 
					has_trade_building_trigger = yes 
					OR = {
						base_production = 15 
						province_trade_power = 100
					}
				}
			}
		}
		
		effect = {
			custom_tooltip = chi_each_req_province_gets_tt
			tooltip = {
				add_province_modifier = {
					name = chi_imperial_center_of_commerce_modifier
					duration = -1 
				}
			}
			add_mercantilism = 10 
			hidden_effect = {
				if = {
					limit = { 
						679 = { country_or_non_sovereign_subject_holds = ROOT } 
					}
					679 = {
						add_province_modifier = {
							name = chi_imperial_center_of_commerce_modifier
							duration = -1 
						}
					}
				}
				if = {
					limit = { 
						667 = { country_or_non_sovereign_subject_holds = ROOT } 
					}
					667 = {
						add_province_modifier = {
							name = chi_imperial_center_of_commerce_modifier
							duration = -1 
						}
					}
				}
				if = {
					limit = { 
						1821 = { country_or_non_sovereign_subject_holds = ROOT } 
					}
					1821 = {
						add_province_modifier = {
							name = chi_imperial_center_of_commerce_modifier
							duration = -1 
						}
					}
				}
				if = {
					limit = { 
						1816 = { country_or_non_sovereign_subject_holds = ROOT } 
					}
					1816 = {
						add_province_modifier = {
							name = chi_imperial_center_of_commerce_modifier
							duration = -1 
						}
					}
				}
			}
		}
	}
}		
	

ming_missions_5 = {
	slot = 5
	generic = no
	ai = yes
	potential = {
		has_dlc = "Domination"
		tag = MNG 
	}
	has_country_shield = yes 

	mng_thirteen_provinces = {
		icon = mng_thirteen_provinces 
		required_missions = {  } 
		position = 1
		provinces_to_highlight = {
			OR = { 
				is_capital_of = DAI 
				AND = { 
					area = red_river_delta_area
					NOT = { country_or_non_sovereign_subject_holds = ROOT } 
				}
			}
		}		
		trigger = { 
			OR = { 
				red_river_delta_area = {
					type = all 
					country_or_non_sovereign_subject_holds = ROOT 
				}
				DAI = { 
					is_subject_of = ROOT 
					NOT = { liberty_desire = 5 } 
					has_opinion = {
						who = ROOT 
						value = 150 
					}
					red_river_delta_area = {
						type = all 
						country_or_non_sovereign_subject_holds = DAI 
					}
				}
			}
		}
		
		effect = {
			custom_tooltip = mng_diplomatic_reward_dai_viet_tt
			tooltip = { 
				MNG = {
					add_mandate = 10
					add_historical_friend = DAI 
					add_dip_power = 100 
				}
				DAI = { 
					custom_tooltip = gain_10_crownland_tt
					hidden_effect = {
						change_estate_land_share = {
							estate = all 
							share = -10 
						}
					}
					add_country_modifier = {
						name = mng_backed_by_emperor_of_china_modifier 
						duration = 9125 
					}
					if = { 
						limit = { has_estate_privilege = estate_nobles_command_of_the_military } 
						remove_estate_privilege = estate_nobles_command_of_the_military 
					}
					add_historical_friend = ROOT 
				}
			}
			
			custom_tooltip = mng_conquest_reward_dai_viet_tt
			tooltip = { 
				red_river_delta_area = {
					add_nationalism = -10 
				}
			}
			
			hidden_effect = {
				if = {
					limit = { 
						DAI = { 
							is_subject_of_type_with_overlord = {
								who = ROOT 
								type = tributary_state
							}
							red_river_delta_area = {
								type = all 
								country_or_non_sovereign_subject_holds = DAI 
							}
						}
					}
					DAI = { 
						change_estate_land_share = {
							estate = all 
							share = -10 
						}
						add_country_modifier = {
							name = mng_backed_by_emperor_of_china_modifier 
							duration = 9125 
						}
						if = { 
							limit = { has_estate_privilege = estate_nobles_command_of_the_military } 
							remove_estate_privilege = estate_nobles_command_of_the_military 
						}
						add_historical_friend = ROOT 
					}
					add_mandate = 10
					add_historical_friend = DAI 
					add_dip_power = 100 
				}
				else = { 
					red_river_delta_area = { add_nationalism = -10 } 
					update_entire_culture_foreign = {
						culture = vietnamese
					}
				}
			}
		}
	}
	
	mng_end_sengoku_jidai = {
		icon = mng_end_sengoku_jidai 
		required_missions = { mng_kingdom_joseon mng_thirteen_provinces } 
		position = 3
		provinces_to_highlight = { 
			OR = {
				province_id = 1020
				region = japan_region 
			}
		}		
		trigger = { 
			OR = { 
				1020 = { 
					owner = { 
						has_opinion = {
							who = ROOT 
							value = 170 
						}
						trust = {
							who = ROOT 
							value = 75 
						}
					}
				}
				AND = { 
					num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {	
						region = japan_region 
						value = 10 
					}
					1020 = { country_or_non_sovereign_subject_holds = ROOT } 
				}
			}
			OR = {
				custom_trigger_tooltip = {
					tooltip = mng_has_had_ashikaga_petitions_for_open_trade_event_tt
					has_country_flag = mng_has_had_ashikaga_petitions_for_open_trade_event_flag
				}
				1376 = {
					trade_share = {
						country = ROOT 
						share = 50 
					}
				}
			}
		}
		
		effect = {
			custom_tooltip = mng_conquest_japan_reward_tt
			tooltip = { 
				1020 = { 
					if = { 
						limit = { 
							owner = { 
								NOT = { is_subject_of = ROOT }
								NOT = { tag = ROOT }
							}
							has_dlc = "Mandate of Heaven" 
						}
						owner = { 
							reverse_add_casus_belli = {
								target = MNG
								type = cb_force_tributary_mission
								months = 120
							}
						}
					}
					else_if = {
						limit = { 
							owner = { 
								NOT = { is_subject_of = ROOT }
								NOT = { tag = ROOT }
							}
							NOT = { has_dlc = "Mandate of Heaven" }
						}
						reverse_add_casus_belli = {
							target = ROOT
							type = cb_vassalize_mission
							months = 120
						}
					}
				}
				add_country_modifier = {
					name = mng_eastern_campaigns_modifier
					duration = 7300 
				}
				if = { 
					limit = { 
						has_dlc = "Leviathan" 
						1020 = { country_or_non_sovereign_subject_holds = ROOT } 
					}
					1020 = {
						add_great_project_tier = { 
							type = imperial_city_kyoto
							tier = 1 
						}
					}
				}
				else_if = {
					limit = { 
						1020 = { country_or_non_sovereign_subject_holds = ROOT } 
					}
					1020 = { add_base_tax = 3 add_base_production = 3 add_base_manpower = 3 } 
				}
			}
			
			custom_tooltip = mng_diplomatic_reward_japan_tt
			tooltip = {
				1020 = { 
					if = {
						limit = { 
							NOT = { owned_by = ROOT }
						}
						owner = { 
							country_event = { id = flavor_mng.39 }
						}
						custom_tooltip = mng_insight_39_tt
					}
					else = {
						add_country_modifier = {
							name = mng_sinicization_of_japan_modifier
							duration = -1 
						}
					}
				}
			}
			
			
			hidden_effect = { 
				if = {
					limit = {
						num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {	
							region = japan_region 
							value = 10 
						}
						1020 = { country_or_non_sovereign_subject_holds = ROOT } 
					}
					1020 = { 
						if = { 
							limit = { 
								owner = { 
									NOT = { is_subject_of = ROOT }
								}
								has_dlc = "Mandate of Heaven" 
							}
							owner = { 
								reverse_add_casus_belli = {
									target = MNG
									type = cb_force_tributary_mission
									months = 120
								}
							}
						}
						else_if = {
							limit = { 
								owner = { 
									NOT = { is_subject_of = ROOT }
								}
								NOT = { has_dlc = "Mandate of Heaven" }
							}
							reverse_add_casus_belli = {
								target = MNG
								type = cb_vassalize_mission
								months = 120
							}
						}
					}
					add_country_modifier = {
						name = mng_eastern_campaigns_modifier
						duration = 7300 
					}
					if = { 
						limit = { has_dlc = "Leviathan" }
						1020 = { 
							add_great_project_tier = { 
								type = imperial_city_kyoto
								tier = 1 
							}
						}
					}
					else = { 
						1020 = { 
							add_base_manpower = 3 
							add_base_tax = 3 
							add_base_production = 3 
						}
					}
				}
				else = {
					1020 = { 
						if = {
							limit = { 
								NOT = { owned_by = ROOT }
							}
							owner = { 
								country_event = { id = flavor_mng.39 }
							}
						}
						else = {
							add_country_modifier = {
								name = mng_sinicization_of_japan_modifier
								duration = -1 
							}
						}
					}
				}
			}
		}
	}
}

DOM_Qing_Missions_5 = { 
	slot = 5
	generic = no
	ai = yes
	#potential_on_load = { has_dlc = "Mandate of Heaven" }
	potential = {
		has_dlc = "Domination"
		OR = {
			tag = MJZ
			tag = MCH
			tag = QNG
			#tag = KRC
			tag = MYR
			tag = EJZ
			tag = NHX
			tag = MHX
		}
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes	
	
	mjz_break_through_korea = {
		icon = mission_conquer_50_development
		required_missions = { }
		position = 1
		provinces_to_highlight = {
			OR = { 
				area = hamgyeong_area 
				area = pyongan_area 
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT } 
		}
		trigger = {
			pyongan_area = {
				type = all 
				country_or_subject_holds = ROOT
			} 
			hamgyeong_area = {
				type = all 
				country_or_subject_holds = ROOT
			}
		}
		
		effect = { 
			add_country_modifier = {
				name = mjz_dominance_of_the_horselords_modifier
				duration = 3650 
			}
			custom_tooltip = mjz_extend_this_every_conquest_mission_tt
			
			korea_region = {
				limit = { 
					NOT = { owned_by = ROOT } 
					NOT = { is_core = ROOT } 
				}
				add_permanent_claim = ROOT 
			}
		}
	}	
	
	mjz_mount_paektu = {
		icon = mission_buddhist_monk_praying
		required_missions = { mjz_break_through_korea }
		position = 2
		provinces_to_highlight = {
			province_id = 4201
			OR = {
				NOT = { owned_by = ROOT is_core = ROOT }
				has_tax_building_trigger = no
			}
		}
		trigger = {
			owns_core_province = 4201
			4201 = { has_tax_building_trigger = yes }
		}
		effect = {
			add_country_modifier = {
				name = "mch_sacred_mountain"
				duration = 7300
			}
			add_corruption = -1 
			4201 = { 
				remove_building = temple 
				add_building = cathedral 
			}
			
			if = { 
				limit = { has_country_modifier = mjz_dominance_of_the_horselords_modifier } 
				custom_tooltip = mjz_extend_dominance_modifier_tt
				hidden_effect = {
					remove_country_modifier = mjz_dominance_of_the_horselords_modifier
					add_country_modifier = {
						name = mjz_dominance_of_the_horselords_modifier 
						duration = 3650 
					}
				}
			}
		}
	}
	
	qng_formalize_ritual_practices = {
		icon = mission_hands_praying
		required_missions = { mjz_mount_paektu }
		position = 3
		trigger = {
			OR = { 
				custom_trigger_tooltip = {
					tooltip = yellow_shamanism_tt
					has_country_modifier = yellow_shamanism_modifier
				}
				custom_trigger_tooltip = {
					tooltip = black_shamanism_tt
					has_country_modifier = black_shamanism_modifier
				}
				AND = { 
					is_emperor_of_china = yes 
					religion = confucianism 
					harmony = 80 
				}
			}
			religious_unity = 0.95 
			stability = 1 
		}
		
		effect = { 
			custom_tooltip = yellow_shamanism_reward_tt
			tooltip = { 
				add_country_modifier = { 
					name = mjz_formalized_yellow_shamanism_modifier 
					duration = 9125 
				}
			}
			
			custom_tooltip = black_shamanism_reward_tt
			tooltip = { 
				add_country_modifier = { 
					name = mjz_formalized_black_shamanism_modifier 
					duration = 9125 
				}
			}
			
			custom_tooltip = confucianism_reward_tt
			tooltip = { 
				add_country_modifier = { 
					name = mjz_formalized_confucian_practices_modifier 
					duration = -1
				}
			}
			
			hidden_effect = {
				if = { 
					limit = { has_country_modifier = yellow_shamanism_modifier }
					add_country_modifier = { 
						name = mjz_formalized_yellow_shamanism_modifier 
						duration = 9125 
					}
				}
				else_if = { 
					limit = { has_country_modifier = black_shamanism_modifier }
					add_country_modifier = { 
						name = mjz_formalized_black_shamanism_modifier 
						duration = 9125 
					}
				}
				else_if = { 
					limit = { religion = confucianism }
					add_country_modifier = { 
						name = mjz_formalized_confucian_practices_modifier 
						duration = -1
					}
				}
			}
		}
	}
}

ming_missions_5_b = {
	slot = 5
	generic = no
	ai = yes
	potential = {
		has_dlc = "Domination"
		is_emperor_of_china = yes 
		OR = { 
			tag = QNG 
			culture_group = east_asian
			has_country_flag = enable_emperor_of_china_missions_flag
		}
		capital_scope = { continent = asia }
		
		started_in = 1368.1.1		#New added in MMETR mod, to exclude new Ancient/Medieval Chinese Warlord missions
		NOT = { tag = HND }		#New added in MMETR mod
		NOT = { tag = SNG }		#New added in MMETR mod
		if = {
			limit = {	
				tag = SHU
			}
			started_in = 280.1.1
		}
		if = {
			limit = {	
				tag = WEI
			}
			started_in = 280.1.1
		}
	}
	has_country_shield = yes 
	
	mng_form_depots = {
		icon = mng_form_depots 
		required_missions = {  } 
		position = 5
		provinces_to_highlight = {
			OR = { 
				province_id = 696 
				province_id = 4194
			}
		} 
		trigger = { 
			OR = { 
				spymaster = 1 
				ruler_has_personality = intricate_web_weaver_personality
				dip = 5 
				has_idea = efficient_spies
				national_focus = DIP 
			}
			OR = { 
				696 = { 
					development = 15 
					owned_by = ROOT 
				}
				4194 = {
					development = 15 
					owned_by = ROOT 
				}
			}
			if = { 
				limit = { has_estate = estate_eunuchs } 
				estate_loyalty = {
					estate = estate_eunuchs 
					loyalty = 60 
				}
			}
		}
		
		effect = {
			country_event = { id = flavor_mng.40 }
			custom_tooltip = mng_insight_40_tt
		}
	}
	
	mng_outer_city_beijing = {
		icon = mng_outer_city_beijing 
		required_missions = { mng_form_depots } 
		position = 6
		provinces_to_highlight = { 
			province_id = 1816 
			OR = { 
				has_tax_building_trigger = no 
				has_production_building_trigger = no 
				has_trade_building_trigger = no 
				has_manpower_building_trigger = no 
			}
		} 
		
		trigger = { 
			1816 = { development = 35 }
			1816 = { 
				has_tax_building_trigger = yes
				has_production_building_trigger = yes  
				has_trade_building_trigger = yes  
				has_manpower_building_trigger = yes 
			}
			1816 = { 
				OR = { 
					if = {
						limit = { has_dlc = "Mandate of Heaven" } 
						prosperity = 50 
					}
					if = { 
						limit = { has_dlc = "Leviathan" } 
						num_of_times_expanded_infrastructure = 1
					}
					else = { num_of_times_improved = 5 } 
				}
			}
		}
		
		effect = {	
			if = {
				limit = { 
					1816 = { has_manufactory_trigger = no } 
				}
				1816 = {
					add_province_modifier = {
						name = mng_outer_wall_beijing_modifier
						duration = -1 
						desc = until_it_is_conquered_desc
					}
				}
				custom_tooltip = mng_can_build_imperial_granary_tt
			}
			else = {
				1816 = {
					add_province_modifier = {
						name = mng_outer_wall_beijing_and_imperial_granary_modifier
						duration = -1
					}
				}
			}
		}
	}
	
	mng_fortify_coast = {
		icon = mission_portuguese_malacca 
		required_missions = { mng_outer_city_beijing mng_jing_hang_grand_canal } 
		position = 7
		provinces_to_highlight = { 
			owned_by = ROOT 
			has_port = yes 
			OR = {
				has_coast_defense_building_trigger = no 
				NOT = { development = 20 }
				devastation = 1 
			}
		} 
		
		trigger = { 
			if = {
				limit = { has_dlc = "Mandate of Heaven" } 
				NOT = { 
					any_owned_province = {
						has_port = yes 
						devastation = 1 
					}
				}
			}
			num_of_owned_provinces_with = { 
				has_coast_defense_building_trigger = yes 
				development = 20 
				value = 8 
			}
			OR = { 
				num_of_galley = 50 
				num_of_light_ship = 50
			}
			if = { 
				limit = { tag = MNG }
				OR = {
					mission_completed = mng_repeal_haijin_policy
					mission_completed = mng_improve_haijin_policy
				}
			}
			else = {
				OR = { 
					full_idea_group = trade_ideas 
					dip = 6 
					monthly_dip = 10 
					national_focus = DIP 
				}
			}
		}
		
		effect = {
			custom_tooltip = mng_improve_haijin_policy_reward_tt
			tooltip = {
				add_province_modifier = {
					name = mng_safe_coasts_modifier
					duration = 9125 
				}
				if = {
					limit = { has_dlc = "Mandate of Heaven" }
					add_prosperity = 100 
				}
				else = { add_base_production = 1 } 
			}
			
			custom_tooltip = mng_repeal_and_replace_reward_policy_tt
			tooltip = {
				define_advisor = {
					type = trader 
					cost_multiplier = 0.1 
				}
				if = { 
					limit = { 
						is_emperor_of_china = yes
						has_dlc = "Mandate of Heaven" 
					}
					add_mandate = 10 
				}
				else = { add_prestige_or_monarch_power = { amount = 25 } }
				change_government_reform_progress = 100 
			}
			
			hidden_effect = { 
				if = {
					limit = { mission_completed = mng_repeal_haijin_policy }
					define_advisor = {
						type = trader 
						cost_multiplier = 0.1 
					}
					if = { 
						limit = { 
							is_emperor_of_china = yes
							has_dlc = "Mandate of Heaven" 
						}
						add_mandate = 10 
					}
					else = { 
						add_prestige_or_monarch_power = { amount = 25 }
					}
					change_government_reform_progress = 100 
					set_country_flag = mng_trade_eff_per_dip_advisor_level_flag
				}
				else = {
					if = {
						limit = { has_dlc = "Mandate of Heaven" }
						every_owned_province = {
							limit = {
								has_coast_defense_building_trigger = yes 
								development = 20 
							}
							add_province_modifier = {
								name = mng_safe_coasts_modifier
								duration = 9125 
							}
							add_prosperity = 100 
						}
					}
					else = {
						every_owned_province = {
							limit = {
								has_coast_defense_building_trigger = yes 
								development = 20 
							}
							add_province_modifier = {
								name = mng_safe_coasts_modifier
								duration = 9125 
							}
							add_base_production = 1
						}
					}
					set_country_flag = mng_dev_per_adm_advisor_level_flag
					if = {
						limit = { has_dlc = "Mandate of Heaven" }
						add_mandate = 10
					}
					else = {
						owner = {
							add_prestige_or_monarch_power = { amount = 25 }
						}
					} 
				}
			}
		}
	}
}
	
DOM_Qing_Missions_5_dynamic_b = { 
	slot = 5
	generic = no
	ai = yes
	#potential_on_load = { has_dlc = "Mandate of Heaven" }
	potential = {
		has_dlc = "Domination"
		tag = QNG
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes	
	
	qng_regulate_trade = {
		icon = mission_dominate_gujarati_trade
		required_missions = { } 
		position = 10		
		trigger = {
			has_institution = global_trade
			num_of_ports = 25
			num_of_owned_provinces_with = {
				has_trade_building_trigger = yes
				value = 12 
			}
			4233 = {
				trade_share = {
					country = ROOT 
					share = 50 
				}
			}
			684 = {
				trade_share = {
					country = ROOT 
					share = 50 
				}
			}
			1371 = {
				trade_share = {
					country = ROOT 
					share = 50 
				}
			}
			OR = { 
				has_reform = free_trade_reform
				has_reform = mercantilistic_approach_reform
			}
			OR = {
				full_idea_group = trade_ideas 
				dip = 6 
				if = {
					limit = { has_estate = estate_burghers }
					AND = { 
						num_of_estate_agendas_completed = { estate = estate_burghers value = 10 } 
						num_of_estate_privileges = { estate = estate_burghers value = 5 } 
						estate_loyalty = {
							estate = estate_burghers 
							loyalty = 70 
						}
					}
				}
			}
		}
		
		effect = {
			tooltip = { swap_non_generic_missions = yes } 
			custom_tooltip = qng_free_trade_reward_tt
			tooltip = {
				add_country_modifier = {
					name = qng_free_trade_modifier
					duration = 9125 
				}
			}
			
			custom_tooltip = qng_mercantilism_reawrd_tt
			tooltip = {
				add_country_modifier = {
					name = qng_mercantilism_modifier
					duration = -1 
				}
			}
			
			hidden_effect = {
				if = { 
					limit = { has_reform = free_trade_reform }
					add_country_modifier = {
						name = qng_free_trade_modifier
						duration = 9125 
					}
					set_country_flag = qng_open_ports_flag
					clr_country_flag = qng_close_ports_flag
					swap_non_generic_missions = yes 
				}
				else = {
					add_country_modifier = {
						name = qng_mercantilism_modifier
						duration = -1 
					}
					set_country_flag = qng_close_ports_flag
					clr_country_flag = qng_open_ports_flag
					swap_non_generic_missions = yes 
				}
			}
		}
	}
}

DOM_Qing_Missions_5_intial = { 
	slot = 5
	generic = no
	ai = yes
	#potential_on_load = { has_dlc = "Mandate of Heaven" }
	potential = {
		has_dlc = "Domination"
		tag = QNG
		NOT = { map_setup = map_setup_random }
		NOT = { has_country_flag = qng_close_ports_flag }
		NOT = { has_country_flag = qng_open_ports_flag } 
	}
	has_country_shield = yes	
	
	qng_branching_mission_trade_1 = {
		icon = mission_unknown_mission 
		required_missions = { qng_regulate_trade }
		position = 11
		
		trigger = {
			custom_trigger_tooltip = {
				tooltip = qng_branching_mission_open_tt
				always = no 
			}
			calc_true_if = {
				all_subject_country = {
					is_colonial_nation_of = ROOT 
				}
				amount = 5 
			}
			trade_income_percentage = 0.35
			navy_size = 300
			custom_trigger_tooltip = {
				tooltip = qng_branching_mission_isolated_tt
				always = no 
			}
			num_of_owned_provinces_with = {
				trade_goods = chinaware
				has_manufactory_trigger = yes 
				base_production = 12 
				value = 5 
			}
			num_of_owned_provinces_with = {
				has_manufactory_trigger = yes 
				value = 25
			}
		}
		
		effect = {
			custom_tooltip = qng_explain_afe_tt
			
			custom_tooltip = qng_explain_pli_tt
		}
	}
	
	qng_branching_mission_trade_2 = {
		icon = mission_unknown_mission 
		required_missions = { qng_branching_mission_trade_1 qng_high_qing_era }
		position = 13
		
		trigger = {
			custom_trigger_tooltip = {
				tooltip = qng_branching_mission_open_tt
				always = no 
			}
			if = {
				limit = { 
					has_dlc = "Rule Britannia" 
				}
				num_of_owned_provinces_with = {
					has_building = furnace 
					value = 4 
				}
				trading_bonus = {
					trade_goods = coal 
					value = yes 
				}
			}
			else = {
				num_of_owned_provinces_with = {
					has_production_building_trigger = yes 
					value = 30
				}
			}
			num_of_trading_bonuses = 10
			num_of_owned_provinces_with = {
				has_manufactory_trigger = yes 
				value = 50 
			}
			has_institution = industrial_revolution 
			custom_trigger_tooltip = {
				tooltip = qng_branching_mission_isolated_tt
				always = no 
			}
			4233 = {
				trade_share = {
					country = ROOT 
					share = 75
				}
			}
			684 = {
				trade_share = {
					country = ROOT 
					share = 75
				}
			}
			1371 = {
				trade_share = {
					country = ROOT 
					share = 75
				}
			}
			home_trade_node = { highest_value_trade_node = yes } 
			mercantilism = 100 
			num_of_light_ship = 200
		}
		
		effect = {
			custom_tooltip = qng_explain_cir_tt
			
			custom_tooltip = qng_explain_ldp_tt
		}
	}
}

DOM_Qing_Missions_5_a = { 
	slot = 5
	generic = no
	ai = yes
	#potential_on_load = { has_dlc = "Mandate of Heaven" }
	potential = {
		has_dlc = "Domination"
		tag = QNG
		NOT = { map_setup = map_setup_random }
		NOT = { has_country_flag = qng_close_ports_flag }
		has_country_flag = qng_open_ports_flag 
	}
	has_country_shield = yes	
	
	qng_allow_foreign_exchanges = {
		icon = mission_rb_scottish_the_darien_scheme 
		required_missions = { qng_regulate_trade }
		position = 11
		
		trigger = {
			calc_true_if = {
				all_subject_country = {
					is_colonial_nation_of = ROOT 
				}
				amount = 5 
			}
			trade_income_percentage = 0.35
			navy_size = 300
		}
		
		effect = {
			add_country_modifier = {
				name = qng_presence_global_market_modifier
				duration = -1 
			}
			
			every_subject_country = {
				limit = { is_colonial_nation_of = ROOT }
				add_liberty_desire = -25
			}
		}
	}
	
	qng_chinese_industrial_revolution = {
		icon = mission_state_manufactories 
		required_missions = { qng_allow_foreign_exchanges qng_high_qing_era }
		position = 13
		trigger = {
			if = {
				limit = { 
					has_dlc = "Rule Britannia" 
				}
				num_of_owned_provinces_with = {
					has_building = furnace 
					value = 4 
				}
				trading_bonus = {
					trade_goods = coal 
					value = yes 
				}
			}
			else = {
				num_of_owned_provinces_with = {
					has_production_building_trigger = yes 
					value = 30
				}
			}
			num_of_trading_bonuses = 10
			num_of_owned_provinces_with = {
				has_manufactory_trigger = yes 
				value = 50 
			}
			has_institution = industrialization 
		}
		effect = {
			add_country_modifier = {
				name = qng_industrial_revolution_modifier
				duration = -1 
			}
			if = {
				limit = { has_dlc = "Mandate of Heaven" } 
				custom_tooltip = enable_industrialisation_tt
				set_country_flag = enable_industrialisation_flag
			}
		}
	}
}	

DOM_Qing_Missions_5_b = { 
	slot = 5
	generic = no
	ai = yes
	#potential_on_load = { has_dlc = "Mandate of Heaven" }
	potential = {
		has_dlc = "Domination"
		tag = QNG
		NOT = { map_setup = map_setup_random }
		has_country_flag = qng_close_ports_flag
		NOT = { has_country_flag = qng_open_ports_flag }
	}
	has_country_shield = yes	
	
	qng_promote_local_industry = {
		icon = mission_have_manufactories 
		required_missions = { qng_regulate_trade }
		position = 11
		provinces_to_highlight = {
			owned_by = ROOT  
			trade_goods = chinaware 
			AND = {
				has_manufactory_trigger = no 
				NOT = { base_production = 12 } 
			}
		}
		trigger = {
			num_of_owned_provinces_with = {
				trade_goods = chinaware
				has_manufactory_trigger = yes 
				base_production = 12 
				value = 5 
			}
			num_of_owned_provinces_with = {
				has_manufactory_trigger = yes 
				value = 25
			}
		}
		
		effect = {
			add_country_modifier = {
				name = qng_qing_industry_modifier
				duration = -1
			}
			change_price = {
				trade_goods = chinaware
				key = qing_chinaware
				value = 0.5
				duration = 18250
			}
		}
	}
	
	qng_expel_foreign_merchants = {
		icon = mission_raid_the_berbers 
		required_missions = { qng_promote_local_industry qng_high_qing_era }
		position = 13
		
		trigger = {
			4233 = {
				trade_share = {
					country = ROOT 
					share = 75
				}
			}
			684 = {
				trade_share = {
					country = ROOT 
					share = 75
				}
			}
			1371 = {
				trade_share = {
					country = ROOT 
					share = 75
				}
			}
			home_trade_node = { highest_value_trade_node = yes } 
			mercantilism = 100 
			num_of_light_ship = 200
		}
		
		effect = {
			add_country_modifier = {
				name = qng_trade_center_worlds_desire_modifier
				duration = -1 
			}
			
			custom_tooltip = qng_pull_the_lever_qing_tt
			hidden_effect = {
				if = { 
					limit = { 
						1269 = {
							trade_share = {
								country = ROOT 
								share = 25 
							}
						}
					}
					1269 = { 
						every_trade_node_member_country = {
							limit = { 
								NOT = { tag = ROOT } 
								OR = { 
									NOT = { alliance_with = ROOT } 
									NOT = { is_subject_of = ROOT } 
								}
								1269 = {
									trade_share = {
										country = PREV 
										share = 25
									}
								}
							}
							add_inflation_scaled_to_trade = {
								inflation = 1.5
							}
						}
					}
				}
				if = { 
					limit = { 
						1276 = {
							trade_share = {
								country = ROOT 
								share = 25 
							}
						}
					}
					1276 = { 
						every_trade_node_member_country = {
							limit = { 
								NOT = { tag = ROOT } 
								OR = { 
									NOT = { alliance_with = ROOT } 
									NOT = { is_subject_of = ROOT } 
								}
								1269 = {
									trade_share = {
										country = PREV 
										share = 25
									}
								}
							}
							add_inflation_scaled_to_trade = {
								inflation = 1.5
							}
						}
					}
				}
				if = { 
					limit = { 
						1293 = {
							trade_share = {
								country = ROOT 
								share = 25 
							}
						}
					}
					1293 = { 
						every_trade_node_member_country = {
							limit = { 
								NOT = { tag = ROOT } 
								OR = { 
									NOT = { alliance_with = ROOT } 
									NOT = { is_subject_of = ROOT } 
								}
								1269 = {
									trade_share = {
										country = PREV 
										share = 25
									}
								}
							}
							add_inflation_scaled_to_trade = {
								inflation = 1.5
							}
						}
					}
				}
				if = { 
					limit = { 
						1295 = {
							trade_share = {
								country = ROOT 
								share = 25 
							}
						}
					}
					1295 = { 
						every_trade_node_member_country = {
							limit = { 
								NOT = { tag = ROOT } 
								OR = { 
									NOT = { alliance_with = ROOT } 
									NOT = { is_subject_of = ROOT } 
								}
								1269 = {
									trade_share = {
										country = PREV 
										share = 25
									}
								}
							}
							add_inflation_scaled_to_trade = {
								inflation = 1.5
							}
						}
					}
				}
				if = { 
					limit = { 
						1298 = {
							trade_share = {
								country = ROOT 
								share = 25 
							}
						}
					}
					1298 = { 
						every_trade_node_member_country = {
							limit = { 
								NOT = { tag = ROOT } 
								OR = { 
									NOT = { alliance_with = ROOT } 
									NOT = { is_subject_of = ROOT } 
								}
								1269 = {
									trade_share = {
										country = PREV 
										share = 25
									}
								}
							}
							add_inflation_scaled_to_trade = {
								inflation = 1.5
							}
						}
					}
				}
				if = { 
					limit = { 
						1308 = {
							trade_share = {
								country = ROOT 
								share = 25 
							}
						}
					}
					1308 = { 
						every_trade_node_member_country = {
							limit = { 
								NOT = { tag = ROOT } 
								OR = { 
									NOT = { alliance_with = ROOT } 
									NOT = { is_subject_of = ROOT } 
								}
								1269 = {
									trade_share = {
										country = PREV 
										share = 25
									}
								}
							}
							add_inflation_scaled_to_trade = {
								inflation = 1.5
							}
						}
					}
				}
				if = { 
					limit = { 
						1310 = {
							trade_share = {
								country = ROOT 
								share = 25 
							}
						}
					}
					1310 = { 
						every_trade_node_member_country = {
							limit = { 
								NOT = { tag = ROOT } 
								OR = { 
									NOT = { alliance_with = ROOT } 
									NOT = { is_subject_of = ROOT } 
								}
								1269 = {
									trade_share = {
										country = PREV 
										share = 25
									}
								}
							}
							add_inflation_scaled_to_trade = {
								inflation = 1.5
							}
						}
					}
				}
				if = { 
					limit = { 
						1320 = {
							trade_share = {
								country = ROOT 
								share = 25 
							}
						}
					}
					1320 = { 
						every_trade_node_member_country = {
							limit = { 
								NOT = { tag = ROOT } 
								OR = { 
									NOT = { alliance_with = ROOT } 
									NOT = { is_subject_of = ROOT } 
								}
								1269 = {
									trade_share = {
										country = PREV 
										share = 25
									}
								}
							}
							add_inflation_scaled_to_trade = {
								inflation = 1.5
							}
						}
					}
				}
				if = { 
					limit = { 
						1322 = {
							trade_share = {
								country = ROOT 
								share = 25 
							}
						}
					}
					1322 = { 
						every_trade_node_member_country = {
							limit = { 
								NOT = { tag = ROOT } 
								OR = { 
									NOT = { alliance_with = ROOT } 
									NOT = { is_subject_of = ROOT } 
								}
								1269 = {
									trade_share = {
										country = PREV 
										share = 25
									}
								}
							}
							add_inflation_scaled_to_trade = {
								inflation = 1.5
							}
						}
					}
				}
				if = { 
					limit = { 
						1317 = {
							trade_share = {
								country = ROOT 
								share = 25 
							}
						}
					}
					1317 = { 
						every_trade_node_member_country = {
							limit = { 
								NOT = { tag = ROOT } 
								OR = { 
									NOT = { alliance_with = ROOT } 
									NOT = { is_subject_of = ROOT } 
								}
								1269 = {
									trade_share = {
										country = PREV 
										share = 25
									}
								}
							}
							add_inflation_scaled_to_trade = {
								inflation = 1.5
							}
						}
					}
				}
				if = { 
					limit = { 
						358 = {
							trade_share = {
								country = ROOT 
								share = 25 
							}
						}
					}
					358 = { 
						every_trade_node_member_country = {
							limit = { 
								NOT = { tag = ROOT } 
								OR = { 
									NOT = { alliance_with = ROOT } 
									NOT = { is_subject_of = ROOT } 
								}
								1269 = {
									trade_share = {
										country = PREV 
										share = 25
									}
								}
							}
							add_inflation_scaled_to_trade = {
								inflation = 1.5
							}
						}
					}
				}
				if = { 
					limit = { 
						1975 = {
							trade_share = {
								country = ROOT 
								share = 25 
							}
						}
					}
					1975 = { 
						every_trade_node_member_country = {
							limit = { 
								NOT = { tag = ROOT } 
								OR = { 
									NOT = { alliance_with = ROOT } 
									NOT = { is_subject_of = ROOT } 
								}
								1269 = {
									trade_share = {
										country = PREV 
										share = 25
									}
								}
							}
							add_inflation_scaled_to_trade = {
								inflation = 1.5
							}
						}
					}
				}
				if = { 
					limit = { 
						45 = {
							trade_share = {
								country = ROOT 
								share = 25 
							}
						}
					}
					45 = { 
						every_trade_node_member_country = {
							limit = { 
								NOT = { tag = ROOT } 
								OR = { 
									NOT = { alliance_with = ROOT } 
									NOT = { is_subject_of = ROOT } 
								}
								1269 = {
									trade_share = {
										country = PREV 
										share = 25
									}
								}
							}
							add_inflation_scaled_to_trade = {
								inflation = 1.5
							}
						}
					}
				}
				if = { 
					limit = { 
						1926 = {
							trade_share = {
								country = ROOT 
								share = 25 
							}
						}
					}
					1926 = { 
						every_trade_node_member_country = {
							limit = { 
								NOT = { tag = ROOT } 
								OR = { 
									NOT = { alliance_with = ROOT } 
									NOT = { is_subject_of = ROOT } 
								}
								1269 = {
									trade_share = {
										country = PREV 
										share = 25
									}
								}
							}
							add_inflation_scaled_to_trade = {
								inflation = 1.5
							}
						}
					}
				}
				if = { 
					limit = { 
						33 = {
							trade_share = {
								country = ROOT 
								share = 25 
							}
						}
					}
					33 = { 
						every_trade_node_member_country = {
							limit = { 
								NOT = { tag = ROOT } 
								OR = { 
									NOT = { alliance_with = ROOT } 
									NOT = { is_subject_of = ROOT } 
								}
								1269 = {
									trade_share = {
										country = PREV 
										share = 25
									}
								}
							}
							add_inflation_scaled_to_trade = {
								inflation = 1.5
							}
						}
					}
				}
				if = { 
					limit = { 
						1652 = {
							trade_share = {
								country = ROOT 
								share = 25 
							}
						}
					}
					1652 = { 
						every_trade_node_member_country = {
							limit = { 
								NOT = { tag = ROOT } 
								OR = { 
									NOT = { alliance_with = ROOT } 
									NOT = { is_subject_of = ROOT } 
								}
								1269 = {
									trade_share = {
										country = PREV 
										share = 25
									}
								}
							}
							add_inflation_scaled_to_trade = {
								inflation = 1.5
							}
						}
					}
				}
			}
		}
	}
}
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	