decisions = {

	# Nestorian > Orthodox
	mend_nestorian_schism = {
		only_independent = yes
		is_high_prio = yes
		
		potential = {
			has_dlc = "Legacy of Rome"
			is_playable = yes
			is_adult = yes
			prisoner = no
			independent = yes
			NOT = { trait = incapable }
			OR = {
				religion = nestorian
				religion = messalian
			}
			##OR = {
			##	has_landed_title = e_byzantium
			##	has_landed_title = e_roman_empire
			##}
			num_of_emperor_titles = 1
			is_heretic = no
			NOT = { has_global_flag = nestorian_schism_mended }
			NOT = { has_global_flag = orthodox_nestorian_schism_mended }
			k_orthodox = {
				holder_scope = {
					is_heretic = no # If the Patriarch (and thus Orthodoxy) is heretical, mending the schism is no longer possible
				}
			}
		}
		allow = {
			piety = 2000
			religion_authority = 0.75
			completely_controls = c_byzantion
			b_hagiasophia = {
				holder_scope = {
					religion = ROOT
					is_heretic = no
				}
			}
			completely_controls = c_antiocheia
			b_antiocheia = {
				holder_scope = {
					religion = ROOT
					is_heretic = no
				}
			}
			completely_controls = c_jerusalem
			b_jerusalem = {
				holder_scope = {
					religion = ROOT
					is_heretic = no
				}
			}
			completely_controls = c_alexandria
			b_alexandria = {
				holder_scope = {
					religion = ROOT
					is_heretic = no
				}
			}
			##completely_controls = c_roma
			##b_roma = {
			##	holder_scope = {
			##		OR = {
			##			religion = orthodox
			##			religion = paulician
			##			religion = monothelite
			##			religion = iconoclast
			##		}
			##		is_heretic = no
			##	}
			##}
		}
		effect = {
			narrative_event = { id = MES.1 tooltip = EVTTOOLTIPMES.1}
			set_global_flag = nestorian_schism_mended
		}
		ai_will_do = {
			factor = 1
		}
	}
	
	# Miaphysite > Orthodox
	mend_miaphysite_schism = {
		only_independent = yes
		is_high_prio = yes
		
		potential = {
			has_dlc = "Legacy of Rome"
			is_playable = yes
			is_adult = yes
			prisoner = no
			independent = yes
			NOT = { trait = incapable }
			OR = {
				religion = miaphysite
				religion = monophysite
			}
			##OR = {
			##	has_landed_title = e_byzantium
			##	has_landed_title = e_roman_empire
			##}
			num_of_emperor_titles = 1
			is_heretic = no
			NOT = { has_global_flag = miaphysite_schism_mended }
			NOT = { has_global_flag = orthodox_miaphysite_schism_mended }
			k_orthodox = {
				holder_scope = {
					is_heretic = no # If the Patriarch (and thus Orthodoxy) is heretical, mending the schism is no longer possible
				}
			}
		}
		allow = {
			piety = 2000
			religion_authority = 0.75
			completely_controls = c_byzantion
			b_hagiasophia = {
				holder_scope = {
					religion = ROOT
					is_heretic = no
				}
			}
			completely_controls = c_antiocheia
			b_antiocheia = {
				holder_scope = {
					religion = ROOT
					is_heretic = no
				}
			}
			completely_controls = c_jerusalem
			b_jerusalem = {
				holder_scope = {
					religion = ROOT
					is_heretic = no
				}
			}
			completely_controls = c_alexandria
			b_alexandria = {
				holder_scope = {
					religion = ROOT
					is_heretic = no
				}
			}
			##completely_controls = c_roma
			##b_roma = {
			##	holder_scope = {
			##		OR = {
			##			religion = orthodox
			##			religion = paulician
			##			religion = monothelite
			##			religion = iconoclast
			##		}
			##		is_heretic = no
			##	}
			##}
		}
		effect = {
			narrative_event = { id = MES.2 tooltip = EVTTOOLTIPMES.2}
			set_global_flag = miaphysite_schism_mended
		}
		ai_will_do = {
			factor = 1
		}
	}
	
	# Orthodox > Nestorian
	mend_orthodox_nestorian_schism = {
		only_independent = yes
		is_high_prio = yes
		
		potential = {
			has_dlc = "Legacy of Rome"
			is_playable = yes
			is_adult = yes
			prisoner = no
			independent = yes
			NOT = { trait = incapable }
			OR = {
				religion = orthodox
				religion = bogomilist
				religion = paulician
				religion = tondrakian
				religion = monothelite
				religion = iconoclast
				religion = catholic
				religion = cathar
				religion = fraticelli
				religion = waldensian
				religion = lollard
				religion = adoptionist
				religion = arian
				religion = miaphysite
				religion = monophysite
				religion = messalian
				religion = apostolic
				religion = maronite
				religion = syriac
			}
			##OR = {
			##	has_landed_title = e_byzantium
			##	has_landed_title = e_roman_empire
			##}
			num_of_emperor_titles = 1
			is_heretic = no
			NOT = { has_global_flag = orthodox_nestorian_schism_mended }
			NOT = { has_global_flag = nestorian_schism_mended }
			d_nestorian = {
				holder_scope = {
					is_heretic = no # If the Nestorian Patriarch (and thus Nestorianism) is heretical, mending the schism is no longer possible
				}
			}
		}
		allow = {
			piety = 2000
			religion_authority = 0.75
			completely_controls = c_edessa
			b_bile = {
				holder_scope = {
					religion = ROOT
					is_heretic = no
				}
			}
			completely_controls = c_baghdad
			b_bagdad = {
				holder_scope = {
					religion = ROOT
					is_heretic = no
				}
			}
			completely_controls = c_merv
			b_tagtabazar = {
				holder_scope = {
					religion = ROOT
					is_heretic = no
				}
			}
			completely_controls = c_jerusalem
			b_jerusalem = {
				holder_scope = {
					religion = ROOT
					is_heretic = no
				}
			}
			##completely_controls = c_alexandria
			##b_alexandria = {
			##	holder_scope = {
			##		religion = ROOT
			##		is_heretic = no
			##	}
			##}
		}
		effect = {
			narrative_event = { id = MES.3 tooltip = EVTTOOLTIPMES.1}
			set_global_flag = orthodox_nestorian_schism_mended
		}
		ai_will_do = {
			factor = 1
		}
	}
	
	# Orthodox > Miaphysite
	mend_orthodox_miaphysite_schism = {
		only_independent = yes
		is_high_prio = yes
		
		potential = {
			has_dlc = "Legacy of Rome"
			is_playable = yes
			is_adult = yes
			prisoner = no
			independent = yes
			NOT = { trait = incapable }
			OR = {
				religion = orthodox
				religion = bogomilist
				religion = paulician
				religion = tondrakian
				religion = monothelite
				religion = iconoclast
				religion = catholic
				religion = cathar
				religion = fraticelli
				religion = waldensian
				religion = lollard
				religion = adoptionist
				religion = arian
				religion = monophysite
				religion = nestorian
				religion = messalian
				religion = apostolic
				religion = maronite
				religion = syriac
			}
			##OR = {
			##	has_landed_title = e_byzantium
			##	has_landed_title = e_roman_empire
			##}
			num_of_emperor_titles = 1
			is_heretic = no
			NOT = { has_global_flag = orthodox_miaphysite_schism_mended }
			NOT = { has_global_flag = miaphysite_schism_mended }
			d_miaphysite = {
				holder_scope = {
					is_heretic = no # If the Miaphysite Pope (and thus Miaphysitism) is heretical, mending the schism is no longer possible
				}
			}
		}
		allow = {
			piety = 2000
			religion_authority = 0.75
			completely_controls = c_dwin
			b_etchmiadzin = {
				holder_scope = {
					religion = ROOT
					is_heretic = no
				}
			}
			completely_controls = c_alexandria
			b_alexandria = {
				holder_scope = {
					religion = ROOT
					is_heretic = no
				}
			}
			completely_controls = c_jerusalem
			b_jerusalem = {
				holder_scope = {
					religion = ROOT
					is_heretic = no
				}
			}
			completely_controls = c_antiocheia
			b_antiocheia = {
				holder_scope = {
					religion = ROOT
					is_heretic = no
				}
			}
			completely_controls = c_aksum
			b_aksum = {
				holder_scope = {
					religion = ROOT
					is_heretic = no
				}
			}
		}
		effect = {
			narrative_event = { id = MES.4 tooltip = EVTTOOLTIPMES.2}
			set_global_flag = orthodox_miaphysite_schism_mended
		}
		ai_will_do = {
			factor = 1
		}
	}
	
	mend_eastern_great_schism = {
		only_independent = yes
		is_high_prio = yes
		ai_check_interval = 24
		
		potential = {
			has_dlc = "Legacy of Rome"
			is_playable = yes
			is_adult = yes
			prisoner = no
			independent = yes
			NOT = { trait = incapable }
			OR = {
				religion = bogomilist
				religion = tondrakian
				religion = adoptionist
				religion = arian
				religion = miaphysite
				religion = monophysite
				religion = nestorian
				religion = messalian
				religion = apostolic
				religion = maronite
				religion = syriac
			}
			##OR = {
			##	has_landed_title = e_byzantium
			##	has_landed_title = e_roman_empire
			##}
			num_of_emperor_titles = 1
			is_heretic = no
			NOT = { has_global_flag = eastern_great_schism_mended }
			k_papal_state = {
				holder_scope = {
					is_heretic = no # If the Pope (and thus Catholicism) is heretical, mending the schism is no longer possible
				}
			}
			NOT = {
				has_alternate_start_parameter = { key = religion_names value = random }
			}
		}
		allow = {
			piety = 2000
			religion_authority = 0.9
			completely_controls = c_byzantion
			b_hagiasophia = {
				holder_scope = {
					religion = ROOT
					is_heretic = no
				}
			}
			completely_controls = c_antiocheia
			b_antiocheia = {
				holder_scope = {
					religion = ROOT
					is_heretic = no
				}
			}
			completely_controls = c_jerusalem
			b_jerusalem = {
				holder_scope = {
					religion = ROOT
					is_heretic = no
				}
			}
			completely_controls = c_alexandria
			b_alexandria = {
				holder_scope = {
					religion = ROOT
					is_heretic = no
				}
			}
			completely_controls = c_roma
			b_roma = {
				holder_scope = {
					religion = ROOT
					is_heretic = no
				}
			}
		}
		effect = {
			narrative_event = { id = MES.5 tooltip = EVTTOOLTIPLoR.210}
			set_global_flag = eastern_great_schism_mended
		}
		ai_will_do = {
			factor = 1
		}
	}
}

