###########################################
#
# Holy Order Decisions for Sons of Abraham
#
###########################################
# Written by Henrik Fhraeus
###########################################

# Holy Order Decisions are listed for each existing holy order of the right religion

decisions = {

	borrow_money_knights_templar = {
		only_playable = yes
		ai_check_interval = 120
		potential = {
			is_playable = yes
			is_nomadic = no
			OR = {
				religion = catholic
				religion = cathar
				religion = fraticelli
				religion = waldensian
				religion = lollard
			}
			is_heretic = no
			is_title_active = d_knights_templar
			OR = {
				ai = no
				AND = {
					ai = yes
					higher_tier_than = COUNT
					independent = yes
				}
			}
			NOT = { has_character_modifier = borrowed_from_knights_templar }
			NOT = { has_character_modifier = expelled_d_knights_templar }
			NOT = { government = order_government }
			
			has_dlc = "Sons of Abraham"
			
			d_knights_templar = {
				holder_scope = {
					liege = {
						NOT = { character = ROOT }
					}
				}
			}
		}
		
		allow = {
			d_knights_templar = {
				holder_scope = {
					wealth = 300
					ROOT = {
						NOT = { excommunicated_for = PREV }
					}
				}
			}
			piety = 100

			custom_tooltip = {
				text = knights_templar_loan_money_TT

				d_knights_templar = {
					holder_scope = {
						opinion = {
							who = ROOT
							value = 25
						}
					}
				}
			}
		}
		
		effect = {
			add_character_modifier = {
				name = borrowed_from_knights_templar
				duration = -1
				inherit = yes
			}
			
			hidden_tooltip = {
				d_knights_templar = {
					holder_scope = {
						character_event = {
							id = SoA.1010
						}
					}
				}
			}
			
			wealth = 300
			piety = -100
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0
				wealth = 0
			}
			modifier = {
				factor = 0.5 # Slow it down
			}
		}
	}
	
	expel_the_knights_templar = {
		only_independent = yes
		ai = no

		potential = {
			OR = {
				religion = catholic
				religion = cathar
				religion = fraticelli
				religion = waldensian
				religion = lollard
			}
			is_heretic = no
			higher_tier_than = DUKE
			independent = yes
			is_title_active = d_knights_templar
			NOT = { has_character_modifier = expelled_d_knights_templar }
			
			any_realm_province = {
				any_province_lord = {
					d_knights_templar = {
						holder_scope = {
							OR = {
								character = PREVPREV
								is_vassal_or_below = PREVPREV
							}
						}
					}
				}
			}
			
			has_dlc = "Sons of Abraham"
		}
		
		allow = {
			piety = 1000
			custom_tooltip = {
				text = expelling_holy_order_decision_tooltip
				hidden_tooltip = {
					NOT = { has_character_flag = expel_the_knights_templar_check }
				}
			}
		}
		
		effect = {
			set_character_flag = expel_the_knights_templar_check
			custom_tooltip = {
				text = expelling_holy_order_decision_tooltip_b
				hidden_tooltip = {
					character_event = { id = SoA.2990 }
				}
			}
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 0
		}
	}
	
	expel_the_knights_hospitaler = {
		only_independent = yes
		ai = no

		potential = {
			OR = {
				religion = catholic
				religion = cathar
				religion = fraticelli
				religion = waldensian
				religion = lollard
			}
			is_heretic = no
			higher_tier_than = DUKE
			independent = yes
			is_title_active = d_knights_hospitaler
			NOT = { has_character_modifier = expelled_d_knights_hospitaler }
			
			any_realm_province = {
				any_province_lord = {
					d_knights_hospitaler = {
						holder_scope = {
							OR = {
								character = PREVPREV
								is_vassal_or_below = PREVPREV
							}
						}
					}
				}
			}
			
			has_dlc = "Sons of Abraham"
		}
		
		allow = {
			piety = 1000
			custom_tooltip = {
				text = expelling_holy_order_decision_tooltip
				hidden_tooltip = {
					NOT = { has_character_flag = expel_the_knights_hospitaler_check }
				}
			}
		}
		
		effect = {
			set_character_flag = expel_the_knights_hospitaler_check
			custom_tooltip = {
				text = expelling_holy_order_decision_tooltip_b
				hidden_tooltip = {
					character_event = { id = SoA.2990 }
				}
			}
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 0
		}
	}
	
	expel_the_teutonic_order = {
		only_independent = yes
		ai = no

		potential = {
			OR = {
				religion = catholic
				religion = cathar
				religion = fraticelli
				religion = waldensian
				religion = lollard
			}
			is_heretic = no
			higher_tier_than = DUKE
			independent = yes
			is_title_active = d_teutonic_order
			NOT = { has_character_modifier = expelled_d_teutonic_order }
			
			any_realm_province = {
				any_province_lord = {
					d_teutonic_order = {
						holder_scope = {
							OR = {
								character = PREVPREV
								is_vassal_or_below = PREVPREV
							}
						}
					}
				}
			}
			
			has_dlc = "Sons of Abraham"
		}
		
		allow = {
			piety = 1000
			custom_tooltip = {
				text = expelling_holy_order_decision_tooltip
				hidden_tooltip = {
					NOT = { has_character_flag = expel_the_teutonic_order_check }
				}
			}
		}
		
		effect = {
			set_character_flag = expel_the_teutonic_order_check
			custom_tooltip = {
				text = expelling_holy_order_decision_tooltip_b
				hidden_tooltip = {
					character_event = { id = SoA.2990 }
				}
			}
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 0
		}
	}
	
	expel_the_jomsvikings = {
		only_independent = yes
		ai = no

		potential = {
			OR = {
				religion = norse_pagan
				religion = norse_pagan_reformed
			}
			higher_tier_than = DUKE
			independent = yes
			is_title_active = d_jomsvikings
			NOT = { has_character_modifier = expelled_d_jomsvikings }
			
			any_realm_province = {
				any_province_lord = {
					d_jomsvikings = {
						holder_scope = {
							OR = {
								character = PREVPREV
								is_vassal_or_below = PREVPREV
							}
						}
					}
				}
			}
			
			has_dlc = "Sons of Abraham"
		}
		
		allow = {
			piety = 1000
			custom_tooltip = {
				text = expelling_holy_order_decision_tooltip
				hidden_tooltip = {
					NOT = { has_character_flag = expel_the_jomsvikings_check }
				}
			}
		}
		
		effect = {
			set_character_flag = expel_the_jomsvikings_check
			custom_tooltip = {
				text = expelling_holy_order_decision_tooltip_b
				hidden_tooltip = {
					character_event = { id = SoA.2990 }
				}
			}
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 0
		}
	}
	
	expel_the_assassins = {
		only_independent = yes
		ai = no

		potential = {
			OR = {
				religion = shiite
				religion = druze
				religion = hurufi
			}
			is_heretic = no
			higher_tier_than = DUKE
			independent = yes
			is_title_active = d_hashshashin
			NOT = { has_character_modifier = expelled_d_hashshashin }
			
			any_realm_province = {
				any_province_lord = {
					d_hashshashin = {
						holder_scope = {
							OR = {
								character = PREVPREV
								is_vassal_or_below = PREVPREV
							}
						}
					}
				}
			}
			
			has_dlc = "Sons of Abraham"
			NOT = { society_member_of = the_assassins }
		}
		
		allow = {
			piety = 1000
			custom_tooltip = {
				text = expelling_holy_order_decision_tooltip
				hidden_tooltip = {
					NOT = { has_character_flag = expel_the_assassins_check }
				}
			}
		}
		
		effect = {
			set_character_flag = expel_the_assassins_check
			custom_tooltip = {
				text = expelling_holy_order_decision_tooltip_b
				hidden_tooltip = {
					character_event = { id = SoA.2990 }
				}
			}
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 0
		}
	}
	
	donate_money_to_knights_templar = {
		only_playable = yes
		ai_check_interval = 80
		potential = {
			is_playable = yes
			
			OR = {
				AND = {
					OR = {
						NOR = {
							trait = cynical
							piety = 300
						}
						AND = {
							trait = zealous
							trait = charitable
						}
					}
					wealth = 600
				}
				ai = no
			}
			
			is_title_active = d_knights_templar
			NOT = { government = order_government }
			
			d_knights_templar = {
				holder_scope = { 
					religion = ROOT
				}
			}
			
			NOT = { has_character_modifier = expelled_d_knights_templar }
			
			OR = {
				AND = {
					NOT = { is_title_active = d_teutonic_order }
					NOT = { is_title_active = d_knights_santiago }
					NOT = { is_title_active = d_knights_calatrava }
				}
				AND = {
					NOT = { is_title_active = d_teutonic_order }
					NOT = { culture_group = iberian }
					NOT = { culture_group = west_african }
					NOT = { culture = maghreb_arabic }
					NOT = { culture = occitan }
				}
				AND = {
					NOT = { is_title_active = d_knights_santiago }
					NOT = { is_title_active = d_knights_calatrava }
					NOT = { culture_group = north_germanic }
					NOT = { culture_group = central_germanic }
					NOT = { culture_group = magyar }
					NOT = { culture_group = south_slavic }
					NOT = { culture_group = west_slavic }
				}
				AND = {
					NOT = { culture_group = iberian }
					NOT = { culture_group = west_african }
					NOT = { culture = maghreb_arabic }
					NOT = { culture = occitan }
					NOT = { culture_group = north_germanic }
					NOT = { culture_group = central_germanic }
					NOT = { culture_group = magyar }
					NOT = { culture_group = south_slavic }
					NOT = { culture_group = west_slavic }
				}
			}
			
			has_dlc = "Sons of Abraham"
			
			d_knights_templar = {
				holder_scope = {
					liege = {
						NOT = { character = ROOT }
					}
				}
			}
		}
		
		allow = {
			wealth = 300
			custom_tooltip = {
				text = holy_order_donate_cooldown_tt
				NOT = { has_character_modifier = donate_to_holy_order_cooldown }
			}
		}
		
		effect = {
			hidden_effect = {
				add_character_modifier = {
					modifier = donate_to_holy_order_cooldown
					hidden = yes
					years = 1
				}
			}
			if = {
				limit = { 
					NOT = { has_character_modifier = donated_to_holy_order }
				}
				add_character_modifier = {
					name = donated_to_holy_order
					duration = -1
				}
			}
			
			hidden_tooltip = {
				d_knights_templar = {
					holder_scope = {
						character_event = {
							id = SoA.1140
						}
					}
				}
			}
			
			wealth = -300
			piety = 100
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5 # Slow it down
			}
		}
	}
	
	donate_money_to_knights_hospitaler = {
		only_playable = yes
		ai_check_interval = 80

		potential = {
			is_playable = yes
			
			OR = {
				AND = {
					wealth = 1000
					NOR = {
						trait = cynical
						piety = 50
					}
				}
				ai = no
			}
			
			is_title_active = d_knights_hospitaler
			NOT = { government = order_government }
			
			d_knights_hospitaler = {
				holder_scope = { 
					religion = ROOT
				}
			}
			
			NOT = { has_character_modifier = expelled_d_knights_hospitaler }
			
			OR = {
				AND = {
					NOT = { is_title_active = d_teutonic_order }
					NOT = { is_title_active = d_knights_santiago }
					NOT = { is_title_active = d_knights_calatrava }
				}
				AND = {
					NOT = { is_title_active = d_teutonic_order }
					NOT = { culture_group = iberian }
					NOT = { culture_group = west_african }
					NOT = { culture = maghreb_arabic }
					NOT = { culture = occitan }
				}
				AND = {
					NOT = { is_title_active = d_knights_santiago }
					NOT = { is_title_active = d_knights_calatrava }
					NOT = { culture_group = north_germanic }
					NOT = { culture_group = central_germanic }
					NOT = { culture_group = magyar }
					NOT = { culture_group = south_slavic }
					NOT = { culture_group = west_slavic }
				}
				AND = {
					NOT = { culture_group = iberian }
					NOT = { culture_group = west_african }
					NOT = { culture = maghreb_arabic }
					NOT = { culture = occitan }
					NOT = { culture_group = north_germanic }
					NOT = { culture_group = central_germanic }
					NOT = { culture_group = magyar }
					NOT = { culture_group = south_slavic }
					NOT = { culture_group = west_slavic }
				}
			}
			
			has_dlc = "Sons of Abraham"
			
			d_knights_hospitaler = {
				holder_scope = {
					liege = {
						NOT = { character = ROOT }
					}
				}
			}
		}
		
		allow = {
			wealth = 300
			custom_tooltip = {
				text = holy_order_donate_cooldown_tt
				NOT = { has_character_modifier = donate_to_holy_order_cooldown }
			}
		}
		
		effect = {
			hidden_effect = {
				add_character_modifier = {
					modifier = donate_to_holy_order_cooldown
					hidden = yes
					years = 1
				}
			}
			if = {
				limit = { 
					NOT = { has_character_modifier = donated_to_holy_order }
				}
				add_character_modifier = {
					name = donated_to_holy_order
					duration = -1
				}
			}
			
			hidden_tooltip = {
				d_knights_hospitaler = {
					holder_scope = {
						character_event = {
							id = SoA.1140
						}
					}
				}
			}
			
			wealth = -300
			piety = 100
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.1 # Slow it down
			}
		}
	}
	
	donate_money_to_teutonic_order = {
		only_playable = yes
		ai_check_interval = 80
		potential = {
			is_playable = yes
			
			OR = {
				AND = {
					wealth = 1000
					NOR = {
						trait = cynical
						piety = 50
					}
				}
				ai = no
			}
			
			is_title_active = d_teutonic_order
			NOT = { government = order_government }
			
			d_teutonic_order = {
				holder_scope = { 
					religion = ROOT
				}
			}

			NOT = { has_character_modifier = expelled_d_teutonic_order }
			
			OR = {
				AND = {
					NOT = { is_title_active = d_knights_hospitaler }
					NOT = { is_title_active = d_knights_templar }
					NOT = { is_title_active = d_knights_santiago }
					NOT = { is_title_active = d_knights_calatrava }
				}
				AND = {
					NOT = { is_title_active = d_knights_hospitaler }
					NOT = { is_title_active = d_knights_templar }
					NOT = { culture_group = iberian }
					NOT = { culture_group = west_african }
					NOT = { culture = maghreb_arabic }
					NOT = { culture = occitan }
				}
				culture_group = north_germanic
				culture_group = central_germanic
				culture_group = magyar
				culture_group = south_slavic
				culture_group = west_slavic
			}
			
			has_dlc = "Sons of Abraham"
			
			d_teutonic_order = {
				holder_scope = {
					liege = {
						NOT = { character = ROOT }
					}
				}
			}
		}
		
		allow = {
			wealth = 300
			custom_tooltip = {
				text = holy_order_donate_cooldown_tt
				NOT = { has_character_modifier = donate_to_holy_order_cooldown }
			}
		}
		
		effect = {
			hidden_effect = {
				add_character_modifier = {
					modifier = donate_to_holy_order_cooldown
					hidden = yes
					years = 1
				}
			}
			if = {
				limit = { 
					NOT = { has_character_modifier = donated_to_holy_order }
				}
				add_character_modifier = {
					name = donated_to_holy_order
					duration = -1
				}
			}
			
			hidden_tooltip = {
				d_teutonic_order = {
					holder_scope = {
						character_event = {
							id = SoA.1340
						}
					}
				}
			}
			
			wealth = -300
			piety = 100
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.1 # Slow it down
			}
		}
	}
	
	donate_money_to_jomsvikings = {
		only_playable = yes
		ai_check_interval = 80

		potential = {
			is_playable = yes
			
			OR = {
				AND = {
					wealth = 1000
					NOR = {
						trait = cynical
						piety = 50
					}
				}
				ai = no
			}
			
			OR = {
				religion = norse_pagan
				religion = norse_pagan_reformed
			}
			
			is_title_active = d_jomsvikings
			NOT = { government = order_government }
			
			has_dlc = "Sons of Abraham"
			
			d_jomsvikings = {
				holder_scope = {
					liege = {
						NOT = { character = ROOT }
					}
				}
			}
			
			NOT = { has_character_modifier = expelled_d_jomsvikings }
		}
		
		allow = {
			wealth = 300
			custom_tooltip = {
				text = holy_order_donate_cooldown_tt
				NOT = { has_character_modifier = donate_to_holy_order_cooldown }
			}
		}
		
		effect = {
			hidden_effect = {
				add_character_modifier = {
					modifier = donate_to_holy_order_cooldown
					hidden = yes
					years = 1
				}
			}
			if = {
				limit = { 
					NOT = { has_character_modifier = donated_to_holy_order }
				}
				add_character_modifier = {
					name = donated_to_holy_order
					duration = -1
				}
			}
			
			hidden_tooltip = {
				d_jomsvikings = {
					holder_scope = {
						character_event = {
							id = SoA.1540
						}
					}
				}
			}
			
			wealth = -300
			piety = 100
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.1 # Slow it down
			}
		}
	}
	
	borrow_money_assassins = {
		only_playable = yes
		ai_check_interval = 120

		potential = {
			is_playable = yes
			OR = {
				religion = shiite
				religion = druze
				religion = hurufi
			}
			is_heretic = no
			is_title_active = d_hashshashin
			OR = {
				ai = no
				AND = {
					ai = yes
					higher_tier_than = COUNT
					independent = yes
				}
			}
			NOT = { has_character_modifier = borrowed_from_assassins }
			NOT = { has_character_modifier = expelled_d_hashshashin }
			NOT = { is_nomadic = yes }
			
			has_dlc = "Sons of Abraham"
			NOT = { society_member_of = the_assassins }
			NOT = { government = order_government }
			
			d_hashshashin = {
				holder_scope = {
					liege = {
						NOT = { character = ROOT }
					}
				}
			}

			NOT = { has_character_modifier = assassins_debt } #From MNM.6001
		}
		
		allow = {
			d_hashshashin = {
				holder_scope = {
					wealth = 300
				}
			}

			piety = 100

			custom_tooltip = {
				text = hashshashin_loan_money_TT

				d_hashshashin = {
					holder_scope = {
						opinion = {
							who = ROOT
							value = 25
						}
					}
				}
			}
		}
		
		effect = {
			add_character_modifier = {
				name = borrowed_from_assassins
				duration = -1
				inherit = yes
			}
			
			hidden_tooltip = {
				d_hashshashin = {
					holder_scope = {
						character_event = {
							id = SoA.1410
						}
					}
				}
			}
			
			wealth = 300

			piety = -100

			hidden_effect = {
				if = {
					limit = { has_dlc = "Mystics" }
					set_variable = { which = assassins_debt value = 300 }
				}
			}
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0
				wealth = 0
			}
			modifier = {
				factor = 0.5 # Slow it down
			}
		}
	}
	
	donate_money_to_assassins = {
		only_playable = yes
		ai_check_interval = 80

		potential = {
			is_playable = yes
			
			OR = {
				AND = {
					wealth = 1000
					NOR = {
						trait = cynical
						piety = 50
					}
				}
				ai = no
			}
			
			NOT = { government = order_government }

			is_title_active = d_hashshashin
			
			d_hashshashin = {
				holder_scope = { 
					religion = ROOT
				}
			}
			
			NOT = { has_character_modifier = expelled_d_hashshashin }

			NOT = { society_member_of = the_assassins }
			
			has_dlc = "Sons of Abraham"
			
			d_hashshashin = {
				holder_scope = {
					liege = {
						NOT = { character = ROOT }
					}
				}
			}
		}
		
		allow = {
			wealth = 300
			custom_tooltip = {
				text = holy_order_donate_cooldown_tt
				NOT = { has_character_modifier = donate_to_holy_order_cooldown }
			}
		}
		
		effect = {
			hidden_effect = {
				add_character_modifier = {
					modifier = donate_to_holy_order_cooldown
					hidden = yes
					years = 1
				}
			}
			
			hidden_tooltip = {
				d_hashshashin = {
					holder_scope = {
						character_event = {
							id = SoA.1140
						}
					}
				}
			}
			
			wealth = -300
			piety = 100
		}

		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.1 # Slow it down
			}
		}
	}
		
	borrow_money_bektashi = {
		only_playable = yes
		ai_check_interval = 120

		potential = {
			is_playable = yes
			OR = {
				religion = sunni
				religion = zikri
				religion = yazidi
			}
			is_heretic = no
			is_title_active = d_bektashi
			OR = {
				ai = no
				AND = {
					ai = yes
					higher_tier_than = COUNT
					independent = yes
				}
			}
			NOT = { has_character_modifier = borrowed_from_bektashi }
			NOT = { has_character_modifier = expelled_d_bektashi }
			NOT = { is_nomadic = yes }
			NOT = { government = order_government }
			
			has_dlc = "Sons of Abraham"
			
			d_bektashi = {
				holder_scope = {
					liege = {
						NOT = { character = ROOT }
					}
				}
			}
		}
		
		allow = {
			d_bektashi = {
				holder_scope = {
					wealth = 300
				}
			}

			piety = 100 

			custom_tooltip = {
				text = bektashi_loan_money_TT

				d_bektashi = {
					holder_scope = {
						opinion = {
							who = ROOT
							value = 25
						}
					}
				}
			}
		}
		
		effect = {
			add_character_modifier = {
				name = borrowed_from_bektashi
				duration = -1
				inherit = yes
			}
			
			hidden_tooltip = {
				d_bektashi = {
					holder_scope = {
						character_event = {
							id = SoA.1210
						}
					}
				}
			}
			wealth = 300
			piety = -100
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0
				wealth = 0
			}
			modifier = {
				factor = 0.5 # Slow it down
			}
		}
	}

	donate_money_to_bektashi = {
		only_playable = yes
		ai_check_interval = 80
		potential = {
			is_playable = yes
			
			OR = {
				AND = {
					wealth = 1000
					NOR = {
						trait = cynical
						piety = 50
					}
				}
				ai = no
			}
			
			NOT = { government = order_government }

			is_title_active = d_bektashi
			
			d_bektashi = {
				holder_scope = { 
					religion = ROOT
				}
			}
			
			has_dlc = "Sons of Abraham"
			
			NOT = { has_character_modifier = expelled_d_bektashi }
			
			d_bektashi = {
				holder_scope = {
					liege = {
						NOT = { character = ROOT }
					}
				}
			}
		}
		
		allow = {
			wealth = 300
			custom_tooltip = {
				text = holy_order_donate_cooldown_tt
				NOT = { has_character_modifier = donate_to_holy_order_cooldown }
			}
		}
		
		effect = {
			hidden_effect = {
				add_character_modifier = {
					modifier = donate_to_holy_order_cooldown
					hidden = yes
					years = 1
				}
			}
			
			hidden_tooltip = {
				d_bektashi = {
					holder_scope = {
						character_event = {
							id = SoA.1140
						}
					}
				}
			}
			
			wealth = -300
			piety = 100
		}

		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.1 # Slow it down
			}
		}
	}
	
	expel_the_bektashi = {
		only_independent = yes
		ai = no

		potential = {
			OR = {
				religion = sunni
				religion = zikri
				religion = yazidi
			}
			is_heretic = no
			higher_tier_than = DUKE
			independent = yes
			is_title_active = d_bektashi
			NOT = { has_character_modifier = expelled_d_bektashi }
			
			any_realm_province = {
				any_province_lord = {
					d_bektashi = {
						holder_scope = {
							OR = {
								character = PREVPREV
								is_vassal_or_below = PREVPREV
							}
						}
					}
				}
			}
			
			has_dlc = "Sons of Abraham"
		}
		
		allow = {
			piety = 1000
			custom_tooltip = {
				text = expelling_holy_order_decision_tooltip
				hidden_tooltip = {
					NOT = { has_character_flag = expel_the_bektashi_check }
				}
			}
		}
		
		effect = {
			set_character_flag = expel_the_bektashi_check
			custom_tooltip = {
				text = expelling_holy_order_decision_tooltip_b
				hidden_tooltip = {
					character_event = { id = SoA.2990 }
				}
			}
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 0
		}
	}
	
	borrow_money_haruriyyah = {
		only_playable = yes
		ai_check_interval = 120

		potential = {
			is_playable = yes
			OR = {
				religion = ibadi
				religion = kharijite
			}
			is_heretic = no
			is_title_active = d_haruriyyah
			OR = {
				ai = no
				AND = {
					ai = yes
					higher_tier_than = COUNT
					independent = yes
				}
			}
			NOT = { has_character_modifier = borrowed_from_haruriyyah }
			NOT = { has_character_modifier = expelled_d_haruriyyah }
			NOT = { is_nomadic = yes }
			NOT = { government = order_government }
			
			has_dlc = "Charlemagne"
			
			d_haruriyyah = {
				holder_scope = {
					liege = {
						NOT = { character = ROOT }
					}
				}
			}
		}
		
		allow = {
			d_haruriyyah = {
				holder_scope = {
					wealth = 300
				}
			}

			piety = 100

			custom_tooltip = {
				text = haruriyyah_loan_money_TT

				d_haruriyyah = {
					holder_scope = {
						opinion = {
							who = ROOT
							value = 25
						}
					}
				}
			}
		}
		
		effect = {
			add_character_modifier = {
				name = borrowed_from_haruriyyah
				duration = -1
				inherit = yes
			}
			
			hidden_tooltip = {
				d_haruriyyah = {
					holder_scope = {
						character_event = {
							id = CM.4310
						}
					}
				}
			}
			wealth = 300

			piety = -100
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0
				wealth = 0
			}
			modifier = {
				factor = 0.5 # Slow it down
			}
		}
	}

	donate_money_to_haruriyyah = {
		only_playable = yes
		ai_check_interval = 80

		potential = {
			is_playable = yes
			
			OR = {
				AND = {
					wealth = 1000
					NOR = {
						trait = cynical
						piety = 50
					}
				}
				ai = no
			}

			NOT = { government = order_government }
			
			is_title_active = d_haruriyyah
			
			d_haruriyyah = {
				holder_scope = { 
					religion = ROOT
				}
			}
			
			has_dlc = "Charlemagne"
			
			NOT = { has_character_modifier = expelled_d_haruriyyah }
			
			d_haruriyyah = {
				holder_scope = {
					liege = {
						NOT = { character = ROOT }
					}
				}
			}
		}
		
		allow = {
			wealth = 300
			custom_tooltip = {
				text = holy_order_donate_cooldown_tt
				NOT = { has_character_modifier = donate_to_holy_order_cooldown }
			}
		}
		
		effect = {
			hidden_effect = {
				add_character_modifier = {
					modifier = donate_to_holy_order_cooldown
					hidden = yes
					years = 1
				}
			}
			
			hidden_tooltip = {
				d_haruriyyah = {
					holder_scope = {
						character_event = {
							id = SoA.1140
						}
					}
				}
			}
			
			wealth = -300
			piety = 100
		}

		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.1 # Slow it down
			}
		}
	}
	
	expel_the_haruriyyah = {
		only_independent = yes
		ai = no

		potential = {
			OR = {
				religion = ibadi
				religion = kharijite
			}
			is_heretic = no
			higher_tier_than = DUKE
			independent = yes
			is_title_active = d_haruriyyah
			NOT = { has_character_modifier = expelled_d_haruriyyah }
			
			any_realm_province = {
				any_province_lord = {
					d_haruriyyah = {
						holder_scope = {
							OR = {
								character = PREVPREV
								is_vassal_or_below = PREVPREV
							}
						}
					}
				}
			}
			
			has_dlc = "Charlemagne"
		}
		
		allow = {
			piety = 1000
			custom_tooltip = {
				text = expelling_holy_order_decision_tooltip
				hidden_tooltip = {
					NOT = { has_character_flag = expel_the_haruriyyah_check }
				}
			}
		}
		
		effect = {
			set_character_flag = expel_the_haruriyyah_check
			custom_tooltip = {
				text = expelling_holy_order_decision_tooltip_b
				hidden_tooltip = {
					character_event = { id = SoA.2990 }
				}
			}
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 0
		}
	}
	
	vassalize_knights_templar = {
		only_playable = yes
		is_high_prio = yes
		ai_check_interval = 60
		
		potential = {
			is_playable = yes
			
			OR = {
				religion = catholic
				religion = cathar
				religion = fraticelli
				religion = waldensian
				religion = lollard
			}
			
			NOT = { has_character_modifier = expelled_d_knights_templar }

			NOT = {
				d_knights_templar = {
					owner = {
						has_opinion_modifier = {
							who = ROOT
							modifier = opinion_unfit_ruler
						}
					}
				}
			}
			
			is_title_active = d_knights_templar
			
			has_landed_title = k_jerusalem
			
			has_dlc = "Sons of Abraham"
			
			d_knights_templar = {
				holder_scope = {
					NOT = { has_truce = ROOT }
					ROOT = { NOT = { has_truce = PREV } }
					liege = {
						NOT = { character = ROOT }
					}
					NOT = { num_of_count_titles = 3 }
					independent = yes
					primary_title = { title = d_knights_templar }
				}
			}

			NOT = {
				has_alternate_start_parameter = { key = religion_names value = random }
			}
		}
		
		allow = {
			wealth = 500
			is_heretic = no
			independent = yes

			conditional_tooltip = {
				trigger = {
					NOT = {
						d_knights_templar = {
							owner = {
								opinion = {
									who = ROOT
									value = 25
								}
							}
						}
					}
				}

				custom_tooltip = {
					text = vassalize_knights_templar_opinion_TT

					d_knights_templar = {
						owner = {
							opinion = {
								who = ROOT
								value = 25
							}
						}
					}
				}
			}

			NOT = {
				trait = excommunicated
			}

			custom_tooltip = {
				text = only_one_vassalized_holy_order_TT

				NOT = {
					any_realm_lord = {
						holy_order = yes
					}
				}
			}
		}
		
		effect = {
			wealth = -500
			
			hidden_tooltip = {
				d_knights_templar = {
					holder_scope = {
						wealth = 500
						character_event = {
							id = SoA.1015
						}
					}
				}
			}
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 1
		}
	}
	
	vassalize_knights_hospitaler = {
		only_playable = yes
		is_high_prio = yes
		ai_check_interval = 60
		
		potential = {
			is_playable = yes
			OR = {
				religion = catholic
				religion = cathar
				religion = fraticelli
				religion = waldensian
				religion = lollard
			}
			
			NOT = { has_character_modifier = expelled_d_knights_hospitaler }

			NOT = {
				d_knights_hospitaler = {
					owner = {
						has_opinion_modifier = {
							who = ROOT
							modifier = opinion_unfit_ruler
						}
					}
				}
			}
			
			is_title_active = d_knights_hospitaler
			
			has_landed_title = k_jerusalem
			
			d_knights_hospitaler = {
				holder_scope = {
					NOT = { has_truce = ROOT }
					ROOT = { NOT = { has_truce = PREV } }
					liege = {
						NOT = { character = ROOT }
					}
					NOT = { num_of_count_titles = 3 }
					independent = yes
					primary_title = { title = d_knights_hospitaler }
				}
			}
			
			has_dlc = "Sons of Abraham"
			
			NOT = {
				has_alternate_start_parameter = { key = religion_names value = random }
			}
		}
		
		allow = {
			wealth = 500
			is_heretic = no
			independent = yes

			conditional_tooltip = {
				trigger = {
					NOT = {
						d_knights_hospitaler = {
							owner = {
								opinion = {
									who = ROOT
									value = 25
								}
							}
						}
					}
				}

				custom_tooltip = {
					text = vassalize_knights_hospitaller_opinion_TT

					d_knights_hospitaler = {
						owner = {
							opinion = {
								who = ROOT
								value = 25
							}
						}
					}
				}
			}

			NOT = {
				trait = excommunicated
			}

			custom_tooltip = {
				text = only_one_vassalized_holy_order_TT

				NOT = {
					any_realm_lord = {
						holy_order = yes
					}
				}
			}
		}
		
		effect = {
			wealth = -500
			
			hidden_tooltip = {
				d_knights_hospitaler = {
					holder_scope = {
						wealth = 500
						character_event = {
							id = SoA.1115
						}
					}
				}
			}
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 1
		}
	}
	
	expel_the_holy_sepulchre = {
		only_independent = yes
		ai = no

		potential = {
			OR = {
				religion = orthodox
				religion = bogomilist
				religion = monothelite
				religion = iconoclast
				religion = paulician
			}
			is_heretic = no
			higher_tier_than = DUKE
			independent = yes
			is_title_active = d_holy_sepulchre
			NOT = { has_character_modifier = expelled_d_holy_sepulchre }
			
			any_realm_province = {
				any_province_lord = {
					d_holy_sepulchre = {
						holder_scope = {
							OR = {
								character = PREVPREV
								is_vassal_or_below = PREVPREV
							}
						}
					}
				}
			}
			
			has_dlc = "Sons of Abraham"
		}
		
		allow = {
			piety = 1000
			custom_tooltip = {
				text = expelling_holy_order_decision_tooltip
				hidden_tooltip = {
					NOT = { has_character_flag = expel_the_holy_sepulchre_check }
				}
			}
		}
		
		effect = {
			set_character_flag = expel_the_holy_sepulchre_check
			custom_tooltip = {
				text = expelling_holy_order_decision_tooltip_b
				hidden_tooltip = {
					character_event = { id = SoA.2990 }
				}
			}
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 0
		}
	}
	
	donate_money_to_holy_sepulchre = {
		only_playable = yes
		ai_check_interval = 80

		potential = {
			is_playable = yes
			
			OR = {
				AND = {
					wealth = 1000
					NOR = {
						trait = cynical
						piety = 50
					}
				}
				ai = no
			}
			
			NOT = { government = order_government }

			is_title_active = d_holy_sepulchre
			
			d_holy_sepulchre = {
				holder_scope = { 
					religion = ROOT
				}
			}
			
			NOT = { has_character_modifier = expelled_d_holy_sepulchre }
			
			d_holy_sepulchre = {
				holder_scope = {
					liege = {
						NOT = { character = ROOT }
					}
				}
			}
			
			has_dlc = "Sons of Abraham"
		}
		
		allow = {
			wealth = 300
			custom_tooltip = {
				text = holy_order_donate_cooldown_tt
				NOT = { has_character_modifier = donate_to_holy_order_cooldown }
			}
		}
		
		effect = {
			hidden_effect = {
				add_character_modifier = {
					modifier = donate_to_holy_order_cooldown
					hidden = yes
					years = 1
				}
			}
			if = {
				limit = { 
					NOT = { has_character_modifier = donated_to_holy_order }
				}
				add_character_modifier = {
					name = donated_to_holy_order
					duration = -1
				}
			}
			
			hidden_tooltip = {
				d_holy_sepulchre = {
					holder_scope = {
						character_event = {
							id = SoA.1640
						}
					}
				}
			}
			
			wealth = -300
			piety = 100
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.1 # Slow it down
			}
		}
	}
	
	expel_saint_anthony = {
		only_independent = yes
		ai = no

		potential = {
			OR = {
				religion = miaphysite
				religion = monophysite
			}
			is_heretic = no
			higher_tier_than = DUKE
			independent = yes
			is_title_active = d_saint_anthony
			NOT = { has_character_modifier = expelled_d_saint_anthony }
			
			any_realm_province = {
				any_province_lord = {
					d_saint_anthony = {
						holder_scope = {
							OR = {
								character = PREVPREV
								is_vassal_or_below = PREVPREV
							}
						}
					}
				}
			}
			
			has_dlc = "Sons of Abraham"
		}
		
		allow = {
			piety = 1000
			custom_tooltip = {
				text = expelling_holy_order_decision_tooltip
				hidden_tooltip = {
					NOT = { has_character_flag = expel_saint_anthony_check }
				}
			}
		}
		
		effect = {
			set_character_flag = expel_saint_anthony_check
			custom_tooltip = {
				text = expelling_holy_order_decision_tooltip_b
				hidden_tooltip = {
					character_event = { id = SoA.2990 }
				}
			}
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 0
		}
	}
	
	donate_money_to_saint_anthony = {
		only_playable = yes
		ai_check_interval = 80
		potential = {
			is_playable = yes
			
			OR = {
				AND = {
					wealth = 1000
					NOR = {
						trait = cynical
						piety = 50
					}
				}
				ai = no
			}
			
			NOT = { government = order_government }

			is_title_active = d_saint_anthony
			
			d_saint_anthony = {
				holder_scope = { 
					religion = ROOT
				}
			}
			
			NOT = { has_character_modifier = expelled_d_saint_anthony }
			
			d_saint_anthony = {
				holder_scope = {
					liege = {
						NOT = { character = ROOT }
					}
				}
			}
			
			has_dlc = "Sons of Abraham"
		}
		
		allow = {
			wealth = 300
			custom_tooltip = {
				text = holy_order_donate_cooldown_tt
				NOT = { has_character_modifier = donate_to_holy_order_cooldown }
			}
		}
		
		effect = {
			hidden_effect = {
				add_character_modifier = {
					modifier = donate_to_holy_order_cooldown
					hidden = yes
					years = 1
				}
			}
			if = {
				limit = { 
					NOT = { has_character_modifier = donated_to_holy_order }
				}
				add_character_modifier = {
					name = donated_to_holy_order
					duration = -1
				}
			}
			
			hidden_tooltip = {
				d_saint_anthony = {
					holder_scope = {
						character_event = {
							id = SoA.1740
						}
					}
				}
			}
			
			wealth = -300
			piety = 100
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.1 # Slow it down
			}
		}
	}
	
	expel_immortals = {
		only_independent = yes
		ai = no

		potential = {
			OR = {
				religion = zoroastrian
				religion = mazdaki
			}
			is_heretic = no
			higher_tier_than = DUKE
			independent = yes
			is_title_active = d_immortals
			NOT = { has_character_modifier = expelled_d_immortals }
			
			any_realm_province = {
				any_province_lord = {
					d_immortals = {
						holder_scope = {
							OR = {
								character = PREVPREV
								is_vassal_or_below = PREVPREV
							}
						}
					}
				}
			}
			
			has_dlc = "Sons of Abraham"
		}
		
		allow = {
			piety = 1000
			custom_tooltip = {
				text = expelling_holy_order_decision_tooltip
				hidden_tooltip = {
					NOT = { has_character_flag = expel_immortals_check }
				}
			}
		}
		
		effect = {
			set_character_flag = expel_immortals_check
			custom_tooltip = {
				text = expelling_holy_order_decision_tooltip_b
				hidden_tooltip = {
					character_event = { id = SoA.2990 }
				}
			}
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 0
		}
	}
	
	donate_money_to_the_immortals = {
		only_playable = yes
		ai_check_interval = 80
		potential = {
			is_playable = yes
			
			OR = {
				AND = {
					wealth = 1000
					NOR = {
						trait = cynical
						piety = 50
					}
				}
				ai = no
			}
			
			NOT = { government = order_government }

			is_title_active = d_immortals
			
			d_immortals = {
				holder_scope = { 
					religion = ROOT
				}
			}
			
			NOT = { has_character_modifier = expelled_d_immortals }
			
			has_dlc = "Sons of Abraham"
			
			d_immortals = {
				holder_scope = {
					liege = {
						NOT = { character = ROOT }
					}
				}
			}
		}
		
		allow = {
			wealth = 300
			custom_tooltip = {
				text = holy_order_donate_cooldown_tt
				NOT = { has_character_modifier = donate_to_holy_order_cooldown }
			}
		}
		
		effect = {
			hidden_effect = {
				add_character_modifier = {
					modifier = donate_to_holy_order_cooldown
					hidden = yes
					years = 1
				}
			}
			if = {
				limit = { 
					NOT = { has_character_modifier = donated_to_holy_order }
				}
				add_character_modifier = {
					name = donated_to_holy_order
					duration = -1
				}
			}
			
			hidden_tooltip = {
				d_immortals = {
					holder_scope = {
						character_event = {
							id = SoA.1840
						}
					}
				}
			}
			
			wealth = -300
			piety = 100
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.1 # Slow it down
			}
		}
	}
	
	expel_zealots = {
		only_independent = yes
		ai = no

		potential = {
			OR = {
				religion = jewish
				religion = samaritan
				religion = karaite
			}
			is_heretic = no
			higher_tier_than = DUKE
			independent = yes
			is_title_active = d_zealots
			NOT = { has_character_modifier = expelled_d_zealots }
			
			any_realm_province = {
				any_province_lord = {
					d_zealots = {
						holder_scope = {
							OR = {
								character = PREVPREV
								is_vassal_or_below = PREVPREV
							}
						}
					}
				}
			}
			
			has_dlc = "Sons of Abraham"
		}
		
		allow = {
			piety = 1000
			custom_tooltip = {
				text = expelling_holy_order_decision_tooltip
				hidden_tooltip = {
					NOT = { has_character_flag = expel_zealots_check }
				}
			}
		}
		
		effect = {
			set_character_flag = expel_zealots_check
			custom_tooltip = {
				text = expelling_holy_order_decision_tooltip_b
				hidden_tooltip = {
					character_event = { id = SoA.2990 }
				}
			}
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 0
		}
	}
	
	donate_money_to_the_zealots = {
		only_playable = yes
		ai_check_interval = 80

		potential = {
			is_playable = yes
			
			OR = {
				AND = {
					wealth = 1000
					NOR = {
						trait = cynical
						piety = 50
					}
				}
				ai = no
			}
			
			NOT = { government = order_government }

			is_title_active = d_zealots
			
			d_zealots = {
				holder_scope = { 
					religion = ROOT
				}
			}
			
			has_dlc = "Sons of Abraham"
			
			NOT = { has_character_modifier = expelled_d_zealots }
			
			d_zealots = {
				holder_scope = {
					liege = {
						NOT = { character = ROOT }
					}
				}
			}
		}
		
		allow = {
			wealth = 300
			custom_tooltip = {
				text = holy_order_donate_cooldown_tt
				NOT = { has_character_modifier = donate_to_holy_order_cooldown }
			}
		}
		
		effect = {
			hidden_effect = {
				add_character_modifier = {
					modifier = donate_to_holy_order_cooldown
					hidden = yes
					years = 1
				}
			}
			if = {
				limit = { 
					NOT = { has_character_modifier = donated_to_holy_order }
				}
				add_character_modifier = {
					name = donated_to_holy_order
					duration = -1
				}
			}
			
			hidden_tooltip = {
				d_zealots = {
					holder_scope = {
						character_event = {
							id = SoA.1940
						}
					}
				}
			}
			
			wealth = -300
			piety = 100
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.1 # Slow it down
			}
		}
	}
	
	expel_sky_lords = {
		only_independent = yes
		ai = no

		potential = {
			religion = tengri_pagan_reformed
			higher_tier_than = DUKE
			independent = yes
			is_title_active = d_sky_lords
			NOT = { has_character_modifier = expelled_d_sky_lords }
			
			any_realm_province = {
				any_province_lord = {
					d_sky_lords = {
						holder_scope = {
							OR = {
								character = PREVPREV
								is_vassal_or_below = PREVPREV
							}
						}
					}
				}
			}
			
			has_dlc = "Sons of Abraham"
		}
		
		allow = {
			piety = 1000
			custom_tooltip = {
				text = expelling_holy_order_decision_tooltip
				hidden_tooltip = {
					NOT = { has_character_flag = expel_sky_lords_check }
				}
			}
		}
		
		effect = {
			set_character_flag = expel_sky_lords_check
			custom_tooltip = {
				text = expelling_holy_order_decision_tooltip_b
				hidden_tooltip = {
					character_event = { id = SoA.2990 }
				}
			}
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 0
		}
	}
	
	donate_money_to_sky_lords = {
		only_playable = yes
		ai_check_interval = 80

		potential = {
			is_playable = yes
			
			religion = tengri_pagan_reformed
		
			OR = {
				AND = {
					wealth = 1000
					NOR = {
						trait = cynical
						piety = 50
					}
				}
				ai = no
			}

			NOT = { government = order_government }
			
			is_title_active = d_sky_lords
			
			has_dlc = "Sons of Abraham"
			
			NOT = { has_character_modifier = expelled_d_sky_lords }
			
			d_sky_lords = {
				holder_scope = {
					liege = {
						NOT = { character = ROOT }
					}
				}
			}
		}
		
		allow = {
			wealth = 300
			custom_tooltip = {
				text = holy_order_donate_cooldown_tt
				NOT = { has_character_modifier = donate_to_holy_order_cooldown }
			}
		}
		
		effect = {
			hidden_effect = {
				add_character_modifier = {
					modifier = donate_to_holy_order_cooldown
					hidden = yes
					years = 1
				}
			}
			if = {
				limit = { 
					NOT = { has_character_modifier = donated_to_holy_order }
				}
				add_character_modifier = {
					name = donated_to_holy_order
					duration = -1
				}
			}
			
			hidden_tooltip = {
				d_sky_lords = {
					holder_scope = {
						character_event = {
							id = SoA.2040
						}
					}
				}
			}
			
			wealth = -300
			piety = 100
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.1 # Slow it down
			}
		}
	}
	
	expel_spirit_guardians = {
		only_independent = yes
		ai = no

		potential = {
			religion = west_african_pagan_reformed
			higher_tier_than = DUKE
			independent = yes
			is_title_active = d_spirit_guardians
			NOT = { has_character_modifier = expelled_d_spirit_guardians }
			
			any_realm_province = {
				any_province_lord = {
					d_spirit_guardians = {
						holder_scope = {
							OR = {
								character = PREVPREV
								is_vassal_or_below = PREVPREV
							}
						}
					}
				}
			}
			
			has_dlc = "Sons of Abraham"
		}
		
		allow = {
			piety = 1000
			custom_tooltip = {
				text = expelling_holy_order_decision_tooltip
				hidden_tooltip = {
					NOT = { has_character_flag = expel_spirit_guardians_check }
				}
			}
		}
		
		effect = {
			set_character_flag = expel_spirit_guardians_check
			custom_tooltip = {
				text = expelling_holy_order_decision_tooltip_b
				hidden_tooltip = {
					character_event = { id = SoA.2990 }
				}
			}
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 0
		}
	}
	
	donate_money_to_spirit_guardians = {
		only_playable = yes
		ai_check_interval = 80

		potential = {
			is_playable = yes
			
			religion = west_african_pagan_reformed
		
			OR = {
				AND = {
					wealth = 1000
					NOR = {
						trait = cynical
						piety = 50
					}
				}
				ai = no
			}
			
			NOT = { government = order_government }
			
			is_title_active = d_spirit_guardians
			
			has_dlc = "Sons of Abraham"
			
			NOT = { has_character_modifier = expelled_d_spirit_guardians }
			
			d_spirit_guardians = {
				holder_scope = {
					liege = {
						NOT = { character = ROOT }
					}
				}
			}
		}
		
		allow = {
			wealth = 300
			custom_tooltip = {
				text = holy_order_donate_cooldown_tt
				NOT = { has_character_modifier = donate_to_holy_order_cooldown }
			}
		}
		
		effect = {
			hidden_effect = {
				add_character_modifier = {
					modifier = donate_to_holy_order_cooldown
					hidden = yes
					years = 1
				}
			}
			if = {
				limit = { 
					NOT = { has_character_modifier = donated_to_holy_order }
				}
				add_character_modifier = {
					name = donated_to_holy_order
					duration = -1
				}
			}
			
			hidden_tooltip = {
				d_spirit_guardians = {
					holder_scope = {
						character_event = {
							id = SoA.2140
						}
					}
				}
			}
			
			wealth = -300
			piety = 100
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.1 # Slow it down
			}
		}
	}
	
	expel_warriors_perun = {
		only_independent = yes
		ai = no

		potential = {
			religion = slavic_pagan_reformed
			higher_tier_than = DUKE
			independent = yes
			is_title_active = d_warriors_perun
			NOT = { has_character_modifier = expelled_d_warriors_perun }
			
			any_realm_province = {
				any_province_lord = {
					d_warriors_perun = {
						holder_scope = {
							OR = {
								character = PREVPREV
								is_vassal_or_below = PREVPREV
							}
						}
					}
				}
			}
			
			has_dlc = "Sons of Abraham"
		}
		
		allow = {
			piety = 1000
			custom_tooltip = {
				text = expelling_holy_order_decision_tooltip
				hidden_tooltip = {
					NOT = { has_character_flag = expel_warriors_perun_check }
				}
			}
		}
		
		effect = {
			set_character_flag = expel_warriors_perun_check
			custom_tooltip = {
				text = expelling_holy_order_decision_tooltip_b
				hidden_tooltip = {
					character_event = { id = SoA.2990 }
				}
			}
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 0
		}
	}
	
	donate_money_to_warriors_perun = {
		only_playable = yes
		ai_check_interval = 80

		potential = {
			is_playable = yes
			
			religion = slavic_pagan_reformed
			
			OR = {
				AND = {
					wealth = 1000
					NOR = {
						trait = cynical
						piety = 50
					}
				}
				ai = no
			}

			NOT = { government = order_government }
			
			is_title_active = d_warriors_perun
			
			NOT = { has_character_modifier = expelled_d_warriors_perun }
			
			has_dlc = "Sons of Abraham"
			
			d_warriors_perun = {
				holder_scope = {
					liege = {
						NOT = { character = ROOT }
					}
				}
			}
		}
		
		allow = {
			wealth = 300
			custom_tooltip = {
				text = holy_order_donate_cooldown_tt
				NOT = { has_character_modifier = donate_to_holy_order_cooldown }
			}
		}
		
		effect = {
			hidden_effect = {
				add_character_modifier = {
					modifier = donate_to_holy_order_cooldown
					hidden = yes
					years = 1
				}
			}
			if = {
				limit = { 
					NOT = { has_character_modifier = donated_to_holy_order }
				}
				add_character_modifier = {
					name = donated_to_holy_order
					duration = -1
				}
			}
			
			hidden_tooltip = {
				d_warriors_perun = {
					holder_scope = {
						character_event = {
							id = SoA.2240
						}
					}
				}
			}
			
			wealth = -300
			piety = 100
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.1 # Slow it down
			}
		}
	}
	
	expel_chosen_perkunas = {
		only_independent = yes
		ai = no

		potential = {
			religion = baltic_pagan_reformed
			higher_tier_than = DUKE
			independent = yes
			is_title_active = d_chosen_perkunas
			NOT = { has_character_modifier = expelled_d_chosen_perkunas }
			
			any_realm_province = {
				any_province_lord = {
					d_chosen_perkunas = {
						holder_scope = {
							OR = {
								character = PREVPREV
								is_vassal_or_below = PREVPREV
							}
						}
					}
				}
			}
			
			has_dlc = "Sons of Abraham"
		}
		
		allow = {
			piety = 1000
			custom_tooltip = {
				text = expelling_holy_order_decision_tooltip
				hidden_tooltip = {
					NOT = { has_character_flag = expel_chosen_perkunas_check }
				}
			}
		}
		
		effect = {
			set_character_flag = expel_chosen_perkunas_check
			custom_tooltip = {
				text = expelling_holy_order_decision_tooltip_b
				hidden_tooltip = {
					character_event = { id = SoA.2990 }
				}
			}
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 0
		}
	}
	
	donate_money_to_chosen_perkunas = {
		only_playable = yes
		ai_check_interval = 80

		potential = {
			is_playable = yes
			
			religion = baltic_pagan_reformed
			
			OR = {
				AND = {
					wealth = 1000
					NOR = {
						trait = cynical
						piety = 50
					}
				}
				ai = no
			}

			NOT = { government = order_government }
			
			is_title_active = d_chosen_perkunas
			
			has_dlc = "Sons of Abraham"
			
			NOT = { has_character_modifier = expelled_d_chosen_perkunas }
			
			d_chosen_perkunas = {
				holder_scope = {
					liege = {
						NOT = { character = ROOT }
					}
				}
			}
		}
		
		allow = {
			wealth = 300
			custom_tooltip = {
				text = holy_order_donate_cooldown_tt
				NOT = { has_character_modifier = donate_to_holy_order_cooldown }
			}
		}
		
		effect = {
			hidden_effect = {
				add_character_modifier = {
					modifier = donate_to_holy_order_cooldown
					hidden = yes
					years = 1
				}
			}
			if = {
				limit = { 
					NOT = { has_character_modifier = donated_to_holy_order }
				}
				add_character_modifier = {
					name = donated_to_holy_order
					duration = -1
				}
			}
			
			hidden_tooltip = {
				d_chosen_perkunas = {
					holder_scope = {
						character_event = {
							id = SoA.2340
						}
					}
				}
			}
			
			wealth = -300
			piety = 100
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.1 # Slow it down
			}
		}
	}
	
	expel_sons_kaleva = {
		only_independent = yes
		ai = no

		potential = {
			religion = finnish_pagan_reformed
			higher_tier_than = DUKE
			independent = yes
			is_title_active = d_sons_kaleva
			NOT = { has_character_modifier = expelled_d_sons_kaleva }
			
			any_realm_province = {
				any_province_lord = {
					d_chosen_perkunas = {
						holder_scope = {
							OR = {
								character = PREVPREV
								is_vassal_or_below = PREVPREV
							}
						}
					}
				}
			}
			
			has_dlc = "Sons of Abraham"
		}
		
		allow = {
			piety = 1000
			custom_tooltip = {
				text = expelling_holy_order_decision_tooltip
				hidden_tooltip = {
					NOT = { has_character_flag = expel_sons_kaleva_check }
				}
			}
		}
		
		effect = {
			set_character_flag = expel_sons_kaleva_check
			custom_tooltip = {
				text = expelling_holy_order_decision_tooltip_b
				hidden_tooltip = {
					character_event = { id = SoA.2990 }
				}
			}
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 0
		}
	}
	
	donate_money_to_sons_kaleva = {
		only_playable = yes
		ai_check_interval = 80

		potential = {
			is_playable = yes
			
			religion = finnish_pagan_reformed
			
			OR = {
				AND = {
					wealth = 1000
					NOR = {
						trait = cynical
						piety = 50
					}
				}
				ai = no
			}

			NOT = { government = order_government }
			
			is_title_active = d_sons_kaleva
			
			has_dlc = "Sons of Abraham"
			
			NOT = { has_character_modifier = expelled_d_sons_kaleva }
			
			d_sons_kaleva = {
				holder_scope = {
					liege = {
						NOT = { character = ROOT }
					}
				}
			}
		}
		
		allow = {
			wealth = 300
			custom_tooltip = {
				text = holy_order_donate_cooldown_tt
				NOT = { has_character_modifier = donate_to_holy_order_cooldown }
			}
		}
		
		effect = {
			hidden_effect = {
				add_character_modifier = {
					modifier = donate_to_holy_order_cooldown
					hidden = yes
					years = 1
				}
			}
			if = {
				limit = { 
					NOT = { has_character_modifier = donated_to_holy_order }
				}
				add_character_modifier = {
					name = donated_to_holy_order
					duration = -1
				}
			}
			
			hidden_tooltip = {
				d_sons_kaleva = {
					holder_scope = {
						character_event = {
							id = SoA.2440
						}
					}
				}
			}
			
			wealth = -300
			piety = 100
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.1 # Slow it down
			}
		}
	}
	
	expel_huitzilopochtli = {
		only_independent = yes
		ai = no

		potential = {
			religion = aztec_reformed
			higher_tier_than = DUKE
			independent = yes
			is_title_active = d_huitzilopochtli
			NOT = { has_character_modifier = expelled_d_huitzilopochtli }
			
			any_realm_province = {
				any_province_lord = {
					d_huitzilopochtli = {
						holder_scope = {
							OR = {
								character = PREVPREV
								is_vassal_or_below = PREVPREV
							}
						}
					}
				}
			}
			
			has_dlc = "Sons of Abraham"
		}
		
		allow = {
			piety = 1000
			custom_tooltip = {
				text = expelling_holy_order_decision_tooltip
				hidden_tooltip = {
					NOT = { has_character_flag = expel_huitzilopochtli_check }
				}
			}
		}
		
		effect = {
			set_character_flag = expel_huitzilopochtli_check
			custom_tooltip = {
				text = expelling_holy_order_decision_tooltip_b
				hidden_tooltip = {
					character_event = { id = SoA.2990 }
				}
			}
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 0
		}
	}
	
	donate_money_to_huitzilopochtli = {
		only_playable = yes
		ai_check_interval = 80

		potential = {
			is_playable = yes
			
			religion = aztec_reformed
			
			OR = {
				AND = {
					wealth = 1000
					NOR = {
						trait = cynical
						piety = 50
					}
				}
				ai = no
			}

			NOT = { government = order_government }
			
			is_title_active = d_huitzilopochtli
			
			has_dlc = "Sons of Abraham"
			
			NOT = { has_character_modifier = expelled_d_huitzilopochtli }
			
			d_huitzilopochtli = {
				holder_scope = {
					liege = {
						NOT = { character = ROOT }
					}
				}
			}
		}
		
		allow = {
			wealth = 300
			custom_tooltip = {
				text = holy_order_donate_cooldown_tt
				NOT = { has_character_modifier = donate_to_holy_order_cooldown }
			}
		}
		
		effect = {
			hidden_effect = {
				add_character_modifier = {
					modifier = donate_to_holy_order_cooldown
					hidden = yes
					years = 1
				}
			}
			if = {
				limit = { 
					NOT = { has_character_modifier = donated_to_holy_order }
				}
				add_character_modifier = {
					name = donated_to_holy_order
					duration = -1
				}
			}
			
			hidden_tooltip = {
				d_huitzilopochtli = {
					holder_scope = {
						character_event = {
							id = SoA.2540
						}
					}
				}
			}
			
			wealth = -300
			piety = 100
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.1 # Slow it down
			}
		}
	}
	
	expel_knights_santiago = {
		only_independent = yes
		ai = no

		potential = {
			OR = {
				religion = catholic
				religion = cathar
				religion = fraticelli
				religion = waldensian
				religion = lollard
			}
			is_heretic = no
			higher_tier_than = DUKE
			independent = yes
			is_title_active = d_knights_santiago
			NOT = { has_character_modifier = expelled_d_knights_santiago }
			
			any_realm_province = {
				any_province_lord = {
					d_knights_santiago = {
						holder_scope = {
							OR = {
								character = PREVPREV
								is_vassal_or_below = PREVPREV
							}
						}
					}
				}
			}
			
			has_dlc = "Sons of Abraham"
		}
		
		allow = {
			piety = 1000
			custom_tooltip = {
				text = expelling_holy_order_decision_tooltip
				hidden_tooltip = {
					NOT = { has_character_flag = expel_knights_santiago_check }
				}
			}
		}
		
		effect = {
			set_character_flag = expel_knights_santiago_check
			custom_tooltip = {
				text = expelling_holy_order_decision_tooltip_b
				hidden_tooltip = {
					character_event = { id = SoA.2990 }
				}
			}
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 0
		}
	}
	
	donate_money_to_knights_santiago = {
		only_playable = yes
		ai_check_interval = 80

		potential = {
			is_playable = yes
			
			OR = {
				AND = {
					wealth = 1000
					NOR = {
						trait = cynical
						piety = 50
					}
				}
				ai = no
			}

			NOT = { government = order_government }
			
			is_title_active = d_knights_santiago
			
			d_knights_santiago = {
				holder_scope = { 
					religion = ROOT
				}
			}
			
			NOT = { has_character_modifier = expelled_d_knights_santiago }

			OR = {
				AND = {
					NOT = { is_title_active = d_knights_hospitaler }
					NOT = { is_title_active = d_knights_templar }
					NOT = { is_title_active = d_teutonic_order }
				}
				AND = {
					NOT = { is_title_active = d_knights_templar }
					NOT = { is_title_active = d_knights_hospitaler }
					NOT = { culture_group = north_germanic }
					NOT = { culture_group = central_germanic }
					NOT = { culture_group = magyar }
					NOT = { culture_group = south_slavic }
					NOT = { culture_group = west_slavic }
				}
				culture_group = iberian
				culture_group = west_african
				culture = maghreb_arabic
				culture = occitan
			}
			
			has_dlc = "Sons of Abraham"
			
			d_knights_santiago = {
				holder_scope = {
					liege = {
						NOT = { character = ROOT }
					}
				}
			}
		}
		
		allow = {
			wealth = 300
			custom_tooltip = {
				text = holy_order_donate_cooldown_tt
				NOT = { has_character_modifier = donate_to_holy_order_cooldown }
			}
		}
		
		effect = {
			hidden_effect = {
				add_character_modifier = {
					modifier = donate_to_holy_order_cooldown
					hidden = yes
					years = 1
				}
			}
			if = {
				limit = { 
					NOT = { has_character_modifier = donated_to_holy_order }
				}
				add_character_modifier = {
					name = donated_to_holy_order
					duration = -1
				}
			}
			
			hidden_tooltip = {
				d_knights_santiago = {
					holder_scope = {
						character_event = {
							id = SoA.2640
						}
					}
				}
			}
			
			wealth = -300
			piety = 100
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.1 # Slow it down
			}
		}
	}
	
	expel_knights_calatrava = {
		only_independent = yes
		ai = no

		potential = {
			OR = {
				religion = catholic
				religion = cathar
				religion = fraticelli
				religion = waldensian
				religion = lollard
			}
			is_heretic = no
			higher_tier_than = DUKE
			independent = yes
			is_title_active = d_knights_calatrava
			NOT = { has_character_modifier = expelled_d_knights_calatrava }
			
			any_realm_province = {
				any_province_lord = {
					d_knights_calatrava = {
						holder_scope = {
							OR = {
								character = PREVPREV
								is_vassal_or_below = PREVPREV
							}
						}
					}
				}
			}
			
			has_dlc = "Sons of Abraham"
		}
		
		allow = {
			piety = 1000
			custom_tooltip = {
				text = expelling_holy_order_decision_tooltip
				hidden_tooltip = {
					NOT = { has_character_flag = expel_knights_calatrava_check }
				}
			}
		}
		
		effect = {
			set_character_flag = expel_knights_calatrava_check
			custom_tooltip = {
				text = expelling_holy_order_decision_tooltip_b
				hidden_tooltip = {
					character_event = { id = SoA.2990 }
				}
			}
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 0
		}
	}
	
	donate_money_to_knights_calatrava = {
		only_playable = yes
		ai_check_interval = 80

		potential = {
			is_playable = yes
			
			OR = {
				AND = {
					wealth = 1000
					NOR = {
						trait = cynical
						piety = 50
					}
				}
				ai = no
			}

			NOT = { government = order_government }
			
			is_title_active = d_knights_calatrava
			
			d_knights_calatrava = {
				holder_scope = { 
					religion = ROOT
				}
			}
			
			NOT = { has_character_modifier = expelled_d_knights_calatrava }

			OR = {
				AND = {
					NOT = { is_title_active = d_knights_hospitaler }
					NOT = { is_title_active = d_knights_templar }
					NOT = { is_title_active = d_teutonic_order }
				}
				AND = {
					NOT = { is_title_active = d_knights_templar }
					NOT = { is_title_active = d_knights_hospitaler }
					NOT = { culture_group = north_germanic }
					NOT = { culture_group = central_germanic }
					NOT = { culture_group = magyar }
					NOT = { culture_group = south_slavic }
					NOT = { culture_group = west_slavic }
				}
				culture_group = iberian
				culture_group = west_african
				culture = maghreb_arabic
				culture = occitan
			}
			
			has_dlc = "Sons of Abraham"
			
			d_knights_calatrava = {
				holder_scope = {
					liege = {
						NOT = { character = ROOT }
					}
				}
			}
		}
		
		allow = {
			wealth = 300
			custom_tooltip = {
				text = holy_order_donate_cooldown_tt
				NOT = { has_character_modifier = donate_to_holy_order_cooldown }
			}
		}
		
		effect = {
			hidden_effect = {
				add_character_modifier = {
					modifier = donate_to_holy_order_cooldown
					hidden = yes
					years = 1
				}
			}
			if = {
				limit = { 
					NOT = { has_character_modifier = donated_to_holy_order }
				}
				add_character_modifier = {
					name = donated_to_holy_order
					duration = -1
				}
			}
			
			hidden_tooltip = {
				d_knights_calatrava = {
					holder_scope = {
						character_event = {
							id = SoA.2740
						}
					}
				}
			}
			
			wealth = -300
			piety = 100
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.1 # Slow it down
			}
		}
	}
	
	expel_order_of_addai = {
		only_independent = yes
		ai = no

		potential = {
			OR = {
				religion = nestorian
				religion = messalian
			}
			is_heretic = no
			higher_tier_than = DUKE
			independent = yes
			is_title_active = d_saint_addai
			NOT = { has_character_modifier = expelled_d_saint_addai }
			
			any_realm_province = {
				any_province_lord = {
					d_saint_addai = {
						holder_scope = {
							OR = {
								character = PREVPREV
								is_vassal_or_below = PREVPREV
							}
						}
					}
				}
			}
			
			has_dlc = "Sons of Abraham"
		}
		
		allow = {
			piety = 1000
			custom_tooltip = {
				text = expelling_holy_order_decision_tooltip
				hidden_tooltip = {
					NOT = { has_character_flag = expel_order_of_addai_check }
				}
			}
		}
		
		effect = {
			set_character_flag = expel_order_of_addai_check
			custom_tooltip = {
				text = expelling_holy_order_decision_tooltip_b
				hidden_tooltip = {
					character_event = { id = SoA.2990 }
				}
			}
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 0
		}
	}
	
	donate_money_to_order_of_addai = {
		only_playable = yes
		ai_check_interval = 80
		potential = {
			is_playable = yes
			
			OR = {
				AND = {
					wealth = 1000
					NOR = {
						trait = cynical
						piety = 50
					}
				}
				ai = no
			}

			NOT = { government = order_government }
			
			is_title_active = d_saint_addai
			
			d_saint_addai = {
				holder_scope = { 
					religion = ROOT
				}
			}
			
			NOT = { has_character_modifier = expelled_d_saint_addai }
			
			d_saint_addai = {
				holder_scope = {
					liege = {
						NOT = { character = ROOT }
					}
				}
			}
			
			has_dlc = "Sons of Abraham"
		}
		
		allow = {
			wealth = 300
			custom_tooltip = {
				text = holy_order_donate_cooldown_tt
				NOT = { has_character_modifier = donate_to_holy_order_cooldown }
			}
		}
		
		effect = {
			hidden_effect = {
				add_character_modifier = {
					modifier = donate_to_holy_order_cooldown
					hidden = yes
					years = 1
				}
			}
			if = {
				limit = { 
					NOT = { has_character_modifier = donated_to_holy_order }
				}
				add_character_modifier = {
					name = donated_to_holy_order
					duration = -1
				}
			}
			
			hidden_tooltip = {
				d_saint_addai = {
					holder_scope = {
						character_event = {
							id = SoA.2840
						}
					}
				}
			}
			
			wealth = -300
			piety = 100
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.1 # Slow it down
			}
		}
	}
	expel_zun_warriors = {
		only_independent = yes
		ai = no

		potential = {
			religion = zun_pagan_reformed
			higher_tier_than = DUKE
			independent = yes
			is_title_active = d_zun_warriors
			NOT = { has_character_modifier = expelled_d_zun_warriors }
			
			any_realm_province = {
				any_province_lord = {
					d_zun_warriors = {
						holder_scope = {
							OR = {
								character = PREVPREV
								is_vassal_or_below = PREVPREV
							}
						}
					}
				}
			}
			has_dlc = "Charlemagne"
		}
		
		allow = {
			piety = 1000
			custom_tooltip = {
				text = expelling_holy_order_decision_tooltip
				hidden_tooltip = {
					NOT = { has_character_flag = expel_zun_warriors_check }
				}
			}
		}
		
		effect = {
			set_character_flag = expel_zun_warriors_check
			custom_tooltip = {
				text = expelling_holy_order_decision_tooltip_b
				hidden_tooltip = {
					character_event = { id = SoA.2990 }
				}
			}
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 0
		}
	}
	donate_money_to_zun_warriors = {
		only_playable = yes
		ai_check_interval = 80

		potential = {
			is_playable = yes
			
			religion = zun_pagan_reformed
			
			OR = {
				AND = {
					wealth = 1000
					NOR = {
						trait = cynical
						piety = 50
					}
				}
				ai = no
			}

			NOT = { government = order_government }
			
			is_title_active = d_zun_warriors
			
			has_dlc = "Charlemagne"
			
			NOT = { has_character_modifier = expelled_d_zun_warriors }
			
			d_zun_warriors = {
				holder_scope = {
					liege = {
						NOT = { character = ROOT }
					}
				}
			}
		}
		
		allow = {
			wealth = 300
			custom_tooltip = {
				text = holy_order_donate_cooldown_tt
				NOT = { has_character_modifier = donate_to_holy_order_cooldown }
			}
		}
		
		effect = {
			hidden_effect = {
				add_character_modifier = {
					modifier = donate_to_holy_order_cooldown
					hidden = yes
					years = 1
				}
			}
			if = {
				limit = { 
					NOT = { has_character_modifier = donated_to_holy_order }
				}
				add_character_modifier = {
					name = donated_to_holy_order
					duration = -1
				}
			}
			
			hidden_tooltip = {
				d_zun_warriors = {
					holder_scope = {
						character_event = {
							id = CM.4005
						}
					}
				}
			}
			
			wealth = -300
			piety = 100
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.1 # Slow it down
			}
		}
	}
	
	form_st_anthony = {
		is_high_prio = yes
		only_playable = yes
		ai_check_interval = 60

		potential = {
			has_dlc = "Sons of Abraham"
			religion = miaphysite
			NOT = { is_title_active = d_saint_anthony }
			is_heretic = no
			OR = {
				has_global_flag = christian_crusades_unlocked #Prevent Army from being created at start.
				has_global_flag = pagan_ghws_unlocked 
				has_global_flag = muslim_jihads_unlocked
			}
			NOT = {
				has_alternate_start_parameter = { key = religion_names value = random }
			}
		}
		allow = {
			piety = 1000
			wealth = 500
		}
		effect = {
			piety = -1000
			wealth = -500
			narrative_event = { id = 39810 tooltip = EVT_39810_TT }
		}
		ai_will_do = {
			factor = 1
		}
	}
	
	form_st_addai = {
		is_high_prio = yes
		only_playable = yes
		ai_check_interval = 60

		potential = {
			has_dlc = "Sons of Abraham"
			religion = nestorian
			NOT = { is_title_active = d_saint_addai }
			is_heretic = no
			OR = {
				has_global_flag = christian_crusades_unlocked #Prevent Army from being created at start.
				has_global_flag = pagan_ghws_unlocked 
				has_global_flag = muslim_jihads_unlocked
			}
			NOT = {
				has_alternate_start_parameter = { key = religion_names value = random }
			}
		}
		allow = {
			piety = 1000
			wealth = 500
		}
		effect = {
			piety = -1000
			wealth = -500
			narrative_event = { id = 39811 tooltip = EVT_39811_TT }
		}
		ai_will_do = {
			factor = 1
		}
	}
	
	organize_army_light = {
		is_high_prio = yes
		only_playable = yes
		ai_check_interval = 60
		
		potential = {
			is_female = no
			prisoner = no
			age = 16
			religion = manichean
			NOT = { has_global_flag = army_light_founded }
			OR = {
				has_global_flag = christian_crusades_unlocked #Prevent Army from being created at start.
				has_global_flag = pagan_ghws_unlocked 
				has_global_flag = muslim_jihads_unlocked
			}	
			NOT = {
				has_alternate_start_parameter = { key = religion_names value = random }
			}
		}
		allow = {
			piety = 1000
			wealth = 500
		}
		effect = {
			set_global_flag = army_light_founded
			prestige = -300
			wealth = -300
			activate_title = { title = d_army_light status = yes }
			hidden_tooltip = {
				create_character = {
					random_traits = yes
					religion = manichean
					culture = ROOT
					dynasty = NONE
					female = no
					age = 34
					trait = skilled_tactician
				}
				new_character = {
					d_army_light = {
						grant_title = PREV
					}
					set_defacto_liege = ROOT
				}
			}
		}
		ai_will_do = {
			factor = 1
		}
	}
}

