decisions = {

	organise_herculeans = {
		is_high_prio = yes
		ai_check_interval = 12

		only_playable = yes

		potential = {
			higher_real_tier_than = COUNT
			religion_openly_hellenic_or_reformed_trigger = yes
			NOT = { has_global_flag = herculeans_founded }
		}

		allow = {
			higher_real_tier_than = DUKE
			prestige >= 300
			wealth >= 300
			is_not_in_regency_trigger = yes
		}

		effect = {
			set_global_flag = herculeans_founded
			prestige = -300
			wealth = -300

			activate_title = {
				title = d_herculean
				status = yes
			}

			hidden_effect = {
				narrative_event = { id = ancrel.2565 }

				create_character = {
					random_traits = yes
					religion = ROOT
					culture = ROOT
					dynasty = none
					female = no
					age = 34
					add_trait = skilled_tactician
				}

				new_character = {
					grant_title = d_herculean
				}
			}
		}

		ai_will_do = {
			factor = 1
		}
	}

	organise_sacred_band = {
		is_high_prio = yes
		ai_check_interval = 12

		only_playable = yes

		potential = {
			higher_real_tier_than = COUNT
			religion_openly_hellenic_or_reformed_trigger = yes
			NOT = { has_global_flag = sacred_band_founded }
		}

		allow = {
			real_tier = EMPEROR
			prestige >= 300
			wealth >= 300
			is_not_in_regency_trigger = yes
		}

		effect = {
			set_global_flag = sacred_band_founded
			prestige = -300
			wealth = -300

			activate_title = {
				title = d_sacred_band
				status = yes
			}

			hidden_effect = {
				narrative_event = { id = ancrel.2567 }

				create_character = {
					random_traits = yes
					religion = ROOT
					culture = ROOT
					dynasty = none
					female = no
					age = 34
					add_trait = skilled_tactician
				}

				new_character = {
					grant_title = d_sacred_band
				}
			}
		}

		ai_will_do = {
			factor = 1
		}
	}

	restore_the_pontifex = {
		is_high_prio = yes
		icon_religion = roman_pagan
		ai_check_interval = 12

		only_playable = yes

		potential = {
			religion = roman_pagan
			higher_real_tier_than = DUKE
			d_roman_pagan = { has_holder = no }
		}

		allow = {
			num_of_holy_sites >= 3
			religion_authority >= 0.6
			wealth >= 300
			piety >= 1000

			custom_tooltip = {
				text = HELLENIC_PRIEST_HOLDS_HOLY_SITE

				any_realm_lord = {
					religion = roman_pagan
					is_theocracy = yes
					capital_holding = { is_holy_site = ROOT }
					prisoner = no
					is_incapable = no
				}
			}

			is_not_in_regency_trigger = yes
		}

		effect = {
			wealth = -300
			prestige = 1000

			if = {
				limit = { NOT = { is_title_active = d_roman_pagan } }

				activate_title = {
					title = d_roman_pagan
					status = yes
				}
			}

			random_realm_lord = {
				show_scope_change = no

				limit = {
					religion = roman_pagan
					is_theocracy = yes
					capital_holding = { is_holy_site = ROOT }
					prisoner = no
					is_incapable = no
				}

				grant_title = d_roman_pagan
				add_friend = ROOT

				hidden_effect = {
					set_defacto_liege = ROOT
					pf_liege_change_effect = yes
					piety = 250
					narrative_event = { id = ancrel.2102 }
				}
			}
		}

		ai_will_do = {
			factor = 1
		}
	}

	replace_pontifex = {
		icon_religion = roman_pagan
		ai_check_interval = 12

		only_independent = yes

		potential = {
			real_tier = EMPEROR
			religion = roman_pagan

			religion_head = {
				is_vassal_or_below_of = ROOT
			}
		}

		allow = {
			piety >= 250

			religion_head = {
				is_vassal_or_below_of = ROOT
				war = no
				NOT = { reverse_has_truce = ROOT }
				NOT = { has_non_aggression_pact_with = ROOT }
			}

			war = no
		}

		effect = {
			piety = -250

			religion_head = {
				show_scope_change = no

				abdicate = yes
				hidden_effect = { add_rival = ROOT }
			}

			hidden_effect = {
				religion_head = {
					opinion = {
						name = opinion_very_grateful
						who = ROOT
						years = 10
					}
				}
			}
		}

		ai_will_do = {
			factor = 1

			trigger = {
				religion_head = {
					reverse_opinion = {
						who = ROOT
						value < -50
					}

					current_heir = {
						ROOT = {
							likes_better_than = {
								who = PREV
								than = PREVPREV
							}
						}
					}
				}
			}
		}
	}

	mithras_promotion = {
		is_high_prio = yes
		ai_check_interval = 12

		potential = {
			religion_openly_hellenic_or_reformed_trigger = yes
			is_adult = yes
			is_incapable = no

			OR = {
				trait = mystery_mithras_corax
				trait = mystery_mithras_nymphus
				trait = mystery_mithras_leo
				trait = mystery_mithras_perses
				trait = mystery_mithras_miles
				trait = mystery_mithras_heliodromus
			}
		}

		allow = {
			in_command_trigger = no
			is_abroad = no
			prisoner = no

			custom_tooltip = {
				text = can_be_promoted_mithras

				OR = {
					trait = mystery_mithras_corax
					trait = mystery_mithras_nymphus
					trait = mystery_mithras_leo
					trait = mystery_mithras_perses
					trait = mystery_mithras_miles
					trait = mystery_mithras_heliodromus
				}
			}

			NOT = { has_character_modifier = recent_mithras_promotion }
		}

		effect = {
			add_character_modifier = {
				name = recent_mithras_promotion
				years = 5
				hidden = yes
			}

			narrative_event = {
				id = ancrel.2583
				days = 1
				tooltip = asks_mithras_promotion
			}
		}

		ai_will_do = {
			factor = 1
		}
	}
}

targeted_decisions = {
	nominate_vestalis_decision = {
		filter = court
		ai_target_filter = court
		ai_check_interval = 12

		from_potential = {
			religion = roman_pagan

			d_roman_pagan = {
				has_holder = yes
				NOT = { holder = ROOT }
			}

			# The College of the Vestales has a seat open
			check_variable = {
				which = global_num_vestales
				value < 5
			}
		}

		potential = {
			is_female = yes
			religion = roman_pagan
			age >= 6
			age < 10
			is_landed = no
			is_betrothed = no
			prisoner = no
			host = { character = FROM }

			NOR = {
				trait = vestalis
				trait = retired_vestalis
				has_minor_title = title_vestalis
				has_minor_title = title_vestalis_maxima
				has_character_flag = flag_nominated_as_vestalis
			}

			religion_head = {
				OR = {
					ai = yes

					trigger_if = {
						limit = { has_character_flag = received_vestalis_nomination }

						had_character_flag = {
							flag = received_vestalis_nomination
							years >= 1
						}
					}
				}
			}
		}

		allow = {
			is_incapable = no

			NOT = {
				trait = inbred
				trait = bastard
				trait = legit_bastard
				trait = child_of_consort
			}

			father_even_if_dead = { religion = roman_pagan }
			mother = { religion = roman_pagan }
		}

		effect = {
			set_character_flag = flag_nominated_as_vestalis

			religion_head = {
				set_character_flag = received_vestalis_nomination

				character_event = {
					id = ancrel.2124
					days = 1
				}
			}
		}

		ai_will_do = {
			factor = 1

			trigger = {
				is_close_relative = FROM

				NOR = {
					any_heir_title = { always = yes }
					any_pretender_title = { always = yes }
				}

				religion_head = {
					reverse_opinion = {
						who = FROM
						value >= -25
					}
				}
			}

			mult_modifier = {
				factor = 0.5
				FROM = { trait = cynical }
			}

			mult_modifier = {
				factor = 2.5
				FROM = { trait = zealous }
			}

			mult_modifier = {
				factor = 0.5

				religion_head = {
					reverse_opinion = {
						who = FROM
						value < 0
					}
				}
			}

			mult_modifier = {
				factor = 1.5

				religion_head = {
					reverse_opinion = {
						who = FROM
						value >= 25
					}
				}
			}

			mult_modifier = {
				factor = 1.5

				religion_head = {
					reverse_opinion = {
						who = FROM
						value >= 50
					}
				}
			}
		}
	}
}