decisions = {

	organise_herculeans = {
		is_high_prio = yes
		ai_check_interval = 12
		potential = {
			higher_tier_than = count
			religion = hellenic_pagan
			has_regent = no
			NOT = { has_global_flag = herculeans_founded }
		}
		allow = {
			higher_tier_than = duke
			prestige = 300
			wealth = 300
		}
		effect = {
			set_global_flag = herculeans_founded
			prestige = -300
			wealth = -300
			activate_title = { title = d_herculean status = yes }
			hidden_tooltip = {
				narrative_event = { id = ancrel.2565 }
				create_character = {
					random_traits = yes
					religion = ROOT
					culture = ROOT
					dynasty = NONE
					female = no
					age = 34
					trait = skilled_tactician
				}
				new_character = {
					d_herculean = {
						grant_title = PREV
					}
				}
			}
		}
		ai_will_do = {
			factor = 1
		}
	}
	
	organise_sacred_band = {
		is_high_prio = yes
		ai_check_interval = 12
		potential = {
			higher_tier_than = count
			religion = hellenic_pagan
			has_regent = no
			NOT = { has_global_flag = sacred_band_founded }
		}
		allow = {
			tier = emperor
			prestige = 300
			wealth = 300
		}
		effect = {
			set_global_flag = sacred_band_founded
			prestige = -300
			wealth = -300
			activate_title = { title = d_sacred_band status = yes }
			hidden_tooltip = {
				narrative_event = { id = ancrel.2567 }
				create_character = {
					random_traits = yes
					religion = ROOT
					culture = ROOT
					dynasty = NONE
					female = no
					age = 34
					trait = skilled_tactician
				}
				new_character = {
					d_sacred_band = {
						grant_title = PREV
					}
				}
			}
		}
		ai_will_do = {
			factor = 1
		}
	}
	
	restore_the_pontifex = {
		is_high_prio = yes
		icon_religion = roman_pagan
		ai_check_interval = 12
		potential = {
			religion = roman_pagan
			higher_tier_than = duke
			has_regent = no
			d_pontifex_maximus = { 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
					NOT = { trait = incapable }
				}
			}
		}
		effect = {
			wealth = -300
			prestige = 1000
			if = {
				limit = { NOT = { is_title_active = d_pontifex_maximus } }
				activate_title = { title = d_pontifex_maximus status = yes }
			}
			random_realm_lord = {
				limit = {
					religion = roman_pagan
					is_theocracy = yes
					capital_holding = { is_holy_site = ROOT }
					prisoner = no
					NOT = { trait = incapable }
				}
				d_pontifex_maximus = { grant_title = PREV }
				set_defacto_liege = ROOT
				pf_liege_change_effect = yes
				add_friend = ROOT
				hidden_tooltip = {
					piety = 250
					narrative_event = { id = ancrel.2102 }
				}
			}
		}
		ai_will_do = {
			factor = 1
		}
	}

	replace_pontifex = {
		icon_religion = roman_pagan
		ai_check_interval = 12
		potential = {
			religion = roman_pagan
			real_tier = emperor
			any_realm_lord = { has_landed_title = d_pontifex_maximus }
		}
		allow = {
			war = no
			piety = 250
			religion_head = {
				war = no
				NOT = { reverse_has_truce = ROOT }
				NOT = { has_non_aggression_pact_with = ROOT }
				is_liege_or_above = ROOT
			}
		}
		effect = {
			piety = -250
			religion_head = {
				abdicate = yes
				hidden_tooltip = { add_rival = ROOT }
			}
			hidden_tooltip = {
				religion_head = {
					opinion = { who = ROOT modifier = opinion_very_grateful years = 10 }
				}
			}
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0
				religion_head = {
					reverse_opinion = { who = ROOT value = -50 }
				}
			}
			modifier = {
				factor = 0
				religion_head = {
					current_heir = {
						ROOT = {
							NOT = { likes_better_than = { who = PREV than = PREVPREV } }
						}
					}
				}
			}
		}
	}
	
	mithras_promotion = {
		is_high_prio = yes
		ai_check_interval = 12
		potential = {
			is_adult = yes
			NOT = { trait = incapable }
			religion = hellenic_pagan
			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_trigger = no
			prisoner = no
			custom_tooltip = {
				text = can_be_promoted_mithras
				hidden_tooltip = {
					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 = {
			hidden_tooltip = {
				add_character_modifier = {
					name = recent_mithras_promotion
					duration = 1825
					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
			NOT = { has_landed_title = d_pontifex_maximus }
			d_pontifex_maximus = { has_holder = yes }
			496 = { NOT = { check_variable = { which = "num_vestales" value = 5 } } } # The Collesge of the Vestales has a seat open
		}
		potential = {
			age = 6
			NOT = { age = 10 }
			religion = roman_pagan
			is_female = yes
			is_landed = no
			is_betrothed = no
			prisoner = no
			host = { character = FROM }
			NOT = {
				trait = vestalis
				trait = retired_vestalis
				has_minor_title = title_vestalis
				has_minor_title = title_vestalis_maxima
				has_character_flag = flag_nominated_as_vestalis
			}
			d_pontifex_maximus = {
				holder_scope = {
					OR = {
						ai = yes
						NOT = { has_character_flag = received_vestalis_nomination }
						had_character_flag = { flag = received_vestalis_nomination days = 365 }
					}
				}
			}
		}
		allow = {
			NOT = {
				trait = incapable
				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
			d_pontifex_maximus = {
				holder_scope = {
					set_character_flag = received_vestalis_nomination
					character_event = { id = ancrel.2124 days = 1 }
				}
			}
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0
				OR = {
					any_heir_title = { always = yes }
					any_pretender_title = { always = yes }
				}
			}
			modifier = {
				factor = 0
				NOT = { is_close_relative = FROM }
			}
			modifier = {
				factor = 0.5
				FROM = { trait = cynical }
			}
			modifier = {
				factor = 2.5
				FROM = { trait = zealous }
			}
			modifier = {
				factor = 0.5
				d_pontifex_maximus = {
					holder_scope = {
						NOT = { reverse_opinion = { who = FROM value = 0 } }
					}
				}
			}
			modifier = {
				factor = 0
				d_pontifex_maximus = {
					holder_scope = {
						NOT = { reverse_opinion = { who = FROM value = -25 } }
					}
				}
			}
			modifier = {
				factor = 1.5
				d_pontifex_maximus = {
					holder_scope = {
						reverse_opinion = { who = FROM value = 25 }
					}
				}
			}
			modifier = {
				factor = 1.5
				d_pontifex_maximus = {
					holder_scope = {
						reverse_opinion = { who = FROM value = 50 }
					}
				}
			}
		}
	}
}

