
###########################################
#                                         #
# Catholic Pilgrimage Events              #
#                                         #
# ID SoA.5000-                            #
#                                         #
###########################################

# Written by Tobias Bodlund

namespace = SoA

# Confirm decision and check religion

character_event = {
	id = SoA.5000
	desc = EVTDESC_SoA_5000
	picture = GFX_evt_bishop
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes # christian_pilgrimage, minor_decisions.txt

	option = {
		name = EVTOPTA_SoA_5000

		piety = 20
		set_character_flag = preparing_pilgrimage
		clr_character_flag = activated_pilgrimage

		if = {
			limit = {
				OR = {
					is_orthodox_branch = yes
					is_nestorian_branch = yes
					is_miaphysite_branch = yes
					is_apostolic_branch = yes
				}
			}

			character_event = { id = SoA.5011 } # Jeru, Const, Antio, Axum
		}
		else_if = {
			limit = {
				OR = {
					is_catholic_branch = yes
					religion = tondrakian
				}
			}

			if = {
				limit = {
					capital_scope = {
						OR = {
							province_id = c_kent
							province_id = c_koln
							province_id = c_roma
							province_id = c_santiago
						}
					}
				}

				character_event = {
					id = SoA.5016 # Go to Jerusalem
					days = 4
				}
			}
			else_if = {
				limit = {
					capital_scope = { province_id = c_jerusalem }
				}

				character_event = {
					id = SoA.5017 # Go to Rome
					days = 4
				}
			}
			else = {
				character_event = {
					id = SoA.5018 # May choose destination
					days = 4
				}
			}
		}
	}
}

###########################################
#                                         #
# Choose destination                      #
#                                         #
# ID SoA.5009-5020                        #
#                                         #
###########################################

# Choose destination as Eastern Christian
character_event = {
	id = SoA.5011
	desc = EVTDESC_SoA_5011
	picture = GFX_evt_icon
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	option = {
		name = EVTOPTA_SoA_5011

		trigger = {
			capital_scope = {
				NOT = { province_id = c_jerusalem }
			}
		}

		set_character_flag = pilgrimage_to_jerusalem

		character_event = {
			id = SoA.5021 # Set out
			days = 15
		}

		if = {
			limit = { ai = no }

			chronicle = {
				entry = CHRONICLE_PILGRIMAGE_TO_JERUSALEM
				picture = GFX_evt_pilgrims_epic_journey
			}
		}
	}

	option = {
		name = EVTOPTB_SoA_5011

		trigger = {
			is_miaphysite_branch = no

			capital_scope = {
				NOT = { province_id = c_constantinopolis }
			}
		}

		set_character_flag = pilgrimage_to_constantinople

		character_event = {
			id = SoA.5021 # Set out
			days = 15
		}

		if = {
			limit = { ai = no }

			chronicle = {
				entry = CHRONICLE_PILGRIMAGE_TO_CONSTANTINOPLE
				picture = GFX_evt_pilgrims_epic_journey
			}
		}
	}

	option = {
		name = EVTOPTC_SoA_5011

		trigger = {
			capital_scope = {
				NOT = { province_id = c_antioch }
			}

			NOT = { religion = chalcedonian }
		}

		set_character_flag = pilgrimage_to_antioch

		character_event = {
			id = SoA.5021 # Set out
			days = 15
		}

		if = {
			limit = { ai = no }

			chronicle = {
				entry = CHRONICLE_PILGRIMAGE_TO_ANTIOCH
				picture = GFX_evt_pilgrims_epic_journey
			}
		}
	}

	option = {
		name = EVTOPTD_SoA_5011

		trigger = {
			is_miaphysite_branch = yes

			capital_scope = {
				NOT = { province_id = c_aksum }
			}
		}

		set_character_flag = pilgrimage_to_axum

		character_event = {
			id = SoA.5021 # Set out
			days = 15
		}

		if = {
			limit = { ai = no }

			chronicle = {
				entry = CHRONICLE_PILGRIMAGE_TO_AXUM
				picture = GFX_evt_pilgrims_epic_journey
			}
		}
	}

	option = {
		name = EVTOPTC_SOA_5018 # Find a Saintly Burial Site to visit

		trigger = {
			# has_global_flag = saintly_burial_sites_exist # Set in event HF.40020
			has_dlc = "Holy Fury"
		}

		character_event = {
			id = HF.41300
			days = 15
		}
	}

	option = {
		name = EVTOPTB_SoA_5020

		trigger = {
			religion = chalcedonian

			capital_scope = {
				NOT = { province_id = c_roma }
			}
		}

		set_character_flag = pilgrimage_to_rome

		character_event = {
			id = SoA.5021
			days = 15
		}

		if = {
			limit = { ai = no }

			chronicle = {
				entry = CHRONICLE_PILGRIMAGE_TO_ROME
				picture = GFX_evt_pilgrims_epic_journey
			}
		}
	}
}

# Catholic - Always go to Jerusalem if already living at one of the other sites
character_event = {
	id = SoA.5016
	desc = EVTDESC_SoA_5016
	picture = GFX_evt_jerusalem
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	option = {
		name = EVTOPTA_SoA_5016

		set_character_flag = pilgrimage_to_jerusalem

		character_event = {
			id = SoA.5021 # Set out
			days = 15
		}

		if = {
			limit = { ai = no }

			chronicle = {
				entry = CHRONICLE_PILGRIMAGE_TO_JERUSALEM
				picture = GFX_evt_pilgrims_epic_journey
			}
		}
	}
}

# Catholic - Always go to Rome if living in Jerusalem province
character_event = {
	id = SoA.5017
	desc = EVTDESC_SoA_5017
	picture = GFX_evt_victory_arch_byzantine
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	option = {
		name = EVTOPTA_SoA_5017

		set_character_flag = pilgrimage_to_rome

		character_event = {
			id = SoA.5021 # Set out
			days = 15
		}

		if = {
			limit = { ai = no }

			chronicle = {
				entry = CHRONICLE_PILGRIMAGE_TO_ROME
				picture = GFX_evt_pilgrims_epic_journey
			}
		}
	}
}

# Catholic - May decide where to go - Western Europe (Canterbury, Santiago, Cologne) or the ancient sites (Jerusalem, Rome)
character_event = {
	id = SoA.5018
	desc = EVTDESC_SoA_5018
	picture = GFX_evt_cathedral
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	option = {
		name = EVTOPTA_SoA_5018 # Go to Western Europe

		trigger = { year >= 814 }

		character_event = { id = SoA.5019 }
	}

	option = {
		name = EVTOPTB_SoA_5018 # Go to the old sites, Rome or Jerusalem

		character_event = { id = SoA.5020 }
	}

	option = {
		name = EVTOPTC_SOA_5018 # Find a Saintly Burial Site to visit

		trigger = { has_dlc = "Holy Fury" }

		character_event = {
			id = HF.41300
			days = 15
		}
	}
}

# Catholic - Where to go - West
character_event = {
	id = SoA.5019
	desc = EVTDESC_SoA_5019
	picture = GFX_evt_cathedral
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	option = {
		name = EVTOPTA_SoA_5019

		trigger = { year >= 1170 }

		set_character_flag = pilgrimage_to_canterbury

		character_event = {
			id = SoA.5021 # Set out
			days = 15
		}

		if = {
			limit = { ai = no }

			chronicle = {
				entry = CHRONICLE_PILGRIMAGE_TO_CANTERBURY
				picture = GFX_evt_pilgrims_epic_journey
			}
		}

		ai_chance = { factor = 25 }
	}

	option = {
		name = EVTOPTB_SoA_5019

		trigger = { year >= 1164 }

		set_character_flag = pilgrimage_to_koln

		character_event = {
			id = SoA.5021 # Set out
			days = 15
		}

		if = {
			limit = { ai = no }

			chronicle = {
				entry = CHRONICLE_PILGRIMAGE_TO_KOLN
				picture = GFX_evt_pilgrims_epic_journey
			}
		}

		ai_chance = { factor = 25 }
	}

	option = {
		name = EVTOPTC_SoA_5019

		set_character_flag = pilgrimage_to_santiago

		character_event = {
			id = SoA.5021 # Set out
			days = 15
		}

		if = {
			limit = { ai = no }

			chronicle = {
				entry = CHRONICLE_PILGRIMAGE_TO_SANTIAGO
				picture = GFX_evt_pilgrims_epic_journey
			}
		}

		ai_chance = { factor = 50 }
	}
}

# Catholic - Where to go - Med - the oldest sites
character_event = {
	id = SoA.5020
	desc = EVTDESC_SoA_5020
	picture = GFX_evt_victory_arch_byzantine
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	option = {
		name = EVTOPTA_SoA_5020

		set_character_flag = pilgrimage_to_jerusalem

		character_event = {
			id = SoA.5021 # Set out
			days = 15
		}

		if = {
			limit = { ai = no }

			chronicle = {
				entry = CHRONICLE_PILGRIMAGE_TO_JERUSALEM
				picture = GFX_evt_pilgrims_epic_journey
			}
		}
	}

	option = {
		name = EVTOPTB_SoA_5020

		set_character_flag = pilgrimage_to_rome

		character_event = {
			id = SoA.5021 # Set out
			days = 15
		}

		if = {
			limit = { ai = no }

			chronicle = {
				entry = CHRONICLE_PILGRIMAGE_TO_ROME
				picture = GFX_evt_pilgrims_epic_journey
			}
		}
	}
}

###########################################
#                                         #
# The journey                             #
#                                         #
# ID SoA.5021-5049                        #
#    SoA.5081-5087                        #
#    SoA.5094-5096                        #
#                                         #
###########################################

# Setting out (also selects events for road)
character_event = {
	id = SoA.5021
	border = GFX_event_normal_frame_religion

	desc = {
		text = EVTDESC_SoA_5021
		picture = GFX_evt_pilgrims_epic_journey
		trigger = { has_character_flag = pilgrimage_to_canterbury }
	}
	desc = {
		text = EVTDESC_SoA_5022
		picture = GFX_evt_pilgrims_epic_journey_desert
		trigger = { has_character_flag = pilgrimage_to_jerusalem }
	}
	desc = {
		text = EVTDESC_SoA_5023
		picture = GFX_evt_pilgrims_epic_journey
		trigger = { has_character_flag = pilgrimage_to_koln }
	}
	desc = {
		text = EVTDESC_SoA_5024
		picture = GFX_evt_pilgrims_epic_journey
		trigger = { has_character_flag = pilgrimage_to_rome }
	}
	desc = {
		text = EVTDESC_SoA_5025
		picture = GFX_evt_pilgrims_epic_journey
		trigger = { has_character_flag = pilgrimage_to_santiago }
	}
	desc = {
		text = EVTDESC_SoA_5094
		picture = GFX_evt_pilgrims_epic_journey
		trigger = { has_character_flag = pilgrimage_to_constantinople }
	}
	desc = {
		text = EVTDESC_SoA_5095
		picture = GFX_evt_pilgrims_epic_journey_desert
		trigger = { has_character_flag = pilgrimage_to_axum }
	}
	desc = {
		text = EVTDESC_SoA_5096
		picture = GFX_evt_pilgrims_epic_journey_desert
		trigger = { has_character_flag = pilgrimage_to_antioch }
	}

	is_triggered_only = yes

	option = {
		name = {
			text = EVTOPTA_SoA_5021
			trigger = { has_character_flag = pilgrimage_to_canterbury }
		}
		name = {
			text = EVTOPTA_SoA_5022
			trigger = { has_character_flag = pilgrimage_to_jerusalem }
		}
		name = {
			text = EVTOPTA_SoA_5023
			trigger = { has_character_flag = pilgrimage_to_koln }
		}
		name = {
			text = EVTOPTA_SoA_5024
			trigger = { has_character_flag = pilgrimage_to_rome }
		}
		name = {
			text = EVTOPTA_SoA_5025
			trigger = { has_character_flag = pilgrimage_to_santiago }
		}
		name = {
			text = EVTOPTA_SoA_5094
			trigger = { has_character_flag = pilgrimage_to_constantinople }
		}
		name = {
			text = EVTOPTA_SoA_5095
			trigger = { has_character_flag = pilgrimage_to_axum }
		}
		name = {
			text = EVTOPTA_SoA_5096
			trigger = { has_character_flag = pilgrimage_to_antioch }
		}

		hidden_effect = {
			clr_character_flag = preparing_pilgrimage
			add_trait = on_pilgrimage
			set_character_flag = good_pilgrimage

			narrative_event = {
				id = SoA.5050
				days = 30
			}

			if = {
				limit = {
					trigger_if = {
						limit = { has_character_flag = pilgrimage_to_constantinople }

						capital_scope = {
							distance = {
								where = c_constantinopolis
								value >= 400 # Longer journey
							}
						}
					}
					trigger_else_if = {
						limit = { has_character_flag = pilgrimage_to_axum }

						capital_scope = {
							distance = {
								where = c_aksum
								value >= 400 # Longer journey
							}
						}
					}
					trigger_else_if = {
						limit = { has_character_flag = pilgrimage_to_antioch }

						capital_scope = {
							distance = {
								where = c_antioch
								value >= 400 # Longer journey
							}
						}
					}
					trigger_else_if = {
						limit = { has_character_flag = pilgrimage_to_canterbury }

						capital_scope = {
							distance = {
								where = c_kent
								value >= 400 # Longer journey
							}
						}
					}
					trigger_else_if = {
						limit = { has_character_flag = pilgrimage_to_jerusalem }

						capital_scope = {
							distance = {
								where = c_jerusalem
								value >= 400 # Longer journey
							}
						}
					}
					trigger_else_if = {
						limit = { has_character_flag = pilgrimage_to_koln }

						capital_scope = {
							distance = {
								where = c_koln
								value >= 400 # Longer journey
							}
						}
					}
					trigger_else_if = {
						limit = { has_character_flag = pilgrimage_to_rome }

						capital_scope = {
							distance = {
								where = c_roma
								value >= 400 # Longer journey
							}
						}
					}
					trigger_else_if = {
						limit = { has_character_flag = pilgrimage_to_santiago }

						capital_scope = {
							distance = {
								where = c_santiago
								value >= 400 # Longer journey
							}
						}
					}
				}

				# List for longer journeys only
				random_list = {
					20 = { character_event = { id = SoA.5026 days = 5 random = 9 } }
					20 = { character_event = { id = SoA.5027 days = 5 random = 9 } }
					20 = { narrative_event = { id = SoA.5028 days = 5 random = 9 } }
					20 = { character_event = { id = SoA.5029 days = 5 random = 9 } }
					20 = { character_event = { id = SoA.5030 days = 5 random = 9 } }
				}
			}

			# List that is always checked
			random_list = {
				10 = { character_event = { id = SoA.5031 days = 15 random = 7 } }
				10 = { character_event = { id = SoA.5032 days = 15 random = 7 } }
				10 = { narrative_event = { id = SoA.5033 days = 15 random = 7 } }
				10 = { character_event = { id = SoA.5034 days = 15 random = 7 } }
				10 = { character_event = { id = SoA.5035 days = 15 random = 7 } }
				10 = { character_event = { id = SoA.5036 days = 15 random = 7 } }
				10 = { character_event = { id = SoA.5037 days = 15 random = 7 } }
				10 = { character_event = { id = SoA.5038 days = 15 random = 7 } }
				10 = { character_event = { id = SoA.5039 days = 15 random = 7 } }
			}

			# Holy orders events, close to destination
			if = {
				limit = {
					trigger_if = {
						limit = { has_character_flag = pilgrimage_to_constantinople }
						is_title_active = d_holy_sepulchre
					}
					trigger_else_if = {
						limit = { has_character_flag = pilgrimage_to_axum }
						is_title_active = d_saint_anthony
					}
					trigger_else_if = {
						limit = { has_character_flag = pilgrimage_to_antioch }

						OR = {
							is_title_active = d_knights_templar
							is_title_active = d_knights_hospitaller
							is_title_active = d_holy_sepulchre
							is_title_active = d_teutonic_order
							is_title_active = k_teutonic_state
						}
					}
					trigger_else_if = {
						limit = { has_character_flag = pilgrimage_to_canterbury }

						OR = {
							is_title_active = d_knights_templar
							is_title_active = d_knights_hospitaller
						}
					}
					trigger_else_if = {
						limit = { has_character_flag = pilgrimage_to_jerusalem }

						OR = {
							is_title_active = d_knights_templar
							is_title_active = d_knights_hospitaller
							is_title_active = d_holy_sepulchre
							is_title_active = d_teutonic_order
							is_title_active = k_teutonic_state
						}
					}
					trigger_else_if = {
						limit = { has_character_flag = pilgrimage_to_koln }

						OR = {
							is_title_active = d_knights_templar
							is_title_active = d_knights_hospitaller
							is_title_active = d_teutonic_order
							is_title_active = k_teutonic_state
						}
					}
					trigger_else_if = {
						limit = { has_character_flag = pilgrimage_to_rome }

						OR = {
							is_title_active = d_knights_templar
							is_title_active = d_knights_hospitaller
							is_title_active = d_teutonic_order
							is_title_active = k_teutonic_state
						}
					}
					trigger_else_if = {
						limit = { has_character_flag = pilgrimage_to_santiago }

						OR = {
							is_title_active = d_knights_santiago
							is_title_active = d_knights_calatrava
						}
					}
				}

				random_list = {
					33 = { narrative_event = { id = SoA.5045 days = 23 random = 4 } }
					33 = { character_event = { id = SoA.5046 days = 23 random = 4 } }
					33 = { character_event = { id = SoA.5047 days = 23 random = 4 } }
				}
			}
		}
	}
}

# Trouble on road - weather
character_event = {
	id = SoA.5026
	desc = EVTDESC_SoA_5026
	picture = GFX_evt_pilgrims_epic_journey

	is_triggered_only = yes

	option = {
		name = EVTOPTA_SoA_5026

		piety = 50

		random_list = {
			10 = { give_pneumonic_effect = yes }
			30 = { give_ill_effect = yes }
			60 = { }
		}

		ai_chance = { factor = 10 }
	}

	option = {
		name = EVTOPTB_SoA_5026

		add_trait_fully_silently_cynical_effect = yes

		random_list = {
			 5 = { give_pneumonic_effect = yes }
			15 = { give_ill_effect = yes }
			80 = { }
		}

		ai_chance = { factor = 90 }
	}
}

# Trouble on road - lost
character_event = {
	id = SoA.5027
	desc = EVTDESC_SoA_5027
	picture = GFX_evt_pilgrims_epic_journey

	is_triggered_only = yes

	option = {
		name = EVTOPTA_SoA_5027

		random = {
			chance = 30
			add_trait_fully_wroth_effect = yes
		}
	}

	option = {
		name = EVTOPTB_SoA_5027

		random = {
			chance = 30
			add_trait_fully_patient_effect = yes
		}
	}
}

# Trouble on road - inn on fire
narrative_event = {
	id = SoA.5028
	title = EVTNAME_SoA_5028
	desc = EVTDESC_SoA_5028
	picture = GFX_evt_burning_house

	is_triggered_only = yes

	option = {
		name = EVTOPTA_SoA_5028

		random = {
			chance = 10
			add_trait_wounded_effect = yes
		}

		random = {
			chance = 30
			add_trait_fully_brave_effect = yes
		}

		ai_chance = { factor = 80 }
	}

	option = {
		name = EVTOPTB_SoA_5028

		add_trait_fully_silently_craven_effect = yes

		ai_chance = { factor = 20 }
	}
}

# Danger on road - robbers
character_event = {
	id = SoA.5029
	desc = EVTDESC_SoA_5029
	picture = GFX_evt_bandits

	is_triggered_only = yes

	option = {
		name = EVTOPTA_SoA_5029

		wealth = -10

		ai_chance = { factor = 90 }
	}

	option = {
		name = EVTOPTB_SoA_5029
		tooltip_info = martial

		trigger = { martial >= 10 }

		add_trait_fully_silently_brave_effect = yes

		random = {
			chance = 10
			add_trait_wounded_effect = yes
		}

		ai_chance = { factor = 10 }
	}
}

# Danger on road  - broken bridge
character_event = {
	id = SoA.5030
	desc = EVTDESC_SoA_5030
	picture = GFX_evt_pilgrims_epic_journey

	is_triggered_only = yes

	option = {
		name = EVTOPTA_SoA_5030

		random = {
			chance = 20
			add_trait_wounded_effect = yes
		}

		ai_chance = { factor = 10 }
	}

	option = {
		name = EVTOPTB_SoA_5030

		wealth = -10

		ai_chance = { factor = 45 }
	}

	option = {
		name = EVTOPTC_SoA_5030

		wealth = -30
		add_trait_fully_silently_charitable_effect = yes

		ai_chance = { factor = 45 }
	}
}

# Philosophical ponderings
character_event = {
	id = SoA.5031
	desc = EVTDESC_SoA_5031
	picture = GFX_evt_pilgrims_epic_journey
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	option = {
		name = EVTOPTA_SoA_5031

		random_list = {
			10 = {
				if = {
					limit = { trait = celibate }
					remove_trait = celibate
				}
				if = {
					limit = { trait = hedonist }
					remove_trait = hedonist
				}
				if = {
					limit = { trait = gardener }
					remove_trait = gardener
				}
				if = {
					limit = { trait = mystic }
					remove_trait = mystic
				}
				if = {
					limit = { trait = impaler }
					remove_trait = impaler
				}
				if = {
					limit = { trait = duelist }
					remove_trait = duelist
				}
				if = {
					limit = { trait = hunter }
					remove_trait = hunter
				}
				if = {
					limit = { trait = poet }
					remove_trait = poet
				}
				if = {
					limit = { trait = falconer }
					remove_trait = falconer
				}
				add_trait = scholar
			}
			10 = {
				if = {
					limit = { trait = celibate }
					remove_trait = celibate
				}
				if = {
					limit = { trait = hedonist }
					remove_trait = hedonist
				}
				if = {
					limit = { trait = scholar }
					remove_trait = scholar
				}
				if = {
					limit = { trait = gardener }
					remove_trait = gardener
				}
				if = {
					limit = { trait = impaler }
					remove_trait = impaler
				}
				if = {
					limit = { trait = duelist }
					remove_trait = duelist
				}
				if = {
					limit = { trait = hunter }
					remove_trait = hunter
				}
				if = {
					limit = { trait = poet }
					remove_trait = poet
				}
				if = {
					limit = { trait = falconer }
					remove_trait = falconer
				}
				add_trait = mystic
			}
			10 = {
				if = {
					limit = { trait = celibate }
					remove_trait = celibate
				}
				if = {
					limit = { trait = hedonist }
					remove_trait = hedonist
				}
				if = {
					limit = { trait = scholar }
					remove_trait = scholar
				}
				if = {
					limit = { trait = gardener }
					remove_trait = gardener
				}
				if = {
					limit = { trait = mystic }
					remove_trait = mystic
				}
				if = {
					limit = { trait = impaler }
					remove_trait = impaler
				}
				if = {
					limit = { trait = duelist }
					remove_trait = duelist
				}
				if = {
					limit = { trait = hunter }
					remove_trait = hunter
				}
				if = {
					limit = { trait = falconer }
					remove_trait = falconer
				}
				add_trait = poet
			}
			10 = {
				add_trait = zealous
			}
			10 = {
				add_trait = depressed
			}
			50 = {
			}
		}
	}

	option = {
		name = EVTOPTB_SoA_5031

		random = {
			chance = 20
			add_trait_fully_cynical_effect = yes
		}
	}
}

# Meeting people on travels - good Samaritan
character_event = {
	id = SoA.5032
	desc = EVTDESC_SoA_5032
	picture = GFX_evt_pilgrims_epic_journey

	is_triggered_only = yes

	option = {
		name = EVTOPTA_SoA_5032

		wealth = -10
		add_trait_fully_silently_kind_effect = yes

		ai_chance = { factor = 90 }
	}

	option = {
		name = EVTOPTB_SoA_5032

		remove_trait_silently_kind_effect = yes

		ai_chance = { factor = 10 }
	}
}

# Meeting people on travels - Noah's ark
narrative_event = {
	id = SoA.5033
	title = EVTNAME_SoA_5033
	desc = EVTDESC_SoA_5033
	picture = GFX_evt_pilgrims_epic_journey

	is_triggered_only = yes

	option = {
		name = EVTOPTA_SoA_5033

		add_trait_fully_silently_arbitrary_effect = yes
	}

	option = {
		name = EVTOPTB_SoA_5033

		add_trait_fully_silently_charitable_effect = yes
	}

	option = {
		name = EVTOPTC_SoA_5033

		custom_tooltip = { text = noahs_ark_cats_dogs }
	}
}

# Meeting people on travels - bread and fish
character_event = {
	id = SoA.5034
	desc = EVTDESC_SoA_5034
	picture = GFX_evt_pilgrims_epic_journey

	is_triggered_only = yes

	option = {
		name = EVTOPTA_SoA_5034

		wealth = -5
		add_trait_fully_silently_charitable_effect = yes
	}

	option = {
		name = EVTOPTB_SoA_5034

		remove_trait_silently_charitable_effect = yes
	}
}

# Learning something about boats
character_event = {
	id = SoA.5035
	desc = EVTDESC_SoA_5035
	picture = GFX_evt_merchant_ship_at_sea_republic

	is_triggered_only = yes

	option = {
		name = EVTOPTA_SoA_5035

		random_list = {
			15 = { change_martial = 1 }
			15 = { change_learning = 1 }
			70 = { }
		}
	}

	option = {
		name = EVTOPTB_SoA_5035

		piety = 30
	}
}

# Learning something about bridges
character_event = {
	id = SoA.5036
	desc = EVTDESC_SoA_5036
	picture = GFX_evt_pilgrims_epic_journey

	is_triggered_only = yes

	option = {
		name = EVTOPTA_SoA_5036

		random = {
			chance = 30
			change_learning = 1
		}
	}

	option = {
		name = EVTOPTB_SoA_5036

		random = {
			chance = 30
			add_trait_fully_proud_effect = yes
		}
	}
}

# Falls ill from trials on journey
character_event = {
	id = SoA.5037
	desc = EVTDESC_SoA_5037
	picture = GFX_evt_pilgrims_epic_journey

	is_triggered_only = yes

	option = {
		name = EVTOPTA_SoA_5037

		piety = 10

		random = {
			chance = 40

			if = {
				limit = { has_dlc = "Reapers" }
				add_symptom_effect = yes
			}
			else = {
				add_trait_ill_effect = yes
			}
		}

		ai_chance = { factor = 10 }
	}

	option = {
		name = EVTOPTB_SoA_5037

		random = {
			chance = 20

			if = {
				limit = { has_dlc = "Reapers" }
				add_symptom_effect = yes
			}
			else = {
				add_trait_ill_effect = yes
			}
		}

		random = {
			chance = 50
			add_trait_fully_cynical_effect = yes
		}

		ai_chance = { factor = 90 }
	}
}

# Moral choice - steal or give
character_event = {
	id = SoA.5038
	desc = EVTDESC_SoA_5038
	picture = GFX_evt_pilgrims_epic_journey

	is_triggered_only = yes

	option = {
		name = EVTOPTA_SoA_5038

		piety = 10
	}

	option = {
		name = EVTOPTB_SoA_5038

		wealth = -10
		piety = 10
		add_trait_fully_silently_charitable_effect = yes
	}

	option = {
		name = EVTOPTC_SoA_5038

		wealth = 10

		remove_trait_silently_charitable_effect = yes
		add_trait_fully_silently_deceitful_effect = yes
	}

	option = {
		name = EVTOPTD_SoA_5038

		remove_trait_silently_charitable_effect = yes
	}
}

# Sees a guiding star - religious experience
character_event = {
	id = SoA.5039
	desc = EVTDESC_SoA_5039
	picture = GFX_evt_pilgrims_epic_journey
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	option = {
		name = EVTOPTA_SoA_5039

		random = {
			chance = 20
			add_trait_fully_zealous_effect = yes
		}
	}

	option = {
		name = EVTOPTB_SoA_5039

		random = {
			chance = 20
			add_trait_fully_cynical_effect = yes
		}
	}
}

# Holy knights come to meet and escort - feels safe
narrative_event = {
	id = SoA.5045
	title = EVTNAME_SoA_5045
	desc = EVTDESC_SoA_5045
	picture = GFX_evt_crusaders

	is_triggered_only = yes

	option = {
		name = EVTOPTA_SoA_5045

		piety = 20

		ai_chance = { factor = 90 }
	}

	option = {
		name = EVTOPTB_SoA_5045

		random = {
			chance = 20
			add_trait_fully_paranoid_effect = yes
		}

		ai_chance = { factor = 10 }
	}
}

# Comes upon holy knights at camp - talks to them and learns something
character_event = {
	id = SoA.5046
	desc = EVTDESC_SoA_5046
	picture = GFX_evt_crusaders

	is_triggered_only = yes

	option = {
		name = EVTOPTA_SoA_5046

		piety = 10

		random = {
			chance = 30
			change_learning = 1
		}
	}

	option = {
		name = EVTOPTB_SoA_5046

		random = {
			chance = 30
			change_martial = 1
		}
	}
}

# Meets holy knight as travel companion - makes friend who is member of a holy order
character_event = {
	id = SoA.5047
	desc = EVTDESC_SoA_5047
	picture = GFX_evt_crusaders

	is_triggered_only = yes

	option = {
		name = EVTOPTA_SoA_5047 # Yes - select order of knight depending on availability and destination. If several possible, randomize

		custom_tooltip = {
			text = gain_friend

			random_list = {
				1 = {
					trigger = {
						is_title_active = d_knights_templar

						OR = {
							has_character_flag = pilgrimage_to_antioch
							has_character_flag = pilgrimage_to_canterbury
							has_character_flag = pilgrimage_to_jerusalem
							has_character_flag = pilgrimage_to_koln
							has_character_flag = pilgrimage_to_rome
						}
					}

					d_knights_templar = {
						save_event_target_as = target_holy_order
					}
				}

				1 = {
					trigger = {
						OR = {
							is_title_active = d_teutonic_order
							is_title_active = k_teutonic_state
						}

						OR = {
							has_character_flag = pilgrimage_to_antioch
							has_character_flag = pilgrimage_to_jerusalem
							has_character_flag = pilgrimage_to_koln
							has_character_flag = pilgrimage_to_rome
						}
					}

					if = {
						limit = { is_title_active = d_teutonic_order }

						d_teutonic_order = {
							save_event_target_as = target_holy_order
						}
					}
					else = {
						k_teutonic_state = {
							save_event_target_as = target_holy_order
						}
					}
				}

				1 = {
					trigger = {
						is_title_active = d_knights_hospitaller

						OR = {
							has_character_flag = pilgrimage_to_antioch
							has_character_flag = pilgrimage_to_canterbury
							has_character_flag = pilgrimage_to_jerusalem
							has_character_flag = pilgrimage_to_koln
							has_character_flag = pilgrimage_to_rome
						}
					}

					d_knights_hospitaller = {
						save_event_target_as = target_holy_order
					}
				}

				1 = {
					trigger = {
						is_title_active = d_knights_santiago
						has_character_flag = pilgrimage_to_santiago
					}

					d_knights_santiago = {
						save_event_target_as = target_holy_order
					}
				}

				1 = {
					trigger = {
						is_title_active = d_knights_calatrava
						has_character_flag = pilgrimage_to_santiago
					}

					d_knights_calatrava = {
						save_event_target_as = target_holy_order
					}
				}

				1 = {
					trigger = {
						is_title_active = d_holy_sepulchre

						OR = {
							has_character_flag = pilgrimage_to_antioch
							has_character_flag = pilgrimage_to_constantinople
						}
					}

					d_holy_sepulchre = {
						save_event_target_as = target_holy_order
					}
				}

				1 = {
					trigger = {
						is_title_active = d_saint_anthony
						has_character_flag = pilgrimage_to_axum
					}

					d_saint_anthony = {
						save_event_target_as = target_holy_order
					}
				}
			}

			event_target:target_holy_order = {
				holder_scope = {
					random_courtier = {
						limit = {
							is_female = no
							is_adult = yes
							prisoner = no
							in_command = no
							is_priest = no

							NOR = {
								sibling = ROOT
								is_friend = ROOT
								is_rival = ROOT
							}
						}

						add_friend = ROOT
						save_event_target_as = target_friend
					}
				}
			}

			character_event = { id = SoA.5087 }
		}

		ai_chance = { factor = 90 }
	}

	option = {
		name = EVTOPTB_SoA_5047 # No

		random = {
			chance = 20
			add_trait_fully_shy_effect = yes
		}

		ai_chance = { factor = 10 }
	}
}

# Pilgrim receives notification about new friend
character_event = {
	id = SoA.5087
	desc = EVTDESC_SoA_5087
	picture = GFX_evt_crusaders

	is_triggered_only = yes

	ai = no

	option = {
		name = EVTOPTA_SoA_5087

		tooltip = {
			add_friend = event_target:target_friend
		}
	}
}

###########################################
#                                         #
# Pilgrim arrives                         #
#                                         #
# ID SoA.5050-SoA.5054                    #
#    SoA.5094-5096                        #
#                                         #
###########################################

# Arrived at Canterbury
narrative_event = {
	id = SoA.5050
	border = GFX_event_narrative_frame_religion

	title = {
		text = EVTNAME_SoA_5050
		trigger = { has_character_flag = pilgrimage_to_canterbury }
	}
	title = {
		text = EVTNAME_SoA_5051
		trigger = { has_character_flag = pilgrimage_to_jerusalem }
	}
	title = {
		text = EVTNAME_SoA_5052
		trigger = { has_character_flag = pilgrimage_to_koln }
	}
	title = {
		text = EVTNAME_SoA_5053
		trigger = { has_character_flag = pilgrimage_to_rome }
	}
	title = {
		text = EVTNAME_SoA_5054
		trigger = { has_character_flag = pilgrimage_to_santiago }
	}
	title = {
		text = EVTNAME_SoA_5097
		trigger = { has_character_flag = pilgrimage_to_constantinople }
	}
	title = {
		text = EVTNAME_SoA_5098
		trigger = { has_character_flag = pilgrimage_to_axum }
	}
	title = {
		text = EVTNAME_SoA_5099
		trigger = { has_character_flag = pilgrimage_to_antioch }
	}

	desc = {
		text = EVTDESC_SoA_5050
		picture = GFX_evt_cathedral
		trigger = { has_character_flag = pilgrimage_to_canterbury }
	}
	desc = {
		text = EVTDESC_SoA_5051
		picture = GFX_evt_jerusalem
		trigger = { has_character_flag = pilgrimage_to_jerusalem }
	}
	desc = {
		text = EVTDESC_SoA_5052
		picture = GFX_evt_cathedral
		trigger = { has_character_flag = pilgrimage_to_koln }
	}
	desc = {
		text = EVTDESC_SoA_5053
		picture = GFX_evt_victory_arch_byzantine
		trigger = { has_character_flag = pilgrimage_to_rome }
	}
	desc = {
		text = EVTDESC_SoA_5054
		picture = GFX_evt_cathedral
		trigger = { has_character_flag = pilgrimage_to_santiago }
	}
	desc = {
		text = EVTDESC_SoA_5097
		picture = GFX_evt_hagia_sofia
		trigger = { has_character_flag = pilgrimage_to_constantinople }
	}
	desc = {
		text = EVTDESC_SoA_5098
		picture = GFX_evt_market_byzantine
		trigger = { has_character_flag = pilgrimage_to_axum }
	}
	desc = {
		text = EVTDESC_SoA_5099
		picture = GFX_evt_cathedral
		trigger = { has_character_flag = pilgrimage_to_antioch }
	}

	is_triggered_only = yes

	option = {
		name = {
			text = EVTOPTA_SoA_5050
			trigger = { has_character_flag = pilgrimage_to_canterbury }
		}
		name = {
			text = EVTOPTA_SoA_5051
			trigger = { has_character_flag = pilgrimage_to_jerusalem }
		}
		name = {
			text = EVTOPTA_SoA_5052
			trigger = { has_character_flag = pilgrimage_to_koln }
		}
		name = {
			text = EVTOPTA_SoA_5053
			trigger = { has_character_flag = pilgrimage_to_rome }
		}
		name = {
			text = EVTOPTA_SoA_5054
			trigger = { has_character_flag = pilgrimage_to_santiago }
		}
		name = {
			text = EVTOPTA_SoA_5097
			trigger = { has_character_flag = pilgrimage_to_constantinople }
		}
		name = {
			text = EVTOPTA_SoA_5098
			trigger = { has_character_flag = pilgrimage_to_axum }
		}
		name = {
			text = EVTOPTA_SoA_5099
			trigger = { has_character_flag = pilgrimage_to_antioch }
		}

		character_event = {
			id = SoA.5055
			days = 5
		}
	}
}

###########################################
#                                         #
# Events occurring at pilgrimage          #
# destination                             #
#                                         #
# ID SoA.5055-SoA.5080                    #
#                                         #
###########################################

# Hidden event that selects what interesting things will happen at destination
character_event = {
	id = SoA.5055

	is_triggered_only = yes
	hide_window = yes

	immediate = {
		random_list = {
			10 = {
				if = {
					limit = { trait = cynical }
					character_event = { id = SoA.5056 } # Stimulated to learning
				}
				else = {
					random_list = {
						20 = { character_event = { id = SoA.5057 } } # Strong religious experience
						10 = { character_event = { id = SoA.5058 } } # Disappointed in the place
						20 = { character_event = { id = SoA.5060 } } # Learns things of the world - cosmopolitan
						20 = { character_event = { id = SoA.5061 } } # Generally impressed
					}
				}
			}

			10 = {
				if = {
					limit = {
						OR = {
							trait = mastermind_theologian
							trait = scholarly_theologian
						}
					}

					character_event = { id = SoA.5059 } # Mastermind theologian impresses everyone
				}
				else = {
					random_list = {
						20 = { character_event = { id = SoA.5057 } } # Strong religious experience
						10 = { character_event = { id = SoA.5058 } } # Disappointed in the place
						20 = { character_event = { id = SoA.5060 } } # Learns things of the world - cosmopolitan
						20 = { character_event = { id = SoA.5061 } } # Generally impressed
					}
				}
			}

			10 = {
				if = {
					limit = { trait = lustful }
					character_event = { id = SoA.5062 } # Lustful tourist having fun
				}
				else = {
					random_list = {
						20 = { character_event = { id = SoA.5057 } } # Strong religious experience
						10 = { character_event = { id = SoA.5058 } } # Disappointed in the place
						20 = { character_event = { id = SoA.5060 } } # Learns things of the world - cosmopolitan
						20 = { character_event = { id = SoA.5061 } } # Generally impressed
					}
				}
			}

			10 = {
				if = {
					limit = { trait = homosexual }
					character_event = { id = SoA.5063 } # Freedom
				}
				else = {
					random_list = {
						20 = { character_event = { id = SoA.5057 } } # Strong religious experience
						10 = { character_event = { id = SoA.5058 } } # Disappointed in the place
						20 = { character_event = { id = SoA.5060 } } # Learns things of the world - cosmopolitan
						20 = { character_event = { id = SoA.5061 } } # Generally impressed
					}
				}
			}

			10 = { # Monks cure pilgrim of disease - attributed to God's hand?
				if = {
					limit = {
						trigger_if = {
							limit = { is_ill = no }

							has_symptom_trigger = yes
							has_character_flag = developing_illness
						}
					}

					narrative_event = { id = SoA.5064 }
				}
				else = {
					random_list = {
						20 = { character_event = { id = SoA.5057 } } # Strong religious experience
						10 = { character_event = { id = SoA.5058 } } # Disappointed in the place
						20 = { character_event = { id = SoA.5060 } } # Learns things of the world - cosmopolitan
						20 = { character_event = { id = SoA.5061 } } # Generally impressed
					}
				}
			}

			10 = {
				if = {
					limit = {
						OR = {
							trait = lunatic
							trait = possessed
						}
					}

					character_event = { id = SoA.5065 } # Lunatic/possessed decides (s)he is God
				}
				else = {
					random_list = {
						20 = { character_event = { id = SoA.5057 } } # Strong religious experience
						10 = { character_event = { id = SoA.5058 } } # Disappointed in the place
						20 = { character_event = { id = SoA.5060 } } # Learns things of the world - cosmopolitan
						20 = { character_event = { id = SoA.5061 } } # Generally impressed
					}
				}
			}

			10 = {
				if = {
					limit = {
						OR = {
							trait = drunkard
							trait = hedonist
						}
					}

					character_event = { id = SoA.5066 } # Drunkard/hedonist event
				}
				else = {
					random_list = {
						20 = { character_event = { id = SoA.5057 } } # Strong religious experience
						10 = { character_event = { id = SoA.5058 } } # Disappointed in the place
						20 = { character_event = { id = SoA.5060 } } # Learns things of the world - cosmopolitan
						20 = { character_event = { id = SoA.5061 } } # Generally impressed
					}
				}
			}

			10 = { # Impressed by Islam or Judaism (Jerusalem only)
				if = {
					limit = {
						has_character_flag = pilgrimage_to_jerusalem

						NAND = {
							trait = sympathy_islam
							trait = sympathy_judaism
						}
					}

					character_event = { id = SoA.5067 }
				}
				else = {
					random_list = {
						20 = { character_event = { id = SoA.5057 } } # Strong religious experience
						10 = { character_event = { id = SoA.5058 } } # Disappointed in the place
						20 = { character_event = { id = SoA.5060 } } # Learns things of the world - cosmopolitan
						20 = { character_event = { id = SoA.5061 } } # Generally impressed
					}
				}
			}
		}
	}
}

# Stimulated to theological learning
character_event = {
	id = SoA.5056
	desc = EVTDESC_SoA_5056
	picture = GFX_evt_library
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	option = {
		name = EVTOPTA_SoA_5056

		if = {
			limit = {
				lifestyle_traits < 1
				NOT = { has_dlc = "Way of Life" }
			}

			add_trait = scholar
		}

		random = {
			chance = 20
			add_trait_fully_zealous_effect = yes
		}
	}

	option = {
		name = EVTOPTB_SoA_5056

		piety = 30
	}

	after = {
		character_event = {
			id = SoA.5090 # Stay a little longer then go home
			days = 10
		}
	}
}

# Strong religious experience
character_event = {
	id = SoA.5057
	desc = EVTDESC_SoA_5057
	picture = GFX_evt_knight_kneeling
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	option = {
		name = EVTOPTA_SoA_5057

		add_trait_fully_silently_zealous_effect = yes

		character_event = {
			id = SoA.5090 # Stay a little longer then go home
			days = 10
		}
	}
}

# Disappointed in the place
character_event = {
	id = SoA.5058
	desc = EVTDESC_SoA_5058
	picture = GFX_evt_bishop
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	option = {
		name = EVTOPTA_SoA_5058

		add_trait_fully_silently_cynical_effect = yes

		clr_character_flag = good_pilgrimage
		clr_character_flag = abominable_pilgrimage
		set_character_flag = bad_pilgrimage

		character_event = {
			id = SoA.5090 # Stay a little longer then go home
			days = 10
		}
	}
}

# Mastermind theologian impresses everyone
character_event = {
	id = SoA.5059
	desc = EVTDESC_SoA_5059
	picture = GFX_evt_heretic
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	option = {
		name = EVTOPTA_SoA_5059

		prestige = 30

		character_event = {
			id = SoA.5090 # Stay a little longer then go home
			days = 10
		}
	}
}

# Learns things of the big world - cosmopolitan experience
character_event = {
	id = SoA.5060
	desc = EVTDESC_SoA_5060
	picture = GFX_evt_market

	is_triggered_only = yes

	option = {
		name = EVTOPTA_SoA_5060

		random_list = {
			15 = { change_learning = 1 }
			15 = { change_intrigue = 1 }
			70 = { }
		}
	}

	option = {
		name = EVTOPTB_SoA_5060

		random = {
			chance = 50
			add_trait_fully_gregarious_effect = yes
		}

		if = {
			limit = { trait = gregarious }

			random = {
				chance = 20
				change_diplomacy = 1
			}
		}
	}

	after = {
		character_event = {
			id = SoA.5090 # Stay a little longer then go home
			days = 10
		}
	}
}

# Generally impressed
character_event = {
	id = SoA.5061
	desc = EVTDESC_SoA_5061
	picture = GFX_evt_bishop
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	option = {
		name = EVTOPTA_SoA_5061

		piety = 20

		character_event = {
			id = SoA.5090 # Stay a little longer then go home
			days = 10
		}
	}
}

# Lustful character enjoys freedom far from home
character_event = {
	id = SoA.5062
	desc = EVTDESC_SoA_5062
	picture = GFX_evt_lovers

	is_triggered_only = yes

	option = {
		name = EVTOPTA_SoA_5062 # Let's go!

		if = {
			limit = {
				is_female = yes
				practical_age < 45
				NOT = { trait = homosexual }
			}

			random = {
				chance = 50

				custom_tooltip = {
					text = becomes_pregnant_no_father
					impregnate = 0
				}

				clr_character_flag = good_pilgrimage
				clr_character_flag = abominable_pilgrimage
				set_character_flag = bad_pilgrimage
			}
		}

		if = {
			limit = {
				NOT = { trait = great_pox }
			}

			random = {
				chance = 5

				give_great_pox_effect = yes
				clr_character_flag = good_pilgrimage
				clr_character_flag = abominable_pilgrimage
				set_character_flag = bad_pilgrimage
			}
		}
	}

	option = {
		name = EVTOPTB_SoA_5062 # Control yourself

		piety = 10

		random = {
			chance = 40
			add_trait_fully_chaste_effect = yes
		}
	}

	after = {
		character_event = {
			id = SoA.5090 # Stay a little longer then go home
			days = 10
		}
	}
}

# Homosexual character enjoys freedom far from home
character_event = {
	id = SoA.5063
	desc = EVTDESC_SoA_5063
	picture = GFX_evt_feast

	is_triggered_only = yes

	option = {
		name = EVTOPTA_SoA_5063 # Do it

		remove_trait_silently_stressed_effect = yes
	}

	option = {
		name = EVTOPTB_SoA_5063 # Don't do it

		add_trait_silently_stressed_effect = yes

		random = {
			chance = 20
			add_trait_fully_zealous_effect = yes
		}
	}

	after = {
		character_event = {
			id = SoA.5090 # Stay a little longer then go home
			days = 10
		}
	}
}

# Monks cure pilgrim of disease - pilgrim attributes it to God's hand
narrative_event = {
	id = SoA.5064
	title = EVTNAME_SoA_5064
	desc = EVTDESC_SoA_5064
	picture = GFX_evt_monastery_monks
	border = GFX_event_narrative_frame_religion

	is_triggered_only = yes

	option = {
		name = EVTOPTA_SoA_5064

		if = {
			limit = { is_ill = yes }
			remove_disease_trait_effect = yes
		}
		else = {
			# Used later in blessing_removes_disease_effect
			set_character_flag = pilgrim_blessing

			add_character_modifier = {
				name = blessing_of_health
				duration = -1
			}
		}

		if = {
			limit = { trait = wounded }

			remove_trait = wounded
			add_scarred_tiered_effect = yes
		}

		add_trait_fully_silently_zealous_effect = yes

		ai_chance = { factor = 70 }
	}

	option = {
		name = EVTOPTB_SoA_5064

		if = {
			limit = { is_ill = yes }
			remove_disease_trait_effect = yes
		}
		else = {
			# Used later in blessing_removes_disease_effect
			set_character_flag = pilgrim_blessing

			add_character_modifier = {
				name = blessing_of_health
				duration = -1
			}
		}

		if = {
			limit = { trait = wounded }

			remove_trait = wounded
			add_scarred_tiered_effect = yes
		}

		add_trait_fully_silently_cynical_effect = yes

		ai_chance = { factor = 20 }
	}

	option = {
		name = EVTOPTC_SoA_5064

		trigger = {
			lifestyle_traits < 1
			NOT = { has_dlc = "Way of Life" }
		}

		if = {
			limit = { is_ill = yes }
			remove_disease_trait_effect = yes
		}
		else = {
			# Used later in blessing_removes_disease_effect
			set_character_flag = pilgrim_blessing

			add_character_modifier = {
				name = blessing_of_health
				duration = -1
			}
		}

		if = {
			limit = { trait = wounded }

			remove_trait = wounded
			add_scarred_tiered_effect = yes
		}

		add_trait = mystic

		ai_chance = { factor = 10 }
	}

	after = {
		character_event = {
			id = SoA.5090 # Stay a little longer then go home
			days = 10
		}
	}
}

# Blessing of health cures disease after having visited the monks
character_event = {
	id = SoA.5068
	desc = EVTDESC_TOG_7015 # copied from Ancestor's blessing event
	picture = GFX_evt_monastery_monks
	border = GFX_event_normal_frame_religion

	trigger = {
		is_ill = yes
	}

	is_triggered_only = yes # blessing_removes_disease_effect, see SoA.5064

	option = {
		name = EVTOPTA_SoA_5064

		remove_disease_trait_effect = yes
		remove_character_modifier = blessing_of_health
		clr_character_flag = pilgrim_blessing
		remove_trait_silently_cynical_effect = yes
	}
}

# Lunatic/possessed pilgrim decides (s)he is God
character_event = {
	id = SoA.5065
	desc = EVTDESC_SoA_5065
	picture = GFX_evt_lunatic
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	option = {
		name = EVTOPTA_SoA_5065

		character_event = { id = SoA.5080 } # Results of speaking to the masses

		ai_chance = { factor = 10 }
	}

	option = {
		name = EVTOPTB_SoA_5065

		ai_chance = { factor = 90 }
	}

	after = {
		character_event = {
			id = SoA.5090 # Stay a little longer then go home
			days = 10
		}
	}
}

# Drunkard/hedonist at holy site
character_event = {
	id = SoA.5066
	desc = EVTDESC_SoA_5066
	picture = GFX_evt_feast

	is_triggered_only = yes

	option = {
		name = EVTOPTA_SoA_5066

		if = {
			limit = {
				lifestyle_traits < 1
				NOT = { has_dlc = "Way of Life" }
			}

			random = {
				chance = 30
				add_trait = hedonist
			}
		}

		random = {
			chance = 30
			add_trait_drunkard_effect = yes
		}

		add_character_modifier = {
			name = good_times
			years = 2
		}

		ai_chance = { factor = 80 }
	}

	option = {
		name = EVTOPTB_SoA_5066

		piety = 10

		random = {
			chance = 30
			add_trait_stressed_effect = yes
		}

		ai_chance = { factor = 20 }
	}

	after = {
		character_event = {
			id = SoA.5090 # Stay a little longer then go home
			days = 10
		}
	}
}

# Impressed by Islam or Judaism (Jerusalem only)
character_event = {
	id = SoA.5067
	desc = EVTDESC_SoA_5067
	picture = GFX_evt_imam
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	option = {
		name = EVTOPTA_SoA_5067

		trigger = {
			NOT = { trait = sympathy_islam }
		}

		remove_trait_silently_zealous_effect = yes
		add_trait = sympathy_islam
	}

	option = {
		name = EVTOPTB_SoA_5067

		trigger = {
			NOT = { trait = sympathy_judaism }
		}

		remove_trait_silently_zealous_effect = yes
		add_trait = sympathy_judaism
	}

	after = {
		character_event = {
			id = SoA.5090 # Stay a little longer then go home
			days = 10
		}
	}
}

# Self-styled God speaks to the masses - consequences
character_event = {
	id = SoA.5080
	desc = EVTDESC_SoA_5080
	picture = GFX_evt_lunatic
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	option = {
		name = EVTOPTA_SoA_5080

		prestige = -10
		clr_character_flag = good_pilgrimage
		clr_character_flag = bad_pilgrimage
		set_character_flag = abominable_pilgrimage
		add_trait_silently_lunatic_effect = yes

		random = {
			chance = 50
			add_trait_fully_wroth_effect = yes
		}
	}
}

###########################################
#                                         #
# Homecoming                              #
#                                         #
# ID SoA5090-SoA5093                      #
#                                         #
###########################################

# Event checking result of pilgrimage and sending us on to the respective homecoming event
character_event = {
	id = SoA.5090

	hide_window = yes
	is_triggered_only = yes

	immediate = {
		if = {
			limit = { religion = yazidi }
			trigger_switch = {
				on_trigger = has_character_flag

				good_pilgrimage = { character_event = { id = GoPagan.282 } }
				bad_pilgrimage = { character_event = { id = GoPagan.283 } }
				abominable_pilgrimage = { character_event = { id = GoPagan.284 } }
			}
		}
		else = {
			trigger_switch = {
				on_trigger = has_character_flag

				good_pilgrimage = { character_event = { id = SoA.5091 } }
				bad_pilgrimage = { character_event = { id = SoA.5092 } }
				abominable_pilgrimage = { character_event = { id = SoA.5093 } }
			}
		}

		if = {
			limit = { has_quest = quest_monastic_order_pilgrimage_christian }

			letter_event = {
				id = MNM.4020
				days = 1
			}
		}
	}
}

# Good pilgrimage
character_event = {
	id = SoA.5091
	desc = EVTDESC_SoA_5091
	picture = GFX_evt_castle_construction
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	immediate = {
		character_event = { id = SoA.5999 } # Clean-up

		if = {
			limit = {
				ai = no
				is_ironman = yes
				NOT = { has_character_flag = achievement_pilgrim }
			}

			set_character_flag = achievement_pilgrim
		}
	}

	option = {
		name = EVTOPTA_SoA_5091

		add_trait = pilgrim
		piety = 30
	}
}

# Disappointing pilgrimage
character_event = {
	id = SoA.5092
	desc = EVTDESC_SoA_5092
	picture = GFX_evt_castle_construction
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	immediate = {
		character_event = { id = SoA.5999 } # Clean-up

		if = {
			limit = {
				ai = no
				is_ironman = yes
				NOT = { has_character_flag = achievement_pilgrim }
			}

			set_character_flag = achievement_pilgrim
		}
	}

	option = {
		name = EVTOPTA_SoA_5092

		add_trait = pilgrim
		piety = -10

		random = {
			chance = 20
			add_trait_fully_cynical_effect = yes
		}
	}
}

# Abominable pilgrimage - very unusual outcome
character_event = {
	id = SoA.5093
	desc = EVTDESC_SoA_5093
	picture = GFX_evt_lunatic
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	immediate = {
		character_event = { id = SoA.5999 } # Clean-up

		if = {
			limit = {
				ai = no
				is_ironman = yes
				NOT = { has_character_flag = achievement_pilgrim }
			}

			set_character_flag = achievement_pilgrim
		}
	}

	option = {
		name = EVTOPTA_SoA_5093

		add_trait = pilgrim
		piety = -100
	}
}

character_event = {
	id = SoA.5998

	is_triggered_only = yes # on_character_convert_religion
	hide_window = yes

	trigger = {
		OR = {
			has_character_flag = preparing_pilgrimage
			has_character_flag = activated_pilgrimage
		}

		NOT = { religion_group = christian }
	}

	immediate = {
		character_event = { id = SoA.5999 }
	}
}

# Clean-up
character_event = {
	id = SoA.5999 # originally HFP.23024

	is_triggered_only = yes # on_become_imprisoned_any_reason and on coming home
	hide_window = yes

	immediate = {
		clr_character_flag = pilgrimage_to_canterbury
		clr_character_flag = pilgrimage_to_jerusalem
		clr_character_flag = pilgrimage_to_koln
		clr_character_flag = pilgrimage_to_rome
		clr_character_flag = pilgrimage_to_santiago
		clr_character_flag = pilgrimage_to_constantinople
		clr_character_flag = pilgrimage_to_axum
		clr_character_flag = pilgrimage_to_antioch
		clr_character_flag = abominable_pilgrimage
		clr_character_flag = do_not_disturb
		clr_character_flag = preparing_pilgrimage
		clr_character_flag = activated_pilgrimage
		clr_character_flag = cold_saintly_pilgrimage
		clr_character_flag = mild_saintly_pilgrimage
		clr_character_flag = exotic_saintly_pilgrimage
		clr_character_flag = generic_saintly_pilgrimage
		clr_character_flag = pilgrimage_st_augustine
		clr_character_flag = pilgrimage_st_christopher
		clr_character_flag = pilgrimage_st_patrick
		remove_trait = on_pilgrimage
		clear_delayed_event = { id = SoA.5000 }
		clear_delayed_event = { id = SoA.5011 }
		clear_delayed_event = { id = SoA.5016 }
		clear_delayed_event = { id = SoA.5017 }
		clear_delayed_event = { id = SoA.5018 }
		clear_delayed_event = { id = SoA.5019 }
		clear_delayed_event = { id = SoA.5020 }
		clear_delayed_event = { id = SoA.5021 }
		clear_delayed_event = { id = SoA.5026 }
		clear_delayed_event = { id = SoA.5027 }
		clear_delayed_event = { id = SoA.5028 }
		clear_delayed_event = { id = SoA.5029 }
		clear_delayed_event = { id = SoA.5030 }
		clear_delayed_event = { id = SoA.5031 }
		clear_delayed_event = { id = SoA.5032 }
		clear_delayed_event = { id = SoA.5033 }
		clear_delayed_event = { id = SoA.5034 }
		clear_delayed_event = { id = SoA.5035 }
		clear_delayed_event = { id = SoA.5036 }
		clear_delayed_event = { id = SoA.5037 }
		clear_delayed_event = { id = SoA.5038 }
		clear_delayed_event = { id = SoA.5039 }
		clear_delayed_event = { id = SoA.5045 }
		clear_delayed_event = { id = SoA.5046 }
		clear_delayed_event = { id = SoA.5047 }
		clear_delayed_event = { id = SoA.5050 }
		clear_delayed_event = { id = SoA.5055 }
		clear_delayed_event = { id = SoA.5056 }
		clear_delayed_event = { id = SoA.5057 }
		clear_delayed_event = { id = SoA.5058 }
		clear_delayed_event = { id = SoA.5059 }
		clear_delayed_event = { id = SoA.5060 }
		clear_delayed_event = { id = SoA.5061 }
		clear_delayed_event = { id = SoA.5062 }
		clear_delayed_event = { id = SoA.5063 }
		clear_delayed_event = { id = SoA.5064 }
		clear_delayed_event = { id = SoA.5068 }
		clear_delayed_event = { id = SoA.5065 }
		clear_delayed_event = { id = SoA.5066 }
		clear_delayed_event = { id = SoA.5067 }
		clear_delayed_event = { id = SoA.5080 }
		clear_delayed_event = { id = SoA.5087 }
		clear_delayed_event = { id = SoA.5090 }
		clear_delayed_event = { id = SoA.5091 }
		clear_delayed_event = { id = SoA.5092 }
		clear_delayed_event = { id = SoA.5093 }
		clear_delayed_event = { id = HF.41300 }
		clear_delayed_event = { id = HF.41310 }
		clear_delayed_event = { id = HF.41312 }
		clear_delayed_event = { id = HF.41314 }
		clear_delayed_event = { id = HF.41316 }
		clear_delayed_event = { id = HF.41320 }
		clear_delayed_event = { id = HF.41340 }
		clear_delayed_event = { id = HF.41350 }
		clear_delayed_event = { id = HF.41352 }
		clear_delayed_event = { id = HF.41354 }
		clear_delayed_event = { id = HF.41356 }
		clear_delayed_event = { id = HF.41360 }
		clear_delayed_event = { id = HF.41365 }
		clear_delayed_event = { id = HF.41370 }
		clear_delayed_event = { id = HF.41375 }
		clear_delayed_event = { id = HF.41390 }
		clear_delayed_event = { id = HF.41400 }
		clear_delayed_event = { id = HF.41410 }
		clear_delayed_event = { id = HF.41411 }
		clear_delayed_event = { id = HF.41412 }
		clear_delayed_event = { id = HF.41413 }
		clear_delayed_event = { id = HF.41419 }
		clear_delayed_event = { id = HF.41420 }
		clear_delayed_event = { id = HF.41450 }
	}
}