#Written by Dub
#Every single one of these missions that deals with multiple provinces uses province groups for designating provinces, because I keep repeating the same code every time. As such it's simpler to refer to them there instead.
#If you want to check the province IDs, check provincegroup.txt in the map folder.

#Once again, this mission tree has been rewritten for the 3rd time, marking the 4th iteration of the Byzantine mission tree.
#This time, we're looking at a total of 123 missions spanning 38 rows in the entire tree. This is likely the largest mission tree in the entirety of EU4.
#Every mission should now also have an icon not used anywhere else in the tree.
#Out of all of these, we are looking at a total of:
#49 new missions, all flavour missions.
#20 old flavour missions.
#For a grand total of 69 (Nice) flavour missions.
#That leaves a total of 54 missions dealing with conquests.
#I hope that this 4th and probably final iteration, barring any small changes that may occur in the future, will be fun to play with.

byz_economic_1 = {
	slot = 1
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes
	
	byz_revive_hyperpyron = { #New in BR 8.0
		icon = dominant_economy
		position = 1 #1-1
		required_missions = { }
		
		provinces_to_highlight = {
			trade_goods = gold
			has_discovered = ROOT
		}
		
		trigger = {
			trade_goods_produced_amount = {
				trade_goods = gold
				amount = 1 #This corresponds to 10 production dev in gold provinces. Byzantium has 2 potential gold provinces to collect from, so this should be fairly easy.
			}
		}
		
		effect = {
			add_years_of_income = 1
			remove_country_modifier = byz_bad_economy
			add_country_modifier = {
				name = "byz_restored_hyperpyron"
				duration = 9125
			}
		}
		
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
	
	byz_refill_imperial_treasury = { #Refill Imperial Treasury
		icon = mission_war_chest
		position = 2 #1-2
		required_missions = { byz_revive_hyperpyron }
		
		provinces_to_highlight = {
			#None
		}
		
		trigger = {
			treasury = 250
			share_of_starting_income = 3 #Byzantium starts with 6.24 starting income. This should in theory require about 20 ducats/month.
			NOT = { num_of_loans = 1 }
			NOT = { inflation = 0.1 }
		}
		
		effect = {
			define_advisor = {
				type = treasurer
				skill = 3
				discount = yes
			}
			define_advisor = {
				type = master_of_mint
				skill = 3
				discount = yes
			}
		}
		
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}

	byz_restore_crown_authority = { #New in BR 8.0
		icon = mission_crown_authority
		position = 3 #1-3
		required_missions = { byz_refill_imperial_treasury byz_state_trade_hegemon }
		
		provinces_to_highlight = {
		}
		
		trigger = {
			crown_land_share = 50
			calc_true_if = {
				if = {
					limit = {
						has_estate = estate_nobles
					}
					estate_loyalty = {
						estate = estate_nobles
						loyalty = 60
					}
				}
				if = {
					limit = {
						has_estate = estate_church
					}
					estate_loyalty = {
						estate = estate_church
						loyalty = 60
					}
				}
				if = {
					limit = {
						has_estate = estate_burghers
					}
					estate_loyalty = {
						estate = estate_burghers
						loyalty = 60
					}
				}
				if = {
					limit = {
						has_estate = estate_generals
					}
					estate_loyalty = {
						estate = estate_generals
						loyalty = 60
					}
				}
				if = {
					limit = {
						has_estate = estate_exarches
					}
					estate_loyalty = {
						estate = estate_exarches
						loyalty = 60
					}
				}
				if = {
					limit = {
						has_estate = estate_cossacks
					}
					estate_loyalty = {
						estate = estate_cossacks
						loyalty = 60
					}
				}
				amount = 2
			}
			#NOT = { average_home_autonomy = 10 } #Cut as part of BT's autonomy overhaul
		}
		
		effect = {
			add_country_modifier = {
				name = "byz_crown_authority_restored"
				duration = -1
			}
		}
		
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
}

byz_economic_2 = {
	slot = 2
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes
	
	byz_state_trade_hegemon = { #New in BR 8.0
		icon = mission_dominate_home_trade_node
		position = 2 #2-2
		required_missions = { byz_revive_hyperpyron }
		
		provinces_to_highlight = {
			OR = {
				province_group = byz_no_latins_in_greece_provinces
				province_group = byz_retake_greek_islands_provinces
				province_group = byz_reconquer_west_anatolia_provinces
				province_group = byz_reconquer_ottoman_greece_provinces
				province_group = byz_deny_ottoman_access_provinces
			}
			owner = {
				has_government_attribute = is_merchant_republic
			}
		}
		
		trigger = {
			1320 = { #Constantinople
				is_strongest_trade_power = ROOT
			}
			5493 = { #Aegean Sea
				is_strongest_trade_power = ROOT
			}
			151 = { #No Galata prov trigmod
				NOT = { has_province_modifier = BYZ_galata }
			}
			custom_trigger_tooltip = {
				tooltip = byz_restore_trade_hegemon_tooltip
				byz_no_latins_in_greece_provinces = {
					type = all
					owner = {
						NOT = { has_government_attribute = is_merchant_republic }
					}
				}
				byz_retake_greek_islands_provinces = {
					type = all
					owner = {
						NOT = { has_government_attribute = is_merchant_republic }
					}
				}
				byz_reconquer_west_anatolia_provinces = {
					type = all
					owner = {
						NOT = { has_government_attribute = is_merchant_republic }
					}
				}
				byz_reconquer_ottoman_greece_provinces = {
					type = all
					owner = {
						NOT = { has_government_attribute = is_merchant_republic }
					}
				}
				byz_deny_ottoman_access_provinces = {
					type = all
					owner = {
						NOT = { has_government_attribute = is_merchant_republic }
					}
				}
			}
		}
		
		effect = {
			add_mercantilism = 5
			remove_country_modifier = byz_bad_trade
			add_country_modifier = {
				name = "byz_restored_trade_hegemon"
				duration = 9125
			}
			151 = {
				add_base_tax = 1
				add_base_production = 1
			}
		}
		
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}

}

byz_religious_1 = {
	slot = 1
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes

	byz_question_of_schismatics = { #A Question of Schismatics
		icon = mission_pf_cross
		position = 4 #1-4
		required_missions = { byz_reconquer_ottoman_greece }
		
		provinces_to_highlight = {
		}
		
		trigger = {
			OR = {
				custom_trigger_tooltip = {
					tooltip = byz_question_of_schismatics_had_union_of_churches
					AND = {
						NOT = { has_disaster = union_of_churches }
						has_country_flag = had_byz_church_crisis
					}
				}
				custom_trigger_tooltip = {
					tooltip = byz_question_of_schismatics_avoided_union_of_churches
					NOT = { current_age = age_of_discovery }
				}
			}
		}
		
		effect = {
			if = { #If Union of Two Churches hasn't fired
				limit = {
					NOT = { has_country_flag = had_byz_church_crisis }
				}
				increase_religious_currency_effect = yes
				if = {
					limit = {
						ruler_religion = catholic
						religion = orthodox
					}
					set_ruler_religion = orthodox
				}
				if = {
					limit = {
						heir_religion = catholic
						religion = orthodox
					}
					set_heir_religion = orthodox
				}
				if = {
					limit = {
						has_country_modifier = byz_bad_religion
					}
					remove_country_modifier = byz_bad_religion
				}
			}
			if = {
				limit = {
					religion = orthodox
				}
				add_estate_loyalty = {
					estate = estate_church
					loyalty = 10
				}
				add_estate_loyalty_modifier = {
					estate = estate_church
					desc = EST_REMAINED_ORTHODOX
					loyalty = 10
					duration = -1
				}
				if = {
					limit = {
						reform_level = 3 #Next level is state & religion
					}
					add_government_reform = ecumenical_patriarch_of_constantinople_reform
					if = { #Hasn't picked T4 gov reform yet
						limit = {
							NOT = { reform_level = 4 }
						}
						change_government_reform_progress = -180 #Empty pool
					}
				}
				every_country = {
					limit = {
						religion = orthodox
					}
					add_opinion = {
						who = ROOT
						modifier = byz_brothers_in_faith
					}
				}
			}
			else_if = {
				limit = {
					religion = catholic
				}
				add_papal_influence = 5
				every_country = {
					limit = {
						religion = catholic
					}
					add_opinion = {
						who = ROOT
						modifier = catholic_convert
					}
				}
			}
			else = { #Dump reward. Pending other addition if Pagan Wrath wants to do something fun with this or whatever. I don't know. This mission branch would probably be removed at that point.
				add_prestige = 10
			}
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
	
	convert_asia_minor = { #Directly taken from vanilla Byzantine Missions
		icon = mission_hands_praying
		required_missions = { byz_question_of_schismatics byz_reconquer_west_anatolia }
		position = 7 #1-7
		
		provinces_to_highlight = {
			province_group = byz_reconquer_west_anatolia_provinces
			OR = {
				NOT = { religion = ROOT }
				NOT = { owned_by = ROOT }
			}
		}
		
		trigger = {
			has_fulfiled_province_requirement_for_mission_trigger = {
				tooltip=country_holds_or_non_sovereign_subject_holds_highlighted 
				provinces=byz_reconquer_west_anatolia_provinces
				owner_type=country_or_non_sovereign_subject_holds
			}
			has_fulfiled_province_requirement_for_mission_trigger = {
				tooltip=highlighted_provinces_converted_to_religion 
				provinces=byz_reconquer_west_anatolia_provinces
				owner_type=religion
			}
		}
		
		effect = {
			if = {
				limit = {
					religion = orthodox
				}
				add_country_modifier = {
					name = "growth_of_the_orthodox_church"
					duration = 7300
				}
				add_estate_loyalty = {
					estate = estate_church
					loyalty = 10
				}
			}
			increase_religious_currency_effect = yes
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
	
	convert_anatolia = { #Convert Anatolia
		icon = mission_religious
		required_missions = { convert_asia_minor byz_reclaim_anatolia }
		position = 11 #1-11
		provinces_to_highlight = {
			province_group = byz_reclaim_anatolia_provinces
			OR = {
				NOT = { religion = ROOT }
				NOT = { owned_by = ROOT }
			}
		}
		
		trigger = {
			has_fulfiled_province_requirement_for_mission_trigger = {
				tooltip=country_holds_or_non_sovereign_subject_holds_highlighted 
				provinces=byz_reclaim_anatolia_provinces
				owner_type=country_or_non_sovereign_subject_holds
			}
			has_fulfiled_province_requirement_for_mission_trigger = {
				tooltip=highlighted_provinces_converted_to_religion 
				provinces=byz_reclaim_anatolia_provinces
				owner_type=religion
			}
		}
		
		effect = {
			if = {
				limit = {
					religion = orthodox
				}
				add_country_modifier = {
					name = "growth_of_the_orthodox_church"
					duration = 7300
				}
				add_estate_loyalty = {
					estate = estate_church
					loyalty = 10
				}
			}
			increase_religious_currency_effect = yes
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
}

byz_reconquest_2 = {
	slot = 2
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes
	
	byz_reconquer_ottoman_greece = { #Ottomans out of Greece
		icon = mission_unite_home_region
		position = 3 #2-3
		required_missions = { byz_deny_ottoman_access }
		
		provinces_to_highlight = {
			province_group = byz_reconquer_ottoman_greece_provinces
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			OR = {
				has_fulfiled_province_requirement_for_mission_trigger = {
					tooltip=country_holds_or_non_sovereign_subject_holds_highlighted 
					provinces=byz_reconquer_ottoman_greece_provinces
					owner_type=country_or_non_sovereign_subject_holds
				}
				custom_trigger_tooltip = {
					tooltip = byz_turn_the_tide_tooltip
					NOT = {
						OR = {
							byz_deny_ottoman_access_provinces = {
								owned_by = TUR
							}
							byz_reconquer_ottoman_greece_provinces = {
								owned_by = TUR
							}
						}
					}
				}
			}
		}
		
		effect = {
			add_country_modifier = {
				name = "byzantium_resurgent"
				duration = 9125
			}
			add_accepted_culture_or_dip_power_stated = { culture = aromanian_culture dip_reward = yes }
			
			#Claims
			give_permaclaims_for_mission = { mission=byz_reconquer_west_anatolia }
			give_permaclaims_for_mission = { mission=byz_safeguard_balkan_border }
		}
		
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}

	byz_reconquer_west_anatolia = { #Recover West Anatolia
		icon = mission_theodosian_walls
		position = 6 #2-6
		required_missions = { byz_reconquer_ottoman_greece }
		
		provinces_to_highlight = {
			province_group = byz_reconquer_west_anatolia_provinces
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			has_fulfiled_province_requirement_for_mission_trigger = {
				tooltip=country_holds_or_non_sovereign_subject_holds_highlighted 
				provinces=byz_reconquer_west_anatolia_provinces
				owner_type=country_or_non_sovereign_subject_holds
			}
		}
		
		effect = {			
			#Dev bonuses
			316 = { #Nicomedia
				add_base_tax = 3
				add_base_manpower = 3
				if = {
					limit = {
						has_global_flag = byz_byzantine_silk_restored
					}
					change_trade_goods = silk
				}
			}
			5157 = { #Nicaea
				add_base_tax = 3
				add_base_production = 3
				if = {
					limit = {
						has_global_flag = byz_favored_glassmakers
					}
					add_base_production = 2
					add_or_spawn_center_of_trade = { level = 2 }
				}
			}
			random_owned_province = { #RandProv 1
				limit = {
					province_group = byz_reconquer_west_anatolia_provinces
					NOT = { #To prevent picking Nicaea/Nicomedia
						province_id = 316
						province_id = 5157
					}
				}
				add_base_tax = 1
				add_base_manpower = 1
				set_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
			}
			random_owned_province = { #RandProv 2
				limit = {
					province_group = byz_reconquer_west_anatolia_provinces
					NOT = { #To prevent picking Nicaea/Nicomedia
						province_id = 316
						province_id = 5157
						has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
					}
				}
				add_base_tax = 1
				add_base_manpower = 1
			}
			hidden_effect = { #Clearing the flag above.
				every_owned_province = {
					limit = {
						has_province_flag = byz_prov_to_dev
					}
					clr_province_flag = byz_prov_to_dev 
				}
			}
			
			#Misc
			create_general = { tradition = 80 }
			
			#Claims
			give_permaclaims_for_mission = { mission=byz_reclaim_anatolia }
			#CB
			if = { #Trebizond
				limit = {
					does_tag_exist_and_have_less_than_provided_dev_trigger = {
						tag=TRE
						dev=200
					}
				}
				add_casus_belli = {
					type = cb_vassalize_mission
					months = 300 #25 years. I'm not sure if you can actually make it infinite.
					target = TRE
				}
			}
			if = { #Epirus
				limit = {
					does_tag_exist_and_have_less_than_provided_dev_trigger = {
						tag=EPI
						dev=200
					}
				}
				add_casus_belli = {
					type = cb_vassalize_mission
					months = 300 #25 years. I'm not sure if you can actually make it infinite.
					target = EPI
				}
			}
			if = { #Cappadocia
				limit = {
					does_tag_exist_and_have_less_than_provided_dev_trigger = {
						tag=CAP
						dev=200
					}
				}
				add_casus_belli = {
					type = cb_vassalize_mission
					months = 300 #25 years. I'm not sure if you can actually make it infinite.
					target = CAP
				}
			}
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}

	byz_reclaim_anatolia = { #Anatolian Reclamation
		icon = mission_empire
		position = 10 #2-10
		required_missions = { byz_reconquer_west_anatolia }
		
		provinces_to_highlight = {
			province_group = byz_reclaim_anatolia_provinces
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			has_fulfiled_province_requirement_for_mission_trigger = {
				tooltip=country_holds_or_non_sovereign_subject_holds_highlighted 
				provinces=byz_reclaim_anatolia_provinces
				owner_type=country_or_non_sovereign_subject_holds
			}
			
			custom_trigger_tooltip = {
				tooltip = byz_reclaim_anatolia_tt
				TRE = {
					OR = {
						exists = no
						AND = {
							NOT = { religion = catholic }
							is_subject_of = ROOT
						}
					}
				}
				EPI = {
					OR = {
						exists = no
						AND = {
							NOT = { religion = catholic }
							is_subject_of = ROOT
						}
					}
				}
				CAP = {
					OR = {
						exists = no
						AND = {
							NOT = { religion = catholic }
							is_subject_of = ROOT
						}
					}
				}
				FEO = {
					OR = {
						exists = no
						AND = {
							NOT = { religion = catholic }
							is_subject_of = ROOT
						}
					}
				}
			}
		}
		
		effect = {
			anatolia_region = {
				add_nationalism = -10 #To allow for faster culture conversions (It always takes me ages to get the Cappadocians in central Anatolia over to the west). Why not, huh?
			}
			#Dev bonuses
			326 = { #Ancyra
				add_base_tax = 3
				add_base_manpower = 3
			}
			151 = { #Constantinople
				add_base_tax = 3
				add_base_production = 3
			}
			
			custom_tooltip = reclaim_anatolia_tooltip
			hidden_effect = {
				byz_reconquer_west_anatolia_provinces = {
					add_province_modifier = {
						name = "byz_resettlement_act"
						duration = 18250
					}
				}
			}
			#Claims
			give_permaclaims_for_mission = { mission=byz_reconquer_lesser_armenia }
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}

	byz_turkic_question = { #The Turkic Question
		icon = mission_non-western_cavalry_raid
		position = 11 #2-11
		required_missions = { byz_reclaim_anatolia }
		
		provinces_to_highlight = {
			if = {
				limit = {
					NOT = { accepted_culture = turkish }
				}
				region = anatolia_region
			}
			culture = turkish
		}
		
		trigger = {
			OR = {
				AND = {
					custom_trigger_tooltip = {
						tooltip = byz_owns_all_turkish_provinces_tooltip
						NOT = {
							any_province = {
								culture = turkish
								NOT = { owned_by = ROOT }
							}
						}
					}
					accepted_culture = turkish
				}
				NOT = {
					any_province = {
						region = anatolia_region
						culture = turkish
					}
				}
			}
		}
		
		effect = {
			if = {
				limit = {
					NOT = {
						any_province = {
							culture = turkish
							NOT = { owned_by = ROOT }
						}
					}
					accepted_culture = turkish
				}
				add_country_modifier = {
					name = "byz_turkic_cavalry"
					duration = 9125
				}
				custom_tooltip = br_turkic_cavalry_enabler_tt
				set_country_flag = br_turkic_cavalry_enabled
			}
			else_if = {
				limit = {
					any_province = {
						region = anatolia_region
						culture = turkish
					}
				}
				#Tooltip part.
				custom_tooltip = turkic_question_tooltip_1
				tooltip = {
					add_country_modifier = {
						name = "byz_turkic_cavalry"
						duration = 9125
					}
					custom_tooltip = br_turkic_cavalry_enabler_tt
				}
				custom_tooltip = turkic_question_tooltip_2
				add_country_modifier = {
					name = "byz_rid_of_turkish_influence"
					duration = 9125
				}
			}
			else = {
				add_country_modifier = {
					name = "byz_rid_of_turkish_influence"
					duration = 9125
				}
			}
			#Claims
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
	
	byz_anatolian_restoration = { #Anatolian Restoration
		icon = mission_monarch_in_throne_room
		position = 12 #2-12
		required_missions = { byz_turkic_question convert_anatolia }
		
		provinces_to_highlight = {
			region = anatolia_region
		}
		
		trigger = {
			development_in_provinces = { #Anatolia starts with 524 dev (Used to be 702 dev in BT 15, 665 in BT 13 and 593 dev in BT 12 with Bugfixes). You also get a lot of dev in a lot of the missions as well, and you are expected to dev west Anatolia quite a bit with its rewards. With dev points and the autonomy overhaul, this is not at all ridiculous.
				value = 900
				region = anatolia_region
			}
		}
		
		effect = {
			if = {
				limit = { has_dlc = "Mandate of Heaven"	}
				add_splendor = 200
			}
			anatolia_region = {
				add_province_modifier = {
					name = "byz_anatolian_restoration"
					duration = -1
				}
			}
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
}

byz_reconquest_1 = {
	slot = 3
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes
	
	byz_turn_the_tide = { #Turn the Tide
		icon = mission_byz_constantinople
		position = 1 #3-1
		required_missions = {  } #None, first mission
		
		provinces_to_highlight = {
			#None
		}
		
		trigger = {
			OR = {
				war_with = TUR
				custom_trigger_tooltip = {
					tooltip = byz_turn_the_tide_tooltip
					NOT = {
						OR = {
							byz_deny_ottoman_access_provinces = {
								owned_by = TUR
							}
							byz_reconquer_ottoman_greece_provinces = {
								owned_by = TUR
							}
						}
					}
				}
			}
		}
		
		effect = {
			add_country_modifier = {
				name = "byz_last_stand"
				duration = 3650
			}
			
			#Claims
			give_cores_for_mission = { mission=byz_deny_ottoman_access }
		}
		
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
	
	byz_deny_ottoman_access = { #Deny Ottomans Access
		icon = mission_pf_map_table
		position = 2 #1-2
		required_missions = { byz_turn_the_tide }
		
		provinces_to_highlight = {
			province_group = byz_deny_ottoman_access_provinces
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			OR = {
				has_fulfiled_province_requirement_for_mission_trigger = {
					tooltip=country_holds_or_non_sovereign_subject_holds_highlighted 
					provinces=byz_deny_ottoman_access_provinces
					owner_type=country_or_non_sovereign_subject_holds
				}
				custom_trigger_tooltip = {
					tooltip = byz_turn_the_tide_tooltip
					NOT = {
						OR = {
							byz_deny_ottoman_access_provinces = {
								owned_by = TUR
							}
							byz_reconquer_ottoman_greece_provinces = {
								owned_by = TUR
							}
						}
					}
				}
			}
		}
		
		effect = {
			4779 = { #Gallipoli
				change_religion = ROOT
				on_province_religion_converted_estate_privileges_effect = yes
				change_culture = ROOT
				add_base_tax = 2
				add_base_production = 2
				add_base_manpower = 1
				add_province_modifier = {
					name = "byz_resettle_gallipoli"
					duration = 9125
				}
			}
			
			#Claims
			give_cores_for_mission = { mission=byz_reconquer_ottoman_greece }
			give_cores_for_mission = { mission=byz_no_latins_in_greece }
			
			#Misc
			custom_tooltip = byz_reconquer_ottoman_greece_nationalism
			hidden_effect = {
				balkan_region = {
					limit = {
						owned_by = TUR
					}
					add_nationalism = 30 #This used to be 30, but apparently vanilla had a hardcap of +10 nationalism added through effect in a defines entry. This is changed to +30 in 1.35, which would in theory make the lands act as if they were newly conquered. That is a bit harsh, so I'm pushing it down to +20.
				}
			}
		}
		
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}

	byz_safeguard_balkan_border = { #Safeguard Constantinople (& Thessalonica!)
		icon = mission_assemble_an_army
		position = 4 #3-4
		required_missions = { byz_reconquer_ottoman_greece }
		
		provinces_to_highlight = {
			province_group = byz_safeguard_balkan_border_provinces
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			has_fulfiled_province_requirement_for_mission_trigger = {
				tooltip=country_holds_or_non_sovereign_subject_holds_highlighted 
				provinces=byz_safeguard_balkan_border_provinces
				owner_type=country_or_non_sovereign_subject_holds
			}
		}
		
		effect = {			
			#Effects:
			if = {
				limit = { has_dlc = "Mandate of Heaven" }
				thrace_area = {
					add_prosperity = 50
				}
				macedonia_area = {
					add_prosperity = 50
				}
				eastern_macedonia_area = {
					add_prosperity = 50
				}
			}
			else = { #Fallback
				add_adm_power = 25
				add_dip_power = 25
				add_mil_power = 25
			}
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
}

byz_reconquest_3 = {
	slot = 4
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes
	
	byz_no_latins_in_greece = { #No Latins in Greece
		icon = mission_mediterranean_castle
		position = 3 #4-3
		required_missions = { byz_deny_ottoman_access }
		
		provinces_to_highlight = {
			province_group = byz_no_latins_in_greece_provinces
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			custom_trigger_tooltip = {
				tooltip = byz_no_latins_in_greece_tt
				ATH = {
					OR = {
						exists = no
						AND = {
							NOT = { religion = catholic }
							is_subject_of = ROOT
						}
					}
				}
				EPI = {
					OR = {
						exists = no
						AND = {
							NOT = { religion = catholic }
							is_subject_of = ROOT
						}
					}
				}
				LES = {
					OR = {
						exists = no
						AND = {
							NOT = { religion = catholic }
							is_subject_of = ROOT
						}
					}
				}
			}
			has_fulfiled_province_requirement_for_mission_trigger = {
				tooltip=country_holds_or_non_sovereign_subject_holds_highlighted 
				provinces=byz_no_latins_in_greece_provinces
				owner_type=country_or_non_sovereign_subject_holds
			}
		}
		
		effect = {
			add_country_modifier = {
				name = "byz_latin_expulsion"
				duration = 9125
			}
			add_accepted_culture_or_dip_power_stated = { culture = arvanite dip_reward = yes }
			if = { #If Genoa controls Chios & has capital in Italy still (Genoa)
				limit = {
					exists = GEN
					GEN = { 
						capital_scope = {
							region = italy_region
						}
						OR = {
							owns = 2348 #Chios
							owns = 6005 #Phocaea
							owns = 6096 #Samos
						}
					}
				}
				country_event = { id = resurgent_BYZ.14 }
			}
			else = {
				add_permanent_claim = 2348
				add_permanent_claim = 6005
				add_permanent_claim = 6096
			}
		
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
}

byz_diplomacy = {
	slot = 5
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes
	
	byz_gather_alliances = { #Gather Alliances
		icon = mission_alliances
		position = 1 #5-1
		required_missions = { }
		
		provinces_to_highlight = {
			#None
		}
		
		trigger = {
			OR = {
				alliance_with = POL
				if = {
					limit = {
						HAB = { is_subject = yes }
					}
					alliance_with = STY
				}
				else = {
					alliance_with = HAB
				}
				alliance_with = HUN
				num_of_allies = 3
			}
		}
		
		effect = {
			add_country_modifier = {
				name = "byz_light_in_the_darkness"
				duration = 9125
			}
			add_dip_power = 100
		}
		
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}

	byz_northern_chersonese = { #The Northern Chersonese
		icon = mission_cossack_cavalry
		position = 3 #5-3
		required_missions = { byz_gather_alliances byz_deny_ottoman_access }
		
		provinces_to_highlight = {
			#None
		}
		
		trigger = {
			any_country = {
				culture_group = east_slavic
				OR = {
					alliance_with = ROOT
					is_subject_of = ROOT
				}
			}
		}
		
		effect = {
			crimea_area = {
				limit = {
					NOT = { is_core = ROOT }
				}
				add_permanent_claim = ROOT
			}
			2447 = {
				add_permanent_claim = ROOT
			}
			286 = {
				add_claim = ROOT
			}
			add_dip_power = 100
		}
		
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
}

byz_navy_2 = {
	slot = 4
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes
	
	byz_modernize_navy = { #New in BR 8.0
		icon = mission_establish_high_seas_navy
		position = 5 #4-5
		required_missions = { byz_no_latins_in_greece byz_expand_naval_dominance }
		
		provinces_to_highlight = {
		
		}
		
		trigger = {
			#shipyard = 10
			dock = 10
			#navy_tradition = 30 #40 navy tradition is pretty darn hard.
			max_sailors = 10000
			if = { limit = { has_dlc = "Rule Britannia" }
				has_naval_doctrine = any
			}
		}
		
		effect = {
			151 = {
				if = {
					limit = { 
						NOT = { has_building = naval_battery } 
						NOT = { has_construction = building }
					}
					add_building_construction = {
						building = naval_battery
						speed = 0.25
						cost = 0
					}
				}
				else_if = {
					limit = { 
						NOT = { has_building = naval_battery } 
					}
					add_building = naval_battery
				}
				else = {
					add_treasury = 200 #Fallback
				}
			}
			remove_country_modifier = byz_bad_navy
		}
	}
}

byz_navy_1 = {
	slot = 5
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes
	
	byz_expand_naval_dominance = { #Restore the Navy
		icon = mission_galleys_in_port
		position = 4 #5-4
		required_missions = { byz_no_latins_in_greece byz_northern_chersonese }
		
		provinces_to_highlight = {
			#None
		}
		
		trigger = {
			naval_forcelimit = 20
			OR = {
				num_of_galley = 15
				num_of_light_ship = 15
				num_of_heavy_ship = 3
			}
		}
		
		effect = {
			if = {
				limit = { 
					has_dlc = "Golden Century" 
					has_spare_flagship_capacity = yes 
				}
				151 = {
					ROOT = {
						create_flagship = {    
							name = "Eleutherios"
							type = galley
						}
					}
				}
			}
			else = {
				151 = {
					ROOT = {
						create_named_ship = {    
							name = "Eleutherios"
							type = galley
						}
					}
				}
			}
			add_yearly_sailors = 1	
			
			#Claims
			give_permaclaims_for_mission = { mission=byz_retake_greek_islands }
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
	
	byz_retake_greek_islands = { #Retake Greek Islands!
		icon = mission_invade_island
		position = 6 #5-6
		required_missions = { byz_modernize_navy byz_expand_naval_dominance }
		
		provinces_to_highlight = {
			province_group = byz_retake_greek_islands_provinces
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			custom_trigger_tooltip = {
				tooltip = byz_retake_greek_islands_tt #Wish there was a way for me to dynamically make this not require two identical localisation strings. Unfortunately, I do not see how without sacrificing something in the process.
				NAX = {
					OR = {
						exists = no
						AND = {
							NOT = { religion = catholic }
							is_subject_of = ROOT
						}
					}
				}
				CDA = {
					OR = {
						exists = no
						AND = {
							NOT = { religion = catholic }
							is_subject_of = ROOT
						}
					}
				}
				KNI = {
					OR = {
						exists = no
						AND = {
							NOT = { religion = catholic }
							is_subject_of = ROOT
						}
					}
				}
				CYP = {
					OR = {
						exists = no
						AND = {
							NOT = { religion = catholic }
							is_subject_of = ROOT
						}
					}
				}
			}
			has_fulfiled_province_requirement_for_mission_trigger = {
				tooltip=country_holds_or_non_sovereign_subject_holds_highlighted 
				provinces=byz_retake_greek_islands_provinces
				owner_type=country_or_non_sovereign_subject_holds
			}
		}
		
		effect = {
			148 = { #Thessalonica grows as an important port city and trade prospers as Byzantium controls the Aegean.
				add_base_tax = 4
				add_base_production = 4
				add_base_manpower = 2
			}
		}
	}
}

byz_military_1 = {
	slot = 3
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes

	byz_restore_imperial_army = { #The Imperial Army
		icon = mission_pf_soldier
		position = 5 #3-5
		required_missions = { byz_safeguard_balkan_border }
		
		provinces_to_highlight = {
			#None
		}
		
		trigger = {
			army_size = 30
			army_tradition = 75
			num_of_generals = 2
		}
		effect = {
			add_legitimacy = 20
			remove_country_modifier = byz_bad_military
		}
		
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
	
	byz_varangian_guard = { #New in BR 8.0
		icon = mission_varangians
		position = 6 #3-6
		required_missions = { byz_restore_imperial_army }
		
		trigger = {
			custom_trigger_tooltip = {
				tooltip = br_varangian_guard_enabled_tt
				has_country_flag = br_varangian_guard_enabled
			}
			any_hired_mercenary_company = {
				OR = {
					template = br_varangian_guard
					template = br_varangian_guard_elite
				}
			}
		}
		effect = {
			if = {
				limit = { has_dlc = "Cradle of Civilization" }
				add_army_professionalism = 0.1
			}
			else = {
				add_army_tradition = 25
				add_mil_power = 100
			}
		}
		
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
}

byz_admin = {
	slot = 3
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes
	
	byz_revoke_latifundia = { #New in BR 8.0
		icon = mission_revoke_latifundia
		position = 8 #4-8
		required_missions = { byz_resurgent }
		
		provinces_to_highlight = {
			
		}
		
		trigger = {
			NOT = { has_estate_privilege = estate_nobles_latifundia_kantakouzenos }
			NOT = { has_estate_privilege = estate_nobles_latifundia_philantropenos }
			NOT = { has_estate_privilege = estate_nobles_latifundia_metochites }
			NOT = { has_estate_privilege = estate_nobles_latifundia_choumnos }
			NOT = { has_estate_privilege = estate_nobles_latifundia_melissenos }
			NOT = { has_estate_privilege = estate_nobles_latifundia_tornikes }
		}
		
		effect = {
			custom_tooltip = byzantine_pronoia_tooltip
			set_country_flag = byz_restored_pronoia_mechanic
			hidden_effect = { #In order to reset the gov mechanics. For some reason this is required by the game.
				#Bureaucracys
				restore_gov_power_part_1_effect = { gov_power=logothete_general_power  }
				restore_gov_power_part_1_effect = { gov_power=logothete_postal_power  }
				restore_gov_power_part_1_effect = { gov_power=logothete_military_power  }
				restore_gov_power_part_1_effect = { gov_power=logothete_praetorium_power  }
				restore_gov_power_part_1_effect = { gov_power=logothete_special_affairs_power  }
				restore_gov_power_part_1_effect = { gov_power=logothete_waters_power  }
				#Militarization
				restore_gov_power_part_1_effect = { gov_power=byzantine_militarization }
				remove_government_reform = reformed_byzantine_monarchy_reform
				add_government_reform = reformed_byzantine_monarchy_reform
				#Bureaucracys
				restore_gov_power_part_2_effect = { gov_power=logothete_general_power  }
				restore_gov_power_part_2_effect = { gov_power=logothete_postal_power  }
				restore_gov_power_part_2_effect = { gov_power=logothete_military_power  }
				restore_gov_power_part_2_effect = { gov_power=logothete_praetorium_power  }
				restore_gov_power_part_2_effect = { gov_power=logothete_special_affairs_power  }
				restore_gov_power_part_2_effect = { gov_power=logothete_waters_power  }
				#Militarization
				restore_gov_power_part_2_effect = { gov_power=byzantine_militarization }
			}
		}
		
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
}

byz_monuments = { #Separated because uncompletable without Leviathan DLC.
	slot = 3
	generic = no
	ai = yes
	potential = {
		tag = BYZ
		has_dlc = "Leviathan"
	}
	has_country_shield = yes
	
	byz_imperial_great_projects = { #New in BR 8.0
		icon = mission_parthenon
		position = 10 #4-10
		required_missions = { byz_revoke_latifundia byz_restore_city_of_cities }
		
		provinces_to_highlight = {
			has_great_project = {
				type = any
				tier = 0
			}
			NOT = {
				has_great_project = {
					type = any
					tier = 3
				}
			}
			owned_by = ROOT
		}
		
		trigger = {
			calc_true_if = {
				desc = byz_imperial_great_projects_tooltip
				all_owned_province = {
					has_great_project = {
						type = any
						tier = 3
					}
				}
				amount = 3
			}
		}
		
		effect = {
			add_country_modifier = {
				name = "byz_great_projects"
				duration = 9125
			}
		}
		
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
}

byz_resurgence = {
	slot = 4
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes
	
	byz_resurgent = { #New in BR 8.0
		icon = mission_byzantine_resurgence
		position = 7 #4-7
		required_missions = { byz_reconquer_west_anatolia byz_varangian_guard byz_retake_greek_islands }
		
		provinces_to_highlight = {
			
		}
		
		trigger = {
			mission_completed = byz_restore_crown_authority
			if = { #Feature locked behind DLC.
				limit = {
					OR = {
						has_dlc = "Rights of Man"
						has_dlc = "Emperor"
					}
				}
				is_great_power = yes
			}
		}
		
		effect = {
			emperor = {
				if = {
					limit = {
						has_dlc = "Emperor"
					}
					set_imperial_incident = incident_byzantine_resurgence
				}
				else = {
					country_event = {
						id = incidents_byzantine_resurgence.2
						days = 5
					}
				}
			}
			remove_government_reform = byzantine_autocracy_reform
			custom_tooltip = byz_resurgent_tooltip #Because government mechanics are showing in tooltips.
			hidden_effect = {
				add_government_reform = reformed_byzantine_monarchy_reform
			}
		}
		
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
	
	byz_bureaucracy = { #New in BR 8.0
		icon = mission_byzantine_bureaucracy
		position = 8 #4-8
		required_missions = { byz_resurgent }
		
		provinces_to_highlight = {
			
		}
		
		trigger = {
			reform_level = 3
			OR = {
				adm = 4
				monthly_adm = 12 #Base is +3, so generating 8 adm from other sources should be possible, especially considering national foci exist.
			}
		}
		
		effect = {
			custom_tooltip = byzantine_bureaucracy_tooltip
			set_country_flag = byz_restored_bureaucracy_mechanic
			hidden_effect = { #In order to reset the gov mechanics. For some reason this is required by the game.
				#Pronoia
				restore_gov_power_part_1_effect = { gov_power=byzantine_pronoia_power }
				#Militarization
				restore_gov_power_part_1_effect = { gov_power=byzantine_militarization }
				remove_government_reform = reformed_byzantine_monarchy_reform
				add_government_reform = reformed_byzantine_monarchy_reform
				#Pronoia
				restore_gov_power_part_1_effect = { gov_power=byzantine_pronoia_power }
				#Militarization
				restore_gov_power_part_2_effect = { gov_power=byzantine_militarization }
			}
		}
		
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
	
}

byz_development_1 = {
	slot = 4
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes
	
	byz_restore_city_of_cities = { #Restore the City of Cities
		icon = take_constantinople
		position = 9 #4-9
		required_missions = { byz_new_renaissance }
		
		provinces_to_highlight = {
			province_id = 151
		}
		
		trigger = {
			151 = {
				if = {
					limit = {
						has_dlc = "Leviathan"
					}
					development = 75 #Because this is the capital and dev in capital in Leviathan is craycray
					OR = {
						has_great_project = {
							type = hagia_sophia
							tier = 3
						}
						has_great_project = {
							type = theodosian_walls
							tier = 3
						}
					}
					num_of_times_expanded_infrastructure = 2
				}
				else = {
					development = 50
				}
			}
		}
		
		effect = {
			151 = {
				area = {
					limit = { owned_by = ROOT }
					add_province_modifier = {
						name = "growth_of_capital"
						duration = 9125 #25 years
					}
				}
				add_province_modifier = {
					name = "byz_city_of_cities"
					duration = -1
				}
				if = {
					limit = {
						has_great_project = {
							type = hagia_sophia
							tier = 3
						}
					}
					ROOT = { 
						change_adm = 1
						change_dip = 1 
					}
					
				}
				if = {
					limit = {
						has_great_project = {
							type = hagia_sophia
							tier = 3
						}
					}
					ROOT = { 
						change_adm = 1
						change_mil = 1 
					}
				}
			}
			add_prestige_or_monarch_power = { amount = 35 }
			add_legitimacy = 35
			if = {
				limit = { has_dlc = "Mandate of Heaven"	}
				add_splendor = 50
			}
		}
		
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
	
	byz_restore_imperial_co_capital = { #The Imperial Co-Capital
		icon = mission_early_game_buildings
		position = 10 #4-10
		required_missions = { byz_restore_city_of_cities }
		
		provinces_to_highlight = {
			province_id = 148
		}
		
		trigger = {
			148 = {
				if = {
					limit = {
						has_dlc = "Leviathan"
					}
					development = 50
					num_of_times_expanded_infrastructure = 2
				}
				else = {
					development = 35
				}
			}
		}
		
		effect = {
			148 = {
				add_province_modifier = {
					name = "byz_co_capital"
					duration = -1
				}
			}
			add_legitimacy = 20
			if = {
				limit = { has_dlc = "Mandate of Heaven"	}
				add_splendor = 50
			}
		}
		
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
}

byz_innovative_1 = {
	slot = 5
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes	
	
	byz_new_renaissance = { #New in BR 8.0
		icon = mission_byzantine_renaissance
		position = 8 #5-8
		required_missions = { byz_resurgent }
		
		provinces_to_highlight = {
			#None
		}
		
		trigger = {
			OR = {
				full_idea_group = innovativeness_ideas
				philosopher = 3
				natural_scientist = 3
			}
		}
		
		effect = {
			change_government_reform_progress = 60
			country_event_with_insight = {
				id = resurgent_BYZ.38
				insight_tooltip = byz_new_renaissance_event_insight
			}
		}
		
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
	
	byz_pandidakterion = { #New in BR 8.0
		icon = mission_pandidakterion
		position = 9 #5-9
		required_missions = { byz_new_renaissance }
		
		provinces_to_highlight = {
			province_id = 151
			NOT = { has_building = university }
		}
		
		trigger = {
			151 = {
				has_building = university
			}
			university = 4
		}
		
		effect = {
			if = {
				limit = {
					has_dlc = "Rule Britannia"
				}
				change_innovativeness = 3
			}
			else = { #Fallback
				add_adm_power = 25
				add_dip_power = 25
				add_mil_power = 25
			}
			change_adm = 1
			change_dip = 1
			
		}
		
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
	
	byz_military_education = { #New in BR 8.0
		icon = mission_skoutatoi
		position = 10 #5-10
		required_missions = { byz_pandidakterion }
		
		provinces_to_highlight = {
		}
		
		trigger = {
			OR = {
				fortification_expert = 3
				commandant = 3
			}
			if = {
				limit = {
					has_dlc = "Cradle of Civilization"
				}
				army_professionalism = 0.4
			}
			else = {
				army_tradition = 70
			}
		}
		
		effect = {
			change_government_reform_progress = 40
			add_country_modifier = {
				name = "byz_military_education"
				duration = -1
			}
			
		}
		
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
	
	byz_basileus_protostrategos = { #New in BR 8.0
		icon = mission_basileus_protostrategos
		position = 11 #5-11
		required_missions = { byz_military_education byz_restore_imperial_co_capital }
		
		provinces_to_highlight = {
			#None
		}
		
		trigger = {
			is_monarch_leader = yes
			OR = {
				mil = 4
				monthly_mil = 12 #Base is +3, so generating 8 mil from other sources should be possible, especially considering national foci exist.
			}
		}
		
		effect = {
			custom_tooltip = byzantine_militarization_tooltip
			set_country_flag = byz_restored_militarization_mechanic
			hidden_effect = { #In order to reset the gov mechanics. For some reason this is required by the game.
				#Bureaucracys
				restore_gov_power_part_1_effect = { gov_power=logothete_general_power  }
				restore_gov_power_part_1_effect = { gov_power=logothete_postal_power  }
				restore_gov_power_part_1_effect = { gov_power=logothete_military_power  }
				restore_gov_power_part_1_effect = { gov_power=logothete_praetorium_power  }
				restore_gov_power_part_1_effect = { gov_power=logothete_special_affairs_power  }
				restore_gov_power_part_1_effect = { gov_power=logothete_waters_power  }
				#Pronoia
				restore_gov_power_part_1_effect = { gov_power=byzantine_pronoia_power }
				remove_government_reform = reformed_byzantine_monarchy_reform
				add_government_reform = reformed_byzantine_monarchy_reform
				#Bureaucracys
				restore_gov_power_part_2_effect = { gov_power=logothete_general_power  }
				restore_gov_power_part_2_effect = { gov_power=logothete_postal_power  }
				restore_gov_power_part_2_effect = { gov_power=logothete_military_power  }
				restore_gov_power_part_2_effect = { gov_power=logothete_praetorium_power  }
				restore_gov_power_part_2_effect = { gov_power=logothete_special_affairs_power  }
				restore_gov_power_part_2_effect = { gov_power=logothete_waters_power  }
				#Pronoia
				restore_gov_power_part_2_effect = { gov_power=byzantine_pronoia_power }
			}
			if = {
				limit = {
					has_dlc = "Cradle of Civilization"
				}
				add_army_professionalism = 0.1
			}
			else = {
				add_army_tradition = 10
			}
		}
		
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
}

byz_armenia_1 = {
	slot = 4
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes
	
	byz_reconquer_lesser_armenia = { #Protect Lesser Armenia!
		icon = mission_mesopotamia
		position = 11 #4-11
		required_missions = { byz_reclaim_anatolia }
		
		provinces_to_highlight = {
			province_group = byz_reconquer_lesser_armenia_provinces
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			has_fulfiled_province_requirement_for_mission_trigger = {
				tooltip=country_holds_or_non_sovereign_subject_holds_highlighted 
				provinces=byz_reconquer_lesser_armenia_provinces
				owner_type=country_or_non_sovereign_subject_holds
			}
		}
		
		effect = {			
			#Misc
			add_accepted_culture_or_dip_power_stated = { culture = cilician dip_reward = yes }
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
	
	byz_fortify_armenia = {
		icon = mission_conquer_50_development
		position = 12 #4-12
		required_missions = { byz_reconquer_lesser_armenia }
		
		provinces_to_highlight = {
			province_group = byz_reconquer_lesser_armenia_provinces
			NOT = { fort_level = 2 }
		}
		
		trigger = {
			calc_true_if = {
				desc = byz_rebuild_armenia_tooltip
				amount = 4
				byz_reconquer_lesser_armenia_provinces = {
					type = all
					fort_level = 2
				}
			}
		}
		
		effect = {
			custom_tooltip = byz_fortify_armenia_tooltip
			hidden_effect = {
				byz_reconquer_lesser_armenia_provinces = {
					limit = {
						fort_level = 2
					}
					add_base_manpower = 2
					add_province_modifier = {
						name = local_fortress
						duration = -1
					}
				}
			}
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
}

byz_armenia_2 = {
	slot = 5
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes
	
	byz_rebuild_armenia = {
		icon = mission_pf_soldier
		position = 12 #5-12
		required_missions = { byz_reconquer_lesser_armenia }
		
		provinces_to_highlight = {
			culture = armenian
		}
		
		trigger = {
			accepted_culture = armenian
			development_in_provinces = { #In 1444, 212 dev is Armenian culture. 300 is therefore reasonable considering you can culture-convert OR dev to reach this number.
                value = 300
                culture = armenian
            }
		}
		
		effect = {
			if = {
				limit = { has_dlc = "Mandate of Heaven" }
				custom_tooltip = byz_rebuild_armenia_effect_tooltip
				hidden_effect = {
					rum_area = {
						add_prosperity = 50
					}
					hudavendigar_area = {
						add_prosperity = 50
					}
					germiyan_area = {
						add_prosperity = 50
					}
					aydin_area = {
						add_prosperity = 50
					}
					ankara_area = {
						add_prosperity = 50
					}
					kastamonu_area = {
						add_prosperity = 50
					}
					karaman_area = {
						add_prosperity = 50
					}
					cukurova_area = {
						add_prosperity = 50
					}
					dulkadir_area = {
						add_prosperity = 50
					}
					pontus_area = {
						add_prosperity = 50
					}
					karasi_area = {
						add_prosperity = 50
					}
					pamphylia_area = {
						add_prosperity = 50
					}
					# lydia_area = {
						# add_prosperity = 50
					# }
				}
			}
			add_country_modifier = {
				name = byz_armenian_auxillaries
				duration = -1
			}
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
}

byz_crusade_1 = {
	slot = 1
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes
	
	byz_bastion_of_christendom = { #Bastion of Christendom
		icon = mission_european_church
		position = 13 #1-13
		required_missions = { convert_anatolia }
		
		provinces_to_highlight = {
		}
		
		trigger = {
			if = {
				limit = {
					religion = catholic
				}
				OR = {
					is_defender_of_faith = yes
					AND = {
						is_papal_controller = yes
						crusade_target = {
							religion_group = muslim
						}
					}
				}
			}
			else = {
				is_defender_of_faith = yes
			}
		}
		
		effect = {
			add_country_modifier = {
				name = "byz_crusade"
				duration = 7300
			}
			
			#Claims
			give_permaclaims_for_mission = { mission=byz_syria }
			
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
	
	byz_syria = { #Crusade for Syria
		icon = mission_arabian_fort
		position = 15 #1-15
		required_missions = { byz_bastion_of_christendom }
		
		provinces_to_highlight = {
			province_group = byz_syria_provinces
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			has_fulfiled_province_requirement_for_mission_trigger = {
				tooltip=country_holds_or_non_sovereign_subject_holds_highlighted 
				provinces=byz_syria_provinces
				owner_type=country_or_non_sovereign_subject_holds
			}
		}
		
		effect = {
			2313 = { #Antioch
				add_base_tax = 2
				add_base_production = 2
				add_base_manpower = 1
				set_center_level_2_center_of_trade = yes
			}
			5170 = { #Laodicea/Theodorias
				add_base_tax = 2
				add_base_production = 2
				add_base_manpower = 1
			}
			
			#Claims
			give_permaclaims_for_mission = { mission=byz_palestine }
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}

	byz_palestine = { #Crusade for Palestine
		icon = jerusalem
		position = 18 #1-18
		required_missions = { byz_syria }
		
		provinces_to_highlight = {
			province_group = byz_palestine_provinces
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			has_fulfiled_province_requirement_for_mission_trigger = {
				tooltip=country_holds_or_non_sovereign_subject_holds_highlighted 
				provinces=byz_palestine_provinces
				owner_type=country_or_non_sovereign_subject_holds
			}
		}
		
		effect = {
			increase_religious_currency_effect = yes
			
			#Claims
			give_permaclaims_for_mission = { mission=byz_arabia } 
			give_permaclaims_for_mission = { mission=byz_lower_egypt }
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
	
	byz_arabia = { #Into Arabia!
		icon = mission_desert
		position = 19 #1-19
		required_missions = { byz_palestine }
		
		provinces_to_highlight = {
			province_group = byz_arabia_provinces
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			has_fulfiled_province_requirement_for_mission_trigger = {
				tooltip=country_holds_or_non_sovereign_subject_holds_highlighted 
				provinces=byz_arabia_provinces
				owner_type=country_or_non_sovereign_subject_holds
			}
		}
		
		effect = {
			365 = {
				if = {
					limit = {
						has_dlc = "Leviathan"
						NOT = {
							has_great_project = {
								type = st_catherines
								tier = 2
							}
						}
					}
					add_great_project_tier = {
						type = st_catherines
						tier = 1
					}
				}
				else = {
					add_base_tax = 2
					add_base_production = 2
				}
			}
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
}

byz_themes_1 = {
	slot = 3
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	
	byz_theme_system = { #New in BR 8.0
		icon = mission_strategoi
		position = 11 #3-11
		required_missions = { }
		
		provinces_to_highlight = {
			OR = {
				province_group = byz_reclaim_anatolia_provinces
				province_group = byz_reconquer_west_anatolia_provinces
			}
			NOT = { estate_generals_is_theme_capital_trigger = yes }
		}
		
		trigger = {
			mission_completed = byz_resurgent
			reform_level = 4
			calc_true_if = {
				desc = byz_theme_system_tooltip
				amount = 10
				byz_reclaim_anatolia_provinces = {
					type = all
					estate_generals_is_theme_capital_trigger = yes
				}
				byz_reconquer_west_anatolia_provinces = {
					type = all
					estate_generals_is_theme_capital_trigger = yes
				}
			}
		}
		
		effect = {
			add_government_reform = theme_system_reform
			custom_tooltip = byz_theme_system_development_tooltip
			hidden_effect = {
				random_owned_province = { #RandProv 1
					limit = {
						OR = {
							province_group = byz_reclaim_anatolia_provinces
							province_group = byz_reconquer_west_anatolia_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
					set_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
				}
				random_owned_province = { #RandProv 2
					limit = {
						OR = {
							province_group = byz_reclaim_anatolia_provinces
							province_group = byz_reconquer_west_anatolia_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
						NOT = { 
							has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
						}
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
					set_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
				}
				random_owned_province = { #RandProv 3
					limit = {
						OR = {
							province_group = byz_reclaim_anatolia_provinces
							province_group = byz_reconquer_west_anatolia_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
						NOT = { 
							has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
						}
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
					set_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
				}
				random_owned_province = { #RandProv 4
					limit = {
						OR = {
							province_group = byz_reclaim_anatolia_provinces
							province_group = byz_reconquer_west_anatolia_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
						NOT = { 
							has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
						}
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
					set_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
				}
				random_owned_province = { #RandProv 5
					limit = {
						OR = {
							province_group = byz_reclaim_anatolia_provinces
							province_group = byz_reconquer_west_anatolia_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
						NOT = { 
							has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
						}
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
				}
				every_owned_province = { #Clearing the flags above.
					if = {
						limit = {
							has_province_flag = byz_prov_to_dev
						}
						clr_province_flag = byz_prov_to_dev 
					}
				}
			}
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
	
	byz_greek_themes = { #New in BR 8.0
		icon = mission_frangokastello
		position = 13 #3-13
		required_missions = { byz_theme_system }
		
		provinces_to_highlight = {
			OR = {
				province_group = byz_reconquer_ottoman_greece_provinces
				province_group = byz_no_latins_in_greece_provinces
				province_group = byz_retake_greek_islands_provinces
				area = thrace_area
			}
			NOT = { estate_generals_is_theme_capital_trigger = yes }
		}
		
		trigger = {
			calc_true_if = {
				desc = byz_theme_system_tooltip
				amount = 6
				byz_reconquer_ottoman_greece_provinces = {
					type = all
					estate_generals_is_theme_capital_trigger = yes
				}
				byz_no_latins_in_greece_provinces = {
					type = all
					estate_generals_is_theme_capital_trigger = yes
				}
				thrace_area = {
					type = all
					estate_generals_is_theme_capital_trigger = yes
				}
			}
			calc_true_if = {
				desc = byz_greek_themes_2_tooltip
				amount = 3
				byz_retake_greek_islands_provinces = {
					type = all
					estate_generals_is_theme_capital_trigger = yes
				}
			}
		}
		
		effect = {
			custom_tooltip = byz_theme_system_development_tooltip
			hidden_effect = {
				random_owned_province = { #RandProv 1
					limit = {
						OR = {
							province_group = byz_reconquer_ottoman_greece_provinces
							province_group = byz_no_latins_in_greece_provinces
							area = thrace_area
						}
						estate_generals_is_theme_capital_trigger = yes
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
					set_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
				}
				random_owned_province = { #RandProv 2
					limit = {
						OR = {
							province_group = byz_reconquer_ottoman_greece_provinces
							province_group = byz_no_latins_in_greece_provinces
							area = thrace_area
						}
						estate_generals_is_theme_capital_trigger = yes
						NOT = { 
							has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
						}
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
					set_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
				}
				random_owned_province = { #RandProv 3
					limit = {
						OR = {
							province_group = byz_reconquer_ottoman_greece_provinces
							province_group = byz_no_latins_in_greece_provinces
							area = thrace_area
						}
						estate_generals_is_theme_capital_trigger = yes
						NOT = { 
							has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
						}
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
				}
				every_owned_province = { #Clearing the flags above.
					if = {
						limit = {
							has_province_flag = byz_prov_to_dev
						}
						clr_province_flag = byz_prov_to_dev 
					}
				}
			}
			
			#Naval themes
			aegean_archipelago_area = { #Aegean Islands
				add_province_modifier = {
					name = "byz_naval_theme"
					duration = -1
				}
			}
			eastern_mediterrenean_islands_area = { #Crete
				add_province_modifier = {
					name = "byz_naval_theme"
					duration = -1
				}
			}
			cyprus_area = { #Cyprus
				add_province_modifier = {
					name = "byz_naval_theme"
					duration = -1
				}
			}
			
			#Claims
			give_permaclaims_for_mission = { mission=byz_reconquer_albania }
			give_permaclaims_for_mission = { mission=byz_conquer_armenia_major }
			give_permaclaims_for_mission = { mission=byz_subjugate_lazica }
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
}

byz_balkan_1 = {
	slot = 2
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	
	byz_reconquer_albania = { #Reconquer Albania
		icon = mission_dyrrachium
		position = 14 #2-14
		required_missions = { byz_greek_themes }
		
		provinces_to_highlight = {
			province_group = byz_reconquer_albania_provinces
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			has_fulfiled_province_requirement_for_mission_trigger = {
				tooltip=country_holds_or_non_sovereign_subject_holds_highlighted 
				provinces=byz_reconquer_albania_provinces
				owner_type=country_or_non_sovereign_subject_holds
			}
		}
		
		effect = {
			4174 = { #Dyrrachium, old important fortress and Theme capital.
				add_base_tax = 4
				add_base_production = 4
				add_base_manpower = 3
			}
			#Claims
			if = { #Bulgaria
				limit = {
					exists = BUL
					BUL = {
						NOT = { total_development = 200 }
					}
				}
				add_casus_belli = {
					type = cb_vassalize_mission
					months = 300 #25 years. I'm not sure if you can actually make it infinite.
					target = BUL
				}
			}
			give_permaclaims_for_mission = { mission=byz_subjugate_bulgaria }
			
			if = { #Serbia
				limit = {
					exists = SER
					SER = {
						NOT = { total_development = 200 }
					}
				}
				add_casus_belli = {
					type = cb_vassalize_mission
					months = 300 #25 years. I'm not sure if you can actually make it infinite.
					target = SER
				}
			}
			give_permaclaims_for_mission = { mission=byz_subjugate_serbia }
			give_permaclaims_for_mission = { mission=byz_gain_foothold_in_italy }
		}
	}
		
	byz_subjugate_bulgaria = { #Subjugate the Bulgars
		icon = mission_cossack_cavalry
		position = 15 #2-15
		required_missions = { byz_reconquer_albania }
		
		provinces_to_highlight = {
			province_group = byz_subjugate_bulgaria_provinces
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			has_fulfiled_province_requirement_for_mission_trigger = {
				tooltip=country_holds_or_non_sovereign_subject_holds_highlighted 
				provinces=byz_subjugate_bulgaria_provinces
				owner_type=country_or_non_sovereign_subject_holds
			}
		}
		
		effect = {	
			159 = { #Dorostolon, Theme capital.
				add_base_tax = 2
				add_base_production = 2
				add_base_manpower = 2
			}		
			149 = { #Adrianople, now safe from Bulgar invasions.
				add_base_tax = 3
				add_base_production = 3
				add_base_manpower = 2
			}
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
}

byz_themes_2 = {
	slot = 2
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	
	byz_balkan_themes = { #New in BR 8.0
		icon = mission_belgrade
		position = 16 #2-16
		required_missions = { byz_subjugate_bulgaria byz_subjugate_serbia }
		
		provinces_to_highlight = {
			OR = {
				province_group = byz_reconquer_albania_provinces
				province_group = byz_subjugate_bulgaria_provinces
				province_group = byz_safeguard_balkan_border_provinces
				province_group = byz_subjugate_serbia_provinces
			}
			NOT = {
				estate_generals_is_theme_capital_trigger = yes
			}
		}
		
		trigger = {
			calc_true_if = {
				desc = byz_theme_system_tooltip
				byz_reconquer_albania_provinces = {
					type = all
					estate_generals_is_theme_capital_trigger = yes
				}
				byz_subjugate_bulgaria_provinces = {
					type = all
					estate_generals_is_theme_capital_trigger = yes
				}
				byz_safeguard_balkan_border_provinces = {
					type = all
					estate_generals_is_theme_capital_trigger = yes
				}
				byz_subjugate_serbia_provinces = {
					type = all
					estate_generals_is_theme_capital_trigger = yes
				}
				amount = 8
			}
		}
		
		effect = {
			#Claims
			give_permaclaims_for_mission = { mission=byz_balkan_hegemony }
			
			#CBs
			if = { #Bosnia
				limit = {
					exists = BOS
					BOS = {
						NOT = { total_development = 200 }
					}
				}
				add_casus_belli = {
					type = cb_vassalize_mission
					months = 300 #25 years. I'm not sure if you can actually make it infinite.
					target = BOS
				}
			}
			if = { #Croatia
				limit = {
					exists = CRO
					CRO = {
						NOT = { total_development = 200 }
					}
				}
				add_casus_belli = {
					type = cb_vassalize_mission
					months = 300 #25 years. I'm not sure if you can actually make it infinite.
					target = CRO
				}
			}
			custom_tooltip = byz_balkan_themes_development_tooltip
			hidden_effect = {
				random_owned_province = {
					limit = {
						OR = {
							province_group = byz_reconquer_albania_provinces
							province_group = byz_subjugate_bulgaria_provinces
							province_group = byz_safeguard_balkan_border_provinces
							province_group = byz_subjugate_serbia_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
					set_province_flag = byz_prov_to_dev
				}
				random_owned_province = {
					limit = {
						OR = {
							province_group = byz_reconquer_albania_provinces
							province_group = byz_subjugate_bulgaria_provinces
							province_group = byz_safeguard_balkan_border_provinces
							province_group = byz_subjugate_serbia_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
						NOT = {
							has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
						}
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
					set_province_flag = byz_prov_to_dev
				}
				random_owned_province = { #RandProv 3
					limit = {
						OR = {
							province_group = byz_reconquer_albania_provinces
							province_group = byz_subjugate_bulgaria_provinces
							province_group = byz_safeguard_balkan_border_provinces
							province_group = byz_subjugate_serbia_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
						NOT = {
							has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
						}
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
					set_province_flag = byz_prov_to_dev
				}
				random_owned_province = { #RandProv 4
					limit = {
						OR = {
							province_group = byz_reconquer_albania_provinces
							province_group = byz_subjugate_bulgaria_provinces
							province_group = byz_safeguard_balkan_border_provinces
							province_group = byz_subjugate_serbia_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
						NOT = {
							has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
						}
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
				}
				every_owned_province = {  #Clearing the flags above.
					if = {
						limit = {
							has_province_flag = byz_prov_to_dev
						}
						clr_province_flag = byz_prov_to_dev 
					}
				}
			}
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
}

byz_religious_2 = {
	slot = 2
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	
	byz_brothers_of_faith = { #New in BR 8.0
		icon = mission_hands_praying
		position = 18 #2-18
		required_missions = { byz_balkan_themes byz_balkan_hegemony }
		
		provinces_to_highlight = {
			region = balkan_region
			OR = {
				NOT = { country_or_non_sovereign_subject_holds = ROOT }
				AND = {
					country_or_non_sovereign_subject_holds = ROOT
					NOT = { has_owner_accepted_culture = yes }
					NOT = { religion = ROOT }
				}
			}
		}
		
		trigger = {
			balkan_region = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT
				religion = ROOT
				#has_owner_accepted_culture = yes
			}
		}
		
		effect = {
			add_accepted_culture_or_dip_power_stated = { culture = serbian dip_reward = yes }
			add_accepted_culture_or_dip_power_stated = { culture = bosnian dip_reward = yes }
			add_accepted_culture_or_dip_power_stated = { culture = croatian dip_reward = yes }
			add_accepted_culture_or_dip_power_stated = { culture = bulgarian dip_reward = yes }
			add_accepted_culture_or_dip_power_stated = { culture = albanian dip_reward = yes }
			# add_country_modifier = {
				# name = "byz_balkan_hegemony"
				# duration = -1
			# }
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
}

byz_balkan_2 = {
	slot = 3
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	
	byz_subjugate_serbia = { #Subjugate the Serbs
		icon = mission_manasija_monastery
		position = 15 #3-15
		required_missions = { byz_reconquer_albania }
		
		provinces_to_highlight = {
			province_group = byz_subjugate_serbia_provinces
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			has_fulfiled_province_requirement_for_mission_trigger = {
				tooltip=country_holds_or_non_sovereign_subject_holds_highlighted 
				provinces=byz_subjugate_serbia_provinces
				owner_type=country_or_non_sovereign_subject_holds
			}
		}
		
		effect = {
			7718 = { #Sirmion, Theme capital.
				add_base_tax = 5
				add_base_production = 5
				add_base_manpower = 3
			}
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
}

byz_venice_1 = {
	slot = 3
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	
	destroy_venice = { #Taken from vanilla, adjusted to limit to Venice itself
		icon = mission_monarch_in_throne_room
		position = 16 #3-16
		required_missions = { byz_gain_foothold_in_italy }
		
		provinces_to_highlight = {
			province_id = 112 #Venice
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			112 = {
				country_or_non_sovereign_subject_holds = ROOT
			}
		}
		
		effect = {
			add_prestige_or_monarch_power = { amount = 20 }
			add_adm_power = 100
			
			custom_tooltip = " "
			
			country_event_with_option_insight = {
				id = flavor_byz.1
				option_1 = "
					112 = {
						custom_tooltip = BYZ_this_province_will_lose_development
						custom_tooltip = \" \"
						add_permanent_province_modifier = {
							name = BYZ_chastening_of_venice
							duration = -1
						}
					}
					capital_scope = {
						add_province_modifier = {
							name = byzantine_treasures_returned
							duration = 7300
						}
					}
				"
				option_2 = "
					if = {
						limit = {
							has_dlc = \"Domination\"
						}
						add_country_modifier = { 
							name = BYZ_may_construct_galleass
							duration = -1
						}
						custom_tooltip = BYZ_may_only_build_in_112
					}
					else = {
						112 = {
							add_province_modifier = {
								name = BYZ_arsenal
								duration = -1
							}
						}
					}
				"
			}
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
}

byz_balkan_3 = {
	slot = 3
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	
	byz_balkan_hegemony = { #Balkan Hegemony
		icon = mission_balkan_conquest
		position = 17 #3-17
		required_missions = { byz_balkan_themes }
		
		provinces_to_highlight = {
			province_group = byz_balkan_hegemony_provinces
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			has_fulfiled_province_requirement_for_mission_trigger = {
				tooltip=country_holds_or_non_sovereign_subject_holds_highlighted 
				provinces=byz_balkan_hegemony_provinces
				owner_type=country_or_non_sovereign_subject_holds
			}
		}
		
		effect = {
			change_adm = 1
			change_dip = 1
			change_mil = 1
			#Claims
			give_permaclaims_for_mission = { mission=byz_land_access_to_italy }
			
			#CBs
			if = { #Carniola
				limit = {
					exists = CNL
					CNL = {
						NOT = { total_development = 200 }
					}
				}
				add_casus_belli = {
					type = cb_vassalize_mission
					months = 300 #25 years. I'm not sure if you can actually make it infinite.
					target = CNL
				}
			}
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
}

byz_georgia_1 = {
	slot = 4
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes
	
	byz_subjugate_lazica = { #Subjugate Lazica
		icon = mission_cannons_firing
		position = 14 #4-14
		required_missions = { byz_greek_themes }
		
		provinces_to_highlight = {
			province_group = byz_subjugate_lazica_provinces
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			has_fulfiled_province_requirement_for_mission_trigger = {
				tooltip=country_holds_or_non_sovereign_subject_holds_highlighted 
				provinces=byz_subjugate_lazica_provinces
				owner_type=country_or_non_sovereign_subject_holds
			}
		}
		
		effect = {			
			#Misc
			add_accepted_culture_or_dip_power_stated = { culture = laz_culture dip_reward = yes }
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
}

byz_east_1 = {
	slot = 5
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes

	byz_conquer_armenia_major = { #Put Greater Armenia into the fold!
		icon = mission_have_two_subjects
		position = 14 #5-14
		required_missions = { byz_greek_themes }
		
		provinces_to_highlight = {
			province_group = byz_conquer_armenia_major_provinces
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			has_fulfiled_province_requirement_for_mission_trigger = {
				tooltip=country_holds_or_non_sovereign_subject_holds_highlighted 
				provinces=byz_conquer_armenia_major_provinces
				owner_type=country_or_non_sovereign_subject_holds
			}
		}
		
		effect = {			
			#Dev bonuses
			random_owned_province = { #RandProv 1
				limit = {
					OR = {
						province_group = byz_reconquer_lesser_armenia_provinces
						province_group = byz_conquer_armenia_major_provinces
					}
					culture = armenian
				}
				add_base_manpower = 2
				set_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
			}
			random_owned_province = { #RandProv 2
				limit = {
					OR = {
						province_group = byz_reconquer_lesser_armenia_provinces
						province_group = byz_conquer_armenia_major_provinces
					}
					culture = armenian
					NOT = {
						has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
					}
				}
				add_base_manpower = 2
				set_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
			}
			random_owned_province = { #RandProv 3
				limit = {
					OR = {
						province_group = byz_reconquer_lesser_armenia_provinces
						province_group = byz_conquer_armenia_major_provinces
					}
					culture = armenian
					NOT = {
						has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
					}
				}
				add_base_manpower = 2
				set_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
			}
			random_owned_province = { #RandProv 4
				limit = {
					OR = {
						province_group = byz_reconquer_lesser_armenia_provinces
						province_group = byz_conquer_armenia_major_provinces
					}
					culture = armenian
					NOT = {
						has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
					}
				}
				add_base_manpower = 2
			}
			hidden_effect = { #Clearing the flags above.
				every_owned_province = {
					limit = {
						has_province_flag = byz_prov_to_dev
					}
					clr_province_flag = byz_prov_to_dev 
				}
			}
			
			#Misc
			add_accepted_culture_or_dip_power_stated = { culture = armenian dip_reward = yes }
			
			#Claims
			give_permaclaims_for_mission = { mission=byz_north_mesopotamia }
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
	
	byz_north_mesopotamia = { #Into Upper Mesopotamia
		icon = mission_mesopotamia_plain
		position = 15 #5-15
		required_missions = { byz_conquer_armenia_major }
		
		provinces_to_highlight = {
			province_group = byz_north_mesopotamia_provinces
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			has_fulfiled_province_requirement_for_mission_trigger = {
				tooltip=country_holds_or_non_sovereign_subject_holds_highlighted 
				provinces=byz_north_mesopotamia_provinces
				owner_type=country_or_non_sovereign_subject_holds
			}
		}
		
		effect = {
			add_country_modifier = {
				name = byz_flowing_spice
				duration = 365
			}
			
			#Claims
			give_permaclaims_for_mission = { mission=byz_south_mesopotamia }
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
	
	byz_south_mesopotamia = { #Finish off Mesopotamia
		icon = mission_establish_high_seas_navy
		position = 16 #5-16
		required_missions = { byz_north_mesopotamia }
		
		provinces_to_highlight = {
			province_group = byz_south_mesopotamia_provinces
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			has_fulfiled_province_requirement_for_mission_trigger = {
				tooltip=country_holds_or_non_sovereign_subject_holds_highlighted 
				provinces=byz_south_mesopotamia_provinces
				owner_type=country_or_non_sovereign_subject_holds
			}
		}
		
		effect = {
			
			#Dev bonuses
			408 = { #Apologos
				add_base_tax = 3
				add_base_production = 3
				add_or_spawn_center_of_trade = { level = 1 }
				add_unit_construction = {
					type = heavy_ship
					amount = 5
					speed = 0.2
					cost = 0
				}
			}
			4288 = { #Charax
				add_base_tax = 3
				add_base_production = 3
				add_or_spawn_center_of_trade = { level = 1 }
			}
			
			#Misc
			define_explorer = {
				shock = 1
				fire = 1
				manuever = 4
				siege = 1
				name = "Tiberios Klaudios Balbillos Modestos"
			}
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
}

byz_themes_7 = {
	slot = 5
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes
	
	byz_mesopotamian_themes = { #New in BR 8.0
		icon = mission_singara
		position = 17 #5-17
		required_missions = { byz_south_mesopotamia }
		
		provinces_to_highlight = {
			OR = {
				province_group = byz_conquer_armenia_major_provinces
				province_group = byz_north_mesopotamia_provinces
				province_group = byz_south_mesopotamia_provinces
			}
			NOT = {
				estate_generals_is_theme_capital_trigger = yes
			}
		}
		
		trigger = {
			calc_true_if = {
				desc = byz_theme_system_tooltip
				byz_conquer_armenia_major_provinces = {
					type = all
					estate_generals_is_theme_capital_trigger = yes
				}
				byz_north_mesopotamia_provinces = {
					type = all
					estate_generals_is_theme_capital_trigger = yes
				}
				byz_south_mesopotamia_provinces = {
					type = all
					estate_generals_is_theme_capital_trigger = yes
				}
				amount = 10
			}
		}
		
		effect = {
			custom_tooltip = byz_mesopotamian_themes_development_tooltip
			hidden_effect = {
				random_owned_province = { #RandProv 1
					limit = {
						OR = {
							province_group = byz_conquer_armenia_major_provinces
							province_group = byz_north_mesopotamia_provinces
							province_group = byz_south_mesopotamia_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
					set_province_flag = byz_prov_to_dev
				}
				random_owned_province = { #RandProv 2
					limit = {
						OR = {
							province_group = byz_conquer_armenia_major_provinces
							province_group = byz_north_mesopotamia_provinces
							province_group = byz_south_mesopotamia_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
						NOT = {
							has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
						}
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
					set_province_flag = byz_prov_to_dev
				}
				random_owned_province = { #RandProv 3
					limit = {
						OR = {
							province_group = byz_conquer_armenia_major_provinces
							province_group = byz_north_mesopotamia_provinces
							province_group = byz_south_mesopotamia_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
						NOT = {
							has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
						}
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
					set_province_flag = byz_prov_to_dev
				}
				random_owned_province = { #RandProv 4
					limit = {
						OR = {
							province_group = byz_conquer_armenia_major_provinces
							province_group = byz_north_mesopotamia_provinces
							province_group = byz_south_mesopotamia_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
						NOT = {
							has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
						}
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
					set_province_flag = byz_prov_to_dev
				}
				random_owned_province = { #RandProv 5
					limit = {
						OR = {
							province_group = byz_conquer_armenia_major_provinces
							province_group = byz_north_mesopotamia_provinces
							province_group = byz_south_mesopotamia_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
						NOT = {
							has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
						}
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
				}
				every_owned_province = {  #Clearing the flags above.
					if = {
						limit = {
							has_province_flag = byz_prov_to_dev
						}
						clr_province_flag = byz_prov_to_dev 
					}
				}
			}
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
}

byz_india_1 = {
	slot = 5
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes
	
	byz_establish_indian_trade_company = { #Coast of India
		icon = mission_bengal_entrepot
		position = 18 #5-18
		required_missions = { byz_mesopotamian_themes }
		
		provinces_to_highlight = {
			superregion = india_superregion
			has_port = yes
			NOT = { owned_by = ROOT }
		}
		
		trigger = {
			calc_true_if = {
				all_owned_province = {
					superregion = india_superregion
					has_port = yes
				}
				amount = 5
			}
		}
		
		effect = {
			add_country_modifier = {
				name = byz_indian_trade_company
				duration = 7300
			}
			
			#Dev bonuses
			408 = { #Apologos
				add_base_tax = 2
				add_base_production = 2
			}
			capital_scope = {
				add_base_tax = 1
				add_base_production = 1
			}
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
}

byz_italy_1 = {
	slot = 4
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes
	
	byz_gain_foothold_in_italy = { #Gain Foothold in Italy!
		icon = mission_invade_island
		position = 15 #4-15
		required_missions = { byz_reconquer_albania }
		
		provinces_to_highlight = {
			province_group = byz_gain_foothold_in_italy_provinces
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			has_fulfiled_province_requirement_for_mission_trigger = {
				tooltip=country_holds_or_non_sovereign_subject_holds_highlighted 
				provinces=byz_gain_foothold_in_italy_provinces
				owner_type=country_or_non_sovereign_subject_holds
			}
		}
		
		effect = {
			1933 = { #Barion, Theme capital.
				add_base_tax = 3
				add_base_production = 3
				add_base_manpower = 1
			}
			add_country_modifier = {
				name = "byz_prep_italy_invasion"
				duration = 1825
			}
			112 = { add_permanent_claim  = ROOT }	
			#Claims
			give_permaclaims_for_mission = { mission=byz_conquer_greater_greece }
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
	
	byz_conquer_greater_greece = { #Get Greater Greece!
		icon = king_of_naples
		position = 18 #4-18
		required_missions = { byz_gain_foothold_in_italy }
		
		provinces_to_highlight = {
			province_group = byz_conquer_greater_greece_provinces
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			has_fulfiled_province_requirement_for_mission_trigger = {
				tooltip=country_holds_or_non_sovereign_subject_holds_highlighted 
				provinces=byz_conquer_greater_greece_provinces
				owner_type=country_or_non_sovereign_subject_holds
			}
		}
		
		effect = {
			123 = { #Rhegion, Theme capital.
				add_base_tax = 2
				add_base_production = 2
				add_base_manpower = 2
			}	
			7017 = { #Kaieta, Theme capital.
				add_base_tax = 2
				add_base_production = 2
				add_base_manpower = 2
			}				
			#Claims
			give_permaclaims_for_mission = { mission=byz_sicily }
			give_permaclaims_for_mission = { mission=byz_subjugate_pope }
			#CBs
			if = { #Any italian minor in Popeland
				limit = {
					any_country = {
						NOT = { total_development = 200 }
						capital_scope = {
							province_group = byz_subjugate_pope_provinces
						}
					}
				}
				every_country = {
					limit = {
						NOT = { total_development = 200 }
						capital_scope = {
							province_group = byz_subjugate_pope_provinces
						}
					}
					reverse_add_casus_belli = {
						type = cb_vassalize_mission
						months = 300 #25 years. I'm not sure if you can actually make it infinite.
						target = ROOT
					}
				}
			}
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
	
	byz_subjugate_pope = { #Make the Pope bend to you.
		icon = control_the_church
		position = 19 #4-19
		required_missions = { byz_conquer_greater_greece }
		
		provinces_to_highlight = {
			province_group = byz_subjugate_pope_provinces
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			has_fulfiled_province_requirement_for_mission_trigger = {
				tooltip=country_holds_or_non_sovereign_subject_holds_highlighted 
				provinces=byz_subjugate_pope_provinces
				owner_type=country_or_non_sovereign_subject_holds
			}
		}
		
		effect = {
			if = {
				limit = {
					is_absolutism_active = yes
				}
				add_absolutism = 10
			}
			else = {
				increase_religious_currency_effect = yes
			}
			if = {
				limit = { has_dlc = "Mandate of Heaven" }
				add_splendor = 50
			}
			
			#Claims
			give_permaclaims_for_mission = { mission=byz_central_italy }
			#CBs
			if = { #Any italian minor in Central Italy
				limit = {
					any_country = {
						NOT = { total_development = 200 }
						capital_scope = {
							province_group = byz_central_italy_provinces
						}
					}
				}
				every_country = {
					limit = {
						NOT = { total_development = 200 }
						capital_scope = {
							province_group = byz_central_italy_provinces
						}
					}
					reverse_add_casus_belli = {
						type = cb_vassalize_mission
						months = 300 #25 years. I'm not sure if you can actually make it infinite.
						target = ROOT
					}
				}
			}
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
	
	byz_central_italy = { #Take Central Italy!
		icon = mission_italian_condottiere
		position = 20 #4-20
		required_missions = { byz_subjugate_pope }
		
		provinces_to_highlight = {
			province_group = byz_central_italy_provinces
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			has_fulfiled_province_requirement_for_mission_trigger = {
				tooltip=country_holds_or_non_sovereign_subject_holds_highlighted 
				provinces=byz_central_italy_provinces
				owner_type=country_or_non_sovereign_subject_holds
			}
		}
		
		effect = {
			114 = { #Ravenna
				add_base_tax = 1
				add_base_production = 1
				add_base_manpower = 1
				set_center_level_2_center_of_trade = yes #It's already quite high dev, giving a little CoT bonus.
			}
		
			#CBs
			if = { #Any italian minor in Lombardy
				limit = {
					any_country = {
						NOT = { total_development = 200 }
						capital_scope = {
							province_group = byz_lombardy_provinces
						}
					}
				}
				every_country = {
					limit = {
						NOT = { total_development = 200 }
						capital_scope = {
							province_group = byz_lombardy_provinces
						}
					}
					reverse_add_casus_belli = {
						type = cb_vassalize_mission
						months = 300 #25 years. I'm not sure if you can actually make it infinite.
						target = ROOT
					}
				}
			}
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
}

byz_italy_2 = {
	slot = 5
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes
	
	byz_sicily = { #Take Sicily!
		icon = mission_sea_battles
		position = 19 #5-19
		required_missions = { byz_conquer_greater_greece }
		
		provinces_to_highlight = {
			province_group = byz_sicily_provinces
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			has_fulfiled_province_requirement_for_mission_trigger = {
				tooltip=country_holds_or_non_sovereign_subject_holds_highlighted 
				provinces=byz_sicily_provinces
				owner_type=country_or_non_sovereign_subject_holds
			}
		}
		
		effect = {
			2982 = { #Syrakousai, Theme capital.
				add_base_tax = 4
				add_base_production = 4
				add_base_manpower = 3
			}	
			124 = { #Messene, Theme capital.
				add_base_tax = 3
				add_base_production = 3
				add_base_manpower = 2
			}
			#Claims
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
}

byz_italy_3 = {
	slot = 3
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes	
	
	byz_land_access_to_italy = { #Land Access to Italy!
		icon = mission_assemble_an_army
		position = 19 #3-19
		required_missions = { byz_balkan_hegemony }
		
		provinces_to_highlight = {
			province_group = byz_land_access_to_italy_provinces
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			has_fulfiled_province_requirement_for_mission_trigger = {
				tooltip=country_holds_or_non_sovereign_subject_holds_highlighted 
				provinces=byz_land_access_to_italy_provinces
				owner_type=country_or_non_sovereign_subject_holds
			}
		}
		
		effect = {
			emperor = { #Logically you've taken parts of the Empire away from them.
				add_imperial_influence = -20
			}
			
			#Claims
			give_permaclaims_for_mission = { mission=byz_lombardy }
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}

	byz_lombardy = { #Exact revenge on the Lombards!
		icon = confront_the_lombards
		position = 21 #3-21
		required_missions = { byz_central_italy byz_land_access_to_italy }
		
		provinces_to_highlight = {
			province_group = byz_lombardy_provinces
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			has_fulfiled_province_requirement_for_mission_trigger = {
				tooltip=country_holds_or_non_sovereign_subject_holds_highlighted 
				provinces=byz_lombardy_provinces
				owner_type=country_or_non_sovereign_subject_holds
			}
		}
		
		effect = {			
			#Dev bonuses
			if = { #Ravenna
				limit = { NOT = { has_global_flag = ravenna_restored } }
				114 = { 
					add_base_tax = 4
					add_base_production = 4
					add_base_manpower = 2
				}
				set_global_flag = ravenna_restored #In case, I suppose.
			}
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
}

byz_egypt_1 = {
	slot = 2
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes
	
	byz_lower_egypt = { #Conquer Lower Egypt
		icon = mission_pyramids
		position = 19 #2-19
		required_missions = { byz_palestine }
		
		provinces_to_highlight = {
			province_group = byz_lower_egypt_provinces
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			has_fulfiled_province_requirement_for_mission_trigger = {
				tooltip=country_holds_or_non_sovereign_subject_holds_highlighted 
				provinces=byz_lower_egypt_provinces
				owner_type=country_or_non_sovereign_subject_holds
			}
		}
		
		effect = {
			151 = { #Grain supplies secured, Constantinople grows.
				add_base_tax = 1
				add_base_production = 1
				add_base_manpower = 1
			}
			custom_tooltip = byz_granary_of_the_mediterranean_tooltip
			hidden_effect = {
				thrace_area = {
					add_province_modifier = {
						name = "byz_granary_of_the_mediterranean"
						duration = 7300
					}
				}
				hudavendigar_area = {
					add_province_modifier = {
						name = "byz_granary_of_the_mediterranean"
						duration = 7300
					}
				}
				karasi_area = {
					add_province_modifier = {
						name = "byz_granary_of_the_mediterranean"
						duration = 7300
					}
				}
			}
			#Claims
			give_permaclaims_for_mission = { mission=byz_upper_egypt }
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
	
	byz_upper_egypt = { #Conquer Upper Egypt
		icon = mission_egyptian_mamluk_soldier
		position = 21 #2-21
		required_missions = { byz_lower_egypt }
		
		provinces_to_highlight = {
			province_group = byz_upper_egypt_provinces
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			has_fulfiled_province_requirement_for_mission_trigger = {
				tooltip=country_holds_or_non_sovereign_subject_holds_highlighted 
				provinces=byz_upper_egypt_provinces
				owner_type=country_or_non_sovereign_subject_holds
				is_empty = yes #For prov 9085
			}
		}
		
		effect = {
			358 = { #Alexandria
				add_base_tax = 4
				add_base_production = 4
				add_base_manpower = 3
			}
			
			give_permaclaims_for_mission = { mission=byz_cyrenaica }
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
}

byz_themes_3 = {
	slot = 1
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes
	
	byz_themes_of_syria_palestina = { #New in BR 8.0
		icon = mission_mobene
		position = 20 #1-20
		required_missions = { byz_arabia }
		
		provinces_to_highlight = {
			OR = {
				province_group = byz_syria_provinces
				province_group = byz_palestine_provinces
				province_group = byz_arabia_provinces
			}
			NOT = {
				estate_generals_is_theme_capital_trigger = yes
			}
		}
		
		trigger = {
			calc_true_if = {
				desc = byz_theme_system_tooltip
				byz_syria_provinces = {
					type = all
					estate_generals_is_theme_capital_trigger = yes
				}
				byz_palestine_provinces = {
					type = all
					estate_generals_is_theme_capital_trigger = yes
				}
				byz_arabia_provinces = {
					type = all
					estate_generals_is_theme_capital_trigger = yes
				}
				amount = 6
			}
		}
		
		effect = {
			if = { #TODO: Move to Themes of Syria Palestina
				limit = {
					2313 = {
						owned_by = ATL
					}
				}
				2313 = {
					add_base_tax = 3
					add_base_production = 3
					add_base_manpower = 1
				}
			}
			else = {
				2313 = {
					change_culture = anatolian
				}
			}
			custom_tooltip = byz_themes_of_syria_palestina_development_tooltip
			hidden_effect = {
				random_owned_province = {
					limit = {
						OR = {
							province_group = byz_syria_provinces
							province_group = byz_palestine_provinces
							province_group = byz_arabia_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
					set_province_flag = byz_prov_to_dev
				}
				random_owned_province = {
					limit = {
						OR = {
							province_group = byz_syria_provinces
							province_group = byz_palestine_provinces
							province_group = byz_arabia_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
						NOT = {
							has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
						}
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
					set_province_flag = byz_prov_to_dev
				}
				random_owned_province = { #RandProv 3
					limit = {
						OR = {
							province_group = byz_syria_provinces
							province_group = byz_palestine_provinces
							province_group = byz_arabia_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
						NOT = {
							has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
						}
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
				}
				every_owned_province = {  #Clearing the flags above.
					if = {
						limit = {
							has_province_flag = byz_prov_to_dev
						}
						clr_province_flag = byz_prov_to_dev 
					}
				}
			}
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
}

byz_tyrian_purple_1 = {
	slot = 1
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes
	
	byz_tyrian_purple = { #New in BR 8.0
		icon = mission_finest_carpets
		position = 21 #1-21
		required_missions = { byz_themes_of_syria_palestina }
		
		provinces_to_highlight = {
			OR = {
				trade_goods = silk
				trade_goods = dyes
			}
			owned_by = ROOT
			NOT = {
				has_production_building_trigger = yes
				has_manufactory_trigger = yes
			}
		}
		
		trigger = {
			custom_trigger_tooltip = {
				tooltip = byz_tyrian_purple_tooltip
				has_global_flag = byz_tyrian_purple_restored
			}
			trade_goods_produced_amount = {
				trade_goods = silk
				amount = 20 #This is 200 silk production dev, post-goods produced + production efficiency and manufactory stuff.
			}
			production_leader = {
				trade_goods = silk
			}
			trade_goods_produced_amount = {
				trade_goods = dyes
				amount = 10 #This is 100 dyes production dev, post-goods produced + production efficiency and manufactory stuff.
			}
			production_leader = {
				trade_goods = dyes
			}
		}
		
		effect = {
			custom_tooltip = byz_tyrian_purple_effect_tooltip
			if = {
				limit = {
					has_global_flag = byz_tyrian_purple_expanded
				}
				clr_global_flag = byz_tyrian_purple_expanded
			}
			else = {
				random_owned_province = {
					limit = {
						trade_goods = silk
					}
					add_base_tax = 2
					add_base_production = 2
				}
				random_owned_province = {
					limit = {
						trade_goods = dyes
					}
					add_base_tax = 2
					add_base_production = 2
				}
			}
		}
	}
}

byz_egypt_2 = {
	slot = 1
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes
	
	byz_cyrenaica = { #To Cyrenaica!
		icon = mission_desert
		position = 22 #1-22
		required_missions = { byz_upper_egypt }
		
		provinces_to_highlight = {
			province_group = byz_cyrenaica_provinces
			NOT = { is_empty = yes } #Because apparently missions can target non-colonized provinces.
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			has_fulfiled_province_requirement_for_mission_trigger = {
				tooltip=country_holds_or_non_sovereign_subject_holds_highlighted 
				provinces=byz_cyrenaica_provinces
				owner_type=country_or_non_sovereign_subject_holds
				is_empty = yes
			}
		}
		
		effect = {
			357 = { #Silphium
				change_trade_goods = spices
			}
			cyrenaica_area = {
				limit = {
					country_or_non_sovereign_subject_holds = ROOT
				}
				add_province_modifier = {
					name = "byz_pentapolis"
					duration = -1
				}
			}
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
}

byz_egypt_3 = {
	slot = 3
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes
	
	byz_mediterranean_bread_basket = { #New in BR 8.0
		icon = mission_panis_quadratus
		position = 22 #1-22
		required_missions = { byz_upper_egypt }
		
		provinces_to_highlight = {
			trade_goods = grain
			owned_by = ROOT
		}
		
		trigger = {
			trade_goods_produced_amount = {
				trade_goods = grain
				amount = 75 #This is 750 grain production dev, post-goods produced + production efficiency and manufactory stuff. I feel like Byzantium should have this, and if they don't at this rate, just build farm estates in Egypt, mkay?
			}
		}
		
		effect = {
			add_country_modifier = {
				name = "byz_staple_food_supply"
				duration = -1
			}
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
}


byz_themes_5 = {
	slot = 1
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes

	byz_themes_of_egypt = { #New in BR 8.0
		icon = mission_babylon_fortress
		position = 23 #1-23
		required_missions = { byz_cyrenaica }
		
		provinces_to_highlight = {
			OR = {
				province_group = byz_lower_egypt_provinces
				province_group = byz_upper_egypt_provinces
				province_group = byz_cyrenaica_provinces
			}
			NOT = {
				estate_generals_is_theme_capital_trigger = yes
			}
		}
		
		trigger = {
			calc_true_if = {
				desc = byz_theme_system_tooltip
				byz_lower_egypt_provinces = {
					type = all
					estate_generals_is_theme_capital_trigger = yes
				}
				byz_upper_egypt_provinces = {
					type = all
					estate_generals_is_theme_capital_trigger = yes
				}
				byz_cyrenaica_provinces = {
					type = all
					estate_generals_is_theme_capital_trigger = yes
				}
				amount = 6
			}
		}
		
		effect = {
			#Claims
			give_permaclaims_for_mission = { mission=byz_tripolitania }
			#Other bonuses
			if = {
				limit = {
					358 = {
						owned_by = AEG
					}
				}
				358 = {
					add_base_tax = 3
					add_base_production = 3
					add_base_manpower = 1
				}
			}
			else = {
				358 = {
					change_culture = alexandrian
				}
			}
			custom_tooltip = byz_themes_of_egypt_development_tooltip
			hidden_effect = {
				random_owned_province = {
					limit = {
						OR = {
							province_group = byz_lower_egypt_provinces
							province_group = byz_upper_egypt_provinces
							province_group = byz_cyrenaica_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
					set_province_flag = byz_prov_to_dev
				}
				random_owned_province = {
					limit = {
						OR = {
							province_group = byz_lower_egypt_provinces
							province_group = byz_upper_egypt_provinces
							province_group = byz_cyrenaica_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
						NOT = {
							has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
						}
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
					set_province_flag = byz_prov_to_dev
				}
				random_owned_province = { #RandProv 3
					limit = {
						OR = {
							province_group = byz_lower_egypt_provinces
							province_group = byz_upper_egypt_provinces
							province_group = byz_cyrenaica_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
						NOT = {
							has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
						}
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
				}
				every_owned_province = {  #Clearing the flags above.
					if = {
						limit = {
							has_province_flag = byz_prov_to_dev
						}
						clr_province_flag = byz_prov_to_dev 
					}
				}
			}
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
}

byz_africa_1 = {
	slot = 1
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes
	
	byz_tripolitania = { #Tripolitana will be ours!
		icon = mission_conquer_tunisia
		position = 24 #1-24
		required_missions = { byz_themes_of_egypt }
		
		provinces_to_highlight = {
			province_group = byz_tripolitania_provinces
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			has_fulfiled_province_requirement_for_mission_trigger = {
				tooltip=country_holds_or_non_sovereign_subject_holds_highlighted 
				provinces=byz_tripolitania_provinces
				owner_type=country_or_non_sovereign_subject_holds
			}
		}
		
		effect = {
			tripolitania_area = {
				limit = {
					country_or_non_sovereign_subject_holds = ROOT
				}
				add_province_modifier = {
					name = "byz_centenarium"
					duration = -1
				}
			}
			#Claims
			give_permaclaims_for_mission = { mission=byz_africa }
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}

	byz_conquer_numidia = { #Into Numidia!
		icon = mission_control_the_barbary_coast
		position = 26 #1-26
		required_missions = { byz_africa }
		
		provinces_to_highlight = {
			province_group = byz_numidia_provinces
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			has_fulfiled_province_requirement_for_mission_trigger = {
				tooltip=country_holds_or_non_sovereign_subject_holds_highlighted 
				provinces=byz_numidia_provinces
				owner_type=country_or_non_sovereign_subject_holds
			}
		}
		
		effect = {
			340 = { #Constantia
				add_base_tax = 2
				add_base_production = 2
				add_base_manpower = 2
			}
			if = {
				limit = {
					NOT = { MIL = 6 }
				}
				change_mil = 1
			}
			else = {
				add_mil_power = 50
			}
			#Claims
			give_permaclaims_for_mission = { mission=byz_east_mauretania }
			east_maghreb_region = {
				limit = { NOT = { is_permanent_claim = ROOT } }
				add_claim = ROOT
			}
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
	
	byz_east_mauretania = { #East Mauretania shall be ours!
		icon = mission_conquer_algiers
		position = 27 #1-27
		required_missions = { byz_conquer_numidia }
		
		provinces_to_highlight = {
			province_group = byz_east_mauretania_provinces
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			has_fulfiled_province_requirement_for_mission_trigger = {
				tooltip=country_holds_or_non_sovereign_subject_holds_highlighted 
				provinces=byz_east_mauretania_provinces
				owner_type=country_or_non_sovereign_subject_holds
			}
		}
		
		effect = {
			if = {
				limit = {
					NOT = { ADM = 6 }
				}
				change_adm = 1
			}
			else = {
				add_adm_power = 50
			}
			
			#Claims
			give_permaclaims_for_mission = { mission=byz_west_mauretania }
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
	
	byz_west_mauretania = { #Finalize our African conquests!
		icon = mission_moroccan_ports
		position = 28 #1-28
		required_missions = { byz_east_mauretania }
		
		provinces_to_highlight = {
			province_group = byz_west_mauretania_provinces
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			has_fulfiled_province_requirement_for_mission_trigger = {
				tooltip=country_holds_or_non_sovereign_subject_holds_highlighted 
				provinces=byz_west_mauretania_provinces
				owner_type=country_or_non_sovereign_subject_holds
			}
		}
		
		effect = {
			if = {
				limit = {
					NOT = { DIP = 6 }
				}
				change_dip = 1
			}
			else = {
				add_dip_power = 50
			}
			151 = {
				add_base_tax = 1
				add_base_production = 1
				add_base_manpower = 1
			}
			maghreb_region = {
				limit = { NOT = { is_permanent_claim = ROOT } }
				add_claim = ROOT
			}
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
}

byz_themes_4 = {
	slot = 5
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes
	
	byz_south_italian_themes = { #New in BR 8.0
		icon = mission_bari_fortress
		position = 20 #5-20
		required_missions = { byz_sicily }
		
		provinces_to_highlight = {
			OR = {
				province_group = byz_gain_foothold_in_italy_provinces
				province_group = byz_conquer_greater_greece_provinces
				province_group = byz_sicily_provinces
			}
			NOT = {
				estate_generals_is_theme_capital_trigger = yes
			}
		}
		
		trigger = {
			calc_true_if = {
				desc = byz_theme_system_tooltip
				byz_gain_foothold_in_italy_provinces = {
					type = all
					estate_generals_is_theme_capital_trigger = yes
				}
				byz_conquer_greater_greece_provinces = {
					type = all
					estate_generals_is_theme_capital_trigger = yes
				}
				byz_sicily_provinces = {
					type = all
					estate_generals_is_theme_capital_trigger = yes
				}
				amount = 8
			}
		}
		
		effect = {
			custom_tooltip = byz_south_italian_themes_development_tooltip
			hidden_effect = {
				random_owned_province = {
					limit = {
						OR = {
							province_group = byz_gain_foothold_in_italy_provinces
							province_group = byz_conquer_greater_greece_provinces
							province_group = byz_sicily_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
					set_province_flag = byz_prov_to_dev
				}
				random_owned_province = {
					limit = {
						OR = {
							province_group = byz_gain_foothold_in_italy_provinces
							province_group = byz_conquer_greater_greece_provinces
							province_group = byz_sicily_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
						NOT = {
							has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
						}
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
					set_province_flag = byz_prov_to_dev
				}
				random_owned_province = { #RandProv 3
					limit = {
						OR = {
							province_group = byz_gain_foothold_in_italy_provinces
							province_group = byz_conquer_greater_greece_provinces
							province_group = byz_sicily_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
						NOT = {
							has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
						}
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
					set_province_flag = byz_prov_to_dev
				}
				random_owned_province = { #RandProv 4
					limit = {
						OR = {
							province_group = byz_gain_foothold_in_italy_provinces
							province_group = byz_conquer_greater_greece_provinces
							province_group = byz_sicily_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
						NOT = {
							has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
						}
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
				}
				every_owned_province = {  #Clearing the flags above.
					if = {
						limit = {
							has_province_flag = byz_prov_to_dev
						}
						clr_province_flag = byz_prov_to_dev 
					}
				}
			}
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
	
	byz_north_italian_themes = { #New in BR 8.0
		icon = the_italian_league #Placeholder
		position = 22 #5-22
		required_missions = { byz_south_italian_themes byz_lombardy }
		
		provinces_to_highlight = {
			OR = {
				province_group = byz_subjugate_pope_provinces
				province_group = byz_central_italy_provinces
				province_group = byz_lombardy_provinces
				province_group = byz_land_access_to_italy_provinces
			}
			NOT = {
				estate_generals_is_theme_capital_trigger = yes
			}
		}
		
		trigger = {
			calc_true_if = {
				desc = byz_theme_system_tooltip
				byz_subjugate_pope_provinces = {
					type = all
					estate_generals_is_theme_capital_trigger = yes
				}
				byz_central_italy_provinces = {
					type = all
					estate_generals_is_theme_capital_trigger = yes
				}
				byz_lombardy_provinces = {
					type = all
					estate_generals_is_theme_capital_trigger = yes
				}
				byz_land_access_to_italy_provinces = {
					type = all
					estate_generals_is_theme_capital_trigger = yes
				}
				amount = 16
			}
		}
		
		effect = {
			custom_tooltip = byz_north_italian_themes_development_tooltip
			hidden_effect = {
				random_owned_province = { #RandProv 1
					limit = {
						OR = {
							province_group = byz_subjugate_pope_provinces
							province_group = byz_central_italy_provinces
							province_group = byz_lombardy_provinces
							province_group = byz_land_access_to_italy_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
					set_province_flag = byz_prov_to_dev
				}
				random_owned_province = { #RandProv 2
					limit = {
						OR = {
							province_group = byz_subjugate_pope_provinces
							province_group = byz_central_italy_provinces
							province_group = byz_lombardy_provinces
							province_group = byz_land_access_to_italy_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
						NOT = {
							has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
						}
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
					set_province_flag = byz_prov_to_dev
				}
				random_owned_province = { #RandProv 3
					limit = {
						OR = {
							province_group = byz_subjugate_pope_provinces
							province_group = byz_central_italy_provinces
							province_group = byz_lombardy_provinces
							province_group = byz_land_access_to_italy_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
						NOT = {
							has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
						}
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
					set_province_flag = byz_prov_to_dev
				}
				random_owned_province = { #RandProv 4
					limit = {
						OR = {
							province_group = byz_subjugate_pope_provinces
							province_group = byz_central_italy_provinces
							province_group = byz_lombardy_provinces
							province_group = byz_land_access_to_italy_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
						NOT = {
							has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
						}
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
					set_province_flag = byz_prov_to_dev
				}
				random_owned_province = { #RandProv 5
					limit = {
						OR = {
							province_group = byz_subjugate_pope_provinces
							province_group = byz_central_italy_provinces
							province_group = byz_lombardy_provinces
							province_group = byz_land_access_to_italy_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
						NOT = {
							has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
						}
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
					set_province_flag = byz_prov_to_dev
				}
				random_owned_province = { #RandProv 6
					limit = {
						OR = {
							province_group = byz_subjugate_pope_provinces
							province_group = byz_central_italy_provinces
							province_group = byz_lombardy_provinces
							province_group = byz_land_access_to_italy_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
						NOT = {
							has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
						}
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
					set_province_flag = byz_prov_to_dev
				}
				random_owned_province = { #RandProv 7
					limit = {
						OR = {
							province_group = byz_subjugate_pope_provinces
							province_group = byz_central_italy_provinces
							province_group = byz_lombardy_provinces
							province_group = byz_land_access_to_italy_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
						NOT = {
							has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
						}
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
					set_province_flag = byz_prov_to_dev
				}
				random_owned_province = { #RandProv 8
					limit = {
						OR = {
							province_group = byz_subjugate_pope_provinces
							province_group = byz_central_italy_provinces
							province_group = byz_lombardy_provinces
							province_group = byz_land_access_to_italy_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
						NOT = {
							has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
						}
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
				}
				every_owned_province = {  #Clearing the flags above.
					if = {
						limit = {
							has_province_flag = byz_prov_to_dev
						}
						clr_province_flag = byz_prov_to_dev 
					}
				}
			}
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
		
	}
}

byz_unite_orthodox_2 = {
	slot = 2
	generic = no
	ai = yes
	potential = {
		tag = BYZ
		religion = orthodox
	}
	has_country_shield = yes
	
	byz_east_oriental_schism = { #Copied over from Pentarchy, adjusted to become 
		icon = mission_etchmiadzin
		position = 23 #2-23
		required_missions = {}
		provinces_to_highlight = {
			province_group = byz_east_oriental_schism_provinces
			OR = {
				NOT = { religion = ROOT }
				NOT = { owned_by = ROOT }
			}
		}
		trigger = {
			religion = orthodox
			has_fulfiled_province_requirement_for_mission_trigger = {
				tooltip=country_holds_or_non_sovereign_subject_holds_highlighted 
				provinces=byz_east_oriental_schism_provinces
				owner_type=country_or_non_sovereign_subject_holds
			}
			has_fulfiled_province_requirement_for_mission_trigger = {
				tooltip=highlighted_provinces_converted_to_religion 
				provinces=byz_east_oriental_schism_provinces
				owner_type=religion
			}
		}
		effect = {
			hidden_effect = {
				if = {
					limit = {
						151 = {
							NOT = { has_province_modifier = orthodox_religious_center }
						}
					}
					151 = { 
						add_province_triggered_modifier = orthodox_religious_center
					}
				}
				if = {
					limit = {
						419 = {
							NOT = { has_province_modifier = orthodox_religious_center }
						}
					}
					419 = { 
						add_province_triggered_modifier = orthodox_religious_center
					}
				}
				if = {
					limit = {
						5154 = {
							NOT = { has_province_modifier = orthodox_religious_center }
						}
					}
					5154 = { 
						add_province_triggered_modifier = orthodox_religious_center
					}
				}
				if = {
					limit = {
						2313 = {
							NOT = { has_province_modifier = orthodox_religious_center }
						}
					}
					2313 = { 
						add_province_triggered_modifier = orthodox_religious_center
					}
				}
				if = {
					limit = {
						379 = {
							NOT = { has_province_modifier = orthodox_religious_center }
						}
					}
					379 = { 
						add_province_triggered_modifier = orthodox_religious_center
					}
				}
				if = {
					limit = {
						358 = {
							NOT = { has_province_modifier = orthodox_religious_center }
						}
					}
					358 = { 
						add_province_triggered_modifier = orthodox_religious_center
					}
				}
			}
			add_prestige_or_monarch_power = { amount = 20 }
			if = {
				limit = {
					NOT = {
						has_global_flag = east_oriental_schism_healed
					}
				}
				country_event = { id = resurgent_BYZ.1 }
				set_global_flag = east_oriental_schism_healed
			}
			
			#Claims
			give_permaclaims_for_mission = { mission=byz_mecca_medina }
		}
		
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
}

byz_religious_4 = {
	slot = 2
	generic = no
	ai = yes
	potential = {
		tag = BYZ
		religion_group = christian
	}
	has_country_shield = yes
	
	byz_mecca_medina = { #Take the Holy Cities of Islam!
		icon = mission_into_arabia
		position = 24 #3-24
		required_missions = { byz_east_oriental_schism }
		
		provinces_to_highlight = {
			province_group = byz_mecca_medina_provinces
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			has_fulfiled_province_requirement_for_mission_trigger = {
				tooltip=country_holds_or_non_sovereign_subject_holds_highlighted 
				provinces=byz_mecca_medina_provinces
				owner_type=country_or_non_sovereign_subject_holds
			}
		}
		
		effect = {			
			#Misc
			add_prestige_or_monarch_power = { amount = 20 }
			add_patriarch_authority = 0.1
		}
	
		ai_weight = {
			factor = 0	#AI nogo!
		}
	}
}

byz_africa_2 = {
	slot = 2
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes
	
	byz_africa = { #Take Karchidon!
		icon = africa_proconsulare
		position = 25 #2-25
		required_missions = { byz_tripolitania }
		
		provinces_to_highlight = {
			province_group = byz_africa_provinces
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			has_fulfiled_province_requirement_for_mission_trigger = {
				tooltip=country_holds_or_non_sovereign_subject_holds_highlighted 
				provinces=byz_africa_provinces
				owner_type=country_or_non_sovereign_subject_holds
			}
		}
		
		effect = {
			341 = {
				add_great_project = {
					type = great_harbor_of_carthage
					instant = yes
				}
			}
			#Claims
			give_permaclaims_for_mission = { mission=byz_sardinia_corsica }
			give_permaclaims_for_mission = { mission=byz_numidia }
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
	
	byz_sardinia_corsica = { #Sardinia & Corsica
		icon = seize_sardinia
		position = 26 #2-26
		required_missions = { byz_africa }
		
		provinces_to_highlight = {
			province_group = byz_sardinia_corsica_provinces
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			has_fulfiled_province_requirement_for_mission_trigger = {
				tooltip=country_holds_or_non_sovereign_subject_holds_highlighted 
				provinces=byz_sardinia_corsica_provinces
				owner_type=country_or_non_sovereign_subject_holds
			}
		}
		
		effect = {
			#Effect is based off of the idea that Byzantine Sardinia remained quite content under the Byzantine Empire post-Justinian.
			corsica_sardinia_area = {
				add_nationalism = -10
			}
			sardinia_area = {
				add_nationalism = -10
			}
			2986 = { add_building = road_network }
			#Claims
			give_permaclaims_for_mission = { mission=byz_baleares }
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
}

byz_themes_6 = {
	slot = 1
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes
	
	byz_roman_african_themes = { #New in BR 8.0
		icon = mission_ounga_fort
		position = 29 #1-29
		required_missions = { byz_west_mauretania }
		
		provinces_to_highlight = {
			OR = {
				province_group = byz_tripolitania_provinces
				province_group = byz_africa_provinces
				province_group = byz_sardinia_corsica_provinces
				province_group = byz_numidia_provinces
				province_group = byz_east_mauretania_provinces
				province_group = byz_west_mauretania_provinces
			}
			NOT = {
				estate_generals_is_theme_capital_trigger = yes
			}
		}
		
		trigger = {
			calc_true_if = {
				desc = byz_theme_system_tooltip
				byz_tripolitania_provinces = {
					type = all
					estate_generals_is_theme_capital_trigger = yes
				}
				byz_africa_provinces = {
					type = all
					estate_generals_is_theme_capital_trigger = yes
				}
				byz_sardinia_corsica_provinces = {
					type = all
					estate_generals_is_theme_capital_trigger = yes
				}
				byz_numidia_provinces = {
					type = all
					estate_generals_is_theme_capital_trigger = yes
				}
				byz_east_mauretania_provinces = {
					type = all
					estate_generals_is_theme_capital_trigger = yes
				}
				byz_west_mauretania_provinces = {
					type = all
					estate_generals_is_theme_capital_trigger = yes
				}
				amount = 8
			}
		}
		
		effect = {
			if = {
				limit = {
					341 = {
						owned_by = KCD
					}
				}
				341 = {
					add_base_tax = 3
					add_base_production = 3
					add_base_manpower = 1
				}
			}
			else = {
				341 = {
					change_culture = karchidoniac
				}
			}
			custom_tooltip = byz_roman_african_themes_development_tooltip
			hidden_effect = {
				random_owned_province = { #RandProv 1
					limit = {
						OR = {
							province_group = byz_tripolitania_provinces
							province_group = byz_africa_provinces
							province_group = byz_sardinia_corsica_provinces
							province_group = byz_numidia_provinces
							province_group = byz_east_mauretania_provinces
							province_group = byz_west_mauretania_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
					set_province_flag = byz_prov_to_dev
				}
				random_owned_province = { #RandProv 2
					limit = {
						OR = {
							province_group = byz_tripolitania_provinces
							province_group = byz_africa_provinces
							province_group = byz_sardinia_corsica_provinces
							province_group = byz_numidia_provinces
							province_group = byz_east_mauretania_provinces
							province_group = byz_west_mauretania_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
						NOT = {
							has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
						}
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
					set_province_flag = byz_prov_to_dev
				}
				random_owned_province = { #RandProv 3
					limit = {
						OR = {
							province_group = byz_tripolitania_provinces
							province_group = byz_africa_provinces
							province_group = byz_sardinia_corsica_provinces
							province_group = byz_numidia_provinces
							province_group = byz_east_mauretania_provinces
							province_group = byz_west_mauretania_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
						NOT = {
							has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
						}
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
					set_province_flag = byz_prov_to_dev
				}
				random_owned_province = { #RandProv 4
					limit = {
						OR = {
							province_group = byz_tripolitania_provinces
							province_group = byz_africa_provinces
							province_group = byz_sardinia_corsica_provinces
							province_group = byz_numidia_provinces
							province_group = byz_east_mauretania_provinces
							province_group = byz_west_mauretania_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
						NOT = {
							has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
						}
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
				}
				every_owned_province = {  #Clearing the flags above.
					if = {
						limit = {
							has_province_flag = byz_prov_to_dev
						}
						clr_province_flag = byz_prov_to_dev 
					}
				}
			}
			#Claims
			give_permaclaims_for_mission = { mission=byz_baetica }
		}
		
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
}

byz_unite_orthodox_1 = {
	slot = 4
	generic = no
	ai = yes
	potential = {
		tag = BYZ
		religion = orthodox
	}
	has_country_shield = yes
	
	the_pentarchy = { #From vanilla Byzantine Missions, but modified slightly to require them being your religion as well.
		icon = new_st_peters_basilica
		position = 23 #4-23
		required_missions = {}
		
		provinces_to_highlight = {
			province_group = the_pentarchy_provinces
			OR = {
				NOT = { religion = ROOT }
				NOT = { owned_by = ROOT }
			}
		}
		trigger = {
			religion = orthodox
			has_fulfiled_province_requirement_for_mission_trigger = {
				tooltip=country_holds_or_non_sovereign_subject_holds_highlighted 
				provinces=the_pentarchy_provinces
				owner_type=country_or_non_sovereign_subject_holds
			}
			has_fulfiled_province_requirement_for_mission_trigger = {
				tooltip=highlighted_provinces_converted_to_religion 
				provinces=the_pentarchy_provinces
				owner_type=religion
			}
		}
		effect = {
			if = {
				limit = {
					has_reform = ecumenical_patriarch_of_constantinople_reform
				}
				add_government_reform = pentarchy_reform
			}
			else = {
				add_prestige_or_monarch_power = { amount = 50 }
			}
			# add_country_modifier = { #Adjusted modifier to only include heretic missionary strength.
				# name = "byz_pentarchy"
				# duration = -1
			# }
			hidden_effect = {
				if = {
					limit = {
						118 = {
							NOT = { has_province_modifier = orthodox_religious_center }
						}
					}
					118 = { 
						add_province_triggered_modifier = orthodox_religious_center
					}
				}
				if = {
					limit = {
						151 = {
							NOT = { has_province_modifier = orthodox_religious_center }
						}
					}
					151 = { 
						add_province_triggered_modifier = orthodox_religious_center
					}
				}
				if = {
					limit = {
						2313 = {
							NOT = { has_province_modifier = orthodox_religious_center }
						}
					}
					2313 = { 
						add_province_triggered_modifier = orthodox_religious_center
					}
				}
				if = {
					limit = {
						379 = {
							NOT = { has_province_modifier = orthodox_religious_center }
						}
					}
					379 = { 
						add_province_triggered_modifier = orthodox_religious_center
					}
				}
				if = {
					limit = {
						358 = {
							NOT = { has_province_modifier = orthodox_religious_center }
						}
					}
					358 = {
						add_province_triggered_modifier = orthodox_religious_center
					}
				}
			}
			if = {
				limit = {
					NOT = {
						has_global_flag = east_west_schism_healed
					}
				}
				country_event = { id = catholic_flavor.3 }
				set_global_flag = east_west_schism_healed
			}
			#Russian PU CB
			if = { #Russia
				limit = {
					exists = RUS
					valid_for_personal_unions_trigger = yes
					RUS = {
						valid_for_personal_unions_trigger = yes
					}
				}
				add_casus_belli = {
					type = cb_restore_personal_union
					months = 300
					target = RUS
				}
			}
			else_if = { #Oh no. Let's try Muscovy
				limit = {
					exists = MOS
					valid_for_personal_unions_trigger = yes
					MOS = {
						valid_for_personal_unions_trigger = yes
					}
				}
				add_casus_belli = {
					type = cb_restore_personal_union
					months = 300
					target = MOS
				}
			}
			else_if = { #Oh bloody hell. What's happened in Russia? Let's just PU the owner of Moscow.
				limit = {
					valid_for_personal_unions_trigger = yes
					295 = {
						owner = {
							valid_for_personal_unions_trigger = yes
						}
					}
				}
				295 = {
					owner = {
						ROOT = {
							add_casus_belli = {
								type = cb_restore_personal_union
								months = 300
								target = PREV
							}
						}
					}
				}
			}
			else = { #If you got to this point in your game, what the heck has happened?! Though I suppose, a Russian republic, or Russia already being PU'd, is possible for this to happen.
				295 = {
					add_permanent_claim = ROOT
				}
			}
		}
		
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
	
	byz_unite_orthodox_churches = { #Unite Orthodoxy
		icon = mission_the_third_rome
		position = 24 #4-24
		required_missions = { the_pentarchy }
		
		provinces_to_highlight = {
			OR = {
				province_id = 295 #Moskva
				province_id = 151 #Constantinople
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			religion = orthodox
			owns = 151 #Constantinople
			owns_or_non_sovereign_subject_of = 295
		}
		effect = {
			if = {
				limit = {
					has_reform = pentarchy_reform
				}
				add_government_reform = united_orthodoxy_reform
			}
			else = {
				add_prestige_or_monarch_power = { amount = 75 }
			}
			# add_country_modifier = {
				# name = "byz_united_orthodox"
				# duration = -1
			# }
			add_patriarch_authority = 0.2
		}
		
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
}

byz_religious_3 = {
	slot = 5
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes
	
	byz_convert_italy = { #New in BR 8.0
		icon = promote_the_patriarchate
		position = 24 #5-24
		required_missions = { byz_north_italian_themes }
		
		provinces_to_highlight = {
			OR = {
				province_group = byz_gain_foothold_in_italy_provinces
				province_group = byz_conquer_greater_greece_provinces
				province_group = byz_sicily_provinces
				province_group = byz_subjugate_pope_provinces
				province_group = byz_central_italy_provinces
				province_group = byz_lombardy_provinces
				province_group = byz_land_access_to_italy_provinces
			}
			OR = {
				NOT = { country_or_non_sovereign_subject_holds = ROOT }
				AND = {
					country_or_non_sovereign_subject_holds = ROOT
					NOT = { religion = ROOT }
				}
			}
		}
		
		trigger = {
			custom_trigger_tooltip = {
				tooltip = byz_convert_italy_tooltip
				byz_gain_foothold_in_italy_provinces = {
					type = all
					religion = ROOT
					country_or_non_sovereign_subject_holds = ROOT
				}
				byz_conquer_greater_greece_provinces = {
					type = all
					religion = ROOT
					country_or_non_sovereign_subject_holds = ROOT
				}
				byz_sicily_provinces = {
					type = all
					religion = ROOT
					country_or_non_sovereign_subject_holds = ROOT
				}
				byz_subjugate_pope_provinces = {
					type = all
					religion = ROOT
					country_or_non_sovereign_subject_holds = ROOT
				}
				byz_central_italy_provinces = {
					type = all
					religion = ROOT
					country_or_non_sovereign_subject_holds = ROOT
				}
				byz_lombardy_provinces = {
					type = all
					religion = ROOT
					country_or_non_sovereign_subject_holds = ROOT
				}
				byz_land_access_to_italy_provinces = {
					type = all
					religion = ROOT
					country_or_non_sovereign_subject_holds = ROOT
				}
			}
		}
		
		effect = {
			if = {
				limit = {
					religion = orthodox
				}
				add_country_modifier = {
					name = "growth_of_the_orthodox_church"
					duration = 7300
				}
				add_estate_loyalty = {
					estate = estate_church
					loyalty = 10
				}
			}
			increase_religious_currency_effect = yes
		}
	}
}

byz_italy_5 = {
	slot = 4
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes
	
	byz_italian_restoration = { #New in BR 8.0
		icon = mission_roman_laurel_wreath
		position = 25 #4-25
		required_missions = { byz_convert_italy }
		
		provinces_to_highlight = {
			OR = {
				province_group = byz_gain_foothold_in_italy_provinces
				province_group = byz_conquer_greater_greece_provinces
				province_group = byz_sicily_provinces
				province_group = byz_subjugate_pope_provinces
				province_group = byz_central_italy_provinces
				province_group = byz_lombardy_provinces
				province_group = byz_land_access_to_italy_provinces
				province_id = 112
			}
		}
		
		trigger = {
			development_in_provinces = { #This is 2130 dev at game start. Given that it'll develop as the game goes on, 3000 feels fair.
				value = 3000
				custom_trigger_tooltip = {
					tooltip = byz_development_in_provinces_mission_tooltip
					OR = {
						province_group = byz_gain_foothold_in_italy_provinces
						province_group = byz_conquer_greater_greece_provinces
						province_group = byz_sicily_provinces
						province_group = byz_subjugate_pope_provinces
						province_group = byz_central_italy_provinces
						province_group = byz_lombardy_provinces
						province_group = byz_land_access_to_italy_provinces
						province_id = 112
					}
				}
			}
		}
		
		effect = {
			custom_tooltip = byz_italian_restoration_effect_tooltip
			hidden_effect = {
				change_culture_group_effect = { old_culture=lombard new_culture=roman }
				change_culture_group_effect = { old_culture=tuscan new_culture=roman }
				change_culture_group_effect = { old_culture=sardinian new_culture=roman }
				change_culture_group_effect = { old_culture=romagnan new_culture=roman }
				change_culture_group_effect = { old_culture=ligurian new_culture=roman }
				change_culture_group_effect = { old_culture=venetian new_culture=roman }
				change_culture_group_effect = { old_culture=dalmatian new_culture=roman }
				change_culture_group_effect = { old_culture=neapolitan new_culture=roman }
				change_culture_group_effect = { old_culture=piedmontese new_culture=roman }
				change_culture_group_effect = { old_culture=sicilian new_culture=roman }
				change_culture_group_effect = { old_culture=umbrian new_culture=roman }
				change_culture_group_effect = { old_culture=maltese new_culture=roman }
				change_culture_group_effect = { old_culture=romanch_culture new_culture=roman }
				change_culture_group_effect = { old_culture=corsican_culture new_culture=roman }
				change_culture_group_effect = { old_culture=friulian_culture new_culture=roman }
				change_culture_group_effect = { old_culture=ladin_culture new_culture=roman }
				change_culture_group_effect = { old_culture=istriot_culture new_culture=roman }
			}
		}
	}
}

byz_italy_4 = {
	slot = 5
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes
	
	byz_italian_reintegration = { #New in BR 8.0
		icon = emperor_and_autocrat
		position = 25 #4-25
		required_missions = { byz_convert_italy }
		
		provinces_to_highlight = {
			OR = {
				province_group = byz_gain_foothold_in_italy_provinces
				province_group = byz_conquer_greater_greece_provinces
				province_group = byz_sicily_provinces
				province_group = byz_subjugate_pope_provinces
				province_group = byz_central_italy_provinces
				province_group = byz_lombardy_provinces
				province_group = byz_land_access_to_italy_provinces
				province_id = 112
			}
			OR = {
				NOT = { country_or_non_sovereign_subject_holds = ROOT }
				AND = {
					country_or_non_sovereign_subject_holds = ROOT
					OR = {
						nationalism = 1
						NOT = { has_owner_accepted_culture = yes }
					}
				}
			}
		}
		
		trigger = {
			custom_trigger_tooltip = {
				tooltip = byz_italian_reintegration_tooltip
				byz_gain_foothold_in_italy_provinces = {
					type = all
					NOT = { nationalism = 1 }
					has_owner_accepted_culture = yes
				}
				byz_conquer_greater_greece_provinces = {
					type = all
					NOT = { nationalism = 1 }
					has_owner_accepted_culture = yes
				}
				byz_sicily_provinces = {
					type = all
					NOT = { nationalism = 1 }
					has_owner_accepted_culture = yes
				}
				byz_subjugate_pope_provinces = {
					type = all
					NOT = { nationalism = 1 }
					has_owner_accepted_culture = yes
				}
				byz_central_italy_provinces = {
					type = all
					NOT = { nationalism = 1 }
					has_owner_accepted_culture = yes
				}
				byz_lombardy_provinces = {
					type = all
					NOT = { nationalism = 1 }
					has_owner_accepted_culture = yes
				}
				byz_land_access_to_italy_provinces = {
					type = all
					NOT = { nationalism = 1 }
					has_owner_accepted_culture = yes
				}
				112 = {
					NOT = { nationalism = 1 }
					has_owner_accepted_culture = yes
				}
			}
		}
		
		effect = {
			add_country_modifier = {
				name = "byz_italy_restored"
				duration = -1
			}
		}
	}

	byz_roman_italy = { #New in BR 8.0
		icon = mission_roman_italy
		position = 26 #4-25
		required_missions = { byz_italian_reintegration byz_italian_restoration }
		
		provinces_to_highlight = {
			OR = {
				province_group = byz_gain_foothold_in_italy_provinces
				province_group = byz_conquer_greater_greece_provinces
				province_group = byz_sicily_provinces
				province_group = byz_subjugate_pope_provinces
				province_group = byz_central_italy_provinces
				province_group = byz_lombardy_provinces
				province_group = byz_land_access_to_italy_provinces
				province_id = 112
			}
			OR = {
				NOT = { country_or_non_sovereign_subject_holds = ROOT }
				AND = {
					country_or_non_sovereign_subject_holds = ROOT
					NOT = { is_state = yes }
					NOT = { is_state_core = ROOT }
				}
			}
		}
		
		trigger = {
			custom_trigger_tooltip = {
				tooltip = byz_roman_italy_tooltip
				NOT = {
					byz_gain_foothold_in_italy_provinces = {
						NOT = { is_state = yes }
						NOT = { is_state_core = ROOT }
					}
					byz_conquer_greater_greece_provinces = {
						NOT = { is_state = yes }
						NOT = { is_state_core = ROOT }
					}
					byz_sicily_provinces = {
						NOT = { is_state = yes }
						NOT = { is_state_core = ROOT }
					}
					byz_subjugate_pope_provinces = {
						NOT = { is_state = yes }
						NOT = { is_state_core = ROOT }
					}
					byz_central_italy_provinces = {
						NOT = { is_state = yes }
						NOT = { is_state_core = ROOT }
					}
					byz_lombardy_provinces = {
						NOT = { is_state = yes }
						NOT = { is_state_core = ROOT }
					}
					byz_land_access_to_italy_provinces = {
						NOT = { is_state = yes }
						NOT = { is_state_core = ROOT }
					}
					112 = {
						NOT = { is_state = yes }
						NOT = { is_state_core = ROOT }
					}
				}
			}
		}
		
		effect = {
			change_government_reform_progress = 100
			add_prestige_or_monarch_power = { amount = 50 }
			151 = {
				add_base_tax = 3
				add_base_production = 3
				add_base_manpower = 2
			}
			change_adm = 1
			change_dip = 1
			change_mil = 1
			if = {
				limit = {
					has_heir = yes
				}
				change_heir_adm = 1
				change_heir_dip = 1
				change_heir_mil = 1
			}
		}
	}
}

byz_exarch_1 = {
	slot = 4
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes
	
	byz_establish_exarches = {
		icon = mission_mare_nostrum
		position = 27 #4-27
		required_missions = { }
		
		provinces_to_highlight = {
			#None
		}
		
		trigger = {
			has_reform = exarch_system_reform
			is_subject = no
		}
		
		effect = {
			add_prestige_or_monarch_power = { amount = 20 }
			
			#Claims
			# give_permaclaims_for_mission = { mission=byz_numidia }
			# give_permaclaims_for_mission = { mission=byz_baleares }
			# give_permaclaims_for_mission = { mission=byz_pannonia }
			# give_permaclaims_for_mission = { mission=byz_conquer_media }
			
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
	
	byz_exarchate_of_africa = { #New in BR 8.0
		icon = mission_african_exarch
		position = 28 #4-28
		required_missions = { byz_establish_exarches }
		
		provinces_to_highlight = {
			province_id = 341
		}
		
		trigger = {
			OR = {
				KCD = {
					exists = yes
					is_subject_of_type = byz_exarch
					is_subject_of = ROOT
					total_development = 600
				}
				341 = {
					development = 50
					is_state = yes
					is_state_core = ROOT
					if = {
						limit = {
							has_dlc = "Leviathan"
						}
						num_of_times_expanded_infrastructure = 1 
					}
					else = {
						num_of_buildings_in_province = 5
					}
				}
			}
		}
		
		effect = {
			custom_tooltip = byz_exarchate_of_africa_1
			tooltip = {
				KCD = {
					add_liberty_desire = -50
					add_country_modifier = {
						name = "byz_exarchate"
						duration = -1
					}
				}
			}
			custom_tooltip = byz_exarchate_of_africa_2
			tooltip = {
				341 = {
					custom_tooltip = byz_establish_exarch_seat_tooltip
				}
			}
			hidden_effect = {
				if = {
					limit = {
						KCD = {
							exists = yes
							is_subject_of_type = byz_exarch
							is_subject_of = ROOT
							total_development = 600
						}
					}
					KCD = {
						add_liberty_desire = -50
						add_country_modifier = {
							name = "byz_exarchate"
							duration = -1
						}
					}
				}
				341 = {
					add_province_triggered_modifier = exarch_seat_modifier_med_dev
					add_province_triggered_modifier = exarch_seat_modifier_high_dev
					add_province_triggered_modifier = exarch_seat_modifier_very_high_dev
				}
			}
			
			
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
		
	}
}

byz_exarch_2 = {
	slot = 3
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes
	
	byz_egyptian_exarch = { #New in BR 8.0
		icon = mission_exarch_of_egypt
		position = 28 #3-28
		required_missions = { byz_establish_exarches }
		
		provinces_to_highlight = {
			province_id = 358
		}
		
		trigger = {
			OR = {
				AEG = {
					exists = yes
					is_subject_of_type = byz_exarch
					is_subject_of = ROOT
					total_development = 600
				}
				358 = {
					development = 50
					is_state = yes
					is_state_core = ROOT
					if = {
						limit = {
							has_dlc = "Leviathan"
						}
						num_of_times_expanded_infrastructure = 1 
					}
					else = {
						num_of_buildings_in_province = 5
					}
				}
			}
		}
		
		effect = {
			custom_tooltip = byz_egyptian_exarch_1
			tooltip = {
				AEG = {
					add_liberty_desire = -50
					add_country_modifier = {
						name = "byz_exarchate"
						duration = -1
					}
				}
			}
			custom_tooltip = byz_egyptian_exarch_2
			tooltip = {
				358 = {
					custom_tooltip = byz_establish_exarch_seat_tooltip
				}
			}
			hidden_effect = {
				if = {
					limit = {
						AEG = {
							exists = yes
							is_subject_of_type = byz_exarch
							is_subject_of = ROOT
							total_development = 600
						}
					}
					AEG = {
						add_liberty_desire = -50
						add_country_modifier = {
							name = "byz_exarchate"
							duration = -1
						}
					}
				}
				else = {
					358 = {
						add_province_triggered_modifier = exarch_seat_modifier_med_dev
						add_province_triggered_modifier = exarch_seat_modifier_high_dev
						add_province_triggered_modifier = exarch_seat_modifier_very_high_dev
					}
				}
			}
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
}

byz_exarch_3 = {
	slot = 5
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes
	
	byz_exarch_ravenna = { #New in BR 8.0
		icon = mission_italian_exarch
		position = 28 #5-28
		required_missions = { byz_establish_exarches }
		
		provinces_to_highlight = {
			province_id = 114
		}
		
		trigger = {
			OR = {
				RVN = {
					exists = yes
					is_subject_of_type = byz_exarch
					is_subject_of = ROOT
					total_development = 600
				}
				114 = {
					development = 50
					is_state = yes
					is_state_core = ROOT
					if = {
						limit = {
							has_dlc = "Leviathan"
						}
						num_of_times_expanded_infrastructure = 1 
					}
					else = {
						num_of_buildings_in_province = 5
					}
				}
			}
		}
		
		effect = {
			custom_tooltip = byz_exarch_ravenna_1
			tooltip = {
				RVN = {
					add_liberty_desire = -50
					add_country_modifier = {
						name = "byz_exarchate"
						duration = -1
					}
				}
			}
			custom_tooltip = byz_exarch_ravenna_2
			114 = {
				custom_tooltip = byz_establish_exarch_seat_tooltip
			}
			hidden_effect = {
				if = {
					limit = {
						RVN = {
							exists = yes
							is_subject_of_type = byz_exarch
							is_subject_of = ROOT
							total_development = 600
						}
					}
					RVN = {
						add_liberty_desire = -50
						add_country_modifier = {
							name = "byz_exarchate"
							duration = -1
						}
					}
				}
				else = {
					114 = {
						add_province_triggered_modifier = exarch_seat_modifier_med_dev
						add_province_triggered_modifier = exarch_seat_modifier_high_dev
						add_province_triggered_modifier = exarch_seat_modifier_very_high_dev
					}
				}
			}
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
}

byz_estates_1 = {
	slot = 4
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes
	
	byz_emperor_of_romans = { #New in BR 8.0
		icon = balance_the_estates
		position = 29 #4-29
		required_missions = { }
		
		provinces_to_highlight = {
			#None
		}
		
		trigger = {
			absolutism = 50
			crown_land_share = 80
			NOT = {
				estate_influence = {
					estate = all
					influence = 40
				}
			}
		}
		
		effect = {
			add_country_modifier = {
				name = byz_emperor_and_autocrat_of_the_romans
				duration = -1
			}
			custom_tooltip = byz_emperor_of_romans_tooltip
			set_country_flag = byz_generals_no_absolutism_privilege_cost
			set_country_flag = no_absolutism_loss_for_parliament_seat_reward
		}
	}
}

byz_iberia_1 = {
	slot = 2
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes
	
	byz_baleares = {
		icon = mission_rb_mediterranean_authority
		position = 28 #2-28
		required_missions = { byz_sardinia_corsica }
		
		provinces_to_highlight = {
			province_group = byz_baleares_provinces
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			has_fulfiled_province_requirement_for_mission_trigger = {
				tooltip=country_holds_or_non_sovereign_subject_holds_highlighted 
				provinces=byz_baleares_provinces
				owner_type=country_or_non_sovereign_subject_holds
			}
		}
		
		effect = {
			333 = { #Red Ochre
				change_trade_goods = dyes
			}
			328 = { #Sinope, the namesake of the red ochre, Sinopia.
				change_trade_goods = dyes
			}
			#Claims
			give_permaclaims_for_mission = { mission=byz_tarraconia }
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}

	byz_tarraconia = {
		icon = mission_tarragona_aqueduct
		position = 30 #2-30
		required_missions = { byz_baleares }
		
		provinces_to_highlight = {
			province_group = byz_tarraconia_provinces
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			has_fulfiled_province_requirement_for_mission_trigger = {
				tooltip=country_holds_or_non_sovereign_subject_holds_highlighted 
				provinces=byz_tarraconia_provinces
				owner_type=country_or_non_sovereign_subject_holds
			}
		}
		
		effect = {
			#The four Colonia of Tarraconensis. Technically there's a 5th, but it isn't represented in EU4 because the thing has like 200 inhabitants today.
			213 = { #Barcino
				add_base_tax = 2
				add_base_production = 2
				add_base_manpower = 1
			}
			2988 = { #Tarracona
				add_base_tax = 2
				add_base_production = 2
				add_base_manpower = 1
			}
			8114 = { #Emporiae
				add_base_tax = 2
				add_base_production = 2
				add_base_manpower = 1
			}
			214 = { #Caesar Augusta
				add_base_tax = 2
				add_base_production = 2
				add_base_manpower = 1				
			}
			#Claims
			give_permaclaims_for_mission = { mission=byz_narbonia }
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
}

byz_iberia_2 = {
	slot = 1
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes
	
	byz_baetica = { #Into Baetica!
		icon = mission_retake_ceuta
		position = 30 #1-30	
		required_missions = { byz_roman_african_themes }
		
		provinces_to_highlight = {
			province_group = byz_baetica_provinces
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			has_fulfiled_province_requirement_for_mission_trigger = {
				tooltip=country_holds_or_non_sovereign_subject_holds_highlighted 
				provinces=byz_baetica_provinces
				owner_type=country_or_non_sovereign_subject_holds
			}
		}
		
		effect = {
			add_prestige_or_monarch_power = { amount = 25 }
			225 = {
				add_base_tax = 2
				add_base_production = 2
				add_base_manpower = 1
			}
			#Claims
			give_permaclaims_for_mission = { mission=byz_lusitania }
			give_permaclaims_for_mission = { mission=byz_karchidonia }
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
	
	byz_lusitania = { #Take Lusitania!
		icon = mission_portuguese_interference
		position = 31 #1-31
		required_missions = { byz_baetica }
		
		provinces_to_highlight = {
			province_group = byz_lusitania_provinces
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			has_fulfiled_province_requirement_for_mission_trigger = {
				tooltip=country_holds_or_non_sovereign_subject_holds_highlighted 
				provinces=byz_lusitania_provinces
				owner_type=country_or_non_sovereign_subject_holds
			}
		}
		
		effect = {	
			3099 = {
				add_base_tax = 4
				add_base_production = 4
				add_base_manpower = 3
				add_or_spawn_center_of_trade = { level = 1 }
			}
			#Claims
			give_permaclaims_for_mission = { mission=byz_galicia }
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
}

byz_iberia_3 = {
	slot = 2
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes
	
	byz_karchidonia = { #The New Karchidon
		icon = mission_cartagena_theatre
		position = 31 #2-31
		required_missions = { byz_baetica }
		
		provinces_to_highlight = {
			province_group = byz_karchidonia_provinces
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			has_fulfiled_province_requirement_for_mission_trigger = {
				tooltip=country_holds_or_non_sovereign_subject_holds_highlighted 
				provinces=byz_karchidonia_provinces
				owner_type=country_or_non_sovereign_subject_holds
			}
		}
		
		effect = {
			8067 = {
				add_base_tax = 4
				add_base_production = 4
				add_base_manpower = 3
				add_or_spawn_center_of_trade = { level = 1 }
			}
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}

	byz_galicia = { #Finalize Iberian Conquests with Galicia!
		icon = mission_hercules_tower
		position = 32 #2-32
		required_missions = { byz_lusitania byz_karchidonia }
		
		provinces_to_highlight = {
			province_group = byz_galicia_provinces
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			has_fulfiled_province_requirement_for_mission_trigger = {
				tooltip=country_holds_or_non_sovereign_subject_holds_highlighted 
				provinces=byz_galicia_provinces
				owner_type=country_or_non_sovereign_subject_holds
			}
		}
		
		effect = {	
			add_prestige_or_monarch_power = { amount = 50 }
			iberia_region = {
				add_province_modifier = {
					name = "byz_roman_iberia"
					duration = -1
				}
			}
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
}

byz_themes_8 = {
	slot = 1
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes
	
	byz_themes_of_hesperia = { #New in BR 8.0
		icon = mission_lugo_walls
		position = 33 #1-33
		required_missions = { byz_galicia }
		
		provinces_to_highlight = {
			OR = {
				province_group = byz_baleares_provinces
				province_group = byz_tarraconia_provinces
				province_group = byz_baetica_provinces
				province_group = byz_lusitania_provinces
				province_group = byz_karchidonia_provinces
				province_group = byz_galicia_provinces
			}
			NOT = {
				estate_generals_is_theme_capital_trigger = yes
			}
		}
		
		trigger = {
			calc_true_if = {
				desc = byz_theme_system_tooltip
				byz_baleares_provinces = {
					type = all
					estate_generals_is_theme_capital_trigger = yes
				}
				byz_tarraconia_provinces = {
					type = all
					estate_generals_is_theme_capital_trigger = yes
				}
				byz_baetica_provinces = {
					type = all
					estate_generals_is_theme_capital_trigger = yes
				}
				byz_lusitania_provinces = {
					type = all
					estate_generals_is_theme_capital_trigger = yes
				}
				byz_karchidonia_provinces = {
					type = all
					estate_generals_is_theme_capital_trigger = yes
				}
				byz_galicia_provinces = {
					type = all
					estate_generals_is_theme_capital_trigger = yes
				}
				amount = 16
			}
		}
		
		effect = {
			if = {
				limit = {
					3099 = {
						owned_by = HSP
					}
				}
				3099 = {
					add_base_tax = 3
					add_base_production = 3
					add_base_manpower = 1
				}
			}
			else = {
				3099 = {
					change_culture = hesperic
				}
			}
			custom_tooltip = byz_themes_of_hesperia_development_tooltip
			hidden_effect = {
				random_owned_province = { #RandProv 1
					limit = {
						OR = {
							province_group = byz_baleares_provinces
							province_group = byz_tarraconia_provinces
							province_group = byz_baetica_provinces
							province_group = byz_lusitania_provinces
							province_group = byz_karchidonia_provinces
							province_group = byz_galicia_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
					set_province_flag = byz_prov_to_dev
				}
				random_owned_province = { #RandProv 2
					limit = {
						OR = {
							province_group = byz_baleares_provinces
							province_group = byz_tarraconia_provinces
							province_group = byz_baetica_provinces
							province_group = byz_lusitania_provinces
							province_group = byz_karchidonia_provinces
							province_group = byz_galicia_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
						NOT = {
							has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
						}
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
					set_province_flag = byz_prov_to_dev
				}
				random_owned_province = { #RandProv 3
					limit = {
						OR = {
							province_group = byz_baleares_provinces
							province_group = byz_tarraconia_provinces
							province_group = byz_baetica_provinces
							province_group = byz_lusitania_provinces
							province_group = byz_karchidonia_provinces
							province_group = byz_galicia_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
						NOT = {
							has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
						}
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
					set_province_flag = byz_prov_to_dev
				}
				random_owned_province = { #RandProv 4
					limit = {
						OR = {
							province_group = byz_baleares_provinces
							province_group = byz_tarraconia_provinces
							province_group = byz_baetica_provinces
							province_group = byz_lusitania_provinces
							province_group = byz_karchidonia_provinces
							province_group = byz_galicia_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
						NOT = {
							has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
						}
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
					set_province_flag = byz_prov_to_dev
				}
				random_owned_province = { #RandProv 5
					limit = {
						OR = {
							province_group = byz_baleares_provinces
							province_group = byz_tarraconia_provinces
							province_group = byz_baetica_provinces
							province_group = byz_lusitania_provinces
							province_group = byz_karchidonia_provinces
							province_group = byz_galicia_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
						NOT = {
							has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
						}
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
					set_province_flag = byz_prov_to_dev
				}
				random_owned_province = { #RandProv 6
					limit = {
						OR = {
							province_group = byz_baleares_provinces
							province_group = byz_tarraconia_provinces
							province_group = byz_baetica_provinces
							province_group = byz_lusitania_provinces
							province_group = byz_karchidonia_provinces
							province_group = byz_galicia_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
						NOT = {
							has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
						}
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
					set_province_flag = byz_prov_to_dev
				}
				random_owned_province = { #RandProv 7
					limit = {
						OR = {
							province_group = byz_baleares_provinces
							province_group = byz_tarraconia_provinces
							province_group = byz_baetica_provinces
							province_group = byz_lusitania_provinces
							province_group = byz_karchidonia_provinces
							province_group = byz_galicia_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
						NOT = {
							has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
						}
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
					set_province_flag = byz_prov_to_dev
				}
				random_owned_province = { #RandProv 8
					limit = {
						OR = {
							province_group = byz_baleares_provinces
							province_group = byz_tarraconia_provinces
							province_group = byz_baetica_provinces
							province_group = byz_lusitania_provinces
							province_group = byz_karchidonia_provinces
							province_group = byz_galicia_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
						NOT = {
							has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
						}
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
				}
				every_owned_province = {  #Clearing the flags above.
					if = {
						limit = {
							has_province_flag = byz_prov_to_dev
						}
						clr_province_flag = byz_prov_to_dev 
					}
				}
			}
		}
		
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
}

byz_iberia_4 = {
	slot = 1
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes
		
	byz_mineral_towns = { #New in BR 8.0
		icon = mission_las_medulas
		position = 34 #1-34
		required_missions = { byz_themes_of_hesperia }
		
		provinces_to_highlight = {
			region = iberia_region
			OR = { #There are a total of 8 iron provinces, 1 gold province and 3 copper provinces, plus 4 additional coal provinces later on (One which is an iron one), totalling 15 potential provinces to get 10 production in.
				trade_goods = copper
				trade_goods = iron
				trade_goods = gold
				trade_goods = coal
			}
			NOT = { base_production = 10 }
		}
		
		trigger = {
			num_of_owned_provinces_with = {
				region = iberia_region
				base_production = 10
				OR = { #There are a total of 8 iron provinces, 1 gold province and 3 copper provinces, plus 4 additional coal provinces later on (One which is an iron one), totalling 15 potential provinces to get 10 production in.
					trade_goods = copper
					trade_goods = iron
					trade_goods = gold
					trade_goods = coal
				}
				value = 10
			}
		}
		
		effect = {
			#Iberian Pyrite Belt
			8074 = { #Silver in these mountains
				change_trade_goods = gold
			}
			8072 = { #A bunch of zinc and copper as well
				change_trade_goods = copper
			}
			#Galician Gold
			8039 = { #Contains a village that literally has a museum of Roman gold mining and practice Roman mining techniques for sport.
				change_trade_goods = gold
			}
		}
	}
		
	byz_supply_of_wine = { #New in BR 8.0
		icon = mission_grapes
		position = 35 #1-35
		required_missions = { byz_mineral_towns }
		
		provinces_to_highlight = {
			region = iberia_region
			OR = {
				trade_goods = wine
				trade_goods = bt_trade_good_fruit
			}
			NOT = { has_building = farm_estate }			
		}
		
		trigger = {
			num_of_owned_provinces_with = {
				region = iberia_region
				OR = {
					trade_goods = wine
					trade_goods = bt_trade_good_fruit
				}
				has_building = farm_estate 
				value = 25 #I count 20 wine, 13 fruits.
			}
			trade_goods_produced_amount = {
				trade_goods = wine
				amount = 80 #This corresponds to 800 production dev in wine provinces. That should not be a problem.
			}
			trade_goods_produced_amount = {
				trade_goods = bt_trade_good_fruit
				amount = 80 #This corresponds to 800 production dev in fruit provinces. That should not be a problem.
			}
			production_leader = {
				trade_goods = wine
			}
			production_leader = {
				trade_goods = bt_trade_good_fruit
			}
		}
		
		effect = {
			iberia_region = {
				add_province_modifier = {
					name = "roman_production_hub"
					duration = -1
				}
			}
		}
		
	}
		
	byz_iberian_coal = { #New in BR 8.0
		icon = mission_rb_build_furnaces
		position = 36 #1-36
		required_missions = { byz_supply_of_wine }
		
		provinces_to_highlight = {
			region = iberia_region
			trade_goods = coal
			NOT = { has_building = furnace }
			
		}
		
		trigger = {
			num_of_owned_provinces_with = {
				region = iberia_region
				trade_goods = coal
				has_building = furnace
				value = 3 #There are 4 coal provinces in the Iberian peninsula
			}
			trade_goods_produced_amount = {
				trade_goods = coal
				amount = 15 #This corresponds to 150 production dev in coal provinces. That should not be a problem.
			}
		}
		
		effect = {
			add_country_modifier = {
				name = "byz_roman_iberia_restored"
				duration = -1
			}
		}
	
	}
	
}

byz_exarch_4 = {
	slot = 2
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes
		
	byz_exarch_hesperia = { #New in BR 8.0
		icon = mission_hesperia_exarch
		position = 34 #2-34
		required_missions = { byz_themes_of_hesperia }
		
		provinces_to_highlight = {
			province_id = 3099
		}
		
		trigger = {
			mission_completed = byz_establish_exarches
			OR = {
				HSP = {
					exists = yes
					is_subject_of_type = byz_exarch
					is_subject_of = ROOT
					total_development = 600
				}
				3099 = {
					development = 50
					is_state = yes
					is_state_core = ROOT
					if = {
						limit = {
							has_dlc = "Leviathan"
						}
						num_of_times_expanded_infrastructure = 1 
					}
					else = {
						num_of_buildings_in_province = 5
					}
				}
			}
		}
		
		effect = {
			custom_tooltip = byz_exarch_hesperia_1
			tooltip = {
				HSP = {
					add_liberty_desire = -50
					add_country_modifier = {
						name = "byz_exarchate"
						duration = -1
					}
				}
			}
			custom_tooltip = byz_exarch_hesperia_2
			tooltip = {
				3099 = {
					custom_tooltip = byz_establish_exarch_seat_tooltip
				}
			}
			hidden_effect = {
				if = {
					limit = {
						HSP = {
							exists = yes
							is_subject_of_type = byz_exarch
							is_subject_of = ROOT
							total_development = 600
						}
					}
					HSP = {
						add_liberty_desire = -50
						add_country_modifier = {
							name = "byz_exarchate"
							duration = -1
						}
					}
				}
				else = {
					3099 = {
						add_province_triggered_modifier = exarch_seat_modifier_med_dev
						add_province_triggered_modifier = exarch_seat_modifier_high_dev
						add_province_triggered_modifier = exarch_seat_modifier_very_high_dev
					}
				}
			}
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	
	}
}

byz_colonial_1 = {
	slot = 2
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes
		
	byz_search_for_atlantis = { #New in BR 8.0
		icon = mission_look_west
		position = 35 #2-35
		required_missions = { byz_exarch_hesperia }
		
		provinces_to_highlight = {
			#None
		}
		
		trigger = {
			custom_trigger_tooltip = {
				tooltip = obj_discover_america_tooltip
				OR = {
					north_america = { has_discovered = ROOT }
					south_america = { has_discovered = ROOT }
					new_world = { has_discovered = ROOT }
				}
			}
		}
		
		effect = {
			add_country_modifier = {
				name = "byz_atlantis"
				duration = 3650
			}
		}
		
	}
		
	byz_atlantean_colony = { #New in BR 8.0
		icon = mission_atlantean_colony
		position = 36 #2-36
		required_missions = { byz_search_for_atlantis }
		
		provinces_to_highlight = {
			OR = { #New World
				superregion = north_america_superregion
				superregion = central_america_superregion
				superregion = south_america_superregion
				superregion = andes_superregion
			}
			is_empty = yes
			has_discovered = ROOT
		}
		
		trigger = {
			any_subject_country = {
				is_colonial_nation = yes
			}
		}
		
		effect = {
			random_subject_country = { #I had to do this. It's just too cool to not do.
				limit = {
					is_colonial_nation = yes
				}
				change_primary_culture = atlantean
				every_owned_province = {
					change_culture = atlantean
				}
			}
			add_country_modifier = {
				name = "byz_third_odyssey"
				duration = 9125
			}
		}
	}
}

byz_themes_9 = {
	slot = 2
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes
		
	byz_north_galatian_themes = { #New in BR 8.0
		icon = mission_jublains
		position = 37 #2-37
		required_missions = { byz_germania_minor }
		
		provinces_to_highlight = {
			OR = {
				province_group = byz_lougdonia_provinces
				province_group = byz_belgica_provinces
				province_group = byz_germania_minor_provinces
			}
			NOT = {
				estate_generals_is_theme_capital_trigger = yes
			}
		}
		
		trigger = {
			calc_true_if = {
				desc = byz_theme_system_tooltip
				byz_lougdonia_provinces = {
					type = all
					estate_generals_is_theme_capital_trigger = yes
				}
				byz_belgica_provinces = {
					type = all
					estate_generals_is_theme_capital_trigger = yes
				}
				byz_germania_minor_provinces = {
					type = all
					estate_generals_is_theme_capital_trigger = yes
				}
				amount = 20
			}
		}
		
		effect = {
			if = {
				limit = {
					80 = {
						owned_by = GLT
					}
				}
				80 = {
					add_base_tax = 3
					add_base_production = 3
					add_base_manpower = 1
				}
			}
			else = {
				80 = {
					change_culture = galatian
				}
			}
			custom_tooltip = byz_north_galatian_themes_development_tooltip
			hidden_effect = {
				random_owned_province = { #RandProv 1
					limit = {
						OR = {
							province_group = byz_lougdonia_provinces
							province_group = byz_belgica_provinces
							province_group = byz_germania_minor_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
					set_province_flag = byz_prov_to_dev
				}
				random_owned_province = { #RandProv 2
					limit = {
						OR = {
							province_group = byz_lougdonia_provinces
							province_group = byz_belgica_provinces
							province_group = byz_germania_minor_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
						NOT = {
							has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
						}
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
					set_province_flag = byz_prov_to_dev
				}
				random_owned_province = { #RandProv 3
					limit = {
						OR = {
							province_group = byz_lougdonia_provinces
							province_group = byz_belgica_provinces
							province_group = byz_germania_minor_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
						NOT = {
							has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
						}
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
					set_province_flag = byz_prov_to_dev
				}
				random_owned_province = { #RandProv 4
					limit = {
						OR = {
							province_group = byz_lougdonia_provinces
							province_group = byz_belgica_provinces
							province_group = byz_germania_minor_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
						NOT = {
							has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
						}
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
					set_province_flag = byz_prov_to_dev
				}
				random_owned_province = { #RandProv 5
					limit = {
						OR = {
							province_group = byz_lougdonia_provinces
							province_group = byz_belgica_provinces
							province_group = byz_germania_minor_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
						NOT = {
							has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
						}
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
					set_province_flag = byz_prov_to_dev
				}
				random_owned_province = { #RandProv 6
					limit = {
						OR = {
							province_group = byz_lougdonia_provinces
							province_group = byz_belgica_provinces
							province_group = byz_germania_minor_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
						NOT = {
							has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
						}
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
					set_province_flag = byz_prov_to_dev
				}
				random_owned_province = { #RandProv 7
					limit = {
						OR = {
							province_group = byz_lougdonia_provinces
							province_group = byz_belgica_provinces
							province_group = byz_germania_minor_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
						NOT = {
							has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
						}
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
					set_province_flag = byz_prov_to_dev
				}
				random_owned_province = { #RandProv 8
					limit = {
						OR = {
							province_group = byz_lougdonia_provinces
							province_group = byz_belgica_provinces
							province_group = byz_germania_minor_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
						NOT = {
							has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
						}
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
					set_province_flag = byz_prov_to_dev
				}
				random_owned_province = { #RandProv 9
					limit = {
						OR = {
							province_group = byz_lougdonia_provinces
							province_group = byz_belgica_provinces
							province_group = byz_germania_minor_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
						NOT = {
							has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
						}
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
					set_province_flag = byz_prov_to_dev
				}
				random_owned_province = { #RandProv 10
					limit = {
						OR = {
							province_group = byz_lougdonia_provinces
							province_group = byz_belgica_provinces
							province_group = byz_germania_minor_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
						NOT = {
							has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
						}
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
				}
				every_owned_province = {  #Clearing the flags above.
					if = {
						limit = {
							has_province_flag = byz_prov_to_dev
						}
						clr_province_flag = byz_prov_to_dev 
					}
				}
			}
		}
		
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
}

byz_galatia_1 = {
	slot = 3
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes
	
	byz_narbonia = { #Get Narbonia
		icon = toulon_dockyards
		position = 31 #3-31
		required_missions = { byz_tarraconia }
		
		provinces_to_highlight = {
			province_group = byz_narbonia_provinces
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			has_fulfiled_province_requirement_for_mission_trigger = {
				tooltip=country_holds_or_non_sovereign_subject_holds_highlighted 
				provinces=byz_narbonia_provinces
				owner_type=country_or_non_sovereign_subject_holds
			}
		}
		
		effect = {
			2753 = { #Narbo
				add_base_tax = 3
				add_base_production = 3
				add_base_manpower = 2
				add_or_spawn_center_of_trade = { level = 1 }
			}
			201 = { #Massalia
				add_base_tax = 3
				add_base_production = 3
				add_base_manpower = 2
			}
			#Claims
			give_permaclaims_for_mission = { mission=byz_aquitania }
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
	
	byz_aquitania = { #Into Aquitania!
		icon = the_seven_provinces
		position = 33 #3-33
		required_missions = { byz_narbonia }
		
		provinces_to_highlight = {
			province_group = byz_aquitania_provinces
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			has_fulfiled_province_requirement_for_mission_trigger = {
				tooltip=country_holds_or_non_sovereign_subject_holds_highlighted 
				provinces=byz_aquitania_provinces
				owner_type=country_or_non_sovereign_subject_holds
			}
		}
		
		effect = {
			add_prestige_or_monarch_power = { amount = 25 }
			174 = { #Bourdigala
				add_base_tax = 3
				add_base_production = 3
				add_base_manpower = 2
			}
			#Claims
			give_permaclaims_for_mission = { mission=byz_lougdonia }
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
	
	byz_lougdonia = { #Lougdonia is next!
		icon = mission_rb_conquer_brittany
		position = 34 #3-34
		required_missions = { byz_aquitania }
		
		provinces_to_highlight = {
			province_group = byz_lougdonia_provinces
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			has_fulfiled_province_requirement_for_mission_trigger = {
				tooltip=country_holds_or_non_sovereign_subject_holds_highlighted 
				provinces=byz_lougdonia_provinces
				owner_type=country_or_non_sovereign_subject_holds
			}
		}
		
		effect = {
			capital_scope = {
				add_base_tax = 1
				add_base_production = 1
			}
			203 = { #Lougdon. Honestly, this city deserves a monument, but I cannot find any good candidates that simultaneously have a good picture.
				add_base_tax = 5
				add_base_production = 5
				add_base_manpower = 3
			}
			#Claims
			give_permaclaims_for_mission = { mission=byz_belgica }
			give_permaclaims_for_mission = { mission=byz_albion }
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
	
	byz_belgica = { #Get the lands of Belgica!
		icon = king_of_the_franks
		position = 35 #3-35
		required_missions = { byz_lougdonia }
		
		provinces_to_highlight = {
			province_group = byz_belgica_provinces
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			has_fulfiled_province_requirement_for_mission_trigger = {
				tooltip=country_holds_or_non_sovereign_subject_holds_highlighted 
				provinces=byz_belgica_provinces
				owner_type=country_or_non_sovereign_subject_holds
			}
		}
		
		effect = {
			add_prestige_or_monarch_power = { amount = 25 }
			80 = { #Augusta Treverorum
				add_base_tax = 3
				add_base_production = 3
				add_base_manpower = 2
			}
			#Claims
			give_permaclaims_for_mission = { mission=byz_germania_minor }
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
	
	byz_germania_minor = { #Finish off the Rhenus Border!
		icon = mission_rhine
		position = 36 #3-36
		required_missions = { byz_belgica }
		
		provinces_to_highlight = {
			province_group = byz_germania_minor_provinces
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			has_fulfiled_province_requirement_for_mission_trigger = {
				tooltip=country_holds_or_non_sovereign_subject_holds_highlighted 
				provinces=byz_germania_minor_provinces
				owner_type=country_or_non_sovereign_subject_holds
			}
		}
		
		effect = {			
			capital_scope = {
				add_base_tax = 5
				add_base_production = 5
				add_base_manpower = 2
			}
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
}

byz_endgame = {
	slot = 3
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes
	
	byz_administrating_an_empire = { #New in BR 8.0
		icon = mission_administrating_a_roman_empire
		position = 38 #3-38
		required_missions = { byz_germania_minor }
		
		provinces_to_highlight = {
			owned_by = ROOT
			OR = {
				AND = { #If above govcap, target state provinces with no town hall, or out of date courthouse building
					owner = { governing_capacity_percentage = 1 }
					is_state = yes
					OR = {
						AND = {
							has_building = courthouse
							owner = { adm_tech = 22 }
						}
						NOT = { has_building = town_hall }
					}
				}
				AND = { #If not above govcap, show non-stated provinces, or provinces with highest possible courthouse building.
					NOT = { owner = { governing_capacity_percentage = 1 } }
					OR = {
						NOT = { is_state = yes }
						has_building = town_hall
						AND = {
							NOT = { owner = { adm_tech = 22 } }
							has_building = courthouse
						}
					}
				}
			}
		}
		
		trigger = {
			development_in_provinces = {
				value = 25000
				is_state = yes
				is_state_core = ROOT
			}
		}
		
		effect = {
			add_prestige_or_monarch_power = { amount = 200 }
			add_country_modifier = {
				name = "byz_empire_restored"
				duration = -1
			}
			hidden_effect = { 1321 = { change_province_name = "Thanks for Playing!" } }
		}
	}
}

byz_hre_1 = {
	slot = 4
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes
		
	byz_pannonia = { 
		icon = danubian_power
		position = 31 #4-31
		required_missions = { byz_dismantle_hre }
		
		provinces_to_highlight = {
			province_group = byz_pannonia_provinces
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			has_fulfiled_province_requirement_for_mission_trigger = {
				tooltip=country_holds_or_non_sovereign_subject_holds_highlighted 
				provinces=byz_pannonia_provinces
				owner_type=country_or_non_sovereign_subject_holds
			}
		}
		
		effect = {
			add_country_modifier = {
				name = "byz_danube_border_restored"
				duration = -1
			}
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
}

byz_hre_2 = {
	slot = 5
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes
	
	byz_dismantle_hre = { #Take down the false Empire!
		icon = mission_dismantle_hre
		position = 30 #5-30
		required_missions = { byz_emperor_of_romans }
		
		provinces_to_highlight = {
			#None
		}
		
		trigger = {
			custom_trigger_tooltip = {
				tooltip = restore_roman_empire_byzantium_dismantle_hre_tooltip
				NOT = { hre_size = 1 }
			}
		}
		
		effect = {
			add_permanent_power_projection = {
				type = 25_permanent_power_projection
				amount = 25
			}
			
			#Claims
			give_permaclaims_for_mission = { mission=byz_raetia_noricum }
			give_permaclaims_for_mission = { mission=byz_pannonia }
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
	
	byz_raetia_noricum = { #Get Raetia & Noricum from the heathen Emperors!
		icon = mission_rhine_gorge
		position = 31 #5-31
		required_missions = { byz_dismantle_hre }
		
		provinces_to_highlight = {
			province_group = byz_raetia_noricum_provinces
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			has_fulfiled_province_requirement_for_mission_trigger = {
				tooltip=country_holds_or_non_sovereign_subject_holds_highlighted 
				provinces=byz_raetia_noricum_provinces
				owner_type=country_or_non_sovereign_subject_holds
			}
		}
		
		effect = {
			add_prestige_or_monarch_power = { amount = 100 }
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
}

byz_themes_10 = {
	slot = 4
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes
		
	byz_northern_themes = { #New in BR 8.0
		icon = mission_saalburg_limes
		position = 32 #4-32
		required_missions = { byz_pannonia byz_raetia_noricum }
		
		provinces_to_highlight = {
			OR = {
				province_group = byz_pannonia_provinces
				province_group = byz_raetia_noricum_provinces
			}
			NOT = {
				estate_generals_is_theme_capital_trigger = yes
			}
		}
		
		trigger = {
			calc_true_if = {
				desc = byz_theme_system_tooltip
				byz_pannonia_provinces = {
					type = all
					estate_generals_is_theme_capital_trigger = yes
				}
				byz_raetia_noricum_provinces = {
					type = all
					estate_generals_is_theme_capital_trigger = yes
				}
				amount = 10
			}
		}
		
		effect = {
			custom_tooltip = byz_northern_themes_development_tooltip
			hidden_effect = {
				random_owned_province = { #RandProv 1
					limit = {
						OR = {
							province_group = byz_pannonia_provinces
							province_group = byz_raetia_noricum_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
					set_province_flag = byz_prov_to_dev
				}
				random_owned_province = { #RandProv 2
					limit = {
						OR = {
							province_group = byz_pannonia_provinces
							province_group = byz_raetia_noricum_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
						NOT = {
							has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
						}
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
					set_province_flag = byz_prov_to_dev
				}
				random_owned_province = { #RandProv 3
					limit = {
						OR = {
							province_group = byz_pannonia_provinces
							province_group = byz_raetia_noricum_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
						NOT = {
							has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
						}
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
					set_province_flag = byz_prov_to_dev
				}
				random_owned_province = { #RandProv 4
					limit = {
						OR = {
							province_group = byz_pannonia_provinces
							province_group = byz_raetia_noricum_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
						NOT = {
							has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
						}
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
					set_province_flag = byz_prov_to_dev
				}
				random_owned_province = { #RandProv 5
					limit = {
						OR = {
							province_group = byz_pannonia_provinces
							province_group = byz_raetia_noricum_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
						NOT = {
							has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
						}
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
				}
				every_owned_province = {  #Clearing the flags above.
					if = {
						limit = {
							has_province_flag = byz_prov_to_dev
						}
						clr_province_flag = byz_prov_to_dev 
					}
				}
			}
		}
		
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
	
}

byz_hre_3 = {
	slot = 5
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes
		
	byz_superior_steel = { #New in BR 8.0
		icon = mission_rb_central_belt_coal_mining
		position = 33 #4-33
		required_missions = { byz_northern_themes }
		
		provinces_to_highlight = {
			owned_by = ROOT
			region = south_german_region
			OR = { #I count 11 potential iron provinces and 1 copper.
				trade_goods = copper
				trade_goods = iron
			}
			NOT = { has_building = weapons }
		}
		
		trigger = {
			num_of_owned_provinces_with = {
				region = south_german_region
				OR = { #I count 11 potential iron provinces and 1 copper.
					trade_goods = copper
					trade_goods = iron
				}
				has_building = weapons
				value = 10
			}
			trade_goods_produced_amount = {
				trade_goods = copper
				amount = 30 #This corresponds to 300 production dev in copper provinces. That should not be a problem.
			}
			production_leader = {
				trade_goods = copper
			}
			trade_goods_produced_amount = {
				trade_goods = iron
				amount = 40 #This corresponds to 400 production dev in iron provinces. That should not be a problem.
			}
			production_leader = {
				trade_goods = iron
			}
		}
		
		effect = {
			add_country_modifier = {
				name = "byz_steel_of_noricum"
				duration = -1
			}
		}
	}
	
}

byz_themes_11 = {
	slot = 4
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes
		
	byz_south_galatian_themes = { #New in BR 8.0
		icon = mission_septimania_fort
		position = 34 #4-34
		required_missions = { byz_aquitania }
		
		provinces_to_highlight = {
			OR = {
				province_group = byz_narbonia_provinces
				province_group = byz_aquitania_provinces
			}
			NOT = {
				estate_generals_is_theme_capital_trigger = yes
			}
		}
		
		trigger = {
			calc_true_if = {
				desc = byz_theme_system_tooltip
				byz_narbonia_provinces = {
					type = all
					estate_generals_is_theme_capital_trigger = yes
				}
				byz_aquitania_provinces = {
					type = all
					estate_generals_is_theme_capital_trigger = yes
				}
				amount = 12
			}
		}
		
		effect = {
			if = {
				limit = {
					174 = {
						owned_by = GLT
					}
				}
				174 = {
					add_base_tax = 3
					add_base_production = 3
					add_base_manpower = 1
				}
			}
			else = {
				174 = {
					change_culture = galatian
				}
			}
			custom_tooltip = byz_south_galatian_themes_development_tooltip
			hidden_effect = {
				random_owned_province = { #RandProv 1
					limit = {
						OR = {
							province_group = byz_narbonia_provinces
							province_group = byz_aquitania_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
					set_province_flag = byz_prov_to_dev
				}
				random_owned_province = { #RandProv 2
					limit = {
						OR = {
							province_group = byz_narbonia_provinces
							province_group = byz_aquitania_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
						NOT = {
							has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
						}
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
					set_province_flag = byz_prov_to_dev
				}
				random_owned_province = { #RandProv 3
					limit = {
						OR = {
							province_group = byz_narbonia_provinces
							province_group = byz_aquitania_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
						NOT = {
							has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
						}
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
					set_province_flag = byz_prov_to_dev
				}
				random_owned_province = { #RandProv 4
					limit = {
						OR = {
							province_group = byz_narbonia_provinces
							province_group = byz_aquitania_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
						NOT = {
							has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
						}
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
					set_province_flag = byz_prov_to_dev
				}
				random_owned_province = { #RandProv 5
					limit = {
						OR = {
							province_group = byz_narbonia_provinces
							province_group = byz_aquitania_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
						NOT = {
							has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
						}
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
					set_province_flag = byz_prov_to_dev
				}
				random_owned_province = { #RandProv 6
					limit = {
						OR = {
							province_group = byz_narbonia_provinces
							province_group = byz_aquitania_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
						NOT = {
							has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
						}
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
				}
				every_owned_province = {  #Clearing the flags above.
					if = {
						limit = {
							has_province_flag = byz_prov_to_dev
						}
						clr_province_flag = byz_prov_to_dev 
					}
				}
			}
		}
		
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
}

byz_galatia_2 = {
	slot = 4
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes
		
	byz_lougdon_minting = { #New in BR 8.0
		icon = mission_establish_mint_towns
		position = 35 #4-35
		required_missions = { byz_lougdonia }
	
		trigger = {
			203 = {
				if = {
					limit = {
						has_dlc = "Leviathan"
					}
					num_of_times_expanded_infrastructure = 2
				}
				else = {
					development = 50 #Starts at 31 in 1444, gets +13 from mission.
				}
			}
			trade_goods_produced_amount = {
				trade_goods = gold
				amount = 10 #This corresponds to 100 production dev in gold provinces. Given where you are at this point, I do not think this will be hard to achieve.
			}
			trade_goods_produced_amount = {
				trade_goods = bt_trade_good_silver
				amount = 25 #This corresponds to 250 production dev in silver provinces. Given where you are at this point, I do not think this will be hard to achieve.
			}
		}
		
		effect = {
			203 = {
				change_trade_goods = gold
			}
		}
	}
}

byz_themes_12 = {
	slot = 4
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes
		
	byz_themes_of_albion = { #New in BR 8.0
		icon = mission_caer
		position = 36 #4-36
		required_missions = { byz_albion }
		
		provinces_to_highlight = {
			province_group = byz_albion_provinces
			NOT = {
				estate_generals_is_theme_capital_trigger = yes
			}
		}
		
		trigger = {
			calc_true_if = {
				desc = byz_theme_system_tooltip
				byz_albion_provinces = {
					type = all
					estate_generals_is_theme_capital_trigger = yes
				}
				amount = 8
			}
		}
		
		effect = {
			if = {
				limit = {
					236 = {
						owned_by = ABO
					}
				}
				236 = {
					add_base_tax = 3
					add_base_production = 3
					add_base_manpower = 1
				}
			}
			else = {
				236 = {
					change_culture = albian
				}
			}
			custom_tooltip = byz_themes_of_albion_development_tooltip
			hidden_effect = {
				random_owned_province = { #RandProv 1
					limit = {
						OR = {
							province_group = byz_narbonia_provinces
							province_group = byz_aquitania_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
					set_province_flag = byz_prov_to_dev
				}
				random_owned_province = { #RandProv 2
					limit = {
						OR = {
							province_group = byz_narbonia_provinces
							province_group = byz_aquitania_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
						NOT = {
							has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
						}
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
					set_province_flag = byz_prov_to_dev
				}
				random_owned_province = { #RandProv 3
					limit = {
						OR = {
							province_group = byz_narbonia_provinces
							province_group = byz_aquitania_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
						NOT = {
							has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
						}
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
					set_province_flag = byz_prov_to_dev
				}
				random_owned_province = { #RandProv 4
					limit = {
						OR = {
							province_group = byz_narbonia_provinces
							province_group = byz_aquitania_provinces
						}
						estate_generals_is_theme_capital_trigger = yes
						NOT = {
							has_province_flag = byz_prov_to_dev #To prevent same province picked twice in practice
						}
					}
					add_base_tax = 1
					add_base_production = 1
					add_base_manpower = 1
				}
				every_owned_province = {  #Clearing the flags above.
					if = {
						limit = {
							has_province_flag = byz_prov_to_dev
						}
						clr_province_flag = byz_prov_to_dev 
					}
				}
			}
		}
		
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
}

byz_exarch_5 = {
	slot = 4
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes
		
	byz_exarch_galatia = { #New in BR 8.0
		icon = mission_galatia_exarch
		position = 37 #4-37
		required_missions = { byz_germania_minor }
		
		provinces_to_highlight = {
			OR = {
				province_id = 174
				province_id = 80
			}
		}
		
		trigger = {
			mission_completed = byz_establish_exarches
			OR = {
				GLT = {
					exists = yes
					is_subject_of_type = byz_exarch
					is_subject_of = ROOT
					total_development = 600
				}
				AND = {
					174 = {
						development = 50
						is_state = yes
						is_state_core = ROOT
						if = {
							limit = {
								has_dlc = "Leviathan"
							}
							num_of_times_expanded_infrastructure = 1 
						}
						else = {
							num_of_buildings_in_province = 5
						}
					}
					80 = {
						development = 50
						is_state = yes
						is_state_core = ROOT
						if = {
							limit = {
								has_dlc = "Leviathan"
							}
							num_of_times_expanded_infrastructure = 1 
						}
						else = {
							num_of_buildings_in_province = 5
						}
					}					
				}
			}
		}
		
		effect = {
			custom_tooltip = byz_exarch_galatia_1
			tooltip = {
				GLT = {
					add_liberty_desire = -50
					add_country_modifier = {
						name = "byz_exarchate"
						duration = -1
					}
				}
			}
			custom_tooltip = byz_exarch_galatia_2
			174 = {
				custom_tooltip = byz_establish_exarch_seat_tooltip
			}
			80 = {
				custom_tooltip = byz_establish_exarch_seat_tooltip
			}
			hidden_effect = {
				if = {
					limit = {
						GLT = {
							exists = yes
							is_subject_of_type = byz_exarch
							is_subject_of = ROOT
							total_development = 600
						}
					}
					GLT = {
						add_liberty_desire = -50
						add_country_modifier = {
							name = "byz_exarchate"
							duration = -1
						}
					}
				}
				else = {
					174 = {
						add_province_triggered_modifier = exarch_seat_modifier_med_dev
						add_province_triggered_modifier = exarch_seat_modifier_high_dev
						add_province_triggered_modifier = exarch_seat_modifier_very_high_dev
					}
					80 = {
						add_province_triggered_modifier = exarch_seat_modifier_med_dev
						add_province_triggered_modifier = exarch_seat_modifier_high_dev
						add_province_triggered_modifier = exarch_seat_modifier_very_high_dev
					}
				}
			}
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
}

byz_england_1 = {
	slot = 5
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes
		
	byz_albion = {
		icon = defeat_the_english
		position = 35 #5-35
		required_missions = { byz_lougdonia }
		
		provinces_to_highlight = {
			province_group = byz_albion_provinces
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			has_fulfiled_province_requirement_for_mission_trigger = {
				tooltip=country_holds_or_non_sovereign_subject_holds_highlighted 
				provinces=byz_albion_provinces
				owner_type=country_or_non_sovereign_subject_holds
			}
		}
		
		effect = {
			if = { #Antonine Wall
				limit = {
					owns_or_non_sovereign_subject_of = 248
					owns_or_non_sovereign_subject_of = 3019
				}
				248 = {
					add_province_modifier = {
						name = local_fortress
						duration = -1
					}
				}
				3019 = {
					add_province_modifier = {
						name = local_fortress
						duration = -1
					}
				}
			}
			else = { #You're my Hadrian's Wall
				8137 = {
					add_province_modifier = {
						name = local_fortress
						duration = -1
					}
				}
				8136 = {
					add_province_modifier = {
						name = local_fortress
						duration = -1
					}
				}
				247 = {
					add_province_modifier = {
						name = local_fortress
						duration = -1
					}
				}
			}
			
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}	
}

byz_exarch_6 = {
	slot = 5
	generic = no
	ai = yes
	potential = {
		tag = BYZ
	}
	has_country_shield = yes
		
	byz_exarch_albion = { #New in BR 8.0
		icon = mission_albion_exarch
		position = 36 #5-35
		required_missions = { byz_albion }
		
		provinces_to_highlight = {
			province_id = 236
		}
		
		trigger = {
			mission_completed = byz_establish_exarches
			OR = {
				ABO = {
					exists = yes
					is_subject_of_type = byz_exarch
					is_subject_of = ROOT
					total_development = 600
				}
				236 = {
					development = 50
					is_state = yes
					is_state_core = ROOT
					if = {
						limit = {
							has_dlc = "Leviathan"
						}
						num_of_times_expanded_infrastructure = 1 
					}
					else = {
						num_of_buildings_in_province = 5
					}
				}
			}
		}
		
		effect = {
			custom_tooltip = byz_exarch_albion_1
			tooltip = {
				ABO = {
					add_liberty_desire = -50
					add_country_modifier = {
						name = "byz_exarchate"
						duration = -1
					}
				}
			}
			custom_tooltip = byz_exarch_albion_2
			236 = {
				custom_tooltip = byz_establish_exarch_seat_tooltip
			}
			hidden_effect = {
				if = {
					limit = {
						ABO = {
							exists = yes
							is_subject_of_type = byz_exarch
							is_subject_of = ROOT
							total_development = 600
						}
					}
					ABO = {
						add_liberty_desire = -50
						add_country_modifier = {
							name = "byz_exarchate"
							duration = -1
						}
					}
				}
				else = {
					236 = {
						add_province_triggered_modifier = exarch_seat_modifier_med_dev
						add_province_triggered_modifier = exarch_seat_modifier_high_dev
						add_province_triggered_modifier = exarch_seat_modifier_very_high_dev
					}
				}
			}
		}
	
		ai_weight = {
			factor = 500	#AI gogo!
		}
	}
}


