title_decisions = {
	
	soc_assign_diocese_ecumenical_patriarch = {
		from_potential = {
			OR = {
				religion = orthodox
				religion = monothelite
				religion = iconoclast
				religion = paulician
			}
			independent = yes
		}
		
		potential = {
			real_tier = KING
			holder_scope = {
				same_realm = FROM
			}
			NOT = {
				has_title_flag = ecumenical_patriarch_admininistration_flag
			}
		}
		
		allow = {
			FROM = {
				piety = 100
			}
			custom_tooltip = {
				text = soc_tooltip_dismissed_pentarchy
				has_global_flag = dismissed_pentarchy_flag
			}
		}
		
		effect = {
			FROM = {
				piety = -100
			}
			custom_tooltip = {
				text = soc_tooltip_ecumenical_patriarch_administration
				ROOT = {
					set_pentarch_title = b_hagiasophia
					set_title_flag = ecumenical_patriarch_admininistration_flag
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0
				OR = {
					NOT = {
						piety = 200
					}
					NOT = {
						AND = {
							is_title_active = k_orthodox
							k_orthodox = {
								holder_scope = {
									same_realm = FROM
								}
							}
						}
					}
				}
			}
		}
	}
	
	soc_assign_diocese_local = {
		from_potential = {
			OR = {
				religion = orthodox
				religion = monothelite
				religion = iconoclast
				religion = paulician
			}
			independent = yes
		}
		
		potential = {
			real_tier = KING
			holder_scope = {
				same_realm = FROM
			}
			has_title_flag = ecumenical_patriarch_admininistration_flag
		}
		
		allow = {
			FROM = {
				piety = 100
			}
			custom_tooltip = {
				text = soc_tooltip_dismissed_pentarchy
				has_global_flag = dismissed_pentarchy_flag
			}
		}
		
		effect = {
			FROM = {
				piety = -100
			}
			custom_tooltip = {
				text = soc_tooltip_local_administration
				ROOT = {
					set_pentarch_title = none
					clr_title_flag = ecumenical_patriarch_admininistration_flag
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0
				OR = {
					NOT = {
						piety = 200
					}
					AND = {
						is_title_active = k_orthodox
						k_orthodox = {
							holder_scope = {
								same_realm = FROM
							}
						}
					}
				}
			}
		}
	}
}