emp_burgundy_1 = {
	slot = 1
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Emperor"
	}
	potential = {
		OR = {
			tag = BUR
			tag = LOT
		}
		started_in = 1384.1.30		#added in mod MMETR, start of the County of Burgundy after death of Louis II
		NOT = { map_setup = map_setup_random }
		has_dlc = "Emperor"
	}
	has_country_shield = yes
	
	emp_bur_nevers = {
		icon = mission_have_two_subjects
		required_missions = { }
		
		provinces_to_highlight = {
			OR = {
				province_id = 191
				province_id = 181
			}
			NOT = { owned_by = ROOT }
		}
		
		trigger = {
			191 = {
				owned_by = ROOT
			}
			181 = {
				owned_by = ROOT
			}
		}
		
		effect = {
			romandie_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			205 = {
				add_permanent_claim = ROOT
			}
			4719 = {
				add_permanent_claim = ROOT
			}
		}
		ai_weight = {
			factor = 500	#Integrate vassal
		}
	}
	emp_bur_romandie = {
		icon = mission_landsknecht_soldier
		required_missions = { emp_bur_nevers }
		
		provinces_to_highlight = {
			OR = {
				area = romandie_area
				province_id = 205
				province_id = 4719
			}
			NOT = { owned_by = ROOT }
		}
		
		trigger = {
			romandie_area = {
				type = all
				owned_by = ROOT
			}
			205 = {
				owned_by = ROOT
			}
			4719 = {
				owned_by = ROOT
			}
		}
		
		effect = {
			savoy_dauphine_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			provence_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			102 = {
				add_permanent_claim = ROOT
			}
		}
		ai_weight = {
			factor = 500	#Rivalry
		}
	}
	
	emp_bur_cisjurania = {
		icon = mission_italian_condottiere
		required_missions = { emp_bur_romandie }
		
		provinces_to_highlight = {
			OR = {
				area = provence_area
				area = savoy_dauphine_area
				province_id = 102
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
			NOT = {
				ROOT = {
					num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
						value = 8 #out of 9 (so you can leave out Avignon)
						OR = {
							area = provence_area
							area = savoy_dauphine_area
							province_id = 102
						}
					}
				}
			}
		}
		
		trigger = {
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				value = 8 #out of 9 (so you can leave out Avignon)
				OR = {
					area = provence_area
					area = savoy_dauphine_area
					province_id = 102
				}
			}
		}
		
		effect = {
			if = {
				limit = {
					NOT = { government_rank = 2 }
				}
				set_government_rank = 2
				else = {
					add_adm_power = 100
				}
			}
			add_country_modifier = {
				name = "bur_arles_mod"
				duration = "7300"
			}
			piedmont_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			lombardy_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			po_valley_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
		}
		ai_weight = {
			factor = 500	#Natural conquest
		}
	}
	emp_bur_lombardy = {
		icon = kingdom_of_lombardy
		required_missions = { emp_bur_cisjurania }
		provinces_to_highlight = {
			OR = {
				AND = {
					OR = {
						area = piedmont_area
						area = lombardy_area
						area = po_valley_area
					}
					NOT = {
						ROOT = {
							num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
								value = 10 #out of 12
								OR = {
									area = piedmont_area
									area = lombardy_area
									area = po_valley_area
								}
							}
						}
					}
				}
				province_id = 104
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			owns_or_non_sovereign_subject_of = 104
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				value = 10 #out of 12
				OR = {
					area = piedmont_area
					area = lombardy_area
					area = po_valley_area
				}
			}
		}
		effect = {
			add_adm_power = 100
			liguria_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			venetia_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			emilia_romagna_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			tuscany_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
		}
		ai_weight = {
			factor = 500	#Natural conquest
		}
	}
}

emp_lotharingia_1 = {
	slot = 1
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Emperor"
	}
	potential = {
		tag = LOT
		NOT = { map_setup = map_setup_random }
		has_dlc = "Emperor"
	}
	has_country_shield = yes
	
	emp_bur_italy = {
		icon = establish_client_states
		position = 6
		required_missions = { emp_bur_lombardy }
		provinces_to_highlight = {
			OR = {
				AND = {
					OR = {
						area = liguria_area
						area = venetia_area
						area = emilia_romagna_area
						area = tuscany_area
					}
					NOT = {
						ROOT = {
							num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
								value = 15 #out of 18
								OR = {
									area = liguria_area
									area = venetia_area
									area = emilia_romagna_area
									area = tuscany_area
								}
							}
						}
					}
				}
				province_id = 101
				province_id = 112
				province_id = 116
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			owns_or_non_sovereign_subject_of = 101
			owns_or_non_sovereign_subject_of = 112
			owns_or_non_sovereign_subject_of = 116
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				value = 15 #out of 18
				OR = {
					area = liguria_area
					area = venetia_area
					area = emilia_romagna_area
					area = tuscany_area
				}
			}
		}
		effect = {
			add_prestige = 20
			add_country_modifier = {
				name = bur_italian_king
				duration = -1
			}
		}
	}
}

emp_burgundy_2 = {
	slot = 2
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Emperor"
	}
	potential = {
		OR = {
			tag = BUR
			tag = LOT
		}
		started_in = 1384.1.30		#added in mod MMETR, start of the County of Burgundy after death of Louis II
		NOT = { map_setup = map_setup_random }
		has_dlc = "Emperor"
	}
	has_country_shield = yes
	
	emp_bur_unite_the_realm = {
		icon = unite_the_realm
		position = 2
		required_missions = { emp_bur_subjects }
		provinces_to_highlight = {
			OR = {
				owned_by = BRB
				owned_by = FLA
				owned_by = HOL
				AND = {
					OR = {
						area = flanders_area
						area = brabant_area
						area = north_brabant_area
						area = holland_area
					}
					NOT = { owned_by = ROOT }
					NOT = {
						ROOT = {
							num_of_owned_provinces_with = {
								value = 10
								OR = {
									area = flanders_area
									area = brabant_area
									area = north_brabant_area
									area = holland_area
								}
							}
						}
					}
				}
			}
		}
		trigger = {
			NOT = { exists = BRB }
			NOT = { exists = FLA }
			NOT = { exists = HOL }
			num_of_owned_provinces_with = {
				value = 10 #the number owned by BRB, FLA and HOL at start
				OR = {
					area = flanders_area
					area = brabant_area
					area = north_brabant_area
					area = holland_area
				}
			}
		}
		effect = {
			add_dip_power = 50
			low_countries_region = {
				limit = { owned_by = root }
				add_province_modifier = {
					name = bur_realm_united_mod
					duration = 7300
				}
			}
		}
		ai_weight = {
			factor = 500	#Natural întegration
		}
	}
	emp_bur_secure_the_lowlands = {
		icon = mission_spanish_netherlands
		position = 4
		required_missions = { emp_bur_unite_the_realm }
		provinces_to_highlight = {
			region = low_countries_region
			OR = {
				NOT = { owned_by = root }
				NOT = { is_core = root }
			}
		}
		trigger = {
			OR = {
				AND = {
					is_year = 1650
					NOT = { has_disaster = dutch_revolt_disaster }
				}
				custom_trigger_tooltip = {
					tooltip = emp_bur_dutch_revolt_has_happened
					has_country_flag = had_dutch_revolt
				}
			}
			low_countries_region = {
				type = all
				owned_by = root
				is_core = root
			}
		}
		effect = {
			low_countries_region = {
				add_province_modifier = {
					name = bur_lowlands_secured_mod
					duration = 7300
				}
			}
		}
		ai_weight = {
			factor = 500	#Natural conquest
		}
	}

	emp_bur_flemish_trade = {
		icon = sources_of_trade
		required_missions = { emp_bur_secure_the_lowlands }
		provinces_to_highlight = {
			OR = {
				AND = {
					province_id = 1269
					NOT = { is_strongest_trade_power = root }
				}
				AND = {
					ROOT = { has_dlc = "Dharma" }
					OR = {
						culture = dutch
						culture = flemish
						culture = wallonian
					}
					province_has_center_of_trade_of_level = 1
					OR = {
						NOT = { owned_by = root }
						NOT = { province_has_center_of_trade_of_level = 2 }
					}
					ROOT = {
						NOT = {
							num_of_owned_provinces_with = {
								value = 3
								province_has_center_of_trade_of_level = 2
								region = low_countries_region
							}
						}
					}
				}
				AND = {
					ROOT = { NOT = { has_dlc = "Dharma" } }
					OR = {
						culture = dutch
						culture = flemish
						culture = wallonian
					}
					province_has_center_of_trade_of_level = 1
					OR = {
						NOT = { owned_by = root }
						AND = {
							NOT = { has_building = trade_depot }
							NOT = { has_building = stock_exchange }
						}
					}
					ROOT = {
						NOT = {
							num_of_owned_provinces_with = {
								value = 3
								province_has_center_of_trade_of_level = 1
								region = low_countries_region
								OR = {
									has_building = trade_depot
									has_building = stock_exchange
								}
							}
						}
					}
				}
			}
		}
		trigger = {
			1269 = {
				is_strongest_trade_power = root
			}
			if = {
				limit = {
					has_dlc = "Dharma"
				}
				num_of_owned_provinces_with = {
					value = 3
					province_has_center_of_trade_of_level = 2
					region = low_countries_region
				}
			}
			else = {
				num_of_owned_provinces_with = {
					value = 3
					province_has_center_of_trade_of_level = 2
					region = low_countries_region
					OR = {
						has_building = trade_depot
						has_building = stock_exchange
					}
				}
			}
		}
		effect = {
			add_country_modifier = {
				name = bur_channel_trading
				duration = -1
			}
		}
	}
}

emp_burgundy_3 = {
	slot = 3
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Emperor"
	}
	potential = {
		OR = {
			tag = BUR
			tag = LOT
		}
		started_in = 1384.1.30		#added in mod MMETR, start of the County of Burgundy after death of Louis II
		NOT = { map_setup = map_setup_random }
		has_dlc = "Emperor"
	}
	has_country_shield = yes
	
	emp_bur_subjects = {
		icon = mission_alliances
		required_missions = { }
		
		trigger = {
			custom_trigger_tooltip = {
				tooltip = bur_subjects.tooltip
				NOT = {
					any_subject_country = {
						liberty_desire = 1
					}
				}
			}
		}
		
		effect = {
			lorraine_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
		}
	}
	
	emp_bur_lorraine = {
		icon = mission_conquer_50_development
		required_missions = { emp_bur_subjects }
		
		provinces_to_highlight = {
			area = lorraine_area
			NOT = { owned_by = ROOT }
		}
		
		trigger = {
			lorraine_area = {
				type = all
				owned_by = ROOT
			}
		}
		
		effect = {
			93 = {
				add_permanent_claim = ROOT
			}
			1878 = {
				add_permanent_claim = ROOT
			}
			2974 = {
				add_permanent_claim = ROOT
			}
			1742 = {
				add_permanent_claim = ROOT
			}
		}
		ai_weight = {
			factor = 500	#Natural conquest
		}
	}
	
	emp_bur_liege = {
		icon = mission_have_two_subjects
		required_missions = { emp_bur_lorraine }
		
		provinces_to_highlight = {
			OR = {
				province_id = 93
				province_id = 1878
				province_id = 2974
				province_id = 1742
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			93 = {
				country_or_non_sovereign_subject_holds = ROOT
			}
			1878 = {
				country_or_non_sovereign_subject_holds = ROOT
			}
			2974 = {
				country_or_non_sovereign_subject_holds = ROOT
			}
			1742 = {
				country_or_non_sovereign_subject_holds = ROOT
			}
		}
		
		effect = {
			add_prestige = 15
			add_country_modifier = {
				name = "bur_diplo_mod"
				duration = 5475
			}
			frisia_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
		}
		ai_weight = {
			factor = 500	#Natural conquest
		}
	}
	
	emp_bur_frisia = {
		icon = mission_hanseatic_city
		required_missions = { emp_bur_liege }
		
		provinces_to_highlight = {
			area = frisia_area
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			frisia_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT
			}
		}
		
		effect = {
			add_prestige = 20
			add_mil_power = 100
			1975 = {
				add_trade_modifier = {
					who = root
					duration = 7300
					power = 20
					key = bur_channel_ambition
				}
			}
		}
		ai_weight = {
			factor = 500	#Natural conquest
		}
	}
	
	emp_bur_appease_the_estates = {
		icon = appease_the_estates
		required_missions = {  }
		trigger = {
			crown_land_share = 30
			if = {
				limit = {
					has_estate = estate_nobles
				}
				estate_loyalty = {
					estate = estate_nobles
					loyalty = 60
				}
			}
			if = {
				limit = {
					has_estate = estate_burghers
				}
				estate_loyalty = {
					estate = estate_burghers
					loyalty = 60
				}
			}
			if = {
				limit = {
					has_estate = estate_church
				}
				estate_loyalty = {
					estate = estate_church
					loyalty = 60
				}
			}
		}
		effect = {
			if = {
				limit = {
					NOT = { has_estate = estate_nobles }
					NOT = { has_estate = estate_burghers }
					NOT = { has_estate = estate_church }
				}
				add_stability_or_adm_power = yes
			}
			else = {
				if = {
					limit = {
						NOT = { crown_land_share = 60 }
					}
					custom_tooltip = add_5_crown_land_share
					hidden_effect = {
						change_estate_land_share = {
							estate = all
							share = -5
						}
					}
				}
				if = {
					limit = {
						has_estate = estate_nobles
					}
					add_estate_loyalty_modifier = {
						estate = estate_nobles
						desc = VAL_BUR_APPEASED_ESTATES
						loyalty = 10
						duration = 7300
					}
				}
				if = {
					limit = {
						has_estate = estate_church
					}
					add_estate_loyalty_modifier = {
						estate = estate_church
						desc = VAL_BUR_APPEASED_ESTATES
						loyalty = 10
						duration = 7300
					}
				}
				if = {
					limit = {
						has_estate = estate_burghers
					}
					add_estate_loyalty_modifier = {
						estate = estate_burghers
						desc = VAL_BUR_APPEASED_ESTATES
						loyalty = 10
						duration = 7300
					}
				}
			}
		}
	}
	emp_bur_chivalry_is_not_dead = {
		icon = chivalry_is_not_dead
		position = 6
		required_missions = { emp_bur_appease_the_estates }
		trigger = {
			prestige = 80
			army_tradition = 80
			has_regency = no
		}
		effect = {
			country_event = { id = new_flavour_bur.5 }
		}
	}
}

emp_burgundy_4 = {
	slot = 4
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Emperor"
	}
	potential = {
		OR = {
			tag = BUR
			tag = LOT
		}
		started_in = 1384.1.30		#added in mod MMETR, start of the County of Burgundy after death of Louis II
		NOT = { map_setup = map_setup_random }
		has_dlc = "Emperor"
	}
	has_country_shield = yes
	
	emp_bur_english_alliance = {
		icon = english_alliance
		required_missions = { }
		provinces_to_highlight = {
			is_capital = yes
			OR = {
				AND = {
					owned_by = GBR
					ROOT = { NOT = { alliance_with = GBR } }
					NOT = {
						GBR = {
							OR = {
								is_rival = root
								root = { is_rival = prev }
							}
							OR = {
								has_opinion_modifier = {
									who = ROOT
									modifier = insulted
								}
								has_opinion_modifier = {
									who = ROOT
									modifier = scornfully_insulted
								}
							}
						}
					}
				}
				AND = {
					owned_by = ENG
					NOT = { exists = GBR }
					ROOT = { NOT = { alliance_with = ENG } }
					NOT = {
						ENG = {
							OR = {
								is_rival = root
								root = { is_rival = prev }
							}
							OR = {
								has_opinion_modifier = {
									who = ROOT
									modifier = insulted
								}
								has_opinion_modifier = {
									who = ROOT
									modifier = scornfully_insulted
								}
							}
						}
					}
				}
				AND = {
					owned_by = SCO
					NOT = { exists = GBR }
					NOT = { exists = ENG }
					ROOT = { NOT = { alliance_with = SCO } }
					NOT = {
						SCO = {
							OR = {
								is_rival = root
								root = { is_rival = prev }
							}
							OR = {
								has_opinion_modifier = {
									who = ROOT
									modifier = insulted
								}
								has_opinion_modifier = {
									who = ROOT
									modifier = scornfully_insulted
								}
							}
						}
					}
				}
				AND = {
					owned_by = FRA
					NOT = {
						FRA = {
							OR = {
								is_rival = root
								root = { is_rival = prev }
							}
							OR = {
								has_opinion_modifier = {
									who = ROOT
									modifier = insulted
								}
								has_opinion_modifier = {
									who = ROOT
									modifier = scornfully_insulted
								}
							}
						}
					}
					NOT = { FRA = { is_subject_of = ROOT } }
				}
			}
		}
		trigger = {
			if = {
				limit = { exists = GBR }
				OR = {
					alliance_with = GBR
					GBR = {
						custom_trigger_tooltip = {
							tooltip = rivalled_or_rival_of
							OR = {
								is_rival = root
								root = { is_rival = prev }
							}
						}
						custom_trigger_tooltip = {
							tooltip = has_been_insulted_by_root
							OR = {
								has_opinion_modifier = {
									who = ROOT
									modifier = insulted
								}
								has_opinion_modifier = {
									who = ROOT
									modifier = scornfully_insulted
								}
							}
						}
					}
				}
			}
			else_if = {
				limit = { exists = ENG }
				OR = {
					alliance_with = ENG
					ENG = {
						custom_trigger_tooltip = {
							tooltip = rivalled_or_rival_of
							OR = {
								is_rival = root
								root = { is_rival = prev }
							}
						}
						custom_trigger_tooltip = {
							tooltip = has_been_insulted_by_root
							OR = {
								has_opinion_modifier = {
									who = ROOT
									modifier = insulted
								}
								has_opinion_modifier = {
									who = ROOT
									modifier = scornfully_insulted
								}
							}
						}
					}
				}
			}
			else_if = {
				limit = { exists = SCO }
				OR = {
					alliance_with = SCO
					SCO = {
						custom_trigger_tooltip = {
							tooltip = rivalled_or_rival_of
							OR = {
								is_rival = root
								root = { is_rival = prev }
							}
						}
						custom_trigger_tooltip = {
							tooltip = has_been_insulted_by_root
							OR = {
								has_opinion_modifier = {
									who = ROOT
									modifier = insulted
								}
								has_opinion_modifier = {
									who = ROOT
									modifier = scornfully_insulted
								}
							}
						}
					}
				}
			}
			OR = {
				FRA = {
					custom_trigger_tooltip = {
						tooltip = rivalled_or_rival_of
						OR = {
							is_rival = root
							root = { is_rival = prev }
						}
					}
					custom_trigger_tooltip = {
						tooltip = has_been_insulted_by_root
						OR = {
							has_opinion_modifier = {
								who = ROOT
								modifier = insulted
							}
							has_opinion_modifier = {
								who = ROOT
								modifier = scornfully_insulted
							}
						}
					}
				}
				FRA = { is_subject_of = ROOT }
				NOT = { exists = FRA }
			}
		}
		effect = {
			add_country_modifier = {
				name = bur_english_diplomacy
				duration = 7300
			}
		}
		ai_weight = {
			factor = 500	#Natural diplomacy
		}
	}
	emp_bur_league_of_public_weal = {
		icon = league_of_the_public_weal
		required_missions = { emp_bur_english_alliance }
		provinces_to_highlight = {
			if = {
				limit = {
					calc_true_if = {
						amount = 3
						BRI = { is_subject_of = FRA }
						PRO = { is_subject_of = FRA }
						LOR = { is_subject_of = FRA }
						AUV = { is_subject_of = FRA }
						AMG = { is_subject_of = FRA }
						BOU = { is_subject_of = FRA }
						ORL = { is_subject_of = FRA }
						FOI = { is_subject_of = FRA }
						ALE = { is_subject_of = FRA }
						NEV = { is_subject_of = FRA }
						NRM = { is_subject_of = FRA }
					}
				}
				OR = {
					owned_by = BRI
					owned_by = PRO
					owned_by = LOR
					owned_by = AUV
					owned_by = AMG
					owned_by = BOU
					owned_by = ORL
					owned_by = FOI
					owned_by = ALE
					owned_by = NEV
					owned_by = NRM
				}
				owner = {
					is_subject_of = FRA
					NOT = {
						has_opinion = {
							who = root
							value = 100
						}
					}
				}
			}
			else = {
				is_capital = yes
				owner = {
					OR = {
						is_rival = FRA
						FRA = { is_rival = prev }
					}
				}
			}
		}
		trigger = {
			if = {
				limit = {
					calc_true_if = {
						amount = 3
						BRI = { is_subject_of = FRA }
						PRO = { is_subject_of = FRA }
						LOR = { is_subject_of = FRA }
						AUV = { is_subject_of = FRA }
						AMG = { is_subject_of = FRA }
						BOU = { is_subject_of = FRA }
						ORL = { is_subject_of = FRA }
						FOI = { is_subject_of = FRA }
						ALE = { is_subject_of = FRA }
						NEV = { is_subject_of = FRA }
						NRM = { is_subject_of = FRA }
					}
				}
				OR = {
					calc_true_if = {
						desc = emp_bur_league_of_public_weal_trigger_tooltip
						amount = 3
						all_country = {
							OR = {
								tag = BRI
								tag = PRO
								tag = LOR
								tag = AUV
								tag = AMG
								tag = BOU
								tag = ORL
								tag = FOI
								tag = BRI
								tag = ALE
								tag = NEV
								tag = NRM
							}
							is_subject_of = FRA
							has_opinion = {
								who = root
								value = 100
							}
						}
					}
					NOT = { exists = FRA }
					FRA = { is_subject_of = ROOT }
				}
			}
			else = {
				OR = { 
					calc_true_if = {
						desc = emp_bur_league_of_public_weal_trigger_tooltip2
						amount = 2
						all_ally = {
							OR = {
								is_rival = FRA
								FRA = { is_rival = prev }
							}
						}
					}
					NOT = { exists = FRA }
					FRA = { is_subject_of = ROOT }
				}
			}
			has_regency = no
		}
		effect = {
			if = {
				limit = {
					exists = FRA
					FRA = { NOT = { is_subject_of = ROOT } }
					calc_true_if = {
						amount = 3
						BRI = { is_subject_of = FRA }
						PRO = { is_subject_of = FRA }
						LOR = { is_subject_of = FRA }
						AUV = { is_subject_of = FRA }
						AMG = { is_subject_of = FRA }
						BOU = { is_subject_of = FRA }
						ORL = { is_subject_of = FRA }
						FOI = { is_subject_of = FRA }
						ALE = { is_subject_of = FRA }
						NEV = { is_subject_of = FRA }
						NRM = { is_subject_of = FRA }
					}
				}
				ile_de_france_area = {
					limit = {
						NOT = { is_core = root }
						NOT = { is_permanent_claim = root }
					}
					add_permanent_claim = root
				}
				champagne_area = {
					limit = {
						NOT = { is_core = root }
						NOT = { is_permanent_claim = root }
					}
					add_permanent_claim = root
				}
				orleans_area = {
					limit = {
						NOT = { is_core = root }
						NOT = { is_permanent_claim = root }
					}
					add_permanent_claim = root
				}
				FRA = {
					country_event = { id = new_flavour_bur.6 }
					every_subject_country = {
						limit = { capital_scope = { region = france_region } }
						add_liberty_desire = 50
					}
				}
			}
			else = {
				ile_de_france_area = {
					limit = {
						NOT = { is_core = root }
						NOT = { is_permanent_claim = root }
					}
					add_permanent_claim = root
				}
				champagne_area = {
					limit = {
						NOT = { is_core = root }
						NOT = { is_permanent_claim = root }
					}
					add_permanent_claim = root
				}
				orleans_area = {
					limit = {
						NOT = { is_core = root }
						NOT = { is_permanent_claim = root }
					}
					add_permanent_claim = root
				}
			}
		}
	}
	emp_bur_king_of_the_franks = {
		icon = king_of_the_franks
		position = 4
		required_missions = { emp_bur_league_of_public_weal }
		provinces_to_highlight = {
			OR = {
				AND = {
					region = france_region
					NOT = {
						ROOT = {
							num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
								value = 18
								region = france_region
							}
						}
					}
				}
				province_id = 183 #Paris
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			owns_core_province = 183 #Paris
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				value = 18
				region = france_region
			}
			total_own_and_non_tributary_subject_development = FRA
			army_size = FRA
			has_regency = no
		}
		effect = {
			add_country_modifier = {
				name = bur_king_of_franks
				duration = 7300
			}

			if = {
				limit = {
					exists = FRA
				}
				custom_tooltip = emp_bur_league_of_public_weal_effect_tooltip
				hidden_effect = {
					france_region = {
						limit = {
							owned_by = FRA
							NOT = { is_core = root }
							NOT = { is_permanent_claim = root }
						}
						add_permanent_claim = root
					}
				}	
			}

			if = {
				limit = {
					NOT = {
						FRA = {
							any_subject_country = {
								capital_scope = {
									region = france_region
								}
							}
						}
					}
				}
				custom_tooltip = emp_bur_king_of_the_franks_effect_tooltip
			}
			if = {
				limit = {
					FRA = {
						any_subject_country = {
							capital_scope = {
								region = france_region
							}
						}
					}
				}
				FRA = { country_event = { id = new_flavour_bur.7 } }
			}
			tooltip = {
				every_country = {
					limit = {
						is_subject_of = FRA
						capital_scope = {
							region = france_region
						}
					}
					hidden_effect = { FRA = { free_vassal = prev } }
					ROOT = { vassalize = prev }
				}
			}
		}
	}
	
	emp_bur_influence_the_princes = {
		icon = influence_the_princes
		position = 5
		required_missions = { emp_bur_join_the_empire }

		provinces_to_highlight = {
			OR = {
				AND = {
					NOT = { hre_size = 1 }
					is_capital = yes
					OR = {
						region = north_german_region
						region = south_german_region
					}
					owner = {
						NOT = { tag = root }
						NOT = { has_opinion = { who = ROOT value = 60 } }
					}
				}
				AND = {
					hre_size = 1
					is_capital = yes
					owner = {
						is_part_of_hre = yes
						NOT = { tag = root }
						NOT = { has_opinion = { who = ROOT value = 60 } }
					}
					OR = {
						NOT = {
							ROOT = {
								calc_true_if = {
									all_country = {
										is_part_of_hre = yes
										has_opinion = { who = ROOT value = 60 }
									}
									amount = 10
								}
							}
						}
						AND = {
							hre_size = 20
							NOT = {
								ROOT = {
									calc_true_if = {
										all_country = {
											is_part_of_hre = yes
											has_opinion = { who = ROOT value = 60 }
										}
										amount = 15
									}
								}
							}
						}
					}
				}
				AND = {
					owner = {
						is_elector = yes
						OR = {
							NOT = { preferred_emperor = ROOT }
							AND = {
								NOT = { tag = root }
								NOT = { has_opinion = { who = ROOT value = 100 } }
							}
						}
					}
					NOT = {
						ROOT = {
							calc_true_if = {
								all_elector = {
									preferred_emperor = ROOT
									has_opinion = { who = ROOT value = 100 }
								}
								amount = 5
							}
						}
					}
				}
			}
		}

		trigger = {
			if = {
				limit = {
					NOT = { hre_size = 1 }
				}
				calc_true_if = {
					desc = emp_bur_influence_the_princes_trigger_tooltip3
					all_country = {
						capital_scope = {
							OR = {
								region = north_german_region
								region = south_german_region
							}
						}
						has_opinion = { who = ROOT value = 60 }
					}
					amount = 5
				}
			}
			else = {
				if = {
					limit = { hre_size = 20 }
					calc_true_if = {
						desc = emp_bur_influence_the_princes_trigger_tooltip
						all_country = {
							is_part_of_hre = yes
							has_opinion = { who = ROOT value = 60 }
						}
						amount = 15
					}
				}
				else = {
					calc_true_if = {
						desc = emp_bur_influence_the_princes_trigger_tooltip2
						all_country = {
							is_part_of_hre = yes
							has_opinion = { who = ROOT value = 60 }
						}
						amount = 10
					}
				}
				calc_true_if = {
					desc = secure_the_imperial_crown.tooltip
					all_elector = {
						preferred_emperor = ROOT
						OR = {
							tag = root #in case this works
							has_opinion = { who = ROOT value = 100 }
						}
					}
					amount = 5
				}
			}
		}

		effect = {
			if = {
				limit = {
					government = monarchy
					NOT = { legitimacy = 90 }
				}
				add_legitimacy = 10
			}
			else = {
				add_prestige = 15
			}
			add_country_modifier = {
				name = bur_influence_over_princes
				duration = 7300
			}
		}
	}
	emp_bur_lead_the_empire = {
		icon = lead_the_empire
		required_missions = { emp_bur_influence_the_princes }
		provinces_to_highlight = {
			NOT = { hre_size = 1 }
			OR = {
				region = north_german_region
				region = south_german_region
			}
			NOT = { country_or_non_sovereign_subject_holds = root }
		}
		trigger = {
			if = {
				limit = { hre_size = 1 }
				is_emperor = yes
				imperial_influence = 25
			}
			else = {
				num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
					value = 25
					OR = {
						region = north_german_region
						region = south_german_region
					}
				}
				custom_trigger_tooltip = {
					tooltip = emp_bur_lead_the_empire_fallback_trigger
					NOT = {
						any_country = {
							capital_scope = {
								OR = {
									region = north_german_region
									region = south_german_region
								}
							}
							num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
								value = 10
							}
						}
					}
				}
			}
		}
		effect = {
			add_prestige = 20
			if = {
				limit = { hre_size = 1 }
				add_imperial_influence = 25
			}
			else = { add_dip_power = 100 }
		}
	}
}

emp_lotharingia_4 = {
	slot = 4
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Emperor"
	}
	potential = {
		tag = LOT
		NOT = { map_setup = map_setup_random }
		has_dlc = "Emperor"
	}
	has_country_shield = yes
	
	emp_bur_kingdom_of_bavaria = {
		icon = duchy_of_bavaria
		position = 7
		required_missions = { emp_bur_east_francia }

		provinces_to_highlight = {
			OR = {
				area = lower_swabia_area
				area = upper_swabia_area
				area = franconia_area
				area = upper_franconia_area
				area = upper_bavaria_area
				area = lower_bavaria_area
				area = east_bavaria_area
				area = tirol_area
				area = austria_proper_area
				area = inner_austria_area
				area = carinthia_area
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
			NOT = {
				ROOT = {
					num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
						value = 30 #out of 45
						OR = {
							area = lower_swabia_area
							area = upper_swabia_area
							area = franconia_area
							area = upper_franconia_area
							area = upper_bavaria_area
							area = lower_bavaria_area
							area = east_bavaria_area
							area = tirol_area
							area = austria_proper_area
							area = inner_austria_area
							area = carinthia_area
						}
					}
				}
			}
		}

		trigger = {
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				value = 30 #out of 45
				OR = {
					area = lower_swabia_area
					area = upper_swabia_area
					area = franconia_area
					area = upper_franconia_area
					area = upper_bavaria_area
					area = lower_bavaria_area
					area = east_bavaria_area
					area = tirol_area
					area = austria_proper_area
					area = inner_austria_area
					area = carinthia_area
				}
			}
		}
		effect = {
			add_country_modifier = {
				name = bur_german_empire
				duration = -1
			}
		}
	}
}

emp_burgundy_5 = {
	slot = 5
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Emperor"
	}
	potential = {
		OR = {
			tag = BUR
			tag = LOT
		}
		started_in = 1384.1.30		#added in mod MMETR, start of the County of Burgundy after death of Louis II
		NOT = { map_setup = map_setup_random }
		has_dlc = "Emperor"
	}
	has_country_shield = yes
	
	emp_bur_papal_relations = {
		icon = holy_state
		required_missions = {  }
		provinces_to_highlight = {
			owned_by = PAP
		}
		trigger = {
			OR = {
				AND = {
					religion = catholic
					papal_influence = 50
					PAP = {
						has_opinion = {
							who = root
							value = 100
						}
					}
				}
				AND = {
					NOT = { religion = catholic }
					OR = {
						NOT = { exists = PAP }
						PAP = {
							custom_trigger_tooltip = {
								tooltip = rivalled_or_rival_of
								OR = {
									is_rival = root
									root = { is_rival = prev }
								}
							}
							custom_trigger_tooltip = {
								tooltip = has_been_insulted_by_root
								OR = {
									has_opinion_modifier = {
										who = ROOT
										modifier = insulted
									}
									has_opinion_modifier = {
										who = ROOT
										modifier = scornfully_insulted
									}
								}
							}
						}
					}
				}
			}
		}
		effect = {
			if = {
				limit = { religion = catholic }
				add_country_modifier = {
					name = bur_special_place_in_popes_heart
					duration = 7300
				}
			}
			else = {
				add_country_modifier = {
					name = bur_pope_is_hated
					duration = 7300
				}
			}
		}
	}
	emp_bur_feast_of_pheasants = {
		icon = feast_of_pheasants
		required_missions = { emp_bur_papal_relations }
		provinces_to_highlight = {
			is_capital = yes
			NOT = { owned_by = root }
			owner = {
				OR = {
					is_rival = TUR
					TUR = { is_rival = prev }
				}
			}
		}
		trigger = {
			OR = {
				calc_true_if = {
					desc = emp_bur_feast_of_pheasants_trigger_tooltip
					all_ally = {
						OR = {
							is_rival = TUR
							TUR = { is_rival = prev }
						}
					}
					amount = 2
				}
				any_ally = {
					if = {
						limit = { has_dlc = "Common Sense" }
						is_great_power = yes
					}
					else = { total_development = 300 }
					is_rival = TUR
				}
				NOT = { exists = TUR }
				TUR = { religion = ROOT }
			}
			has_regency = no
		}
		effect = {
			if = {
				limit = {
					exists = TUR
					NOT = { TUR = { religion = ROOT } }
				}
				custom_tooltip = emp_bur_feast_of_pheasants_effect_tooltip
				hidden_effect = {
					country_event = { id = new_flavour_bur.2 }
					every_country = {
						limit = {
							religion = root
							capital_scope = { continent = europe }
							NOT = { tag = BUR }
							has_opinion = {
								who = root
								value = 0
							}
							NOT = {
								has_opinion = {
									who = TUR
									value = 50
								}
							}
						}
						country_event = { id = new_flavour_bur.1 }
					}
					TUR = {
						country_event = { id = new_flavour_bur.3 }
					}
				}
			}
			else = {
				add_dip_power = 100
				add_mil_power = 100
			}
		}
	}

	emp_bur_secure_succession = {
		icon = secure_the_succession
		required_missions = {  }
		trigger = {
			custom_trigger_tooltip = {
				tooltip = burgundy_has_secured_succession_tt
				OR = {
					has_country_flag = bur_crisis_has_happened
					is_year = 1500
				}
			}
			is_subject = no
			is_at_war = no
			NOT = { active_imperial_incident = any }
		}
		effect = {
			if = {
				limit = {
					is_emperor = no
					is_part_of_hre = no
					tag = BUR
					is_subject = no
					is_at_war = no
					hre_size = 1
					is_subject = no
					has_female_heir = no
					NOT = {
						has_country_flag = burgundian_succession_start
					}
					OR = {
						had_country_flag = {
							flag = bur_crisis_has_happened
							days = 1825
						}
						had_country_flag = {
							flag = charles_died
							days = 1825
						}
						AND = {
							NOT = {
								has_ruler = "Philippe III"
							}
							has_heir = yes
						}
					}
				}
				country_event = {
					id = incidents_bur_join_empire.1
				}
			}
			else_if = {
				limit = {
					is_part_of_hre = no
					hre_size = 1
				}
				set_in_empire = yes	
				every_owned_province = {
					limit = {
						continent = europe
					}
					set_in_empire = yes	
				}
			}
			add_country_modifier = {
				name = bur_seed_is_strong
				duration = -1
			}
			add_country_modifier = {
				name = bur_we_shall_not_be_annexed
				duration = 7300
			}
			if = {
				limit = {
					has_ruler_flag = mary_is_heir
				}
				country_event = { id = incidents_bur_inheritance.6 }
			}
		}
	}
	emp_bur_join_the_empire = {
		icon = join_the_empire
		required_missions = { emp_bur_secure_succession }
		trigger = {
			is_subject = no
			OR = {
				is_part_of_hre = yes
				is_emperor = yes
				NOT = { hre_size = 1 }
				custom_trigger_tooltip = {
					tooltip = burgundy_has_resolved_imperial_issue_tt
					has_country_flag = burgundy_refused_empire
				}
			}
		}
		effect = {
			if = {
				limit = {
					OR = {
						is_emperor = yes
						emperor = { exists = no }
					}
				}
				add_power_projection = {
					type = mission_rewards_power_projection
					amount = 25
				}
			}
			alsace_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			lower_rhineland_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			north_rhine_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
		}
	}
	emp_bur_crown_of_lothair = {
		icon = the_crown_of_lothair
		required_missions = { emp_bur_join_the_empire }

		provinces_to_highlight = {
			OR = {
				AND = {
					OR = {
						area = alsace_area
						area = lower_rhineland_area
						area = north_rhine_area
						area = lorraine_area
						area = wallonia_area
						area = brabant_area
						area = north_brabant_area
						area = holland_area
						area = frisia_area
					}
					NOT = {
						ROOT = {
							num_of_owned_provinces_with = {
								value = 25 #out of 34
								is_core = root
								OR = {
									area = alsace_area
									area = lower_rhineland_area
									area = north_rhine_area
									area = lorraine_area
									area = wallonia_area
									area = brabant_area
									area = north_brabant_area
									area = holland_area
									area = frisia_area
								}
							}
						}
					}
				}
				province_id = 1878
				province_id = 189
			}
			OR = {
				NOT = { owned_by = ROOT }
				NOT = { is_core = ROOT }
			}
		}

		trigger = {
			is_at_war = no
			owns_core_province = 1878
			owns_core_province = 189
			num_of_owned_provinces_with = {
				value = 25 #out of 34
				is_core = root
				OR = {
					area = alsace_area
					area = lower_rhineland_area
					area = north_rhine_area
					area = lorraine_area
					area = wallonia_area
					area = brabant_area
					area = north_brabant_area
					area = holland_area
					area = frisia_area
				}
			}

			#just in case (but hidden for a normal run)
			if = {
				limit = {
					NOT = { tag = LOT }
					OR = {
						exists = LOT
						is_free_or_tributary_trigger = no
						is_nomad = yes
						normal_or_historical_nations = no
						was_never_end_game_tag_trigger = no
						AND = {
							ai = yes
							is_playing_custom_nation = yes
						}
						is_colonial_nation = yes
						AND = {
							is_former_colonial_nation = yes
							ai = yes
						}
					}
				}
				NOT = { exists = LOT }
				is_free_or_tributary_trigger = yes
				is_nomad = no
				normal_or_historical_nations = yes
				was_never_end_game_tag_trigger = yes
				OR = {
					ai = no
					is_playing_custom_nation = no
				}
				is_colonial_nation = no
				OR = {
					is_former_colonial_nation = no
					AND = {
						is_former_colonial_nation = yes
						ai = no
					}
				}
			}
		}

		effect = {
			country_event = { id = new_flavour_bur.4 }

			upper_rhineland_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			palatinate_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			hesse_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			westphalia_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			north_westphalia_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			weser_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			lower_saxony_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			braunschweig_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
		}
	}
}

emp_lotharingia_5 = {
	slot = 5
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Emperor"
	}
	potential = {
		tag = LOT
		NOT = { map_setup = map_setup_random }
		has_dlc = "Emperor"
	}
	has_country_shield = yes
	
	emp_bur_east_francia = {
		icon = conquer_east_francia
		position = 6
		required_missions = { emp_bur_crown_of_lothair }

		provinces_to_highlight = {
			OR = {
				area = alsace_area
				area = upper_rhineland_area
				area = palatinate_area
				area = hesse_area
				area = lower_rhineland_area
				area = north_rhine_area
				area = westphalia_area
				area = north_westphalia_area
				area = weser_area
				area = lower_saxony_area
				area = braunschweig_area
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
			NOT = {
				ROOT = {
					num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
						value = 30 #out of 42
						OR = {
							area = alsace_area
							area = upper_rhineland_area
							area = palatinate_area
							area = hesse_area
							area = lower_rhineland_area
							area = north_rhine_area
							area = westphalia_area
							area = north_westphalia_area
							area = weser_area
							area = lower_saxony_area
							area = braunschweig_area
						}
					}
				}
			}
		}

		trigger = {
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				value = 30 #out of 42
				OR = {
					area = alsace_area
					area = upper_rhineland_area
					area = palatinate_area
					area = hesse_area
					area = lower_rhineland_area
					area = north_rhine_area
					area = westphalia_area
					area = north_westphalia_area
					area = weser_area
					area = lower_saxony_area
					area = braunschweig_area
				}
			}
		}
		effect = {
			lower_swabia_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			upper_swabia_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			franconia_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			upper_franconia_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			upper_bavaria_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			lower_bavaria_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			east_bavaria_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			tirol_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			austria_proper_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			inner_austria_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
			carinthia_area = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
		}
	}
	emp_bur_carolingian_empire = {
		icon = carolingian_empire
		required_missions = { emp_bur_east_francia }
		trigger = {
			num_of_cities = 200
		}
		effect = {
			if = {
				limit = {
					NOT = { government_rank = 3 }
				}
				custom_tooltip = emp_bur_carolingian_empire_effect_tooltip
				hidden_effect = {
					set_government_rank = 3
				}
			}
			add_country_modifier = {
				name = bur_carolingia
				duration = -1
			}
		}
	}
}