
franconia_conquest_group_1 = {
	slot = 1
	generic = no
	ai = yes
	potential = {
		OR = {
			tag = WBG
			tag = ANS
			tag = BAM
			tag = BYT
			tag = ROT
			tag = NUM
			tag = FKN
			tag = COB
		}
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes
	
	fkn_defeat_rivals = {
		icon = mission_assemble_an_army
		required_missions = { }

		provinces_to_highlight = {
			OR = {
				area = franconia_area
				area = upper_franconia_area
			}
			OR = {
				NOT = { owned_by = root }
				NOT = { is_core = root }
			}
			ROOT = {
				NOT = {
					num_of_owned_provinces_with = {
						value = 4
						OR = {
							area = franconia_area
							area = upper_franconia_area
						}
						is_core = root
					}
				}
			}
		}
		
		trigger = {
			num_of_owned_provinces_with = {
				value = 4
				OR = {
					area = franconia_area
					area = upper_franconia_area
				}
				is_core = root
			}
		}
		
		effect = {
			franconia_area = {
				limit = {
					NOT = { owned_by = root }
					NOT = { is_permanent_claim = root }
				}
				add_permanent_claim = root
			}
			upper_franconia_area = {
				limit = {
					NOT = { owned_by = root }
					NOT = { is_permanent_claim = root }
				}
				add_permanent_claim = root
			}
		}
	}
	fkn_liberty = {
		icon = mission_noble_council
		required_missions = { fkn_defeat_rivals }

		provinces_to_highlight = {
			OR = {
				area = franconia_area
				area = upper_franconia_area
			}
			NOT = { owner = { primary_culture = franconian } }
		}
		
		trigger = {
			franconia_area = {
				type = all
				owner = { primary_culture = franconian }
			}
			upper_franconia_area = {
				type = all
				owner = { primary_culture = franconian }
			}
		}
		
		effect = {
			hesse_area = {
				limit = {
					NOT = { owned_by = root }
					NOT = { is_permanent_claim = root }
				}
				add_permanent_claim = root
			}
			palatinate_area = {
				limit = {
					NOT = { owned_by = root }
					NOT = { is_permanent_claim = root }
				}
				add_permanent_claim = root
			}
			83 = {
				if = {
					limit = {
						NOT = { owned_by = root }
						NOT = { is_permanent_claim = root }
					}
					add_permanent_claim = root
				}
			}
		}
	}
	fkn_greater_franconia = {
		icon = mission_unite_home_region
		required_missions = { fkn_liberty }

		provinces_to_highlight = {
			OR = {
				AND = {
					province_id = 1876
					OR = {
						NOT = { owned_by = root }
						NOT = { is_core = root }
					}
				}
				AND = {
					OR = {
						area = hesse_area
						area = palatinate_area
						province_id = 83
					}
					NOT = { country_or_non_sovereign_subject_holds = root }
					ROOT = {
						NOT = {
							num_of_owned_provinces_with = {
								value = 8 #of 9
								OR = {
									area = hesse_area
									area = palatinate_area
									province_id = 83
								}
							}
						}
					}
				}
			}
			OR = {
				area = hesse_area
				area = palatinate_area
				province_id = 83
			}
			NOT = { country_or_non_sovereign_subject_holds = root }
		}
		
		trigger = {
			owns_core_province = 1876
			num_of_owned_provinces_with = {
				value = 8 #of 9
				OR = {
					area = hesse_area
					area = palatinate_area
					province_id = 83
				}
			}
		}
		
		effect = {
			add_country_modifier = {
				name = fkn_franconia_ascendant
				duration = 7300
			}

			upper_bavaria_area = {
				limit = {
					NOT = { owned_by = root }
					NOT = { is_permanent_claim = root }
				}
				add_permanent_claim = root
			}
			lower_bavaria_area = {
				limit = {
					NOT = { owned_by = root }
					NOT = { is_permanent_claim = root }
				}
				add_permanent_claim = root
			}
			east_bavaria_area = {
				limit = {
					NOT = { owned_by = root }
					NOT = { is_permanent_claim = root }
				}
				add_permanent_claim = root
			}
			every_province = {
				limit = {
					OR = {
						owned_by = ING
						owned_by = LBV
						owned_by = UBV
						owned_by = BAV
					}
					NOT = { area = upper_bavaria_area }
					NOT = { area = lower_bavaria_area }
					NOT = { area = east_bavaria_area }
					NOT = { is_claim = root }
					NOT = { country_or_non_sovereign_subject_holds = root }
				}
				add_claim = root
			}
		}
	}
	fkn_subjugate_bavaria = {
		icon = mission_have_two_subjects
		required_missions = { fkn_greater_franconia }

		provinces_to_highlight = {
			OR = {
				AND = {
					OR = {
						area = upper_bavaria_area
						area = lower_bavaria_area
						area = east_bavaria_area
					}
					NOT = { country_or_non_sovereign_subject_holds = root }
					ROOT = {
						NOT = {
							num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
								value = 8
								OR = {
									area = upper_bavaria_area
									area = lower_bavaria_area
									area = east_bavaria_area
								}
							}
						}
					}
				}
				AND = {
					OR = {
						owned_by = ING
						owned_by = LBV
						owned_by = UBV
						owned_by = BAV
					}
					NOT = { country_or_non_sovereign_subject_holds = root }
				}
			}
		}
		
		trigger = {
			if = {
				limit = {
					exists = ING
				}
				ING = {
					OR = {
						exists = no
						is_subject_of = root
					}
				}
			}
			if = {
				limit = {
					exists = UBV
				}
				UBV = {
					OR = {
						exists = no
						is_subject_of = root
					}
				}
			}
			if = {
				limit = {
					exists = LBV
				}
				LBV = {
					OR = {
						exists = no
						is_subject_of = root
					}
				}
			}
			if = {
				limit = {
					exists = BAV
				}
				BAV = {
					OR = {
						exists = no
						is_subject_of = root
					}
				}
			}
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				value = 8
				OR = {
					area = upper_bavaria_area
					area = lower_bavaria_area
					area = east_bavaria_area
				}
			}
		}
		
		effect = {
			add_prestige = 20
			
			lorraine_area = {
				limit = {
					NOT = { owned_by = root }
					NOT = { is_permanent_claim = root }
				}
				add_permanent_claim = root
			}
			champagne_area = {
				limit = {
					NOT = { owned_by = root }
					NOT = { is_permanent_claim = root }
				}
				add_permanent_claim = root
			}
			ile_de_france_area = {
				limit = {
					NOT = { owned_by = root }
					NOT = { is_permanent_claim = root }
				}
				add_permanent_claim = root
			}
			orleans_area = {
				limit = {
					NOT = { owned_by = root }
					NOT = { is_permanent_claim = root }
				}
				add_permanent_claim = root
			}
		}
	}
}

franconia_conquest_group_2 = {
	slot = 1
	generic = no
	ai = yes
	potential = {
		tag = FKN
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes
	
	fkn_kingdom_of_the_franks = {
		icon = mission_empire
		position = 5
		required_missions = { fkn_subjugate_bavaria }

		provinces_to_highlight = {
			province_id = 183
			OR = {
				NOT = { owned_by = root }
				NOT = { is_core = root }
			}
		}
		
		trigger = {
			owns_core_province = 183 #Paris
			total_own_and_non_tributary_subject_development = FRA
			army_size = FRA
		}
		
		effect = {
			if = {
				limit = {
					NOT = { government_rank = 2 }
					OR = {
						is_part_of_hre = no
						is_elector = yes
					}
				}
				set_government_rank = 2
			}
			add_country_modifier = {
				name = fkn_kingdom_of_the_franks_mod
				duration = -1
			}
			if = {
				limit = {
					valid_for_personal_unions_trigger = yes
					exists = FRA
					FRA = {
						valid_for_personal_unions_trigger = yes
					}
				}
				add_casus_belli = {
					type = cb_restore_personal_union
					months = 300
					target = FRA
				}
			}
			else = {
				france_region = {
					limit = {
						NOT = { owned_by = root }
						NOT = { is_permanent_claim = root }
					}
					add_permanent_claim = root
				}
			}
		}
	}
}


franconia_splendour_group = {
	slot = 2
	generic = no
	ai = yes
	potential = {
		OR = {
			tag = WBG
			tag = ANS
			tag = BAM
			tag = BYT
			tag = ROT
			tag = NUM
			tag = FKN
			tag = COB
		}
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes
	
	fkn_franconian_prosperity = {
		icon = mission_high_income
		required_missions = {  }

		provinces_to_highlight = {
			owned_by = root
			OR = {
				AND = {
					is_capital = yes
					NOT = { num_of_buildings_in_province = 2 }
				}
				NOT = { development = 10 }
				NOT = { num_of_times_improved_by_owner = 3 }
			}
		}
		
		trigger = {
			capital_scope = {
				num_of_buildings_in_province = 2
			}
			num_of_owned_provinces_with = {
				value = 3
				development = 10
				num_of_times_improved_by_owner = 3
			}
		}
		
		effect = {
			add_country_modifier = {
				name = fkn_we_prosper
				duration = 7300
			}
		}
	}
	fkn_patronage_of_the_arts = {
		icon = mission_early_modern_university
		required_missions = { fkn_franconian_prosperity }
		
		trigger = {
			has_adm_advisor_2 = yes
			has_dip_advisor_2 = yes
			has_mil_advisor_2 = yes
			is_in_deficit = no
		}
		
		effect = {
			add_country_modifier = {
				name = fkn_arts_patronised
				duration = 7300
			}
		}
	}
	fkn_industrial_revolution = {
		icon = mission_have_manufactories
		required_missions = { fkn_patronage_of_the_arts }

		provinces_to_highlight = {
			owned_by = root
			ROOT = {
				NOT = {
					num_of_owned_provinces_with = {
						value = 5
						has_manufactory_trigger = yes
						development = 10
					}
				}
			}
			OR = {
				AND = {
					ROOT = {
						num_of_owned_provinces_with = {
							value = 5
							has_manufactory_trigger = yes
						}
					}
					has_manufactory_trigger = yes
					NOT = { development = 10 }
				}
				AND = {
					ROOT = {
						num_of_owned_provinces_with = {
							value = 5
							development = 10
						}
					}
					has_manufactory_trigger = no
					development = 10
				}
				AND = {
					NOT = {
						ROOT = {
							num_of_owned_provinces_with = {
								value = 5
								has_manufactory_trigger = yes
							}
						}
					}
					NOT = {
						ROOT = {
							num_of_owned_provinces_with = {
								value = 5
								development = 10
							}
						}
					}
					OR = {
						has_manufactory_trigger = no
						NOT = { development = 10 }
					}
				}
			}
		}
		
		trigger = {
			num_of_owned_provinces_with = {
				value = 5
				has_manufactory_trigger = yes
				development = 10
			}
		}
		
		effect = {
			add_country_modifier = {
				name = fkn_we_produce_stuff
				duration = 7300
			}
		}
	}
}
franconia_splendour_group_2 = {
	slot = 2
	generic = no
	ai = yes
	potential = {
		OR = {
			tag = FKN
			tag = ANS
			tag = BYT
		}
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes
	
	fkn_sanspareil = {
		icon = mission_monarch_in_throne_room
		position = 4
		required_missions = { fkn_industrial_revolution }

		provinces_to_highlight = {
			is_capital_of = root
			NOT = { num_of_buildings_in_province = 5 }
		}
		
		trigger = {
			prestige = 80
			legitimacy_equivalent = 95
			capital_scope = {
				num_of_buildings_in_province = 5
			}
		}
		
		effect = {
			capital_scope = {
				add_province_modifier = {
					name = fkn_franconian_palace
					duration = -1
				}
			}

			if = {
				limit = {
					valid_for_personal_unions_trigger = yes
					OR = {
						dynasty = "0000000000000"
						tag = ANS
						tag = BYT
						was_tag = ANS
						was_tag = BYT
					}
					exists = BRA
					BRA = {
						valid_for_personal_unions_trigger = yes
					}
				}
				add_casus_belli = {
					type = cb_restore_personal_union
					months = 300
					target = BRA
				}
			}
			else_if = {
				limit = {
					valid_for_personal_unions_trigger = yes
					OR = {
						dynasty = "0000000000000"
						tag = ANS
						tag = BYT
						was_tag = ANS
						was_tag = BYT
					}
					exists = PRU
					PRU = {
						valid_for_personal_unions_trigger = yes
					}
				}
				add_casus_belli = {
					type = cb_restore_personal_union
					months = 300
					target = PRU
				}
			}
			else = {
				mittelmark_area = {
					limit = {
						NOT = { owned_by = root }
						NOT = { is_permanent_claim = root }
					}
					add_permanent_claim = root
				}
				neumark_area = {
					limit = {
						NOT = { owned_by = root }
						NOT = { is_permanent_claim = root }
					}
					add_permanent_claim = root
				}
			}
		}
	}
	fkn_union_with_brandenburg = {
		icon = mission_alliances
		required_missions = { fkn_sanspareil }

		provinces_to_highlight = {
			OR = {
				area = mittelmark_area
				area = neumark_area
			}
			NOT = { country_or_non_sovereign_subject_holds = root }
		}
		
		trigger = {
			mittelmark_area = {
				type = all
				country_or_non_sovereign_subject_holds = root
			}
			neumark_area = {
				type = all
				country_or_non_sovereign_subject_holds = root
			}
		}
		
		effect = {
			add_country_modifier = {
				name = fkn_expansionist_ambition
				duration = 10950
			}
		}
	}
}
