﻿# Events for the travel portion of the Tour grand activity

namespace = tour_grounds_events

############################
## Tour Mini-Activity: Tour Grounds
############################
## Vassal Events
## 1000-2999
## by James Beaumont
############################
# tour_grounds_events.1001 - Vassal: Show your liege your hunting skills?
# tour_grounds_events.1002 - You stage an elaborate mock-assassination on your liege
# tour_grounds_events.1004 - You attempt to have a romantic encounter with your liege in the woods
# tour_grounds_events.1006 - A landless character speaks out of turn
# tour_grounds_events.1008 - A member of your court tells your child liege a scary story
# tour_grounds_events.1010 - You capture your liege's rival and have them ridden around like a horse
# tour_grounds_events.1012 - You find a vegetable that looks like your liege
# tour_grounds_events.1014 - You stage a fake hunt for your liege
#
############################
## Liege Events
## 3000-5999
## by James Beaumont
############################
# tour_grounds_events.3001 - Liege: Initial event informing the liege that their vassal-host has decided to do a tour grounds mini-activity
# tour_grounds_events.3003 - You spot a beast in a precarious position and attempt to slay it
# tour_grounds_events.3008 - You trample a child with your horse
# tour_grounds_events.3010 - Your horse stumbles over a rock
# tour_grounds_events.3012 - You give your host a bag of severed heads from poachers
# tour_grounds_events.3014 - You collect a window tax on your host
# tour_grounds_events.3016 - You carve your lover's name into a tree
# tour_grounds_events.3019 - You collect taxable extras on your host
#
#



#####################################################################################

######################
## Vassal Events
## 1000-2999
## by James Beaumont
######################

# Vassal: Show your liege your hunting skills?
tour_grounds_events.1001 = {
	type = activity_event
	title = tour_grounds_events.1001.title
	desc = {
		desc = tour_grounds_events.1001.desc.intro
		first_valid = {
			triggered_desc = {
				trigger = {
					always = yes 
				}
				desc = tour_grounds_events.1001.desc.mid
			}
		}
		desc = tour_grounds_events.1001.desc.outro
	}

	theme = tour_grounds
	left_portrait = {
		character = root
		animation = admiration
	}
	right_portrait = {
		character = scope:visiting_liege
		animation = personality_honorable
	}

	trigger = {
		
		NOT = { exists = local_var:had_1001 }
	}

	immediate = {
		root = {
			save_scope_as = stop_host_scope
		}
		scope:stop_host_scope.capital_county = {
			save_scope_as = wilderness_scope
		}
		liege = { save_scope_as = visiting_liege }
		set_local_variable = {
			name = had_1001
			value = yes
		}
	}

	option = { # Let's hunt
		name = tour_grounds_events.1001.a
		duel = {
			skill = prowess
			value = decent_skill_rating
			10 = { #You critically impress with your hunting skills
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
				}
				modifier = {
					factor = 4
					has_trait = lifestyle_hunter
				}
				custom_tooltip = {
					text = liege_very_impressed_by_hunting_tt
					subject = scope:visiting_liege
				}
				reverse_add_opinion = {
					target = scope:visiting_liege
					modifier = impressed_opinion
					opinion = 15
				}
				add_prestige = medium_prestige_gain
				if = {
					limit = {
						this.dynasty.dynast ?= this
					}
					dynasty ?= { add_dynasty_prestige = minor_dynasty_prestige_gain }
				}
				set_variable = {
					name = 1001_critical_success
					days = 7
				}
			}
			50 = { #You impress with your hunting skills
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
				}
				modifier = {
					factor = 2
					has_trait = lifestyle_hunter
				}
				custom_tooltip = {
					text = liege_impressed_by_hunting_tt
					subject = scope:visiting_liege
				}
				reverse_add_opinion = {
					target = scope:visiting_liege
					modifier = impressed_opinion
					opinion = 10
				}
				add_prestige = minor_prestige_gain
				if = {
					limit = {
						this.dynasty.dynast ?= this
					}
					dynasty ?= { add_dynasty_prestige = miniscule_dynasty_prestige_gain }
				}
				set_variable = {
					name = 1001_success
					days = 7
				}
			}
			50 = { #You fail to impress with your hunting skills
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
				}
				custom_tooltip = {
					text = liege_not_very_impressed_by_hunting_tt
					subject = scope:visiting_liege
				}
				reverse_add_opinion = {
					target = scope:visiting_liege
					modifier = disappointed_opinion
					opinion = -5
				}
				add_prestige = minor_prestige_loss
				set_variable = {
					name = 1001_failure
					days = 7
				}
			}
		}
		scope:visiting_liege = {
			trigger_event = tour_grounds_events.3002
		}
	}

	option = { # Something else perhaps
		name = tour_grounds_events.1001.b
		trigger_event = { on_action = on_tour_grounds_vassal }
	}
}

scripted_effect tour_grounds_1002_likes_effect = {
	scope:visiting_liege = {
		reverse_add_opinion = {
			target = scope:stop_host_scope
			modifier = impressed_opinion
			opinion = 15
		}
	}
	scope:stop_host_scope = {
		add_prestige = minor_prestige_gain
		if = {
			limit = {
				this.dynasty.dynast ?= this
			}
			dynasty ?= { add_dynasty_prestige = miniscule_dynasty_prestige_gain }
		}
	}
}

scripted_effect tour_grounds_1002_dislikes_effect = {
	scope:visiting_liege = {
		reverse_add_opinion = {
			target = scope:stop_host_scope
			modifier = insulted_opinion
			opinion = -15
		}
	}
	scope:stop_host_scope = {
		add_prestige = minor_prestige_loss
	}
}

scripted_effect tour_grounds_1002_murder_effect = {
	scope:visiting_liege = {
		progress_towards_rival_effect = {
			CHARACTER = scope:stop_host_scope
			REASON = rival_believes_attempted_murder
			OPINION = default_rival_opinion
		}
	}
}

# Vassal: Set up an elaborate assassination attempt for your liege to foil
tour_grounds_events.1002 = {
	type = activity_event
	title = tour_grounds_events.1002.title
	desc = tour_grounds_events.1002.desc

	theme = tour_grounds
	left_portrait = {
		character = root
		animation = personality_rational
	}
	right_portrait = {
		character = scope:visiting_liege
		animation = personality_honorable
	}

	trigger = {
		
		NOT = { exists = local_var:had_1002 }
	}

	immediate = {
		root = {
			save_scope_as = stop_host_scope
		}
		scope:stop_host_scope.capital_county = {
			save_scope_as = wilderness_scope
		}
		liege = { save_scope_as = visiting_liege }
		set_local_variable = {
			name = had_1002
			value = yes
		}
	}

	option = { # Let's do it!
		name = tour_grounds_events.1002.a
		show_as_tooltip = {
			random_list = {
				100 = {
					show_chance = no
					desc = tour_grounds_1002_likes_tt
					tour_grounds_1002_likes_effect = yes
				}
				100 = {
					show_chance = no
					desc = tour_grounds_1002_dislikes_tt
					tour_grounds_1002_dislikes_effect = yes
				}
				100 = {
					show_chance = no
					desc = tour_grounds_1002_murder_tt
					tour_grounds_1002_murder_effect = yes
				}
			}
		}
		hidden_effect = {
			scope:visiting_liege = { trigger_event = tour_grounds_events.1003 }
		}
		stress_impact = {
			shy = minor_stress_impact_gain
			honest = medium_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -10
				OR = {
					has_trait = shy
					has_trait = honest
				}
			}
		}
	}

	option = { # Something else perhaps
		name = tour_grounds_events.1002.b
		trigger_event = { on_action = on_tour_grounds_vassal }
		stress_impact = {
			honest = minor_stress_impact_loss
			gregarious = medium_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -10
				OR = {
					has_trait = deceitful
					has_trait = gregarious
				}
			}
		}
	}
}

# Liege: respond to "assassination attempt"
tour_grounds_events.1003 = {
	type = activity_event
	title = tour_grounds_events.1003.title
	desc = {
		desc = tour_grounds_events.1003.desc.intro
		first_valid = {
			triggered_desc = {
				trigger = {
					has_trait = paranoid
				}
				desc = tour_grounds_events.1003.desc.paranoid
			}
			desc = tour_grounds_events.1003.desc.not_paranoid
		}
	}

	theme = murder_scheme
	left_portrait = {
		character = root
		animation = shock
	}
	right_portrait = {
		character = scope:fake_assassin_scope
		animation = scheme
	}

	trigger = {
		
		NOT = { exists = local_var:had_1003 }
	}

	immediate = {
		create_character = {
			location = scope:touring_grounds_scope.title_province
			template = generic_peasant_character
			culture = scope:touring_grounds_scope.culture
			faith = scope:touring_grounds_scope.faith
			save_scope_as = fake_assassin_scope
		}
		set_local_variable = {
			name = had_1003
			value = yes
		}
	}

	option = { # Play along
		name = {
			text = {
				first_valid = {
					triggered_desc = {
						trigger = { has_trait = paranoid }
						desc = tour_grounds_events.1003.a.paranoid
					}
					desc = tour_grounds_events.1003.a
				}
			}
		}
		if = {
			limit = {
				has_trait = paranoid
			}
			show_as_tooltip = {
				death = {
					killer = scope:fake_assassin_scope
					death_reason = death_murder
				}
			}
			hidden_effect = {
				send_interface_toast = {
					title = tour_grounds_1002.assassination_was_fake
					left_icon = scope:visiting_liege
					right_icon = scope:stop_host_scope
					tour_grounds_1002_dislikes_effect = yes
				}
				scope:stop_host_scope = {
					send_interface_toast = {
						title = tour_grounds_1002.liege_believed_it_was_real
						left_icon = scope:stop_host_scope
						right_icon = scope:visiting_liege
						show_as_tooltip = {
							tour_grounds_1002_dislikes_effect = yes
						}
					}
				}
			}
		}
		else = {
			scope:stop_host_scope = {
				send_interface_toast = {
					title = tour_grounds_1002.liege_played_along
					left_icon = scope:stop_host_scope
					right_icon = scope:visiting_liege
					tour_grounds_1002_likes_effect = yes
				}
			}
		}
		stress_impact = {
			base = minor_stress_impact_loss
			gregarious = minor_stress_impact_loss
			shy = medium_stress_impact_gain
			paranoid = massive_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -10
				OR = {
					has_trait = shy
					has_trait = paranoid
				}
			}
		}
	}

	option = { # Begrudgingly play along
		name = tour_grounds_events.1003.b
		trigger = {
			NOT = {
				has_trait = paranoid
			}
		}
		scope:stop_host_scope = {
			send_interface_toast = {
				title = tour_grounds_1002.liege_begrudgingly_played_along
				left_icon = scope:stop_host_scope
				right_icon = scope:visiting_liege
				tour_grounds_1002_dislikes_effect = yes
			}
		}
		stress_impact = {
			shy = medium_stress_impact_loss
			shy = minor_stress_impact_gain
			forgiving = minor_stress_impact_gain
			honest = minor_stress_impact_loss
			greedy = minor_stress_impact_loss
			wrathful = minor_stress_impact_loss
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -10
				OR = {
					has_trait = gregarious
					has_trait = forgiving
					has_trait = deceitful
					has_trait = generous
					has_trait = calm
				}
			}
		}
	}

	option = { # You'll never take me alive!
		name = tour_grounds_events.1003.c
		trigger = {
			has_trait = paranoid
		}
		duel = {
			skill = prowess
			target = scope:stop_host_scope
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
				}
				add_prestige = medium_prestige_gain
				add_stress = major_stress_impact_loss
			}
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
				}
				add_stress = major_stress_impact_gain
				show_as_tooltip = {
					death = {
						killer = scope:fake_assassin_scope
						death_reason = death_murder
					}
				}
			}
		}
		hidden_effect = {
			send_interface_toast = {
				title = tour_grounds_1002.assassination_was_fake
				left_icon = scope:visiting_liege
				right_icon = scope:stop_host_scope
				tour_grounds_1002_murder_effect = yes
			}
			scope:stop_host_scope = {
				send_interface_toast = {
					title = tour_grounds_1002.liege_believed_it_was_real
					left_icon = scope:stop_host_scope
					right_icon = scope:visiting_liege
					show_as_tooltip = {
						tour_grounds_1002_murder_effect = yes
					}
				}
			}
		}
		ai_chance = {
			base = 30
		}
	}

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

# Liege and vassal are lovers, go for some snogging in the woods
scripted_effect tour_grounds_1004_shag_effect = {
	scope:stop_host_scope = {
		had_sex_with_effect = {
			CHARACTER = scope:visiting_liege
			PREGNANCY_CHANCE = 50
		}
		if = {
			limit = {
				any_scheme = {
					scheme_type = seduce
					scheme_target = scope:visiting_liege
				}
			}
			random_scheme = {
				limit = {
					scheme_type = seduce
					scheme_target = scope:visiting_liege
				}
				add_scheme_modifier = {
					type = moment_in_the_woods_modifier
				}
			}
		}
	}
}
scripted_effect tour_grounds_1004_rebuffed_effect = {
	scope:stop_host_scope = {
		add_opinion = {
			target = scope:visiting_liege
			modifier = rebuffed_opinion
			opinion = -10
		}
		if = {
			limit = {
				any_scheme = {
					scheme_type = seduce
					scheme_target = scope:visiting_liege
				}
			}
			random_scheme = {
				limit = {
					scheme_type = seduce
					scheme_target = scope:visiting_liege
				}
				add_scheme_modifier = {
					type = rebuffed_in_the_woods_modifier
				}
			}
		}
	}
}

#Vassal
tour_grounds_events.1004 = {
	type = activity_event
	title = tour_grounds_events.1004.title
	desc = {
		desc = tour_grounds_events.1004.desc.intro
		first_valid = {
			triggered_desc = {
				trigger = {
					OR = {
						has_relation_lover = scope:visiting_liege
						has_relation_soulmate = scope:visiting_liege
					}
				}
				desc = tour_grounds_events.1004.desc.already_shagging
			}
			desc = tour_grounds_events.1004.desc.trying_to_shag
		}
		desc = tour_grounds_events.1004.desc.outro
	}

	theme = tour_grounds
	left_portrait = {
		character = root
		animation = flirtation
	}
	right_portrait = {
		character = scope:visiting_liege
		animation = personality_rational
	}

	trigger = {
		is_adult = yes
		scope:visiting_liege = { is_adult = yes }
		OR = {
			has_relation_lover = scope:visiting_liege
			has_relation_soulmate = scope:visiting_liege
			any_scheme = {
				scheme_type = seduce
				scheme_target = scope:visiting_liege
			}
		}
		scope:visiting_liege = {
			NOT = { has_trait = celibate }
		}
		NOT = { has_trait = celibate }
		NOT = { exists = local_var:had_1004 }
	}

	immediate = {
		set_local_variable = {
			name = had_1004
			value = yes
		}
	}

	option = { # Shall we shag now
		name = tour_grounds_events.1004.a
		show_as_tooltip = {
			random_list = {
				100 = {
					show_chance = no
					desc = tour_grounds_if_liege_accepts_tt
					tour_grounds_1004_shag_effect = yes
				}
				100 = {
					show_chance = no
					desc = tour_grounds_if_liege_rejects_tt
					tour_grounds_1004_rebuffed_effect = yes
				}
			}
		}
		hidden_effect = {
			scope:visiting_liege = {
				trigger_event = tour_grounds_events.1005
			}
		}
		stress_impact = {
			lustful = minor_stress_impact_loss
			gregarious = minor_stress_impact_loss
			humble = minor_stress_impact_gain
			craven = minor_stress_impact_gain
			shy = medium_stress_impact_gain
			paranoid = medium_stress_impact_gain
			chaste = medium_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -10
				OR = {
					has_trait = humble
					has_trait = craven
					has_trait = shy
					has_trait = paranoid
					has_trait = chaste
				}
			}
		}
	}

	option = { # or shag later?
		name = tour_grounds_events.1004.b
		
		stress_impact = {
			impatient = minor_stress_impact_gain
			craven = minor_stress_impact_loss
			chaste = minor_stress_impact_loss
			shy = medium_stress_impact_loss
			arrogant = minor_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -10
				OR = {
					has_trait = impatient
					has_trait = brave
					has_trait = lustful
					has_trait = gregarious
					has_trait = arrogant
				}
			}
		}
	}
}

#Liege response event
tour_grounds_events.1005 = {
	type = activity_event
	title = tour_grounds_events.1005.title
	desc = {
		desc = tour_grounds_events.1005.desc.intro
		first_valid = {
			triggered_desc = {
				trigger = {
					OR = {
						has_relation_lover = scope:stop_host_scope
						has_relation_soulmate = scope:stop_host_scope
					}
				}
				desc = tour_grounds_events.1005.desc.already_shagging
			}
			desc = tour_grounds_events.1005.desc.trying_to_shag
		}
		desc = tour_grounds_events.1005.desc.outro
	}

	theme = tour_grounds
	left_portrait = {
		character = root
		animation = personality_rational
	}
	right_portrait = {
		character = scope:stop_host_scope
		animation = flirtation
	}
	
	immediate = {
		select_local_animal_effect = { TYPE = prowling } # Save scope to limit possible animals: any/big/small/dangerous/harmless/prowling
	}

	option = { # Have your moment in the woods
		name = tour_grounds_events.1005.a
		scope:visiting_liege = {
			send_interface_toast = {
				title = tour_grounds.moment_in_the_woods
				left_icon = scope:stop_host_scope
				right_icon = scope:visiting_liege
				tour_grounds_1004_shag_effect = yes
			}
		}
		if = {
			limit = {
				scope:activity = {
					has_activity_option = {
						category = special_type
						option = tour_type_majesty
					}
				}
			}
			increase_tour_success_effect = { POINTS = 1 }
		}
		stress_impact = {
			rakish = medium_stress_impact_loss
			lustful = medium_stress_impact_loss
			gregarious = minor_stress_impact_loss
			humble = minor_stress_impact_gain
			craven = minor_stress_impact_gain
			shy = medium_stress_impact_gain
			paranoid = medium_stress_impact_gain
			chaste = medium_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				factor = 2
				OR = {
					has_relation_lover = scope:stop_host_scope
					has_relation_soulmate = scope:stop_host_scope
				}
			}
			modifier = {
				add = -10
				OR = {
					has_trait = humble
					has_trait = craven
					has_trait = shy
					has_trait = paranoid
					has_trait = chaste
				}
			}
		}
	}

	option = { # Absolutely not
		name = tour_grounds_events.1005.b
		scope:visiting_liege = {
			send_interface_toast = {
				title = tour_grounds.rebuffed_in_the_woods
				left_icon = scope:stop_host_scope
				right_icon = scope:visiting_liege
				tour_grounds_1004_rebuffed_effect = yes
			}
		}
		stress_impact = {
			impatient = minor_stress_impact_gain
			craven = minor_stress_impact_loss
			shy = medium_stress_impact_loss
			arrogant = minor_stress_impact_gain
			lustful = medium_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -5
				OR = {
					has_relation_lover = scope:stop_host_scope
					has_relation_soulmate = scope:stop_host_scope
				}
			}
			modifier = {
				add = 5
				has_trait = chaste
			}
			modifier = {
				add = -10
				OR = {
					has_trait = impatient
					has_trait = brave
					has_trait = lustful
					has_trait = gregarious
					has_trait = arrogant
				}
			}
		}
	}
}

#Landless character speaks out of turn
#Vassal
tour_grounds_events.1006 = {
	type = activity_event
	title = tour_grounds_events.1006.title
	desc = {
		desc = tour_grounds_events.1006.desc.intro
		first_valid = {
			triggered_desc = {
				trigger = {
					scope:landless_courtier_scope = { martial >= very_high_skill_rating }
				}
				desc = tour_grounds_events.1006.desc.mid.martial
			}
			triggered_desc = {
				trigger = {
					scope:landless_courtier_scope = { learning >= very_high_skill_rating }
				}
				desc = tour_grounds_events.1006.desc.mid.learning
			}
			triggered_desc = {
				trigger = {
					scope:landless_courtier_scope = { stewardship >= very_high_skill_rating }
				}
				desc = tour_grounds_events.1006.desc.mid.stewardship
			}
			triggered_desc = {
				trigger = {
					scope:landless_courtier_scope = { diplomacy >= very_high_skill_rating }
				}
				desc = tour_grounds_events.1006.desc.mid.diplomacy
			}
			triggered_desc = {
				trigger = {
					scope:landless_courtier_scope = { intrigue >= very_high_skill_rating }
				}
				desc = tour_grounds_events.1006.desc.mid.intrigue
			}
		}
		desc = tour_grounds_events.1006.desc.outro
	}

	theme = tour_grounds
	left_portrait = {
		character = root
		animation = anger
	}
	right_portrait = {
		character = scope:landless_courtier_scope
		animation = fear
	}

	trigger = {
		
		any_courtier = {
			is_ruler = no
			is_available_ai_adult = yes
			OR = {
				martial >= very_high_skill_rating
				learning >= very_high_skill_rating
				stewardship >= very_high_skill_rating
				diplomacy >= very_high_skill_rating
				intrigue >= very_high_skill_rating
			}
			is_councillor = no
		}
		NOT = { exists = local_var:had_1006 }
	}
	immediate = {
		random_courtier = {
			limit = {
				is_ruler = no
				is_available_ai_adult = yes
				OR = {
					martial >= very_high_skill_rating
					learning >= very_high_skill_rating
					stewardship >= very_high_skill_rating
					diplomacy >= very_high_skill_rating
					intrigue >= very_high_skill_rating
				}
				is_councillor = no
			}
			save_scope_as = landless_courtier_scope
		}
		set_local_variable = {
			name = had_1006
			value = yes
		}
	}

	option = { # Have them punished
		name = tour_grounds_events.1006.a
		progress_towards_rival_effect = {
			CHARACTER = scope:landless_courtier_scope
			OPINION = default_rival_opinion
			REASON = rival_silenced_me
		}
		scope:visiting_liege = {
			trigger_event = tour_grounds_events.1007
		}
		stress_impact = {
			irritable = minor_stress_impact_loss
			lazy = minor_stress_impact_gain
			forgiving = medium_stress_impact_gain
			generous = medium_stress_impact_gain
			compassionate = medium_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -10
				OR = {
					has_trait = lazy
					has_trait = forgiving
					has_trait = generous
					has_trait = compassionate
				}
			}
		}
	}

	option = { # Lightly chastise them
		name = tour_grounds_events.1006.b
		scope:visiting_liege = {
			trigger_event = tour_grounds_events.1017
		}
		stress_impact = {
			wrathful = medium_stress_impact_gain
			impatient = medium_stress_impact_gain
			arrogant = medium_stress_impact_gain
			callous = medium_stress_impact_gain
			sadistic = medium_stress_impact_gain
			irritable = major_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -10
				OR = {
					has_trait = wrathful
					has_trait = impatient
					has_trait = arrogant
					has_trait = callous
					has_trait = sadistic
					has_trait = irritable
				}
			}
		}
	}
}

#Liege response event
tour_grounds_events.1007 = {
	type = activity_event
	title = tour_grounds_events.1006.title
	desc = {
		desc = tour_grounds_events.1007.desc.intro
		first_valid = {
			triggered_desc = {
				trigger = {
					scope:landless_courtier_scope = { martial >= very_high_skill_rating }
				}
				desc = tour_grounds_events.1006.desc.mid.martial
			}
			triggered_desc = {
				trigger = {
					scope:landless_courtier_scope = { learning >= very_high_skill_rating }
				}
				desc = tour_grounds_events.1006.desc.mid.learning
			}
			triggered_desc = {
				trigger = {
					scope:landless_courtier_scope = { stewardship >= very_high_skill_rating }
				}
				desc = tour_grounds_events.1006.desc.mid.stewardship
			}
			triggered_desc = {
				trigger = {
					scope:landless_courtier_scope = { diplomacy >= very_high_skill_rating }
				}
				desc = tour_grounds_events.1006.desc.mid.diplomacy
			}
			triggered_desc = {
				trigger = {
					scope:landless_courtier_scope = { intrigue >= very_high_skill_rating }
				}
				desc = tour_grounds_events.1006.desc.mid.intrigue
			}
		}
		desc = tour_grounds_events.1007.desc.outro
	}

	theme = tour_grounds
	left_portrait = {
		character = scope:stop_host_scope
		animation = anger
	}
	right_portrait = {
		character = scope:landless_courtier_scope
		animation = fear
	}

	option = { # They are brave and wise, hire them!
		name = tour_grounds_events.1007.a
		scope:stop_host_scope = {
			send_interface_toast = {
				title = tour_grounds.recruited_my_courtier
				left_icon = scope:stop_host_scope
				right_icon = scope:visiting_liege
				scope:visiting_liege = {
					add_to_entourage_court_and_activity_effect = {
						CHAR_TO_ADD = scope:landless_courtier_scope 
						NEW_COURT_OWNER = scope:visiting_liege 
					}
				}
			}
		}
		reverse_add_opinion = {
			target = scope:stop_host_scope
			modifier = insulted_opinion
			opinion = -15
		}
		stress_impact = {
			lazy = minor_stress_impact_gain
			shy = minor_stress_impact_gain
			humble = minor_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -10
				OR = {
					has_trait = lazy
					has_trait = shy
					has_trait = humble
				}
			}
		}
	}

	option = { # Lightly chastise them yourself
		name = tour_grounds_events.1007.b
		reverse_add_opinion = {
			target = scope:stop_host_scope
			modifier = flattered_opinion
			opinion = 15
		}
		reverse_add_opinion = {
			target = scope:landless_courtier_scope
			modifier = insulted_opinion
			opinion = -15
		}
		stress_impact = {
			patient = minor_stress_impact_gain
			forgiving = minor_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -10
				OR = {
					has_trait = patient
					has_trait = forgiving
				}
			}
		}
	}

	option = { # Heavily chastise them
		name = tour_grounds_events.1007.c
		reverse_add_opinion = {
			target = scope:stop_host_scope
			modifier = flattered_opinion
			opinion = 15
		}
		rightfully_imprison_character_effect = {
			TARGET = scope:landless_courtier_scope
			IMPRISONER = root
		}
		if = {
			limit = {
				scope:activity = {
					has_activity_option = {
						category = special_type
						option = tour_type_intimidation
					}
				}
			}
			increase_tour_success_effect = { POINTS = 1 }
		}
		stress_impact = {
			compassionate = minor_stress_impact_loss
			calm = minor_stress_impact_loss
			patient = medium_stress_impact_gain
			forgiving = medium_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -10
				OR = {
					has_trait = patient
					has_trait = forgiving
				}
			}
			modifier = {
				add = 10
				OR = {
					has_trait = sadistic
					has_trait = wrathful
				}
			}
		}
	}
}

#Liege response event
tour_grounds_events.1017 = {
	type = activity_event
	title = tour_grounds_events.1006.title
	desc = {
		desc = tour_grounds_events.1007.desc.intro
		first_valid = {
			triggered_desc = {
				trigger = {
					scope:landless_courtier_scope = { martial >= very_high_skill_rating }
				}
				desc = tour_grounds_events.1006.desc.mid.martial
			}
			triggered_desc = {
				trigger = {
					scope:landless_courtier_scope = { learning >= very_high_skill_rating }
				}
				desc = tour_grounds_events.1006.desc.mid.learning
			}
			triggered_desc = {
				trigger = {
					scope:landless_courtier_scope = { stewardship >= very_high_skill_rating }
				}
				desc = tour_grounds_events.1006.desc.mid.stewardship
			}
			triggered_desc = {
				trigger = {
					scope:landless_courtier_scope = { diplomacy >= very_high_skill_rating }
				}
				desc = tour_grounds_events.1006.desc.mid.diplomacy
			}
			triggered_desc = {
				trigger = {
					scope:landless_courtier_scope = { intrigue >= very_high_skill_rating }
				}
				desc = tour_grounds_events.1006.desc.mid.intrigue
			}
		}
		desc = tour_grounds_events.1017.desc.outro
	}

	theme = tour_grounds
	left_portrait = {
		character = scope:stop_host_scope
		animation = anger
	}
	right_portrait = {
		character = scope:landless_courtier_scope
		animation = fear
	}

	option = { # They are brave and wise, learn from them!
		name = tour_grounds_events.1017.a
		add_character_modifier = {
			modifier = tutored_by_landless_modifier
			years = 5
		}
		stress_impact = {
			lazy = minor_stress_impact_gain
			shy = medium_stress_impact_gain
			vengeful = medium_stress_impact_gain
			wrathful = medium_stress_impact_gain
			sadistic = medium_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -10
				OR = {
					has_trait = lazy
					has_trait = shy
					has_trait = vengeful
					has_trait = wrathful
					has_trait = sadistic
				}
			}
		}
	}

	option = { # Lightly chastise them yourself
		name = tour_grounds_events.1007.b
		reverse_add_opinion = {
			target = scope:stop_host_scope
			modifier = flattered_opinion
			opinion = 15
		}
		reverse_add_opinion = {
			target = scope:landless_courtier_scope
			modifier = insulted_opinion
			opinion = -15
		}
		stress_impact = {
			patient = medium_stress_impact_gain
			forgiving = medium_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -10
				OR = {
					has_trait = patient
					has_trait = forgiving
				}
			}
		}
	}
}

#Tell spooky stories to child liege
scripted_effect 1008_liege_likes_effect = {
	scope:stop_host_scope = {
		add_prestige = minor_prestige_gain
	}
	scope:visiting_liege = {
		progress_towards_friend_effect = {
			CHARACTER = scope:stop_host_scope
			OPINION = default_friend_opinion
			REASON = friend_told_me_scary_stories
		}
		# TODO_CD_EP2 add memories
	}
}
scripted_effect 1008_liege_scared_effect = {
	scope:visiting_liege = {
		add_opinion = {
			target = scope:stop_host_scope
			modifier = scared_opinion
			opinion = -15
		}
		# TODO_CD_EP2 add memories
	}
}
scripted_effect 1008_liege_annoyed_effect = {
	scope:visiting_liege = {
		add_opinion = {
			target = scope:stop_host_scope
			modifier = annoyed_opinion
			opinion = -15
		}
	}
}

tour_grounds_events.1008 = {
	type = activity_event
	title = tour_grounds_events.1008.title
	desc = {
		desc = tour_grounds_events.1008.desc.intro
		first_valid = {
			#AGOT Disabled
			# triggered_desc = {
			# 	trigger = {
			# 		scope:storyteller_scope.culture = { has_cultural_pillar = heritage_goidelic }
			# 	}
			# 	desc = tour_grounds_events.1008.desc.mid.banshee
			# }
			# triggered_desc = {
			# 	trigger = {
			# 		scope:storyteller_scope.culture = { has_cultural_pillar = heritage_arabic }
			# 	}
			# 	desc = tour_grounds_events.1008.desc.mid.ghul
			# }
			# triggered_desc = {
			# 	trigger = {
			# 		scope:storyteller_scope.culture = { has_cultural_pillar = heritage_iranian }
			# 	}
			# 	desc = tour_grounds_events.1008.desc.mid.azdaha
			# }
			# triggered_desc = {
			# 	trigger = {
			# 		scope:storyteller_scope.culture = { has_cultural_pillar = heritage_akan }
			# 	}
			# 	desc = tour_grounds_events.1008.desc.mid.sasabonsam
			# }
			# triggered_desc = {
			# 	trigger = {
			# 		scope:storyteller_scope.culture = {
			# 			OR = {
			# 				has_cultural_pillar = heritage_brythonic
			# 				this = culture:norman
			# 				any_parent_culture = { this = culture:norman }
			# 			}
			# 		}
			# 	}
			# 	desc = tour_grounds_events.1008.desc.mid.ankou
			# }
			# triggered_desc = {
			# 	trigger = {
			# 		scope:storyteller_scope.culture = {
			# 			OR = {
			# 				this = culture:dutch
			# 				any_parent_culture = { this = culture:dutch }
			# 				this = culture:frisian
			# 				any_parent_culture = { this = culture:frisian }
			# 				this = culture:saxon
			# 				any_parent_culture = { this = culture:saxon }
			# 			}
			# 		}
			# 	}
			# 	desc = tour_grounds_events.1008.desc.mid.witt_wieven
			# }
			# triggered_desc = {
			# 	trigger = {
			# 		scope:storyteller_scope = {
			# 			OR = {
			# 				culture = { has_cultural_pillar = heritage_east_slavic }
			# 				culture = { has_cultural_pillar = heritage_west_slavic }
			# 				culture = { has_cultural_pillar = heritage_south_slavic }
			# 				faith = { religion = religion:slavic_religion }
			# 			}
			# 		}
			# 	}
			# 	desc = tour_grounds_events.1008.desc.mid.baba_yaga
			# }
			desc = tour_grounds_events.1008.desc.mid
		}
		desc = tour_grounds_events.1008.desc.outro
	}

	theme = tour_grounds
	left_portrait = {
		character = scope:storyteller_scope
		animation = personality_rational
	}
	right_portrait = {
		character = scope:visiting_liege
		animation = fear
	}

	trigger = {
		
		scope:visiting_liege = {
			is_adult = no
		}
		NOT = { exists = local_var:had_1008 }
	}

	immediate = {
		random_courtier = {
			limit = {
				is_ruler = no
				is_available_ai_adult = yes
			}
			weight = {
				#Try to make it someone relevant
				modifier = {
					add = 5
					is_councillor = yes
				}
				modifier = {
					add = 5
					OR = {
						is_close_family_of = root
						is_consort_of = root
					}
				}
				#Try to make it someone who would be good at telling a story
				modifier = {
					add = 5
					OR = {
						has_trait = journaller
						has_trait = poet
					}
				}
				modifier = {
					add = 5
					learning >= high_skill_rating
				}
			}
			save_scope_as = storyteller_scope
		}
		set_local_variable = {
			name = had_1008
			value = yes
		}
	}

	option = { # Join in on the spooky story
		name = tour_grounds_events.1008.a
		# TODO_CD_EP2 add reason and uncomment
		progress_towards_friend_effect = {
			CHARACTER = scope:storyteller_scope
			OPINION = default_friend_opinion
			REASON = friend_bonded_on_tour
		}
		show_as_tooltip = {
			random_list = {
				100 = {
					show_chance = no
					desc = tour_grounds_if_liege_enjoys_tt
					1008_liege_likes_effect = yes
				}
				100 = {
					show_chance = no
					desc = tour_grounds_if_liege_is_scared_tt
					1008_liege_scared_effect = yes
				}
			}
		}
		hidden_effect = {
			set_variable = {
				name = 1008_told_the_story
				days = 7
			}
			scope:visiting_liege = {
				trigger_event = tour_grounds_events.1009
			}
		}
		stress_impact = {
			paranoid = minor_stress_impact_gain
			cynical = minor_stress_impact_gain
			wrathful = minor_stress_impact_loss
			craven = medium_stress_impact_gain
			compassionate = medium_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -5
				OR = {
					has_trait = paranoid
					has_trait = cynical
					has_trait = calm
				}
			}
			modifier = {
				add = -10
				OR = {
					has_trait = craven
					has_trait = compassionate
				}
			}
		}
	}

	option = { # There's no such thing as ghosts
		name = tour_grounds_events.1008.b
		reverse_add_opinion = {
			target = scope:storyteller_scope
			modifier = annoyed_opinion
			opinion = -15
		}
		show_as_tooltip = {
			random_list = {
				100 = {
					show_chance = no
					desc = tour_grounds_if_liege_is_scared_tt
					1008_liege_likes_effect = yes
				}
				100 = {
					show_chance = no
					desc = tour_grounds_if_liege_enjoys_tt
					1008_liege_annoyed_effect = yes
				}
			}
		}
		hidden_effect = {
			set_variable = {
				name = 1008_interrupted_the_story
				days = 7
			}
			scope:visiting_liege = {
				trigger_event = tour_grounds_events.1009
			}
		}
		stress_impact = {
			callous = medium_stress_impact_gain
			sadistic = medium_stress_impact_gain
			arrogant = medium_stress_impact_gain
			deceitful = medium_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -10
				OR = {
					has_trait = callous
					has_trait = sadistic
					has_trait = arrogant
					has_trait = deceitful
				}
			}
		}
	}
}

tour_grounds_events.1009 = {
	type = activity_event
	title = tour_grounds_events.1009.title
	desc = {
		desc = tour_grounds_events.1009.desc.intro
		first_valid = {
			#AGOT Disabled
			# triggered_desc = {
			# 	trigger = {
			# 		scope:storyteller_scope.culture = { has_cultural_pillar = heritage_goidelic }
			# 	}
			# 	desc = tour_grounds_events.1008.desc.mid.banshee
			# }
			# triggered_desc = {
			# 	trigger = {
			# 		scope:storyteller_scope.culture = { has_cultural_pillar = heritage_arabic }
			# 	}
			# 	desc = tour_grounds_events.1008.desc.mid.ghul
			# }
			# triggered_desc = {
			# 	trigger = {
			# 		scope:storyteller_scope.culture = { has_cultural_pillar = heritage_iranian }
			# 	}
			# 	desc = tour_grounds_events.1008.desc.mid.azdaha
			# }
			# triggered_desc = {
			# 	trigger = {
			# 		scope:storyteller_scope.culture = { has_cultural_pillar = heritage_akan }
			# 	}
			# 	desc = tour_grounds_events.1008.desc.mid.sasabonsam
			# }
			# triggered_desc = {
			# 	trigger = {
			# 		scope:storyteller_scope.culture = {
			# 			OR = {
			# 				has_cultural_pillar = heritage_brythonic
			# 				this = culture:norman
			# 				any_parent_culture = { this = culture:norman }
			# 			}
			# 		}
			# 	}
			# 	desc = tour_grounds_events.1008.desc.mid.ankou
			# }
			# triggered_desc = {
			# 	trigger = {
			# 		scope:storyteller_scope.culture = {
			# 			OR = {
			# 				this = culture:dutch
			# 				any_parent_culture = { this = culture:dutch }
			# 				this = culture:frisian
			# 				any_parent_culture = { this = culture:frisian }
			# 				this = culture:saxon
			# 				any_parent_culture = { this = culture:saxon }
			# 			}
			# 		}
			# 	}
			# 	desc = tour_grounds_events.1008.desc.mid.witt_wieven
			# }
			# triggered_desc = {
			# 	trigger = {
			# 		scope:storyteller_scope = {
			# 			OR = {
			# 				culture = { has_cultural_pillar = heritage_east_slavic }
			# 				culture = { has_cultural_pillar = heritage_west_slavic }
			# 				culture = { has_cultural_pillar = heritage_south_slavic }
			# 				faith = { religion = religion:slavic_religion }
			# 			}
			# 		}
			# 	}
			# 	desc = tour_grounds_events.1008.desc.mid.baba_yaga
			# }
			desc = tour_grounds_events.1008.desc.mid
		}
		first_valid = {
			triggered_desc = {
				trigger = {
					scope:stop_host_scope = {
						exists = var:1008_told_the_story
					}
				}
				desc = tour_grounds_events.1009.desc.mid.finished
			}
			desc = tour_grounds_events.1009.desc.outro.interrupted
		}
	}

	theme = tour_grounds
	left_portrait = {
		character = root
		animation = fear
	}
	right_portrait = {
		character = scope:stop_host_scope
		animation = personality_rational
	}

	option = { # What a fun story!
		name = tour_grounds_events.1009.a
		trigger = {
			scope:stop_host_scope = {
				exists = var:1008_told_the_story
			}
		}
		1008_liege_likes_effect = yes
		if = {
			limit = {
				scope:activity = {
					has_activity_option = {
						category = special_type
						option = tour_type_intimidation
					}
				}
			}
			increase_tour_success_effect = { POINTS = 1 }
		}
		stress_impact = {
			paranoid = minor_stress_impact_gain
			pensive = minor_stress_impact_gain
			compassionate = minor_stress_impact_gain
			craven = medium_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -10
				OR = {
					has_trait = paranoid
					has_trait = pensive
					has_trait = compassionate
					has_trait = craven
				}
			}
		}
	}

	option = { # I am traumatised
		name = tour_grounds_events.1009.b
		trigger = {
			scope:stop_host_scope = {
				exists = var:1008_told_the_story
			}
		}
		1008_liege_scared_effect = yes
		stress_impact = {
			craven = minor_stress_impact_loss
			rowdy = minor_stress_impact_gain
			callous = minor_stress_impact_gain
			compassionate = minor_stress_impact_loss
			arrogant = minor_stress_impact_gain
			curious = minor_stress_impact_gain
			cynical = minor_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -10
				OR = {
					has_trait = brave
					has_trait = rowdy
					has_trait = callous
					has_trait = sadistic
					has_trait = arrogant
					has_trait = curious
					has_trait = cynical
				}
			}
		}
	}

	option = { # You stopped it at the good part!
		name = tour_grounds_events.1009.c
		trigger = {
			scope:stop_host_scope = {
				exists = var:1008_interrupted_the_story
			}
		}
		1008_liege_scared_effect = yes
		if = {
			limit = {
				scope:activity = {
					has_activity_option = {
						category = special_type
						option = tour_type_intimidation
					}
				}
			}
			increase_tour_success_effect = { POINTS = 1 }
		}
		stress_impact = {
			paranoid = minor_stress_impact_gain
			craven = medium_stress_impact_gain
			compassionate = medium_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -5
				OR = {
					has_trait = paranoid
					has_trait = cynical
					has_trait = calm
				}
			}
			modifier = {
				add = -10
				OR = {
					has_trait = craven
					has_trait = compassionate
				}
			}
		}
	}

	option = { # Thank goodness you stopped it
		name = tour_grounds_events.1009.d
		trigger = {
			scope:stop_host_scope = {
				exists = var:1008_interrupted_the_story
			}
		}
		1008_liege_likes_effect = yes
		stress_impact = {
			craven = minor_stress_impact_loss
			rowdy = minor_stress_impact_gain
			callous = minor_stress_impact_gain
			compassionate = minor_stress_impact_loss
			arrogant = minor_stress_impact_gain
			curious = minor_stress_impact_gain
			cynical = minor_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -10
				OR = {
					has_trait = brave
					has_trait = rowdy
					has_trait = callous
					has_trait = sadistic
					has_trait = arrogant
					has_trait = curious
					has_trait = cynical
				}
			}
		}
	}
}

# Host catches liege's rival and offers to have them ridden around like a horse
tour_grounds_events.1010 = {
	type = activity_event
	title = tour_grounds_events.1010.title
	desc = tour_grounds_events.1010.desc

	theme = tour_grounds
	left_portrait = {
		character = root
		animation = scheme
	}
	right_portrait = {
		character = scope:rival_courtier
		animation = fear
	}

	trigger = {
		
		scope:visiting_liege = {
			is_adult = yes
			any_relation = {
				type = rival
				is_ai = yes
				is_landed = no
				is_adult = yes
				OR = {
					is_imprisoned = no
					is_imprisoned_by = root
				}
			}
		}
		NOT = { exists = local_var:had_1010 }
	}

	immediate = {
		scope:visiting_liege = {
			random_relation = {
				type = rival
				limit = {
					is_ai = yes
					is_landed = no
					is_adult = yes
					OR = {
						is_imprisoned = no
						is_imprisoned_by = root
					}
				}
				save_scope_as = rival_courtier
			}
		}
		set_local_variable = {
			name = had_1010
			value = yes
		}
	}

	option = { # Try to grab em
		name = tour_grounds_events.1010.a
		duel = {
			skill = intrigue
			target = scope:rival_courtier
			50 = { #You manage to catch them
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
				}
				modifier = {
					factor = 2
					has_trait = schemer
				}
				progress_towards_rival_effect = {
					CHARACTER = scope:visiting_liege
					OPINION = default_friend_opinion
					REASON = friend_humiliated_rival
				}
				progress_towards_rival_effect = {
					CHARACTER = scope:rival_courtier
					OPINION = default_rival_opinion
					REASON = rival_humiliated
				}
				add_prestige = minor_prestige_gain
				scope:rival_courtier = {
					increase_wounds_no_death_effect = { REASON = fight }
				}
				scope:visiting_liege = {
					trigger_event = tour_grounds_events.1011
				}
			}
			50 = { #You fail
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
				}
				modifier = {
					factor = 0
					scope:rival_courtier = {
						is_imprisoned_by = root
					}
				}
				reverse_add_opinion = {
					target = scope:visiting_liege
					modifier = disappointed_opinion
					opinion = -5
				}
				add_prestige = minor_prestige_loss
			}
		}
		stress_impact = {
			paranoid = minor_stress_impact_gain
			craven = medium_stress_impact_gain
			compassionate = medium_stress_impact_gain
			forgiving = medium_stress_impact_gain
			just = medium_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -5
				has_trait = paranoid
			}
			modifier = {
				add = -10
				OR = {
					has_trait = craven
					has_trait = compassionate
					has_trait = forgiving
					has_trait = just
				}
			}
		}
	}

	option = { # Don't go ahead with it
		name = tour_grounds_events.1010.b
		trigger_event = { on_action = on_tour_grounds_vassal }
		stress_impact = {
			callous = medium_stress_impact_gain
			sadistic = medium_stress_impact_gain
			arrogant = medium_stress_impact_gain
			deceitful = medium_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -10
				OR = {
					has_trait = callous
					has_trait = sadistic
					has_trait = arrogant
					has_trait = deceitful
				}
			}
		}
	}
}
#Liege
tour_grounds_events.1011 = {
	type = activity_event
	title = tour_grounds_events.1011.title
	desc = tour_grounds_events.1011.desc

	theme = tour_grounds
	left_portrait = {
		character = root
		animation = scheme
	}
	right_portrait = {
		character = scope:rival_courtier
		animation = fear
		outfit_tags = { no_clothes }
	}

	option = { # Ride them around like a horse
		name = tour_grounds_events.1011.a
		reverse_add_opinion = {
			target = scope:rival_courtier
			modifier = humiliated_opinion
			opinion = -20
		}
		if = {
			limit = {
				scope:activity = {
					has_activity_option = {
						category = special_type
						option = tour_type_intimidation
					}
				}
			}
			increase_tour_success_effect = { POINTS = 1 }
		}
		stress_impact = {
			base = medium_stress_impact_loss
			compassionate = medium_stress_impact_gain
			forgiving = medium_stress_impact_gain
			just = medium_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -10
				OR = {
					has_trait = compassionate
					has_trait = forgiving
					has_trait = just
				}
			}
		}
	}

	option = { # Untie them and let them go
		name = tour_grounds_events.1011.b
		reverse_add_opinion = {
			target = scope:rival_courtier
			modifier = grateful_opinion
			opinion = 25
		}
		if = {
			limit = {
				scope:activity = {
					has_activity_option = {
						category = special_type
						option = tour_type_majesty
					}
				}
			}
			increase_tour_success_effect = { POINTS = 1 }
		}
		stress_impact = {
			callous = medium_stress_impact_gain
			sadistic = medium_stress_impact_gain
			arrogant = medium_stress_impact_gain
			deceitful = medium_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -10
				OR = {
					has_trait = callous
					has_trait = sadistic
					has_trait = arrogant
					has_trait = deceitful
				}
			}
		}
	}
}

#Vassal: you find a turnip that looks kind of like your liege. Show it off?
tour_grounds_events.1012 = {
	type = activity_event
	title = tour_grounds_events.1012.title
	desc = tour_grounds_events.1012.desc

	theme = tour_grounds
	left_portrait = {
		character = root
		animation = ecstasy
	}
	right_portrait = {
		character = scope:visiting_liege
		animation = personality_rational
	}

	trigger = {
		
		NOT = { exists = local_var:had_1012 }
		scope:visiting_liege = {
			is_available_adult = yes
		}
	}

	weight_multiplier = {
		base = 1
		modifier = {
			factor = 2
			scope:touring_grounds_scope.county = {
				development_level <= 2 
			}
		}
		modifier = {
			factor = 0.5
			scope:touring_grounds_scope.county = {
				development_level >= 5 
			}
		}
	}

	immediate = {
		set_local_variable = {
			name = had_1012
			value = yes
		}
		root.location = {
			select_root_vegetable_effect = yes
		}
	}

	option = { # I'm sure my liege will love it
		name = tour_grounds_events.1012.a

		show_as_tooltip = {
			random_list = {
				100 = {
					show_chance = no
					desc = tour_grounds_if_liege_is_impressed_tt
					add_prestige = minor_prestige_gain
					progress_towards_friend_effect = {
						CHARACTER = scope:visiting_liege
						OPINION = default_friend_opinion
						REASON = friend_gift
					}
				}
				100 = {
					show_chance = no
					desc = tour_grounds_if_liege_is_insulted_tt
					reverse_add_opinion = {
						target = scope:visiting_liege
						modifier = insulted_opinion
						opinion = -20
					}
				}
			}
		}
		hidden_effect = {
			scope:visiting_liege = { trigger_event = tour_grounds_events.1013 }
		}
		stress_impact = {
			generous = minor_stress_impact_loss
			deviant = minor_stress_impact_gain
			arrogant = minor_stress_impact_gain
		}
		if = {
			limit = {
				faith_is_aniconic_trigger = yes
			}
			stress_impact = {
				zealous = minor_stress_impact_gain
			}
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -10
				OR = {
					has_trait = greedy
					has_trait = deviant
					has_trait = arrogant
					AND = {
						faith_is_aniconic_trigger = yes
						has_trait = zealous
					}
				}
			}
		}
	}

	option = { # Have the turnip quietly disposed of
		name = tour_grounds_events.1012.b
		stress_impact = {
			greedy = minor_stress_impact_loss
			humble = minor_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -10
				OR = {
					has_trait = generous
					has_trait = humble
				}
			}
		}
	}

	option = { # Sell the turnip for money
		name = tour_grounds_events.1012.c
		trigger = {
			has_trait = greedy
		}
		add_gold = minor_gold_value
		stress_impact = {
			greedy = minor_stress_impact_loss
			humble = minor_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -10
				OR = {
					has_trait = generous
					has_trait = humble
				}
			}
		}
	}

	option = { # Keep the turnip for... personal use
		name = tour_grounds_events.1012.d
		trigger = {
			is_deviant_trigger = yes
			matching_gender_and_sexuality_trigger = {
				CHARACTER_1 = root
				CHARACTER_2 = scope:visiting_liege
			}
			scope:visiting_liege = {
				is_adult = yes
			}
		}
        create_artifact = {
			name = turnip_that_looks_like_liege
			description = turnip_that_looks_like_liege_description
			type = miscellaneous
			visuals = pouch
			modifier = artifact_fertility_gain_1_modifier
			save_scope_as = newly_created_artifact
		}
		scope:newly_created_artifact = {
			flag_as_trash_artifact = yes
		}
		stress_impact = {
			generous = medium_stress_impact_gain
			humble = medium_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -10
				OR = {
					has_trait = generous
					has_trait = humble
				}
			}
		}
	}
}

# Liege response event
tour_grounds_events.1013 = {
	type = activity_event
	title = tour_grounds_events.1013.title
	desc = tour_grounds_events.1013.desc

	theme = tour_grounds
	left_portrait = {
		character = root
		animation = personality_rational
	}
	right_portrait = {
		character = scope:stop_host_scope
		animation = ecstasy
	}

	option = { # Wow, I love it great thanks
		name = tour_grounds_events.1013.a
        create_artifact = {	
			name = turnip_that_looks_like_liege
			description = turnip_that_looks_like_liege_description
			type = miscellaneous
			visuals = pouch
			modifier = artifact_stress_gain_1_modifier
			save_scope_as = newly_created_artifact
		}
		scope:newly_created_artifact = {
			flag_as_trash_artifact = yes
		}
		scope:stop_host_scope = {
			send_interface_toast = {
				title = tour_grounds.liege_impressed
				left_icon = scope:visiting_liege
				right_icon = scope:stop_host_scope
				add_prestige = minor_prestige_gain
				reverse_add_opinion = {
					target = scope:visiting_liege
					modifier = grateful_opinion
					opinion = 25
				}
			}
		}
		stress_impact = {
			arrogant = minor_stress_impact_loss
			humble = minor_stress_impact_gain
		}
		if = {
			limit = {
				faith_is_aniconic_trigger = yes
			}
			stress_impact = {
				zealous = medium_stress_impact_gain
			}
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -10
				OR = {
					has_trait = humble
					AND = {
						faith_is_aniconic_trigger = yes
						has_trait = zealous
					}
				}
			}
		}
	}

	option = { # Have the turnip quietly disposed of
		name = tour_grounds_events.1013.b
		scope:stop_host_scope = {
			send_interface_toast = {
				title = tour_grounds.liege_insulted
				left_icon = scope:visiting_liege
				right_icon = scope:stop_host_scope
				reverse_add_opinion = {
					target = scope:visiting_liege
					modifier = insulted_opinion
					opinion = -20
				}
			}
		}
		stress_impact = {
			greedy = minor_stress_impact_loss
			forgiving = minor_stress_impact_gain
			compassionate = minor_stress_impact_gain
			arrogant = minor_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -10
				OR = {
					has_trait = generous
					has_trait = forgiving
					has_trait = compassionate
					has_trait = arrogant
				}
			}
		}
	}
}

# You hold a fake hunt for your liege
scripted_effect 1014_liege_impressed_effect = {
	add_prestige = minor_prestige_gain
	progress_towards_friend_effect = {
		CHARACTER = scope:visiting_liege
		REASON = friend_entertained
		OPINION = default_friend_opinion
	}
}
scripted_effect 1014_liege_insulted_effect = {
	reverse_add_opinion = {
		target = scope:visiting_liege
		modifier = insulted_opinion
		opinion = -25
	}
}

#Vassal
tour_grounds_events.1014 = {
	type = activity_event
	title = tour_grounds_events.1014.title
	desc = tour_grounds_events.1014.desc

	theme = tour_grounds
	left_portrait = {
		character = root
		animation = personality_rational
	}
	right_portrait = {
		character = scope:visiting_liege
		animation = happiness
	}

	trigger = {
		
		NOT = { exists = local_var:had_1014 }
		scope:visiting_liege = {
			is_available = yes
			is_adult = no
		}
	}

	immediate = {
		set_local_variable = {
			name = had_1014
			value = yes
		}
		select_local_animal_effect = { TYPE = prowling } # Save scope to limit possible animals: any/big/small/dangerous/harmless/prowling
	}

	option = { # I'm sure my liege will love it
		name = tour_grounds_events.1014.a
		show_as_tooltip = {
			random_list = {
				100 = {
					show_chance = no
					desc = tour_grounds_if_liege_is_impressed_tt
					1014_liege_impressed_effect = yes
				}
				100 = {
					show_chance = no
					desc = tour_grounds_if_liege_is_insulted_tt
					1014_liege_insulted_effect = yes
				}
			}
		}
		hidden_effect = {
			scope:visiting_liege = { trigger_event = tour_grounds_events.1015 }
		}
		stress_impact = {
			generous = minor_stress_impact_loss
			arrogant = minor_stress_impact_gain
			deceitful = minor_stress_impact_loss
			impatient = minor_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -10
				OR = {
					has_trait = greedy
					has_trait = arrogant
					has_trait = honest
					has_trait = impatient
				}
			}
		}
	}

	option = { # Don't do it
		name = tour_grounds_events.1014.b
		trigger_event = { on_action = on_tour_grounds_vassal }
		stress_impact = {
			generous = medium_stress_impact_gain
			humble = medium_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -10
				OR = {
					has_trait = generous
					has_trait = humble
				}
			}
		}
	}
}

#Liege
tour_grounds_events.1015 = {
	type = activity_event
	title = tour_grounds_events.1015.title
	desc = tour_grounds_events.1015.desc

	theme = tour_grounds
	left_portrait = {
		character = root
		animation = personality_rational
	}
	right_portrait = {
		character = scope:stop_host_scope
		animation = ecstasy
	}

	option = { # Play along
		name = tour_grounds_events.1015.a
		scope:stop_host_scope = {
			send_interface_toast = {
				title = tour_grounds.liege_impressed
				left_icon = scope:visiting_liege
				right_icon = scope:stop_host_scope
				1014_liege_impressed_effect = yes
			}
		}
		stress_impact = {
			humble = minor_stress_impact_loss
			arrogant = minor_stress_impact_gain
			deceitful = minor_stress_impact_loss
			rowdy = minor_stress_impact_gain
			craven = minor_stress_impact_loss
			bossy = minor_stress_impact_gain
		}
		if = {
			limit = {
				faith_is_aniconic_trigger = yes
			}
			stress_impact = {
				zealous = medium_stress_impact_gain
			}
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -10
				OR = {
					has_trait = arrogant
					has_trait = honest
					has_trait = rowdy
					has_trait = brave
					has_trait = bossy
				}
			}
		}
	}

	option = { # Refuse, and be belligerently angry
		name = tour_grounds_events.1015.b
		scope:stop_host_scope = {
			send_interface_toast = {
				title = tour_grounds.liege_insulted
				left_icon = scope:visiting_liege
				right_icon = scope:stop_host_scope
				1014_liege_insulted_effect = yes
			}
		}
		stress_impact = {
			shy = minor_stress_impact_gain
			pensive = minor_stress_impact_gain
			forgiving = minor_stress_impact_gain
			compassionate = minor_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -10
				OR = {
					has_trait = shy
					has_trait = pensive
					has_trait = forgiving
					has_trait = compassionate
				}
			}
		}
	}

	option = { # Demand a real beast to slay
		name = tour_grounds_events.1015.c
		scope:stop_host_scope = {
			send_interface_toast = {
				title = tour_grounds.liege_insulted
				left_icon = scope:visiting_liege
				right_icon = scope:stop_host_scope
				1014_liege_insulted_effect = yes
			}
		}
		trigger_event = tour_grounds_events.1016
		stress_impact = {
			arrogant = minor_stress_impact_loss
			craven = minor_stress_impact_gain
			shy = minor_stress_impact_gain
			pensive = minor_stress_impact_gain
			forgiving = minor_stress_impact_gain
			compassionate = minor_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -10
				OR = {
					has_trait = shy
					has_trait = pensive
					has_trait = forgiving
					has_trait = compassionate
					has_trait = craven
				}
			}
		}
	}
}

#Liege
tour_grounds_events.1016 = {
	type = activity_event
	title = tour_grounds_events.1016.title
	desc = tour_grounds_events.1016.desc

	theme = tour_grounds
	left_portrait = {
		character = root
		animation = personality_rational
	}
	right_portrait = {
		character = scope:stop_host_scope
		animation = ecstasy
	}

	option = { # Shoot!
		name = tour_grounds_events.1016.a
		duel = {
			skill = prowess
			value = decent_skill_rating
			50 = { # You manage to get em
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
				}
				send_interface_toast = {
					title = tour_grounds.killed_boar
					left_icon = root
					add_prestige = major_prestige_gain
					if = {
						limit = {
							this.dynasty.dynast ?= this
						}
						dynasty ?= { add_dynasty_prestige = minor_dynasty_prestige_gain }
					}
					create_artifact_animal_hide_effect = {
						OWNER = root
						HUNTER = root
						LEGENDARY = no
						ANIMAL = root.var:animal_type
					}
					if = {
						limit = {
							scope:activity = {
								has_activity_option = {
									category = special_type
									option = tour_type_intimidation
								}
							}
						}
						increase_tour_success_effect = { POINTS = 1 }
					}
					if = {
						limit = {
							scope:activity = {
								has_activity_option = {
									category = special_type
									option = tour_type_majesty
								}
							}
						}
						increase_tour_success_effect = { POINTS = 1 }
					}
				}
			}
			50 = { # You fail and get gored by a boar
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
				}
				send_interface_toast = {
					title = tour_grounds.mauled_by_boar
					left_icon = root
					add_prestige = minor_prestige_loss
					increase_wounds_effect = { REASON = wild_animal }
				}
			}
		}
		ai_chance = {
			base = 10
		}
	}
}


######################
## Liege Events
## 3000-5999
## by James Beaumont
######################

# Liege: Initial event informing the liege that their vassal-host has decided to let them in
tour_grounds_events.3001 = {
	type = activity_event
	title = tour_grounds_events.3001.title
	#CD note, we should aim to use a *lot* of triggered loc in these introductory events. The player is going to see them a lot of times, so the more variety and personality we can get across in the way you're greeted, the better.
	desc = {
		desc = tour_grounds_events.3001.desc.intro
		first_valid = {
			triggered_desc = {
				trigger = {
					scope:activity = {
						has_activity_option = { category = special_type option = tour_type_majesty }
					}
				}
				desc = tour_grounds_events.3001.desc.type.majesty
			}
			triggered_desc = {
				trigger = {
					scope:activity = {
						has_activity_option = { category = special_type option = tour_type_taxation }
					}
				}
				desc = tour_grounds_events.3001.desc.type.taxation
			}
			desc = tour_grounds_events.3001.desc.type.intimidation
		}
		first_valid = {
			triggered_desc = {
				trigger = {
					OR = {
						has_relation_rival = scope:stop_host_scope
						opinion = {
							target = scope:stop_host_scope
							value <= -25
						}
					}
				}
				desc = tour_grounds_events.3001.desc.mid.hates_vassal
			}
			triggered_desc = {
				trigger = { has_relation_lover = scope:stop_host_scope }
				desc = tour_grounds_events.3001.desc.mid.lover
			}
			triggered_desc = {
				trigger = { has_relation_friend = scope:stop_host_scope }
				desc = tour_grounds_events.3001.desc.mid.friend
			}
			triggered_desc = {
				trigger = {
					OR = {
						is_close_family_of = scope:stop_host_scope
						is_consort_of = scope:stop_host_scope
					}
				}
				desc = tour_grounds_events.3001.desc.mid.close_family
			}
			triggered_desc = {
				trigger = {
					exists = house
					scope:stop_host_scope.house ?= root.house
				}
				desc = tour_grounds_events.3001.desc.mid.house
			}
			triggered_desc = {
				trigger = { is_powerful_vassal_of = scope:stop_host_scope }
				desc = tour_grounds_events.3001.desc.mid.powerful_vassal
			}
			desc = tour_grounds_events.3001.desc.mid.default
		}
		desc = tour_grounds_events.3001.desc.mid
		desc = tour_grounds_events.3001.desc.outro
	}

	theme = tour_arrival
	window = tour_arrival_event
	
	left_portrait = {
		character = root
		triggered_animation = {
			trigger = {
				OR = {
					has_relation_rival = scope:stop_host_scope
					opinion = {
						target = scope:stop_host_scope
						value <= -25
					}
				}
			}
			animation = war_over_tie
		}
		triggered_animation = {
			trigger = {
				NOR = {
					has_relation_rival = scope:stop_host_scope
					opinion = {
						target = scope:stop_host_scope
						value <= -25
					}
				}
			}
			animation = happiness
		}
	}
	right_portrait = {
		character = scope:stop_host_scope
		animation = personality_honorable
	}

	immediate = {
		location.county.holder = {
			save_scope_as = stop_host_scope
		}
		location.barony = {
			save_scope_as = touring_grounds_scope
		}
		location.county = {
			save_scope_as = wilderness_scope
		}
		if = {
			limit = {
				root.location.county.holder = {
					OR = {
						has_relation_friend = root
						opinion = {
							target = root
							value >= low_positive_opinion
						}
					}
				}
			}
			play_arrival_music_effect = {
				WELCOME_LEVEL = welcome
			}
		}
		else = {
			play_arrival_music_effect = {
				WELCOME_LEVEL = neutral
			}
		}
	}

	option = { # Very good, begin activity
		name = tour_grounds_events.3001.a
		custom_tooltip = tour_grounds_begins_tt
		tour_distribute_control = {
			CAPITAL = minor_county_control_gain
			HELD_COUNTIES = minor_county_control_gain
			HELD_AND_VASSAL_COUNTIES = minor_county_control_gain
		}
		tour_generic_arrival_effect = yes
	}
}

# Liege: vassal shows off hunting skills
tour_grounds_events.3002 = {
	type = activity_event
	title = tour_grounds_events.3002.title
	desc = {
		desc = tour_grounds_events.3002.desc.intro
		first_valid = {
			triggered_desc = {
				trigger = {
					scope:stop_host_scope = {
						exists = var:1001_critical_success
					}
				}
				desc = tour_grounds_events.3002.desc.mid.crit
			}
			triggered_desc = {
				trigger = {
					scope:stop_host_scope = {
						exists = var:1001_success
					}
				}
				desc = tour_grounds_events.3002.desc.mid.succ
			}
			triggered_desc = {
				trigger = {
					scope:stop_host_scope = {
						exists = var:1001_failure
					}
				}
				desc = tour_grounds_events.3002.desc.mid.fail
			}
		}
		desc = tour_grounds_events.3002.desc.outro
	}

	theme = tour_grounds
	override_background = { reference = wilderness_activity }
	left_portrait = {
		character = root
		animation = admiration
	}
	right_portrait = {
		character = scope:stop_host_scope
		animation = hunting_shortbow_aim_arrow_default
	}

	trigger = {
		NOT = { exists = local_var:had_3002 }
		scope:stop_host_scope = {
			is_adult = yes
			is_healthy = yes
		}
	}

	immediate = {
		scope:stop_host_scope.capital_county = {
			save_scope_as = wilderness_scope
		}
		root = { save_scope_as = visiting_liege }
		set_local_variable = {
			name = had_3002
			value = yes
		}
	}

	option = { # I could do better!
		name = tour_grounds_events.3002.a
		duel = {
			skill = prowess
			target = scope:stop_host_scope
			50 = { #You outdo them in hunting
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
				}
				modifier = {
					factor = 2
					has_trait = lifestyle_hunter
				}
				
				custom_tooltip = {
					text = impressed_by_hunting_tt
					subject = scope:stop_host_scope
				}
				
				send_interface_toast = {
					title = impressed_by_hunting_tt
					left_icon = root
					right_icon = scope:stop_host_scope
					
					reverse_add_opinion = {
						target = scope:stop_host_scope
						modifier = impressed_opinion
						opinion = 20
					}
					add_prestige = medium_prestige_gain
					if = {
						limit = {
							this.dynasty.dynast ?= this
						}
						dynasty ?= { add_dynasty_prestige = minor_dynasty_prestige_gain }
					}
					if = {
						limit = {
							scope:activity = {
								has_activity_option = {
									category = special_type
									option = tour_type_majesty
								}
							}
						}
						increase_tour_success_effect = { POINTS = 1 }
					}
				}
			}
			50 = { #You embarass yourself
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
				}
				
				custom_tooltip = {
					text = not_very_impressed_by_hunting_tt
					subject = scope:stop_host_scope
				}
				
				send_interface_toast = {
					title = not_very_impressed_by_hunting_tt
					left_icon = root
					right_icon = scope:stop_host_scope
					
					reverse_add_opinion = {
						target = scope:stop_host_scope
						modifier = disappointed_opinion
						opinion = -5
					}
					add_prestige = minor_prestige_loss
				}
			}
		}
	}

	option = { # Something else perhaps
		name = tour_grounds_events.3002.b
		trigger_event = { on_action = on_tour_grounds_liege }
	}
}

#Liege spots a precariously positioned prey
tour_grounds_events.3003 = {
	type = activity_event
	title = tour_grounds_events.3003.title
	desc = {
		desc = tour_grounds_events.3003.desc.intro
		first_valid = {
			triggered_desc = {
				trigger = {
					OR = {
						prowess >= decent_skill_rating
						has_trait = lifestyle_hunter
					}
				}
				desc = tour_grounds_events.3003.desc.mid.high_skill
			}
			desc = tour_grounds_events.3003.desc.mid.low_skill
		}
		desc = tour_grounds_events.3003.desc.outro
	}

	theme = tour_grounds
	left_portrait = {
		character = root
		animation = personality_rational
	}

	trigger = {
		
		NOT = { exists = local_var:had_3003 }
	}

	immediate = {
		scope:stop_host_scope.capital_county = {
			save_scope_as = wilderness_scope
		}
		root = { save_scope_as = visiting_liege }
		set_local_variable = {
			name = had_3003
			value = yes
		}
	}

	option = { # I'm sure I can make it
		name = tour_grounds_events.3003.a
		duel = {
			skill = prowess
			value = decent_skill_rating
			50 = { # You manage to get em
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
				}
				modifier = {
					factor = 2
					has_trait = lifestyle_hunter
				}
				if = {
					limit = {
						scope:activity = {
							OR = {
								has_activity_option = {
									category = special_type
									option = tour_type_majesty
								}
								has_activity_option = {
									category = special_type
									option = tour_type_intimidation
								}
							}
						}
					}
					increase_tour_success_effect = { POINTS = 2 }
				}
				add_prestige = medium_prestige_gain
				if = {
					limit = {
						this.dynasty.dynast ?= this
					}
					dynasty ?= { add_dynasty_prestige = minor_dynasty_prestige_gain }
				}
				hidden_effect = { # Opportunity for vassal to show resentment/congratulate
					scope:stop_host_scope = { trigger_event = tour_grounds_events.3004 }
				}
			}
			50 = { # You fail and take a tumble
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
				}
				show_as_tooltip = {
					add_prestige = minor_prestige_loss
					increase_wounds_no_death_effect = { REASON = wild_animal }
				}
				hidden_effect = { # Opportunity for vassal to rescue their liege from injury
					scope:stop_host_scope = { trigger_event = tour_grounds_events.3006 }
				}
			}
		}
		stress_impact = {
			compassionate = minor_stress_impact_gain
			lazy = minor_stress_impact_gain
			humble = minor_stress_impact_gain
			craven = medium_stress_impact_gain
		}
	}

	option = { # Let's not risk it
		name = tour_grounds_events.3003.b
		if = {
			limit = {
				scope:activity = {
					OR = {
						has_activity_option = {
							category = special_type
							option = tour_type_majesty
						}
						has_activity_option = {
							category = special_type
							option = tour_type_intimidation
						}
					}
				}
			}
			increase_tour_success_effect = { POINTS = 1 }
		}
		stress_impact = {
			stubborn = minor_stress_impact_gain
			compassionate = minor_stress_impact_loss
			ambitious = medium_stress_impact_gain
			arrogant = medium_stress_impact_gain
			brave = medium_stress_impact_gain
		}
	}
}

#Vassal watches as liege slays some prey, congratulate or belittle
tour_grounds_events.3004 = {
	type = activity_event
	title = tour_grounds_events.3004.title
	desc = {
		desc = tour_grounds_events.3004.desc.intro
		desc = tour_grounds_events.3004.desc
	}

	theme = tour_grounds
	left_portrait = {
		character = root
		animation = personality_rational
	}
	right_portrait = {
		character = scope:visiting_liege
		animation = personality_bold
	}

	option = { # Congratulations, m'ladylord
		name = tour_grounds_events.3004.a
		reverse_add_opinion = {
			target = scope:visiting_liege
			modifier = flattered_opinion
			opinion = 10
		}
		hidden_effect = {
			set_variable = {
				name = 3004_congratulate
				days = 7
			}
		}
		stress_impact = {
			ambitious = minor_stress_impact_gain
			arrogant = minor_stress_impact_gain
			craven = minor_stress_impact_loss
			callous = minor_stress_impact_gain
			compassionate = minor_stress_impact_loss
			stubborn = minor_stress_impact_gain
			arbitrary = minor_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -10
				OR = {
					has_trait = ambitious
					has_trait = arrogant
					has_trait = brave
					has_trait = callous
					has_trait = sadistic
					has_trait = stubborn
					has_trait = arbitrary
				}
			}
			modifier = {
				add = 10
				has_relation_friend = scope:visiting_liege
			}
		}
	}

	option = { # Call your liege a show-off
		name = tour_grounds_events.3004.b
		reverse_add_opinion = {
			target = scope:visiting_liege
			modifier = insult_opinion
			opinion = -10
		}
		stress_impact = {
			content = minor_stress_impact_gain
			forgiving = minor_stress_impact_gain
			shy = medium_stress_impact_loss
			just = minor_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -10
				OR = {
					has_trait = content
					has_trait = forgiving
					has_trait = gregarious
					has_trait = just
				}
			}
			modifier = {
				add = -10
				has_relation_friend = scope:visiting_liege
			}
			modifier = {
				add = 10
				has_relation_rival = scope:visiting_liege
			}
			modifier = {
				add = 10
				has_relation_nemesis = scope:visiting_liege
			}
		}
	}

	after = {
		hidden_effect = {
			scope:visiting_liege = {
				trigger_event = tour_grounds_events.3005
			}
		}
	}
}

#Liege is given final outcome of the event
tour_grounds_events.3005 = {
	type = activity_event
	title = tour_grounds_events.3005.title
	desc = {
		desc = tour_grounds_events.3005.desc.intro
		first_valid = {
			triggered_desc = {
				trigger = {
					scope:stop_host_scope = {
						exists = var:3004_congratulate
					}
				}
				desc = tour_grounds_events.3005.desc.mid.congrats
			}
			desc = tour_grounds_events.3005.desc.mid.insult
		}
	}

	theme = tour_grounds
	left_portrait = {
		character = root
		animation = personality_honorable
	}
	right_portrait = {
		character = scope:stop_host_scope
		triggered_animation = {
			trigger = {
				scope:stop_host_scope = {
					exists = var:3004_congratulate
				}
			}
			animation = admiration
		}
		animation = anger
	}

	immediate = {
		show_as_tooltip = {
			add_prestige = medium_prestige_gain
			if = {
				limit = {
					this.dynasty.dynast ?= this
				}
				dynasty ?= { add_dynasty_prestige = minor_dynasty_prestige_gain }
			}
			if = {
				limit = {
					scope:stop_host_scope = {
						exists = var:3004_congratulate
					}
				}
				add_opinion = {
					target = scope:stop_host_scope
					modifier = flattered_opinion
					opinion = 10
				}
			}
			else = {
				add_opinion = {
					target = scope:stop_host_scope
					modifier = insult_opinion
					opinion = -10
				}
			}
		}
	}

	option = { # ok
		name = {
			text = {
				first_valid = {
					triggered_desc = {
						trigger = {
							scope:stop_host_scope = {
								exists = var:3004_congratulate
							}
						}
						desc = tour_grounds_events.3005.a
					}
					desc = tour_grounds_events.3005.a.bad
				}
			}
		}
		
		ai_chance = {
			base = 10
		}
	}
}

#Vassal watches as liege takes a tumble, save them?
tour_grounds_events.3006 = {
	type = activity_event
	title = tour_grounds_events.3006.title
	desc = {
		desc = tour_grounds_events.3004.desc.intro
		desc = tour_grounds_events.3006.desc
	}

	theme = tour_grounds
	left_portrait = {
		character = root
		animation = personality_rational
	}
	right_portrait = {
		character = scope:visiting_liege
		animation = personality_bold
	}

	option = { # Grab a hold of them!
		name = tour_grounds_events.3006.a
		duel = {
			skill = prowess
			value = decent_skill_rating
			50 = { # Grab them with no incident
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
				}
				modifier = {
					factor = 2
					has_trait = lifestyle_hunter
				}
			}
			50 = { # You fail and take a tumble
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
				}
				increase_wounds_no_death_effect = { REASON = wild_animal }
			}
		}
		show_as_tooltip = {
			progress_towards_friend_effect = {
				CHARACTER = scope:visiting_liege
				OPINION = default_friend_opinion
				REASON = friend_bonded_on_tour
			}
		}
		hidden_effect = {
			set_variable = {
				name = 3006_protected_liege_from_injury
				days = 7
			}
		}
		stress_impact = {
			ambitious = minor_stress_impact_gain
			arrogant = minor_stress_impact_gain
			callous = minor_stress_impact_gain
			compassionate = minor_stress_impact_loss
			craven = minor_stress_impact_gain
			arbitrary = minor_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -10
				OR = {
					has_trait = ambitious
					has_trait = arrogant
					has_trait = callous
					has_trait = sadistic
					has_trait = craven
					has_trait = arbitrary
				}
			}
			modifier = {
				add = 10
				has_relation_friend = scope:visiting_liege
			}
		}
	}

	option = { # Let them fall
		name = tour_grounds_events.3006.b
		show_as_tooltip = {
			reverse_add_opinion = {
				target = scope:visiting_liege
				modifier = angry_opinion
				opinion = -10
			}
			scope:visiting_liege = {
				increase_wounds_no_death_effect = { REASON = wild_animal }
			}
		}
		hidden_effect = {
			set_variable = {
				name = 3006_let_liege_fall
				days = 7
			}
		}
		stress_impact = {
			sadistic = minor_stress_impact_loss
			content = minor_stress_impact_gain
			forgiving = minor_stress_impact_gain
			shy = medium_stress_impact_loss
			just = minor_stress_impact_gain
			craven = minor_stress_impact_loss
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -10
				OR = {
					has_trait = content
					has_trait = forgiving
					has_trait = gregarious
					has_trait = just
				}
			}
			modifier = {
				add = -10
				has_relation_friend = scope:visiting_liege
			}
			modifier = {
				add = 10
				has_relation_rival = scope:visiting_liege
			}
			modifier = {
				add = 10
				has_relation_nemesis = scope:visiting_liege
			}
		}
	}

	option = { # Take the shot yourself!
		trigger = {
			OR = { # Would they be petty enough to do that?
				has_trait = sadistic
				has_trait = callous
				has_trait = arbitrary
				has_relation_rival = scope:visiting_liege
				has_relation_nemesis = scope:visiting_liege
			}
			OR = { # Would they have the skill to do that?
				has_trait = lifestyle_hunter
				prowess >= decent_skill_rating
			}
		}
		name = tour_grounds_events.3006.c
		add_prestige = medium_prestige_gain
		show_as_tooltip = {
			progress_towards_rival_effect = {
				CHARACTER = scope:visiting_liege
				OPINION = default_rival_opinion
				REASON = rival_humiliated
			}
			scope:visiting_liege = {
				increase_wounds_no_death_effect = { REASON = wild_animal }
			}
		}
		hidden_effect = {
			set_variable = {
				name = 3006_took_the_shot
				days = 7
			}
		}
		stress_impact = {
			arrogant = medium_stress_impact_loss
			content = medium_stress_impact_gain
			forgiving = medium_stress_impact_gain
			shy = medium_stress_impact_loss
			just = minor_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -10
				OR = {
					has_trait = content
					has_trait = forgiving
					has_trait = gregarious
					has_trait = just
				}
			}
			modifier = {
				add = -10
				has_relation_friend = scope:visiting_liege
			}
			modifier = {
				add = 10
				has_relation_rival = scope:visiting_liege
			}
			modifier = {
				add = 10
				has_relation_nemesis = scope:visiting_liege
			}
		}
	}

	after = {
		scope:visiting_liege = {
			trigger_event = tour_grounds_events.3007
		}
	}
}

#Liege is given final outcome of the event
tour_grounds_events.3007 = {
	type = activity_event
	title = tour_grounds_events.3007.title
	desc = {
		desc = tour_grounds_events.3007.desc.intro
		first_valid = {
			triggered_desc = {
				trigger = {
					scope:stop_host_scope = {
						exists = var:3006_protected_liege_from_injury
					}
				}
				desc = tour_grounds_events.3007.desc.mid.protected
			}
			triggered_desc = {
				trigger = {
					scope:stop_host_scope = {
						exists = var:3006_let_liege_fall
					}
				}
				desc = tour_grounds_events.3007.desc.mid.fell
			}
			triggered_desc = {
				trigger = {
					scope:stop_host_scope = {
						exists = var:3006_took_the_shot
					}
				}
				desc = tour_grounds_events.3007.desc.mid.took_the_shot
			}
		}
	}

	theme = tour_grounds
	left_portrait = {
		character = root
		animation = personality_honorable
	}
	right_portrait = {
		character = scope:stop_host_scope
		triggered_animation = {
			trigger = {
				scope:stop_host_scope = {
					exists = var:3004_congratulate
				}
			}
			animation = admiration
		}
		triggered_animation = {
			trigger = { always = yes }
			animation = anger
		}
	}

	immediate = {
		if = {
			limit = {
				scope:stop_host_scope = {
					exists = var:3006_protected_liege_from_injury
				}
			}
			progress_towards_friend_effect = {
				CHARACTER = scope:stop_host_scope
				OPINION = default_friend_opinion
				REASON = friend_bonded_on_tour
			}
		}
		else_if = {
			limit = {
				scope:stop_host_scope = {
					exists = var:3006_let_liege_fall
				}
			}
			add_opinion = {
				target = scope:stop_host_scope
				modifier = angry_opinion
				opinion = -10
			}
			increase_wounds_no_death_effect = { REASON = wild_animal }
		}
		else = {
			increase_wounds_no_death_effect = { REASON = wild_animal }
			progress_towards_rival_effect = {
				CHARACTER = scope:stop_host_scope
				OPINION = default_rival_opinion
				REASON = rival_humiliated
			}
		}
	}

	option = { # ok
		name = tour_grounds_events.3007.a
		ai_chance = {
			base = 10
		}
	}
}

# Liege: a group of children step in front of your horse
tour_grounds_events.3008 = {
	type = activity_event
	title = tour_grounds_events.3008.title
	desc = tour_grounds_events.3008.desc
	theme = tour_grounds
	left_portrait = {
		character = root
		animation = shock
	}
	right_portrait = {
		character = scope:trampled_child_scope
		animation = happiness
	}

	trigger = {
		NOT = { exists = local_var:had_3008 }
		scope:activity = {
			has_activity_option = {
				category = special_type
				option = tour_type_intimidation
			}
		}
	}

	weight_multiplier = {
		base = 1
	}

	immediate = {
		set_local_variable = {
			name = had_3008
			value = yes
		}
		random_list = {
			10 = { # Chance of trampling the host's child
				trigger = {
					scope:stop_host_scope = {
						any_child = {
							is_ai = yes
							child_not_infant_trigger = yes
							is_at_same_location = root
						}
					}
				}
				scope:stop_host_scope = {
					random_child = {
						limit = {
							is_ai = yes
							child_not_infant_trigger = yes
							is_at_same_location = root
						}
						save_scope_as = trampled_child_scope
					}
				}
			}
			50 = { # Chance of trampling a random noble child
				trigger = {
					OR = {
						any_pool_character = {
							province = scope:stop_host_scope.capital_province
							child_not_infant_trigger = yes
							is_at_same_location = root
							NOT = { is_child_of = root }
							is_lowborn = no
						}
						scope:stop_host_scope = {
							any_courtier = {
								child_not_infant_trigger = yes
								is_at_same_location = root
								NOT = { is_child_of = root }
								is_lowborn = no
							}
						}
					}
				}
				if = {
					limit = {
						scope:stop_host_scope = {
							any_courtier = {
								child_not_infant_trigger = yes
								is_at_same_location = root
								NOT = { is_child_of = root }
								is_lowborn = no
							}
						}
					}
					scope:stop_host_scope = {
						random_courtier = {
							limit = {
								child_not_infant_trigger = yes
								is_at_same_location = root
								NOT = { is_child_of = root }
								is_lowborn = no
							}
							save_scope_as = trampled_child_scope
						}
					}
				}
				else = {
					random_pool_character = {
						province = scope:stop_host_scope.capital_province
						limit = {
							child_not_infant_trigger = yes
							is_at_same_location = root
							NOT = { is_child_of = root }
							is_lowborn = no
						}
						save_scope_as = trampled_child_scope
					}
				}
			}
			50 = { # Chance of trampling a random peasant child
				create_character = {
					location = scope:stop_host_scope.capital_province
					culture = scope:stop_host_scope.capital_county.culture
					faith = scope:stop_host_scope.capital_county.faith
					template = peasant_child_character
					save_scope_as = trampled_child_scope
				}
			}
		}
	}

	option = { # Reel your horse back to avoid the child
		name = tour_grounds_events.3008.a
		duel = {
			skill = prowess
			value = decent_skill_rating
			50 = { #Succesfully avoid the kid
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
				}
				custom_tooltip = {
					text = 3007_avoid_hitting_child_tt
				}
				add_prestige = minor_prestige_gain
				if = {
					limit = {
						this.dynasty.dynast ?= this
					}
					dynasty ?= { add_dynasty_prestige = miniscule_dynasty_prestige_gain }
				}
				if = {
					limit = {
						scope:activity = {
							has_activity_option = {
								category = special_type
								option = tour_type_majesty
							}
						}
					}
					increase_tour_success_effect = { POINTS = 1 }
				}
			}
			50 = { #Avoid the kid but also fall off your horse
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
				}
				custom_tooltip = {
					text = 3007_fall_off_horse_tt
				}
				increase_wounds_effect = { REASON = horse_riding_accident }
			}
		}
		if = {
			limit = {
				scope:activity = {
					has_activity_option = {
						category = special_type
						option = tour_type_intimidation
					}
				}
			}
			decrease_tour_success_effect = { POINTS = 1 }
		}
		stress_impact = {
			arrogant = minor_stress_impact_gain
			compassionate = minor_stress_impact_loss
			callous = minor_stress_impact_gain
			calm = minor_stress_impact_loss
		}
		ai_chance = {
			base = 10
			modifier = {
				factor = 0
				OR = {
					has_trait = arrogant
					has_trait = sadistic
					has_trait = callous
				}
			}
		}
	}

	option = { # Trample the child
		name = tour_grounds_events.3008.b
		scope:activity = {
			add_activity_log_entry = {
				key = trampled_child_log
				tags = { good }
				character = scope:visiting_liege
				target = scope:trampled_child_scope
				root = {
					random_list = {
						10 = {
							scope:trampled_child_scope = {
								death = {
									killer = root
									death_reason = death_trampled_by_horse
								}
							}
						}
						90 = {
							scope:trampled_child_scope = {
								increase_wounds_effect = { REASON = trampled_by_horse }
							}
						}
					}
					add_dread = medium_dread_gain
					if = {
						limit = {
							scope:activity = {
								has_activity_option = {
									category = special_type
									option = tour_type_intimidation
								}
							}
						}
						increase_tour_success_effect = { POINTS = 1 }
					}
				}
			}
		}
		hidden_effect = {
			if = {
				limit = {
					scope:trampled_child_scope = {
						OR = {
							is_child_of = scope:stop_host_scope
							is_courtier_of = scope:stop_host_scope
						}
					}
				}
				scope:stop_host_scope = {
					trigger_event = tour_grounds_events.3009
				}
			}
		}
		if = {
			limit = {
				is_adult = no
				NAND = {
					OR = {
						has_trait = just
						has_trait = arbitrary
					}
					OR = {
						has_trait = greedy
						has_trait = generous
					}
					OR = {
						has_trait = callous
						has_trait = compassionate
						has_trait = sadistic
					}
				}
			}
			add_trait = callous
			if = {
				limit = {
					scope:teacher = {
						is_ai = yes
						OR = {
							has_trait = callous
							has_trait = sadistic
							has_trait = paranoid
						}
					}
				}
				scope:teacher = {
					if = {
						limit = {
							can_set_relation_friend_trigger = { CHARACTER = scope:child }
						}
						set_relation_friend = { reason = friend_took_lessons_to_heart target = scope:child }
					}
					add_opinion = {
						target = scope:child
						modifier = clever_child_opinion
					}
				}
			}
			
			if = {
				limit = {
					is_ai = yes
				}
				add_character_flag = callous
				random_relation = {
					type = guardian
					trigger_event = child_personality.7051
				}
			}
		}
		stress_impact = {
			sadistic = medium_stress_impact_loss
			callous = minor_stress_impact_loss
			base = minor_stress_impact_gain
			humble = minor_stress_impact_gain
			patient = minor_stress_impact_gain
			just = medium_stress_impact_gain
			forgiving = medium_stress_impact_gain
			generous = medium_stress_impact_gain
			calm = medium_stress_impact_gain
			compassionate = massive_stress_impact_gain
		}
		ai_chance = {
			base = 5
			modifier = {
				factor = 0
				OR = {
					has_trait = humble
					has_trait = patient
					has_trait = just
					has_trait = forgiving
					has_trait = generous
					has_trait = calm
					has_trait = compassionate
				}
			}
		}
	}
}

# Vassal: your liege just trampled a child in your court
tour_grounds_events.3009 = {
	type = activity_event
	title = tour_grounds_events.3009.title
	desc = {
		desc = tour_grounds_events.3009.desc.intro
		first_valid = {
			triggered_desc = {
				trigger = {
					scope:trampled_child_scope = {
						is_child_of = root
					}
				}
				desc = tour_grounds_events.3009.desc.mid.my_kid
			}
			desc = tour_grounds_events.3009.desc.mid.not_my_kid
		}
		first_valid = {
			triggered_desc = {
				trigger = {
					scope:trampled_child_scope = {
						is_child_of = root
						is_alive = no
					}
				}
				desc = tour_grounds_events.3009.desc.outro.my_kid_dead
			}
			triggered_desc = {
				trigger = {
					scope:trampled_child_scope = {
						NOT = { is_child_of = root }
						is_alive = no
					}
				}
				desc = tour_grounds_events.3009.desc.outro.not_my_kid_dead
			}
			desc = tour_grounds_events.3009.desc.outro.alive
		}
	}

	theme = tour_grounds
	left_portrait = {
		character = root
		animation = shock
	}
	right_portrait = {
		character = scope:visiting_liege
		animation = personality_vengeful
	}

	immediate = {
		show_as_tooltip = {
			if = {
				limit = {
					scope:trampled_child_scope = {
						is_alive = no
					}
				}
				scope:trampled_child_scope = {
					death = {
						killer = root
						death_reason = death_trampled_by_horse
					}
				}
			}
			else = {
				scope:trampled_child_scope = {
					increase_wounds_no_death_effect = { REASON = trampled_by_horse }
				}
			}
		}
	}

	option = { # What a monster
		name = {
			text = {
				first_valid = {
					triggered_desc = {
						trigger = {
							NOR = {
								has_trait = callous
								has_trait = sadistic
								scope:trampled_child_scope = {
									is_child_of = root
								}
							}
						}
						desc = tour_grounds_events.3009.a.callous
					}
					desc = tour_grounds_events.3009.a
				}
			}
		}
		if = {
			limit = {
				scope:trampled_child_scope = {
					is_child_of = root
				}
			}
			stress_impact = {
				vengeful = medium_stress_impact_gain
				wrathful = medium_stress_impact_gain
			}
		}
		ai_chance = {
			base = 10
			modifier = {
				factor = 0
				OR = {
					has_trait = vengeful
					has_trait = wrathful
				}
			}
		}
	}

	option = { # Swear your vengeance
		name = tour_grounds_events.3009.b
		trigger = {
			scope:trampled_child_scope = {
				is_child_of = root
			}
		}
		scope:visiting_liege = {
			send_interface_toast = {
				title = tour_grounds.trampled_child_nemesis
				left_icon = scope:visiting_liege
				right_icon = scope:stop_host_scope
				set_relation_nemesis = {
					target = scope:stop_host_scope
					reason = rival_killed_your_child
				}
			}
		}
		stress_impact = {
			vengeful = minor_stress_impact_loss
			craven = minor_stress_impact_gain
			forgiving = minor_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				factor = 0
				OR = {
					has_trait = forgiving
					has_trait = craven
				}
			}
			modifier = {
				add = 100
				scope:trampled_child_scope = {
					is_alive = no
				}
			}
		}
	}
}

# Your horse stumbles over a rock, kill it?
scripted_effect 3010_pay_for_horse_effect = {
	scope:stop_host_scope = {
		progress_towards_friend_effect = {
			CHARACTER = scope:visiting_liege
			REASON = friend_gift
			OPINION = default_friend_opinion
		}
	}
	scope:stop_host_scope = { remove_short_term_gold = minor_gold_value }
}

#Liege slays a horse
tour_grounds_events.3010 = {
	type = activity_event
	title = tour_grounds_events.3010.title
	desc = {
		desc = tour_grounds_events.3010.desc.intro
		first_valid = {
			triggered_desc = {
				trigger = {
					OR = {
						has_trait = irritable
						has_trait = wrathful
						has_trait = callous
						has_trait = sadistic
						has_trait = impatient
					}
				}
				desc = tour_grounds_events.3010.desc.mid.irritable
			}
			desc = tour_grounds_events.3010.desc.mid.calm
		}
		desc = tour_grounds_events.3010.desc.outro
	}
	cooldown = { years = 5 }

	theme = tour_grounds
	left_portrait = {
		character = root
		animation = shock
	}
	right_portrait = {
		character = scope:stop_host_scope
		animation = laugh
	}

	immediate = {
	}

	option = { # Kill it and buy a new one
		name = tour_grounds_events.3010.a
		if = {
			limit = {
				any_owned_story = {
					story_type = story_cycle_martial_lifestyle_warhorse
					exists = var:story_cycle_horse_name
				}
			}
			custom_tooltip = kill_warhorse_tt
			random_owned_story = {
				limit = { story_type = story_cycle_martial_lifestyle_warhorse }
				hidden_effect = { end_story = yes }
			}
			add_dread = medium_dread_gain
		}
		else = {
			custom_tooltip = kill_horse_tt
			add_dread = minor_dread_gain
		}
		show_as_tooltip = {
			random_list = {
				100 = {
					show_chance = no
					desc = tour_grounds_if_vassal_is_generous_tt
					3010_pay_for_horse_effect = yes
				}
				100 = {
					show_chance = no
					desc = tour_grounds_if_vassal_is_not_generous_tt
					remove_short_term_gold = minor_gold_value
				}
			}
		}
		hidden_effect = {
			scope:stop_host_scope = { trigger_event = tour_grounds_events.3011 }
		}
		reverse_add_opinion = {
			target = scope:stop_host_scope
			modifier = impressed_opinion
			opinion = 15
		}
		if = {
			limit = {
				scope:activity = {
					has_activity_option = {
						category = special_type
						option = tour_type_intimidation
					}
				}
			}
			increase_tour_success_effect = { POINTS = 1 }
		}
		add_prestige = medium_prestige_gain
		stress_impact = {
			irritable = minor_stress_impact_loss
			sadistic = minor_stress_impact_loss
			greedy = minor_stress_impact_loss
			wrathful = minor_stress_impact_loss
			just = minor_stress_impact_gain
			patient = medium_stress_impact_gain
			forgiving = medium_stress_impact_gain
			compassionate = medium_stress_impact_gain
			humble = medium_stress_impact_gain
			pensive = medium_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -10
				OR = {
					has_trait = generous
					has_trait = calm
					has_trait = just
					has_trait = patient
					has_trait = forgiving
					has_trait = compassionate
					has_trait = humble
					has_trait = pensive
				}
			}
			modifier = {
				add = -10
				short_term_gold < minor_gold_value
			}
		}
	}

	option = { # Let it go
		name = tour_grounds_events.3010.b
		if = {
			limit = {
				scope:activity = {
					has_activity_option = {
						category = special_type
						option = tour_type_intimidation
					}
				}
			}
			decrease_tour_success_effect = { POINTS = 1 }
		}
		stress_impact = {
			irritable = medium_stress_impact_gain
			sadistic = medium_stress_impact_gain
			callous = medium_stress_impact_gain
			arrogant = medium_stress_impact_gain
			vengeful = medium_stress_impact_loss
			rowdy = medium_stress_impact_loss
			bossy = medium_stress_impact_loss
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -10
				OR = {
					has_trait = irritable
					has_trait = sadistic
					has_trait = callous
					has_trait = arrogant
					has_trait = vengeful
					has_trait = rowdy
					has_trait = bossy
				}
			}
		}
	}
}

#Vassal reacts to liege killing their horse
tour_grounds_events.3011 = {
	type = activity_event
	title = tour_grounds_events.3011.title
	desc = {
		desc = tour_grounds_events.3011.desc.intro
		first_valid = {
			triggered_desc = {
				trigger = {
					scope:visiting_liege = {
						OR = {
							has_trait = irritable
							has_trait = wrathful
							has_trait = callous
							has_trait = sadistic
							has_trait = impatient
						}
					}
				}
				desc = tour_grounds_events.3011.desc.mid.irritable
			}
			desc = tour_grounds_events.3011.desc.mid.calm
		}
		desc = tour_grounds_events.3011.desc.outro
	}

	theme = tour_grounds
	left_portrait = {
		character = root
		animation = shock
	}
	right_portrait = {
		character = scope:visiting_liege
		animation = laugh
	}

	option = { # Pay for liege's horse
		name = tour_grounds_events.3011.a
		scope:visiting_liege = {
			send_interface_toast = {
				title = tour_grounds_3011.vassal_paid_for_new_horse
				left_icon = scope:visiting_liege
				right_icon = scope:stop_host_scope
				3010_pay_for_horse_effect = yes
			}
		}
		stress_impact = {
			arrogant = medium_stress_impact_gain
			vengeful = medium_stress_impact_loss
			rowdy = medium_stress_impact_loss
			bossy = medium_stress_impact_loss
			greedy = medium_stress_impact_loss
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -10
				OR = {
					has_trait = arrogant
					has_trait = vengeful
					has_trait = rowdy
					has_trait = bossy
					has_trait = greedy
				}
			}
			modifier = {
				add = -10
				short_term_gold < minor_gold_value
			}
		}
	}

	option = { # Don't pay for it
		name = tour_grounds_events.3011.b
		scope:visiting_liege = {
			send_interface_toast = {
				title = tour_grounds_3011.vassal_did_not_pay
				left_icon = scope:visiting_liege
				right_icon = scope:stop_host_scope
				remove_short_term_gold = minor_gold_value
				add_opinion = {
					target = scope:stop_host_scope
					modifier = disappointed_opinion
					opinion = -5
				}
			}
		}
		stress_impact = {
			generous = medium_stress_impact_gain
			craven = medium_stress_impact_gain
			humble = medium_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -10
				OR = {
					has_trait = generous
					has_trait = craven
					has_trait = humble
				}
			}
		}
	}
}

# You stumble upon some poachers, wanna kill em?
scripted_effect 3012_impressed_effect = {
	scope:visiting_liege = {
		reverse_add_opinion = {
			target = scope:stop_host_scope
			modifier = grateful_opinion
			opinion = 15
		}
		add_opinion = {
			target = scope:stop_host_scope
			modifier = flattered_opinion
			opinion = 15
		}
	}
	tour_distribute_control = {
		CAPITAL = minor_county_control_gain
		HELD_COUNTIES = minor_county_control_gain
		HELD_AND_VASSAL_COUNTIES = minor_county_control_gain
	}
	scope:touring_grounds_scope.county = {
		add_county_modifier = {
			modifier = locals_terrorised_modifier
			years = 15
		}
	}
}
scripted_effect 3012_horrified_effect = {
	scope:visiting_liege = {
		reverse_add_opinion = {
			target = scope:stop_host_scope
			modifier = scared_opinion
			opinion = -15
		}
		add_opinion = {
			target = scope:stop_host_scope
			modifier = insulted_opinion
			opinion = -15
		}
		add_dread = minor_dread_gain
	}
	tour_distribute_control = {
		CAPITAL = minor_county_control_gain
		HELD_COUNTIES = minor_county_control_gain
		HELD_AND_VASSAL_COUNTIES = minor_county_control_gain
	}
}

#Liege
tour_grounds_events.3012 = {
	type = activity_event
	title = tour_grounds_events.3012.title
	desc = {
		desc = tour_grounds_events.3012.desc.intro
		first_valid = {
			triggered_desc = {
				trigger = {
					OR = {
						has_trait = wrathful
						has_trait = callous
						has_trait = sadistic
					}
				}
				desc = tour_grounds_events.3012.desc.mid.sadistic
			}
			desc = tour_grounds_events.3012.desc.mid
		}
		desc = tour_grounds_events.3012.desc.outro
	}

	theme = tour_grounds
	override_background = { reference = wilderness_activity }
	left_portrait = {
		character = root
		animation = personality_bold
	}
	right_portrait = {
		character = scope:poacher_scope
		animation = scheme
	}
	cooldown = { years = 2 }

	immediate = {
		create_character = {
			location = scope:touring_grounds_scope.title_province
			template = generic_peasant_character
			culture = scope:touring_grounds_scope.culture
			faith = scope:touring_grounds_scope.faith
			save_scope_as = poacher_scope
		}
		scope:poacher_scope = {
			hidden_effect = { add_trait = lifestyle_hunter }
			make_criminal_effect = yes
		}
	}

	option = { # Kill them. Kill them now.
		name = tour_grounds_events.3012.a
		scope:activity = {
			add_activity_log_entry = {
				key = eliminated_poachers_log
				tags = { good }
				character = scope:visiting_liege
				target = scope:stop_host_scope
				root = {
					duel = {
						skill = prowess # TODO_CD_EP2, use caravan security rather than personal prowess
						target = scope:poacher_scope
						50 = { #You round them up and kill them
							compare_modifier = {
								value = scope:duel_value
								multiplier = 3.5
							}

							if = {
								limit = {
									scope:activity = {
										OR = {
											has_activity_option = {
												category = special_type
												option = tour_type_intimidation
											}
											has_activity_option = {
												category = special_type
												option = tour_type_taxation
											}
										}
									}
								}
								increase_tour_success_effect = { POINTS = 1 }
							}
							show_as_tooltip = {
								random_list = {
									100 = {
										show_chance = no
										desc = tour_grounds_if_vassal_is_impressed_tt
										3012_impressed_effect = yes
									}
									100 = {
										show_chance = no
										desc = tour_grounds_if_vassal_is_scared_tt
										3012_horrified_effect = yes
									}
								}
							}
							hidden_effect = {
								scope:stop_host_scope = { trigger_event = tour_grounds_events.3013 }
							}
						}
						50 = { #They manage to escape
							compare_modifier = {
								value = scope:duel_value
								multiplier = -3.5
							}
							increase_wounds_no_death_effect = { REASON = fight }
						}
					}
				}
			}
		}
		stress_impact = {
			irritable = minor_stress_impact_loss
			sadistic = minor_stress_impact_loss
			greedy = minor_stress_impact_loss
			wrathful = minor_stress_impact_loss
			patient = medium_stress_impact_gain
			forgiving = medium_stress_impact_gain
			compassionate = medium_stress_impact_gain
			pensive = medium_stress_impact_gain
			craven = major_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -10
				OR = {
					has_trait = generous
					has_trait = calm
					has_trait = patient
					has_trait = forgiving
					has_trait = compassionate
					has_trait = pensive
				}
			}
			modifier = {
				add = -10
				has_trait = craven
			}
			modifier = {
				add = 10
				OR = {
					has_trait = impatient
					has_trait = sadistic
				}
			}
		}
	}

	option = { # Let them off, for a fee
		name = tour_grounds_events.3012.b
		trigger = {
			has_trait = greedy
		}
		add_prestige = minor_prestige_loss
		add_gold = minor_gold_value
		reverse_add_opinion = {
			target = scope:stop_host_scope
			modifier = angry_opinion
			opinion = -5
		}
		if = {
			limit = {
				scope:activity = {
					has_activity_option = {
						category = special_type
						option = tour_type_taxation
					}
				}
			}
			increase_tour_success_effect = { POINTS = 1 }
		}
		stress_impact = {
			greedy = minor_stress_impact_loss
			wrathful = minor_stress_impact_loss
			just = minor_stress_impact_gain
			generous = major_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -10
				OR = {
					has_trait = generous
					has_trait = calm
					has_trait = just
				}
			}
			modifier = {
				add = 10
				has_trait = greedy
			}
		}
	}

	option = { # Ride on by
		name = tour_grounds_events.3012.c
		add_prestige = minor_prestige_loss
		stress_impact = {
			just = minor_stress_impact_gain
			irritable = medium_stress_impact_gain
			sadistic = medium_stress_impact_gain
			impatient = medium_stress_impact_gain
			brave = major_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -10
				OR = {
					has_trait = irritable
					has_trait = sadistic
					has_trait = impatient
					has_trait = just
					has_trait = brave
				}
			}
			modifier = {
				add = 10
				has_trait = craven
			}
		}
	}

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

#Vassal
tour_grounds_events.3013 = {
	type = activity_event
	title = tour_grounds_events.3013.title
	desc = tour_grounds_events.3013.desc
	theme = tour_grounds
	left_portrait = {
		character = root
		animation = shock
	}
	right_portrait = {
		character = scope:visiting_liege
		animation = personality_bold
	}

	option = { # Thanks for the bag of heads and hands, m'lord. Love it.
		name = tour_grounds_events.3013.a
		scope:visiting_liege = {
			send_interface_toast = {
				title = tour_grounds.vassal_impressed
				left_icon = scope:visiting_liege
				right_icon = scope:stop_host_scope
				3012_impressed_effect = yes
			}
		}
		stress_impact = {
			sadistic = minor_stress_impact_loss
			greedy = minor_stress_impact_loss
			wrathful = minor_stress_impact_loss
			patient = medium_stress_impact_gain
			forgiving = medium_stress_impact_gain
			compassionate = medium_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -10
				OR = {
					has_trait = generous
					has_trait = calm
					has_trait = patient
					has_trait = forgiving
					has_trait = compassionate
					has_trait = pensive
				}
			}
			modifier = {
				add = 10
				has_trait = sadistic
			}
		}
	}

	option = { # Chastise them
		name = tour_grounds_events.3013.b
		scope:visiting_liege = {
			send_interface_toast = {
				title = tour_grounds.vassal_horrified
				left_icon = scope:visiting_liege
				right_icon = scope:stop_host_scope
				3012_horrified_effect = yes
			}
		}
		scope:touring_grounds_scope.county = {
			add_county_modifier = { 
				modifier = chastised_tyrant_modifier
				years = 5
			}
		}
		stress_impact = {
			just = minor_stress_impact_gain
			irritable = medium_stress_impact_gain
			sadistic = medium_stress_impact_gain
			impatient = medium_stress_impact_gain
			brave = major_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -10
				OR = {
					has_trait = irritable
					has_trait = sadistic
					has_trait = impatient
					has_trait = just
					has_trait = brave
				}
			}
			modifier = {
				add = 10
				has_trait = craven
			}
		}
	}
}

# You count the windows in your vassal's holding and determine that they must pay a tax for each window
scripted_effect 3014_paid_tax_effect = {
	scope:visiting_liege = {
		reverse_add_opinion = {
			target = scope:stop_host_scope
			modifier = angry_opinion
			opinion = -10
		}
		add_opinion = {
			target = scope:stop_host_scope
			modifier = grateful_opinion
			opinion = 15
		}
	}
	scope:stop_host_scope = {
		pay_short_term_gold = {
			target = scope:visiting_liege
			gold = medium_gold_value
		}
	}
	tour_distribute_control = {
		CAPITAL = medium_county_control_gain
		HELD_COUNTIES = medium_county_control_gain
		HELD_AND_VASSAL_COUNTIES = 0
	}
	
}
scripted_effect 3014_refuse_to_pay_tax_effect = {
	scope:visiting_liege = {
		add_opinion = {
			target = scope:stop_host_scope
			modifier = tax_avoidance_crime
			opinion = -15
		}
	}
}

#Liege
tour_grounds_events.3014 = {
	type = activity_event
	title = tour_grounds_events.3014.title
	desc = tour_grounds_events.3014.desc
	theme = tour_grounds
	override_background = { reference = corridor_day }
	left_portrait = {
		character = root
		animation = personality_rational
	}

	trigger = {
		
		NOT = { exists = local_var:had_3014 }
	}

	weight_multiplier = {
		base = 1
		modifier = {
			factor = 2
			scope:touring_grounds_scope.county = {
				development_level >= 10
			}
		}
		modifier = {
			factor = 2
			scope:touring_grounds_scope.county = {
				development_level >= root.capital_county.development_level
			}
		}
		modifier = {
			factor = 2
			OR = {
				has_trait = greedy
				has_trait = arrogant
			}
		}
		modifier = {
			factor = 0.5
			scope:touring_grounds_scope.county = {
				development_level <= 5 
			}
		}
		# TODO_CD_EP2, weight up for tax tour
	}

	immediate = {
		set_local_variable = {
			name = had_3014
			value = yes
		}
	}

	option = { # Demand they pay... a window tax!
		name = tour_grounds_events.3014.a
		if = {
			limit = {
				scope:activity = {
					has_activity_option = {
						category = special_type
						option = tour_type_taxation
					}
				}
			}
			increase_tour_success_effect = { POINTS = 1 }
		}
		show_as_tooltip = {
			random_list = {
				100 = {
					show_chance = no
					desc = tour_grounds_if_vassal_accepts_tt
					3014_paid_tax_effect = yes
				}
				100 = {
					show_chance = no
					desc = tour_grounds_if_vassal_refuses_tt
					3014_refuse_to_pay_tax_effect = yes
				}
			}
		}
		hidden_effect = {
			scope:stop_host_scope = { trigger_event = tour_grounds_events.3015 }
		}
		stress_impact = {
			just = medium_stress_impact_gain
			forgiving = medium_stress_impact_gain
			compassionate = medium_stress_impact_gain
			pensive = medium_stress_impact_gain
			generous = major_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -10
				OR = {
					has_trait = just
					has_trait = forgiving
					has_trait = compassionate
					has_trait = pensive
					has_trait = generous
				}
			}
		}
	}

	option = { # Just let it go
		name = tour_grounds_events.3014.b
		stress_impact = {
			generous = minor_stress_impact_loss
			arbitrary = medium_stress_impact_gain
			arrogant = medium_stress_impact_gain
			greedy = major_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -10
				OR = {
					has_trait = arbitrary
					has_trait = arrogant
					has_trait = greedy
				}
			}
		}
	}
}

#Vassal
tour_grounds_events.3015 = {
	type = activity_event
	title = tour_grounds_events.3015.title
	desc = tour_grounds_events.3015.desc
	theme = tour_grounds
	left_portrait = {
		character = root
		animation = anger
	}
	right_portrait = {
		character = scope:visiting_liege
		animation = personality_rational
	}

	option = { # Pay the gosh darn window tax
		name = tour_grounds_events.3015.a
		scope:activity = {
			add_activity_log_entry = {
				key = window_tax_log
				tags = { good }
				character = scope:visiting_liege
				target = scope:stop_host_scope
				root = {
					send_interface_toast = {
						title = tour_grounds.vassal_paid_tax
						left_icon = scope:visiting_liege
						right_icon = scope:stop_host_scope
						3014_paid_tax_effect = yes
					}
				}
			}
		}
		stress_impact = {
			generous = minor_stress_impact_loss
			profligate = minor_stress_impact_loss
			vengeful = medium_stress_impact_gain
			arrogant = medium_stress_impact_gain
			greedy = major_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -10
				OR = {
					has_trait = vengeful
					has_trait = arrogant
					has_trait = greedy
				}
			}
			modifier = {
				add = -10
				short_term_gold < medium_gold_value
			}
		}
	}

	option = { # Refuse the tax
		name = tour_grounds_events.3015.b
		scope:visiting_liege = {
			duel = {
				skill = stewardship
				target = scope:stop_host_scope
				50 = { # You win the duel
					compare_modifier = {
						value = scope:duel_value
						multiplier = 3.5
					}
					send_interface_toast = {
						title = tour_grounds.vassal_refused_to_pay_tax
						left_icon = scope:visiting_liege
						right_icon = scope:stop_host_scope
						3014_refuse_to_pay_tax_effect = yes
					}
					hidden_effect = {
						scope:stop_host_scope = {
							send_interface_toast = {
								title = tour_grounds.vassal_won_tax_duel
								left_icon = scope:visiting_liege
								right_icon = scope:stop_host_scope
								show_as_tooltip = {
									3014_refuse_to_pay_tax_effect = yes
								}
							}
						}
					}
				}
				50 = { #They manage to evade taxation
					compare_modifier = {
						value = scope:duel_value
						multiplier = -3.5
					}
					send_interface_toast = {
						title = tour_grounds.vassal_won_tax_duel
						left_icon = scope:visiting_liege
						right_icon = scope:stop_host_scope
					}
					scope:stop_host_scope = {
						send_interface_toast = {
							title = tour_grounds.vassal_won_tax_duel
							left_icon = scope:visiting_liege
							right_icon = scope:stop_host_scope
						}
					}
				}
			}
		}
		stress_impact = {
			humble = medium_stress_impact_gain
			generous = major_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -10
				OR = {
					has_trait = humble
					has_trait = generous
				}
			}
		}
	}
}

# You carve your name into something that may or may not be sacred
scripted_effect 3016_sacred_carving_effect = {
	scope:visiting_liege = {
		if = {
			limit = {
				NOT = { scope:liege_lover_scope = scope:stop_host_scope }
			}
			reverse_add_opinion = {
				target = scope:liege_lover_scope
				modifier = flattered_opinion
				opinion = 15
			}
			reverse_add_opinion = {
				target = scope:stop_host_scope
				modifier = angry_opinion
				opinion = -10
			}
		}
		add_piety = medium_piety_loss
	}
	scope:touring_grounds_scope.county = {
		add_county_modifier = {
			modifier = sacred_site_vandalised_modifier
			years = 5
		}
	}
}
scripted_effect 3016_sacred_carving_take_blame_effect = {
	scope:stop_host_scope = {
		if = {
			limit = {
				can_add_hook = {
					target = scope:visiting_liege
					type = loyalty_hook
				}
			}
			add_hook = {
				type = loyalty_hook
				target = scope:visiting_liege
			}
		}
		else = {
			reverse_add_opinion = {
				target = scope:visiting_liege
				modifier = grateful_opinion
				opinion = 15
			}
		}
		add_piety = medium_piety_loss
	}
	scope:touring_grounds_scope.county = {
		add_county_modifier = {
			modifier = sacred_site_vandalised_modifier
			years = 5
		}
	}
}
scripted_effect 3016_non_sacred_carving_effect = {
	scope:visiting_liege = {
		reverse_add_opinion = {
			target = scope:liege_lover_scope
			modifier = flattered_opinion
			opinion = 15
		}
		if = {
			limit = {
				scope:activity = {
					has_activity_option = {
						category = special_type
						option = tour_type_majesty
					}
				}
			}
			increase_tour_success_effect = { POINTS = 1 }
		}
	}
	scope:touring_grounds_scope.county = {
		add_county_modifier = {
			modifier = kings_carving_modifier
			years = 5
		}
	}
}

#Liege
tour_grounds_events.3016 = {
	type = activity_event
	title = tour_grounds_events.3016.title
	desc = tour_grounds_events.3016.desc
	theme = tour_grounds
	left_portrait = {
		character = root
		animation = personality_rational
	}

	trigger = {
		NOT = { exists = local_var:had_3016 }
		any_relation = {
			type = lover
		}
		is_adult = yes
	}

	weight_multiplier = {
		base = 1
		modifier = {
			factor = 2
			scope:touring_grounds_scope = {
				faith = { has_doctrine_parameter = believes_in_harmony_with_nature_invisible }
			}
		}
		modifier = {
			factor = 2
			scope:touring_grounds_scope = {
				is_holy_site_of = faith
			}
		}
		modifier = {
			factor = 2
			scope:touring_grounds_scope.title_province = {
				is_wooded_trigger = yes
			}
		}
	}

	immediate = {
		set_local_variable = {
			name = had_3016
			value = yes
		}
		random_relation = {
			type = lover
			save_scope_as = liege_lover_scope
		}
	}

	option = { # Make the carving!
		name = tour_grounds_events.3016.a
		show_as_tooltip = {
			3016_non_sacred_carving_effect = yes
		}
		hidden_effect = {
			random_list = {
				50 = {
					3016_non_sacred_carving_effect = yes
				}
				50 = {
					scope:stop_host_scope = { trigger_event = tour_grounds_events.3017 }
				}
			}
		}
		stress_impact = {
			chaste = medium_stress_impact_gain
			humble = medium_stress_impact_gain
			shy = medium_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -10
				OR = {
					has_trait = chaste
					has_trait = humble
					has_trait = shy
				}
			}
		}
	}

	option = { # Don't
		name = tour_grounds_events.3016.b
		trigger_event = { on_action = on_tour_grounds_liege }
		stress_impact = {
			trusting = minor_stress_impact_gain
			lustful = medium_stress_impact_gain
			gregarious = medium_stress_impact_gain
			arrogant = medium_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -10
				OR = {
					has_trait = trusting
					has_trait = lustful
					has_trait = gregarious
					has_trait = arrogant
				}
			}
		}
	}
}

#Vassal
tour_grounds_events.3017 = {
	type = activity_event
	title = tour_grounds_events.3017.title
	desc = tour_grounds_events.3017.desc
	theme = tour_grounds
	left_portrait = {
		character = root
		animation = shock
	}
	right_portrait = {
		character = scope:visiting_liege
		animation = personality_rational
	}

	option = { # Chastise your liege
		name = tour_grounds_events.3017.a
		show_as_tooltip = { # Actually done in 3018
			3016_sacred_carving_effect = yes
		}
		hidden_effect = {
			set_variable = {
				name = 3016_blamed_liege
				days = 7
			}
		}
		stress_impact = {
			just = medium_stress_impact_gain
			deceitful = medium_stress_impact_gain
			shy = medium_stress_impact_gain
			humble = medium_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -10
				OR = {
					has_trait = just
					has_trait = deceitful
					has_trait = shy
					has_trait = humble
				}
			}
		}
	}

	option = { # Take the blame yourself
		name = tour_grounds_events.3017.b
		show_as_tooltip = { # Actually done in 3018
			3016_sacred_carving_take_blame_effect = yes
		}
		hidden_effect = {
			set_variable = {
				name = 3016_took_the_blame
				days = 7
			}
		}
		stress_impact = {
			deceitful = minor_stress_impact_loss
			gregarious = medium_stress_impact_gain
			arrogant = medium_stress_impact_gain
			callous = medium_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -10
				OR = {
					has_trait = honest
					has_trait = gregarious
					has_trait = arrogant
					has_trait = callous
				}
			}
		}
	}

	after = {
		hidden_effect = {
			scope:visiting_liege = {
				trigger_event = tour_grounds_events.3018
			}
		}
	}
}

#Liege
tour_grounds_events.3018 = {
	type = activity_event
	title = tour_grounds_events.3018.title
	desc = {
		desc = tour_grounds_events.3018.desc
		first_valid = {
			triggered_desc = {
				trigger = {
					scope:stop_host_scope = {
						exists = var:3016_took_the_blame
					}
				}
				desc = tour_grounds_events.3018.desc.outro.took_the_blame
			}
			triggered_desc = {
				trigger = {
					scope:stop_host_scope = {
						exists = var:3016_blamed_liege
					}
				}
				desc = tour_grounds_events.3018.desc.outro.blamed_liege
			}
		}
	}
	theme = tour_grounds
	left_portrait = {
		character = root
		animation = shock
	}
	right_portrait = {
		character = scope:stop_host_scope
		animation = personality_rational
	}

	immediate = {
		if = {
			limit = {
				scope:stop_host_scope = {
					exists = var:3016_took_the_blame
				}
			}
			3016_sacred_carving_take_blame_effect = yes
		}
		else_if = {
			limit = {
				scope:stop_host_scope = {
					exists = var:3016_blamed_liege
				}
			}
			3016_sacred_carving_effect = yes
		}
	}

	option = { # Basic response
		name = {
			text = {
				first_valid = {
					triggered_desc = {
						trigger = {
							scope:stop_host_scope = {
								exists = var:3016_took_the_blame
							}
						}
						desc = tour_grounds_events.3018.a.took_blame
					}
					triggered_desc = {
						trigger = {
							scope:stop_host_scope = {
								exists = var:3016_blamed_liege
							}
						}
						desc = tour_grounds_events.3018.a.was_blamed
					}
				}
			}
		}
	}
}

# Seek taxable extras
scripted_effect 3019_liege_tax_duel_effect = {
	scope:visiting_liege = {
		duel = {
			skill = stewardship
			target = scope:stop_host_scope
			50 = { # You win the duel
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
				}
				reverse_add_opinion = {
					target = scope:stop_host_scope
					modifier = angry_opinion
					opinion = -10
				}
				3019_liege_pay_tax_effect = yes
			}
			50 = { #They manage to evade taxation
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
				}
			}
		}
	}
}
scripted_effect 3019_liege_pay_tax_effect = {
	scope:activity = {
		add_activity_log_entry = {
			key = taxable_extras_log
			tags = { good }
			character = scope:visiting_liege
			target = scope:stop_host_scope
			scope:visiting_liege = {
				send_interface_toast = {
					title = tour_grounds.vassal_paid_tax
					left_icon = scope:visiting_liege
					right_icon = scope:stop_host_scope
					tour_distribute_control = {
						CAPITAL = minor_county_control_gain
						HELD_COUNTIES = minor_county_control_gain
						HELD_AND_VASSAL_COUNTIES = 0
					}
					scope:stop_host_scope = {
						send_interface_toast = {
							title = tour_grounds.vassal_paid_tax
							left_icon = scope:stop_host_scope
							right_icon = scope:visiting_liege
							pay_short_term_gold = {
								target = scope:visiting_liege
								gold = medium_gold_value
							}
						}
					}
					if = {
						limit = {
							scope:activity = {
								has_activity_option = {
									category = special_type
									option = tour_type_taxation
								}
							}
						}
						increase_tour_success_effect = { POINTS = 1 }
					}
				}
			}
		}
	}
}

#Liege
tour_grounds_events.3019 = {
	type = activity_event
	title = tour_grounds_events.3019.title
	desc = tour_grounds_events.3019.desc
	theme = tour_grounds
	left_portrait = {
		character = root
		animation = personality_rational
	}
	right_portrait = {
		character = scope:greedy_entourage_member
		animation = scheme
	}

	trigger = {
		
		NOT = { exists = local_var:had_3019 }
		is_adult = yes
	}

	weight_multiplier = {
		base = 1
		modifier = {
			factor = 1
			always = yes # TODO_CD_EP2, weigh up for taxation tour
		}
	}

	immediate = {
		set_local_variable = {
			name = had_3019
			value = yes
		}
		random_courtier = { # TODO_CD_EP2, grab an entourage member. Weigh up for greed/stewardship
			save_scope_as = greedy_entourage_member
		}
	}

	option = { # Tax the excess!
		name = tour_grounds_events.3019.a
		show_as_tooltip = { 3019_liege_tax_duel_effect = yes }
		hidden_effect = {
			scope:stop_host_scope = { trigger_event = tour_grounds_events.3020 }
		}
		stress_impact = {
			generous = medium_stress_impact_gain
			forgiving = medium_stress_impact_gain
			just = medium_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -10
				OR = {
					has_trait = generous
					has_trait = forgiving
					has_trait = just
				}
			}
		}
	}

	option = { # Let them off
		name = tour_grounds_events.3019.b
		reverse_add_opinion = {
			target = scope:stop_host_scope
			modifier = grateful_opinion
			opinion = 10
		}
		stress_impact = {
			forgiving = medium_stress_impact_loss
			arbitrary = medium_stress_impact_gain
			greedy = medium_stress_impact_gain
			arrogant = medium_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -10
				OR = {
					has_trait = vengeful
					has_trait = arbitrary
					has_trait = greedy
					has_trait = arrogant
				}
			}
		}
	}
}

#Vassal
tour_grounds_events.3020 = {
	type = activity_event
	title = tour_grounds_events.3020.title
	desc = tour_grounds_events.3020.desc
	theme = tour_grounds
	left_portrait = {
		character = root
		animation = personality_rational
	}
	right_portrait = {
		character = scope:visiting_liege
		animation = scheme
	}

	option = { # Attempt to avoid the tax
		name = tour_grounds_events.3020.a
		3019_liege_tax_duel_effect = yes
		stress_impact = {
			humble = medium_stress_impact_gain
			shy = medium_stress_impact_gain
			generous = medium_stress_impact_gain
			profligate = medium_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -10
				OR = {
					has_trait = humble
					has_trait = shy
					has_trait = generous
					has_trait = profligate
				}
			}
		}
	}

	option = { # Pay the tax
		name = tour_grounds_events.3020.b
		3019_liege_pay_tax_effect = yes
		reverse_add_opinion = {
			target = scope:visiting_liege
			modifier = grateful_opinion
			opinion = 10
		}
		stress_impact = {
			generous = minor_stress_impact_loss
			profligate = medium_stress_impact_loss
			forgiving = medium_stress_impact_loss
			greedy = medium_stress_impact_gain
			arrogant = medium_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				add = -10
				OR = {
					has_trait = vengeful
					has_trait = greedy
					has_trait = arrogant
				}
			}
		}
	}
}

#Some peasants are talking smack about your host
tour_grounds_events.3040 = {
	type = activity_event
	title = tour_grounds_events.3040.title
	desc = {
		desc = tour_grounds_events.3040.desc.intro
		random_valid = {
			triggered_desc = {
				trigger = {
					scope:stop_host_scope = {
						NOT = {
							knows_language_of_culture = root.location.county.culture
						}
					}
					scope:angry_peasant = { knows_language_of_culture = root.location.county.culture }
				}
				desc = tour_grounds_events.3040.desc.mid.wrong_language
			}
			triggered_desc = {
				trigger = {
					NOT = { scope:stop_host_scope.culture = root.location.county.culture }
					scope:angry_peasant.culture = root.location.county.culture 
				}
				desc = tour_grounds_events.3040.desc.mid.wrong_culture
			}
			triggered_desc = {
				trigger = {
					NOT = { scope:stop_host_scope.faith = root.location.county.faith }
					scope:angry_peasant.culture = root.location.county.faith
				}
				desc = tour_grounds_events.3040.desc.mid.wrong_faith
			}
			triggered_desc = {
				trigger = {
					scope:angry_peasant = { drinks_alcohol_trigger = yes }
				}
				desc = tour_grounds_events.3040.desc.mid.shit_beer
			}
			triggered_desc = {
				trigger = {
					scope:angry_peasant = { drinks_alcohol_trigger = no }
				}
				desc = tour_grounds_events.3040.desc.mid.shit_weed
			}
			desc = tour_grounds_events.3040.desc.mid.conscription
			desc = tour_grounds_events.3040.desc.mid.high_taxes
			desc = tour_grounds_events.3040.desc.mid.just_plain_dislike_em
		}
		desc = tour_grounds_events.3040.desc.outro
	}
	theme = tour_grounds
	override_background = { reference = tavern }
	cooldown = { years = 5 }
	left_portrait = {
		character = root
		animation = personality_rational
	}
	right_portrait = {
		character = scope:angry_peasant
		animation = anger
	}

	trigger = {
		is_adult = yes
	}

	weight_multiplier = {
		base = 1
		modifier = {
			add = 1
			scope:activity = {
				has_activity_option = {
					category = special_type
					option = tour_type_intimidation
				}
			}
		}
	}

	immediate = {
		hidden_effect = {
			if = {
				limit = {
					any_pool_character = {
						province = root.location
						is_available_ai_adult = yes
						is_lowborn = yes
						can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = scope:stop_host_scope }
					}
				}
				random_pool_character = {
					province = root.location
					limit = {
						is_available_ai_adult = yes
						is_lowborn = yes
						can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = scope:stop_host_scope }
					}
					weight = {
						base = 1
						modifier = {
							add = ai_boldness
						}
						modifier = {
							add = ai_vengefulness
						}
					}
					save_scope_as = angry_peasant
				}
			}
			else = {
				create_character = {
					location = root.location
					template = drunken_peasant_character
					culture = root.location.county.culture
					faith = root.location.county.faith
					save_scope_as = angry_peasant
				}
			}
			scope:angry_peasant = { add_trait = disloyal }
		}
	}

	option = { # Arrest these men!
		name = tour_grounds_events.3040.a
		add_dread = minor_dread_gain
		tour_distribute_control = {
			CAPITAL = minor_county_control_gain
			HELD_COUNTIES = 0
			HELD_AND_VASSAL_COUNTIES = 0
		}
		if = {
			limit = {
				scope:activity = {
					has_activity_option = {
						category = special_type
						option = tour_type_intimidation
					}
				}
			}
			increase_tour_success_effect = { POINTS = 1 }
		}
		progress_towards_friend_ai_effect = {
			CHARACTER = scope:stop_host_scope
			REASON = friend_defended_my_honor
			OPINION = default_friend_opinion
		}
		rightfully_imprison_character_effect = {
			TARGET = scope:angry_peasant
			IMPRISONER = root
		}
		stress_impact = {
			arbitrary = minor_stress_impact_loss
			just = minor_stress_impact_gain
			compassionate = minor_stress_impact_gain
		}
		ai_chance = {
			base = 10
			opinion_modifier = {
				who = root
				opinion_target = scope:stop_host_scope
				min = 0
				max = 10
				multiplier = 0.1
			}
			ai_value_modifier = {
				ai_vengefulness = 1
				ai_rationality = -0.5
			}
		}
	}

	option = { # I will fight for my vassal's honor!
		name = tour_grounds_events.3040.b
		duel = {
			skill = prowess
			target = scope:angry_peasant
			50 = { # You win the duel
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				send_interface_toast = {
					title = tour_grounds_events.3050.b.success
					tour_distribute_control = {
						CAPITAL = medium_county_control_gain
						HELD_COUNTIES = 0
						HELD_AND_VASSAL_COUNTIES = 0
					}
					root.location.county = {
						add_county_modifier = {
							modifier = liege_respected_fighter_modifier
							years = 10
						}
					}
				}
				if = {
					limit = {
						scope:activity = {
							has_activity_option = {
								category = special_type
								option = tour_type_intimidation
							}
						}
					}
					increase_tour_success_effect = { POINTS = 2 }
				}
				progress_towards_friend_ai_effect = {
					CHARACTER = scope:stop_host_scope
					REASON = friend_defended_my_honor
					OPINION = default_friend_opinion
				}
			}
			50 = { #They beat you
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				send_interface_toast = {
					title = tour_grounds_events.3050.b.failure
					increase_wounds_effect = { REASON = fight }
					add_prestige = minor_prestige_loss
				}
			}
		}
		stress_impact = {
			gallant = minor_stress_impact_loss
			brave = minor_stress_impact_loss
			arrogant = minor_stress_impact_loss
			craven = minor_stress_impact_gain
			patient = minor_stress_impact_gain
		}
		ai_chance = {
			base = 10
			opinion_modifier = {
				who = root
				opinion_target = scope:stop_host_scope
				min = 0
				max = 10
				multiplier = 0.1
			}
			ai_value_modifier = {
				ai_vengefulness = 1
				ai_boldness = 1
				ai_rationality = 0.5
			}
		}
	}

	option = { # Agree with them about your vassal being an idiot
		name = tour_grounds_events.3040.c
		progress_towards_friend_effect = {
			CHARACTER = scope:angry_peasant
			REASON = friend_defended_my_honor
			OPINION = default_friend_opinion
		}
		progress_towards_rival_ai_effect = {
			CHARACTER = scope:stop_host_scope
			REASON = rival_insulted_me
			OPINION = default_rival_opinion
		}
		stress_impact = {
			callous = minor_stress_impact_loss
			arbitrary = minor_stress_impact_loss
			vengeful = minor_stress_impact_loss
			compassionate = minor_stress_impact_gain
			forgiving = minor_stress_impact_gain
		}
		ai_chance = {
			base = 10
			opinion_modifier = {
				who = root
				opinion_target = scope:stop_host_scope
				min = 0
				max = 10
				multiplier = -0.1
			}
			ai_value_modifier = {
				ai_vengefulness = -0.5
				ai_boldness = 0.5
				ai_rationality = -0.5
			}
		}
	}
}

#Some neer-do-wells are roughing up a local
tour_grounds_events.3050 = {
	type = activity_event
	title = tour_grounds_events.3050.title
	desc = tour_grounds_events.3050.desc
	theme = tour_grounds
	override_background = { reference = market }
	cooldown = { years = 5 }
	left_portrait = {
		character = root
		triggered_animation = {
			trigger = { has_trait = craven }
			animation = fear
		}
		animation = personality_bold
	}
	right_portrait = {
		character = scope:angry_peasant
		animation = anger
	}
	lower_right_portrait = {
		character = scope:beaten_peasant
		animation = fear
	}

	trigger = {
		is_adult = yes
		root.location.county.county_control < 100
	}

	weight_multiplier = {
		base = 1
		modifier = {
			add = 1
			scope:activity = {
				has_activity_option = {
					category = special_type
					option = tour_type_intimidation
				}
			}
		}
	}

	immediate = {
		hidden_effect = {
			if = {
				limit = {
					any_pool_character = {
						province = root.location
						is_available_ai_adult = yes
						is_lowborn = yes
						can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = scope:stop_host_scope }
					}
				}
				random_pool_character = {
					province = root.location
					limit = {
						is_available_ai_adult = yes
						is_lowborn = yes
						can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = scope:stop_host_scope }
					}
					weight = {
						base = 1
						modifier = {
							add = ai_boldness
						}
						modifier = {
							add = ai_vengefulness
						}
					}
					save_scope_as = angry_peasant
				}
			}
			else = {
				create_character = {
					location = root.location
					template = peasant_character
					gender_female_chance = root_soldier_female_chance
					culture = root.location.county.culture
					faith = root.location.county.faith
					save_scope_as = angry_peasant
				}
				scope:angry_peasant = {
					add_character_flag = {
						flag = silently_disappear_me
						years = 1
					}
				}
			}
			if = {
				limit = {
					any_pool_character = {
						province = root.location
						is_ai = yes
						is_adult = yes
						is_lowborn = yes
						NOT = { this = scope:angry_peasant }
					}
				}
				random_pool_character = {
					province = root.location
					limit = {
						is_ai = yes
						is_adult = yes
						is_lowborn = yes
					}
					weight = {
						base = 1
						modifier = {
							add = ai_honor
						}
						modifier = {
							add = 10
							OR = {
								has_trait = humble
								has_trait = compassionate
								has_trait = physique_bad
								has_trait = shy
								has_trait = craven
							}
						}
						modifier = {
							add = {
								value = 0
								subtract = prowess
							}
						}
					}
					save_scope_as = beaten_peasant
				}
			}
			else = {
				create_character = {
					location = root.location
					template = peasant_character
					gender_female_chance = root_soldier_female_chance
					culture = root.location.county.culture
					faith = root.location.county.faith
					save_scope_as = beaten_peasant
				}
				scope:beaten_peasant = {
					add_character_flag = {
						flag = silently_disappear_me
						years = 1
					}
				}
			}
			scope:beaten_peasant = {
				increase_wounds_no_death_effect = {
					REASON = fight
				}
			}
		}
	}

	option = { # Arrest these men!
		name = tour_grounds_events.3050.a
		add_dread = minor_dread_gain
		tour_distribute_control = {
			CAPITAL = minor_county_control_gain
			HELD_COUNTIES = 0
			HELD_AND_VASSAL_COUNTIES = 0
		}
		root.location.county = {
			add_county_modifier = {
				modifier = clearing_crime_modifier
				years = 10
			}
		}
		if = {
			limit = {
				scope:activity = {
					has_activity_option = {
						category = special_type
						option = tour_type_majesty
					}
				}
			}
			increase_tour_success_effect = { POINTS = 1 }
		}
		rightfully_imprison_character_effect = {
			TARGET = scope:angry_peasant
			IMPRISONER = root
		}
		stress_impact = {
			arbitrary = minor_stress_impact_loss
			just = minor_stress_impact_gain
			compassionate = minor_stress_impact_gain
		}
		ai_chance = {
			base = 10
			ai_value_modifier = {
				ai_vengefulness = 1
				ai_rationality = -0.5
			}
		}
	}

	option = { # Have at you, I will defend this defenceless person!
		name = tour_grounds_events.3050.b
		duel = {
			skill = prowess
			target = scope:angry_peasant
			50 = { # You win the duel
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				send_interface_toast = {
					title = tour_grounds_events.3050.b.success
					tour_distribute_control = {
						CAPITAL = medium_county_control_gain
						HELD_COUNTIES = 0
						HELD_AND_VASSAL_COUNTIES = 0
					}
					root.location.county = {
						add_county_modifier = {
							modifier = liege_respected_fighter_modifier
							years = 10
						}
					}
				}
				if = {
					limit = {
						scope:activity = {
							has_activity_option = {
								category = special_type
								option = tour_type_majesty
							}
						}
					}
					increase_tour_success_effect = { POINTS = 2 }
				}
				progress_towards_friend_ai_effect = {
					CHARACTER = scope:beaten_peasant
					REASON = friend_defended_my_honor
					OPINION = default_friend_opinion
				}
			}
			50 = { #They manage to evade taxation
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				send_interface_toast = {
					title = tour_grounds_events.3050.b.failure
					increase_wounds_effect = { REASON = fight }
				}
			}
		}
		stress_impact = {
			gallant = minor_stress_impact_loss
			brave = minor_stress_impact_loss
			arrogant = minor_stress_impact_loss
			craven = minor_stress_impact_gain
			patient = minor_stress_impact_gain
		}
		ai_chance = {
			base = 10
			ai_value_modifier = {
				ai_vengefulness = 1
				ai_boldness = 1
				ai_rationality = 0.5
			}
		}
	}

	option = { # Beat em up yourself!
		name = tour_grounds_events.3050.c
		trigger = {
			has_trait = sadistic
		}
		scope:beaten_peasant = {
			increase_wounds_effect = {
				REASON = fight
			}
		}
		
		stress_impact = {
			sadistic = major_stress_impact_loss
			callous = minor_stress_impact_loss
			arbitrary = minor_stress_impact_loss
			compassionate = minor_stress_impact_gain
		}
		ai_chance = {
			base = 10
			ai_value_modifier = {
				ai_vengefulness = 1
				ai_boldness = 0.5
				ai_rationality = -0.5
			}
		}
	}

	after = {
		if = {
			limit = {
				is_ai = yes
			}
			# Silently disappear the characters if they were created as a result of this event
			if = {
				limit = {
					scope:beaten_peasant = {
						has_character_flag = silently_disappear_me
					}
				}
				scope:beaten_peasant = {
					silent_disappearance_effect = yes
				}
			}
			if = {
				limit = {
					scope:angry_peasant = {
						has_character_flag = silently_disappear_me
					}
				}
				scope:angry_peasant = {
					silent_disappearance_effect = yes
				}
			}
		}
	}
}

#Your vassal has some cool stationed MaA, micromanage them?
tour_grounds_events.3060 = {
	type = activity_event
	title = tour_grounds_events.3060.title
	# TODO_CD_EP2, update this to use the actual type of MaA types as soon as they're a scope
	desc = {
		desc = tour_grounds_events.3060.desc.intro
		first_valid = {
			triggered_desc = {
				trigger = {
					root.location = {
						OR = {
							has_stationed_regiment_of_base_type = skirmishers
							has_stationed_regiment_of_base_type = pikemen
						}
					}
				}
				desc = tour_grounds_events.3060.desc.light_infantry
			}
			triggered_desc = {
				trigger = {
					root.location = { has_stationed_regiment_of_base_type = archers }
				}
				desc = tour_grounds_events.3060.desc.archers
			}
			triggered_desc = {
				trigger = {
					root.location = { has_stationed_regiment_of_base_type = heavy_infantry }
				}
				desc = tour_grounds_events.3060.desc.heavy_infantry
			}
			triggered_desc = {
				trigger = {
					root.location = {
						OR = {
							has_stationed_regiment_of_base_type = light_cavalry
							has_stationed_regiment_of_base_type = heavy_cavalry
							has_stationed_regiment_of_base_type = archer_cavalry
						}
					}
				}
				desc = tour_grounds_events.3060.desc.cavalry
			}
			triggered_desc = {
				trigger = {
					root.location = { has_stationed_regiment_of_base_type = camel_cavalry }
				}
				desc = tour_grounds_events.3060.desc.camel_cavalry
			}
			triggered_desc = {
				trigger = {
					root.location = { has_stationed_regiment_of_base_type = elephant_cavalry }
				}
				desc = tour_grounds_events.3060.desc.elephant_cavalry
			}
		}
		desc = tour_grounds_events.3060.desc.outro
	}
	theme = tour_grounds
	override_background = { reference = armory }
	cooldown = { years = 5 }
	left_portrait = {
		character = root
		animation = admiration
	}
	right_portrait = {
		character = scope:stop_host_scope
		animation = personality_bold
	}
	trigger = {
		root.location = { has_stationed_regiment = yes }
	}

	option = { # Send em in to hunt down bandits!
		name = tour_grounds_events.3060.a
		trigger = {
			root.location.county = { county_control < 100 }
		}
		tour_distribute_control = {
			CAPITAL = minor_county_control_gain
			HELD_COUNTIES = minor_county_control_gain
			HELD_AND_VASSAL_COUNTIES = 0
		}
		root.location.county.holder = {
			every_held_title = {
				custom = every_title_held_by_vassal
				limit = {
					tier = tier_county
				}
				add_county_modifier = {
					modifier = clearing_crime_modifier
					years = 15
				}
			}
		}
		increase_tour_success_effect = { POINTS = 1 }
		stress_impact = {
			arbitrary = minor_stress_impact_loss
			vengeful = minor_stress_impact_loss
			just = minor_stress_impact_loss
			compassionate = minor_stress_impact_gain
			forgiving = minor_stress_impact_gain
		}
		ai_chance = {
			base = 10
			ai_value_modifier = {
				ai_vengefulness = 1
				ai_rationality = -0.5
			}
		}
	}

	option = { # Hmm, these guys could be run much more efficiently
		name = tour_grounds_events.3060.b
		duel = {
			skills = { stewardship martial }
			value = high_skill_rating
			50 = { # You win the duel
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				if = {
					limit = {
						OR = {
							scope:activity = {
								has_activity_option = {
									category = special_type
									option = tour_type_majesty
								}
							}
							scope:activity = {
								has_activity_option = {
									category = special_type
									option = tour_type_taxation
								}
							}
						}
					}
					increase_tour_success_effect = { POINTS = 2 }
				}
				scope:visiting_liege = {
					send_interface_toast = {
						title = tour_grounds_events.3060.b.success
						add_gold = minor_gold_value
						scope:stop_host_scope = {
							send_interface_toast = {
								title = tour_grounds_events.3060.b.vassal
								scope:activity = {
									add_activity_log_entry = {
										key = maa_managed_log
										tags = { good }
										character = scope:visiting_liege
										target = scope:stop_host_scope
										scope:stop_host_scope = {
											add_character_modifier = {
												modifier = general_maa_learning
												years = 15
											}
										}
									}
								}
							}
						}
					}
				}
				progress_towards_friend_ai_effect = {
					CHARACTER = scope:stop_host_scope
					REASON = friend_helped_me
					OPINION = default_friend_opinion
				}
			}
			50 = { #They manage to evade taxation
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				scope:visiting_liege = {
					send_interface_toast = {
						title = tour_grounds_events.3060.b.failure
						scope:stop_host_scope = {
							send_interface_toast = {
								title = tour_grounds_events.3060.b.vassal
								scope:activity = {
									add_activity_log_entry = {
										key = maa_mismanaged_log
										tags = { bad }
										character = scope:visiting_liege
										target = scope:stop_host_scope
										scope:stop_host_scope = {
											add_character_modifier = {
												modifier = liege_bad_micromanagement
												years = 15
											}
										}
									}
								}
							}
						}
					}
				}
				progress_towards_rival_ai_effect = {
					CHARACTER = scope:stop_host_scope
					REASON = rival_incompetence
					OPINION = default_rival_opinion
				}
			}
		}
		stress_impact = {
			gallant = minor_stress_impact_loss
			brave = minor_stress_impact_loss
			avaricious = minor_stress_impact_loss
			arrogant = minor_stress_impact_loss
			trusting = minor_stress_impact_gain
			paranoid = minor_stress_impact_gain
			humble = minor_stress_impact_gain
		}
		ai_chance = {
			base = 10
			ai_value_modifier = {
				ai_vengefulness = 1
				ai_boldness = 1
				ai_rationality = 0.5
			}
		}
	}

	option = { # Fascinating, I will learn all about them!
		name = tour_grounds_events.3060.c
		if = {
			limit = {
				root.location = {
					OR = {
						has_stationed_regiment_of_base_type = skirmishers
						has_stationed_regiment_of_base_type = pikemen
					}
				}
			}
			add_character_modifier = {
				modifier = skirmisher_learnings
				years = 25
			}
		}
		else_if = {
			limit = {
				root.location = { has_stationed_regiment_of_base_type = archers }
			}
			add_character_modifier = {
				modifier = archers_learnings
				years = 25
			}
		}
		else_if = {
			limit = {
				root.location = { has_stationed_regiment_of_base_type = heavy_infantry }
			}
			add_character_modifier = {
				modifier = heavy_infantry_learnings
				years = 25
			}
		}
		else_if = {
			limit = {
				root.location = {
					OR = {
						has_stationed_regiment_of_base_type = light_cavalry
						has_stationed_regiment_of_base_type = heavy_cavalry
						has_stationed_regiment_of_base_type = archer_cavalry
						has_stationed_regiment_of_base_type = camel_cavalry
						has_stationed_regiment_of_base_type = elephant_cavalry
					}
				}
			}
			add_character_modifier = {
				modifier = cavalry_learnings
				years = 25
			}
		}
		ai_chance = {
			base = 10
			modifier = {
				factor = 0
				number_of_maa_regiments >= 4 # TODO_CD_EP2, there doesn't seem to be a way to check the MaA limit
			}
			ai_value_modifier = {
				ai_rationality = 1
			}
		}
	}

	option = { # I bet I could apply these ideas to my own MaA back home
		name = tour_grounds_events.3060.d
		trigger = {
			has_trait = avaricious
		}
		add_character_modifier = {
			modifier = general_maa_learning
			years = 25
		}
		add_stewardship_lifestyle_perk_points = 1
		ai_chance = {
			base = 10
			ai_value_modifier = {
				ai_rationality = 1
				ai_greed = 1
			}
		}
	}
}



# You spot a treasure map
tour_grounds_events.3030 = {
	type = activity_event
	title = tour_grounds_events.3030.title
	desc = tour_grounds_events.3030.desc

	theme = tour_grounds
	override_background = { reference = market_scope }
	left_portrait = {
		character = root
		animation = lantern
	}

	trigger = {
		is_ai = no
		NOT = {
			exists = var:had_event_tour_grounds_3130
		}
		OR = {
			any_owned_story = {
				story_type = story_cycle_mysterious_journal
				exists = var:mysterious_journal
				var:mysterious_journal = {
					NOT = {
						exists = var:secret_cipher
					}
				}
			}
			scope:stop_host_scope = {
				is_ai = yes
				is_adult = yes
				has_trait = education_intrigue
				OR = {
					has_trait = paranoid
					has_trait = schemer
					intrigue >= high_skill_rating
				}
				NOT = {
					has_trait = cynical
					has_trait = zealous
				}
			}
		}
	}

	option = { # I will investigate...
		name = tour_grounds_events.3030.a
		duel = {
			skill = intrigue
			value = high_skill_rating
			50 = { # You follow the map to its location
				compare_modifier = {
					value = scope:duel_value
					multiplier = 0.5
				}
				custom_tooltip = you_progress_deeper_tt
				hidden_effect = {
					trigger_event = tour_grounds_events.3031
				}
			}
			50 = { # You fail
				compare_modifier = {
					value = scope:duel_value
					multiplier = -0.5
				}
				send_interface_toast = {
					title = tour_grounds_events.3030.got_lost
					left_icon = root
					add_character_modifier = {
						modifier = totally_lost_modifier
						years = 5
					}
				}
			}
		}
		stress_impact = {
			trusting = medium_stress_impact_gain
			humble = medium_stress_impact_gain
			honest = medium_stress_impact_gain
			lazy = medium_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				factor = 0
				OR = {
					has_trait = trusting
					has_trait = humble
					has_trait = honest
					has_trait = lazy
				}
			}
			ai_value_modifier = {
				ai_boldness = 1
				ai_compassion = -0.2
			}
		}
	}

	option = { # I will trust that my vassal isn't hiding anything
		name = tour_grounds_events.3030.b
		if = {
			limit = {
				NOT = {
					has_trait = paranoid
				}
			}
			add_character_modifier = {
				modifier = well_rested_modifier
				years = 5
			}
		}
		stress_impact = {
			cynical = minor_stress_impact_gain
			arrogant = minor_stress_impact_gain
			stubborn = minor_stress_impact_gain
			ambitious = medium_stress_impact_gain
			paranoid = medium_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				factor = 0
				OR = {
					has_trait = ambitious
					has_trait = paranoid
				}
			}
			ai_value_modifier = {
				ai_boldness = -1
			}
		}
	}

	after = {
		if = {
			limit = {
				NOT = {
					owns_story_of_type = story_cycle_mysterious_journal
				}
			}
			set_variable = {
				name = had_event_tour_grounds_3130
				years = 100
			}
		}
	}
}

# You find a clearing in the woods covered in recently dug-up soil
scripted_effect tour_grounds_3131_find_the_stash_effect = {
	random_list = {
		10 = {
			trigger_event = tour_grounds_events.3032
		}
	}
}

tour_grounds_events.3031 = {
	type = activity_event
	title = tour_grounds_events.3031.title
	desc = tour_grounds_events.3031.desc

	theme = tour_grounds
	override_background = { reference = battlefield }
	left_portrait = {
		character = root
		animation = lantern
	}

	option = { # I can solve it!
		name = tour_grounds_events.3031.a
		duel = {
			skill = martial
			value = high_skill_rating
			50 = { # You find the right spot to dig up
				compare_modifier = {
					value = scope:duel_value
					multiplier = 0.5
				}
				custom_tooltip = you_progress_deeper_tt
				hidden_effect = {
					tour_grounds_3131_find_the_stash_effect = yes
				}
			}
			50 = { # You fail
				compare_modifier = {
					value = scope:duel_value
					multiplier = -0.5
				}
				send_interface_toast = {
					title = tour_grounds_events.3031.fail_to_get_it_open
					left_icon = root
				}
			}
		}
		add_character_modifier = {
			modifier = tour_sleep_deprived_modifier
			years = 5
		}
		stress_impact = {
			impatient = medium_stress_impact_gain
			lazy = medium_stress_impact_gain
			wrathful = medium_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				factor = 0
				OR = {
					has_trait = impatient
					has_trait = lazy
					has_trait = wrathful
				}
			}
			ai_value_modifier = {
				ai_boldness = 1
			}
		}
	}

	option = { # Dig everywhere!!
		name = tour_grounds_events.3031.b
		duel = {
			skill = prowess
			value = very_high_skill_rating
			50 = { # You brute force your way into digging up the entire area
				compare_modifier = {
					value = scope:duel_value
					multiplier = 0.5
				}
				custom_tooltip = you_progress_deeper_tt
				hidden_effect = {
					tour_grounds_3131_find_the_stash_effect = yes
				}
			}
			50 = { # You fail
				compare_modifier = {
					value = scope:duel_value
					multiplier = -0.5
				}
				send_interface_toast = {
					title = tour_grounds_events.3031.fail_to_get_it_open
					left_icon = root
				}
			}
		}
		add_character_modifier = {
			modifier = tour_sleep_deprived_modifier
			years = 5
		}
		stress_impact = {
			patient = medium_stress_impact_gain
			scholar = medium_stress_impact_gain
			diligent = medium_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				factor = 0
				OR = {
					has_trait = patient
					has_trait = scholar
					has_trait = diligent
				}
			}
			ai_value_modifier = {
				ai_boldness = 1
			}
		}
	}

	option = { # Screw this, I'm going back to bed
		name = tour_grounds_events.3031.c
		add_character_modifier = {
			modifier = well_rested_modifier
			years = 5
		}
		stress_impact = {
			lazy = minor_stress_impact_loss
			patient = minor_stress_impact_gain
			diligent = minor_stress_impact_gain
			stubborn = minor_stress_impact_gain
			wrathful = minor_stress_impact_gain
			paranoid = minor_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				factor = 0
				OR = {
					has_trait = patient
					has_trait = diligent
					has_trait = stubborn
					has_trait = wrathful
					has_trait = paranoid
				}
			}
			ai_value_modifier = {
				ai_boldness = -1
			}
		}
	}
}

# You find the secret journal #3
tour_grounds_events.3032 = {
	type = activity_event
	title = tour_grounds_events.3032.title
	desc = tour_grounds_events.3032.desc

	theme = tour_grounds
	override_background = { reference = battlefield }
	left_portrait = {
		character = root
		animation = shock
	}
	artifact = {
		target = scope:journal_artifact
		position = lower_right_portrait
	}

	immediate = {
		if = {
			limit = {
				NOT = {
					any_owned_story = {
						story_type = story_cycle_mysterious_journal
					}
				}
			}
			create_artifact = {
				name = artifact_secret_journal_name
				description = artifact_secret_cipher_description
				type = miscellaneous
				visuals = book
				wealth = 10
				quality = 10
				modifier = artifact_stress_gain_1_penalty_modifier
				save_scope_as = journal_artifact
			}
		}
		else = {
			random_owned_story = {
				limit = {
					story_type = story_cycle_mysterious_journal
				}
				var:mysterious_journal = {
					save_scope_as = journal_artifact
				}
			}
		}
		scope:journal_artifact = {
			set_variable = {
				name = secret_cipher
			}
		}
		increase_tour_success_effect = { POINTS = 1 }
	}

	option = { # What could it mean? Take the journal
		name = tour_grounds_events.3032.a
		trigger = {
			NOT = {
				any_owned_story = {
					story_type = story_cycle_mysterious_journal
				}
			}
		}
		hidden_effect = {
			create_story = story_cycle_mysterious_journal
			random_owned_story = {
				limit = {
					story_type = story_cycle_mysterious_journal
				}
				set_variable = {
					name = mysterious_journal
					value = scope:journal_artifact
				}
			}
		}
		stress_impact = {
			honest = medium_stress_impact_gain
			paranoid = medium_stress_impact_gain
			trusting = medium_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				factor = 0
				OR = {
					has_trait = honest
					has_trait = paranoid
					has_trait = trusting
				}
			}
		}
	}

	option = { # The mystery grows deeper
		name = tour_grounds_events.3032.b
		trigger = {
			# You have only one part of the puzzle
			any_character_artifact = {
				OR = {
					exists = var:secret_journal
					exists = var:secret_puzzle
				}
			}
			# But not both
			NOT = {
				any_character_artifact = {
					exists = var:secret_journal
					exists = var:secret_puzzle
				}
			}
			any_owned_story = {
				story_type = story_cycle_mysterious_journal
			}
		}
		custom_tooltip = progress_to_unlock_journal_mystery_tt
		random_owned_story = {
			limit = {
				story_type = story_cycle_mysterious_journal
			}
			var:mysterious_journal = {
				if = {
					limit = {
						exists = var:secret_journal
					}
					set_artifact_description = artifact_secret_journal_with_cipher_description
				}
				else_if = {
					limit = {
						exists = var:secret_puzzle
					}
					set_artifact_description = artifact_secret_journal_with_puzzle_description
				}
				set_variable = {
					name = secret_cipher
				}
			}
		}
		ai_chance = {
			base = 10
		}
	}

	option = { # At last, I have them all
		name = tour_grounds_events.3032.c
		trigger = {
			any_character_artifact = {
				exists = var:secret_journal
				exists = var:secret_puzzle
			}
			any_owned_story = {
				story_type = story_cycle_mysterious_journal
			}
		}
		random_owned_story = {
			limit = {
				story_type = story_cycle_mysterious_journal
			}
			var:mysterious_journal = {
				set_artifact_description = artifact_secret_journal_unsolved_description
				set_variable = {
					name = secret_cipher
				}
			}
		}
		ai_chance = {
			base = 10
		}
	}

	option = { # I will not steal
		name = tour_grounds_events.3032.d
		trigger = {
			NOT = {
				any_owned_story = {
					story_type = story_cycle_mysterious_journal
				}
			}
		}
		destroy_artifact = scope:journal_artifact
		stress_impact = {
			base = medium_stress_impact_gain
			paranoid = major_stress_impact_loss
			honest = major_stress_impact_loss
			compassionate = major_stress_impact_loss
			forgiving = major_stress_impact_loss
		}
		ai_chance = {
			base = 0
		}
	}
}

#Your vassal has some relaxing building, explore it?
tour_grounds_events.3070 = {
	type = activity_event
	title = tour_grounds_events.3070.title
	desc = {
		desc = tour_grounds_events.3070.desc.intro
		first_valid = {
			triggered_desc = {
				trigger = {
					root.location = {
						has_building_or_higher = royal_garden_01
					}
				}
				desc = tour_grounds_events.3070.desc.royal_garden
			}
			triggered_desc = {
				trigger = {
					root.location = {
						has_building_or_higher = royal_forest_01
					}
				}
				desc = tour_grounds_events.3070.desc.royal_forest
			}
			triggered_desc = {
				trigger = {
					root.location = {
						OR = {
							has_building_or_higher = leisure_palace_01
							#AGOT ADDED
							has_building = agot_summerhall_01
							has_building = agot_summerhall_ruins_02
						}
					}
				}
				desc = tour_grounds_events.3070.desc.leisure_palace
			}
		}
		desc = tour_grounds_events.3070.desc.outro
	}
	theme = tour_grounds
	override_background = { reference = garden }
	cooldown = { years = 5 }
	left_portrait = {
		character = root
		animation = admiration
	}
	trigger = {
		root.location = {
			OR = {
				has_building_or_higher = royal_garden_01
				has_building_or_higher = royal_forest_01
				has_building_or_higher = leisure_palace_01
				#AGOT ADDED
				has_building = agot_summerhall_01
				has_building = agot_summerhall_ruins_02
			}
		}
	}

	option = { # Fascinating, there is so much I can learn from this!
		name = tour_grounds_events.3070.a
		trigger = { has_trait = scholar }
		add_character_modifier = {
			modifier = liesurely_studies
			years = 15
		}
		add_stewardship_lifestyle_perk_points = 1
		stress_impact = {
			diligent = minor_stress_impact_loss
			impatient = minor_stress_impact_gain
			lazy = minor_stress_impact_gain
		}
		ai_chance = {
			base = 10
			ai_value_modifier = {
				ai_energy = 1
				ai_rationality = 1
			}
		}
	}

	option = { # A leisurely stroll is a gift
		name = tour_grounds_events.3070.b
		add_character_modifier = {
			modifier = liesurely_stroll
			years = 5
		}
		stress_impact = {
			base = medium_stress_impact_loss
			diligent = minor_stress_impact_gain
			impatient = minor_stress_impact_loss
			lazy = minor_stress_impact_loss
		}
		ai_chance = {
			base = 10
			ai_value_modifier = {
				ai_energy = -1
			}
		}
	}

	option = { # Station troops, this place must be protected
		name = tour_grounds_events.3070.c
		if = {
			limit = {
				scope:activity = {
					has_activity_option = {
						category = special_type
						option = tour_type_intimidation
					}
				}
			}
			increase_tour_success_effect = { POINTS = 1 }
		}
		root.location.county = {
			add_county_modifier = {
				modifier = guarded_garden
				years = 15
			}
		}
		tour_distribute_control = {
			CAPITAL = minor_county_control_gain
			HELD_COUNTIES = 0
			HELD_AND_VASSAL_COUNTIES = 0
		}
		remove_short_term_gold = minor_gold_value
		stress_impact = {
			diligent = minor_stress_impact_loss
			impatient = minor_stress_impact_gain
			lazy = minor_stress_impact_gain
		}
		ai_chance = {
			base = 10
			ai_value_modifier = {
				ai_vengefulness = 1
				ai_rationality = -0.5
			}
			modifier = {
				factor = 0
				short_term_gold < minor_gold_value
			}
		}
	}
}

#Your vassal has some military building
scripted_effect tour_grounds_3080_trait_distribution = {
	if = {
		limit = {
			is_adult = yes
			NOT = { has_trait = organizer }
			root.location = {
				has_building_or_higher = military_academy_01
			}
		}
		add_trait = organizer
	}
	else_if = {
		limit = {
			is_adult = yes
			NOT = { has_trait = unyielding_defender }
			root.location = {
				has_building_or_higher = march_01
			}
		}
		add_trait = unyielding_defender
	}
	else_if = {
		limit = {
			is_adult = yes
			NOT = { has_trait = military_engineer }
			root.location = {
				has_building_or_higher = siege_works_01
			}
		}
		add_trait = military_engineer
	}
	else_if = {
		limit = {
			is_adult = yes
			NOT = { has_trait = aggressive_attacker }
			root.location = {
				has_building_or_higher = royal_armory_01
			}
		}
		add_trait = aggressive_attacker
	}
	else_if = {
		limit = {
			is_adult = yes
			has_trait = tourney_participant
			root.location = {
				has_building_or_higher = jousting_lists_01
			}
		}
		add_trait_xp = {
			trait = tourney_participant
			track = horse
			value = medium_trait_xp
		}
	}
	else_if = {
		limit = {
			is_adult = yes
			has_trait = tourney_participant
			root.location = {
				has_building_or_higher = archery_ranges_01
			}
		}
		add_trait_xp = {
			trait = tourney_participant
			track = bow
			value = medium_trait_xp
		}
	}
	else_if = {
		limit = {
			$MARTIAL_POINTS$ <= 1
		}
		add_martial_skill = 1
	}
	if = {
		limit = {
			$MARTIAL_POINTS$ < 1
		}
		add_martial_skill = $MARTIAL_POINTS$
	}
}

tour_grounds_events.3080 = {
	type = activity_event
	title = tour_grounds_events.3080.title
	desc = {
		desc = tour_grounds_events.3080.desc.intro
		first_valid = {
			triggered_desc = {
				trigger = {
					root.location = {
						has_building_or_higher = military_academy_01
					}
				}
				desc = tour_grounds_events.3080.desc.military_academy
			}
			triggered_desc = {
				trigger = {
					root.location = {
						has_building_or_higher = march_01
					}
				}
				desc = tour_grounds_events.3080.desc.march
			}
			triggered_desc = {
				trigger = {
					root.location = {
						has_building_or_higher = siege_works_01
					}
				}
				desc = tour_grounds_events.3080.desc.siege_works
			}
			triggered_desc = {
				trigger = {
					root.location = {
						has_building_or_higher = royal_armory_01
					}
				}
				desc = tour_grounds_events.3080.desc.royal_armories
			}
			triggered_desc = {
				trigger = {
					root.location = {
						has_building_or_higher = jousting_lists_01
					}
				}
				desc = tour_grounds_events.3080.desc.jousting_lists
			}
			triggered_desc = {
				trigger = {
					root.location = {
						has_building_or_higher = archery_ranges_01
					}
				}
				desc = tour_grounds_events.3080.desc.archery_ranges
			}
		}
		desc = tour_grounds_events.3080.desc.outro
	}
	theme = tour_grounds
	override_background = { reference = armory }
	cooldown = { years = 5 }
	left_portrait = {
		character = root
		animation = admiration
	}
	trigger = {
		root.location = {
			OR = {
				has_building_or_higher = military_academy_01
				has_building_or_higher = march_01
				has_building_or_higher = siege_works_01
				has_building_or_higher = royal_armory_01
				has_building_or_higher = jousting_lists_01
				has_building_or_higher = archery_ranges_01
			}
		}
	}

	option = { # Fascinating, there is so much I can learn from this!
		name = tour_grounds_events.3080.a
		trigger = { has_trait = scholar }
		add_character_modifier = {
			modifier = military_studies
			years = 15
		}
		tour_grounds_3080_trait_distribution = { MARTIAL_POINTS = 1 }
		stress_impact = {
			diligent = minor_stress_impact_loss
			impatient = minor_stress_impact_gain
			lazy = minor_stress_impact_gain
		}
		ai_chance = {
			base = 10
			ai_value_modifier = {
				ai_energy = 1
				ai_rationality = 1
			}
		}
	}

	option = { # Get out there and do your damn jobs!
		name = tour_grounds_events.3080.b
		if = {
			limit = {
				scope:activity = {
					has_activity_option = {
						category = special_type
						option = tour_type_intimidation
					}
				}
			}
			increase_tour_success_effect = { POINTS = 1 }
		}
		tour_distribute_control = {
			CAPITAL = medium_county_control_gain
			HELD_COUNTIES = minor_county_control_gain
			HELD_AND_VASSAL_COUNTIES = minor_county_control_gain
		}
		stress_impact = {
			base = medium_stress_impact_loss
			impatient = minor_stress_impact_loss
			diligent = minor_stress_impact_loss
			compassionate = minor_stress_impact_gain
		}
		ai_chance = {
			base = 10
			ai_value_modifier = {
				ai_vengefulness = 1
			}
		}
	}

	option = { # Fascinating, maybe I can get a lesson!
		name = tour_grounds_events.3080.c
		trigger = {
			NOT = {
				has_trait = scholar
			}
		}
		duel = {
			skill = martial
			value = decent_skill_rating
			10 = { # You do so epicly that you gain an extra skill point
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
				}
				tour_grounds_3080_trait_distribution = { MARTIAL_POINTS = 2 }
			}
			50 = { #You manage to learn a bit
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
				}
				tour_grounds_3080_trait_distribution = { MARTIAL_POINTS = 1 }
			}
			50 = { #You learn little
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
				}
				add_character_modifier = {
					modifier = military_studies
					years = 15
				}
			}
		}
		stress_impact = {
			diligent = minor_stress_impact_loss
			impatient = minor_stress_impact_gain
			lazy = minor_stress_impact_gain
		}
		ai_chance = {
			base = 10
			ai_value_modifier = {
				ai_energy = 1
				ai_rationality = 1
			}
		}
	}
}

# Peasants are meeting to trade their livestock and vegetables
tour_grounds_events.3090 = {
	type = activity_event
	title = tour_grounds_events.3090.title
	desc = {
		desc = tour_grounds_events.3090.desc.intro
		first_valid = {
			triggered_desc = {
				trigger = {
					root.location.county = { is_vegetarian_trigger = yes }
				}
				desc = tour_grounds_events.3090.desc.vegetables
			}
			desc = tour_grounds_events.3090.desc.livestock
		}
		desc = tour_grounds_events.3090.desc.outro
	}
	theme = tour_grounds
	override_background = { reference = farmland }
	cooldown = { years = 5 }
	left_portrait = {
		character = root
		animation = thinking
	}
	right_portrait = {
		character = scope:farmer
		animation = admiration
	}

	immediate = {
		hidden_effect = {
			if = {
				limit = {
					any_pool_character = {
						province = root.location
						is_lowborn = yes
					}
				}
				random_pool_character = {
					province = root.location
					limit = {
						is_lowborn = yes
					}
					save_scope_as = farmer
				}
			}
			else = {
				create_character = {
					location = root.capital_province
					template = generic_peasant_character
					faith = root.location.faith
					culture = root.location.culture
					save_scope_as = farmer
				}
				scope:farmer = {
					add_character_flag = {
						flag = silently_disappear_me
						years = 1
					}
				}
			}
		}
	}

	option = { # There should be a survey!
		name = tour_grounds_events.3090.a
		tour_distribute_control = {
			CAPITAL = minor_county_control_gain
			HELD_COUNTIES = minor_county_control_gain
			HELD_AND_VASSAL_COUNTIES = minor_county_control_gain
		}
		if = {
			limit = {
				scope:activity = {
					has_activity_option = {
						category = special_type
						option = tour_type_taxation
					}
				}
			}
			increase_tour_success_effect = { POINTS = 1 }
		}
		add_gold = minor_gold_value
		stress_impact = {
			base = minor_stress_impact_gain
			diligent = minor_stress_impact_loss
			impatient = minor_stress_impact_gain
			lazy = minor_stress_impact_gain
		}
		ai_chance = {
			base = 10
			ai_value_modifier = {
				ai_energy = 1
				ai_rationality = 1
			}
		}
	}

	option = { # Tell the peasants to get back to work
		name = tour_grounds_events.3090.b
		if = {
			limit = {
				scope:activity = {
					has_activity_option = {
						category = special_type
						option = tour_type_intimidation
					}
				}
			}
			increase_tour_success_effect = { POINTS = 1 }
		}
		add_dread = minor_dread_gain
		root.location.county = {
			add_county_modifier = {
				modifier = festival_disruption
				years = 5
			}
		}
		stress_impact = {
			impatient = minor_stress_impact_loss
			diligent = minor_stress_impact_loss
			vengeful = minor_stress_impact_loss
			compassionate = minor_stress_impact_gain
		}
		ai_chance = {
			base = 10
			ai_value_modifier = {
				ai_vengefulness = 1
				ai_rationality = -1
			}
		}
	}

	option = { # Wonderful, I will judge the contest!
		name = tour_grounds_events.3090.c
		if = {
			limit = {
				scope:activity = {
					has_activity_option = {
						category = special_type
						option = tour_type_majesty
					}
				}
			}
			increase_tour_success_effect = { POINTS = 1 }
		}
		root.location.county = {
			add_county_modifier = {
				modifier = liege_judged_festival
				years = 15
			}
		}
		stress_impact = {
			gregarious = minor_stress_impact_loss
			humble = minor_stress_impact_loss
			diligent = minor_stress_impact_loss
			impatient = minor_stress_impact_gain
			lazy = minor_stress_impact_gain
			callous = minor_stress_impact_gain
			sadistic = minor_stress_impact_gain
			arrogant = minor_stress_impact_gain
		}
		ai_chance = {
			base = 10
			ai_value_modifier = {
				ai_energy = 1
				ai_sociability = 1
			}
		}
	}

	after = {
		if = {
			limit = {
				is_ai = yes
				scope:farmer = {
					has_character_flag = silently_disappear_me
				}
			}
			scope:farmer = {
				silent_disappearance_effect = yes
			}
		}
	}
}

# Hang out in town doing stuff!
tour_grounds_events.3100 = {
	type = activity_event
	title = tour_grounds_events.3100.title
	desc = {
		desc = tour_grounds_events.3100.desc.intro
		first_valid = {
			triggered_desc = {
				trigger = {
					drinks_alcohol_trigger = yes
				}
				desc = tour_grounds_events.3100.desc.booze
			}
			desc = tour_grounds_events.3100.desc.hash
		}
		desc = tour_grounds_events.3100.desc.outro
	}
	theme = tour_grounds
	override_background = { reference = market }
	cooldown = { years = 5 }
	left_portrait = {
		character = root
		animation = personality_rational
	}

	option = { # Conduct a census
		name = tour_grounds_events.3100.a
		tour_distribute_control = {
			CAPITAL = minor_county_control_gain
			HELD_COUNTIES = minor_county_control_gain
			HELD_AND_VASSAL_COUNTIES = minor_county_control_gain
		}
		if = {
			limit = {
				scope:activity = {
					has_activity_option = {
						category = special_type
						option = tour_type_taxation
					}
				}
			}
			increase_tour_success_effect = { POINTS = 1 }
		}
		add_gold = minor_gold_value
		stress_impact = {
			base = minor_stress_impact_gain
			diligent = minor_stress_impact_loss
			impatient = minor_stress_impact_gain
			lazy = minor_stress_impact_gain
		}
		ai_chance = {
			base = 10
			ai_value_modifier = {
				ai_energy = 1
				ai_rationality = 1
			}
		}
	}

	option = { # Go to church (same faith)
		name = tour_grounds_events.3100.b
		trigger = {
			root.location.county.faith = root.faith
		}
		if = {
			limit = {
				scope:activity = {
					has_activity_option = {
						category = special_type
						option = tour_type_majesty
					}
				}
			}
			increase_tour_success_effect = { POINTS = 1 }
		}
		add_piety = minor_piety_gain
		root.location.county = {
			add_county_modifier = {
				modifier = pious_liege
				years = 15
			}
		}
		stress_impact = {
			zealous = minor_stress_impact_loss
			gregarious = minor_stress_impact_loss
			lazy = minor_stress_impact_gain
		}
		ai_chance = {
			base = 10
			ai_value_modifier = {
				ai_zeal = 1
				ai_sociability = 1
			}
		}
	}

	option = { # Go to church (diff faith)
		name = tour_grounds_events.3100.c
		trigger = {
			NOT = { root.location.county.faith = root.faith }
		}
		if = {
			limit = {
				scope:activity = {
					has_activity_option = {
						category = special_type
						option = tour_type_majesty
					}
				}
			}
			increase_tour_success_effect = { POINTS = 1 }
		}
		hidden_effect = {
			set_variable = {
				name = discounted_faith_to_convert_to_var
				value = root.location.county.faith
			}
		}
		custom_tooltip = cheaper_to_convert_to_local_faith_tt
		add_piety = medium_piety_loss
		root.location.county = {
			add_county_modifier = {
				modifier = tolerant_liege
				years = 15
			}
		}
		stress_impact = {
			gregarious = minor_stress_impact_loss
			curious = minor_stress_impact_loss
			zealous = minor_stress_impact_gain
			lazy = minor_stress_impact_gain
		}
		ai_chance = {
			base = 10
			ai_value_modifier = {
				ai_zeal = -1
				ai_sociability = 1
			}
		}
	}

	option = { # An excellent opportunity for charity
		name = tour_grounds_events.3100.d
		if = {
			limit = {
				scope:activity = {
					has_activity_option = {
						category = special_type
						option = tour_type_majesty
					}
				}
			}
			increase_tour_success_effect = { POINTS = 2 }
		}
		add_piety = major_piety_gain
		remove_short_term_gold = medium_gold_value
		root.location.county = {
			add_county_modifier = {
				modifier = sacred_touch
				years = 15
			}
		}
		stress_impact = {
			gregarious = minor_stress_impact_loss
			generous = minor_stress_impact_loss
			greedy = minor_stress_impact_gain
			callous = minor_stress_impact_gain
			sadistic = minor_stress_impact_gain
		}
		ai_chance = {
			base = 10
			ai_value_modifier = {
				ai_zeal = 1
				ai_sociability = 1
			}
			modifier = {
				factor = 0
				short_term_gold < medium_gold_value
			}
		}
	}

	option = { # A good chance to relax uwu
		name = tour_grounds_events.3100.e
		stress_impact = {
			base = medium_stress_impact_loss
			drunkard = minor_stress_impact_loss
			hashishiyah = minor_stress_impact_loss
			gluttonous = minor_stress_impact_loss
			gregarious = minor_stress_impact_loss
			zealous = minor_stress_impact_gain
			shy = minor_stress_impact_gain
			arrogant = minor_stress_impact_gain
		}
		ai_chance = {
			base = 10
			ai_value_modifier = {
				ai_sociability = 1
				ai_energy = -1
			}
		}
	}
}
