namespace = Plus

#reserved: Plus.1200 to Plus.1299

#######################################
# CORONATION EVENTS
# Written by Rylock
#######################################

# Ruler begins planning the coronation
character_event = {
	id = Plus.1200
	desc = EVTDESC_Plus_1200
	picture = GFX_evt_coronation
	
	is_triggered_only = yes
	hide_from = yes
	
	option = {
		name = EVTOPTA_Plus_1200
		custom_tooltip = { text = send_invitations }
		hidden_tooltip = {
			any_character = {
				limit = {
					is_adult = yes
					prisoner = no
					is_within_diplo_range = ROOT
					OR = {
						is_vassal_or_below = ROOT
						is_liege_or_above = ROOT
						is_close_relative = ROOT
						dynasty = ROOT
						is_allied_with = ROOT
						has_non_aggression_pact_with = ROOT
						AND = {
							same_realm = ROOT
							higher_tier_than = BARON
						}
						AND = {
							religion = ROOT
							any_realm_province = {
								ROOT = {
									any_realm_province = {
										NOT = { distance = { where = PREVPREV value = 125 } }
									}
								}
							}
						}
					}
					NOR = {
						character = ROOT
						trait = incapable
						trait = excommunicated
						has_truce = ROOT
					}
				}
				letter_event = { id = Plus.1201 }
			}
		}
	}
}

# Invitation to the coronation
letter_event = {
	id = Plus.1201
	desc = EVTDESC_Plus_1201
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_Plus_1201 # I will attend
		trigger = {
			war = no
			is_not_busy_trigger = yes
		}
		ai_chance = {
			factor = 80
			modifier = {
				factor = 0.1
				is_inaccessible_trigger = yes
			}
			modifier = {
				factor = 0
				OR = {
					is_ill = yes
					is_pregnant = yes
				}
			}
			modifier = {
				factor = 0.5
				trait = paranoid
			}
			modifier = {
				factor = 0.5
				trait = shy
			}
			modifier = {
				factor = 0.5
				trait = cynical
			}
			modifier = {
				factor = 0.5
				trait = slothful
			}
			modifier = {
				factor = 1.5
				trait = diligent
			}
			modifier = {
				factor = 1.5
				trait = zealous
			}
			modifier = {
				factor = 1.5
				trait = gregarious
			}
			modifier = {
				factor = 5
				is_close_relative = FROM
			}
			modifier = {
				factor = 2
				OR = {
					dynasty = FROM
					is_allied_with = FROM
					has_non_aggression_pact_with = FROM
					is_theocracy = yes
				}
			}
			modifier = {
				factor = 1.25
				opinion = { who = FROM value = 25 }
			}
			modifier = {
				factor = 1.25
				opinion = { who = FROM value = 50 }
			}
			modifier = {
				factor = 1.25
				opinion = { who = FROM value = 75 }
			}
			modifier = {
				factor = 0.75
				NOT = { opinion = { who = FROM value = 0 } }
			}
			modifier = {
				factor = 0.75
				NOT = { opinion = { who = FROM value = -25 } }
			}
			modifier = {
				factor = 0.5
				NOT = { opinion = { who = FROM value = -50 } }
			}
			modifier = {
				factor = 0.25
				NOT = { opinion = { who = FROM value = -75 } }
			}
		}
		if = {
			limit = {
				higher_real_tier_than = COUNT
				NOT = { same_realm = FROM }
			}
			FROM = {
				letter_event = { id = Plus.1202 days = 3 random = 10 tooltip = accept_invitation }
			}
		}
		hidden_tooltip = {
			if = {
				limit = { NOT = { has_opinion_modifier = { who = FROM modifier = attending_coronation } } }	
				reverse_opinion = { who = FROM modifier = attending_coronation months = 12 }
				opinion = { who = FROM modifier = attending_coronation months = 12 }
				add_character_modifier = { name = do_not_disturb days = 200 hidden = yes }
				end_inaccessibility_effect = yes
			}
			any_spouse = {
				limit = {
					is_ill = no
					is_pregnant = no
					is_ruler = no
					war = no
					NOT = { is_inaccessible_trigger = yes }
					is_not_busy_trigger = yes
					NOT = { has_opinion_modifier = { who = FROM modifier = attending_coronation } }
				}
				reverse_opinion = { who = FROM modifier = attending_coronation months = 12 }
				opinion = { who = FROM modifier = attending_coronation months = 12 }
				add_character_modifier = { name = do_not_disturb days = 200 hidden = yes }
			}
		}
	}
	option = {
		name = EVTOPTB_Plus_1201 # I will not attend
		trigger = {
			war = no
			is_not_busy_trigger = yes
			OR = {
				same_realm = FROM
				is_ruler = no
			}
		}
		ai_chance = {
			factor = 20
		}
		reverse_opinion = { who = FROM modifier = opinion_insulted months = 60 }
		if = {
			limit = {
				higher_real_tier_than = COUNT
				NOT = { any_spouse = { character = FROM } }
			}
			FROM = {
				letter_event = { id = Plus.1203 days = 7 random = 5 tooltip = decline_invitation }
			}
		}
	}
	option = {
		name = EVTOPTC_Plus_1201 # Send an envoy in my stead
		trigger = {
			war = no
			is_not_busy_trigger = yes
			NOT = { same_realm = FROM }
			is_ruler = yes
		}
		ai_chance = {
			factor = 40
		}
		reverse_opinion = { who = FROM modifier = opinion_insulted months = 60 }
		if = {
			limit = { higher_real_tier_than = COUNT }
			FROM = {
				letter_event = { id = Plus.1204 days = 7 random = 5 tooltip = decline_invitation }
			}
		}
	}
	option = {
		name = EVTOPTD_Plus_1201 # I am at war
		trigger = {
			war = yes
		}
		if = {
			limit = { higher_real_tier_than = COUNT }
			FROM = {
				letter_event = { id = Plus.1205 days = 7 random = 5 tooltip = decline_invitation }
			}
		}
	}
	option = {
		name = EVTOPTE_Plus_1201 # I am too busy
		trigger = {
			is_not_busy_trigger = no
		}
		if = {
			limit = { higher_real_tier_than = COUNT }
			FROM = {
				letter_event = { id = Plus.1206 days = 7 random = 5 tooltip = decline_invitation }
			}
		}
	}
}

# Foreign ruler accepts the invitation
letter_event = {
	id = Plus.1202
	desc = EVTDESC_Plus_1202
	
	is_triggered_only = yes
	
	trigger = {
		FROM = { higher_real_tier_than = DUKE }
	}
	
	has_character_flag = planning_coronation
	
	option = {
		name = EXCELLENT
	}
}

# Notification of an invitation declined
letter_event = {
	id = Plus.1203
	desc = EVTDESC_Plus_1203
	
	is_triggered_only = yes
	
	has_character_flag = planning_coronation
	
	trigger = {
		OR = {
			FROM = {
				is_powerful_vassal = yes
				same_realm = ROOT
			}
			FROM = { higher_tier_than = DUKE }
		}
	}
	
	option = {
		name = I_SEE
	}
}

# Notification of an invitation declined by foreign ruler
letter_event = {
	id = Plus.1204
	desc = EVTDESC_Plus_1204
	
	is_triggered_only = yes
	
	has_character_flag = planning_coronation
	
	trigger = {
		FROM = { higher_real_tier_than = DUKE }
	}
	
	option = {
		name = I_SEE
	}
}

# Notification of an invitation declined due to war
letter_event = {
	id = Plus.1205
	desc = EVTDESC_Plus_1205
	
	is_triggered_only = yes
	
	has_character_flag = planning_coronation
	
	trigger = {
		OR = {
			FROM = {
				is_powerful_vassal = yes
				same_realm = ROOT
			}
			FROM = { higher_tier_than = DUKE }
		}
	}
	
	option = {
		name = I_SEE
	}
}

# Notification of an invitation declined due to being busy
letter_event = {
	id = Plus.1206
	desc = EVTDESC_Plus_1206
	
	is_triggered_only = yes
	
	has_character_flag = planning_coronation
	
	trigger = {
		OR = {
			FROM = {
				is_powerful_vassal = yes
				same_realm = ROOT
			}
			FROM = { higher_tier_than = DUKE }
		}
	}
	
	option = {
		name = I_SEE
	}
}

# Vassal priest asks to perform the ceremony
character_event = {
	id = Plus.1207
	desc = EVTDESC_Plus_1207
	picture = GFX_evt_coronation
	
	only_rulers = yes
	min_age = 16
	capable_only = yes
	prisoner = no
	
	trigger = {
		capital_holding = { holding_type = temple }
		has_any_opinion_modifier = attending_coronation
		any_opinion_modifier_target = {
			is_alive = yes
			religion = ROOT
			has_opinion_modifier = { who = ROOT modifier = attending_coronation }
			reverse_has_opinion_modifier = { who = ROOT modifier = attending_coronation }
			has_character_flag = planning_coronation
			NOR = {
				has_character_flag = has_priest_to_perform_coronation
				has_character_flag = asked_about_coronation
				reverse_has_opinion_modifier = { who = ROOT modifier = opinion_insulted }
			}
		}
	}
	
	mean_time_to_happen = {
		days = 20
		modifier = {
			factor = 0.75
			trait = diligent
		}
		modifier = {
			factor = 0.75
			trait = proud
		}
		modifier = {
			factor = 0.75
			trait = zealous
		}
		modifier = {
			factor = 0.5
			trait = ambitious
		}
		modifier = {
			factor = 1.5
			trait = humble
		}
		modifier = {
			factor = 1.5
			trait = content
		}
		modifier = {
			factor = 2.0
			real_tier = BARON
		}
		modifier = {
			factor = 0.5
			higher_real_tier_than = COUNT
		}
		modifier = {
			factor = 0.5
			higher_real_tier_than = DUKE
		}
		modifier = {
			factor = 0.5
			controls_religion = yes
		}
		modifier = {
			factor = 0.5
			any_opinion_modifier_target = {
				is_alive = yes
				religion = ROOT
				has_opinion_modifier = { who = ROOT modifier = attending_coronation }
				reverse_has_opinion_modifier = { who = ROOT modifier = attending_coronation }
				has_character_flag = planning_coronation
				rightful_religious_head = ROOT
			}
		}
		modifier = {
			factor = 0.75
			any_playable_ruler = {
				reverse_has_opinion_modifier = { who = ROOT modifier = attending_coronation }
				reverse_opinion = { who = ROOT value = 25 }
			}
		}
		modifier = {
			factor = 0.75
			any_playable_ruler = {
				reverse_has_opinion_modifier = { who = ROOT modifier = attending_coronation }
				reverse_opinion = { who = ROOT value = 50 }
			}
		}
		modifier = {
			factor = 0.75
			any_playable_ruler = {
				reverse_has_opinion_modifier = { who = ROOT modifier = attending_coronation }
				reverse_opinion = { who = ROOT value = 75 }
			}
		}
		modifier = {
			factor = 1.5
			any_playable_ruler = {
				reverse_has_opinion_modifier = { who = ROOT modifier = attending_coronation }
				NOT = { reverse_opinion = { who = ROOT value = 0 } }
			}
		}
		modifier = {
			factor = 1.5
			any_playable_ruler = {
				reverse_has_opinion_modifier = { who = ROOT modifier = attending_coronation }
				NOT = { reverse_opinion = { who = ROOT value = -25 } }
			}
		}
		modifier = {
			factor = 1.5
			any_playable_ruler = {
				reverse_has_opinion_modifier = { who = ROOT modifier = attending_coronation }
				NOT = { reverse_opinion = { who = ROOT value = -50 } }
			}
		}
		modifier = {
			factor = 0.5
			any_playable_ruler = {
				reverse_has_opinion_modifier = { who = ROOT modifier = attending_coronation }
				dynasty = ROOT
			}
		}
	}

	immediate = {
		random_opinion_modifier_target = {
			limit = {
				religion = ROOT
				has_opinion_modifier = { who = ROOT modifier = attending_coronation }
				reverse_has_opinion_modifier = { who = ROOT modifier = attending_coronation }
				has_character_flag = planning_coronation
				NOR = {
					has_character_flag = has_priest_to_perform_coronation
					has_character_flag = asked_about_coronation
					reverse_has_opinion_modifier = { who = ROOT modifier = opinion_insulted }
				}
			}
			save_event_target_as = coronation_liege
			set_character_flag = asked_about_coronation
		}
	}
	
	option = {
		name = EVTOPTA_Plus_1207 # Make the request
		event_target:coronation_liege = {
			letter_event = { id = Plus.1208 tooltip = request_to_perform_coronation }
		}
	}
}

# Liege receives request from priest to perform the coronation
letter_event = {
	id = Plus.1208
	desc = EVTDESC_Plus_1208
	
	is_triggered_only = yes
	
	has_character_flag = planning_coronation
	
	option = {
		name = EVTOPTA_Plus_1208 # Let him do it
		clr_character_flag = asked_about_coronation
		set_character_flag = has_priest_to_perform_coronation
		reverse_opinion = { who = FROM modifier = opinion_performed_coronation months = 120 }
		hidden_tooltip = {
			FROM = { letter_event = { id = Plus.1209 days = 1 } }
			any_opinion_modifier_target = {
				limit = {
					is_alive = yes
					religion = ROOT
					capital_holding = { holding_type = temple }
					has_opinion_modifier = { who = ROOT modifier = attending_coronation }
					reverse_has_opinion_modifier = { who = ROOT modifier = attending_coronation }
					higher_real_tier_than = FROM
					prisoner = no
					NOT = { trait = incapable }
				}
				opinion = { who = ROOT modifier = opinion_insulted months = 60 }
			}
		}
	}
	option = {
		name = EVTOPTB_Plus_1208 # Refuse
		trigger = {
			ai = no
		}
		clr_character_flag = asked_about_coronation
		reverse_opinion = { who = FROM modifier = opinion_insulted months = 60 }
		hidden_tooltip = {
			FROM = { letter_event = { id = Plus.1210 days = 1 } }
		}
	}
}

# Liege agrees to the request
letter_event = {
	id = Plus.1209
	desc = EVTDESC_Plus_1209
	
	is_triggered_only = yes
	
	option = {
		name = EXCELLENT
		reverse_opinion = { who = FROM modifier = opinion_performed_coronation months = 120 }
	}
}

# Liege refuses the request
letter_event = {
	id = Plus.1210
	desc = EVTDESC_Plus_1210
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_Plus_1210
		prestige = -50
		tooltip = {
			opinion = { who = FROM modifier = opinion_insulted months = 60 }
		}
	}
}

# Coronation cancelled due to war
character_event = {
	id = Plus.1211
	desc = EVTDESC_Plus_1211
	picture = GFX_evt_council
	
	is_triggered_only = yes
	
	only_rulers = yes
	min_age = 16
	
	trigger = {
		war = yes
		OR = {
			has_character_flag = planning_coronation
			has_character_flag = holding_coronation
		}
	}
	
	option = {
		name = CURSES
		if = {
			limit = { has_character_flag = planning_coronation }
			scaled_wealth = 0.8
		}
		hidden_tooltip = {
			remove_do_not_disturb_effect = yes
			clr_character_flag = planning_coronation
			clr_character_flag = holding_coronation
			clr_character_flag = has_priest_to_perform_coronation
			clr_character_flag = asked_about_coronation
			clr_character_flag = coronation_event
			clr_character_flag = coronation_lover
			clr_character_flag = coronation_duel
			clr_character_flag = coronation_poetry
			clr_character_flag = coronation_friend
			clr_character_flag = coronation_rival
			clr_character_flag = coronation_toast
			clr_character_flag = coronation_badmouth
			clr_character_flag = coronation_drunkard
			clr_character_flag = coronation_lunatic
			any_opinion_modifier_target = {
				limit = { 
					is_alive = yes
					reverse_has_opinion_modifier = { who = ROOT modifier = attending_coronation } 
				}
				remove_opinion = { who = ROOT modifier = attending_coronation }
				reverse_remove_opinion = { who = ROOT modifier = attending_coronation }
				letter_event = { id = Plus.1212 }
			}
		}
	}
}

# Receive notification about cancellation of coronation due to war
letter_event = {
	id = Plus.1212
	desc = EVTDESC_Plus_1212
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_Plus_1212
		hidden_tooltip = {
			remove_do_not_disturb_effect = yes
			clr_character_flag = coronation_event
			clr_character_flag = attending_coronation
			if = {
				limit = {
					FROM = { NOT = { trait = crowned } }
					has_opinion_modifier = { who = FROM modifier = opinion_performed_coronation }
				}
				remove_opinion = { who = FROM modifier = opinion_performed_coronation }
				reverse_remove_opinion = { who = FROM modifier = opinion_performed_coronation }
			}
		}
	}
}

# Ruler dies, the coronation must be canceled
character_event = {
	id = Plus.1213
	desc = EVTDESC_Plus_1213
	picture = GFX_evt_death
	
	is_triggered_only = yes
	
	trigger = {
		OR = {
			has_character_flag = planning_coronation
			has_character_flag = holding_coronation
		}
	}
	
	option = {
		name = CURSES
		if = {
			limit = { has_character_flag = planning_coronation }
			scaled_wealth = 0.8
		}
		hidden_tooltip = {
			clr_character_flag = planning_coronation
			clr_character_flag = holding_coronation
			clr_character_flag = has_priest_to_perform_coronation
			clr_character_flag = asked_about_coronation
			clr_character_flag = coronation_event
			clr_character_flag = coronation_lover
			clr_character_flag = coronation_duel
			clr_character_flag = coronation_poetry
			clr_character_flag = coronation_friend
			clr_character_flag = coronation_rival
			clr_character_flag = coronation_toast
			clr_character_flag = coronation_badmouth
			clr_character_flag = coronation_drunkard
			clr_character_flag = coronation_lunatic
			any_opinion_modifier_target = {
				limit = {
					is_alive = yes
					reverse_has_opinion_modifier = { who = ROOT modifier = attending_coronation }
				}
				remove_opinion = { who = ROOT modifier = attending_coronation }
				reverse_remove_opinion = { who = ROOT modifier = attending_coronation }
				letter_event = { id = Plus.1214 }
			}
		}
	}
}

# Receive notification about cancellation of coronation due to ruler's death
letter_event = {
	id = Plus.1214
	desc = EVTDESC_Plus_1214
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_Plus_1212
		hidden_tooltip = {
			remove_do_not_disturb_effect = yes
			clr_character_flag = coronation_event
			clr_character_flag = attending_coronation
		}
	}
}

### THE CORONATION

# The coronation begins
narrative_event = {
	id = Plus.1215
	title = EVTNAME_Plus_1215
	desc = EVTDESC_Plus_1215
	picture = GFX_evt_coronation
	border = GFX_event_narrative_frame_religion
	
	major = yes
	is_triggered_only = yes
	hide_from = yes
	show_ROOT = yes
	
	has_character_flag = planning_coronation
	
	major_trigger = {
		OR = {
			character = FROM
			has_opinion_modifier = { who = FROM modifier = attending_coronation }
			same_realm = FROM
		}
	}
	
	option = {
		name = EVTOPTA_Plus_1215
		trigger = { character = FROM }
		piety = 100
		if = {
			limit = {
				OR = {
					NOT = { has_landed_title = e_byzantium }
					e_byzantium = { is_primary_holder_title = no }
				}
			}
			add_trait = crowned
		}
		if = {
			limit = {
				has_landed_title = e_byzantium
				e_byzantium = { is_primary_holder_title = yes }
			}
			hidden_tooltip = {
				random_courtier = {
					limit = {
						ai = yes
						is_ruler = no
					}
					character_event = { id = Plus.1335 }
				}
			}
		}
		if = {
			limit = { trait = humble }
			random = {
				chance = 50
				remove_trait = humble
			}
		}
		if = {
			limit = {
				NOT = { trait = humble }
				NOT = { trait = proud }
			}
			random = {
				chance = 50
				add_trait = proud
				hidden_tooltip = { character_event = { id = 38261 } } # notify proud
			}
		}
		if = {
			limit = { any_vassal = { leads_faction = faction_tradition } }
			custom_tooltip = { text = TRADITIONFACTIONMOODPLUS }
			hidden_tooltip = {
				random_vassal = { limit = { leads_faction = faction_tradition } set_variable = { which = "faction_mood_increase" value = 2 } }
				character_event = { id = PlusFaction.200 days = 1 }
			}
		}
		if = {
			limit = {
				OR = {
					NOT = { has_landed_title = e_byzantium }
					e_byzantium = { is_primary_holder_title = no }
				}
				tier = EMPEROR
			}
			ROOT = {
				custom_tooltip = { text = IMPERIAL_DECADENCE_MINUS_1 }
				hidden_tooltip = {
					primary_title = { change_variable = { which = "imperial_decadence" value = -1 } }
					character_event = { id = Plus.1852 }
				}
			}
		}
		hidden_tooltip = {
			character_event = { id = Plus.1216 days = 1 } # the feast begins
		}
		if = {
			limit = { ai = no }
			chronicle = {
				entry = CHRONICLE_NORMAL_CORONATION
				portrait = [Root.GetID]
				picture = GFX_evt_coronation
			}
		}
	}
	option = {
		name = EVTOPTB_Plus_1215
		trigger = {
			NOT = { character = FROM }
			has_opinion_modifier = { who = FROM modifier = attending_coronation }
		}
		if = {
			limit = { ai = no }
			chronicle = {
				entry = CHRONICLE_NORMAL_CORONATION
				portrait = [Root.GetID]
				picture = GFX_evt_coronation
			}
		}
	}
	option = {
		name = EVTOPTC_Plus_1215
		trigger = {
			NOT = { character = FROM }
			NOT = { has_opinion_modifier = { who = FROM modifier = attending_coronation } }
		}
		if = {
			limit = { ai = no }
			chronicle = {
				entry = CHRONICLE_NORMAL_CORONATION
				portrait = [Root.GetID]
				picture = GFX_evt_coronation
			}
		}
	}
}

# The coronation feast follows
character_event = {
	id = Plus.1216
	title = EVTNAME_Plus_1215
	desc = EVTDESC_Plus_1216
	picture = GFX_evt_feast
	
	major = yes
	is_triggered_only = yes
	
	has_character_flag = planning_coronation
	
	major_trigger = {
		OR = {
			character = FROM
			has_opinion_modifier = { who = FROM modifier = attending_coronation }
		}
	}
	
	immediate = {
		set_character_flag = holding_coronation
		clr_character_flag = planning_coronation
		character_event = { id = Plus.1275 days = 30 } # coronation feast ends
		character_event = { id = Plus.1250 days = 3 } # coronation events
		
		# Possible duels
		any_opinion_modifier_target = {
			limit = {
				is_alive = yes
				reverse_has_opinion_modifier = { who = ROOT modifier = attending_coronation }
				has_opinion_modifier = { who = ROOT modifier = attending_coronation }
				is_female = no
				higher_tier_than = BARON
				OR = {
					martial = 8
					trait = duelist
					trait = lunatic
					trait = possessed
				}
				NOR = {
					trait = craven
					trait = wounded
					is_maimed_trigger = yes
				}
			}
			character_event = { id = Plus.1222 days = 5 random = 20 }
		}
	}
	
	option = {
		name = EVTOPTA_Plus_1216
		trigger = { character = FROM }
	}
	option = {
		name = EVTOPTB_Plus_1216
		trigger = {
			NOT = { character = FROM }
			has_opinion_modifier = { who = FROM modifier = attending_coronation }
		}
	}
}

# Ruler gets along with host at the coronation
character_event = {
	id = Plus.1217
	desc = EVTDESC_Plus_1217
	picture = GFX_evt_feast
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_Plus_1217
		set_character_flag = coronation_event
		FROM = {
			set_character_flag = coronation_friend
			character_event = { id = Plus.1218 tooltip = coronation_friends }
		}
	}
}

character_event = {
	id = Plus.1218
	desc = EVTDESC_Plus_1218
	picture = GFX_evt_feast
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_Plus_1217
		random_list = {
			50 = {
				add_friend = FROM
			}
			25 = {
				opinion = { who = FROM modifier = coronation_friends multiplier = 2 months = 120 }
				hidden_tooltip = { reverse_opinion = { who = FROM modifier = coronation_friends multiplier = 2 months = 120 } }
			}
			25 = {
				opinion = { who = FROM modifier = coronation_friends months = 60 }
				hidden_tooltip = { reverse_opinion = { who = FROM modifier = coronation_friends months = 60 } }
			}
		}
	}
}

# Ruler argues with host over claim
character_event = {
	id = Plus.1219
	desc = EVTDESC_Plus_1219
	picture = GFX_evt_feast
	
	is_triggered_only = yes
	
	immediate = {
		random_claim = {
			limit = {
				ROOT = { has_strong_claim = PREV }
				holder = FROM
			}
			save_event_target_as = argue_title
			break = yes
		}
		random_claim = {
			limit = { holder = FROM }
			save_event_target_as = argue_title
		}
	}

	option = {
		name = EVTOPTA_Plus_1219
		set_character_flag = coronation_event
		FROM = {
			set_character_flag = coronation_rival
			character_event = { id = Plus.1220 tooltip = coronation_rivals }
		}
	}
}

character_event = {
	id = Plus.1220
	desc = EVTDESC_Plus_1220
	picture = GFX_evt_feast
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_Plus_1220
		random_list = {
			50 = {
				add_rival = FROM
			}
			25 = {
				opinion = { who = FROM modifier = coronation_rivals multiplier = 2 months = 120 }
				hidden_tooltip = { reverse_opinion = { who = FROM modifier = coronation_rivals multiplier = 2 months = 120 } }
			}
			25 = {
				opinion = { who = FROM modifier = coronation_rivals months = 60 }
				hidden_tooltip = { reverse_opinion = { who = FROM modifier = coronation_rivals months = 60 } }
			}
		}
	}
}

# The Duel - character notified that enemy is present
character_event = {
	id = Plus.1222
	desc = EVTDESC_Plus_1222
	picture = GFX_evt_feast

	is_triggered_only = yes
	
	trigger = {
		war = no
		NOT = { has_character_flag = coronation_event }
		FROM = {
			NOT = { has_character_flag = coronation_duel }
			has_character_flag = holding_coronation
			any_opinion_modifier_target = {
				is_alive = yes
				has_opinion_modifier = { who = PREV modifier = attending_coronation }
				war = no
				is_adult = yes
				is_female = no
				prisoner = no
				is_foe = ROOT
				NOR = {
					trait = incapable
					trait = wounded
					is_maimed_trigger = yes
					has_character_flag = coronation_event
				}
			}
		}
	}
	
	immediate = {
		FROM = {
			random_opinion_modifier_target = {
				limit = {
					has_opinion_modifier = { who = PREV modifier = attending_coronation }
					war = no
					is_adult = yes
					is_female = no
					prisoner = no
					is_foe = ROOT
					NOR = {
						trait = incapable
						trait = wounded
						is_maimed_trigger = yes
						has_character_flag = coronation_event
					}
				}
				save_event_target_as = challenge_target
			}
		}
	}
	
	option = {
		name = EVTOPTA72030 # Challenge to a duel
		ai_chance = {
			factor = 70
			modifier = {
				factor = 0.5
				trait = kind
			}
			modifier = {
				factor = 0.5
				trait = humble
			}
			modifier = {
				factor = 0.5
				trait = content
			}
			modifier = {
				factor = 0.5
				trait = patient
			}
			modifier = {
				factor = 0.5
				trait = slothful
			}
		}
		set_character_flag = coronation_event
		event_target:challenge_target = {
			character_event = { id = Plus.1223 tooltip = EVTTOOLTIP72031 }
		}
	}
	option = {
		ai_chance = {
			factor = 30
			modifier = {
				factor = 0
				OR = {
					trait = drunkard
					trait = possessed
					trait = lunatic
					trait = wroth
					trait = cruel
					trait = duelist
				}
			}
			modifier = {
				factor = 0.5
				trait = brave
			}
			modifier = {
				factor = 0.5
				trait = proud
			}
		}
		name = EVTOPTB72030 # No challenge
		prestige = -20
	}
}

# The Duel - the challenge is made
character_event = {
	id = Plus.1223
	desc = EVTDESC72031
	picture = GFX_evt_feast
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA72031 # Accept the duel
		ai_chance = {
			factor = 70
			modifier = {
				factor = 0
				trait = craven
			}
			modifier = {
				factor = 0.5
				trait = kind
			}
			modifier = {
				factor = 0.5
				trait = humble
			}
			modifier = {
				factor = 0.5
				trait = content
			}
			modifier = {
				factor = 0.5
				trait = patient
			}
			modifier = {
				factor = 0.5
				trait = slothful
			}
		}
		set_character_flag = coronation_event
		FROMFROM = {
			set_character_flag = coronation_duel
			character_event = { id = Plus.1225 tooltip = ask_permission_to_duel }
		}
	}
	option = {
		name = EVTOPTB72031 # Refuse
		ai_chance = {
			factor = 30
			modifier = {
				factor = 0
				OR = {
					trait = drunkard
					trait = possessed
					trait = lunatic
					trait = wroth
					trait = cruel
					trait = duelist
				}
				NOT = { trait = craven }
			}
			modifier = {
				factor = 0.5
				trait = brave
			}
			modifier = {
				factor = 0.5
				trait = proud
			}
		}
		prestige = -20
		hidden_tooltip = {
			FROM = { character_event = { id = Plus.1224 } }
		}
	}
}

# The Duel - the challenged refuses the duel
character_event = {
	id = Plus.1224
	desc = EVTDESC_Plus_1224
	picture = GFX_evt_feast
	
	is_triggered_only = yes

	option = {
		name = EVTOPTA_Plus_1224
		prestige = 20
	}
}

# The Duel - the host is asked for permission to hold the duel
character_event = {
	id = Plus.1225
	desc = EVTDESC_Plus_1225
	picture = GFX_evt_feast
	
	is_triggered_only = yes
	
	immediate = {
		clr_character_flag = coronation_event
		set_character_flag = coronation_event
	}
	
	option = {
		name = EVTOPTA_Plus_1225 # Absolutely not!
		trigger = { NOT = { diplomacy = 12 } }
		ai_chance = {
			factor = 30
		}
		FROM = { character_event = { id = Plus.1226 days = 1 tooltip = refused_duel } }
		FROMFROM = { character_event = { id = Plus.1226 days = 1 tooltip = refused_duel } }
	}
	option = {
		name = EVTOPTB_Plus_1225 # Talk them out of it
		trigger = { diplomacy = 12 }
		ai_chance = {
			factor = 30
		}
		tooltip_info = diplomacy
		FROM = { character_event = { id = Plus.1227 days = 1 tooltip = talked_out_of_duel } }
		FROMFROM = { character_event = { id = Plus.1227 days = 1 tooltip = talked_out_of_duel } }
	}
	option = {
		name = EVTOPTC_Plus_1225 # Let them fight
		ai_chance = {
			factor = 70
			modifier = {
				factor = 5
				OR = {
					trait = impaler
					trait = duelist
					trait = cruel
					trait = lunatic
					trait = possessed
				}
			}
			modifier = {
				factor = 2
				trait = arbitrary
			}
			modifier = {
				factor = 0.5
				trait = zealous
			}
			modifier = {
				factor = 0.5
				trait = kind
			}
			modifier = {
				factor = 0.5
				trait = just
			}
			modifier = {
				factor = 0.75
				trait = temperate
			}
			modifier = {
				factor = 0.75
				trait = charitable
			}
			modifier = {
				factor = 0.75
				trait = proud
			}
		}
		custom_tooltip = { text = let_the_duel_begin }
		hidden_tooltip = {			
			FROMFROM = {
				character_event = { id = Plus.1228 days = 1 } 
			}
		}
	}
}

# The Duel - the host refuses to let them fight
character_event = {
	id = Plus.1226
	desc = EVTDESC_Plus_1226
	picture = GFX_evt_feast
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_Plus_1226
		prestige = -20
		opinion = {
			who = FROM
			modifier = opinion_insulted
			months = 60
		}
	}
}

# The Duel - the host diplomatically talks them out of fighting
character_event = {
	id = Plus.1227
	desc = EVTDESC_Plus_1227
	picture = GFX_evt_feast
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_Plus_1226
		prestige = -20
		opinion = {
			who = FROM
			modifier = opinion_impressed
			months = 60
		}
	}
}

# The Duel - ping event to start duel
character_event = {
	id = Plus.1228	

	hide_window = yes
	is_triggered_only = yes
	hide_from = yes
	
	immediate = {
		set_character_flag = coronation_duelist
		FROMFROM = {
			character_event = { id = Plus.1229 } 
		}
	}	
}

# The Duel - start duel, call engine
character_event = {
	id = Plus.1229	

	hide_window = yes
	is_triggered_only = yes
	hide_from = yes
	
	immediate = {
		set_character_flag = coronation_duelist
		e_rebels = { holder_scope = { character_event = { id = DuelEngine.0 } } }
	}	
}

# The Duel - loser is alive
character_event = {
	id = Plus.1230	
	picture = GFX_evt_battle

	major = yes
	is_triggered_only = yes
	
	desc = {
		text = EVTDESC_Plus_1229
		trigger = {
			FROMFROM = {
				NOR = {
					trait = wounded
					is_maimed_trigger = yes
				}
			}
		}
	}
	
	desc = {
		text = EVTDESC_Plus_1230
		trigger = {
			FROMFROM = {
				OR = {
					trait = wounded
					is_maimed_trigger = yes
				}
			}
		}
	}
	
	major_trigger = {
		OR = {
			character = FROM
			character = FROMFROM
			character = event_target:coronation_duel_host
			has_opinion_modifier = { who = event_target:coronation_duel_host modifier = attending_coronation }
		}
	}
	
	option = {
		name = EVTOPTA_Plus_1229 # There, it is done
		trigger = { character = event_target:coronation_duel_host }
	}
	option = {
		name = EVTOPTB_Plus_1229 # He must have cheated!
		trigger = { character = FROMFROM }		
		if = {
			limit = { NOT = { trait = scarred } }
			random = {
				chance = 30
				add_trait = scarred
			}
		}
		if = {
			limit = { NOT = { is_rival = FROM } }
			add_rival = FROM
		}
		opinion = {
			who = event_target:coronation_duel_host
			modifier = opinion_grateful
			months = 60
		}
	}
	option = {
		name = EVTOPTC_Plus_1229 # Victory is mine!
		trigger = { character = FROM }
		prestige = 200
		if = {
			limit = { NOT = { trait = scarred } }
			random = {
				chance = 30
				add_trait = scarred
			}
		}
		opinion = {
			who = event_target:coronation_duel_host
			modifier = opinion_grateful
			months = 60
		}
	}
	option = {
		name = EVTOPTD_Plus_1228 # How scandalous!
		trigger = {
			NOR = {
				character = FROM
				character = FROMFROM
				character = event_target:coronation_duel_host
			}
			has_opinion_modifier = { who = event_target:coronation_duel_host modifier = attending_coronation }
		}
	}
}

# The Duel - loser is killed
character_event = {
	id = Plus.1231
	desc = EVTDESC_Plus_1231
	picture = GFX_evt_battle

	major = yes
	is_triggered_only = yes
	hide_from = yes
	
	major_trigger = {
		OR = {
			character = FROM
			character = FROMFROM
			character = event_target:coronation_duel_host
			has_opinion_modifier = { who = event_target:coronation_duel_host modifier = attending_coronation }
		}
	}
	
	immediate = {
		log = "[FromFrom.GetTitledName] has been killed by [From.GetTitledName] during a duel at [coronation_duel_host.GetTitledName]'s coronation"
	}
	
	option = {
		name = EVTOPTA_Plus_1228 # Most unfortunate
		trigger = { character = event_target:coronation_duel_host }
		opinion = {
			who = FROM
			modifier = opinion_disappointed
			months = 60
		}
		hidden_tooltip = {
			any_character = {
				limit = {
					has_opinion_modifier = { who = ROOT modifier = attending_coronation }
					NOT = { character = FROM }
					NOT = { character = FROMFROM }
				}
				opinion = { who = event_target:coronation_duel_host modifier = coronation_duel months = 24 }
				opinion = { who = FROM modifier = coronation_duel multiplier = 2 months = 24 }
			}
		}
	}
	option = {
		name = EVTOPTB_Plus_1228 # The bastard killed me!
		trigger = { character = FROMFROM }		
	}
	option = {
		name = EVTOPTC_Plus_1228 # Ha! He had it coming!
		trigger = { character = FROM }
		prestige = 100
		piety = -50
		if = {
			limit = { NOT = { trait = scarred } }
			random = {
				chance = 30
				add_trait = scarred
			}
		}
		opinion = {
			who = event_target:coronation_duel_host
			modifier = opinion_grateful
			months = 60
		}
	}
	option = {
		name = EVTOPTD_Plus_1228 # How scandalous!
		trigger = {
			NOR = {
				character = FROM
				character = FROMFROM
				character = event_target:coronation_duel_host
			}
			has_opinion_modifier = { who = event_target:coronation_duel_host modifier = attending_coronation }
		}
	}
}

# Wife/husband is upset that lover attends the coronation
character_event = {
	id = Plus.1232
	desc = EVTDESC_Plus_1232
	picture = GFX_evt_feast
	
	is_triggered_only = yes
	
	prisoner = no
	
	trigger = {
		NOT = { trait = incapable }
		FROM = {
			any_lover = {
				has_opinion_modifier = { who = PREV modifier = attending_coronation }
				NOR = {
					is_married = PREV
					is_consort = PREV
					has_character_flag = coronation_event
				}
			}
		}
	}
	
	immediate = {
		FROM = {
			random_lover = {
				limit = {
					has_opinion_modifier = { who = PREV modifier = attending_coronation }
					NOR = {
						is_married = PREV
						is_consort = PREV
						has_character_flag = coronation_event
					}
				}
				save_event_target_as = lover_coronation
			}
		}
	}
	
	option = {
		name = EVTOPTA_Plus_1232
		set_character_flag = coronation_event
		event_target:lover_coronation = {
			set_character_flag = coronation_event
			reverse_opinion = {
				who = ROOT
				modifier = opinion_outraged
				months = 60
			}
		}
		FROM = {
			character_event = { id = Plus.1233 tooltip = lover_at_coronation }
		}
	}
}

character_event = {
	id = Plus.1233
	desc = EVTDESC_Plus_1233
	picture = GFX_evt_feast
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_Plus_1233
		prestige = -20
		reverse_opinion = {
			who = FROM
			modifier = opinion_outraged
			months = 60
		}
	}
}

# Poet puts on a show at the coronation
character_event = {
	id = Plus.1234
	desc = EVTDESC_Plus_1234
	picture = GFX_evt_feast
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_Plus_1234 # I'll do it!
		set_character_flag = coronation_event
		FROM = {
			set_character_flag = coronation_poetry
			random_list = {
				40 = {
					modifier = {
						factor = 2.0
						diplomacy = 15
					}
					modifier = {
						factor = 1.5
						NOT = { diplomacy = 15 }
						diplomacy = 8
					}
					character_event = { id = Plus.1235 tooltip = coronation_poetry_good }
				}
				60 = {
					modifier = {
						factor = 0.3
						diplomacy = 15
					}
					modifier = {
						factor = 0.65
						NOT = { diplomacy = 15 }
						diplomacy = 8
					}
					character_event = { id = Plus.1236 tooltip = coronation_poetry_bad }
				}
			}
		}
	}
	option = {
		name = EVTOPTB_Plus_1234 # I'd rather not risk it
		trigger = { ai = no }
		random = {
			chance = 30
			add_trait = depressed
		}
	}
}

# The poetry goes over well
character_event = {
	id = Plus.1235
	desc = EVTDESC_Plus_1235
	picture = GFX_evt_feast
	
	major = yes
	is_triggered_only = yes
	
	major_trigger = {
		OR = {
			character = ROOT
			character = FROM
			has_opinion_modifier = { who = ROOT modifier = attending_coronation }
		}
	}
	
	option = {
		name = EVTOPTA_Plus_1235
		trigger = { character = ROOT }
		prestige = 50
		opinion = {
			who = FROM
			modifier = opinion_approves
			months = 60
		}
	}
	option = {
		name = EVTOPTB_Plus_1235
		trigger = { character = FROM }
		prestige = 50
		change_diplomacy = 1
	}
	option = {
		name = EVTOPTC_Plus_1235
		trigger = {
			NOT = { character = ROOT }
			NOT = { character = FROM }
			has_opinion_modifier = { who = ROOT modifier = attending_coronation }
		}
	}
}

# The poetry goes over poorly
character_event = {
	id = Plus.1236
	desc = EVTDESC_Plus_1236
	picture = GFX_evt_feast
	
	major = yes
	is_triggered_only = yes
	
	major_trigger = {
		OR = {
			character = ROOT
			character = FROM
			has_opinion_modifier = { who = ROOT modifier = attending_coronation }
		}
	}
	
	option = {
		name = EVTOPTA_Plus_1236
		trigger = { character = ROOT }
		prestige = -20
		opinion = {
			who = FROM
			modifier = opinion_disapprove
			months = 60
		}
	}
	option = {
		name = EVTOPTB_Plus_1236
		trigger = { character = FROM }
		prestige = -50
		add_trait = depressed
	}
	option = {
		name = EVTOPTC_Plus_1236
		trigger = {
			NOT = { character = ROOT }
			NOT = { character = FROM }
			has_opinion_modifier = { who = ROOT modifier = attending_coronation }
		}
	}
}

# Ruler gives a toast at the coronation
character_event = {
	id = Plus.1237
	
	hide_window = yes
	is_triggered_only = yes

	immediate = {
		set_character_flag = coronation_event
		FROM = {
			set_character_flag = coronation_toast
			character_event = { id = Plus.1238 }
		}
	}
}

character_event = {
	id = Plus.1238
	desc = EVTDESC_Plus_1238
	picture = GFX_evt_feast
	
	is_triggered_only = yes
	major = yes
	
	major_trigger = {
		OR = {
			character = ROOT
			has_opinion_modifier = { who = ROOT modifier = attending_coronation }
		}
	}
	
	option = {
		name = EVTOPTA_Plus_1238
		trigger = { character = ROOT }
		prestige = 10
		opinion = {
			who = FROM
			modifier = opinion_pleased
			months = 24
		}
	}
	option = {
		name = EVTOPTB_Plus_1238
		trigger = { NOT = { character = ROOT } }
	}
}

# A dance with the host?
character_event = {
	id = Plus.1239
	
	hide_window = yes
	is_triggered_only = yes
	
	immediate = {
		set_character_flag = coronation_event
		FROM = {
			set_character_flag = coronation_lover
			character_event = { id = Plus.1240 }
		}
	}
}

character_event = {
	id = Plus.1240
	desc = EVTDESC_Plus_1240
	picture = GFX_evt_courtly_love
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_Plus_1240 # Pursue him/her
		add_lover = FROM
		hidden_tooltip = {
			if = {
				limit = {
					is_female = no
					fertility = 0.33
					FROM = {
						is_female = yes
						fertility = 0.33
					}
				}
				if = {
					limit = { FROM = { is_married = no } }
					random = {
						chance = 50
						ROOT = { impregnate = FROM }
					}
				}
				if = {
					limit = { FROM = { is_married = yes } }
					random = {
						chance = 50
						ROOT = { impregnate_cuckoo = FROM }
					}
				}
			}
			if = {
				limit = {
					NOT = { age = 45 }
					is_female = yes
					fertility = 0.33
					FROM = {
						is_female = no
						fertility = 0.33
					}
				}
				if = {
					limit = { is_married = no }
					random = {
						chance = 50
						FROM = { impregnate = ROOT }
					}
				}
				if = {
					limit = { is_married = yes }
					random = {
						chance = 50
						FROM = { impregnate_cuckoo = ROOT }
					}
				}
			}
		}
	}
	option = {
		name = EVTOPTB_Plus_1240 # A dance is more than enough
		trigger = { ai = no }
		reverse_opinion = {
			who = FROM
			modifier = opinion_spurned
			months = 60
		}
	}
}

# A homosexual guest is interested in the host
character_event = {
	id = Plus.1241
	
	hide_window = yes	
	is_triggered_only = yes
	
	immediate = {
		set_character_flag = coronation_event
		FROM = {
			set_character_flag = coronation_lover
			character_event = { id = Plus.1242 }
		}
	}
}

character_event = {
	id = Plus.1242
	desc = EVTDESC_Plus_1240
	picture = GFX_evt_courtly_love
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_Plus_1240 # Pursue him/her
		add_lover = FROM
	}
	option = {
		name = EVTOPTB_Plus_1240 # Not interested
		trigger = { ai = no }
		reverse_opinion = {
			who = FROM
			modifier = opinion_spurned
			months = 60
		}
	}
}

# Guest is badmouthing the host
character_event = {
	id = Plus.1243
	
	hide_window = yes
	is_triggered_only = yes
	
	immediate = {
		set_character_flag = coronation_event
		FROM = {
			set_character_flag = coronation_badmouth
			character_event = { id = Plus.1244 }
		}
	}
}

character_event = {
	id = Plus.1244
	desc = EVTDESC_Plus_1244
	picture = GFX_evt_feast
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_Plus_1244 # Endure it
		ai_chance = {
			factor = 50
			modifier = {
				factor = 2
				trait = patient
			}
			modifier = {
				factor = 2
				trait = kind
			}
			modifier = {
				factor = 1.5
				trait = craven
			}
		}
		prestige = -20
		if = {
			limit = { NOT = { trait = patient } }
			random = {
				chance = 20
				add_trait = patient
			}
		}
		opinion = {
			who = FROM
			modifier = opinion_insulted
			months = 60
		}
	}
	option = {
		name = EVTOPTB_Plus_1244 # This cannot be endured
		ai_chance = {
			factor = 50
			modifier = {
				factor = 2
				trait = wroth
			}
			modifier = {
				factor = 2
				trait = cruel
			}
			modifier = {
				factor = 1.5
				trait = brave
			}
		}
		if = {
			limit = { NOT = { trait = wroth } }
			random = {
				chance = 20
				add_trait = wroth
			}
		}
		random_list = {
			20 = {
				reverse_opinion = { who = FROM modifier = opinion_impressed months = 24 }
			}
			40 = {
				reverse_opinion = { who = FROM modifier = opinion_furious months = 60 }
				hidden_tooltip = { opinion = { who = FROM modifier = opinion_insulted months = 60 } }
			}
			40 = {
				add_rival = FROM
			}
		}	
	}
}

# Guest overindulges and makes a spectacle of themselves
character_event = {
	id = Plus.1245
	
	hide_window = yes
	is_triggered_only = yes
	
	immediate = {
		set_character_flag = coronation_event
		prestige = -20
		FROM = {
			set_character_flag = coronation_drunkard
			character_event = { id = Plus.1246 }
		}
	}
}

character_event = {
	id = Plus.1246
	desc = EVTDESC_Plus_1246
	picture = GFX_evt_feast
	
	is_triggered_only = yes
	major = yes
	show_ROOT = yes
	
	major_trigger = {
		OR = {
			character = ROOT
			has_opinion_modifier = { who = FROM modifier = attending_coronation }
		}
		NOT = { character = FROM }
	}
	
	option = {
		name = EVTOPTA_Plus_1246
		opinion = { who = FROM modifier = opinion_feast_scandal months = 24 }
	}
}

# Lunatic guest makes a spectacle of themselves
character_event = {
	id = Plus.1247
	
	hide_window = yes
	is_triggered_only = yes
	
	immediate = {
		set_character_flag = coronation_event
		prestige = -20
		FROM = {
			set_character_flag = coronation_lunatic
			character_event = { id = Plus.1248 }
		}
	}
}

character_event = {
	id = Plus.1248
	desc = EVTDESC_Plus_1248
	picture = GFX_evt_feast
	
	is_triggered_only = yes
	major = yes
	show_ROOT = yes
	
	major_trigger = {
		OR = {
			character = ROOT
			has_opinion_modifier = { who = FROM modifier = attending_coronation }
		}
		NOT = { character = FROM }
	}
	
	option = {
		name = EVTOPTA_Plus_1246
		trigger = { character = ROOT }
		opinion = {
			who = FROM
			modifier = opinion_feast_scandal
			multiplier = 2
			months = 24
		}
		reverse_opinion = {
			who = FROM
			modifier = opinion_insulted
			months = 60
		}
	}
	option = {
		name = OK
		trigger = {
			NOT = { character = ROOT }
		}
		opinion = { who = FROM modifier = opinion_feast_scandal months = 24 }
	}
}

# Main event manager for host
character_event = {
	id = Plus.1250
	
	hide_window = yes
	is_triggered_only = yes
	
	has_character_flag = holding_coronation
	
	immediate = {
		repeat_event = { id = Plus.1250 days = 3 }
		random_list = {
			10 = { # Ruler gets along with host at coronation
				modifier = {
					factor = 0
					has_character_flag = coronation_friend
					NOT = { had_character_flag = { flag = coronation_friend days = 10 } }
				}
				modifier = {
					factor = 0
					num_of_friends = 5
				}
				modifier = {
					factor = 0.5
					trait = shy
				}
				modifier = {
					factor = 0.5
					trait = paranoid
				}
				modifier = {
					factor = 2.0
					trait = gregarious
				}
				modifier = {
					factor = 1.5
					trait = drunkard
				}
				modifier = {
					factor = 0
					NOT = {
						any_opinion_modifier_target = {
							is_alive = yes
							has_opinion_modifier = { who = ROOT modifier = attending_coronation }
							same_sex = ROOT
							is_ruler = yes
							is_adult = yes
							war = no
							prisoner = no
							opinion = { who = ROOT value = 0 }
							reverse_opinion = { who = ROOT value = 0 }
							NOR = {
								trait = incapable
								is_friend = ROOT
								num_of_friends = 5
								has_character_flag = coronation_event
							}
						}
					}
				}
				clr_character_flag = coronation_event
				set_character_flag = coronation_event
				random_opinion_modifier_target = {
					limit = {
						higher_tier_than = COUNT
						has_opinion_modifier = { who = ROOT modifier = attending_coronation }
						same_sex = ROOT
						is_ruler = yes
						is_adult = yes
						war = no
						prisoner = no
						opinion = { who = ROOT value = 0 }
						reverse_opinion = { who = ROOT value = 0 }
						NOR = {
							trait = shy
							trait = paranoid
							trait = incapable
							is_friend = ROOT
							num_of_friends = 5
							has_character_flag = coronation_event
						}
					}
					character_event = { id = Plus.1217 }
					break = yes
				}
				random_opinion_modifier_target = {
					limit = {
						higher_tier_than = COUNT
						has_opinion_modifier = { who = ROOT modifier = attending_coronation }
						same_sex = ROOT
						is_ruler = yes
						is_adult = yes
						war = no
						prisoner = no
						opinion = { who = ROOT value = 0 }
						reverse_opinion = { who = ROOT value = 0 }
						NOR = {
							trait = incapable
							is_friend = ROOT
							num_of_friends = 5
							has_character_flag = coronation_event
						}
					}
					character_event = { id = Plus.1217 }
					break = yes
				}
				random_opinion_modifier_target = {
					limit = {
						has_opinion_modifier = { who = ROOT modifier = attending_coronation }
						same_sex = ROOT
						is_ruler = yes
						is_adult = yes
						war = no
						prisoner = no
						opinion = { who = ROOT value = 0 }
						reverse_opinion = { who = ROOT value = 0 }
						NOR = {
							trait = shy
							trait = paranoid
							trait = incapable
							is_friend = ROOT
							num_of_friends = 5
							has_character_flag = coronation_event
						}
					}
					character_event = { id = Plus.1217 }
					break = yes
				}
				random_opinion_modifier_target = {
					limit = {
						has_opinion_modifier = { who = ROOT modifier = attending_coronation }
						same_sex = ROOT
						is_ruler = yes
						is_adult = yes
						war = no
						prisoner = no
						opinion = { who = ROOT value = 0 }
						reverse_opinion = { who = ROOT value = 0 }
						NOR = {
							trait = incapable
							is_friend = ROOT
							num_of_friends = 5
							has_character_flag = coronation_event
						}
					}
					character_event = { id = Plus.1217 }
					break = yes
				}
			}
			10 = { # Ruler argues with host over claim
				modifier = {
					factor = 0
					has_character_flag = coronation_rival
					NOT = { had_character_flag = { flag = coronation_rival days = 10 } }
				}
				modifier = {
					factor = 0
					num_of_rivals = 5
				}
				modifier = {
					factor = 0
					NOT = {
						any_opinion_modifier_target = {
							is_alive = yes
							has_opinion_modifier = { who = ROOT modifier = attending_coronation }
							is_ruler = yes
							is_adult = yes
							war = no
							prisoner = no
							any_claim = { holder = ROOT }
							OR = {
								NOT = { is_close_relative = ROOT }
								NOT = { opinion = { who = ROOT value = 0 } }
							}
							NOR = {
								trait = content
								trait = charitable
								trait = kind
								trait = incapable
								is_rival = ROOT
								num_of_rivals = 5
								has_character_flag = coronation_event
							}
						}
					}
				}
				clr_character_flag = coronation_event
				set_character_flag = coronation_event
				random_opinion_modifier_target = {
					limit = {
						has_opinion_modifier = { who = ROOT modifier = attending_coronation }
						is_ruler = yes
						is_adult = yes
						war = no
						prisoner = no
						any_claim = { holder = ROOT }
						OR = {
							NOT = { is_close_relative = ROOT }
							NOT = { opinion = { who = ROOT value = 0 } }
						}
						OR = {
							trait = envious
							trait = wroth
							trait = drunkard
						}
						NOR = {
							trait = content
							trait = charitable
							trait = kind
							trait = incapable
							is_rival = ROOT
							num_of_rivals = 5
							has_character_flag = coronation_event
						}						
					}
					character_event = { id = Plus.1219 }
					break = yes
				}
				random_opinion_modifier_target = {
					limit = {
						has_opinion_modifier = { who = ROOT modifier = attending_coronation }
						is_ruler = yes
						is_adult = yes
						war = no
						prisoner = no
						any_claim = { holder = ROOT }
						OR = {
							NOT = { is_close_relative = ROOT }
							NOT = { opinion = { who = ROOT value = 0 } }
						}
						NOR = {
							trait = content
							trait = charitable
							trait = kind
							trait = incapable
							is_rival = ROOT
							num_of_rivals = 5
							has_character_flag = coronation_event
						}						
					}
					character_event = { id = Plus.1219 }
					break = yes
				}
			}
			10 = { # Wife/husband is upset that lover attends the coronation
				modifier = {
					factor = 0
					NOT = {
						any_lover = {
							has_opinion_modifier = { who = ROOT modifier = attending_coronation }
							NOR = {
								is_married = ROOT
								is_consort = ROOT
								has_character_flag = coronation_event
							}
						}
					}
				}
				modifier = {
					factor = 0
					NOT = {
						any_spouse = {
							has_opinion_modifier = { who = ROOT modifier = attending_coronation }
							NOT = { has_character_flag = coronation_event }
						}
					}
				}
				modifier = {
					factor = 2.0
					any_spouse = {
						has_opinion_modifier = { who = ROOT modifier = attending_coronation }
						NOT = { has_character_flag = coronation_event }
						trait = wroth
					}
				}
				modifier = {
					factor = 2.0
					any_spouse = {
						has_opinion_modifier = { who = ROOT modifier = attending_coronation }
						NOT = { has_character_flag = coronation_event }
						trait = proud
					}
				}
				modifier = {
					factor = 0.5
					any_spouse = {
						has_opinion_modifier = { who = ROOT modifier = attending_coronation }
						NOT = { has_character_flag = coronation_event }
						trait = patient
					}
				}
				modifier = {
					factor = 0.5
					any_spouse = {
						has_opinion_modifier = { who = ROOT modifier = attending_coronation }
						NOT = { has_character_flag = coronation_event }
						trait = humble
					}
				}
				clr_character_flag = coronation_event
				set_character_flag = coronation_event
				random_spouse = {
					limit = {
						has_opinion_modifier = { who = ROOT modifier = attending_coronation }
						NOT = { has_character_flag = coronation_event }
						OR = {
							trait = wroth
							trait = proud
						}
					}
					character_event = { id = Plus.1232 }
					break = yes
				}
				random_spouse = {
					limit = {
						has_opinion_modifier = { who = ROOT modifier = attending_coronation }
						NOT = { has_character_flag = coronation_event }						
					}
					character_event = { id = Plus.1232 }
					break = yes
				}
			}
			10 = { # Poet puts on a show at the coronation
				modifier = {
					factor = 0
					has_character_flag = coronation_poetry
				}
				modifier = {
					factor = 0
					NOT = {
						any_opinion_modifier_target = {
							is_alive = yes
							has_opinion_modifier = { who = ROOT modifier = attending_coronation }
							is_adult = yes
							prisoner = no
							war = no
							trait = poet
							opinion = { who = ROOT value = 0 }
							NOR = {
								trait = incapable
								trait = depressed
								trait = stressed
								trait = humble
								trait = shy
								has_character_flag = coronation_event
							}
						}
					}
				}
				clr_character_flag = coronation_event
				set_character_flag = coronation_event
				random_opinion_modifier_target = {
					limit = {
						has_opinion_modifier = { who = ROOT modifier = attending_coronation }
						is_adult = yes
						prisoner = no
						war = no
						trait = poet
						opinion = { who = ROOT value = 0 }
						NOR = {
							trait = incapable
							trait = depressed
							trait = stressed
							trait = humble
							trait = shy
							has_character_flag = coronation_event
						}
					}
					character_event = { id = Plus.1234 }
				}
			}
			10 = { # Ruler gives a toast at the coronation
				modifier = {
					factor = 0
					has_character_flag = coronation_toast
					NOT = { had_character_flag = { flag = coronation_toast days = 10 } }
				}
				modifier = {
					factor = 0
					NOT = {
						any_opinion_modifier_target = {
							is_alive = yes
							has_opinion_modifier = { who = ROOT modifier = attending_coronation }
							is_adult = yes
							prisoner = no
							war = no
							ai = yes
							diplomacy = 8
							opinion = { who = ROOT value = 0 }
							NOR = {
								trait = shy
								trait = envious
								trait = cruel
								has_character_flag = coronation_event
							}
						}
					}
				}
				clr_character_flag = coronation_event
				set_character_flag = coronation_event
				random_opinion_modifier_target = {
					limit = {
						higher_tier_than = COUNT
						has_opinion_modifier = { who = ROOT modifier = attending_coronation }
						is_adult = yes
						prisoner = no
						war = no
						ai = yes
						diplomacy = 8
						opinion = { who = ROOT value = 0 }
						OR = {
							trait = gregarious
							trait = humble
							trait = kind
						}
						NOR = {
							trait = shy
							trait = envious
							trait = cruel
							has_character_flag = coronation_event
						}
					}
					character_event = { id = Plus.1237 }
					break = yes
				}
				random_opinion_modifier_target = {
					limit = {
						has_opinion_modifier = { who = ROOT modifier = attending_coronation }
						is_adult = yes
						prisoner = no
						war = no
						ai = yes
						diplomacy = 8
						opinion = { who = ROOT value = 0 }
						OR = {
							trait = gregarious
							trait = humble
							trait = kind
						}
						NOR = {
							trait = shy
							trait = envious
							trait = cruel
							has_character_flag = coronation_event
						}
					}
					character_event = { id = Plus.1237 }
					break = yes
				}
				random_opinion_modifier_target = {
					limit = {
						higher_tier_than = COUNT
						has_opinion_modifier = { who = ROOT modifier = attending_coronation }
						is_adult = yes
						prisoner = no
						war = no
						ai = yes
						diplomacy = 8
						opinion = { who = ROOT value = 0 }
						NOR = {
							trait = shy
							trait = envious
							trait = cruel
							has_character_flag = coronation_event
						}
					}
					character_event = { id = Plus.1237 }
					break = yes
				}
				random_opinion_modifier_target = {
					limit = {
						has_opinion_modifier = { who = ROOT modifier = attending_coronation }
						is_adult = yes
						prisoner = no
						war = no
						ai = yes
						diplomacy = 8
						opinion = { who = ROOT value = 0 }
						NOR = {
							trait = shy
							trait = envious
							trait = cruel
							has_character_flag = coronation_event
						}
					}
					character_event = { id = Plus.1237 }
					break = yes
				}
			}
			10 = { # A dance with the host?
				modifier = {
					factor = 0
					has_character_flag = coronation_lover
				}
				modifier = {
					factor = 5.0
					has_ambition = obj_find_lover
				}
				modifier = {
					factor = 2.0
					trait = lustful
				}
				modifier = {
					factor = 2.0
					trait = hedonist
				}
				modifier = {
					factor = 0
					is_married = yes
					trait = chaste
				}
				modifier = {
					factor = 0.5
					is_married = yes
				}
				modifier = {
					factor = 0
					has_lover = yes
					OR = {
						NOT = { trait = lustful }
						num_of_lovers = 5
					}
				}
				modifier = {
					factor = 0
					OR = {
						trait = infirm
						trait = incapable
						trait = celibate
						trait = eunuch
						trait = homosexual
						trait = chaste
					}
				}
				modifier = {
					factor = 0
					NOT = {
						any_opinion_modifier_target = {
							is_alive = yes
							has_opinion_modifier = { who = ROOT modifier = attending_coronation }
							ai = yes
							is_adult = yes
							prisoner = no
							war = no
							is_pregnant = no
							reverse_opinion = { who = ROOT value = 0 }
							opinion = { who = ROOT value = 0 }
							OR = {
								is_married = no
								trait = lustful
								trait = hedonist
							}
							OR = {
								has_lover = no
								trait = lustful
								trait = hedonist
							}
							NOR = {
								same_sex = ROOT
								is_married = ROOT
								is_lover = ROOT
								is_consort = ROOT
								is_former_lover = ROOT
								is_rival = ROOT
								is_close_relative = ROOT
								trait = infirm
								trait = celibate
								trait = eunuch
								trait = hunchback
								trait = dwarf
								trait = ugly
								trait = homosexual
								trait = chaste
								trait = blinded
								trait = inbred
								trait = imbecile
								age = 40
								num_of_lovers = 5
								has_character_flag = coronation_event
							}
						}
					}
				}
				clr_character_flag = coronation_event
				set_character_flag = coronation_event
				random_opinion_modifier_target = {
					limit = {
						has_opinion_modifier = { who = ROOT modifier = attending_coronation }
						ai = yes
						is_adult = yes
						prisoner = no
						war = no
						is_pregnant = no
						reverse_opinion = { who = ROOT value = 0 }
						opinion = { who = ROOT value = 0 }
						OR = {
							trait = lustful
							trait = hedonist
							trait = fair
							has_ambition = obj_find_lover
						}
						OR = {
							is_married = no
							trait = lustful
							trait = hedonist
						}
						OR = {
							has_lover = no
							trait = lustful
							trait = hedonist
						}
						NOR = {
							same_sex = ROOT
							is_married = ROOT
							is_lover = ROOT
							is_consort = ROOT
							is_former_lover = ROOT
							is_rival = ROOT
							is_close_relative = ROOT
							trait = infirm
							trait = celibate
							trait = eunuch
							trait = hunchback
							trait = dwarf
							trait = ugly
							trait = homosexual
							trait = chaste
							trait = blinded
							trait = inbred
							trait = imbecile
							age = 20
							num_of_lovers = 5
							has_character_flag = coronation_event
						}
					}
					character_event = { id = Plus.1239 }
					break = yes
				}
				random_opinion_modifier_target = {
					limit = {
						has_opinion_modifier = { who = ROOT modifier = attending_coronation }
						ai = yes
						is_adult = yes
						prisoner = no
						war = no
						is_pregnant = no
						reverse_opinion = { who = ROOT value = 0 }
						opinion = { who = ROOT value = 0 }
						OR = {
							trait = lustful
							trait = hedonist
							trait = fair
							has_ambition = obj_find_lover
						}
						OR = {
							is_married = no
							trait = lustful
							trait = hedonist
						}
						OR = {
							has_lover = no
							trait = lustful
							trait = hedonist
						}
						NOR = {
							same_sex = ROOT
							is_married = ROOT
							is_lover = ROOT
							is_consort = ROOT
							is_former_lover = ROOT
							is_rival = ROOT
							is_close_relative = ROOT
							trait = infirm
							trait = celibate
							trait = eunuch
							trait = hunchback
							trait = dwarf
							trait = ugly
							trait = homosexual
							trait = chaste
							trait = blinded
							trait = inbred
							trait = imbecile
							age = 40
							num_of_lovers = 5
							has_character_flag = coronation_event
						}
					}
					character_event = { id = Plus.1239 }
					break = yes
				}
				random_opinion_modifier_target = {
					limit = {
						has_opinion_modifier = { who = ROOT modifier = attending_coronation }
						ai = yes
						is_adult = yes
						prisoner = no
						war = no
						is_pregnant = no
						reverse_opinion = { who = ROOT value = 0 }
						opinion = { who = ROOT value = 0 }
						OR = {
							is_married = no
							trait = lustful
							trait = hedonist
						}
						OR = {
							has_lover = no
							trait = lustful
							trait = hedonist
						}
						NOR = {
							same_sex = ROOT
							is_married = ROOT
							is_lover = ROOT
							is_consort = ROOT
							is_former_lover = ROOT
							is_rival = ROOT
							is_close_relative = ROOT
							trait = infirm
							trait = celibate
							trait = eunuch
							trait = hunchback
							trait = dwarf
							trait = ugly
							trait = homosexual
							trait = chaste
							trait = blinded
							trait = inbred
							trait = imbecile
							age = 40
							num_of_lovers = 5
							has_character_flag = coronation_event
						}
					}
					character_event = { id = Plus.1239 }
					break = yes
				}
			}
			10 = { # A homosexual guest is interested in the host
				modifier = {
					factor = 0
					has_character_flag = coronation_lover
				}
				modifier = {
					factor = 5.0
					has_ambition = obj_find_lover
				}
				modifier = {
					factor = 2.0
					trait = lustful
				}
				modifier = {
					factor = 2.0
					trait = hedonist
				}
				modifier = {
					factor = 0
					has_lover = yes
					OR = {
						NOT = { trait = lustful }
						num_of_lovers = 5
					}
				}
				modifier = {
					factor = 0
					OR = {
						trait = infirm
						trait = incapable
						trait = celibate
						trait = eunuch
						NOT = { trait = homosexual }
						trait = chaste
					}
				}
				modifier = {
					factor = 0
					NOT = {
						any_opinion_modifier_target = {
							is_alive = yes 
							has_opinion_modifier = { who = ROOT modifier = attending_coronation }
							ai = yes
							is_adult = yes
							prisoner = no
							war = no
							is_pregnant = no
							trait = homosexual
							same_sex = ROOT
							reverse_opinion = { who = ROOT value = 0 }
							opinion = { who = ROOT value = 0 }
							OR = {
								is_married = no
								trait = lustful
								trait = hedonist
							}
							OR = {
								has_lover = no
								trait = lustful
								trait = hedonist
							}
							NOR = {
								is_married = ROOT
								is_lover = ROOT
								is_consort = ROOT
								is_former_lover = ROOT
								is_rival = ROOT
								is_close_relative = ROOT
								trait = infirm
								trait = celibate
								trait = eunuch
								trait = hunchback
								trait = dwarf
								trait = ugly
								trait = chaste
								trait = blinded
								trait = inbred
								trait = imbecile
								age = 40
								num_of_lovers = 5
								has_character_flag = coronation_event
							}
						}
					}
				}
				clr_character_flag = coronation_event
				set_character_flag = coronation_event
				random_opinion_modifier_target = {
					limit = {
						has_opinion_modifier = { who = ROOT modifier = attending_coronation }
						ai = yes
						is_adult = yes
						prisoner = no
						war = no
						is_pregnant = no
						reverse_opinion = { who = ROOT value = 0 }
						opinion = { who = ROOT value = 0 }
						trait = homosexual
						same_sex = ROOT
						OR = {
							trait = lustful
							trait = hedonist
							trait = fair
							has_ambition = obj_find_lover
						}
						OR = {
							is_married = no
							trait = lustful
							trait = hedonist
						}
						OR = {
							has_lover = no
							trait = lustful
							trait = hedonist
						}
						NOR = {
							is_married = ROOT
							is_lover = ROOT
							is_consort = ROOT
							is_former_lover = ROOT
							is_rival = ROOT
							is_close_relative = ROOT
							trait = infirm
							trait = celibate
							trait = eunuch
							trait = hunchback
							trait = dwarf
							trait = ugly
							trait = chaste
							trait = blinded
							trait = inbred
							trait = imbecile
							age = 20
							num_of_lovers = 5
							has_character_flag = coronation_event
						}
					}
					character_event = { id = Plus.1241 }
					break = yes
				}
				random_opinion_modifier_target = {
					limit = {
						has_opinion_modifier = { who = ROOT modifier = attending_coronation }
						ai = yes
						is_adult = yes
						prisoner = no
						war = no
						is_pregnant = no
						reverse_opinion = { who = ROOT value = 0 }
						opinion = { who = ROOT value = 0 }
						trait = homosexual
						same_sex = ROOT
						OR = {
							trait = lustful
							trait = hedonist
							trait = fair
							has_ambition = obj_find_lover
						}
						OR = {
							is_married = no
							trait = lustful
							trait = hedonist
						}
						OR = {
							has_lover = no
							trait = lustful
							trait = hedonist
						}
						NOR = {
							is_married = ROOT
							is_lover = ROOT
							is_consort = ROOT
							is_former_lover = ROOT
							is_rival = ROOT
							is_close_relative = ROOT
							trait = infirm
							trait = celibate
							trait = eunuch
							trait = hunchback
							trait = dwarf
							trait = ugly
							trait = chaste
							trait = blinded
							trait = inbred
							trait = imbecile
							age = 40
							num_of_lovers = 5
							has_character_flag = coronation_event
						}
					}
					character_event = { id = Plus.1241 }
					break = yes
				}
				random_opinion_modifier_target = {
					limit = {
						has_opinion_modifier = { who = ROOT modifier = attending_coronation }
						ai = yes
						is_adult = yes
						prisoner = no
						war = no
						is_pregnant = no
						reverse_opinion = { who = ROOT value = 0 }
						opinion = { who = ROOT value = 0 }
						trait = homosexual
						same_sex = ROOT
						OR = {
							is_married = no
							trait = lustful
							trait = hedonist
						}
						OR = {
							has_lover = no
							trait = lustful
							trait = hedonist
						}
						NOR = {
							is_married = ROOT
							is_lover = ROOT
							is_consort = ROOT
							is_former_lover = ROOT
							is_rival = ROOT
							is_close_relative = ROOT
							trait = infirm
							trait = celibate
							trait = eunuch
							trait = hunchback
							trait = dwarf
							trait = ugly
							trait = chaste
							trait = blinded
							trait = inbred
							trait = imbecile
							age = 40
							num_of_lovers = 5
							has_character_flag = coronation_event
						}
					}
					character_event = { id = Plus.1241 }
					break = yes
				}
			}
			10 = { # Guest is badmouthing the host
				modifier = {
					factor = 0
					has_character_flag = coronation_badmouth
					NOT = { had_character_flag = { flag = coronation_badmouth days = 10 } }
				}
				modifier = {
					factor = 0
					num_of_rivals = 5
				}
				modifier = {
					factor = 0
					NOT = {
						any_opinion_modifier_target = {
							is_alive = yes
							has_opinion_modifier = { who = ROOT modifier = attending_coronation }
							is_adult = yes
							prisoner = no
							war = no
							ai = yes
							OR = {
								trait = cruel
								trait = envious
								trait = deceitful
								trait = wroth
							}
							NOR = {
								opinion = { who = ROOT value = 0 }
								num_of_rivals = 5
								has_character_flag = coronation_event
							}
						}
					}
				}
				clr_character_flag = coronation_event
				set_character_flag = coronation_event
				random_opinion_modifier_target = {
					limit = {
						higher_tier_than = COUNT
						has_opinion_modifier = { who = ROOT modifier = attending_coronation }
						is_adult = yes
						prisoner = no
						war = no
						ai = yes
						OR = {
							trait = cruel
							trait = lunatic
							trait = possessed
						}
						OR = {
							trait = cruel
							trait = envious
							trait = deceitful
							trait = wroth
						}
						NOR = {
							opinion = { who = ROOT value = 0 }
							num_of_rivals = 5
							has_character_flag = coronation_event
						}
					}
					character_event = { id = Plus.1243 }
					break = yes
				}
				random_opinion_modifier_target = {
					limit = {
						has_opinion_modifier = { who = ROOT modifier = attending_coronation }
						is_adult = yes
						prisoner = no
						war = no
						ai = yes
						OR = {
							trait = cruel
							trait = lunatic
							trait = possessed
						}
						OR = {
							trait = cruel
							trait = envious
							trait = deceitful
							trait = wroth
						}
						NOR = {
							opinion = { who = ROOT value = 0 }
							num_of_rivals = 5
							has_character_flag = coronation_event
						}
					}
					character_event = { id = Plus.1243 }
					break = yes
				}
				random_opinion_modifier_target = {
					limit = {
						has_opinion_modifier = { who = ROOT modifier = attending_coronation }
						is_adult = yes
						prisoner = no
						war = no
						ai = yes
						OR = {
							trait = cruel
							trait = envious
							trait = deceitful
							trait = wroth
						}
						NOR = {
							opinion = { who = ROOT value = 0 }
							num_of_rivals = 5
							has_character_flag = coronation_event
						}
					}
					character_event = { id = Plus.1243 }
					break = yes
				}
			}
			10 = { # Guest overindulges and makes a spectacle of themselves
				modifier = {
					factor = 0
					has_character_flag = coronation_drunkard
				}
				modifier = {
					factor = 0
					trait = drunkard
				}
				modifier = {
					factor = 0
					NOT = {
						any_opinion_modifier_target = {
							is_alive = yes
							has_opinion_modifier = { who = ROOT modifier = attending_coronation }
							is_adult = yes
							prisoner = no
							war = no
							OR = {
								trait = drunkard
								trait = depressed
								trait = imbecile
								trait = inbred
							}
							NOT = { has_character_flag = coronation_event }
						}
					}
				}
				clr_character_flag = coronation_event
				set_character_flag = coronation_event
				random_opinion_modifier_target = {
					limit = {
						higher_tier_than = COUNT
						has_opinion_modifier = { who = ROOT modifier = attending_coronation }
						is_adult = yes
						prisoner = no
						war = no
						OR = {
							trait = drunkard
							trait = depressed
							trait = imbecile
							trait = inbred
						}
						NOT = { has_character_flag = coronation_event }
					}
					character_event = { id = Plus.1245 }
					break = yes
				}
				random_opinion_modifier_target = {
					limit = {
						is_ruler = yes
						has_opinion_modifier = { who = ROOT modifier = attending_coronation }
						is_adult = yes
						prisoner = no
						war = no
						OR = {
							trait = drunkard
							trait = depressed
							trait = imbecile
							trait = inbred
						}
						NOT = { has_character_flag = coronation_event }
					}
					character_event = { id = Plus.1245 }
					break = yes
				}
				random_opinion_modifier_target = {
					limit = {
						has_opinion_modifier = { who = ROOT modifier = attending_coronation }
						is_adult = yes
						prisoner = no
						war = no
						OR = {
							trait = drunkard
							trait = depressed
							trait = imbecile
							trait = inbred
						}
						NOT = { has_character_flag = coronation_event }
					}
					character_event = { id = Plus.1245 }
					break = yes
				}
			}
			10 = { # Lunatic guest makes a spectacle of themselves
				modifier = {
					factor = 0
					has_character_flag = coronation_lunatic
				}
				modifier = {
					factor = 0
					NOT = {
						any_opinion_modifier_target = {
							is_alive = yes
							has_opinion_modifier = { who = ROOT modifier = attending_coronation }
							is_adult = yes
							prisoner = no
							war = no
							OR = {
								trait = lunatic
								trait = possessed
							}
							NOT = { has_character_flag = coronation_event }
						}
					}
				}
				clr_character_flag = coronation_event
				set_character_flag = coronation_event
				random_opinion_modifier_target = {
					limit = {
						higher_tier_than = COUNT
						has_opinion_modifier = { who = ROOT modifier = attending_coronation }
						is_adult = yes
						prisoner = no
						war = no
						OR = {
							trait = lunatic
							trait = possessed
						}
						NOT = { has_character_flag = coronation_event }
					}
					character_event = { id = Plus.1247 }
					break = yes
				}
				random_opinion_modifier_target = {
					limit = {
						is_ruler = yes
						has_opinion_modifier = { who = ROOT modifier = attending_coronation }
						is_adult = yes
						prisoner = no
						war = no
						OR = {
							trait = lunatic
							trait = possessed
						}
						NOT = { has_character_flag = coronation_event }
					}
					character_event = { id = Plus.1247 }
					break = yes
				}
				random_opinion_modifier_target = {
					limit = {
						has_opinion_modifier = { who = ROOT modifier = attending_coronation }
						is_adult = yes
						prisoner = no
						war = no
						OR = {
							trait = lunatic
							trait = possessed
						}
						NOT = { has_character_flag = coronation_event }
					}
					character_event = { id = Plus.1247 }
					break = yes
				}
			}
			100 = { # No event
				modifier = {
					factor = 0.5
					NOT = { has_character_flag = coronation_event }
				}
				modifier = {
					factor = 0.5
					had_character_flag = { flag = coronation_event days = 6 }
				}
				modifier = {
					factor = 0.5
					had_character_flag = { flag = coronation_event days = 12 }
				}
				modifier = {
					factor = 0.5
					had_character_flag = { flag = coronation_event days = 18 }
				}
			}
		}
	}
}

# The coronation feast ends
character_event = {
	id = Plus.1275
	desc = EVTDESC_Plus_1275
	picture = GFX_evt_feast
	
	is_triggered_only = yes
	major = yes
	
	major_trigger = {
		OR = {
			character = FROM
			has_opinion_modifier = { who = FROM modifier = attending_coronation }
		}
	}
	
	immediate = {
		clr_character_flag = holding_coronation
	}
	
	option = {
		name = EVTOPTA_Plus_1275
		trigger = { character = FROM }
		prestige = 100
		if = {
			limit = { any_vassal = { leads_faction = faction_court } }
			custom_tooltip = { text = COURTFACTIONMOODPLUS }
			hidden_tooltip = {
				random_vassal = { limit = { leads_faction = faction_court } set_variable = { which = "faction_mood_increase" value = 2 } }
				character_event = { id = PlusFaction.200 days = 1 }
			}
		}
		hidden_tooltip = {
			remove_do_not_disturb_effect = yes
			clr_character_flag = has_priest_to_perform_coronation
			clr_character_flag = asked_about_coronation
			clr_character_flag = coronation_event
			clr_character_flag = coronation_lover
			clr_character_flag = coronation_duel
			clr_character_flag = coronation_poetry
			clr_character_flag = coronation_friend
			clr_character_flag = coronation_rival
			clr_character_flag = coronation_toast
			clr_character_flag = coronation_badmouth
			clr_character_flag = coronation_drunkard
			clr_character_flag = coronation_lunatic
			any_opinion_modifier_target = {
				limit = {
					is_alive = yes
					reverse_has_opinion_modifier = { who = ROOT modifier = attending_coronation }
				}
				remove_opinion = { who = ROOT modifier = attending_coronation }
				reverse_remove_opinion = { who = ROOT modifier = attending_coronation }
				character_event = { id = Plus.1276 }
			}
		}
	}
	option = {
		name = EVTOPTB_Plus_1275
		trigger = { NOT = { character = FROM } }
	}
}

# clear flags
character_event = {
	id = Plus.1276
	
	hide_window = yes
	is_triggered_only = yes
	
	has_character_flag = attending_coronation
	
	immediate = {
		remove_do_not_disturb_effect = yes
		clr_character_flag = coronation_event
		clr_character_flag = attending_coronation
		opinion = { who = FROM modifier = opinion_attended_ceremony years = 5 }
		reverse_opinion = { who = FROM modifier = opinion_attended_ceremony years = 5 }
	}
}

# Check if ruler can have regnal name
character_event = {
	id = Plus.1290
	hide_window = yes
	
	is_triggered_only = yes
	
	capable_only = yes
	prisoner = no
	
	trigger = {
		higher_real_tier_than = DUKE
		OR = {
			has_character_flag = planning_coronation
			has_landed_title = e_byzantium
			has_landed_title = e_hre
			has_landed_title = e_karling
		}
	}
	
	immediate = {
		if = {
			limit = {
				ai = no
				NOT = { has_character_flag = set_regnal_name }
				regnal_name_trigger = yes
			}
			character_event = { id = Plus.1291 } # ask about regnal name
		}
		if = {
			limit = {
				NOR = {
					has_landed_title = e_byzantium
					has_landed_title = e_hre
					has_landed_title = e_karling
				}
			}
		}
		narrative_event = { id = Plus.1215 days = 1 } #Give it an extra day.
	}
}

#Ask for regnal name
character_event = {
	id = Plus.1291
	desc = EVTDESC_Plus_1291
	hide_from = yes
	picture = GFX_evt_feast
	
	is_triggered_only = yes
	
	option = { #Select name from list
		name = EVTOPTA_Plus_1291
		trigger = {
			regnal_name_culture_trigger = yes
			OR = {
				is_female = no
				regnal_female_name_culture_trigger = yes
			}
		}
		set_character_flag = set_regnal_name
		# effect calls culture dependant events with regnal name selection
		select_regnal_name_effect = yes
	}
	
	option = { #Select a random dynastic name
		name = EVTOPTC_Plus_1291
		trigger = {
			regnal_dynastic_name_trigger = yes
		}
		character_event = { id = Plus.3890 }
	}
	
	option = {
		name = EVTOPTB_Plus_1291
	}
}
