﻿activity_HRT_italienzug = {
	is_shown = {
		OR = {
			is_ai = yes
			AND = {
				has_dlc_feature = tours_and_tournaments
				has_dlc_feature = advanced_activities
			}
		}
		has_character_flag = COR_flag_preparing_coronation
		exists = var:COR_coronator
		is_landed = yes
		HRT_is_emperor_trigger = yes
		NOR = {
			has_trait = HRT_emperor
			has_trait = COR_crowned_by_myself
		}
		faith:catholic.religious_head = {
			this = root.var:COR_coronator
			any_held_title = {
				this = title:c_roma
			}
		}
		trigger_if = {
			limit = {
				is_ai = yes
			}
			OR = {
				NOT = {
					any_character_war ?= {
						is_war_leader = root
						is_defender = root
					}
				}
				var:COR_years_reigned ?= 30
			}
		}
	}

	can_start_showing_failures_only = {
		is_capable_adult = yes
		OR = {
			custom_tooltip = {
				text = COR_war_defender
				NOT = {
					any_character_war ?= {
						is_war_leader = root
						is_defender = root
					}
				}
			}
			custom_tooltip = {
				text = COR_maxed_uncrowned_tooltip
				var:COR_years_reigned ?= 30
			}
		}
	}

	is_valid = {
		scope:host = {
			exists = capital_province
			is_alive = yes
			is_imprisoned = no
			is_landed = yes
			#highest_held_title_tier = tier_empire
			HRT_is_emperor_trigger = yes
			NOT = {	is_incapable = yes }
			faith = faith:catholic
			NOT = { has_character_flag = COR_selfcrowned }
		}
		# Coronator dying, imprisoned or unvalid
		scope:activity.special_guest:COR_coronator = {
			is_alive = yes
			is_imprisoned = no
			faith = faith:catholic
			OR = {
				has_trait = TCT_antipope
				is_cardinal = yes
				this = faith:catholic.religious_head
				is_theocratic_lessee = yes
				has_council_position = councillor_court_chaplain
			}
		}
		# Coronator is not coming for some reason
		trigger_if = {
			limit = {
				scope:activity = {
					NOT = { has_variable = activity_travel_countdown }
				}
				exists = scope:activity.var:COR_coronator_var
			}
			scope:activity.var:COR_coronator_var = {
				OR = {
					AND = {
						is_ai = yes
						involved_activity ?= scope:activity
						OR = {
							location = scope:activity.activity_location
							current_travel_plan ?= {
								travel_plan_activity = scope:activity
							}
						}
					}
					is_ai = no
				}
			}
		}
	}

	on_host_death = {
		every_attending_character = {
			limit = { is_alive = yes }
			trigger_event = {
				id = COR_ceremony.0301
				days = 1 # So you don't get spammed
			}
		}
		scope:host = {
			current_travel_plan = {
				every_entourage_character = { set_location_to_default = yes }
			}
		}
	}

	on_invalidated = {
		scope:activity.special_guest:COR_coronator ?= { save_scope_as = COR_coronator }
		# Set up the refund
		if = {
			limit = {
				scope:host = {
					NOT = { has_character_flag = COR_selfcrowned }
				}
				exists = scope:activity.var:COR_ceremony_refund_pot
			}
			scope:host = {
				set_variable = {
					name = COR_ceremony_gold_recoup_value
					value = {
						value = 0
						# For a base, add the total pot spent.
						add = scope:activity.var:COR_ceremony_refund_pot
						# Then revise it down a little to account for some costs being irredeemable.
						multiply = 0.75
					}
				}
			}
		}
		# Host becomes unlanded
		if = {
			limit = {
				scope:host = { is_landed = no }
			}
			scope:activity = {
				activity_type = { save_scope_as = activity_type }
			}
			every_attending_character = { trigger_event = activity_system.0320 }
		}
		# Host becomes incapable
		else_if = {
			limit = {
				scope:host = { is_incapable = yes }
			}
			scope:activity = {
				activity_type = { save_scope_as = activity_type }
			}
			scope:host = { trigger_event = activity_system.0330 }
			every_attending_character = {
				limit = {
					NOT = { this = scope:host }
				}
				trigger_event = activity_system.0331
			}
		}
		#Host has been imprisoned
		else_if = {
			limit = {
				scope:host = { is_imprisoned = yes }
			}
			scope:host = {
				trigger_event = COR_ceremony.0303
			}
			every_attending_character = {
				limit = {
					NOT = { this = scope:host }
				}
				trigger_event = COR_ceremony.0304
			}
		}

		# The activity failed because the Coronator died
		else_if = {
			limit = {
				scope:COR_coronator = { is_alive = no }
			}
			scope:host = { trigger_event = COR_ceremony.0305 }
			every_attending_character = {
				limit = {
					NOT = { this = scope:host }
				}
				trigger_event = COR_ceremony.0306
			}	
		}

		# Coronator was taken prisoner along the way
		else_if = {
			limit = {
				scope:COR_coronator = { is_imprisoned = yes }
			}
			scope:host = { trigger_event = COR_ceremony.0307 }
			every_attending_character = {
				limit = {
					NOR = {
						this = scope:COR_coronator
						this = scope:host
					}
				}
				trigger_event = COR_ceremony.0308
			}
		}
		
		# Invalidation for your Coronator not showing up
		else_if = {
			limit = {
				scope:activity = {
					NOT = { has_variable = activity_travel_countdown }
				}
				scope:COR_coronator = {
					is_ai = yes
					NOR = {
						involved_activity ?= scope:activity
						location = scope:activity.activity_location
						current_travel_plan ?= {
							travel_plan_activity = scope:activity
						}
					}
				}
			}
			activity_host = { trigger_event = COR_ceremony.0309 }
			every_attending_character = {
				limit = {
					NOT = { this = scope:host }
				}
				trigger_event = COR_ceremony.0310
			}
		}

		## The host doesn't meet the tier requirements
		#else_if = {
		#	limit = {
		#		scope:host = { highest_held_title_tier < tier_kingdom }
		#	}
		#	activity_host = { trigger_event = COR_ceremony.0311 }
		#	every_attending_character = {
		#		limit = {
		#			NOT = { this = scope:host }
		#		}
		#		trigger_event = COR_ceremony.0312
		#	}
		#}
		
		# You become excommunicated (because you snatched the crown from the Pope's hands; good job Napoleon)
		else_if = {
			limit = {
				scope:host = {
					has_character_flag = COR_selfcrowned
				}
			}
			activity_host = { trigger_event = COR_ceremony.0313 }
			every_attending_character = {
				limit = {
					NOR = {
						this = scope:host
						this = scope:COR_coronator
					}
				}
				trigger_event = COR_ceremony.0314
			}
		}

		# Invalidation because the Coronator is no valid priest
		else_if = {
			limit = {
				scope:COR_coronator = {
					NOR = {
						faith = faith:catholic
						OR = {
							has_trait = TCT_antipope
							is_cardinal = yes
							this = faith:catholic.religious_head
							is_theocratic_lessee = yes
							has_council_position = councillor_court_chaplain
						}
					}
				}
			}
			every_attending_character = {
				trigger_event = COR_ceremony.0315
			}
		}

		# Fallback Invalidation
		else = {
			scope:activity = {
				every_attending_character = {
					trigger_event = COR_ceremony.0316
				}
			}
		}

		# Remove flag to re-enable Organize a Coronation Ceremony Decision
		scope:host = {
			if = {
				limit = { is_alive = yes }
				remove_character_flag = COR_flag_preparing_coronation
			}
		}

		#Accolades' modifiers' removal
		if = {
			limit = {
				scope:activity = {
					any_attending_character = {
						has_character_modifier = accolade_charmer_party_modifier
					}
				}
			}
			scope:activity = {
				every_attending_character = {
					limit = {
						is_alive = yes
						has_character_modifier = accolade_charmer_party_modifier
					}
					remove_character_modifier = accolade_charmer_party_modifier
				}
			}
		}
		if = {
			limit = {
				scope:activity = {
					any_attending_character = {
						has_character_modifier = accolade_charmer_party_high_modifier
					}
				}
			}
			scope:activity = {
				every_attending_character = {
					limit = {
						is_alive = yes
						has_character_modifier = accolade_charmer_party_high_modifier
					}
					remove_character_modifier = accolade_charmer_party_high_modifier
				}
			}
		}
	}

	ai_will_do = {
		value = 1000
	}

	ai_check_interval = 4

	is_location_valid = {
		exists = barony
		exists = province_owner
		trigger_if = {
			limit = {
				exists = barony
				faith:catholic.religious_head = {
					this = scope:host.var:COR_coronator
					any_held_title = {
						this = title:c_roma
					}
				}
			}
			barony = title:b_vaticano # St. Peter's Basilica
		}
		trigger_if = {
			limit = {
				exists = barony
				faith:catholic.religious_head = {
					NAND = {
						this = scope:host.var:COR_coronator
						any_held_title = {
							this = title:c_roma
						}
					}
				}
			}
			province_owner.top_liege = scope:host
			#religion = religion:christianity_religion
			OR = {
				scope:host.capital_province = root
				scope:host.var:COR_coronator.capital_province ?= root
				COR_location_has_cathedral_trigger = yes
				barony = title:b_aachen # Aachen Cathedral
				barony = title:b_reims # Reims Cathedral
				barony = title:b_london # Westminster Abbey
				# Holy Sites
				barony = title:b_jerusalem
				barony = title:b_vaticano # St. Peter's Basilica
				barony = title:b_santiago
				barony = title:b_canterbury
			}
		}
	}

	ai_will_select_province = {
		value = 30
		if = {
			limit = { COR_location_has_cathedral_trigger = yes }
			add = {
				value = 200
				desc = "Cathedral"
			}
		}
		if = {
			limit = { barony = { is_holy_site_of = scope:host.faith } }
			add = {
				value = 100
				desc = "Holy Site"
			}
		}
		if = {
			limit = { scope:host.capital_province = root }
			add = {
				value = 50
				desc = "Capital"
			}
		}
		# Plague
		scope:host = {
			if = {
        		limit = {
        		    any_sub_realm_county = {
        		        any_county_province = {
        		            any_province_epidemic = {
        		                count >= 1
        		                outbreak_intensity < apocalyptic
        		            }
        		        }
        		    }
        		    would_follow_social_distancing_value >= -1
        		}
        		add = {
        		    value = -60
        		    desc = "Plague in Realm"
        		}
    		}
    		else_if = {
    		    limit = {
    		        any_realm_county = {
    		            any_county_province = {
    		                any_province_epidemic = {
    		                    count >= 1
    		                    outbreak_intensity < apocalyptic
    		                }
    		            }
    		        }
    		        would_follow_social_distancing_value >= -1
    		    }
    		    add = {
    		        value = -40
    		        desc = "Plague in Top Realm"
    		    }
    		}
    		if = {
    		    limit = {
    		        any_sub_realm_county = {
    		            any_county_province = {
    		                any_province_epidemic = {
    		                    count >= 1
    		                    outbreak_intensity = apocalyptic
    		                }
    		            }
    		        }
    		    }
    		    add = {
    		        value = -200
    		        desc = "Apocalyptic Plague in Realm"
    		    }
    		}
    		else_if = {
    		    limit = {
    		        any_realm_county = {
    		            any_county_province = {
    		                any_province_epidemic = {
    		                    count >= 1
    		                    outbreak_intensity = apocalyptic
    		                }
    		            }
    		        }
    		    }
    		    add = {
    		        value = -100
    		        desc = "Apocalyptic Plague in Top Realm"
    		    }
    		}
		}
	}

	province_score = {
		value = 75
		if = {
			limit = { COR_location_has_cathedral_trigger = yes }
			add = 125
		}
		#if = {
		#	limit = { barony = { is_holy_site_of = scope:host.faith } }
		#	add = 75
		#}
	}

	province_description = {
		desc = COR_activity_coronation_ceremony_province_desc
		triggered_desc = {
			trigger = {
				barony = {
					this = title:b_vaticano # St. Peter's Basilica
				}
			}
			desc = COR_activity_coronation_ceremony_province_rome_desc
		}
		triggered_desc = {
			trigger = {
				barony = {
					this = title:b_aachen # Aachen Cathedral
				}
			}
			desc = COR_activity_coronation_ceremony_province_aachen_desc
		}
		triggered_desc = {
			trigger = {
				barony = {
					this = title:b_reims # Reims Cathedral
				}
			}
			desc = COR_activity_coronation_ceremony_province_reims_desc
		}
		triggered_desc = {
			trigger = {
				barony = {
					this = title:b_london # Westminster Abbey
				}
			}
			desc = COR_activity_coronation_ceremony_province_london_desc
		}
		triggered_desc = {
			trigger = {
				barony = {
					NOR = {
						this = title:b_vaticano
						this = title:b_aachen
						this = title:b_reims
						this = title:b_london
					}
				}
				COR_location_has_cathedral_trigger = yes
			}
			desc = COR_activity_coronation_ceremony_province_cathedral_desc
		}
		triggered_desc = {
			trigger = {
				barony = {
					NOR = {
						this = title:b_vaticano
						this = title:b_aachen
						this = title:b_reims
						this = title:b_london
					}
					is_holy_site_of = scope:host.faith
				}
			}
			desc = COR_activity_coronation_ceremony_province_holy_site_desc
		}
		triggered_desc = {
			trigger = {
				scope:host.var:COR_coronator.capital_province ?= root
			}
			desc = COR_activity_coronation_ceremony_province_officiant_desc
		}
		#triggered_desc = {
		#	trigger = {
		#		scope:host.capital_province = root
		#	}
		#	desc = COR_activity_coronation_ceremony_province_capital_desc
		#}
	}

	###################
	# PARAMETERS
	###################

	activity_group_type = grand

	max_guest_arrival_delay_time = { months = 8 }

	is_single_location = yes
	
	province_filter = all

	max_route_deviation_mult = 2.0

	cost = {
		gold = {
			add = {
				add = {
					value = root.COR_base_ceremony_cost
					desc = COR_activity_coronation_ceremony_base_cost
				}
				add = {
					value = root.COR_base_ceremony_cost
					multiply = activity_cost_scale_by_era
					subtract = root.COR_base_ceremony_cost
					desc = activity_cost_scale_by_era_desc 
				}
			}
		}
	}

	ui_predicted_cost = {
		gold = {
			# Base Cost
			add = {
				value = root.COR_base_ceremony_cost
				desc = COR_activity_coronation_ceremony_base_cost
				# Scale by Era
				multiply = {
					value = activity_cost_scale_by_era
					desc = activity_cost_scale_by_era_desc
				}
				# OPTIONS
				add = { # Expedition Option
					value = 0
					#add = tiny_gold_value # Small Cost
					add = medium_gold_value # Normal Cost
					#add = major_gold_value # Grand Cost
					#divide = 3
				}
				add = { # Entertainment
					value = 0
					#add = 0 # Bad Option Cost
					add = minor_gold_value # Normal Option Cost Cost
					#add = major_gold_value # Good Option Cost
					#divide = 3
				}
				add = { # Food
					value = 0
					#add = 0 # Bad Option Cost
					add = tiny_gold_value # Normal Option Cost
					#add = medium_gold_value # Good Option Cost
					#divide = 3
				}
				add = { # Decoration
					#value = 0
					add = tiny_gold_value # Bad Option Cost
					#add = medium_gold_value # Normal Option Cost
					#add = major_gold_value # Good Option Cost
					#divide = 3
				}
				# Make it a multiple of 5 (rounded up)
				divide = 5
				ceiling = yes
				multiply = 5
			}
		}
	}

	###################
	# OPTIONS
	###################

	options = {
		#########
		# EXPEDITION OPTION
		#########
		HRT_italienzug_expedition_type = {
			HRT_italienzug_expedition_type_small = {
				cost = {
					gold = {
						add = {
							add = {
								value = tiny_gold_value
								desc = tour_entourage_small
							}
						}
						if = {
							limit = {
								root = { is_ai = yes }
							}
							multiply = 0
						}
					}
				}
				
				travel_entourage_selection = {
					weight = pilgrimage_entourage_base_set_weighting_value
					max = 10
					invite_rule_order = 1
				}

				ai_will_do = {
					value = 0
					add = { #Base amount
						value = 30
					}
					if = {
						limit = {
							has_trait = greedy
						}
						add = 30
					}
					if = {
						limit = {
							OR = {
								has_trait = lazy
								has_trait = temperate
								has_trait = content
							}
						}
						add = 15
					}
					if = {
						limit = {
							has_trait = humble
						}
						add = 10
					}
					if = {
						limit = {
							gold <= medium_gold_value
						}
						add = 100
					}
				}
			}
			HRT_italienzug_expedition_type_normal = {
				default = yes
				travel_entourage_selection = {
					weight = {
						add = pilgrimage_entourage_base_set_weighting_value
						add = pilgrimage_entourage_extras_set_weighting_value
						add = pilgrimage_entourage_sodding_everyone_set_weighting_value
					}

					max = 30
					ai_max = 20
					invite_rule_order = 1
				}

				on_start = {
					scope:host = {
						add_prestige = medium_prestige_gain
					}
				}

				ai_will_do = {
					value = 50
				}

				cost = {
					gold = {
						add = {
							add = {
								value = medium_gold_value
								desc = tour_entourage_normal
							}
						}
						if = {
							limit = {
								root = { is_ai = yes }
							}
							multiply = 0
						}
					}
				}
			}
			HRT_italienzug_expedition_type_grand = {
				#Entourage option grabbing sodding everyone suitable from court, + every grabbable rando in the duchy and maybe a few extra.
				travel_entourage_selection = {
					weight = {
						add = pilgrimage_entourage_base_set_weighting_value
						add = pilgrimage_entourage_extras_set_weighting_value
						add = pilgrimage_entourage_sodding_everyone_set_weighting_value
					}

					max = 40
					ai_max = 20
					invite_rule_order = 1
				}

				on_start = {
					scope:host = {
						add_prestige = major_prestige_gain
					}
				}

				ai_will_do = {
					value = 0
					add = { #Base amount
						value = 30
					}
					if = {
						limit = {
							OR = {
								has_trait = arrogant
								has_trait = ambitious
							}
						}
						add = 30
					}
				}

				cost = {
					gold = {	
						add = {
							add = {
								value = major_gold_value
								desc = tour_entourage_grand
							}
						}
						if = {
							limit = {
								root = { is_ai = yes }
							}
							multiply = 0
						}
					}
				}
			}
		}

		COR_ceremony_option_entertainment = {
			COR_ceremony_entertainment_bad = {
				# desc is only shown in debug AI watch window
				ai_will_do = {
					value = 0
					# Financial preference.
					add = activity_option_likes_cheap_expense_value
				}
				cost = {
					gold = {
						value = 0
					}
				}
			}

			COR_ceremony_entertainment_normal = {
				is_valid = { }
				default = yes
				# desc is only shown in debug AI watch window
				ai_will_do = {
					value = 0
					# Financial preference.
					add = activity_option_likes_middling_expense_value
				}
				cost = {
					gold = {
						add = {
							add = {
								value = minor_gold_value
								desc = COR_ceremony_entertainment_normal
							}
						}
						if = {
							limit = {
								is_ai = yes
							}
							multiply = 0
						}
					}
				}
				on_start = {
					# Vassal opinion
					COR_ceremony_normal_option_effect = yes
					# keep synced with the cost of the option
					if = {
						limit = { # add the discounted cost 
							scope:host = {
								is_ai = no
							}
						}
						change_variable = {
							name = COR_ceremony_refund_pot
							add = minor_gold_value
						}
					}
				}
			}

			COR_ceremony_entertainment_good = {
				is_valid = { }
				# desc is only shown in debug AI watch window
				ai_will_do = {
					value = 0
					# Financial preference.
					add = activity_option_likes_heavy_expense_value
				}
				cost = {
					gold = {
						add = {
							add = {
								value = major_gold_value
								desc = COR_ceremony_entertainment_good
							}
						}
						if = {
							limit = {
								is_ai = yes
							}
							multiply = 0
						}
					}
				}
				on_start = {
					# Vassal Opinion and Option bonuses
					COR_ceremony_good_option_effect = yes
					# keep synced with the cost of the option
					if = {
						limit = { # add the discounted cost 
							scope:host = {
								is_ai = no
							}
						}
						change_variable = {
							name = COR_ceremony_refund_pot
							add = major_gold_value
						}
					}
				}
			}
		}

		COR_ceremony_option_food = {
			COR_ceremony_food_bad = {
				# desc is only shown in debug AI watch window
				ai_will_do = {
					value = 0
					# Financial preference.
					add = activity_option_likes_cheap_expense_value
					# Fanciness preference.
					add = activity_option_likes_functional_food_option_value
				}
				cost = {
					gold = {
						value = 0
					}
				}
			}

			COR_ceremony_food_normal = {
				is_valid = { }
				default = yes
				# desc is only shown in debug AI watch window
				ai_will_do = {
					value = 0
					# Financial preference.
					add = activity_option_likes_middling_expense_value
					# Fanciness preference.
					## We just use slightly reduced fanciness prefs here.
					add = {
						value = activity_option_likes_ostentatious_food_option_value
						multiply = 0.5
					}
				}
				cost = {
					gold = {
						add = {
							add = {
								value = tiny_gold_value
								desc = COR_ceremony_food_normal
							}
						}
						if = {
							limit = {
								is_ai = yes
							}
							multiply = 0
						}
					}
				}
				on_start = {
					# Vassal Opinion and Option bonuses
					COR_ceremony_normal_option_effect = yes
					# keep synced with the cost of the option
					if = {
						limit = { # add the discounted cost 
							scope:host = {
								is_ai = no
							}
						}
						change_variable = {
							name = COR_ceremony_refund_pot
							add = tiny_gold_value
						}
					}
				}
			}

			COR_ceremony_food_good = {
				is_valid = { }
				# desc is only shown in debug AI watch window
				ai_will_do = {
					value = 0
					# Financial preference.
					add = activity_option_likes_heavy_expense_value
				}
				cost = {
					gold = {
						add = {
							add = {
								value = medium_gold_value
								desc = COR_ceremony_food_good
							}
						}
						if = {
							limit = {
								is_ai = yes
							}
							multiply = 0
						}
					}
				}
				on_start = {
					# Vassal Opinion and Option bonuses
					COR_ceremony_good_option_effect = yes
					# keep synced with the cost of the option
					if = {
						limit = { # add the discounted cost 
							scope:host = {
								is_ai = no
							}
						}
						change_variable = {
							name = COR_ceremony_refund_pot
							add = medium_gold_value
						}
					}
				}
			}
		}

		COR_ceremony_option_decoration = {
			COR_ceremony_decoration_bad = {
				# desc is only shown in debug AI watch window
				ai_will_do = {
					value = 0
					# Financial preference.
					add = activity_option_likes_cheap_expense_value
				}
				cost = {
					gold = {
						add = {
							add = {
								value = tiny_gold_value
								desc = wedding_decoration_bad
							}
						}
						if = {
							limit = {
								is_ai = yes
							}
							multiply = 0
						}
					}
				}
				on_start = {
					# keep synced with the cost of the option
					if = {
						limit = { # add the discounted cost 
							scope:host = {
								is_ai = no
							}
						}
						change_variable = {
							name = COR_ceremony_refund_pot
							add = tiny_gold_value
						}
					}
				}
			}

			COR_ceremony_decoration_normal = {
				is_valid = { }
				default = yes
				# desc is only shown in debug AI watch window
				ai_will_do = {
					value = 0
					# Financial preference.
					add = activity_option_likes_middling_expense_value
				}
				cost = {
					gold = {
						add = {
							add = {
								value = medium_gold_value
								desc = COR_ceremony_decoration_normal
							}
						}
						if = {
							limit = {
								is_ai = yes
							}
							multiply = 0
						}
					}
				}
				on_start = {
					# Vassal Opinion and Option bonuses
					COR_ceremony_normal_option_effect = yes
					# keep synced with the cost of the option
					if = {
						limit = { # add the discounted cost 
							scope:host = {
								is_ai = no
							}
						}
						change_variable = {
							name = COR_ceremony_refund_pot
							add = medium_gold_value
						}
					}
				}
			}

			COR_ceremony_decoration_good = {
				is_valid = { }
				# desc is only shown in debug AI watch window
				ai_will_do = {
					value = 0
					# Financial preference.
					add = activity_option_likes_heavy_expense_value
				}
				cost = {
					gold = {
						add = {
							add = {
								value = major_gold_value
								desc = COR_ceremony_decoration_good
							}
						}
						if = {
							limit = {
								is_ai = yes
							}
							multiply = 0
						}
					}
				}
				on_start = {
					# Vassal Opinion and Option bonuses
					COR_ceremony_good_option_effect = yes
					scope:host = {
						add_prestige = medium_prestige_gain
					}
					# keep synced with the cost of the option
					if = {
						limit = { # add the discounted cost 
							scope:host = {
								is_ai = no
							}
						}
						change_variable = {
							name = COR_ceremony_refund_pot
							add = major_gold_value
						}
					}
				}
			}
		}
	}

	###################
	# PHASES
	###################

	phases = {

		COR_ceremony_phase_ceremony = {
			is_predefined = yes

			order = 1

			is_shown = {
				always = yes
			}

			on_phase_active = {
				scope:host = { save_scope_as = COR_ruler }
				scope:activity.special_guest:COR_coronator ?= { save_scope_as = COR_coronator }
				# Coronation Ceremony Starts
				if = {
					limit = {
						root = scope:host
					}
					scope:host = { trigger_event = COR_ceremony.0320 }
				}
				# Accolade stuff
				if = {
					limit = {
						this = scope:host
						any_active_accolade = {
							has_accolade_parameter = accolade_party_fertility
						}
					}
					add_character_modifier = {
						modifier = accolade_charmer_party_modifier
					}
				}
				if = {
					limit = {
						this = scope:host
						any_active_accolade = {
							has_accolade_parameter = accolade_party_fertility_high
						}
					}
					add_character_modifier = {
						modifier = accolade_charmer_party_high_modifier
					}
				}
				# Fires the conclusion events for every attendee, and advance to next phase
				trigger_event = {
					on_action = COR_ceremony_ending_event_pulse
					weeks = 2
				}
			}

			on_weekly_pulse = {
				# Fires for every attendee	
				trigger_event = { on_action = COR_ceremony_ongoing_event_pulse }
			}

			ai_will_do = {
				value = 100
			}
		}

		wedding_phase_banquet = {
			is_predefined = yes

			order = 2

			on_enter_phase = {
				if = {
					limit = { this = scope:host }
					# No passive state for the toast, just jump right into it
					scope:activity = { progress_activity_phase_after = { days = 1 } }
				}
			}

			on_phase_active = {
				# Fires for every attendee
				trigger_event = COR_ceremony.0401

				if = {
					limit = {
						root = scope:host
					}
					scope:activity = { progress_activity_phase_after = { weeks = 3 } }
				}
			}

			on_weekly_pulse = {
				# Fires for every attendee
				trigger_event = { on_action = COR_ceremony_banquet_ongoing_event_pulse }
			}

			ai_will_do = {
				value = 100
			}
		}
	}

	###################
	# GUEST HANDLING
	###################

	max_guests = 100

	allow_zero_guest_invites = yes

	guest_invite_rules = {
		rules = {
			#2 = activity_invite_rule_rivals
			2 = activity_invite_rule_rivals_if_appropriate
			#2 = activity_invite_rule_extended_family
			#1 = activity_invite_rule_hof
			
			# MP 
			6 = activity_invite_mp
		}
		defaults = {
			1 = COR_activity_invite_rule_officiant
			2 = activity_invite_rule_friends
			1 = activity_invite_rule_close_family
			1 = activity_invite_rule_vassals
			2 = activity_invite_rule_fellow_vassals
			2 = activity_invite_rule_knights
			3 = activity_invite_rule_courtiers
			4 = activity_invite_rule_guests
			2 = activity_invite_rule_all_lieges
			3 = activity_invite_rule_extended_family
			#2 = activity_invite_spouses_close_family
			#2 = activity_invite_spouses_extended_family
			2 = activity_invite_neighbouring_rulers
			1 = activity_invite_spouses
		}
	}

	can_be_activity_guest = {
		is_adult = yes
		faith.religion = scope:host.faith.religion
		OR = {
			in_diplomatic_range = scope:host
			this = scope:host.var:COR_coronator
		}
	}

	host_intents = {
		intents = { HRT_submission_intent HRT_glory_intent diplomatic_intent legitimacy_intent }
		default = HRT_submission_intent
	}

	guest_intents = {
		intents = { reduce_stress_intent murder_attendee_intent diplomatic_intent banquet_mischief_intent }
		default = reduce_stress_intent
	}

	guest_join_chance = {
		base = 10
		base_activity_modifier = yes

		# Scripted Modifiers
		activity_guest_shared_ai_accept_modifier = yes
		COR_activity_guest_coronation_ai_accept_modifier = yes
	}

	special_guests = {
		COR_coronator = {
			is_required = yes

			select_character = {
				var:COR_coronator = {
					save_scope_as = character
				}
			}

			is_shown = {
				always = yes
			}

			can_pick = {
				always = yes
			}

			ai_will_do = {
				value = 100
			}

			on_invite = { }
		}
	}

	# Guests bring knights & close family
	travel_entourage_selection = {
		weight = {
			value = standard_travel_entourage_additions
			if = {
				limit = {
					is_spouse_of = scope:owner
					is_available = yes
				}
				add = 200
			}
			if = {
				limit = {
					bannable_serving_diarch_trigger = no
					OR = {
						is_knight_of = scope:owner
						scope:owner.court_position:champion_court_position ?= this
					}
					trigger_if = {
						limit = { is_landed = yes }
						highest_held_title_tier = tier_barony
					}
					is_available = yes
				}
				add = 100
			}
			if = {
				limit = {
					bannable_serving_diarch_trigger = no
					is_landed = no
					is_close_family_of = scope:owner
					is_available = yes
				}
				add = 50
			}
		}

		max = 18
		invite_rule_order = 1
	}
	
	###################
	# ACTIVITY-SPECIFIC PULSES
	###################

	pulse_actions = {
		entries = {
			COR_excellent_food
			hook_trusting_guest
			COR_dynasty_blessing
			COR_royal_gift
			COR_contact_network
			COR_admired_venue
			knight_praised
			COR_impressed_courtly_vassal
			COR_music_performance
			COR_poetry_performance
			COR_officiant_impressed
			COR_lauded_food
			guest_impressed_by_court_artifact
			friend_lauds_efforts
			COR_courtly_vassals_appeased
			host_gains_diplo_xp
			host_gains_steward_xp
			host_gains_intrigue_xp
			COR_ridiculed_food
		}
		chance_of_no_event = 3
	}

	on_start = {
		# Keep synced with the wedding Base cost
		set_variable = {
			name = COR_ceremony_refund_pot
			value = scope:host.base_wedding_cost
		}
		scope:activity = {
			# save officiant as a variable, else is_valid won't work
			set_variable = {
				name = COR_coronator_var
				value = special_guest:COR_coronator
			}
			# we save a countdown to check that the officiant has not got stuck in odd places - don't ask
			set_variable = {
				name = activity_travel_countdown
				days = 15
			}
		}
	}

	on_enter_travel_state = {
		scope:host.current_travel_plan = {
			set_variable = {
				name = HRT_italienzug
				value = yes
			}
			every_entourage_character = {
				limit = {
					can_be_knight_trigger = {
						ARMY_OWNER = scope:host
					}
				}
				add_character_flag = wear_armor
			}
		}
	}

	on_enter_active_state = {
		scope:host.current_travel_plan = {
			every_entourage_character = {
				if = {
					limit = {
						is_alive = yes
						has_character_flag = wear_armor
					}
					remove_character_flag = wear_armor
				}
			}
		}
	}

	on_complete = {
		if = {
			limit = { this = scope:host }
			create_character_memory = {
				type = HRT_italienzug_host_memory
			}
			scope:host = {
				HRT_italienzug_completed_log_entry_effect = yes
			}
		}
		else = {			
			create_character_memory = {
				type = HRT_italienzug_guest_memory
				participants = {
					host = scope:host
				}
			}
		}
	}

	###################
	# GRAPHICS
	###################

	map_entity = {
		trigger = {
			activity_location.culture = {
				OR = {
					has_graphical_mena_culture_group_trigger = yes
					has_graphical_steppe_culture_group_trigger = yes
					has_graphical_african_culture_group_trigger = yes
				}
			}
		}
		reference = "building_mena_wedding_01_entity"
	}

	map_entity = {
		trigger = {
			activity_location.culture = {
				has_graphical_india_culture_group_trigger = yes
			}
		}
		reference = "building_indian_wedding_01_entity"
	}
	
	map_entity = "building_western_wedding_01_entity"

	# Travel
	background = { # Bridge
		trigger = {
			NOT = { scope:host.location = scope:activity.activity_location }
			scope:host.location = {
				is_riverside_province = yes
				geographical_region = world_europe
				OR = {
					terrain = farmlands
					terrain = plains
					terrain = mountains
					terrain = hills
				}
			}
		}
		texture = "gfx/interface/illustrations/event_scenes/ep2_travel_bridge.dds"
		environment = "environment_travel_bridge"
		ambience = "event:/SFX/Events/Backgrounds/mountains_day"
	}
	
	background = { # Farmland, settled
		trigger = {
			NOT = { scope:host.location = scope:activity.activity_location }
			scope:host.location = {
				terrain = farmlands
				exists = province_owner
			}
		}
		texture = "gfx/interface/illustrations/event_scenes/ep2_travel_farm.dds"
		environment = "environment_travel_farmlands"
		ambience = "event:/SFX/Events/Backgrounds/fields_farms_day"
	}
	background = { # Farmland, unsettled
		trigger = {
			NOT = { scope:host.location = scope:activity.activity_location }
			scope:host.location = {
				terrain = farmlands
				NOT = { exists = province_owner }
			}
		}
		texture = "gfx/interface/illustrations/event_scenes/farms.dds"
		environment = "environment_event_farms"
		ambience = "event:/SFX/Events/Backgrounds/fields_farms_day"
	}

	background = { #Desert, settled
		trigger = {
			NOT = { scope:host.location = scope:activity.activity_location }
			scope:host.location = {
				graphical_wilderness_desert_trigger = yes
				exists = province_owner
			}
		}
		texture = "gfx/interface/illustrations/event_scenes/ep2_travel_desert.dds"
		environment = "environment_travel_desert"
		ambience = "event:/SFX/Events/Backgrounds/desert_day"
	}
	background = { #Desert, unsettled
		trigger = {
			NOT = { scope:host.location = scope:activity.activity_location }
			scope:host.location = {
				graphical_wilderness_desert_trigger = yes
				NOT = { exists = province_owner }
			}
		}
		texture = "gfx/interface/illustrations/event_scenes/desert.dds"
		environment = "environment_event_bp1_desert"
		ambience = "event:/SFX/Events/Backgrounds/desert_day"
	}

	background = { #forest snowy
		trigger = {
			NOT = { scope:host.location = scope:activity.activity_location }
			scope:host.location ?= { hunt_snowy_forest_trigger = yes }
		}
		texture = "gfx/interface/illustrations/event_scenes/ep2_hunt_snowy_forest.dds"
		environment = "environment_hunt_snowy_forest"
		ambience = "event:/SFX/Events/Backgrounds/mountains_day"
	}

	background = { #forest_pine
		trigger = {
			NOT = { scope:host.location = scope:activity.activity_location }
			scope:host.location = {
				graphical_wilderness_forest_pine_trigger = yes
			}
		}
		texture = "gfx/interface/illustrations/event_scenes/forest_pine.dds"
		environment = "environment_event_forest_pine"
		ambience = "event:/SFX/Events/Backgrounds/coniferous_forest_day"
	}

	background = { #forest
		trigger = {
			NOT = { scope:host.location = scope:activity.activity_location }
			scope:host.location = {
				graphical_wilderness_forest_trigger = yes
			}
		}
		texture = "gfx/interface/illustrations/event_scenes/forest.dds"
		environment = "environment_event_forest"
		ambience = "event:/SFX/Events/Backgrounds/deciduous_forest_day"
	}

	background = { #mountains, settled
		trigger = {
			NOT = { scope:host.location = scope:activity.activity_location }
			scope:host.location = {
				graphical_wilderness_mountains_trigger = yes
				exists = province_owner
			}
		}
		texture = "gfx/interface/illustrations/event_scenes/ep2_travel_mountains.dds"
		environment = "environment_travel_mountain_settlement"
		ambience = "event:/SFX/Events/Backgrounds/mountains_day"
	}
	background = { #mountains, unsettled
		trigger = {
			NOT = { scope:host.location = scope:activity.activity_location }
			scope:host.location = {
				graphical_wilderness_mountains_trigger = yes
				NOT = { exists = province_owner }
			}
		}
		texture = "gfx/interface/illustrations/event_scenes/mountains.dds"
		environment = "environment_event_mountains"
		ambience = "event:/SFX/Events/Backgrounds/mountains_day"
	}

	background = { #steppe, settled
		trigger = {
			NOT = { scope:host.location = scope:activity.activity_location }
			scope:host.location = {
				graphical_wilderness_steppe_trigger = yes
				exists = province_owner
			}
		}
		texture = "gfx/interface/illustrations/event_scenes/ep2_travel_steppe.dds"
		environment = "environment_travel_steppe_settlement"
		ambience = "event:/SFX/Events/Backgrounds/steppe_day"
	}
	background = { #steppe, unsettled
		trigger = {
			NOT = { scope:host.location = scope:activity.activity_location }
			scope:host.location = {
				graphical_wilderness_steppe_trigger = yes
				NOT = { exists = province_owner }
			}
		}
		texture = "gfx/interface/illustrations/event_scenes/steppe.dds"
		environment = "environment_event_steppe"
		ambience = "event:/SFX/Events/Backgrounds/steppe_day"
	}

	background = { #drylands (formerly desert)
		trigger = {
			NOT = { scope:host.location = scope:activity.activity_location }
			scope:host.location = {
				graphical_drylands_trigger = yes
			}
		}
		texture = "gfx/interface/illustrations/event_scenes/drylands.dds"
		environment = "environment_event_desert"
		ambience = "event:/SFX/Events/Backgrounds/desert_day"
	}

	background = { #wetlands
		trigger = {
			NOT = { scope:host.location = scope:activity.activity_location }
			scope:host.location = {
				graphical_wilderness_wetlands_trigger = yes
			}
		}
		texture = "gfx/interface/illustrations/event_scenes/bp1_wetlands.dds"
		environment = "environment_event_bp1_wetlands" 
		ambience = "event:/SFX/Events/Backgrounds/deciduous_forest_day"
	}

	background = { #jungle
		trigger = {
			NOT = { scope:host.location = scope:activity.activity_location }
			scope:host.location = {
				graphical_wilderness_jungle_trigger = yes
			}
		}
		texture = "gfx/interface/illustrations/event_scenes/bp1_jungle.dds"
		environment = "environment_event_bp1_jungle"
		ambience = "event:/SFX/Events/Backgrounds/deciduous_forest_day"
	}

	background = { #plains, settled
		trigger = {
			NOT = { scope:host.location = scope:activity.activity_location }
			scope:host.location = {
				graphical_plains_trigger = yes
				exists = province_owner
			}
		}
		texture = "gfx/interface/illustrations/event_scenes/ep2_travel_hills.dds"
		environment = "environment_travel_hills_settlement"
		ambience = "event:/SFX/Events/Backgrounds/fields_farms_day"
	}
	background = { #plains, unsettled
		trigger = {
			NOT = { scope:host.location = scope:activity.activity_location }
			scope:host.location = {
				graphical_plains_trigger = yes
				NOT = { exists = province_owner }
			}
		}
		texture = "gfx/interface/illustrations/event_scenes/bp1_plains.dds"
		environment = "environment_event_bp1_plains"
		ambience = "event:/SFX/Events/Backgrounds/fields_farms_day"
	}

	background = { #hills, settled
		trigger = {
			NOT = { scope:host.location = scope:activity.activity_location }
			scope:host.location = {
				graphical_hills_trigger = yes
				exists = province_owner
			}
		}
		texture = "gfx/interface/illustrations/event_scenes/ep2_travel_hills.dds"
		environment = "environment_travel_hills_settlement"
		ambience = "event:/SFX/Events/Backgrounds/fields_farms_day"
	}
	background = { #hills, unsettled
		trigger = {
			NOT = { scope:host.location = scope:activity.activity_location }
			scope:host.location = {
				graphical_hills_trigger = yes
				NOT = { exists = province_owner }
			}
		}
		texture = "gfx/interface/illustrations/event_scenes/bp1_hills.dds"
		environment = "environment_event_bp1_hills"
		ambience = "event:/SFX/Events/Backgrounds/fields_farms_day"
	}

	background = { #sea
		trigger = {
			NOT = { scope:host.location = scope:activity.activity_location }
			scope:host.location = {
				is_sea_province = yes
			}
		}
		texture = "gfx/interface/illustrations/event_scenes/fp1_ocean.dds"
		environment = "environment_event_fp1_ocean"
		ambience = "event:/DLC/FP1/SFX/Events/event_ocean_longship"
	}
	# End Travel

	background = {	 #Indian
		trigger = {
			activity_location.culture = { has_graphical_india_culture_group_trigger = yes }
		}
		texture = "gfx/interface/illustrations/event_scenes/ep2_wedding_ceremony_indian.dds"
		environment = "environment_indian_wedding"
		ambience = "event:/DLC/EP2/SFX/Events/Grand_Activities/Weddings/ep2_event_grand_wedding"
		music = "weddingindia_cue"
	}
	background = {	 #MENA (also steppes and African )
		trigger = {
			OR = {
				activity_location.culture = { has_graphical_mena_culture_group_trigger = yes }
				activity_location.culture = { has_graphical_steppe_culture_group_trigger = yes }
				activity_location.culture = { has_graphical_african_culture_group_trigger = yes }
			}
		}
		texture = "gfx/interface/illustrations/event_scenes/ep2_wedding_ceremony_mena.dds"
		environment = "environment_mena_wedding"
		ambience = "event:/DLC/EP2/SFX/Events/Grand_Activities/Weddings/ep2_event_grand_wedding"
		music = "weddingmena_cue"
	}
	background = {	 # Western - Fallback
		texture = "gfx/interface/illustrations/event_scenes/ep2_wedding_ceremony_western.dds"
		environment = "environment_western_wedding"
		ambience = "event:/DLC/EP2/SFX/Events/Grand_Activities/Weddings/ep2_event_grand_wedding"
		music = "weddingwest_cue"
	}

	window_characters = {
		
		guest = {
			camera = camera_event_right
			
			effect = {
				if = {
					limit = {
						scope:host.location = scope:activity.activity_location
						exists = scope:host.intent_target
						any_attending_character = {
							location = scope:activity.activity_location
							NOR = {
								this = scope:host
								scope:activity.special_guest:COR_coronator = this
							}
							this = scope:host.intent_target
						}
					}
					every_attending_character = {
						limit = {
							location = scope:activity.activity_location
							NOR = {
								this = scope:host
								scope:activity.special_guest:COR_coronator = this
							}
							this = scope:host.intent_target
						}
						add_to_list = characters
					}
				}
				else_if = {
					limit = {
						scope:host.location = scope:activity.activity_location
						any_attending_character = {
							location = scope:activity.activity_location
							NOR = {
								this = scope:host
								scope:activity.special_guest:COR_coronator = this
							}
							highest_held_title_tier >= tier_kingdom
						}
					}
					every_attending_character = {
						limit = {
							location = scope:activity.activity_location
							NOR = {
								this = scope:host
								scope:activity.special_guest:COR_coronator = this
							}
							highest_held_title_tier >= tier_kingdom
						}
						add_to_list = characters
					}
				}
				else_if = {
					limit = {
						scope:host.location = scope:activity.activity_location
						any_attending_character = {
							location = scope:activity.activity_location
							NOR = {
								this = scope:host
								scope:activity.special_guest:COR_coronator = this
							}
							highest_held_title_tier >= tier_duchy
						}
					}
					every_attending_character = {
						limit = {
							location = scope:activity.activity_location
							NOR = {
								this = scope:host
								scope:activity.special_guest:COR_coronator = this
							}
							highest_held_title_tier >= tier_duchy
						}
						add_to_list = characters
					}
				}
				else_if = {
					limit = {
						scope:host.location = scope:activity.activity_location
						any_attending_character = {
							location = scope:activity.activity_location
							NOR = {
								this = scope:host
								scope:activity.special_guest:COR_coronator = this
							}
							is_vassal_of = scope:host
						}
					}
					every_attending_character = {
						limit = {
							location = scope:activity.activity_location
							NOR = {
								this = scope:host
								scope:activity.special_guest:COR_coronator = this
							}
							is_vassal_of = scope:host
						}
						add_to_list = characters
					}
				}
				else_if = {
					limit = {
						scope:host.location = scope:activity.activity_location
						any_attending_character = {
							location = scope:activity.activity_location
							NOR = {
								this = scope:host
								scope:activity.special_guest:COR_coronator = this
							}
							is_councillor_of = scope:host
						}
					}
					every_attending_character = {
						limit = {
							location = scope:activity.activity_location
							NOR = {
								this = scope:host
								scope:activity.special_guest:COR_coronator = this
							}
							is_councillor_of = scope:host
						}
						add_to_list = characters
					}
				}
				else_if = {
					limit = {
						scope:host.location = scope:activity.activity_location
						any_attending_character = {
							location = scope:activity.activity_location
							NOR = {
								this = scope:host
								scope:activity.special_guest:COR_coronator = this
							}
						}
					}
					every_attending_character = {
						limit = {
							location = scope:activity.activity_location
							NOR = {
								this = scope:host
								scope:activity.special_guest:COR_coronator = this
							}
						}
						add_to_list = characters
					}
				}
			}

			scripted_animation = {
				triggered_animation = {
					trigger = {
						scope:character = {
							any_claim = {
								tier >= tier_kingdom
								holder = scope:host
							}
						}
					}
					animation = { dismissal worry disbelief personality_cynical disapproval }
				}
				triggered_animation = {
					trigger = {
						NOT = {
							scope:character = {
								any_claim = {
									tier >= tier_kingdom
									holder = scope:host
								}
							}
						}
					}
					animation = { drink_goblet toast throne_room_conversation_3 throne_room_conversation_4 throne_room_conversation_1 admiration }
				}
				#Fallback
				animation = toast
			}
		}

		retainer = {
			camera = camera_activity_horse
			
			effect = {
				if = {
					limit = {
						exists = scope:host.current_travel_plan
						has_activity_option = {
							category = HRT_italienzug_expedition_type
							option = HRT_italienzug_expedition_type_grand
						}
					}
					scope:host.current_travel_plan = {
						every_entourage_character = {
							limit = {
								faith = scope:host.faith
								culture = {
									OR = {
										has_same_culture_heritage = scope:host.culture
										has_cultural_pillar = heritage_central_germanic
										has_cultural_pillar = heritage_frankish
										has_cultural_pillar = heritage_latin
									}
								}
								NOT = {
									scope:host.location = scope:activity.activity_location
								}
								is_knight = yes
							}
							alternative_limit = {
								faith = scope:host.faith
								culture = {
									has_same_culture_heritage = scope:host.culture
								}
								NOT = {
									scope:host.location = scope:activity.activity_location
								}
								has_character_flag = wear_armor
							}	
							add_to_list = characters
						}
					}
				}
			}

			scripted_animation = {
				triggered_animation = {
					trigger = {
						scope:character.location = { is_sea_province = yes }
					}
					animation = { idle }
				}
				animation = jockey_walk
			}
		}

		retainer = {
			camera = camera_activity_horse
			
			effect = {
				if = {
					limit = {
						exists = scope:host.current_travel_plan
					}
					scope:host.current_travel_plan = {
						every_entourage_character = {
							limit = {
								faith = scope:host.faith
								culture = {
									OR = {
										has_same_culture_heritage = scope:host.culture
										has_cultural_pillar = heritage_central_germanic
										has_cultural_pillar = heritage_frankish
										has_cultural_pillar = heritage_latin
									}
								}
								NOT = {
									scope:host.location = scope:activity.activity_location
								}
								is_knight = yes
							}
							alternative_limit = {
								faith = scope:host.faith
								culture = {
									has_same_culture_heritage = scope:host.culture
								}
								NOT = {
									scope:host.location = scope:activity.activity_location
								}
								has_character_flag = wear_armor
							}	
							add_to_list = characters
						}
					}
				}
			}

			scripted_animation = {
				triggered_animation = {
					trigger = {
						scope:character.location = { is_sea_province = yes }
					}
					animation = { idle }
				}
				animation = jockey_walk
			}
		}
		
		host = {
			camera = camera_event_center
			
			effect = {
				if = {
					limit = {
						scope:host.location = scope:activity.activity_location
					}
					scope:host = {
						add_to_list = characters
					}
				}
			}
			scripted_animation = {
				triggered_animation = {
					trigger = {
						always = yes
					}
					animation = { idle }
				}
			}
		}
		
		travel_host = {
			camera = camera_activity_horse
			
			effect = {
				if = {
					limit = {
						NOT = {
							scope:host.location = scope:activity.activity_location
						}
					}
					scope:host = {
						add_to_list = characters
					}
				}
			}
			scripted_animation = {
				triggered_animation = {
					trigger = {
						scope:character.location = { is_sea_province = yes }
					}
					animation = { idle }
				}
				animation = jockey_walk
			}
		}

		officiant_traveling = {
			camera = camera_activity_horse
			
			effect = {
				if = {
					limit = {
						scope:activity.special_guest:COR_coronator.involved_activity ?= scope:activity
						NOT = {
							scope:activity.special_guest:COR_coronator.location ?= scope:activity.activity_location
						}
						special_guest:COR_coronator ?= {
							NOT = {
								this = faith:catholic.religious_head
							}
						}
					}
					special_guest:COR_coronator ?= {
						add_to_list = characters
					}
				}
			}
			scripted_animation = {
				triggered_animation = {
					trigger = {
						scope:character.location = { is_sea_province = yes }
					}
					animation = { idle }
				}
				triggered_animation = {
					trigger = { scope:character = { has_trait = impatient } }
					animation = { jockey_gallop }
				}
				animation = jockey_walk
			}
		}
		
		officiant = {
			camera = camera_event_center
			
			effect = {
				if = {
					limit = {
						OR = {
							scope:activity = { is_current_phase_active = yes }
							AND = {
								scope:host.location = scope:activity.activity_location
								scope:activity.special_guest:COR_coronator.location ?= scope:activity.activity_location
							}
						}
					}
					special_guest:COR_coronator ?= {
						add_to_list = characters
					}
				}
			}
			scripted_animation = {
				triggered_animation = {
					trigger = {
						always = yes
					}
					animation = { personality_zealous chaplain personality_forgiving personality_content }
				}
			}
		}

		retainer = {
			camera = camera_activity_horse
			
			effect = {
				if = {
					limit = {
						exists = scope:host.current_travel_plan
					}
					scope:host.current_travel_plan = {
						every_entourage_character = {
							limit = {
								faith = scope:host.faith
								culture = {
									OR = {
										has_same_culture_heritage = scope:host.culture
										has_cultural_pillar = heritage_central_germanic
										has_cultural_pillar = heritage_frankish
										has_cultural_pillar = heritage_latin
									}
								}
								NOT = {
									scope:host.location = scope:activity.activity_location
								}
								is_knight = yes
							}
							alternative_limit = {
								faith = scope:host.faith
								culture = {
									has_same_culture_heritage = scope:host.culture
								}
								NOT = {
									scope:host.location = scope:activity.activity_location
								}
								has_character_flag = wear_armor
							}
							add_to_list = characters
						}
					}
				}
			}

			scripted_animation = {
				triggered_animation = {
					trigger = {
						scope:character.location = { is_sea_province = yes }
					}
					animation = { idle }
				}
				animation = jockey_walk
			}
		}

		retainer = {
			camera = camera_activity_horse
			
			effect = {
				if = {
					limit = {
						exists = scope:host.current_travel_plan
						has_activity_option = {
							category = HRT_italienzug_expedition_type
							option = HRT_italienzug_expedition_type_grand
						}
					}
					scope:host.current_travel_plan = {
						every_entourage_character = {
							limit = {
								faith = scope:host.faith
								culture = {
									OR = {
										has_same_culture_heritage = scope:host.culture
										has_cultural_pillar = heritage_central_germanic
										has_cultural_pillar = heritage_frankish
										has_cultural_pillar = heritage_latin
									}
								}
								NOT = {
									scope:host.location = scope:activity.activity_location
								}
								is_knight = yes
							}
							alternative_limit = {
								faith = scope:host.faith
								culture = {
									has_same_culture_heritage = scope:host.culture
								}
								NOT = {
									scope:host.location = scope:activity.activity_location
								}
								has_character_flag = wear_armor
							}
							add_to_list = characters
						}
					}
				}
			}

			scripted_animation = {
				triggered_animation = {
					trigger = {
						scope:character.location = { is_sea_province = yes }
					}
					animation = { idle }
				}
				animation = jockey_walk
			}
		}
		
		guest = {
			camera = camera_event_left
			
			effect = {
				if = {
					limit = {
						scope:host.location = scope:activity.activity_location
						any_attending_character = {
							location = scope:activity.activity_location
							NOR = {
								this = scope:host
								scope:activity.special_guest:COR_coronator = this
							}
							highest_held_title_tier >= tier_kingdom
							NOT = { this = scope:host.intent_target }
						}
					}
					every_attending_character = {
						limit = {
							location = scope:activity.activity_location
							NOR = {
								this = scope:host
								scope:activity.special_guest:COR_coronator = this
							}
							highest_held_title_tier >= tier_kingdom
							NOT = { this = scope:host.intent_target }
						}
						add_to_list = characters
					}
				}
				else_if = {
					limit = {
						scope:host.location = scope:activity.activity_location
						any_attending_character = {
							location = scope:activity.activity_location
							NOR = {
								this = scope:host
								scope:activity.special_guest:COR_coronator = this
							}
							highest_held_title_tier >= tier_duchy
							NOT = { this = scope:host.intent_target }
						}
					}
					every_attending_character = {
						limit = {
							location = scope:activity.activity_location
							NOR = {
								this = scope:host
								scope:activity.special_guest:COR_coronator = this
							}
							highest_held_title_tier >= tier_duchy
							NOT = { this = scope:host.intent_target }
						}
						add_to_list = characters
					}
				}
				else_if = {
					limit = {
						scope:host.location = scope:activity.activity_location
						any_attending_character = {
							location = scope:activity.activity_location
							NOR = {
								this = scope:host
								scope:activity.special_guest:COR_coronator = this
							}
							is_vassal_of = scope:host
							NOT = { this = scope:host.intent_target }
						}
					}
					every_attending_character = {
						limit = {
							location = scope:activity.activity_location
							NOR = {
								this = scope:host
								scope:activity.special_guest:COR_coronator = this
							}
							is_vassal_of = scope:host
							NOT = { this = scope:host.intent_target }
						}
						add_to_list = characters
					}
				}
				else_if = {
					limit = {
						scope:host.location = scope:activity.activity_location
						any_attending_character = {
							location = scope:activity.activity_location
							NOR = {
								this = scope:host
								scope:activity.special_guest:COR_coronator = this
							}
							is_councillor_of = scope:host
							NOT = { this = scope:host.intent_target }
						}
					}
					every_attending_character = {
						limit = {
							location = scope:activity.activity_location
							NOR = {
								this = scope:host
								scope:activity.special_guest:COR_coronator = this
							}
							is_councillor_of = scope:host
							NOT = { this = scope:host.intent_target }
						}
						add_to_list = characters
					}
				}
				else_if = {
					limit = {
						scope:host.location = scope:activity.activity_location
						any_attending_character = {
							location = scope:activity.activity_location
							NOR = {
								this = scope:host
								scope:activity.special_guest:COR_coronator = this
							}
						}
					}
					every_attending_character = {
						limit = {
							location = scope:activity.activity_location
							NOR = {
								this = scope:host
								scope:activity.special_guest:COR_coronator = this
							}
						}
						add_to_list = characters
					}
				}
			}

			scripted_animation = {
				triggered_animation = {
					trigger = {
						scope:character = {
							any_claim = {
								tier >= tier_kingdom
								holder = scope:host
							}
						}
					}
					animation = { dismissal disapproval }
				}
				triggered_animation = {
					trigger = {
						NOT = {
							scope:character = {
								any_claim = {
									tier >= tier_kingdom
									holder = scope:host
								}
							}
						}
					}
					animation = { drink_goblet toast happiness throne_room_conversation_3 throne_room_conversation_1 admiration }
				}
				#Fallback
				animation = toast
			}
		}
	}
}