﻿# EK NOTE: removed vanilla references
namespace = travel_events

############################
## Travel Flavor Events
## 3000-3999
## by Veronica Pazos
############################
# travel_events.3000-3001 - Grotesques
# travel_events.3010-3012 - Lost pet
# travel_events.3020-3022 - Warm welcome
# travel_events.3030 - Infatuated knight
# travel_events.3040 - Curious bishop
# travel_events.3050 - Campfire (TODO)
# travel_events.3060-3062 - Hermit
# travel_events.3070 - Danger! Bridge bandits
# travel_events.3080-3081 - Knight errant
# travel_events.3090 - Temple visiting
# travel_events.3100 - Danger! Your horses cannot survive in the steppe
# travel_events.3120 - Danger! Taiga/Jungle/Forest fire
# travel_events.3130 - Danger! Rival hires assassin to get you
# travel_events.3140 - Danger! Army in occupied province tries to capture you
# travel_events.3150 - Danger! Rival/Nemesis in your entourage plots against you
# travel_events.3160 - Danger! Forest - A Murder of Crows
#
#

##################################################
# Grotesque events (based on William of Rubruck being very sad because he couldn't find any)
# by Veronica Pazos
# 3000-3001
##################################################

#Rumours about grotesques 
travel_events.3000 = { 
    type = character_event
    title = travel_events.3000.t
    desc = travel_events.3000.desc
    theme = travel
    left_portrait = {
		character = root
		triggered_animation = {
			trigger = { 
				has_trait = cynical
			}
			animation = disbelief
		}
		animation = admiration
	}
    right_portrait = {
        character = scope:traveller_monk
        animation = personality_rational
    }
    cooldown = { years = 30 }
	
    trigger = {
		static_group_filter = {
			group = travel_events.3000
			match = 0.25
		}
		is_available_travelling_adult = yes 
        is_landed = yes
        is_location_valid_for_travel_event_on_land = yes
        exists = cp:councillor_court_chaplain
		location = {
			exists = this.county.holder
			this.county.holder = {
				NOR = {
					this.top_liege = root
					this.liege = root
					this = root
				}
			}
			NOR = {
				culture = root.culture
				religion = root.religion
			}
		}	
		current_travel_plan = {
			any_entourage_character = {  
				OR = {
					AND = {
						exists = root.cp:councillor_court_chaplain
						this = root.cp:councillor_court_chaplain
					}
					NOT = { has_trait = cynical }
				}
			}
			next_destination_province = {
				exists = this.county.holder
				this.county.holder = {
					NOR = {
						this.top_liege = root
						this.liege = root
						this = root
					}
				}
				NOR = {
					culture = root.culture
					religion = root.religion
				}
			}	
		}
    }
	
	weight_multiplier = {
		base = 1
		modifier = {
			factor = 2
			has_trait = scholar
		}
		modifier = {
			factor = 2
			exists = root.cp:councillor_court_chaplain
			current_travel_plan = {
				any_entourage_character = {
					this = root.cp:councillor_court_chaplain
				}
			}
		}
		modifier = {
			factor = -0.5
			has_trait = cynical
		}
	}
	
    immediate = {
    	wayfarer_storyteller_fame_effect = { VALUE = roaming_reward_fame_small }
		if = {
			limit = {
				exists = root.cp:councillor_court_chaplain
				current_travel_plan = {
					any_entourage_character = {
						this = root.cp:councillor_court_chaplain
					}
				}
			} 
			cp:councillor_court_chaplain = { save_scope_as = traveller_monk }
		}
		else = {
			current_travel_plan = {
				ordered_entourage_character = {
					limit = {
						NOT = { has_trait = cynical }
					}
					order_by = learning
					save_scope_as = traveller_monk
				}
			}
		}
		current_travel_plan = {
			save_scope_as = grotesque_travel_plan
		}
	}
	
    #You want to see them. NOW!
    option = { 
        name = travel_events.3000.a
		trigger = {
			NOT = { has_trait = scholar }
		}
		custom_tooltip = travel_events.3000.a.tt
		current_travel_plan = {
			add_travel_plan_modifier = grotesque_rush_modifier
		}
		trigger_event = { id = travel_events.3001 days = 10 }
		stress_impact = {
			cynical = medium_stress_impact_gain
		}
		ai_chance = {
            base = 100
            ai_value_modifier = {
                ai_boldness = 0.75 
            }
        }
    }
	
    #You ask the bishop to tell you more about them
    option = { 
        name = travel_events.3000.b
		if = {
			limit = { has_focus = education_learning }
			add_learning_lifestyle_xp = medium_lifestyle_xp
		}
		add_character_modifier = { 
			modifier = travel_events.3000_interest_modifier
			years = 5
		}
		hidden_effect = {
			random_list = {
				25 = {
					trigger_event = { id = travel_events.3001 days = 10 }
				}
				75 = {
					#Nothing happens
				}
			}
		}
		stress_impact = {
			lazy = minor_stress_impact_gain
			cynical = medium_stress_impact_gain
		}
        ai_chance = {
            base = 100
			modifier = {
				learning >= medium_skill_rating
				add = 20
			}
            ai_value_modifier = {
                ai_sociability = 0.5
            }
        }
    }
	
    #You really don't care
    option = { 
        name = travel_events.3000.c
        trigger = {
			OR = {
				has_trait = cynical
				has_trait = intellect_bad
				has_trait = lazy
			}
		}
		stress_impact = {
			base = minor_stress_impact_loss
		}
        ai_chance = {
            base = 100
            ai_value_modifier = {
				ai_rationality = 0.5 #not 1 because even rational people believed in this
            }
        }
    }
	
	#You care so much you want to study them
	option = {
		name = travel_events.3000.d
		trigger = { has_trait = scholar }
		custom_tooltip = travel_events.3000.a.tt
		current_travel_plan = {
			add_travel_plan_modifier = grotesque_scholar_modifier
		}
		trigger_event = { id = travel_events.3001 }
		stress_impact = {
			base = minor_stress_impact_loss
			cynical = major_stress_impact_gain
		}
		ai_chance = {
            base = 100
			modifier = { #a scholar will always pick this
				has_trait = scholar
				add = 100
			}
			modifier = {
				learning >= medium_skill_rating
				add = 20
			}
			modifier = {
				has_trait = journaller
				add = 20
			}
        }
	}
}

#They don't exist - take an l
travel_events.3001 = { 
    type = character_event
    title = travel_events.3001.t
    desc = {
		desc = travel_events.3001.desc_intro 
		first_valid = {
			triggered_desc = {
				trigger = { 
					has_trait = cynical
				}
				desc = travel_events.3001.desc_cynical
			}
			desc = travel_events.3001.desc.fallback
		}
		desc = travel_events.3001.desc.outro
	}
    theme = travel
    left_portrait = {
		character = root
		triggered_animation = {
			trigger = { 
				has_trait = cynical
			}
			animation = schadenfreude
		}
		animation = sadness
	}
	right_portrait = {
        character = scope:traveller_monk
        animation = worry
    }
	
	trigger = {
		is_location_valid_for_travel_event_on_land = yes
		current_travel_plan = { this = scope:grotesque_travel_plan } #you're still in the same travel
	}
	
	immediate = {
		location = { save_scope_as = grotesque_place }
	}
	
    #Oh... okay...
    option = { 
        name = travel_events.3001.a
		add_character_modifier = {
			modifier = satiated_curiosity
			years = 5
		}
		stress_impact = {
			arrogant = medium_stress_impact_gain
			scholar = medium_stress_impact_gain
			stubborn = medium_stress_impact_gain
			irritable = medium_stress_impact_gain
		}			
		ai_chance = {
            base = 100
            ai_value_modifier = {
                ai_boldness = -1
				ai_energy = -0.5
				ai_rationality = 0.5
            }
        }
    }
	
    #You PROMISED me
    option = { 
        name = travel_events.3001.b
		reverse_add_opinion = {
			target = scope:traveller_monk
			modifier = insult_opinion
			opinion = -20
		}
		stress_impact = {
			base = medium_stress_impact_loss #you lose stress because this is not on you
			callous = medium_stress_impact_loss
			wrathful = medium_stress_impact_loss
			vengeful = medium_stress_impact_loss
			trusting = medium_stress_impact_gain
			just = medium_stress_impact_gain
			compassionate = major_stress_impact_gain
		}
		ai_chance = {
            base = 100
            ai_value_modifier = {
                ai_sociability = -0.5
				ai_compassion = -1
            }
        }
	}
	
	#You PROMISED me and Im terrible
	option = {
		name = travel_events.3001.b_sadistic
		trigger = {
			OR = {
				has_trait = callous
				has_trait = sadistic
				dread >= high_dread
			}
		}
		imprison_character_effect = {
			TARGET = scope:traveller_monk
			IMPRISONER = root
		}
		reverse_add_opinion = {
			target = scope:traveller_monk
			modifier = cruelty_opinion
			opinion = -30
		}
		stress_impact = {
			callous = minor_stress_impact_loss
			wrathful = minor_stress_impact_loss
			sadistic = medium_stress_impact_loss
			trusting = major_stress_impact_gain
			just = major_stress_impact_gain
			compassionate = major_stress_impact_gain
		}
		ai_chance = {
            base = 100
			modifier = {
				has_trait = sadistic
				add = 100
			}
            ai_value_modifier = {
                ai_sociability = -0.75
				ai_compassion = -1
            }
        }
	}
	
	#HAH! I knew it
	option = {
		name = travel_events.3001.c
		trigger = { has_trait = cynical }
		stress_impact = {
			base = medium_stress_impact_loss
		}
		ai_chance = {
            base = 100
			modifier = {
				has_trait = cynical
				add = 100
			}
            ai_value_modifier = {
				ai_rationality = 0.5
            }
        }
	}
	
	#We just need to look a bit further
	option = {
		name = travel_events.3001.d
		trigger = {
			AND = {
				OR = {
					has_trait = arrogant #you cannot understand you may be wrong
					has_trait = stubborn
					has_trait = eccentric
				}
				NOT = { has_trait = cynical }
			}
		}
		add_character_modifier = {
			modifier = cryptid_obssessed
			years = 5
		}
		current_travel_plan = {
			add_travel_plan_modifier = cryptid_obssessed_rush
		}
		stress_impact = {
			eccentric = major_stress_impact_loss
			base = medium_stress_impact_gain
			arrogant = minor_stress_impact_gain
		}
		ai_chance = {
            base = 100
            ai_value_modifier = {
                ai_boldness = 1
				ai_energy = 0.25
				ai_rationality = -0.5
            }
        }
	}
	
	#Lie about it and write home
	option = {
		name = travel_events.3001.e
		trigger = {
			OR = {
				has_trait = scholar
				has_trait = journaller
				has_trait = arbitrary
				has_trait = gregarious
			}
		}
		duel = {
			skill = diplomacy
			value = low_skill_rating
			50 = {
				desc = travel_events.3001.e.success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
				}
				send_interface_toast = {
					title = travel_events.3001.e.success
					left_icon = root
					add_prestige = minor_prestige_gain
				}
			}
			50 = {
				desc = travel_events.3001.e.failure
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
				}
				send_interface_toast = {
					title = travel_events.3001.e.failure
					left_icon = root
					add_prestige = minor_prestige_loss
				}
			}
		}
		ai_chance = {
            base = 100
			modifier = {
				has_trait = journaller #a journaller will always pick this
				add = 100
			}
			modifier = {
				has_trait = gregarious #you can't trust social people
				add = 30
			}
			modifier = {
				has_trait = arbitrary
				add = 20
			}
		}
	}
}

##################################################
# Pet gets lost
# by Veronica Pazos
# 3010-3012
##################################################

scripted_trigger travel_events_3010_slow_runner = {
	OR = {
		has_trait = dwarf
		has_trait = clubfooted
		has_trait = physique_bad
		has_trait = weak
		has_trait = maimed
	}
}

#Your pet chases something into the wild
travel_events.3010 = { 
    type = character_event
    title = travel_events.3010.t
    desc = {
		desc = travel_events.3010.intro
		first_valid = {
			triggered_desc = {
				trigger =  { exists = scope:pet_rescuer }
				desc = travel_events.3010.desc
			}
			desc = travel_events.3010.alone
		}
		first_valid = {
			triggered_desc = {
				trigger = {
					has_exotic_pet_trigger = yes
				}
				desc = travel_events.3010.exotic
			}
			triggered_desc = {
				trigger = {
					has_named_cat_trigger = yes
				}
				desc = travel_events.3010.cat
			}
			triggered_desc = {
				trigger = {
					has_named_dog_trigger = yes
				}
				desc = travel_events.3010.dog
			}
		}
	}
    theme = travel
    left_portrait = {
		character = root
		animation = shock
	}
	right_portrait = {
		character = scope:pet_rescuer
		animation = personality_bold
	}
    cooldown = { years = 25 }
	
    trigger = {
		static_group_filter = {
			group = travel_events.3010
			match = 0.25
		}
        is_available_travelling_adult = yes 
        is_playable_character = yes
		has_alive_pet_trigger = yes #your pet rock cannot follow something into the forest
		is_location_valid_for_travel_event_on_land = yes
    }
	
    immediate = {
    	current_travel_plan = {
    		save_scope_as = pet_travel_plan
			if = {
				limit = { exists = travel_leader }
				travel_leader = { save_scope_as = pet_rescuer }
			}
			else_if = {
				limit = {
					any_entourage_character = {
						NOT = { this = ROOT }
						NOT = { has_trait = one_legged }
					}
				}
				ordered_entourage_character = {
					limit = {
						NOT = { this = ROOT }
						NOT = { has_trait = one_legged }
					}
					order_by = martial
					save_scope_as = pet_rescuer
				}
			}
		}
	}
	
    #Send someone to get it
    option = {
		name = {
			trigger = {
				has_exotic_pet_trigger = yes
			}
			text = travel_events.3010.a_exotic
		}
		name = {
			trigger = {
				has_named_cat_trigger = yes
			}
			text = travel_events.3010.a_cat
		}
		name = {
			trigger = {
				has_named_dog_trigger = yes
			}
			text = travel_events.3010.a_dog
		}
		trigger = { exists = scope:pet_rescuer}
		scope:pet_rescuer = {
			duel = {
				skill = martial
				value = medium_skill_rating
				50 = {
					desc = travel_events.3010.a.success
					compare_modifier = {
						value = scope:duel_value
						multiplier = 3.5
					}
					modifier = {
						has_trait = athletic
						add = 2
					}
					modifier = {
						has_trait = physique_good
						add = 1
					}
					root = {
						trigger_event = travel_events.3011
					}
				}
				50 = {
					desc = travel_events.3010.a.failure
					compare_modifier = {
						value = scope:duel_value
						multiplier = -3.5
					}
					modifier = {
						travel_events_3010_slow_runner = yes
						add = 1.5
					}
					root = {
						send_interface_toast = {
							title = travel_events.3010.a.failure_toast
							left_icon = scope:pet_rescuer
							scope:pet_rescuer = {
								increase_wounds_effect = {
									REASON = lost_in_the_forest
								}
							}
						}
					}
					hidden_effect = {
						random_list = {
							30 = {
								root = {
									trigger_event = {
										id = travel_events.3011
										days = { 1 30 }
									}
								}
							}
							65 = { }
							5 = {
								modifier = {
									add = 25
									has_exotic_pet_trigger = yes
								}
								root = {
									trigger_event = {
										id = travel_events.3012
										days = { 1 30 }
									}
								}
							}
						}
					}
				}
			}
		}
		if = {
			limit = {
				scope:pet_rescuer = {
					travel_events_3010_slow_runner = yes
				}
			}
			scope:pet_rescuer = { #they like you less for this
				add_opinion = {
					target = root
					modifier = angry_opinion
					opinion = -20
				}
			}
		}
		
		stress_impact = {
			callous = medium_stress_impact_gain
		}
		
		ai_chance = {
			base = 100
			modifier = {
				has_trait = compassionate
				add = 50
			}
			modifier = {
				has_trait = callous 
				factor = 0.35
			}
		}
    }
	
    #Im sure it'll find its way back
    option = {
		name = {
			trigger = {
				has_exotic_pet_trigger = yes
			}
			text = travel_events.3010.b_exotic
		}
		name = {
			trigger = {
				has_named_cat_trigger = yes
			}
			text = travel_events.3010.b_cat
		}
		name = {
			trigger = {
				has_named_dog_trigger = yes
			}
			text = travel_events.3010.b_dog
		}
		random_list = {
			50 = { 
				custom_tooltip = travel_events.3010.b.tt #TODO_CD_FGK Check out
				send_interface_toast = {
					title = travel_events.3010.b.tt
					left_icon = root
				}
			}
			45 = {
				custom_tooltip = travel_events.3010.b.tt2
				trigger_event = { id = travel_events.3011 days = { 1 30 } }
			}
			5 = {
				modifier = {
					add = 45
					has_exotic_pet_trigger = yes
				}
				custom_tooltip = travel_events.3010.b.tt3
				trigger_event = { id = travel_events.3012 days = { 1 30 } }
			}
		}
		stress_impact = {
			base = medium_stress_impact_gain
			callous = minor_stress_impact_loss #so it weights it down
			compassionate = medium_stress_impact_gain
		}
		
		ai_chance = {
            base = 100
			modifier = {
				has_trait = compassionate
				factor = 0
			}
			modifier = {
				has_trait = callous
				add = 50
			}
		}
    }
	
	#Follow it 
	option = {
		name = {
			trigger = {
				has_exotic_pet_trigger = yes
			}
			text = travel_events.3010.c_exotic
		}
		name = {
			trigger = {
				has_named_cat_trigger = yes
			}
			text = travel_events.3010.c_cat
		}
		name = {
			trigger = {
				has_named_dog_trigger = yes
			}
			text = travel_events.3010.c_dog
		}
		duel = {
			skill = martial
			value = medium_skill_rating
			50 = {
				desc = travel_events.3010.c.success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
				}
				modifier = {
					has_trait = athletic
					add = 2
				}
				modifier = {
					has_trait = physique_good
					add = 1
				}
				trigger_event = travel_events.3011
			}
			50 = {
				desc = travel_events.3010.c.failure
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
				}
				modifier = {
					travel_events_3010_slow_runner = yes
					add = 1.5
				}
				send_interface_toast = {
					title = travel_events.3010.c.failure_toast
					left_icon = root
					increase_wounds_effect = {
						REASON = lost_in_the_forest
					}
				}
				hidden_effect = {
					random_list = {
						40 = {
							trigger_event = {
								id = travel_events.3011
								days = { 1 30 }
							}
						}
						60 = { }
					}
				}
			}
		}
		add_prestige = minor_prestige_loss #it's not very prestigious to see a king chasing after his cat
		stress_impact = {
			lazy = medium_stress_impact_gain
			callous = medium_stress_impact_gain
			arrogant = medium_stress_impact_gain
		}
		
		ai_chance = {
            base = 100
			modifier = {
				has_trait = compassionate
				add = 100
			}
			modifier = {
				has_trait = lazy
				factor = 0.5
			}
			modifier = {
				has_trait = callous
				factor = 0.5
			}
			modifier = {
				has_trait = arrogant
				factor = 0.5
			}
		}
	}
	
	#Send EVERYONE after it
	option = {
		name = {
			trigger = {
				has_exotic_pet_trigger = yes
			}
			text = travel_events.3010.e_exotic
		}
		name = {
			trigger = {
				has_named_cat_trigger = yes
			}
			text = travel_events.3010.e_cat
		}
		name = {
			trigger = {
				has_named_dog_trigger = yes
			}
			text = travel_events.3010.e_dog
		}
		current_travel_plan = {
			add_travel_plan_modifier = pet_rescue_modifier
		}
		trigger_event = travel_events.3011 #but you always find it
		stress_impact = {
			base = medium_stress_impact_gain
			impatient = medium_stress_impact_gain
			callous = medium_stress_impact_gain
		}
		
		ai_chance = {
            base = 100
			modifier = {
				has_trait = compassionate
				add = 100
			}
			modifier = {
				has_trait = impatient
				add = 100
			}
		}
	}
	
	#We cannot control an animal's life, if it wants to leave it shall leave
	option = {
		name = travel_events.3010.d
		trigger = {
			OR = {
				faith = {	
					OR = {
						has_doctrine = tenet_reincarnation
						has_doctrine = tenet_dharmic_pacifism
					}
				}
				has_trait = callous
			}
		}
		add_piety = medium_piety_gain
		hidden_effect = {
			random_list = {
				15 = {
					trigger_event = {
						id = travel_events.3011
						days = { 1 30 }
					}
				}
				85 = { }
			}
		}
		stress_impact = {
			base = miniscule_stress_impact_gain
			zealous = miniscule_stress_impact_loss
			compassionate = medium_stress_impact_gain
		}
		
		ai_chance = {
            base = 100
			modifier = {
				has_trait = compassionate
				factor = 0.25
			}
			modifier = {
				has_trait = zealous
				add = 50
			}
		}
	}
}

#You find your pet! And something else
travel_events.3011 = { 
	type = character_event
	title = travel_events.3011.t
	desc = {
		desc = travel_events.3011.intro
		first_valid = {
			triggered_desc = {
				trigger = {
					has_exotic_pet_trigger = yes
				}
				desc = travel_events.3011.exotic
			}
			triggered_desc = {
				trigger = {
					has_named_cat_trigger = yes
				}
				desc = travel_events.3011.cat
			}
			triggered_desc = {
				trigger = {
					has_named_dog_trigger = yes
				}
				desc = travel_events.3011.dog
			}
		}
	}
	theme = travel
	left_portrait = {
		character = root
		animation = happiness
	}
	
    #Compliment your pet for killing the thing
	option = { 
		name = travel_events.3011.a
		add_character_modifier = {
			modifier = adventurous_pet_modifier
			years = 2
		}
		stress_impact = {
			compassionate = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				has_trait = callous
				add = 50
			}
			modifier = {
				has_trait = wrathful
				add = 50
			}
		}
    }
	
    #Hug your pet and never let it go
	option = { 
		name = travel_events.3011.b
		stress_impact = {
			base = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				has_trait = compassionate
				add = 100
			}
		}
    }
}

scripted_effect travel_events_3012_remove_pet_effect = {
	if = {
		limit = {
			any_owned_story = {
				story_type = story_cycle_pet_cat
			}
		}
		random_owned_story = {
			limit = { story_type = story_cycle_pet_cat }
			save_temporary_scope_as = story
		}		
		scope:story = { end_story = yes }
	}
	if = {
		limit = {
			any_owned_story = {
				story_type = story_cycle_pet_dog
			}
		}
		random_owned_story = {
			limit = { story_type = story_cycle_pet_dog }
			save_temporary_scope_as = story
		}		
		scope:story = { end_story = yes }
	}
	remove_character_modifier = dog_story_modifier
	remove_character_modifier = cat_story_modifier
	remove_character_modifier = exotic_pet_wolf
	remove_character_modifier = exotic_pet_bear
	remove_character_modifier = exotic_pet_lion
	remove_character_modifier = exotic_pet_tiger
}

#Your pet found its way back! Changed...
travel_events.3012 = { 
    type = character_event
    title = travel_events.3012.t
    desc = {
		desc = travel_events.3011.intro #we recycle the loc for this
		first_valid = {
			triggered_desc = {
				trigger = {
					has_exotic_pet_trigger = yes
				}
				desc = travel_events.3011.exotic
			}
			triggered_desc = {
				trigger = {
					has_named_cat_trigger = yes
				}
				desc = travel_events.3011.cat
			}
			triggered_desc = {
				trigger = {
					has_named_dog_trigger = yes
				}
				desc = travel_events.3011.dog
			}
		}
		first_valid = { #but now it's weird
			triggered_desc = {
				trigger = {
					has_exotic_pet_trigger = yes
				}
				desc = travel_events.3012.exotic
			}
			triggered_desc = {
				trigger = {
					has_named_cat_trigger = yes
				}
				desc = travel_events.3012.cat
			}
			triggered_desc = {
				trigger = {
					has_named_dog_trigger = yes
				}
				desc = travel_events.3012.dog
			}
		}
	}
    theme = travel
    left_portrait = {
		character = root
		triggered_animation = {
			trigger = {
				OR = {
					has_trait = wrathful
					dread >= high_dread
				}
			}
			animation = ecstasy
		}
		animation = shock
	}
    override_background = { reference = wilderness_forest }
	
    #Let it go back to the forest
	option = { 
		name = travel_events.3012.a
		travel_events_3012_remove_pet_effect = yes
		if = {
			limit = { has_exotic_pet_trigger = yes }
			stress_impact = {
				base = minor_stress_impact_gain #you're less worried about your dangerous pet alone in the wild
				compassionate = medium_stress_impact_gain
			}
		}
		else = {
			stress_impact = {
				base = medium_stress_impact_gain
				callous = minor_stress_impact_loss
				compassionate = medium_stress_impact_gain
			}
		}
    }
	
    #Hug your pet and never let it go
	option = { 
		name = travel_events.3011.b
		trigger = {
			NOT = { has_trait = wrathful }
		}
		if = {
			limit = { has_exotic_pet_trigger = yes }
			#a feral wolf/bear/lion/tigger is kinda scary
			add_dread = medium_dread_gain
		}
		add_character_modifier = {
			modifier = feral_pet_modifier
			years = 2
		}
    }
	
	#Yes! Hahaha YES!!!
	option = {
		name = travel_events.3012.c
		trigger = {
			has_trait = wrathful
			has_exotic_pet_trigger = yes
		}
		add_dread = medium_dread_gain
		add_character_modifier = {
			modifier = feral_pet_love_modifier
			years = 2
		}
	}
}

##################################################
# Encounters in a Distant Court
# by Veronica Pazos
# 3020-3022
##################################################

#You visit another ruler's court
travel_events.3020 = { 
    type = character_event
    title = travel_events.3020.t
    desc = travel_events.3020.desc
    theme = travel
	left_portrait = {
		character = root
		triggered_animation = {
			trigger = {
				OR = {
					has_lustful_adjacent_trait_trigger = yes
				}
			}
  			animation = flirtation_left
  		}
		animation = personality_honorable
	}
    right_portrait = {
        character = scope:foreign_ruler
        animation = happiness
    }
	lower_right_portrait = scope:random_ambassador
    override_background = { reference = throne_room }
    cooldown = { years = 2 }
	
	trigger = {
		is_available_travelling_adult = yes
        is_landed = yes
		exists = location.county.holder
		involved_activity ?= {
			NOT = { activity_location = root.location }
		}
		is_location_valid_for_travel_event_on_land = yes
		location.county.holder = { #you're in a foreign court
			is_available_ai_adult = yes
			NOR = {
				this = root
				is_vassal_of = root
				is_liege_or_above_of = root
			}
			any_courtier_or_guest = {
				is_councillor = no
				is_available_ai_adult = yes
				is_travelling = no
			}
		}
		OR = { #they're actually excited to see you
			location.county.holder.dynasty.dynasty_prestige_level < root.dynasty.dynasty_prestige_level #your dynasty is more prestigious than theirs
			location.county.holder = {
				OR = {
					opinion = {
						target = root
						value >= 50
					}
					has_friendly_relationship_with_root_trigger = yes
				}
			}
		}
		current_travel_plan ?= {
			next_destination_province ?= { exists = this }
		}
    }
	
	weight_multiplier = {
		base = 1
		modifier = {
			add = 2
			root.location.county.holder = {
				has_friendly_relationship_with_root_trigger = yes
			}
		}
	}
	
	immediate = {
		play_music_cue = mx_cue_travel_arrival
		location.county.holder = {
			save_scope_as = foreign_ruler
			ordered_courtier_or_guest = {
				limit = {
					is_councillor = no
					is_available_ai_adult = yes
					is_travelling = no
				}
				order_by = diplomacy
				save_scope_as = random_ambassador
			}
		}
		mp_delay_travel_plan = { DAYS = 90 }
		current_travel_plan = {
			next_destination_province = {
				save_scope_as = next_province
			}
		}
	}
	
    #Ask for diplomatic assist
	option = { 
		name = {
			text = {
				first_valid = {
					#Traveling back home
					triggered_desc = {
						trigger = {
							exists = root.capital_province
							scope:next_province = root.capital_province
						}
						desc = travel_events.3020.a_home
					}
					#Traveling to the next destination
					desc = travel_events.3020.a
				}
			}
		}
		
		current_travel_plan = {
			add_companion = scope:random_ambassador
		}
		
		stress_impact = {
			shy = minor_stress_impact_gain
			callous = medium_stress_impact_gain
			paranoid = medium_stress_impact_gain
		}
		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_boldness = 0.25
			}
		}
    }
	
    #Ask for supplies
	option = { 
		name = travel_events.3020.b
		duel = {
			skill = stewardship
			target = scope:foreign_ruler
			50 = {
				desc = travel_events.3020.b.success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
				}
				send_interface_toast = {
					title = travel_events.3020.b.success
					left_icon = scope:foreign_ruler
					add_character_modifier = {
						modifier = more_supplies_modifier
						years = 5
					}
				}
			}
			50 = {
				desc = travel_events.3020.b.failure
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
				}
				send_interface_toast = {
					title = travel_events.3020.b.failure
					left_icon = scope:foreign_ruler
					scope:foreign_ruler = {
						add_opinion = {
							modifier = hurt_opinion
							opinion = -5
							target = root
						}
					}
				}
			}
		}
		
		stress_impact = {
			arrogant = minor_stress_impact_gain
		}
		
		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_greed = 0.5
			}
		}
    }
	
	#Ask for men
	option = {
		name = travel_events.3020.c
		duel = {
			skill = martial
			target = scope:foreign_ruler
			50 = {
				desc = travel_events.3020.c.success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
				}
				send_interface_toast = {
					title = travel_events.3020.c.success
					left_icon = scope:foreign_ruler
					current_travel_plan = {
						add_travel_plan_modifier = more_men_modifier
					}
				}
			}
			50 = {
				desc = travel_events.3020.b.failure
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
				}
				send_interface_toast = {
					title = travel_events.3020.b.failure
					left_icon = scope:foreign_ruler
					scope:foreign_ruler = {
						add_opinion = {
							modifier = hurt_opinion
							opinion = -5
							target = root
						}
					}
				}
			}
		}
		
		stress_impact = {
			calm = medium_stress_impact_gain
		}
		
		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_vengefulness = 0.5
			}
		}
	}
	
	#Accept offer and stay behind
	option = {
		name = travel_events.3020.d
		custom_tooltip = travel_events.3020.d.tt
		current_travel_plan = {
			delay_travel_plan = { days = 7 }
		}
		hidden_effect = {
			random_list = {
				50 = {
					modifier = {
						add = 25
						scope:foreign_ruler = {
							OR = {
								learning >= medium_skill_rating
								has_trait = theologian
							}
						}
					}
					trigger_event = { id = travel_events.3021 days = { 5 12 } }
				}
				50 = {
					modifier = {
						add = 25
						scope:foreign_ruler = {
							OR = {
								has_trait = gregarious
								has_trait = lifestyle_reveler
							}
						}
					}
					trigger_event = { id = travel_events.3022 days = { 5 12 } }
				}
			}
		}
		
		stress_impact = {
			gregarious = miniscule_stress_impact_loss
			lifestyle_reveler = minor_stress_impact_loss
			shy = minor_stress_impact_gain
			impatient = medium_stress_impact_gain
			paranoid = medium_stress_impact_gain
		}
		
		ai_chance = {
			base = 100
			modifier = {
				add = 100
				has_trait = gregarious
			}
			modifier = {
				add = 100
				has_trait = lifestyle_reveler
			}
			opinion_modifier = {
				opinion_target = scope:foreign_ruler
			}
		}
	}
	
	#Try to smash
	option = {
		name = travel_events.3020.e 
		trigger = {
			OR = {
				has_lustful_adjacent_trait_trigger = yes
			}
			is_attracted_to_gender_of = scope:foreign_ruler
			might_cheat_on_every_partner_trigger = yes
			scope:foreign_ruler = {
				is_attracted_to_gender_of = root
				might_cheat_on_every_partner_trigger = yes
			}
		}
		random_list = {
			50 = {
				desc = travel_events.3020.e.success
				modifier = {
					add = 30
					scope:foreign_ruler = {	has_trait = seducer }
				}
				modifier = {
					add = 30
					scope:foreign_ruler = { has_trait = lustful }
				}
				modifier = {
					add = 20
					scope:foreign_ruler = { has_trait = rakish }
				}
				modifier = {
					add = 20
					scope:foreign_ruler = { has_trait = deviant }
				}
				send_interface_toast = {
					title = travel_events.3020.e.success
					left_icon = scope:foreign_ruler
					had_sex_with_effect = {
						CHARACTER = scope:foreign_ruler
						PREGNANCY_CHANCE = pregnancy_chance
					}
					stress_impact = {
						base = minor_stress_impact_loss
					}
				}
			}
			50 = {
				desc = travel_events.3020.e.failure
				modifier = {
					add = 40
					scope:foreign_ruler = { has_trait = celibate }
				}
				modifier = {
					add = 30
					scope:foreign_ruler = { has_trait = chaste }
				}
				send_interface_toast = {
					title = travel_events.3020.e.failure
					left_icon = scope:foreign_ruler
					scope:foreign_ruler = {
						add_opinion = {
							modifier = insulted_opinion
							opinion = -15
							target = root
						}
					}
				}
			}
		}
		
		stress_impact = {
			shy = medium_stress_impact_gain
		}
		
		ai_chance = {
			base = 100
			modifier = {
				add = 100
				has_trait = seducer
			}
			modifier = {
				add = 100
				has_trait = lustful
			}
			modifier = {
				add = 50
				has_trait = rakish
			}
			modifier = {
				add = 50
				has_trait = deviant
			}
			modifier = {
				add = -100
				has_trait = celibate
			}
		}
	}
	
	#It's a trap!
	option = {
		name = travel_events.3020.f
		trigger = { has_trait = paranoid }
		stress_impact = {
			base = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				add = 100
				has_trait = paranoid
			}
		}
	}


	after = {
		mp_resume_travel_plan = yes
	}
}

#Foreign ruler invites you into a theological competition (based on Möngke Khan)
travel_events.3021 = { 
    type = character_event
    title = travel_events.3021.t
    desc = {
		desc = travel_events.3021.intro
		first_valid = {
			triggered_desc = {
				trigger = { NOT = { faith = scope:foreign_ruler.faith } }
				desc = travel_events.3021.different_faiths
			}
			triggered_desc = {
				trigger = { faith = scope:foreign_ruler.faith }
				desc = travel_events.3021.same_faith
			}
		}
	}			
    theme = travel
    left_portrait = {
		character = root
		animation = personality_rational
	}
    right_portrait = {
        character = scope:foreign_ruler
        animation = personality_rational
    }
	lower_left_portrait = scope:your_theologian
	lower_right_portrait = scope:foreign_theologian
	override_background = { reference = throne_room }
	
	immediate = {
		scope:foreign_ruler = {
			ordered_courtier_or_guest = {
				limit = {
					is_available_ai_adult = yes
				}
				order_by = {
					value = learning
					if = {
						limit = { has_trait = theologian }
						add = 30
					}
				}
				save_scope_as = foreign_theologian
			}
		}
		current_travel_plan = {
			ordered_entourage_character = {
				order_by = {
					value = learning
					if = {
						limit = { has_trait = theologian }
						add = 30
					}
					if = {
						limit = { has_trait = zealous }
						add = 20
					}
				}
				save_scope_as = your_theologian
			}
		}
		scope:foreign_ruler.faith = { save_scope_as = foreign_faith }
	}
	
    #Accept
	option = { 
		name = travel_events.3021.a
		duel = {
			skills = { learning intrigue } #you also need some charisma
			target = scope:foreign_theologian
			40 = {
				desc = travel_events.3021.a.success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
				}
				send_interface_toast = {
					title = travel_events.3021.a.success
					left_icon = scope:foreign_theologian
					add_prestige = medium_prestige_gain
					give_nickname = nick_the_discussant
				}
			}
			60 = {
				desc = travel_events.3021.a.failure
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
				}
				send_interface_toast = {
					title = travel_events.3021.a.failure
					left_icon = scope:foreign_ruler
					add_prestige = medium_prestige_loss
				}
			}
		}
		stress_impact = {
			dull = medium_stress_impact_gain
			lisping = medium_stress_impact_gain
			intellect_bad_1 = medium_stress_impact_gain
			intellect_bad_2 = major_stress_impact_gain
			intellect_bad_3 = major_stress_impact_gain
		}
		
		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_zeal = 1
				ai_honor = 1
			}
			modifier = {
				add = 100
				has_trait = theologian
			}
			modifier = {
				add = 100
				has_trait = scholar
			}
			modifier = {
				add = 100
				learning >= high_skill_rating
			}
			modifier = {
				factor = 0
				has_trait = dull
			}
			modifier = {
				factor = 0
				has_trait = lisping
			}
			modifier = {
				factor = 0
				has_trait = intellect_bad_1
			}
			modifier = {
				factor = 0
				has_trait = intellect_bad_2
			}
			modifier = {
				factor = 0
				has_trait = intellect_bad_3
			}
		}
    }
	
    #Deflect it to your most trusted companion
	option = {
		name = travel_events.3021.b
		scope:your_theologian = {
			duel = {
				skills = { learning intrigue } #you also need some charisma
				target = scope:foreign_theologian
				50 = {
					desc = travel_events.3021.b.success
					compare_modifier = {
						value = scope:duel_value
						multiplier = 3.5
					}
					root = {
						send_interface_toast = {
							title = travel_events.3021.b.success
							left_icon = scope:foreign_theologian
							add_prestige = minor_prestige_gain
						}
					}
				}
				50 = {
					desc = travel_events.3021.b.failure
					compare_modifier = {
						value = scope:duel_value
						multiplier = -3.5
					}
					root = {
						send_interface_toast = {
							title = travel_events.3021.a.failure
							left_icon = scope:foreign_ruler
							add_prestige = minor_prestige_loss
						}
					}
				}
			}
		}
		stress_impact = {
			intellect_bad_1 = miniscule_stress_impact_loss
			intellect_bad_2 = miniscule_stress_impact_loss
			intellect_bad_3 = miniscule_stress_impact_loss
			dull = miniscule_stress_impact_loss
			arrogant = medium_stress_impact_gain
			zealous = medium_stress_impact_gain
			theologian = major_stress_impact_gain
		}
		
		ai_chance = {
			base = 50
			modifier = {
				factor = 0
				has_trait = zealous
			}
			modifier = {
				factor = 0
				has_trait = theologian
			}
			modifier = {
				factor = 0
				has_trait = arrogant
			}
			modifier = {
				factor = 0
				has_trait = dull
			}
			modifier = {
				factor = 0
				has_trait = lisping
			}
			modifier = {
				factor = 0
				has_trait = intellect_bad_1
			}
			modifier = {
				factor = 0
				has_trait = intellect_bad_2
			}
			modifier = {
				factor = 0
				has_trait = intellect_bad_3
			}
		}
    }
	
	#We don't have time for this
	option = {
		name = travel_events.3021.c
		trigger = {
			has_trait = callous
		}
		current_travel_plan = {
			add_travel_plan_modifier = dismissed_religious_debate
		}
		scope:foreign_ruler = {
			add_opinion = {
				target = root
				modifier = insulted_opinion
				opinion = -20
			}
		}
		
		stress_impact = {
			arrogant = medium_stress_impact_gain
			scholar = medium_stress_impact_gain
			zealous = major_stress_impact_gain
			theologian = major_stress_impact_gain
		}
		
		ai_chance = {
			base = 100
			modifier = {
				add = 50
				has_trait = impatient
			}
		}
	}
	
	#Bribe your oponent to make a good impression
	option = {
		name = travel_events.3021.d
		custom_tooltip = travel_events.3021.d.tt
		trigger = {
			OR = {
				has_trait = arrogant
				has_trait = deceitful
				has_trait = ambitious
			}
		}
		add_prestige = minor_prestige_gain
		pay_short_term_gold = {
			target = scope:foreign_theologian
			gold = minor_gold_value
		}
		stress_impact = {
			greedy = medium_stress_impact_gain
			just = medium_stress_impact_gain
		}
		
		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_greed = -1
				ai_honor = -1
			}
		}
	}
}

# Foreign ruler invites you to DANCE! DANCE! REVOLUTION!

scripted_trigger travel_events.3022_is_valid_secret_owner = {
	any_secret = {
		NOT = { is_known_by = root }
	}
}

travel_events.3022 = { 
    type = character_event
    title = travel_events.3022.t
    desc = travel_events.3022.desc
    theme = travel
    left_portrait = {
		character = root
		animation = happiness
	}
    right_portrait = {
        character = scope:foreign_ruler
        animation = ecstasy
    }
    override_background = { reference = throne_room }
	
	immediate = {
		wayfarer_storyteller_fame_effect = { VALUE = roaming_reward_fame_small }
		if = {
			limit = {
				scope:foreign_ruler = {
					any_courtier_or_guest = {
						travel_events.3022_is_valid_secret_owner = yes
					}
				}
			}
		}
		scope:foreign_ruler = {
			random_courtier_or_guest = {
				limit = { travel_events.3022_is_valid_secret_owner = yes }
				save_scope_as = potential_secret_owner
				random_secret = {
					limit = { NOT = { is_known_by = root } }
					save_scope_as = potential_secret
				}
			}
		}
	}
	
    #Accept
	option = { 
		name = travel_events.3022.a
		progress_towards_friend_effect = {
			CHARACTER = scope:foreign_ruler
			OPINION = 20
			REASON = friend_dance
		}
		stress_impact = {
			lifestyle_reveler = minor_stress_impact_loss
			lazy = medium_stress_impact_gain
			callous = medium_stress_impact_gain
			clubfooted = medium_stress_impact_gain
			shy = major_stress_impact_gain
			arrogant = major_stress_impact_gain
		}
		
		ai_chance = {
			base = 100
			modifier = {
				add = 100
				has_trait = lifestyle_reveler
			}
			modifier = {
				add = 100
				has_trait = humble
			}
			modifier = {
				factor = 0
				has_trait = clubfooted
			}
			modifier = {
				factor = 0.25
				has_trait = callous
			}
			modifier = {
				factor = 0
				has_trait = arrogant
			}
			ai_value_modifier = {
				ai_boldness = 1
			}
		}
    }
	
	#Make the best dance move ever seen and steal the spotlight
	option = {
		name = travel_events.3022.b
		trigger = {
			OR = {
				has_trait = arrogant
				has_trait = ambitious
			}
		}
		duel = {
			skills = { diplomacy prowess }
			value = medium_skill_rating
			50 = {
				desc = travel_events.3022.b.success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
				}
				send_interface_toast = {
					title = travel_events.3022.b.success
					left_icon = root
					add_character_modifier = {
						modifier = vigorous_dancer_modifier
						years = 5
					}
					add_prestige = minor_prestige_gain
				}
			}
			50 = {
				desc = travel_events.3022.b.failure
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
				}
				send_interface_toast = {
					title = travel_events.3022.b.failure
					left_icon = root
					add_prestige = minor_prestige_loss
				}
			}
		}
		stress_impact = {
			lifestyle_reveler = minor_stress_impact_loss
			craven = minor_stress_impact_gain
			lazy = medium_stress_impact_gain
			callous = medium_stress_impact_gain
			clubfooted = major_stress_impact_gain
			shy = major_stress_impact_gain
			humble = medium_stress_impact_gain
		}
		
		ai_chance = {
			base = 100
			modifier = {
				factor = 2
				has_trait = arrogant
			}
			modifier = {
				factor = 1.5
				has_trait = lifestyle_reveler
			}
			modifier = {
				factor = 1.5
				has_trait = gregarious
			}
			modifier = {
				factor = 0
				has_trait = clubfooted
				has_trait = humble
			}
			modifier = {
				factor = 0
				has_trait = lazy
			}
			modifier = {
				factor = 0
				has_trait = callous
			}
			modifier = {
				factor = 0
				has_trait = shy
			}
		}
	}
	
	#Go and gossip away from the crowd instead
	option = {
		name = travel_events.3022.c
		trigger = {
			has_trait = shy
			exists = scope:potential_secret_owner
		}
		custom_tooltip = {
			text = non_dancer_secret.desc
		}
		hidden_effect = {
			send_interface_toast = {
				title = non_dancer_secret.desc
				left_icon = scope:potential_secret_owner
				scope:potential_secret = {
					reveal_to = root
				}
			}
		}
		stress_impact = {
			gregarious = medium_stress_impact_gain
			diplomat = medium_stress_impact_gain
			lifestyle_reveler = medium_stress_impact_gain
			diligent = minor_stress_impact_gain
		}
		
		ai_chance = {
			base = 100
			modifier = {
				factor = 2
				has_trait = shy
			}
			modifier = {
				factor = 0
				has_trait = diplomat
				has_trait = diligent
			}
			modifier = {
				factor = 0
				has_trait = lifestyle_reveler
			}
		}
	}

	 #Refuse (this is something for knights, not for a KING)
	option = { 
		name = travel_events.3022.d
		scope:foreign_ruler = {
			add_opinion = {	
				target = root
				modifier = disappointed_opinion
				opinion = -15
			}
		}
		stress_impact = {
			base = minor_stress_impact_loss
			gregarious = medium_stress_impact_gain
			lifestyle_reveler = medium_stress_impact_gain
			humble = medium_stress_impact_gain
			trusting = minor_stress_impact_gain
		}
		
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				has_trait = lifestyle_reveler
			}
			modifier = {
				factor = 0
				has_trait = gregarious
				has_trait = humble
				has_trait = trusting
			}
			modifier = {
				add = 50
				has_trait = clubfooted
			}
			modifier = {
				add = 50
				has_trait = shy
			}
		}
    }
	
	after = {
		current_travel_plan = {
			resume_travel_plan = yes
		}
	}
}

##################################################
# Your knight becomes infatuated with another court's lady/lad
# by Veronica Pazos
# 3030
##################################################

travel_events.3030 = {
    type = character_event
    title = travel_events.3030.t
    desc = travel_events.3030.desc
    theme = travel
    left_portrait = {
		character = scope:fleeing_knight
		animation = admiration
	}
    right_portrait = {
        character = scope:foreign_lady_scope
        animation = flirtation_left
    }
	lower_center_portrait = scope:3030_ruler
    override_background = { reference = garden }
    cooldown = { years = 20 }
	
	trigger = {
		is_available_travelling_adult = yes 
        is_playable_character = yes
		is_location_valid_for_travel_event_on_land = yes
		location = {
			has_holding = yes
		}
		current_travel_plan = {
			any_entourage_character = {
				NOT = { has_variable = had_travel_3030_var } #they don't get the event again
				num_of_relation_soulmate <= 0
				save_temporary_scope_as = fleeing_knight_candidate
			}
		}

		location.county.holder = {
			is_available_ai_adult = yes
			NOR = {
				this = root
				is_vassal_of = root
				is_liege_or_above_of = root
			}
			any_courtier = {
				NOT = { has_variable = had_travel_3030_var }
				num_of_relation_soulmate <= 0
				save_temporary_scope_as = courtier_candidate
				are_characters_sensible_and_appropriate_open_lovers_trigger = {
					INSTIGATING_LOVER = scope:fleeing_knight_candidate
					TARGET_OF_LOVE = scope:courtier_candidate
				}
			}
		}
    }
	
	immediate = {
		play_music_cue = mx_cue_travel_arrival
		location.county.holder = { save_scope_as = 3030_ruler }
		current_travel_plan = {
			random_entourage_character = {
				limit = {
					NOT = { has_variable = had_travel_3030_var } #they don't get the event again
					num_of_relation_soulmate <= 0
					save_temporary_scope_as = fleeing_knight_candidate
					location.county.holder = {
						any_courtier = {
							NOT = { has_variable = had_travel_3030_var }
							num_of_relation_soulmate <= 0
							save_temporary_scope_as = courtier_candidate
							are_characters_sensible_and_appropriate_open_lovers_trigger = {
								INSTIGATING_LOVER = scope:fleeing_knight_candidate
								TARGET_OF_LOVE = scope:courtier_candidate
							}
						}
					}
				}
				weight = {
					base = 1
					modifier = {
						is_knight_of = root
						add = 100
					}
					modifier = {
						has_lustful_adjacent_trait_trigger = yes
						add = 50
					}
				}
				set_variable = had_travel_3030_var
				save_scope_as = fleeing_knight
			}
		}
		#we don't really care if they're available
		scope:3030_ruler = {
			random_courtier = {
				limit = {
					NOT = { has_variable = had_travel_3030_var }
					num_of_relation_soulmate <= 0
					save_temporary_scope_as = courtier_candidate
					are_characters_sensible_and_appropriate_open_lovers_trigger = {
						INSTIGATING_LOVER = scope:fleeing_knight
						TARGET_OF_LOVE = scope:courtier_candidate
					}
				}
				save_scope_as = foreign_lady_scope
			}
		}
	}
	
    #Let him go
	option = { 
		name = travel_events.3030.a
		scope:3030_ruler = {
			add_courtier = scope:fleeing_knight
			add_opinion = {
				target = root 
				modifier = grateful_opinion
				opinion = 20
			}
		}

		current_travel_plan = { 
			remove_character = scope:fleeing_knight 
		}

		scope:fleeing_knight = {
			if = {
				limit = {
					exists = scope:activity
				}
				remove_from_activity = scope:activity
			}
			hidden_effect = {
				return_to_court = yes
			}
			set_relation_soulmate = {
				reason = lover_first_sight
				target = scope:foreign_lady_scope
			}
		}
		if = {
			limit = { 
				can_set_relation_friend_trigger = { CHARACTER = scope:fleeing_knight } 
			}
			set_relation_friend = {
				reason = friend_courtly_love
				province = root.location
				target = scope:fleeing_knight
			}
		}
		stress_impact = {
			callous = medium_stress_impact_gain
			sadistic = medium_stress_impact_gain
		}
		
		ai_chance = {
			base = 0
		}
    }
	
	#Ask her to join instead
	option = {
		name = travel_events.3030.d
		scope:foreign_lady_scope = {
			add_to_court_and_entourage_effect = yes
		}
		scope:fleeing_knight = {
			set_relation_soulmate = {
				reason = lover_first_sight
				target = scope:foreign_lady_scope
			}
		}
		scope:3030_ruler = { #you stole their courtier
			add_opinion = {
				target = root
				modifier = annoyed_opinion
				opinion = -15
			}
		}
		stress_impact = {
			callous = medium_stress_impact_gain
			sadistic = medium_stress_impact_gain
		}
		
		ai_chance = {
			base = 100
		}
	}
	
	#Refuse
	option = {
		name = travel_events.3030.b 
		scope:fleeing_knight = {
			add_opinion = {
				target = root
				modifier = angry_opinion
				opinion = -35
			}
		}
		stress_impact = {
			compassionate = medium_stress_impact_gain
		}
		
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				has_trait = gallant
			}
			modifier = {
				factor = 0
				has_trait = gregarious
			}
			modifier = {
				factor = 0
				has_trait = compassionate
			}
			modifier = {
				factor = 2
				has_trait = callous
			}
			ai_value_modifier = {
				ai_compassion = -1
			}
		}
	}
}

##################################################
# Your bishop becomes too curious about a different faith
# by Veronica Pazos
# 3040
##################################################

travel_events.3040 = { 
    type = character_event
    title = travel_events.3040.t
    desc = travel_events.3040.desc
    theme = travel
    left_portrait = {
		character = root
		triggered_animation = {
			trigger = { 
				has_trait = zealous
			}
  			animation = anger
  		}
		animation = worry
	}
    right_portrait = {
        character = scope:bishop
        animation = admiration
    }
	lower_center_portrait = scope:foreign_bishop #their bishop
    override_background = { reference = temple }
    cooldown = { years = 20 }
	
	trigger = {
		static_group_filter = {
			group = travel_events.3040
			match = 0.5
		}
		is_available_travelling_adult = yes
		is_landed = yes
		is_location_valid_for_travel_event_on_land = yes
		root.location.county.holder.faith.religion = { NOT = { this = root.religion } } #they have a different religion
		exists = cp:councillor_court_chaplain #you have a bishop
		current_travel_plan = { #and they're coming with you
			any_entourage_character = {
				this = root.cp:councillor_court_chaplain
				NOT = { has_variable = had_travel_3040_var } #they don't get the event again
			}
		}
		exists = location.county.holder #you travel through someone's lands
		location.county.holder = {
			exists = cp:councillor_court_chaplain #they also have a bishop
			faith.religion = { NOT = { this = root.religion } } #and they have a different religion
		}
    }
	
	weight_multiplier = {
		base = 1
		modifier = {
			add = -0.5
			exists = cp:councillor_court_chaplain
			cp:councillor_court_chaplain = { has_trait = zealous }
		}
	}
	
	immediate = {
		play_music_cue = mx_cue_travel_arrival
		location.county.holder.faith.religion = { save_scope_as = foreign_religion }
		location.county.holder = {
			cp:councillor_court_chaplain = { save_scope_as = foreign_bishop }
		}
		cp:councillor_court_chaplain = {
			save_scope_as = bishop
			set_variable = had_travel_3040_var
		}
	}
	
    #Mmmmm interesting
	option = { 
		name = travel_events.3040.a
		add_character_modifier = {
			modifier = broadened_horizons_modifier #diff faith op
			years = 5
		}
		stress_impact = {
			base = medium_stress_impact_gain
			zealous = major_stress_impact_gain
		}
		
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_zeal = -1
				ai_rationality = 0.25
			}
		}
    }
	
	#Nonsense
	option = {
		name = travel_events.3040.b 
		add_character_modifier = {
			modifier = firm_convictions_modifier #religious vassals op
			years = 5
		}
		stress_impact = {
			base = medium_stress_impact_gain
		}
		
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_zeal = 1
				ai_rationality = 0.25
				ai_boldness = 0.5
			}
		}
	}
	
	#Let's have a calm chat about it
	option = {
		name = travel_events.3040.c
		duel = {
			skill = learning
			target = scope:bishop
			50 = {
				desc = travel_events.3040.c.success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
				}
				send_interface_toast = {
					title = travel_events.3040.c.success
					right_icon = root 
					left_icon = scope:bishop 
					scope:bishop = {
						add_opinion = {
							target = root
							modifier = respect_opinion
							opinion = 20
						}
					}
				}
			}
			50 = {
				desc = travel_events.3040.c.failure
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
				}
				send_interface_toast = {
					title = travel_events.3040.c.failure
					right_icon = root 
					left_icon = scope:bishop 
					scope:bishop = {
						add_opinion = {
							target = root
							modifier = angry_opinion
							opinion = -20
						}
					}
				}
			}
		}
		stress_impact = {
			zealous = major_stress_impact_gain
		}
		
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_zeal = -1
				ai_rationality = 0.5
			}
		}
	}
	
	#Let's have a heated chat about it
	option = {
		trigger = { has_trait = zealous }
		name = travel_events.3040.d
		duel = {
			skill = prowess
			target = scope:bishop
			50 = {
				desc = travel_events.3040.d.success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
				}
				send_interface_toast = {
					title = travel_events.3040.d.success
					right_icon = root 
					left_icon = scope:bishop 
					add_piety = minor_piety_gain
					scope:bishop = {
						increase_wounds_no_death_effect = { REASON = fight }
					}
				}
			}
			50 = {
				desc = travel_events.3040.d.failure
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
				}
				send_interface_toast = {
					title = travel_events.3040.d.failure
					right_icon = root 
					left_icon = scope:bishop 
					scope:bishop = {
						add_opinion = {
							target = root
							modifier = angry_opinion
							opinion = -50
						}
					}
				}
			}
		}
		stress_impact = {
			base = medium_stress_impact_gain
			eccentric = medium_stress_impact_loss
			wrathful = minor_stress_impact_loss
			sadistic = minor_stress_impact_loss
			zealous = minor_stress_impact_loss
			craven = medium_stress_impact_gain
			compassionate = major_stress_impact_gain
		}
		
		ai_chance = {
			base = 100
			modifier = {
				factor = 0.5
				has_trait = wrathful
			}
			modifier = {
				factor = 0.5
				has_trait = sadistic
			}
			ai_value_modifier = {
				ai_zeal = 1
				ai_rationality = -0.75
				ai_boldness = -0.5
				ai_compassion = -1
			}
		}
	}
}

##################################################
# The Hermit
# by Veronica Pazos
# 3060-3062
##################################################

travel_events.3060 = { 
    type = character_event
    title = travel_events.3060.t
    desc = {
    	desc = travel_events.3060.desc.intro
		first_valid = {
			triggered_desc = {
				trigger = { exists = scope:travel_leader }
				desc = travel_events.3060.desc.travel_leader
			}
			desc = travel_events.3060.desc.on_your_own
		}
	}

    theme = travel
	override_background = {
		reference = ep2_hunt_forest_cave
	}
    left_portrait = {
		character = root
		triggered_animation = {
			trigger = { 
				has_trait = cynical
			}
  			animation = personality_cynical
  		}
		animation = chaplain
	}
    right_portrait = {
        character = scope:hermit_scope
        animation = lantern
    }
    cooldown = { years = 10 }
	
    trigger = {
        is_available_travelling_adult = yes
        is_playable_character = yes
		is_location_valid_for_travel_event_on_land = yes
		location = { is_wooded_trigger = yes } #hermits were paid to be kept in the forest
		NOR = {
			has_variable = encountered_recruitable_hermit
			location.county.holder = ROOT
			government_has_flag = government_is_nomadic
		}
    }
	
    immediate = {
    	wayfarer_storyteller_fame_effect = { VALUE = roaming_reward_fame_very_small }
		set_variable = encountered_recruitable_hermit #This unlocks the Garden Hermit court position, and also prevents the character from getting the event again
		create_character = {
			template = garden_hermit_character
			location = root.location
			culture = root.location.county.culture
			faith = root.location.county.faith
			dynasty = none
			save_scope_as = hermit_scope
		}
		scope:hermit_scope = {
			add_character_flag = peasant_outfit
		}
		location = {
			county = { save_scope_as = hermit_county }
			county.holder = { save_scope_as = hermit_owner }
		}
		current_travel_plan.travel_leader ?= { save_scope_as = travel_leader }			
	}
	
	#Recruit
    option = { 
        name = travel_events.3060.a
		trigger = {
			is_landless_adventurer = no
		}
		current_travel_plan = {
			add_companion = scope:hermit_scope
		}
		trigger_event = { id = travel_events.3062 days = 3 }
		stress_impact = {
			paranoid = medium_stress_impact_gain
			cynical = medium_stress_impact_gain
		}
    }
	
	#Ask for advice
    option = {
        name = travel_events.3060.b
        custom_tooltip = hermit_tells_your_future_tt
		hidden_effect = {
			random_list = {
				30 = {
					set_variable = {
						name = good_prophecy_var
						years = prophecy_duration
					}
					#increases your chance to find a knight errant
				}
				30 = {
					set_variable = {
						name = bad_prophecy_var
						years = prophecy_duration
					}
					#increases your chance to be attacked by bandits
				}
				30 = {
					#just a normal prophecy, nothing special
				}
			}
			trigger_event = travel_events.3061
		}
		stress_impact = {
			cynical = medium_stress_impact_gain
		}
	}
	
	#Ignore
	option = {
		name = travel_events.3060.c
		if = {
			limit = { has_trait = paranoid }
			add_character_modifier = {
				modifier = impending_doom_modifier
			}
		}
		current_travel_plan = {
			add_travel_plan_modifier = ignored_hermit
		}
		stress_impact = {
			cynical = miniscule_stress_impact_loss
			paranoid = major_stress_impact_gain
		}
	}
}

#The Hermit's prophecy
#By Veronica Pazos

travel_events.3061 = { 
    type = character_event
    title = travel_events.3061.t
    desc = {
		desc = travel_events.3061.intro
		first_valid = {
			triggered_desc = {
				trigger = { has_variable = good_prophecy_var }
				desc = travel_events.3061.desc_good
			}
			triggered_desc = {
				trigger = { has_variable = bad_prophecy_var }
				desc = travel_events.3061.desc_bad
			}
			desc = travel_events.3061.desc_normal
		}
	}
    theme = travel
	override_background = {
		reference = ep2_hunt_forest_cave
	}
    left_portrait = {
		character = root
		triggered_animation = {
			trigger = { 
				has_trait = cynical
			}
  			animation = disbelief
  		}
		triggered_animation = {
			trigger = { 
				has_trait = paranoid
			}
  			animation = paranoia
  		}
		animation = personality_compassionate
	}
    right_portrait = {
        character = scope:hermit_scope
        animation = personality_honorable
		outfit_tags = { beggar_rags }
    }
	
	#Insightful
	option = {
		name = travel_events.3061.a
		custom_tooltip = travel_events.3061.a.tt
		add_piety = minor_piety_gain #you've listened to the wise hermit
		
		if = { limit = { has_variable = good_prophecy_var }
			stress_impact = {
				base = minor_stress_impact_loss
				paranoid = minor_stress_impact_gain
			}
		}
		
		if = {
			limit = { has_variable = bad_prophecy_var }
			stress_impact = {
				base = medium_stress_impact_gain
				cynical = minor_stress_impact_loss #level it down
				paranoid = major_stress_impact_gain
			}
		}
	}
}

# What are you doing with my hermit?
# (ornamental hermits were popular in the 19th c.,
# but we already have examples in the 1400s and, honestly, it's too funny to let it go)
# By Veronica Pazos

travel_events.3062 = { 
	type = character_event
	title = travel_events.3062.t
	desc = travel_events.3062.desc
	theme = travel
	left_portrait = {
		character = root
		animation = dismissal
	}
	right_portrait = {
		character = scope:hermit_owner
		animation = anger
	}
	lower_center_portrait = {
		character = scope:hermit_scope
		outfit_tags = { beggar_rags }
	}
	override_background = { reference = throne_room }

	trigger = {
		exists = scope:hermit_scope #Must not have died during these 3 days
		scope:hermit_scope = {
			is_alive = yes
		}
		is_landed = yes
	}
	
	#Apologise & let them go
	option = {
		name = travel_events.3062.a
		scope:hermit_owner = {
			add_courtier = scope:hermit_scope
			add_opinion = {
				target = root
				modifier = pleased_opinion
				opinion = 10
			}
		}
		current_travel_plan = { remove_character = scope:hermit_scope }
		stress_impact = {
			arrogant = medium_stress_impact_gain
			callous = medium_stress_impact_gain
		}
		
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				has_trait = arrogant
			}
			modifier = {
				factor = 0
				has_trait = callous
			}
		}
	}
	
	#Refuse
	option = {
		name = travel_events.3062.b
		trigger = {
			can_appoint_char_to_court_position = {
				CHAR = scope:hermit_scope
				COURT_POS = cave_hermit_court_position
			}
		}
		custom_tooltip = travel_events.3062.b.tt
		scope:hermit_scope = {
			set_variable = {
				name = found_hermit_mod
				years = 5
			}
		}
		scope:hermit_scope = {
			if = {
				limit = {
					NOT = { is_courtier_of = root }
				}
				root = {
					add_courtier = scope:hermit_scope
				}
			}
		}
		court_position_grant_effect = {
			CANDIDATE = scope:hermit_scope
			EMPLOYER = root
			POS = cave_hermit
		}
		scope:hermit_owner = {
			add_opinion = {
				target = root
				modifier = angry_opinion
				opinion = -20
			}
		}
		stress_impact = {
			humble = medium_stress_impact_gain
			just = medium_stress_impact_gain
			compassionate = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				has_trait = humble
			}
			modifier = {
				factor = 0
				has_trait = just
			}
			modifier = {
				factor = 0
				has_trait = compassionate
			}
		}
	}
	
	#Let the hermit decide
	option = {
		name = travel_events.3062.c
		duel = {
			target = scope:hermit_owner
			skill = diplomacy
			
			50 = { #they stay with you
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
				}
				modifier = {
					add = 25
					has_trait = compassionate
				}
				modifier = {
					add = -25
					has_trait = callous
				}
				desc = travel_events.3062.c.success
				send_interface_toast = {
					left_icon = scope:hermit_scope
					title = travel_events.3062.c.success
					appoint_court_position = { #he's now your personal hermit
						recipient = scope:hermit_scope
						court_position = cave_hermit_court_position
					}
				}
			}
			50 = { #they leave
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
				}
				modifier = {
					add = 25
					scope:hermit_scope = { has_trait = compassionate }
				}
				modifier = {
					add = -25
					scope:hermit_scope = { has_trait = callous }
				}
				desc = travel_events.3062.c.failure
				send_interface_toast = {
					left_icon = scope:hermit_scope
					title = travel_events.3062.c.failure
					scope:hermit_owner = { add_courtier = scope:hermit_scope }
					current_travel_plan = { remove_character = scope:hermit_scope }
				}
			}
		}
		stress_impact = {
			arrogant = medium_stress_impact_gain
			callous = medium_stress_impact_gain
		}
		
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				has_trait = arrogant
			}
			modifier = {
				factor = 0
				has_trait = callous
			}
		}
	}
}

#############################################
# Bandits on a bridge
# By Veronica Pazos
# 3070
#############################################

travel_events.3070 = { 
    type = character_event
    title = travel_events.3070.t
    desc = travel_events.3070.desc
    theme = travel_danger
	override_background = {
		reference = ep2_travel_bridge
	}
    left_portrait = {
		character = root
		triggered_animation = {
			trigger = {
				OR = {
					has_trait = brave
					has_trait = wrathful
					has_trait = arrogant
					has_trait = vengeful
				}
			}
  			animation = anger
  		}
		animation = shock
	}
    right_portrait = {
        character = scope:bandit_scope
        animation = schadenfreude
    }
	lower_left_portrait = scope:knight_scope
    cooldown = { years = 2 }
	
    trigger = {
		is_playable_character = yes
		location ?= { is_riverside_province = yes } #there's an actual river
		exists = location.province_owner
		current_travel_plan ?= {
			any_entourage_character = {
				NOT = { this = root }
				count > 1
			}
		}
		NOR = { 
			has_character_flag = had_travel_danger_event_1002_bandit_event_recently
			has_character_flag = had_travel_event_1003_bandit_event_recently
		}
    }
	
	weight_multiplier = {
		base = 1
		modifier = {
			factor = 5
			has_variable = bad_prophecy_var
		}
	}
	
    immediate = {
    	wayfarer_storyteller_fame_effect = { VALUE = roaming_reward_fame_small }
		location.province_owner = { save_scope_as = value_target }
		create_character = {
			location = root.location
			template = bandit_character
			gender_female_chance = scope_value_target_soldier_female_chance
			save_scope_as = bandit_scope
		}
		scope:bandit_scope = {
			add_character_flag = wear_armor
		}
		mp_delay_travel_plan = { DAYS = 90 }
		current_travel_plan = {
			ordered_entourage_character = {
				limit = { NOT = { this = root } }
				order_by = {
					value = prowess
					if = {
						limit = { is_knight_of = root }
						add = 50
					}
					if = {
						limit = {
							root = { exists = cp:councillor_marshal }
							this = root.cp:councillor_marshal
						}
						add = 50
					}
					if = {
						limit = { has_court_position = bodyguard_court_position }
						add = 50
					}
					if = {
						limit = { has_court_position = akolouthos_court_position }
						add = 50
					}
				}
				save_scope_as = knight_scope
			}
		}
		traveler_danger_xp_effect = {
			MIN = 3
			MAX = 7
		}
		add_character_flag = {
			flag = had_travel_event_3070_bandit_event_recently
			years = 5
		}
	}
	
	#Pay
    option = { 
        name = travel_events.3070.a
		pay_short_term_gold = {
			target = scope:bandit_scope
			gold = tiny_gold_value
		}
		stress_impact = {
			greedy = medium_stress_impact_gain
			avaricious = medium_stress_impact_gain
			arrogant = medium_stress_impact_gain
			brave = medium_stress_impact_gain
		}
		
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				has_trait = greedy
			}
			modifier = {
				factor = 0
				has_trait = avaricious
			}
			modifier = {
				factor = 0
				has_trait = arrogant
			}
			modifier = {
				factor = 0
				has_trait = brave
			}
		}
	}
	
	#Refuse
    option = {
        name = travel_events.3070.b
		scope:knight_scope = {
			duel = {
				skill = prowess
				target = scope:bandit_scope
				50 = {
					desc = travel_events.3070.b.success
					compare_modifier = {
						value = scope:duel_value
						multiplier = 3.5
					}
					root = {
						send_interface_toast = {
							title = travel_events.3070.b.success
							left_icon = scope:knight_scope
							scope:bandit_scope = {
								increase_wounds_effect = { REASON = fight }
							}
							scope:knight_scope = {
								if = {
									limit = {
										NOT = { has_trait = aggressive_attacker }
										number_of_commander_traits < commander_trait_limit
									}
									random_list = {
										50 = { }
										50 = {
											add_trait = aggressive_attacker
										}
									}
								}
							}
						}
					}
				}
				50 = {
					desc = travel_events.3070.b.failure
					compare_modifier = {
						value = scope:duel_value
						multiplier = -3.5
					}
					root = {
						send_interface_toast = {
							title = travel_events.3070.b.failure
							left_icon = scope:knight_scope
							scope:knight_scope = {
								increase_wounds_effect = { REASON = fight }
							}
						}
					}
				}
			}
		}
		stress_impact = {
			craven = medium_stress_impact_gain
		}
		
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				has_trait = craven
			}
		}
	}
	
	#Say IM THE KING
	option = {
		name = travel_events.3070.c
		duel = {
			skills = { intrigue prowess } #intimidation check
			target = scope:bandit_scope
			50 = {
				desc = travel_events.3070.c.success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
				}
				send_interface_toast = {
					title = travel_events.3070.c.success
					left_icon = root
					stress_impact = {
						base = miniscule_stress_impact_loss
						wrathful = miniscule_stress_impact_loss
					}
				}
			}
			50 = {
				desc = travel_events.3070.c.failure
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
				}
				send_interface_toast = {
					title = travel_events.3070.c.failure
					left_icon = scope:knight_scope
					pay_short_term_gold = {
						target = scope:bandit_scope
						gold = minor_gold_value
					}
				}
			}
		}
		stress_impact = {
			humble = medium_stress_impact_gain
			craven = medium_stress_impact_gain
			shy = medium_stress_impact_gain
			calm = medium_stress_impact_gain
		}
		
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				has_trait = humble
			}
			modifier = {
				factor = 0
				has_trait = craven
			}
			modifier = {
				factor = 0
				has_trait = shy
			}
			modifier = {
				factor = 0
				has_trait = calm
			}
		}
	}
	after = {
		remove_variable = bad_prophecy_var
		mp_resume_travel_plan = yes
	}
}

##################################################
# You find a knight errant
# by Veronica Pazos
# 3080-3081
##################################################
travel_events.3080 = { 
	type = character_event
	title = travel_events.3080.t
	desc = {
		desc = travel_events.3080.desc_intro
		first_valid = {
			triggered_desc = {
				trigger = {
					current_travel_plan = {
						any_entourage_character = {
							culture = scope:knight_errant.culture
						}
					}
				}
				desc = travel_events.3080.desc_anagnorisis
			}
		}
	}
	theme = travel
	left_portrait = {
		character = root
		animation = personality_rational
	}
	right_portrait = {
		character = scope:knight_errant
		animation = personality_honorable
	}
	cooldown = { years = 2 }
	
	trigger = {
		is_available_travelling_adult = yes
		is_playable_character = yes
		is_location_valid_for_travel_event_on_land = yes
		location.culture = {
			OR = {
				has_cultural_tradition = tradition_chivalry
				has_cultural_tradition = tradition_martial_admiration
				has_cultural_tradition = tradition_chanson_de_geste
				has_cultural_tradition = tradition_storytellers #powerful legends
			}
		}
    }
	
	weight_multiplier = {
		base = 1
		modifier = {
			factor = 5
			has_variable = good_prophecy_var
		}
		modifier = {
			factor = 5
			has_trait = gallant
		}
		upweight_for_focus_modifier = { FOCUS = martial_chivalry_focus }
	}
	
	immediate = {
		wayfarer_storyteller_fame_effect = { VALUE = roaming_reward_fame_small }
		create_character = {
			template = knight_errant_character
			dynasty = none
			location = root.location
			culture = location.culture
			faith = location.faith
			save_scope_as = knight_errant
		}
		scope:knight_errant = { add_character_flag = forced_knight_armor } #so they look like a knight if you click on them to check the traits, etc
		if = {
			limit = {
				current_travel_plan = {
					any_entourage_character = {
						culture = scope:knight_errant.culture
					}
				}
			}
			current_travel_plan = {
				random_entourage_character = {
					limit = { culture = scope:knight_errant.culture }
					save_scope_as = same_culture_companion
				}
			}
		}
		scope:knight_errant = {
			add_character_flag = wear_armor
		}
	}
	
    #Help them
	option = { 
		name = travel_events.3080.a
		custom_tooltip = travel_events.3080.a.tt
		current_travel_plan = {
			delay_travel_plan = { days = 3 }
		}
		trigger_event = travel_events.3081
		stress_impact = {
			craven = minor_stress_impact_gain
			lazy = minor_stress_impact_gain
			callous = medium_stress_impact_gain
		}
		
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				has_trait = craven
			}
			modifier = {
				factor = 0
				has_trait = lazy
			}
			modifier = {
				factor = 0.5
				has_trait = deceitful
			}
			modifier = {
				factor = 0
				has_trait = callous
			}
			ai_value_modifier = {
				ai_compassion = 0.25
				ai_boldness = 0.25
				ai_sociability = 0.25
				ai_honor = 1
			}
		}
    }
	
	#Convince them to join you regardless
	option = {
		name = travel_events.3080.b
		trigger = {
			current_travel_plan = {
				NOT = {
					any_entourage_character = {
						culture = scope:knight_errant.culture
					}
				}
			}
		}
		duel = {
			skill = diplomacy
			target = scope:knight_errant
			50 = { #they join you
				desc = travel_events.3080.b.success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				send_interface_toast = {
					title = travel_events.3080.b.success
					left_icon = scope:knight_errant
					add_courtier = scope:knight_errant
					current_travel_plan = {	add_companion = scope:knight_errant }
					if = {
						limit = { 
							number_of_knights < max_number_of_knights
							scope:knight_errant = {
								can_be_knight_trigger = { ARMY_OWNER = root }
							}
						}
						scope:knight_errant = { set_knight_status = force }
					}
					scope:knight_errant = { remove_character_flag = forced_knight_armor } #they get their own knight armor/courtier thing organically
				}
			}
			50 = { #they go back to their quest
				desc = travel_events.3080.b.failure
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				send_interface_toast = {
					title = travel_events.3080.b.failure
					left_icon = scope:knight_errant
				}
				hidden_effect = {
					scope:knight_errant = { silent_disappearance_effect = yes }
				}
			}
		}
		stress_impact = {
			paranoid = minor_stress_impact_gain #you're inviting a random
			callous = medium_stress_impact_gain
		}
		
		ai_chance = {
			base = 100
			modifier = {
				add = -50
				has_trait = paranoid
			}
			modifier = {
				add = -75
				has_trait = callous
			}
		}
	}
	
	#Steal from them
	option = {
		name = travel_events.3080.c
		trigger = {
			OR = {
				has_trait = callous
				has_trait = sadistic
				has_trait = greedy
				has_trait = avaricious
				has_trait = arbitrary
				has_trait = deceitful
				has_trait = ambitious
				has_trait = fickle
			}
		}
		scope:knight_errant = {
			pay_short_term_gold = {
				target = root
				gold = medium_gold_value
			}
			hidden_effect = {
				silent_disappearance_effect = yes
			}
		}
		stress_impact = {
			compassionate = medium_stress_impact_gain
			just = medium_stress_impact_gain
			brave = medium_stress_impact_gain
			gallant = major_stress_impact_gain
			generous = major_stress_impact_gain
		}
		
		ai_chance = {
			base = 100
			modifier = {
				add = 50
				has_trait = greedy
			}
			modifier = {
				add = 50
				has_trait = avaricious
			}
			modifier = {
				add = -75
				has_trait = compassionate
			}
			modifier = {
				add = -75
				has_trait = just
			}
			modifier = {
				add = -75
				has_trait = brave
			}
			modifier = {
				factor = 0
				has_trait = gallant
			}
			modifier = {
				factor = 0
				has_trait = generous
			}
		}
	}
	
	#A member of your entourage recognises them and convinces them to join
	option = {
		name = travel_events.3080.d
		trigger = {
			current_travel_plan = {
				any_entourage_character = {
					culture = scope:knight_errant.culture
				}
			}
		}
		add_courtier = scope:knight_errant
		current_travel_plan = {	add_companion = scope:knight_errant }
		if = {
			limit = {
				scope:knight_errant = {
					can_be_knight_trigger = { ARMY_OWNER = root }
				}
				number_of_knights < max_number_of_knights
			}
			scope:knight_errant = { set_knight_status = force }
		}
		scope:knight_errant = { remove_character_flag = forced_knight_armor } #they get their own armor/courtier when they join
		stress_impact = {
			paranoid = medium_stress_impact_gain #they're confabulating
			callous = medium_stress_impact_gain
		}
		
		ai_chance = {
			base = 100
			modifier = {
				add = -50
				has_trait = paranoid
			}
			modifier = {
				add = -75
				has_trait = callous
			}
		}
	}
	after = {
		scope:knight_errant = {
			if = {
				limit = { is_alive = yes }
				remove_character_flag = wear_armor
			}
		}
		remove_variable = good_prophecy_var
	}
}

#Help the knight errant
travel_events.3081 = {
	type = character_event
	title = travel_events.3081.t
	desc = travel_events.3081.desc
	theme = travel
	left_portrait = {
		character = root
		triggered_animation = {
			trigger = { has_trait = craven }
			animation = shock
		}
		animation = rage
	}
	right_portrait = {
		character = scope:knight_errant
		animation = disgust
    }
	artifact = {
		target = scope:sacred_water_scope
		position = lower_left_portrait
	}

    immediate = {
    	wayfarer_storyteller_fame_effect = { VALUE = roaming_reward_fame_medium }
    	hidden_effect = {
	    	scope:knight_errant = {
				set_artifact_rarity_famed = yes
				create_artifact = {
					name = sacred_water_modifier
					description = sacred_water_modifier_desc
					type = miscellaneous
					visuals = small_box
					modifier = artifact_stress_gain_4_modifier
					wealth = scope:wealth
					quality = scope:quality
					save_scope_as = sacred_water_scope
				}
			}
		}
		scope:knight_errant = {
			add_character_flag = wear_armor
		}
    }
	
    #Help them kill the beast
	option = {
		name = travel_events.3081.a
		duel = { #some other skill duel
			skill = prowess
			value = decent_skill_rating
			50 = { #they join you
				desc = travel_events.3081.a.success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
				}
				send_interface_toast = {
					title = travel_events.3081.a.success
					left_icon = scope:knight_errant
					add_character_modifier = {
						modifier = knight_errant_training_modifier
						years = 15
					}
					show_as_tooltip = { scope:sacred_water_scope = { set_owner = scope:knight_errant } }
				}
			}
			50 = { #you get injured but they still join you for trying
				desc = travel_events.3081.a.failure
				send_interface_toast = {
					title = travel_events.3081.a.failure
					left_icon = root
					increase_wounds_effect = { REASON = attacked }
					destroy_artifact = scope:sacred_water_scope
				}
			}
		}
		add_courtier = scope:knight_errant
		current_travel_plan = {	add_companion = scope:knight_errant }
		if = {
			limit = {
				number_of_knights < max_number_of_knights
				scope:knight_errant = {
					can_be_knight_trigger = { ARMY_OWNER = root }
				}
			}
			scope:knight_errant = { set_knight_status = force }
		}
		scope:knight_errant = { remove_character_flag = forced_knight_armor } #they get their own knight armor/courtier thing organically
		
		stress_impact = {
			lazy = medium_stress_impact_gain
			calm = medium_stress_impact_gain
			craven = major_stress_impact_gain
		}
		
		ai_chance = {
			base = 100
			modifier = {
				factor = 0.5
				has_trait = lazy 
			}
			modifier = {
				factor = 0.5
				has_trait = calm 
			}
			modifier = {
				factor = 0
				has_trait = craven 
			}
		}
	}
	
	#Distract the beast while they get the water
	option = {
		name = travel_events.3081.b
		duel = {
			skill = intrigue
			value = decent_skill_rating
			50 = { #they join you
				desc = travel_events.3081.b.success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
				}
				send_interface_toast = {
					title = travel_events.3081.b.success
					left_icon = scope:knight_errant
					add_character_modifier = {
						modifier = knight_errant_faith_modifier
						years = 15
					}
					show_as_tooltip = { scope:sacred_water_scope = { set_owner = scope:knight_errant } }
				}
			}
			50 = { #you get injured but they still join you for trying
				desc = travel_events.3081.a.failure
				send_interface_toast = {
					title = travel_events.3081.a.failure
					left_icon = scope:knight_errant
					increase_wounds_effect = { REASON = attacked }
					destroy_artifact = scope:sacred_water_scope
				}
			}
		}
		add_courtier = scope:knight_errant
		current_travel_plan = {	add_companion = scope:knight_errant }
		if = {
			limit = {
				number_of_knights < max_number_of_knights
				scope:knight_errant = {
					can_be_knight_trigger = { ARMY_OWNER = root }
				}
			}
			scope:knight_errant = { set_knight_status = force }
		}
		scope:knight_errant = { remove_character_flag = forced_knight_armor } #they get their own knight armor/courtier thing organically
		stress_impact = {
			wrathful = medium_stress_impact_gain
			brave = major_stress_impact_gain
			gallant = major_stress_impact_gain
		}
		
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				has_trait = wrathful 
			}
			modifier = {
				factor = 0
				has_trait = brave 
			}
			modifier = {
				factor = 0
				has_trait = gallant 
			}
		}
	}
	
	#Betray them
	option = {
		name = travel_events.3081.c
		scope:sacred_water_scope = { set_owner = root }
		scope:knight_errant = { silent_disappearance_effect = yes }
		stress_impact = {
			callous = medium_stress_impact_loss
			sadistic = medium_stress_impact_loss
			compassionate = medium_stress_impact_gain
			just = medium_stress_impact_gain
			brave = medium_stress_impact_gain
			honest = medium_stress_impact_gain
		}
		
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				has_trait = compassionate 
			}
			modifier = {
				factor = 0
				has_trait = just 
			}
			modifier = {
				factor = 0
				has_trait = brave 
			}
			modifier = {
				factor = 0
				has_trait = honest 
			}
		}
	}
	
	#I really enjoyed this chivalrous thing you did
	option = {
		name = travel_events.3081.d
		custom_tooltip = travel_events.1201.a.tt #this is not an error, the TT comes from a cultural discount event
		trigger = {
			culture = { NOT = { has_cultural_tradition = tradition_chivalry } }
			has_focus_or_focus_trait_trigger = { FOCUS = martial_chivalry_focus }
		}
		set_variable = tradition_chivalry_travel_discount
		
		ai_chance = {
			base = 100
			modifier = {
				factor = 2
				has_trait = gallant 
			}
			modifier = {
				factor = 1.25
				has_trait = brave 
			}
			modifier = {
				factor = 0
				has_trait = craven 
			}
		}
	}
	
	after = {
		current_travel_plan = {
			resume_travel_plan = yes
		}
		scope:knight_errant = {
			if = {
				limit = { is_alive = yes }
				remove_character_flag = wear_armor
			}
		}
	}
}

##################################################
# You wanna go visit the local temples and they're all closed in preparation for the activity
# by Veronica Pazos
# 3090
##################################################
travel_events.3090 = { 
	type = character_event
	title = travel_events.3090.t
	desc = {
		desc = travel_events.3090.desc_intro
		first_valid = {
			triggered_desc = {
				trigger = {
					has_trait = zealous
				}
				desc = travel_events.3090.desc_zealous
			}
			triggered_desc = {
				trigger = {
					has_trait = cynical
				}
				desc = travel_events.3090.desc_cynical
			}
		}
		desc = travel_events.3090.desc_outro
	}
	theme = travel
    left_portrait = {
		character = root
		animation = personality_rational
	}
	right_portrait = {
		character = scope:local_monk
		animation = beg
	}
    override_background = { reference = alley_day }
    cooldown = { years = 2 }
	
	trigger = {
		is_playable_character = yes
		is_available_travelling_adult = yes
		is_location_valid_for_travel_event_on_land = yes
		exists = location.barony.holder
		NOT = { location.barony.holder = root }
		exists = involved_activity #there must be something there for the temples to prepare for
		involved_activity.activity_host = { NOT = { this = root } } #you're not the host
		exists = involved_activity.activity_location.barony.lessee
		involved_activity.activity_location = {
			has_holding_type = church_holding
			barony = {
				lessee = {
					NOT = { this = root } #you're not the responsible for this
					is_available_ai_adult = yes
				}
			}
		}
    }
	
	weight_multiplier = {
		base = 1
		modifier = {
			factor = 2
			has_trait = zealous
		}
	}
	
	immediate = {
		location = { save_scope_as = church_visit_location }
		location.barony.holder = { save_scope_as = church_visit_holder }
		involved_activity = { save_scope_as = activity }
		create_character = {
			template = monk_character_template
			dynasty = none
			location = root.location
			save_scope_as = local_monk
		}
	}
	
    #Convince them to open it
	option = { 
		name = travel_events.3090.a
		duel = {
			skill = diplomacy
			target = scope:local_monk
			50 = {
				desc = travel_events.3090.a.success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
				}
				send_interface_toast = {
					title = travel_events.3090.a.success
					left_icon = root
					add_piety = minor_piety_gain
				}
			}
			50 = {
				desc = travel_events.3090.a.failure
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
				}
				send_interface_toast = {
					title = travel_events.3090.a.failure
					left_icon = root
					add_piety = medium_piety_loss
				}
			}
		}
		stress_impact = {
			patient = minor_stress_impact_gain
			shy = medium_stress_impact_gain
			wrathful = medium_stress_impact_gain
			cynical = medium_stress_impact_gain
		}
		
		ai_chance = {
			base = 100
			modifier = {
				add = -75
				has_trait = patient
			}
			modifier = {
				factor = 0
				has_trait = shy
			}
			modifier = {
				factor = 0
				has_trait = wrathful
			}
			modifier = {
				factor = 0
				has_trait = cynical
			}
		}
    }
	
	#Attempt to sneak in
	option = {
		name = travel_events.3090.b
		trigger = {
			scope:church_visit_holder = {
				any_secret = { NOT = { is_known_by = ROOT } }
			}
		}
		duel = {
			skill = intrigue
			value = decent_skill_rating
			50 = {
				desc = travel_events.3090.b.success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
				}
				send_interface_toast = { #you see some documents you shouldn't have seen
					title = travel_events.3090.b.success
					desc = travel_events.3090.b.success_desc
					left_icon = root
					random_secret = {
						limit = {
							secret_owner = scope:church_visit_holder
							NOT = { is_known_by = ROOT }
						}
						reveal_to = ROOT
					}
				}
			}
			50 = {
				desc = travel_events.3090.b.failure
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
				}
				send_interface_toast = {
					title = travel_events.3090.b.failure
					left_icon = root
					add_piety = minor_prestige_loss
					reverse_add_opinion = {
						target = scope:church_visit_holder
						modifier = insult_opinion
						opinion = -20
					}
				}
			}
		}
		stress_impact = {
			diligent = medium_stress_impact_gain
			honest = medium_stress_impact_gain
			cynical = medium_stress_impact_gain
		}
		
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				has_trait = diligent
			}
			modifier = {
				factor = 0
				has_trait = honest
			}
			modifier = {
				factor = 0
				has_trait = cynical
			}
		}
	}
	
	#Break in
	option = {
		name = travel_events.3090.c
		add_piety = medium_piety_loss
		if = {
			limit = { has_trait = zealous }
			add_learning_lifestyle_xp = medium_lifestyle_xp
		}
		add_dread = medium_dread_gain
		reverse_add_opinion = {
			target = scope:church_visit_holder
			modifier = insult_opinion
			opinion = -50
		}
		stress_impact = {
			base = minor_stress_impact_gain
			zealous = minor_stress_impact_loss
			wrathful = minor_stress_impact_loss
			patient = minor_stress_impact_gain
			craven = minor_stress_impact_gain
			diligent = medium_stress_impact_gain
			temperate = medium_stress_impact_gain
			calm = major_stress_impact_gain
			cynical = major_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				add = -75
				has_trait = patient
			}
			modifier = {
				add = -75
				has_trait = craven
			}
			modifier = {
				factor = 0
				has_trait = diligent
			}
			modifier = {
				factor = 0
				has_trait = temperate
			}
			modifier = {
				factor = 0
				has_trait = calm
			}
			modifier = {
				factor = 0
				has_trait = cynical
			}
		}
	}
	
	#You really don't care
	option = {
		name = travel_events.3090.d
		current_travel_plan = {
			add_travel_plan_modifier = ignored_church
		}
		stress_impact = {
			impatient = medium_stress_impact_gain
			zealous = major_stress_impact_gain
		}
		
		ai_chance = {
			base = 100
			modifier = {
				add = 100
				has_trait = cynical
			}
			modifier = {
				add = -75
				has_trait = impatient
			}
			modifier = {
				factor = 0
				has_trait = zealous
			}
		}
	}
}

##################################################
# Danger! Your horses have a bad time in the steppes (inspired by poor John of Pian de Carpine changing horses 4 times a day)
# by Veronica Pazos
# 3100
##################################################
travel_events.3100 = { 
	type = character_event
	title = travel_events.3100.t
	desc = {
		desc = travel_events.3100.desc_intro
		first_valid = {
			#EK DISABLED
			#triggered_desc = {
			#	trigger = { #if you're from a Steppe culture or not
			#		capital_province = { geographical_region = world_steppe }
			#	}
			#	desc = travel_events.3100.desc_steppe
			#}
		}
		desc = travel_events.3100.desc_outro
	}
	theme = travel_danger
    left_portrait = {
		character = root
		animation = worry
	}
	right_portrait = {
		character = scope:local_merchant
		animation = personality_greedy
	}
    cooldown = { years = 2 }
	
	trigger = {
		is_available_travelling_adult = yes
		is_playable_character = yes
		is_location_valid_for_travel_event_on_land = yes
		current_travel_plan = {
			is_travel_with_domicile = no
		}
		location = {
			travel_danger_type = {
				travel_plan = root.current_travel_plan
				terrain = steppe
			}
		}
    }
	
	weight_multiplier = {
		base = 1
		modifier = {
			factor = 0.5
			current_travel_plan = {
				has_travel_option = fancy_mounts_option
			}
		}
	}
	
	immediate = {
		mp_delay_travel_plan = { DAYS = 90 }
		location = { save_scope_as = horses_steppe_location }
		create_character = {
			template = merchant_template
			dynasty = none
			location = root.location
			save_scope_as = local_merchant
		}
		traveler_danger_xp_effect = {
			MIN = 3
			MAX = 7
		}
	}
	
    #Pay for the horses
	option = { 
		name = travel_events.3100.a
		pay_short_term_gold = {
			target = scope:local_merchant
			gold = minor_gold_value
		}
		current_travel_plan = {
			add_travel_plan_modifier = bought_horses_modifier
		}
		#increases travel safety AND speed
		stress_impact = {
			greedy = medium_stress_impact_gain
			avaricious = medium_stress_impact_gain
		}
		
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_greed = -1
			}
			modifier = {
				factor = 0
				gold <= medium_gold_value
			}
		}
    }
	
	#Push them a bit more
	option = {
		name = travel_events.3100.b
		trigger = {
			current_travel_plan = {
				NOT = { has_travel_option = fancy_mounts_option }
			}
		}
		random_list = {
			35 = { #they make it
				#EK DISABLED
				#modifier = {
				#	factor = 1.5
				#	capital_province = { geographical_region = world_steppe } #you know how to do this stuff
				#}
				modifier = {
					factor = 1
					has_trait = rough_terrain_expert
				}
				send_interface_toast = {
					title = travel_events.3100.b.success
					left_icon = root
					current_travel_plan = {
						add_travel_plan_modifier = pushed_horses_good_modifier
					}
					#safety goes up
				}
			}
			65 = { #they don't
				send_interface_toast = {
					title = travel_events.3100.b.failure
					left_icon = root
					current_travel_plan = {
						add_travel_plan_modifier = pushed_horses_bad_modifier
					}
					#speed AND safety goes down 
				}
			}
		}
		stress_impact = {
			base = minor_stress_impact_gain
			compassionate = medium_stress_impact_gain
			eccentric = medium_stress_impact_loss
		}
		
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = -1
				ai_rationality = -0.5
				ai_boldness = 0.2
				ai_vengefulness = 0.2
			}
		}
	}
	
	#Steal some horses
	option = {
		name = travel_events.3100.c
		duel = {
			skill = intrigue
			target = scope:local_merchant
			50 = {
				desc = travel_events.3100.c.success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
				}
				send_interface_toast = {
					title = travel_events.3100.c.success
					left_icon = root
					current_travel_plan = {
						add_travel_plan_modifier = bought_horses_modifier
					}
					#increase travel safety AND speed
				}
			}
			50 = {
				desc = travel_events.3100.c.failure
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
				}
				send_interface_toast = {
					title = travel_events.3100.c.failure
					left_icon = root
					#you're forced to pay _more_
					pay_short_term_gold = {
						target = scope:local_merchant
						gold = medium_gold_value
					}
					current_travel_plan = {
						add_travel_plan_modifier = bought_horses_modifier
					}
					#you still get the travel safety AND speed modifiers 
				}
			}
		}
		stress_impact = {
			base = minor_stress_impact_gain
			deceitful = minor_stress_impact_loss
			arbitrary = minor_stress_impact_loss
			compassionate = minor_stress_impact_gain
			temperate = minor_stress_impact_gain
			honest = medium_stress_impact_gain
			generous = medium_stress_impact_gain
			just = major_stress_impact_gain
		}
		
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = -0.5
				ai_honor = -1
			}
			modifier = {
				factor = 0
				has_trait = honest
			}
			modifier = {
				factor = 0
				has_trait = generous
			}
			modifier = {
				factor = 0
				has_trait = just
			}
			modifier = {
				factor = 0
				gold <= major_gold_value
			}
		}
	}
	
	#Your horses can take this
	option = {
		name = travel_events.3100.d
		trigger = {
			current_travel_plan = {
				has_travel_option = fancy_mounts_option
			}
		}
		random_list = {
			70 = { #they make it
				#EK DISABLED
				#modifier = {
				#	factor = 1.5
				#	capital_province = { geographical_region = world_steppe }
				#}
				modifier = {
					factor = 1
					has_trait = rough_terrain_expert
				}
				send_interface_toast = {
					title = travel_events.3100.b.success
					left_icon = root
					current_travel_plan = {
						add_travel_plan_modifier = pushed_horses_good_modifier
					}
					#travel safety goes up
				}
			}
			30 = { #they don't
				send_interface_toast = {
					title = travel_events.3100.b.failure
					left_icon = root
					current_travel_plan = {
						add_travel_plan_modifier = pushed_horses_bad_modifier
					}
					#travel safety goes down 
				}
			}
		}
		stress_impact = {
			compassionate = medium_stress_impact_gain
		}
		
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = -1
				ai_rationality = -0.5
				ai_boldness = 0.2
				ai_vengefulness = 0.2
			}
		}
	}
	after = {
		mp_resume_travel_plan = yes
	}
}

##################################################
# Danger! Taiga/Jungle/Forest catches fire
# by Veronica Pazos
# 3120
##################################################
travel_events.3120 = {
	type = character_event
	title = travel_events.3120.t
	desc = travel_events.3120.desc
	theme = travel_danger
    left_portrait = {
		character = root
		animation = shock
	}
	right_portrait = {
		character = scope:endangered_character
		animation = fear
	}
	lower_center_portrait = scope:travel_leader
	lower_left_portrait = {
		trigger = { exists = scope:prowess_entourage_member }
		character = scope:prowess_entourage_member
	}
    cooldown = { years = 1 }
	
	trigger = {
		is_available_travelling_adult = yes
		is_playable_character = yes
		is_location_valid_for_travel_event_on_land = yes
		current_travel_plan = {
			any_entourage_character = {
				count > 2
			}
		}
		location_has_winter_trigger = no 
		location = {
			OR = {
				travel_danger_type = {
					travel_plan = root.current_travel_plan
					terrain = jungle
				}
				travel_danger_type = {
					travel_plan = root.current_travel_plan
					terrain = forest
				}
				travel_danger_type = {
					travel_plan = root.current_travel_plan
					terrain = taiga
				}
			}
		}
    }
	
	weight_multiplier = {
		base = 1
	}
	
	immediate = {
		wayfarer_storyteller_fame_effect = { VALUE = roaming_reward_fame_small }
		location = { save_scope_as = wooded_location }
		#TODO_CD_EP2 this event needs to account for a situation where we don't have a travel_leader
		mp_delay_travel_plan = { DAYS = 90 }
		current_travel_plan = {
			travel_leader ?= { save_scope_as = travel_leader }
			if = {
				limit = {
					NOT = { exists = scope:travel_leader }
				}
				ordered_entourage_character = {
					order_by = martial
					limit = {
						NOT = { this = root }
					}
					save_scope_as = travel_leader #Should be rare but if needed this character fills the role of a caravan master for purposes of this event
				}
			}
			ordered_entourage_character = {
				order_by = prowess
				limit = {
					NOR = {
						this = root
						this = scope:travel_leader
					}
				}
				save_scope_as = prowess_entourage_member
			}
			random_entourage_character = {
				limit = {
					NOR = {
						this = root
						this = scope:travel_leader
						this = scope:prowess_entourage_member
					}
				}
				weight = {
					base = 1
					# Try to find someone relevant
					modifier = {
						is_close_family_of = root
						add = 2
					}
					modifier = {
						has_friendly_relationship_with_root_trigger = yes
						add = 1
					}
				}
				save_scope_as = endangered_character
			}
		}
		traveler_danger_xp_effect = {
			MIN = 3
			MAX = 7
		}
	}
	
    #Travel Leader! Save them!
	option = { 
		name = travel_events.3120.a
		trigger = {
			 exists = scope:travel_leader
		}
		scope:travel_leader = {
			duel = {
				skill = prowess
				value = medium_skill_rating
				25 = { #both end up unwounded
					desc = travel_events.3120.a.big_success
					compare_modifier = {
						value = scope:duel_value
						multiplier = 3.5
					}
					root = {
						send_interface_toast = {
							title = travel_events.3120.a.big_success
							left_icon = scope:travel_leader
						}
					}
				}
				50 = { #they save the entourage member but get wounded in the process
					desc = travel_events.3120.a.success
					compare_modifier = {
						value = scope:duel_value
						multiplier = 3.5
					}
					root = {
						send_interface_toast = {
							title = travel_events.3120.a.success
							left_icon = scope:travel_leader
							scope:travel_leader = {
								increase_wounds_effect = { REASON = burned }
							}
						}
					}
				}
				25 = { #they fail to save the entourage member
					desc = travel_events.3120.a.failure
					compare_modifier = {
						value = scope:duel_value
						multiplier = -3.5
					}
					root = {
						send_interface_toast = {
							title = travel_events.3120.a.failure
							left_icon = scope:endangered_character
							scope:endangered_character = {
								death = {
									death_reason = death_fire
								}
							}
						}
					}
				}
			}
		}
		stress_impact = {
			callous = medium_stress_impact_gain
			sadistic = medium_stress_impact_gain
		}
		
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				has_trait = callous
			}
			modifier = {
				factor = 0
				has_trait = sadistic
			}
		}
	}
	#Prowess person! Save them!
	option = { 
		name = travel_events.3120.d
		trigger = {
			exists = scope:prowess_entourage_member
		}
		scope:prowess_entourage_member = {
			duel = {
				skill = prowess
				value = medium_skill_rating
				30 = { #both end up unwounded
					desc = travel_events.3120.d.big_success
					compare_modifier = {
						value = scope:duel_value
						multiplier = 3.5
					}
					root = {
						send_interface_toast = {
							title = travel_events.3120.d.big_success
							left_icon = scope:endangered_character
							if = {
								limit = {
									scope:prowess_entourage_member = {
										can_add_hook = {
											type = favor_hook
											target = root
										}
									}
								}
								scope:prowess_entourage_member = {
									add_hook = {
										type = favor_hook
										target = root
									}
								}
							}
						}
					}
				}
				60 = { #they save the entourage member but get wounded in the process
					desc = travel_events.3120.d.success
					compare_modifier = {
						value = scope:duel_value
						multiplier = 3.5
					}
					root = {
						send_interface_toast = {
							title = travel_events.3120.d.success
							left_icon = scope:endangered_character
							scope:prowess_entourage_member = {
								increase_wounds_effect = { REASON = burned }
							}
						}
						if = {
							limit = {
								scope:prowess_entourage_member = {
									can_add_hook = {
										type = favor_hook
										target = root
									}
								}
							}
							scope:prowess_entourage_member = {
								add_hook = {
									type = favor_hook
									target = root
								}
							}
						}
					}
				}
				15 = { #they fail to save the entourage member
					desc = travel_events.3120.d.failure
					compare_modifier = {
						value = scope:duel_value
						multiplier = -3.5
					}
					root = {
						send_interface_toast = {
							title = travel_events.3120.d.failure
							left_icon = scope:endangered_character
							scope:endangered_character = {
								death = {
									death_reason = death_fire
								}
							}
							scope:prowess_entourage_member = {
								increase_wounds_effect = { REASON = burned }
							}
						}
					}
				}
			}
		}
		stress_impact = {
			callous = medium_stress_impact_gain
			sadistic = medium_stress_impact_gain
		}
		
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				has_trait = callous
			}
			modifier = {
				factor = 0
				has_trait = sadistic
			}
		}
    }
	#I'll save them!
	option = { 
		name = travel_events.3120.c
		root = {
			duel = {
				skill = prowess
				value = medium_skill_rating
				25 = { #both end up unwounded
					desc = travel_events.3120.a.big_success
					compare_modifier = {
						value = scope:duel_value
						multiplier = 3.5
					}
					root = {
						send_interface_toast = {
							title = travel_events.3120.a.big_success
							left_icon = scope:endangered_character
						}
					}
				}
				50 = { #they save the entourage member but get wounded in the process
					desc = travel_events.3120.a.success
					compare_modifier = {
						value = scope:duel_value
						multiplier = 3.5
					}
					root = {
						send_interface_toast = {
							title = travel_events.3120.a.success
							left_icon = scope:endangered_character
							root = {
								increase_wounds_effect = { REASON = burned }
							}
						}
					}
				}
				25 = { #they fail to save the entourage member
					desc = travel_events.3120.a.failure
					compare_modifier = {
						value = scope:duel_value
						multiplier = -3.5
					}
					root = {
						send_interface_toast = {
							title = travel_events.3120.a.failure
							left_icon = scope:endangered_character
							scope:endangered_character = {
								death = {
									death_reason = death_fire
								}
							}
							root = {
								increase_wounds_effect = { REASON = burned }
							}
						}
					}
				}
			}
		}
		stress_impact = {
			callous = medium_stress_impact_gain
			sadistic = medium_stress_impact_gain
		}
		
		ai_chance = {
			base = 0
			modifier = {
				add = root.prowess
				root.prowess > 0
			}
			modifier = {
				factor = 0
				has_trait = callous
			}
			modifier = {
				factor = 0
				has_trait = sadistic
			}
		}
    }
	
	#Sucks to be you
	option = {
		name = travel_events.3120.b
		scope:endangered_character = {
			death = {
				death_reason = death_fire
			}
		}
		stress_impact = {
			base = minor_stress_impact_gain #someone just died in front of you
			gregarious = medium_stress_impact_gain
			compassionate = major_stress_impact_gain
		}
		
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				has_trait = gregarious
			}
			modifier = {
				factor = 0
				has_trait = compassionate
			}
		}
	}

	after = {
		mp_resume_travel_plan = yes
	}
}

##################################################
# Danger! Sexy assassin sent to kill you. Flirt?
# by Veronica Pazos
# 3130
##################################################
travel_events.3130 = { 
	type = character_event
	title = travel_events.3130.t
	desc = travel_events.3130.desc
	theme = travel_danger
    left_portrait = {
		character = root
		triggered_animation = {
			trigger = { has_lustful_adjacent_trait_trigger = yes }
			animation = flirtation_left
		}
		triggered_animation = {
			trigger = {
				OR = {
					has_trait = calm
					has_trait = craven
				}
			}
			animation = shock
		}
		animation = anger
	}
	right_portrait = {
		character = scope:sexy_assassin
		animation = assassin
	}
	lower_center_portrait = scope:rival_scope
    cooldown = { years = 1 }
	
	trigger = {
		is_playable_character = yes
		is_available_travelling_adult = yes
		is_location_valid_for_travel_event_on_land = yes
		location = {
			exists = province_owner
			province_owner = { 
				is_ai = yes 
				OR = {
					opinion = {
						target = root
						value <= 0
					}
					has_relation_rival = root
				}
				OR = {
					has_trait = callous
					has_trait = sadistic
					AND = {
						NOT = { has_trait = compassionate }
						opinion = {
							target = root
							value <= -25
						}
					}
				}
			}
			travel_danger_type = {
				travel_plan = root.current_travel_plan
				type = owner_opinion
			}
		}
    }
	
	weight_multiplier = {
		base = 1
		modifier = {
			factor = 0.5
			current_travel_plan = { has_travel_option = circumspect_option }
		}
		modifier = {
			factor = 2
			location.province_owner ?= {
				OR = {
					opinion = {
						target = root
						value <= -25
					}
					has_relation_rival = root
				}
			}
		}
	}
	
	immediate = {
		location = {
			save_scope_as = assassin_location
			province_owner = { save_scope_as = rival_scope }
		}
		mp_delay_travel_plan = { DAYS = 90 }
		create_character = {
			template = sexy_assassin_character
			location = root.location
			save_scope_as = sexy_assassin
		}
		traveler_danger_xp_effect = {
			MIN = 3
			MAX = 7
		}
	}
	
    #Kill them immediately
	option = { 
		name = travel_events.3130.a
		duel = {
			skill = prowess
			target = scope:sexy_assassin
			50 = {
				desc = travel_events.3130.a.success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				send_interface_toast = {
					title = travel_events.3130.a.success
					left_icon = scope:sexy_assassin
					right_icon = scope:rival_scope
					add_character_modifier = {
						modifier = executed_assassin_modifier
						years = 5
					}
					scope:sexy_assassin = {
						death = {
							death_reason = death_fight
							killer = root
						}
					}
					if = {
						limit = {
							NOT = { has_relation_nemesis = scope:rival_scope }
						}
						set_relation_nemesis = {
							reason = nemesis_sent_assassins
							copy_reason = rival
							target = scope:rival_scope
						}
					}
				}
			}
			50 = {
				desc = travel_events.3130.a.failure
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				send_interface_toast = {
					title = travel_events.3130.a.failure
					left_icon = scope:sexy_assassin
					right_icon = scope:rival_scope
					increase_wounds_effect = { REASON = attacked }
					scope:rival_scope = { add_courtier = scope:sexy_assassin }
				}
			}
		}
			
		stress_impact = {
			base = minor_stress_impact_gain #you always get stressed because someone tried to kill you
			callous = medium_stress_impact_loss #to offset the penalty
			sadistic = medium_stress_impact_loss
			vengeful = medium_stress_impact_loss
			wrathful = medium_stress_impact_loss
			compassionate = medium_stress_impact_gain
			calm = medium_stress_impact_gain
			forgiving = major_stress_impact_gain
		}
		
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				has_trait = compassionate
			}
			modifier = {
				factor = 0
				has_trait = calm
			}
			modifier = {
				factor = 0
				has_trait = forgiving
			}
			modifier = {
				factor = 1.5
				has_trait = wrathful
			}
			modifier = {
				factor = 1.5
				has_trait = vengeful
			}
			modifier = {
				factor = 1.25
				has_trait = callous
			}
			modifier = {
				factor = 1.25
				has_trait = sadistic
			}
		}
    }
	
	#Send them back to rival with a message
	option = {
		name = travel_events.3130.b
		duel = {
			skill = martial
			target = scope:sexy_assassin
			50 = {
				desc = travel_events.3130.b.success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				send_interface_toast = {
					title = travel_events.3130.b.success
					left_icon = scope:sexy_assassin
					right_icon = scope:rival_scope
					add_character_modifier = {
						modifier = sent_assassin_back_modifier
						years = 5
					}
					scope:rival_scope = {
						add_courtier = scope:sexy_assassin
						add_opinion = {
							target = root
							modifier = angry_opinion
							opinion = -20
						}
					}
				}
			}
			50 = {
				desc = travel_events.3130.a.failure
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				send_interface_toast = {
					title = travel_events.3130.a.failure
					left_icon = scope:sexy_assassin
					right_icon = scope:rival_scope
					increase_wounds_effect = { REASON = attacked }
					scope:rival_scope = { add_courtier = scope:sexy_assassin }
				}
			}
		}
		stress_impact = {
			base = minor_stress_impact_gain #you always get stressed because someone tried to kill you
			compassionate = medium_stress_impact_gain
			forgiving = medium_stress_impact_gain
		}
		
		ai_chance = {
			base = 100
			modifier = {
				factor = 0.5
				has_trait = compassionate
			}
			modifier = {
				factor = 0.5
				has_trait = forgiving
			}
		}
	}
	
	#Recruit them
	option = {
		name = travel_events.3130.c
		trigger = {
			current_travel_plan = {
				OR = {
					has_travel_option = circumspect_option
					has_travel_option = anxious_option
				}
			}
		}
		add_courtier = scope:sexy_assassin
    	current_travel_plan = { add_companion = scope:sexy_assassin }
		add_character_modifier = {
			modifier = sent_assassin_back_modifier
			years = 5
		}
		stress_impact = {
			base = minor_stress_impact_gain #you always get stressed because someone tried to kill you
			wrathful = medium_stress_impact_gain
			paranoid = medium_stress_impact_gain
			vengeful = major_stress_impact_gain
		}
		
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				has_trait = wrathful
			}
			modifier = {
				factor = 0
				has_trait = paranoid
			}
			modifier = {
				factor = 0
				has_trait = vengeful
			}
			modifier = {
				factor = 1.5
				has_trait = compassionate
			}
			modifier = {
				factor = 1.5
				has_trait = forgiving
			}
		}
	}
	
	#Flirt?
	option = {
		name = travel_events.3130.d
		trigger = {
			has_lustful_adjacent_trait_trigger = yes
		}
		add_courtier = scope:sexy_assassin
    	current_travel_plan = { add_companion = scope:sexy_assassin }
		progress_towards_lover_effect = {
			CHARACTER = scope:sexy_assassin
			REASON = lover_sexy_assassin
			OPINION = 20
		}
		stress_impact = {
			base = minor_stress_impact_gain #you always get stressed because someone tried to kill you
			deviant = minor_stress_impact_loss
			lustful = medium_stress_impact_loss
			seducer = medium_stress_impact_loss
			rakish = medium_stress_impact_loss
			callous = medium_stress_impact_gain
			wrathful = medium_stress_impact_gain
			paranoid = medium_stress_impact_gain #you would never flirt with the person that tried to kill you
			vengeful = major_stress_impact_gain
		}
		ai_chance = {
			modifier = {
				factor = 0
				has_trait = callous
			}
			modifier = {
				factor = 0
				has_trait = wrathful
			}
			modifier = {
				factor = 0
				has_trait = paranoid
			}
			modifier = {
				factor = 0
				has_trait = vengeful
			}
			modifier = {
				factor = 2
				has_trait = lustful
			}
			modifier = {
				factor = 2
				has_trait = seducer
			}
			modifier = {
				factor = 1.5
				has_trait = deviant
			}
			modifier = {
				factor = 1.5
				has_trait = forgiving
			}
			modifier = {
				factor = 1.25
				has_trait = compassionate
			}
		}
	}
	
	#Let them go
	option = {
		name = travel_events.3130.e
		trigger = {
			has_lustful_adjacent_trait_trigger = no
		}
		add_prestige = minor_prestige_loss
		stress_impact = {
			base = minor_stress_impact_gain #you always get stressed because someone tried to kill you
			forgiving = minor_stress_impact_loss
			callous = medium_stress_impact_gain
			wrathful = medium_stress_impact_gain
			paranoid = medium_stress_impact_gain 
			vengeful = major_stress_impact_gain
		}
		ai_chance = {
			modifier = {
				factor = 0
				OR = {
					has_trait = callous
					has_trait = wrathful
					has_trait = paranoid
					has_trait = vengeful
				}
			}
		}
	}
	
	after = {
		mp_resume_travel_plan = yes
	}
}

##################################################
# Danger! Army in occupied/sieged province tries to capture you
# by Veronica Pazos
# 3140
##################################################

scripted_trigger travel_events.3140.has_aggressive_trait = {
	OR = {
		has_trait = wrathful
		has_trait = vengeful
		has_trait = arrogant
		has_trait = callous
		has_trait = sadistic
		has_trait = brave
	}
}

scripted_trigger travel_events.3140.is_valid_commander = {
	has_any_good_relationship_with_root_trigger = no #the commander is not someone that likes you
	NOT = { is_vassal_of = root } #and this isn't your army/vassal
	exists = liege
}
						
travel_events.3140 = { 
	type = character_event
	title = travel_events.3140.t
	desc = travel_events.3140.desc
	theme = travel_danger
    left_portrait = {
		character = root
		triggered_animation = {
			trigger = {
				OR = {
					has_trait = wrathful
					has_trait = arrogant
					has_trait = brave
				}
			}
			animation = anger
		}
		animation = fear
	}
	right_portrait = {
		character = scope:hostile_commander
		animation = disapproval
	}
	lower_center_portrait = scope:entourage_member
	override_background = { reference = army_camp }
    cooldown = { years = 1 }
	
	trigger = {
		is_playable_character = yes
		is_available_travelling_adult = yes
		is_location_valid_for_travel_event_on_land = yes
		location = {
			OR = {
				travel_danger_type = {
					travel_plan = root.current_travel_plan
					type = siege 
				}
				travel_danger_type = {
					travel_plan = root.current_travel_plan
					type = army
				}
			}
			any_army_in_location = {
				exists = army_commander
				army_commander = {
					travel_events.3140.is_valid_commander = yes
				}
			}
		}
		current_travel_plan = {
			any_entourage_character = {
				NOT = { this = root }
			}
		}
    }
	
	weight_multiplier = {
		base = 1
	}
	
	immediate = {
		wayfarer_storyteller_fame_effect = { VALUE = roaming_reward_fame_small }
		location = {
			random_army_in_location = {
				limit = {
					exists = army_commander
					army_commander = {
						travel_events.3140.is_valid_commander = yes
					}
				}
				army_commander = {
					save_scope_as = hostile_commander
				}
			}
		}
		#Leaving it random so it can grab someone you care about or someone you just don't
		mp_delay_travel_plan = { DAYS = 90 }
		current_travel_plan = {
			random_entourage_character = {
				limit = {
					NOT = { this = root }
				}
				save_scope_as = entourage_member
			}
		}
		traveler_danger_xp_effect = {
			MIN = 3
			MAX = 7
		}
	}
	
    #Make them understand
	option = { 
		name = travel_events.3140.a
		duel = {
			skill = diplomacy
			target = scope:hostile_commander
			50 = {
				desc = travel_events.3140.a.success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
				}
				#They let you go
				send_interface_toast = {
					title = travel_events.3140.a.success
					left_icon = scope:hostile_commander
				}
			}
			50 = {
				desc = travel_events.3140.a.failure
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
				}
				#They imprison your friend
				send_interface_toast = {
					title = travel_events.3140.a.failure
					left_icon = scope:hostile_commander
					rightfully_imprison_character_effect = {
						TARGET = scope:entourage_member
						IMPRISONER = scope:hostile_commander.liege
					}
				}
			}
		}
		stress_impact = {
			craven = medium_stress_impact_gain
			wrathful = medium_stress_impact_gain
			vengeful = medium_stress_impact_gain
		}
		
		ai_chance = {
			base = 100
			modifier = {
				factor = 0.25
				has_trait = craven
			}
			modifier = {
				factor = 0
				has_trait = wrathful
			}
			modifier = {
				factor = 0
				has_trait = vengeful
			}
		}
    }
	
	#Fight them
	option = {
		name = travel_events.3140.b
		duel = {
			skill = prowess
			target = scope:hostile_commander
			50 = {
				desc = travel_events.3140.b.success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
				}
				#You win the fight
				send_interface_toast = {
					title = travel_events.3140.b.success
					left_icon = scope:hostile_commander
					scope:hostile_commander = { increase_wounds_effect = { REASON = fight } }
					current_travel_plan = {
						every_entourage_character = {
							limit = {
								travel_events.3140.has_aggressive_trait = yes
							}
							add_opinion = {
								modifier = respect_opinion
								target = root
								opinion = 10
							}
						}
					}
				}
			}
			50 = {
				desc = travel_events.3140.b.failure
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
				}
				#They imprison your friend and also beat you up
				if = {
					limit = {
						scope:hostile_commander = {
							is_landed = yes
						}
					}
					send_interface_toast = {
						title = travel_events.3140.b.failure
						left_icon = scope:hostile_commander
						rightfully_imprison_character_effect = {
							TARGET = scope:entourage_member
							IMPRISONER = scope:hostile_commander
						}
						increase_wounds_effect = { REASON = fight }
					}
				}
				else = {
					send_interface_toast = {
						title = travel_events.3140.b.failure
						left_icon = scope:hostile_commander
						rightfully_imprison_character_effect = {
							TARGET = scope:entourage_member
							IMPRISONER = scope:hostile_commander.liege
						}
						increase_wounds_effect = { REASON = fight }
					}
				}
			}
		}
		stress_impact = {
			compassionate = minor_stress_impact_gain
			patient = medium_stress_impact_gain
			craven = major_stress_impact_gain
			calm = major_stress_impact_gain
		}
		
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				has_trait = compassionate
			}
			modifier = {
				factor = 0
				has_trait = patient
			}
			modifier = {
				factor = 0
				has_trait = craven
			}
			modifier = {
				factor = 0
				has_trait = calm
			}
		}
	}
	
	#Bribe them
	option = {
		name = travel_events.3140.c
		pay_short_term_gold = {
			target = scope:hostile_commander
			gold = minor_gold_value
		}
		stress_impact = {
			just = minor_stress_impact_gain
			wrathful = medium_stress_impact_gain
			vengeful = medium_stress_impact_gain
			callous = medium_stress_impact_gain
			greedy = major_stress_impact_gain
			avaricious = major_stress_impact_gain
		}
		
		ai_chance = {
			base = 100
			modifier = {
				factor = 0.5
				has_trait = just
			}
			modifier = {
				factor = 0.25
				has_trait = wrathful
			}
			modifier = {
				factor = 0.25
				has_trait = vengeful
			}
			modifier = {
				factor = 0.25
				has_trait = callous
			}
			modifier = {
				factor = 0
				has_trait = greedy
			}
			modifier = {
				factor = 0
				has_trait = avaricious
			}
			modifier = {
				factor = 0
				gold <= medium_gold_value
			}
		}
	}
	after = {
		mp_resume_travel_plan = yes
	}
}

##################################################
# Rival/Nemesis in your entourage bad mouths you
# by Veronica Pazos
# 3150
##################################################
		
travel_events.3150 = { 
	type = character_event
	title = travel_events.3150.t
	desc = travel_events.3150.desc
	theme = travel
    left_portrait = {
		character = root
		animation = disapproval
	}
	right_portrait = {
		character = scope:rival_scope
		animation = scheme
	}
	override_background = { reference = bp1_bonfire }
    cooldown = { years = 20 }
	
	trigger = {
		is_playable_character = yes
		is_available_travelling_adult = yes
		is_location_valid_for_travel_event_on_land = yes
		current_travel_plan = {
			any_entourage_character = {
				is_adult = yes
				OR = {
					has_relation_potential_rival = root
					has_relation_rival = root
				}
				NOT = { this = current_travel_plan.travel_leader }
				NOT = { is_imprisoned_by = root }
				NOT = { is_consort_of = root }
				NOT = { is_close_or_extended_family_of = root }
			}
		}
    }
	
	weight_multiplier = {
		base = 1
		modifier = {
			factor = 2
			current_travel_plan = {
				any_entourage_character = { has_relation_rival = root }
			}
		}
		modifier = { #more likely to happen if your Caravan Master also hates you
			factor = 1.5
			current_travel_plan = {
				exists = travel_leader
				travel_leader = {
					opinion = {
						target = root
						value >= low_negative_opinion
					}
				}
			}
		}
	}
	
	immediate = {
		mp_delay_travel_plan = { DAYS = 90 }
		current_travel_plan = {
			random_entourage_character = {
				limit = {
					is_adult = yes
					OR = {
						has_relation_potential_rival = root
						has_relation_rival = root
					}
					NOT = { this = current_travel_plan.travel_leader }
					NOT = { is_imprisoned_by = root }
					NOT = { is_consort_of = root }
					NOT = { is_close_or_extended_family_of = root }
				}
				weight = {
					base = 1
					modifier = {
						has_relation_rival = root
						add = 5
					}
					modifier = {
						has_relation_nemesis = root
						add = 10
					}
				}
				save_scope_as = rival_scope
			}
		}
		if = {
			limit = {
				current_travel_plan = { exists = travel_leader }
			}
			current_travel_plan.travel_leader = { save_scope_as = travel_leader }
		}
		traveler_danger_xp_effect = {
			MIN = 3
			MAX = 7
		}
	}
	
    #Fight them
	option = {
		name = travel_events.3150.a
		duel = {
			skill = prowess
			target = scope:rival_scope
			50 = {
				desc = travel_events.3150.a.success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
				}
				#You win
				send_interface_toast = {
					title = travel_events.3150.a.success
					left_icon = scope:rival_scope
					scope:rival_scope = {
						increase_wounds_effect = { REASON = fight }
					}
					current_travel_plan = { remove_character = scope:rival_scope } #we get them out of your entourage
					if = {
						limit = { scope:rival_scope = { is_courtier_of = root } } #and out of your court
						remove_courtier_or_guest = scope:rival_scope
					}
				}
			}
			50 = {
				desc = travel_events.3150.a.failure
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
				}
				#They win
				send_interface_toast = {
					title = travel_events.3150.a.failure
					left_icon = scope:rival_scope
					increase_wounds_no_death_effect = { REASON = fight }
					current_travel_plan = { remove_character = scope:rival_scope } #we still get them out of your entourage
					add_character_modifier = {
						modifier = travel_humiliation_modifier
						years = 5
					}
				}
			}
		}
		stress_impact = {
			calm = medium_stress_impact_gain
			craven = medium_stress_impact_gain
			forgiving = medium_stress_impact_gain
		}
		
		ai_chance = {
			base = 100
			modifier = {
				factor = 0.5
				has_trait = compassionate
			}
			modifier = {
				factor = 0.25
				has_trait = calm
			}
			modifier = {
				factor = 0.25
				has_trait = craven
			}
			modifier = {
				factor = 0.25
				has_trait = forgiving
			}
			modifier = {
				factor = 0.5
				has_trait = trusting
			}
		}
    }
	
	#Send your Caravan Master to get them
	option = {
		name = travel_events.3150.b
		trigger = {
			current_travel_plan = { exists = travel_leader }
		}
		if = {
			limit = {
				scope:travel_leader = {
					opinion = {
						target = root
						value >= high_positive_opinion
					}
				}
			}
			scope:travel_leader = {
				duel = {
					skill = prowess
					target = scope:rival_scope
					50 = {
						desc = travel_events.3150.b.success
						compare_modifier = {
							value = scope:duel_value
							multiplier = 3.5
						}
						#Your Caravan Master wins
						root = {
							send_interface_toast = {
								title = travel_events.3150.b.success
								left_icon = scope:travel_leader
								right_icon = scope:rival_scope
								current_travel_plan = { remove_character = scope:rival_scope } #we get them out of your entourage
								if = {
									limit = { scope:rival_scope = { is_courtier_of = root } } #and out of your court
									remove_courtier_or_guest = scope:rival_scope
								}
								scope:rival_scope = { increase_wounds_effect = { REASON = fight } }
							}
						}
					}
					50 = {
						desc = travel_events.3150.a.failure
						compare_modifier = {
							value = scope:duel_value
							multiplier = -3.5
						}
						#They win
						root = {
							send_interface_toast = {
								title = travel_events.3150.a.failure
								left_icon = scope:rival_scope
								right_icon = scope:travel_leader
								scope:travel_leader = { increase_wounds_effect = { REASON = fight } }
								current_travel_plan = { remove_character = scope:rival_scope } #we still get them out of your entourage
							}
						}
					}
				}
			}
		}
		else = {
			custom_tooltip = travel_events.3150.b.tt
			reverse_add_opinion = {
				target = scope:rival_scope
				modifier = angry_opinion
				opinion = -15
			}
		}
		stress_impact = {
			compassionate = minor_stress_impact_gain
			forgiving = minor_stress_impact_gain
			arrogant = medium_stress_impact_gain
			vengeful = major_stress_impact_gain
		}
		
		ai_chance = {
			base = 100
			modifier = {
				factor = 0.5
				has_trait = compassionate
			}
			modifier = {
				factor = 0.5
				has_trait = calm
			}
			modifier = {
				factor = 0.5
				has_trait = forgiving
			}
			modifier = {
				factor = 0.25
				has_trait = trusting
			}
			modifier = {
				factor = 0.25
				has_trait = brave
			}
			modifier = {
				factor = 0.25
				has_trait = arrogant
			}
			modifier = {
				factor = 0
				has_trait = vengeful
			}
			modifier = {
				factor = 0
				has_trait = wrathful
			}
		}
	}
	
	#Send your Guards to get them
	option = {
		name = travel_events.3150.c
		trigger = {
			is_landed = yes
			current_travel_plan = {
				OR = {
					has_travel_option = hire_experienced_mercenaries_option
					has_travel_option = military_recruits_option
					any_entourage_character = {
						is_knight_of = root 
						has_court_position = bodyguard_court_position 
					}
					any_entourage_character = {
						is_knight_of = root 
						has_court_position = akolouthos_court_position 
					}
				}
			}
		}
		rightfully_imprison_character_effect = {
			TARGET = scope:rival_scope
			IMPRISONER = root
		}
		stress_impact = {
			arrogant = medium_stress_impact_gain
			compassionate = medium_stress_impact_gain
			forgiving = medium_stress_impact_gain
		}
		
		ai_chance = {
			base = 100
			modifier = {
				factor = 0.5
				has_trait = calm
			}
			modifier = {
				factor = 0.5
				has_trait = brave
			}
			modifier = {
				factor = 0.25
				has_trait = compassionate
			}
			modifier = {
				factor = 0.25
				has_trait = forgiving
			}
			modifier = {
				factor = 0.25
				has_trait = trusting
			}
		}
	}
	
	#Expel them
	option = {
		name = travel_events.3150.d
		trigger = {
			is_landed = no
		}
		current_travel_plan = { remove_character = scope:rival_scope } #we get them out of your entourage
		if = {
			limit = { scope:rival_scope = { is_courtier_of = root } } #and out of your court
			remove_courtier_or_guest = scope:rival_scope
		}
		worsen_relationship_effect = {
			TARGET = scope:rival_scope
			REASON = rival_bad_mouthed
		}
		stress_impact = {
			vengeful = medium_stress_impact_gain
			wrathful = medium_stress_impact_gain
			forgiving = medium_stress_impact_gain
		}
		
		ai_chance = {
			base = 100
			modifier = {
				factor = 0.5
				has_trait = compassionate
			}
			modifier = {
				factor = 0.5
				has_trait = brave
			}
			modifier = {
				factor = 0.5
				has_trait = vengeful
			}
			modifier = {
				factor = 0.25
				has_trait = trusting
			}
			modifier = {
				factor = 0.25
				has_trait = forgiving
			}
			modifier = {
				factor = 0.25
				has_trait = wrathful
			}
		}
    }
	
	#Ignore them 
	option = {
		name = travel_events.3150.e
		add_prestige = minor_prestige_loss
		stress_impact = {
			arrogant = medium_stress_impact_gain
			callous = medium_stress_impact_gain
			vengeful = major_stress_impact_gain
		}
		
		ai_chance = {
			base = 100
			modifier = {
				factor = 0.25
				has_trait = brave
			}
			modifier = {
				factor = 0
				has_trait = callous
			}
			modifier = {
				factor = 0
				has_trait = vengeful
			}
			modifier = {
				factor = 0
				has_trait = wrathful
			}
			modifier = {
				factor = 0
				prestige <= minor_prestige_value
			}
		}
	}

	after = {
		mp_resume_travel_plan = yes
	}
}

##################################################
# Danger! A Murder of Crows
# by Veronica Pazos
# 3160
##################################################

scripted_trigger travel_events.3160.is_fearless = {
	OR = {
		has_trait = brave
		has_trait = callous
		has_trait = sadistic
		has_trait = wrathful
		has_trait = vengeful
	}
}

travel_events.3160 = { 
	type = character_event
	title = travel_events.3160.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					location = {
						travel_danger_type = { #there's a battle
							travel_plan = root.current_travel_plan
							type = battle
						}
					}
				}
				desc = travel_events.3160.desc_battle
			}
			desc = travel_events.3160.desc_fallback
		}
		desc = travel_events.3160.desc_outro
	}
	theme = travel_danger
    left_portrait = {
		character = root
		triggered_animation = {
			trigger = { travel_events.3160.is_fearless = yes }
			animation = anger
		}				
		animation = fear
	}
    cooldown = { years = 5 }
	override_background = { reference = battlefield }
	
	trigger = {
		is_playable_character = yes
		is_available_travelling_adult = yes
		is_location_valid_for_travel_event_on_land = yes
		OR = { #this is heavily implied to be a rare occurrance/hallucination
			has_trait = paranoid
			has_trait = lunatic
		}
		current_travel_plan = { num_entourage_characters > 1 }
		location = {
			OR = {
				travel_danger_type = { #there's a battle
					travel_plan = root.current_travel_plan
					type = battle
				}
				travel_danger_type = { #there's a forest
					travel_plan = root.current_travel_plan
					terrain = forest
				}
				travel_danger_type = {
					travel_plan = root.current_travel_plan
					terrain = taiga
				}
			}
		}
    }
	
	weight_multiplier = {
		base = 1
		
	}
	
	immediate = {
		wayfarer_storyteller_fame_effect = { VALUE = roaming_reward_fame_small }
		mp_delay_travel_plan = { DAYS = 90 }
		location = { save_scope_as = crow_location }
		if = {
			limit = {
				exists = current_travel_plan.travel_leader
			}
			current_travel_plan.travel_leader = { save_scope_as = travel_leader }
		}
		else = {
			current_travel_plan = {
				random_entourage_character = {
					limit = {
						NAND = {
							this = root
							this = current_travel_plan.travel_leader
						}
					}
					save_scope_as = travel_leader
				}
			}
		}
		traveler_danger_xp_effect = {
			MIN = 3
			MAX = 7
		}
	}
	
    #Scream for your Caravan Master 
	option = { 
		name = travel_events.3160.a
		scope:travel_leader = {
			increase_wounds_no_death_effect = { REASON = wild_animal } #crows have never killed a human according to my research
		}
		stress_impact = {
			compassionate = medium_stress_impact_gain
			brave = medium_stress_impact_gain
			wrathful = medium_stress_impact_gain
			vengeful = medium_stress_impact_gain
		}
		
		ai_chance = {
			base = 100
			modifier = {
				factor = 0.25
				has_trait = compassionate
			}
			modifier = {
				factor = 0.25
				has_trait = brave
			}
			modifier = {
				factor = 0
				has_trait = wrathful
			}
			modifier = {
				factor = 0
				has_trait = vengeful
			}
		}
    }
	
	#Throw food at them
	option = {
		name = travel_events.3160.b
		remove_short_term_gold = tiny_gold_value
		stress_impact = {
			brave = medium_stress_impact_gain
			wrathful = medium_stress_impact_gain
			vengeful = medium_stress_impact_gain
			avaricious = major_stress_impact_gain
			greedy = major_stress_impact_gain
		}
		
		ai_chance = {
			base = 100
			modifier = {
				factor = 0.25
				has_trait = wrathful
			}
			modifier = {
				factor = 0.25
				has_trait = brave
			}
			modifier = {
				factor = 0
				has_trait = vengeful
			}
			modifier = {
				factor = 0
				has_trait = avaricious
			}
			modifier = {
				factor = 0
				has_trait = greedy
			}
		}
	}
	
	#Draw your sword
	option = {
		name = travel_events.3160.c
		trigger = {
			OR = {
				has_trait = dull
				travel_events.3160.is_fearless = yes
			}
		}
		duel = {
			skill = prowess
			value = medium_skill_rating
			60 = { #you win
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = travel_events.3160.c.success
				send_interface_toast = {
					left_icon = root
					title = travel_events.3160.c.success
					add_prowess_skill = 2
					current_travel_plan = {
						every_entourage_character = { #they think this is goofy
							limit = {
								has_trait = callous
								has_trait = cynical
								has_trait = arrogant
								has_trait = honest
								has_trait = temperate
							}
							add_opinion = {
								target = root
								modifier = disgusted_opinion
								opinion = -5
							}
						}
					}
				}
			}
			40 = { #the crows win
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
				}
				desc = travel_events.3160.c.failure
				send_interface_toast = {
					left_icon = root
					title = travel_events.3160.c.failure
					increase_wounds_no_death_effect = { REASON = wild_animal }
				}
			}
		}
		stress_impact = {
			compassionate = medium_stress_impact_gain
			calm = medium_stress_impact_gain
			craven = major_stress_impact_gain
		}
		
		ai_chance = {
			base = 100
			modifier = {
				factor = 0.25
				has_trait = intellect_good_1
			}
			modifier = {
				factor = 0.25
				has_trait = intellect_good_2
			}
			modifier = {
				factor = 0.25
				has_trait = intellect_good_3
			}
			modifier = {
				factor = 0.25
				has_trait = compassionate
			}
			modifier = {
				factor = 0.25
				has_trait = calm
			}
			modifier = {
				factor = 0
				has_trait = craven
			}
		}
	}
	after = {
		mp_resume_travel_plan = yes
	}
}
