decisions = {
	recreate_pontificate = {
		only_playable = yes
		is_high_prio = yes
		potential = {
			religion = hellenic_pagan
			primary_title = { higher_real_tier_than = DUKE }
			independent = yes
			d_hellenic_pagan = {
				has_holder = no #Covers the case of destroyed title considered active
			}
		}
		allow = {
			age = 16
			prisoner = no

			c_roma = { holder = ROOT }
			OR = { #in ACR it's available for RE, ERE and Latin Empire, in WtWSMS it's available for RE, ERE and WRE
				completely_controls = d_latium
				e_byzantium = { holder = ROOT }
				e_roman_empire = { holder = ROOT }
				e_wre = { holder = ROOT }
			}
			piety = 500
			prestige = 300
			religion_authority = 0.5
		}
		effect = {
			piety = -500
			prestige = -300
			activate_title = { title = d_hellenic_pagan status = yes }
			d_hellenic_pagan = {
				grant_title = PREV
			}
			religion_authority = { modifier = pontifex_restored }
			hidden_tooltip = {
				narrative_event = { id = hellenic.104 }
			}
		}

		ai_will_do = {
			factor = 1
			
			modifier = {
				factor = 0
				NOT = {
					prestige = 500
				}
			}
			modifier = {
				factor = 0
				NOT = {
					piety = 700
				}
			}			
			modifier = {
				factor = 0
				trait = content
			}
			modifier = {
				factor = 0
				NOT = { diplomacy = 10 }
			}			
		}
	}

	organize_sacred_band = {
		only_playable = yes
		is_high_prio = yes
		potential = {
			higher_tier_than = count
			religion = hellenic_pagan
			has_regent = no
			NOT = { has_global_flag = sacred_band_founded }
		}
		allow = {
			tier = emperor
			d_hellenic_pagan = { owner = { always = yes } } # There is currently a Pontifex Maximus
			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 = hellenic.36 }
				create_character = {
					random_traits = yes
					religion = ROOT
					culture = ROOT
					dynasty = NONE
					female = no
					age = 34
					trait = skilled_tactician
				}
				new_character = {
					prestige = 300
					wealth = 300
					d_sacred_band = {
						grant_title = PREV
					}
				}
			}
			religion_authority = {
				modifier = religious_order_formed
				years = 10
			}
		}
		ai_will_do = {
			factor = 1
		}
	}

	hold_dionysia = { # public rites of dionysus
		only_playable = yes
		is_high_prio = yes

		potential = {
			tier = COUNT
			
			society_rank = {
				society = mysteries_dionysus
				rank = 3
			}
		}

		allow = {
			society_currency >= 500
			OR = {
				AND = {
					month = 3
					NOT = { month = 4 }
				}
				month = 12
			}
		}

		effect = {
			change_society_currency = {
				value = -500
				#scales_with_influence = yes
			}
			set_character_flag = ancrel_holding_dionysia
		}


		ai_will_do = {
			factor = 0 # TODO: proper ai weighting
		}
	}
}

targetted_decisions = {
	nominate_vestalis_decision = {
		filter = court
		ai_target_filter = court

		from_potential = {
			religion = hellenic_pagan
			NOT = { has_landed_title = d_hellenic_pagan }
			d_hellenic_pagan = { owner = { always = yes } } # There is currently a Pontifex Maximus
			d_hellenic_pagan = { owner = { NOT = { check_variable = { which = "num_vestales" value = 5 } } } } # The College of the Vestales has a seat open.
		}

		potential = {
			age = 6
			NOT = { age = 10 }
			is_female = yes
			is_landed = no
			is_betrothed = no
			prisoner = no
			host = { character = FROM }
			NOT = { has_character_flag = flag_nominated_as_vestalis }
		}

		allow = {
			age = 6
			NOT = { age = 10 }
			is_female = yes
			NOT = { trait = bastard }
			NOT = { trait = legit_bastard }
			NOT = { trait = child_of_consort }
			religion = hellenic_pagan
			father_even_if_dead = { religion = hellenic_pagan }
			mother = { religion = hellenic_pagan }
		}

		effect = {
			set_character_flag = flag_nominated_as_vestalis
			d_hellenic_pagan = { owner = { character_event = { id = hellenic.124 days = 1 } } }
		}

		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.2
			}
			modifier = {
				factor = 0
				OR = {
					is_primary_heir = FROM
					FROM = { is_pretender = yes }
				}
			}
			modifier = {
				factor = 0.8
				FROM = { trait = cynical }
			}
			modifier = {
				factor = 1.25
				FROM = { trait = zealous }
			}
			modifier = {
				factor = 0.8
				NOT = { d_hellenic_pagan = { owner = { reverse_opinion = { who = FROM value = -40 } } } }
			}
			modifier = {
				factor = 1.25
				d_hellenic_pagan = { owner = { reverse_opinion = { who = FROM value = 40 } } }
			}
		}
	}
}
