﻿#Starting a travel plan (starting to travel to the first destination)

namespace = travel_start_event

############################
## Travel Start Events
## 1000-1080
## by Filippa Gannholm Kirsten
############################
# travel_start_event.1000 - Generic start (no activity)
# travel_start_event.1010 - Travelling to a Tournament
# travel_start_event.1020 - Setting off on a Tour
# travel_start_event.1030 - Travelling to a Wedding
# travel_start_event.1040 - Travelling to a Feast
# travel_start_event.1050 - Travelling to a Playdate
# travel_start_event.1060 - Going on a Pilgrimage
# travel_start_event.1070 - Travelling to a Hunt
# travel_start_event.1080 - Travelling to a Witch Ritual
# travel_start_event.1090 - Travelling to a Lifestyle Travel Activity
# travel_start_event.1100 - Travelling to an Examination Activity
# travel_start_event.1110 - Travelling to a Mandala Ritual
# travel_start_event.1120 - Travelling to a Debate

##DEBUG Event
travel_start_event.0001 = {
	hidden = yes
	orphan = yes
	immediate = {
		# Set variables on the travel plan to save the start date and a base count for provinces traversed. These are referenced in the travel conclusion event
		current_travel_plan = {
			set_variable = {
				name = travel_plan_start_date
				value = current_date
			}
			set_variable = {
				name = travel_plan_provinces_traversed
				value = 1
			}
		}
		if = {
			limit = {
				exists = current_travel_plan.travel_leader
			}
			current_travel_plan.travel_leader = {
				save_scope_as = travel_leader
			}
		}
		random_courtier = {
			limit = {
				is_available_adult = yes
				NOR = { 
					this = root
					trigger_if = {
						limit = { exists = scope:travel_leader }
						this = scope:travel_leader
					}
				}
			}
			save_scope_as = entourage_member_one
		}
		random_courtier = {
			limit = {
				is_available_adult = yes
				NOR = { 
					this = root
					trigger_if = {
						limit = { exists = scope:travel_leader }
						this = scope:travel_leader
					}
					trigger_if = {
						limit = { exists = scope:entourage_member_one }
						this = scope:entourage_member_one
					}
				}
			}
			save_scope_as = entourage_member_two
		}
		random_vassal_or_below = {
			limit = {
				is_available_adult = yes
				is_knight_of = root
				NOR = { 
					this = root
					trigger_if = {
						limit = { exists = scope:travel_leader }
						this = scope:travel_leader
					}
					trigger_if = {
						limit = { exists = scope:entourage_member_one }
						this = scope:entourage_member_one
					}
					trigger_if = {
						limit = { exists = scope:entourage_member_two }
						this = scope:entourage_member_two
					}
				}
			}
			save_scope_as = entourage_member_knight
		}
		if = {
			limit = {
				any_prisoner = { }
				is_adult = yes
				NOR = { 
					this = root
					trigger_if = {
						limit = { exists = scope:travel_leader }
						this = scope:travel_leader
					}
					trigger_if = {
						limit = { exists = scope:entourage_member_one }
						this = scope:entourage_member_one
					}
					trigger_if = {
						limit = { exists = scope:entourage_member_two }
						this = scope:entourage_member_two
					}
					trigger_if = {
						limit = { exists = scope:entourage_member_knight }
						this = scope:entourage_member_knight
					}
				}
			}
			random_prisoner = {
				limit = {
					is_adult = yes
					NOR = { 
						this = root
						trigger_if = {
							limit = { exists = scope:travel_leader }
							this = scope:travel_leader
						}
						trigger_if = {
							limit = { exists = scope:entourage_member_one }
							this = scope:entourage_member_one
						}
						trigger_if = {
							limit = { exists = scope:entourage_member_two }
							this = scope:entourage_member_two
						}
						trigger_if = {
							limit = { exists = scope:entourage_member_knight }
							this = scope:entourage_member_knight
						}
					}
				}
				save_scope_as = entourage_member_prisoner
			}
		}
		if = {
			limit = {
				player_heir ?= {
					is_available_adult = yes
				}
				NOR = {
					trigger_if = {
						limit = { exists = scope:travel_leader }
						player_heir = scope:travel_leader
					}
					trigger_if = {
						limit = { exists = scope:entourage_member_one }
						player_heir = scope:entourage_member_one
					}
					trigger_if = {
						limit = { exists = scope:entourage_member_two }
						player_heir = scope:entourage_member_two
					}
					trigger_if = {
						limit = { exists = scope:entourage_member_knight }
						player_heir = scope:entourage_member_knight
					}
					trigger_if = {
						limit = { exists = scope:entourage_member_prisoner }
						player_heir = scope:entourage_member_prisoner
					}
				}
			}
			player_heir = { save_scope_as = entourage_member_heir }
		}
		current_travel_plan = {
			if = {
				limit = { exists = scope:entourage_member_one }
				add_companion = scope:entourage_member_one
			}
			if = {
				limit = { exists = scope:entourage_member_two }
				add_companion = scope:entourage_member_two
			}
			if = {
				limit = { exists = scope:entourage_member_knight }
				add_companion = scope:entourage_member_knight
			}
			if = {
				limit = { exists = scope:entourage_member_prisoner }
				add_companion = scope:entourage_member_prisoner
			}
			if = {
				limit = { exists = scope:entourage_member_heir }
				add_companion = scope:entourage_member_heir
			}
		}
	}
}

#Generic start (no activity)
#Should probably mostly be used for DEBUG purposes
travel_start_event.1000 = {
	orphan = yes
	type = character_event
	title = {
		first_valid = {
			#Migration start
			triggered_desc = {
				trigger = { is_migrating = yes }
				desc = travel_start_event.1000.t_migrating
			}
			#Sick start
			triggered_desc = {
				trigger = { has_any_debilitating_illness = yes }
				desc = travel_start_event.1000.t_sick
			}
			#Default
			triggered_desc = {
				desc = travel_start_event.1000.t
			}
		}
	} 
	desc = {
		first_valid = {
			#Migration start
			triggered_desc = {
				trigger = { is_migrating = yes }
				desc = travel_start_event.1000.desc_migrating
			}
			#Sick start
			triggered_desc = {
				trigger = { has_any_debilitating_illness = yes }
				desc = travel_start_event.1000.desc_sick
			}
			#Default
			triggered_desc = {
				desc = travel_start_event.1000.desc
			}
		}
	}
	theme = travel
	left_portrait = {
		character = root
		triggered_animation = {
			trigger = { is_nomad = yes }
			animation = horse_surveying
			camera = camera_event_horse_left
		}
		#Sick - sick animation
		triggered_animation = {
			trigger = { has_any_debilitating_illness = yes }
			animation = sick
		}
		triggered_animation = {
			trigger = {
				OR = {
					has_trait = lunatic
					has_trait = possessed
				}
			}
			animation = personality_irrational
		}
		#Default
	   	animation = personality_rational
	}
	#Show our Travel Leader
	right_portrait = {
		trigger = { exists = scope:travel_leader }
		character = scope:travel_leader
	}
	trigger = {
		is_available_travelling = yes
		OR = {
			is_landed = yes
			is_migrating = yes
		}
		NOR = { 
			exists = involved_activity
			has_an_active_mandala_contract_trigger = yes
		}
	}
	immediate = {
		play_music_cue = mx_cue_travel_start
		if = {
			limit = { exists = current_travel_plan.travel_leader }
			current_travel_plan.travel_leader = { save_scope_as = travel_leader }
		}
	}
	#Giddy up!
	option = { 
		name = {
			text = {
				first_valid = {
					#Yeah, yeah ...
					triggered_desc = {
						trigger = {
							OR = {
								has_any_debilitating_illness = yes
								has_trait = cynical
							}
						}
						desc = travel_start_event.1000.a_cynical
					}
					#Everything is _awesome_
					triggered_desc = {
						desc = travel_start_event.1000.a
					}
				}
			}
		}
	}
}

#Travelling to a Tournament
travel_start_event.1010 = {
	orphan = yes
	type = character_event
	title = {
		first_valid = {
			#Sick Tournament
			triggered_desc = {
				trigger = { has_any_debilitating_illness = yes }
				desc = travel_start_event.1010.t_sick_tournament
			}
			#Tournament
			triggered_desc = {
				desc = travel_start_event.1010.t_tournament
			}
		}
	} 
	desc = {
		first_valid = {
			#Shared intro for other person's tournament
			triggered_desc = {
				trigger = { exists = scope:host }
				desc = travel_start_event.1010.desc_tournament_intro
			}
		}
		first_valid = {
			#Sick Tournament
			triggered_desc = {
				trigger = {
					exists = scope:host
					has_any_debilitating_illness = yes
				}
				desc = travel_start_event.1010.desc_sick_tournament
			}
			#Tournament
			triggered_desc = {
				trigger = { exists = scope:host }
				desc = travel_start_event.1010.desc_tournament
			}
			#Sick My Tournament
			triggered_desc = {
				trigger = { has_any_debilitating_illness = yes }
				desc = travel_start_event.1010.desc_sick_my_tournament
			}
			#My Tournament
			triggered_desc = {
				desc = travel_start_event.1010.desc_my_tournament
			}
		}
		first_valid = {
			#Tournament Negative
			triggered_desc = {
				trigger = {
					exists = scope:host
					has_character_flag = we_dislike_host
					has_any_debilitating_illness = no
				}
				desc = travel_start_event.1010.desc_tournament_outro_negative
			}
			#Tournament Other Culture
			triggered_desc = {
				trigger = {
					exists = scope:host
					involved_activity.activity_host.culture != root.culture
					has_any_debilitating_illness = no
				}
				desc = travel_start_event.1010.desc_tournament_outro_positive_culture
			}
			#Tournament
			triggered_desc = {
				trigger = {
					exists = scope:host
					has_any_debilitating_illness = no
				}
				desc = travel_start_event.1010.desc_tournament_outro_positive
			}
			#My Tournament Shy
			triggered_desc = {
				trigger = {
					OR = {
						has_trait = humble
						has_trait = content
						has_trait = shy
					}
					has_any_debilitating_illness = no
				}
				desc = travel_start_event.1010.desc_my_tournament_outro_shy
			}
			#My Tournament Default
			triggered_desc = {
				trigger = { has_any_debilitating_illness = no }
				desc = travel_start_event.1010.desc_my_tournament_outro
			}
		}
	}
	theme = travel
	left_portrait = {
		character = root
		#Sick - sick animation
		triggered_animation = {
			trigger = { has_any_debilitating_illness = yes }
			animation = sick
		}
		animation = marshal #personality_rational?
	}
	#Show another marshal character to get some tournament vibes going
	right_portrait = {
		trigger = { exists = scope:our_entourage_character }
		character = scope:our_entourage_character
		animation = marshal
	}
	#Show our Travel Leader
	lower_left_portrait = {
		trigger = { 
			exists = scope:travel_leader
			exists = scope:our_entourage_character
			scope:our_entourage_character != scope:travel_leader
		}
		character = scope:travel_leader
	}
   	#Show our host
	lower_right_portrait = {
		trigger = { exists = scope:host }
		character = scope:host
	}
	trigger = {
		is_available_travelling = yes
		is_landed = yes
		involved_activity ?= { has_activity_type = activity_tournament }
	}
	immediate = {
		play_music_cue = mx_cue_travel_start
		# Do we have beef with the host?
		if = {
			limit = {
				involved_activity.activity_host != root
			}
			#Check if we dislike the host
			if = {
				limit = {
					OR = {
						has_relation_rival = involved_activity.activity_host
						opinion = {
							target = involved_activity.activity_host
							value < 10
						}
					}
				}
				add_character_flag = we_dislike_host
			}
			#Let's save the scope
			involved_activity.activity_host = { save_scope_as = host }
		}
		# Sort some portrait scopes.
		## Check if we have a champion with us for the portrait
		if = {
			limit = { 
				employs_court_position = champion_court_position
				current_travel_plan = {
					any_entourage_character = {
						has_court_position = champion_court_position
					}
				}
			}
			current_travel_plan = {
				random_entourage_character = {
					limit = { has_court_position = champion_court_position }
					save_scope_as = our_entourage_character
				}
			}
		}
		## Otherwise just pick a knight
		else_if = {
			limit = {
				current_travel_plan = {
					any_entourage_character = {
						is_knight_of = root
					}
				}
			}
			current_travel_plan = {
				random_entourage_character = {
					limit = { is_knight_of = root }
					save_scope_as = our_entourage_character
				}
			}
		}
		## ... or the travel leader. Lol.
		else_if = {
			limit = { exists = current_travel_plan.travel_leader }
			current_travel_plan.travel_leader = {
				save_scope_as = our_entourage_character
			}
		}
		#Portrait logic complains about finding characters direct scoping in current_travel_plan.travel_leader
		if = {
			limit = { 
				exists = current_travel_plan.travel_leader
				NOT = { current_travel_plan.travel_leader = scope:our_entourage_character }
			}
			current_travel_plan.travel_leader = { save_scope_as = travel_leader }
		}
		add_character_flag = wear_armor
	}
	#Giddy up!
	option = { 
		name = {
			text = {
				first_valid = {
					#Yeah, yeah ...
					triggered_desc = {
						trigger = {
							OR = {
								has_any_debilitating_illness = yes
								has_character_flag = we_dislike_host
								has_trait = cynical
							}
						}
						desc = travel_start_event.1000.a_cynical
					}
					#Everything is _awesome_
					triggered_desc = {
						desc = travel_start_event.1000.a
					}
				}
			}
		}
		# If this is a tourney, we want to nab all of our knights for the ride.
		if = {
			limit = {
				root.involved_activity ?= { has_activity_type = activity_tournament }
			}
			# We hide the overall effect because a custom parameter doesn't work well with the add_companion effect.
			hidden_effect = {
				every_knight = {
					limit = {
						is_ruler = no
						is_available_ai = yes
						bannable_serving_diarch_trigger = no
					}
					save_scope_as = char_temp
					root.current_travel_plan = { add_companion = scope:char_temp }
				}
				clear_saved_scope = char_temp
			}
			custom_tooltip = travel_start_event.1010.tt.tournament.every_knight
		}
	}
	after = {
		if = {
			limit = { has_character_flag = we_dislike_host }
			remove_character_flag = we_dislike_host
		}
		remove_character_flag = wear_armor
	}
}

#Setting off on a Tour
travel_start_event.1020 = {
	type = character_event
	title = {
		first_valid = {
			#Sick Tour
			triggered_desc = {
				trigger = {
					has_any_debilitating_illness = yes
				}
				desc = travel_start_event.1020.t_sick_tour
			}
			#Majesty Tour
			triggered_desc = {
				trigger = {
					involved_activity = {
						has_activity_option = { 
							category = special_type 
							option = tour_type_majesty 
						}
					}
				}
				desc = travel_start_event.1020.t_tour_majesty
			}
			#Tax Tour
			triggered_desc = {
				trigger = {
					involved_activity = { 
						has_activity_option = { 
							category = special_type 
							option = tour_type_taxation 
						}
					}
				}
				desc = travel_start_event.1020.t_tour_tax
			}
			#Dread Tour
			triggered_desc = {
				trigger = {
					involved_activity = { 
						has_activity_option = { 
							category = special_type 
							option = tour_type_intimidation 
						}
					}
				}
				desc = travel_start_event.1020.t_tour_dread
			}
		}
	} 
	desc = {
		desc = travel_start_event.1020.desc_tour_intro
		first_valid = {
			#Sick Tour
			triggered_desc = {
				trigger = {
					involved_activity = { 
						activity_host != root
					}
					has_any_debilitating_illness = yes
				}
				desc = travel_start_event.1020.desc_sick_tour
			}
			#Majesty Tour
			triggered_desc = {
				trigger = {
					involved_activity = { 
						has_activity_option = { 
							category = special_type 
							option = tour_type_majesty 
						}
					}
				}
				desc = travel_start_event.1020.desc_tour_majesty
			}
			#Tax Tour
			triggered_desc = {
				trigger = {
					involved_activity = { 
						has_activity_option = { 
							category = special_type 
							option = tour_type_taxation 
						}
					}
				}
				desc = travel_start_event.1020.desc_tour_tax
			}
			#Dread Tour
			triggered_desc = {
				trigger = {
					involved_activity = { 
						has_activity_option = { 
							category = special_type 
							option = tour_type_intimidation 
						}
					}
				}
				desc = travel_start_event.1020.desc_tour_dread
			}
		}
	}
	theme = travel
	left_portrait = {
		character = root
		#Sick - sick animation
		triggered_animation = {
			trigger = { has_any_debilitating_illness = yes }
			animation = sick
		}
		#Tour - Majesty
		triggered_animation = {
			trigger = {
				involved_activity = { 
					has_activity_option = { 
						category = special_type 
						option = tour_type_majesty 
					}
				}
			}
			animation = personality_honorable
		}
		#Tour - Tax
		triggered_animation = {
			trigger = {
				involved_activity = { 
					has_activity_option = { 
						category = special_type 
						option = tour_type_taxation 
					}
				}
			}
			animation = personality_dishonorable
		}
		#Tour - Dread
		triggered_animation = {
			trigger = {
				involved_activity = { 
					has_activity_option = { 
						category = special_type 
						option = tour_type_intimidation 
					}
				}
			}
			animation = personality_vengeful
		}
	}
	#Show our Travel Leader
	right_portrait = {
		trigger = { exists = root.current_travel_plan.travel_leader }
		character = current_travel_plan.travel_leader
	}
	#Next destination liege
	lower_right_portrait = {
		character = scope:next_stop_liege
	}
	trigger = {
		is_available_travelling = yes
		is_landed = yes
		involved_activity ?= { has_activity_type = activity_tour }
	}
	immediate = {
		play_music_cue = mx_cue_travel_start
		current_travel_plan = {
			next_destination_province = {
				province_owner = {
					save_scope_as = next_stop_liege
				}
			}
		}
		show_tour_option_start_effect = yes
	}
	#Giddy up!
	option = { 
		name = {
			text = {
				first_valid = {
					#Yeah, yeah ...
					triggered_desc = {
						trigger = {
							OR = {
								has_any_debilitating_illness = yes
								has_trait = cynical
							}
						}
						desc = travel_start_event.1000.a_cynical
					}
					#Everything is _awesome_
					triggered_desc = {
						desc = travel_start_event.1000.a
					}
				}
			}
		}
		stress_impact = {
			base = medium_stress_impact_loss
			gregarious = minor_stress_impact_loss
			arrogant = minor_stress_impact_loss
		}
	}
}

#Travelling to a Wedding
travel_start_event.1030 = {
	orphan = yes
	type = character_event
	title = {
		first_valid = {
			#Bloody Wedding
			triggered_desc = {
				trigger = {
					NOT = { exists = scope:host } #No host is saved so I am the host
					involved_activity ?= { 
						has_activity_type = activity_wedding
						has_activity_option = {
							category = special_type
							option = wedding_type_bloody
						}
					}
				}
				desc = travel_start_event.1030.t_red_wedding
			}
			#Sick Wedding
			triggered_desc = {
				trigger = {
					has_any_debilitating_illness = yes
				}
				desc = travel_start_event.1030.t_sick_wedding
			}
			#Wedding
			triggered_desc = {
				desc = travel_start_event.1030.t_wedding
			}
		}
	} 
	desc = {
		#Intro
		first_valid = {
			#Sick Bloody Wedding
			triggered_desc = {
				trigger = {
					NOT = { exists = scope:host } #No host is saved so I am the host
					involved_activity ?= { 
						has_activity_type = activity_wedding
						has_activity_option = {
							category = special_type
							option = wedding_type_bloody
						}
					}
					has_any_debilitating_illness = yes
				}
				desc = travel_start_event.1030.desc_sick_red_wedding
			}
			#Bloody Wedding
			triggered_desc = {
				trigger = {
					NOT = { exists = scope:host } #No host is saved so I am the host
					involved_activity ?= { 
						has_activity_type = activity_wedding
						has_activity_option = {
							category = special_type
							option = wedding_type_bloody
						}
					}
				}
				desc = travel_start_event.1030.desc_red_wedding
			}
			#Host Wedding
			triggered_desc = {
				trigger = { 
					exists = scope:host
					exists = scope:host_spouse_to_be
				}
				desc = travel_start_event.1030.desc_host_wedding
			}
			#Wedding
			triggered_desc = {
				trigger = { exists = scope:host }
				desc = travel_start_event.1030.desc_wedding
			}
			#My Spouse Wedding
			triggered_desc = {
				trigger = {
					NOT = { exists = scope:host }  #No host is saved so I am the host
					exists = scope:my_spouse_to_be
				}
				desc = travel_start_event.1030.desc_my_spouse_wedding
			}
			#My Wedding
			triggered_desc = {
				trigger = {
					NOT = { exists = scope:host }  #No host is saved so I am the host
				}
				desc = travel_start_event.1030.desc_my_wedding
			}
		}

		#Relation Host Wedding
		first_valid = {
			#Negative
			triggered_desc = {
				trigger = { 
					exists = scope:host
					exists = scope:host_spouse_to_be
					has_character_flag = we_dislike_host
				}
				desc = travel_start_event.1030.desc_host_wedding_negative
			}
			#Positive
			triggered_desc = {
				trigger = { 
					exists = scope:host
					exists = scope:host_spouse_to_be
					has_any_good_relationship_with_character_trigger = { CHARACTER = scope:host }
				}
				desc = travel_start_event.1030.desc_host_wedding_positive
			}
			#Default
			triggered_desc = {
				trigger = { 
					exists = scope:host
					exists = scope:host_spouse_to_be
				}
				desc = travel_start_event.1030.desc_host_wedding_default
			}
		}

		#Outro Host Wedding
		first_valid = {
			#Sick
			triggered_desc = {
				trigger = {
					exists = scope:host
					has_any_debilitating_illness = yes
				}
				desc = travel_start_event.1030.desc_wedding_outro_sick
			}
			#Negative 
			triggered_desc = {
				trigger = { 
					exists = scope:host
					exists = scope:host_spouse_to_be
					has_character_flag = we_dislike_host
				}
				desc = travel_start_event.1030.desc_host_wedding_outro_negative
			}
			#Positive
			triggered_desc = {
				trigger = { 
					exists = scope:host
					exists = scope:host_spouse_to_be
					has_any_good_relationship_with_character_trigger = { CHARACTER = scope:host }
				}
				desc = travel_start_event.1030.desc_host_wedding_outro_positive
			}
			#Default
			triggered_desc = {
				trigger = { 
					exists = scope:host
					exists = scope:host_spouse_to_be
				}
				desc = travel_start_event.1030.desc_host_wedding_outro_default
			}
		}


		#Outro Wedding
		first_valid = {
			#Negative 
			triggered_desc = {
				trigger = {
					exists = scope:host
					NOT = { exists = scope:host_spouse_to_be }
					has_any_debilitating_illness = no
				}
				desc = travel_start_event.1030.desc_wedding_outro_negative
			}
			#Positive
			triggered_desc = {
				trigger = {
					exists = scope:host
					NOT = { exists = scope:host_spouse_to_be }
					has_any_debilitating_illness = no
				}
				desc = travel_start_event.1030.desc_wedding_outro_positive
			}
			#Default
			triggered_desc = {
				trigger = {
					exists = scope:host
					NOT = { exists = scope:host_spouse_to_be }
					has_any_debilitating_illness = no
				}
				desc = travel_start_event.1030.desc_wedding_outro_default
			}
		}


		#Outro My Literal Wedding
		first_valid = {
			#Sick
			triggered_desc = {
				trigger = { 
					NOT = { exists = scope:host }
						NOT = {
						involved_activity ?= { 
							has_activity_type = activity_wedding
							has_activity_option = {
								category = special_type
								option = wedding_type_bloody
							}
						}
					}
					has_any_debilitating_illness = yes
				}
				desc = travel_start_event.1030.desc_my_wedding_outro_sick
			}
			#Negative 
			triggered_desc = {
				trigger = {
					NOT = { exists = scope:host }
					exists = scope:my_spouse_to_be
					OR = {
						has_any_bad_relationship_with_character_trigger = { CHARACTER = scope:my_spouse_to_be }
						opinion = {
							target = scope:my_spouse_to_be
							value < 0
						}
					}
					NOT = {
						involved_activity ?= { 
							has_activity_type = activity_wedding
							has_activity_option = {
								category = special_type
								option = wedding_type_bloody
							}
						}
					}
				}
				desc = travel_start_event.1030.desc_my_spouse_wedding_outro_negative
			}
			#Positive
			triggered_desc = {
				trigger = {
					NOT = { exists = scope:host }
					exists = scope:my_spouse_to_be
					has_any_good_relationship_with_character_trigger = { CHARACTER = scope:my_spouse_to_be }
					NOT = {
						involved_activity ?= { 
							has_activity_type = activity_wedding
							has_activity_option = {
								category = special_type
								option = wedding_type_bloody
							}
						}
					}
				}
				desc = travel_start_event.1030.desc_my_spouse_wedding_outro_positive
			}
			#Default
			triggered_desc = {
				trigger = {
					NOT = { exists = scope:host }
					exists = scope:my_spouse_to_be
					NOT = {
						involved_activity ?= { 
							has_activity_type = activity_wedding
							has_activity_option = {
								category = special_type
								option = wedding_type_bloody
							}
						}
					}
				}
				desc = travel_start_event.1030.desc_my_spouse_wedding_outro_default
			}
		}


		#Outro My Wedding
		first_valid = {
			#Negative 
			triggered_desc = {
				trigger = { 
					NOT = { exists = scope:host }
					NOT = { exists = scope:my_spouse_to_be }
					NOT = {
						involved_activity ?= { 
							has_activity_type = activity_wedding
							has_activity_option = {
								category = special_type
								option = wedding_type_bloody
							}
						}
					}
					OR = {
						has_any_bad_relationship_with_character_trigger = { CHARACTER = scope:first_spouse }
						opinion = {
							target = scope:first_spouse
							value < 0
						}
					}
					OR = {
						has_any_bad_relationship_with_character_trigger = { CHARACTER = scope:second_spouse }
						opinion = {
							target = scope:second_spouse
							value < 0
						}
					}
					has_any_debilitating_illness = no
				}
				desc = travel_start_event.1030.desc_my_wedding_outro_negative
			}
			#Positive
			triggered_desc = {
				trigger = {
					NOT = { exists = scope:host }
					NOT = { exists = scope:my_spouse_to_be }
					NOT = {
						involved_activity ?= { 
							has_activity_type = activity_wedding
							has_activity_option = {
								category = special_type
								option = wedding_type_bloody
							}
						}
					}
					OR = {
						has_any_good_relationship_with_character_trigger = { CHARACTER = scope:first_spouse }
						has_any_good_relationship_with_character_trigger = { CHARACTER = scope:second_spouse }
					}
					has_any_debilitating_illness = no
				}
				desc = travel_start_event.1030.desc_my_wedding_outro_positive
			}
			#Default
			triggered_desc = {
				trigger = {
					NOT = { exists = scope:host }
					NOT = { exists = scope:my_spouse_to_be }
					NOT = {
						involved_activity ?= { 
							has_activity_type = activity_wedding
							has_activity_option = {
								category = special_type
								option = wedding_type_bloody
							}
						}
					}
					has_any_debilitating_illness = no
				}
				desc = travel_start_event.1030.desc_my_wedding_outro_default
			}
		}
	}
	theme = travel
	left_portrait = {
		character = root
		#Blood Wedding
		triggered_animation = {
			trigger = {
				NOT = { exists = scope:host } #No host saved so I am the host
				NOT = {
					involved_activity ?= { 
						has_activity_type = activity_wedding
						has_activity_option = {
							category = special_type
							option = wedding_type_bloody
						}
					}
				}
			}
			animation = scheme
		}
		#Sick - sick animation
		triggered_animation = {
			trigger = { has_any_debilitating_illness = yes }
			animation = sick
		}
		#We dislike the host
		triggered_animation = {
			trigger = { 
				OR = {
					has_character_flag = we_dislike_host 
					has_character_flag = we_dislike_a_spouse
					has_trait = cynical
				}
			}
			animation = personality_cynical
		}
		animation = happiness
	}
	#Show our Travel Leader
	lower_left_portrait = {
		trigger = { exists = current_travel_plan.travel_leader }
		character = current_travel_plan.travel_leader
	}
	#If it's our wedding, let's show the spouse to-be
	lower_center_portrait = {
		trigger = { exists = scope:my_spouse_to_be }
		character = scope:my_spouse_to_be
	}
	#Show our host
	lower_right_portrait = {
		trigger = { exists = scope:host }
		character = involved_activity.activity_host
	}
	trigger = {
		is_available_travelling = yes
		is_landed = yes
		involved_activity ?= { has_activity_type = activity_wedding }
	}
	immediate = {
		play_music_cue = mx_cue_travel_start
		#Check if we dislike the host
		if = {
			limit = {
				involved_activity.activity_host != root
			}
			if = {
				limit = {
					OR = {
						has_relation_rival = involved_activity.activity_host
						opinion = {
							target = involved_activity.activity_host
							value < 10
						}
					}
				}
				add_character_flag = we_dislike_host
			}
			involved_activity.activity_host = { save_scope_as = host }
		}
		#Save the spouses
		if = {
			limit = { exists = involved_activity.special_guest:spouse_1 }
			involved_activity.special_guest:spouse_1 = {
				save_scope_as = first_spouse
			}
		}
		if = {
			limit = { exists = involved_activity.special_guest:spouse_1 }
			involved_activity.special_guest:spouse_2 = {
				save_scope_as = second_spouse
			}
		}
		#Check if the host is a spouse
		if = {
			limit = { exists = scope:host }
			if = {
				limit = {
					exists = scope:first_spouse
					exists = scope:second_spouse
				}
				if = {
					limit = { scope:first_spouse = scope:host }
					scope:second_spouse = {
						save_scope_as = host_spouse_to_be
					}
				}
				if = {
					limit = { scope:second_spouse = scope:host }
					scope:first_spouse = {
						save_scope_as = host_spouse_to_be
					}
				}
			}
		}
		#Check if we're a spouse
		if = {
			limit = {
				exists = scope:first_spouse
				exists = scope:second_spouse
			}
			if = {
				limit = { scope:first_spouse = root }
				scope:second_spouse = {
					save_scope_as = my_spouse_to_be
				}
			}
			else_if = {
				limit = { scope:second_spouse = root }
				scope:first_spouse = {
					save_scope_as = my_spouse_to_be
				}
			}
		}
		if = {
			limit = {
				NOT = { exists = scope:host }
				OR = {
					has_any_bad_relationship_with_character_trigger = { CHARACTER = scope:first_spouse }
					opinion = {
						target = scope:first_spouse
						value < 0
					}
				}
				OR = {
					has_any_bad_relationship_with_character_trigger = { CHARACTER = scope:second_spouse }
					opinion = {
						target = scope:second_spouse
						value < 0
					}
				}
			}
			add_character_flag = we_dislike_a_spouse
		}
	}
	#Giddy up!
	option = { 
		name = {
			text = {
				first_valid = {
					#Yeah, yeah ...
					triggered_desc = {
						trigger = {
							OR = {
								has_any_debilitating_illness = yes
								has_character_flag = we_dislike_host
								has_character_flag = we_dislike_a_spouse
								has_trait = cynical
							}
						}
						desc = travel_start_event.1000.a_cynical
					}
					#Everything is _awesome_
					triggered_desc = {
						desc = travel_start_event.1000.a
					}
				}
			}
		}
	}
	after = {
		if = {
			limit = { has_character_flag = we_dislike_host }
			remove_character_flag = we_dislike_host
		}
		if = {
			limit = { has_character_flag = we_dislike_a_spouse }
			remove_character_flag = we_dislike_a_spouse
		}
	}
}

#Travelling to a Feast
travel_start_event.1040 = {
	orphan = yes
	type = character_event
	title = {
		first_valid = {
			#Murder Feast
			triggered_desc = {
				trigger = {
					NOT = { exists = scope:host } #I am the host
					involved_activity ?= { 
						has_activity_type = activity_feast
						has_activity_option = {
							category = special_type
							option = feast_type_murder
						}
					}
				}
				desc = travel_start_event.1040.t_murder_feast
			}
			#Sick Feast
			triggered_desc = {
				trigger = {
					has_any_debilitating_illness = yes
				}
				desc = travel_start_event.1040.t_sick_feast
			}
			#Feast
			triggered_desc = {
				desc = travel_start_event.1040.t_feast
			}
		}
	} 
	desc = {
		#Intro
		first_valid = {
			#Sick Murder Feast
			triggered_desc = {
				trigger = {
					NOT = { exists = scope:host } #No host was saved so I am the host
					involved_activity ?= { 
						has_activity_type = activity_feast
						has_activity_option = {
							category = special_type
							option = feast_type_murder
						}
					}
					has_any_debilitating_illness = yes
				}
				desc = travel_start_event.1040.desc_sick_murder_feast
			}
			##Murder Feast
			triggered_desc = {
				trigger = {
					NOT = { exists = scope:host } #No host was saved so I am the host
					involved_activity ?= { 
						has_activity_type = activity_feast
						has_activity_option = {
							category = special_type
							option = feast_type_murder
						}
					}
				}
				desc = travel_start_event.1040.desc_murder_feast
			}
			#Feast
			triggered_desc = {
				trigger = { NOT = { exists = scope:host } } #No host was saved so I am the host
				desc = travel_start_event.1000.intro_my_activity
			}
			#My Feast
			triggered_desc = {
				desc = travel_start_event.1040.desc_feast
			}
		}
		#Feast Type
		#My Feast Type
		first_valid = {
			#I am the guest of honor
			triggered_desc = {
				trigger = {
					involved_activity ?= { 
						has_activity_type = activity_feast
						exists = scope:celebratory_guest
					}
					scope:celebratory_guest = root
				}
				desc = travel_start_event.1040.desc_my_feast_celebration_host
			}
			#Celebratory - Someone else is the geust of Honor
			triggered_desc = {
				trigger = {
					involved_activity ?= { 
						has_activity_type = activity_feast
						exists = scope:celebratory_guest
					}
					scope:celebratory_guest != root
				}
				desc = travel_start_event.1040.desc_my_feast_celebration
			}
			#We skip this stip if no guest of honor
		}
		#Outro
		first_valid = {
			#Sick
			triggered_desc = {
				trigger = {
					exists = scope:host
					has_any_debilitating_illness = yes 
				}
				desc = travel_start_event.1040.desc_feast_outro_sick
			}
			#Negative
			triggered_desc = {
				trigger = {
					exists = scope:host
					has_relation_rival = scope:host
				}
				desc = travel_start_event.1040.desc_feast_outro_negative
			}
			#Positive
			triggered_desc = {
				trigger = {
					exists = scope:host
					has_any_good_relationship_with_character_trigger = { CHARACTER = scope:host }
				}
				desc = travel_start_event.1040.desc_feast_outro_positive
			}
			#Default
			triggered_desc = {
				trigger = { exists = scope:host }
				desc = travel_start_event.1040.desc_feast_outro_default
			}
		}
		#Outro my feast
		first_valid = {
			#Sick
			triggered_desc = {
				trigger = {
					NOT = { exists = scope:host }
					has_any_debilitating_illness = yes 
				}
				desc = travel_start_event.1040.desc_my_feast_outro_sick
			}
			#Introvert
			triggered_desc = {
				trigger = {
					NOT = { exists = scope:host }
					OR = {
						has_trait = shy
						has_trait = humble
						has_trait = reclusive
						has_trait = paranoid
						has_trait = craven
					}
				}
				desc = travel_start_event.1040.desc_my_feast_outro_introvert
			}
			#Extrovert
			triggered_desc = {
				trigger = {
					NOT = { exists = scope:host }
					OR = {
						has_trait = arrogant
						has_trait = brave
						has_trait = gregarious
						has_trait = trusting
					}
				}
				desc = travel_start_event.1040.desc_my_feast_outro_extrovert
			}
			#Default my feast
			triggered_desc = {
				trigger = { 
					NOT = { exists = scope:host }
				}
				desc = travel_start_event.1040.desc_my_feast_outro
			}
		}
	}
	theme = travel
	left_portrait = {
		character = root
		#Murder feast
		triggered_animation = {
			trigger = { 
				involved_activity ?= { 
					has_activity_type = activity_feast
					has_activity_option = {
						category = special_type
						option = feast_type_murder
					}
				}
			}
			animation = scheme
		}
		#Sick - sick animation
		triggered_animation = {
			trigger = { has_any_debilitating_illness = yes }
			animation = sick
		}
		#We dislike the host or feasts in general
		triggered_animation = {
			trigger = { 
				OR = {
					has_character_flag = we_dislike_host
					has_trait = shy
					has_trait = humble
					has_trait = reclusive
					has_trait = paranoid
					has_trait = craven
				}
			}
			animation = personality_cynical
		}
		animation = happiness
	}
	#Show our Travel Leader
	right_portrait = {
		trigger = { exists = current_travel_plan.travel_leader }
		character = current_travel_plan.travel_leader
	}
	#Show our guest of honor
	lower_center_portrait = {
		trigger = {
			exists = scope:celebratory_guest
			scope:celebratory_guest != root
		}
		character = scope:celebratory_guest
	}
	#Show our host
	lower_right_portrait = {
		trigger = { exists = scope:host }
		character = scope:host
	}
	trigger = {
		is_available_travelling = yes
		is_landed = yes
		involved_activity ?= { has_activity_type = activity_feast }
	}
	immediate = {
		play_music_cue = mx_cue_travel_start
		#Check if we dislike the host
		if = {
			limit = {
				involved_activity.activity_host != root
			}
			involved_activity.activity_host = { save_scope_as = host }
		}
		if = {
			limit = {
				involved_activity.activity_host != root
			}
			#Check if we dislike the host
			if = {
				limit = {
					OR = {
						has_relation_rival = involved_activity.activity_host
						opinion = {
							target = involved_activity.activity_host
							value < 10
						}
					}
				}
				add_character_flag = we_dislike_host
			}
		}
		#Save special guests, for both normal and murder feasts
		if = {
			limit = {
				involved_activity ?= { 
					has_activity_type = activity_feast
					has_activity_option = {
						category = special_type
						option = feast_type_murder
					}
					exists = special_guest:honorary_guest #Murder Feast target
				}
			}
			involved_activity.special_guest:honorary_guest = {
				save_scope_as = celebratory_guest
			}
		}
		else_if = {
			limit = {
				involved_activity ?= { 
					has_activity_type = activity_feast
					has_activity_option = {
						category = special_type
						option = feast_type_generic
					}
					exists = special_guest:honorary_guest_regular #Normal Guest of Honor
				}
			}
			involved_activity.special_guest:honorary_guest_regular = {
				save_scope_as = celebratory_guest
			}
		}
	}
	#Giddy up!
	option = { 
		name = {
			text = {
				first_valid = {
					#Yeah, yeah ...
					triggered_desc = {
						trigger = {
							OR = {
								has_any_debilitating_illness = yes
								has_character_flag = we_dislike_host
								has_trait = cynical
							}
						}
						desc = travel_start_event.1000.a_cynical
					}
					#Everything is _awesome_
					triggered_desc = {
						desc = travel_start_event.1000.a
					}
				}
			}
		}
	}
	after = {
		if = {
			limit = { has_character_flag = we_dislike_host }
			remove_character_flag = we_dislike_host
		}
	}
}

#Travelling to a Playdate
travel_start_event.1050 = {
	orphan = yes
	type = character_event
	title = {
		first_valid = {
			#Sick Play Date
			triggered_desc = {
				trigger = {
					has_any_debilitating_illness = yes
				}
				desc = travel_start_event.1050.t_sick_playdate
			}
			#Play Date
			triggered_desc = {
				desc = travel_start_event.1050.t_playdate
			}
		}
	} 
	desc = {
		#Intro
		first_valid = {
			#Playdate
			triggered_desc = {
				trigger = {
					exists = scope:host
				}
				desc = travel_start_event.1050.desc_playdate
			}
			#My Playdate
			triggered_desc = {
				desc = travel_start_event.1050.desc_my_playdate
			}
		}
		#Relation to host
		first_valid = {
			#Sick
			triggered_desc = {
				trigger = {
					has_any_debilitating_illness = yes
				}
				desc = travel_start_event.1050.desc_sick_playdate
			}
			#Negative relationship
			triggered_desc = {
				trigger = {
					exists = scope:host
					OR = {
						has_character_flag = we_dislike_host
						has_relation_victim = scope:host
					}
					has_any_debilitating_illness = no
				}
				desc = travel_start_event.1050.desc_playdate_negative
			}
			#Positive relationship
			triggered_desc = {
				trigger = {
					exists = scope:host
					has_any_good_relationship_with_character_trigger = { CHARACTER = scope:host }
					has_any_debilitating_illness = no
				}
				desc = travel_start_event.1050.desc_playdate_positive
			}
			#Default
			triggered_desc = {
				trigger = {
					exists = scope:host
					has_any_debilitating_illness = no
				}
				desc = travel_start_event.1050.desc_playdate_default
			}
		}
		#Trait flavor for my playdate
		first_valid = {
			#Extrovert
			triggered_desc = {
				trigger = {
					NOT = { exists = scope:host }
					OR = {
						has_trait = charming
						has_trait = curious
					}
					has_any_debilitating_illness = no
				}
				desc = travel_start_event.1050.desc_my_playdate_learning
			}
			#Bossy
			triggered_desc = {
				trigger = {
					NOT = { exists = scope:host }
					OR = {
						has_trait = bossy
						has_trait = rowdy
					}
					has_any_debilitating_illness = no
				}
				desc = travel_start_event.1050.desc_my_playdate_bossy
			}
			#Not a fan of people + Outro
			triggered_desc = {
				trigger = {
					NOT = { exists = scope:host }
					has_trait = pensive
					has_any_debilitating_illness = no
				}
				desc = travel_start_event.1050.desc_my_playdate_pensive
			}
			#We have a victim + Outro
			triggered_desc = {
				trigger = {
					NOT = { exists = scope:host }
					exists = scope:playdate_victim
					has_any_debilitating_illness = no
				}
				desc = travel_start_event.1050.desc_my_playdate_victim
			}
			#Default
			triggered_desc = {
				trigger = {
					NOT = { exists = scope:host }
					has_any_debilitating_illness = no
				}
				desc = travel_start_event.1050.desc_my_playdate_default
			}
		}
		#Outro
		first_valid = {
			#Playdate
			triggered_desc = {
				trigger = { exists = scope:host }
				desc = travel_start_event.1050.desc_playdate_outro
			}
			#My Playdate
			triggered_desc = {
				trigger = {
					NOT = { exists = scope:host }
					NOR = {
						has_trait = pensive
						exists = scope:playdate_victim
					}
				}
				desc = travel_start_event.1050.desc_my_playdate_outro
			}
		}
	}
	theme = travel
	left_portrait = {
		character = root
		#Sick - sick animation
		triggered_animation = {
			trigger = { has_any_debilitating_illness = yes }
			animation = sick
		}
		#We dislike the host
		triggered_animation = {
			trigger = { has_character_flag = we_dislike_host }
			animation = disapproval
		}
		animation = admiration
	}
	#Show our Travel Leader
	lower_left_portrait = {
		trigger = { exists = current_travel_plan.travel_leader }
		character = current_travel_plan.travel_leader
	}
	#Show our host
	lower_right_portrait = {
		trigger = { exists = scope:host }
		character = scope:host
	}
	trigger = {
		is_available_travelling = yes
		is_landed = yes
		involved_activity ?= { has_activity_type = activity_playdate }
	}
	immediate = {
		play_music_cue = mx_cue_travel_start
		if = {
			limit = {
				involved_activity.activity_host != root
			}
			#Check if we dislike the host
			if = {
				limit = {
					OR = {
						has_relation_rival = involved_activity.activity_host
						opinion = {
							target = involved_activity.activity_host
							value < 10
						}
					}
				}
				add_character_flag = we_dislike_host
			}
			#Let's save the scope
			involved_activity.activity_host = { save_scope_as = host }
		}
		if = {
			limit = {
				involved_activity = {
					any_attending_character = {
						has_relation_victim = root
					}
				}
			}
			involved_activity = {
				random_attending_character = {
					limit = { has_relation_victim = root }
					save_scope_as = playdate_victim
				}
			}
		}
	}
	#Giddy up!
	option = { 
		name = {
			text = {
				first_valid = {
					#Yeah, yeah ...
					triggered_desc = {
						trigger = {
							OR = {
								has_any_debilitating_illness = yes
								has_character_flag = we_dislike_host
								has_trait = cynical
							}
						}
						desc = travel_start_event.1000.a_cynical
					}
					#Everything is _awesome_
					triggered_desc = {
						desc = travel_start_event.1000.a
					}
				}
			}
		}
	}
	after = {
		if = {
			limit = { has_character_flag = we_dislike_host }
			remove_character_flag = we_dislike_host
		}
	}
}

travel_start_event.1051 = {
	type = character_event
	title = travel_start_event.1051.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					any_in_list = {
						variable = playdate_guests
						count >= 4
					}
				}
				desc = travel_start_event.1051.many
			}
			triggered_desc = {
				trigger = {
					any_in_list = {
						variable = playdate_guests
						count = 3
					}
				}
				desc = travel_start_event.1051.three
			}
			triggered_desc = {
				trigger = {
					any_in_list = {
						variable = playdate_guests
						count = 2
					}
				}
				desc = travel_start_event.1051.two
			}
			desc = travel_start_event.1051.one
		}
		desc = travel_start_event.1051.desc
		first_valid = {
			triggered_desc = {
				trigger = {
					any_in_list = {
						variable = playdate_guests
						count > 1
					}
				}
				desc = travel_start_event.1051.multiple
			}
			desc = travel_start_event.1051.single
		}
	}
	theme = travel
	override_background = { reference = courtyard }
	left_portrait = {
		character = root
		#We dislike the host
		triggered_animation = {
			trigger = {
				OR = {
					has_character_flag = we_dislike_host
					scope:child_1 = { has_any_debilitating_illness = yes }
				}
			}
			animation = dismissal
		}
		animation = worry
	}
	right_portrait = {
		character = scope:child_1
		#Sick - sick animation
		triggered_animation = {
			trigger = {
				scope:child_1 = { has_any_debilitating_illness = yes }
			}
			animation = sick
		}
		#We dislike the host
		triggered_animation = {
			trigger = { has_character_flag = we_dislike_host }
			animation = disapproval
		}
		animation = admiration
	}
	lower_left_portrait = scope:child_2
	lower_center_portrait = scope:child_3
	#Show our host
	lower_right_portrait = {
		trigger = { exists = scope:host }
		character = scope:host
	}
	cooldown = { days = 1 }

	trigger = {
		scope:host ?= { is_alive = yes }
	}

	immediate = {
		play_music_cue = mx_cue_travel_start
		# Save children scopes
		while = {
			limit = {
				NAND = {
					exists = scope:child_1
					exists = scope:child_2
					exists = scope:child_3
				}
				any_in_list = {
					variable = playdate_guests
					NOR = {
						scope:child_1 ?= this
						scope:child_2 ?= this
						scope:child_3 ?= this
					}
				}
			}
			random_in_list = {
				variable = playdate_guests
				limit = {
					NOR = {
						scope:child_1 ?= this
						scope:child_2 ?= this
						scope:child_3 ?= this
					}
				}
				weight = {
					base = 1
					modifier = {
						factor = {
							value = age
							multiply = 2
						}
					}
					is_of_major_interest_to_weight_up_modifier = { CHARACTER = root }
					is_of_minor_interest_to_weight_up_modifier = { CHARACTER = root }
				}
				if = {
					limit = {
						NOT = { exists = scope:child_1 }
					}
					save_scope_as = child_1
					involved_activity.activity_host = { save_scope_as = host }
				}
				else_if = {
					limit = {
						NOT = { exists = scope:child_2 }
					}
					save_scope_as = child_2
				}
				else = { save_scope_as = child_3 }
			}
		}
		#Check if we dislike the host
		if = {
			limit = {
				exists = scope:host
				OR = {
					has_relation_rival = scope:host
					opinion = {
						target = scope:host
						value < 10
					}
				}
			}
			add_character_flag = we_dislike_host
		}
	}

	# Ok!
	option = {
		name = {
			text = {
				first_valid = {
					triggered_desc = {
						trigger = {
							OR = {
								scope:child_1 = { has_any_debilitating_illness = yes }
								has_character_flag = we_dislike_host
								has_trait = paranoid
							}
						}
						desc = travel_start_event.1051.a_cynical
					}
					triggered_desc = {
						trigger = {
							any_in_list = {
								variable = playdate_guests
								count >= 2
							}
						}
						desc = travel_start_event.1051.a.multiple
					}
					desc = travel_start_event.1051.a
				}
			}
		}
		every_in_list = {
			variable = playdate_guests
			custom_tooltip = playdate_depart_tt
		}
		stress_impact = {
			paranoid = minor_stress_impact_gain
			sadistic = minor_stress_impact_gain
		}
	}

	# Hell to the no!
	option = { 
		name = travel_start_event.1051.b
		every_in_list = {
			variable = playdate_guests
			custom = playdate_blocked_tt
			hidden_effect = {
				current_travel_plan = { 
					if = {
						limit = { can_cancel = yes }
						cancel_travel_plan = yes
					}
				}
			}
			add_opinion = {
				modifier = annoyed_opinion
				target = root
				opinion = -10
			}
		}
		scope:host = {
			if = {
				limit = { is_ai = no }
				if = {
					limit = { exists = scope:child_2 }
					send_interface_message = {
						type = event_travel_bad_with_text
						title = playdate_forbidden_title
						left_icon = scope:carer
						right_icon = scope:child_1
						desc = playdate_forbidden_tt
					}
				}
				else = {
					send_interface_message = {
						type = event_travel_bad_with_text
						title = playdate_forbidden_title
						left_icon = scope:carer
						right_icon = scope:child_1
						desc = playdate_forbidden_single_tt
					}
				}
			}
		}
		stress_impact = {
			compassionate = minor_stress_impact_gain
			gregarious = minor_stress_impact_gain
		}
	}

	after = {
		if = {
			limit = { has_character_flag = we_dislike_host }
			remove_character_flag = we_dislike_host
		}
		clear_variable_list = playdate_guests
	}
}

scripted_trigger travel_event_1060_valid_local_pilgrim_trigger = {
	# Let's only take sensible chars.
	is_available = yes
	# Otherwise we're *weirdly* pulling in your courtiers, and we don't want that.
	liege != root
	# Must have suitable religious convictions.
	faith = root.faith
	NOR = {
		has_trait = cynical
		any_secret = { type = secret_non_believer }
	}
}

scripted_effect travel_event_1060_grab_local_pilgrims_effect = {
	hidden_effect = {
		while = {
			limit = {
				any_in_list = {
					list = grabbable_randos_list
					count > 0
					is_travel_entourage_character = no
					bannable_serving_diarch_trigger = no
				}
				current_travel_plan = { num_entourage_characters < $ENTOURAGE_CAP$ }
			}
			random_in_list = {
				list = grabbable_randos_list
				limit = {
					is_travel_entourage_character = no
					bannable_serving_diarch_trigger = no
				}
				weight = {
					base = 1
					# Weight up likely travellers.
					## Zealous.
					modifier = {
						add = 100
						has_trait = zealous
					}
					## Faith Warrior.
					modifier = {
						add = 500
						has_trait = faith_warrior
					}
					## Traveller.
					modifier = {
						add = 100
						has_trait = lifestyle_traveler
					}
					## Pilgrim.
					modifier = {
						add = 200
						has_trait = pilgrim
					}
					## Hajjaj.
					### Slightly lower weight here, because all (barring rare exceptions) good Muslims should be Hajjaj.
					modifier = {
						add = 50
						has_trait = hajjaj
					}
					## Devoted.
					modifier = {
						add = 200
						has_trait = devoted
					}
					## Athletic.
					### 'cause they like to walk. Geddit.
					modifier = {
						add = 50
						has_trait = athletic
					}
					## Hunter.
					### More mobile due to being better able to live off the land.
					modifier = {
						add = 50
						has_trait = lifestyle_hunter
					}
					## Herbalist.
					### More mobile due to being better able to live off the land.
					modifier = {
						add = 50
						has_trait = lifestyle_herbalist
					}
					## Mystic.
					### Vision quests, etc.
					modifier = {
						add = 75
						has_trait = lifestyle_mystic
					}
				}
				save_scope_as = char_temp
				root = {
					# Whack 'em in the train.
					current_travel_plan = { add_companion = scope:char_temp }
					# Otherwise they get added as courtiers and that's just not the idea.
					remove_courtier_or_guest = scope:char_temp
				}
			}
			scope:char_temp = { remove_from_list = grabbable_randos_list }
			# Increment the counter.
			change_variable = {
				name = rando_pilgrim_counter
				add = 1
			}
		}
	}
}

scripted_effect travel_event_1060_create_additional_pilgrims_effect = {
	hidden_effect = {
		if = {
			limit = {
				root = { is_ai = no }
			}
			while = {
				limit = {
					current_travel_plan = { num_entourage_characters < $ENTOURAGE_CAP$ }
				}
				create_character = {
					template = location_pilgrim_template
					culture = scope:pilgrim_net.culture
					# Peasants don't generate correctly when deleting their dynasties in templates, so we manually remove their house here.
					dynasty = none
					# Random traits, likewise, doesn't generate correctly for templates.
					random_traits = no
					location = scope:pilgrim_net.title_province
					save_scope_as = fresh_pilgrim
				}
				scope:fresh_pilgrim = {
					add_character_flag = {
						flag = cannot_be_diarch
						weeks = 1
					}
				}
				# Whack 'em in the train.
				current_travel_plan = { add_companion = scope:fresh_pilgrim }
				# Otherwise they get added as courtiers and that's just not the idea.
				remove_courtier_or_guest = scope:fresh_pilgrim
				# Increment the counter.
				change_variable = {
					name = rando_pilgrim_counter
					add = 1
				}
			}
		}
	}
}

#Going on a Pilgrimage
travel_start_event.1060 = {
	type = character_event
	title = {
		first_valid = {
			#Sick Pilgrimage
			triggered_desc = {
				trigger = {
					has_any_debilitating_illness = yes
				}
				desc = travel_start_event.1060.t_sick_pilgrimage
			}
			#Hajj
			triggered_desc = {
				trigger = {
					involved_activity = {
						has_activity_option = {
							category = special_type
							option = pilgrimage_type_hajj
						}
					}
				}
				desc = travel_start_event.1060.t_hajj
			}
			#Pilgrimage
			triggered_desc = {
				desc = travel_start_event.1060.t_pilgrimage
			}
		}
	}
	desc = {
		first_valid = {
			#Sick Pilgrimage
			triggered_desc = {
				trigger = {
					has_any_debilitating_illness = yes
				}
				desc = travel_start_event.1060.desc_sick_pilgrimage
			}
			#Hajj
			triggered_desc = {
				trigger = {
					involved_activity = {
						has_activity_option = {
							category = special_type
							option = pilgrimage_type_hajj
						}
					}
				}
				desc = travel_start_event.1060.desc_hajj_pilgrimage
			}
			#Yatra (Buddhist or Hidhu Pilgrimage)
			triggered_desc = {
				trigger = {
					religion = {
						OR = {
							this = religion:buddhism_religion
							this = religion:hinduism_religion
						}
					}
				}
				desc = travel_start_event.1060.desc_yatra_pilgrimage		
			}
			#Pilgrimage
			triggered_desc = {
				desc = travel_start_event.1060.desc_pilgrimage
			}
		}
	}
	theme = travel_pilgrimage
	left_portrait = {
		character = root
		#Sick - sick animation
		triggered_animation = {
			trigger = { has_any_debilitating_illness = yes }
			animation = sick
		}
		#Pilgrimage
		triggered_animation = {
			trigger = {
				OR = {
					has_pious_pilgrimage_type_trigger = yes
					has_hajj_pilgrimage_type_trigger = yes
				}
			}
			#Pious pilgrim
			animation = personality_zealous
		}
		triggered_animation = {
			trigger = { has_worldly_pilgrimage_type_trigger = yes }
			#Worldly pilgrim
			animation = personality_forgiving
		}
		animation = personality_compassionate
	}
	#Show our Travel Leader
	right_portrait = {
		character = scope:saved_travel_leader
	}
	trigger = {
		is_available_travelling = yes
		is_landed = yes
		involved_activity ?= { has_activity_type = activity_pilgrimage }
	}
	immediate = {
		play_music_cue = mx_cue_travel_start

		current_travel_plan.travel_leader ?= {
			save_scope_as = saved_travel_leader
		}
		# Right, what amount of extras do we need?
		## First, work out where we're casting our net.
		### Landed characters use their capital.
		if = {
			limit = { is_landed = yes }
			capital_county = { save_scope_as = pilgrim_net }
		}
		### Landless ones use their location.
		#### Technically they shouldn't be able to get this far, but we're being thorough.
		else = {
			location.county = { save_scope_as = pilgrim_net }
		}
		## Then, assemble a basic list.
		### The locals.
		every_pool_character = {
			limit = { travel_event_1060_valid_local_pilgrim_trigger = yes }
			province = scope:pilgrim_net.title_province
			add_to_list = grabbable_randos_list
		}
		### And a bit further afield.
		scope:pilgrim_net = {
			duchy = {
				every_title_to_title_neighboring_and_across_water_duchy = {
					title_capital_county.title_province = {
						save_scope_as = province_temp
						every_pool_character = {
							limit = { travel_event_1060_valid_local_pilgrim_trigger = yes }
							province = scope:province_temp
							add_to_list = grabbable_randos_list
						}
					}
				}
			}
		}
		## Create a tracker for later.
		set_variable = {
			name = rando_pilgrim_counter
			value = 0
		}
		## Now, what type of train are we running?
		### Pomp, Humble.
		if = {
			limit = {
				involved_activity = {
					has_activity_option = {
						category = pilgrimage_option_pomp
						option = pilgrimage_pomp_humble
					}
				}
			}
			# Sweet, try to grab a small handful from the local area.
			travel_event_1060_grab_local_pilgrims_effect = { ENTOURAGE_CAP = pilgrimage_entourage_pomp_humble_max_value }
			# And if we _still_ don't have enough pilgrims, create some.
			travel_event_1060_create_additional_pilgrims_effect = { ENTOURAGE_CAP = pilgrimage_entourage_pomp_humble_max_value }
		}
		### Pomp, Appropriate.
		else_if = {
			limit = {
				involved_activity = {
					has_activity_option = {
						category = pilgrimage_option_pomp
						option = pilgrimage_pomp_appropriate
					}
				}
			}
			# Sweet, try to grab a small handful from the local area.
			travel_event_1060_grab_local_pilgrims_effect = { ENTOURAGE_CAP = pilgrimage_entourage_pomp_appropriate_max_value }
			# And if we _still_ don't have enough pilgrims, create some.
			travel_event_1060_create_additional_pilgrims_effect = { ENTOURAGE_CAP = pilgrimage_entourage_pomp_appropriate_max_value }
		}
		### Pomp, Ceremonial.
		else_if = {
			limit = {
				involved_activity = {
					has_activity_option = {
						category = pilgrimage_option_pomp
						option = pilgrimage_pomp_ceremonial
					}
				}
			}
			# Sweet, try to grab a small handful from the local area.
			travel_event_1060_grab_local_pilgrims_effect = { ENTOURAGE_CAP = pilgrimage_entourage_pomp_ceremonial_max_value }
			# And if we _still_ don't have enough pilgrims, create some.
			travel_event_1060_create_additional_pilgrims_effect = { ENTOURAGE_CAP = pilgrimage_entourage_pomp_ceremonial_max_value }
		}
		### Pomp, Throng.
		else_if = {
			limit = {
				involved_activity = {
					has_activity_option = {
						category = pilgrimage_option_pomp
						option = pilgrimage_pomp_throng
					}
				}
			}
			# Sweet, try to grab a small handful from the local area.
			travel_event_1060_grab_local_pilgrims_effect = { ENTOURAGE_CAP = pilgrimage_entourage_pomp_throng_max_value }
			# And if we _still_ don't have enough pilgrims, create some.
			travel_event_1060_create_additional_pilgrims_effect = { ENTOURAGE_CAP = pilgrimage_entourage_pomp_throng_max_value }
		}

		### Place with Piousness modifier
		hidden_effect = {
			if = {
				limit = {
					involved_activity.activity_location = {
						OR = {
							has_province_modifier = inspection_protected_holy_site_levy_modifier
							has_province_modifier = inspection_protected_holy_site_gold_modifier
							has_province_modifier = inspection_protected_holy_poi_levy_modifier
							has_province_modifier = inspection_protected_holy_poi_gold_modifier
						}
					}
				}
				involved_activity = { activity_special_type_progression_huge = yes }
			}
		}
	}
	#Giddy up!
	option = {
		#Yeah, yeah ...
		name = {
			trigger = {
				OR = {
					has_any_debilitating_illness = yes
					has_trait = cynical
				}
			}
			text = travel_start_event.1000.a_cynical
		}
		#Hajj
		name = {
			trigger = {
				involved_activity ?= {
					has_activity_option = {
						category = special_type
						option = pilgrimage_type_hajj
					}
				}
				NOT = { has_trait = hajjaj }
			}
			text = travel_start_event.1000.a_hajj
		}
		#Revisit Hajj
		name = {
			trigger = {
				involved_activity ?= {
					has_activity_option = {
						category = special_type
						option = pilgrimage_type_hajj
					}
				}
				has_trait = hajjaj
			}
			text = travel_start_event.1000.a_hajj_revisit
		}
		#Everything is _awesome_
		name = {
			trigger = {
				NOT = {
					involved_activity ?= {
						has_activity_option = {
							category = special_type
							option = pilgrimage_type_hajj
						}
					}
				}
			}
			text = travel_start_event.1000.a
		}

		# Tell the player how many randos we've picked up in our tracker, since doing this in the immediate block causes weird display issues.
		# We only show this if we added any.
		if = {
			limit = {
				var:rando_pilgrim_counter > 0
			}
			custom_tooltip = travel_start_event.1060.tt.random_pilgrim_counter
		}
	}

	after = {
		# Clean up the tracker variable.
		remove_variable = rando_pilgrim_counter
	}
}

#Travelling to a Hunt
travel_start_event.1070 = {
	orphan = yes
	type = character_event
	title = {
		first_valid = {
			#Sick Hunt
			triggered_desc = {
				trigger = {
					has_any_debilitating_illness = yes
				}
				desc = travel_start_event.1070.t_sick_hunt
			}
			#Hunt
			triggered_desc = {
				desc = travel_start_event.1070.t_hunt
			}
		}
	} 
	desc = {
		#Intro
		first_valid = {
			#Hunt
			triggered_desc = {
				trigger = { exists = scope:host }
				desc = travel_start_event.1070.desc_hunt
			}
			#My Hunt
			triggered_desc = {
				desc = travel_start_event.1070.desc_my_hunt
			}
		}
		#Relationship to host segway
		first_valid = {
			#Negative
			triggered_desc = {
				trigger = {
					exists = scope:host
					has_relation_rival = involved_activity.activity_host
				}
				desc = travel_start_event.1070.desc_hunt_negative
			}
			#Positive
			triggered_desc = {
				trigger = {
					exists = scope:host
					has_any_good_relationship_with_character_trigger = { CHARACTER = scope:host }
				}
				desc = travel_start_event.1070.desc_hunt_positive
			}
			#Default
			triggered_desc = {
				trigger = { exists = scope:host }
				desc = travel_start_event.1070.desc_hunt_default
			}
		}
		#Trait flavor for my hunt
		first_valid = {
			#Hunter
			triggered_desc = {
				trigger = {
					has_trait = lifestyle_hunter 
					NOT = { exists = scope:host }
					has_any_debilitating_illness = no
				}
				desc = travel_start_event.1070.desc_my_hunt_hunter
			}
			#Humble
			triggered_desc = {
				trigger = {
					NOT = { exists = scope:host }
					OR = {
						has_trait = humble
						has_trait = shy
					}
					has_any_debilitating_illness = no
				}
				desc = travel_start_event.1070.desc_my_hunt_humble
			}
			#Arrogant
			triggered_desc = {
				trigger = { 
					NOT = { exists = scope:host }
					has_any_debilitating_illness = no
				}
				desc = travel_start_event.1070.desc_my_hunt_arrogant
			}
		}
		#Outro
		first_valid = {
			#Sick Hunt
			triggered_desc = {
				trigger = {
					exists = scope:host
					has_any_debilitating_illness = yes
				}
				desc = travel_start_event.1070.desc_sick_hunt_outro
			}
			#Dangerous Hunt
			triggered_desc = {
				trigger = {
					exists = scope:host
					involved_activity = { 
						has_activity_option = { category = special_type option = hunt_type_standard }
						activity_location.county = { has_county_modifier = hunt_sighting_dangerous_modifier }
					}
				}
				desc = travel_start_event.1070.desc_hunt_outro_dangerous
			}
			#Standard Hunt
			triggered_desc = {
				trigger = {
					exists = scope:host
					involved_activity = { 
						has_activity_option = { category = special_type option = hunt_type_standard }
					}
				}
				desc = travel_start_event.1070.desc_hunt_outro_standard
			}
			#Legendary Hunt
			triggered_desc = {
				trigger = {
					exists = scope:host
					involved_activity = { 
						has_activity_option = { category = special_type option = hunt_type_legendary }
					}
				}
				desc = travel_start_event.1070.desc_hunt_outro_legendary
			}
			#Falconry Hunt
			triggered_desc = {
				trigger = {
					exists = scope:host
					involved_activity = { 
						has_activity_option = { category = special_type option = hunt_type_falconry }
					}
				}
				desc = travel_start_event.1070.desc_hunt_outro_falconry
			}
			#Sick My Hunt
			triggered_desc = {
				trigger = {
					has_any_debilitating_illness = yes
				}
				desc = travel_start_event.1070.desc_sick_my_hunt_outro
			}
			#Dangerous My Hunt
			triggered_desc = {
				trigger = {
					involved_activity = { 
						has_activity_option = { category = special_type option = hunt_type_standard }
						activity_location.county = { has_county_modifier = hunt_sighting_dangerous_modifier }
					}
				}
				desc = travel_start_event.1070.desc_my_hunt_outro_dangerous
			}
			#Standard My Hunt
			triggered_desc = {
				trigger = {
					involved_activity = { 
						has_activity_option = { category = special_type option = hunt_type_standard }
					}
				}
				desc = travel_start_event.1070.desc_my_hunt_outro_standard
			}
			#Legendary My Hunt
			triggered_desc = {
				trigger = {
					involved_activity = { 
						has_activity_option = { category = special_type option = hunt_type_legendary }
					}
				}
				desc = travel_start_event.1070.desc_my_hunt_outro_legendary
			}
			#Falconry My Hunt
			triggered_desc = {
				trigger = {
					involved_activity = { 
						has_activity_option = { category = special_type option = hunt_type_falconry }
					}
				}
				desc = travel_start_event.1070.desc_my_hunt_outro_falconry
			}
		}
	}
	theme = travel
	left_portrait = {
		character = root
		#Sick - sick animation
		triggered_animation = {
			trigger = { has_any_debilitating_illness = yes }
			animation = sick
		}
		triggered_animation = {
			trigger = {
				involved_activity = { 
					has_activity_option = { category = special_type option = hunt_type_falconry }
				}
			}
			animation = hunting_falcon
		}
		triggered_animation = {
			trigger = {
				involved_activity = { has_activity_type = activity_hunt }
			}
			animation = hunting_horn
		}
		animation = happiness
	}
	#Show our Travel Leader
	right_portrait = {
		trigger = { exists = scope:caravaner } #Unop Use scope:caravaner
		character = scope:caravaner
	}
	#Show our host
	lower_right_portrait = {
		trigger = { exists = scope:host }
		character = scope:host
	}
	trigger = {
		is_available_travelling = yes
		is_landed = yes
		involved_activity ?= { has_activity_type = activity_hunt }
	}
	immediate = {
		#Unop Save scope:caravaner
		if = {
			limit = { exists = current_travel_plan.travel_leader }
			current_travel_plan.travel_leader = { save_scope_as = caravaner }
		}

		play_music_cue = mx_cue_travel_start
		if = {
			limit = {
				involved_activity.activity_host != root
			}
			#Check if we dislike the host
			if = {
				limit = {
					OR = {
						has_relation_rival = involved_activity.activity_host
						opinion = {
							target = involved_activity.activity_host
							value < 10
						}
					}
				}
				add_character_flag = we_dislike_host
			}
			#Save the scope for loc
			involved_activity.activity_host = { save_scope_as = host }
		}
	}
	#Giddy up!
	option = { 
		name = {
			text = {
				first_valid = {
					#Yeah, yeah ...
					triggered_desc = {
						trigger = {
							OR = {
								has_any_debilitating_illness = yes
								has_character_flag = we_dislike_host
								has_trait = craven
							}
						}
						desc = travel_start_event.1000.a_craven
					}
					#Everything is _awesome_
					triggered_desc = {
						desc = travel_start_event.1000.a
					}
				}
			}
		}
	}
	after = {
		if = {
			limit = { has_character_flag = we_dislike_host }
			remove_character_flag = we_dislike_host
		}
	}
}

#Travelling to a Witch Ritual
travel_start_event.1080 = {
	orphan = yes
	type = character_event
	title = {
		first_valid = {
			#Sick Witch Ritual
			triggered_desc = {
				trigger = {
					has_any_debilitating_illness = yes
				}
				desc = travel_start_event.1080.t_sick_witch_ritual
			}
			#Witch Ritual
			triggered_desc = {
				desc = travel_start_event.1080.t_witch_ritual
			}
		}
	} 
	desc = {
		#Intro
		first_valid = {
			#Witch Ritual
			triggered_desc = {
				trigger = { exists = scope:host }
				desc = travel_start_event.1080.desc_witch_ritual
			}
			#My Witch Ritual
			triggered_desc = {
				desc = travel_start_event.1080.desc_my_witch_ritual
			}
		}
		#Relation to host
		first_valid = {
			#Negative
			triggered_desc = {
				trigger = { 
					exists = scope:host
					has_relation_rival = scope:host
				}
				desc = travel_start_event.1080.desc_witch_ritual
			}
			#Positive
			triggered_desc = {
				trigger = { 
					exists = scope:host
					has_any_good_relationship_with_character_trigger = { CHARACTER = scope:host }
				}
				desc = travel_start_event.1080.desc_witch_ritual
			}
			#Default
			triggered_desc = {
				trigger = { 
					exists = scope:host 
				}
				desc = travel_start_event.1080.desc_witch_ritual_default
			}
		}
		#Trait flavor for my witch ritual
		first_valid = {
			#Learned
			triggered_desc = {
				trigger = { 
					NOT = { exists = scope:host }
					OR = {
						has_trait = education_learning_3
						has_trait = education_learning_4
						has_trait = scholar
					}
				}
				desc = travel_start_event.1080.desc_my_witch_ritual_learned
			}
			#Mystic
			triggered_desc = {
				trigger = { 
					NOT = { exists = scope:host }
					has_trait = lifestyle_mystic
				}
				desc = travel_start_event.1080.desc_my_witch_ritual_mystic
			}
			#Herbalist
			triggered_desc = {
				trigger = { 
					NOT = { exists = scope:host } 
					OR = {
						has_trait = lifestyle_herbalist
						has_trait = whole_of_body
						AND = {
							has_trait = lifestyle_physician
							has_trait_xp = {
								trait = lifestyle_physician
								value >= 50
							}
						}
					}
				}
				desc = travel_start_event.1080.desc_my_witch_ritual_health
			}
			#Default
			triggered_desc = {
				trigger = { 
					NOT = { exists = scope:host } 
				}
				desc = travel_start_event.1080.desc_my_witch_ritual_default
			}
		}
		#Outro
		first_valid = {
			#Sick
			triggered_desc = {
				trigger = { 
					has_any_debilitating_illness = yes
				}
				desc = travel_start_event.1080.desc_sick_my_witch_ritual_outro
			}
			#Default
			triggered_desc = {
				desc = travel_start_event.1080.desc_my_witch_ritual_outro
			}
		}
	}
	theme = travel
	left_portrait = {
		character = root
		#Sick - sick animation
		triggered_animation = {
			trigger = { has_any_debilitating_illness = yes }
			animation = sick
		}
		#Witch Ritual
		triggered_animation = {
			trigger = { has_trait = zealous }
			#Zealous witch
			animation = personality_zealous
		}
		animation = admiration
	}
	#Show our Travel Leader
	lower_left_portrait = {
		trigger = { exists = current_travel_plan.travel_leader }
		character = current_travel_plan.travel_leader
	}
	#Show our host
	lower_right_portrait = {
		trigger = { 
			involved_activity.activity_host != root
		}
		character = involved_activity.activity_host
	}
	trigger = {
		is_available_travelling = yes
		is_landed = yes
		involved_activity ?= { has_activity_type = activity_witch_ritual }
	}
	immediate = {
		play_music_cue = mx_cue_travel_start
		#Check if we dislike the host
		if = {
			limit = {
				involved_activity.activity_host != root
			}
			if = {
				limit = {
					OR = {
						has_relation_rival = involved_activity.activity_host
						opinion = {
							target = involved_activity.activity_host
							value < 10
						}
					}
				}
				add_character_flag = we_dislike_host
			}
			#Save the host for loc
			involved_activity.activity_host = { save_scope_as = host }
		}
	}
	#Giddy up!
	option = { 
		name = {
			text = {
				first_valid = {
					#Yeah, yeah ...
					triggered_desc = {
						trigger = {
							OR = {
								has_any_debilitating_illness = yes
								has_character_flag = we_dislike_host
								has_trait = cynical
							}
						}
						desc = travel_start_event.1000.a_cynical
					}
					#Everything is _awesome_
					triggered_desc = {
						desc = travel_start_event.1000.a
					}
				}
			}
		}
	}
	after = {
		if = {
			limit = { has_character_flag = we_dislike_host }
			remove_character_flag = we_dislike_host
		}
	}
}

#Travelling to a Travel Lifestyle Activity
travel_start_event.1090 = {
	type = character_event
	title = {
		first_valid = {
			triggered_desc = {
				trigger = {
					involved_activity = { has_activity_type = activity_roaming }
				}
				desc = travel_start_event.1090.t_activity_roaming
			}
			triggered_desc = {
				trigger = {
					involved_activity = { has_activity_type = activity_journey }
				}
				desc = travel_start_event.1090.t_activity_journey
			}
			triggered_desc = {
				trigger = {
					involved_activity = { has_activity_type = activity_survey }
				}
				desc = travel_start_event.1090.t_activity_survey
			}
		}
	} 
	desc = {
		#Intro
		first_valid = {
			triggered_desc = {
				trigger = { involved_activity = { has_activity_type = activity_roaming } }
				desc = travel_start_event.1090.desc_activity_roaming
			}
			triggered_desc = {
				trigger = { involved_activity = { has_activity_type = activity_journey } }
				desc = travel_start_event.1090.desc_activity_journey
			}
			triggered_desc = {
				trigger = { involved_activity = { has_activity_type = activity_survey } }
				desc = travel_start_event.1090.desc_activity_survey
			}
		}
	}
	theme = travel
	left_portrait = {
		character = root
		#Sick - sick animation
		triggered_animation = {
			trigger = { has_any_debilitating_illness = yes }
			animation = sick
		}
		animation = survey
	}
	#Show our Travel Leader
	right_portrait = {
		character = current_travel_plan.travel_leader
	}
	lower_left_portrait = scope:scribe_1
	lower_right_portrait = scope:scribe_2
	trigger = {
		is_available_travelling = yes
		is_ruler = yes
		involved_activity ?= {
			OR = {
				has_activity_type = activity_roaming
				has_activity_type = activity_journey
				has_activity_type = activity_survey
			}
		}
	}
	immediate = {
		play_music_cue = mx_cue_travel_start
		involved_activity.activity_location = { save_scope_as = location }
		involved_activity = { save_scope_as = activity }
		save_scope_as = root_scope
		select_local_farm_animal_effect = yes
		if = {
			limit = {
				involved_activity = {
					has_activity_type = activity_journey
					has_activity_option = {
						category = journey_option_scribes
						option = journey_skilled_scribes
					}
				}
			}
			create_character = {
				employer = root
				template = scribe_travel_option_character
				faith = root.capital_county.faith
				culture = root.capital_county.culture
				save_scope_as = scribe_1
			}
			create_character = {
				employer = root
				template = scribe_travel_option_character
				faith = root.capital_county.faith
				culture = root.capital_county.culture
				save_scope_as = scribe_2
			}
		}
		if = {
			limit = {
				involved_activity = {
					has_activity_type = activity_journey
					activity_location = {
						OR = {
							has_province_modifier = inspection_proteted_poi_levy_modifier
							has_province_modifier = inspection_protected_poi_gold_modifier
							has_province_modifier = inspection_protected_poi_gold_modifier
							has_province_modifier = inspection_protected_holy_poi_gold_modifier
						}
					}
				}
			}
			hidden_effect = {
				involved_activity = { 
					journey_knowledge_hoarding_skill_effect = { VALUE = 10 } 
				}
			}
		}
	}
	#Giddy up!
	option = { 
		name = {
			text = {
				first_valid = {
					#Norwegian
					triggered_desc = {
						trigger = {
							OR = {
								culture = culture:norwegian
								culture = {
									any_parent_culture_or_above = { this = culture:norwegian }
								}
							}
						}
						desc = travel_start_event.1000.norwegian
					}
					#Everything is _awesome_
					triggered_desc = {
						desc = travel_start_event.1000.a
					}
				}
			}
		}
		if = {
			limit = {
				involved_activity = {
					has_activity_type = activity_journey
					has_activity_option = {
						category = journey_option_scribes
						option = journey_skilled_scribes
					}
				}
			}
			involved_activity = { journey_knowledge_hoarding_skill_effect = { VALUE = 20 } }
			custom_tooltip = obligation_hook_tt
		}
		scope:scribe_1 ?= {
			add_to_entourage_court_and_activity_effect = { 
				CHAR_TO_ADD = scope:scribe_1 
				NEW_COURT_OWNER = root 
			}
			root = {
				add_hook = {
					type = obligation_hook
					target = scope:scribe_1
				}
			}
		}
		scope:scribe_2 ?= {
			add_to_entourage_court_and_activity_effect = { 
				CHAR_TO_ADD = scope:scribe_2 
				NEW_COURT_OWNER = root 
			}
			root = {
				add_hook = {
					type = obligation_hook
					target = scope:scribe_2
				}
			}
		}
	}
}

#Travelling to an Examination Activity
travel_start_event.1100 = {
	type = character_event
	title = {
		first_valid = {
			#Sick IE
			triggered_desc = {
				trigger = {
					involved_activity = { has_activity_type = activity_imperial_examination }
					has_any_debilitating_illness = yes
				}
				desc = travel_start_event.1100.t_sick_exam
			}
			#IE
			triggered_desc = {
				trigger = {
					involved_activity = { has_activity_type = activity_imperial_examination }
				}
				desc = travel_start_event.1100.t_exam
			}
			#Sick Local
			triggered_desc = {
				trigger = {
					involved_activity = { has_activity_type = activity_local_examination }
					has_any_debilitating_illness = yes
				}
				desc = travel_start_event.1100.t_sick_exam_local
			}
			desc = travel_start_event.1100.t_exam_local
		}
	}

	desc = {
		#Intro
		first_valid = {
			triggered_desc = {
				trigger = {
					this = scope:host
					involved_activity = {
						has_activity_type = activity_imperial_examination
					}
				}
				desc = travel_start_event.1100.desc_my_exam_imperial
			}
			triggered_desc = {
				trigger = {
					this = scope:host
					involved_activity = {
						has_activity_type = activity_local_examination
					}
				}
				desc = travel_start_event.1100.desc_my_exam_local
			}
			desc = travel_start_event.1100.desc_exam
		}
		
		#Body
		first_valid = {
			triggered_desc = {
				trigger = {
					involved_activity = {
						has_activity_type = activity_imperial_examination
						has_activity_option = {
							category = special_type
							option = imperial_examination_focus_learning
						}
					}
					NOT = {
						this = scope:host
					}
				}
				desc = travel_start_event.1100.desc_exam_learning
			}
			triggered_desc = {
				trigger = {
					involved_activity = {
						has_activity_type = activity_imperial_examination
						has_activity_option = {
							category = special_type
							option = imperial_examination_focus_stewardship
						}
					}
					NOT = {
						this = scope:host
					}
				}
				desc = travel_start_event.1100.desc_exam_stewardship
			}
			triggered_desc = {
				trigger = {
					involved_activity = {
						has_activity_type = activity_imperial_examination
						has_activity_option = {
							category = special_type
							option = imperial_examination_focus_martial
						}
					}
					NOT = {
						this = scope:host
					}
				}
				desc = travel_start_event.1100.desc_exam_martial
			}
			desc = travel_start_event.1100.desc_exam_learning
		}
		first_valid = {
			#Sick IE
			triggered_desc = {
				trigger = {
					has_any_debilitating_illness = yes
				}
				desc = travel_start_event.1100.desc_sick_exam_outro
			}
			triggered_desc = {
				trigger = { this = scope:host }
				desc = travel_start_event.1100.desc_my_exam_outro
			}
			triggered_desc = {
				trigger = { is_wrong_examination_gender = yes }
				desc = travel_start_event.1100.desc_exam_wrong_gender
			}
			desc = travel_start_event.1100.desc_exam_outro
		}
	}
	theme = travel
	left_portrait = {
		character = root
		#Sick - sick animation
		triggered_animation = {
			trigger = { has_any_debilitating_illness = yes }
			animation = sick
		}
		animation = writing
	}
	#Show our Travel Leader
	right_portrait = {
		character = current_travel_plan.travel_leader
	}
	trigger = {
		is_available_travelling = yes
		is_ruler = yes
		involved_activity ?= {
			OR = {
				has_activity_type = activity_imperial_examination
				has_activity_type = activity_local_examination
			}
		}
	}
	immediate = {
		play_music_cue = mx_cue_travel_start
		involved_activity.activity_location = { save_scope_as = location }
		involved_activity = { save_scope_as = activity }
		involved_activity.activity_host = { save_scope_as = host }
		save_scope_as = root_scope
		if = {
			limit = {
				scope:activity = { has_activity_type = activity_imperial_examination }
				is_ai = no
				NOR = {
					has_character_flag = passed_palace_exam
					has_character_flag = set_activity_intent
				}
			}
			set_activity_intent = imperial_exam_taker_intent
			add_character_flag = set_activity_intent
		}
		if = {
			limit = {
				scope:activity = { has_activity_type = activity_local_examination }
				is_ai = no
				NOR = {
					has_character_flag = passed_provincial_exam
					has_character_flag = set_activity_intent
				}
			}
			set_activity_intent = local_exam_taker_intent
			add_character_flag = set_activity_intent
		}
	}
	#I should take the test.
	option = {
		name = travel_start_event.1000.take_test
		trigger = {
			is_landed = yes
			top_liege ?= involved_activity.activity_host
			NAND = {
				tgp_passed_metropolitan_examination = yes
				tgp_passed_palace_examination = yes
			}
			NOR = {
				has_title = title:h_china
				this = involved_activity.activity_host
			}
		}
		flavor = travel_start_event.1000.take_test_tt
		custom_tooltip = renounce_governorship_decision_effect_tt
		show_as_tooltip = {
			if = {
				limit = {
					government_allows = merit 
				}
				change_merit = medium_merit_gain
				add_character_modifier = {
					modifier = ep3_renounced_governorship_merit
					years = 15
				}
			}
			else = {
				add_gold = massive_gold_value
				add_character_modifier = {
					modifier = ep3_renounced_governorship
					years = 15
				}
			}
		}
		trigger_event = ep3_decisions_event.4090
		ai_chance = {
			base = 0
		}
	}
	#Giddy up!
	option = { 
		name = {
			text = {
				first_valid = {
					#Let's see how this goes...
					triggered_desc = {
						trigger = {
							OR = {
								has_any_debilitating_illness = yes
								has_trait = cynical
							}
						}
						desc = travel_start_event.1000.a_cynical
					}
					#Everything is _awesome_
					triggered_desc = {
						desc = travel_start_event.1000.a
					}
				}
			}
		}
	}
	
	after = {
		if = {
			limit = {
				is_wrong_examination_gender = yes
			}
			play_music_cue = "mx_cue_negative"
			custom_tooltip = wrong_examination_gender_tt
			add_prestige = medium_prestige_loss
			if = {
				limit = { is_male = yes }
				add_character_modifier = {
					modifier = tgp_wrong_examination_gender_male_modifier
					years = 15
				}
			}
			else = {
				add_character_modifier = {
					modifier = tgp_wrong_examination_gender_female_modifier
					years = 15
				}
			}
		}
	}
}

#Traveling to a Mandala Contract
travel_start_event.1110 = {
	orphan = yes
	type = character_event
	title = {
		first_valid = {
			#Sick
			triggered_desc = {
				trigger = {
					has_any_debilitating_illness = yes
				}
				desc = travel_start_event.1110.t_sick
			}
			desc = travel_start_event.1110.t
		}
	}
	desc = {
		desc = travel_start_event.1110.desc
		first_valid = {
			#Sick
			triggered_desc = {
				trigger = {
					has_any_debilitating_illness = yes
				}
				desc = travel_start_event.1110.desc_sick_outro
			}
			desc = travel_start_event.1110.desc_outro
			
		}
	}
	theme = travel
	left_portrait = {
		character = root
		#Sick - sick animation
		triggered_animation = {
			trigger = { has_any_debilitating_illness = yes }
			animation = sick
		}
		animation = holding_staff
	}
	trigger = {
		is_available_travelling = yes
		is_ruler = yes
		has_an_active_mandala_contract_trigger = yes
		#Longer than one tick, please
		current_travel_plan ?= {
			next_destination_province = {
				county != root.capital_county
			}
		}
	}
	immediate = {
		play_music_cue = mx_cue_travel_start
		random_character_active_contract = {
			limit = { is_a_mandala_contract_trigger = yes }
			save_scope_as = task_contract
			task_contract_location = { save_scope_as = contract_location }
		}
	}
	#Giddy up!
	option = { 
		name = {
			text = {
				first_valid = {
					#Let's see how this goes...
					triggered_desc = {
						trigger = {
							OR = {
								has_any_debilitating_illness = yes
								has_trait = cynical
							}
						}
						desc = travel_start_event.1000.a_cynical
					}
					#Everything is _awesome_
					triggered_desc = {
						desc = travel_start_event.1000.a
					}
				}
			}
		}
	}
}

#Travelling to a Debate
travel_start_event.1120 = {
	type = character_event
	title = {
		first_valid = {
			triggered_desc = {
				trigger = {
					involved_activity = {
						has_activity_type = activity_debate
						has_activity_option = {
							category = special_type
							option = debate_type_leadership
						}
					}
					scope:activity.special_guest:movement_leader ?= root
				}
				desc = travel_start_event.1120.t_special_guest
			}
			#Sick IE
			triggered_desc = {
				trigger = {
					has_any_debilitating_illness = yes
				}
				desc = travel_start_event.1120.t_sick_debate
			}
			#IE
			triggered_desc = {
				desc = travel_start_event.1120.t_debate
			}
		}
	}

	desc = {
		#Intro
		first_valid = {
			triggered_desc = {
				trigger = {
					involved_activity = {
						has_activity_type = activity_debate
						has_activity_option = {
							category = special_type
							option = debate_type_leadership
						}
					}
					scope:activity.special_guest:movement_leader = this
				}
				desc = travel_start_event.1120.desc_special_guest
			}
			triggered_desc = {
				trigger = { this = scope:host }
				desc = travel_start_event.1120.desc_my_debate
			}
			desc = travel_start_event.1120.desc_debate
		}
		
		first_valid = {
			#Sick 
			triggered_desc = {
				trigger = {
					has_any_debilitating_illness = yes
				}
				desc = travel_start_event.1120.desc_sick_debate_outro
			}
			# Undecided
			triggered_desc = {
				trigger = { is_any_movement_member_not_undecided = no }
				desc = travel_start_event.1120.desc.undecided
			}
			desc = travel_start_event.1120.desc_debate_outro
		}
	}
	theme = travel
	left_portrait = {
		character = root
		#Sick - sick animation
		triggered_animation = {
			trigger = { has_any_debilitating_illness = yes }
			animation = sick
		}
		triggered_animation = {
			trigger = {
				involved_activity = {
					has_activity_type = activity_debate
					has_activity_option = {
						category = special_type
						option = debate_type_leadership
					}
				}
				scope:activity.special_guest:movement_leader = this
			}
			animation = dismissal
		}
		animation = reading
	}
	#Show our Travel Leader
	right_portrait = {
		character = current_travel_plan.travel_leader
	}
	trigger = {
		is_available_travelling = yes
		exists = involved_activity
		involved_activity = {
			has_activity_type = activity_debate
		}
	}
	immediate = {
		play_music_cue = mx_cue_travel_start
		involved_activity.activity_location = { save_scope_as = location }
		involved_activity = { save_scope_as = activity }
		involved_activity.activity_host = { save_scope_as = host }
		save_scope_as = root_scope
		top_liege.primary_title = { save_scope_as = primary_title }
	}
	#Giddy up!
	option = { 
		name = {
			text = {
				first_valid = {
					#Let's see how this goes...
					triggered_desc = {
						trigger = {
							OR = {
								has_any_debilitating_illness = yes
								has_trait = cynical
							}
						}
						desc = travel_start_event.1000.a_cynical
					}
					triggered_desc = {
						trigger = {
							involved_activity = {
								has_activity_type = activity_debate
								has_activity_option = {
									category = special_type
									option = debate_type_leadership
								}
							}
							scope:activity.special_guest:movement_leader = this
						}
						desc = travel_start_event.1120.a_leader
					}
					#Everything is _awesome_
					triggered_desc = {
						desc = travel_start_event.1000.a
					}
				}
			}
		}
		trigger = {
			is_any_movement_member_not_undecided = yes
		}
	}
	
	option = { # Join the Conservatives
		trigger = {
			is_any_movement_member_not_undecided = no
		}
		name = travel_start_event.1120.conservatives
		reason = conservative_movement
		custom_tooltip = travel_start_event.1120.conservatives.tt
		set_variable = {
			name = movement_member
			value = flag:conservative
		}
		ai_chance = {
			base = 25
			modifier = {
				add = 100
				dynasty ?= {
					dynasty_prestige_level >= high_dynasty_prestige_level
				}
			}
		}
	}
	
	option = { # Join the Expansionists
		trigger = {
			is_any_movement_member_not_undecided = no
		}
		name = travel_start_event.1120.expansionists
		reason = expansion_movement
		custom_tooltip = travel_start_event.1120.expansionists.tt
		set_variable = {
			name = movement_member
			value = flag:expansion
		}
		ai_chance = {
			base = 0
			modifier = {
				add = 100
				OR = {
					vassal_contract_has_flag = celestial_province_military
					vassal_contract_has_flag = celestial_province_protectorate
				}
			}
		}
	}
	
	option = { # Join the Advancement
		trigger = {
			is_any_movement_member_not_undecided = no
		}
		name = travel_start_event.1120.advancement
		reason = advancement_movement
		custom_tooltip = travel_start_event.1120.advancement.tt
		set_variable = {
			name = movement_member
			value = flag:advancement
		}
		ai_chance = {
			base = 0
			modifier = {
				add = 100
				vassal_contract_has_flag = celestial_civil_appointment
			}
		}
	}
	
	option = { # Join the Pro-Hegemon
		trigger = {
			is_any_movement_member_not_undecided = no
		}
		name = travel_start_event.1120.pro_hegemon
		reason = pro_hegemon_movement
		custom_tooltip = travel_start_event.1120.pro_hegemon.tt
		set_variable = {
			name = movement_member
			value = flag:pro_hegemon
		}
		ai_chance = {
			base = 10
		}
	}
	
	option = { # Go home
		trigger = {
			is_any_movement_member_not_undecided = no
		}
		name = travel_start_event.1120.bye
		remove_from_activity = involved_activity # This reroutes you home
		ai_chance = {
			base = 100
		}
	}
}

#Generic Travel Start Toast
travel_start_event.1130 = {
	hidden = yes
	trigger = {
		is_available_travelling = yes
	}
	immediate = {
		play_music_cue = mx_cue_travel_start
		save_scope_as = root_scope
		if = {
			limit = {
				exists = involved_activity
			}
			involved_activity = { save_scope_as = activity }
			involved_activity.activity_location.barony = { save_scope_as = location }
			involved_activity.activity_host = { save_scope_as = host }
			send_interface_toast = {
				title = travel_starts
				left_icon = scope:host
				right_icon = scope:location
				custom_tooltip = travel_destination_activity
			}
		}
		else = {
			current_travel_plan.final_destination_province.barony = { save_scope_as = location }
			send_interface_toast = {
				title = travel_starts
				left_icon = scope:root_scope
				right_icon = scope:location
				custom_tooltip = travel_destination_location
			}
		}
	}
}
