﻿# Events for Pilgrimages

namespace = pilgrimage_intent

################################
# Pilgrimage intent events
# by James Beaumont & Alexander Oltner
################################
# pilgrimage_intent.1000 - Zealot - Console a local
# pilgrimage_intent.1001 - Zealot - Convert a child
# pilgrimage_intent.1010 - Zealot - Local courtier is passing by, convert them and bring them on your pilgrimage!
# pilgrimage_intent.1020 - Zealot - Fellow pilgrims of a different faith are on your path
# pilgrimage_intent.1030 - Reflection - You see a particularly calm clearing along your way and stop to meditate
# pilgrimage_intent.1040 - Reflection - You spot an animal, follow it for an omen?
# pilgrimage_intent.1050 - Reflection - You contemplate the brevity of life
# pilgrimage_intent.1060 - Reflection - You contemplate old empires
# pilgrimage_intent.1100 - Reflection - Personal reflections
# pilgrimage_intent.1110 - Reflection/Zealot/Altruism - Sea: Sea legs
# pilgrimage_intent.9000 - Zealot - A local heathen is smitten with one of your entourage members and asks to marry them
#
#

# Missionary, console a local
# by James Beaumont
pilgrimage_intent.1000 = {
	type = character_event
	title = pilgrimage_intent.1000.t
	desc = pilgrimage_intent.1000.desc
	theme = travel_pilgrimage
	left_portrait = {
		character = root
		animation = personality_zealous
	}
	right_portrait = {
		character = scope:sad_peasant
		animation = sadness
	}
	cooldown = { years = 2 }
	trigger = {
		is_location_valid_for_travel_event_on_land = yes
		root.location.faith != root.faith
		has_activity_intent = zealot_intent
	}
	immediate = {
		create_character = {
			location = root.location
			dynasty = none
			culture = root.location.culture
			faith = root.location.faith
			template = peasant_character
			gender_female_chance = 50
			after_creation = {
				set_to_lowborn = yes
			}
			save_scope_as = sad_peasant
		}
	}
	option = { # Console and convert them
		name = {
			text = {
				first_valid = {
					triggered_desc = {
						trigger = { 
							root.faith.religion != scope:sad_peasant.faith.religion
						}
						desc = pilgrimage_intent.1000.a
					}
					desc = pilgrimage_intent.1000.a.alternate
				}
			}
		}
		pious_type_option_effect = yes
		duel = {
			skills = { diplomacy learning }
			target = scope:sad_peasant
			50 = { # You convert them!
				desc = pilgrimage_intent.1000.a.conversion_succesful.desc
				compare_modifier = {
					value = scope:duel_value
					multiplier = 0.5
				}
				modifier = {
					has_perk = zealous_proselytizer_perk
					add = 25
				}
				modifier = {
					has_trait = zealous
					add = 25
				}
				send_interface_toast = {
					title = pilgrimage_intent.1000.a.conversion_succesful.t
					left_icon = root
					right_icon = scope:sad_peasant
					scope:sad_peasant = {
						set_character_faith = root.faith
					}
					set_relation_friend = {
						target = scope:sad_peasant
						reason = friend_consoled_me
					}
					add_piety = minor_piety_gain
				}
			}
			50 = { # You fail
				desc = pilgrimage_intent.1000.a.conversion_failed.desc
				compare_modifier = {
					value = scope:duel_value
					multiplier = -0.5
				}
				send_interface_toast = {
					title = pilgrimage_intent.1000.a.conversion_failed.t
					left_icon = root
					right_icon = scope:sad_peasant
					set_relation_rival = {
						target = scope:sad_peasant
						reason = rival_tried_to_convert_me
					}
					add_piety = minor_piety_loss
				}
			}
		}
		stress_impact = {
			shy = minor_stress_impact_gain
			cynical = minor_stress_impact_gain
			callous = minor_stress_impact_gain
			sadistic = minor_stress_impact_gain
		}
		ai_chance = {
			base = 10
			ai_value_modifier = {
				ai_zeal = 1
				ai_boldness = 0.5
			}
		}
	}
	# Console, convert, and recruit them to your pilgrimage
	option = { 
		name = pilgrimage_intent.1000.b
		pious_type_option_effect = yes
		duel = {
			skill = diplomacy
			target = scope:sad_peasant
			50 = { # You convert them!
				desc = pilgrimage_intent.1000.b.joined.desc
				compare_modifier = {
					value = scope:duel_value
					multiplier = 0.5
				}
				modifier = {
					has_perk = zealous_proselytizer_perk
					add = 25
				}
				modifier = {
					has_trait = zealous
					add = 25
				}
				send_interface_toast = {
					title = pilgrimage_intent.1000.b.joined.t
					left_icon = root
					right_icon = scope:sad_peasant
					scope:sad_peasant = {
						set_character_faith = root.faith
					}
					set_relation_friend = {
						target = scope:sad_peasant
						reason = friend_consoled_me
					}
				}
				#Putting here as to not cut off toast
				add_to_entourage_court_and_activity_effect = { 
					CHAR_TO_ADD = scope:sad_peasant 
					NEW_COURT_OWNER = root 
				}
			}
			50 = { # You fail
				desc = pilgrimage_intent.1000.b.not_joined.desc
				compare_modifier = {
					value = scope:duel_value
					multiplier = -0.5
				}
				send_interface_toast = {
					title = pilgrimage_intent.1000.b.not_joined.t
					left_icon = root
					right_icon = scope:sad_peasant
					set_relation_rival = {
						target = scope:sad_peasant
						reason = rival_tried_to_convert_me
					}
					add_piety = medium_piety_loss
				}
			}
		}
		stress_impact = {
			shy = minor_stress_impact_gain
			callous = minor_stress_impact_gain
			sadistic = minor_stress_impact_gain
			paranoid = medium_stress_impact_gain
		}
		ai_chance = {
			base = 10
			ai_value_modifier = {
				ai_sociability = 1
				ai_boldness = 0.5
			}
		}
	}
	# Dismiss them
	option = { 
		name = pilgrimage_intent.1000.c
		scope:sad_peasant = {
			silent_disappearance_effect = yes
		}
		stress_impact = {
			zealous = minor_stress_impact_gain
			gregarious = minor_stress_impact_gain
			compassionate = minor_stress_impact_gain
		}
		ai_chance = {
			base = 10
			ai_value_modifier = {
				ai_sociability = -1
				ai_compassion = -1
			}
		}
	}

	after = {
		scope:sad_peasant = {
			if = {
				limit = {
					NOT = {
						has_relation_friend = root
					}
					root = { is_ai = yes }
					is_alive = yes
				}
				silent_disappearance_effect = yes
			}
		}
	}
}

# Missionary, convert a child
# by James Beaumont
pilgrimage_intent.1001 = {
	type = character_event
	title = pilgrimage_intent.1001.t
	desc = pilgrimage_intent.1001.desc
	theme = travel_pilgrimage
	left_portrait = {
		character = root
		animation = personality_zealous
	}
	right_portrait = {
		character = scope:impressionable_child
		animation = happiness
	}
	cooldown = { years = 2 }
	trigger = {
		is_location_valid_for_travel_event_on_land = yes
		is_adult = yes
		root.location.faith != root.faith
		has_activity_intent = zealot_intent
		location.county.holder ?= {
			is_ai = yes
			this != root
			any_child = {
				age > 5
				is_adult = no
				location = prev.location #County holder
				is_ai = yes
				is_landed = no
				is_travelling = no
				NOT = {
					has_trait = zealous
					faith = root.faith
				}
			}
		}
		num_of_relation_ward < 2
	}
	immediate = {
		location.county.holder = {
			save_scope_as = location_holder
			random_child = {
				limit = {
					age > 5
					is_adult = no
					location = scope:location_holder.location
					is_ai = yes
					is_landed = no
					is_travelling = no
					NOT = {
						has_trait = zealous
						faith = root.faith
					}
				}
				save_scope_as = impressionable_child
			}
		}
	}
	option = { # Tell the child cool religious stories
		name = pilgrimage_intent.1001.a
		pious_type_option_effect = yes
		duel = {
			skills = { diplomacy learning }
			value = medium_skill_rating
			50 = { # You convert them!
				desc = pilgrimage_intent.1001.a.conversion_succesful.desc
				compare_modifier = {
					value = scope:duel_value
					multiplier = 0.5
				}
				modifier = {
					has_perk = zealous_proselytizer_perk
					add = 25
				}
				modifier = {
					has_trait = zealous
					add = 25
				}
				send_interface_toast = {
					title = pilgrimage_intent.1001.a.conversion_succesful.t
					left_icon = root
					right_icon = scope:impressionable_child
					add_piety = minor_piety_gain
				}
				#Putting here as to not cut off toast
				scope:impressionable_child = {
					set_relation_guardian = root
					set_character_faith = root.faith
				}
				add_to_entourage_court_and_activity_effect = { 
					CHAR_TO_ADD = scope:impressionable_child 
					NEW_COURT_OWNER = root 
				}
			}
			50 = { # You fail
				desc = pilgrimage_intent.1001.a.conversion_failed.desc
				compare_modifier = {
					value = scope:duel_value
					multiplier = -0.5
				}
				send_interface_toast = {
					title = pilgrimage_intent.1001.a.conversion_failed.t
					left_icon = root
					right_icon = scope:impressionable_child
					add_piety = minor_piety_loss
				}
			}
		}
		progress_towards_rival_effect = {
			REASON = rival_attempted_to_convert_my_child
			CHARACTER = scope:location_holder
			OPINION = default_rival_opinion
		}
		stress_impact = {
			shy = minor_stress_impact_gain
			cynical = minor_stress_impact_gain
			callous = minor_stress_impact_gain
			sadistic = minor_stress_impact_gain
		}
		ai_chance = {
			base = 10
			ai_value_modifier = {
				ai_zeal = 1
				ai_boldness = 0.5
			}
		}
	}
	# Dismiss them
	option = { 
		name = pilgrimage_intent.1001.b
		stress_impact = {
			zealous = minor_stress_impact_gain
			gregarious = medium_stress_impact_gain
			compassionate = medium_stress_impact_gain
		}
		ai_chance = {
			base = 10
			ai_value_modifier = {
				ai_sociability = -1
				ai_compassion = -1
			}
		}
	}
}

# Local courtier is passing by, convert them and bring them on your pilgrimage!
# by James Beaumont
pilgrimage_intent.1010 = {
	type = character_event
	title = pilgrimage_intent.1010.t
	desc = pilgrimage_intent.1010.desc
	theme = travel_pilgrimage
	left_portrait = {
		character = root
		animation = personality_zealous
	}
	right_portrait = {
		character = scope:convertable_courtier
		animation = thinking
	}
	lower_right_portrait = {
		character = scope:county_holder
	}
	cooldown = { years = 2 }
	trigger = {
		has_activity_intent = zealot_intent
		location.county.holder ?= {
			NOR = {
				this = root
				faith = root.faith
			}
			any_courtier = {
				is_available_ai_adult = yes
				location = root.location
				is_landed = no
				NOR = {
					is_child_of = prev #County holder
					is_consort_of = prev #County holder
					has_trait = devoted
					faith = root.faith
				}
			}
		}
	}
	immediate = {
		location.county.holder = {
			save_scope_as = county_holder
			random_courtier = {
				limit = {
					is_available_ai_adult = yes
					location = root.location
					is_landed = no
					NOR = {
						is_child_of = scope:county_holder
						is_consort_of = scope:county_holder
						has_trait = devoted
						faith = root.faith
					}
				}
				weight = { # Try to find someone cool
					base = 1
					modifier = {
						factor = 10
						is_claimant = yes
					}
					modifier = {
						factor = 10
						OR = {
							diplomacy >= high_skill_rating
							stewardship >= high_skill_rating
							learning >= high_skill_rating
							martial >= high_skill_rating
							intrigue >= high_skill_rating
							prowess >= high_skill_rating
						}
					}
					modifier = {
						is_of_major_or_minor_interest_trigger = { CHARACTER = scope:county_holder }
						add = 4
					}
				}
				save_scope_as = convertable_courtier
			}
		}
	}
	option = { # Attempt to convert the courtier
		name = pilgrimage_intent.1010.a
		pious_type_option_effect = yes
		duel = {
			skills = { diplomacy learning }
			target = scope:convertable_courtier
			50 = { # You convert them!
				desc = pilgrimage_intent.1010.a.conversion_succesful.desc
				compare_modifier = {
					value = scope:duel_value
					multiplier = 0.5
				}
				modifier = {
					has_perk = zealous_proselytizer_perk
					add = 25
				}
				modifier = {
					has_trait = zealous
					add = 25
				}
				send_interface_toast = {
					title = pilgrimage_intent.1010.a.conversion_succesful.t
					left_icon = root
					right_icon = scope:convertable_courtier
					scope:convertable_courtier = {
						set_character_faith = root.faith
						add_character_flag = {
							flag = blocked_from_leaving
							years = 5
						}
					}
					add_piety = minor_piety_gain
				}
				#Putting here as to not cut off toast
				add_to_entourage_court_and_activity_effect = { 
					CHAR_TO_ADD = scope:convertable_courtier
					NEW_COURT_OWNER = root 
				}
				progress_towards_friend_effect = {
					REASON = friend_religious_revalation
					CHARACTER = scope:convertable_courtier
					OPINION = default_friend_opinion
				}
			}
			50 = { # You fail
				desc = pilgrimage_intent.1010.a.conversion_failed.desc
				compare_modifier = {
					value = scope:duel_value
					multiplier = -0.5
				}
				send_interface_toast = {
					title = pilgrimage_intent.1010.a.conversion_failed.t
					left_icon = root
					right_icon = scope:convertable_courtier
					add_piety = minor_piety_loss
				}
			}
		}
		progress_towards_rival_effect = {
			REASON = rival_stole_my_courtier
			CHARACTER = scope:county_holder
			OPINION = default_rival_opinion
		}
		stress_impact = {
			shy = minor_stress_impact_gain
			cynical = minor_stress_impact_gain
			callous = minor_stress_impact_gain
			sadistic = minor_stress_impact_gain
		}
		ai_chance = {
			base = 10
			ai_value_modifier = {
				ai_zeal = 1
				ai_boldness = 0.5
			}
		}
	}
	option = { # Who cares
		name = pilgrimage_intent.1010.b
		stress_impact = {
			zealous = minor_stress_impact_gain
			gregarious = medium_stress_impact_gain
			compassionate = medium_stress_impact_gain
		}
		ai_chance = {
			base = 10
			ai_value_modifier = {
				ai_sociability = -1
				ai_compassion = -1
			}
		}
	}
}

# Fellow pilgrims of a different faith are on your path
# by James Beaumont
pilgrimage_intent.1020 = {
	type = character_event
	title = pilgrimage_intent.1020.t
	desc = pilgrimage_intent.1020.desc
	theme = travel_pilgrimage
	left_portrait = {
		character = root
		animation = thinking
	}
	right_portrait = {
		character = scope:pilgrim_character
		animation = happiness
	}
	cooldown = { years = 2 }
	trigger = {
		has_activity_intent = zealot_intent
		any_religion_global = {
			any_faith = {
				root.involved_activity.activity_location.barony = {
					is_holy_site_of = prev #The faith
				}
				this != root.faith
				NOT = { has_doctrine_parameter = forbidden_from_pilgrimage }
				# Don't grab dead religions
				num_character_followers >= 5
			}
		}
	}
	immediate = {
		random_religion_global = {
			limit = {
				any_faith = {
					root.involved_activity.activity_location.barony = {
						is_holy_site_of = prev #The faith
					}
					this != root.faith
					NOT = { has_doctrine_parameter = forbidden_from_pilgrimage }
					# Don't grab dead religions
					num_character_followers >= 5
				}
			}
			random_faith = {
				limit = {
					root.involved_activity.activity_location.barony = {
						is_holy_site_of = prev #The faith
					}
					this != root.faith
					NOT = { has_doctrine_parameter = forbidden_from_pilgrimage }
					# Don't grab dead religions
					num_character_followers >= 5
				}
				save_scope_as = pilgrim_faith
				random_faith_character = { save_scope_as = base_character }
			}
		}
		create_character = {
			location = root.location
			culture = scope:base_character.culture
			faith = scope:pilgrim_faith
			template = pilgrim_character
			gender_female_chance = 50
			save_scope_as = pilgrim_character
		}
	}
	option = { # That's cool, let me tell you about MY religion!
		name = pilgrimage_intent.1020.a
		pious_type_option_effect = yes
		duel = {
			skills = { diplomacy learning }
			target = scope:pilgrim_character
			50 = { # You convert them!
				desc = pilgrimage_intent.1020.a.conversion_succesful.desc
				compare_modifier = {
					value = scope:duel_value
					multiplier = 0.5
				}
				modifier = {
					has_perk = zealous_proselytizer_perk
					add = 25
				}
				modifier = {
					has_trait = zealous
					add = 25
				}
				send_interface_toast = {
					title = pilgrimage_intent.1020.a.conversion_succesful.t
					left_icon = root
					right_icon = scope:pilgrim_character
					add_piety = minor_piety_gain
				}
				#Putting here as to not cut off toast
				scope:pilgrim_character = {
					set_character_faith = root.faith
				}
				set_relation_friend = {
					target = scope:pilgrim_character
					reason = friend_religious_revalation
				}
			}
			50 = { # You fail
				desc = pilgrimage_intent.1020.a.conversion_failed.desc
				compare_modifier = {
					value = scope:duel_value
					multiplier = -0.5
				}
				send_interface_toast = {
					title = pilgrimage_intent.1020.a.conversion_failed.t
					left_icon = root
					right_icon = scope:pilgrim_character
				}
				#Putting here as to not cut off toast
				set_relation_rival = {
					target = scope:pilgrim_character
					reason = rival_tried_to_convert_me
				}
			}
		}
		stress_impact = {
			gregarious = minor_stress_impact_gain
			cynical = minor_stress_impact_gain
			zealous = minor_stress_impact_loss
		}
		ai_chance = {
			base = 10
			ai_value_modifier = {
				ai_zeal = 1
				ai_sociability = 1
				ai_compassion = -1
			}
		}
	}
	option = { # Take an interest, gain conversion bonus
		name = pilgrimage_intent.1020.b
		set_variable = {
			name = discounted_faith_to_convert_to_var
			value = scope:pilgrim_character.faith
		}
		scope:pilgrim_character = { custom_tooltip = cheaper_to_convert_to_pilgrim_faith_tt }
		add_piety = medium_piety_loss
		stress_impact = {
			zealous = medium_stress_impact_gain
			shy = minor_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				factor = 0
				has_trait = zealous
			}
			ai_value_modifier = {
				ai_zeal = -1
			}
		}
	}
	option = { # We're not so different, come with me!
		name = pilgrimage_intent.1020.c
		worldly_type_option_effect = yes
		scope:pilgrim_character = {
			add_character_flag = {
				flag = blocked_from_leaving
				years = 5
			}
		}
		add_to_entourage_court_and_activity_effect = { 
			CHAR_TO_ADD = scope:pilgrim_character 
			NEW_COURT_OWNER = root 
		}
		random_list = {
			25 = {
				modifier = {
					factor = 2
					num_of_relation_friend < 1
				}
				modifier = {
					factor = 0.5
					any_relation = { type = friend }
				}
				set_relation_friend = {
					target = scope:pilgrim_character
					reason = friend_religious_understanding
				}
			}
			50 = {
				#Nothing happens
			}
		}
		stress_impact = {
			zealous = minor_stress_impact_gain
			shy = medium_stress_impact_gain
			paranoid = medium_stress_impact_gain
		}
		ai_chance = {
			base = 10
			ai_value_modifier = {
				ai_sociability = 1
				ai_zeal = -1
			}
		}
	}
	after = {
		scope:pilgrim_character = {
			silent_disappearance_ai_effect = yes
		}
	}
}

# You see a particularly calm clearing along your way and stop to meditate
# by James Beaumont
pilgrimage_intent.1030 = {
	type = character_event
	title = pilgrimage_intent.1030.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = { 
					location = { is_sea_province = yes } 
				}
				desc = pilgrimage_intent.1030.desc_sea
			}
			desc = pilgrimage_intent.1030.desc
		}
	}
	theme = travel_pilgrimage
	left_portrait = {
		character = root
		animation = personality_zealous
	}
	cooldown = { years = 2 }
	trigger = {
		has_activity_intent = reflection_intent
	}
	immediate = {
		mp_delay_travel_plan = { DAYS = 90 }
	}
	option = { # Contemplate God
		name = pilgrimage_intent.1030.a
		pious_type_option_effect = yes
		current_travel_plan = {
			delay_travel_plan = { days = 10 }
		}
		if = {
			limit = {
				NOT = { has_trait = pilgrim }
			}
			add_piety = minor_piety_gain
		}
		else_if = {
			limit = {
				has_trait = pilgrim
				has_trait_xp = {
					trait = pilgrim
					value < 100
				}
			}
			add_trait_xp = {
				trait = pilgrim
				value = 10
			}
		}
		else = {
			add_piety = medium_piety_gain
		}
		if = {
			limit = {
				has_trait = lifestyle_mystic
			}
			add_trait_xp = {
				trait = lifestyle_mystic
				value = lifestyle_mystic_xp_gain_minor_value
			}
		}
		stress_impact = {
			base = minor_stress_impact_loss
			impatient = minor_stress_impact_gain
			cynical = minor_stress_impact_gain
		}
		ai_chance = {
			base = 10
			ai_value_modifier = {
				ai_zeal = 1
				ai_sociability = -1
			}
		}
	}
	option = { # We cannot delay!
		name = pilgrimage_intent.1030.b
		stress_impact = {
			lazy = minor_stress_impact_gain
			zealous = medium_stress_impact_gain
			patient = medium_stress_impact_gain
		}
		ai_chance = {
			base = 10
			ai_value_modifier = {
				ai_zeal = -1
			}
		}
	}
	after = {
		mp_resume_travel_plan = yes
	}
}

# You spot an animal, follow it for an omen?
# by James Beaumont
pilgrimage_intent.1040 = {
	type = character_event
	title = pilgrimage_intent.1040.t
	desc = {
		desc = pilgrimage_intent.1040.desc.intro
		first_valid = {
			triggered_desc = {
				trigger = {
					exists = var:predator_omen
				}
				desc = pilgrimage_intent.1040.desc.mid.pred
			}
			triggered_desc = {
				trigger = {
					exists = var:prey_omen
				}
				desc = pilgrimage_intent.1040.desc.mid.prey
			}
		}
		desc = pilgrimage_intent.1040.desc.outro
	}
	theme = travel_pilgrimage
	left_portrait = {
		character = root
		animation = personality_zealous
	}
	cooldown = { years = 2 }
	trigger = {
		has_activity_intent = reflection_intent
		location = { is_sea_province = no }
		NOR = {
			has_character_modifier = pilgrimage_combat_omen_modifier
			has_character_modifier = pilgrimage_hostile_omen_modifier
			has_character_modifier = pilgrimage_failure_omen_modifier
			has_character_modifier = pilgrimage_watchful_omen_modifier
			has_character_modifier = pilgrimage_horny_omen_modifier
			has_character_modifier = pilgrimage_family_omen_modifier
			has_character_modifier = pilgrimage_hostile_omen_modifier
		}
	}

	immediate = {
		wayfarer_storyteller_fame_effect = { VALUE = roaming_reward_fame_small }
		mp_delay_travel_plan = { DAYS = 90 }
		hidden_effect = {
			random_list = {
				50 = {
					set_variable = {
						name = predator_omen
						years = 1
					}
					select_local_animal_effect = { TYPE = dangerous } # Save scope to limit possible animals: any/big/small/dangerous/harmless/prowling
				}
				50 = {
					set_variable = {
						name = prey_omen
						years = 1
					}
					select_local_animal_effect = { TYPE = harmless } # Save scope to limit possible animals: any/big/small/dangerous/harmless/prowling
				}
			}
		}
	}
	option = { # Follow that creature!
		name = pilgrimage_intent.1040.a
		pious_type_option_effect = yes
		current_travel_plan = {
			delay_travel_plan = { days = 10 }
		}
		add_piety = minor_piety_gain
		custom_tooltip = you_follow_the_animal_tt
		hidden_effect = {
			random_list = {
				50 = { # Positive omen (predator)
					trigger = {
						exists = var:predator_omen
					}
					trigger_event = pilgrimage_intent.1041
				}
				50 = { # Negative omen (predator)
					trigger = {
						exists = var:predator_omen
					}
					trigger_event = pilgrimage_intent.1042
				}
				50 = { # Positive omen (prey)
					trigger = {
						exists = var:prey_omen
					}
					trigger_event = pilgrimage_intent.1043
				}
				50 = { # Negative omen (prey)
					trigger = {
						exists = var:predator_omen
					}
					trigger_event = pilgrimage_intent.1044
				}
				50 = { # You lose the animal
					send_interface_toast = {
						type = event_toast_text_neutral
						title = pilgrimage.you_lose_the_animal.t
						desc = pilgrimage.you_lose_the_animal.desc
						left_icon = root
					}
				}
			}
		}
		stress_impact = {
			base = minor_stress_impact_loss
			lazy = minor_stress_impact_gain
			impatient = minor_stress_impact_gain
			craven = minor_stress_impact_gain
			paranoid = minor_stress_impact_gain
		}
		ai_chance = {
			base = 10
			ai_value_modifier = {
				ai_zeal = 1
				ai_sociability = -1
				ai_energy = 1
			}
		}
	}
	option = { # We cannot delay!
		name = pilgrimage_intent.1040.b
		stress_impact = {
			zealous = medium_stress_impact_gain
			patient = medium_stress_impact_gain
			lifestyle_hunter = medium_stress_impact_gain
		}
		ai_chance = {
			base = 10
			ai_value_modifier = {
				ai_zeal = -1
				ai_energy = -1
			}
		}
	}
	after = {
		mp_resume_travel_plan = yes
	}
}

# Good omen (predator)
# by James Beaumont
pilgrimage_intent.1041 = {
	type = character_event
	title = pilgrimage_intent.1041.t
	desc = {
		desc = pilgrimage_intent.1041.desc.intro
		desc = pilgrimage_intent.1041.desc.mid
		desc = pilgrimage_intent.1041.desc.outro
	}
	theme = travel_pilgrimage
	left_portrait = {
		character = root
		animation = shock
	}
	immediate = {
		if = {
			limit = {
				has_trait = pilgrim
			}
			add_trait_xp = {
				trait = pilgrim
				value = 10
			}
		}
		else = {
			add_piety = miniscule_piety_gain
		}
		create_character_memory = {
			type = good_predator_omen_memory
		}
	}
	option = { # It must mean I will be succesful in combat!
		name = pilgrimage_intent.1041.a
		add_character_modifier = {
			modifier = pilgrimage_combat_omen_modifier
			years = 20
		}
		stress_impact = {
			base = minor_stress_impact_loss
			paranoid = minor_stress_impact_loss
			brave = minor_stress_impact_gain
			trusting = minor_stress_impact_gain
		}
		ai_chance = {
			base = 10
		}
	}
	option = { # It means my "hunt" will be succesful!
		name = pilgrimage_intent.1041.b
		add_character_modifier = {
			modifier = pilgrimage_hostile_omen_modifier
			years = 20
		}
		stress_impact = {
			base = minor_stress_impact_loss
			paranoid = medium_stress_impact_gain
			craven = medium_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				factor = 0
				OR = {
					has_trait = paranoid
					has_trait = craven
				}
			}
		}
	}
}

# Bad omen (predator)
# by James Beaumont
pilgrimage_intent.1042 = {
	type = character_event
	title = pilgrimage_intent.1042.t
	desc = {
		desc = pilgrimage_intent.1041.desc.intro
		desc = pilgrimage_intent.1042.desc.mid
		desc = pilgrimage_intent.1041.desc.outro
	}
	theme = travel_pilgrimage
	left_portrait = {
		character = root
		animation = fear
	}
	option = { # It must mean I will fail.
		name = pilgrimage_intent.1042.a
		add_character_modifier = {
			modifier = pilgrimage_failure_omen_modifier
			years = 10
		}
		create_character_memory = {
			type = bad_predator_omen_memory
		}
		stress_impact = {
			base = medium_stress_impact_gain
			cynical = minor_stress_impact_loss
			brave = minor_stress_impact_gain
			trusting = minor_stress_impact_gain
		}
		ai_chance = {
			base = 10
		}
	}
	option = { # It means I will escape a scheme against me!
		name = pilgrimage_intent.1042.b
		trigger = {
			has_trait = lifestyle_mystic
		}
		add_character_modifier = {
			modifier = pilgrimage_watchful_omen_modifier
			years = 20
		}
		create_character_memory = {
			type = good_predator_omen_memory
		}
		stress_impact = {
			base = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
		}
	}
}

# Good omen (prey)
# by James Beaumont
pilgrimage_intent.1043 = {
	type = character_event
	title = pilgrimage_intent.1043.t
	desc = {
		desc = pilgrimage_intent.1043.desc.intro
		desc = pilgrimage_intent.1043.desc.mid
		desc = pilgrimage_intent.1041.desc.outro
	}
	theme = travel_pilgrimage
	left_portrait = {
		character = root
		animation = shock
	}
	immediate = {
		if = {
			limit = {
				has_trait = pilgrim
				has_trait_xp = {
					trait = pilgrim
					value < 100
				}
			}
			add_trait_xp = {
				trait = pilgrim
				value = 10
			}
		}
		create_character_memory = {
			type = good_prey_omen_memory
		}
	}
	option = { # It must mean a new child is on its way!
		name = pilgrimage_intent.1043.a
		trigger = {
			fertility >= 0.1
		}
		show_unlock_reason = no
		add_character_modifier = {
			modifier = pilgrimage_horny_omen_modifier
			years = 20
		}
		stress_impact = {
			base = minor_stress_impact_loss
			lustful = minor_stress_impact_loss
			chaste = minor_stress_impact_gain
		}
		ai_chance = {
			base = 10
		}
	}
	option = { # It must mean I should bury the hatchet with an old rival
		name = pilgrimage_intent.1043.b
		trigger = {
			any_relation = { type = rival }
		}
		show_unlock_reason = no
		random_relation = {
			type = rival
			remove_relation_rival = root
		}
		stress_impact = {
			base = minor_stress_impact_loss
			forgiving = major_stress_impact_loss
			paranoid = minor_stress_impact_gain
			callous = minor_stress_impact_gain
			sadistic = minor_stress_impact_gain
			vengeful = major_stress_impact_gain
		}
		ai_chance = {
			base = 10
		}
	}
	option = { # It means I should spend more time with my family
		name = pilgrimage_intent.1043.c
		add_character_modifier = {
			modifier = pilgrimage_family_omen_modifier
			years = 20
		}
		stress_impact = {
			base = minor_stress_impact_loss
			paranoid = medium_stress_impact_gain
			craven = medium_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				factor = 0
				OR = {
					has_trait = paranoid
					has_trait = craven
				}
			}
		}
	}
}

# Bad omen (prey)
# by James Beaumont
pilgrimage_intent.1044 = {
	type = character_event
	title = pilgrimage_intent.1044.t
	desc = {
		desc = pilgrimage_intent.1043.desc.intro
		desc = pilgrimage_intent.1044.desc.mid
		desc = pilgrimage_intent.1041.desc.outro
	}
	theme = travel_pilgrimage
	left_portrait = {
		character = root
		animation = fear
	}
	option = { # It must mean something is coming for me!
		name = pilgrimage_intent.1044.a
		add_character_modifier = {
			modifier = pilgrimage_failure_omen_modifier
			years = 20
		}
		create_character_memory = {
			type = bad_prey_omen_memory
		}
		stress_impact = {
			base = medium_stress_impact_gain
			cynical = minor_stress_impact_loss
			brave = minor_stress_impact_gain
			trusting = minor_stress_impact_gain
		}
		ai_chance = {
			base = 10
		}
	}
	option = { # It means I will fell my enemies!
		name = pilgrimage_intent.1044.b
		trigger = {
			has_trait = lifestyle_mystic
		}
		add_character_modifier = {
			modifier = pilgrimage_hostile_omen_modifier
			years = 20
		}
		create_character_memory = {
			type = bad_but_good_prey_omen_memory
		}
		stress_impact = {
			base = minor_stress_impact_loss
			brave = minor_stress_impact_loss
			compassionate = minor_stress_impact_gain
			forgiving = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
		}
	}
}

# You stop to contemplate on your age
# by James Beaumont
pilgrimage_intent.1050 = {
	type = character_event
	title = pilgrimage_intent.1050.t
	desc = {
		desc = pilgrimage_intent.1050.desc.intro
		first_valid = {
			triggered_desc = {
				trigger = {
					age >= 50
				}
				desc = pilgrimage_intent.1050.desc.mid.old
			}
			triggered_desc = {
				trigger = {
					age <= 30
					health <= poor_health
				}
				desc = pilgrimage_intent.1050.desc.mid.young_and_dying
			}
			triggered_desc = {
				trigger = {
					age <= 30
				}
				desc = pilgrimage_intent.1050.desc.mid.young
			}
		}
		desc = pilgrimage_intent.1050.desc.outro
	}
	theme = travel_pilgrimage
	left_portrait = {
		character = root
		animation = thinking
	}
	cooldown = { years = 2 }
	trigger = {
		has_activity_intent = reflection_intent
		OR = {
			age >= 50
			age <= 30
		}
		location = { is_sea_province = no }
		NOR = {
			has_character_modifier = determination_modifier
			has_character_modifier = determined_to_live_modifier
		}
	}
	immediate = {
		mp_delay_travel_plan = { DAYS = 90 }
	}
	option = { # I should contemplate the brevity of life
		name = pilgrimage_intent.1050.a
		pious_type_option_effect = yes
		current_travel_plan = {
			delay_travel_plan = { days = 10 }
		}
		duel = {
			skill = learning
			value = decent_skill_rating
			# Success.
			60 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 0.5
				}
				send_interface_toast = {
					title = pilgrimage.drive_to_succeed.t
					left_icon = root
					add_stress = medium_stress_loss
					add_character_modifier = {
						modifier = determination_modifier
						years = 25
					}
					add_piety = minor_piety_gain
					if = {
						limit = {
							has_trait = lifestyle_mystic
						}
						add_trait_xp = {
							trait = lifestyle_mystic
							value = lifestyle_mystic_xp_gain_minor_value
						}
					}
				}
			}
			# Failure.
			40 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -0.5
				}
				send_interface_toast = {
					type = event_toast_text_and_effect_bad
					title = pilgrimage.existential_dread.t
					desc = pilgrimage.existential_dread.desc
					left_icon = root
					add_stress = medium_stress_gain
				}
			}
		}
		stress_impact = {
			# I don't wanna meditate
			impatient = minor_stress_impact_gain
			# Existentialism makes me upset
			craven = minor_stress_impact_gain
			ambitious = minor_stress_impact_gain
		}
		ai_chance = {
			base = 10
			ai_value_modifier = {
				ai_zeal = 1
				ai_sociability = -1
				ai_energy = 1
			}
		}
	}
	option = { # I-I don't want to die!
		name = pilgrimage_intent.1050.b
		trigger = {
			OR = {
				age >= 50
				health <= poor_health
			}
		}
		current_travel_plan = {
			delay_travel_plan = { days = 10 }
		}
		duel = {
			skill = learning
			value = decent_skill_rating
			# Success.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 0.5
				}
				send_interface_toast = {
					type = event_toast_text_and_effect_good
					title = pilgrimage.drive_to_survive.t
					desc = pilgrimage.drive_to_survive.desc
					left_icon = root
					add_stress = minor_stress_loss
					add_character_modifier = {
						modifier = determined_to_live_modifier
						years = 15
					}
				}
			}
			# Failure.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -0.5
				}
				send_interface_toast = {
					type = event_toast_text_and_effect_bad
					title = pilgrimage.existential_dread.t
					desc = pilgrimage.existential_dread.desc
					left_icon = root
					add_stress = minor_stress_gain
				}
			}
		}
		stress_impact = {
			# I don't wanna meditate
			impatient = minor_stress_impact_gain
			# I'm okay with dying
			content = medium_stress_impact_gain
			depressed_1 = medium_stress_impact_gain
			depressed_genetic = medium_stress_impact_gain
			infirm = medium_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				factor = 0
				OR = {
					has_trait = content
					has_trait = depressed_1
					has_trait = depressed_genetic
					has_trait = infirm
				}
			}
			ai_value_modifier = {
				ai_zeal = -1
				ai_energy = 1
			}
		}
	}
	option = { # I can't think about that right now
		name = pilgrimage_intent.1050.c
		stress_impact = {
			zealous = minor_stress_impact_gain
			patient = minor_stress_impact_gain
		}
		ai_chance = {
			base = 10
			ai_value_modifier = {
				ai_zeal = -1
				ai_energy = -1
			}
		}
	}
	after = {
		mp_resume_travel_plan = yes
	}
}

# You stop to contemplate ancient civilizations
# by James Beaumont
pilgrimage_intent.1060 = {
	type = character_event
	title = pilgrimage_intent.1060.t
	desc = {
		desc = pilgrimage_intent.1060.desc.intro
		random_valid = { # Some locations could be part of multiple ancient empires
			triggered_desc = {
				trigger = {
					location = {
						geographical_region = custom_roman_full_borders
					}
				}
				desc = pilgrimage_intent.1060.desc.mid.rome
			}
			triggered_desc = {
				trigger = {
					location = {
						geographical_region = ghw_region_jerusalem
					}
				}
				desc = pilgrimage_intent.1060.desc.mid.israel
			}
			triggered_desc = {
				trigger = {
					location = {
						geographical_region = ghw_region_egypt
					}
				}
				desc = pilgrimage_intent.1060.desc.mid.egypt
			}
			triggered_desc = {
				trigger = {
					location = {
						geographical_region = world_persian_empire
					}
				}
				desc = pilgrimage_intent.1060.desc.mid.persia
			}
			triggered_desc = {
				trigger = {
					location = {
						OR = {
							geographical_region = world_india_bengal
							geographical_region = world_india_rajastan
						}
					}
				}
				desc = pilgrimage_intent.1060.desc.mid.ashokas_pillars
			}
			triggered_desc = {
				trigger = {
					location = {
						geographical_region = world_africa_east
					}
				}
				desc = pilgrimage_intent.1060.desc.mid.kush
			}
			triggered_desc = {
				trigger = {
					location = {
						NOR = {
							geographical_region = custom_roman_full_borders
							geographical_region = ghw_region_jerusalem
							geographical_region = ghw_region_egypt
							geographical_region = world_persian_empire
							geographical_region = world_india_bengal
							geographical_region = world_india_rajastan
							geographical_region = world_africa_east
						}
					}
				}
				desc = pilgrimage_intent.1060.desc.mid.fallback
			}
		}
		desc = pilgrimage_intent.1060.desc.outro
	}
	theme = pilgrimage_destination
	left_portrait = {
		character = root
		animation = thinking
	}
	cooldown = { years = 2 }
	trigger = {
		has_activity_intent = reflection_intent
		location = { is_sea_province = no }
		NOR = {
			has_character_modifier = imperial_contemplation_modifier
			has_character_modifier = contemplated_ancient_gods_modifier
		}
	}
	immediate = {
		mp_delay_travel_plan = { DAYS = 90 }
	}
	option = { # I should contemplate the nature of empires
		name = pilgrimage_intent.1060.a
		worldly_type_option_effect = yes
		current_travel_plan = {
			delay_travel_plan = { days = 10 }
		}
		add_piety = minor_piety_gain
		duel = {
			skill = learning
			value = decent_skill_rating
			# Success.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 0.5
				}
				send_interface_toast = {
					type = event_toast_text_and_effect_good
					title = pilgrimage.imperial_contemplation.t
					desc = pilgrimage.imperial_contemplation.desc
					left_icon = root
					add_stress = medium_stress_loss
					add_character_modifier = {
						modifier = imperial_contemplation_modifier
						years = 15
					}
				}
			}
			# Failure.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -0.5
				}
				send_interface_toast = {
					type = event_toast_text_bad
					title = pilgrimage.failed_contemplation.t
					desc = pilgrimage.failed_contemplation.desc
					left_icon = root
				}
			}
		}
		stress_impact = {
			base = minor_stress_impact_loss
			# I don't wanna meditate
			lazy = minor_stress_impact_gain
			impatient = minor_stress_impact_gain
		}
		ai_chance = {
			base = 10
			ai_value_modifier = {
				ai_zeal = 1
				ai_sociability = -1
				ai_energy = 1
			}
		}
	}
	option = { # I should contemplate the nature of God
		name = pilgrimage_intent.1060.b
		pious_type_option_effect = yes
		current_travel_plan = {
			delay_travel_plan = { days = 10 }
		}
		duel = {
			skill = learning
			value = decent_skill_rating
			# Success.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 0.5
				}
				send_interface_toast = {
					type = event_toast_text_and_effect_good
					title = pilgrimage.godly_meditation.t
					desc = pilgrimage.godly_meditation.desc
					left_icon = root
					add_character_modifier = {
						modifier = contemplated_ancient_gods_modifier
						years = 15
					}
					if = {
						limit = { 
							NOT = { has_perk = open_minded_perk } 
						}
						add_perk = open_minded_perk
					}
					add_piety = medium_piety_gain
					if = {
						limit = {
							has_trait = lifestyle_mystic
						}
						add_trait_xp = {
							trait = lifestyle_mystic
							value = lifestyle_mystic_xp_gain_minor_value
						}
					}
				}
			}
			# Failure.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -0.5
				}
				send_interface_toast = {
					type = event_toast_text_bad
					title = pilgrimage.failed_contemplation.t
					desc = pilgrimage.failed_contemplation.desc
					left_icon = root
				}
			}
		}
		stress_impact = {
			base = minor_stress_impact_loss
			# I don't wanna meditate
			lazy = minor_stress_impact_gain
			impatient = minor_stress_impact_gain
			# I don't care to think about Gods
			cynical = minor_stress_impact_gain
			arrogant = minor_stress_impact_gain
		}
		ai_chance = {
			base = 10
			ai_value_modifier = {
				ai_zeal = 1
				ai_sociability = -1
				ai_energy = 1
			}
		}
	}
	option = { # Nonsense, MY empire will last forever!
		name = pilgrimage_intent.1060.c
		trigger = {
			is_landless_adventurer = no
		}
		stress_impact = {
			zealous = medium_stress_impact_gain
			patient = medium_stress_impact_gain
		}
		ai_chance = {
			base = 10
			ai_value_modifier = {
				ai_zeal = -1
				ai_energy = -1
			}
		}
	}
	option = { # Let's just press on
		name = pilgrimage_intent.1001.b
		trigger = {
			has_government = landless_adventurer_government
		}
		stress_impact = {
			zealous = medium_stress_impact_gain
			patient = medium_stress_impact_gain
		}
		ai_chance = {
			base = 10
			ai_value_modifier = {
				ai_zeal = -1
				ai_energy = -1
			}
		}
	}
	after = {
		mp_resume_travel_plan = yes
	}
}

#Personal reflections
# by Petter Vilberg
pilgrimage_intent.1100 = {
	type = character_event
	title = pilgrimage_intent.1100.t
	desc = pilgrimage_intent.1100.desc
	theme = travel_pilgrimage
	left_portrait = {
		character = root
		animation = personality_content
	}
	cooldown = { years = 2 }
	trigger = {
		has_activity_intent = reflection_intent
	}
	# PantheonTerm would wish me to, of course
	option = { 
		name = pilgrimage_intent.1100.a
		pious_type_option_effect = yes
		add_character_modifier = {
			modifier = dedicated_to_pilgrimage_modifier
			years = 10
		}
		if = {
			limit = { 
				has_trait = pilgrim
				has_trait_xp = {
					trait = pilgrim
					value < 100
				}
			}
			add_trait_xp = {
				trait = pilgrim
				value = 5
			}
		}
		if = {
			limit = {
				has_trait = lifestyle_mystic
			}
			add_trait_xp = {
				trait = lifestyle_mystic
				value = lifestyle_mystic_xp_gain_minor_value
			}
		}
		stress_impact = {
			cynical = minor_stress_impact_gain
		}
		ai_chance = {
			base = 200
			modifier = {
				has_trait = cynical
				factor = 0
			}
			ai_value_modifier = {
				ai_zeal = 1
			}
		}
	}
	# I want to see foreign lands
	option = { 
		name = pilgrimage_intent.1100.b
		worldly_type_option_effect = yes
		add_stress = medium_stress_loss
		add_character_modifier = {
			modifier = pilgrimage_worldly_modifier
			years = 10
		}
		ai_chance = {
			base = 50
			compare_modifier = {
				value = stress
				multiplier = 2
			}
		}
	}
	# For the sake of appearances, of course
	option = { 
		name = pilgrimage_intent.1100.c
		add_character_modifier = {
			modifier = showy_about_pilgrimage_modifier
			years = 10
		}
		stress_impact = {
			zealous = minor_stress_impact_gain
		}
		ai_chance = {
			base = 50
			modifier = {
				has_trait = zealous
				factor = 0
			}
			ai_value_modifier = {
				ai_zeal = -1
			}
		}
	}
}

#Sea: Sea legs
#by Filippa Gannholm Kirsten
pilgrimage_intent.1110 = {
	type = character_event
	title = {
		first_valid = {
			triggered_desc = {
				trigger = { has_activity_intent = altruism_intent }
				desc = pilgrimage_intent.1110.t_altruism
			}
			triggered_desc = {
				trigger = { has_activity_intent = reflection_intent }
				desc = pilgrimage_intent.1110.t_reflection
			}
			triggered_desc = {
				trigger = { has_activity_intent = zealot_intent }
				desc = pilgrimage_intent.1110.t_zealot
			}
		}
	}
	desc = {
		desc = pilgrimage_intent.1110.desc
		first_valid = {
			triggered_desc = {
				trigger = { has_activity_intent = altruism_intent }
				desc = pilgrimage_intent.1110.desc.outro_altruism
			}
			triggered_desc = {
				trigger = { has_activity_intent = reflection_intent }
				desc = pilgrimage_intent.1110.desc.outro_reflection
			}
			triggered_desc = {
				trigger = { has_activity_intent = zealot_intent }
				desc = pilgrimage_intent.1110.desc.outro_zealot
			}
		}
	}
	theme = travel_pilgrimage
	left_portrait = {
		character = root
		triggered_animation = {
			trigger = { has_trait = sadistic }
			animation = personality_callous
		}
		animation = personality_honorable
	}
	right_portrait = {
		character = scope:affected_pilgrim
		animation = sick
	}
	cooldown = { years = 2 }
	trigger = {
		OR = {
			has_activity_intent = altruism_intent
			has_activity_intent = reflection_intent
			has_activity_intent = zealot_intent
		}
		location = { is_sea_province = yes }
		current_travel_plan ?= {
			any_entourage_character = {
				is_adult = yes
				NOT = { 
					is_of_major_or_minor_interest_trigger = { CHARACTER = root }
					this = root
				}
			}
		}
	}
	immediate = {
		current_travel_plan = {
			random_entourage_character = {
				limit = {
					is_adult = yes
					NOT = { 
						is_of_major_or_minor_interest_trigger = { CHARACTER = root }
						this = root
					}
				}
				save_scope_as = affected_pilgrim
			}
		}
	}
	#Altruism: Poor sod, have some of my water
	option = { 
		name = pilgrimage_intent.1110.a
		trigger = { has_activity_intent = altruism_intent }
		custom_tooltip = available_because_intent_tt
		pious_type_option_effect = yes
		current_travel_plan = {
			every_entourage_character = {
				custom = every_entourage_tt
				add_opinion = {
					target = root
					modifier = pilgrimage_altruistic_opinion
					opinion = 15
				}
			}
		}
		if = {
			limit = { 
				has_trait = pilgrim
				has_trait_xp = {
					trait = pilgrim
					value < 100
				}
			}
			add_trait_xp = {
				trait = pilgrim
				value = 5
			}
		}
		stress_impact = {
			generous = minor_stress_impact_loss
			humble = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
		}
	}
	#Reflection: Contemplate the cruelty of being forced to sea-fare to reach divine locations
	option = { 
		name = pilgrimage_intent.1110.b
		trigger = { has_activity_intent = reflection_intent }
		custom_tooltip = available_because_intent_tt
		pious_type_option_effect = yes
		if = {
			limit = { 
				has_trait = pilgrim
				has_trait_xp = {
					trait = pilgrim
					value < 100
				}
			}
			add_trait_xp = {
				trait = pilgrim
				value = 5
			}
		}
		stress_impact = {
			base = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
		}
	}
	#Zealot: Get down and pray
	option = { 
		name = pilgrimage_intent.1110.c
		trigger = { has_activity_intent = zealot_intent }
		custom_tooltip = available_because_intent_tt
		pious_type_option_effect = yes
		add_piety = miniscule_piety_gain
		if = {
			limit = { 
				has_trait = pilgrim
				has_trait_xp = {
					trait = pilgrim
					value < 100
				}
			}
			add_trait_xp = {
				trait = pilgrim
				value = 5
			}
		}
		stress_impact = {
			zealous = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
		}
	}
	#Trait: I should have some herbs for that
	option = { 
		name = pilgrimage_intent.1110.d
		trigger = { 
			OR = {
				has_trait = whole_of_body
				has_trait = lifestyle_herbalist
				is_witch_trigger = yes
				has_trait = lifestyle_physician
			}
			NOT = { has_character_modifier = pilgrimage_herbalist_modifier }
		}
		worldly_type_option_effect = yes
		if = {
			limit = {
				NOT = { has_trait = lifestyle_mystic }
			}
			add_trait = lifestyle_mystic
		}
		else_if = {
			limit = {
				has_trait = lifestyle_mystic
				has_trait_xp = {
					trait = lifestyle_mystic
					value < 100
				}
			}
			add_trait_xp = {
				trait = lifestyle_mystic
				value = 10
			}
		}
		if = {
			limit = { has_lifestyle = learning_lifestyle }
			add_learning_lifestyle_xp = medium_lifestyle_xp
		}
		if = {
			limit = {
				NOR = {
					AND = {
						has_trait = lifestyle_mystic
						has_trait_xp = {
							trait = lifestyle_mystic
							value < 100
						}
					}
					has_lifestyle = learning_lifestyle
				}
			}
			add_character_modifier = {
				modifier = pilgrimage_herbalist_modifier
				years = 5
			}
		}
		if = {
			limit = { 
				has_trait = pilgrim
				has_trait_xp = {
					trait = pilgrim
					value < 100
				}
			}
			add_trait_xp = {
				trait = pilgrim
				value = 10
			}
		}
		reverse_add_opinion = {
			target = scope:affected_pilgrim
			modifier = feast_helped_me_opinion
			opinion = 25
		}
		stress_impact = {
			sadistic = minor_stress_impact_gain
		}
		ai_chance = {
			base = 200
			modifier = {
				has_trait = sadistic
				factor = 0
			}
		}
	}
	#Sadist opt-out
	option = { 
		name = pilgrimage_intent.1110.e
		trigger = { has_trait = sadistic }
		stress_impact = {
			sadistic = medium_stress_impact_loss
			compassionate = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				has_trait = compassionate
				factor = 0
			}
		}
	}
}

scripted_trigger suitable_smitten_heathen_trigger = {
	is_physically_able_adult = yes
	NOR = {
		faith.religion = root.faith.religion
		has_trait = celibate
		has_trait = chaste
		has_trait = zealous
		has_trait = seducer
		exists = betrothed
	}
	allowed_to_marry_character_gender_trigger = { CHARACTER = $ENTOURAGE_TARGET$ }
	$ENTOURAGE_TARGET$ ?= { allowed_to_marry_character_gender_trigger = { CHARACTER = prev } }
	age <= 40
	is_married = no
	can_marry_trigger = yes
	is_concubine = no
	is_attracted_to_gender_of = $ENTOURAGE_TARGET$
}

scripted_trigger suitable_entourage_character_trigger = {
	is_physically_able_adult = yes
	this != root
	faith = root.faith
	is_courtier_of = root
	is_married = no
	can_marry_trigger = yes
	age <= 40
	is_concubine = no
	NOR = {
		has_trait = celibate
		has_trait = chaste
		has_sexuality = asexual
		is_heir_of = root
		exists = betrothed
	}
	save_temporary_scope_as = entourage_member
	any_pool_character = { 
		province = root.location
		suitable_smitten_heathen_trigger = { ENTOURAGE_TARGET = scope:entourage_member }
	}
}

# A local heathen is smitten with one of your entourage members and asks to marry them
# by Alexander Oltner
pilgrimage_intent.9000 = { 
	type = character_event
	title = pilgrimage_intent.9000.t
	desc = pilgrimage_intent.9000.desc
	theme = travel_pilgrimage
	left_portrait = {
		character = scope:entourage_to_marry_2
		animation = eyeroll
	}
	right_portrait = {
		character = scope:smitten_heathen
		animation = admiration
	}
	override_background = { reference = market_scope }
	cooldown = { years = 10 }
	trigger = {
		is_location_valid_for_travel_event_on_land = yes
		exists = location.province_owner
		has_activity_intent = zealot_intent
		current_travel_plan ?= {
			any_entourage_character = { suitable_entourage_character_trigger = yes }
		}
	}
	immediate = {
		location.county.title_province = { save_scope_as = background_market_scope }
		current_travel_plan ?= {
			random_entourage_character = {
				limit = {
					suitable_entourage_character_trigger = yes
				}
				save_scope_as = entourage_to_marry_2
			}
		}
		random_pool_character = {
			province = root.location
			limit = {
				suitable_smitten_heathen_trigger = { ENTOURAGE_TARGET = scope:entourage_to_marry_2 }
			}
			save_scope_as = smitten_heathen
		}
	}
	option = { # Show them how its done
		name = pilgrimage_intent.9000.seducer
		trigger = {
			has_trait = seducer
		}
		flavor = pilgrimage_intent.9000.seducer.flavor
		bonus_to_all_types_effect = yes
		add_piety = medium_piety_gain
		add_prestige = medium_prestige_gain
		scope:smitten_heathen = {
			set_character_faith = root.faith
			add_opinion = {
				target = root
				modifier = happy_opinion
				opinion = 30
			}
		}
		add_to_entourage_court_and_activity_effect = { 
			CHAR_TO_ADD = scope:smitten_heathen 
			NEW_COURT_OWNER = root 
		}
		scope:entourage_to_marry_2 = {
			add_opinion = {
				target = root
				modifier = happy_opinion
				opinion = 30
			}
			if = {
				limit = {
					is_female = yes
					is_lowborn = no
					scope:smitten_heathen = {
						is_lowborn = yes
					}
				}
				marry_matrilineal = scope:smitten_heathen
			}
			else_if = {
				limit = {
					is_male = yes
					is_lowborn = yes
					scope:smitten_heathen = {
						is_lowborn = no
					}
				}
				marry_matrilineal = scope:smitten_heathen
			}
			else = {
				marry = scope:smitten_heathen
			}
		}
		stress_impact = {
			paranoid = medium_stress_impact_gain
			callous = medium_stress_impact_gain
			sadistic = medium_stress_impact_gain
		}
		
		ai_chance = {
			base = 1000
			
			modifier = {
				factor = 0
				OR = {
					has_trait = paranoid
					has_trait = callous
					has_trait = sadistic
				}
			}
		}
	}
	option = { # Let them marry, if the heathen converts
		name = pilgrimage_intent.9000.a
		flavor = pilgrimage_intent.9000.a.flavor
		pious_type_option_effect = yes
		add_piety = minor_piety_gain
		scope:smitten_heathen = {
			set_character_faith = root.faith
		}
		add_to_entourage_court_and_activity_effect = { 
			CHAR_TO_ADD = scope:smitten_heathen 
			NEW_COURT_OWNER = root 
		}
		scope:entourage_to_marry_2 = {
			progress_towards_rival_effect = {
				CHARACTER = root
				REASON = rival_forced_to_marry_heathen
				OPINION = 0
			}
			add_opinion = {
				target = root
				modifier = disappointed_opinion
				opinion = -30
			}
			if = {
				limit = {
					is_female = yes
					is_lowborn = no
					scope:smitten_heathen = {
						is_lowborn = yes
					}
				}
				marry_matrilineal = scope:smitten_heathen
			}
			else_if = {
				limit = {
					is_male = yes
					is_lowborn = yes
					scope:smitten_heathen = {
						is_lowborn = no
					}
				}
				marry_matrilineal = scope:smitten_heathen
			}
			else = {
				marry = scope:smitten_heathen
			}
		}
		stress_impact = {
			cynical = medium_stress_impact_gain
			arrogant = medium_stress_impact_gain
		}
		
		ai_chance = {
			base = 100
			
			modifier = {
				factor = 0
				OR = {
					has_trait = cynical
					has_trait = arrogant
				}
			}
		}
	}
	option = { # Let them marry, if your entourage member approves
		name = pilgrimage_intent.9000.b
		flavor = pilgrimage_intent.9000.b.flavor
		worldly_type_option_effect = yes
		scope:entourage_to_marry_2 = {
			random_list = {
				1 = { # They hit it off and marry
					desc = hit_it_off_tt
					modifier = {
						trait_compatibility = {
							target = scope:smitten_heathen
							value >= low_positive_trait_compatibility
						}
						add = 1
					}
					modifier = {
						trait_compatibility = {
							target = scope:smitten_heathen
							value >= medium_positive_trait_compatibility
						}
						add = 1
					}
					modifier = {
						trait_compatibility = {
							target = scope:smitten_heathen
							value >= high_positive_trait_compatibility
						}
						add = 1
					}
					root = {
						send_interface_toast = {
							title = hit_it_off_tt
							left_icon = scope:entourage_to_marry_2
							right_icon = scope:smitten_heathen
							scope:entourage_to_marry_2 = {
								root = {
									add_prestige = medium_prestige_gain
								}
							}
						}
					}
					#Putting here as to not cut off toast
					add_opinion = {
						target = root
						modifier = happy_opinion
						opinion = 30
					}
					scope:smitten_heathen = {
						add_opinion = {
							target = root
							modifier = happy_opinion
							opinion = 30
						}
					}
					if = {
						limit = {
							is_female = yes
							is_lowborn = no
							scope:smitten_heathen = {
								is_lowborn = yes
							}
						}
						marry_matrilineal = scope:smitten_heathen
					}
					else_if = {
						limit = {
							is_male = yes
							is_lowborn = yes
							scope:smitten_heathen = {
								is_lowborn = no
							}
						}
						marry_matrilineal = scope:smitten_heathen
					}
					else = {
						marry = scope:smitten_heathen
					}
					add_to_entourage_court_and_activity_effect = { 
						CHAR_TO_ADD = scope:smitten_heathen 
						NEW_COURT_OWNER = root 
					}
				}
				1 = {
					desc = they_fight_publicly_tt
					modifier = {
						trait_compatibility = {
							target = scope:smitten_heathen
							value <= low_negative_trait_compatibility
						}
						add = 1
					}
					modifier = {
						trait_compatibility = {
							target = scope:smitten_heathen
							value <= medium_negative_trait_compatibility
						}
						add = 1
					}
					modifier = {
						trait_compatibility = {
							target = scope:smitten_heathen
							value <= high_negative_trait_compatibility
						}
						add = 1
					}
					modifier = {
						NOT = {
							is_attracted_to_gender_of = scope:smitten_heathen
						}
						add = 3
					}
					root = {
						send_interface_toast = {
							title = they_fight_publicly_tt
							left_icon = scope:entourage_to_marry_2
							right_icon = scope:smitten_heathen
							add_prestige = minor_prestige_loss
						}
						scope:entourage_to_marry_2 = {
							add_opinion = {
								target = scope:smitten_heathen
								modifier = angry_opinion
								opinion = -30
							}
						}
					}
				}
			}
		}
		stress_impact = {
			zealous = medium_stress_impact_gain
			humble = medium_stress_impact_gain
		}
		
		ai_chance = {
			base = 100
			
			modifier = {
				factor = 0
				OR = {
					has_trait = zealous
					has_trait = humble
				}
			}
		}
	}
	option = {
		name = pilgrimage_intent.9000.c
		
		scope:entourage_to_marry_2 = {
			add_opinion = {
				target = root
				modifier = relieved_opinion
				opinion = 10
			}
		}
		stress_impact = {
			generous = medium_stress_impact_gain
		}
		
		ai_chance = {
			base = 10
			
			modifier = {
				factor = 0
				has_trait = generous
			}
		}
	}
}
