﻿namespace = travel_events_fp3
############################
# Dying Ember Event
# by Lucas Ribeiro
############################
travel_events_fp3.0010 = {
	type = character_event
	title = travel_events_fp3.0010.t
	desc = travel_events_fp3.0010.desc.intro
	theme = travel

	left_portrait = {
		character = root
		animation = lantern
	}
	right_portrait = {
		character = scope:fp3_zoroastrian_armed_pilgrim
		animation = aggressive_mace
	}
	override_background = {
		reference = fp1_runestone_circle
	}
	override_effect_2d = rain

	cooldown = {
		years = 10
	}
	trigger = {
		has_dlc_feature = legacy_of_persia
		is_available_travelling_adult = yes
		is_landed = yes
		exists = location.faith
		root.location.faith = { religion_tag = zoroastrianism_religion }
	}
	immediate = {
		wayfarer_storyteller_fame_effect = { VALUE = roaming_reward_fame_small }
		create_character = {
			template = fp3_zoroastrian_armed_pilgrim
			location = root.location
			culture = root.location.county.culture
			faith = root.location.county.faith
			gender_female_chance = root_faith_clergy_gender_female_chance
			#Set up the scope
			save_scope_as = fp3_zoroastrian_armed_pilgrim
		}
	}

	# Put out the embers by force
	option = {
		name = travel_events_fp3.0010.a
		flavor = travel_events_fp3.0010.a.lightning.desc
		trigger = {
			faith = {
				faith_hostility_level = {
					target = root.location.faith
					value >= faith_hostile_level
				}
			}
		}
		duel = {
			skill = prowess
			target = scope:fp3_zoroastrian_armed_pilgrim
			50 = {
				desc = travel_events_fp3.0010.a.success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				hidden_effect = {
					scope:fp3_zoroastrian_armed_pilgrim = {
						increase_wounds_effect = {
							REASON = fight
						}
					}
				}
				show_as_tooltip = {
					send_interface_toast = {
						title = travel_events_fp3.0010.a.success
						left_icon = root
						right_icon = scope:fp3_zoroastrian_armed_pilgrim
						add_piety = medium_piety_gain
						rightfully_imprison_character_effect = {
							TARGET = scope:fp3_zoroastrian_armed_pilgrim
							IMPRISONER = root
						}
					}
				}
				hidden_effect = {
					random_list = {
						90 = {
							send_interface_toast = {
								title = travel_events_fp3.0010.a.success
								left_icon = root
								right_icon = scope:fp3_zoroastrian_armed_pilgrim
								add_piety = medium_piety_gain
								rightfully_imprison_character_effect = {
									TARGET = scope:fp3_zoroastrian_armed_pilgrim
									IMPRISONER = root
								}
							}
						}
						5 = {
							trigger_event = travel_events_fp3.0011
						}
					}
				}
			}
			50 = {
				desc = travel_events_fp3.0010.a.failure
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				hidden_effect = {
					scope:fp3_zoroastrian_armed_pilgrim = {
						if = {
							limit = {
								root = {
									is_ai = yes
								}
							}
							silent_disappearance_effect = yes
						}
					}
				}
				increase_wounds_effect = {
					REASON = fight
				}
				show_as_tooltip = {
					send_interface_toast = {
						title = travel_events_fp3.0010.a.failure
						left_icon = root
						right_icon = scope:fp3_zoroastrian_armed_pilgrim
						add_piety = minor_piety_loss
					}
				}
				hidden_effect = {
					random_list = {
						95 = {
							send_interface_toast = {
								title = travel_events_fp3.0010.a.failure
								left_icon = root
								right_icon = scope:fp3_zoroastrian_armed_pilgrim
								add_piety = minor_piety_loss
							}
						}
						5 = {
							trigger_event = travel_events_fp3.0011
						}
					}
				}
			}
		}
		stress_impact = {
			compassionate = medium_stress_impact_gain
			forgiving = medium_stress_impact_gain
			callous = medium_stress_impact_loss
			sadistic = medium_stress_impact_loss
			cynical = medium_stress_impact_loss
			zealous = medium_stress_impact_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = compassionate
					has_trait = forgiving
				}
			}
			modifier = {
				factor = 1
				has_trait = zealous

			}
		}
	}

	#Confiscate the Holy Brazier as a zoroastrian
	option = {
		name = travel_events_fp3.0010.b
		trigger = {
			root.religion = religion:zoroastrianism_religion
		}
		flavor = travel_events_fp3.0010.a.lightning.desc
		scope:fp3_zoroastrian_armed_pilgrim = {
			if = {
				limit = {
					root = {
						is_ai = yes
					}
				}
				silent_disappearance_effect = yes
			}
		}
		duel = {
			skill = prowess
			target = scope:fp3_zoroastrian_armed_pilgrim
			50 = {
				desc = travel_events_fp3.0010.b.success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				hidden_effect = {
					scope:fp3_zoroastrian_armed_pilgrim = {
						increase_wounds_effect = {
							REASON = fight
						}
					}
				}
				show_as_tooltip = {
					send_interface_toast = {
						title = travel_events_fp3.0010.b.success
						left_icon = root
						right_icon = scope:fp3_zoroastrian_armed_pilgrim
						add_piety = minor_piety_loss
						create_artifact = {
							name = zoroastrian_brazier_name
							creator = scope:fp3_zoroastrian_armed_pilgrim
							description = zoroastrian_brazier_desc
							template = fp3_zoroastrian_brazier_template
							modifier = fp3_zoroastrian_brazier_modifier
							type = miscellaneous
							visuals = urn
							wealth = 40
							quality = 40
						}
					}
				}
				hidden_effect = {
					random_list = {
						95 = {
							send_interface_toast = {
								title = travel_events_fp3.0010.b.success
								left_icon = root
								right_icon = scope:fp3_zoroastrian_armed_pilgrim
								add_piety = minor_piety_loss
								create_artifact = {
									name = zoroastrian_brazier_name
									creator = scope:fp3_zoroastrian_armed_pilgrim
									description = zoroastrian_brazier_desc
									template = fp3_zoroastrian_brazier_template
									modifier = fp3_zoroastrian_brazier_modifier
									type = miscellaneous
									visuals = urn
									wealth = 40
									quality = 40
								}
							}
						}
						5 = {
							trigger_event = travel_events_fp3.0011
						}
					}
				}
			}
			50 = {
				desc = travel_events_fp3.0010.b.failure
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				increase_wounds_effect = {
					REASON = fight
				}
				show_as_tooltip = {
					send_interface_toast = {
						title = travel_events_fp3.0010.b.failure
						left_icon = root
						right_icon = scope:fp3_zoroastrian_armed_pilgrim
						add_piety = major_piety_loss
					}
				}
				hidden_effect = {
					random_list = {
						95 = {
							send_interface_toast = {
								title = travel_events_fp3.0010.b.failure
								left_icon = root
								right_icon = scope:fp3_zoroastrian_armed_pilgrim
								add_piety = major_piety_loss
							}
						}
						5 = {
							trigger_event = travel_events_fp3.0011
						}
					}
				}
			}
		}
		stress_impact = {
			compassionate = medium_stress_impact_gain
			forgiving = medium_stress_impact_gain
			zealous = medium_stress_impact_gain
			sadistic = medium_stress_impact_loss
			cynical = medium_stress_impact_loss
			greedy = medium_stress_impact_loss
			ambitious = minor_stress_impact_loss
			callous = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = compassionate
					has_trait = forgiving
					has_trait = zealous
				}
			}
		}
	}

	# Help shelter the embers
	option = {
		name = travel_events_fp3.0010.c
		flavor = travel_events_fp3.0010.c.flavor
		if = {
			limit = {
				root.religion = religion:zoroastrianism_religion
			}
			add_piety = medium_piety_gain
			stress_impact = {
				zealous = medium_stress_impact_loss
			}
		}
		else = {
			add_piety = medium_piety_loss
			stress_impact = {
				zealous = medium_stress_impact_gain
			}
		}
		random_list = {
			70 = {
				desc = travel_events_fp3.0010.c.success
				add_prestige = minor_prestige_gain
				custom_tooltip = travel_events_fp3.0010.c.success.desc
				trigger_event = travel_events_fp3.0012
			}
			30 = {
				desc = travel_events_fp3.0010.c.failure
				send_interface_toast = {
					title = travel_events_fp3.0010.c.failure
					left_icon = root
					right_icon = scope:fp3_zoroastrian_armed_pilgrim
					add_prestige = minor_prestige_loss
					scope:fp3_zoroastrian_armed_pilgrim = {
						if = {
							limit = {
								root = {
									is_ai = yes
								}
							}
							silent_disappearance_effect = yes
						}
					}
				}
			}
		}
		stress_impact = {
			callous = medium_stress_impact_gain
			sadistic = major_stress_impact_gain
			compassionate = medium_stress_impact_loss
			forgiving = minor_stress_impact_loss
		}
		ai_chance = {
			base = 0
			modifier = {
				add = 100
				OR = {
					has_trait = compassionate
					has_trait = just
					has_trait = forgiving
				}
			}
			modifier = {
				factor = 0
				OR = {
					has_trait = callous
					has_trait = sadistic
				}
			}
		}
	}

	# Leave them to their plight
	option = {
		name = travel_events_fp3.0010.d
		flavor = travel_events_fp3.0010.d.flavor
		scope:fp3_zoroastrian_armed_pilgrim = {
			if = {
				limit = {
					root = {
						is_ai = yes
					}
				}
				silent_disappearance_effect = yes
			}
		}
		stress_impact = {
			compassionate = minor_stress_impact_gain
			forgiving = minor_stress_impact_gain
			lazy = minor_stress_impact_loss
			callous = minor_stress_impact_loss
			sadistic = minor_stress_impact_loss
			cynical = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = callous
					has_trait = sadistic
					has_trait = zealous
				}
			}
		}
	}
}

### Brazier is relit by lightning during the fight
travel_events_fp3.0011 = {
	title = travel_events_fp3.0011.t
	desc = travel_events_fp3.0011.desc.intro
	theme = travel
	override_background = {
		reference = fp1_runestone_circle
	}
	left_portrait = {
		character = root
		animation = shock
	}
	right_portrait = {
		character = scope:fp3_zoroastrian_armed_pilgrim
		animation = celebrate_mace
	}

	immediate = {
		wayfarer_storyteller_fame_effect = { VALUE = roaming_reward_fame_high }
	}

	### Convert Openly due to the Miracle
	option = {
		name = travel_events_fp3.0011.a
		trigger = {
			is_ai = no
		}
		set_character_faith_with_conversion = root.location.county.faith
		scope:fp3_zoroastrian_armed_pilgrim = {
			if = {
				limit = {
					root = {
						is_ai = yes
					}
				}
				silent_disappearance_effect = yes
			}
		}
		stress_impact = {
			cynical = medium_stress_impact_gain
			zealous = medium_stress_impact_gain
			arbitrary = medium_stress_impact_loss
		}
		ai_chance = {
			base = 100
		}
	}

	### Convert Secretly due to the Miracle
	option = {
		name = travel_events_fp3.0011.b
		scope:fp3_zoroastrian_armed_pilgrim = {
			if = {
				limit = {
					root = {
						is_ai = yes
					}
				}
				silent_disappearance_effect = yes
			}
		}
		if = {
			limit = {
				has_trait = lifestyle_mystic
			}
			add_trait_xp = {
				trait = lifestyle_mystic
				value = lifestyle_mystic_xp_gain_minor_value
			}
		}
		make_character_crypto_religionist_effect = { CRYPTO_RELIGION = root.location.faith }
		stress_impact = {
			base = medium_stress_impact_gain
			cynical = medium_stress_impact_gain
			zealous = medium_stress_impact_gain
			arbitrary = minor_stress_impact_gain
		}
		ai_chance = {
			base = 50
			modifier = {
				factor = 0
				has_trait = zealous
			}
		}
	}

	### Refute the Miracle
	option = {
		name = travel_events_fp3.0011.c
		scope:fp3_zoroastrian_armed_pilgrim = {
			if = {
				limit = {
					root = {
						is_ai = yes
					}
				}
				silent_disappearance_effect = yes
			}
		}
		stress_impact = {
			base = major_stress_impact_gain
			cynical = major_stress_impact_loss
			zealous = medium_stress_impact_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 2
				has_trait = cynical
			}
		}
	}
}

### Group takes shelter from the storm together
travel_events_fp3.0012 = {
	title = travel_events_fp3.0012.t
	desc = travel_events_fp3.0012.desc.intro

	theme = travel
	override_background = {
		reference = fp3_cave
	}
	left_portrait = {
		character = root
		animation = personality_content
	}
	right_portrait = {
		character = scope:fp3_zoroastrian_armed_pilgrim
		animation = happiness
	}

	immediate = {
		wayfarer_storyteller_fame_effect = { VALUE = roaming_reward_fame_small }
		save_scope_as = owner #For the court artifact
	}

	### Steal the Brazier while they rest
	option = {
		name = travel_events_fp3.0012.a
		duel = {
			skill = intrigue
			target = scope:fp3_zoroastrian_armed_pilgrim
			50 = {
				# You steal the Brazier from the Magi
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				send_interface_toast = {
					left_icon = root
					title = travel_events_fp3.0012.a.success
					if = {
						limit = {
							has_royal_court = no
						}
						create_artifact = {
							name = afarganyu_name
							creator = scope:fp3_zoroastrian_armed_pilgrim
							description = zoroastrian_brazier_desc
							template = fp3_zoroastrian_brazier_template
							modifier = fp3_zoroastrian_brazier_modifier
							type = miscellaneous
							history = {
								type = created_before_history
							}
							visuals = urn
							wealth = 40
							quality = 40
						}
					}
					else = {
						set_artifact_rarity_illustrious = yes
						create_artifact = {	
							name = afarganyu_name
							description = zoroastrian_brazier_desc
							template = branch_zoroastr_template
							type = urn
							visuals = urn
							wealth = scope:wealth
							quality = scope:quality
							history = {
								type = created_before_history
							}
							modifier = afarganyu_modifier
							save_scope_as = newly_created_artifact
						}

						scope:newly_created_artifact = {
							set_variable = { name = historical_unique_artifact value = yes }
							set_variable = {
								name = relic
								value = flag:zoroastr
							}
							save_scope_as = epic
						}
					}
				}
				scope:fp3_zoroastrian_armed_pilgrim = {
					if = {
						limit = {
							root = {
								is_ai = yes
							}
						}
						silent_disappearance_effect = yes
					}
				}
			}
			50 = {
				# You get caught and exposed
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				send_interface_toast = {
					title = travel_events_fp3.0012.a.failure
					left_icon = root
					add_prestige = major_prestige_loss
					add_character_modifier = {
						modifier = caught_thief_modifier
						years = 5
					}
				}
				scope:fp3_zoroastrian_armed_pilgrim = {
					if = {
						limit = {
							root = {
								is_ai = yes
							}
						}
						silent_disappearance_effect = yes
					}
				}
			}
		}
		stress_impact = {
			honest = medium_stress_impact_gain
			compassionate = minor_stress_impact_gain
			greedy = medium_stress_impact_loss
			sadistic = medium_stress_impact_loss
			callous = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = honest
					has_trait = compassionate
				}
			}
		}
	}
	### Take one of the Magi in the trip with you
	option = {
		name = travel_events_fp3.0012.b
		trigger = {
			scope:fp3_zoroastrian_armed_pilgrim = {
				is_landed = no
			}
		}
		add_courtier = scope:fp3_zoroastrian_armed_pilgrim
		root.current_travel_plan = {
			add_companion = scope:fp3_zoroastrian_armed_pilgrim
		}
		if = {
			limit = {
				has_trait = lifestyle_mystic
			}
			add_trait_xp = {
				trait = lifestyle_mystic
				value = lifestyle_mystic_xp_gain_minor_value
			}
		}
		if = {
			limit = {
				root.religion = religion:zoroastrianism_religion
			}
			add_piety = minor_piety_gain
			stress_impact = {
				zealous = medium_stress_impact_loss
			}
		}
		else = {
			add_piety = minor_piety_loss
			stress_impact = {
				zealous = medium_stress_impact_gain
			}
		}
		scope:fp3_zoroastrian_armed_pilgrim = {
			add_character_flag = {
				flag = blocked_from_leaving
				years = 5
			}
		}
		stress_impact = {
			paranoid = medium_stress_impact_gain
			shy = medium_stress_impact_gain
			gregarious = medium_stress_impact_loss
			trusting = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = shy
					has_trait = paranoid
				}
			}
		}
	}

	### Part ways with the Magi
	option = {
		name = travel_events_fp3.0012.c
		scope:fp3_zoroastrian_armed_pilgrim = {
			if = {
				limit = {
					root = {
						is_ai = yes
					}
				}
				silent_disappearance_effect = yes
			}
		}
		stress_impact = {
			gregarious = minor_stress_impact_gain
			paranoid = minor_stress_impact_loss
			shy = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				has_trait = gregarious
			}
		}
	}
}

############################
# Qanat Diving
# by Lucas Ribeiro
############################
travel_events_fp3.0020 = {
	type = character_event
	title = travel_events_fp3.0020.t
	desc = travel_events_fp3.0020.desc.intro
	theme = travel
	left_portrait = {
		character = root
		animation = lantern
	}
	override_background = {
		reference = fp3_cave
	}
	cooldown = {
		years = 50 #It is unlikely you would be surprised by a cave like this twice.
	}
	trigger = {
		static_group_filter = {
			group = travel_events_fp3.0020
			match = 0.5
		}
		has_dlc_feature = legacy_of_persia
		is_available_travelling_adult = yes
		is_playable_character = yes

		exists = root.current_travel_plan.travel_leader

		root.location = {
			geographical_region = world_persian_empire
			root.location != root.capital_province #We are not at home
		}
	}
	immediate = {
		mp_delay_travel_plan = { DAYS = 90 }
		create_character = {
			template = fp3_young_rascal
			location = root.location
			culture = root.location.county.culture
			faith = root.location.county.faith
			#Set up the scope
			save_scope_as = fp3_young_rascal
		}
		if = {
			limit = { exists = root.current_travel_plan.travel_leader }
			root.current_travel_plan.travel_leader = { save_scope_as = travel_leader }
        }
	}

	### Investigate
	option = {
		name = travel_events_fp3.0020.a
		flavor = travel_events.fp3.0020.a.flavor
		
		duel = {
			skill = prowess
			value = decent_skill_rating
			65 = {
				desc = travel_events_fp3.0020.a.success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				custom_tooltip = travel_events_fp3.0020.a.success.tooltip
				traveler_danger_xp_effect = { #We learn something from this ordeal.
					MIN = 1
					MAX = 3
				}
				trigger_event = travel_events_fp3.0021
			}
			35 = {
				desc = travel_events_fp3.0020.a.failure
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				send_interface_toast = {
					title = travel_events_fp3.0020.a.failure
					custom_tooltip = travel_events_fp3.0020.a.failure.title
					left_icon = root
					increase_wounds_effect = { REASON = fall }
					current_travel_plan = {
						delay_travel_plan = { days = 20 }
					}
				}
			}
		}

		stress_impact = {
			craven = major_stress_impact_gain
			patient = minor_stress_impact_gain
			brave = medium_stress_impact_loss
			impatient = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = craven
					has_trait = patient
				}
			}
		}
	}

	### Leave these caves
	option = {
		name = travel_events_fp3.0020.b
		flavor = travel_events.fp3.0020.b.flavor

		reverse_add_opinion = {
	 		target = scope:travel_leader
	 		modifier = grateful_opinion
	 		opinion = 15
	 	}
		
		traveler_danger_xp_effect = { #We learn something from this ordeal.
			MIN = 1
			MAX = 3
		}

		stress_impact = {
			impatient = medium_stress_impact_gain
			craven = medium_stress_impact_loss
			patient = medium_stress_impact_loss
		}

		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				has_trait = impatient
			}
		}
	}
	after = {
		mp_resume_travel_plan = yes
		scope:fp3_young_rascal = {
			silent_disappearance_ai_effect = yes
		}
	}
}

travel_events_fp3.0021 = {
	type = character_event
	title = travel_events_fp3.0021.t
	desc = travel_events_fp3.0021.desc
	theme = travel
	left_portrait = {
		character = root
		animation = lantern
	}
	right_portrait = {
		character = scope:fp3_young_rascal
		animation = personality_bold
	}
	override_background = {
		reference = fp3_cave
	}

	immediate = {
		wayfarer_storyteller_fame_effect = { VALUE = roaming_reward_fame_medium }
	}

	### Dive for treasure
	option = {
		name = travel_events_fp3.0021.a
		duel = {
			skill = prowess
			value = decent_skill_rating
			# Success.
			60 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 0.5
				}
				desc = travel_events_fp3.0021.a.success.desc
				hidden_effect = {
					random_list = {
						5 = { #Islamic Relic
							trigger = { has_royal_court = yes }
							create_artifact_pedestal_islamic_relic_effect_hist = { OWNER = root }
						}
						5 = { #Zoroastrian Relic
							trigger = { has_royal_court = yes }
							random_list = {
								50 = {
									create_artifact_pedestal_branch_relic_zoroastr_effect = { OWNER = root }
								}
								50 = {
									create_artifact_afarganyu_effect = { OWNER = root }
								}
							}
						}
						1 = { #Shamshir-e Zomorrodnegar
							trigger = {
								has_royal_court = yes
								any_artifact = {
									count < 1
									has_variable = zomorrodnegar
								}
							}
							create_artifact_zomorrodnegar_effect = { OWNER = root }
						}
						1 = { #Cup of Jamshid
							trigger = {
								has_royal_court = yes
								NOT = {
									any_artifact = { has_variable = cup_jamshid }
								}
							}
							create_artifact_pedestal_cup_jamshid_effect = { OWNER = root }
						}
						10 = {
							trigger = {
								any_artifact = {
									count < 10
									has_variable = sassanian_sword
								}
							}
							create_artifact_sassanian_sword_effect = { OWNER = root }
						}
						1 = {
							create_artifact_oxus_bracelet_effect = { OWNER = root }
						}
						3 = {
							create_artifact_fp3_ancient_drinking_vessel_effect = { OWNER = root }
						}
					}
					scope:newly_created_artifact = {
						set_variable = {
							name = suppress_artifact_notifications
							days = 1
						}
						set_owner = {
							target = root
							history = {
								type = discovered
								actor = scope:fp3_young_rascal
								recipient = root
								location = root.location
							}
						}
					}
				}
				send_interface_toast = {
					title = travel_events_fp3.0021.a.success.t
					left_icon = root
					right_icon = scope:newly_created_artifact
					add_prestige = minor_prestige_gain
				}
				custom_tooltip = travel_events_fp3.0021.a.artifact
			}
			40 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -0.5
				}
				desc = travel_events_fp3.0021.a.failure.desc
				send_interface_toast = {
					title = travel_events_fp3.0021.a.failure.t
					left_icon = root
					contract_disease_effect = { DISEASE = ill TREATMENT_EVENT = yes }
					add_prestige = minor_prestige_loss
				}
				if = {
					limit = { exists = scope:newly_created_artifact }
					hidden_effect = { destroy_artifact = scope:newly_created_artifact }
				}
			}
		}
		traveler_danger_xp_effect = {
			MIN = 3
			MAX = 7
		}
		stress_impact = {
			craven = major_stress_impact_gain
			patient = minor_stress_impact_gain
			brave = medium_stress_impact_loss
			impatient = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = craven
					has_trait = patient
				}
			}
		}
	}

	### Study the Qanat
	option = {
		name = travel_events_fp3.0021.b
		if = {
			limit = { exists = scope:newly_created_artifact }
			hidden_effect = { destroy_artifact = scope:newly_created_artifact }
		}
		current_travel_plan = {
			delay_travel_plan = { days = 20 }
		}
		duel = {
			skill = learning
			value = decent_skill_rating
			# Success.
			60 = {
				desc = travel_events_fp3.0021.b.success.desc
				compare_modifier = {
					value = scope:duel_value
					multiplier = 0.5
				}
				send_interface_toast = {
					title = travel_events_fp3.0021.b.success.t
					left_icon = root
					add_character_modifier = {
						modifier = fp3_irrigation_insights_modifier
						years = 25
					}
					add_prestige = minor_prestige_gain
				}
			}
			# Failure.
			40 = {
				desc = travel_events_fp3.0021.b.failure.desc
				compare_modifier = {
					value = scope:duel_value
					multiplier = -0.5
				}
				send_interface_toast = {
					title = travel_events_fp3.0021.b.failure.t
					left_icon = root
					add_prestige = minor_prestige_loss
					add_stress = minor_stress_gain
				}
			}
		}
		stress_impact = {
			impatient = medium_stress_impact_gain
			lazy = medium_stress_impact_gain
			patient = medium_stress_impact_loss
			diligent = medium_stress_impact_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = lazy
					has_trait = impatient
				}
			}
		}
	}

	### Scold the rascal
	option = {
		name = travel_events_fp3.0021.c
		if = {
			limit = { exists = scope:newly_created_artifact }
			hidden_effect = { destroy_artifact = scope:newly_created_artifact }
		}
		add_prestige = minor_prestige_gain
		stress_impact = {
			humble = medium_stress_impact_gain
			patient = minor_stress_impact_gain
			trusting = minor_stress_impact_gain
			calm = minor_stress_impact_gain
			compassionate = minor_stress_impact_gain
			arrogant = medium_stress_impact_loss
			impatient = minor_stress_impact_loss
			paranoid = minor_stress_impact_loss
			wrathful = minor_stress_impact_loss
			callous = minor_stress_impact_loss
			sadistic = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				has_trait = humble
			}
		}
	}

	after = {
		if = {
			limit = { is_ai = yes }
			scope:fp3_young_rascal = { silent_disappearance_effect = yes }
		}
	}
}

############################
# Feast for Falcons
# by Lucas Ribeiro
############################
travel_events_fp3.0030 = {
	type = character_event
	title = travel_events_fp3.0030.t
	desc = travel_events_fp3.0030.desc.intro
	theme = travel
	left_portrait = {
		character = root
		animation = shock
	}
	right_portrait = {
		character = scope:sky_burial_officiator
		animation = disapproval
	}
	cooldown = {
		years = 5
	}
	trigger = {
		has_dlc_feature = legacy_of_persia
		is_available_travelling_adult = yes
		is_landed = yes
		root.location = {
			geographical_region = world_persian_empire
		}
		root.location.faith = {
			has_doctrine_parameter = sky_burials_active
		}
	}

	immediate = {
		wayfarer_storyteller_fame_effect = { VALUE = roaming_reward_fame_small }
		root.location.faith = {
			save_scope_as = local_faith
		}
		create_character = {
			template = priest_character_template
			location = root.location
			faith = root.location.county.faith
			save_scope_as = sky_burial_officiator
		}
	}

	### Bury the bodies
	option = {
		name = travel_events_fp3.0030.a
		trigger = {
			faith = {
				NOT = {
					has_doctrine_parameter = sky_burials_active
				}
			}
		}
		add_piety = medium_piety_gain
		every_vassal = {
			limit = {
				faith = {
					has_doctrine_parameter = sky_burials_active
				}
			}
			custom = every_faith_vassal
			add_opinion = {
				target = root
				modifier = disturbed_funerals #Stacks slightly with the character modifier
			}
		}
		add_character_modifier = {
			modifier = disturbed_sky_burial
			years = 5
		}

		stress_impact = {
			compassionate = medium_stress_impact_gain
			forgiving = medium_stress_impact_gain
			callous = minor_stress_impact_loss
			sadistic = medium_stress_impact_loss
			zealous = medium_stress_impact_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = compassionate
					has_trait = forgiving
				}
			}
		}
	}

	### Appreciate as a Zoroastrian
	option = {
		name = travel_events_fp3.0030.b
		trigger = {
			root.faith = {
				has_doctrine_parameter = sky_burials_active
			}
		}
		add_piety = medium_piety_gain
		stress_impact = {
			craven = medium_stress_impact_gain
			cynical = medium_stress_impact_gain
			zealous = medium_stress_impact_loss
			brave = medium_stress_impact_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = cynical
					has_trait = craven
				}
			}
		}
	}

	### Secret Faith Convert as a non-zoroastrian
	#Rare trait unlocked option
	option = {
		name = travel_events_fp3.0030.c
		trigger = {
			is_ai = no #Never for the ai
			OR = {
				has_trait = lifestyle_mystic
				has_trait = theologian
			}
			faith = {
				NOT = {
					has_doctrine_parameter = sky_burials_active
				}
			}
		}
		make_character_crypto_religionist_effect = { CRYPTO_RELIGION = root.location.faith }
		stress_impact = {
			zealous = massive_stress_impact_gain
			cynical = major_stress_impact_gain
			fickle = medium_stress_impact_loss
		}
	}

	### Opt Out
	option = {
		name = travel_events_fp3.0030.d
		flavor = travel_events_fp3.0030.d_flavor
		add_piety = minor_piety_gain

		ai_chance = {
			base = 100
		}
	}

	### Get a young bird for you to train
	option = {
		name = travel_events_fp3.0030.e
		trigger = {
			has_dlc_feature = tours_and_tournaments
			NOR = {
				has_character_modifier = fp3_untrained_falcon
				has_character_modifier = fp3_aggressive_falcon
				has_character_modifier = peregrine_falcon
			}
		}
		add_character_modifier = {
			modifier = fp3_untrained_falcon
			years = 7
		}
		hidden_effect = {
			#this sets up the falcon training event
			trigger_event = {
				id = travel_events_fp3.0031
				months = 1
			}
		}
		custom_tooltip = travel_events_fp3.0030.e.tooltip
		stress_impact = {
			lazy = minor_stress_impact_gain
			content = minor_stress_impact_gain
			paranoid = minor_stress_impact_gain
			craven = minor_stress_impact_gain
			zealous = minor_stress_impact_gain
			ambitious = minor_stress_impact_loss
			diligent = minor_stress_impact_loss
			trusting = minor_stress_impact_loss
			brave = minor_stress_impact_loss
			cynical = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = lazy
					has_trait = content
					has_trait = paranoid
					has_trait = craven
				}
			}
		}
	}
	after = {
		scope:sky_burial_officiator = {
			silent_disappearance_effect = yes 
		}
	}
}

### The Falcon's training starts
travel_events_fp3.0031 = {
	type = character_event
	title = travel_events_fp3.0031.t
	desc = travel_events_fp3.0031.desc.intro

	theme = hunting
	trigger = {
		is_landed = yes
		has_character_modifier = fp3_untrained_falcon
	}
	left_portrait = {
		character = root
		animation = hunting_falcon
	}
	right_portrait = {
		character = scope:falcon_victim
		animation = pain
	}
	immediate = {
		wayfarer_storyteller_fame_effect = { VALUE = roaming_reward_fame_small }
		if = {
			limit = {
				is_travelling = yes
				employs_court_position = master_of_hunt_court_position
				court_position:master_of_hunt_court_position = {
					location = root.location
					is_available_allow_travelling = yes
				}
			}
			court_position:master_of_hunt_court_position = {
				save_scope_as = falcon_victim
			}
		}
		else_if = {
			limit = {
				is_travelling = yes
				current_travel_plan = {
					any_entourage_character = {
						count > 1
						this != root
						is_available_travelling_adult = yes
					}
				}
			}
			current_travel_plan = {
				random_entourage_character = {
					limit = {
						this != root
						is_available_travelling_adult = yes
					}
					save_scope_as = falcon_victim
				}
			}
		}
		else_if = {
			limit = {
				employs_court_position = master_of_hunt_court_position
			}
			court_position:master_of_hunt_court_position = {
				save_scope_as = falcon_victim
			}
		}
		else_if = {
			limit = {
				exists = cp:councillor_marshal
			}
			cp:councillor_marshal = {
				save_scope_as = falcon_victim
			}
		}
		else_if = {
			limit = {
				exists = cp:councillor_steward
			}
			cp:councillor_steward = {
				save_scope_as = falcon_victim
			}
		}
		else_if = {
			limit = {
				exists = cp:councillor_chancellor
			}
			cp:councillor_chancellor = {
				save_scope_as = falcon_victim
			}
		}
		else = {
			random_courtier = {
				save_scope_as = falcon_victim
			}
		}
		scope:falcon_victim = {
			increase_wounds_effect = {
				REASON = maimed_by_wild_beast
			}
		}
	}

	### Train the falcon as an avid falconer
	option = {
		name = travel_events_fp3.0031.d
		trigger = {
			root.culture = {
				has_cultural_tradition = tradition_ep2_avid_falconers
			}
		}
		flavor = travel_events_fp3.0031.d.tt

		add_character_modifier = {
			modifier = peregrine_falcon
			years = 7
		}
		remove_character_modifier = fp3_untrained_falcon
		add_prestige = minor_prestige_gain
	}

	### Try to train the falcon
	option = {
		name = travel_events_fp3.0031.a
		trigger = {
			NOT = {
				root.culture = {
					has_cultural_tradition = tradition_ep2_avid_falconers
				}
			}
		}
		duel = {
			skill = martial
			value = decent_skill_rating
			# Success.
			50 = {
				desc = travel_events_fp3.0031.a.success.desc
				compare_modifier = {
					value = scope:duel_value
					multiplier = 0.5
				}
				send_interface_toast = {
					title = travel_events_fp3.0031.a.success.t
					left_icon = root
					add_character_modifier = {
						modifier = peregrine_falcon
						years = 7
					}
					remove_character_modifier = fp3_untrained_falcon
					add_prestige = minor_prestige_gain
				}
			}
			# Failure.
			50 = {
				desc = travel_events_fp3.0031.a.failure.desc
				compare_modifier = {
					value = scope:duel_value
					multiplier = -0.5
				}
				send_interface_toast = {
					title = travel_events_fp3.0031.a.failure.t
					left_icon = root
					add_prestige = minor_prestige_loss
					add_stress = minor_stress_gain
				}
			}
		}
		scope:falcon_victim = {
			add_opinion = {
				target = root
				opinion = -20
				modifier = cruelty_opinion
			}
		}
		stress_impact = {
			lazy = minor_stress_impact_gain
			impatient = medium_stress_impact_gain
			diligent = minor_stress_impact_loss
			patient = medium_stress_impact_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = lazy
					has_trait = impatient
				}
			}
		}
	}

	### Use the falcon to intimidate your enemies
	option = {
		name = travel_events_fp3.0031.b
		add_character_modifier = {
			modifier = fp3_aggressive_falcon
			years = 6
		}
		remove_character_modifier = fp3_untrained_falcon
		scope:falcon_victim = {
			add_opinion = {
				target = root
				opinion = -20
				modifier = cruelty_opinion
			}
		}
		stress_impact = {
			compassionate = medium_stress_impact_gain
			sadistic = minor_stress_impact_loss
			callous = minor_stress_impact_loss
		}

		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				has_trait = compassionate
			}
		}
	}

	### Get rid of the falcon
	option = {
		name = travel_events_fp3.0031.c
		remove_character_modifier = fp3_untrained_falcon
		add_prestige = minor_prestige_loss
		scope:falcon_victim = {
			add_opinion = {
				target = root
				opinion = 20
				modifier = pleased_opinion
			}
		}
		stress_impact = {
			callous = medium_stress_impact_gain
			sadistic = medium_stress_impact_gain
			forgiving = minor_stress_impact_gain
			ambitious = minor_stress_impact_gain
			patient = minor_stress_impact_gain
			compassionate = medium_stress_impact_loss
			content = minor_stress_impact_loss
			impatient = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = callous
					has_trait = sadistic
					has_trait = ambitious
					has_trait = patient
				}
			}
		}
	}
}

############################
# Mare's Milk
# by Lucas Ribeiro
############################
travel_events_fp3.0040 = {
	type = character_event
	title = travel_events_fp3.0040.t
	desc = {
		desc = travel_events_fp3.0040.desc.intro
		# Turkic travelers have GOOD intentions and you speak their language
		first_valid = {
			triggered_desc = {
				trigger = {
					scope:fp3_turkic_traveler = {
						has_character_flag = good_intentions
					}
					root = {
						knows_language_of_culture = scope:fp3_turkic_traveler.culture
					}
				}
				desc = travel_events_fp3.0040.desc.intro.a
			}
			# Turkic travelers have BAD intentions and you speak their language
			triggered_desc = {
				trigger = {
					scope:fp3_turkic_traveler = {
						has_character_flag = bad_intentions
					}
					root = {
						knows_language_of_culture = scope:fp3_turkic_traveler.culture
					}
				}
				desc = travel_events_fp3.0040.desc.intro.b
			}
			# You don't speak the turkic traveler's language
			triggered_desc = {
				desc = travel_events_fp3.0040.desc.intro.c
			}
		}
	}
	theme = travel
	left_portrait = {
		character = root
		animation = paranoia
	}
	right_portrait = {
		character = scope:fp3_turkic_traveler
		animation = toast_goblet
	}
	cooldown = {
		years = 10
	}
	trigger = {
		has_dlc_feature = legacy_of_persia
		is_available_travelling_adult = yes
		is_playable_character = yes
		is_ai = no #Cultural acceptance volatility
		#We do not check local culture since this represents the nomadic incursions of Turkic warriors into Iran.
		current_date > "990.01.1" #before this it does not make sense to run into nomadic turkic warriors in Iran
		root.location = { geographical_region = dlc_fp3_greater_persian_frontier_regions }
		root.culture = {
			NOT = {
				has_cultural_pillar = heritage_turkic
			}
		}
	}
	immediate = {
		wayfarer_storyteller_fame_effect = { VALUE = roaming_reward_fame_small }
		create_character = {
			template = fp3_turkic_traveler
			location = root.location
			faith = root.location.county.faith
			save_scope_as = fp3_turkic_traveler
		}
		hidden_effect = {
			random_list = {
				1 = { scope:fp3_turkic_traveler = { add_character_flag = good_intentions } }
				1 = { scope:fp3_turkic_traveler = { add_character_flag = bad_intentions } }
			}
		}
	}

	# I understand their language and drink with them
	option = {
		name = travel_events_fp3.0040.a
		trigger = {
			scope:fp3_turkic_traveler = {
				has_character_flag = good_intentions
			}
			root = {
				knows_language_of_culture = scope:fp3_turkic_traveler.culture
			}
		}
		flavor = travel_events_fp3.0040.ab.tt
		scope:fp3_turkic_traveler = {
			if = {
				limit = {
					root = {
						is_ai = yes
					}
				}
				silent_disappearance_effect = yes
			}
		}
		scope:fp3_turkic_traveler = {
			culture = {
				change_cultural_acceptance = {
					target = root.culture
					value = minor_cultural_acceptance_gain
					desc = cultural_acceptance_gain_event
				}
			}
		}
		add_prestige = minor_prestige_gain

		stress_impact = {
			paranoid = medium_stress_impact_gain
			shy = minor_stress_impact_gain
			trusting = medium_stress_impact_loss
			gregarious = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = paranoid
					has_trait = shy
				}
			}
		}
	}

	#I understand their language and imprison them
	option = {
		name = travel_events_fp3.0040.b
		trigger = {
			scope:fp3_turkic_traveler = {
				has_character_flag = bad_intentions
			}
			root = {
				knows_language_of_culture = scope:fp3_turkic_traveler.culture
			}
		}
		flavor = travel_events_fp3.0040.ab.tt
		add_prestige = minor_prestige_gain
		rightfully_imprison_character_effect = {
			TARGET = scope:fp3_turkic_traveler
			IMPRISONER = root
		}
		stress_impact = {
			forgiving = medium_stress_impact_gain
			compassionate = minor_stress_impact_gain
			just = medium_stress_impact_loss
			vengeful = medium_stress_impact_loss
			wrathful = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = forgiving
					has_trait = compassionate
				}
			}
		}
	}

	#I do not understand them and take a risk drinking the kumis
	option = {
		name = travel_events_fp3.0040.c
		trigger = {
			root = {
				NOT = {
					knows_language_of_culture = scope:fp3_turkic_traveler.culture
				}
			}
		}
		scope:fp3_turkic_traveler = {
			if = {
				limit = {
					root = {
						is_ai = yes
					}
				}
				silent_disappearance_effect = yes
			}
		}
		random_list = {
			1 = {
				desc = travel_events_fp3.0040.c.success
				send_interface_toast = {
					title = travel_events_fp3.0040.c.success.t
					left_icon = root
					scope:fp3_turkic_traveler = {
						culture = {
							change_cultural_acceptance = {
								target = root.culture
								value = minor_cultural_acceptance_gain
								desc = cultural_acceptance_gain_event
							}
						}
					}
					add_character_modifier = {
						modifier = fp3_had_delicious_kumis
						years = 10
					}
				}
			}
			1 = {
				desc = travel_events_fp3.0040.c.failure
				send_interface_toast = {
					left_icon = root
					title = travel_events_fp3.0040.c.failure.t
					remove_short_term_gold = minor_gold_value
					add_prestige = minor_prestige_loss
				}
			}
		}
		stress_impact = {
			shy = minor_stress_impact_gain
			craven = minor_stress_impact_gain
			paranoid = medium_stress_impact_gain
			trusting = medium_stress_impact_loss
			brave = minor_stress_impact_loss
			gregarious = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = shy
					has_trait = craven
					has_trait = paranoid
				}
			}
		}
	}

	#I insult them by not drinking the kumis
	option = {
		name = travel_events_fp3.0040.d
		scope:fp3_turkic_traveler = {
			if = {
				limit = {
					root = {
						is_ai = yes
					}
				}
				silent_disappearance_effect = yes
			}
		}
		add_character_modifier = {
			modifier = rebuffed_turkic_war_band
			years = 10
		}
		scope:fp3_turkic_traveler = {
			culture = {
				change_cultural_acceptance = {
					target = root.culture
					value = minor_cultural_acceptance_loss
					desc = cultural_acceptance_gain_event
				}
			}
		}
		stress_impact = {
			trusting = medium_stress_impact_gain
			brave = minor_stress_impact_gain
			craven = minor_stress_impact_loss
			paranoid = medium_stress_impact_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = trusting
					has_trait = brave
				}
			}
		}
	}

	#I pay them to join me
	option = {
		name = travel_events_fp3.0040.e
		trigger = {
			can_start_scheme = {
				type = learn_language
				target_character = scope:fp3_turkic_traveler
			}
		}
		add_character_modifier = {
			modifier = turkic_war_band
			years = 10
		}
		pay_short_term_gold = {
			target = scope:fp3_turkic_traveler
			gold = major_gold_value
		}
		add_courtier = scope:fp3_turkic_traveler
		root.current_travel_plan = {
			add_companion = scope:fp3_turkic_traveler
		}
		scope:fp3_turkic_traveler = {
			add_character_flag = {
				flag = blocked_from_leaving
				years = 10
			}
		}
		start_scheme = {
			type = learn_language
			target_character = scope:fp3_turkic_traveler
		}
		custom_tooltip = learn_language_with_bonus_tt
		hidden_effect = {
			random_scheme = {
				type = learn_language
				limit = {
					scheme_target_character = scope:fp3_turkic_traveler
				}
				add_scheme_modifier = {
					type = xenophile_bonus_modifier
				}
			}
		}
		stress_impact = {
			greedy = medium_stress_impact_gain
			shy = medium_stress_impact_gain
			impatient = minor_stress_impact_gain
			generous = medium_stress_impact_loss
			gregarious = minor_stress_impact_loss
			patient = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = greedy
					has_trait = shy
					has_trait = impatient
				}
			}
		}
	}
}

############################
# Tomb Raiders
# by Lucas Ribeiro
############################
travel_events_fp3.0050 = {
	type = character_event
	title = travel_events_fp3.0050.t
	desc = travel_events_fp3.0050.desc.intro
	theme = travel
	left_portrait = {
		character = root
		animation = disapproval
	}
	right_portrait = {
		character = scope:fp3_tomb_raider
		animation = shame
	}
	cooldown = {
		years = 10
	}
	trigger = {
		has_dlc_feature = legacy_of_persia
		is_available_travelling_adult = yes
		is_playable_character = yes
		NOR = {
			has_character_modifier = ancient_persian_relics
		}
		root.location = {
			geographical_region = world_persian_empire
		}
	}
	immediate = {
		wayfarer_storyteller_fame_effect = { VALUE = roaming_reward_fame_small }
		create_character = {
			template = fp3_tomb_raider
			location = root.location
			culture = root.location.county.culture
			faith = root.location.county.faith
			#Set up the scope
			save_scope_as = fp3_tomb_raider
		}
		if = {
			limit = {
				current_travel_plan = {
					any_entourage_character = {
						stewardship > root.stewardship
					}
				}
			}
			current_travel_plan = {
				ordered_entourage_character = {
					order_by = stewardship
					save_scope_as = entourage_helper
				}
			}
		}
	}

	#Imprison the Tomb Raiders
	option = {
		name = travel_events_fp3.0050.a

		if = {
			limit = {
				faith = {
					has_doctrine = tenet_ancestor_worship
				}
			}
			add_piety = major_piety_gain
		}
		else_if = {
			limit = {
				faith = {
					OR = {
						trait_is_virtue = compassionate
						trait_is_virtue = generous
					}
				}
			}
			add_piety = medium_piety_gain
		}
		rightfully_imprison_character_effect = {
			TARGET = scope:fp3_tomb_raider
			IMPRISONER = root
		}

		stress_impact = {
			forgiving = minor_stress_impact_gain
			compassionate = minor_stress_impact_gain
			just = minor_stress_impact_loss
			zealous = minor_stress_impact_loss
		}

		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = cynical
					has_trait = forgiving
					has_trait = compassionate
				}
			}
		}
	}

	#Try to get the best pick of the loot
	option = {
		name = travel_events_fp3.0050.b

		if = {
			limit = {
				exists = scope:entourage_helper
			}
			custom_tooltip = travel_events_fp3.0050.b.entourage

			scope:entourage_helper = {
					duel = {
						skill = stewardship
						value = medium_skill_rating
						# Success.
						40 = {
							desc = travel_events_fp3.0050.b.success.desc
							compare_modifier = {
								value = scope:duel_value
								multiplier = 3.5
								min = -49
							}
							custom_tooltip = travel_events_fp3.0050.b.success.tooltip
							hidden_effect = {
								random_list = {
									25 = {
										#This means you get a modifier instead, in the notification effect
										root = { add_character_flag = treasure_modifier }
										modifier = {
											factor = 2
											root = { has_royal_court = yes }
										}
										modifier = {
											factor = 0.1
											stewardship > high_skill_rating
										}
									}
									15 = { #Islamic Relic
										trigger = { root = { has_royal_court = yes } }
										scope:fp3_tomb_raider = { create_artifact_pedestal_islamic_relic_effect_hist = { OWNER = scope:fp3_tomb_raider } }
										modifier = {
											factor = 0.1
											stewardship > high_skill_rating
										}
									}
									15 = { #Zoroastrian Relic
										trigger = {
											root = { has_royal_court = yes }
										}
										scope:fp3_tomb_raider = {
											random_list = {
												50 = {
													create_artifact_pedestal_branch_relic_zoroastr_effect = {
														OWNER = scope:fp3_tomb_raider
													}
												}
												50 = {
													create_artifact_afarganyu_effect = {
														OWNER = scope:fp3_tomb_raider
													}
												}
											}
										}
										modifier = {
											factor = 0.1
											stewardship > high_skill_rating
										}
									}
									1 = { #Shamshir-e Zomorrodnegar
										trigger = {
											root = { has_royal_court = yes }
											any_artifact = {
												count < 1
												has_variable = zomorrodnegar
											}
										}
										scope:fp3_tomb_raider = {
											create_artifact_zomorrodnegar_effect = { OWNER = scope:fp3_tomb_raider }
										}
									}
									10 = { #Sassanian Sword
										trigger = {
											any_artifact = {
												count < 10
												has_variable = sassanian_sword
											}
										}
										scope:fp3_tomb_raider = {
											create_artifact_sassanian_sword_effect = { OWNER = scope:fp3_tomb_raider }
										}
									}
									1 = { #Cup of Jamshid
										trigger = {
											root = { has_royal_court = yes }
											NOT = {
												any_artifact = {
													has_variable = cup_jamshid
												}
											}
										}
										scope:fp3_tomb_raider = {
											create_artifact_pedestal_cup_jamshid_effect = { OWNER = scope:fp3_tomb_raider }
										}
									}
									1 = { #Armor of Alexander the Great
										trigger = {
											root = { has_royal_court = yes }
											any_artifact = {
												count < 1
												has_variable = arms_of_alex
											}
										}
										scope:fp3_tomb_raider = {
											create_artifact_arms_of_alexander_effect = { OWNER = scope:fp3_tomb_raider }
										}
									}
									1 = { #Dagger of Rostam
										trigger = {
											root = { has_royal_court = yes }
											any_artifact = {
												count < 1
												has_variable = dagger_of_rostam
											}
										}
										scope:fp3_tomb_raider = {
											create_artifact_dagger_of_rostam_effect = { OWNER = scope:fp3_tomb_raider }
										}
									}
									1 = { #Babr E Bayan
										trigger = {
											root = { has_royal_court = yes }
											NOT = {
												any_artifact = {
													has_variable = babr_e_bayan
												}
											}
										}
										scope:fp3_tomb_raider = {
											create_artifact_sculpture_babr_e_bayan_effect = { OWNER = scope:fp3_tomb_raider }
										}
									}
									5 = { #Ancent Bracelet
										scope:fp3_tomb_raider = {
											create_artifact_oxus_bracelet_effect = { OWNER = scope:fp3_tomb_raider }
										}
									}
									10 = { #Ancient Drinking Vessel
										scope:fp3_tomb_raider = { create_artifact_fp3_ancient_drinking_vessel_effect = { OWNER = scope:fp3_tomb_raider } }
									}
								}
							} #Success chance is weighted up if you have brought high stewardship characters on your journey.
							if = {
								limit = { exists = scope:newly_created_artifact }
								root = {
									send_interface_toast = {
										title = travel_events_fp3.0050.b.success.desc
										left_icon = root
										right_icon = scope:newly_created_artifact
										scope:newly_created_artifact = { set_owner = root }
									}
								}
							}
							else = {
								root = {
									send_interface_toast = {
										title = travel_events_fp3.0050.b.success.desc
										left_icon = root
										if = {
											limit = {
												has_character_flag = treasure_modifier
											}
											add_character_modifier = {
												modifier = ancient_persian_relics
												years = 5
											}
											remove_character_flag = treasure_modifier
										}
									}
								}
							}
						}

						# Failure.
						60 = {
							desc = travel_events_fp3.0050.b.failure.desc
							compare_modifier = {
								value = scope:duel_value
								multiplier = -3.5
								min = -49
							}
							if = {
								limit = { exists = scope:newly_created_artifact }
								hidden_effect = { destroy_artifact = scope:newly_created_artifact }
							}
							root = {
								send_interface_toast = {
									title = travel_events_fp3.0050.b.failure.t
									left_icon = root
									add_short_term_gold = minor_gold_value
								}
							}
						}
					}
			}
		}
		else = {
			duel = {
				skill = stewardship
				value = medium_skill_rating
				# Success.
				40 = {
					desc = travel_events_fp3.0050.b.success.desc
					compare_modifier = {
						value = scope:duel_value
						multiplier = 3.5
						min = -49
					}
					custom_tooltip = travel_events_fp3.0050.b.success.tooltip
					hidden_effect = {
						random_list = {
							25 = {
								add_character_flag = treasure_modifier
								modifier = {
									factor = 2
									root = { has_royal_court = yes }
								}
							}
							15 = { #Islamic Relic
								trigger = { root = { has_royal_court = yes } }
								scope:fp3_tomb_raider = {
								create_artifact_pedestal_islamic_relic_effect_hist = { OWNER = scope:fp3_tomb_raider } }
							}
							15 = { #Zoroastrian Relic
								trigger = {
									root = { has_royal_court = yes }
								}
								scope:fp3_tomb_raider = {
									random_list = {
										50 = {
											create_artifact_pedestal_branch_relic_zoroastr_effect = {
												OWNER = scope:fp3_tomb_raider
											}
										}
										50 = {
											create_artifact_afarganyu_effect = {
												OWNER = scope:fp3_tomb_raider
											}
										}
									}
								}
							}
							1 = { #Shamshir-e Zomorrodnegar
								trigger = {
									root = { has_royal_court = yes }
									any_artifact = {
										count < 1
										has_variable = zomorrodnegar
									}
									scope:location ?= {
										OR = {
											geographical_region = world_asia_minor
											geographical_region = world_middle_east
											geographical_region = world_middle_east_persia
										}
									}
								}
								scope:fp3_tomb_raider = {create_artifact_zomorrodnegar_effect = { OWNER = scope:fp3_tomb_raider } }
							}
							10 = { #Sassanian Sword
								trigger = {
									any_artifact = {
										count < 10
										has_variable = sassanian_sword
									}
								}
								scope:fp3_tomb_raider = { create_artifact_sassanian_sword_effect = { OWNER = scope:fp3_tomb_raider } }
							}
							1 = { #Cup of Jamshid
								trigger = {
									root = { has_royal_court = yes }
									NOT = {
										any_artifact = {
											has_variable = cup_jamshid
										}
									}
								}
								scope:fp3_tomb_raider = { create_artifact_pedestal_cup_jamshid_effect = { OWNER = scope:fp3_tomb_raider } }
							}
							1 = { #Armor of Alexander the Great
								trigger = {
									root = { has_royal_court = yes }
									any_artifact = {
										count < 1
										has_variable = arms_of_alex
									}
								}
								scope:fp3_tomb_raider = {create_artifact_arms_of_alexander_effect = { OWNER = scope:fp3_tomb_raider } }
							}
							1 = { #Dagger of Rostam
								trigger = {
									root = { has_royal_court = yes }
									any_artifact = {
										count < 1
										has_variable = dagger_of_rostam
									}
								}
								scope:fp3_tomb_raider = {create_artifact_dagger_of_rostam_effect = { OWNER = scope:fp3_tomb_raider } }
							}
							1 = { #Babr E Bayan
								trigger = {
									root = { has_royal_court = yes }
									NOT = {
										any_artifact = {
											has_variable = babr_e_bayan
										}
									}
								}
								scope:fp3_tomb_raider = {create_artifact_sculpture_babr_e_bayan_effect = { OWNER = scope:fp3_tomb_raider } }
							}
							5 = { #Ancent Bracelet
								scope:fp3_tomb_raider = {create_artifact_oxus_bracelet_effect = { OWNER = scope:fp3_tomb_raider } }
							}
							10 = { #Ancient Drinking Vessel
								scope:fp3_tomb_raider = {create_artifact_fp3_ancient_drinking_vessel_effect = { OWNER = scope:fp3_tomb_raider } }
							}
						}
					}
					if = {
						limit = { exists = scope:newly_created_artifact }
						send_interface_toast = {
							title = travel_events_fp3.0050.b.success.desc
							left_icon = root
							right_icon = scope:newly_created_artifact
							scope:newly_created_artifact = { set_owner = root }
						}
					}
					else = {
						send_interface_toast = {
							title = travel_events_fp3.0050.b.success.desc
							left_icon = root
							if = {
								limit = {
									has_character_flag = treasure_modifier
								}
								add_character_modifier = {
									modifier = ancient_persian_relics
									years = 5
								}
								remove_character_flag = treasure_modifier
							}
						}
					}
				}

				# Failure.
				60 = {
					desc = travel_events_fp3.0050.b.failure.desc
					compare_modifier = {
						value = scope:duel_value
						multiplier = -3.5
						min = -49
					}
					if = {
						limit = { exists = scope:newly_created_artifact }
						hidden_effect = { destroy_artifact = scope:newly_created_artifact }
					}
					send_interface_toast = {
						title = travel_events_fp3.0050.b.failure.t
						left_icon = root
						add_short_term_gold = minor_gold_value
					}
				}
			}
		}
		
		if = {
			limit = {
				faith = {
					has_doctrine = tenet_ancestor_worship
				}
			}
			add_piety = major_piety_loss
		}
		else_if = {
			limit = {
				faith = {
					OR = {
						trait_is_virtue = compassionate
						trait_is_virtue = generous
					}
				}
			}
			add_piety = medium_piety_loss
		}
		stress_impact = {
			just = minor_stress_impact_gain
			zealous = minor_stress_impact_gain
			arbitrary = minor_stress_impact_loss
			cynical = minor_stress_impact_loss
		}

		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = just
					has_trait = zealous
					has_trait = generous
				}
			}
		}
	}

	#You don't interfere
	option = {
		name = travel_events_fp3.0050.c

		stress_impact = {
			zealous = minor_stress_impact_gain
			cynical = minor_stress_impact_loss
		}

		add_prestige = miniscule_prestige_gain

		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_zeal = -1
				ai_energy = 1
			}
		}
	}
	after = {
		scope:fp3_tomb_raider = {
			silent_disappearance_ai_effect = yes
		}
	}
}
