coronation_trigger = {
	has_ach_dlc_trigger = yes
	is_landed = yes
	highest_held_title_tier >= tier_kingdom
	# Governments where independent king+ rulers can hold Coronations
	trigger_if = {
		limit = { tgp_realm_has_ceremonial_liege_trigger = yes }
		custom_tooltip = {
			text = tgp_ceremonial_liege_coronation_trigger
			tgp_has_ceremonial_liege_title_trigger = yes
		}
	}
	trigger_if = {
		limit = { government_allows = administrative }
		is_independent_ruler = yes
	}
	trigger_else = {
		NOR = {
			government_has_flag = government_is_theocracy
			government_has_flag = government_is_republic
			government_has_flag = government_is_mercenary
			government_has_flag = government_is_holy_order
		}
	}
}

coronation_living_officiator_trigger = {
	involved_activity = { 
		has_variable = officiator 
		var:officiator = {
			is_alive = yes
			is_imprisoned = no
		}
	}
}

coronation_has_emperor_law = {
	has_realm_law = crowned_emperor
}

coronation_has_king_law = {
	has_realm_law = crowned_king
}

has_any_coronation_law = {
	OR = {
		coronation_has_emperor_law = yes
		coronation_has_king_law = yes
	}
}

coronation_feast_phase = {
	trigger_if = {
		limit = {
			has_activity_type = activity_coronation
		}
		has_current_phase = coronation_phase_feast
	}
}

coronation_hostile_to_host_trigger = {
	OR = {
		is_in_guest_subset = { name = detractor }
		has_any_bad_relationship_with_character_trigger = { CHARACTER = involved_activity.activity_host }
		has_activity_intent = coronation_disrupt_loyalists
	}
}

is_important_hof_trigger = {
	faith = {
		# The HoF actually matters
		NOT = { has_doctrine = doctrine_theocracy_temporal }
		# And this HoF is relevant to the activity
		this = scope:host.faith
	}
	government_has_flag = government_is_theocracy
	any_held_title = { is_head_of_faith = yes }
}

coronation_has_proper_artifact_trigger = {
	trigger_if = {
		limit = {
			faith = {
				coronation_proper_artifact_crown_trigger = yes
				coronation_proper_artifact_regalia_trigger = no
			}
		}
		any_character_artifact = {
			artifact_slot_type = helmet
		}
	}
	trigger_else_if = {
		limit = {
			faith = {
				coronation_proper_artifact_regalia_trigger = yes
				coronation_proper_artifact_crown_trigger = no
			}
		}
		any_character_artifact = {
			artifact_slot_type = regalia
		}
	}
	trigger_else = {
		any_character_artifact = {
			OR = {
				artifact_slot_type = helmet
				artifact_slot_type = regalia
			}
		}
	}
}

coronation_proper_artifact_crown_trigger = {
	religion = {
		OR = {
			this = religion:baltic_religion
			this = religion:bon_religion
			this = religion:eastern_orthodox_religion
			this = religion:catholic_religion
			this = religion:protestant_religion
			this = religion:dualism_religion
			this = religion:hellenism_religion
			this = religion:judaism_religion
			this = religion:kushitism_religion
			this = religion:siberian_religion
			this = religion:tengrism_religion
			this = religion:west_african_orisha_religion
			this = religion:yazidi_religion
			this = religion:zoroastrianism_religion
		}
	}
}

coronation_proper_artifact_regalia_trigger = {
	religion = {
		OR = {
			this = religion:buddhism_religion
			this = religion:finno_ugric_religion
			this = religion:hinduism_religion
			this = religion:jainism_religion
			this = religion:slavic_religion
			this = religion:west_african_bori_religion
			this = religion:taoism_religion
		}
	}
}

# Religions that are not included in the triggers above can have both regalia or a crown.
# The list is intentional and includes:
# akom_religion
# basque_paganism_religion
# donyipolism_religion
# germanic_religion
# islam_religion
# magyar_religion
# mundhum_religion
# north_african_religion
# paganism_religion
# qiangic_religion
# taoism_religion
# waaqism_religion
# west_african_roog_religion
# zunism_religion

has_regal_presence_trait_trigger = {
	#Done this way to prevent traits blocking event option text
	trigger_if = {
		limit = {
			has_trait = greatest_of_khans
		}
		has_trait = greatest_of_khans
	}
	trigger_else_if = {
		limit = {
			has_trait = chakravarti
		}
		has_trait = chakravarti
	}
	trigger_else_if = {
		limit = {
			has_trait = augustus
		}
		has_trait = augustus
	}
	trigger_else_if = {
		limit = {
			has_trait = golden_lineage
		}
		has_trait = golden_lineage
	}
	trigger_else_if = {
		limit = {
			has_trait = legend
		}
		has_trait = legend
	}
	trigger_else_if = {
		limit = {
			has_trait = golden_lineage
		}
		has_trait = golden_lineage
	}
	trigger_else_if = {
		limit = {
			has_trait = conqueror
		}
		has_trait = conqueror
	}
	trigger_else_if = {
		limit = {
			has_trait = lifestyle_surveyor
		}
		has_trait = lifestyle_surveyor
	}
	trigger_else_if = {
		limit = {
			has_trait = administrator
		}
		has_trait = administrator
	}
	trigger_else_if = {
		limit = {
			has_trait = family_first
		}
		has_trait = family_first
	}
	trigger_else_if = {
		limit = {
			has_trait = august
		}
		has_trait = august
	}
	trigger_else_if = {
		limit = {
			has_trait = overseer
		}
		has_trait = overseer
	}
	trigger_else_if = {
		limit = {
			has_trait = giant
		}
		has_trait = giant
	}
	trigger_else_if = {
		limit = {
			has_trait = arrogant
		}
		has_trait = arrogant
	}
	trigger_else_if = {
		limit = {
			has_trait = gregarious
		}
		has_trait = gregarious
	}
	trigger_else_if = {
		limit = {
			has_trait = ambitious
		}
		has_trait = ambitious
	}
	trigger_else_if = {
		limit = {
			has_trait = just
		}
		has_trait = just
	}
	trigger_else_if = {
		limit = {
			has_trait = calm
		}
		has_trait = calm
	}
	trigger_else_if = {
		limit = {
			has_trait = zealous
		}
		has_trait = zealous
	}
	trigger_else_if = {
		limit = {
			has_trait = strong
		}
		has_trait = strong
	}
	trigger_else_if = {
		limit = {
			has_trait = beauty_good_3
		}
		has_trait = beauty_good_3
	}
	trigger_else_if = {
		limit = {
			has_trait = beauty_good_2
		}
		has_trait = beauty_good_2
	}
	trigger_else_if = {
		limit = {
			has_trait = physique_good_3
		}
		has_trait = physique_good_3
	}
	trigger_else = {
		has_trait = physique_good_2
	}
}

coronation_being_crowned_trigger = {
	exists = involved_activity
	coronation_living_officiator_trigger = yes
	involved_activity.activity_host = {
		OR = {
			coronation_proper_artifact_crown_trigger = yes
			AND = {
				coronation_proper_artifact_regalia_trigger = no
				any_character_artifact = {
					artifact_slot_type = helmet
				}
				involved_activity = {
					has_activity_option = {
						category = special_type
						option = coronation_type_anointment
					}
				}
			}
		}
	}
	
}

coronation_self_crowning_trigger = {
	exists = involved_activity
	involved_activity.activity_host = {
		OR = {
			coronation_proper_artifact_crown_trigger = yes
			AND = {
				coronation_proper_artifact_regalia_trigger = no
				any_character_artifact = {
					artifact_slot_type = helmet
				}
				#Doesn't have title regalia
				save_temporary_scope_as = host_temp
				NOT = {
					any_character_artifact = {
						artifact_slot_type = regalia
						has_variable = artifact_succession_title
						var:artifact_succession_title = {
							this = scope:host_temp.primary_title
						}
					}
				}
			}
		}
	}
}

coronation_host_east_asian_admin_or_mandala_trigger = {
	OR = {
		government_has_flag = government_is_celestial
		government_has_flag = government_is_meritocratic
		government_has_flag = government_is_mandala
		government_is_japanese_trigger = yes
	}
}

coronation_host_east_asian_trigger = {
	OR = {
		government_has_flag = government_is_celestial
		government_has_flag = government_is_meritocratic
		government_is_japanese_trigger = yes
	}
}

coronation_host_east_asian_steppe_admin_trigger = {
	OR = {
		government_has_flag = government_is_celestial
		government_has_flag = government_is_meritocratic
		government_has_flag = government_is_steppe_admin
		government_is_japanese_trigger = yes
	}
}
