generic_chinese_warlord_missions_1 = {
	slot = 1
	generic = no
	ai = yes
	potential = {
		NOT = { started_in = 1368.1.1 }
		OR = {
			is_emperor_of_china = no
			NOT = { government_rank = 3 }
			has_country_flag = mmetr_keep_chinese_warlord_missions_flag		#sets flag in on_actions which prevents losing missions upon becoming Emperor of China
		}
		OR = {
			government = monarchy
			government = theocracy		#includes Hanzhong and other Daoist theocratic governments
		}
		OR = {
			has_reform = chinese_warlord
			has_reform = warlord_state
			has_reform = chinese_claimant_empire_reform
			is_chinese_dynasty_tag = yes	#MMETR custom scripted trigger
			AND = {
				culture_group = east_asian
				capital_scope = {
					superregion = china_superregion
				}
			}
		}
		
		#Exclusions - continue to add to this as more unique missions added
		NOT = { tag = SNG }
		NOT = { tag = NAN }
		if = {
			limit = {
				tag = WEI
			}
			started_in = 350.1.1
		}
		if = {
			limit = {
				tag = HND
			}
			started_in = 300.1.1
		}
		if = {
			limit = {
				tag = SHU
			}
			started_in = 280.1.1
		}
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes
	
	genchinese_weathering_uncertain_times_mission = {
		icon = mng_inward_perfection
		required_missions = {  }
		position = 1
		trigger = {
			stability = 3
		}
		effect = {
			add_adm_power = 50
			if = {
				limit = {
					ai = no
				}
				country_event = {
					id = mmetr_Generic_Chinese_mission_events.7
				}
				custom_tooltip = genchinese_weathering_uncertain_times_mission.tt
			}
		}
	}
	genchinese_achieving_harmony_mission = {
		icon = mng_pure_land
		required_missions = { genchinese_weathering_uncertain_times_mission genchinese_pure_land_mission }
		position = 2
		trigger = {
			religious_unity = 0.95
			if = {
				limit = {
					has_dlc = "Mandate of Heaven"
					OR = {
						religion = confucianism
						religion = daoism
					}
				}
				harmony = 90
			}
			num_of_owned_provinces_with = {
				value = 40
				superregion = china_superregion
				OR = {
					has_owner_religion = yes
					has_owner_secondary_religion = yes
				}
			}
		}
		effect = {
			add_country_modifier = {
				name = "me_genchnw_harmony_restored"
				duration = 14600
			}
		}
	}
	genchinese_the_flow_of_coin_mission = {
		icon = reform_the_monte
		required_missions = { genchinese_restore_foreign_trade_mission }
		position = 3
		trigger = {
			share_of_starting_income = 2.0
			years_of_income = 2
			if = {
				limit = {
					has_estate = estate_burghers
				}
				OR = {
					estate_loyalty = {
						estate = estate_burghers 
						loyalty = 60
					}
					num_of_estate_agendas_completed = {
						estate = estate_burghers
						value = 3
					}
				}
			}
			if = {
				limit = {
					adm_tech = 33
				}
				num_of_owned_provinces_with = {
					value = 10
					OR = {
						has_building = marketplace
						has_building = trade_post
						has_building = trade_depot
						has_building = treasury_office
						has_building = stock_exchange
					}
				}
			}
		}
		effect = {
			add_country_modifier = {
				name = "me_genchnw_thriving_economy"
				duration = 10950
			}
			define_advisor = {
				type = master_of_mint
				skill = 2
				discount = yes
			}
		}
	}
	genchinese_papermaking_monopoly_mission = {
		icon = mng_expand_yongle_dadian
		required_missions = { genchinese_the_flow_of_coin_mission }
		position = 4
		provinces_to_highlight = {
			trade_goods = paper
			superregion = china_superregion
			NOT = {
				owned_by = ROOT
			}
			has_discovered = ROOT
		}
		trigger = {
			num_of_owned_provinces_with = {
				value = 5
				trade_goods = paper
				superregion = china_superregion
			}
			num_of_owned_provinces_with = {
				value = 3
				trade_goods = paper
				base_production = 4
			}
			num_of_owned_provinces_with = {
				value = 10
				OR = {
					has_building = storehouse
					has_building = windmill
					has_building = workshop
					has_building = counting_house
				}
			}
		}
		effect = {
			add_country_modifier = {
				name = "me_genchnw_paper_economy"
				duration = 10950
			}
		}
	}
	genchinese_master_the_36_stratagems_mission = {
		icon = mission_chinese_cavalry_charge
		required_missions = {  }
		position = 5
		trigger = {
			army_tradition = 50
			num_of_battles = { amount = 30 }
			is_at_war = no
			has_regency = no
		}
		effect = {
			country_event = {
				id = mmetr_Generic_Chinese_mission_events.1
			}
			tooltip = {
				add_country_modifier = {
					name = "me_genchnw_military_treatises"
					duration = 10950
				}
			}
		}
	}
	genchinese_the_conqueror_xiang_yu_mission = {
		icon = mission_chinese_monarch_horseback
		required_missions = { genchinese_base_in_capitalarea_mission genchinese_master_the_36_stratagems_mission }
		position = 6
		provinces_to_highlight = {
			OR = {
				area = zhejiang_area
				area = jiangsu_area
				area = south_jiangsu_area
				area = south_anhui_area
				area = anhui_area
				area = jiangxi_area
				area = hunan_area
				area = huguang_area	#Hubei
			}
			NOT = {
				country_or_non_sovereign_subject_holds = ROOT
			}
		}
		trigger = {
			num_of_battles = { amount = 50 }
			zhejiang_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT
			}
			jiangsu_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT
			}
			south_jiangsu_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT
			}
			south_anhui_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT
			}
			anhui_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT
			}
			jiangxi_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT
			}
			hunan_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT
			}
			huguang_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT
			}
		}
		effect = {
			country_event = {
				id = mmetr_Generic_Chinese_mission_events.3
			}
			tooltip = {
				add_prestige = 10
				add_ruler_modifier = {
					name = "me_genchnw_great_conqueror"
					duration = -1
				}
			}
		}
	}
	genchinese_the_southern_frontier_mission = {
		icon = mission_conquer_burma
		required_missions = { genchinese_the_conqueror_xiang_yu_mission }
		position = 8
		provinces_to_highlight = {
			OR = {
				area = guangdong_area
				area = west_guangdong_area
				area = guangzhou_area
				area = guangxi_area
				area = red_river_delta_area
				area = vietnam_area
			}
			NOT = {
				country_or_non_sovereign_subject_holds = ROOT
			}
			is_empty = no
			has_discovered = ROOT
		}
		trigger = {
			guangdong_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT
			}
			west_guangdong_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT
			}
			guangzhou_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT
			}
			guangxi_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT
			}
			red_river_delta_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT
				NOT = { unrest = 5 }
			}
			vietnam_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT
				NOT = { unrest = 5 }
			}
		}
		effect = {
			add_adm_power = 50
			add_dip_power = 50
			add_country_modifier = {
				name = "me_genchnw_chinese_war_elephants"
				duration = 10950
			}
		}
	}
	genchinese_guard_the_jade_gate_mission = {
		icon = mission_silk_road
		required_missions = { genchinese_tribute_from_the_five_hu_mission }
		position = 10
		provinces_to_highlight = {
			OR = {
				AND = {
					OR = {
						area = kashgaria_area
						area = tarim_basin_area		#North Altishahr
						area = shanshan_area
					}
					NOT = {
						country_or_non_sovereign_subject_holds = ROOT
					}
				}
				AND = {
					province_id = 707	#Yumen trade node
					NOT = {
						is_strongest_trade_power = ROOT
					}
				}
			}
			has_discovered = ROOT
		}
		trigger = {
			owns_core_province = 707
			707 = {
				is_strongest_trade_power = ROOT
			}
			kashgaria_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT
			}
			tarim_basin_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT
			}
			shanshan_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT
			}
		}
		effect = {
			add_dip_power = 75
			add_mercantilism_or_monarch_power = { amount = 2 }
			define_advisor = {
				type = trader
				skill = 3
				discount = yes
				culture = tocharian
				religion = dharmaguptaka
			}
			if = {
				limit = {
					OR = {
						NOT = { exists = WP1 }
						overlord_of = WP1
					}
				}
				country_event = {
					id = mmetr_HND_mission_events.7		#Can spawn Western Protectorate subject
				}
			}
		}
	}
	genchinese_journey_to_the_west_mission = {
		icon = mission_chinese_planning_war
		required_missions = { genchinese_guard_the_jade_gate_mission genchinese_princesses_abroad_mission }
		position = 12
		trigger = {
			any_known_country = {
				has_opinion = {
					who = ROOT
					value = 150
				}
				NOT = {
					technology_group = chinese
					technology_group = early_chinese
				}
				OR = {
					alliance_with = ROOT
					is_subject_of = ROOT
				}
			}
		}
		effect = {
			add_dip_power = 50
			add_country_modifier = {
				name = "me_genchnw_western_embassies"
				duration = 7300
			}
		}
	}
}

generic_chinese_warlord_missions_2 = {
	slot = 2
	generic = no
	ai = yes
	potential = {
		NOT = { started_in = 1368.1.1 }
		OR = {
			is_emperor_of_china = no
			NOT = { government_rank = 3 }
			has_country_flag = mmetr_keep_chinese_warlord_missions_flag		#sets flag in on_actions which prevents losing missions upon becoming Emperor of China
		}
		OR = {
			government = monarchy
			government = theocracy		#includes Hanzhong and other Daoist theocratic governments
		}
		OR = {
			has_reform = chinese_warlord
			has_reform = warlord_state
			has_reform = chinese_claimant_empire_reform
			is_chinese_dynasty_tag = yes	#MMETR custom scripted trigger
			AND = {
				culture_group = east_asian
				capital_scope = {
					superregion = china_superregion
				}
			}
		}
		
		#Exclusions - continue to add to this as more unique missions added
		NOT = { tag = SNG }
		NOT = { tag = NAN }
		if = {
			limit = {
				tag = WEI
			}
			started_in = 350.1.1
		}
		if = {
			limit = {
				tag = HND
			}
			started_in = 300.1.1
		}
		if = {
			limit = {
				tag = SHU
			}
			started_in = 280.1.1
		}
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes
	
	genchinese_pure_land_mission = {
		icon = mission_chinese_castle_tower
		required_missions = {  }
		position = 1
		trigger = {
			num_of_owned_provinces_with = {
				value = 15
				OR = {
					has_building = glorious_monument
					has_building = temple
					has_building = cathedral
				}
			}
			capital_scope = {
				OR = {
					has_building = glorious_monument
					has_building = temple
					has_building = cathedral
				}
			}
			if = {
				limit = {
					has_estate = estate_church
				}
				OR = {
					estate_loyalty = {
						estate = estate_church
						loyalty = 60
					}
					num_of_estate_agendas_completed = {
						estate = estate_church
						value = 2
					}
				}
			}
			else = {
				prestige = 30
			}
		}
		effect = {
			if = {
				limit = {
					has_dlc = "Mandate of Heaven"
					OR = {
						religion = confucianism
						religion = daoism
					}
				}
				add_harmony = 5
			}
			if = {
				limit = {
					capital_scope = {
						has_building = glorious_monument
					}
				}
				remove_building = glorious_monument
				add_building = temple
			}
			add_country_modifier = {
				name = "me_genchnw_temples_of_the_three_teachings"
				duration = 10950
			}
		}
	}
	genchinese_restore_foreign_trade_mission = {
		icon = mission_the_chola_campaigns
		required_missions = {  }
		position = 2
		trigger = {
			home_trade_node = { is_strongest_trade_power = ROOT }
			trader = 1
			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 = {
			add_mercantilism_or_monarch_power = { amount = 1 }
			add_country_modifier = {
				name = "me_genchnw_trade_embassies"
				duration = 10950
			}
		}
	}
	genchinese_silk_road_hegemony_mission = {
		icon = mission_chinese_market
		required_missions = { genchinese_restore_foreign_trade_mission }
		position = 4
		provinces_to_highlight = {
			if = {
				limit = {
					ROOT = {
						NOT = { silk = 8 }
					}
				}
				trade_goods = silk
				has_discovered = ROOT
			}
			else = {
				always = no
			}
		}
		trigger = {
			production_leader = {
				trade_goods = silk
			}
			silk = 8
		}
		effect = {
			add_prestige = 15
			add_mercantilism_or_monarch_power = { amount = 2 }
			add_country_modifier = {
				name = "silk_road_modifier"
				duration = 9125
			}
			define_advisor = {
				type = trader
				skill = 2
				discount = yes
			}
		}
	}
	genchinese_base_in_capitalarea_mission = {
		icon = mission_chinese_recruitment
		required_missions = {  }
		position = 5
		trigger = {
			total_development = 100
			grown_by_development = 50
			num_of_generals = 1
		}
		effect = {
			add_country_modifier = {
				name = "me_genchnw_self_appointed_duke"
				duration = 10950
			}
		}
	}
	genchinese_end_the_dragons_slumber_mission = {
		icon = mission_ancient_chinese_army_in_siege
		required_missions = { genchinese_base_in_capitalarea_mission }
		position = 6
		provinces_to_highlight = {
			OR = {
				province_id = 1836	#Luoyang
				province_id = 700	#Chang'an
				province_id = 679	#Chengdu
				province_id = 1821	#Jianye
				province_id = 1816	#Beijing
				province_id = 667	#Canton/Guangzhou
			}
			NOT = {
				owned_by = ROOT
				is_core = ROOT
			}
			has_discovered = ROOT
		}
		trigger = {
			grown_by_states = 5
			capital_scope = {
				area_for_scope_province = {
					type = all
					country_or_non_sovereign_subject_holds = ROOT
				}
			}
			OR = {
				owns_core_province = 1836	#Luoyang
				owns_core_province = 700	#Chang'an
				owns_core_province = 679	#Chengdu
				owns_core_province = 1821	#Jianye
				owns_core_province = 1816	#Beijing
				owns_core_province = 667	#Canton/Guangzhou
			}
			calc_true_if = {
				all_states = {
					superregion = china_superregion
				}
				amount = 7
			}
		}
		effect = {
			add_adm_power = 50
			add_mil_power = 50
			add_country_modifier = {
				name = "me_genchnw_soaring_dragon"
				duration = 9125
			}
		}
	}
	genchinese_emulate_wen_of_zhou_mission = {
		icon = mission_chinese_edict
		required_missions = { genchinese_king_of_new_kingdom_mission }
		position = 6
		trigger = {
			OR = {
				custom_trigger_tooltip = {
					tooltip = genchinese_emulate_wen_of_zhou_mission.tt
					has_country_flag = established_claimant_empire_dec_flag
				}
				has_reform = chinese_claimant_empire_reform
				has_reform = celestial_empire
				is_emperor_of_china = yes
				government_rank = 3
			}
		}
		effect = {
			country_event = {
				id = mmetr_Generic_Chinese_mission_events.4
			}
			tooltip = {
				add_country_modifier = {
					name = "me_genchnw_adherance_to_the_i_ching"
					duration = 10950
				}
			}
		}
	}
	genchinese_tribute_from_the_five_hu_mission = {
		icon = mission_jurchen_cavalrymen
		required_missions = { genchinese_fate_of_the_imperial_seal_mission }
		position = 9
		provinces_to_highlight = {
			OR = {
				area = amdo_area
				area = west_gansu_area
				area = ordos_area
				area = inner_mongolia_area
				area = chahar_area
			}
			NOT = {
				country_or_subject_holds = ROOT
			}
			has_discovered = ROOT
		}
		trigger = {
			amdo_area = {
				type = all
				OR = {
					country_or_non_sovereign_subject_holds = ROOT
					custom_trigger_tooltip = {
						tooltip = genchinese_tribute_from_the_five_hu_mission.tt
						owner = {
							is_subject_of_type_with_overlord = { who = ROOT type = tributary_state }
							has_opinion = { who = ROOT value = 120 }
						}
					}
				}
			}
			west_gansu_area = {
				type = all
				OR = {
					country_or_non_sovereign_subject_holds = ROOT
					custom_trigger_tooltip = {
						tooltip = genchinese_tribute_from_the_five_hu_mission.tt
						owner = {
							is_subject_of_type_with_overlord = { who = ROOT type = tributary_state }
							has_opinion = { who = ROOT value = 120 }
						}
					}
				}
			}
			ordos_area = {
				type = all
				OR = {
					country_or_non_sovereign_subject_holds = ROOT
					custom_trigger_tooltip = {
						tooltip = genchinese_tribute_from_the_five_hu_mission.tt
						owner = {
							is_subject_of_type_with_overlord = { who = ROOT type = tributary_state }
							has_opinion = { who = ROOT value = 120 }
						}
					}
				}
			}
			inner_mongolia_area = {
				type = all
				OR = {
					country_or_non_sovereign_subject_holds = ROOT
					custom_trigger_tooltip = {
						tooltip = genchinese_tribute_from_the_five_hu_mission.tt
						owner = {
							is_subject_of_type_with_overlord = { who = ROOT type = tributary_state }
							has_opinion = { who = ROOT value = 120 }
						}
					}
				}
			}
			chahar_area = {
				type = all
				OR = {
					country_or_non_sovereign_subject_holds = ROOT
					custom_trigger_tooltip = {
						tooltip = genchinese_tribute_from_the_five_hu_mission.tt
						owner = {
							is_subject_of_type_with_overlord = { who = ROOT type = tributary_state }
							has_opinion = { who = ROOT value = 120 }
						}
					}
				}
			}
		}
		effect = {
			add_country_modifier = {
				name = "me_genchnw_five_hu_subjugated"
				duration = 10950
			}
		}
	}
	genchinese_expand_the_great_wall_mission = {
		icon = mng_nomadic_frontier
		required_missions = { genchinese_tribute_from_the_five_hu_mission }
		position = 10
		trigger = {
			OR = {
				has_great_project = {
					type = the_great_wall_of_china
					tier = 2
				}
				num_of_owned_provinces_with = {
					value = 4
					fort_level = 1
					OR = {
						area = liaoning_area
						area = hebei_area
						area = chahar_area
						area = inner_mongolia_area
						area = ordos_area
						area = central_mongolia_area	#Gobi
						area = hebei_area
					}
				}
			}
		}
		effect = {
			country_event = {
				id = mmetr_Generic_Chinese_mission_events.5
			}
			tooltip = {
				add_country_modifier = {
					name = "me_genchnw_great_wall_expanded"
					duration = 10950
				}
			}
		}
	}
	genchinese_princesses_abroad_mission = {
		icon = mission_japanese_marriage
		required_missions = { genchinese_the_empire_long_divided_mission }
		position = 11
		trigger = {
			calc_true_if = {
				all_neighbor_country = {
					marriage_with = ROOT
					NOT = {
						culture_group = east_asian
					}
					OR = {
						alliance_with = ROOT
						is_subject_of = ROOT
					}
				}
				amount = 4
			}
		}
		effect = {
			add_country_modifier = {
				name = "me_genchnw_marriage_diplomacy"
				duration = -1
			}
		}
	}
}

generic_chinese_warlord_missions_3 = {
	slot = 3
	generic = no
	ai = yes
	potential = {
		NOT = { started_in = 1368.1.1 }
		OR = {
			is_emperor_of_china = no
			NOT = { government_rank = 3 }
			has_country_flag = mmetr_keep_chinese_warlord_missions_flag		#sets flag in on_actions which prevents losing missions upon becoming Emperor of China
		}
		OR = {
			government = monarchy
			government = theocracy		#includes Hanzhong and other Daoist theocratic governments
		}
		OR = {
			has_reform = chinese_warlord
			has_reform = warlord_state
			has_reform = chinese_claimant_empire_reform
			is_chinese_dynasty_tag = yes	#MMETR custom scripted trigger
			AND = {
				culture_group = east_asian
				capital_scope = {
					superregion = china_superregion
				}
			}
		}
		
		#Exclusions - continue to add to this as more unique missions added
		NOT = { tag = SNG }
		NOT = { tag = NAN }
		if = {
			limit = {
				tag = WEI
			}
			started_in = 350.1.1
		}
		if = {
			limit = {
				tag = HND
			}
			started_in = 300.1.1
		}
		if = {
			limit = {
				tag = SHU
			}
			started_in = 280.1.1
		}
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes
	
	genchinese_borrow_a_distant_knife_mission = {
		icon = mission_chinese_warlords_alliance
		required_missions = {  }
		position = 1
		trigger = {
			custom_trigger_tooltip = {
				tooltip = building_alliances.tooltip
				num_of_allies = 2
				calc_true_if = {
					all_ally = {
						has_opinion = {
							who = ROOT
							value = 150
						}
					}
					amount = 2
				}
			}
			any_ally = {
				any_war_enemy_country = {
					defensive_war_with = ROOT
					#OR = {
					#	is_rival = ROOT
					#	is_enemy = ROOT
					#}
				}
			}
		}
		effect = {
			custom_tooltip = genchinese_borrow_a_distant_knife_mission.tt
			every_ally = {
				limit = {
					has_opinion = {
						who = ROOT
						value = 150
					}
				}
				add_trust = {
					who = ROOT
					value = 5
					mutual = yes
				}
			}
			add_country_modifier = {
				name = "me_genchnw_lending_a_knife_to_a_friend"
				duration = 10950
			}
		}
	}
	genchinese_curb_the_military_elite_mission = {
		icon = mission_chinese_officials_in_line
		required_missions = {  }
		position = 2
		trigger = {
			stability = 1
			NOT = { num_of_loans = 1 }
			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 
				}
			}
		}
		effect = {
			add_country_modifier = {
				name = chi_stable_court_modifier
				duration = 9125 
			}
		}
	}
	genchinese_imperial_examinations_mission = {
		icon = mission_scholar_officials
		required_missions = { genchinese_curb_the_military_elite_mission }
		position = 3
		trigger = {
			OR = {
				has_adm_advisor_3 = yes
				has_dip_advisor_3 = yes
			}
			if = {
				limit = {
					is_emperor_of_china = yes
				}
				meritocracy = 90
			}
		}
		effect = {
			add_country_modifier = {
				name = "me_genchnw_imperial_examinations"
				duration = 14600
			}
		}
	}
	genchinese_medicinal_studies_mission = {
		icon = mission_chinese_scholars_scrolls
		required_missions = { genchinese_imperial_examinations_mission }
		position = 4
		trigger = {
			OR = {
				natural_scientist = 3
				AND = {
					natural_scientist = 2
					has_institution = medicine
				}
			}
		}
		effect = {
			add_country_modifier = {
				name = "me_genchnw_herbal_medicine"
				duration = 14600
			}
		}
	}
	genchinese_king_of_new_kingdom_mission = {
		icon = mission_chinese_ruler_in_hall
		required_missions = { genchinese_base_in_capitalarea_mission genchinese_imperial_ambitions_mission }
		position = 6
		trigger = {
			total_development = 200
			OR = {
				custom_trigger_tooltip = {
					tooltip = genchinese_king_of_new_kingdom_mission.tt
					government_rank = 2
				}
				government_rank = 2
			}
			NOT = {
				has_reform = warlord_state
			}
		}
		effect = {
			add_prestige = 20
			add_ruler_modifier = {
				name = "me_genchnw_king"
				duration = -1
			}
			custom_tooltip = claim_neighbor_province
			hidden_effect = {
				every_owned_province = {
					every_neighbor_province = {
						limit = {
							NOT = { owned_by = ROOT }
							NOT = { is_permanent_claim = ROOT	}
							NOT = { is_core = ROOT	}
						}
						add_claim = ROOT
					}
				}
			}
		}
	}
	genchinese_fate_of_the_imperial_seal_mission = {
		icon = mission_chinese_imperial_seal
		required_missions = { genchinese_king_of_new_kingdom_mission }
		position = 8
		trigger = {
			OR = { 
				war_score_against = {
					who = event_target:EmperorOfChina
					value = 90
				}
				is_emperor_of_china = yes
				custom_trigger_tooltip = {
					tooltip = genchinese_fate_of_the_imperial_seal_mission.tt
					has_country_flag = restored_mandate_of_heaven_mmetr_dec_flag
				}
			}
			custom_trigger_tooltip = {		#fixed script since did not work properly in vanilla
				tooltip = chi_strongest_warlord_tt
				NOT = {
					any_country = { 
						capital_scope = { superregion = china_superregion }
						army_size = ROOT
						total_development = ROOT
					}	
				}
			}
		}
		effect = {
			if = {
				limit = { 
					has_dlc = "Rights of Man" 
					NOT = { num_of_ruler_traits = { amount = 3 } }
				}
				add_ruler_personality = conqueror_personality
			}
			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 }
				}
			}
		}
	}
	genchinese_the_empire_long_divided_mission = {
		icon = mng_heavens_will
		required_missions = { genchinese_fate_of_the_imperial_seal_mission }
		position = 10
		provinces_to_highlight = {
			superregion = china_superregion
			NOT = {
				country_or_non_sovereign_subject_holds = ROOT
			}
			is_empty = no
			has_discovered = ROOT
		}
		trigger = {
			china_superregion = {
				type = all 
				OR = {
					country_or_non_sovereign_subject_holds = ROOT
					is_empty = yes
				}
			}
			if = {
				limit = { has_dlc = "Mandate of Heaven" } 
				OR = { 
					in_golden_age = yes
					monthly_income = 100
					is_emperor_of_china = yes
				}
			}
			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
			}
		}
	}
	genchinese_center_of_the_world_mission = {
		icon = mission_chinese_son_of_heaven
		required_missions = { genchinese_the_empire_long_divided_mission }
		position = 12
		trigger = {
			custom_trigger_tooltip = {
				tooltip = genchinese_center_of_the_world_mission.tt
				capital_scope = {
					NOT = {
						any_province = {
							superregion = china_superregion
							higher_development_than = PREV
						}
					}
				}
			}
			power_projection = 50
			if = {
				limit = {
					OR = {
						has_dlc = "Emperor" 
						has_dlc = "Rights of Man"
					}
				}
				NOT = { great_power_rank = 2 } 
			}
		}
		effect = {
			add_country_modifier = {
				name = "me_genchnw_middle_kingdom"
				duration = -1 
			}
		}
	}
}

generic_chinese_warlord_missions_4 = {
	slot = 4
	generic = no
	ai = yes
	potential = {
		NOT = { started_in = 1368.1.1 }
		OR = {
			is_emperor_of_china = no
			NOT = { government_rank = 3 }
			has_country_flag = mmetr_keep_chinese_warlord_missions_flag		#sets flag in on_actions which prevents losing missions upon becoming Emperor of China
		}
		OR = {
			government = monarchy
			government = theocracy		#includes Hanzhong and other Daoist theocratic governments
		}
		OR = {
			has_reform = chinese_warlord
			has_reform = warlord_state
			has_reform = chinese_claimant_empire_reform
			is_chinese_dynasty_tag = yes	#MMETR custom scripted trigger
			AND = {
				culture_group = east_asian
				capital_scope = {
					superregion = china_superregion
				}
			}
		}
		
		#Exclusions - continue to add to this as more unique missions added
		NOT = { tag = SNG }
		NOT = { tag = NAN }
		if = {
			limit = {
				tag = WEI
			}
			started_in = 350.1.1
		}
		if = {
			limit = {
				tag = HND
			}
			started_in = 300.1.1
		}
		if = {
			limit = {
				tag = SHU
			}
			started_in = 280.1.1
		}
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes
	
	genchinese_prosperous_capital_mission = {
		icon = mng_outer_city_beijing
		required_missions = {  }
		position = 1
		provinces_to_highlight = {
			is_capital_of = ROOT
			NOT = {
				num_of_times_improved_by_owner = 6
			}
		}
		trigger = {
			capital_scope = {
				num_of_times_improved_by_owner = 6
			}
		}
		effect = {
			add_splendor = 50
			if = {
				limit = {
					is_emperor_of_china = yes
				}
				add_meritocracy = 10
				add_mandate = 1
			}
			else = {
				add_legitimacy = 10
			}
			capital_scope = {
				add_country_modifier = {
					name = "me_genchnw_growth_in_the_outer_wall"
					duration = 10950
				}
			}
		}
	}
	genchinese_create_something_from_nothing_mission = {
		icon = mission_chu_shi_biao
		required_missions = {  }
		position = 2
		provinces_to_highlight = {
			fort_level = 1
			owned_by = ROOT
		}
		trigger = {
			num_of_owned_provinces_with	= {
				value = 3
				fort_level = 1
				base_manpower = 3
				is_state_core = ROOT
			}
		}
		effect = {
			add_country_modifier = {
				name = "me_genchnw_defensive_stratagems"
				duration = 10950
			}
		}
	}
	genchinese_implement_tuntian_mission = {
		icon = mission_chinese_land_survey
		required_missions = { genchinese_create_something_from_nothing_mission }
		position = 3
		provinces_to_highlight = {
			owned_by = ROOT
			trade_goods = grain
			OR = {
				NOT = { fort_level = 1 }
				NOT = { has_building = armory }
				NOT = { has_building = barracks }
				NOT = { base_manpower = 4 }
			}
		}
		trigger = {
			OR = {
				manpower_percentage = 0.25
				recruitmaster = 2
			}
			num_of_owned_provinces_with = {
				value = 5
				trade_goods = grain
				OR = {
					fort_level = 1
					has_building = armory
					has_building = barracks
					base_manpower = 4
				}
			}
		}
		effect = {
			add_country_modifier = {
				name = "me_shu_tuntian_system"
				duration = 10950
			}
		}
	}
	genchinese_centralized_field_system_mission = {
		icon = mission_rice_field
		required_missions = { genchinese_imperial_examinations_mission genchinese_implement_tuntian_mission genchinese_control_the_industries_mission }
		position = 4
		trigger = {
			total_development = 1000
			OR = {
				crown_land_share = 95
				absolutism = 50
				AND = {
					stability = 2
					NOT = {
						estate_influence = {
							estate = estate_nobles
							influence = 15
						}
					}
				}
			}
		}
		effect = {
			capital_scope = {
				add_base_production = 1
			}
			add_country_modifier = {
				name = "me_genchnw_equal_field_system"
				duration = 10950
			}
		}
	}
	genchinese_imperial_ambitions_mission = {
		icon = mission_chinese_army_mobilization_medieval
		required_missions = {  }
		position = 5
		trigger = {
			army_size_percentage = 0.8
			OR = { 
				has_reform = chinese_warlord
				has_reform = warlord_state
				is_subject = no 
				AND = { 
					is_subject = yes 
					num_of_allies = 3 
				}
			}
			if = {
				limit = { is_subject = yes } 
				overlord = { 
					OR = {
						has_opinion_modifier = {
							who = ROOT  
							modifier = insulted
						}
						has_opinion_modifier = {
							who = ROOT  
							modifier = scornfully_insulted
						}
					}
				}
			}
		}
		effect = {
			add_manpower = 2
			add_country_modifier = {
				name = "me_genchnw_just_cause_for_reunification"
				duration = 10950
			}
			custom_tooltip = claim_neighbor_province
			hidden_effect = {
				every_owned_province = {
					every_neighbor_province = {
						limit = {
							NOT = { owned_by = ROOT }
							NOT = { is_permanent_claim = ROOT	}
							NOT = { is_core = ROOT	}
						}
						add_claim = ROOT
					}
				}
			}
		}
	}
	genchinese_conquer_the_ancestral_cities_mission = {
		icon = qng_north_china
		required_missions = { genchinese_imperial_ambitions_mission }
		position = 7
		provinces_to_highlight = {
			OR = {
				province_id = 1836	#Luoyang
				province_id = 700	#Chang'an
				province_id = 679	#Chengdu
				province_id = 1821	#Jianye
			}
			NOT = {
				owned_by = ROOT
				is_core = ROOT
			}
			has_discovered = ROOT
		}
		trigger = {
			owns_core_province = 1836	#Luoyang
			owns_core_province = 700	#Chang'an
			owns_core_province = 679	#Chengdu
			owns_core_province = 1821	#Jianye
		}
		effect = {
			add_prestige = 10
			add_army_tradition = 10
			add_adm_power = 50
			add_legitimacy = 20
		}
	}
	genchinese_subjugate_the_hanguo_mission = {
		icon = mission_korean_three_kingdoms
		required_missions = { genchinese_fate_of_the_imperial_seal_mission }
		position = 9
		provinces_to_highlight = {
			region = korea_region
			NOT = {
				country_or_subject_holds = ROOT
			}
			has_discovered = ROOT
		}
		trigger = {
			korea_region = {
				type = all
				OR = {
					country_or_non_sovereign_subject_holds = ROOT
					custom_trigger_tooltip = {
						tooltip = genchinese_subjugate_the_hanguo_mission.tt
						owner = {
							is_subject_of_type_with_overlord = { who = ROOT type = tributary_state }
							has_opinion = { who = ROOT value = 120 }
						}
					}
				}
			}
		}
		effect = {
			add_sailors = 100
			define_advisor = {
				type = naval_reformer
				skill = 1
				discount = yes
				culture = korean
			}
			add_country_modifier = {
				name = "me_genchnw_korean_vassals"
				duration = 10950
			}
			korea_region = {
				limit = {
					country_or_non_sovereign_subject_holds = ROOT
				}
				add_province_modifier = {
					name = "me_genchnw_korean_integration"
					duration = 10950
				}
			}
		}
	}
	genchinese_tribute_to_the_emperor_mission = {
		icon = mission_kowtow
		required_missions = { genchinese_the_empire_long_divided_mission }
		position = 11
		trigger = {
			calc_true_if = {
				custom_trigger_tooltip = {
					tooltip = genchinese_tribute_to_the_emperor_mission.tt
					all_subject_country = {
						is_subject_of_type_with_overlord = { who = ROOT type = tributary_state }
					}
				}
				amount = 10
			}
		}
		effect = {
			add_country_modifier = {
				name = "me_genchnw_foreign_tribute"
				duration = 10950
			}
		}
	}
}

generic_chinese_warlord_missions_5 = {
	slot = 5
	generic = no
	ai = yes
	potential = {
		NOT = { started_in = 1368.1.1 }
		OR = {
			is_emperor_of_china = no
			NOT = { government_rank = 3 }
			has_country_flag = mmetr_keep_chinese_warlord_missions_flag		#sets flag in on_actions which prevents losing missions upon becoming Emperor of China
		}
		OR = {
			government = monarchy
			government = theocracy		#includes Hanzhong and other Daoist theocratic governments
		}
		OR = {
			has_reform = chinese_warlord
			has_reform = warlord_state
			has_reform = chinese_claimant_empire_reform
			is_chinese_dynasty_tag = yes	#MMETR custom scripted trigger
			AND = {
				culture_group = east_asian
				capital_scope = {
					superregion = china_superregion
				}
			}
		}
		
		#Exclusions - continue to add to this as more unique missions added
		NOT = { tag = SNG }
		NOT = { tag = NAN }
		if = {
			limit = {
				tag = WEI
			}
			started_in = 350.1.1
		}
		if = {
			limit = {
				tag = HND
			}
			started_in = 300.1.1
		}
		if = {
			limit = {
				tag = SHU
			}
			started_in = 280.1.1
		}
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes
	
	genchinese_capable_governors_mission = {
		icon = mission_asian_city
		required_missions = {  }
		position = 1
		provinces_to_highlight = {
			owned_by = ROOT
			NOT = {
				num_of_times_improved_by_owner = 1
			}
		}
		trigger = {
			grown_by_states = 3
			num_of_owned_provinces_with = {
				value = 5
				num_of_times_improved_by_owner = 1
			}
			custom_trigger_tooltip = {
				tooltip = genchinese_capable_governors_mission.tt
			}
		}
		effect = {
			add_adm_power = 50
			add_country_modifier = {
				name = "me_genchnw_satisfied_commonfolk"
				duration = 9125
			}
			custom_tooltip = claim_neighbor_province
			hidden_effect = {
				every_owned_province = {
					every_neighbor_province = {
						limit = {
							NOT = { owned_by = ROOT }
							NOT = { is_permanent_claim = ROOT	}
							NOT = { is_core = ROOT	}
						}
						add_claim = ROOT
					}
				}
			}
		}
	}
	genchinese_abundance_of_lord_shennong_mission = {
		icon = mission_chinese_harvest
		required_missions = { genchinese_capable_governors_mission }
		position = 2
		provinces_to_highlight = {
			OR = {
				trade_goods = grain
				trade_goods = cloth
				has_terrain = farmlands
			}
			owned_by = ROOT
			NOT = { base_production = 4 }
		}
		trigger = {
			num_of_owned_provinces_with = {
				value = 5
				trade_goods = grain
			}
			num_of_owned_provinces_with = {
				value = 5
				base_production = 5
				OR = {
					trade_goods = grain
					trade_goods = cloth
					has_terrain = farmlands
				}
			}
		}
		effect = {
			add_dip_power = 100
			add_country_modifier = {
				name = "me_genchnw_bountiful_harvests"
				duration = 10950
			}
		}
	}
	genchinese_control_the_industries_mission = {
		icon = mission_son_own_develop_clothes_and_salt
		required_missions = { genchinese_abundance_of_lord_shennong_mission }
		position = 3
		trigger = {
			num_of_owned_provinces_with = {
				value = 4
				trade_goods = iron
			}
			num_of_owned_provinces_with = {
				value = 3
				trade_goods = salt
			}
			num_of_owned_provinces_with = {
				value = 3
				trade_goods = tea
			}
			num_of_owned_provinces_with = {
				value = 3
				trade_goods = chinaware
			}
			OR = {
				trader = 2
				natural_scientist = 2
				treasurer = 2
			}
		}
		effect = {
			country_event = {
				id = mmetr_Generic_Chinese_mission_events.2
			}
		}
	}
	genchinese_utilize_fire_medicine_mission = {
		icon = mission_chinese_gunpowder_crossbow
		required_missions = { genchinese_control_the_industries_mission }
		position = 4
		trigger = {
			mil_tech = 38	#1100s, when Song historically first used fire lance as gunpowder weapon
			OR = {
				mil = 5
				monthly_mil = 10
				has_mil_advisor_3 = yes
				natural_scientist = 3
				army_tradition = 75
			}
		}
		effect = {
			country_event = {
				id = mmetr_Generic_Chinese_mission_events.6
			}
			tooltip = {
				add_country_modifier = {
					name = "me_genchnw_gunpowder_fire_lances"
					duration = 10950
				}
			}
		}
	}
	genchinese_towards_a_new_age_mission = {
		icon = mission_rb_central_belt_coal_mining
		required_missions = { genchinese_utilize_fire_medicine_mission }
		position = 5
		trigger = {
			calc_true_if = {
				desc = build_manufactories_mission_tooltip
				all_owned_province = {
					OR = {
						has_building = mills
						has_building = farm_estate
						has_building = tradecompany
						has_building = plantations
						has_building = textile
						has_building = weapons
						has_building = wharf
						has_building = furnace
					}
				}
				amount = 20
			}
		}
		effect = {
			add_country_modifier = {
				name = "proto_industrialization"
				duration = 10950
			}
			add_years_of_income = 1.5
		}
	}
	genchinese_innovations_of_yu_the_great_mission = {
		icon = mng_tame_china_sorrow
		required_missions = { genchinese_imperial_ambitions_mission }
		position = 6
		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 = 2 } 
			}	
		}
		
		trigger = {
			2142 = { 
				num_of_times_improved = 2 
				owned_by = ROOT 
				if = {
					limit = { has_dlc = "Mandate of Heaven" }
					NOT = { devastation = 1 } 
				}
			}
			4196 = { 
				num_of_times_improved = 2 
				owned_by = ROOT 
				if = {
					limit = { has_dlc = "Mandate of Heaven" }
					NOT = { devastation = 1 } 
				}
			}
			2141 = { 
				num_of_times_improved = 2 
				owned_by = ROOT 
				if = {
					limit = { has_dlc = "Mandate of Heaven" }
					NOT = { devastation = 1 } 
				}
			}
			688 = { 
				num_of_times_improved = 2 
				owned_by = ROOT 
				if = {
					limit = { has_dlc = "Mandate of Heaven" }
					NOT = { devastation = 1 } 
				}
			}
			1836 = { 
				num_of_times_improved = 2
				owned_by = ROOT 
				if = {
					limit = { has_dlc = "Mandate of Heaven" }
					NOT = { devastation = 1 } 
				}
			}
		}
		effect = {
			country_event = {
				id = mmetr_Generic_Chinese_mission_events.8
			}
			tooltip = {
				add_country_modifier = {
					name = "me_genchnw_a_new_great_yu"
					duration = 10950
				}
			}
		}
	}
	genchinese_study_the_arts_of_espionage_mission = {
		icon = mng_form_depots
		required_missions = {  }
		position = 7
		trigger = {
			OR = { 
				spymaster = 1
				ruler_has_personality = intricate_web_weaver_personality
				dip = 5 
				has_idea = efficient_spies
				national_focus = DIP
			}
			if = { 
				limit = { has_estate = estate_eunuchs } 
				estate_loyalty = {
					estate = estate_eunuchs
					loyalty = 60
				}
			}
			OR = {
				any_rival_country = {
					has_spy_network_from = {
						who = ROOT
						value = 50
					}
				}
				any_enemy_country = {
					has_spy_network_from = {
						who = ROOT
						value = 50
					}
				}
				any_war_enemy_country = {
					has_spy_network_from = {
						who = ROOT
						value = 50
					}
				}
			}
		}
		effect = {
			add_dip_power = 50
			add_country_modifier = {
				name = "me_genchnw_war_by_espionage"
				duration = 10950
			}
		}
	}
	genchinese_establish_a_fleet_mission = {
		icon = mission_korean_naval_battle_panokseon
		required_missions = { genchinese_study_the_arts_of_espionage_mission }
		position = 8
		trigger = {
			navy_size = 30
			num_of_owned_provinces_with = {
				value = 12
				has_port = yes
			}
		}
		effect = {
			add_navy_tradition = 10
			add_country_modifier = {
				name = "me_genchnw_tower_ship_fleet"
				duration = 10950
			}
			define_advisor = {
				type = naval_reformer
				skill = 2
				discount = yes
			}
		}
	}
	genchinese_overseas_missions_mission = {
		icon = mission_japanese_wa_himiko
		required_missions = { genchinese_establish_a_fleet_mission genchinese_subjugate_the_hanguo_mission }
		position = 10
		provinces_to_highlight = {
			region = japan_region
			NOT = {
				country_or_subject_holds = ROOT
			}
			has_discovered = ROOT
		}
		trigger = {
			num_of_provinces_owned_or_owned_by_subjects_with = {
				value = 10
				region = japan_region
			}
		}
		effect = {
			add_country_modifier = {
				name = "me_genchnw_overseas_exchange"
				duration = 10950
			}
			custom_tooltip = genchinese_overseas_missions_mission.tt
			if = {
				limit = {
					is_emperor_of_china = yes
				}
				every_known_country = {
					limit = {
						capital_scope = {
							region = japan_region
						}
					}
					reverse_add_casus_belli = {
						target = ROOT
						type = cb_force_tributary
						months = 200
					}
				}
			}
		}
	}
	genchinese_treasure_explorations = {
		icon = mission_to_the_south_china_sea
		required_missions = { genchinese_overseas_missions_mission }
		position = 12
		trigger = {
			num_of_colonies = 1
			num_of_owned_provinces_with = {
				value = 5
				NOT = { superregion = china_superregion }
				is_overseas = yes
			}
		}
		effect = {
			add_country_modifier = {
				name = "me_genchnw_treasure_fleet"
				duration = -1
			}
			add_country_modifier = {
				name = "me_genchnw_overseas_colonies_policy"
				duration = 10950
			}
		}
	}
}