#Generic Ancient missions for before ADM Tech 30 appears in game

gen_ancient_1_missions = {
	slot = 1 
	generic = yes #only appears for non-unique, overwriting Generic European missions
	ai = yes
	potential = {
		NOT = { started_in = 922.1.1 }
	}
	
	gen_ancient_martial_tradition_mission = { 
		icon = mission_greek_phalanx_antiquity
		required_missions = {  }
		position = 1
		trigger = {
			num_of_generals = 1
			OR = {
				army_tradition = 50
				army_professionalism = 0.40
			}
		}
		effect = {
			add_country_modifier = {
				name = "me_genancient_war_tradition"
				duration = 10950
			}
		}
	}
	gen_ancient_unite_the_homeland_mission = { 
		icon = mission_persianate_empire
		required_missions = {  } 
		position = 2
		provinces_to_highlight = {
			region_for_scope_province = {
				is_capital_of = ROOT
			}
			NOT = { owned_by = ROOT }
		}
		trigger = {
			custom_trigger_tooltip = {
				tooltip = unite_home_region_ct
				capital_scope = {
					region_for_scope_province = {
						type = all
						owned_by = ROOT #Subjects won't count, empty provinces will need to be colonized.
					}
				}
			}
		}
		effect = {
			add_power_projection = {
				type = mission_rewards_power_projection
				amount = 25
			}
			add_country_modifier = {
				name = "hegemonic_ambition"
				duration = 9125 #25 years
			}
			custom_tooltip = home_region_generic_reward
			tooltip = {
				add_nationalism = -10
			}
			custom_tooltip = " "
			custom_tooltip = perma_claim_neighbor_area
			hidden_effect = {
				every_owned_province = {
					every_neighbor_province = {
						area = {
							limit = {
								NOT = { owned_by = ROOT }
								NOT = { is_permanent_claim = ROOT    }
								NOT = { is_core = ROOT    }
							}
							add_permanent_claim = ROOT
						}
					}
				}
				every_owned_province = {
					limit = {
						region = capital
					}
					add_nationalism = -10
				}
			}
		}
	}
	gen_ancient_cultural_hegemony_mission = { 
		icon = mission_the_chola_campaigns
		required_missions = {  } 
		position = 3
		trigger = {
			grown_by_development = 50
			num_accepted_cultures = 2
		}
		effect = { 
			add_country_modifier = {
				name = "me_genancient_recognized_citizens"
				duration = 10950
			}
			custom_tooltip = gen_ancient_cultural_hegemony_mission.tt
			random_owned_province = {
				limit = {
					has_owner_accepted_culture = yes
					has_owner_culture = no
				}
				add_base_tax = 1
			}
		}
	}
	gen_ancient_monuments_of_faith_mission = { 
		icon = mission_aksum_obelisk
		required_missions = {  }
		position = 4
		trigger = {
			num_of_owned_provinces_with = {
				value = 10
				OR = {
					has_building = glorious_monument
					has_building = temple
					has_building = cathedral
				}
			}
		}
		effect = { 
			add_prestige = 5
			add_country_modifier = {
				name = "me_genancient_religious_monuments"
				duration = 10950
			}
		}
		ai_weight = {
			factor = 2 
		}
	}
	gen_ancient_sponsor_missionaries_mission = { 
		icon = mission_hands_praying
		required_missions = { gen_ancient_monuments_of_faith_mission }
		position = 6
		trigger = {
			num_of_converted_provinces = { amount = 20 }
			num_of_owned_provinces_with = {
				value = 15
				has_owner_culture = no
				OR = {
					has_owner_religion = yes
					has_owner_secondary_religion = yes
				}
			}
		}
		effect = { 
			if = {
				limit = {
					has_dlc = "Rights of Man"
				}
				custom_tooltip = HORDES_IF_RULER_HAS_SINNER_REMOVE
			
				custom_tooltip = SEPERATOR_TOOLTIP
				
				hidden_effect = {
					remove_ruler_personality = sinner_personality
				}
			}
			if = {
				limit = {
					is_nomad = yes
				}
				unlock_estate = { estate = estate_church }
			}
			define_advisor = {
				type = theologian
				skill = 2
				discount = yes
			}
		}
	}
	
}

gen_ancient_2_missions = {
	slot = 2
	generic = yes #only appears for non-unique, overwriting Generic European missions
	ai = yes
	potential = {
		NOT = { started_in = 922.1.1 }
	}
	
	gen_ancient_call_upon_the_levies_mission = { 
		icon = mission_chinese_training
		required_missions = {  }
		position = 1
		trigger = {
			army_size_percentage = 1 #What you need to complete the mission, displayed for mission tooltip
		}
		effect = { #This is what you get after you finished your mission.
			add_country_modifier = {
				name = "thriving_arms_industry"
				duration = 9125 #25 years
			}
			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
					}
				}
			}
		}
		ai_weight = {
			factor = 10
		}
	}
	gen_ancient_expansionist_doctrine_mission = { 
		icon = mission_chinese_planning_war
		required_missions = { gen_ancient_call_upon_the_levies_mission }
		position = 2
		trigger = {
			grown_by_development = 30
			if = {
				limit = {
					has_dlc = "Art of War"
				}
				num_of_war_reparations = 3
			}
		}
		effect = { 
			capital_scope = {
				add_base_tax = 1
				add_base_production = 1
				add_base_manpower = 1
				area = {
					limit = { owned_by = ROOT }
					add_province_modifier = {
						name = "growth_of_capital"
						duration = 10950 #30 years
					}
				}
			}
			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
					}
				}
			}
		}
		ai_weight = {
			factor = 5
		}
	}
	gen_ancient_glorious_conquest_mission = { 
		icon = mission_greek_general_surrendering
		required_missions = { gen_ancient_expansionist_doctrine_mission }
		position = 3
		trigger = {
			grown_by_states = 5
		}
		effect = { 
			add_mil_power = 100
			add_country_modifier = {
				name = "expansionist_country"
				duration = 9125 #25 years
			}
			custom_tooltip = perma_claim_neighbor_area
			hidden_effect = {
				every_owned_province = {
					every_neighbor_province = {
						area = {
							limit = {
								NOT = { owned_by = ROOT }
								NOT = { is_permanent_claim = ROOT    }
								NOT = { is_core = ROOT    }
							}
							add_permanent_claim = ROOT
						}
					}
				}
			}
		}
	}
	gen_ancient_wise_governance_mission = { 
		icon = mission_chinese_land_survey
		required_missions = { gen_ancient_glorious_conquest_mission }
		position = 4
		trigger = {
			num_of_states = 10
			stability = 2
			NOT = { corruption = 1 }
			NOT = { num_of_rebel_armies = 1 }
			is_bankrupt = no
			NOT = { average_unrest = 2 }
			has_any_disaster = no
			crown_land_share = 50
		}
		effect = { 
			add_adm_power = 100
			change_adm = 1		#Ruler gains +1 ADM skill to stats
			add_country_modifier = {
				name = "me_genancient_capable_governors"
				duration = 10950
			}
		}
	}
	gen_ancient_divine_right_mission = { 
		icon = mission_chinese_son_of_heaven
		required_missions = { gen_ancient_monuments_of_faith_mission gen_ancient_wise_governance_mission }
		position = 5
		trigger = {
			legitimacy_equivalent = 100
			religious_unity = 0.90
		}
		effect = { 
			add_country_modifier = {
				name = "me_genancient_divine_right_to_rule"
				duration = 10950
			}
		}
	}
	
}

gen_ancient_3_missions = {
	slot = 3
	generic = yes #only appears for non-unique, overwriting Generic European missions
	ai = yes
	potential = {
		NOT = { started_in = 922.1.1 }
	}
	
	gen_ancient_trustworthy_allies_mission = { 
		icon = mission_dove_peace_diplomacy
		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
				}
			}
		}
		effect = {
			add_country_modifier = {
				name = "influential_diplomacy"
				duration = 9125 #25 years
			}
			define_advisor = {
				type = diplomat
				skill = 1
				culture = ROOT
				religion = ROOT
				cost_multiplier = 0.5
			}
		}
	}
	gen_ancient_loyal_subjects_mission = { 
		icon = mission_kowtow
		required_missions = { gen_ancient_loyal_subjects_mission }
		position = 2
		trigger = {
			custom_trigger_tooltip = {
				tooltip = fun_great_king_of_funan_mission.tt
				calc_true_if = {
					all_subject_country = {
						has_opinion = {
							who = ROOT
							value = 150
						}
					}
					amount = 2
				}
			}
		}
		effect = { 
			add_dip_power = 100
			add_country_modifier = {
				name = "obedient_subjects"
				duration = 10950 #30 years
			}
			every_subject_country = {
				add_liberty_desire = -10
			}
		}
	}
	gen_ancient_bolster_fortifications_mission = { 
		icon = mission_great_wall
		required_missions = { gen_ancient_expansionist_doctrine_mission gen_ancient_loyal_subjects_mission }
		position = 3
		trigger = {
			is_at_war = no
			has_truce = yes
			num_of_owned_provinces_with = {
				value = 4
				fort_level = 1
			}
		}
		effect = { 
			add_country_modifier = {
				name = "me_genancient_art_of_fortification"
				duration = 10950 #30 years
			}
		}
	}
	gen_ancient_imperial_ambitions_mission = { 
		icon = mission_alexander_macedonian_flag
		required_missions = { gen_ancient_bolster_fortifications_mission gen_ancient_glorious_conquest_mission }
		position = 4
		trigger = {
			total_development = 1000
		}
		effect = { 
			add_prestige_or_monarch_power = {
				amount = 30
			}
			add_country_modifier = {
				name = "imperial_ambition"
				duration = 10950
			}
			custom_tooltip = perma_claim_neighbor_area
			hidden_effect = {
				every_owned_province = {
					every_neighbor_province = {
						area = {
							limit = {
								NOT = { owned_by = ROOT }
								NOT = { is_permanent_claim = ROOT    }
								NOT = { is_core = ROOT    }
							}
							add_permanent_claim = ROOT
						}
					}
				}
			}
		}
	}
	gen_ancient_mining_industries_mission = { 
		icon = mission_zambezi_gold
		required_missions = { gen_ancient_renovate_the_capital_mission }
		position = 5
		trigger = {
			num_of_owned_provinces_with = {
				value = 5
				base_production = 4
				num_of_times_improved = 1
				OR = {
					trade_goods = iron
					trade_goods = copper
					trade_goods = gold
					trade_goods = salt
					trade_goods = gems
				}
			}
		}
		effect = { 
			every_owned_province = {
				limit = {
					OR = {
						trade_goods = iron
						trade_goods = copper
						trade_goods = gold
						trade_goods = salt
						trade_goods = gems
					}
				}
				add_province_modifier = {
					name = "me_genancient_mining_business_investments"
					duration = 10950
				}
			}
		}
	}
	gen_ancient_abundant_granaries_mission = { 
		icon = mission_consume_the_baghels
		required_missions = { gen_ancient_new_road_networks_mission }
		position = 6
		trigger = {
			num_of_owned_provinces_with = {
				value = 10
				OR = {
					has_building = storehouse
					has_building = windmill
					has_building = workshop
					has_building = counting_house
				}
			}
		}
		effect = { 
			add_adm_power = 50
			add_country_modifier = {
				name = "me_genancient_production_spree"
				duration = 10950
			}
		}
	}
	
}

gen_ancient_4_missions = {
	slot = 4
	generic = yes #only appears for non-unique, overwriting Generic European missions
	ai = yes
	potential = {
		NOT = { started_in = 922.1.1 }
	}
	
	gen_ancient_establish_a_navy_mission = { 
		icon = mission_arabian_sea_trade
		required_missions = {  }
		position = 1
		trigger = {
			num_of_admirals = 2
			OR = {
				num_of_light_ship = 10
				num_of_galley = 10
			}
		}
		effect = { 
			add_dip_power = 50
			if = {
				limit = {
					NOT = {
						navy_tradition = 30
					}
				}
				create_admiral = { tradition = 30 }
			}
			else_if = {
				limit = {
					NOT = {
						navy_tradition = 50
					}
				}
				create_admiral = { tradition = 50 }
			}
			else_if = {
				limit = {
					NOT = {
						navy_tradition = 70
					}
				}
				create_admiral = { tradition = 70 }
			}
			else_if = {
				limit = {
					NOT = {
						navy_tradition = 80
					}
				}
				create_admiral = { tradition = 80 }
			}
			else = {
				create_admiral = { tradition = 100 }
			}
			add_country_modifier = {
				name = "me_genancient_naval_expansion"
				duration = 10950
			}
		}
	}
	gen_ancient_mercantile_authority_mission = { 
		icon = mission_chinese_market
		required_missions = {  }
		position = 2
		trigger = {
			home_trade_node = {
				trade_share = {
					country = ROOT
					share = 75
				}
			}
		}
		effect = { 
			hidden_effect = {
				home_trade_node_effect_scope = {
					random_trade_node_member_province = {
						limit = {
							owned_by = ROOT
						}
						save_event_target_as = reward_province
					}
					random_trade_node_member_province = {
						limit = {
							owned_by = ROOT
							is_capital = yes
						}
						save_event_target_as = reward_province
					}
					random_trade_node_member_province = {
						limit = {
							owned_by = ROOT
							development = CAPITAL
							is_capital = no
						}
						save_event_target_as = reward_province
					}
					random_trade_node_member_province = {
						limit = {
							owned_by = ROOT
							development = CAPITAL
							is_capital = no
							development = 20
						}
						save_event_target_as = reward_province
					}
					random_trade_node_member_province = {
						limit = {
							owned_by = ROOT
							development = CAPITAL
							is_capital = no
							development = 25
						}
						save_event_target_as = reward_province
					}
					random_trade_node_member_province = {
						limit = {
							owned_by = ROOT
							development = CAPITAL
							is_capital = no
							development = 30
						}
						save_event_target_as = reward_province
					}
				}
			}
			if = {
				limit = { has_saved_event_target = reward_province }
				event_target:reward_province = {
					add_province_modifier = {
						name = "dominant_trade_hub"
						duration = -1
					}
				}
			}
			else = {
				custom_tooltip = dominant_home_node_reward_tooltip
			}
			custom_tooltip = " "
			add_mercantilism_or_monarch_power = { amount = 3 }
		}
	}
	gen_ancient_establish_emporia_mission = { 
		icon = mission_growth_of_surat
		required_missions = { gen_ancient_mercantile_authority_mission gen_ancient_loyal_subjects_mission }
		position = 3
		trigger = {
			num_of_owned_provinces_with = {
				value = 2
				province_has_center_of_trade_of_level = 1
			}
			num_of_owned_provinces_with = {
				value = 3
				province_has_center_of_trade_of_level = 1
			}
			num_of_owned_provinces_with = {
				value = 3
				has_port = yes
				development = 12
			}
		}
		effect = { 
			add_dip_power = 50
			add_country_modifier = {
				name = "me_genancient_trade_city_merchants"
				duration = 10950
			}
		}
	}
	gen_ancient_renovate_the_capital_mission = { 
		icon = mission_greek_city_acropolis
		required_missions = {  }
		position = 4
		provinces_to_highlight = {
			is_capital_of = ROOT
		}
		trigger = {
			capital_scope = {
				num_of_times_improved = 5
			}
		}
		effect = {
			add_prestige = 5
			capital_scope = {
				add_province_modifier = {
					name = "me_genancient_thriving_capital"
					duration = 10950
				}
			}
		}
		ai_weight = {
			factor = 2
		}
	}
	gen_ancient_new_road_networks_mission = { 
		icon = mission_road_construction_ancient
		required_missions = { gen_ancient_renovate_the_capital_mission }
		position = 5
		trigger = {
			num_of_owned_provinces_with = {
				value = 10
				has_building = road
			}
		}
		effect = { 
			add_country_modifier = {
				name = "me_genancient_road_network"
				duration = 10950
			}
		}
	}
	gen_ancient_bread_and_circuses_mission = { 
		icon = mission_latin_farmer_latifundia
		required_missions = { gen_ancient_new_road_networks_mission }
		position = 6
		trigger = {
			num_of_owned_provinces_with = {
				value = 15
				base_production = 3
				OR = {
					trade_goods = grain
					trade_goods = wine
					trade_goods = fish
					trade_goods = livestock
				}
			}
		}
		effect = { 
			add_country_modifier = {
				name = "me_genancient_bread_and_circuses"
				duration = 10950
			}
		}
	}
	
}

gen_ancient_5_missions = {
	slot = 5
	generic = yes #only appears for non-unique, overwriting Generic European missions
	ai = yes
	potential = {
		NOT = { started_in = 922.1.1 }
	}
	
	gen_ancient_security_for_the_people_mission = { 
		icon = mission_greco_roman_market
		required_missions = {  }
		position = 1
		trigger = {
			stability = 3
			is_at_war = no
		}
		effect = { 
			add_country_modifier = {
				name = "me_genancient_stable_realm"
				duration = 9250 #25 years
			}
		}
	}
	gen_ancient_the_flow_of_coin_mission = { 
		icon = mission_establish_mint_towns
		required_missions = { gen_ancient_security_for_the_people_mission }
		position = 2
		trigger = {
			share_of_starting_income = 1.5
		}
		effect = { 
			add_country_modifier = {
				name = "growing_economy"
				duration = 10950 #30 years
			}
			define_advisor = {
				type = treasurer
				skill = 1
				culture = ROOT
				religion = ROOT
				cost_multiplier = 0.5
			}
		}
	}
	gen_ancient_overflowing_treasury_mission = { 
		icon = mission_entrepot_of_india
		required_missions = { gen_ancient_the_flow_of_coin_mission }
		position = 3
		trigger = {
			treasury = 2000
		}
		effect = { 
			add_country_modifier = {
				name = "strong_treasury"
				duration = 10950
			}
			add_corruption = -2
		}
	}
	gen_ancient_rising_metropolis_mission = { 
		icon = mission_roman_forum_imperial
		required_missions = { gen_ancient_overflowing_treasury_mission }
		position = 4
		trigger = {
			capital_scope = {
				development = 25
			}
			num_of_owned_provinces_with = {
				value = 30
				has_building = road
			}
		}
		effect = { 
			add_prestige = 20
			if = {
				limit = {
					capital_scope = {
						NOT = {
							has_center_of_trade_of_level = 1
						}
					}
				}
				capital_scope = {
					center_of_trade = 1
				}
			}
			capital_scope = {
				add_province_modifier = {	#lost when conquered by another country
					name = "me_genancient_envy_of_the_world"
					duration = -1
				}
			}
		}
	}
	gen_ancient_heed_wise_council_mission = { 
		icon = mission_celtic_nobles
		required_missions = {  }
		position = 5
		trigger = {
			employed_advisor = {
				skill = 3
			}
			if = {
				limit = { has_estate = estate_church }
				num_of_estate_agendas_completed = {
					estate = estate_church
					value = 2
				}
			}
			if = {
				limit = { has_estate = estate_nobles }
				num_of_estate_agendas_completed = {
					estate = estate_nobles
					value = 2
				}
			}
			if = {
				limit = { has_estate = estate_burghers }
				num_of_estate_agendas_completed = {
					estate = estate_burghers
					value = 2
				}
			}
		}
		effect = { 
			add_corruption = -2
			add_country_modifier = {
				name = "me_genancient_meritocratic_appointments"
				duration = 10950
			}
		}
	}
	
}
