﻿namespace = tour_travel

# Chance to build a cool new church
tour_travel.3000 = {
	type = character_event
	title = tour_travel.3000.t
	desc = tour_travel.3000.desc
	theme = travel_tour
	left_portrait = {
		character = root
		animation = happiness
	}
	
	right_portrait = {
		character = scope:pious_peasant
		animation = worry
	}

	cooldown = { years = 2 }
	
	trigger = {
		is_landed_or_landless_administrative = yes
		#Same religion as me
		location.religion = root.religion
		location = {
			NOT = {
				has_holding_type = church_holding
				is_sea_province = yes
			}
		}
		location.province_owner ?= {
			OR = {
				this = root
				is_vassal_or_below_of = root
			}
		}
		has_activity_intent = altruism_intent
	}

	immediate = {
		create_character = {
			template = generic_peasant_character
			culture = root.location.culture
			faith = root.location.faith
			location = root.location
			trait = zealous
			save_scope_as = pious_peasant
		}
	}

	option = { #Makeshift place to worship
		name = tour_travel.3000.a
		location.county = {
			add_county_modifier = {
				modifier = helped_construct_makeshift_temple
				years = 25
			}
		}
		remove_treasury_or_gold = minor_treasury_or_gold_value
		add_piety = minor_piety_gain
		stress_impact = {
			greedy = miniscule_stress_impact_loss
			chaste = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = 1
				ai_vengefulness = -1
			}
			modifier = {
				factor = 0
				short_term_treasury_or_gold <= minor_treasury_or_gold_value
			}
		}
	}

	option = { #Build a church
		name = tour_travel.3000.b
		trigger = {
			location = { has_holding = no }
		}
		location.county = {
			add_county_modifier = {
				modifier = helped_construct_makeshift_temple
				years = 25
			}
		}
		add_piety = medium_piety_gain
		location = {
			begin_create_holding = church_holding
		}
		remove_treasury_or_gold = minor_treasury_or_gold_value
		set_relation_friend = {
			target = scope:pious_peasant
			reason = friend_built_temple_for_village
		}
		stress_impact = {
			zealous = miniscule_stress_impact_loss
			profligate = miniscule_stress_impact_loss
			generous = minor_stress_impact_loss
			cynical = minor_stress_impact_gain
			callous = minor_stress_impact_gain
			compassionate = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = 1
				ai_vengefulness = -1
			}
			modifier = {
				factor = 0
				short_term_treasury_or_gold <= minor_treasury_or_gold_value
			}
		}
	}

	option = { #No lol
		name = tour_travel.3000.c
		add_piety = minor_piety_loss
		stress_impact = {
			zealous = minor_stress_impact_gain
			greedy = minor_stress_impact_loss
			profligate = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = 1
				ai_vengefulness = -1
			}
		}
	}
}

# You get married to a peasant you meet by the roadside
tour_travel.3001 = {
	type = character_event
	title = tour_travel.3001.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					has_trait = drunkard
				}
				desc = tour_travel.3001.desc.drunkard
			}
			desc = tour_travel.3001.desc
		}
	}
	theme = travel_tour
	left_portrait = {
		character = scope:marriage_mother
		animation = beg
	}
	right_portrait = {
		character = scope:marriage_candidate
		animation = admiration
	}

	cooldown = { years = 2 }
	trigger = {
		is_landed_or_landless_administrative = yes
		is_adult = yes
		is_location_valid_for_travel_event_on_land = yes
		can_marry_trigger = yes
		OR = {
			has_activity_intent = lechery_intent
			has_trait = drunkard
		}
	}

	immediate = {
		create_character = {
			template = generic_peasant_character
			age = { 50 70 }
			gender = female
			location = root.location
			save_scope_as = marriage_mother
		}
		if = { #Checks if same sex marriage is allowed.
			limit = {
				allowed_to_marry_same_sex_trigger = yes
			}
			create_character = {
				age = { 18 32 }
				random_traits = yes
				random_traits_list = {
					count = 1
					beauty_good_2 = {}
					beauty_good_3 = {}
					intellect_good_2 = {}
					intellect_good_3 = {}
					physique_good_2 = {}
					physique_good_3 = {}
				}
				culture = root.culture
				faith = root.faith
				gender_female_chance = root_sexuality_female_chance # Someone you're attracted to
				location = root.location
				mother = scope:marriage_mother
				save_scope_as = marriage_candidate
			}
		}
		else = {
			create_character = {
				age = { 18 32 }
				random_traits = yes
				random_traits_list = { # Something good to make you want them
					count = 1
					beauty_good_2 = {}
					beauty_good_3 = {}
					intellect_good_2 = {}
					intellect_good_3 = {}
					physique_good_2 = {}
					physique_good_3 = {}
				}
				culture = root.culture
				faith = root.faith
				gender_female_chance = {
					if = {
						limit = {
							is_female = yes
						}
						value = 0
					}
					else = {
						value = 100
					}
				}
				location = root.location
				mother = scope:marriage_mother
				save_scope_as = marriage_candidate
			}
		}
	}

	option = { #Get married
		name = {
			text = {
				first_valid = {
					triggered_desc = {
						trigger = {
							has_trait = drunkard
						}
						desc = tour_travel.3001.a.drunkard
					}
					desc = tour_travel.3001.a
				}
			}
		}
		if = {
			limit = {
				is_female = yes
				scope:marriage_candidate = { is_male = yes }
			}
			marry_matrilineal = scope:marriage_candidate
		}
		else = {
			marry = scope:marriage_candidate
		}
		set_relation_friend = {
			target = scope:marriage_mother
			reason = friend_married_my_child
		}
		stress_impact = {
			lustful = minor_stress_impact_loss
			rakish = minor_stress_impact_loss
			base = minor_stress_impact_gain
			arrogant = minor_stress_impact_gain
			chaste = minor_stress_impact_gain
			gallant = minor_stress_impact_gain
		}
		ai_chance = { # The AI should basically not do this if they have a choice
			base = 10
			ai_value_modifier = {
				ai_sociability = 1
				ai_honor = -1
			}
		}
	}

	option = { #Don't get married
		name = tour_travel.3001.b
		trigger = {
			NOT = {
				has_trait = drunkard
			}
		}
		show_as_unavailable = { always = yes }
		stress_impact = {
			zealous = miniscule_stress_impact_loss
			chaste = minor_stress_impact_loss
			rakish = minor_stress_impact_gain
		}

		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = 1
				ai_sociability = -1
			}
		}
	}

	after = {
		if = {
			limit = {
				is_ai = yes
				NOT = {
					scope:marriage_candidate = { is_consort_of = root }
				}
			}
			scope:marriage_candidate = {
				silent_disappearance_effect = yes
			}
			scope:marriage_mother = {
				silent_disappearance_effect = yes
			}
		}
	}
}

# Locals blame you for their family dying in a war
tour_travel.3002 = {
	type = character_event
	title = tour_travel.3002.t
	desc = tour_travel.3002.desc
	theme = travel_tour
	left_portrait = {
		character = root
		animation = worry
	}

	right_portrait = {
		character = scope:widow_peasant
		animation = anger
	}

	lower_left_portrait = {
		character = scope:widow_father
	}

	lower_center_portrait = {
		character = scope:widow_husband
	}

	lower_right_portrait = {
		character = scope:widow_son
	}
	cooldown = { years = 2 }
	trigger = {
		is_landed_or_landless_administrative = yes
		is_location_valid_for_travel_event_on_land = yes
		#Check there was a war recently
		any_memory = {
			memory_type = battle_won_memory
			memory_age_years <= 10
		}
	}

	weight_multiplier = {
		base = 1
		modifier = {
			factor = 2
			has_activity_intent = altruism_intent
		}
	}

	immediate = {
		random_memory = {
			memory_type = battle_won_memory
			limit = {
				memory_age_years <= 10
			}
			save_scope_as = battle_memory
			
		}
		create_character = {
			template = generic_peasant_character
			location = root.location
			age = { 60 70 }
			gender = male
			save_scope_as = widow_father
		}
		create_character = {
			template = generic_peasant_character
			location = root.location
			age = { 36 40}
			gender = male
			save_scope_as = widow_husband
		}	
		create_character = {
			template = generic_peasant_character
			location = root.location
			father = scope:widow_father
			age = { 36 40}
			gender = female
			save_scope_as = widow_peasant
		}
		create_character = {
			template = generic_peasant_character
			location = root.location
			mother = scope:widow_peasant
			age = 18
			gender = male
			save_scope_as = widow_son
		}
		hidden_effect = {
			scope:widow_husband = {
				marry = scope:widow_peasant
				death = {
					death_reason = death_battle
				}
				scope:widow_father = {
					death = {
						death_reason = death_battle
					}
				}
				scope:widow_son = {
					death = {
						death_reason = death_battle
					}
				}
			}
		}
	}

	option = { #Ill try and make it up to you
		name = tour_travel.3002.a
		location.county = {
			add_county_modifier = {
				modifier = cared_for_war_widow
				years = 25
			}
		}
		remove_short_term_gold = medium_gold_value
		stress_impact = {
			generous = minor_stress_impact_loss
			callous = minor_stress_impact_gain
			compassionate = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = 1
				ai_compassion = 1
				ai_vengefulness = -1
			}
		}
	}


	option = { #Not my issue
		name = tour_travel.3002.b
		location.county = {
			add_county_modifier = {
				modifier = ignored_war_widow
				years = 25
			}
		}
		stress_impact = {
			compassionate = minor_stress_impact_gain
			greedy = minor_stress_impact_loss
			shy = medium_stress_impact_loss
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = -1
			}
		}
	}

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

# You are disgusted by your subjects
tour_travel.3003 = {
	type = character_event
	title = tour_travel.3003.t
	desc = tour_travel.3003.desc
	theme = travel_tour
	left_portrait = {
		character = root
		animation = anger
	}
	right_portrait = {
		character = scope:ugly_peasant
		animation = ecstasy
		outfit_tags = { beggar_rags }
		hide_info = yes
	}
	cooldown = { years = 2 }
	trigger = {
		is_landed_or_landless_administrative = yes
		is_location_valid_for_travel_event_on_land = yes
		OR = {
			has_trait = callous
			has_trait = sadistic
		}
	}
	immediate = {
		create_character = {
			location = root.capital_province
			template = random_barrel_character
			faith = root.location.faith
			culture = root.location.culture
			random_traits_list = {
				count = { 3 5 }
				consumption = {}
				cancer = {}
				typhus = {}
				smallpox = {}
				leper = {}
				lovers_pox = {}
				great_pox = {}
				pneumonic = {}
			}

			random_traits_list = {
				count = { 2 4 }
				lunatic_genetic = {}
				possessed_genetic = {}
				dwarf = {}
				giant = {}
				inbred = {}
				weak = {}
				dull = {}
				clubfooted = {}
				hunchbacked = {}
				lisping = {}
				stuttering = {}
				wheezing = {}
				albino = {}
				scaly = {}
				spindly = {}
			}

			random_traits_list = {
				count = { 2 3 }
				maimed = {}
				one_eyed = {}
				one_legged = {}
				disfigured = {}
				blind = {}
				eunuch_1 = {}
			}

			health = 8

			save_scope_as = ugly_peasant
		}
	}
	option = {
		name = tour_travel.3003.a
		location.county = {
			add_county_modifier = {
				modifier = entertained_peasants
				years = 20
			}
		}
		stress_impact = {
			compassionate = minor_stress_impact_loss
			callous = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = 1
				ai_vengefulness = -1
			}
		}
	}

	option = {
		name = tour_travel.3003.b
		location.county = {
			add_county_modifier = {
				modifier = scared_peasants
				years = 20
			}
		}
		add_dread = miniscule_dread_gain
		stress_impact = {
			forgiving = minor_stress_impact_gain
			sadistic = minor_stress_impact_loss
			callous = minor_stress_impact_loss
		}

		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = 1
				ai_vengefulness = -1
			}
		}
	}

	after = {
		scope:ugly_peasant = { silent_disappearance_effect = yes }
	}
}

tour_travel.3004 = { #Ugly Statue
	type = character_event
	title = tour_travel.3004.t
	desc = tour_travel.3004.desc
	theme = travel_tour
	left_portrait = {
		character = root
		animation = anger
	}
	cooldown = { years = 2 }
	trigger = {
		is_landed_or_landless_administrative = yes
		is_location_valid_for_travel_event_on_land = yes
		NOT = {
			any_sub_realm_county = {
				OR = {
					has_county_modifier = ugly_statue
					has_county_modifier = destroyed_statue
				}
			}
		}
	}
	weight_multiplier = {
		base = 1
		modifier = { # You actually are ugly lmao
			factor = 2
			has_trait = beauty_bad
		}
	}

	option = {
		name = tour_travel.3004.a
		location.county = {
			add_county_modifier = {
				modifier = ugly_statue
				years = 50
			}
		}
		add_prestige = minor_prestige_loss
		stress_impact = {
			compassionate = minor_stress_impact_loss
			callous = minor_stress_impact_gain
			vengeful = minor_stress_impact_gain
			arrogant = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = 1
				ai_vengefulness = -1
			}
		}
	}

	option = {
		name = tour_travel.3004.b
		location.county = {
			add_county_modifier = {
				modifier = destroyed_statue
				years = 25
			}
		}
		stress_impact = {
			arrogant = medium_stress_impact_loss
			vengeful = medium_stress_impact_loss
			sadistic = medium_stress_impact_loss
			callous = minor_stress_impact_loss
			arbitrary = minor_stress_impact_loss
			humble = minor_stress_impact_gain
			forgiving = minor_stress_impact_gain
			compassionate = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = 1
				ai_vengefulness = -1
			}
		}
	}

	option = { # Actually, the resemblence is quite uncanny!
		name = tour_travel.3004.c
		trigger = {
			has_trait = beauty_bad
			has_trait = humble
		}
		location.county = {
			add_county_modifier = {
				modifier = accurate_statue
				years = 50
			}
		}
		stress_impact = {
			humble = medium_stress_impact_loss
			arrogant = minor_stress_impact_gain
			callous = minor_stress_impact_gain
			sadistic = minor_stress_impact_gain
			vengeful = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 1
				ai_honor = 1
				ai_compassion = 1
				ai_vengefulness = -1
			}
		}
	}
}

tour_travel.3005 = { #Peasant has same criminal secret as you
	type = character_event
	title = tour_travel.3005.t
	desc = tour_travel.3005.desc
	theme = travel_tour
	left_portrait = {
		character = root
		animation = worry
	}

	right_portrait = {
		character = scope:criminal_peasant
		animation = prisondungeon
	}
	cooldown = { years = 2 }
	trigger = {
		is_landed_or_landless_administrative = yes
		is_location_valid_for_travel_event_on_land = yes
		any_secret = {
			is_criminal_for = secret_owner
		}
	}

	weight_multiplier = {
		base = 1
		modifier = {
			factor = 2
			has_activity_intent = justice_intent
		}
	}


	immediate = {
		random_secret = {
			limit = {
				is_criminal_for = secret_owner
			}
			save_scope_as = criminal_secret
		}
		create_character = {
			template = generic_peasant_character
			location = root.location
			save_scope_as = criminal_peasant
		}
		hidden_effect = {
			if = {
				limit = {
					scope:criminal_secret = { secret_type = secret_deviant }
				}
				scope:criminal_peasant = { add_trait = deviant }
			}
			else_if = {
				limit = {
					scope:criminal_secret = { secret_type = secret_murder }
				}
				scope:criminal_peasant = { add_trait = murderer }
			}
			else_if = {
				limit = {
					scope:criminal_secret = { secret_type = secret_cannibal }
				}
				scope:criminal_peasant = { add_trait = cannibal }
			}
			else_if = {
				limit = {
					scope:criminal_secret = { secret_type = secret_lover }
				}
				scope:criminal_peasant = { add_trait = fornicator }
			}
			else_if = {
				limit = {
					scope:criminal_secret = { secret_type = secret_homosexual }
				}
				scope:criminal_peasant = {
					random_list = {
						40 = { set_sexuality = homosexual }
						40 = { set_sexuality = bisexual }
						20 = { set_sexuality = asexual }
					}
				}
				if = {
					limit = {
						scope:criminal_peasant = { is_male = yes }
					}
					scope:criminal_peasant = { add_trait = sodomite }
				}
				else = {
					scope:criminal_peasant = { add_trait = fornicator }
				}
			}
			else_if = {
				limit = {
					scope:criminal_secret = { secret_type = secret_incest }
				}
				scope:criminal_peasant = { add_trait = incestuous }
			}
		}
	}

	option = { #Release her
		name = tour_travel.3005.a
		location.county = {
			add_county_modifier = {
				modifier = released_criminal
				years = 25
			}
		}
		add_courtier = scope:criminal_peasant
		current_travel_plan = {
			add_companion = scope:criminal_peasant 
		}
		scope:criminal_peasant = {
			add_character_flag = {
				flag = blocked_from_leaving
				years = 10
			}
		}
		set_relation_friend = {
			target = scope:criminal_peasant
			reason = friend_royal_pardon
		}
		hidden_effect = {
			consume_imprisonment_reasons = scope:criminal_peasant
		}
		stress_impact = {
			compassionate = minor_stress_impact_loss
			forgiving = minor_stress_impact_loss
			arbitrary = minor_stress_impact_loss
			callous = minor_stress_impact_gain
			sadistic = minor_stress_impact_gain
			vengeful = minor_stress_impact_gain
			just = medium_stress_impact_gain
		}

		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				has_trait = just
			}
			ai_value_modifier = {
				ai_compassion = 1
				ai_vengefulness = -1
			}
		}
	}

	option = { #Don't
		name = tour_travel.3005.b
		stress_impact = {
			deceitful = minor_stress_impact_loss
			sadistic = minor_stress_impact_loss
			callous = minor_stress_impact_loss
			arbitrary = minor_stress_impact_loss
			just = major_stress_impact_loss
			compassionate = minor_stress_impact_gain
			forgiving = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_vengefulness = 1
				ai_rationality = 1
				ai_honor = 1
				ai_compassion = -1
				ai_zeal = -1
			}
		}
	}

	after = {
		if = {
			limit = {
				scope:criminal_peasant = {
					NOT = { is_courtier_of = root }
				}
			}
			scope:criminal_peasant = {
				silent_disappearance_effect = yes
			}
		}
	}
}

tour_travel.3006 = { #A peasant asks for a story from your life
	type = character_event
	title = tour_travel.3006.t
	desc = tour_travel.3006.desc
	theme = travel_tour
	left_portrait = {
		character = root
		animation = worry
	}

	cooldown = { years = 2 }
	trigger = {
		is_landed_or_landless_administrative = yes
		is_location_valid_for_travel_event_on_land = yes
		any_memory = {
			 has_memory_category = positive
			NOT = { has_memory_category = war }
		}
		any_memory = {
			 has_memory_category = positive
			 has_memory_category = war
		}
	}

	immediate = {
		random_memory = {
			limit = {
				has_memory_category = positive
				NOT = { has_memory_category = war }
			}
			save_scope_as = positive_memory
		}

		random_memory = {
			limit = {
				has_memory_category = positive
				has_memory_category = war
			}
		save_scope_as = war_memory
		}

	}

	option = { #Normal story
		name = tour_travel.3006.a
		add_prestige = medium_prestige_gain
		location.county = {
			add_county_modifier = {
				modifier = inspired_by_tales
				years = 25
			}
		}
		stress_impact = {
			calm = minor_stress_impact_loss
			forgiving = medium_stress_impact_loss
			ambitious = minor_stress_impact_gain
			callous = minor_stress_impact_gain
			compassionate = minor_stress_impact_loss
		}

		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = 1
				ai_sociability = 1
			}
		}
	}

	option = { #War story!
		name = tour_travel.3006.b
		location.county = {
			add_county_modifier = {
				modifier = martially_inspired
				years = 25
			}
		}
		stress_impact = {
			wrathful = minor_stress_impact_loss
			arrogant = minor_stress_impact_loss
			patient = minor_stress_impact_gain
			compassionate = minor_stress_impact_gain
			craven = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 2
				has_trait = ambitious
			}
			ai_value_modifier = {
				ai_energy = 1
				ai_vengefulness = 1
				ai_boldness = 1
			}
		}
	}
}

tour_travel.3007 = { #You get taken to a brothel
	type = character_event
	title = tour_travel.3007.t
	desc = tour_travel.3007.desc
	theme = travel_tour
	override_background = { reference = tavern }
	left_portrait = {
		character = root
		animation = worry
	}

	cooldown = { years = 2 }

	trigger = {
		is_landed_or_landless_administrative = yes
		is_adult = yes
		has_activity_intent = lechery_intent
	}

	immediate = {
		random_culture_global = {
			limit = {
				culture_head ?= {
					in_diplomatic_range = root
				}
			}
			save_scope_as = random_event_culture
		}
		create_character = {
			age = { 18 32 }
			template = beautiful_peasant_character
			random_traits = yes
			culture = root.location.culture
			faith = root.location.faith
			gender_female_chance = root_sexuality_female_chance # Someone you're attracted to
			location = root.location
			trait = fornicator
			save_scope_as = prostitute_scope
		}
	}

	option = { #Leave
		name = tour_travel.3007.a
		if = {
			limit = {
				NOT = { faith = { trait_is_virtue = lustful } }
			}
			stress_impact = {
				chaste = minor_stress_impact_loss
				zealous = minor_stress_impact_loss
				rakish = minor_stress_impact_gain
				lustful = minor_stress_impact_gain
			}
		}
		else = {
			stress_impact = {
				chaste = minor_stress_impact_loss
				rakish = minor_stress_impact_gain
				lustful = minor_stress_impact_gain
				zealous = minor_stress_impact_gain
			}
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 2
				faith = { trait_is_virtue = lustful }
				has_trait = zealous
			}
			modifier = {
				factor = 0.1
				NOT = { faith = { trait_is_virtue = lustful } }
				has_trait = zealous
			}
			ai_value_modifier = {
				ai_energy = 1
				ai_boldness = 1
				ai_sociability = 1
			}
		}
	}

	option = { #Stay
		name = tour_travel.3007.b
		if = {
			limit = {
				NOT = { faith = { trait_is_virtue = lustful } }
			}
			stress_impact = {
				base = medium_stress_impact_loss
				chaste = minor_stress_impact_gain
				zealous = minor_stress_impact_gain
			}
		}
		else = {
			stress_impact = {
				base = medium_stress_impact_loss
				zealous = minor_stress_impact_loss
				chaste = minor_stress_impact_gain
			}
		}
        had_sex_with_effect = {
	        CHARACTER = scope:prostitute_scope
	        PREGNANCY_CHANCE = pregnancy_chance
        }
		ai_chance = {
			base = 100
			modifier = {
				factor = 0.1
				faith = { trait_is_virtue = lustful }
				has_trait = zealous
			}
			modifier = {
				factor = 2
				NOT = { faith = { trait_is_virtue = lustful } }
				has_trait = zealous
			}
			modifier = {
				factor = 0
				has_trait = chaste
			}
			ai_value_modifier = {
				ai_zeal = 1
			}
		}
	}
}

tour_travel.3010 = { #Local shrine
	type = character_event
	title = tour_travel.3010.t
	desc = tour_travel.3010.desc
	theme = travel_tour
	left_portrait = {
		character = root
		animation = thinking
	}
	lower_right_portrait = scope:shrine_ruler
	cooldown = { years = 40 }

	trigger = {
		static_group_filter = {
			group = travel_events.3010
			match = 0.25
		}
		is_landed_or_landless_administrative = yes
		is_location_valid_for_travel_event_on_land = yes
		location.county = {
			religion = root.religion
			NOR = {
				holder = root
				has_county_modifier = local_saint_modifier
				faith = {
					OR = {
						has_doctrine = unreformed_faith_doctrine
						religion = religion:shintoism_religion
						religion = { is_in_family = rf_sinitic }
					} 	 
				}
			}
		}
	}

	immediate = {
		wayfarer_storyteller_fame_effect = { VALUE = roaming_reward_fame_small }
		location = {
			save_scope_as = shrine_province
			county.holder = { save_scope_as = shrine_ruler }
		}
		hidden_effect = {
			create_character = {
				template = peasant_child_character
				culture = root.location.county.culture
				faith = root.location.county.faith
				location = root.location
				gender_female_chance = 50
				save_scope_as = saint_name
			}
			scope:saint_name = {
				death = { death_reason = death_disappearance }
			}
		}
	}

	option = { #Desecrate
		name = tour_travel.3010.a
		if = {
			limit = {
				involved_activity ?= {
					has_activity_type = activity_pilgrimage
				}
				has_activity_intent = zealot_intent
			}
			pious_type_option_effect = yes
			add_piety = medium_piety_gain
		}
		else = {
			add_piety = minor_piety_gain
		}
		reverse_add_opinion = {
			target = scope:shrine_ruler
			modifier = angry_opinion
			opinion = -10
		}
		add_character_modifier = {
			modifier = desecrated_local_saint_modifier
			years = 10
		}
		if = {
			limit = {
				scope:shrine_province.county.culture != root.culture
			}
			root.culture = {
				change_cultural_acceptance = {
					target = scope:shrine_province.county.culture
					value = minor_cultural_acceptance_loss
					desc = cultural_acceptance_local_saint
				}
			}
		}
		stress_impact = {
			cynical = minor_stress_impact_gain
			arbitrary = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_zeal = 1
				ai_boldness = 0.5
				ai_sociability = -0.5
			}
		}
	}

	option = { #Patronize
		name = tour_travel.3010.b
		remove_short_term_gold = tiny_gold_value
		if = {
			limit = {
				involved_activity ?= {
					has_activity_type = activity_pilgrimage
				}
				NOT = { has_activity_intent = zealot_intent }
			}
			bonus_to_all_types_effect = yes #Worldly and pious/Hajj
			add_piety = minor_piety_gain
		}
		reverse_add_opinion = {
			target = scope:shrine_ruler
			modifier = pleased_opinion
			opinion = 10
		}
		add_character_modifier = {
			modifier = patronized_local_saint_modifier
			years = 10
		}
		scope:shrine_province.county = {
			add_county_modifier = {
				modifier = local_saint_modifier
				years = 10
			}
		}
		if = {
			limit = {
				scope:shrine_province.county.culture != root.culture
			}
			root.culture = {
				change_cultural_acceptance = {
					target = scope:shrine_province.county.culture
					value = minor_cultural_acceptance_gain
					desc = cultural_acceptance_local_saint
				}
			}
		}
		stress_impact = {
			zealous = minor_stress_impact_gain
			generous = minor_stress_impact_loss
		}
		ai_chance = {
			base = 125
			ai_value_modifier = {
				ai_zeal = 1
				ai_greed = -0.5
				ai_boldness = -0.5
			}
		}
	}

	option = { #It is just a log
		name = tour_travel.3010.c
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_energy = -0.5
				ai_boldness = -0.5
			}
		}
	}
}

tour_travel.3020 = { #Confession of love
	type = character_event
	title = tour_travel.3020.t
	desc = tour_travel.3020.desc
	theme = travel_tour
	left_portrait = {
		character = root
		animation = thinking
		outfit_tags = { nightgown }
	}
	right_portrait = {
		character = scope:love_professor
		animation = flirtation
		outfit_tags = { nightgown }
	}
	lower_right_portrait = root.primary_spouse
	override_background = { reference = corridor_night }
	cooldown = { years = 10 }

	trigger = {
		is_landed_or_landless_administrative = yes
		is_adult = yes
		has_activity_intent = lechery_intent
		current_travel_plan ?= {
			any_entourage_character = {
				would_attempt_to_seduce_trigger = { CHARACTER = root }
			}
		}
	}

	immediate = {
		current_travel_plan ?= {
			random_entourage_character = {
				limit = {
					has_trait = lustful
					would_attempt_to_seduce_trigger = { CHARACTER = root }
				}
				alternative_limit = {
					would_attempt_to_seduce_trigger = { CHARACTER = root }
				}
				weight = {
					base = 1
					# Favor good matches
					modifier = {
						factor = 0
						save_temporary_scope_as = love_professor_temp
						root = { is_attracted_to_gender_of = scope:love_professor_temp }
					}
					# Favor attractive matches
					modifier = {
						add = {
							value = attraction
							divide = 2
						}
					}
				}
				save_scope_as = love_professor
			}
		}
		scope:love_professor = {
			if = {
				limit = {
					sex_same_as = root
					NOT = {
						faith = { has_doctrine_parameter = homosexuality_accepted }
					}
				}
				if = {
					limit = {
						NOT = {
							any_secret = { type = secret_homosexual }
						}
					}
					hidden_effect = {
						add_secret = { type = secret_homosexual }
					}
				}
				random_secret = {
					type = secret_homosexual
					save_scope_as = sodomite_secret
				}
			}
		}
	}

	option = { # Alright
		name = tour_travel.3020.a
		trigger = { is_attracted_to_gender_of = scope:love_professor }
		had_sex_with_effect = {
			CHARACTER = scope:love_professor
			PREGNANCY_CHANCE = pregnancy_chance
		}
		progress_towards_lover_effect = {
			CHARACTER = scope:love_professor
			REASON = lover_tour_storm
			OPINION = default_lover_opinion
		}
		if = {
			limit = {
				sex_same_as = scope:love_professor
				NOT = {
					faith = { has_doctrine_parameter = homosexuality_accepted }
				}
			}
			if = {
				limit = {
					NOT = {
						any_secret = { type = secret_homosexual }
					}
				}
				add_secret = { type = secret_homosexual }
			}
			random_secret = {
				type = secret_homosexual
				save_scope_as = my_sodomite_secret
				reveal_to = scope:love_professor
			}
		}
		stress_impact = {
			chaste = minor_stress_impact_gain
			base = minor_stress_impact_loss
			lustful = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_zeal = -0.5
				ai_boldness = 1
				ai_sociability = 0.5
			}
			modifier = {
				factor = 0
				NOT = {
					would_attempt_to_seduce_incest_trigger = { CHARACTER = scope:love_professor }
				}
			}
			modifier = {
				factor = 0
				NOT = { would_attempt_to_seduce_married_trigger = yes }
			}
		}
	}

	option = { # Insult
		name = tour_travel.3020.c
		progress_towards_rival_effect = {
			CHARACTER = scope:love_professor
			REASON = lover_tour_storm_insult
			OPINION = default_rival_opinion
		}
		stress_impact = {
			arrogant = minor_stress_impact_loss
			compassionate = minor_stress_impact_gain
			sadistic = minor_stress_impact_loss
			humble = minor_stress_impact_gain
			chaste = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_zeal = -0.5
				ai_boldness = 1
				ai_sociability = 0.5
			}
		}
	}

	option = { # Brush off
		name = tour_travel.3020.d
		reverse_add_opinion = {
			target = scope:love_professor
			modifier = rejected_opinion
			opinion = -10
		}
		stress_impact = {
			lustful = minor_stress_impact_gain
		}
		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_zeal = 0.5
				ai_boldness = -0.5
				ai_sociability = -0.5
			}
			
		}
	}

	after = {
		if = {
			limit = { exists = scope:sodomite_secret }
			scope:sodomite_secret = { reveal_to = root }
		}
	}
}

tour_travel.3030 = { #Wrongfully accused
	type = character_event
	title = tour_travel.3030.t
	desc = {
		desc = tour_travel.3030.desc
		random_valid = {
			desc = tour_travel.3030.framed
			desc = tour_travel.3030.pinned
			desc = tour_travel.3030.wrongful
		}
		desc = tour_travel.3030.outro
	}
	theme = travel_tour
	left_portrait = {
		character = scope:accused_partner
		animation = beg
	}
	right_portrait = {
		character = scope:wrongfully_accused
		animation = prisonhouse
		outfit_tags = { beggar_rags }
	}
	lower_left_portrait = court_position:executioner_court_position
	lower_right_portrait = {
		character = location.county.holder
		trigger = {
			this != root
		}
	}
	override_background = { reference = gallows }
	cooldown = { years = 10 }
	
	trigger = {
		is_landed_or_landless_administrative = yes
		is_adult = yes
		is_location_valid_for_travel_event_on_land = yes
		has_activity_intent = justice_intent
		location.county.holder.top_liege = root.top_liege
	}

	immediate = {
		create_character = {
			template = generic_peasant_character
			culture = root.location.county.culture
			faith = root.location.county.faith
			age = { 30 35 }
			location = root.location
			gender_female_chance = 50
			dynasty = none
			save_scope_as = wrongfully_accused
		}
		if = {
			limit = {
				scope:wrongfully_accused ?= { is_female = yes }
			}
			create_character = {
				template = generic_peasant_character
				culture = root.location.county.culture
				faith = root.location.county.faith
				age = { 30 35 }
				location = root.location
				gender_female_chance = 0
				dynasty = none
				save_scope_as = accused_partner
			}
		}
		else = {
			create_character = {
				template = generic_peasant_character
				culture = root.location.county.culture
				faith = root.location.county.faith
				age = { 30 35 }
				location = root.location
				gender_female_chance = 100
				dynasty = none
				save_scope_as = accused_partner
			}
		}
		hidden_effect = {
			scope:wrongfully_accused = { marry = scope:accused_partner }
		}
	}

	option = { # Due diligence
		name = tour_travel.3030.a
		current_travel_plan = {
			delay_travel_plan = { days = 5 }
		}
		duel = {
			skills = { intrigue stewardship }
			value = decent_skill_rating
			5 = {
				modifier = {
					add = {
						value = intrigue
						divide = 2
					}
					add = {
						value = stewardship
						divide = 2
					}
				}
				send_interface_toast = {
					title = truth_of_it_sleuth_toast
					left_icon = root
					add_character_modifier = {
						modifier = super_sleuth_modifier
						years = 10
					}
				}
				min = 1
			}
			10 = {
				trigger = { intrigue <= decent_skill_rating }
				modifier = {
					add = {
						value = 0
						subtract = intrigue
						divide = 2
					}
				}
				send_interface_toast = {
					title = truth_of_it_skill_toast
					left_icon = root
					add_intrigue_skill = 1
				}
				min = 1
			}
			10 = {
				trigger = { stewardship <= decent_skill_rating }
				modifier = {
					add = {
						value = 0
						subtract = stewardship
						divide = 2
					}
				}
				send_interface_toast = {
					title = truth_of_it_skill_toast
					left_icon = root
					add_stewardship_skill = 1
				}
				min = 1
			}
			25 = {
				send_interface_toast = {
					title = truth_of_it_stress_toast
					left_icon = root
					stress_impact = { base = minor_stress_impact_gain }
				}
			}
		}
		hidden_effect = {
			random = {
				chance = 50
				modifier = {
					add = 50
					is_ai = yes
				}
				scope:wrongfully_accused = { silent_disappearance_effect = yes }
				scope:accused_partner = { silent_disappearance_effect = yes }
			}
		}
		stress_impact = {
			lazy = minor_stress_impact_gain
			impatient = minor_stress_impact_gain
			callous = minor_stress_impact_gain
			trusting = minor_stress_impact_gain
			just = major_stress_impact_loss
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_energy = 1
				ai_boldness = 0.5
				ai_honor = 1
				ai_compassion = 0.5
			}
		}
	}

	option = { # Compassionate
		name = tour_travel.3030.d
		add_courtier = scope:wrongfully_accused
		add_courtier = scope:accused_partner
		add_hook = {
			type = saved_my_life_hook
			target = scope:wrongfully_accused
		}
		add_hook = {
			type = loyalty_hook
			target = scope:accused_partner
		}
		scope:wrongfully_accused = { remove_character_flag = peasant_outfit }
		scope:accused_partner = { remove_character_flag = peasant_outfit }
		location.county.holder = {
			if = {
				limit = {
					this != root
				}
				add_opinion = {
					target = root
					modifier = annoyed_opinion
					opinion = -10
				}
			}
		}
		stress_impact = {
			compassionate = major_stress_impact_loss
			deceitful = minor_stress_impact_loss
			just = minor_stress_impact_gain
			callous = minor_stress_impact_gain
		}
		ai_chance = {
			base = 75
			ai_value_modifier = {
				ai_energy = 0.5
				ai_boldness = 1
				ai_honor = 0.5
				ai_compassion = 1
			}
		}
	}

	option = { # Sadistic
		name = {
			text = tour_travel.3030.b
			trigger = {
				NOT = { has_trait = sadistic }
			}
		}
		name = {
			text = tour_travel.3030.b.sadistic
			trigger = { has_trait = sadistic }
		}
		trigger = {
			NOT = { exists = court_position:executioner_court_position }
		}
		add_dread = miniscule_dread_gain
		scope:wrongfully_accused = {
			death = { death_reason = death_execution }
		}
		scope:accused_partner = { silent_disappearance_effect = yes }
		stress_impact = {
			compassionate = minor_stress_impact_loss
			sadistic = medium_stress_impact_loss
			just = minor_stress_impact_gain			
			diligent = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_energy = -0.5
				ai_boldness = -0.5
				ai_honor = -0.5
				ai_compassion = -1
			}
		}
	}

	option = { # Executioner
		name = tour_travel.3030.c
		trigger = { exists = court_position:executioner_court_position }
		add_prestige = medium_prestige_gain
		reverse_add_opinion = {
			target = court_position:executioner_court_position
			modifier = grateful_opinion
			opinion = 10
		}
		scope:wrongfully_accused = {
			death = {
				death_reason = death_execution
				killer = root.court_position:executioner_court_position
			}
		}
		scope:accused_partner = { silent_disappearance_effect = yes }
		location.county = {
			add_county_modifier = {
				modifier = celebrity_executioner_modifier
				years = 10
			}
		}
		stress_impact = {
			compassionate = medium_stress_impact_gain
			sadistic = medium_stress_impact_loss
			just = minor_stress_impact_gain			
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_energy = -0.5
				ai_boldness = -0.5
				ai_honor = -0.5
				ai_compassion = -1
			}
		}
	}
	after = {
		scope:wrongfully_accused = {
			silent_disappearance_ai_effect = yes
		}
		scope:accused_partner = {
			silent_disappearance_ai_effect = yes
		}
	}
}

tour_travel.3040 = { #Bandits ahead
	type = character_event
	title = tour_travel.3040.t
	desc = {
		desc = tour_travel.3040.desc
		first_valid = {
			triggered_desc = {
				trigger = { location.county.holder = root }
				desc = tour_travel.3040.own
			}
			triggered_desc = {
				trigger = { location.county.holder = root.liege }
				desc = tour_travel.3040.liege
			}
			triggered_desc = {
				trigger = { location.county.holder.top_liege = root.top_liege }
				desc = tour_travel.3040.realm
			}
			desc = tour_travel.3040.foreign
		}
	}
	theme = travel_tour
	left_portrait = {
		character = scope:bandit_mayor
		animation = beg
	}
	lower_right_portrait = {
		trigger = {
			this != root
		}
		character = location.county.holder
	}
	override_background = { reference = bp1_crossroads_inn }
	cooldown = { years = 10 }
	
	
	trigger = {
		is_landed_or_landless_administrative = yes
		is_location_valid_for_travel_event_on_land = yes
		has_activity_intent = altruism_intent
		location.county != capital_county
	}

	immediate = {
		create_character = {
			template = generic_peasant_character
			culture = root.location.county.culture
			faith = root.location.county.faith
			age = { 40 50 }
			location = root.location
			gender_female_chance = root_faith_dominant_gender_female_chance
			dynasty = none
			save_scope_as = bandit_mayor
		}
	}

	option = { # En avant
		name = {
			text = tour_travel.3040.a
			trigger = {
				NOT = {
					is_adult = yes
					is_healthy = yes
					can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = root }
				}
			}
		}
		name = {
			text = tour_travel.3040.a.martial
			trigger = {
				is_adult = yes
				is_healthy = yes
				can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = root }
			}
		}
		if = {
			limit = {
				is_adult = yes
				is_healthy = yes
				can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = root }
			}
			add_prestige = minor_prestige_gain
		}
		else = { add_prestige = miniscule_prestige_gain }
		current_travel_plan ?= {
			random = {
				chance = 50
				modifier = {
					add = {
						value = root.current_travel_plan.travel_safety
						multiply = -0.5
					}
				}
				custom_tooltip = {
					text = entourage_member_wound_chance_tt
					random_entourage_character = {
						limit = {
							is_adult = yes
							is_healthy = yes
							can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = root }
						}
						weight = {
							base = 1
							modifier = {
								add = {
									value = prowess
									multiply = -10
								}
							}
						}
						save_scope_as = woundee
						root = {
							send_interface_toast = {
								title = entourage_member_wounded_toast
								left_icon = scope:woundee
								increase_wounds_effect = { REASON = battle }
							}
						}
					}
				}
			}
		}
		add_character_modifier = {
			modifier = hamlet_bandit_modifier
			years = 10
		}
		if = {
			limit = {
				location.county.holder != root
			}
			reverse_add_opinion = {
				target = location.county.holder
				modifier = grateful_opinion
				opinion = 10
			}
		}
		stress_impact = {
			lazy = minor_stress_impact_gain
			impatient = minor_stress_impact_gain
			callous = minor_stress_impact_gain
			craven = minor_stress_impact_gain
			generous = medium_stress_impact_loss
			brave = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_zeal = -0.5
				ai_boldness = 1
				ai_sociability = 0.5
			}
		}
	}

	option = { # For a price
		name = tour_travel.3040.b
		add_gold = tiny_gold_value
		current_travel_plan = {
			random = {
				chance = 50
				modifier = {
					add = {
						value = root.current_travel_plan.travel_safety
						multiply = -0.5
					}
				}
				custom_tooltip = {
					text = entourage_member_wound_chance_tt
					random_entourage_character = {
						limit = {
							is_adult = yes
							is_healthy = yes
							can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = root }
						}
						weight = {
							base = 1
							modifier = {
								add = {
									value = prowess
									multiply = -10
								}
							}
						}
						save_scope_as = woundee
						root = {
							send_interface_toast = {
								title = entourage_member_wounded_toast
								left_icon = scope:woundee
								increase_wounds_effect = { REASON = battle }
							}
						}
					}
				}
			}
		}
		stress_impact = {
			just = minor_stress_impact_gain
			compassionate = minor_stress_impact_gain
			generous = medium_stress_impact_gain
			greedy = minor_stress_impact_loss
			callous = minor_stress_impact_gain
		}
		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_zeal = 0.5
				ai_boldness = -0.5
				ai_sociability = -0.5
			}
		}
	}

	option = { # No
		name = {
			trigger = {
				location.county.holder.top_liege != root.top_liege
			}
			text = tour_travel.3040.c.foreign
		}
		name = {
			trigger = { location.county.holder.top_liege = root.top_liege }
			text = tour_travel.3040.c
		}
		if = {
			limit = {
				location.county.holder != root
			}
			reverse_add_opinion = {
				target = location.county.holder
				modifier = annoyed_opinion
				opinion = -10
			}
		}
		location.county = {
			add_county_modifier = {
				modifier = hamlet_bandit_remains_modifier
				years = 10
			}
		}
		stress_impact = {
			generous = minor_stress_impact_gain
			just = minor_stress_impact_gain
			compassionate = minor_stress_impact_gain
			callous = minor_stress_impact_loss
		}
		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_zeal = 0.5
				ai_boldness = -0.5
				ai_sociability = -0.5
			}
		}
	}

	after = {
		scope:bandit_mayor = { silent_disappearance_effect = yes }
	}	
}


