decisions = {	
	create_binitarian_patriarchy = {
		only_playable = yes
		is_high_prio = yes
	
		potential = {
			religion = binitarian
			NOT = { is_title_active = d_binitarian }
			age = 16
			prisoner = no
			NOT = { trait = incapable }
		}
		
		allow = {
			piety = 1000
			OR = {
				owns = 774 # Jerusalem
				any_realm_lord = {
					owns = 774
				}
			}
		}
		
		effect = {
			activate_title = { title = d_binitarian status = yes }
			hidden_tooltip = {
				create_random_priest = {
					dynasty = none
					random_traits = yes
				}
				new_character = {
					d_binitarian = {
						grant_title = PREV
					}
					wealth = 500
					opinion = {
						who = ROOT
						modifier = opinion_creator_of_rel_heal
					}
				}
				
				religion_authority = {
					modifier = patriarchy_instituted
					years = 20
				}
			}
			piety = 1000
		}
		
		ai_will_do = {
			factor = 1
		}
	}
	
	create_ebionites_patriarchy = {
		only_playable = yes
		is_high_prio = yes
	
		potential = {
			religion = ebionites
			NOT = { is_title_active = d_ebionites }
			age = 16
			prisoner = no
			NOT = { trait = incapable }
		}
		
		allow = {
			piety = 1000
			OR = {
				owns = 774 # Jerusalem
				any_realm_lord = {
					owns = 774
				}
			}
		}
		
		effect = {
			activate_title = { title = d_ebionites status = yes }
			hidden_tooltip = {
				create_random_priest = {
					dynasty = none
					random_traits = yes
				}
				new_character = {
					d_ebionites = {
						grant_title = PREV
					}
					wealth = 500
					opinion = {
						who = ROOT
						modifier = opinion_creator_of_rel_heal
					}
				}
				
				religion_authority = {
					modifier = patriarchy_instituted
					years = 20
				}
			}
			piety = 1000
		}
		
		ai_will_do = {
			factor = 1
		}
	}

	create_apollinarian_patriarchy = {
		only_playable = yes
		is_high_prio = yes
	
		potential = {
			religion = apollinarian
			NOT = { is_title_active = d_apollinarian }
			age = 16
			prisoner = no
			NOT = { trait = incapable }
		}
		
		allow = {
			is_heretic = no
			piety = 1000
			OR = {
				owns = 496 # Constantinople
				any_realm_lord = {
					owns = 496
				}
			}
		}
		
		effect = {
			activate_title = { title = d_apollinarian status = yes }
			hidden_tooltip = {
				create_random_priest = {
					dynasty = none
					random_traits = yes
				}
				new_character = {
					d_apollinarian = {
						grant_title = PREV
					}
					wealth = 500
					opinion = {
						who = ROOT
						modifier = opinion_creator_of_rel_heal
					}
				}
				
				religion_authority = {
					modifier = patriarchy_instituted
					years = 20
				}
			}
			piety = 1000
		}
		
		ai_will_do = {
			factor = 1
		}
	}

	create_adoptionian_patriarchy = {
		only_playable = yes
		is_high_prio = yes
	
		potential = {
			religion = adoptionism
			NOT = { is_title_active = d_adoptionism }
			age = 16
			prisoner = no
			NOT = { trait = incapable }
		}
		
		allow = {
			is_heretic = no
			piety = 1000
			OR = {
				owns = 764 # Antioch
				any_realm_lord = {
					owns = 764 
				}
			}
		}
		
		effect = {
			activate_title = { title = d_adoptionism status = yes }
			hidden_tooltip = {
				create_random_priest = {
					dynasty = none
					random_traits = yes
				}
				new_character = {
					d_adoptionism = {
						grant_title = PREV
					}
					wealth = 500
					opinion = {
						who = ROOT
						modifier = opinion_creator_of_rel_heal
					}
				}
				
				religion_authority = {
					modifier = patriarchy_instituted
					years = 20
				}
			}
			piety = 1000
		}
		
		ai_will_do = {
			factor = 1
		}
	}

	create_patripassian_patriarchy = {
		only_playable = yes
		is_high_prio = yes
	
		potential = {
			religion = patripassianism
			NOT = { is_title_active = d_patripassian }
			age = 16
			prisoner = no
			NOT = { trait = incapable }
		}
		
		allow = {
			is_heretic = no
			piety = 1000
			OR = {
				owns = 333 # Rome
				any_realm_lord = {
					owns = 333
				}
			}
		}
		
		effect = {
			activate_title = { title = d_patripassian status = yes }
			hidden_tooltip = {
				create_random_priest = {
					dynasty = none
					random_traits = yes
				}
				new_character = {
					d_patripassian = {
						grant_title = PREV
					}
					wealth = 500
					opinion = {
						who = ROOT
						modifier = opinion_creator_of_rel_heal
					}
				}
				
				religion_authority = {
					modifier = patriarchy_instituted
					years = 20
				}
			}
			piety = 1000
		}
		
		ai_will_do = {
			factor = 1
		}
	}
	
	create_audianistic_patriarch = {
		only_playable = yes
		is_high_prio = yes
	
		potential = {
			religion = audianistic
			NOT = { is_title_active = d_audianistic }
			age = 16
			prisoner = no
			NOT = { trait = incapable }
		}
		
		allow = {
			is_heretic = no
			piety = 1000
			OR = {
				owns = 333 # Rome
				any_realm_lord = {
					owns = 333
				}
			}
		}
		
		effect = {
			activate_title = { title = d_audianistic status = yes }
			hidden_tooltip = {
				create_random_priest = {
					dynasty = none
					random_traits = yes
				}
				new_character = {
					d_audianistic = {
						grant_title = PREV
					}
					wealth = 500
					opinion = {
						who = ROOT
						modifier = opinion_creator_of_rel_heal
					}
				}
				
				religion_authority = {
					modifier = patriarchy_instituted
					years = 20
				}
			}
			piety = 1000
		}
		
		ai_will_do = {
			factor = 1
		}
	}

	restore_bishop_of_carthage = {
		only_playable = yes
		is_high_prio = yes
	
		potential = {
			religion = donatism
			NOT = { is_title_active = d_donatism }
			age = 16
			prisoner = no
			NOT = { trait = incapable }
		}
		
		allow = {
			is_heretic = no
			piety = 1000
			OR = {
				owns = 817 # Carthage
				any_realm_lord = {
					owns = 817
				}
			}
		}
		
		effect = {
			activate_title = { title = d_donatism status = yes }
			hidden_tooltip = {
				create_random_priest = {
					dynasty = none
					random_traits = yes
				}
				new_character = {
					d_donatism = {
						grant_title = PREV
					}
					wealth = 500
					opinion = {
						who = ROOT
						modifier = opinion_creator_of_rel_heal
					}
				}
				
				religion_authority = {
					modifier = patriarchy_instituted
					years = 20
				}
			}
			piety = 1000
			narrative_event = { id = spirit.43 days = 2 }
		}
		
		ai_will_do = {
			factor = 1
		}
	}

	create_valentinian_patriarchy = {
		only_playable = yes
		is_high_prio = yes
	
		potential = {
			religion = valentinianism
			NOT = { is_title_active = d_valentinianism }
			age = 16
			prisoner = no
			NOT = { trait = incapable }
		}
		
		allow = {
			is_heretic = no
			piety = 1000
			OR = {
				owns = 333 # Rome
				any_realm_lord = {
					owns = 333
				}
			}
		}
		
		effect = {
			activate_title = { title = d_valentinianism status = yes }
			hidden_tooltip = {
				create_random_priest = {
					dynasty = none
					random_traits = yes
				}
				new_character = {
					d_valentinianism = {
						grant_title = PREV
					}
					wealth = 500
					opinion = {
						who = ROOT
						modifier = opinion_creator_of_rel_heal
					}
				}
				
				religion_authority = {
					modifier = patriarchy_instituted
					years = 20
				}
			}
			piety = 1000
		}
		
		ai_will_do = {
			factor = 1
		}
	}
	
	create_priscillian_patriarchy = {
		only_playable = yes
		is_high_prio = yes
		potential = {
			religion = priscillianism
			NOT = { is_title_active = d_priscillianism }
			age = 16
			prisoner = no
			NOT = { trait = incapable }
		}
		allow = {
			piety = 1000
			trait = vegetarian
			OR = {
				owns = 198 # Valladolid
				any_realm_lord = {
					owns = 198 # Valladolid
				}
			}
		}
		effect = {
			give_nickname = nick_with_immortal_soul
			activate_title = { title = d_priscillianism status = yes }
			hidden_tooltip = {
				create_random_priest = {
					name = "Priscillian"
					dynasty = none
					trait = humble
					trait = vegetarian
					trait = zealous
					trait = mystic
					race = coptic
					religion = priscillianism
					culture = ROOT
					female = no
					attributes = {
						martial = 8
						intrigue = 10
						learning = 10
					}
					historical = yes
				}
			}
			new_character = {
				d_priscillianism = {
					grant_title = PREV
				}
				b_avila = {
					grant_title = PREV
					make_capital_holding = yes
				}
				wealth = 0
				opinion = {
					who = ROOT
					modifier = opinion_creator_of_rel_heal
				}
			}
			religion_authority = {
				modifier = patriarchy_instituted
				years = 20
			}
			piety = 1000
		}
		
		ai_will_do = {
			factor = 1
		}
	}

	create_sethian_patriarchy = {
 		only_playable = yes
 		is_high_prio = yes
 	
 		potential = {
 			religion = sethian
 			NOT = { is_title_active = d_sethian }
			age = 16
			prisoner = no
			NOT = { trait = incapable }
 		}
 	
 		allow = {
			OR = {
				is_heretic = no
				AND = {
					higher_real_tier_than = KING
					realm_size = 90
				}
			}
 			piety = 1000
			OR = {
				owns = 802 # Alexandria
				any_realm_lord = {
					owns = 802
				}
			}
 		}
 		
 		effect = {
 			activate_title = { title = d_sethian status = yes }
 			hidden_tooltip = {
 				create_random_priest = {
 					dynasty = none
 					random_traits = yes
					female = no
					trait = mystic	
 				}
 				new_character = {
 					d_sethian = {
 						grant_title = PREV
 					}
 					wealth = 500
 					opinion = {
 						who = ROOT
 						modifier = opinion_creator_of_rel_heal
 					}
 				}
 				
				religion_authority = {
 					modifier = patriarchy_instituted
 					years = 20
 				}
 			}
			piety = 1000
 		}
 		
 		ai_will_do = {
 			factor = 1
 		}
 	}

	create_bishop_of_iona = {
		only_playable = yes
		is_high_prio = yes
	
		potential = {
			religion = insular
			has_global_flag = insular_whitby_victory
			NOT = { is_title_active = d_insular }
			age = 16
			prisoner = no
			NOT = { trait = incapable }
		}
		
		allow = {
			piety = 1000
			OR = {
				owns = 35 # Innse Gall (Iona)
				any_realm_lord = {
					owns = 35
				}
			}
		}
		
		effect = {
			activate_title = { title = d_insular status = yes }
			hidden_tooltip = {
				create_random_priest = {
					dynasty = none
					random_traits = yes
				}
				new_character = {
					d_insular = {
						grant_title = PREV
					}
					wealth = 500
					opinion = {
						who = ROOT
						modifier = opinion_creator_of_rel_heal
					}
				}
				
				religion_authority = {
					modifier = patriarchy_instituted
					years = 20
				}
			}
			piety = 1000
		}
		
		ai_will_do = {
			factor = 1
		}
	}
	
	create_pelagian_bishop = {
		only_playable = yes
		is_high_prio = yes
	
		potential = {
			religion = pelagianism
			NOT = { is_title_active = d_pelagian }
			age = 16
			prisoner = no
			NOT = { trait = incapable }
		}
		
		allow = {
			piety = 1000
			OR = {
				owns = 35 # Innse Gall (Iona)
				any_realm_lord = {
					owns = 35
				}
			}
		}
		
		effect = {
			activate_title = { title = d_pelagian status = yes }
			hidden_tooltip = {
				create_random_priest = {
					dynasty = none
					random_traits = yes
				}
				new_character = {
					d_pelagian = {
						grant_title = PREV
					}
					wealth = 500
					opinion = {
						who = ROOT
						modifier = opinion_creator_of_rel_heal
					}
				}
				
				religion_authority = {
					modifier = patriarchy_instituted
					years = 20
				}
			}
			piety = 1000
		}
		
		ai_will_do = {
			factor = 1
		}
	}
	
	create_arian_papacy = {
		only_playable = yes
		is_high_prio = yes
	
		potential = {
			religion = arian
			NOT = { is_title_active = d_arian }
			age = 16
			prisoner = no
			NOT = { trait = incapable }
		}
		
		allow = {
			is_heretic = no
			piety = 1000
			OR = {
				owns = 774 # Jerusalem
				any_realm_lord = {
					owns = 774
				}
			}
		}
		
		effect = {
			activate_title = { title = d_arian status = yes }
			hidden_tooltip = {
				create_random_priest = {
					dynasty = none
					random_traits = yes
				}
				new_character = {
					d_arian = {
						grant_title = PREV
					}
					wealth = 500
					opinion = {
						who = ROOT
						modifier = opinion_creator_of_rel_heal
					}
				}
				
				religion_authority = {
					modifier = patriarchy_instituted
					years = 20
				}
			}
			piety = 1000
			narrative_event = { id = spirit.44 days = 2 }
		}
		
		ai_will_do = {
			factor = 1
		}
	}
	
	create_salem = {
		is_high_prio = yes
		only_playable = yes
		only_independent = yes

		potential = {
			religion = melchisedechianism
			age = 16
			prisoner = no
			NOT = { trait = incapable }
			independent = yes
			NOT = { is_title_active = k_melchisedechianism }
		}
		
		allow = {
			piety = 1000
			OR = {
				trait = mystic
				learning = 14
			}
			primary_title = { higher_tier_than = KING }
			realm_size = 150
		}
		
		effect = {
			give_nickname = nick_the_anointed
			activate_title = { 
				title = k_melchisedechianism
				status = yes
			}
			hidden_tooltip = {
				k_melchisedechianism = {
					grant_title = ROOT
				}
				religion_authority = {
					modifier = patriarchy_instituted
					years = 20
				}
			}
			piety = 1000
			add_trait = mystic
			add_trait = newsalem
			ROOT = {
				narrative_event = { id = spirit.40 }
			}
		}
		
		ai_will_do = {
			factor = 1
		}
	}
	
	the_henotikon = {
		is_high_prio = yes
		only_independent = yes

		potential = {
			has_landed_title = e_byzantium
			religion = nicene
			NOT = { has_global_flag = the_henotikon }
		}
		
		allow = {
			piety = 100
			prestige = 100
			war = no
			prisoner = no
			NOT = { is_inaccessible_trigger = yes }
			age = 16
		}
		
		effect = {
			narrative_event = { id = hist.9 }
			set_global_flag = the_henotikon
		}
		
		ai_will_do = {
			factor = 1
		}
	}
	
	end_acacian_schism  = {
		is_high_prio = yes
		only_independent = yes
		
		potential = {
			has_landed_title = e_byzantium
			religion = nicene
			has_global_flag = the_henotikon
			NOT = { has_global_flag = acacian_schism_ended }
		}
		
		allow = {
			war = no
			prisoner = no
			NOT = { is_inaccessible_trigger = yes }
			age = 16
		}
		
		effect = {
			narrative_event = { id = hist.26 }
			set_global_flag = acacian_schism_ended
			piety = 100
			prestige = -100
		}
		
		ai_will_do = {
			factor = 0.5
			modifier = {
				factor = 3
				trait = craven
			}
			modifier = {
				factor = 3
				trait = content
			}
			modifier = {
				factor = 0.1
				trait = ambitious
			}
			modifier = {
				factor = 0.001 # Slow it down
				always = yes
			}
		}
	}
	
	recruit_donatist_bands = {
		only_playable = yes
		is_high_prio = yes
		is_mercenary = yes
		potential = {
			is_playable = yes
			is_tribal = no
			is_landed = yes
			religion = donatism
			capital_scope = {
				region = world_africa_north #These bands lived in Northern Africa where there were sizeable Donatist minorities
			}
			OR = {
				ai = no
				any_war = {
					OR = {
						any_defender = {
							character = ROOT
							is_primary_war_defender = yes
						}
						any_attacker = {
							character = ROOT
							is_primary_war_attacker = yes
						}
					}
				}
			}
		}
		
		allow = {
			war = yes
			piety = 500
			age = 16
		}
		
		effect = {
			custom_tooltip = { text = recruit_donatist_bands_tooltip }
			piety = -500
			
			hidden_tooltip = {
				capital_scope = {
					PREV = {
						spawn_unit = {
							owner = ROOT
							province = PREV
							home = PREV
							troops = {
								light_infantry = { 250 250 }
							}
							attrition = 1.0
							disband_on_peace = yes
							maintenance_multiplier = 0.5
						}
					}
				}
				capital_scope = {
					PREV = {
						spawn_unit = {
							owner = ROOT
							province = PREV
							home = PREV
							troops = {
								light_infantry = { 250 250 }
							}
							attrition = 1.0
							disband_on_peace = yes
							maintenance_multiplier = 0.5
						}
					}
				}
			}
		}
		
		ai_will_do = {
			factor = 0 # decisions with the "is_mercenary" will not be calculated from the script
		}
	}
	
	choose_sanamahi_patron_deity = {
		only_playable = yes
		potential = {
			#always = no # TODO event spirit.34 does not exist !
			has_dlc = "Rajas of India"
			is_playable = yes
			age = 16
			not = { trait = incapable }
			OR = {
				religion = sanamahi
				religion = sanamahi_reformed
			}
			NOT = {
				has_character_modifier = patron_lainingthou
				has_character_modifier = patron_ebudhou
				has_character_modifier = patron_apokpa
				has_character_modifier = patron_ebendhou
				has_character_modifier = patron_panthoibi
				has_character_modifier = patron_shidapa
			}
			NOT = { has_character_flag = selecting_patron_deity }
		}
		allow = {
			prisoner = no
		}
		effect = {
			custom_tooltip = {
				text = custom_tooltip_choose_patron_diety
			}
			#character_event = { id = spirit.34 } #wrong ID
			character_event = { id = spirit.35 }
			set_character_flag = selecting_patron_deity
		}
		
		ai_will_do = {
			factor = 0.01
			modifier = {
				factor = 5
				trait = zealous
			}
			modifier = {
				factor = 0.5
				trait = cynical
			}
		}
	}

	alamannian_sacrifice = {
		only_playable = yes
		only_rulers = yes
		potential = {
			is_feudal = yes
			prisoner = no
			culture = alamannian
			NOT = { has_character_modifier = held_alam_sacrifice }
			OR = {
				religion = germanic_pagan
				religion = germanic_pagan_reformed 
			}
		}
		allow = {
			war = no
			custom_tooltip = {
				text = UNOCCUPIED_DEMESNE_TITLE
				hidden_tooltip = {
					any_demesne_title = {
						NOT = { higher_tier_than = count }
						is_occupied = no
					}
				}
			}
			prisoner = no
			wealth = 25
			month = 10
			prestige = 100
		}
		effect = {
			wealth = -50
			hidden_tooltip = {
				ROOT = {
					character_event = { id = spirit.23 }
				}
			}
		}
		
		ai_will_do = {
			factor = 1
		}
	}
	
	give_toumanglais = {
		only_playable = yes
		potential = {
			is_ruler = yes
			is_theocracy = no
			OR = {
				religion = sanamahi
				religion = sanamahi_reformed
			}
			NOT = {
				has_character_flag = gave_offering_unugais
			}
			primary_title = { higher_tier_than = BARON }
		}
		allow = {
            scaled_wealth = 0.20
			prestige = 50
			piety = 50
		}
		effect = {
			scaled_wealth = -0.20
			set_character_flag = gave_offering_unugais
            character_event = { id = sanamahi.15 }
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5 # Slow it down
				always = yes
			}
			modifier = {
				factor = 2
				trait = zealous
			}
			modifier = {
				factor = 0.5
				trait = arbitrary
			}
			modifier = {
				factor = 2
				trait = kind
			}
			modifier = {
				factor = 0.5
				trait = envious
			}
			modifier = {
				factor = 2
				trait = ambitious
			}
			modifier = {
				factor = 0.5
				trait = content
			}
			modifier = {
				factor = 2
				trait = diligent
			}
			modifier = {
				factor = 0.5
				trait = slothful
			}
			modifier = {
				factor = 0.05
				has_character_flag = retreat_at_least_once
				NOT = { trait = zealous }
			}
		}
	}
	
	enlist_paygan = {
		only_playable = yes
		is_high_prio = yes
		is_mercenary = yes
		potential = {
			OR = { 
				culture = persian
				culture = parthian
			}
			religion = zoroastrian
		}
		allow = {
			war = yes
			piety = 150
		}
		effect = {
			piety = -150
			capital_scope = {
				PREV = {
					spawn_unit = {
						owner = ROOT
						province = PREV
						home = PREV
						troops = {
							light_infantry = { 1000 1000 }
						}
						attrition = 1.0
						#morale = -0.20 
						disband_on_peace = yes
						maintenance_multiplier = 0.5
					}
				}
			}
		}
		ai_will_do = {
			factor = 0 # decisions with the "is_mercenary" will not be calculated from the script
		}
	}

	restore_mimamsa = {
		only_playable = yes
		is_high_prio = yes
		potential = {
			religion = mimamsa
			higher_real_tier_than = KING
			NOT = { is_title_active = k_mimamsa }
			age = 16
			prisoner = no
			NOT = { trait = incapable }
		}

		allow = {
			NOT = { trait = cynical }
			piety = 1000
		}

		effect = {
			activate_title = { title = k_mimamsa status = yes }
			hidden_tooltip = {
				create_random_priest = {
					dynasty = none
					random_traits = yes
					trait = imposing
					trait = brahmin
					female = no
					culture = ROOT
				}
				new_character = {
					k_mimamsa = {
						grant_title = PREV
					}
					wealth = 500
					opinion = {
						who = ROOT
						modifier = opinion_creator_of_rel_heal
					}
				}
				
				religion_authority = {
					modifier = patriarchy_instituted
					years = 20
				}
			}
		}
	}
	
	embrace_apellian = {
		only_playable = yes
		potential = {
			religion = marcionism
			NOT = { 
				OR = {
					trait = apellian
					trait = potitian
					trait = synerian
				}
			}
			is_ruler = yes
			age = 16
			prisoner = no
		}
		
		allow = {
			piety = 50
		}
		
		effect = {
			add_trait = apellian
			character_event = { id = spirit.26 tooltip = EVTTOOLTIP_SPIRIT_26 }
		}
		
		ai_will_do = {
			factor = 1
			
			modifier = {
				factor = 0.1
				trait = zealous
				NOT = { trait = mystic }
				}

			modifier = {
				factor = 4
				trait = mystic
			}
			modifier = {
				factor = 0.2
				trait = cynical
			}
			modifier = {
				factor = 1.2
				liege = { trait = apellian }
			}
			modifier = {
				factor = 3
				liege = { religion_group = zoroastrian_group }
			}
		}
	}
	
	embrace_potitian = {
		only_playable = yes
		potential = {
			religion = marcionism
			NOT = { 
				OR = {
					trait = apellian
					trait = potitian
					trait = synerian
				}
			}
			is_ruler = yes
			age = 16
			prisoner = no
		}
		
		allow = {
			piety = 50
		}
		
		effect = {
			add_trait = potitian
			character_event = { id = spirit.27 tooltip = EVTTOOLTIP_SPIRIT_27 }
		}
		
		ai_will_do = {
			factor = 1
			
			modifier = {
				factor = 3
				trait = scholar
			}
			modifier = {
				factor = 0.3
				trait = craven
			}
			modifier = {
				factor = 0.3
				trait = arbitrary
			}
			modifier = {
				factor = 3
				trait = zealous
			}
			modifier = {
				factor = 1.2
				liege = { trait = potitian }
			}
		}
	}
	
	embrace_synerian = {
		only_playable = yes
		potential = {
			religion = marcionism
			NOT = { 
				OR = {
					trait = apellian
					trait = potitian
					trait = synerian
				}
			}
			is_ruler = yes
			age = 16
			prisoner = no
		}
		
		allow = {
			piety = 50
		}
		
		effect = {
			add_trait = synerian
			character_event = { id = spirit.28 tooltip = EVTTOOLTIP_SPIRIT_28 }
		}
		
		ai_will_do = {
			factor = 1
			
			modifier = {
				factor = 3
				trait = craven
			}
			modifier = {
				factor = 3
				trait = content
			}
			modifier = {
				factor = 0.1
				trait = zealous
			}
			modifier = {
				factor = 1.2
				liege = { trait = synerian }
			}
			modifier = {
				factor = 3
				liege = { religion = nicene }
			}
		}
	}
	
	denounce_three_chapters = {
		only_playable = yes
		is_high_prio = yes
		potential = {
			religion = nicene
			has_landed_title = e_byzantium 
			age = 16
			prisoner = no
			year = 500
			NOT = { year = 600 } 
			NOT = { has_global_flag = three_chapter_controversy }
		}
		
		allow = {
			piety = 50
		}
		
		effect = {
			narrative_event = { id = syn.1 tooltip = syn.1.tooltip }
			set_global_flag = three_chapter_controversy
		}
		
		ai_will_do = {
			factor = 5
		}
	}
	
	rejoin_church_aquileian = {
		only_playable = yes
		is_high_prio = yes
		potential = {
			religion = aquileian
			controls_religion = yes
			age = 16
			prisoner = no
			has_global_flag = aquileian_schism
			NOT = { has_global_flag = end_aquileian_schism }
		}
		
		allow = {
			piety = 50
			religion = aquileian
			controls_religion = yes
		}
		
		effect = {
			narrative_event = { id = syn.11 }
			set_global_flag = end_aquileian_schism
			d_aquileia_church = {
				holder_scope = {
					d_papal_state = {
						grant_title = PREV
					}
					unsafe_religion = nicene  # Use this effect with care
				}
				hidden_tooltip = { unsafe_destroy_landed_title = THIS }
			}
			activate_title = { title = d_aquileia_church status = no }
		}
		
		ai_will_do = {
			factor = 0.5
			modifier = {
				factor = 10
				had_global_flag = { 
					flag = aquileian_schism 
					days = 36500 # 100 years 
				}
			}
			modifier = {
				factor = 5
				had_global_flag = { 
					flag = aquileian_schism 
					days = 18250 # 50 years
				}
			}
			modifier = {
				factor = 3
				trait = craven
			}
			modifier = {
				factor = 3
				trait = content
			}
			modifier = {
				factor = 0.1
				trait = zealous
			}
			modifier = {
				factor = 0.001 # Slow it down
				always = yes
			}
		}
	}
	
	take_over_aquileian_church = {
		only_playable = yes
		is_high_prio = yes
		potential = {
			religion_group = pagan_group 
			has_landed_title = c_aquileia
			NOT = { has_global_flag = the_aquileian_capture }
			NOT = { has_global_flag = end_aquileian_schism }
			has_global_flag = aquileian_schism 
			age = 16
			prisoner = no
		}
		
		allow = {
			prestige = 500
		}
		
		effect = {
			religion = aquileian
			narrative_event = { id = syn.10 tooltip = syn.10.tooltip }
			set_global_flag = the_aquileian_capture
		}
		
		ai_will_do = {
			factor = 5
		}
	}
	
	give_alms = {
		only_playable = yes
		ai = no
		
		potential = {
			is_playable = yes
			religion = pelagianism
			is_adult = yes
			demesne_size = 1
			NOT = { has_character_flag = gave_alms }
			religion_head = {	
				NOT = {
					has_opinion_modifier = { who = ROOT modifier = opinion_almsgiving }
				}
			}
		}
		allow = {
			scaled_wealth = 1.0
		}
		effect = {
			set_character_flag = gave_alms
			scaled_wealth = -0.25
			piety = 50
			if = {
				limit = {
					is_title_active = d_pelagian
				}
				religion_head = {
					opinion = {
						modifier = opinion_almsgiving
						who = ROOT
						years = 5
					}
				}
			}
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0
				ai = yes
				OR = {
					NOT = { scaled_wealth = 10.0 }
					piety = 0
				}
			}
		}
	}
}