decisions = {

	expel_the_braedralag = {
		ai = no

		potential = {
			independent = yes
			higher_real_tier_than = DUKE
			has_dlc = "Sons of Abraham"
			is_title_active = d_braedralag
			religion = d_braedralag
			NOT = { has_character_modifier = expelled_d_braedralag }

			any_realm_province = {
				held_under_PREV = yes

				any_province_lord = {
					OR = {
						character = d_braedralag
						is_vassal_or_below_of = d_braedralag
					}
				}
			}
		}

		allow = {
			piety >= 1000

			custom_tooltip = {
				text = expelling_holy_order_decision_tooltip
				NOT = { has_character_flag = expel_the_braedralag_check }
			}
		}

		effect = {
			set_character_flag = expel_the_braedralag_check

			d_harii = {
				save_event_target_as = target_holy_order

				holder_scope = {
					save_event_target_as = target_grandmaster
				}
			}

			character_event = {
				id = SoA.2990
				tooltip = expelling_holy_order_decision_tooltip_b
			}
		}

		ai_will_do = {
			factor = 0
		}
	}

	expel_the_harii = {
		ai = no

		potential = {
			independent = yes
			higher_real_tier_than = DUKE
			has_dlc = "Sons of Abraham"
			is_title_active = d_harii
			religion = d_harii
			NOT = { has_character_modifier = expelled_d_harii }

			any_realm_province = {
				held_under_PREV = yes

				any_province_lord = {
					OR = {
						character = d_harii
						is_vassal_or_below_of = d_harii
					}
				}
			}
		}

		allow = {
			piety >= 1000

			custom_tooltip = {
				text = expelling_holy_order_decision_tooltip
				NOT = { has_character_flag = expel_the_harii_check }
			}
		}

		effect = {
			set_character_flag = expel_the_harii_check

			d_harii = {
				save_event_target_as = target_holy_order

				holder_scope = {
					save_event_target_as = target_grandmaster
				}
			}

			character_event = {
				id = SoA.2990
				tooltip = expelling_holy_order_decision_tooltip_b
			}
		}

		ai_will_do = {
			factor = 0
		}
	}

	donate_money_to_braedralag = {
		ai_check_interval = 60

		only_playable = yes

		potential = {
			has_dlc = "Sons of Abraham"
			is_title_active = d_harii

			OR = {
				religion = d_braedralag
				is_heresy_of = d_braedralag
			}

			d_braedralag = {
				holder_scope = {
					is_within_diplo_range = ROOT
				}
			}

			NOR = {
				government = order_government
				has_character_modifier = expelled_d_braedralag
				is_liege_of = d_braedralag
				has_landed_title = d_braedralag
			}
		}

		allow = {
			wealth >= 300
		}

		effect = {
			wealth = -300
			piety = 150

			if = {
				limit = {
					NOT = { has_character_modifier = donated_to_holy_order }
				}

				add_character_modifier = {
					name = donated_to_holy_order
					duration = -1
				}
			}

			add_character_modifier = {
				name = donate_to_holy_order_cooldown
				years = 1
				hidden = yes
			}

			d_braedralag = {
				show_scope_change = no

				save_event_target_as = target_holy_order

				holder_scope = {
					show_scope_change = no

					save_event_target_as = target_grandmaster
					wealth = 300
				}
			}

			letter_event = { id = SoA.1141 }
		}

		ai_will_do = {
			factor = 0.12

			trigger = {
				piety < 1000
				wealth >= 1000
				NOT = { has_character_modifier = ai_austerity }
			}
		}
	}

	donate_money_to_harii = {
		ai_check_interval = 80

		only_playable = yes

		potential = {
			has_dlc = "Sons of Abraham"
			is_title_active = d_harii

			OR = {
				religion = d_harii
				is_heresy_of = d_harii
			}

			d_harii = {
				holder_scope = {
					is_within_diplo_range = ROOT
				}
			}

			NOR = {
				government = order_government
				has_character_modifier = expelled_d_harii
				is_liege_of = d_harii
				has_landed_title = d_harii
			}
		}

		allow = {
			wealth >= 300
		}

		effect = {
			wealth = -300
			piety = 150

			if = {
				limit = {
					NOT = { has_character_modifier = donated_to_holy_order }
				}

				add_character_modifier = {
					name = donated_to_holy_order
					duration = -1
				}
			}

			add_character_modifier = {
				name = donate_to_holy_order_cooldown
				years = 1
				hidden = yes
			}

			d_harii = {
				show_scope_change = no

				save_event_target_as = target_holy_order

				holder_scope = {
					show_scope_change = no

					save_event_target_as = target_grandmaster
					wealth = 300
				}
			}

			letter_event = { id = SoA.1141 }
		}

		ai_will_do = {
			factor = 0.12

			trigger = {
				piety < 1000
				wealth >= 1000
				NOT = { has_character_modifier = ai_austerity }
			}
		}
	}
}