namespace = fp1_yearly

##################################################
# #Standard Yearlies
# 0001 - 0010	An Escaping Thrall Robs You
# 0011 - 0020	Locals Call for Courtier to be Declared Nithing
# 0021 - 0030	Two of your Knights wish to Holmgang over a Dispute
# 0031 - 0040	A Mighty Warrior with a Big Personality Arrives
# 0041 - 0050	[Russia/Steppe] Islamic Explorer Visits Court
# 0051 - 0070	[Rural] A Dead Character is Rumoured to have become a Draugr
# 0071 - 0090	[Rural] A Troll has been sighted & is attacking villages/peasants
# 0091 - 0100	Commissioning a Longship for Yourself
# 0101 - 0110	A Guest/Courtier Challenges you to Riddles
# 0111 - 0120	Nithing Pole Raised Against Courtier
#
# #Flavour Yearlies
# 0501 - 0510	Out for a Sail - you spot a ship in distress.
# 0511 - 0520	The Stench of Success - a courtier won't let an old trophy go.
# 0521 - 0530	Blood on the Snow - your child wishes to snowball fight.
# 0531 - 0540	[Dynasty] on Ice - your child wants to learn how to ice skate.
# 0541 - 0550	The Beast of [Capital] - your child is playing pranks on courtiers.
# 0551 - 0560	Fishy Business - a courtier won't stop eating rotten fish.
# 0561 - 0570	My Arm Against Yours - a knight challenges you to arm-wrestling.
# 0571 - 0580	Petty Vandalism - your child has vandalised a runestone.
# 0581 - 0590	When I Grow Up - your child wishes to be a shieldperson.
# 0591 - 0600	Raised Voices at the Thing - two of your counties are fighting at a regional thing.
# 0601 - 0610	The Hardest Part of Ruling - you're incredibly bored in a protracted thing session.
# 0611 - 0620	Leading by Example - one of your children hurts another whilst imitating you.
# 0621 - 0630	A Shiny New Toy - your child wants a specific piece of loot from a raid.
# 0631 - 0640	A Cynical Bent - you notice a knight not sacrificing after a raid.
# 0641 - 0650	Worthy of the Ocean - your longships are in disrepair.
# 0651 - 0660	Leviathan - you spot a whale whilst sailing.
# 0661 - 0670	A Novel Challenge - a knight challenges you to skiing.
# 0671 - 0680	A Slippery Slope - your child wants to go sledding.
# 0681 - 0690	Why Can't I Come? - your child wants to come raiding.
# 0691 - 0700	Attempted Atonement - a knight has converted after raiding a reformed faith.
#
# #Special Yearlies
# 1001 - 1030	A Mysterious Stranger Stays at Court
# 1031 - 1060	RIP
# 1061 - 1071	Commissioning a Longship for a Funeral
# 1071 - 1080	Sparklingly Clean
# 1081 - 1090	Explorer from Phantom Islands
##################################################










##################################################
# STANDARD YEARLIES

##################################################
# An Escaping Thrall Robs You
# by Ewan Cowhig Croft
# 0001 - 0010
##################################################

scripted_trigger suitably_terrible_knight_trigger = {
	is_available_ai = yes
	is_ruler = no
	# Just make sure they have at least one knight with believably-bad prowess. Deliberately "<", rather than "<=".
	prowess < high_skill_rating
	# And uhh, for obvious reasons...
	NOT = { has_trait = blind }
}

#	A thrall leaves your court in the night.
fp1_yearly.0001 = {
	type = character_event
	title = fp1_yearly.0001.t
	desc = fp1_yearly.0001.desc
	theme = stewardship
	left_portrait = {
		character = scope:scapegoat
		animation = shame
	}
	override_background = { reference = throne_room }

	trigger = {
		#DLC check.
		has_fp1_dlc_trigger = yes
		#Standard checks.
		is_available_even_at_war_adult = yes
		NOT = { has_character_flag = had_event_fp1_yearly_0001 }
		is_landed = yes
		#Must be able to raid, or else your thrall economy is being phased out.
		can_raid_trigger = yes
		#Should be North Germanic, or the flavour won't make sense.
		culture = { has_cultural_pillar = heritage_north_germanic }
		#Needs a knight for scapegoating.
		any_knight = {
			count >= 1
			suitably_terrible_knight_trigger = yes
		}
	}

	weight_multiplier = {
		base = 1

		#Weight up a little for rulers that thralls are desperate to escape from.
		modifier = {
			add = 0.5
			has_trait = sadistic
		}
		modifier = {
			add = 0.25
			has_trait = callous
		}

		#And weight down for anyone who's a bit nicer. Not to suggest that the thralls are treated particularly well, but they're not being casually murdered for fun like a sadist might.
		modifier = {
			add = -0.5
			has_trait = compassionate
		}
		modifier = {
			add = -0.25
			has_trait = forgiving
		}
	}

	immediate = {
		add_character_flag = {
			flag = had_event_fp1_yearly_0001
			days = 1825
		}
		# Pick a fall guy.
		random_knight = {
			limit = { suitably_terrible_knight_trigger = yes }
			weight = {
				# Every point of prowess a knight has lowers the chance for it to be them by 2%.
				base = 0
				modifier = {
					add = {
						value = 50
						subtract = prowess
					}
				}
				# And every point of compassion another 1%.
				modifier = { add = ai_compassion }
			}
			save_scope_as = scapegoat
		}
		# Give the escaped thrall a gender for loc.
		random_dummy_gender_effect = yes
		# Remove the stolen jewels.
		remove_short_term_gold = medium_gold_value
	}

	# Send out descriptions of the thrall and the stolen goods.
	option = {
		name = fp1_yearly.0001.a

		duel = {
			skill = stewardship
			value = decent_skill_rating
			# The thrall is spotted and captured several villages away.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = fp1_yearly.0001.a.tt_success
				send_interface_toast = {
					title = fp1_yearly.0001.a.tt_success
					left_icon = root
					add_prestige = medium_prestige_gain
					add_gold = medium_gold_value
				}
			}
			# The thrall slips the net, with your stolen goods.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = fp1_yearly.0001.a.tt_failure
				send_interface_toast = {
					title = fp1_yearly.0001.a.tt_failure
					left_icon = root
					custom_tooltip = fp1_yearly.0001.gold_stays_lost.tt
				}
			}
		}

		stress_impact = {
			diligent = medium_stress_impact_loss
			lazy = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_energy = 0.5
				ai_rationality = 0.25
			}
			modifier = {	# Weight up for stress.
				add = 20
				has_trait = diligent
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = lazy
			}
		}
	}

	#Start a manhunt.
	option = {
		name = fp1_yearly.0001.b

		duel = {
			skill = martial
			value = decent_skill_rating
			#The thrall is caught before they can get far.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = fp1_yearly.0001.b.tt_success
				send_interface_toast = {
					title = fp1_yearly.0001.b.tt_success
					left_icon = root
					add_prestige = medium_prestige_gain
					add_gold = medium_gold_value
				}
			}
			#The thrall slips the net, with your stolen goods.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = fp1_yearly.0001.b.tt_failure
				send_interface_toast = {
					title = fp1_yearly.0001.b.tt_failure
					left_icon = root
					custom_tooltip = fp1_yearly.0001.gold_stays_lost.tt
				}
			}
		}

		stress_impact = {
			diligent = medium_stress_impact_loss
			lazy = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_energy = 0.5
				ai_rationality = 0.25
			}
			modifier = {	#Weight up for stress.
				add = 20
				has_trait = diligent
			}
			modifier = {	#Weight down for stress.
				add = -20
				has_trait = lazy
			}
		}
	}

	#Fine scope:scapegoat.
	option = {
		name = fp1_yearly.0001.c

		#And no money was lost after all.
		add_prestige = medium_prestige_gain

		#Unless you're scope:scapegoat.
		scope:scapegoat = {
			pay_short_term_gold = {
				target = root
				gold = root.medium_gold_value
			}
			#Who is, understandably, a bit miffed.
			progress_towards_rival_effect = {
				REASON = rival_thrall_scapegoat
				CHARACTER = root
				OPINION = 0
			}
			add_opinion = {
				target = root
				modifier = angry_opinion
				opinion = -20
			}
		}

		stress_impact = {
			wrathful = minor_stress_impact_loss
			greedy = medium_stress_impact_loss
			vengeful = major_stress_impact_loss
			calm = minor_stress_impact_gain
			generous = medium_stress_impact_gain
			forgiving = major_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_vengefulness = 0.25
				ai_compassion = -0.25
			}
			modifier = {	#Weight up for stress.
				add = 10
				has_trait = wrathful
			}
			modifier = {	#Weight up for stress.
				add = 20
				has_trait = greedy
			}
			modifier = {	#Weight up for stress.
				add = 30
				has_trait = vengeful
			}
			modifier = {	#Weight down for stress.
				add = -10
				has_trait = calm
			}
			modifier = {	#Weight down for stress.
				add = -20
				has_trait = generous
			}
			modifier = {	#Weight down for stress.
				add = -30
				has_trait = forgiving
			}
		}
	}

	#Not your fault, scope:scapegoat. These things happen.
	option = {
		name = fp1_yearly.0001.d

		#Some assets are gone for good.
		custom_tooltip = fp1_yearly.0001.gold_stays_lost.tt

		#Welp, you _did_ show clemency.
		if = {
			limit = {
				can_add_hook = {
					type = favor_hook
					target = scope:scapegoat
				}
			}
			add_hook = {
				type = favor_hook
				target = scope:scapegoat
			}
		}
		scope:scapegoat = {
			add_opinion = {
				target = root
				modifier = relieved_opinion
				opinion = 20
			}
		}

		stress_impact = {
			calm = minor_stress_impact_loss
			generous = medium_stress_impact_loss
			forgiving = major_stress_impact_loss
			wrathful = minor_stress_impact_gain
			greedy = medium_stress_impact_gain
			vengeful = major_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = 0.5
				ai_vengefulness = -0.5
			}
			modifier = {	#Weight up for stress.
				add = 10
				has_trait = calm
			}
			modifier = {	#Weight up for stress.
				add = 20
				has_trait = generous
			}
			modifier = {	#Weight up for stress.
				add = 30
				has_trait = forgiving
			}
			modifier = {	#Weight down for stress.
				add = -10
				has_trait = wrathful
			}
			modifier = {	#Weight down for stress.
				add = -20
				has_trait = greedy
			}
			modifier = {	#Weight down for stress.
				add = -30
				has_trait = vengeful
			}
		}
	}
}

##################################################
# Locals Call for Courtier to be Declared Nithing
# by Ewan Cowhig Croft
# 0011 - 0020
##################################################

scripted_trigger offensive_courtier_candidate_trigger = {
	#Filter out the basic miscs.
	is_available_ai_adult = yes
	#Have committed some genuine malfeasance, or just be irritating to at least some people.
	OR = {
		#Having committed murder by poison is a solid way to become a nithing; this might be a secret, but we assume local rumours about a shady buyer of poisons abound...
		has_character_flag = murdered_by_poison
		#Legitimately being a witch, and a Germanic Pagan one at that, is a good reason, though all parties have to agree on that being a bad thing first.
		AND = {
			faith = { has_doctrine_parameter = witchcraft_illegal }
			root.faith = { has_doctrine_parameter = witchcraft_illegal }
			root.capital_county.faith = { has_doctrine_parameter = witchcraft_illegal }
			OR = {
				has_trait = witch
				any_secret = { type = secret_witch }
			}
		}
		#Irritating personality traits can be cause for suspicion.
		has_trait = wrathful
		has_trait = deceitful
		has_trait = craven
		has_trait = ambitious
		has_trait = arbitrary
		has_trait = paranoid
		has_trait = sadistic
		has_trait = stubborn
		has_trait = vengeful
		#And really anyone dealing with herbs, potions, poisons, or alchemy.
		has_trait = lifestyle_mystic
		has_trait = lifestyle_physician
		has_trait = lifestyle_herbalist
	}
	#If they're heir to a player, then they should only be the heir of the player making the decision.
	OR = {
		#Plus we need to filter out anyone who isn't an heir at all.
		any_heir_title = { count = 0 }
		any_heir_title = {
			is_title_created = yes
			holder = {
				is_ai = no
				this != root
			}
		}
	}
}

scripted_effect agree_to_courtier_becoming_nithing_effect = {
	# First, we remove any legal relations.
	## Specifically marriage.
	if = {
		limit = {
			any_spouse = { this = root }
			root.faith = {
				# _Technically_ they're 'dead' and this isn't a divorce, but if divorce was as easy as declaring your spouse legally dead, Henry VIII would've remained a good Catholic boi till the end of his days.
				NOT = { has_doctrine = doctrine_divorce_disallowed }
			}
		}
		divorce_effect = {
			DIVORCER = root
			DIVORCEE = scope:offensive_courtier
		}
	}
	## And concubinage.
	if = {
		limit = {
			scope:offensive_courtier = { is_concubine_of = root }
		}
		root = { remove_concubine = scope:offensive_courtier }
	}
	# Then we evict them.
	banish = yes # banish_effect not used for unlanded
	# Which naturally causes some friction.
	add_opinion = {
		target = root
		modifier = hate_opinion
		opinion = -75
	}
	## Including some ramifications later, potentially.
	hidden_effect = {
		if = {
			limit = {
				can_set_relation_potential_rival_trigger = { CHARACTER = scope:offensive_courtier }
			}
			set_relation_potential_rival = scope:offensive_courtier
		}
	}
	# And, finally, let the whole world know.
	add_character_modifier = {
		modifier = nithing_fp1_modifier
		years = 20
	}
}

#	Locals call for one of your courtiers to be exiled as a nithing.
fp1_yearly.0011 = {
	type = character_event
	title = fp1_yearly.0011.t
	desc = {
		desc = fp1_yearly.0011.desc
		# And if they have a hard-to-live with virtue...
		triggered_desc = {
			trigger = { exists = scope:priest }
			desc = fp1_yearly.0011.desc.priest
		}
	}
	theme = realm
	left_portrait = {
		character = scope:offensive_courtier
		animation = shock
	}
	right_portrait = {
		character = scope:priest
		animation = dismissal
	}

	trigger = {
		#DLC check.
		has_fp1_dlc_trigger = yes
		#Standard checks.
		is_available_even_at_war_adult = yes
		NOT = { has_character_flag = had_event_fp1_yearly_0011 }
		is_landed = yes
		#Must have at least one suitable courtier.
		any_courtier = { offensive_courtier_candidate_trigger = yes }
		#Both yourself and your capital must be Germanic Pagans.
		religion = religion:folkgerman_religion
		capital_county.religion = religion:folkgerman_religion
	}

	weight_multiplier = {
		base = 1
	}

	immediate = {
		add_character_flag = {
			flag = had_event_fp1_yearly_0011
			days = 3650
		}
		# Save the capital for loc.
		capital_barony = { save_scope_as = capital_barony }
		# Pick a suitable courtier to be the nithing.
		random_courtier = {
			limit = { offensive_courtier_candidate_trigger = yes }
			# Make sure we grab someone interesting.
			weight = {
				base = 1

				# Claimants are good picks.
				modifier = {
					add = 10
					is_claimant = yes
				}
				# Highly-skilled characters are good picks.
				modifier = {
					add = 5
					diplomacy >= decent_skill_rating
				}
				modifier = {
					add = 5
					martial >= decent_skill_rating
				}
				modifier = {
					add = 5
					stewardship >= decent_skill_rating
				}
				modifier = {
					add = 5
					intrigue >= decent_skill_rating
				}
				modifier = {
					add = 5
					learning >= decent_skill_rating
				}
				modifier = {
					add = 5
					prowess >= decent_skill_rating
				}
				# Characters with some relation to root are adequate picks.
				modifier = {
					add = 10
					has_important_relationship_trigger = { CHARACTER = root }
				}
			}
			# Nab them for use elsewhere.
			save_scope_as = offensive_courtier
		}
		# Does scope:offensive_courtier have any virtuous traits that are offensive to the commonfolk? If so, designate a priest to defend them.
		if = {
			limit = {
				scope:offensive_courtier = {
					OR = {
						# wrathful
						AND = {
							has_trait = wrathful
							faith = { trait_is_virtue = wrathful }
						}
						# deceitful
						AND = {
							has_trait = deceitful
							faith = { trait_is_virtue = deceitful }
						}
						# craven
						AND = {
							has_trait = craven
							faith = { trait_is_virtue = craven }
						}
						# ambitious
						AND = {
							has_trait = ambitious
							faith = { trait_is_virtue = ambitious }
						}
						# arbitrary
						AND = {
							has_trait = arbitrary
							faith = { trait_is_virtue = arbitrary }
						}
						# paranoid
						AND = {
							has_trait = paranoid
							faith = { trait_is_virtue = paranoid }
						}
						# sadistic
						AND = {
							has_trait = sadistic
							faith = { trait_is_virtue = sadistic }
						}
						# stubborn
						AND = {
							has_trait = stubborn
							faith = { trait_is_virtue = stubborn }
						}
						# vengeful
						AND = {
							has_trait = vengeful
							faith = { trait_is_virtue = vengeful }
						}
					}
				}
				any_learning_councillor = { exists = this }
			}
			random_learning_councillor = { save_scope_as = priest }
		}
	}

	# Family: disinherit & banish.
	option = {
		name = fp1_yearly.0011.a
		trigger = { house = scope:offensive_courtier.house }

		# The nithing is exiled utterly.
		scope:offensive_courtier = {
			disinherit_effect = { DISINHERITOR = root }
			agree_to_courtier_becoming_nithing_effect = yes
		}

		# Your capital is pretty happy about the nithing being given the boot.
		capital_county = {
			add_county_modifier = {
				modifier = nithing_exiled_fp1_modifier
				years = 10
			}
		}

		stress_impact = {
			vengeful = major_stress_impact_loss
			forgiving = massive_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_vengefulness = 0.5
				ai_boldness = 0.25
			}
			modifier = {	# Weight up for stress.
				add = 30
				has_trait = vengeful
			}
			modifier = {	# Weight down for stress.
				add = -40
				has_trait = forgiving
			}
		}
	}

	# Non-family: banish them.
	option = {
		name = fp1_yearly.0011.b
		trigger = {
			house != scope:offensive_courtier.house
		}

		# The nithing is exiled utterly.
		scope:offensive_courtier = { agree_to_courtier_becoming_nithing_effect = yes }

		# Your capital is pretty happy about the nithing being given the boot.
		capital_county = {
			add_county_modifier = {
				modifier = nithing_exiled_fp1_modifier
				years = 10
			}
		}

		stress_impact = {
			vengeful = major_stress_impact_loss
			forgiving = massive_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_vengefulness = 0.5
				ai_boldness = 0.25
			}
			modifier = {	# Weight up for stress.
				add = 30
				has_trait = vengeful
			}
			modifier = {	# Weight down for stress.
				add = -40
				has_trait = forgiving
			}
		}
	}

	# Harbour them against the angry mob.
	option = {
		name = fp1_yearly.0011.c

		# Get a favour, or at least some opinion.
		if = {
			limit = {
				can_add_hook = {
					type = favor_hook
					target = scope:offensive_courtier
				}
			}
			add_hook = {
				type = favor_hook
				target = scope:offensive_courtier
			}
		}
		else = {
			reverse_add_opinion = {
				modifier = fp1_saved_me_from_the_mob_opinion
				target = scope:offensive_courtier
			}
		}

		# Your capital county isn't super happy about this, though.
		capital_county = {
			add_county_modifier = {
				modifier = nithing_harboured_fp1_modifier
				years = 10
			}
		}

		stress_impact = {
			forgiving = major_stress_impact_loss
			vengeful = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = 0.5
				ai_vengefulness = -0.5
			}
			modifier = {	# Weight down for stress.
				add = 30
				has_trait = forgiving
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = vengeful
			}
		}
	}

	# Refuse to rule.
	option = {
		name = fp1_yearly.0011.d

		# Not your circus, not your trained dancing bears.
		add_stress = massive_stress_loss

		# Both capital_county & scope:offensive_courtier are unhappy with your inaction.
		reverse_add_opinion = {
			modifier = fp1_abandoned_me_to_the_mob_opinion
			target = scope:offensive_courtier
		}
		capital_county = {
			add_county_modifier = {
				modifier = nithing_in_limbo_fp1_modifier
				years = 10
			}
		}

		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = -0.25
				ai_energy = -0.5
			}
		}
	}
}

##################################################
# Two of your Knights wish to Holmgang over a Dispute
# by Ewan Cowhig Croft
# 0021 - 0030
##################################################

scripted_trigger suitable_knight_for_dispute_trigger = {
	is_available_ai_adult = yes
	#Nab them for checking various things later in the event.
	save_temporary_scope_as = current_knight
	#Filter out rulers, as the loc mismatches such tonally.
	is_ruler = no
	#They have to be at least not non-argumentative.
	NOR = {
		has_trait = forgiving
		has_trait = craven
	}
	#For the sake of ease, they shouldn't have a positive special relationship with any other knight.
	NOT = {
		root = {
			any_knight = {
				has_friendly_relationship_trigger = { CHARACTER = scope:current_knight }
			}
		}
	}
	#Is the character hookable for the event results?
	root = {
		can_add_hook = {
			type = favor_hook
			target = scope:current_knight
		}
	}
}

scripted_trigger deviant_knight_trigger = {
	OR = {
		has_trait = deviant
		any_secret = { type = secret_deviant }
	}
}

scripted_effect holmgang_results_effect = {
	if = {
		limit = { government_has_flag = government_is_tribal }
		$LOSER$ = {
			death = {
				killer = $WINNER$
				death_reason = death_duel
			}
		}
	}
	else = {
		$LOSER$ = {
			increase_wounds_effect = { REASON = duel }
		}
	}
}

#	Two knights fight to the death over nothing.
fp1_yearly.0021 = {
	type = character_event
	title = fp1_yearly.0021.t
	desc = {
		desc = fp1_yearly.0021.desc.intro
		first_valid = {
			triggered_desc = {
				trigger = { scope:dispute_nature = flag:doggo }
				desc = fp1_yearly.0021.desc.doggo
			}
			triggered_desc = {
				trigger = { scope:dispute_nature = flag:spit_of_land }
				desc = fp1_yearly.0021.desc.spit_of_land
			}
			triggered_desc = {
				trigger = { scope:dispute_nature = flag:unrepeatable_insult }
				desc = fp1_yearly.0021.desc.unrepeatable_insult
			}
			triggered_desc = {
				trigger = { scope:dispute_nature = flag:escalating_prank_war }
				desc = fp1_yearly.0021.desc.escalating_prank_war
			}
			triggered_desc = {
				trigger = { scope:dispute_nature = flag:religious_differences }
				desc = fp1_yearly.0021.desc.religious_differences
			}
			triggered_desc = {
				trigger = { scope:dispute_nature = flag:stolen_pig }
				desc = fp1_yearly.0021.desc.stolen_pig
			}
			# Female Variant.
			triggered_desc = {
				trigger = {
					scope:dispute_nature = flag:defiled_longboat
					scope:defiling_knight = { is_female = yes }
				}
				desc = fp1_yearly.0021.desc.defiled_longboat.woman
			}
			# Male Variant.
			triggered_desc = {
				trigger = {
					scope:dispute_nature = flag:defiled_longboat
					scope:defiling_knight = { is_male = yes }
				}
				desc = fp1_yearly.0021.desc.defiled_longboat
			}
			triggered_desc = {
				trigger = { scope:dispute_nature = flag:board_game }
				desc = fp1_yearly.0021.desc.board_game
			}
		}
		desc = fp1_yearly.0021.desc.outro
	}
	theme = unfriendly
	left_portrait = {
		character = scope:first_knight
		animation = anger
	}
	right_portrait = {
		character = scope:second_knight
		animation = disgust
	}
	override_background = { reference = wilderness }

	trigger = {
		#DLC check.
		has_fp1_dlc_trigger = yes
		#Standard checks.
		is_available_at_peace_adult = yes
		NOT = { has_character_flag = had_event_fp1_yearly_0021 }
		is_landed = yes
		#Must be North Germanic.
		culture = { has_cultural_pillar = heritage_north_germanic }
		#Holmgangs must still be in fashion.
		NOT = {
			culture = { has_cultural_era_or_later = culture_era_high_medieval }
		}
		#Must have at least two knights available who can get into a dispute.
		any_knight = {
			count >= 2
			suitable_knight_for_dispute_trigger = yes
		}
	}

	weight_multiplier = {
		base = 1
	}

	immediate = {
		add_character_flag = {
			flag = had_event_fp1_yearly_0021
			days = 1825
		}
		#Sort Actors.
		##Grab capital barony for loc.
		capital_barony = { save_scope_as = capital_barony }
		##Grab the first knight.
		random_knight = {
			limit = { suitable_knight_for_dispute_trigger = yes }
			save_scope_as = first_knight
		}
		##Grab the second knight.
		random_knight = {
			limit = {
				suitable_knight_for_dispute_trigger = yes
				this != scope:first_knight
			}
			save_scope_as = second_knight
		}
		##Just make them hate each other a little.
		scope:first_knight = {
			add_opinion = {
				target = scope:second_knight
				modifier = respect_opinion
				opinion = -40
			}
			reverse_add_opinion = {
				target = scope:second_knight
				modifier = respect_opinion
				opinion = -40
			}
			progress_towards_rival_effect = {
				REASON = rival_knights_slapfight
				CHARACTER = scope:second_knight
				OPINION = 0
			}
		}
		#Pick which dispute type they'll have.
		##Eight options of 12.5% chance each.
		random_list = {
			#Dispute over a pet killed in an accident.
			125 = {
				#No trigger, fallback.
				save_scope_value_as = {
					name = dispute_nature
					value = flag:doggo
				}
				select_local_animal_effect = { TYPE = any } # Save scope to limit possible animals: any/big/small/dangerous/harmless/prowling
				# And, if scope:second_knight actually has a doggo, kill it.
				scope:second_knight = {
					if = {
						limit = {
							any_owned_story = {
								type = story_cycle_pet_dog
								exists = story_owner.var:story_cycle_dog_name
							}
						}
						random_owned_story = {
							type = story_cycle_pet_dog
							limit = {
								exists = story_owner.var:story_cycle_dog_name
							}
							story_owner = {
								add_character_flag = {
									flag = dog_is_dying
								}
								trigger_event = pet_animal.1199
							}
						}
					}
				}
			}
			#Dispute over a spit of land that grows the best cabbages.
			125 = {
				#Both knights must care at least a little about money, and at least one a little too much.
				trigger = {
					NOR = {
						scope:first_knight = {
							OR = {
								has_trait = generous
								has_trait = profligate
								has_trait = improvident
							}
						}
						scope:second_knight = {
							OR = {
								has_trait = generous
								has_trait = profligate
								has_trait = improvident
							}
						}
					}
					OR = {
						scope:first_knight = { has_trait = greedy }
						scope:second_knight = { has_trait = greedy }
					}
				}
				save_scope_value_as = {
					name = dispute_nature
					value = flag:spit_of_land
				}
			}
			#Dispute over an unrepeatable insult involving a goat & a good drinking horn.
			125 = {
				#Both knights must be the type to let the insult escalate, and at least one to take it too far.
				trigger = {
					NOR = {
						scope:first_knight = { has_trait = calm }
						scope:second_knight = { has_trait = calm }
					}
					OR = {
						scope:first_knight = { has_trait = wrathful }
						scope:first_knight = { has_trait = wrathful}
					}
				}
				save_scope_value_as = {
					name = dispute_nature
					value = flag:unrepeatable_insult
				}
			}
			#Dispute resulting from an escalating prank war.
			125 = {
				#Both knights must be people who might get involved in such a thing, and one should be the type to take it too far.
				trigger = {
					NOR = {
						scope:first_knight = {
							OR = {
								has_trait = shy
								has_trait = reclusive
							}
						}
						scope:second_knight = {
							OR = {
								has_trait = shy
								has_trait = reclusive
							}
						}
					}
					OR = {
						scope:first_knight = { has_trait = vengeful }
						scope:second_knight = { has_trait = vengeful }
					}
				}
				save_scope_value_as = {
					name = dispute_nature
					value = flag:escalating_prank_war
				}
			}
			#Dispute over religious differences.
			125 = {
				#Both knights must find each other's faiths disagreeable.
				trigger = {
					scope:first_knight.faith = {
						faith_hostility_level = {
							target = scope:second_knight.faith
							value >= faith_hostile_level
						}
					}
					scope:second_knight.faith = {
						faith_hostility_level = {
							target = scope:first_knight.faith
							value >= faith_hostile_level
						}
					}
					#Quietly exclude sceptics also.
					NOR = {
						scope:first_knight = { has_trait = cynical }
						scope:second_knight = { has_trait = cynical }
					}
				}
				save_scope_value_as = {
					name = dispute_nature
					value = flag:religious_differences
				}
			}
			#Dispute over a stolen pig.
			125 = {
				trigger = {
					#Exempt faiths that don't eat pork: technically the pig could be as a pet or for non-edible purposes, but it scans best if we just don't bring this up.
					NOR = {
						scope:first_knight = {
							OR = {
								religion = religion:judaism_religion
								religion = religion:islam_religion
							}
						}
						scope:second_knight = {
							OR = {
								religion = religion:judaism_religion
								religion = religion:islam_religion
							}
						}
					}
				}
				save_scope_value_as = {
					name = dispute_nature
					value = flag:stolen_pig
				}
			}
			#Dispute resulting from someone making a sea-going vessel a bit saltier.
			125 = {
				#Requires at least one knight to be a deviant.
				trigger = {
					OR = {
						scope:first_knight = { deviant_knight_trigger = yes }
						scope:second_knight = { deviant_knight_trigger = yes }
					}
				}
				save_scope_value_as = {
					name = dispute_nature
					value = flag:defiled_longboat
				}
				#Specify who defiled who's longboat.
				if = {
					limit = {
						scope:first_knight = { deviant_knight_trigger = yes }
					}
					scope:first_knight = { save_scope_as = defiling_knight }
					scope:second_knight = { save_scope_as = unfortunate_knight }
				}
				else = {
					scope:second_knight = { save_scope_as = defiling_knight }
					scope:first_knight = { save_scope_as = unfortunate_knight }
				}
			}
			#Dispute resulting from the mysterious Viking board game.
			125 = {
				#No trigger, fallback.
				save_scope_value_as = {
					name = dispute_nature
					value = flag:board_game
				}
			}
		}
	}

	#Strictly forbid them.
	option = {
		name = fp1_yearly.0021.b

		#Then, we see if your rule is feared or jeered.
		duel = {
			skill = intrigue
			value = 12
			#You successfully terrify them into not fighting.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = fp1_yearly.0021.b.tt_success
				send_interface_toast = {
					title = fp1_yearly.0021.b.tt_success
					left_icon = scope:first_knight
					add_dread = medium_dread_gain
					add_prestige = minor_prestige_gain
				}
			}
			#They begrudgingly agree not to fight, but shit-talk you for it.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = fp1_yearly.0021.b.tt_failure
				send_interface_toast = {
					title = fp1_yearly.0021.b.tt_failure
					left_icon = scope:first_knight
					add_dread = medium_dread_loss
					add_prestige = minor_prestige_loss
				}
			}
		}

		#Regardless of outcome, they dislike you for this.
		reverse_add_opinion = {
			target = scope:first_knight
			modifier = respect_opinion
			opinion = -30
		}
		reverse_add_opinion = {
			target = scope:second_knight
			modifier = respect_opinion
			opinion = -30
		}

		stress_impact = {
			arbitrary = minor_stress_impact_loss
			just = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = -0.25
				ai_vengefulness = -0.25
				ai_rationality = -0.25
			}
			modifier = {	#Weight up for stress.
				add = 10
				has_trait = arbitrary
			}
			modifier = {	#Weight down for stress.
				add = -10
				has_trait = just
			}
		}
	}

	#Bet on scope:first_knight.
	option = {
		name = fp1_yearly.0021.c

		#Sort the duel.
		scope:first_knight = {
			duel = {
				skill = prowess
				target = scope:second_knight
				#scope:first_knight wins!
				50 = {
					compare_modifier = {
						value = scope:duel_value
						multiplier = 3.5
						min = -49
					}
					desc = fp1_yearly.0021.c.tt_success
					root = {
						send_interface_toast = {
							title = fp1_yearly.0021.c.tt_success
							left_icon = scope:first_knight
							add_gold = minor_gold_value
							holmgang_results_effect = {
								WINNER = scope:first_knight
								LOSER = scope:second_knight
							}
						}
					}
				}
				#scope:second_knight wins!
				50 = {
					compare_modifier = {
						value = scope:duel_value
						multiplier = -3.5
						min = -49
					}
					desc = fp1_yearly.0021.c.tt_failure
					root = {
						send_interface_toast = {
							title = fp1_yearly.0021.c.tt_failure
							left_icon = scope:second_knight
							remove_short_term_gold = minor_gold_value
							holmgang_results_effect = {
								WINNER = scope:second_knight
								LOSER = scope:first_knight
							}
						}
					}
				}
			}
		}

		stress_impact = {
			greedy = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_greed = 0.5
				ai_compassion = -0.25
			}
			modifier = {	#Weight up for stress.
				add = 10
				has_trait = greedy
			}
		}
	}

	#Bet on scope:second_knight.
	option = {
		name = fp1_yearly.0021.d

		#Sort the duel.
		scope:first_knight = {
			duel = {
				skill = prowess
				target = scope:second_knight
				#scope:first_knight wins!
				50 = {
					compare_modifier = {
						value = scope:duel_value
						multiplier = 3.5
						min = -49
					}
					desc = fp1_yearly.0021.d.tt_failure
					root = {
						send_interface_toast = {
							title = fp1_yearly.0021.d.tt_failure
							left_icon = scope:first_knight
							remove_short_term_gold = minor_gold_value
							holmgang_results_effect = {
								WINNER = scope:first_knight
								LOSER = scope:second_knight
							}
						}
					}
				}
				#scope:second_knight wins!
				50 = {
					compare_modifier = {
						value = scope:duel_value
						multiplier = -3.5
						min = -49
					}
					desc = fp1_yearly.0021.d.tt_success
					root = {
						send_interface_toast = {
							title = fp1_yearly.0021.d.tt_success
							left_icon = scope:second_knight
							add_gold = minor_gold_value
							holmgang_results_effect = {
								WINNER = scope:second_knight
								LOSER = scope:first_knight
							}
						}
					}
				}
			}
		}

		stress_impact = {
			greedy = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_greed = 0.5
				ai_compassion = -0.25
			}
			modifier = {	#Weight up for stress.
				add = 10
				has_trait = greedy
			}
		}
	}

	#Grant them permission.
	option = {
		name = fp1_yearly.0021.a

		#Sort the duel.
		scope:first_knight = {
			duel = {
				skill = prowess
				target = scope:second_knight
				#scope:first_knight wins!
				50 = {
					compare_modifier = {
						value = scope:duel_value
						multiplier = 3.5
						min = -49
					}
					desc = fp1_yearly.0021.a.tt_success
					root = {
						send_interface_toast = {
							title = fp1_yearly.0021.a.tt_success
							left_icon = scope:first_knight
							add_hook = {
								type = favor_hook
								target = scope:first_knight
							}
							holmgang_results_effect = {
								WINNER = scope:first_knight
								LOSER = scope:second_knight
							}
						}
					}
				}
				#scope:second_knight wins!
				50 = {
					compare_modifier = {
						value = scope:duel_value
						multiplier = -3.5
						min = -49
					}
					desc = fp1_yearly.0021.a.tt_failure
					root = {
						send_interface_toast = {
							title = fp1_yearly.0021.a.tt_failure
							left_icon = scope:second_knight
							add_hook = {
								type = favor_hook
								target = scope:second_knight
							}
							holmgang_results_effect = {
								WINNER = scope:second_knight
								LOSER = scope:first_knight
							}
						}
					}
				}
			}
		}

		stress_impact = {
			just = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = 0.5
				ai_vengefulness = 0.25
			}
			modifier = {	#Weight up for stress.
				add = 10
				has_trait = just
			}
		}
	}
}

##################################################
# A Mighty Warrior with a Big Personality Arrives
# by Ewan Cowhig Croft
# 0031 - 0040
##################################################

scripted_trigger fp1_0031_any_valid_king_trigger = {
	#Make sure it's a kingdom that's known about.
	in_diplomatic_range = root
	#And that the warrior isn't lying about someone the friend cares for.
	NOR = {
		any_close_or_extended_family_member = { this = root }
		any_spouse = { this = root }
	}
	#We're quite happy to suggest that the warrior is lying, but make sure that it's not an excessively dodgy lie.
	OR = {
		any_child = { count = 0 }
		any_child = {
			count = all
			is_physically_able_adult = yes
		}
	}
}

#	A deceitful warrior is telling tall-tales at court.
fp1_yearly.0031 = {
	type = character_event
	title = fp1_yearly.0031.t
	desc = {
		desc = fp1_yearly.0031.desc.intro
		first_valid = {
			triggered_desc = {
				trigger = { scope:lie_nature = flag:sunk_longboat }
				desc = fp1_yearly.0031.desc.sunk_longboat
			}
			triggered_desc = {
				trigger = { scope:lie_nature = flag:wrestled_whale }
				desc = fp1_yearly.0031.desc.wrestled_whale
			}
			triggered_desc = {
				trigger = {
					scope:lie_nature = flag:charged_city
					exists = scope:fruit_knife
				}
				desc = fp1_yearly.0031.desc.charged_city_fruit_knife
			}
			triggered_desc = {
				trigger = {
					scope:lie_nature = flag:charged_city
					NOT = { exists = scope:fruit_knife }
				}
				desc = fp1_yearly.0031.desc.charged_city
			}
			triggered_desc = {
				trigger = { scope:lie_nature = flag:kept_iceland_afloat }
				desc = fp1_yearly.0031.desc.kept_iceland_afloat
			}
			triggered_desc = {
				trigger = { scope:lie_nature = flag:wooed_heir }
				desc = fp1_yearly.0031.desc.wooed_heir
			}
			triggered_desc = {
				trigger = { scope:lie_nature = flag:hunted_troll }
				desc = fp1_yearly.0031.desc.hunted_troll
			}
		}
		desc = fp1_yearly.0031.desc.outro
	}
	theme = intrigue
	left_portrait = {
		character = root
		animation = toast
		triggered_animation = {
			trigger = {
				has_trait = impatient
			}
			animation = boredom
		}
	}
	right_portrait = {
		character = scope:lying_warrior
		animation = storyteller
	}
	override_background = { reference = feast }

	trigger = {
		#DLC check.
		has_fp1_dlc_trigger = yes
		#Standard checks.
		is_available_even_at_war_adult = yes
		NOT = { has_character_flag = had_event_fp1_yearly_0031 }
		is_landed = yes
		#Must be some form of North Germanic culture.
		culture = { has_cultural_pillar = heritage_north_germanic }
		#And that culture must not be too advanced.
		culture = {
			NOT = { has_cultural_era_or_later = culture_era_high_medieval }
		}
	}

	weight_multiplier = {
		base = 1
	}

	immediate = {
		add_character_flag = {
			flag = had_event_fp1_yearly_0031
			days = 1825
		}
		#Save the capital for loc.
		capital_barony = { save_scope_as = capital_barony }
		#Create our lying warrior.
		create_character = {
			location = root.capital_province
			template = fp1_deceitful_warrior_character
			save_scope_as = lying_warrior
		}
		#Create our actual lie.
		##Six options for roughly 16.6% chance apiece.
		random_list = {
			#Swam home after their longboat sank from too much plunder.
			166 = {
				#Fallback: always available.
				save_scope_value_as = {
					name = lie_nature
					value = flag:sunk_longboat
				}
			}
			#Wrestled a wounded whale ashore single-handed.
			166 = {
				#Fallback: always available.
				save_scope_value_as = {
					name = lie_nature
					value = flag:wrestled_whale
				}
			}
			#Lead the charge on the walls of a great city.
			166 = {
				#Fallback: always available.
				save_scope_value_as = {
					name = lie_nature
					value = flag:charged_city
				}
				#And an Easter egg for Nick.
				random = {
					chance = 1
					save_scope_value_as = {
						name = fruit_knife
						value = yes
					}
					scope:lying_warrior = { give_nickname = nick_the_blessed }
				}
			}
			#Averted giant holmgang that would have sunk Iceland.
			166 = {
				trigger = {
					#Must not have any counties in Iceland, as the news'd travel otherwise.
					NOT = {
						any_realm_de_jure_duchy = { this = title:d_iceland }
					}
				}
				save_scope_value_as = {
					name = lie_nature
					value = flag:kept_iceland_afloat
				}
			}
			#Wooed the child of a foreign king.
			166 = {
				trigger = {
					any_kingdom = {
						is_title_created = yes
						holder = { fp1_0031_any_valid_king_trigger = yes }
					}
				}
				save_scope_value_as = {
					name = lie_nature
					value = flag:wooed_heir
				}
				#Designate a suitable kingdom.
				random_kingdom = {
					limit = {
						is_title_created = yes
						holder = { fp1_0031_any_valid_king_trigger = yes }
					}
					holder = { save_scope_as = disparaged_king }
				}
				#Set dummy appropriate gender.
				## If the faith is generally intolerant, then we invent a heterosexual target.
				if = {
					limit = {
						faith = {
							OR = {
								has_doctrine_parameter = homosexuality_illegal
								has_doctrine_parameter = homosexuality_shunned
							}
						}
					}
					# Then females get a male invention.
					if = {
						limit = {
							scope:lying_warrior = { is_female = yes }
						}
						dummy_male = { save_scope_as = invented_heir }
					}
					# And males get a female invention.
					if = {
						limit = {
							scope:lying_warrior = { is_male = yes }
						}
						dummy_female = { save_scope_as = invented_heir }
					}
				}
				## Otherwise, we randomise.
				else = {
					random_list = {
						100 = {
							dummy_female = { save_scope_as = invented_heir }
						}
						100 = {
							dummy_male = { save_scope_as = invented_heir }
						}
					}
				}
				## Ensure that scope:lying_warrior's preferences line up with their invented target.
				### Note: asexuals not specifically accounted for, since we can't reliably say which way(s) their preferences go, as we don't store that information.
				scope:lying_warrior = {
					if = {
						limit = {
							# Orthodox couplings.
							OR = {
								AND = {
									is_female = yes
									scope:invented_heir = { is_female = yes }
								}
								AND = {
									is_male = yes
									scope:invented_heir = { is_male = yes }
								}
							}
							# But a heterodox preference.
							has_sexuality = heterosexual
						}
						# Randomise scope:lying_warrior's sexuality to match their stories.
						random_list = {
							100 = { set_sexuality = bisexual }
							100 = { set_sexuality = homosexual }
						}
					}
				}
			}
			#Hunted troll.
			166 = {
				#Fallback: always available.
				save_scope_value_as = {
					name = lie_nature
					value = flag:hunted_troll
				}
				#Gotta make it believable.
				scope:lying_warrior = {
					hidden_effect = {
						increase_wounds_effect = { REASON = fight }
					}
				}
			}
		}
	}

	#Invite them to stay permanently.
	option = {
		name = fp1_yearly.0031.a

		add_courtier = scope:lying_warrior

		stress_impact = {
			trusting = minor_stress_impact_loss
			paranoid = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = 0.25
				ai_sociability = 0.25
			}
			modifier = {	#Weight up for stress.
				add = 10
				has_trait = trusting
			}
			modifier = {	#Weight down for stress.
				add = -10
				has_trait = paranoid
			}
		}
	}

	#Question their veracity.
	option = {
		name = fp1_yearly.0031.b

		#Standard intrigue duel; we make it a little easier, since you do have the choice of just gaining a courtier.
		duel = {
			skill = intrigue
			target = scope:lying_warrior
			#You expose their lies.
			60 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = fp1_yearly.0031.b.tt_success
				send_interface_toast = {
					title = fp1_yearly.0031.b.tt_success
					left_icon = scope:lying_warrior
					add_prestige = minor_prestige_gain
					scope:lying_warrior = {
						#Dispose of scope:lying_warrior.
						hidden_effect = {
							death = { death_reason = death_vanished }
						}
					}
				}
			}
			#They run circles around your questions.
			40 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = fp1_yearly.0031.b.tt_failure
				send_interface_toast = {
					title = fp1_yearly.0031.b.tt_failure
					left_icon = scope:lying_warrior
					add_prestige = minor_prestige_loss
					scope:lying_warrior = {
						#Dispose of scope:lying_warrior.
						hidden_effect = {
							death = { death_reason = death_vanished }
						}
					}
				}
			}
		}

		stress_impact = {
			paranoid = medium_stress_impact_loss
			trusting = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_boldness = 0.25
				ai_sociability = -0.5
			}
			modifier = {	#Weight up for stress.
				add = 20
				has_trait = paranoid
			}
			modifier = {	#Weight down for stress.
				add = -20
				has_trait = trusting
			}
		}
	}

	#Tell them to tell people of your generous halls.
	option = {
		name = fp1_yearly.0031.c

		#Get a nice little bonus/negate a negative for being talked up.
		if = {
			limit = { has_character_modifier = stingy_host_fp1_modifier }
			remove_character_modifier = stingy_host_fp1_modifier
		}
		else = {
			add_character_modifier = {
				modifier = generous_host_fp1_modifier
				years = 10
			}
		}

		#Dispose of scope:lying_warrior.
		hidden_effect = {
			scope:lying_warrior = {
				death = { death_reason = death_vanished }
			}
		}

		stress_impact = {
			gregarious = minor_stress_impact_loss
			arrogant = minor_stress_impact_loss
			shy = minor_stress_impact_gain
			humble = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_boldness = 0.25
				ai_sociability = -0.25
			}
			modifier = {	#Weight up for stress.
				add = 10
				has_trait = gregarious
			}
			modifier = {	#Weight up for stress.
				add = 10
				has_trait = arrogant
			}
			modifier = {	#Weight down for stress.
				add = -10
				has_trait = shy
			}
			modifier = {	#Weight down for stress.
				add = -10
				has_trait = humble
			}
		}
	}
}

##################################################
# [Russia/Steppe] Islamic Explorer Visits Court
# by Ewan Cowhig Croft
# 0041 - 0050
##################################################

scripted_trigger suitable_islamic_realm_trigger = {
	#First off, we need people who will consider root a savage.
	NOR = {
		government_has_flag = government_is_tribal
		government_has_flag = government_is_nomadic
	}
	#Next, filter down to the correct religion.
	religion = religion:islam_religion
	#Making sure to only grab rulers from the Middle East.
	capital_province = {
		OR = {
			geographical_region = world_asia_minor
			geographical_region = world_middle_east_jerusalem
			geographical_region = world_middle_east_arabia
			geographical_region = world_middle_east_persia
			geographical_region = world_india_rajastan
		}
	}
	#And then misc checks to make sure that the tone is correct.
	top_liege = {
		NOR = {
			#Such as the liege not having much contact with Germanic Paganism.
			religion = religion:folkgerman_religion
			any_vassal_or_below = { religion = religion:folkgerman_religion }
			#The realm not being positioned next door to root.
			character_is_realm_neighbor = root.top_liege
			#And the realm generally not being inside the same (admittedly large) area.
			any_realm_county = {
				title_province = { geographical_region = dlc_fp1_region_russian_steppe }
			}
		}
	}
}

#	An Islamic explorer stops by for a visit.
fp1_yearly.0041 = {
	type = character_event
	title = fp1_yearly.0041.t
	desc = fp1_yearly.0041.desc
	theme = stewardship
	left_portrait = {
		character = scope:explorer
		animation = disapproval
	}
	right_portrait = {
		character = scope:sponsoring_liege
		animation = personality_rational
	}
	override_background = { reference = throne_room }

	trigger = {
		#DLC check.
		has_fp1_dlc_trigger = yes
		#Standard checks.
		is_available_even_at_war_adult = yes
		NOT = { has_character_flag = had_event_fp1_yearly_0041 }
		is_landed = yes
		#Must be a Norse pagan tribal.
		government_has_flag = government_is_tribal
		religion = religion:folkgerman_religion
		#With a capital in the steppe/Russia.
		capital_province = { geographical_region = dlc_fp1_region_russian_steppe }
		#Just for good measure, you should probably be a small-ish realm.
		realm_size <= medium_realm_size
		#No same-realm Muslims.
		top_liege = {
			NOR = {
				religion = religion:islam_religion
				any_vassal_or_below = { religion = religion:islam_religion }
			}
		}
		#A suitable Islamic realm for the explorer to have come from must exists.
		any_kingdom = {
			holder ?= { suitable_islamic_realm_trigger = yes }
		}
	}

	weight_multiplier = {
		base = 1
	}

	immediate = {
		add_character_flag = {
			flag = had_event_fp1_yearly_0041
			days = 3650
		}
		#Grab home barony for loc.
		capital_barony = { save_scope_as = capital_barony }
		#Assign a home realm for the explorer.
		random_kingdom = {
			limit = {
				holder ?= { suitable_islamic_realm_trigger = yes}
			}
			holder = { save_scope_as = sponsoring_liege }
		}
		#Create the Islamic explorer.
		create_character = {
			location = root.capital_province
			template = fp1_islamic_explorer_character
			save_scope_as = explorer
		}
		hidden_effect = {
			scope:explorer = {
				add_random_tiered_trait_xp_effect = {
					TRAIT = lifestyle_mystic
					LEVEL_1 = yes
					LEVEL_3 = yes
				}
				add_random_tiered_trait_xp_effect = {
					TRAIT = lifestyle_physician
					LEVEL_1 = yes
					LEVEL_3 = yes
				}
			}
		}
	}

	#Host a small blot.
	option = {
		name = fp1_yearly.0041.a

		#Diplomacy duel to see how well you present yourself.
		duel = {
			skill = diplomacy
			value = decent_skill_rating
			#Your blot impresses the explorer.
			40 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = fp1_yearly.0041.a.tt_success
				send_interface_toast = {
					title = fp1_yearly.0041.a.tt_success
					left_icon = scope:explorer
					add_prestige = medium_prestige_gain
					add_character_modifier = {
						modifier = exotic_foreign_lord_fp1_modifier
						years = 10
					}
				}
			}
			#Your pagan ways disgust the explorer.
			60 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = fp1_yearly.0041.a.tt_failure
				send_interface_toast = {
					title = fp1_yearly.0041.a.tt_failure
					left_icon = scope:explorer
					add_prestige = minor_prestige_loss
					add_character_modifier = {
						modifier = horrifying_foreign_lord_fp1_modifier
						years = 5
					}
				}
			}
		}

		stress_impact = {
			zealous = medium_stress_impact_loss
			cynical = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_zeal = 0.5
				ai_sociability = 0.25
			}
			modifier = {	#Weight up for stress.
				add = 20
				has_trait = zealous
			}
			modifier = {	#Weight down for stress.
				add = -20
				has_trait = cynical
			}
		}
	}

	#Invite them to stay and convert you.
	option = {
		name = fp1_yearly.0041.b
		#Prohibit the AI from converting to far-away religions unless they're genuinely very interested in scope:explorer's faith.
		trigger = {
			OR = {
				is_ai = no
				AND = {
					NOR = {
						has_trait = zealous #Zealous characters never convert on a whim.
						has_trait = cynical	#Cynical characters aren't really interested in what anyone is selling.
						has_trait = arrogant #Arrogant characters believe their faith is already the best, even if they don't care much about it.
						has_trait = paranoid #Paranoid characters don't trust scope:explorer's tales.
					}
					OR = {
						has_trait = humble	#Humble characters like to give everyone a fair chance to explain their POV.
						has_trait = trusting #Trusting characters can be talked into many things, given time & charisma.
					}
				}
			}
		}

		#Get scope:explorer as a courtier.
		add_courtier = scope:explorer
		#Sort conversion.
		set_character_faith_with_conversion = scope:explorer.faith
		if = {
			limit = { 
				scope:explorer.faith = { has_doctrine = doctrine_monotheist }
			}
			custom_description_no_bullet = { text = mandala_monotheist_warning_tt }
		}
		#Get scope:sponsoring_liege as a friend, if possible.
		if = {
			limit = {
				can_set_relation_friend_trigger = { CHARACTER = scope:sponsoring_liege }
			}
			set_relation_friend = { reason = friend_converted_explorer target = scope:sponsoring_liege }
			reverse_add_opinion = {
				target = scope:sponsoring_liege
				modifier = pious_opinion
				opinion = 50
			}
		}

		stress_impact = {
			humble = medium_stress_impact_loss
			trusting = major_stress_impact_loss
			paranoid = minor_stress_impact_gain
			arrogant = medium_stress_impact_gain
			zealous = massive_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_boldness = 0.25
				ai_zeal = -0.75
			}
			modifier = {	#Weight up for stress.
				add = 20
				has_trait = humble
			}
			modifier = {	#Weight up for stress.
				add = 30
				has_trait = trusting
			}
			modifier = {	#Weight down for stress.
				add = -10
				has_trait = paranoid
			}
			modifier = {	#Weight down for stress.
				add = -20
				has_trait = arrogant
			}
			modifier = {	#Weight down for stress.
				add = -50
				has_trait = zealous
			}
		}
	}

	#Give them the boot.
	option = {
		name = fp1_yearly.0041.c

		#Consolation prize for giving them the boot.
		## Stress loss handled in stress_impact.

		stress_impact = {
			base = minor_stress_loss
			zealous = minor_stress_impact_loss
			shy = major_stress_impact_loss
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_zeal = -0.25
				ai_sociability = -0.5
			}
			modifier = {	#Weight down for stress.
				add = -10
				has_trait = zealous
			}
			modifier = {	#Weight down for stress.
				add = -30
				has_trait = shy
			}
		}
	}

	#Clean-up characters, if appropriate.
	after = {
		# We use a separate event delayed by a day so that scope:explorer isn't dead in the toasts.
		trigger_event = {
			id = fp1_yearly.0042
			days = 1
		}
	}
}

#	Clean up unused explorer.
fp1_yearly.0042 = {
	hidden = yes

	immediate = {
		#Get rid of scope:explorer, unless they've decided to stay.
		scope:explorer = {
			if = {
				limit = {
					NOT = { is_courtier_of = root }
				}
				hidden_effect = {
					death = { death_reason = death_vanished }
				}
			}
		}
	}
}

##################################################
# [Rural] A Dead Character is Rumoured to have become a Draugr
# by Ewan Cowhig Croft
# 0051 - 0070
##################################################

#	You are informed of the reputed-draugr.
fp1_yearly.0051 = {
	type = character_event
	title = fp1_yearly.0051.t
	desc = fp1_yearly.0051.desc
	theme = unfriendly
	left_portrait = {
		character = scope:draugr
		animation = personality_vengeful
	}
	override_background = { reference = throne_room }

	trigger = {
		#DLC check.
		has_fp1_dlc_trigger = yes
		#Standard checks.
		is_available_even_at_war_adult = yes
		NOT = { has_character_flag = had_event_fp1_yearly_0051 }
		is_landed = yes
		#Must have a draugr candidate ready; this is set on the on_death on_action.
		has_variable = potential_draugr
		#Must be a tribal...
		government_has_flag = government_is_tribal
		#With a rural, North Germanic capital.
		capital_county = {
			#Checking the capital, not the character, since it's a local superstition rather than something ye're insisiting on.
			culture = { has_cultural_pillar = heritage_north_germanic }
			development_level <= terrible_development_level
		}
	}

	weight_multiplier = {
		base = 1
	}

	immediate = {
		add_character_flag = {
			flag = had_event_fp1_yearly_0051
			days = 7300
		}
		#Grab our capital for loc.
		capital_county = { save_scope_as = capital_county }
		#Then grab our draugr.
		var:potential_draugr = { save_scope_as = draugr }
	}

	#Investigate in person.
	option = {
		name = fp1_yearly.0051.a

		#You go off to investigate in person.
		custom_tooltip = fp1_yearly.0051.a.tt
		##5 possible outcomes, weighing down the chance of nothing happening slightly due to low value, gives us x4 options of 22.5% & one of 10%.
		hidden_effect = {
			random_list = {
				#A pack of wolves!
				225 = {
					trigger_event = {
						id = fp1_yearly.0061
						months = 1
					}
				}
				#A fearsome bear!
				225 = {
					trigger_event = {
						id = fp1_yearly.0062
						months = 1
					}
				}
				#A nithing living in the mound!
				225 = {
					trigger_event = {
						id = fp1_yearly.0063
						months = 1
					}
				}
				#An orphan living in the mound!
				225 = {
					trigger_event = {
						id = fp1_yearly.0064
						months = 1
					}
				}
				#Absolutely bugger-all!
				100 = {
					trigger_event = {
						id = fp1_yearly.0065
						months = 1
					}
				}
			}
		}

		stress_impact = {
			diligent = medium_stress_impact_loss
			brave = medium_stress_impact_loss
			lazy = medium_stress_impact_gain
			craven = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_boldness = 0.5
				ai_energy = 0.25
			}
			modifier = {	#Weight up for stress.
				add = 20
				has_trait = diligent
			}
			modifier = {	#Weight down for stress.
				add = 20
				has_trait = brave
			}
			modifier = {	#Weight down for stress.
				add = -20
				has_trait = lazy
			}
			modifier = {	#Weight down for stress.
				add = -20
				has_trait = craven
			}
		}
	}

	#Try various folk solutions.
	option = {
		name = fp1_yearly.0051.c

		#Let's see how your hearth wisdom is, chummer.
		duel = {
			skill = learning
			value = decent_skill_rating
			#Your potions and spells reassure the locals.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = fp1_yearly.0051.c.tt_success
				send_interface_toast = {
					title = fp1_yearly.0051.c.tt_success
					left_icon = scope:draugr
					capital_county = {
						add_county_modifier = {
							modifier = draugr_remedies_succeeded_fp1_modifier
							years = 10
						}
					}
					add_stress = medium_stress_loss
				}
			}
			#Your rituals are insufficient.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = fp1_yearly.0051.c.tt_failure
				send_interface_toast = {
					title = fp1_yearly.0051.c.tt_failure
					left_icon = scope:draugr
					capital_county = {
						add_county_modifier = {
							modifier = draugr_remedies_failed_fp1_modifier
							years = 10
						}
					}
					add_stress = medium_stress_gain
				}
			}
		}

		stress_impact = {
			lazy = minor_stress_impact_loss
			diligent = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = 0.5
				ai_energy = 0.5
			}
			modifier = {	#Weight up for stress.
				add = 10
				has_trait = lazy
			}
			modifier = {	#Weight down for stress.
				add = -10
				has_trait = diligent
			}
		}
	}

	#Have them exhumed and the corpse destroyed.
	option = {
		name = fp1_yearly.0051.b

		#Peasants are happy.
		send_interface_toast = {
			title = fp1_yearly.0051.b.body_destroyed
			left_icon = root
			capital_county = {
				add_county_modifier = {
					modifier = draugr_remedies_succeeded_fp1_modifier
					years = 10
				}
			}
		}

		#But either the family of the deceased are not...
		if = {
			limit = {
				scope:draugr = {
					OR = {
						#Nab their entire house.
						AND = {
							house ?= {
								any_house_member = {
									count >= 1
									is_alive = yes
								}
							}
						}
						#Any close family outside of that house (bastards, house-founder siblings, etc).
						any_close_or_extended_family_member = {
							count >= 1
							is_alive = yes
						}
						#And any spouses still kicking around.
						any_former_spouse = {
							count >= 1
							is_alive = yes
						}
					}
				}
			}
			#Nab scope:draugr's nearest'n'dearest.
			scope:draugr = {
				if = {
					limit = { exists = house }
					house = {
						every_house_member = {
							limit = { is_alive = yes }
							add_to_list = close_to_draugr_list
						}
					}
				}
				every_close_or_extended_family_member = {
					limit = { is_alive = yes }
					add_to_list = close_to_draugr_list
				}
				every_former_spouse = {
					limit = { is_alive = yes }
					add_to_list = close_to_draugr_list
				}
			}
			#And make them unhappy at the thing wot u dun.
			every_in_list = {
				list = close_to_draugr_list
				custom = fp1_yearly.0051.b.list
				add_opinion = {
					target = root
					modifier = fp1_desecrated_corpse_of_loved_one
				}
			}
		}
		#... Or you have to spend a little prestige for defiling the dead.
		else = { add_prestige = medium_prestige_loss }

		stress_impact = {
			vengeful = minor_stress_impact_loss
			callous = medium_stress_impact_loss
			arbitrary = medium_stress_impact_loss
			forgiving = minor_stress_impact_gain
			compassionate = medium_stress_impact_gain
			just = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_vengefulness = 0.25
				ai_compassion = -0.25
				ai_honor = -0.5
			}
			modifier = {	#Weight up for stress.
				add = 10
				has_trait = vengeful
			}
			modifier = {	#Weight up for stress.
				add = 20
				has_trait = callous
			}
			modifier = {	#Weight up for stress.
				add = 20
				has_trait = arbitrary
			}
			modifier = {	#Weight down for stress.
				add = -10
				has_trait = forgiving
			}
			modifier = {	#Weight down for stress.
				add = -20
				has_trait = compassionate
			}
			modifier = {	#Weight down for stress.
				add = -20
				has_trait = just
			}
		}
	}
}

#	The draugr is earmarked.
fp1_yearly.0052 = {
	hidden = yes

	trigger = {
		#DLC check.
		has_fp1_dlc_trigger = yes
		#Must be within the player's court.
		is_knight = yes
		court_owner = { is_ai = no }
		#Must be an intimidating fighter.
		prowess >= extremely_high_skill_rating
		#Aaaaand must have a personality that makes people think they'd come back to harass the living.
		calc_true_if = {
			amount >= 2
			has_trait = wrathful
			has_trait = arrogant
			has_trait = deceitful
			has_trait = craven
			has_trait = ambitious
			has_trait = arbitrary
			has_trait = cynical
			has_trait = vengeful
			has_trait = sadistic
		}
	}

	immediate = {
		save_scope_as = potential_draugr
		court_owner = {
			set_variable = {
				name = potential_draugr
				value = scope:potential_draugr
				years = 5
			}
		}
	}
}

#	The draugr was a pack of wolves!
fp1_yearly.0061 = {
	type = character_event
	title = fp1_yearly.0061.t
	desc = fp1_yearly.0061.desc
	theme = martial
	left_portrait = {
		character = root
		animation = shock
	}
	override_background = { reference = wilderness }

	trigger = {
		is_available_even_at_war_adult = yes
	}

	#Fight the wolves.
	option = {
		name = fp1_yearly.0061.a

		#You rally your soldiers to fight off the pack!
		duel = {
			skill = martial
			value = high_skill_rating
			#You slaughter the pack!
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = fp1_yearly.0061.a.tt_success
				send_interface_toast = {
					title = fp1_yearly.0061.a.tt_success
					left_icon = root
					capital_county = {
						add_county_modifier = {
							modifier = draugr_remedies_succeeded_fp1_modifier
							years = 10
						}
					}
					add_prestige = medium_prestige_gain
				}
			}
			#You barely escape with your life!
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = fp1_yearly.0061.a.tt_failure
				send_interface_toast = {
					title = fp1_yearly.0061.a.tt_failure
					left_icon = root
					capital_county = {
						add_county_modifier = {
							modifier = draugr_monstrous_wolfpack_fp1_modifier
							years = 10
						}
					}
					increase_wounds_effect = { REASON = wolves }
				}
			}
		}

		stress_impact = {
			brave = major_stress_impact_loss
			craven = major_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_boldness = 0.5
				ai_honor = 0.25
			}
			modifier = {	#Weight up for stress.
				add = 30
				has_trait = brave
			}
			modifier = {	#Weight down for stress.
				add = -30
				has_trait = craven
			}
		}
	}

	#Retreat!
	option = {
		name = fp1_yearly.0061.b

		#The wolves will be eating people for some time to come.
		capital_county = {
			add_county_modifier = {
				modifier = draugr_monstrous_wolfpack_fp1_modifier
				years = 10
			}
		}
		#And e'eryone knows why.
		add_prestige = medium_prestige_loss

		stress_impact = {
			craven = major_stress_impact_loss
			brave = major_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = -0.25
				ai_boldness = -0.5
			}
			modifier = {	#Weight up for stress.
				add = 30
				has_trait = craven
			}
			modifier = {	#Weight down for stress.
				add = -30
				has_trait = brave
			}
		}
	}
}

#	The draugr was a bear!
fp1_yearly.0062 = {
	type = character_event
	title = fp1_yearly.0062.t
	desc = fp1_yearly.0062.desc
	theme = martial
	left_portrait = {
		character = root
		animation = shock
	}
	override_background = { reference = wilderness }

	trigger = {
		is_available_even_at_war_adult = yes
	}

	#Fight the bear.
	option = {
		name = fp1_yearly.0062.a

		#You meet the bear's challenge!
		duel = {
			skill = prowess
			value = high_skill_rating
			#You kill the bear!
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = fp1_yearly.0062.a.tt_success
				send_interface_toast = {
					title = fp1_yearly.0062.a.tt_success
					left_icon = root
					capital_county = {
						add_county_modifier = {
							modifier = draugr_remedies_succeeded_fp1_modifier
							years = 10
						}
					}
					add_prestige = medium_prestige_gain
				}
			}
			#You only just escape with your life!
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = fp1_yearly.0062.a.tt_failure
				send_interface_toast = {
					title = fp1_yearly.0062.a.tt_failure
					left_icon = root
					capital_county = {
						add_county_modifier = {
							modifier = draugr_monstrous_bear_fp1_modifier
							years = 10
						}
					}
					increase_wounds_effect = { REASON = bear }
				}
			}
		}

		stress_impact = {
			brave = major_stress_impact_loss
			craven = major_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_boldness = 0.5
				ai_honor = 0.25
			}
			modifier = {	#Weight up for stress.
				add = 30
				has_trait = brave
			}
			modifier = {	#Weight down for stress.
				add = -30
				has_trait = craven
			}
		}
	}

	#Retreat!
	option = {
		name = fp1_yearly.0062.b

		#The bear will be eating people for some time to come.
		capital_county = {
			add_county_modifier = {
				modifier = draugr_monstrous_bear_fp1_modifier
				years = 10
			}
		}
		#And e'eryone knows why.
		add_prestige = medium_prestige_loss

		stress_impact = {
			craven = major_stress_impact_loss
			brave = major_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = -0.25
				ai_boldness = -0.5
			}
			modifier = {	#Weight up for stress.
				add = 30
				has_trait = craven
			}
			modifier = {	#Weight down for stress.
				add = -30
				has_trait = brave
			}
		}
	}
}

#	The draugr was a nithing!
fp1_yearly.0063 = {
	type = character_event
	title = fp1_yearly.0063.t
	desc = fp1_yearly.0063.desc
	theme = intrigue
	left_portrait = {
		character = root
		animation = disgust
	}
	right_portrait = {
		character = scope:draugr_nithing
		animation = shock
	}
	override_background = { reference = wilderness }

	trigger = {
		is_available_even_at_war_adult = yes
	}

	immediate = {
		#Create us a nithing!
		create_character = {
			location = root.capital_province
			template = fp1_capital_county_nithing_character
			save_scope_as = draugr_nithing
		}
		hidden_effect = {
			scope:draugr_nithing = { nithing_character_creation_scripted_effect = yes }
		}
	}

	#Try to catch the nithing before they slip away.
	option = {
		name = fp1_yearly.0063.a

		#You attempt to catch the criminal.
		duel = {
			skill = intrigue
			value = high_skill_rating
			#Your trap works!
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = fp1_yearly.0063.a.tt_success
				send_interface_toast = {
					title = fp1_yearly.0063.a.tt_success
					left_icon = root
					capital_county = {
						add_county_modifier = {
							modifier = draugr_remedies_succeeded_fp1_modifier
							years = 10
						}
					}
					add_prestige = medium_prestige_gain
					#To the dungeon with you, m'nithing.
					imprison = {
						target = scope:draugr_nithing
						type = dungeon
					}
				}
			}
			#The nithing slips the net!
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = fp1_yearly.0063.a.tt_failure
				send_interface_toast = {
					title = fp1_yearly.0063.a.tt_failure
					left_icon = root
					capital_county = {
						add_county_modifier = {
							modifier = draugr_nithing_fp1_modifier
							years = 10
						}
					}
					custom_tooltip = fp1_yearly.0063.a.tt_failure.draugr_nithing_escapes
					hidden_effect = {
						scope:draugr_nithing = {
							death = { death_reason = death_vanished }
						}
					}
				}
			}
		}

		stress_impact = {
			paranoid = minor_stress_impact_loss
			vengeful = medium_stress_impact_loss
			just = medium_stress_impact_loss
			forgiving = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_boldness = 0.5
				ai_honor = 0.25
			}
			modifier = {	#Weight up for stress.
				add = 10
				has_trait = paranoid
			}
			modifier = {	#Weight up for stress.
				add = 20
				has_trait = vengeful
			}
			modifier = {	#Weight up for stress.
				add = 20
				has_trait = just
			}
			modifier = {	#Weight down for stress.
				add = -20
				has_trait = forgiving
			}
		}
	}

	#Leave them to it.
	option = {
		name = fp1_yearly.0063.b

		#The nithing will continue to do your capital a mischief for quite a while.
		capital_county = {
			add_county_modifier = {
				modifier = draugr_nithing_fp1_modifier
				years = 10
			}
		}
		#But at least it's less ignoble than running from wild animals.
		add_prestige = minor_prestige_loss

		stress_impact = {
			just = medium_stress_impact_loss
			vengeful = medium_stress_impact_loss
			arbitrary = minor_stress_impact_gain
			forgiving = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = 0.25
				ai_honor = -0.25
			}
			modifier = {	#Weight up for stress.
				add = 20
				has_trait = just
			}
			modifier = {	#Weight up for stress.
				add = 20
				has_trait = vengeful
			}
			modifier = {	#Weight down for stress.
				add = -10
				has_trait = arbitrary
			}
			modifier = {	#Weight down for stress.
				add = -20
				has_trait = forgiving
			}
		}
	}
}

#	The draugr was an orphan!
fp1_yearly.0064 = {
	type = character_event
	title = fp1_yearly.0064.t
	desc = fp1_yearly.0064.desc
	theme = friendly
	left_portrait = {
		character = root
		animation = shock
	}
	right_portrait = {
		character = scope:draugr_orphan
		animation = fear
	}
	override_background = { reference = wilderness }

	trigger = {
		is_available_even_at_war_adult = yes
	}

	immediate = {
		#Create us an orphan!
		create_character = {
			location = root.capital_province
			template = fp1_capital_county_orphan_character
			save_scope_as = draugr_orphan
		}
		#And every possible result sorts the issue for you.
		capital_county = {
			add_county_modifier = {
				modifier = draugr_remedies_succeeded_fp1_modifier
				years = 10
			}
		}
	}

	#Move them on.
	option = {
		name = fp1_yearly.0064.a

		#The orphan disappears.
		custom_tooltip = fp1_yearly.0064.a.tt
		hidden_effect = {
			scope:draugr_orphan = {
				death = { death_reason = death_vanished }
			}
		}

		stress_impact = {
			sadistic = minor_stress_impact_loss
			callous = major_stress_impact_loss
			compassionate = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = 0.25
				ai_compassion = -0.5
			}
			modifier = {	#Weight up for stress.
				add = 10
				has_trait = sadistic
			}
			modifier = {	#Weight up for stress.
				add = 30
				has_trait = callous
			}
			modifier = {	#Weight down for stress.
				add = -10
				has_trait = compassionate
			}
		}
	}

	#Fling them into prison.
	option = {
		name = fp1_yearly.0064.b

		#You uhh, you get a prisoner.
		imprison = {
			target = scope:draugr_orphan
			type = dungeon
		}
		reverse_add_opinion = {
			target = scope:draugr_orphan
			modifier = imprisoned_me
		}
		#... Just for good measure, let's make sure they won't forget this.
		hidden_effect = { set_relation_potential_rival = scope:draugr_orphan }

		stress_impact = {
			callous = minor_stress_impact_loss
			sadistic = major_stress_impact_loss
			compassionate = major_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_vengefulness = 0.25
				ai_compassion = -0.75
			}
			modifier = {	#Weight up for stress.
				add = 10
				has_trait = callous
			}
			modifier = {	#Weight up for stress.
				add = 30
				has_trait = sadistic
			}
			modifier = {	#Weight down for stress.
				add = -30
				has_trait = compassionate
			}
		}
	}

	#Take them to court.
	option = {
		name = fp1_yearly.0064.c

		#One shiny new child for you.
		add_courtier = scope:draugr_orphan
		#And they're pretty happy about being whisked out of the grave they were living in.
		reverse_add_opinion = {
			target = scope:draugr_orphan
			modifier = loyal_servant
		}
		add_hook = {
			target = scope:draugr_orphan
			type = loyalty_hook
		}

		stress_impact = {
			trusting = minor_stress_impact_loss
			compassionate = major_stress_impact_loss
			paranoid = minor_stress_impact_gain
			callous = medium_stress_impact_gain
			sadistic = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_vengefulness = 0.25
				ai_compassion = -0.75
			}
			modifier = {	#Weight up for stress.
				add = 10
				has_trait = trusting
			}
			modifier = {	#Weight up for stress.
				add = 30
				has_trait = compassionate
			}
			modifier = {	#Weight down for stress.
				add = -10
				has_trait = paranoid
			}
			modifier = {	#Weight down for stress.
				add = -20
				has_trait = callous
			}
			modifier = {	#Weight down for stress.
				add = -20
				has_trait = sadistic
			}
		}
	}

	#Adopt them.
	option = {
		name = fp1_yearly.0064.d
		#And, if you've no kids of your own right now...
		trigger = {
			any_child = {
				count = 0
				is_alive = yes
			}
		}

		#One shiny new child for you.
		if = {
			limit = { is_female = yes }
			scope:draugr_orphan = { set_mother = root }
		}
		else = {
			scope:draugr_orphan = { set_father = root }
		}
		hidden_effect = {
			#We take care of the sundries in a hidden effect so as not to put too much into the tooltip.
			scope:draugr_orphan = { set_house = root.house }
			add_courtier = scope:draugr_orphan
		}
		#And they're pretty happy about being the child of a lord all of a sudden.
		reverse_add_opinion = {
			target = scope:draugr_orphan
			modifier = love_opinion
			opinion = 100
		}
		add_hook = {
			target = scope:draugr_orphan
			type = loyalty_hook
		}

		stress_impact = {
			trusting = medium_stress_impact_loss
			compassionate = massive_stress_impact_loss
			paranoid = medium_stress_impact_gain
			callous = major_stress_impact_gain
			sadistic = major_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_vengefulness = 0.25
				ai_compassion = -0.75
			}
			modifier = {	#Weight up for stress.
				add = 20
				has_trait = trusting
			}
			modifier = {	#Weight up for stress.
				add = 50
				has_trait = compassionate
			}
			modifier = {	#Weight down for stress.
				add = 20
				has_trait = paranoid
			}
			modifier = {	#Weight down for stress.
				add = -30
				has_trait = callous
			}
			modifier = {	#Weight down for stress.
				add = -30
				has_trait = sadistic
			}
		}
	}
}

#	The draugr was... didn't exist!
fp1_yearly.0065 = {
	type = character_event
	title = fp1_yearly.0065.t
	desc = fp1_yearly.0065.desc
	theme = physical_health
	left_portrait = {
		character = root
		animation = boredom
	}
	override_background = { reference = wilderness }

	trigger = {
		is_available_even_at_war_adult = yes
	}

	#Must have been the wind?
	option = {
		name = fp1_yearly.0065.a

		#Welp, at least the fresh air does you good!
		add_character_modifier = {
			modifier = draugr_healthy_hiking_fp1_modifier
			years = 10
		}


		#The locals grumble a little regardless.
		send_interface_toast = {
			title = fp1_yearly.0065.a.locals_grumble
			left_icon = root
			capital_county = {
				add_county_modifier = {
					modifier = draugr_nothing_found_fp1_modifier
					years = 10
				}
			}
		}

		stress_impact = {
			#Usually bad form to give stress in one-event options, but it's a little funny to see your character's reaction to there being literally nothing to see.
			trusting = miniscule_stress_impact_loss
			paranoid = miniscule_stress_impact_gain
		}
		ai_chance = {
			#Only option.
			base = 100
		}
	}
}

##################################################
# The Deep Places of the World
# by Ewan Cowhig Croft
# 0071 - 0090
##################################################

scripted_trigger fp1_0071_loveli_lakes_trigger = {
	has_trait = shieldmaiden
	is_courtier_of = root
	is_available_ai_adult = yes
	is_healthy = yes
}

scripted_trigger fp1_0071_valid_marshal_for_delegation_trigger = {
	exists = this
	is_available_ai_adult = yes
}

scripted_effect fp1_0071_apply_hungry_troll_modifier_effect = {
	capital_county = {
		add_county_modifier = {
			modifier = fp1_yearly_0071_troll_attacks_modifier
			years = 30
		}
	}
}

#	[Rural] A Troll has been sighted & is attacking villages/peasants
fp1_yearly.0071 = {
	type = character_event
	title = fp1_yearly.0071.t
	desc = {
		desc = fp1_yearly.0071.desc.intro
		# Troll type.
		first_valid = {
			# A towering bear.
			triggered_desc = {
				trigger = { scope:troll_type = flag:bear }
				desc = fp1_yearly.0071.desc.troll_type.bear
			}
			# An ancient wolf.
			triggered_desc = {
				trigger = { scope:troll_type = flag:wolf }
				desc = fp1_yearly.0071.desc.troll_type.wolf
			}
			# A colossal wolverine.
			triggered_desc = {
				trigger = { scope:troll_type = flag:wolverine }
				desc = fp1_yearly.0071.desc.troll_type.wolverine
			}
			# A stealthy lynx.
			triggered_desc = {
				trigger = { scope:troll_type = flag:lynx }
				desc = fp1_yearly.0071.desc.troll_type.lynx
			}
			# An enraged moose.
			triggered_desc = {
				trigger = { scope:troll_type = flag:moose }
				desc = fp1_yearly.0071.desc.troll_type.moose
			}
		}
		# Outro type.
		first_valid = {
			triggered_desc = {
				trigger = { exists = scope:loveli_lakes }
				desc = fp1_yearly.0071.desc.outro.loveli_lakes
			}
			desc = fp1_yearly.0071.desc.outro.fallback
		}
	}
	theme = hunting
	left_portrait = {
		character = root
		animation = disbelief
	}
	right_portrait = {
		character = scope:marshal
		animation = dismissal
	}
	lower_left_portrait = scope:loveli_lakes
	override_background = { reference = throne_room }

	trigger = {
		# DLC check.
		has_fp1_dlc_trigger = yes
		# Standard checks.
		is_available_even_at_war_adult = yes
		NOT = { has_character_flag = had_event_fp1_yearly_0071 }
		is_landed = yes
		# Must be a tribal in Scandinavia.
		government_has_flag = government_is_tribal
		fp1_is_in_scandinavia = yes
		# With a rural, North Germanic capital.
		capital_county = {
			# Checking the capital, not the character, since it's a local superstition rather than something ye're insisiting on.
			culture = { has_cultural_pillar = heritage_north_germanic }
			development_level <= terrible_development_level
			# And ensure it doesn't already have a troll problem.
			NOT = { has_county_modifier = fp1_yearly_0071_troll_attacks_modifier }
		}
	}

	weight_multiplier = {
		base = 1

		# Weight down a little if you're a hunter, since it means you're probably trimming the local wildlife down quite dramatically.
		modifier = {
			add = -0.5
			has_trait = lifestyle_hunter
		}
	}

	immediate = {
		add_character_flag = {
			flag = had_event_fp1_yearly_0071
			days = 1825
		}
		# Roll to determine what type of beast we get.
		## Five options of 20% each.
		random_list = {
			# A towering bear.
			200 = {
				save_scope_value_as = {
					name = troll_type
					value = flag:bear
				}
			}
			# An ancient wolf.
			200 = {
				save_scope_value_as = {
					name = troll_type
					value = flag:wolf
				}
			}
			# A colossal wolverine.
			200 = {
				save_scope_value_as = {
					name = troll_type
					value = flag:wolverine
				}
			}
			# A stealthy lynx.
			200 = {
				save_scope_value_as = {
					name = troll_type
					value = flag:lynx
				}
			}
			# An enraged moose.
			200 = {
				save_scope_value_as = {
					name = troll_type
					value = flag:moose
				}
			}
		}
		## Did a møøse bite root's sister?
		if = {
			limit = {
				scope:troll_type = flag:moose
				# We could go for a more complex implementation, but as we want to keep the meme rare (and therefore less stale), we hard-lock it down to just shieldmaidens.
				any_sibling = { fp1_0071_loveli_lakes_trigger = yes }
			}
			random_sibling = {
				limit = { fp1_0071_loveli_lakes_trigger = yes }
				save_scope_as = loveli_lakes
			}
		}
		# Grab the martial, if possible, for delegation.
		if = {
			limit = {
				any_martial_councillor = { fp1_0071_valid_marshal_for_delegation_trigger = yes }
			}
			random_martial_councillor = {
				limit = { fp1_0071_valid_marshal_for_delegation_trigger = yes }
				save_scope_as = marshal
			}
		}
	}

	# I'll kill the beast myself!
	option = {
		name = fp1_yearly.0071.a

		# Inform root that they'll get a follow-up event.
		custom_tooltip = fp1_yearly.0071.a.tt
		# Calc which event to send out.
		## A towering bear.
		if = {
			limit = { scope:troll_type = flag:bear }
			trigger_event = {
				id = fp1_yearly.0081
				days = 14
			}
		}
		## An ancient wolf.
		else_if = {
			limit = { scope:troll_type = flag:wolf }
			trigger_event = {
				id = fp1_yearly.0082
				days = 14
			}
		}
		## A colossal wolverine.
		else_if = {
			limit = { scope:troll_type = flag:wolverine }
			trigger_event = {
				id = fp1_yearly.0083
				days = 14
			}
		}
		## A stealthy lynx.
		else_if = {
			limit = { scope:troll_type = flag:lynx }
			trigger_event = {
				id = fp1_yearly.0084
				days = 14
			}
		}
		## An enraged moose.
		else = {
			trigger_event = {
				id = fp1_yearly.0085
				days = 14
			}
		}

		stress_impact = {
			brave = minor_stress_impact_loss
			craven = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = 0.5
				ai_vengefulness = 0.5
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = brave
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = craven
			}
		}
	}

	# Scope:marshal, take care of this.
	option = {
		name = fp1_yearly.0071.b
		trigger = { exists = scope:marshal }

		# Martial duel for the marshal.
		scope:marshal = {
			duel = {
				skill = martial
				value = very_high_skill_rating
				# Your marshal and their troops hunt down the beast.
				50 = {
					compare_modifier = {
						value = scope:duel_value
						multiplier = 3.5
						min = -49
					}
					desc = fp1_yearly.0071.b.tt_success
					root = {
						send_interface_toast = {
							title = fp1_yearly.0071.b.tt_success
							left_icon = scope:marshal
							# Huzzah! Everyone's a hero!
							scope:marshal = { add_prestige = major_prestige_gain }
							add_prestige = medium_prestige_gain
						}
					}
				}
				# The beast eludes scope:marshal and continues to stalk the province.
				50 = {
					compare_modifier = {
						value = scope:duel_value
						multiplier = -3.5
						min = -49
					}
					desc = fp1_yearly.0071.b.tt_failure
					root = {
						send_interface_toast = {
							title = fp1_yearly.0071.b.tt_failure
							left_icon = scope:marshal
							# Welp, that's a lot of failure involved for everyone.
							scope:marshal = { add_prestige = major_prestige_loss }
							add_prestige = medium_prestige_loss
							# Capital_county isn't happy.
							fp1_0071_apply_hungry_troll_modifier_effect = yes
						}
					}
				}
			}
		}

		stress_impact = {
			craven = minor_stress_impact_loss
			lazy = medium_stress_impact_loss
			brave = minor_stress_impact_gain
			diligent = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = -0.25
				ai_energy = -0.5
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = craven
			}
			modifier = {	# Weight up for stress.
				add = 20
				has_trait = lazy
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = brave
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = diligent
			}
		}
	}

	# It's probably just a bear. Deal with it yourselves, cravens.
	option = {
		name = fp1_yearly.0071.c

		# Gain some prestige for your toughness.
		add_prestige = minor_prestige_gain
		# But your capital county is upset.
		fp1_0071_apply_hungry_troll_modifier_effect = yes

		stress_impact = {
			cynical = minor_stress_impact_loss
			craven = medium_stress_impact_loss
			brave = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_vengefulness = -0.25
				ai_honor = -0.5
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = cynical
			}
			modifier = {	# Weight up for stress.
				add = 20
				has_trait = craven
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = brave
			}
		}
	}
}

scripted_effect fp1_0081_invalidation_toast_effect = {
	send_interface_toast = {
		title = fp1_yearly.0081.hunt_invalidated
		left_icon = root
		custom_tooltip = fp1_yearly.0081.hunt_invalidated.tt
	}
}

scripted_effect fp1_0081_troll_duel_victory_effect = {
	# Add unique character modifier.
	add_character_modifier = {
		modifier = $MODIFIER$
		years = 20
	}
	# And prestige.
	add_prestige = major_prestige_gain
	# Low chance for characters to become styled "Troll-Slayer".
	if = {
		limit = {
			has_any_nickname = no
			AND = {
				has_bad_nickname = yes
				is_ai = yes
			}
		}
		random = {
			chance = 25
			give_nickname = nick_troll_slayer
		}
	}
	# Or automatically if they're players with bad nicknames.
	else_if = {
		limit = {
			has_bad_nickname = yes
			is_ai = no
		}
		give_nickname = nick_troll_slayer
	}
}

scripted_effect fp1_0081_troll_duel_effect = {
	duel = {
		skill = prowess
		value = high_skill_rating
		# You murderise the animal.
		50 = {
			compare_modifier = {
				value = scope:duel_value
				multiplier = 3.5
				min = -49
			}
			desc = $SUCCESS_TITLE$
			send_interface_toast = {
				title = $SUCCESS_TITLE$
				left_icon = root
				# Apply victory effects.
				fp1_0081_troll_duel_victory_effect = { MODIFIER = $MODIFIER$ }
			}
		}
		# The animal wounds you and your retinue carries you off.
		50 = {
			compare_modifier = {
				value = scope:duel_value
				multiplier = -3.5
				min = -49
			}
			desc = $FAILURE_TITLE$
			send_interface_toast = {
				title = $FAILURE_TITLE$
				left_icon = root
				# Capital_county is unhappy.
				fp1_0071_apply_hungry_troll_modifier_effect = yes
				# The beast kills you.
				death = { death_reason = $REASON$ }
			}
		}
	}
}

scripted_effect fp1_0081_troll_duel_alternate_effect = {
	duel = {
		skill = $SKILL$
		value = high_skill_rating
		# You murderise the animal.
		50 = {
			compare_modifier = {
				value = scope:duel_value
				multiplier = 3.5
				min = -49
			}
			desc = $SUCCESS_TITLE$
			send_interface_toast = {
				title = $SUCCESS_TITLE$
				left_icon = root
				# Apply victory effects.
				fp1_0081_troll_duel_victory_effect = { MODIFIER = $MODIFIER$ }
			}
		}
		# The animal wounds you and your retinue carries you off.
		50 = {
			compare_modifier = {
				value = scope:duel_value
				multiplier = -3.5
				min = -49
			}
			desc = $FAILURE_TITLE$
			send_interface_toast = {
				title = $FAILURE_TITLE$
				left_icon = root
				# The beast merely maims you.
				custom_tooltip = $FAILURE_TITLE$.tt
				hidden_effect = { maimed_in_battle_effect = yes }
				# Capital_county is unhappy.
				fp1_0071_apply_hungry_troll_modifier_effect = yes
			}
		}
	}
}

scripted_effect fp1_0081_flee_option_effect = {
	# Lose prestige.
	add_prestige = medium_prestige_loss
	# Your capital county doesn't do too well, either.
	fp1_0071_apply_hungry_troll_modifier_effect = yes
}

#	Troll: towering bear.
fp1_yearly.0081 = {
	type = character_event
	title = fp1_yearly.0081.t
	desc = fp1_yearly.0081.desc
	theme = hunting
	left_portrait = {
		character = root
		animation = shock
	}

	trigger = {
		# DLC check.
		has_fp1_dlc_trigger = yes
		# Standard checks.
		is_available_even_at_war_adult = yes
		is_landed = yes
		# Must be a tribal...
		government_has_flag = government_is_tribal
		# With a rural, North Germanic capital.
		capital_county = {
			# Checking the capital, not the character, since it's a local superstition rather than something ye're insisiting on.
			culture = { has_cultural_pillar = heritage_north_germanic }
			development_level <= terrible_development_level
		}
	}

	on_trigger_fail = { fp1_0081_invalidation_toast_effect = yes }

	immediate = { play_music_cue = "mx_cue_combat_stinger" }

	# Charge in, blade swinging.
	option = {
		name = fp1_yearly.0081.a
		trigger = {
			NOT = { has_trait = berserker }
		}

		# Risky prowess duel.
		fp1_0081_troll_duel_effect = {
			SUCCESS_TITLE = fp1_yearly.0081.a.tt_success
			FAILURE_TITLE = fp1_yearly.0081.a.tt_failure
			MODIFIER = fp1_yearly_0071_troll_victory_bear_modifier
			REASON = death_bear
		}

		#We need to check that they didn't die - if we apply stress to a dead character the error-log complains
		if = {
			limit = {
				is_alive = yes
			}
			stress_impact = {
				brave = major_stress_impact_loss
				craven = major_stress_impact_gain
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = 0.5
				ai_vengefulness = 0.5
			}
			modifier = {	# Weight up for stress.
				add = 30
				has_trait = brave
			}
			modifier = {	# Weight down for stress.
				add = -30
				has_trait = craven
			}
		}
	}

	# (Berserker) Auto-win due to Hulkery.
	option = {
		name = fp1_yearly.0081.b
		trigger = { has_trait = berserker }
		trait = berserker

		# Explain what's happening.
		custom_tooltip = fp1_yearly.0081.b.tt
		# And apply victory effects.
		fp1_0081_troll_duel_victory_effect = { MODIFIER = fp1_yearly_0071_troll_victory_bear_modifier }

		stress_impact = {
			berserker = massive_stress_impact_loss
			wrathful = major_stress_impact_loss
			calm = major_stress_impact_gain
		}
		ai_chance = {
			# The AI should basically always take this option, since it's both an automatic win and something representing a sudden & total loss of control.
			base = 10000
		}
	}

	# Diplomacy: at it, Wolves of [Capital]!
	option = {
		name = fp1_yearly.0081.c

		# Risky diplomacy duel.
		fp1_0081_troll_duel_alternate_effect = {
			SKILL = diplomacy
			SUCCESS_TITLE = fp1_yearly.0081.c.tt_success
			FAILURE_TITLE = fp1_yearly.0081.c.tt_failure
			MODIFIER = fp1_yearly_0071_troll_victory_bear_modifier
		}

		stress_impact = {
			brave = medium_stress_impact_loss
			craven = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 0.5
				ai_vengefulness = 0.5
				ai_honor = 0.25
			}
			modifier = {	# Weight up for stress.
				add = 30
				has_trait = brave
			}
			modifier = {	# Weight down for stress.
				add = -30
				has_trait = craven
			}
		}
	}

	# FLEE!
	option = {
		name = fp1_yearly.0081.d

		# Apply flee effects.
		fp1_0081_flee_option_effect = yes

		stress_impact = {
			craven = major_stress_impact_loss
			brave = major_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = -0.5
				ai_vengefulness = -0.5
			}
			modifier = {	# Weight up for stress; weight up even further for cravens not wanting to immediately die.
				add = 1000
				has_trait = craven
			}
			modifier = {	# Weight down for stress.
				add = -30
				has_trait = brave
			}
		}
	}
}

#	Troll: ancient wolf.
fp1_yearly.0082 = {
	type = character_event
	title = fp1_yearly.0082.t
	desc = fp1_yearly.0082.desc
	theme = hunting
	left_portrait = {
		character = root
		animation = shock
	}

	trigger = {
		# DLC check.
		has_fp1_dlc_trigger = yes
		# Standard checks.
		is_available_even_at_war_adult = yes
		is_landed = yes
		# Must be a tribal...
		government_has_flag = government_is_tribal
		# With a rural, North Germanic capital.
		capital_county = {
			# Checking the capital, not the character, since it's a local superstition rather than something ye're insisiting on.
			culture = { has_cultural_pillar = heritage_north_germanic }
			development_level <= terrible_development_level
		}
	}

	on_trigger_fail = { fp1_0081_invalidation_toast_effect = yes }

	immediate = { play_music_cue = "mx_cue_combat_stinger" }

	# Charge in, blade swinging.
	option = {
		name = fp1_yearly.0082.a
		trigger = {
			NOT = { has_trait = berserker }
		}

		# Risky prowess duel.
		fp1_0081_troll_duel_effect = {
			SUCCESS_TITLE = fp1_yearly.0082.a.tt_success
			FAILURE_TITLE = fp1_yearly.0082.a.tt_failure
			MODIFIER = fp1_yearly_0071_troll_victory_wolf_modifier
			REASON = death_wolf
		}

		#We need to check that they didn't die - if we apply stress to a dead character the error-log complains
		if = {
			limit = {
				is_alive = yes
			}
			stress_impact = {
				brave = major_stress_impact_loss
				craven = major_stress_impact_gain
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = 0.5
				ai_vengefulness = 0.5
			}
			modifier = {	# Weight up for stress.
				add = 30
				has_trait = brave
			}
			modifier = {	# Weight down for stress.
				add = -30
				has_trait = craven
			}
		}
	}

	# (Berserker) Auto-win due to Hulkery.
	option = {
		name = fp1_yearly.0082.b
		trigger = { has_trait = berserker }
		trait = berserker

		# Explain what's happening.
		custom_tooltip = fp1_yearly.0082.b.tt
		# And apply victory effects.
		fp1_0081_troll_duel_victory_effect = { MODIFIER = fp1_yearly_0071_troll_victory_wolf_modifier }

		stress_impact = {
			berserker = massive_stress_impact_loss
			wrathful = major_stress_impact_loss
			calm = major_stress_impact_gain
		}
		ai_chance = {
			# The AI should basically always take this option, since it's both an automatic win and something representing a sudden & total loss of control.
			base = 10000
		}
	}

	# Martial: rally! Form a circle!
	option = {
		name = fp1_yearly.0082.c

		# Risky martial duel.
		fp1_0081_troll_duel_alternate_effect = {
			SKILL = martial
			SUCCESS_TITLE = fp1_yearly.0082.c.tt_success
			FAILURE_TITLE = fp1_yearly.0082.c.tt_failure
			MODIFIER = fp1_yearly_0071_troll_victory_wolf_modifier
		}

		stress_impact = {
			brave = medium_stress_impact_loss
			craven = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 0.5
				ai_vengefulness = 0.5
				ai_honor = 0.25
			}
			modifier = {	# Weight up for stress.
				add = 30
				has_trait = brave
			}
			modifier = {	# Weight down for stress.
				add = -30
				has_trait = craven
			}
		}
	}

	# FLEE!
	option = {
		name = fp1_yearly.0082.d

		# Apply flee effects.
		fp1_0081_flee_option_effect = yes

		stress_impact = {
			craven = major_stress_impact_loss
			brave = major_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = -0.5
				ai_vengefulness = -0.5
			}
			modifier = {	# Weight up for stress; weight up even further for cravens not wanting to immediately die.
				add = 1000
				has_trait = craven
			}
			modifier = {	# Weight down for stress.
				add = -30
				has_trait = brave
			}
		}
	}
}

#	Troll: colossal wolverine.
fp1_yearly.0083 = {
	type = character_event
	title = fp1_yearly.0083.t
	desc = fp1_yearly.0083.desc
	theme = hunting
	left_portrait = {
		character = root
		animation = shock
	}

	trigger = {
		# DLC check.
		has_fp1_dlc_trigger = yes
		# Standard checks.
		is_available_even_at_war_adult = yes
		is_landed = yes
		# Must be a tribal...
		government_has_flag = government_is_tribal
		# With a rural, North Germanic capital.
		capital_county = {
			# Checking the capital, not the character, since it's a local superstition rather than something ye're insisiting on.
			culture = { has_cultural_pillar = heritage_north_germanic }
			development_level <= terrible_development_level
		}
	}

	on_trigger_fail = { fp1_0081_invalidation_toast_effect = yes }

	immediate = { play_music_cue = "mx_cue_combat_stinger" }

	# Charge in, blade swinging.
	option = {
		name = fp1_yearly.0083.a
		trigger = {
			NOT = { has_trait = berserker }
		}

		# Risky prowess duel.
		fp1_0081_troll_duel_effect = {
			SUCCESS_TITLE = fp1_yearly.0083.a.tt_success
			FAILURE_TITLE = fp1_yearly.0083.a.tt_failure
			MODIFIER = fp1_yearly_0071_troll_victory_wolverine_modifier
			REASON = death_wolverine
		}

		#We need to check that they didn't die - if we apply stress to a dead character the error-log complains
		if = {
			limit = {
				is_alive = yes
			}
			stress_impact = {
				brave = major_stress_impact_loss
				craven = major_stress_impact_gain
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = 0.5
				ai_vengefulness = 0.5
			}
			modifier = {	# Weight up for stress.
				add = 30
				has_trait = brave
			}
			modifier = {	# Weight down for stress.
				add = -30
				has_trait = craven
			}
		}
	}

	# (Berserker) Auto-win due to Hulkery.
	option = {
		name = fp1_yearly.0083.b
		trigger = { has_trait = berserker }
		trait = berserker

		# Explain what's happening.
		custom_tooltip = fp1_yearly.0083.b.tt
		# And apply victory effects.
		fp1_0081_troll_duel_victory_effect = { MODIFIER = fp1_yearly_0071_troll_victory_wolverine_modifier }

		stress_impact = {
			berserker = massive_stress_impact_loss
			wrathful = major_stress_impact_loss
			calm = major_stress_impact_gain
		}
		ai_chance = {
			# The AI should basically always take this option, since it's both an automatic win and something representing a sudden & total loss of control.
			base = 10000
		}
	}

	# Stewardship: there's a lodge near here, fall back for reinforcements!
	option = {
		name = fp1_yearly.0083.c

		# Risky stewardship duel.
		fp1_0081_troll_duel_alternate_effect = {
			SKILL = stewardship
			SUCCESS_TITLE = fp1_yearly.0083.c.tt_success
			FAILURE_TITLE = fp1_yearly.0083.c.tt_failure
			MODIFIER = fp1_yearly_0071_troll_victory_wolverine_modifier
		}

		stress_impact = {
			brave = medium_stress_impact_loss
			craven = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 0.5
				ai_vengefulness = 0.5
				ai_honor = 0.25
			}
			modifier = {	# Weight up for stress.
				add = 30
				has_trait = brave
			}
			modifier = {	# Weight down for stress.
				add = -30
				has_trait = craven
			}
		}
	}

	# FLEE!
	option = {
		name = fp1_yearly.0083.d

		# Apply flee effects.
		fp1_0081_flee_option_effect = yes

		stress_impact = {
			craven = major_stress_impact_loss
			brave = major_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = -0.5
				ai_vengefulness = -0.5
			}
			modifier = {	# Weight up for stress; weight up even further for cravens not wanting to immediately die.
				add = 1000
				has_trait = craven
			}
			modifier = {	# Weight down for stress.
				add = -30
				has_trait = brave
			}
		}
	}
}

#	Troll: stealthy lynx.
fp1_yearly.0084 = {
	type = character_event
	title = fp1_yearly.0084.t
	desc = fp1_yearly.0084.desc
	theme = hunting
	left_portrait = {
		character = root
		animation = shock
	}

	trigger = {
		# DLC check.
		has_fp1_dlc_trigger = yes
		# Standard checks.
		is_available_even_at_war_adult = yes
		is_landed = yes
		# Must be a tribal...
		government_has_flag = government_is_tribal
		# With a rural, North Germanic capital.
		capital_county = {
			# Checking the capital, not the character, since it's a local superstition rather than something ye're insisiting on.
			culture = { has_cultural_pillar = heritage_north_germanic }
			development_level <= terrible_development_level
		}
	}

	on_trigger_fail = { fp1_0081_invalidation_toast_effect = yes }

	immediate = { play_music_cue = "mx_cue_combat_stinger" }

	# Charge in, blade swinging.
	option = {
		name = fp1_yearly.0084.a
		trigger = {
			NOT = { has_trait = berserker }
		}

		# Risky prowess duel.
		fp1_0081_troll_duel_effect = {
			SUCCESS_TITLE = fp1_yearly.0084.a.tt_success
			FAILURE_TITLE = fp1_yearly.0084.a.tt_failure
			MODIFIER = fp1_yearly_0071_troll_victory_lynx_modifier
			REASON = death_lynx
		}

		#We need to check that they didn't die - if we apply stress to a dead character the error-log complains
		if = {
			limit = {
				is_alive = yes
			}
			stress_impact = {
				brave = major_stress_impact_loss
				craven = major_stress_impact_gain
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = 0.5
				ai_vengefulness = 0.5
			}
			modifier = {	# Weight up for stress.
				add = 30
				has_trait = brave
			}
			modifier = {	# Weight down for stress.
				add = -30
				has_trait = craven
			}
		}
	}

	# (Berserker) Auto-win due to Hulkery.
	option = {
		name = fp1_yearly.0084.b
		trigger = { has_trait = berserker }
		trait = berserker

		# Explain what's happening.
		custom_tooltip = fp1_yearly.0084.b.tt
		# And apply victory effects.
		fp1_0081_troll_duel_victory_effect = { MODIFIER = fp1_yearly_0071_troll_victory_lynx_modifier }

		stress_impact = {
			berserker = massive_stress_impact_loss
			wrathful = major_stress_impact_loss
			calm = major_stress_impact_gain
		}
		ai_chance = {
			# The AI should basically always take this option, since it's both an automatic win and something representing a sudden & total loss of control.
			base = 10000
		}
	}

	# Intrigue: quiet; you two flank it, we'll flush it towards you...
	option = {
		name = fp1_yearly.0084.c

		# Risky diplomacy duel.
		fp1_0081_troll_duel_alternate_effect = {
			SKILL = intrigue
			SUCCESS_TITLE = fp1_yearly.0084.c.tt_success
			FAILURE_TITLE = fp1_yearly.0084.c.tt_failure
			MODIFIER = fp1_yearly_0071_troll_victory_lynx_modifier
		}

		stress_impact = {
			brave = medium_stress_impact_loss
			craven = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 0.5
				ai_vengefulness = 0.5
				ai_honor = 0.25
			}
			modifier = {	# Weight up for stress.
				add = 30
				has_trait = brave
			}
			modifier = {	# Weight down for stress.
				add = -30
				has_trait = craven
			}
		}
	}

	# FLEE!
	option = {
		name = fp1_yearly.0084.d

		# Apply flee effects.
		fp1_0081_flee_option_effect = yes

		stress_impact = {
			craven = major_stress_impact_loss
			brave = major_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = -0.5
				ai_vengefulness = -0.5
			}
			modifier = {	# Weight up for stress; weight up even further for cravens not wanting to immediately die.
				add = 1000
				has_trait = craven
			}
			modifier = {	# Weight down for stress.
				add = -30
				has_trait = brave
			}
		}
	}
}

#	Troll: enraged moose.
fp1_yearly.0085 = {
	type = character_event
	title = fp1_yearly.0085.t
	desc = {
		# Account for sibling violence.
		first_valid = {
			triggered_desc = {
				trigger = { exists = scope:loveli_lakes }
				desc = fp1_yearly.0085.desc.loveli_lakes
			}
			desc = fp1_yearly.0085.desc.fallback
		}
	}
	theme = hunting
	left_portrait = {
		character = root
		animation = shock
	}
	right_portrait = {
		character = scope:loveli_lakes
		animation = anger
	}

	trigger = {
		# DLC check.
		has_fp1_dlc_trigger = yes
		# Standard checks.
		is_available_even_at_war_adult = yes
		is_landed = yes
		# Must be a tribal...
		government_has_flag = government_is_tribal
		# With a rural, North Germanic capital.
		capital_county = {
			# Checking the capital, not the character, since it's a local superstition rather than something ye're insisiting on.
			culture = { has_cultural_pillar = heritage_north_germanic }
			development_level <= terrible_development_level
		}
	}

	on_trigger_fail = { fp1_0081_invalidation_toast_effect = yes }

	immediate = { play_music_cue = "mx_cue_combat_stinger" }

	# Charge in, blade swinging.
	option = {
		name = fp1_yearly.0085.a
		trigger = {
			NOT = { has_trait = berserker }
		}

		# Risky prowess duel.
		fp1_0081_troll_duel_effect = {
			SUCCESS_TITLE = fp1_yearly.0085.a.tt_success
			FAILURE_TITLE = fp1_yearly.0085.a.tt_failure
			MODIFIER = fp1_yearly_0071_troll_victory_moose_modifier
			REASON = death_moose
		}

		#We need to check that they didn't die - if we apply stress to a dead character the error-log complains
		if = {
			limit = {
				is_alive = yes
			}
			stress_impact = {
				brave = major_stress_impact_loss
				craven = major_stress_impact_gain
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = 0.5
				ai_vengefulness = 0.5
			}
			modifier = {	# Weight up for stress.
				add = 30
				has_trait = brave
			}
			modifier = {	# Weight down for stress.
				add = -30
				has_trait = craven
			}
		}
	}

	# (Berserker) Auto-win due to Hulkery.
	option = {
		name = fp1_yearly.0085.b
		trigger = { has_trait = berserker }
		trait = berserker

		# Explain what's happening.
		custom_tooltip = fp1_yearly.0085.b.tt
		# And apply victory effects.
		fp1_0081_troll_duel_victory_effect = { MODIFIER = fp1_yearly_0071_troll_victory_moose_modifier }

		stress_impact = {
			berserker = massive_stress_impact_loss
			wrathful = major_stress_impact_loss
			calm = major_stress_impact_gain
		}
		ai_chance = {
			# The AI should basically always take this option, since it's both an automatic win and something representing a sudden & total loss of control.
			base = 10000
		}
	}

	# Learning: remember its weak spot, spears and bows only!
	option = {
		name = fp1_yearly.0085.c

		# Risky learning duel.
		fp1_0081_troll_duel_alternate_effect = {
			SKILL = learning
			SUCCESS_TITLE = fp1_yearly.0085.c.tt_success
			FAILURE_TITLE = fp1_yearly.0085.c.tt_failure
			MODIFIER = fp1_yearly_0071_troll_victory_moose_modifier
		}

		stress_impact = {
			brave = medium_stress_impact_loss
			craven = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 0.5
				ai_vengefulness = 0.5
				ai_honor = 0.25
			}
			modifier = {	# Weight up for stress.
				add = 30
				has_trait = brave
			}
			modifier = {	# Weight down for stress.
				add = -30
				has_trait = craven
			}
		}
	}

	# FLEE!
	option = {
		name = fp1_yearly.0085.d

		# Apply flee effects.
		fp1_0081_flee_option_effect = yes

		stress_impact = {
			craven = major_stress_impact_loss
			brave = major_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = -0.5
				ai_vengefulness = -0.5
			}
			modifier = {	# Weight up for stress; weight up even further for cravens not wanting to immediately die.
				add = 1000
				has_trait = craven
			}
			modifier = {	# Weight down for stress.
				add = -30
				has_trait = brave
			}
		}
	}
}

##################################################
# A Ship fit for a [ROOT.Char.GetTitleAsName]
# by Ewan Cowhig Croft
# 0090 - 0100
##################################################

#	Commissioning a Longship for Yourself
fp1_yearly.0091 = {
	type = character_event
	title = fp1_yearly.0091.t
	desc = fp1_yearly.0091.desc
	theme = martial
	left_portrait = {
		character = root
		animation = personality_rational
	}
	override_background = { reference = fp1_beached_longships }

	trigger = {
		# DLC check.
		has_fp1_dlc_trigger = yes
		# Standard checks.
		is_available_even_at_war_adult = yes
		NOT = { has_character_flag = had_event_fp1_yearly_0091 }
		is_landed = yes
		# Filter to flavour-appropriate characters.
		fp1_is_coastal_norse_tribal = yes
	}

	weight_multiplier = {
		base = 1

		# Weight up for having sea-faring traits.
		modifier = {
			add = 0.5
			has_trait = viking
		}
		modifier = {
			add = 0.5
			has_trait = adventurer
		}
	}

	immediate = {
		add_character_flag = {
			flag = had_event_fp1_yearly_0091
			days = 10950
		}
	}

	# A leviathan, to carry my spoils!
	option = {
		name = fp1_yearly.0091.a
		trigger = {
			can_make_expensive_purchase_trigger = { PRICE = fp1_0091_standard_ship_gold_cost }
		}

		# Get a modifier enhancing loot capacity.
		add_character_modifier = {
			modifier = fp1_flagship_leviathan_modifier
			years = 10
		}
		# And charge the gold cost.
		remove_short_term_gold = major_gold_value

		stress_impact = {
			profligate = massive_stress_impact_loss
			ambitious = major_stress_impact_loss
			content = major_stress_impact_gain
			greedy = major_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_boldness = 0.5
				ai_energy = 0.5
				ai_greed = -0.5
			}
			modifier = {	# Weight up for stress.
				add = 50
				has_trait = profligate
			}
			modifier = {	# Weight up for stress.
				add = 30
				has_trait = ambitious
			}
			modifier = {	# Weight down for stress.
				add = -30
				has_trait = content
			}
			modifier = {	# Weight down for stress.
				add = -30
				has_trait = greedy
			}
		}
	}

	# A monster, to intimidate my vassals!
	option = {
		name = fp1_yearly.0091.b
		trigger = {
			can_make_expensive_purchase_trigger = { PRICE = fp1_0091_standard_ship_gold_cost }
		}

		# Get a modifier giving more tax from cowed vassals.
		add_character_modifier = {
			modifier = fp1_flagship_monster_modifier
			years = 10
		}
		# And charge the gold cost.
		remove_short_term_gold = major_gold_value

		stress_impact = {
			profligate = massive_stress_impact_loss
			callous = major_stress_impact_loss
			sadistic = major_stress_impact_loss
			compassionate = major_stress_impact_gain
			greedy = major_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_boldness = 0.5
				ai_vengefulness = 0.5
				ai_greed = -0.5
			}
			modifier = {	# Weight up for stress.
				add = 50
				has_trait = profligate
			}
			modifier = {	# Weight up for stress.
				add = 30
				has_trait = callous
			}
			modifier = {	# Weight up for stress.
				add = 30
				has_trait = sadistic
			}
			modifier = {	# Weight down for stress.
				add = -30
				has_trait = compassionate
			}
			modifier = {	# Weight down for stress.
				add = -30
				has_trait = greedy
			}
		}
	}

	# A dragon, to roar my name!
	option = {
		name = fp1_yearly.0091.c
		trigger = {
			can_make_expensive_purchase_trigger = { PRICE = fp1_0091_standard_ship_gold_cost }
		}

		# Get a modifier granting diplomacy per prestige level
		add_character_modifier = {
			modifier = fp1_flagship_dragon_modifier
			years = 10
		}
		# And charge the gold cost.
		remove_short_term_gold = major_gold_value

		stress_impact = {
			profligate = massive_stress_impact_loss
			arrogant = major_stress_impact_loss
			humble = major_stress_impact_gain
			greedy = major_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_boldness = 0.5
				ai_sociability = 0.5
				ai_greed = -0.5
			}
			modifier = {	# Weight up for stress.
				add = 50
				has_trait = profligate
			}
			modifier = {	# Weight up for stress.
				add = 30
				has_trait = arrogant
			}
			modifier = {	# Weight down for stress.
				add = -30
				has_trait = humble
			}
			modifier = {	# Weight down for stress.
				add = -30
				has_trait = greedy
			}
		}
	}

	# These are all ludicrously costly...
	option = {
		name = fp1_yearly.0091.d

		# Consiliatory stress loss for hanging on to your cash.
		## Stress loss handled in stress impact.

		stress_impact = {
			base = minor_stress_loss
			greedy = medium_stress_impact_loss
			arrogant = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_greed = 0.5
				ai_boldness = -0.25
			}
			modifier = {	# Weight up for stress.
				add = 20
				has_trait = greedy
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = arrogant
			}
		}
	}
}

##################################################
# A Guest/Courtier Challenges you to Riddles
# by Ewan Cowhig Croft
# 0101 - 0110
##################################################

scripted_trigger fp1_valid_riddler_at_court_trigger = {
	# We want characters of minor or major interest, ideally.
	is_of_major_or_minor_interest_trigger = { CHARACTER = root }
	# And we want to make sure they're available and can speak.
	is_available_ai_adult = yes
}

#	Someone in your court challenges you to an idle game of riddles.
fp1_yearly.0101 = {
	type = character_event
	title = fp1_yearly.0101.t
	desc = fp1_yearly.0101.desc
	theme = diplomacy
	left_portrait = {
		character = root
		animation = personality_rational
	}
	right_portrait = {
		character = scope:riddler
		animation = schadenfreude
	}

	trigger = {
		# DLC check.
		has_fp1_dlc_trigger = yes
		# Standard checks.
		is_available_even_at_war_adult = yes
		NOT = { has_character_flag = had_event_fp1_yearly_0101 }
		is_landed = yes
		# Valid for North Germanics only.
		culture = { has_cultural_pillar = heritage_north_germanic }
		# Has a valid courtier/guest who can quiz you.
		any_courtier_or_guest = { fp1_valid_riddler_at_court_trigger = yes }
		# Doesn't have an established extreme hatred of riddles.
		NOT = { has_character_flag = fp1_yearly_0101_really_hates_riddles }
	}

	weight_multiplier = {
		base = 1

		# Weight up for traits that make you a known woman/man of letters.
		modifier = {
			add = 0.5
			has_trait = journaller
		}
		modifier = {
			add = 0.5
			has_trait = scholar
		}
		modifier = {
			add = 0.5
			has_trait = theologian
		}
		modifier = {
			add = 0.5
			has_trait = administrator
		}
		modifier = {
			add = 0.5
			has_trait = architect
		}
	}

	immediate = {
		add_character_flag = {
			flag = had_event_fp1_yearly_0101
			days = 1825
		}
		# Designate a suitable riddler.
		## First, we grab all possibles & sort them into a list.
		every_courtier_or_guest = {
			limit = { fp1_valid_riddler_at_court_trigger = yes }
			add_to_list = potential_valid_riddlers_list
		}
		## Then, we order that list appropriately.
		ordered_in_list = {
			list = potential_valid_riddlers_list
			order_by = { value = fp1_best_available_riddler_value }
			save_scope_as = riddler
		}
	}

	# Entertaining, I'll play! [diplo]
	option = {
		name = fp1_yearly.0101.a

		# Duel the courtier for it.
		duel = {
			skill = diplomacy
			target = scope:riddler
			# You win the game!
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = fp1_yearly.0101.a.tt_success
				send_interface_toast = {
					title = fp1_yearly.0101.a.tt_success
					left_icon = scope:riddler
					# Gain opinion with your court for participating.
					every_courtier_or_guest = {
						limit = { is_available_adult = yes }
						custom = fp1_yearly.0101.a.every_courtier_and_guest
						add_opinion = {
							target = root
							modifier = amused_opinion
							opinion = 20
						}
					}
					# And a little prestige as a side-prize.
					add_prestige = miniscule_prestige_gain
				}
			}
			# You lose the game!
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = fp1_yearly.0101.a.tt_failure
				send_interface_toast = {
					title = fp1_yearly.0101.a.tt_failure
					left_icon = scope:riddler
					# Gain opinion with your court for participating.
					every_courtier_or_guest = {
						limit = { is_available_adult = yes }
						custom = fp1_yearly.0101.a.every_courtier_and_guest
						add_opinion = {
							target = root
							modifier = amused_opinion
							opinion = 20
						}
					}
					# And lose a little prestige.
					add_prestige = minor_prestige_loss
				}
			}
		}

		stress_impact = {
			arrogant = minor_stress_impact_loss
			gregarious = medium_stress_impact_loss
			shy = minor_stress_impact_gain
			impatient = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_sociability = 0.75
				ai_boldness = 0.5
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = arrogant
			}
			modifier = {	# Weight up for stress.
				add = 20
				has_trait = gregarious
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = shy
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = impatient
			}
		}
	}

	# Entertaining, I'll play! [learning]
	option = {
		name = fp1_yearly.0101.b

		duel = {
			skill = learning
			target = scope:riddler
			# You win the game!
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = fp1_yearly.0101.a.tt_success
				send_interface_toast = {
					title = fp1_yearly.0101.a.tt_success
					left_icon = scope:riddler
					# Gain opinion with your court for participating.
					every_courtier_or_guest = {
						limit = { is_available_adult = yes }
						custom = fp1_yearly.0101.a.every_courtier_and_guest
						add_opinion = {
							target = root
							modifier = amused_opinion
							opinion = 20
						}
					}
					# And a little prestige as a side-prize.
					add_prestige = miniscule_prestige_gain
				}
			}
			# You lose the game!
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = fp1_yearly.0101.a.tt_failure
				send_interface_toast = {
					title = fp1_yearly.0101.a.tt_failure
					left_icon = scope:riddler
					# Gain opinion with your court for participating.
					every_courtier_or_guest = {
						limit = { is_available_adult = yes }
						custom = fp1_yearly.0101.a.every_courtier_and_guest
						add_opinion = {
							target = root
							modifier = amused_opinion
							opinion = 20
						}
					}
					# And lose a little prestige.
					add_prestige = minor_prestige_loss
				}
			}
		}

		stress_impact = {
			arrogant = minor_stress_impact_loss
			gregarious = medium_stress_impact_loss
			shy = minor_stress_impact_gain
			impatient = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_sociability = 0.75
				ai_boldness = 0.5
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = arrogant
			}
			modifier = {	# Weight up for stress.
				add = 20
				has_trait = gregarious
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = shy
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = impatient
			}
		}
	}

	# Here's one: who has no brain and belongs in the dungeon?
	option = {
		name = fp1_yearly.0101.c

		# Toss them in the dungeon.
		imprison_character_effect = {
			IMPRISONER = root
			TARGET = scope:riddler
		}
		hidden_effect = {
			# Make sure that it's _definitely_ the dungeon.
			scope:riddler = { change_prison_type = dungeon }
			# And that no one will ever try to get you involved in a game ever again.
			add_character_flag = fp1_yearly_0101_really_hates_riddles
		}
		# Gain some dread to balance out that tyranny.
		add_dread = medium_dread_gain
		# People may remember your over-reaction...
		if = {
			limit = { has_any_nickname = no }
			custom_tooltip = fp1_yearly.0101.c.tt
			hidden_effect = {
				random_list = {
					60 = {
						# The court dares not mock you.
					}
					40 = {
						# You hear a whispered nickname behind your back...
						random_list = {
							20 = {
								send_interface_toast = {
									title = fp1_yearly.0101.c.tt_nickname
									left_icon = root
									give_nickname = nick_the_stonefaced
								}
							}
							20 = {
								send_interface_toast = {
									title = fp1_yearly.0101.c.tt_nickname
									left_icon = root
									give_nickname = nick_the_dry
								}
							}
							20 = {
								send_interface_toast = {
									title = fp1_yearly.0101.c.tt_nickname
									left_icon = root
									give_nickname = nick_the_joyless
								}
							}
							20 = {
								send_interface_toast = {
									title = fp1_yearly.0101.c.tt_nickname
									left_icon = root
									give_nickname = nick_lacks_laughs
								}
							}
							20 = {
								send_interface_toast = {
									title = fp1_yearly.0101.c.tt_nickname
									left_icon = root
									give_nickname = nick_the_dull
								}
							}
						}
					}
				}
			}
		}

		stress_impact = {
			sadistic = minor_stress_impact_loss
			impatient = medium_stress_impact_loss
			vengeful = medium_stress_impact_loss
			gregarious = minor_stress_impact_gain
			compassionate = medium_stress_impact_gain
			patient = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_vengefulness = 0.5
				ai_compassion = -0.5
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = sadistic
			}
			modifier = {	# Weight up for stress.
				add = 20
				has_trait = impatient
			}
			modifier = {	# Weight up for stress.
				add = 20
				has_trait = vengeful
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = gregarious
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = compassionate
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = patient
			}
		}
	}

	# Thanks, but I'm a [title], and have things to do.
	option = {
		name = fp1_yearly.0101.d

		# Lose a little prestige, but less than if you were beaten.
		add_prestige = miniscule_prestige_loss
		# Scope:riddler is disappointed in you.
		scope:riddler = {
			add_opinion = {
				target = root
				modifier = disappointed_opinion
				opinion = -20
			}
		}

		stress_impact = {
			shy = minor_stress_impact_loss
			impatient = medium_stress_impact_loss
			arrogant = minor_stress_impact_gain
			gregarious = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_boldness = -0.5
				ai_sociability = -0.5
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = shy
			}
			modifier = {	# Weight up for stress.
				add = 20
				has_trait = impatient
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = arrogant
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = gregarious
			}
		}
	}
}

##################################################
# Accursed
# by Ewan Cowhig Croft
# 0111 - 0120
##################################################

scripted_trigger fp1_0111_superstitious_courtier_trigger = {
	# Basic checks.
	is_available_ai_adult = yes
	OR = {
		fp1_is_norse = yes
		religion = religion:folkgerman_religion
	}
	# Rule out a few key traits.
	NOR = {
		# Cynical characters don't believe.
		has_trait = cynical
		# Brave characters don't succumb to threats.
		has_trait = brave
		# Trusting characters believe the gods or their friends will help them.
		has_trait = trusting
	}
	# Witches aren't fussed: they're confident in their counterspells.
	NOR = {
		has_trait = witch
		any_secret = { type = secret_witch }
	}
	# Anyone who's already been cursed is about as screwed as they can be.
	NOT = { has_character_modifier = fp1_cursed_by_nithing_pole_modifier }
	# And we ideally want to be able to add a strong hook, at least.
	save_temporary_scope_as = current_courtier
	root = {
		can_add_hook = {
			target = scope:current_courtier
			type = loyalty_hook
		}
	}
}

scripted_trigger fp1_0111_suspicious_courtier_trigger = {
	# Basic checks.
	is_available_ai_adult = yes
	this != scope:accursed
	OR = {
		fp1_is_norse = yes
		religion = religion:folkgerman_religion
	}
	# Would-be sorcerers need to either know what they're doing, or else have absolutely no clue.
	OR = {
		intrigue >= fp1_0111_sorcerer_intrigue_high
		learning >= fp1_0111_sorcerer_learning_high
		intrigue <= fp1_0111_sorcerer_intrigue_low
		learning <= fp1_0111_sorcerer_learning_low
	}
	# ... and to have at least two of various pairs of matched traits.
	calc_true_if = {
		amount >= 2
		OR = {
			has_trait = lazy
			has_trait = arbitrary
		}
		OR = {
			has_trait = wrathful
			has_trait = impatient
		}
		OR = {
			has_trait = calm
			has_trait = patient
		}
		OR = {
			has_trait = sadistic
			has_trait = arrogant
		}
		OR = {
			has_trait = callous
			has_trait = ambitious
		}
		OR = {
			has_trait = deceitful
			has_trait = craven
		}
		OR = {
			has_trait = brave
			has_trait = trusting
		}
		OR = {
			has_trait = paranoid
			has_trait = vengeful
		}
	}
	# Filter out known witches: *way* too obvious.
	NOT = { has_trait = witch }
}

scripted_trigger fp1_0111_discountable_courtier_trigger = {
	# Basic checks.
	is_available_ai_adult = yes
	this != scope:accursed
	OR = {
		fp1_is_norse = yes
		religion = religion:folkgerman_religion
	}
	# Discountables must not meet minimum requirements to be suspicious.
	fp1_0111_suspicious_courtier_trigger = no
	# On top of that, as long as they have at least one disqualifying statistic, they're gucci.
	OR = {
		has_trait = gallant
		has_trait = honest
		has_trait = just
		has_trait = compassionate
		has_trait = forgiving
		# Zealous characters require witchcraft to be at least somewhat shameful.
		AND = {
			has_trait = zealous
			faith = {
				NOT = { has_doctrine_parameter = witchcraft_accepted }
			}
		}
	}
	# Ensure that no witches are thrown into the discountables pile, as that's just cruel.
	NOR = {
		has_trait = witch
		any_secret = { type = secret_witch }
	}
}

scripted_effect fp1_0111_randomise_sorcerer_identity_effect = {
	random_list = {
		100 = {
			trigger = {
				NOT = { exists = scope:suspect_a }
			}
			save_scope_as = suspect_a
		}
		100 = {
			trigger = {
				NOT = { exists = scope:suspect_b }
			}
			save_scope_as = suspect_b
		}
		100 = {
			trigger = {
				NOT = { exists = scope:suspect_c }
			}
			save_scope_as = suspect_c
		}
	}
}

scripted_effect fp1_0111_accursed_receives_curse_effect = {
	# Firstly, they gain a *colossal* amount of stress.
	add_stress = monumental_stress_gain
	# Then they take a negative modifier.
	add_character_modifier = {
		modifier = fp1_cursed_by_nithing_pole_modifier
		years = 20
	}
	# And become paranoid if possible.
	if = {
		limit = {
			number_of_personality_traits < personality_trait_limit
			NOR = {
				has_trait = trusting
				has_trait = paranoid
			}
		}
		add_trait = paranoid
	}
}

scripted_effect fp1_0111_correct_accusation_effect = {
	# Give $CHARACTER$ a witch secret & expose it.
	$CHARACTER$ = {
		# Hide the witch effect, so that you can't just *see* who the witch is by who'll be exposed.
		hidden_effect = {
			random_secret = {
				type = secret_witch
				expose_secret = root
			}
		}
		# Simply show a nice, easy tooltip.
		show_as_tooltip = { add_trait = witch }
	}
	# Rightfully imprison them.
	rightfully_imprison_character_effect = {
		TARGET = $CHARACTER$
		IMPRISONER = root
	}
	# Gain a nicely chonky chunk of prestige.
	add_prestige = medium_prestige_gain
	# Receive a strong hook on, and oodles of opinion with, scope:accursed.
	add_hook = {
		type = loyalty_hook
		target = scope:accursed
	}
	reverse_add_opinion = {
		target = scope:accursed
		modifier = relieved_opinion
		opinion = 75
	}
}

scripted_effect fp1_0111_false_accusation_effect = {
	# $CHARACTER$ is, understandably, upset.
	reverse_add_opinion = {
		target = $CHARACTER$
		modifier = falsely_accused
	}
	# And you lose some prestige for your failure.
	add_prestige = medium_prestige_loss
	# Scope:accursed has a melt-down.
	scope:accursed = { fp1_0111_accursed_receives_curse_effect = yes }
}

scripted_effect fp1_0111_select_accusation_effect = {
	# Inform root about the potential consequences of their guess.
	show_as_tooltip = {
		random_list = {
			# Guessed correctly.
			100 = {
				show_chance = no
				desc = fp1_yearly.0111.tt.correct_guess
				fp1_0111_correct_accusation_effect = { CHARACTER = $CHARACTER$ }
			}
			# Guessed incorrectly.
			100 = {
				show_chance = no
				desc = fp1_yearly.0111.tt.wrong_guess
				fp1_0111_false_accusation_effect = { CHARACTER = $CHARACTER$ }
			}
		}
	}
	# And handle the actual results.
	## Guessed correctly!
	if = {
		limit = { $CHARACTER$ = scope:culprit }
		send_interface_toast = {
			title = fp1_yearly.0111.tt.correct_accusation
			left_icon = $CHARACTER$
			right_icon = scope:accursed
			# Calculate actual effects: we have to keep these hidden so as not to spoil the mystery.
			hidden_effect = {
				fp1_0111_correct_accusation_effect = { CHARACTER = $CHARACTER$ }
			}
			# And throw in a tooltip to make the toast seem less empty.
			custom_tooltip = fp1_yearly.0111.tt.correct_accusation.tt
		}
	}
	## Otherwise, you dun goofed.
	else = {
		send_interface_toast = {
			title = fp1_yearly.0111.tt.false_accusation
			left_icon = $CHARACTER$
			right_icon = scope:accursed
			# Calculate actual effects: we have to keep these hidden so as not to spoil the mystery.
			hidden_effect = {
				fp1_0111_false_accusation_effect = { CHARACTER = $CHARACTER$ }
			}
			# And throw in a tooltip to make the toast seem less empty.
			custom_tooltip = fp1_yearly.0111.tt.false_accusation.tt
		}
	}
}

#	Nithing Pole Raised Against Courtier
fp1_yearly.0111 = {
	type = character_event
	title = fp1_yearly.0111.t
	desc = {
		desc = fp1_yearly.0111.desc.intro
		# Skill clue.
		first_valid = {
			triggered_desc = {
				trigger = {
					scope:clue_skill = flag:intrigue
					intrigue >= fp1_0111_sorcerer_intrigue_high
				}
				desc = fp1_yearly.0111.desc.skill.intrigue_high
			}
			triggered_desc = {
				trigger = {
					scope:clue_skill = flag:learning
					learning >= fp1_0111_sorcerer_learning_high
				}
				desc = fp1_yearly.0111.desc.skill.learning_high
			}
			triggered_desc = {
				trigger = {
					scope:clue_skill = flag:intrigue
					intrigue <= fp1_0111_sorcerer_intrigue_low
				}
				desc = fp1_yearly.0111.desc.skill.intrigue_low
			}
			triggered_desc = {
				trigger = {
					scope:clue_skill = flag:learning
					learning <= fp1_0111_sorcerer_learning_low
				}
				desc = fp1_yearly.0111.desc.skill.learning_low
			}
			desc = fp1_yearly.0111.desc.skill.fallback
		}
		# Grammatical stop.
		desc = fp1_yearly.0111.desc.first_connector
		# Trait clue #1.
		first_valid = {
			triggered_desc = {
				trigger = { scope:clue_trait_1 = flag:lazy_or_arbitrary }
				desc = fp1_yearly.0111.desc.trait_1.lazy_or_arbitrary
			}
			triggered_desc = {
				trigger = { scope:clue_trait_1 = flag:wrathful_or_impatient }
				desc = fp1_yearly.0111.desc.trait_1.wrathful_or_impatient
			}
			triggered_desc = {
				trigger = { scope:clue_trait_1 = flag:calm_or_patient }
				desc = fp1_yearly.0111.desc.trait_1.calm_or_patient
			}
			triggered_desc = {
				trigger = { scope:clue_trait_1 = flag:sadistic_or_arrogant }
				desc = fp1_yearly.0111.desc.trait_1.sadistic_or_arrogant
			}
			triggered_desc = {
				trigger = { scope:clue_trait_1 = flag:callous_or_ambitious }
				desc = fp1_yearly.0111.desc.trait_1.callous_or_ambitious
			}
			triggered_desc = {
				trigger = { scope:clue_trait_1 = flag:deceitful_or_craven }
				desc = fp1_yearly.0111.desc.trait_1.deceitful_or_craven
			}
			triggered_desc = {
				trigger = { scope:clue_trait_1 = flag:brave_or_trusting }
				desc = fp1_yearly.0111.desc.trait_1.brave_or_trusting
			}
			triggered_desc = {
				trigger = { scope:clue_trait_1 = flag:paranoid_or_vengeful }
				desc = fp1_yearly.0111.desc.trait_1.paranoid_or_vengeful
			}
			desc = fp1_yearly.0111.desc.trait_1.fallback
		}
		# Grammatical stop.
		desc = fp1_yearly.0111.desc.second_connector
		# Trait clue #2.
		first_valid = {
			triggered_desc = {
				trigger = { scope:clue_trait_2 = flag:lazy_or_arbitrary }
				desc = fp1_yearly.0111.desc.trait_2.lazy_or_arbitrary
			}
			triggered_desc = {
				trigger = { scope:clue_trait_2 = flag:wrathful_or_impatient }
				desc = fp1_yearly.0111.desc.trait_2.wrathful_or_impatient
			}
			triggered_desc = {
				trigger = { scope:clue_trait_2 = flag:calm_or_patient }
				desc = fp1_yearly.0111.desc.trait_2.calm_or_patient
			}
			triggered_desc = {
				trigger = { scope:clue_trait_2 = flag:sadistic_or_arrogant }
				desc = fp1_yearly.0111.desc.trait_2.sadistic_or_arrogant
			}
			triggered_desc = {
				trigger = { scope:clue_trait_2 = flag:callous_or_ambitious }
				desc = fp1_yearly.0111.desc.trait_2.callous_or_ambitious
			}
			triggered_desc = {
				trigger = { scope:clue_trait_2 = flag:deceitful_or_craven }
				desc = fp1_yearly.0111.desc.trait_2.deceitful_or_craven
			}
			triggered_desc = {
				trigger = { scope:clue_trait_2 = flag:brave_or_trusting }
				desc = fp1_yearly.0111.desc.trait_2.brave_or_trusting
			}
			triggered_desc = {
				trigger = { scope:clue_trait_2 = flag:paranoid_or_vengeful }
				desc = fp1_yearly.0111.desc.trait_2.paranoid_or_vengeful
			}
			desc = fp1_yearly.0111.desc.trait_2.fallback
		}
		desc = fp1_yearly.0111.desc.outro
	}
	theme = intrigue
	left_portrait = {
		character = root
		animation = personality_rational
	}
	right_portrait = {
		character = scope:accursed
		animation = fear
	}
	lower_left_portrait = scope:suspect_a
	lower_center_portrait = scope:suspect_b
	lower_right_portrait = scope:suspect_c
	override_background = { reference = corridor_night }

	trigger = {
		# DLC check.
		has_fp1_dlc_trigger = yes
		# Standard checks.
		is_available_even_at_war_adult = yes
		NOT = { has_character_flag = had_event_fp1_yearly_0111 }
		is_landed = yes
		# Filter to flavour-appropriate characters.
		faith = {
			NOT = { has_doctrine_parameter = witchcraft_accepted }
		}
		OR = {
			fp1_is_norse_tribal = yes
			# Allow this after feudalisation, but not for kings and emperors with more important things going on.
			AND = {
				fp1_is_norse = yes
				highest_held_title_tier <= tier_duchy
			}
		}
		# Make sure we have a suitably superstitious character for scope:courtier.
		any_courtier = {
			fp1_0111_superstitious_courtier_trigger = yes
			save_temporary_scope_as = accursed
		}
		# And that they've got enemies available.
		any_courtier_or_guest = {
			# Count one more than we need so that we've still got a valid scope:accursed even if they accidentally take up a suspect slot.
			count >= 4
			fp1_0111_suspicious_courtier_trigger = yes
		}
	}

	weight_multiplier = {
		base = 1

		# Witches see more of this type of thing in their court.
		modifier = {
			add = 1
			has_trait = witch
		}
		# And zealots are more likely to be appealed to by terrified courtiers.
		modifier = {
			add = 0.5
			has_trait = zealous
		}
	}

	immediate = {
		play_music_cue = "mx_cue_murder"
		add_character_flag = {
			flag = had_event_fp1_yearly_0111
			days = 7300
		}
		# Designate a suitable superstitious courtier.
		random_courtier = {
			limit = { fp1_0111_superstitious_courtier_trigger = yes }
			weight = {
				base = 0
				# Weigh up the paranoid.
				modifier = {
					add = 100
					has_trait = paranoid
				}
				# Weigh up zealots.
				modifier = {
					add = 50
					has_trait = zealous
				}
				# And the vengeful, just a little, for assuming everyone thinks like them.
				modifier = {
					add = 25
					has_trait = vengeful
				}
			}
			save_scope_as = accursed
		}
		# Next, grab all valid suspicious courtiers
		every_courtier_or_guest = {
			limit = {
				fp1_0111_suspicious_courtier_trigger = yes
			}
			add_to_list = suspicious_courtiers_list
		}
		# And all valid discountables.
		every_courtier_or_guest = {
			limit = { fp1_0111_discountable_courtier_trigger = yes }
			add_to_list = discountable_courtiers_list
		}
		# Process candidates.
		## First, scope:culprit.
		random_in_list = {
			list = suspicious_courtiers_list
			weight = {
				base = 1
				# Weight up anyone with the witch secret for the main suspect.
				modifier = {
					add = 1000
					any_secret = { type = secret_witch }
				}
			}
			save_scope_as = culprit
		}
		## Then, scope:red_herring.
		random_in_list = {
			list = suspicious_courtiers_list
			limit = {
				NOR = {
					this = scope:culprit
					# Forbid secret witches: that's *too* much of a red herring.
					any_secret = { type = secret_witch }
				}
			}
			save_scope_as = red_herring
		}
		## Try for a scope:discountable.
		if = {
			limit = {
				any_in_list = {
					list = discountable_courtiers_list
					count >= 1
				}
			}
			random_in_list = {
				list = discountable_courtiers_list
				save_scope_as = discountable
			}
		}
		## If no scope:discountable is available, pick a scope:scarlet_herring.
		else = {
			random_in_list = {
				list = suspicious_courtiers_list
				limit = {
					NOR = {
						this = scope:culprit
						this = scope:red_herring
						# Forbid secret witches: that's *too* much of a red herring.
						any_secret = { type = secret_witch }
					}
				}
				save_scope_as = scarlet_herring
			}
		}
		# Then hand out suspect tags at random, so that it's not just always scope:suspect_a.
		## First, sort scope:culprit.
		scope:culprit = { fp1_0111_randomise_sorcerer_identity_effect = yes }
		## Next, scope:red_herring.
		scope:red_herring = { fp1_0111_randomise_sorcerer_identity_effect = yes }
		## If we have a scope:discountable, finish with them.
		if = {
			limit = { exists = scope:discountable }
			scope:discountable = { fp1_0111_randomise_sorcerer_identity_effect = yes }
		}
		## Otherwise, it's scope:scarlet_herring's turn.
		else = {
			scope:scarlet_herring = { fp1_0111_randomise_sorcerer_identity_effect = yes }
		}
		# Process clues.
		scope:culprit = {
			# First, we pick one of scope:culprit's skills to examine.
			## The base is just a straight 50:50 shot between intrigue & learning, but we weight it a list by education.
			random_list = {
				# Intrigue.
				1000 = {
					save_scope_value_as = {
						name = clue_skill
						value = flag:intrigue
					}
					# Weight up for education.
					modifier = {
						add = 250
						has_trait_rank = {
							trait = education_intrigue
							rank = 1
						}
					}
					modifier = {
						add = 500
						has_trait_rank = {
							trait = education_intrigue
							rank = 2
						}
					}
					modifier = {
						add = 750
						has_trait_rank = {
							trait = education_intrigue
							rank = 3
						}
					}
					modifier = {
						add = 1000
						has_trait_rank = {
							trait = education_intrigue
							rank >= 4
						}
					}
				}
				# Learning.
				1000 = {
					save_scope_value_as = {
						name = clue_skill
						value = flag:learning
					}
					# Weight up for education.
					modifier = {
						add = 250
						has_trait_rank = {
							trait = education_learning
							rank = 1
						}
					}
					modifier = {
						add = 500
						has_trait_rank = {
							trait = education_learning
							rank = 2
						}
					}
					modifier = {
						add = 750
						has_trait_rank = {
							trait = education_learning
							rank = 3
						}
					}
					modifier = {
						add = 1000
						has_trait_rank = {
							trait = education_learning
							rank >= 4
						}
					}
				}
			}
			# Then, we want to look through their traits and pick a first pair to comment on.
			## Eight options of 12.5% each.
			random_list = {
				# Lazy or arbitrary
				125 = {
					trigger = {
						OR = {
							has_trait = lazy
							has_trait = arbitrary
						}
					}
					save_scope_value_as = {
						name = clue_trait_1
						value = flag:lazy_or_arbitrary
					}
				}
				# Wrathful or impatient.
				125 = {
					trigger = {
						OR = {
							has_trait = wrathful
							has_trait = impatient
						}
					}
					save_scope_value_as = {
						name = clue_trait_1
						value = flag:wrathful_or_impatient
					}
				}
				# Calm or patient.
				125 = {
					trigger = {
						OR = {
							has_trait = calm
							has_trait = patient
						}
					}
					save_scope_value_as = {
						name = clue_trait_1
						value = flag:calm_or_patient
					}
				}
				# Sadistic or arrogant.
				125 = {
					trigger = {
						OR = {
							has_trait = sadistic
							has_trait = arrogant
						}
					}
					save_scope_value_as = {
						name = clue_trait_1
						value = flag:sadistic_or_arrogant
					}
				}
				# Callous or ambitious.
				125 = {
					trigger = {
						OR = {
							has_trait = callous
							has_trait = ambitious
						}
					}
					save_scope_value_as = {
						name = clue_trait_1
						value = flag:callous_or_ambitious
					}
				}
				# Deceitful or craven.
				125 = {
					trigger = {
						OR = {
							has_trait = deceitful
							has_trait = craven
						}
					}
					save_scope_value_as = {
						name = clue_trait_1
						value = flag:deceitful_or_craven
					}
				}
				# Brave or trusting.
				125 = {
					trigger = {
						OR = {
							has_trait = brave
							has_trait = trusting
						}
					}
					save_scope_value_as = {
						name = clue_trait_1
						value = flag:brave_or_trusting
					}
				}
				# Paranoid or vengeful.
				125 = {
					trigger = {
						OR = {
							has_trait = paranoid
							has_trait = vengeful
						}
					}
					save_scope_value_as = {
						name = clue_trait_1
						value = flag:paranoid_or_vengeful
					}
				}
			}
			# Finally, pick a secondary trait pairing.
			## Technically eight options of 12.5% each, but one of these is discounted for the first pairing, so it's actually seven pairings of 14.3% each.
			random_list = {
				# Lazy or arbitrary
				125 = {
					trigger = {
						OR = {
							has_trait = lazy
							has_trait = arbitrary
						}
						NOT = { scope:clue_trait_1 = flag:lazy_or_arbitrary }
					}
					save_scope_value_as = {
						name = clue_trait_2
						value = flag:lazy_or_arbitrary
					}
				}
				# Wrathful or impatient.
				125 = {
					trigger = {
						OR = {
							has_trait = wrathful
							has_trait = impatient
						}
						NOT = { scope:clue_trait_1 = flag:wrathful_or_impatient }
					}
					save_scope_value_as = {
						name = clue_trait_2
						value = flag:wrathful_or_impatient
					}
				}
				# Calm or patient.
				125 = {
					trigger = {
						OR = {
							has_trait = calm
							has_trait = patient
						}
						NOT = { scope:clue_trait_1 = flag:calm_or_patient }
					}
					save_scope_value_as = {
						name = clue_trait_2
						value = flag:calm_or_patient
					}
				}
				# Sadistic or arrogant.
				125 = {
					trigger = {
						OR = {
							has_trait = sadistic
							has_trait = arrogant
						}
						NOT = { scope:clue_trait_1 = flag:sadistic_or_arrogant }
					}
					save_scope_value_as = {
						name = clue_trait_2
						value = flag:sadistic_or_arrogant
					}
				}
				# Callous or ambitious.
				125 = {
					trigger = {
						OR = {
							has_trait = callous
							has_trait = ambitious
						}
						NOT = { scope:clue_trait_1 = flag:callous_or_ambitious }
					}
					save_scope_value_as = {
						name = clue_trait_2
						value = flag:callous_or_ambitious
					}
				}
				# Deceitful or craven.
				125 = {
					trigger = {
						OR = {
							has_trait = deceitful
							has_trait = craven
						}
						NOT = { scope:clue_trait_1 = flag:deceitful_or_craven }
					}
					save_scope_value_as = {
						name = clue_trait_2
						value = flag:deceitful_or_craven
					}
				}
				# Brave or trusting.
				125 = {
					trigger = {
						OR = {
							has_trait = brave
							has_trait = trusting
						}
						NOT = { scope:clue_trait_1 = flag:brave_or_trusting }
					}
					save_scope_value_as = {
						name = clue_trait_2
						value = flag:brave_or_trusting
					}
				}
				# Paranoid or vengeful.
				125 = {
					trigger = {
						OR = {
							has_trait = paranoid
							has_trait = vengeful
						}
						NOT = { scope:clue_trait_1 = flag:paranoid_or_vengeful }
					}
					save_scope_value_as = {
						name = clue_trait_2
						value = flag:paranoid_or_vengeful
					}
				}
			}
		}
		# Aaaaaaand make scope:culprit an actual witch.
		hidden_effect = {
			scope:culprit = { give_witch_secret_or_trait_effect = yes }
		}
	}

	# Scope:suspect_a, clearly.
	option = {
		name = fp1_yearly.0111.a

		# Display tooltip & apply effects.
		fp1_0111_select_accusation_effect = { CHARACTER = scope:suspect_a }

		stress_impact = {
			paranoid = major_stress_impact_loss
			zealous = major_stress_impact_loss
			trusting = major_stress_impact_gain
			cynical = major_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_zeal = 0.5
				ai_vengefulness = 0.25
			}
			modifier = {	# Weight up for stress.
				add = 30
				has_trait = paranoid
			}
			modifier = {	# Weight up for stress.
				add = 30
				has_trait = zealous
			}
			modifier = {	# Weight down for stress.
				add = -30
				has_trait = trusting
			}
			modifier = {	# Weight down for stress.
				add = -30
				has_trait = cynical
			}
		}
	}

	# Scope:suspect_b, I think...
	option = {
		name = fp1_yearly.0111.b

		# Display tooltip & apply effects.
		fp1_0111_select_accusation_effect = { CHARACTER = scope:suspect_b }

		stress_impact = {
			paranoid = major_stress_impact_loss
			zealous = major_stress_impact_loss
			trusting = major_stress_impact_gain
			cynical = major_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_zeal = 0.5
				ai_vengefulness = 0.25
			}
			modifier = {	# Weight up for stress.
				add = 30
				has_trait = paranoid
			}
			modifier = {	# Weight up for stress.
				add = 30
				has_trait = zealous
			}
			modifier = {	# Weight down for stress.
				add = -30
				has_trait = trusting
			}
			modifier = {	# Weight down for stress.
				add = -30
				has_trait = cynical
			}
		}
	}

	# Sounds like scope:suspect_c!
	option = {
		name = fp1_yearly.0111.c

		# Display tooltip & apply effects.
		fp1_0111_select_accusation_effect = { CHARACTER = scope:suspect_c }

		stress_impact = {
			paranoid = major_stress_impact_loss
			zealous = major_stress_impact_loss
			trusting = major_stress_impact_gain
			cynical = major_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_zeal = 0.5
				ai_vengefulness = 0.25
			}
			modifier = {	# Weight up for stress.
				add = 30
				has_trait = paranoid
			}
			modifier = {	# Weight up for stress.
				add = 30
				has_trait = zealous
			}
			modifier = {	# Weight down for stress.
				add = -30
				has_trait = trusting
			}
			modifier = {	# Weight down for stress.
				add = -30
				has_trait = cynical
			}
		}
	}

	# Scope:accursed, it's all in your mind, alright?
	option = {
		name = fp1_yearly.0111.d
		trigger = {
			NOT = { has_trait = witch }
		}

		# Diplomacy challenge to convince scope:accursed that the nithing pole means nothing.
		duel = {
			skill = diplomacy
			target = scope:accursed
			# You talk them down.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = fp1_yearly.0111.d.tt_success
				send_interface_toast = {
					title = fp1_yearly.0111.d.tt_success
					left_icon = scope:accursed
					# Gain a favour if possible.
					if = {
						limit = {
							can_add_hook = {
								type = favor_hook
								target = scope:accursed
							}
						}
						add_hook = {
							type = favor_hook
							target = scope:accursed
							years = 20
						}
					}
					# And always a lot of opinion.
					reverse_add_opinion = {
						target = scope:accursed
						modifier = trust_opinion
						opinion = 50
					}
					# Plus a decent chunk of prestige.
					add_prestige = medium_prestige_gain
				}
			}
			# They freak the hell out.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = fp1_yearly.0111.d.tt_failure
				send_interface_toast = {
					title = fp1_yearly.0111.d.tt_failure
					left_icon = scope:accursed
					# Scope:accursed has a melt-down.
					scope:accursed = { fp1_0111_accursed_receives_curse_effect = yes }
				}
			}
		}

		stress_impact = {
			trusting = major_stress_impact_loss
			cynical = major_stress_impact_loss
			paranoid = major_stress_impact_gain
			zealous = major_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_vengefulness = -0.25
				ai_zeal = -0.5
			}
			modifier = {	# Weight up for stress.
				add = 30
				has_trait = trusting
			}
			modifier = {	# Weight up for stress.
				add = 30
				has_trait = cynical
			}
			modifier = {	# Weight down for stress.
				add = -30
				has_trait = paranoid
			}
			modifier = {	# Weight down for stress.
				add = -30
				has_trait = zealous
			}
		}
	}

	# (Witch) Worry not, I have a counter-spell.
	option = {
		name = fp1_yearly.0111.e
		trigger = { has_trait = witch }
		trait = witch

		# Gain a favour if possible.
		if = {
			limit = {
				can_add_hook = {
					type = favor_hook
					target = scope:accursed
				}
			}
			add_hook = {
				type = favor_hook
				target = scope:accursed
				years = 20
			}
		}
		# And always a lot of opinion.
		reverse_add_opinion = {
			target = scope:accursed
			modifier = trust_opinion
			opinion = 50
		}
		# Plus a decent chunk of prestige.
		add_prestige = medium_prestige_gain

		stress_impact = {
			trusting = major_stress_impact_loss
			cynical = major_stress_impact_loss
			paranoid = major_stress_impact_gain
			zealous = major_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_vengefulness = -0.25
				ai_zeal = -0.5
			}
			modifier = {	# Weight up for stress.
				add = 30
				has_trait = trusting
			}
			modifier = {	# Weight up for stress.
				add = 30
				has_trait = cynical
			}
			modifier = {	# Weight down for stress.
				add = -30
				has_trait = paranoid
			}
			modifier = {	# Weight down for stress.
				add = -30
				has_trait = zealous
			}
		}
	}
}












##################################################
# FLAVOUR YEARLIES

##################################################
# FLAVOUR YEARLIES EFFECTS

scripted_effect fp1_pick_outdoorsy_child_for_winter_effect = {
	random_child = {
		# Try to pick an outdoorsy child first.
		limit = {
			child_suitable_to_play_with_character_one_sided = { CHARACTER = root }
			OR = {
				childhood_loud_child_trigger = yes
				childhood_nice_child_trigger = yes
			}
		}
		# Otherwise, any is good.
		alternative_limit = {
			child_suitable_to_play_with_character_one_sided = { CHARACTER = root }
		}
		save_scope_as = child
	}
}

##################################################
# Out for a Sail
# by Ewan Cowhig Croft
# 0501 - 0510
##################################################

#	You encounter a distressed raiding vessel whilst out sailing.
fp1_yearly.0501 = {
	type = character_event
	title = fp1_yearly.0501.t
	desc = fp1_yearly.0501.desc
	theme = realm
	left_portrait = {
		character = root
		animation = shock
	}
	override_background = { reference = fp1_ocean_norse }

	trigger = {
		# DLC check.
		has_fp1_dlc_trigger = yes
		# Standard checks.
		is_available_even_at_war_adult = yes
		NOT = { has_character_flag = had_event_fp1_yearly_0501 }
		is_landed = yes
		# Filter to flavour-appropriate characters.
		fp1_is_coastal_norse_tribal = yes
	}

	weight_multiplier = {
		base = 1

		# Weight up for having sea-faring traits.
		modifier = {
			add = 0.5
			has_trait = viking
		}
		modifier = {
			add = 0.5
			has_trait = adventurer
		}
	}

	immediate = {
		add_character_flag = {
			flag = had_event_fp1_yearly_0501
			days = 1825
		}
		# Generate a gender for the fisher people.
		random_dummy_gender_soldier_effect = { SCOPE_NAME = fisherpeople }
	}

	# Stop and try to help them!
	option = {
		name = fp1_yearly.0501.a

		# Martial duel to organise your sailors.
		duel = {
			skill = martial
			value = 10
			# You succeed in saving the crew and some of their haul!
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = fp1_yearly.0501.a.tt_success
				send_interface_toast = {
					title = fp1_yearly.0501.a.tt_success
					left_icon = root
					add_prestige = medium_prestige_gain
				}
			}
			# You fail, and many are lost to the storm.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = fp1_yearly.0501.a.tt_failure
				send_interface_toast = {
					title = fp1_yearly.0501.a.tt_failure
					left_icon = root
					add_prestige = miniscule_prestige_loss
				}
			}
		}

		stress_impact = {
			diligent = minor_stress_impact_loss
			compassionate = medium_stress_impact_loss
			lazy = minor_stress_impact_gain
			callous = medium_stress_impact_gain
			sadistic = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = 0.75
				ai_energy = 0.25
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = diligent
			}
			modifier = {	# Weight up for stress.
				add = 20
				has_trait = compassionate
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = lazy
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = callous
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = sadistic
			}
		}
	}

	# Salvage the cargo, kill the survivors.
	option = {
		name = fp1_yearly.0501.b

		# Prowess duel to storm the boat.
		duel = {
			skill = prowess
			value = 10
			# You storm the boat easily.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = fp1_yearly.0501.b.tt_success
				send_interface_toast = {
					title = fp1_yearly.0501.b.tt_success
					left_icon = root
					add_gold = minor_gold_value
				}
			}
			# Survivors slip to shore.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = fp1_yearly.0501.b.tt_failure
				send_interface_toast = {
					title = fp1_yearly.0501.b.tt_failure
					left_icon = root
					add_gold = minor_gold_value
					add_tyranny = minor_tyranny_gain
				}
			}
		}

		stress_impact = {
			greedy = minor_stress_impact_loss
			callous = minor_stress_impact_loss
			sadistic = medium_stress_impact_loss
			compassionate = medium_stress_impact_gain
			generous = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_boldness = 0.5
				ai_greed = 0.25
				ai_compassion = -0.5
				ai_honor = -0.5
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = greedy
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = callous
			}
			modifier = {	# Weight up for stress.
				add = 20
				has_trait = sadistic
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = compassionate
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = generous
			}
		}
	}

	# Sail on by.
	option = {
		name = fp1_yearly.0501.c

		# Minor dread gain from your crew.
		add_dread = miniscule_dread_gain

		stress_impact = {
			lazy = minor_stress_impact_loss
			callous = minor_stress_impact_loss
			arbitrary = minor_stress_impact_loss
			diligent = minor_stress_impact_gain
			compassionate = minor_stress_impact_gain
			just = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = -0.25
				ai_energy = -0.5
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = lazy
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = callous
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = arbitrary
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = diligent
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = compassionate
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = just
			}
		}
	}
}

##################################################
# The Stench of Success
# by Ewan Cowhig Croft
# 0511 - 0520
##################################################

scripted_trigger fp1_keeps_stinking_hunting_trophy = {
	# Standard checks.
	is_available_ai_adult = yes
	# Do they have the right personality?
	calc_true_if = {
		amount >= 2
		has_trait = greedy
		has_trait = lazy
		has_trait = wrathful
		has_trait = arrogant
		has_trait = brave
		has_trait = gregarious
		has_trait = ambitious
		has_trait = callous
		has_trait = sadistic
		has_trait = stubborn
		has_trait = vengeful
	}
	NOR = {
		has_trait = diligent
		has_trait = humble
		has_trait = shy
		has_trait = fickle
	}
	# Filter out anyone who'd be a better hunter than this.
	NOR = {
		has_trait = lifestyle_hunter
		has_court_position = master_of_hunt_court_position
	}
	# Finally, remove people who are currently hurt, so that berserkers can smash 'em up.
	NOT = { has_trait = wounded }
}

#	One of your courtiers is extremely proud of a hunting trophy and won't let it go.
fp1_yearly.0511 = {
	type = character_event
	title = fp1_yearly.0511.t
	desc = fp1_yearly.0511.desc
	theme = hunting
	left_portrait = {
		character = root
		animation = disgust
	}
	right_portrait = {
		character = scope:stinker
		animation = personality_honorable
	}
	override_background = { reference = study }

	trigger = {
		# DLC check.
		has_fp1_dlc_trigger = yes
		# Standard checks.
		is_available_even_at_war_adult = yes
		NOT = { has_character_flag = had_event_fp1_yearly_0511 }
		is_landed = yes
		# Filter to flavour-appropriate characters.
		fp1_is_norse_tribal = yes
		fp1_is_in_scandinavia_or_colonies = yes
		# Must have a suitable random courtier.
		any_courtier = { fp1_keeps_stinking_hunting_trophy = yes }
	}

	weight_multiplier = {
		base = 1

		# Weight up a little for special traits.
		modifier = {
			add = 0.5
			has_trait = lifestyle_hunter
		}
		modifier = {
			add = 0.5
			has_trait = berserker
		}
	}

	immediate = {
		add_character_flag = {
			flag = had_event_fp1_yearly_0511
			days = 1825
		}
		# Designate a suitable courtier.
		random_courtier = {
			# Try to grab someone relevant.
			limit = {
				fp1_keeps_stinking_hunting_trophy = yes
				is_of_major_or_minor_interest_trigger = { CHARACTER = root }
			}
			# Otherwise, any valid character will do.
			alternative_limit = { fp1_keeps_stinking_hunting_trophy = yes }
			save_scope_as = stinker
		}
		# Pick a local animal for the head to be from.
		select_local_animal_effect = { TYPE = any } # Save scope to limit possible animals: any/big/small/dangerous/harmless/prowling
		# Give them the trophy.
		scope:stinker = {
			add_character_modifier = {
				modifier = fp1_0511_carries_stinking_trophy_modifier
				years = 5
			}
		}
	}

	# It's very nice, scope:stinker. So very, very nice.
	option = {
		name = fp1_yearly.0511.a

		# Scope:stinker is very happy with you.
		reverse_add_opinion = {
			target = scope:stinker
			modifier = pleased_opinion
			opinion = 75
		}
		# Everyone else is not.
		every_courtier_or_guest = {
			custom = custom.every_courtier_and_guest
			limit = {
				this != scope:stinker
			}
			add_opinion = {
				target = root
				modifier = angry_opinion
				opinion = -20
			}
		}

		stress_impact = {
			deceitful = minor_stress_impact_loss
			patient = minor_stress_impact_loss
			shy = medium_stress_impact_loss
			impatient = minor_stress_impact_gain
			honest = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = 0.25
				ai_sociability = -0.25
				ai_boldness = -0.5
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = deceitful
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = patient
			}
			modifier = {	# Weight up for stress.
				add = 20
				has_trait = shy
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = impatient
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = honest
			}
		}
	}

	# [HighGod], [HealthGod], and [FortuneGod] too, get *rid* of it!
	option = {
		name = fp1_yearly.0511.b

		# Scope:stinker is incredibly upset.
		reverse_add_opinion = {
			target = scope:stinker
			modifier = cruelty_opinion
			opinion = -50
		}
		scope:stinker = { remove_character_modifier = fp1_0511_carries_stinking_trophy_modifier }
		# Everyone else is not.
		every_courtier_or_guest = {
			custom = custom.every_courtier_and_guest
			limit = {
				this != scope:stinker
			}
			add_opinion = {
				target = root
				modifier = grateful_opinion
				opinion = 20
			}
		}

		stress_impact = {
			wrathful = minor_stress_impact_loss
			impatient = medium_stress_impact_loss
			compassionate = minor_stress_impact_gain
			patient = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_boldness = 0.25
				ai_sociability = 0.25
				ai_compassion = -0.25
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = wrathful
			}
			modifier = {	# Weight up for stress.
				add = 20
				has_trait = impatient
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = compassionate
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = patient
			}
		}
	}

	# (Berserker) root SMASH!
	option = {
		name = fp1_yearly.0511.c
		trigger = { has_trait = berserker }
		trait = berserker

		# Scope:stinker is incredibly upset.
		reverse_add_opinion = {
			target = scope:stinker
			modifier = cruelty_opinion
			opinion = -75
		}
		scope:stinker = { remove_character_modifier = fp1_0511_carries_stinking_trophy_modifier }
		# Scope:stinker will remember this.
		progress_towards_rival_effect = {
			REASON = rival_berserker_smash
			CHARACTER = scope:stinker
			OPINION = 0
		}
		# But man, wasn't that *therapeutic*?
		## Stress loss handled in stress_impact.

		stress_impact = {
			berserker = massive_stress_loss
			impatient = minor_stress_impact_loss
			wrathful = minor_stress_impact_loss
			patient = medium_stress_impact_gain
			calm = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_vengefulness = 0.5
				ai_boldness = 0.5
				ai_compassion = -0.5
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = impatient
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = wrathful
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = patient
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = calm
			}
		}
	}

	# (Hunter) How about we get you a *new* trophy this eve?
	option = {
		name = fp1_yearly.0511.d
		# Elite hunters who don't fly off the handle.
		trigger = {
			has_trait = lifestyle_hunter
			NOT = { has_trait = berserker }
		}
		trait = lifestyle_hunter

		# Scope:stinker benefits.
		scope:stinker = {
			# They're happy with you.
			add_opinion = {
				target = root
				modifier = pleased_opinion
				opinion = 50
			}
			# And won't make the same mistake.
			add_trait = lifestyle_hunter
			# Plus they ditch the old trophy.
			remove_character_modifier = fp1_0511_carries_stinking_trophy_modifier
		}
		# Best friends?
		progress_towards_friend_effect = {
			CHARACTER = scope:stinker
			OPINION = 0
			REASON = friend_fp1_stink_new_trophy
		}
		# Everyone else is just glad the stink is gone.
		every_courtier_or_guest = {
			custom = custom.every_courtier_and_guest
			limit = {
				this != scope:stinker
			}
			add_opinion = {
				target = root
				modifier = grateful_opinion
				opinion = 10
			}
		}


		stress_impact = {
			compassionate = minor_stress_impact_loss
			gregarious = minor_stress_impact_loss
			patient = medium_stress_impact_loss
			impatient = medium_stress_impact_gain
			lazy = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = 0.5
				ai_energy = 0.5
				ai_honor = 0.25
				ai_sociability = 0.25
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = compassionate
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = gregarious
			}
			modifier = {	# Weight up for stress.
				add = 20
				has_trait = patient
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = impatient
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = lazy
			}
		}
	}

	# Yes, scope:stinker, it's rank, now please leave.
	option = {
		name = fp1_yearly.0511.e

		# Scope:stinker is quite upset.
		reverse_add_opinion = {
			target = scope:stinker
			modifier = cruelty_opinion
			opinion = -25
		}
		# But people respect you telling it like it is.
		add_prestige = minor_prestige_gain

		stress_impact = {
			honest = medium_stress_impact_loss
			deceitful = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_boldness = 0.25
				ai_sociability = -0.25
				ai_energy = -0.5
			}
			modifier = {	# Weight up for stress.
				add = 20
				has_trait = honest
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = deceitful
			}
		}
	}

	after = {
		remove_variable = animal_type
	}
}

##################################################
# Blood on the Snow
# by Ewan Cowhig Croft
# 0521 - 0530
##################################################

#	Your child challenges your mastery of snowball warfare.
fp1_yearly.0521 = {
	type = character_event
	title = fp1_yearly.0521.t
	desc = fp1_yearly.0521.desc
	theme = war
	left_portrait = {
		character = root
		animation = fear
	}
	right_portrait = {
		character = scope:child
		animation = personality_bold
	}
	override_background = { reference = market }
	widget = {
		gui = "event_window_widget_vfx_snow"
		container = "foreground_shader_vfx_container"
	}

	trigger = {
		# DLC check.
		has_fp1_dlc_trigger = yes
		# Standard checks.
		is_available_even_at_war_adult = yes
		NOT = { has_character_flag = had_event_fp1_yearly_0521 }
		is_playable_character = yes
		# Must have at least one suitable child.
		any_child = {
			child_suitable_to_play_with_character_one_sided = { CHARACTER = root }
		}
		# Gotta have snow in the capital.
		character_capital_has_winter_trigger = yes
	}

	weight_multiplier = {
		base = 1

		# Weight up for outdoorsy kids.
		modifier = {
			add = 1
			any_child = { childhood_loud_child_trigger = yes }
		}
		modifier = {
			add = 1
			any_child = { childhood_nice_child_trigger = yes }
		}

		# Weight according to winter scale.
		character_capital_has_snow_suitable_for_activities = { CHARACTER = root }
	}

	immediate = {
		play_music_cue = "mx_cue_war_declared"
		add_character_flag = {
			flag = had_event_fp1_yearly_0521
			days = 1825
		}
		# Designate a suitable child.
		fp1_pick_outdoorsy_child_for_winter_effect = yes
	}

	# Good shot! Come here y'little rascal!
	option = {
		name = fp1_yearly.0521.a

		# You get into a friendly snowball fight.
		custom_tooltip = fp1_yearly.0521.a.tt
		# Gain some opinion with them.
		reverse_add_opinion = {
			target = scope:child
			modifier = love_opinion
			opinion = 20
		}

		stress_impact = {
			gregarious = minor_stress_impact_loss
			forgiving = minor_stress_impact_loss
			vengeful = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_sociability = 0.5
				ai_energy = 0.25
				ai_vengefulness = -0.25
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = gregarious
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = forgiving
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = vengeful
			}
		}
	}

	# Throw a match against them.
	option = {
		name = fp1_yearly.0521.b

		# You take a dive.
		custom_tooltip = fp1_yearly.0521.b.tt
		# Gain more opinion.
		reverse_add_opinion = {
			target = scope:child
			modifier = love_opinion
			opinion = 40
		}
		# But lose a little prestige.
		add_prestige = minor_prestige_loss

		stress_impact = {
			forgiving = minor_stress_impact_loss
			humble = minor_stress_impact_loss
			vengeful = minor_stress_impact_gain
			arrogant = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = 0.5
				ai_sociability = 0.25
				ai_honor = -0.1
				ai_vengefulness = -0.25
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = forgiving
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = humble
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = vengeful
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = arrogant
			}
		}
	}

	# Beat them into the ground with superior martial know-how.
	option = {
		name = fp1_yearly.0521.c
		# If you've got berserker, you flip out when taking things too seriously instead.
		trigger = {
			NOR = {
				has_trait = berserker
				has_trait = strategist
			}
		}

		# Confirm to the player.
		custom_tooltip = fp1_yearly.0521.c.tt
		# Sure would be embarrassing if you lost this snowball fight your voluntarily taking too seriously, amirite?
		duel = {
			skill = martial
			target = scope:child
			# You successfully beat the child.
			40 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = fp1_yearly.0521.c.tt_success
				send_interface_toast = {
					title = fp1_yearly.0521.c.tt_success
					left_icon = scope:child
					# Minor prestige for uhh... your ruthlessness?
					add_prestige = minor_prestige_gain
					# Scope:child is a bit upset.
					reverse_add_opinion = {
						target = scope:child
						modifier = disappointed_opinion
						opinion = -30
					}
				}
			}
			# Scope:child trounces you.
			60 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = fp1_yearly.0521.c.tt_failure
				send_interface_toast = {
					title = fp1_yearly.0521.c.tt_failure
					left_icon = scope:child
					# Clearly you're taking this *way* too seriously.
					reverse_add_opinion = {
						target = scope:child
						modifier = respect_opinion
						opinion = -40
					}
				}
			}
		}

		stress_impact = {
			vengeful = medium_stress_impact_loss
			arrogant = medium_stress_impact_loss
			forgiving = medium_stress_impact_gain
			humble = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_vengefulness = 0.5
				ai_sociability = 0.25
				ai_honor = 0.1
				ai_compassion = -0.75
			}
			modifier = {	# Weight up for stress.
				add = 20
				has_trait = vengeful
			}
			modifier = {	# Weight up for stress.
				add = 20
				has_trait = arrogant
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = forgiving
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = humble
			}
		}
	}

	# (Strategist) Insta-beat 'em.
	option = {
		name = fp1_yearly.0521.d
		trigger = {
			has_trait = strategist
			NOT = { has_trait = berserker }
		}
		trait = strategist

		# Confirm to the player.
		custom_tooltip = fp1_yearly.0521.d.tt
		# Minor prestige for uhh... your ruthlessness?
		add_prestige = minor_prestige_gain
		# Scope:child is a bit awed.
		reverse_add_opinion = {
			target = scope:child
			modifier = respect_opinion
			opinion = 20
		}

		stress_impact = {
			vengeful = medium_stress_impact_loss
			arrogant = medium_stress_impact_loss
			forgiving = medium_stress_impact_gain
			humble = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_vengefulness = 0.5
				ai_sociability = 0.25
				ai_honor = 0.1
				ai_compassion = -0.75
			}
			modifier = {	# Weight up for stress.
				add = 20
				has_trait = vengeful
			}
			modifier = {	# Weight up for stress.
				add = 20
				has_trait = arrogant
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = forgiving
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = humble
			}
		}
	}

	# (Berserker) RRRAAAAARRRGGGHHH!
	option = {
		name = fp1_yearly.0521.e
		trigger = { has_trait = berserker }
		trait = berserker

		# The snowball triggers your berserk rage.
		custom_tooltip = fp1_yearly.0521.e.tt
		# Berserkergang relieves stress.
		## Stress loss handled in stress impact.
		# Scope:child is *terrified*.
		reverse_add_opinion = {
			target = scope:child
			modifier = scared_opinion
			opinion = -100
		}

		stress_impact = {
			berserker = massive_stress_loss
			impatient = minor_stress_impact_loss
			wrathful = minor_stress_impact_loss
			patient = medium_stress_impact_gain
			calm = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_vengefulness = 0.75
				ai_compassion = -1
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = impatient
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = wrathful
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = patient
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = calm
			}
		}
	}

	# Don't bother parent whilst they're working. Run along.
	option = {
		name = fp1_yearly.0521.f

		# Welp, that's that dealt with.
		add_stress = minor_stress_loss
		# Scope:child is mildly hurt.
		reverse_add_opinion = {
			target = scope:child
			modifier = hurt_opinion
			opinion = -10
		}

		# Too gentle a response to give stress, to be honest.
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_vengefulness = -0.25
				ai_energy = -0.5
				ai_sociability = -0.75
			}
		}
	}
}

##################################################
# [Dynasty] on Ice
# by Ewan Cowhig Croft
# 0531 - 0540
##################################################

scripted_trigger fp1_child_not_had_decisive_skating_lessons_trigger = {
	NOR = {
		has_character_flag = child_had_event_fp1_yearly_0531
		has_character_modifier = fp1_avoiding_the_snow_modifier
	}
}

#	Teaching your Child to Ice Skate
fp1_yearly.0531 = {
	type = character_event
	title = fp1_yearly.0531.t
	desc = fp1_yearly.0531.desc
	theme = education
	left_portrait = {
		character = root
		animation = admiration
	}
	right_portrait = {
		character = scope:child
		animation = shame
	}
	override_background = { reference = courtyard }

	trigger = {
		# DLC check.
		has_fp1_dlc_trigger = yes
		# Standard checks.
		is_available_even_at_war_adult = yes
		NOT = { has_character_flag = had_event_fp1_yearly_0531 }
		is_playable_character = yes
		# Must be a suitable culture.
		culture_uses_frequent_winter_transportation_trigger = yes
		# Must have at least one suitable child.
		any_child = {
			child_suitable_to_play_with_character_one_sided = { CHARACTER = root }
			# Can't have successfully learnt/been encouraged away from already.
			fp1_child_not_had_decisive_skating_lessons_trigger = yes
		}
		# Gotta have snow in the capital.
		character_capital_has_winter_trigger = yes
	}

	weight_multiplier = {
		base = 1

		# Weight up for outdoorsy kids.
		modifier = {
			add = 1
			any_child = { childhood_loud_child_trigger = yes }
		}
		modifier = {
			add = 1
			any_child = { childhood_nice_child_trigger = yes }
		}

		# Weight according to winter scale.
		character_capital_has_snow_suitable_for_activities = { CHARACTER = root }
	}

	immediate = {
		add_character_flag = {
			flag = had_event_fp1_yearly_0531
			days = 1825
		}
		# Pick a suitable child; this is a slightly modified fp1_pick_outdoorsy_child_for_winter, as we need to filter out a few things.
		random_child = {
			# Try to pick an outdoorsy child first.
			limit = {
				child_suitable_to_play_with_character_one_sided = { CHARACTER = root }
				OR = {
					has_trait = rowdy
					childhood_loud_child_trigger = yes
					childhood_nice_child_trigger = yes
				}
				# Can't have successfully learnt/been encouraged away from already.
				fp1_child_not_had_decisive_skating_lessons_trigger = yes
			}
			# Otherwise, any is good.
			alternative_limit = {
				child_suitable_to_play_with_character_one_sided = { CHARACTER = root }
				# Can't have successfully learnt/been encouraged away from already.
				fp1_child_not_had_decisive_skating_lessons_trigger = yes
			}
			save_scope_as = child
		}
	}

	# It's easy! Alright, you can watch me...
	option = {
		name = fp1_yearly.0531.a

		duel = {
			skill = diplomacy
			value = 10
			# You successfully explain what's up to scope:child.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = fp1_yearly.0531.a.tt_success
				send_interface_toast = {
					title = fp1_yearly.0531.a.tt_success
					left_icon = scope:child
					scope:child = {
						# Gain some opinion with them.
						add_opinion = {
							target = root
							modifier = love_opinion
							opinion = 20
						}
						# And this boosts their confidence & balance.
						add_prowess_skill = medium_skill_bonus
						add_diplomacy_skill = medium_skill_bonus
						# Flag them as having learnt and not needing to learn again.
						add_character_flag = {
							flag = child_had_event_fp1_yearly_0531
							years = 20
						}
					}
				}
			}
			# You just frustrate them further.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = fp1_yearly.0531.a.tt_failure
				send_interface_toast = {
					title = fp1_yearly.0531.a.tt_failure
					left_icon = scope:child
					# They grow frustrated.
					reverse_add_opinion = {
						target = scope:child
						modifier = respect_opinion
						opinion = -20
					}
					scope:child = { add_stress = major_stress_gain }
				}
			}
		}

		stress_impact = {
			diligent = minor_stress_impact_loss
			lazy = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_sociability = 0.5
				ai_energy = 0.5
				ai_compassion = 0.25
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = diligent
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = lazy
			}
		}
	}

	# Don't we have maids for you to pester?
	option = {
		name = fp1_yearly.0531.b

		# You focus on your work.
		add_character_modifier = {
			modifier = fp1_focusing_on_rule_modifier
			years = 10
		}
		# They grow frustrated.
		reverse_add_opinion = {
			target = scope:child
			modifier = hurt_opinion
			opinion = -40
		}
		# And will remember this in later life.
		hidden_effect = {
			if = {
				limit = {
					can_set_relation_potential_rival_trigger = { CHARACTER = scope:child }
				}
				set_relation_potential_rival = scope:child
			}
		}

		stress_impact = {
			callous = minor_stress_impact_loss
			lazy = major_stress_impact_loss
			compassionate = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = -0.25
				ai_energy = -0.5
				ai_sociability = -0.5
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = callous
			}
			modifier = {	# Weight up for stress.
				add = 30
				has_trait = lazy
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = compassionate
			}
		}
	}

	# Play indoors, you'll catch the cold.
	option = {
		name = fp1_yearly.0531.c

		# Your advice is taken.
		scope:child = {
			add_character_modifier = {
				modifier = fp1_avoiding_the_snow_modifier
				years = 10
			}
		}
		# They're a tad bummed though.
		reverse_add_opinion = {
			target = scope:child
			modifier = disappointed_opinion
			opinion = -20
		}

		stress_impact = {
			cynical = minor_stress_impact_loss
			paranoid = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = 0.25
				ai_boldness = -0.5
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = cynical
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = paranoid
			}
		}
	}
}

##################################################
# The Beast of [Capital]
# by Ewan Cowhig Croft
# 0541 - 0550
##################################################

scripted_trigger fp1_0541_valid_child_prankster_trigger = {
	# Is available for events.
	is_available_ai_child = yes
	# Child is in the correct age bracket.
	child_not_infant_trigger = yes
	child_not_teen_trigger = yes
	# Must not be a quiet child.
	childhood_quiet_child_trigger = no
}

scripted_trigger fp1_0541_valid_courtier_victim_trigger = {
	# Is available for events.
	is_available_ai_adult = yes
	# Isn't especially brave or good at dealing with kids.
	NOR = {
		has_trait = calm
		has_trait = patient
		has_trait = humble
		has_trait = brave
		has_trait = shy
		has_trait = gregarious
		has_trait = trusting
		has_trait = compassionate
		has_trait = forgiving
	}
	# And, in case you act disproportionately, they aren't a good relationship.
	has_friendly_relationship_with_root_trigger = no
}

#	Young child with animal furs is pretending to be a large animal.
fp1_yearly.0541 = {
	type = character_event
	title = fp1_yearly.0541.t
	desc = fp1_yearly.0541.desc
	theme = family
	left_portrait = {
		character = scope:courtier
		animation = rage
	}
	right_portrait = {
		character = scope:child
		animation = schadenfreude
	}
	override_background = { reference = corridor_day }

	trigger = {
		# DLC check.
		has_fp1_dlc_trigger = yes
		# Standard checks.
		is_available_even_at_war_adult = yes
		NOT = { has_character_flag = had_event_fp1_yearly_0541 }
		is_landed = yes
		# Intended for Norse-ish tribals.
		fp1_is_norse_tribal = yes
		fp1_is_in_scandinavia_or_colonies = yes
		# Has a valid child.
		any_child = { fp1_0541_valid_child_prankster_trigger = yes }
		# Has a valid courtier.
		any_courtier = { fp1_0541_valid_courtier_victim_trigger = yes }
	}

	weight_multiplier = {
		base = 1

		# Weight up for active/mean kids.
		modifier = {
			add = 1
			any_child = { childhood_loud_child_trigger = yes }
		}
		modifier = {
			add = 1
			any_child = { childhood_mean_child_trigger = yes }
		}
	}

	immediate = {
		add_character_flag = {
			flag = had_event_fp1_yearly_0541
			days = 1825
		}
		# Pick an appropriate child.
		random_child = {
			# Prefer rowdy or mean-spirited children.
			limit = {
				fp1_0541_valid_child_prankster_trigger = yes
				OR = {
					childhood_loud_child_trigger = yes
					childhood_mean_child_trigger = yes
				}
			}
			# Though otherwise any valid child is acceptable.
			alternative_limit = { fp1_0541_valid_child_prankster_trigger = yes }
			save_scope_as = child
		}
		# And an appropriate courtier.
		random_courtier = {
			limit = {
				fp1_0541_valid_courtier_victim_trigger = yes
				is_of_major_or_minor_interest_trigger = { CHARACTER = root }
			}
			alternative_limit = { fp1_0541_valid_courtier_victim_trigger = yes }
			save_scope_as = courtier
		}
		select_local_animal_effect = { TYPE = dangerous } # Save scope to limit possible animals: any/big/small/dangerous/harmless/prowling
	}

	# This is honestly just bloody hilarious.
	option = {
		name = fp1_yearly.0541.a

		# Scope:child is pretty damned happy.
		reverse_add_opinion = {
			target = scope:child
			modifier = amused_opinion
			opinion = 40
		}
		# Scope:courtier loses opinion, though.
		reverse_add_opinion = {
			target = scope:courtier
			modifier = respect_opinion
			opinion = -50
		}
		# Other courtiers are sceptical.
		every_courtier_or_guest = {
			custom = custom.every_courtier_and_guest
			limit = {
				NOR = {
					this = scope:child
					this = scope:courtier
				}
			}
			add_opinion = {
				target = root
				modifier = amused_opinion
				opinion = -10
			}
		}

		stress_impact = {
			gregarious = minor_stress_impact_loss
			vengeful = minor_stress_impact_loss
			arbitrary = minor_stress_impact_loss
			just = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_boldness = 0.25
				ai_vengefulness = 0.25
				ai_sociability = 0.25
				ai_compassion = -0.25
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = gregarious
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = vengeful
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = arbitrary
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = just
			}
		}
	}

	# Punish scope:child.
	option = {
		name = fp1_yearly.0541.b

		# Scope:courtier is happy, and you gain a favour hook if possible.
		if = {
			limit = {
				can_add_hook = {
					type = favor_hook
					target = scope:courtier
				}
			}
			add_hook = {
				type = favor_hook
				target = scope:courtier
				years = 5
			}
		}
		reverse_add_opinion = {
			target = scope:courtier
			modifier = pleased_opinion
			opinion = 20
		}
		# Scope:child is upset.
		reverse_add_opinion = {
			target = scope:child
			modifier = hurt_opinion
			opinion = -30
		}

		stress_impact = {
			just = minor_stress_impact_loss
			forgiving = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 0.25
				ai_honor = 0.25
				ai_vengefulness = -0.25
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = just
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = forgiving
			}
		}
	}

	# Evict scope:courtier.
	option = {
		name = fp1_yearly.0541.c

		# Scope:child is very happy.
		reverse_add_opinion = {
			target = scope:child
			modifier = amused_opinion
			opinion = 30
		}
		# Scope:courtier is gobsmacked, might become a rival, and leaves.
		reverse_add_opinion = {
			target = scope:courtier
			modifier = respect_opinion
			opinion = -30
		}
		scope:child = { save_scope_as = relationship_reason_involved_character }
		progress_towards_rival_effect = {
			REASON = rival_harassed_exiled
			CHARACTER = scope:courtier
			OPINION = 0
		}
		clear_saved_scope = relationship_reason_involved_character
		scope:courtier = { select_and_move_to_pool_effect = yes }

		stress_impact = {
			arbitrary = major_stress_impact_loss
			just = major_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_vengefulness = 0.5
				ai_compassion = -0.5
				ai_rationality = -0.5
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = arbitrary
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = just
			}
		}
	}

	# I really, profoundly do not care.
	option = {
		name = fp1_yearly.0541.d

		# Gain a little prestige for telling them to sod off.
		add_prestige = minor_prestige_gain
		# Both scope:child & scope:courtier are a tad upset.
		reverse_add_opinion = {
			target = scope:courtier
			modifier = disappointed_opinion
			opinion = -10
		}
		reverse_add_opinion = {
			target = scope:child
			modifier = disappointed_opinion
			opinion = -10
		}

		stress_impact = {
			arbitrary = minor_stress_impact_loss
			lazy = medium_stress_impact_loss
			just = medium_stress_impact_gain
			diligent = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_energy = -0.5
				ai_sociability = -0.5
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = arbitrary
			}
			modifier = {	# Weight up for stress.
				add = 20
				has_trait = lazy
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = just
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = diligent
			}
		}
	}
}

##################################################
# Fishy Business
# by Ewan Cowhig Croft
# 0551 - 0560
##################################################

scripted_trigger fp1_0551_appropriately_smelly_courtier_trigger = {
	# Standard checks.
	is_available_ai_adult = yes
	# Must have some quality that's inspired this odd attitude.
	OR = {
		# Enjoys eating oddities.
		has_trait = lifestyle_hunter
		has_trait = gluttonous
		has_trait = vengeful
		# Weird health foods.
		has_trait = whole_of_body
		has_trait = lifestyle_mystic
		has_trait = lifestyle_physician
		# Refuses to admit wrong-doing.
		has_trait = arrogant
		has_trait = stubborn
		has_trait = sadistic
	}
	# And nothing that would rule it out.
	NOR = {
		has_trait = temperate
		has_trait = fickle
		has_trait = compassionate
	}
}

#	One of your courtiers has taken a liking to foul food stuffs.
fp1_yearly.0551 = {
	type = character_event
	title = fp1_yearly.0551.t
	desc = fp1_yearly.0551.desc
	theme = unfriendly
	left_portrait = {
		character = root
		animation = disapproval
	}
	right_portrait = {
		character = scope:antisocialite
		animation = personality_greedy
	}
	override_background = { reference = feast }

	trigger = {
		# DLC check.
		has_fp1_dlc_trigger = yes
		# Standard checks.
		is_available_even_at_war_adult = yes
		NOT = { has_character_flag = had_event_fp1_yearly_0551 }
		is_landed = yes
		# Filter to flavour-appropriate characters.
		fp1_is_norse_tribal = yes
		fp1_is_in_scandinavia = yes
		# Has a suitable courtier.
		any_courtier = { fp1_0551_appropriately_smelly_courtier_trigger = yes }
	}

	weight_multiplier = { base = 1 }

	immediate = {
		add_character_flag = {
			flag = had_event_fp1_yearly_0551
			days = 1825
		}
		# Grab an appropriate courtier.
		random_courtier = {
			limit = {
				fp1_0551_appropriately_smelly_courtier_trigger = yes
				is_of_major_or_minor_interest_trigger = { CHARACTER = root }
			}
			alternative_limit = { fp1_0551_appropriately_smelly_courtier_trigger = yes }
			save_scope_as = antisocialite
		}
	}

	# Let's have a chat.
	option = {
		name = fp1_yearly.0551.a

		# See if you can politely convince scope:antisocialite to be a bit more respectful.
		duel = {
			skill = diplomacy
			target = scope:antisocialite
			# You put your point across eloquently.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -45
				}
				desc = fp1_yearly.0551.a.tt_success
				send_interface_toast = {
					title = fp1_yearly.0551.a.tt_success
					left_icon = scope:antisocialite
					reverse_add_opinion = {
						target = scope:antisocialite
						modifier = respect_opinion
						opinion = 20
					}
					every_courtier_or_guest = {
						custom = custom.every_courtier_and_guest
						limit = {
							this != scope:antisocialite
						}
						add_opinion = {
							target = root
							modifier = grateful_opinion
							opinion = 20
						}
					}
					# And a bit of prestige to sweeten the pot.
					add_prestige = minor_prestige_gain
				}
			}
			# Scope:socialite is incredibly insulted.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -45
				}
				desc = fp1_yearly.0551.a.tt_failure
				send_interface_toast = {
					title = fp1_yearly.0551.a.tt_failure
					left_icon = scope:antisocialite
					reverse_add_opinion = {
						target = scope:antisocialite
						modifier = insult_opinion
						opinion = -40
					}
					progress_towards_rival_effect = {
						REASON = rival_smells_of_fish
						CHARACTER = scope:antisocialite
						OPINION = 0
					}
				}
			}
		}

		stress_impact = {
			gregarious = minor_stress_impact_loss
			honest = minor_stress_impact_loss
			shy = minor_stress_impact_gain
			lazy = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_sociability = 0.5
				ai_compassion = 0.25
				ai_rationality = 0.25
				ai_vengefulness = -0.5
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = gregarious
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = honest
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = shy
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = lazy
			}
		}
	}

	# Perhaps I could simply move my quarters further away?
	option = {
		name = fp1_yearly.0551.b
		trigger = {
			NOT = { has_trait = gluttonous }
		}

		# Make it clear that scope:antisocialite will continue their smelly rampage.
		custom_tooltip = fp1_yearly.0551.b.tt
		# Gain a weak hook on the courtier.
		if = {
			limit = {
				can_add_hook = {
					target = scope:antisocialite
					type = favor_hook
					years = 5
				}
			}
			add_hook = {
				target = scope:antisocialite
				type = favor_hook
				years = 5
			}
		}
		# And some opinion.
		reverse_add_opinion = {
			target = scope:antisocialite
			modifier = grateful_opinion
			opinion = 30
		}
		# Lose a bit of respect with everyone else.
		every_courtier_or_guest = {
			custom = custom.every_courtier_and_guest
			# Speedily filter out the root cause.
			limit = {
				this != scope:antisocialite
			}
			add_opinion = {
				target = root
				modifier = respect_opinion
				opinion = -20
			}
		}

		stress_impact = {
			arbitrary = medium_stress_impact_loss
			shy = major_stress_impact_loss
			honest = minor_stress_impact_gain
			gregarious = major_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_vengefulness = -0.5
				ai_rationality = -0.5
				ai_sociability = -0.75
			}
			modifier = {	# Weight up for stress.
				add = 20
				has_trait = arbitrary
			}
			modifier = {	# Weight up for stress.
				add = 30
				has_trait = shy
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = honest
			}
			modifier = {	# Weight down for stress.
				add = -30
				has_trait = gregarious
			}
		}
	}

	# (Gluttonous) Do... do you have any more of that?
	option = {
		name = fp1_yearly.0551.b_alt
		trigger = { has_trait = gluttonous }
		trait = gluttonous

		# Make it clear that scope:antisocialite will continue their smelly rampage.
		custom_tooltip = fp1_yearly.0551.b_alt.tt
		# Gain a strong hook on the courtier.
		if = {
			limit = {
				can_add_hook = {
					target = scope:antisocialite
					type = loyalty_hook
				}
			}
			add_hook = {
				target = scope:antisocialite
				type = loyalty_hook
			}
		}
		# Become friends, if possible.
		if = {
			limit = {
				can_set_relation_friend_trigger = { CHARACTER = scope:antisocialite }
			}
			set_relation_friend = { reason = friend_delectable_herring target = scope:antisocialite }
		}
		# And some opinion.
		reverse_add_opinion = {
			target = scope:antisocialite
			modifier = respect_opinion
			opinion = 50
		}
		# Lose a *fair* of respect with everyone else.
		every_courtier_or_guest = {
			custom = custom.every_courtier_and_guest
			# Speedily filter out the root cause.
			limit = {
				this != scope:antisocialite
			}
			add_opinion = {
				target = root
				modifier = respect_opinion
				opinion = -40
			}
		}

		stress_impact = {
			arbitrary = medium_stress_impact_loss
			shy = major_stress_impact_loss
			honest = minor_stress_impact_gain
			gregarious = major_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_vengefulness = -0.5
				ai_rationality = -0.5
				ai_sociability = -0.75
			}
			modifier = {	# Weight up for stress.
				add = 20
				has_trait = arbitrary
			}
			modifier = {	# Weight up for stress.
				add = 30
				has_trait = shy
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = honest
			}
			modifier = {	# Weight down for stress.
				add = -30
				has_trait = gregarious
			}
		}
	}

	# You know what? Dungeon. *Now*.
	option = {
		name = fp1_yearly.0551.c

		# No one objects to the imprisonment.
		rightfully_imprison_character_effect = {
			TARGET = scope:antisocialite
			IMPRISONER = root
		}
		hidden_effect = {
			scope:antisocialite = { change_prison_type = dungeon }
		}
		# Immediate gratitude from your courtiers et al.
		every_courtier_or_guest = {
			custom = custom.every_courtier_and_guest
			# Speedily filter out the root cause.
			limit = {
				this != scope:antisocialite
			}
			add_opinion = {
				target = root
				modifier = grateful_opinion
				opinion = 20
			}
		}

		stress_impact = {
			arbitrary = minor_stress_impact_loss
			callous = minor_stress_impact_loss
			sadistic = minor_stress_impact_loss
			just = medium_stress_impact_gain
			compassionate = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_vengefulness = 0.5
				ai_honor = -0.5
				ai_compassion = -0.5
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = arbitrary
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = callous
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = sadistic
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = just
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = compassionate
			}
		}
	}

	# What a shame, it seems my attention is required *far* away.
	option = {
		name = fp1_yearly.0551.d

		# What a relief.
		## Stress loss handled in stress_impact.
		# Lose a bit of respect with everyone else.
		every_courtier_or_guest = {
			custom = custom.every_courtier_and_guest
			# Speedily filter out the root cause.
			limit = {
				this != scope:antisocialite
			}
			add_opinion = {
				target = root
				modifier = respect_opinion
				opinion = -10
			}
		}
		# Gain a mild modifier.
		add_character_modifier = {
			modifier = fp1_yearly_0551_absent_lord_modifier
			years = 5
		}

		stress_impact = {
			base = major_stress_loss
			shy = minor_stress_impact_loss
			gregarious = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_energy = 0.5
				ai_sociability = -0.25
				ai_boldness = -0.5
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = shy
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = gregarious
			}
		}
	}
}

##################################################
# My Arm Against Yours
# by Ewan Cowhig Croft
# 0561 - 0570
##################################################

scripted_trigger fp1_0561_is_friendly_knight_trigger = {
	# Standard checks.
	is_available_ai_adult = yes
	is_landed = no
	# Has some sociable qualities.
	OR = {
		ai_sociability >= low_positive_ai_value
		ai_boldness >= low_positive_ai_value
		ai_energy >= low_positive_ai_value
		ai_honor >= low_positive_ai_value
		has_trait = wrathful
		has_trait = arrogant
		has_trait = brave
		has_trait = gregarious
		has_trait = ambitious
		has_trait = lifestyle_reveler
	}
	# No special relationship with root.
	has_any_good_relationship_with_root_trigger = no
	has_any_bad_relationship_with_root_trigger = no
	# Doesn't absolutely hate root.
	opinion = {
		target = root
		value >= low_negative_opinion
	}
}

#	One of your knights challenges you to a friendly arm wrestle.
fp1_yearly.0561 = {
	type = character_event
	title = fp1_yearly.0561.t
	desc = fp1_yearly.0561.desc
	theme = friendly
	left_portrait = {
		character = root
		animation = personality_bold
	}
	right_portrait = {
		character = scope:knight
		animation = admiration
	}
	override_background = { reference = tavern }

	trigger = {
		# DLC check.
		has_fp1_dlc_trigger = yes
		# Standard checks.
		is_available_at_peace_adult = yes
		NOT = { has_character_flag = had_event_fp1_yearly_0561 }
		is_landed = yes
		# Filter to flavour-appropriate characters.
		fp1_is_norse_tribal = yes
		# Has an appropriate available knight.
		any_knight = { fp1_0561_is_friendly_knight_trigger = yes }
		# Must be a suitable challengee.
		prowess >= mediocre_skill_rating
		is_healthy = yes
		can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = root }
	}

	weight_multiplier = {
		base = 1

		# Weight down/up a little according to prowess.
		modifier = {
			add = -0.25
			prowess <= low_skill_rating
		}
		modifier = {
			add = -0.25
			prowess <= mediocre_skill_rating
		}
		modifier = {
			add = 0.25
			prowess >= high_skill_rating
		}
		modifier = {
			add = 0.25
			prowess >= very_high_skill_rating
		}
	}

	immediate = {
		add_character_flag = {
			flag = had_event_fp1_yearly_0561
			days = 1825
		}
		# Grab an appropriate knight to wrassle.
		random_knight = {
			limit = {
				fp1_0561_is_friendly_knight_trigger = yes
				is_of_major_or_minor_interest_trigger = { CHARACTER = root }
			}
			alternative_limit = { fp1_0561_is_friendly_knight_trigger = yes }
			# We want to weight up higher prowess knights, but not that dramatically.
			weight = {
				base = 0
				modifier = {
					add = {
						value = prowess
						multiply = 0.5
					}
				}
			}
			save_scope_as = knight
		}
	}

	# Accept the challenge.
	option = {
		name = fp1_yearly.0561.a
		trigger = {
			NOR = {
				has_trait = strong
				has_trait = physique_good
			}
		}

		# Basic prowess challenge.
		duel = {
			skill = prowess
			target = scope:knight
			# You win: some minor prestige, more opinion.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = fp1_yearly.0561.a.tt_success
				send_interface_toast = {
					title = fp1_yearly.0561.a.tt_success
					left_icon = scope:knight
					add_prestige = minor_prestige_gain
					reverse_add_opinion = {
						target = scope:knight
						modifier = impressed_opinion
						opinion = 30
					}
				}
			}
			# You lose: well, not a huge deal, and still good fun.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = fp1_yearly.0561.a.tt_failure
				send_interface_toast = {
					title = fp1_yearly.0561.a.tt_failure
					left_icon = scope:knight
					add_prestige = miniscule_prestige_loss
					reverse_add_opinion = {
						target = scope:knight
						modifier = amused_opinion
						opinion = 10
					}
				}
			}
		}
		# Either way you step friendship.
		progress_towards_friend_effect = {
			CHARACTER = scope:knight
			OPINION = 0
			REASON = friend_arm_wrestled
		}

		stress_impact = {
			gregarious = minor_stress_impact_loss
			arrogant = minor_stress_impact_loss
			shy = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_boldness = 0.5
				ai_energy = 0.5
				ai_honor = 0.5
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = gregarious
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = arrogant
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = shy
			}
		}
	}

	# (Strong/Physique_Good) *cracks knuckles*
	option = {
		name = fp1_yearly.0561.b
		trigger = {
			OR = {
				has_trait = strong
				has_trait = physique_good
			}
		}
		trait = strong
		trait = physique_good_1
		trait = physique_good_2
		trait = physique_good_3

		# Effortless victory grants prestige & opinion.
		custom_tooltip = fp1_yearly.0561.b.tt
		add_prestige = medium_prestige_gain
		reverse_add_opinion = {
			target = scope:knight
			modifier = impressed_opinion
			opinion = 30
		}

		stress_impact = {
			gregarious = minor_stress_impact_loss
			arrogant = minor_stress_impact_loss
			shy = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_boldness = 0.5
				ai_energy = 0.5
				ai_honor = 0.5
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = gregarious
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = arrogant
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = shy
			}
		}
	}

	# Attempt to cheat.
	option = {
		name = fp1_yearly.0561.c

		# Modest intrigue challenge.
		duel = {
			skill = intrigue
			target = scope:knight
			# You win, making it look *dramatic*!
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = fp1_yearly.0561.c.tt_success
				send_interface_toast = {
					title = fp1_yearly.0561.c.tt_success
					left_icon = scope:knight
					# Gain prestige for your win!
					add_prestige = medium_prestige_gain
					# But your foe might know something...
					reverse_add_opinion = {
						target = scope:knight
						modifier = suspicion_opinion
						opinion = -5
					}
				}
			}
			# Your cheating is discovered...
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = fp1_yearly.0561.c.tt_failure
				send_interface_toast = {
					title = fp1_yearly.0561.c.tt_failure
					left_icon = scope:knight
					# This is embarrassing.
					add_prestige = minor_prestige_loss
					# Welp, scope:knight is pissed.
					reverse_add_opinion = {
						target = scope:knight
						modifier = weak_opinion
						opinion = -40
					}
					progress_towards_rival_effect = {
						REASON = rival_cheated_at_armwrestle
						CHARACTER = scope:knight
						OPINION = 0
					}
				}
			}
		}

		stress_impact = {
			deceitful = medium_stress_impact_loss
			honest = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_boldness = 0.5
				ai_energy = 0.5
				ai_honor = -0.5
			}
			modifier = {	# Weight up for stress.
				add = 20
				has_trait = deceitful
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = honest
			}
		}
	}

	# Ignore scope:knight and continue eating.
	option = {
		name = fp1_yearly.0561.d

		# Gain minor prestige for just not bothering.
		add_prestige = miniscule_prestige_gain
		# Hurt the knight's feelings a little.
		reverse_add_opinion = {
			target = scope:knight
			modifier = hurt_opinion
			opinion = -10
		}

		stress_impact = {
			arrogant = minor_stress_impact_loss
			gluttonous = minor_stress_impact_loss
			shy = medium_stress_impact_loss
			lazy = medium_stress_impact_loss
			humble = minor_stress_impact_gain
			gregarious = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_energy = -0.5
				ai_sociability = -0.75
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = arrogant
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = gluttonous
			}
			modifier = {	# Weight up for stress.
				add = 20
				has_trait = shy
			}
			modifier = {	# Weight up for stress.
				add = 20
				has_trait = lazy
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = humble
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = gregarious
			}
		}
	}
}

##################################################
# Petty Vandalism
# by Ewan Cowhig Croft
# 0571 - 0580
##################################################

scripted_trigger fp1_0571_suitable_vandal_child_available_trigger = {
	# Is available for events.
	is_available_ai_child = yes
	# Child is old enough to have travelled that far.
	age >= 10
	# Must not be a quiet child.
	childhood_quiet_child_trigger = no
}

scripted_trigger fp1_0571_suitable_annoyed_courtier_trigger = {
	# Is available for events.
	is_available_ai_adult = yes
	# Likely to be annoyed at the vandalism.
	NOR = {
		has_trait = calm
		has_trait = patient
		has_trait = shy
		has_trait = craven
		has_trait = arbitrary
		has_trait = fickle
		has_trait = lazy
		has_trait = trusting
	}
}

scripted_trigger fp1_0571_suitable_vandal_site_trigger = {
	tier = tier_county
	fp1_county_has_stele_trigger = yes
	squared_distance = {
		target = root.capital_county
		value <= squared_distance_small
	}
}

#	A runestone in your lands has been damaged by one of your children.
fp1_yearly.0571 = {
	type = character_event
	title = fp1_yearly.0571.t
	desc = fp1_yearly.0571.desc
	theme = family
	left_portrait = {
		character = scope:courtier
		animation = disapproval
	}
	right_portrait = {
		character = scope:child
		animation = shame
	}
	override_background = { reference = fp1_runestone }

	trigger = {
		# DLC check.
		has_fp1_dlc_trigger = yes
		# Standard checks.
		is_available_even_at_war_adult = yes
		NOT = { has_character_flag = had_event_fp1_yearly_0571 }
		is_landed_or_landless_administrative = yes
		# Filter to flavour-appropriate characters.
		fp1_is_norse = yes
		# Must have an appropriate runestone in your territory.
		any_held_title = { fp1_0571_suitable_vandal_site_trigger = yes }
		# A valid child.
		any_child = { fp1_0571_suitable_vandal_child_available_trigger = yes }
		# And a courtier who might not appreciate things.
		any_courtier = { fp1_0571_suitable_annoyed_courtier_trigger = yes }

	}

	weight_multiplier = {
		base = 1

		# If you're setting a good example, kids are less likely to imitate.
		modifier = {
			add = 0.5
			has_trait = just
		}
		# And the reverse.
		modifier = {
			add = -0.5
			has_trait = arbitrary
		}
	}

	immediate = {
		add_character_flag = {
			flag = had_event_fp1_yearly_0571
			days = 1825
		}
		# Select a runestone location.
		random_held_title = {
			limit = { fp1_0571_suitable_vandal_site_trigger = yes }
			save_scope_as = vandal_site
		}
		# Grab a suitable child.
		random_child = {
			# Prefer rowdy or mean-spirited children.
			limit = {
				fp1_0541_valid_child_prankster_trigger = yes
				OR = {
					childhood_loud_child_trigger = yes
					childhood_mean_child_trigger = yes
				}
			}
			# Though otherwise any valid child is acceptable.
			alternative_limit = { fp1_0571_suitable_vandal_child_available_trigger = yes }
			save_scope_as = child
		}
		# And the courtier.
		random_courtier = {
			# Try to get someone who dislikes the child first.
			limit = {
				fp1_0571_suitable_annoyed_courtier_trigger = yes
				opinion = {
					target = scope:child
					value <= neutral_opinion
				}
			}
			# Otherwise, whoever is fine.
			alternative_limit = { fp1_0571_suitable_annoyed_courtier_trigger = yes }
			save_scope_as = courtier
		}
		# Quietly make the two potential rivals for later.
		hidden_effect = {
			if = {
				limit = {
					scope:child = {
						can_set_relation_potential_rival_trigger = { CHARACTER = scope:courtier }
					}
				}
				scope:child = { set_relation_potential_rival = scope:courtier }
			}
		}
	}

	# Look, you can't be defacing expensive monuments, 'kay?
	option = {
		name = fp1_yearly.0571.a

		# Diplomacy challenge to persuade the child.
		duel = {
			skill = diplomacy
			target = scope:child
			# Child sees how they've gone wrong.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = fp1_yearly.0571.tt_success
				send_interface_toast = {
					title = fp1_yearly.0571.tt_success
					left_icon = scope:child
					# If the child's personality can accept it, make them honourable.
					scope:child = {
						if = {
							limit = {
								number_of_personality_traits < personality_trait_standard
								NOR = {
									has_trait = arbitrary
									has_trait = just
								}
							}
							add_trait = just
						}
					}
					# Otherwise, just give opinion.
					reverse_add_opinion = {
						target = scope:child
						modifier = respect_opinion
						opinion = 30
					}
				}
			}
			# Child doesn't understand what the issue even is.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = fp1_yearly.0571.tt_failure
				send_interface_toast = {
					title = fp1_yearly.0571.tt_failure
					left_icon = scope:child
					# If the child's personality can accept it, make them arbitrary.
					scope:child = {
						if = {
							limit = {
								number_of_personality_traits < personality_trait_standard
								NOT = { has_trait = just }
							}
							add_trait = arbitrary
						}
					}
					# Otherwise, just give opinion.
					reverse_add_opinion = {
						target = scope:child
						modifier = respect_opinion
						opinion = -20
					}
				}
			}
		}
		# Courtier is satisfied that something has been done.
		reverse_add_opinion = {
			target = scope:courtier
			modifier = impressed_opinion
			opinion = 30
		}
		# The runestone is destroyed.
		scope:vandal_site = { fp1_remove_stele_effect = yes }

		stress_impact = {
			trusting = medium_stress_impact_loss
			vengeful = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = 0.25
				ai_greed = -0.5
				ai_vengefulness = -0.5
			}
			modifier = {	# Weight up for stress.
				add = 20
				has_trait = trusting
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = vengeful
			}
		}
	}

	# I'll be fining the cost of the runestone from your things.
	option = {
		name = fp1_yearly.0571.b

		# Gain opinion with the courtier.
		reverse_add_opinion = {
			target = scope:courtier
			modifier = pleased_opinion
			opinion = 30
		}
		# The runestone is repaired.
		custom_tooltip = fp1_yearly.0571.b.tt
		# Lose opinion with the child, and fine them gold.
		scope:child = {
			add_opinion = {
				target = root
				modifier = respect_opinion
				opinion = -40
			}
			remove_short_term_gold = root.raise_stele_gold_cost
		}

		stress_impact = {
			vengeful = minor_stress_impact_loss
			greedy = medium_stress_impact_loss
			forgiving = minor_stress_impact_gain
			generous = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_greed = 0.5
				ai_vengefulness = 0.25
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = vengeful
			}
			modifier = {	# Weight up for stress.
				add = 20
				has_trait = greedy
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = forgiving
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = generous
			}
		}
	}

	# Look, you can't be defacing expensive monuments, 'kay?
	option = {
		name = fp1_yearly.0571.b.2

		# Gain lots of opinion with your child.
		reverse_add_opinion = {
			target = scope:child
			modifier = pleased_opinion
			opinion = 70
		}
		# Lose some with your courtier.
		reverse_add_opinion = {
			target = scope:courtier
			modifier = respect_opinion
			opinion = -40
		}
		# The runestone is repaired.
		custom_tooltip = fp1_yearly.0571.b.tt
		remove_short_term_gold = root.raise_stele_gold_cost
		# If your child is still growing, this may leave a mark.
		scope:child = {
			## Making them more arbitrary.
			if = {
				limit = {
					# If they have room.
					number_of_personality_traits < personality_trait_standard
					# And don't already feel strongly either way.
					NOR = {
						has_trait = just
						has_trait = arbitrary
					}
				}
				add_trait = arbitrary
			}
			## And less attached to money.
			if = {
				limit = {
					NOR = {
						has_trait = profligate
						has_trait = greedy
					}
				}
				add_trait = profligate
			}
		}

		stress_impact = {
			forgiving = minor_stress_impact_loss
			generous = minor_stress_impact_loss
			lazy = medium_stress_impact_loss
			arbitrary = medium_stress_impact_loss
			vengeful = minor_stress_impact_gain
			greedy = medium_stress_impact_gain
			diligent = medium_stress_impact_gain
			just = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_greed = -0.5
				ai_honor = -0.5
				ai_vengefulness = -0.5
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = forgiving
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = generous
			}
			modifier = {	# Weight up for stress.
				add = 20
				has_trait = lazy
			}
			modifier = {	# Weight up for stress.
				add = 20
				has_trait = arbitrary
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = vengeful
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = greedy
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = diligent
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = just
			}
		}
	}

	# *Sigh* This isn't worth the bother.
	option = {
		name = fp1_yearly.0571.c

		# Gain lots of opinion with your child.
		reverse_add_opinion = {
			target = scope:child
			modifier = pleased_opinion
			opinion = 50
		}
		# Lose some with your courtier.
		reverse_add_opinion = {
			target = scope:courtier
			modifier = respect_opinion
			opinion = -30
		}
		# Lose the runestone.
		scope:vandal_site = { fp1_remove_stele_effect = yes }

		stress_impact = {
			forgiving = minor_stress_impact_loss
			lazy = medium_stress_impact_loss
			arbitrary = medium_stress_impact_loss
			vengeful = minor_stress_impact_gain
			diligent = medium_stress_impact_gain
			just = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_energy = -0.5
				ai_honor = -0.5
				ai_vengefulness = -0.5
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = forgiving
			}
			modifier = {	# Weight up for stress.
				add = 20
				has_trait = lazy
			}
			modifier = {	# Weight up for stress.
				add = 20
				has_trait = arbitrary
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = vengeful
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = diligent
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = just
			}
		}
	}
}

##################################################
# When I Grow Up
# by Ewan Cowhig Croft
# 0581 - 0590
##################################################

scripted_trigger fp1_0581_wrong_gender_child_wishes_to_fight_trigger = {
	NOT = { has_character_flag = fp1_dreams_of_shieldpersondom }
	trigger_if = { # Has the Royal Court and thus can modify pillars
		limit = { has_dlc_feature = diverge_culture }
		# For ease, they must share your faith or your culture.
		OR = {
			culture = root.culture
			faith = root.faith
		}
	}
	trigger_else = {
		# For ease, they must share your faith.
		faith = root.faith
	}
	# Have an appropriate matching personality.
	OR = {
		childhood_loud_child_trigger = yes
		childhood_mean_child_trigger = yes
	}
	# Be the wrong gender to fight.
	NOT = { can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = root } }
	# Aaaand be available to play.
	child_suitable_to_play_with_character_one_sided = { CHARACTER = root }
}

scripted_trigger fp1_0581_valid_courtier_to_bully_trigger = {
	# No positive relationship with root.
	has_any_good_relationship_with_root_trigger = no
	# And they have a negative opinion of you; player only action, so we only care about making sure the player might dislike this character.
	opinion = {
		target = root
		value <= medium_negative_opinion
	}
}

#	Your wrong-gender child wants to fight and raid in a few years.
fp1_yearly.0581 = {
	type = character_event
	title = fp1_yearly.0581.t
	desc = {
		desc = fp1_yearly.0581.desc.intro
		# Currently causes too much risk of scrolling copy.
		triggered_desc = {
			trigger = { always = no }
			desc = fp1_yearly.0581.desc.victim
		}
		desc = fp1_yearly.0581.desc.outro
	}
	theme = martial
	left_portrait = {
		character = root
		animation = personality_rational
	}
	right_portrait = {
		character = scope:child
		animation = admiration
	}
	lower_right_portrait = scope:victim
	override_background = { reference = corridor_day }

	trigger = {
		# DLC check.
		has_fp1_dlc_trigger = yes
		# Standard checks.
		is_available_even_at_war_adult = yes
		NOT = { has_character_flag = had_event_fp1_yearly_0581 }
		# Filter to shieldmaiden-having culture.
		culture = { has_cultural_parameter = has_access_to_shieldmaidens }
		trigger_if = { # Has the Royal Court and thus can modify pillars
			limit = { has_dlc_feature = diverge_culture }
			culture = { NOT = { has_cultural_parameter = martial_custom_equal_combatant } }
		}
		trigger_else = {
			# Can't be following an equal faith.
			faith = { NOT = { has_doctrine_parameter = combatant_can_be_either_gender_if_no_roco } }
		}
		# Any child of yours might want to be a shieldperson when they grow up.
		any_child = { fp1_0581_wrong_gender_child_wishes_to_fight_trigger = yes }
	}

	weight_multiplier = {
		base = 1

		# Shieldmaidens are something of an inspiration, and thus
		modifier = {
			add = 1
			has_trait = shieldmaiden
		}

		# If you're of low prowess, then there's less to aspire to.
		modifier = {
			add = -0.5
			prowess <= medium_skill_rating
		}
		# But if you're of high prowess, then there's plenty.
		modifier = {
			add = 0.5
			prowess >= very_high_skill_rating
		}
	}

	immediate = {
		add_character_flag = {
			flag = had_event_fp1_yearly_0581
			days = 1825
		}
		# Nab an appropriate child.
		random_child = {
			limit = { fp1_0581_wrong_gender_child_wishes_to_fight_trigger = yes }
			# Weight up the most promising fighter amongst your valid children.
			weight = {
				base = 0
				modifier = {
					add = {
						value = prowess
						multiply = 100
					}
				}
			}
			save_scope_as = child
		}
		# See if there's someone at court you can set the child to bully.
		if = {
			limit = {
				# Keep this player-specific for ease of presentation.
				is_ai = no
				any_courtier_or_guest = { fp1_0581_valid_courtier_to_bully_trigger = yes }
			}
			random_courtier_or_guest = {
				# Try to pick rivals et al first.
				limit = {
					has_any_bad_relationship_with_root_trigger = yes
					fp1_0581_valid_courtier_to_bully_trigger = yes
				}
				# Otherwise just any random dick will do.
				alternative_limit = { fp1_0581_valid_courtier_to_bully_trigger = yes }
				save_scope_as = victim
			}
		}
	}

	# My child, you shall make the world itself *tremble*.
	option = {
		name = fp1_yearly.0581.a
		trigger = { has_trait = shieldmaiden }
		trait = shieldmaiden

		# Scope:child is significantly more likely to try to become a shieldmaiden.
		custom_tooltip = fp1_yearly.0581.a.tt
		scope:child = { add_character_flag = fp1_dreams_of_shieldpersondom }
		# Scope:child gains prowess.
		scope:child = { add_prowess_skill = massive_skill_bonus }
		# Scope:child gains opinion.
		reverse_add_opinion = {
			target = scope:child
			modifier = love_opinion
			opinion = 60
		}

		stress_impact = {
			shieldmaiden = major_stress_impact_loss
			brave = major_stress_impact_loss
			ambitious = major_stress_impact_loss
			compassionate = major_stress_impact_gain
			humble = major_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = 0.75
				ai_zeal = 0.5
				ai_energy = 0.25
			}
			modifier = {	# Weight down for stress.
				add = -30
				has_trait = compassionate
			}
			modifier = {	# Weight down for stress.
				add = -30
				has_trait = humble
			}
			# Raiders & adventurers want their prodigy to follow in their footsteps.
			modifier = {
				add = 20
				has_trait = viking
			}
			modifier = {
				add = 20
				has_trait = adventurer
			}
			modifier = {
				add = 20
				has_trait = brave
			}
			modifier = {
				add = 20
				has_trait = shieldmaiden
			}
			modifier = {
				add = 20
				has_trait = ambitious
			}
		}
	}

	# A noble goal! Have at thee, rogue!
	option = {
		name = fp1_yearly.0581.b
		trigger = {
			NOT = { has_trait = shieldmaiden }
		}

		# Scope:child is significantly more likely to try to become a shieldmaiden.
		custom_tooltip = fp1_yearly.0581.b.tt
		scope:child = { add_character_flag = fp1_dreams_of_shieldpersondom }
		# Scope:child gains prowess.
		scope:child = { add_prowess_skill = medium_skill_bonus }
		# Scope:child gains opinion.
		reverse_add_opinion = {
			target = scope:child
			modifier = love_opinion
			opinion = 30
		}

		stress_impact = {
			compassionate = minor_stress_impact_loss
			gregarious = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = 0.5
				ai_honor = 0.5
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = compassionate
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = gregarious
			}
			# Raiders & adventurers want their prodigy to follow in their footsteps.
			modifier = {
				add = 20
				has_trait = viking
			}
			modifier = {
				add = 20
				has_trait = adventurer
			}
			modifier = {
				add = 20
				has_trait = brave
			}
			modifier = {
				add = 20
				has_trait = shieldmaiden
			}
			modifier = {
				add = 20
				has_trait = ambitious
			}
		}
	}

	# Perhaps. You should practice by ambushing scope:victim.
	option = {
		name = fp1_yearly.0581.c
		trigger = { exists = scope:victim }

		# Scope:child gains prowess.
		scope:child = { add_prowess_skill = medium_skill_bonus }
		# Scope:victim gains wounded.
		scope:victim = {
			increase_wounds_no_death_effect = { REASON = duel }
		}
		# Scope:victim loses opinion of you.
		reverse_add_opinion = {
			target = scope:victim
			modifier = angry_opinion
			opinion = -20
		}
		# Scope:child adds scope:victim as a potential rival.
		hidden_effect = {
			scope:child = {
				progress_towards_rival_effect = {
					REASON = rival_hit_with_stick
					CHARACTER = scope:victim
					OPINION = -30
				}
			}
		}

		stress_impact = {
			vengeful = minor_stress_impact_loss
			sadistic = minor_stress_impact_loss
			forgiving = minor_stress_impact_gain
			compassionate = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_vengefulness = 0.5
				ai_boldness = 0.25
				ai_compassion = -0.25
				ai_honor = -0.5
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = vengeful
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = sadistic
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = forgiving
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = compassionate
			}
		}
	}

	# Stop troubling me with foolish dreams.
	option = {
		name = fp1_yearly.0581.d

		# Gain a minor beneficial modifier for having your child avoid you.
		add_character_modifier = {
			modifier = fp1_ignoring_annoyances_modifier
			years = 10
		}
		# Scope:child loses opinion of you.
		reverse_add_opinion = {
			target = scope:child
			modifier = disappointed_opinion
			opinion = -30
		}

		stress_impact = {
			callous = minor_stress_impact_loss
			sadistic = minor_stress_impact_loss
			impatient = minor_stress_impact_loss
			compassionate = minor_stress_impact_gain
			patient = minor_stress_impact_gain
			shieldmaiden = major_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_sociability = -0.25
				ai_compassion = -0.5
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = callous
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = sadistic
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = impatient
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = compassionate
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = patient
			}
			modifier = {	# Weight down for stress.
				add = -50
				has_trait = shieldmaiden
			}
		}
	}

	# Hah! We shall see, little one.
	option = {
		name = fp1_yearly.0581.e

		reverse_add_opinion = {
			target = scope:child
			modifier = pleased_opinion
			opinion = 15
		}

		# Fairly mild option, so doesn't incur stress.
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_energy = -0.25
				ai_boldness = -0.5
			}
		}
	}
}

##################################################
# Raised Voices at the Thing
# by Ewan Cowhig Croft
# 0591 - 0600
##################################################

scripted_trigger fp1_0591_secondary_county_trigger = {
	holder = root
	culture = { has_innovation = innovation_all_things }
}

scripted_trigger fp1_0591_fighting_counties_at_thing_trigger = {
	tier = tier_county
	culture = { has_innovation = innovation_all_things }
	any_neighboring_county = { fp1_0591_secondary_county_trigger = yes }
}

#	One of your counties is engaged in an argument with another.
fp1_yearly.0591 = {
	type = character_event
	title = fp1_yearly.0591.t
	desc = {
		desc = fp1_yearly.0591.desc
		random_valid = {
			desc = fp1_yearly.0591.desc.border_dispute		#
			desc = fp1_yearly.0591.desc.stolen_flocks		#
			desc = fp1_yearly.0591.desc.kidnapped_child		#
			desc = fp1_yearly.0591.desc.drunken_arson		#
			desc = fp1_yearly.0591.desc.lost_dog			#
			desc = fp1_yearly.0591.desc.disrupted_wedding
			desc = fp1_yearly.0591.desc.suspicious_will		#
			desc = fp1_yearly.0591.desc.sheltered_criminal	#
			desc = fp1_yearly.0591.desc.bad_luck			#
			desc = fp1_yearly.0591.desc.fly_tipping			#
		}
	}
	theme = realm
	left_portrait = {
		character = root
		animation = disgust
	}
	override_background = { reference = fp1_runestone_circle }

	trigger = {
		# DLC check.
		has_fp1_dlc_trigger = yes
		# Standard checks.
		is_available_even_at_war_adult = yes
		NOT = { has_character_flag = had_event_fp1_yearly_0591 }
		is_landed_or_landless_administrative = yes
		# Filter to flavour-appropriate characters.
		culture = { has_innovation = innovation_all_things }
		# Ensure you have at least two counties that can fight with each other.
		any_held_title = { fp1_0591_fighting_counties_at_thing_trigger = yes }
	}

	weight_multiplier = {
		base = 1

		# Weight up a little for mainland Scandinavia.
		modifier = {
			add = 0.5
			fp1_is_in_scandinavia = yes
		}
	}

	immediate = {
		add_character_flag = {
			flag = had_event_fp1_yearly_0591
			days = 1825
		}
		# Grab the counties.
		random_held_title = {
			limit = { fp1_0591_fighting_counties_at_thing_trigger = yes }
			save_scope_as = county_a
			random_neighboring_county = {
				limit = { fp1_0591_secondary_county_trigger = yes }
				save_scope_as = county_b
			}
		}
		# Set a dummy gender for loc.
		random_dummy_gender_soldier_effect = { SCOPE_NAME = dummy_gender }
	}

	# Side with scope:county_a.
	option = {
		name = fp1_yearly.0591.a

		# Levy bonus county modifier.
		scope:county_a = {
			add_county_modifier = {
				modifier = fp1_yearly_0591_levy_modifier
				years = 10
			}
		}
		# And spurn the other county.
		scope:county_b = {
			add_county_modifier = {
				modifier = fp1_yearly_0591_spurned_modifier
				years = 10
			}
		}

		stress_impact = {
			lazy = minor_stress_impact_loss
			diligent = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_energy = 0.5
				ai_honor = 0.25
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = lazy
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = diligent
			}
		}
	}

	# Side with scope:county_b.
	option = {
		name = fp1_yearly.0591.b

		# Building cost county modifier.
		scope:county_b = {
			add_county_modifier = {
				modifier = fp1_yearly_0591_building_modifier
				years = 10
			}
		}
		# And spurn the other county.
		scope:county_a = {
			add_county_modifier = {
				modifier = fp1_yearly_0591_spurned_modifier
				years = 10
			}
		}

		stress_impact = {
			lazy = minor_stress_impact_loss
			diligent = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_energy = 0.5
				ai_honor = 0.25
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = lazy
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = diligent
			}
		}
	}

	# Deliberately wind them both up.
	option = {
		name = fp1_yearly.0591.c

		# Popular opinion bonus modifiers in both (as they're too busy fighting each other).
		scope:county_a = {
			add_county_modifier = {
				modifier = fp1_yearly_0591_otherwise_occupied_modifier
				years = 10
			}
		}
		scope:county_b = {
			add_county_modifier = {
				modifier = fp1_yearly_0591_otherwise_occupied_modifier
				years = 10
			}
		}

		stress_impact = {
			deceitful = minor_stress_impact_loss
			arbitrary = medium_stress_impact_loss
			honest = minor_stress_impact_gain
			just = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_energy = 0.5
				ai_vengefulness = 0.25
				ai_honor = -0.25
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = deceitful
			}
			modifier = {	# Weight up for stress.
				add = 20
				has_trait = arbitrary
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = honest
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = just
			}
		}
	}

	# Let them fight it out.
	option = {
		name = fp1_yearly.0591.d

		# Stress loss: not your problem, honestly.
		## Covered in stress impact.

		stress_impact = {
			base = major_stress_loss
			lazy = medium_stress_impact_loss
			diligent = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_boldness = -0.25
				ai_energy = -0.75
			}
			modifier = {	# Weight up for stress.
				add = 20
				has_trait = lazy
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = diligent
			}
		}
	}
}

##################################################
# The Hardest Part of Ruling
# by Ewan Cowhig Croft
# 0601 - 0610
##################################################

scripted_trigger fp1_0601_valid_county_for_things_trigger = {
	tier = tier_county
	culture = { has_innovation = innovation_all_things }
}

#	An incredibly boring local assembly tries your patience.
fp1_yearly.0601 = {
	type = character_event
	title = fp1_yearly.0601.t
	desc = fp1_yearly.0601.desc
	theme = realm
	left_portrait = {
		character = root
		animation = boredom
	}
	override_background = { reference = fp1_runestone_circle }

	trigger = {
		# DLC check.
		has_fp1_dlc_trigger = yes
		# Standard checks.
		is_available_even_at_war_adult = yes
		NOT = { has_character_flag = had_event_fp1_yearly_0601 }
		is_landed = yes
		# Filter to flavour-appropriate characters.
		culture = { has_innovation = innovation_all_things }
		any_held_title = { fp1_0601_valid_county_for_things_trigger = yes }
	}

	weight_multiplier = {
		base = 1

		# Weight up a little for mainland Scandinavia.
		modifier = {
			add = 0.5
			fp1_is_in_scandinavia = yes
		}
	}

	immediate = {
		add_character_flag = {
			flag = had_event_fp1_yearly_0601
			days = 1825
		}
		# Designate a suitable random county.
		random_held_title = {
			limit = { fp1_0601_valid_county_for_things_trigger = yes }
			save_scope_as = county
		}
		# Set a dummy gender for loc.
		random_dummy_gender_soldier_effect = { SCOPE_NAME = dummy_gender }
	}

	# Fight to stay awake.
	option = {
		name = fp1_yearly.0601.a

		# Diplomacy duel to see how well you disguise it.
		duel = {
			skill = diplomacy
			value = decent_skill_rating
			# You power through and remain composed.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = fp1_yearly.0601.a.tt_success
				send_interface_toast = {
					title = fp1_yearly.0601.a.tt_success
					left_icon = root
					add_prestige = medium_prestige_gain
				}
			}
			# You slump right out of your seat.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = fp1_yearly.0601.a.tt_failure
				send_interface_toast = {
					title = fp1_yearly.0601.a.tt_failure
					left_icon = root
					add_prestige = medium_prestige_loss
				}
			}
		}

		stress_impact = {
			just = minor_stress_impact_loss
			diligent = medium_stress_impact_loss
			arbitrary = minor_stress_impact_gain
			lazy = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_energy = 1
				ai_sociability = 0.25
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = just
			}
			modifier = {	# Weight up for stress.
				add = 20
				has_trait = diligent
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = arbitrary
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = lazy
			}
		}
	}

	# (Diplomacy) Daydream of more interesting diplomatic problems.
	option = {
		name = fp1_yearly.0601.b
		trigger = { has_trait = education_diplomacy }
		trait = education_diplomacy_1
		trait = education_diplomacy_2
		trait = education_diplomacy_3
		trait = education_diplomacy_4
		trait = education_diplomacy_5

		# Gain a minor modifier boosting diplomacy.
		add_character_modifier = {
			modifier = fp1_daydreaming_about_diplomacy_modifier
			years = 5
		}

		stress_impact = {
			lazy = minor_stress_impact_loss
			arrogant = minor_stress_impact_loss
			diligent = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_boldness = 0.5
				ai_sociability = -0.25
				ai_energy = -0.5
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = lazy
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = arrogant
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = diligent
			}
		}
	}

	# (Martial) Daydream up new strategies.
	option = {
		name = fp1_yearly.0601.c
		trigger = { has_trait = education_martial }
		trait = education_martial_1
		trait = education_martial_2
		trait = education_martial_3
		trait = education_martial_4
		trait = education_martial_5

		# Gain a minor modifier boosting martial.
		add_character_modifier = {
			modifier = fp1_daydreaming_about_martial_modifier
			years = 5
		}

		stress_impact = {
			lazy = minor_stress_impact_loss
			arrogant = minor_stress_impact_loss
			diligent = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_boldness = 0.5
				ai_sociability = -0.25
				ai_energy = -0.5
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = lazy
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = arrogant
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = diligent
			}
		}
	}

	# (Stewardship) Daydream up new taxes to charge them.
	option = {
		name = fp1_yearly.0601.d
		trigger = { has_trait = education_stewardship }
		trait = education_stewardship_1
		trait = education_stewardship_2
		trait = education_stewardship_3
		trait = education_stewardship_4
		trait = education_stewardship_5

		# Gain a minor modifier boosting stewardship.
		add_character_modifier = {
			modifier = fp1_daydreaming_about_stewardship_modifier
			years = 5
		}

		stress_impact = {
			lazy = minor_stress_impact_loss
			arrogant = minor_stress_impact_loss
			diligent = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_boldness = 0.5
				ai_sociability = -0.25
				ai_energy = -0.5
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = lazy
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = arrogant
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = diligent
			}
		}
	}

	# (Intrigue) Daydream up new ways to keep them under control.
	option = {
		name = fp1_yearly.0601.e
		trigger = { has_trait = education_intrigue }
		trait = education_intrigue_1
		trait = education_intrigue_2
		trait = education_intrigue_3
		trait = education_intrigue_4
		trait = education_intrigue_5

		# Gain a minor modifier boosting intrigue.
		add_character_modifier = {
			modifier = fp1_daydreaming_about_intrigue_modifier
			years = 5
		}

		stress_impact = {
			lazy = minor_stress_impact_loss
			arrogant = minor_stress_impact_loss
			diligent = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_boldness = 0.5
				ai_sociability = -0.25
				ai_energy = -0.5
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = lazy
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = arrogant
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = diligent
			}
		}
	}

	# (Learning) Daydream of your favourite book.
	option = {
		name = fp1_yearly.0601.f
		trigger = { has_trait = education_learning }
		trait = education_learning_1
		trait = education_learning_2
		trait = education_learning_3
		trait = education_learning_4
		trait = education_learning_5

		# Gain a minor modifier boosting learning.
		add_character_modifier = {
			modifier = fp1_daydreaming_about_learning_modifier
			years = 5
		}

		stress_impact = {
			lazy = minor_stress_impact_loss
			arrogant = minor_stress_impact_loss
			diligent = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_boldness = 0.5
				ai_sociability = -0.25
				ai_energy = -0.5
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = lazy
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = arrogant
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = diligent
			}
		}
	}

	# Give in and doze off.
	option = {
		name = fp1_yearly.0601.g

		# Lose stress since... I mean, who cares?
		## Stress loss handled in stress_impact.
		# Buuuuut also lose prestige.
		add_prestige = minor_prestige_loss
		# Low-random chance for players to occasionally become known as "the Snorer" here.
		hidden_effect = {
			if = {
				limit = {
					is_ai = no
					has_any_nickname = no
				}
				random = {
					chance = 1
					send_interface_toast = {
						title = fp1_yearly.0601.g.nickname
						left_icon = root
						give_nickname = nick_the_snorer
					}
				}
			}
		}

		stress_impact = {
			base = major_stress_loss
			lazy = medium_stress_impact_loss
			diligent = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = -0.25
				ai_sociability = -0.5
				ai_energy = -1
			}
			modifier = {	# Weight up for stress.
				add = 20
				has_trait = lazy
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = diligent
			}
		}
	}
}

##################################################
# Leading by Example
# by Ewan Cowhig Croft
# 0611 - 0620
##################################################

scripted_trigger fp1_0611_aggressive_child_candidate_trigger = {
	# Age gate so that they're never the same as scope:child_b.
	age >= 10
	# Must be around.
	child_suitable_to_play_with_character_one_sided = { CHARACTER = root }
	# And have the right personality for this.
	OR = {
		childhood_mean_child_trigger = yes
		childhood_loud_child_trigger = yes
	}
}

scripted_trigger fp1_0611_victim_child_candidate_trigger = {
	# Age gate so that they're never the same as scope:child_a.
	age < 10
	# Must be around.
	child_suitable_to_play_with_character_one_sided = { CHARACTER = root }
	# We're not fussed about personality here, anything is good.
}

#	One of your children wounds another whilst imitating you.
fp1_yearly.0611 = {
	type = character_event
	title = fp1_yearly.0611.t
	desc = fp1_yearly.0611.desc
	theme = education
	left_portrait = {
		character = scope:child_a
		animation = shame
	}
	right_portrait = {
		character = scope:child_b
		animation = anger
	}
	override_background = { reference = bedchamber }

	trigger = {
		# DLC check.
		has_fp1_dlc_trigger = yes
		# Standard checks.
		is_available_even_at_war_adult = yes
		NOT = { has_character_flag = had_event_fp1_yearly_0611 }
		is_landed = yes
		# Filter to flavour-appropriate characters.
		fp1_is_norse_tribal = yes
		# You must qualify for imitation in some way.
		OR = {
			has_trait = viking
			has_trait = berserker
			has_trait = adventurer
			has_character_flag = has_recently_performed_raid
		}
		# Gotta have one child who qualifies as the aggressor.
		any_child = { fp1_0611_aggressive_child_candidate_trigger = yes }
		# And one child who qualifies as the bully.
		any_child = { fp1_0611_victim_child_candidate_trigger = yes }
	}

	weight_multiplier = {
		base = 1

		# Weight up a little for each qualifying trait.
		modifier = {
			add = 0.25
			has_trait = viking
		}
		modifier = {
			add = 0.25
			has_trait = berserker
		}
		modifier = {
			add = 0.25
			has_trait = adventurer
		}
	}

	immediate = {
		add_character_flag = {
			flag = had_event_fp1_yearly_0611
			days = 1825
		}
		# Grab the first child.
		random_child = {
			limit = { fp1_0611_aggressive_child_candidate_trigger = yes }
			save_scope_as = child_a
		}
		# And the second.
		random_child = {
			limit = { fp1_0611_victim_child_candidate_trigger = yes }
			save_scope_as = child_b
		}
		# Wound scope:child_b.
		scope:child_b = {
			increase_wounds_no_death_effect = { REASON = duel }
		}
	}

	# Explain to scope:child_a that they need to wait till they're older.
	option = {
		name = fp1_yearly.0611.a

		# Diplomacy duel to see if you manage the feelings involved.
		duel = {
			skill = diplomacy
			value = high_skill_rating
			# You successfully explain that fighting is not playing.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = fp1_yearly.0611.a.tt_success
				send_interface_toast = {
					title = fp1_yearly.0611.a.tt_success
					left_icon = scope:child_a
					right_icon = scope:child_b
					scope:child_b = {
						progress_towards_friend_effect = {
							CHARACTER = scope:child_a
							OPINION = 50
							REASON = friend_child_apologize
						}
					}
				}
			}
			# You only engender feelings of bitterness between the two.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = fp1_yearly.0611.a.tt_failure
				send_interface_toast = {
					title = fp1_yearly.0611.a.tt_failure
					left_icon = scope:child_a
					right_icon = scope:child_b
					scope:child_b = {
						progress_towards_rival_effect = {
							REASON = rival_hit_with_sharp_stick
							CHARACTER = scope:child_a
							OPINION = -50
						}
					}
				}
			}
		}

		stress_impact = {
			honest = minor_stress_impact_loss
			forgiving = minor_stress_impact_loss
			vengeful = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = 0.5
				ai_honor = 0.25
				ai_vengefulness = -0.25
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = honest
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = forgiving
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = vengeful
			}
		}
	}

	# Laud scope:child_a for their goals.
	option = {
		name = fp1_yearly.0611.b

		# Scope:child_a is very happy & gains some prowess.
		scope:child_a = { add_prowess_skill = medium_skill_bonus }
		reverse_add_opinion = {
			target = scope:child_a
			modifier = love_opinion
			opinion = 40
		}
		# Scope:child_b is very unhappy and grows close to a rivalry with scope:child_a.
		scope:child_b = {
			progress_towards_rival_effect = {
				REASON = rival_hit_with_sharp_stick
				CHARACTER = scope:child_a
				OPINION = -20
			}
		}
		reverse_add_opinion = {
			target = scope:child_b
			modifier = trust_opinion
			opinion = -20
		}

		stress_impact = {
			callous = minor_stress_impact_loss
			sadistic = minor_stress_impact_loss
			compassionate = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = -0.5
				ai_honor = -0.5
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = callous
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = sadistic
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = compassionate
			}
		}
	}

	# Teach scope:child_b how to deal with bullies.
	option = {
		name = fp1_yearly.0611.c

		# Scope:child_b is very happy & gains some prowess.
		scope:child_b = { add_prowess_skill = medium_skill_bonus }
		reverse_add_opinion = {
			target = scope:child_b
			modifier = love_opinion
			opinion = 40
		}
		# Scope:child_a is unhappy.
		reverse_add_opinion = {
			target = scope:child_a
			modifier = trust_opinion
			opinion = -20
		}

		stress_impact = {
			fickle = minor_stress_impact_loss
			compassionate = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = 0.5
				ai_honor = 0.5
				ai_vengefulness = 0.25
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = fickle
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = compassionate
			}
		}
	}

	# Tell them to take it to their nurse.
	option = {
		name = fp1_yearly.0611.d

		# Lose stress.
		## Stress loss handled in stress_impact.
		# But also opinion with both children.
		reverse_add_opinion = {
			target = scope:child_a
			modifier = trust_opinion
			opinion = -20
		}
		reverse_add_opinion = {
			target = scope:child_b
			modifier = hurt_opinion
			opinion = -20
		}
		# And we set up a hidden rivalry anyway.
		hidden_effect = {
			scope:child_b = {
				if = {
					limit = {
						can_set_relation_potential_rival_trigger = { CHARACTER = scope:child_a }
					}
					set_relation_potential_rival = scope:child_a
				}
			}
		}

		stress_impact = {
			base = medium_stress_loss
			lazy = minor_stress_impact_loss
			callous = minor_stress_impact_loss
			diligent = minor_stress_impact_gain
			compassionate = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = -0.5
				ai_energy = -0.5
				ai_boldness = -0.5
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = lazy
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = callous
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = diligent
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = compassionate
			}
		}
	}
}

##################################################
# A Shiny New Toy
# by Ewan Cowhig Croft
# 0621 - 0630
##################################################

scripted_trigger fp1_0621_valid_child_wants_loot_trigger = {
	# Must be around.
	child_suitable_to_play_with_character_one_sided = { CHARACTER = scope:raider }
	# Quiet children aren't going to come down to the beach.
	childhood_quiet_child_trigger = no
}

#	Your child asks you which piece of raid loot is theirs.
fp1_yearly.0621 = {
	type = character_event
	title = fp1_yearly.0621.t
	desc = fp1_yearly.0621.desc
	theme = war
	left_portrait = {
		character = scope:raider
		animation = personality_rational
	}
	right_portrait = {
		character = scope:child
		animation = admiration
	}
	override_background = { reference = fp1_beached_longships }

	# Triggers handled in the setup event.

	# Weight multipliers handled in the setup event.

	immediate = {
		add_character_flag = {
			flag = had_event_fp1_yearly_0621
			days = 1825
		}
		# Grab a suitable child.
		random_child = {
			limit = { fp1_0621_valid_child_wants_loot_trigger = yes }
			# Weight up greedier children.
			weight = {
				base = 0
				modifier = { add = ai_greed }
			}
			save_scope_as = child
		}
		# Save a dummy gender for raid victims; reflects your child's biases rather than your actual experiences.
		random_dummy_gender_soldier_effect = { SCOPE_NAME = dummy_gender }
	}

	# Of course you can take the big trophy.
	option = {
		name = fp1_yearly.0621.a

		# Scope:child gains lots of opinion of you.
		reverse_add_opinion = {
			target = scope:child
			modifier = love_opinion
			opinion = 50
		}
		# But you lose some gold.
		remove_short_term_gold = minor_gold_value

		stress_impact = {
			generous = medium_stress_impact_loss
			greedy = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = 0.5
				ai_greed = -0.5
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = greedy
			}
			modifier = {	# Weight up for stress.
				add = 20
				has_trait = generous
			}
		}
	}

	# Nothing now: maybe when you're older, you can earn your own.
	option = {
		name = fp1_yearly.0621.b

		# Scope:child gains some opinion of you.
		reverse_add_opinion = {
			target = scope:child
			modifier = respect_opinion
			opinion = 10
		}

		# A fairly mild response, so no stress to be garnered.
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = 0.5
				ai_boldness = 0.5
			}
		}
	}

	# Away with you! This is for the adults.
	option = {
		name = fp1_yearly.0621.c

		# Gain some prestige.
		add_prestige = minor_prestige_gain
		# Scope:child is upset.
		reverse_add_opinion = {
			target = scope:child
			modifier = hurt_opinion
			opinion = -20
		}

		stress_impact = {
			impatient = minor_stress_impact_loss
			greedy = medium_stress_impact_loss
			patient = minor_stress_impact_gain
			generous = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 0.25
				ai_compassion = -0.25
				ai_energy = -0.5
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = impatient
			}
			modifier = {	# Weight up for stress.
				add = 20
				has_trait = greedy
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = patient
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = generous
			}
		}
	}
}

#	Setup event to sort triggers, scopes, etc.
fp1_yearly.0622 = {
	hidden = yes
	scope = army

	trigger = {
		# DLC check.
		has_fp1_dlc_trigger = yes
		# Root must have been leading the army personally.
		army_commander = scope:raider
		# And some actual loot must have been recovered.
		raid_loot >= 10
		# In which case we take a look at scope:raider & see how they stack up.
		scope:raider = {
			# Standard checks.
			is_available_adult_or_is_commanding = yes
			NOT = { has_character_flag = had_event_fp1_yearly_0621 }
			is_landed = yes
			# Filter to flavour-appropriate characters.
			fp1_is_coastal_norse_tribal = yes
			# And must have a valid child laying about.
			any_child = { fp1_0621_valid_child_wants_loot_trigger = yes}
		}
	}

	weight_multiplier = {
		base = 1

		# Weight up a little for dedicated raiders.
		modifier = {
			add = 1
			scope:raider = { has_trait = viking }
		}
		# Or if you've brought home a truly excessive amount of loot.
		modifier = {
			add = 1
			raid_loot >= 200
		}
	}

	immediate = {
		save_scope_as = raiding_army
		scope:raider = { trigger_event = fp1_yearly.0621 }
	}
}

##################################################
# A Cynical Bent
# by Ewan Cowhig Croft
# 0631 - 0640
##################################################

scripted_trigger fp1_0631_suitable_cynical_knight_trigger = {
	# Must be in the correct army.
	knight_army ?= $ARMY$
	# Has to share scope:raider's faith.
	faith = scope:raider.faith
	# Can't be zealous.
	NOT = { has_trait = zealous }
	# And must have at least decent learning.
	learning >= decent_skill_rating
}

#	You notice a courtier refuses to sacrifice after a raid.
fp1_yearly.0631 = {
	type = character_event
	title = fp1_yearly.0631.t
	desc = fp1_yearly.0631.desc
	theme = faith
	left_portrait = {
		character = scope:cynic
		animation = personality_cynical
	}
	override_background = { reference = fp1_beached_longships }

	# Triggers handled in the setup event.

	# Weight multipliers handled in the setup event.

	immediate = {
		add_character_flag = {
			flag = had_event_fp1_yearly_0631
			days = 1825
		}
		# Grab an appropriate knight.
		random_knight = {
			limit = {
				fp1_0631_suitable_cynical_knight_trigger = { ARMY = scope:raiding_army }
			}
			# Weight up cynical knights.
			weight = {
				base = 0
				modifier = {
					add = {
						value = ai_zeal
						multiply = -1
					}
				}
			}
			save_scope_as = cynic
		}
	}

	# Lecture them for their impiety.
	option = {
		name = fp1_yearly.0631.a

		# Learning duel over piety.
		duel = {
			skill = learning
			target = scope:cynic
			# You succeed in shaming scope:knight.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = fp1_yearly.0631.a.tt_success
				send_interface_toast = {
					title = fp1_yearly.0631.a.tt_success
					left_icon = scope:cynic
					add_piety = medium_piety_gain
					reverse_add_opinion = {
						target = scope:cynic
						modifier = annoyed_opinion
						opinion = -20
					}
				}
			}
			# Scope:knight makes you look like a fool.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = fp1_yearly.0631.a.tt_failure
				send_interface_toast = {
					title = fp1_yearly.0631.a.tt_failure
					left_icon = scope:cynic
					add_piety = minor_piety_loss
					reverse_add_opinion = {
						target = scope:cynic
						modifier = respect_opinion
						opinion = -30
					}
				}
			}
		}

		stress_impact = {
			gregarious = minor_stress_impact_loss
			generous = minor_stress_impact_loss
			vengeful = minor_stress_impact_loss
			zealous = major_stress_impact_loss
			greedy = major_stress_impact_loss
			shy = medium_stress_impact_gain
			forgiving = medium_stress_impact_gain
			# Event cannot be triggered if you have cynical.
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_zeal = 0.5
				ai_greed = -0.5
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = gregarious
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = generous
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = vengeful
			}
			modifier = {	# Weight up for stress.
				add = 30
				has_trait = zealous
			}
			modifier = {	# Weight up for stress.
				add = 30
				has_trait = greedy
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = shy
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = forgiving
			}
		}
	}

	# Quietly keep your own tribute too.
	option = {
		name = fp1_yearly.0631.b

		# Gain a little gold.
		add_gold = tiny_gold_value
		# Lose a little piety.
		add_piety = miniscule_piety_loss

		stress_impact = {
			greedy = medium_stress_impact_loss
			generous = medium_stress_impact_gain
			zealous = major_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_greed = 0.5
				ai_zeal = -0.5
			}
			modifier = {	# Weight up for stress.
				add = 20
				has_trait = greedy
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = generous
			}
			modifier = {	# Weight down for stress.
				add = -30
				has_trait = zealous
			}
		}
	}

	# Shrug and move on.
	option = {
		name = fp1_yearly.0631.c

		# Gain opinion with scope:knight.
		reverse_add_opinion = {
			target = scope:cynic
			modifier = grateful_opinion
			opinion = 20
		}

		stress_impact = {
			forgiving = medium_stress_impact_loss
			vengeful = medium_stress_impact_gain
			zealous = major_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_zeal = -0.25
				ai_greed = -0.25
				ai_energy = -0.5
			}
			modifier = {	# Weight up for stress.
				add = 20
				has_trait = forgiving
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = vengeful
			}
			modifier = {	# Weight down for stress.
				add = -30
				has_trait = zealous
			}
		}
	}
}

#	Setup event to sort triggers, scopes, etc.
fp1_yearly.0632 = {
	hidden = yes
	scope = army

	trigger = {
		# DLC check.
		has_fp1_dlc_trigger = yes
		# Root must have been leading the army personally.
		army_commander = scope:raider
		# And some actual loot must have been recovered.
		raid_loot >= 10
		# In which case we take a look at scope:raider & see how they stack up.
		scope:raider = {
			# Standard checks.
			is_available_adult_or_is_commanding = yes
			NOT = { has_character_flag = had_event_fp1_yearly_0631 }
			is_landed = yes
			# Filter to flavour-appropriate characters.
			fp1_is_coastal_norse_tribal = yes
			# And there's an appropriate knightly target.
			any_knight = {
				fp1_0631_suitable_cynical_knight_trigger = { ARMY = root }
			}
			# And remove any dedicated cynics.
			NOT = { has_trait = cynical }
		}
	}

	weight_multiplier = {
		base = 1

		# Weight up a little for the zealous, who are more likely to notice.
		modifier = {
			add = 1
			scope:raider = { has_trait = zealous }
		}
	}

	immediate = {
		save_scope_as = raiding_army
		scope:raider = { trigger_event = fp1_yearly.0631 }
	}
}

##################################################
# Worthy of the Ocean
# by Ewan Cowhig Croft
# 0641 - 0650
##################################################

scripted_trigger fp1_0641_raider_with_longships_trigger = {
	can_raid_trigger = yes
	culture = { has_innovation = innovation_longboats }
	any_sub_realm_county = { is_coastal_county = yes }
}

scripted_trigger fp1_0641_neighbouring_ruler_with_stealable_ships_trigger = {
	# Doesn't have a friendly relationship with root.
	has_friendly_relationship_with_root_trigger = no
	# Has stealable longboats.
	fp1_0641_raider_with_longships_trigger = yes
}

#	Your longships seem to be in poor nick.
fp1_yearly.0641 = {
	type = character_event
	title = fp1_yearly.0641.t
	desc = fp1_yearly.0641.desc
	theme = intrigue
	left_portrait = {
		character = root
		animation = personality_rational
	}
	right_portrait = {
		character = scope:neighbour
		animation = dismissal
	}
	override_background = { reference = fp1_beached_longships }

	trigger = {
		# DLC check.
		has_fp1_dlc_trigger = yes
		# Standard checks.
		is_available_even_at_war_adult = yes
		NOT = { has_character_flag = had_event_fp1_yearly_0641 }
		is_landed = yes
		# Filter to flavour-appropriate characters.
		fp1_0641_raider_with_longships_trigger = yes
	}

	weight_multiplier = {
		base = 1

		# Weight down a little if you're a raider or diligent, used to keeping your longships in tip-top condition.
		modifier = {
			add = -0.5
			has_trait = viking
		}
		modifier = {
			add = -0.5
			has_trait = diligent
		}
		# And up a little for adventurers and the lazy, who wear their ships hard & can't be arsed respectively.
		modifier = {
			add = 0.5
			has_trait = adventurer
		}
		modifier = {
			add = 0.5
			has_trait = lazy
		}
	}

	immediate = {
		add_character_flag = {
			flag = had_event_fp1_yearly_0641
			days = 1825
		}
		# Try to grab a suitable neighbour.
		if = {
			limit = {
				any_neighboring_and_across_water_realm_same_rank_owner = { fp1_0641_neighbouring_ruler_with_stealable_ships_trigger = yes }
			}
			random_neighboring_and_across_water_realm_same_rank_owner = {
				# Prefer rivals first.
				limit = {
					any_neighboring_and_across_water_realm_same_rank_owner = {
						any_relation = {
							type = rival
							this = root
						}
						fp1_0641_neighbouring_ruler_with_stealable_ships_trigger = yes
					}
				}
				# Otherwise, just whoever.
				alternative_limit = {
					any_neighboring_and_across_water_realm_same_rank_owner = { fp1_0641_neighbouring_ruler_with_stealable_ships_trigger = yes }
				}
				save_scope_as = neighbour
			}
		}
	}

	# Pay to fix them.
	option = {
		name = fp1_yearly.0641.a
		trigger = {
			can_make_expensive_purchase_trigger = { PRICE = minor_gold_value }
		}

		# The boat are repaired without issue.
		custom_tooltip = fp1_yearly.0641.a.tt
		# Lose a little gold.
		remove_treasury_or_gold = minor_treasury_or_gold_value

		stress_impact = {
			generous = minor_stress_impact_loss
			honest = minor_stress_impact_loss
			greedy = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 0.5
				ai_greed = -0.5
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = generous
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = honest
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = greedy
			}
		}
	}

	# Steal some from a neighbouring ruler.
	option = {
		name = fp1_yearly.0641.b
		trigger = { exists = scope:neighbour }

		# Intrigue duel to nab the boats in the night.
		duel = {
			skill = intrigue
			target = scope:neighbour
			# You heist the longships gleefully.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = fp1_yearly.0641.b.tt_success
				send_interface_toast = {
					title = fp1_yearly.0641.b.tt_success
					left_icon = scope:neighbour
					add_character_modifier = {
						modifier = fp1_excellent_longships_modifier
						years = 10
					}
					reverse_add_opinion = {
						target = scope:neighbour
						modifier = angry_opinion
						opinion = -50
					}
				}
			}
			# You're caught and have to leg it.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = fp1_yearly.0641.b.tt_failure
				send_interface_toast = {
					title = fp1_yearly.0641.b.tt_failure
					left_icon = scope:neighbour
					add_character_modifier = {
						modifier = fp1_rotting_longships_modifier
						years = 10
					}
					reverse_add_opinion = {
						target = scope:neighbour
						modifier = annoyed_opinion
						opinion = -20
					}
				}
			}
		}
		# Try to earmark scope:neighbour as a potential rival.
		hidden_effect = {
			if = {
				limit = {
					can_set_relation_potential_rival_trigger = { CHARACTER = scope:neighbour }
				}
				set_relation_potential_rival = scope:neighbour
			}
		}

		stress_impact = {
			arbitrary = minor_stress_impact_loss
			greedy = medium_stress_impact_loss
			deceitful = medium_stress_impact_loss
			just = minor_stress_impact_gain
			generous = medium_stress_impact_gain
			honest = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_greed = 0.5
				ai_rationality = 0.25
				ai_honor = -0.5
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = arbitrary
			}
			modifier = {	# Weight up for stress.
				add = 20
				has_trait = greedy
			}
			modifier = {	# Weight up for stress.
				add = 20
				has_trait = deceitful
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = just
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = generous
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = honest
			}
		}
	}

	# Commission new vessels from a fancy shipwright.
	option = {
		name = fp1_yearly.0641.c
		trigger = {
			can_make_expensive_purchase_trigger = { PRICE = medium_gold_value }
		}

		# Gain a modifier boosting naval speed & reducing embark cost.
		add_character_modifier = {
			modifier = fp1_excellent_longships_modifier
			years = 10
		}
		# Lose a bit more gold.
		remove_treasury_or_gold = medium_treasury_or_gold_value

		stress_impact = {
			diligent = minor_stress_impact_loss
			generous = medium_stress_impact_loss
			lazy = minor_stress_impact_gain
			greedy = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 0.5
				ai_greed = -1
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = diligent
			}
			modifier = {	# Weight up for stress.
				add = 20
				has_trait = generous
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = lazy
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = greedy
			}
		}
	}

	# Bah, let them rot. What's the harm?
	option = {
		name = fp1_yearly.0641.d

		# Gain a modifier reducing naval speed & increasing embark cost.
		add_character_modifier = {
			modifier = fp1_rotting_longships_modifier
			years = 10
		}
		# Someone else's problem, right?
		## Stress loss handled in stress impact.

		stress_impact = {
			base = major_stress_loss
			lazy = medium_stress_impact_loss
			greedy = medium_stress_impact_loss
			diligent = medium_stress_impact_gain
			generous = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 0.25
				ai_greed = -0.5
				ai_energy = -0.75
			}
			modifier = {	# Weight up for stress.
				add = 20
				has_trait = lazy
			}
			modifier = {	# Weight up for stress.
				add = 20
				has_trait = greedy
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = diligent
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = generous
			}
		}
	}
}

##################################################
# Leviathan
# by Ewan Cowhig Croft
# 0651 - 0660
##################################################

#	You're out sailing when you spot a whale.
fp1_yearly.0651 = {
	type = character_event
	title = fp1_yearly.0651.t
	desc = fp1_yearly.0651.desc
	theme = hunt_activity
	left_portrait = {
		character = root
		animation = shock
	}
	override_background = { reference = fp1_ocean_norse }

	trigger = {
		# DLC check.
		has_fp1_dlc_trigger = yes
		# Standard checks.
		is_available_even_at_war_adult = yes
		NOT = { has_character_flag = had_event_fp1_yearly_0651 }
		is_playable_character = yes
		is_landed = yes
		# Must have a coastal capital.
		capital_county = { is_coastal_county = yes }
	}

	weight_multiplier = {
		base = 1

		# Weight up for the Norse a bit.
		modifier = {
			add = 1
			fp1_is_norse = yes
		}
		# Raiders spend more time at sea. Probably. Vikings do at least.
		modifier = {
			add = 1
			has_trait = viking
		}
		# Adventurers spend more time at sea. Also probably.
		modifier = {
			add = 1
			has_trait = adventurer
		}
	}

	immediate = {
		add_character_flag = {
			flag = had_event_fp1_yearly_0651
			years = 50
		}
	}

	# Static gold is used rather than dynamic throughout this event. This is to account for whale value not adjusting with your scale (even if it probably should with region): a gold mine for a poor tribal is a month's tax for a highly developed king.

	# Get the harpoons!
	option = {
		name = fp1_yearly.0651.a

		# Prowess challenge to slaughter the whale.
		duel = {
			skill = prowess
			value = decent_skill_rating
			# You haul the whale to shore and butcher it.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = fp1_yearly.0651.a.tt_success
				send_interface_toast = {
					title = fp1_yearly.0651.a.tt_success
					left_icon = root
					# Per the comment below the immediate block, the static gold is deliberate.
					add_gold = 100
				}
			}
			# The beast escapes you.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = fp1_yearly.0651.a.tt_failure
				send_interface_toast = {
					title = fp1_yearly.0651.a.tt_failure
					left_icon = root
					add_prestige = minor_prestige_loss
				}
			}
		}

		stress_impact = {
			vengeful = miniscule_stress_impact_loss	# From Hell's Heart I stab at thee, etc.
			brave = major_stress_impact_loss
			craven = major_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_boldness = 0.5
				ai_energy = 0.5
				ai_compassion = -0.25
			}
			modifier = {	# Weight up for stress.
				add = 5
				has_trait = vengeful
			}
			modifier = {	# Weight up for stress.
				add = 30
				has_trait = brave
			}
			modifier = {	# Weight down for stress.
				add = -30
				has_trait = craven
			}
		}
	}

	# Just bring me the carcass.
	option = {
		name = fp1_yearly.0651.b

		# Gain some minor gold.
		## Per the comment below the immediate block, the static gold is deliberate.
		add_gold = 50

		stress_impact = {
			greedy = minor_stress_impact_loss
			generous = minor_stress_impact_gain
			compassionate = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_boldness = -0.25
				ai_energy = -0.25
				ai_compassion = -0.25
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = greedy
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = generous
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = compassionate
			}
		}
	}

	# (Hunter) A *grand* quarry!
	option = {
		name = fp1_yearly.0651.c
		trigger = { has_trait = lifestyle_hunter }
		trait = lifestyle_hunter
		# You face a *true* leviathan.
		custom_tooltip = fp1_yearly.0651.c.tt
		# More difficult prowess challenge for greater rewards.
		duel = {
			skill = prowess
			value = very_high_skill_rating
			# You haul the whale to shore and butcher it.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = fp1_yearly.0651.c.tt_success
				send_interface_toast = {
					title = fp1_yearly.0651.c.tt_success
					left_icon = root
					# Per the comment below the immediate block, the static gold is deliberate.
					add_gold = 300
				}
			}
			# The beast escapes you.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = fp1_yearly.0651.c.tt_failure
				send_interface_toast = {
					title = fp1_yearly.0651.c.tt_failure
					left_icon = root
					increase_wounds_effect = { REASON = hunting_accident }
					add_prestige = minor_prestige_loss
				}
			}
		}

		stress_impact = {
			vengeful = miniscule_stress_impact_loss	# From Hell's Heart I stab at thee, etc.
			brave = major_stress_impact_loss
			craven = major_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_boldness = 0.75
				ai_energy = 0.75
				ai_compassion = -0.25
			}
			modifier = {	# Weight up for stress.
				add = 5
				has_trait = vengeful
			}
			modifier = {	# Weight up for stress.
				add = 30
				has_trait = brave
			}
			modifier = {	# Weight down for stress.
				add = -30
				has_trait = craven
			}
		}
	}

	# A creature of fearsome majesty, leave it.
	option = {
		name = fp1_yearly.0651.d

		# The whale goes free.
		custom_tooltip = fp1_yearly.0651.d.tt
		# You gain a little prestige for your kindness.
		add_prestige = minor_prestige_gain

		stress_impact = {
			generous = minor_stress_impact_loss
			compassionate = medium_stress_impact_loss
			craven = major_stress_impact_loss
			greedy = medium_stress_impact_gain
			sadistic = medium_stress_impact_gain
			brave = major_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = 0.5
				ai_boldness = -0.5
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = generous
			}
			modifier = {	# Weight up for stress.
				add = 20
				has_trait = compassionate
			}
			modifier = {	# Weight up for stress.
				add = 30
				has_trait = craven
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = greedy
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = sadistic
			}
			modifier = {	# Weight down for stress.
				add = -30
				has_trait = brave
			}
		}
	}
}

##################################################
# A Novel Challenge
# by Ewan Cowhig Croft
# 0661 - 0670
##################################################

scripted_trigger fp1_0661_knight_appropriate_for_skiing_trigger = {
	# Has to be around.
	is_available_ai_adult = yes
	# And in the capital.
	location = root.location
	# And have no disqualifying traits.
	NOR = {
		# Personality blockers.
		has_trait = shy
		has_trait = lazy
		has_trait = humble
		has_trait = craven
		# Not that it's impossible, just unlikely for the period & tech level.
		has_trait = one_legged
	}
	# Finally, no negative relationship with root.
	has_any_bad_relationship_with_root_trigger = no
}

#	One of your knights challenges you to skiing.
fp1_yearly.0661 = {
	type = character_event
	title = fp1_yearly.0661.t
	desc = fp1_yearly.0661.desc
	theme = friendly
	left_portrait = {
		character = root
		animation = personality_rational
	}
	right_portrait = {
		character = scope:knight
		animation = personality_bold
	}
	override_background = { reference = feast }

	trigger = {
		# DLC check.
		has_fp1_dlc_trigger = yes
		# Standard checks.
		is_available_at_peace_adult = yes
		NOT = { has_character_flag = had_event_fp1_yearly_0661 }
		is_playable_character = yes
		# Must be a suitable culture.
		culture_uses_frequent_winter_transportation_trigger = yes
		# Gotta have snow in the capital.
		character_capital_has_winter_trigger = yes
		# And have an available knight.
		any_knight = { fp1_0661_knight_appropriate_for_skiing_trigger = yes }
	}

	weight_multiplier = {
		base = 1

		# Weight according to winter scale.
		character_capital_has_snow_suitable_for_activities = { CHARACTER = root }
	}

	immediate = {
		add_character_flag = {
			flag = had_event_fp1_yearly_0661
			days = 1825
		}
		# Grab an appropriate knight.
		random_knight = {
			limit = { fp1_0661_knight_appropriate_for_skiing_trigger = yes }
			save_scope_as = knight
		}
	}

	# How unusual! I accept!
	option = {
		name = fp1_yearly.0661.a
		trigger = {
			NOT = { has_trait = winter_soldier }
		}

		# Prowess duel vs. scope:knight.
		duel = {
			skill = prowess
			target = scope:knight
			# It's close, but you win!
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = fp1_yearly.0661.a.tt_success
				send_interface_toast = {
					title = fp1_yearly.0661.a.tt_success
					left_icon = scope:knight
					add_prestige = minor_prestige_gain
					progress_towards_friend_effect = {
						CHARACTER = scope:knight
						OPINION = 30
						REASON = friend_ski_race
					}
				}
			}
			# Scope:knight skids to victory.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = fp1_yearly.0661.a.tt_failure
				send_interface_toast = {
					title = fp1_yearly.0661.a.tt_failure
					left_icon = scope:knight
					add_prestige = minor_prestige_loss
					progress_towards_friend_effect = {
						CHARACTER = scope:knight
						OPINION = 10
						REASON = friend_ski_race
					}
				}
			}
		}

		stress_impact = {
			brave = medium_stress_impact_loss
			craven = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_energy = 0.5
				ai_boldness = 0.5
				ai_honor = 0.5
				ai_sociability = 0.25
			}
			modifier = {	# Weight up for stress.
				add = 20
				has_trait = brave
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = craven
			}
		}
	}

	# Winter Soldier: Out in the snow? I accept.
	option = {
		name = fp1_yearly.0661.a.2
		trigger = { has_trait = winter_soldier }
		trait = winter_soldier

		custom_tooltip = fp1_yearly.0661.a.2.tt
		add_prestige = minor_prestige_gain
		progress_towards_friend_effect = {
			CHARACTER = scope:knight
			OPINION = 50
			REASON = friend_ski_race
		}

		stress_impact = {
			diligent = minor_stress_impact_loss
			lazy = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_energy = 0.5
				ai_boldness = 0.5
				ai_honor = 0.5
				ai_sociability = 0.25
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = diligent
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = lazy
			}
		}
	}

	# Hobble the competition, then race.
	option = {
		name = fp1_yearly.0661.b

		# Intrigue duel vs. scope:knight.
		duel = {
			skill = intrigue
			target = scope:knight
			# My, what an *effortless* win you have there.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = fp1_yearly.0661.b.tt_success
				send_interface_toast = {
					title = fp1_yearly.0661.b.tt_success
					left_icon = scope:knight
					add_prestige = medium_prestige_gain
					reverse_add_opinion = {
						target = scope:knight
						modifier = suspicion_opinion
						opinion = -5
					}
				}
			}
			# Scope:knight discovers you in the act.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = fp1_yearly.0661.b.tt_failure
				send_interface_toast = {
					title = fp1_yearly.0661.b.tt_failure
					left_icon = scope:knight
					add_prestige = medium_prestige_loss
					progress_towards_rival_effect = {
						REASON = rival_attempted_to_cheat_race
						CHARACTER = scope:knight
						OPINION = -40
					}
				}
			}
		}

		stress_impact = {
			arbitrary = minor_stress_impact_loss
			deceitful = medium_stress_impact_loss
			just = minor_stress_impact_gain
			honest = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_energy = 0.5
				ai_boldness = 0.5
				ai_sociability = 0.25
				ai_honor = -0.5
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = arbitrary
			}
			modifier = {	# Weight up for stress.
				add = 20
				has_trait = deceitful
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = just
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = honest
			}
		}
	}

	# *Competitive* skiing? With no hunting? Get lost.
	option = {
		name = fp1_yearly.0661.c

		# Some minor opt-out prestige.
		add_prestige = miniscule_prestige_gain
		# You upset scope:knight a bit, though.
		reverse_add_opinion = {
			target = scope:knight
			modifier = disappointed_opinion
			opinion = -10
		}

		stress_impact = {
			lazy = minor_stress_impact_loss
			craven = minor_stress_impact_loss
			lifestyle_hunter = medium_stress_impact_loss
			brave = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_sociability = -0.25
				ai_boldness = -0.5
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = lazy
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = craven
			}
			modifier = {	# Weight up for stress.
				add = 20
				has_trait = lifestyle_hunter
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = brave
			}
		}
	}
}

##################################################
# A Slippery Slope
# by Ewan Cowhig Croft
# 0671 - 0680
##################################################

scripted_trigger fp1_0671_available_older_sibling_trigger = {
	this != scope:child
	child_suitable_to_play_with_character_one_sided = { CHARACTER = root }
	# Should be older than scope:child.
	age > scope:child.age
	# Mustn't have a terribly negative relationship with scope:child.
	NOT = {
		has_any_bad_relationship_with_character_trigger = { CHARACTER = scope:child }
	}
	opinion = {
		target = scope:child
		value >= medium_negative_opinion
	}
}

#	Your child wants you to go sledding with them.
fp1_yearly.0671 = {
	type = character_event
	title = fp1_yearly.0671.t
	desc = fp1_yearly.0671.desc
	theme = family
	left_portrait = {
		character = root
		animation = happiness
	}
	right_portrait = {
		character = scope:child
		animation = admiration
	}
	lower_right_portrait = scope:sibling
	override_background = { reference = bedchamber }

	trigger = {
		# DLC check.
		has_fp1_dlc_trigger = yes
		# Standard checks.
		is_available_even_at_war_adult = yes
		NOT = { has_character_flag = had_event_fp1_yearly_0671 }
		is_landed = yes
		# Gotta have snow in the capital.
		character_capital_has_winter_trigger = yes
		# And an available child.
		any_child = {
			child_suitable_to_play_with_character_one_sided = { CHARACTER = root }
		}
	}

	weight_multiplier = {
		base = 1

		# Weight according to winter scale.
		character_capital_has_snow_suitable_for_activities = { CHARACTER = root }
	}

	immediate = {
		add_character_flag = {
			flag = had_event_fp1_yearly_0671
			days = 1825
		}
		# Grab a suitable child.
		random_child = {
			limit = {
				child_suitable_to_play_with_character_one_sided = { CHARACTER = root }
			}
			save_scope_as = child
		}
		# If there's a suitable sibling, nab them for later.
		if = {
			limit = {
				any_child = { fp1_0671_available_older_sibling_trigger = yes }
			}
			random_child = {
				limit = { fp1_0671_available_older_sibling_trigger = yes }
				save_scope_as = sibling
			}
		}
		add_character_flag = {
			flag = use_sickness_clothes
			days = 1
		}
	}

	# (Strong/Physique_Good) Hah, let me just haul this table out for us!
	option = {
		name = fp1_yearly.0671.a
		trigger = {
			OR = {
				has_trait = strong
				has_trait = physique_good
			}
		}
		trait = strong
		trait = physique_good_1
		trait = physique_good_2
		trait = physique_good_3

		# Gain huge opinion boost with scope:child.
		reverse_add_opinion = {
			target = scope:child
			modifier = love_opinion
			opinion = 50
		}
		# Grow closer to becoming friends with scope:child, if possible.
		progress_towards_friend_effect = {
			CHARACTER = scope:child
			OPINION = 0
			REASON = friend_sledding
		}

		stress_impact = {
			gregarious = minor_stress_impact_loss
			diligent = minor_stress_impact_loss
			lazy = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = 0.5
				ai_energy = 0.5
				ai_sociability = 0.25
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = gregarious
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = diligent
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = lazy
			}
		}
	}

	# Come on, let's get a tray from the kitchen.
	option = {
		name = fp1_yearly.0671.b
		trigger = {
			NOR = {
				has_trait = strong
				has_trait = physique_good
			}
		}

		# Gain large opinion boost with scope:child.
		reverse_add_opinion = {
			target = scope:child
			modifier = love_opinion
			opinion = 25
		}

		stress_impact = {
			gregarious = minor_stress_impact_loss
			diligent = minor_stress_impact_loss
			lazy = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = 0.5
				ai_energy = 0.5
				ai_sociability = 0.25
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = gregarious
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = diligent
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = lazy
			}
		}
	}

	# Go ask your [sibling].
	option = {
		name = fp1_yearly.0671.c
		trigger = { exists = scope:sibling }

		# Scope:child & scope:sibling both gain opinion of each other.
		scope:child = {
			progress_towards_friend_effect = {
				CHARACTER = scope:sibling
				OPINION = 30
				REASON = friend_sledding
			}
		}

		# Quite a mild response, so no stress involved.
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = 0.5
				ai_energy = -0.25
				ai_sociability = -0.25
			}
		}
	}

	# Away with you, I'm busy.
	option = {
		name = fp1_yearly.0671.d

		# Lose stress.
		## Stress loss handled in stress_impact.
		# But also opinion with scope:child.
		reverse_add_opinion = {
			target = scope:child
			modifier = disappointed_opinion
			opinion = -20
		}

		stress_impact = {
			base = major_stress_loss
			lazy = minor_stress_impact_loss
			callous = minor_stress_impact_loss
			compassionate = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = -0.25
				ai_sociability = -0.25
				ai_energy = -0.5
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = lazy
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = callous
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = compassionate
			}
		}
	}

	# Get out of your pajamas.
	after = { remove_character_flag = use_sickness_clothes }
}

##################################################
# Why Can't I Come?
# by Ewan Cowhig Croft
# 0681 - 0690
##################################################

scripted_trigger fp1_0681_haughty_knights_trigger = {
	# Has enough prowess that they're proud of it.
	prowess >= medium_skill_rating
	# And lacks any humbling traits.
	NOR = {
		has_trait = humble
		has_trait = compassionate
		has_trait = forgiving
	}
}

scripted_trigger fp1_0681_child_that_might_like_raiding_trigger = {
	# Must be around.
	child_suitable_to_play_with_character_one_sided = { CHARACTER = root }
	# We want basically anyone who might think it's exciting.
	NOT = { has_trait = pensive }
}

#	One of your children wants to know why they can't come raiding.
fp1_yearly.0681 = {
	type = character_event
	title = fp1_yearly.0681.t
	desc = fp1_yearly.0681.desc
	theme = war
	left_portrait = {
		character = root
		animation = personality_content
	}
	right_portrait = {
		character = scope:child
		animation = admiration
	}
	override_background = { reference = study }

	trigger = {
		# DLC check.
		has_fp1_dlc_trigger = yes
		# Standard checks.
		is_available_at_peace_adult = yes
		NOT = { has_character_flag = had_event_fp1_yearly_0681 }
		is_landed = yes
		# Filter to flavour-appropriate characters.
		fp1_is_coastal_norse_tribal = yes
		# Raiding must be recent or ever-present.
		OR = {
			has_trait = viking
			has_character_flag = has_recently_performed_raid
		}
		# At least some of your knights should be snobbish.
		any_knight = { fp1_0681_haughty_knights_trigger = yes }
		# And you must have a suitable child.
		any_child = { fp1_0681_child_that_might_like_raiding_trigger = yes }
	}

	weight_multiplier = {
		base = 1

		# Weight up a bit for adventurers & vikings.
		modifier = {
			add = 0.5
			has_trait = adventurer
		}
		modifier = {
			add = 0.5
			has_trait = viking
		}
	}

	immediate = {
		add_character_flag = {
			flag = had_event_fp1_yearly_0681
			days = 1825
		}
		# Grab a suitable child.
		random_child = {
			limit = { fp1_0681_child_that_might_like_raiding_trigger = yes }
			save_scope_as = child
		}
	}

	# I'm leaving you to guard [capital], ok?
	option = {
		name = fp1_yearly.0681.a

		# Gain opinion with scope:child.
		reverse_add_opinion = {
			target = scope:child
			modifier = trust_opinion
			opinion = 20
		}

		stress_impact = {
			compassionate = minor_stress_impact_loss
			callous = minor_stress_impact_gain
			sadistic = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = 0.75
				ai_sociability = 0.25
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = compassionate
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = callous
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = sadistic
			}
		}
	}

	# _Hah_! You'll never be a true warrior, child.
	option = {
		name = fp1_yearly.0681.b

		# Gain opinion with all of your haughty knights.
		every_knight = {
			limit = { fp1_0681_haughty_knights_trigger = yes }
			custom = fp1_yearly.0681.b.haughty_knights
			add_opinion = {
				target = root
				modifier = respect_opinion
				opinion = 15
			}
		}
		# Lose opinion with scope:child.
		reverse_add_opinion = {
			target = scope:child
			modifier = hurt_opinion
			opinion = -30
		}
		# Add hidden potential rivalry if possible.
		hidden_effect = {
			if = {
				limit = {
					can_set_relation_potential_rival_trigger = { CHARACTER = scope:child }
				}
				set_relation_potential_rival = scope:child
			}
		}

		stress_impact = {
			callous = minor_stress_impact_loss
			sadistic = minor_stress_impact_loss
			compassionate = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_boldness = 0.25
				ai_compassion = -0.5
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = callous
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = sadistic
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = compassionate
			}
		}
	}

	# We'll talk about it when you're older.
	option = {
		name = fp1_yearly.0681.c

		# Gain some minor opinion with your knights.
		every_knight = {
			custom = custom.every_knight
			add_opinion = {
				target = root
				modifier = respect_opinion
				opinion = 5
			}
		}
		# But lose opinion with scope:child.
		reverse_add_opinion = {
			target = scope:child
			modifier = disappointed_opinion
			opinion = -10
		}

		# Mild response, incurs no stress.
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_energy = -0.25
				ai_boldness = -0.25
				ai_sociability = -0.25
			}
		}
	}
}

##################################################
# Attempted Atonement
# by Ewan Cowhig Croft
# 0691 - 0700
##################################################

scripted_trigger fp1_0692_valid_convertable_knight_trigger = {
	# Must be in the army's location.
	location = root.location
	# & share scope:raider's faith, which isn't reformed.
	faith = {
		this = scope:raider.faith
		has_doctrine_parameter = unreformed
	}
	# Shouldn't have anything that might block them from converting.
	NOR = {
		has_trait = arrogant
		has_trait = content
		has_trait = cynical
		has_trait = zealous
		has_trait = paranoid
		# Sadists are too busy for introspection.
		has_trait = sadistic
	}
	# And should be landless.
	is_courtier_of = scope:raider
	# Children can be rebellious, but we should probably filter them out too.
	NOT = {
		any_parent = { this = scope:raider }
	}
}

scripted_trigger fp1_0691_knight_still_valid_convertable_trigger = {
	# Has all the appropriate variables; they come as a matched pair, but just in case.
	has_variable = raid_convert_county
	has_variable = raid_convert_faith
	# Standard checks.
	is_available_ai_adult = yes
	is_courtier_of = root
	# Make sure that they're still of root's faith, and that root hasn't converted to their new faith.
	faith = root.faith
	NOT = { this.var:raid_convert_faith = root.faith }
	# Shouldn't have become committed to a religious stance, but just check they've not managed to sneak-acquire traits in the meanwhilst.
	NOR = {
		has_trait = zealous
		has_trait = cynical
	}
}

#	One of your knights finds new faith after a raid.
fp1_yearly.0691 = {
	type = character_event
	title = fp1_yearly.0691.t
	desc = fp1_yearly.0691.desc
	theme = war
	left_portrait = {
		character = root
		animation = shock
	}
	right_portrait = {
		character = scope:knight
		animation = personality_zealous
	}
	override_background = { reference = throne_room }

	trigger = {
		# DLC check.
		has_fp1_dlc_trigger = yes
		# Standard checks.
		is_available_at_peace_adult = yes
		NOT = { has_character_flag = had_event_fp1_yearly_0691 }
		is_landed = yes
		# Filter to flavour-appropriate characters.
		fp1_is_norse_tribal = yes
		# There must be at least one knight who's had a crisis of conscience.
		any_knight = { fp1_0691_knight_still_valid_convertable_trigger = yes }
	}

	weight_multiplier = {
		base = 1

		# Knights feel more comfortable converting away if you're not particularly religious.
		modifier = {
			add = 0.5
			has_trait = cynical
		}
	}

	immediate = {
		add_character_flag = {
			flag = had_event_fp1_yearly_0691
			days = 3650
		}
		# Grab a suitable knight.
		random_knight = {
			limit = { fp1_0691_knight_still_valid_convertable_trigger = yes }
			weight = {
				base = 0
				# Weight up fickle & trusting characters.
				## Fickle characters are more likely to heel-face-turn on their pillaging faith.
				modifier = {
					add = 100
					has_trait = fickle
				}
				## Trusting characters are more gullible, and they *did* take thralls.
				modifier = {
					add = 100
					has_trait = trusting
				}
			}
			save_scope_as = knight
		}
		# Convert them & boost their zeal.
		scope:knight = {
			set_character_faith = this.var:raid_convert_faith
			add_trait = zealous
		}
		# Grab the source county for loc.
		scope:knight.var:raid_convert_county = { save_scope_as = county }
	}

	# Surely I can talk you out of this foreign faith?
	option = {
		name = fp1_yearly.0691.a

		# Learning duel to get them to recant & stay.
		duel = {
			skill = learning
			target = scope:knight
			# You bring them back to the light.
			40 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = fp1_yearly.0691.a.tt_success
				send_interface_toast = {
					title = fp1_yearly.0691.a.tt_success
					left_icon = scope:knight
					# They reconvert.
					scope:knight = { set_character_faith = root.faith }
					# And you either get a hook on them...
					if = {
						limit = {
							can_add_hook = {
								target = scope:knight
								type = favor_hook
							}
						}
						add_hook = {
							target = scope:knight
							type = favor_hook
						}
					}
					# Or a goodly chunk of opinion.
					else = {
						reverse_add_opinion = {
							target = scope:knight
							modifier = grateful_opinion
							opinion = 30
						}
					}
				}
			}
			# They refuse and leave.
			60 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = fp1_yearly.0691.a.tt_failure
				send_interface_toast = {
					title = fp1_yearly.0691.a.tt_failure
					left_icon = scope:knight
					# They leave.
					scope:knight = { select_and_move_to_pool_effect = yes }
					# And they're none too happy with you.
					reverse_add_opinion = {
						target = scope:knight
						modifier = insult_opinion
						opinion = -25
					}
				}
			}
		}

		stress_impact = {
			humble = minor_stress_impact_loss
			zealous = major_stress_impact_loss
			arrogant = minor_stress_impact_gain
			cynical = major_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_zeal = 0.75
				ai_boldness = 0.5
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = humble
			}
			modifier = {	# Weight up for stress.
				add = 30
				has_trait = zealous
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = arrogant
			}
			modifier = {	# Weight down for stress.
				add = -30
				has_trait = cynical
			}
		}
	}

	# GetFaith.GetReligion.GetName? You've gone mad. Guards!
	option = {
		name = fp1_yearly.0691.b

		# Quietly move scope:knight to the pool so you're no longer their liege.
		hidden_effect = {
			scope:knight = { move_to_pool = yes }
		}
		# Throw scope:knight in the dungeon immediately.
		rightfully_imprison_character_effect = {
			TARGET = scope:knight
			IMPRISONER = root
		}
		hidden_effect = {
			scope:knight = { change_prison_type = dungeon }
		}
		# Scope:knight is understandably angry.
		reverse_add_opinion = {
			target = scope:knight
			modifier = hate_opinion
			opinion = -50
		}
		# Quietly mark them for future rivalry.
		hidden_effect = {
			if = {
				limit = {
					can_set_relation_potential_rival_trigger = { CHARACTER = scope:knight }
				}
				set_relation_potential_rival = scope:knight
			}
		}
		# But, hey, piety & same-faith courtier & guest opinion.
		every_courtier_or_guest = {
			limit = {
				faith = root.faith
				NOT = { has_trait = cynical }
			}
			custom = fp1_yearly.0691.b.same_faith_courtiers_and_guests
			add_opinion = {
				target = root
				modifier = pious_opinion
				opinion = 10
			}
		}

		stress_impact = {
			vengeful = major_stress_impact_loss
			zealous = major_stress_impact_loss
			forgiving = major_stress_impact_gain
			cynical = major_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_zeal = 0.5
				ai_vengefulness = 0.5
				ai_energy = -0.25
			}
			modifier = {	# Weight up for stress.
				add = 30
				has_trait = vengeful
			}
			modifier = {	# Weight up for stress.
				add = 30
				has_trait = zealous
			}
			modifier = {	# Weight down for stress.
				add = -30
				has_trait = forgiving
			}
			modifier = {	# Weight down for stress.
				add = -30
				has_trait = cynical
			}
		}
	}

	# You may go if you wish.
	option = {
		name = fp1_yearly.0691.c

		# Gain a little prestige.
		add_prestige = minor_prestige_gain
		# And the knight's gratitude.
		reverse_add_opinion = {
			target = scope:knight
			modifier = grateful_opinion
			opinion = 35
		}
		# But lose the knight.
		scope:knight = { select_and_move_to_pool_effect = yes }

		stress_impact = {
			forgiving = major_stress_impact_loss
			cynical = major_stress_impact_loss
			vengeful = major_stress_impact_gain
			zealous = major_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = 0.5
				ai_vengefulness = -0.5
			}
			modifier = {	# Weight up for stress.
				add = 30
				has_trait = forgiving
			}
			modifier = {	# Weight up for stress.
				add = 30
				has_trait = cynical
			}
			modifier = {	# Weight down for stress.
				add = -30
				has_trait = vengeful
			}
			modifier = {	# Weight down for stress.
				add = -30
				has_trait = zealous
			}
		}
	}
}

#	Set-up event for raiding.
fp1_yearly.0692 = {
	hidden = yes
	scope = army

	trigger = {
		# DLC check.
		has_fp1_dlc_trigger = yes
		# We only want to convert to reformed faiths.
		scope:county.faith = {
			NOT = { has_doctrine_parameter = unreformed }
		}
		# Check various prerequisites with scope:raider.
		scope:raider = {
			# Scope:raider shouldn't have had this event recently either.
			#NOT = { has_character_flag = had_event_fp1_yearly_0691 }
			# We don't want all raiding to result in tons of variables floating about.
			fp1_is_norse_tribal = yes
			# There must be at least one eligible knight in the raid army.
			any_knight = { fp1_0692_valid_convertable_knight_trigger = yes }
		}
	}

	immediate = {
		# Designate a suitable knight.
		scope:raider = {
			random_knight = {
				# Preferring those who might be more open to new ideas.
				limit = {
					fp1_0692_valid_convertable_knight_trigger = yes
					OR = {
						has_trait = humble
						has_trait = honest
						has_trait = ambitious
						has_trait = gregarious
						has_trait = arbitrary
						has_trait = trusting
						has_trait = fickle
					}
				}
				# But otherwise just anyone valid.
				alternative_limit = { fp1_0692_valid_convertable_knight_trigger = yes }
				# Remember the county it happened in.
				set_variable = {
					name = raid_convert_county
					value = scope:county
					years = 5
				}
				# And the faith they'd like to convert to.
				set_variable = {
					name = raid_convert_faith
					value = scope:county.faith
					years = 5
				}
			}
		}
	}
}










##################################################
# SPECIAL YEARLIES

##################################################
# A Mysterious Stranger Stays at Court
# by Ewan Cowhig Croft
# 1001 - 1030
##################################################

scripted_trigger valid_germanic_faith_trigger = {
	#Small enough that it probably doesn't need a trigger, but might need to be more complex in future.
	religion = religion:folkgerman_religion
}

scripted_trigger valid_non_germanic_reformed_faith_trigger = {
	NOR = {
		faith = { has_doctrine_parameter = unreformed }
		religion = religion:folkgerman_religion
	}
}

scripted_effect fp1_mysterious_stranger_follow_up_event_picker_effect = {
	if = {
		limit = { scope:ms_type = flag:godi }
		trigger_event = fp1_yearly.1011
	}
	else_if = {
		limit = { scope:ms_type = flag:missionary }
		trigger_event = fp1_yearly.1012
	}
	else_if = {
		limit = { scope:ms_type = flag:nithing }
		trigger_event = fp1_yearly.1013
	}
	else_if = {
		limit = { scope:ms_type = flag:warrior }
		trigger_event = fp1_yearly.1014
	}
	#Trigger vagrant as the last possible thing.
	else = { trigger_event = fp1_yearly.1015 }
}

scripted_effect mysterious_stranger_disappears_effect = {
	custom_tooltip = fp1_yearly.1001.mysterious_stranger_disappears.tt
	hidden_effect = {
		scope:stranger = {
			death = { death_reason = death_vanished }
		}
	}
}

#	You notice a stranger has been hanging around the court.
fp1_yearly.1001 = {
	type = character_event
	title = fp1_yearly.1001.t
	desc = {
		desc = fp1_yearly.1001.desc.intro
		first_valid = {
			triggered_desc = {
				trigger = { scope:ms_behaviour_1 = flag:sneaks }
				desc = fp1_yearly.1001.desc.behaviour_1.sneaks
			}
			triggered_desc = {
				trigger = { scope:ms_behaviour_1 = flag:leaves_early }
				desc = fp1_yearly.1001.desc.behaviour_1.leaves_early
			}
			triggered_desc = {
				trigger = { scope:ms_behaviour_1 = flag:earnest }
				desc = fp1_yearly.1001.desc.behaviour_1.earnest
			}
			triggered_desc = {
				trigger = { scope:ms_behaviour_1 = flag:confident }
				desc = fp1_yearly.1001.desc.behaviour_1.confident
			}
			triggered_desc = {
				trigger = { scope:ms_behaviour_1 = flag:talkative }
				desc = fp1_yearly.1001.desc.behaviour_1.talkative
			}
			triggered_desc = {
				trigger = { scope:ms_behaviour_1 = flag:eats_their_fill }
				desc = fp1_yearly.1001.desc.behaviour_1.eats_their_fill
			}
		}
		first_valid = {
			triggered_desc = {
				trigger = { scope:ms_behaviour_2 = flag:sneaks }
				desc = fp1_yearly.1001.desc.behaviour_2.sneaks
			}
			triggered_desc = {
				trigger = { scope:ms_behaviour_2 = flag:leaves_early }
				desc = fp1_yearly.1001.desc.behaviour_2.leaves_early
			}
			triggered_desc = {
				trigger = { scope:ms_behaviour_2 = flag:earnest }
				desc = fp1_yearly.1001.desc.behaviour_2.earnest
			}
			triggered_desc = {
				trigger = { scope:ms_behaviour_2 = flag:confident }
				desc = fp1_yearly.1001.desc.behaviour_2.confident
			}
			triggered_desc = {
				trigger = { scope:ms_behaviour_2 = flag:talkative }
				desc = fp1_yearly.1001.desc.behaviour_2.talkative
			}
			triggered_desc = {
				trigger = { scope:ms_behaviour_2 = flag:eats_their_fill }
				desc =  fp1_yearly.1001.desc.behaviour_2.eats_their_fill
			}
		}
		desc = fp1_yearly.1001.desc.outro
	}
	theme = intrigue
	left_portrait = {
		character = scope:stranger
		animation = personality_honorable
	}
	override_background = { reference = feast }

	trigger = {
		#DLC check.
		has_fp1_dlc_trigger = yes
		#Standard checks.
		is_available_even_at_war_adult = yes
		is_landed = yes
		NOT = { has_character_flag = had_event_fp1_yearly_1001 }
		#Scandinavian culture group, and within Scandinavia (plus a few other places).
		culture = { has_cultural_pillar = heritage_north_germanic }
		capital_province ?= { geographical_region = dlc_fp1_region_mysterious_stranger_locations }
	}

	weight_multiplier = {
		base = 1
	}

	immediate = {
		add_character_flag = {
			flag = had_event_fp1_yearly_1001
			days = 7300
		}
		#Spawn a suitable mysterious stranger.
		##Each of these has a list of traits that overlap with 1-2 other spawnable categories, as well as some unique tells.
		##The idea is that they're structured enough to be able to guess (sorta) first time, but random enough that you won't always guess correctly. At the same time, learning the tells over time, and what makes a character definitely/definitely not a specific type of stranger, rewards repeated play.
		random_list = {
			#Spawn a godi.
			100 = {
				#Requires some contact with Germanic Paganism.
				trigger = {
					OR = {
						valid_germanic_faith_trigger = yes
						any_sub_realm_county = { valid_germanic_faith_trigger = yes }
						any_neighboring_top_liege_realm_owner = { valid_germanic_faith_trigger = yes }
					}
				}
				#Create the character & set up details for later.
				create_character = {
					location = root.capital_province
					template = fp1_ms_godi_character
					save_scope_as = stranger
				}
				save_scope_value_as = {
					name = ms_type
					value = flag:godi
				}
				#Figure out what faith the godi would actually have.
				##Only a random chance for now: this is to give same-religion separate-faith godis a chance to spawn if you're Germanic Pagan yourself.
				random = {
					chance = 50
					if = {
						limit = { valid_germanic_faith_trigger = yes }
						faith = { save_scope_as = ms_faith }
					}
				}
				if = {
					limit = {
						NOT = { exists = scope:ms_faith }
						any_sub_realm_county = { valid_germanic_faith_trigger = yes }
					}
					random_sub_realm_county = {
						limit = { valid_germanic_faith_trigger = yes }
						faith = { save_scope_as = ms_faith }
					}
				}
				else_if  = {
					limit = {
						any_neighboring_top_liege_realm_owner = { valid_germanic_faith_trigger = yes }
					}
					random_neighboring_top_liege_realm_owner = {
						limit = { valid_germanic_faith_trigger = yes }
						faith = { save_scope_as = ms_faith }
					}
				}
				else = {
					#If you hit this stage, go back to your own Germanic Pagan faith.
					faith = { save_scope_as = ms_faith }
				}
			}
			#Spawn a missionary from a reformed faith.
			100 = {
				#Requires some contact with a reformed faith that isn't Germanic Pagan.
				trigger = {
					OR = {
						valid_non_germanic_reformed_faith_trigger = yes
						any_sub_realm_county = { valid_non_germanic_reformed_faith_trigger = yes }
						any_neighboring_top_liege_realm_owner = { valid_non_germanic_reformed_faith_trigger = yes }
					}
				}
				#Create the character & set up details for later.
				create_character = {
					location = root.capital_province
					template = fp1_ms_reformed_missionary_character
					save_scope_as = stranger
				}
				save_scope_value_as = {
					name = ms_type
					value = flag:missionary
				}
				#Figure out what faith the missionary would actually have.
				if = {
					limit = { valid_non_germanic_reformed_faith_trigger = yes }
					faith = { save_scope_as = ms_faith }
				}
				else_if = {
					limit = {
						any_sub_realm_county = { valid_non_germanic_reformed_faith_trigger = yes }
					}
					random_sub_realm_county = {
						limit = { valid_non_germanic_reformed_faith_trigger = yes }
						faith = { save_scope_as = ms_faith }
					}
				}
				else = {
					random_neighboring_top_liege_realm_owner = {
						limit = { valid_non_germanic_reformed_faith_trigger = yes }
						faith = { save_scope_as = ms_faith }
					}
				}
			}
			#Spawn a nithing.
			100 = {
				#No requirements.
				#Create the character & set up details for later.
				create_character = {
					location = root.capital_province
					template = fp1_ms_nithing_character
					save_scope_as = stranger
				}
				save_scope_value_as = {
					name = ms_type
					value = flag:nithing
				}
			}
			#Spawn a warrior.
			100 = {
				#No requirements.
				#Create the character & set up details for later.
				create_character = {
					location = root.capital_province
					template = fp1_ms_warrior_character
					save_scope_as = stranger
				}
				save_scope_value_as = {
					name = ms_type
					value = flag:warrior
				}
			}
			#Spawn an ordinary vagrant.
			##These guys are the wild cards: they have no restrictions on anything, save that they suck at everything. Their job is to be confusing and make you uncertain.
			100 = {
				#No requirements.
				#Create the character & set up details for later.
				create_character = {
					location = root.capital_province
					template = fp1_ms_vagrant_character
					save_scope_as = stranger
				}
				save_scope_value_as = {
					name = ms_type
					value = flag:vagrant
				}
			}
		}
		#Set behaviours.
		##Each stranger type exhibits two of three possible behaviour patterns in the event description. All behaviour patterns overlap with at least one other stranger type, with the vagrant having access to all of them.
		random_list = {
			#Godi
			100 = {
				trigger = { scope:ms_type = flag:godi }
				random_list = {
					33 = {
						save_scope_value_as = {
							name = ms_behaviour_1
							value = flag:sneaks
						}
					}
					33 = {
						save_scope_value_as = {
							name = ms_behaviour_1
							value = flag:leaves_early
						}
					}
					33 = {
						save_scope_value_as = {
							name = ms_behaviour_1
							value = flag:earnest
						}
					}
				}
				random_list = {
					33 = {
						trigger = {
							NOT = { scope:ms_behaviour_1 = flag:sneaks }
						}
						save_scope_value_as = {
							name = ms_behaviour_2
							value = flag:sneaks
						}
					}
					33 = {
						trigger = {
							NOT = { scope:ms_behaviour_1 = flag:leaves_early }
						}
						save_scope_value_as = {
							name = ms_behaviour_2
							value = flag:leaves_early
						}
					}
					33 = {
						trigger = {
							NOT = { scope:ms_behaviour_1 = flag:earnest }
						}
						save_scope_value_as = {
							name = ms_behaviour_2
							value = flag:earnest
						}
					}
				}
			}
			#Missionary
			100 = {
				trigger = { scope:ms_type = flag:missionary }
				random_list = {
					33 = {
						save_scope_value_as = {
							name = ms_behaviour_1
							value = flag:confident
						}
					}
					33 = {
						save_scope_value_as = {
							name = ms_behaviour_1
							value = flag:leaves_early
						}
					}
					33 = {
						save_scope_value_as = {
							name = ms_behaviour_1
							value = flag:talkative
						}
					}
				}
				random_list = {
					33 = {
						trigger = {
							NOT = { scope:ms_behaviour_1 = flag:confident }
						}
						save_scope_value_as = {
							name = ms_behaviour_2
							value = flag:confident
						}
					}
					33 = {
						trigger = {
							NOT = { scope:ms_behaviour_1 = flag:leaves_early }
						}
						save_scope_value_as = {
							name = ms_behaviour_2
							value = flag:leaves_early
						}
					}
					33 = {
						trigger = {
							NOT = { scope:ms_behaviour_1 = flag:talkative }
						}
						save_scope_value_as = {
							name = ms_behaviour_2
							value = flag:talkative
						}
					}
				}
			}
			#Nithing
			100 = {
				trigger = { scope:ms_type = flag:nithing }
				random_list = {
					33 = {
						save_scope_value_as = {
							name = ms_behaviour_1
							value = flag:sneaks
						}
					}
					33 = {
						save_scope_value_as = {
							name = ms_behaviour_1
							value = flag:eats_their_fill
						}
					}
					33 = {
						save_scope_value_as = {
							name = ms_behaviour_1
							value = flag:earnest
						}
					}
				}
				random_list = {
					33 = {
						trigger = {
							NOT = { scope:ms_behaviour_1 = flag:sneaks }
						}
						save_scope_value_as = {
							name = ms_behaviour_2
							value = flag:sneaks
						}
					}
					33 = {
						trigger = {
							NOT = { scope:ms_behaviour_1 = flag:eats_their_fill }
						}
						save_scope_value_as = {
							name = ms_behaviour_2
							value = flag:eats_their_fill
						}
					}
					33 = {
						trigger = {
							NOT = { scope:ms_behaviour_1 = flag:earnest }
						}
						save_scope_value_as = {
							name = ms_behaviour_2
							value = flag:earnest
						}
					}
				}
			}
			#Warrior
			100 = {
				trigger = { scope:ms_type = flag:warrior }
				random_list = {
					33 = {
						save_scope_value_as = {
							name = ms_behaviour_1
							value = flag:confident
						}
					}
					33 = {
						save_scope_value_as = {
							name = ms_behaviour_1
							value = flag:eats_their_fill
						}
					}
					33 = {
						save_scope_value_as = {
							name = ms_behaviour_1
							value = flag:talkative
						}
					}
				}
				random_list = {
					33 = {
						trigger = {
							NOT = { scope:ms_behaviour_1 = flag:confident }
						}
						save_scope_value_as = {
							name = ms_behaviour_2
							value = flag:confident
						}
					}
					33 = {
						trigger = {
							NOT = { scope:ms_behaviour_1 = flag:eats_their_fill }
						}
						save_scope_value_as = {
							name = ms_behaviour_2
							value = flag:eats_their_fill
						}
					}
					33 = {
						trigger = {
							NOT = { scope:ms_behaviour_1 = flag:talkative }
						}
						save_scope_value_as = {
							name = ms_behaviour_2
							value = flag:talkative
						}
					}
				}
			}
			#Vagrant
			100 = {
				trigger = { scope:ms_type = flag:vagrant }
				random_list = {
					20 = {
						save_scope_value_as = {
							name = ms_behaviour_1
							value = flag:sneaks
						}
					}
					20 = {
						save_scope_value_as = {
							name = ms_behaviour_1
							value = flag:leaves_early
						}
					}
					20 = {
						save_scope_value_as = {
							name = ms_behaviour_1
							value = flag:earnest
						}
					}
					20 = {
						save_scope_value_as = {
							name = ms_behaviour_1
							value = flag:confident
						}
					}
					20 = {
						save_scope_value_as = {
							name = ms_behaviour_1
							value = flag:talkative
						}
					}
				}
				random_list = {
					20 = {
						trigger = {
							NOT = { scope:ms_behaviour_1 = flag:sneaks }
						}
						save_scope_value_as = {
							name = ms_behaviour_2
							value = flag:sneaks
						}
					}
					20 = {
						trigger = {
							NOT = { scope:ms_behaviour_1 = flag:leaves_early }
						}
						save_scope_value_as = {
							name = ms_behaviour_2
							value = flag:leaves_early
						}
					}
					20 = {
						trigger = {
							NOT = { scope:ms_behaviour_1 = flag:earnest }
						}
						save_scope_value_as = {
							name = ms_behaviour_2
							value = flag:earnest
						}
					}
					20 = {
						trigger = {
							NOT = { scope:ms_behaviour_1 = flag:confident }
						}
						save_scope_value_as = {
							name = ms_behaviour_2
							value = flag:confident
						}
					}
					20 = {
						trigger = {
							NOT = { scope:ms_behaviour_1 = flag:talkative }
						}
						save_scope_value_as = {
							name = ms_behaviour_2
							value = flag:talkative
						}
					}
				}
			}
		}
		#And sometimes just remove an eye for funsies.
		random = {
			chance = 5
			scope:stranger = { add_trait = one_eyed }
		}
	}

	#Ignore them: they're probably harmless.
	##This leads to a standardised effect: something mildly beneficial/annoying, if the player is unsure or doesn't want to gamble much.
	option = {
		name = fp1_yearly.1001.a

		#Let the player know that something will happen.
		custom_tooltip = fp1_yearly.1001.probably_harmless.tt

		#Configure for standard effects.
		save_scope_value_as = {
			name = ms_effect
			value = flag:standard
		}

		#Figure out which follow-up event to send.
		fp1_mysterious_stranger_follow_up_event_picker_effect = yes

		stress_impact = {
			trusting = minor_stress_impact_loss
			gregarious = minor_stress_impact_loss
			paranoid = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_sociability = -0.5
				ai_compassion = -0.25
			}
			modifier = {	#Weight up for stress.
				add = 10
				has_trait = trusting
			}
			modifier = {	#Weight up for stress.
				add = 10
				has_trait = gregarious
			}
			modifier = {	#Weight down for stress.
				add = -10
				has_trait = paranoid
			}
		}
	}

	#Make them a guest of honour!
	##This leads to a critical effect: we dial up the consequences, in case the player is certain they know who the stranger is/wants to risk it for a biscuit.
	option = {
		name = fp1_yearly.1001.b

		#Warn the player that they're signing up for a dramatic event.
		custom_tooltip = fp1_yearly.1001.guest_of_honour.tt

		#Configure for critical effects.
		save_scope_value_as = {
			name = ms_effect
			value = flag:critical
		}

		#Figure out which follow-up event to send.
		fp1_mysterious_stranger_follow_up_event_picker_effect = yes

		stress_impact = {
			trusting = medium_stress_impact_loss
			gregarious = medium_stress_impact_loss
			paranoid = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_sociability = -0.5
				ai_compassion = -0.25
			}
			modifier = {	#Weight up for stress.
				add = 20
				has_trait = trusting
			}
			modifier = {	#Weight up for stress.
				add = 20
				has_trait = gregarious
			}
			modifier = {	#Weight down for stress.
				add = -20
				has_trait = paranoid
			}
		}
	}

	#Give 'em the boot.
	##Opt-out with mild consequence.
	option = {
		name = fp1_yearly.1001.c

		#The mysterious stranger vanishes.
		mysterious_stranger_disappears_effect = yes

		#Everyone thinks you're a bit mean-spirited, but that's it.
		if = {
			limit = { has_character_modifier = generous_host_fp1_modifier }
			remove_character_modifier = generous_host_fp1_modifier
		}
		else = {
			add_character_modifier = {
				modifier = stingy_host_fp1_modifier
				years = 5
			}
		}

		stress_impact = {
			paranoid = minor_stress_impact_loss
			shy = medium_stress_impact_loss
			trusting = minor_stress_impact_gain
			gregarious = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_sociability = 0.5
				ai_compassion = 0.25
			}
			modifier = {	#Weight up for stress.
				add = 10
				has_trait = paranoid
			}
			modifier = {	#Weight up for stress.
				add = 20
				has_trait = shy
			}
			modifier = {	#Weight down for stress.
				add = -10
				has_trait = trusting
			}
			modifier = {	#Weight down for stress.
				add = -10
				has_trait = gregarious
			}
		}
	}
}

scripted_trigger mysterious_stranger_godi_same_faith_trigger = {
	#Small enough that it probably doesn't need a trigger, but might need to be more complex in future.
	faith = scope:ms_faith
}

scripted_trigger mysterious_stranger_godi_same_religion_trigger = {
	NOT = { mysterious_stranger_godi_same_faith_trigger = yes }
	religion = scope:ms_faith.religion
}

scripted_effect mysterious_stranger_add_possible_converts_to_specific_list_effect = {
	random_in_list = {
		list = possible_converts_pool_list
		limit = {
			NOT = { is_in_list = possible_converts_specific_list }
		}
		weight = {
			base = 0
			#Give a base percentage chance, scale down 2% per point of learning.
			modifier = {
				add = {
					value = 50
					subtract = learning
				}
			}
			#Weight up assorted traits that make you more likely to believe the godi.
			modifier = {
				add = 5
				has_trait = arbitrary
			}
			modifier = {
				add = 5
				has_trait = fickle
			}
			modifier = {
				add = 10
				has_trait = trusting
			}
		}
		add_to_list = possible_converts_specific_list
	}
}

scripted_effect mysterious_stranger_different_religion_convert_courtiers_effect = {
	#Firstly, nab all the courtiers who might be susceptible to conversion, excepting any who'd mess you up too much.
	every_courtier = {
		limit = {
			is_available_ai_adult = yes
			#We only want to look at people of root's faith.
			faith = root.faith
			NOR = {
				#Exclude the self-righteous.
				has_trait = zealous
				has_trait = faith_warrior
				has_trait = heresiarch
				has_trait = crusader_king
				#Aaaand exclude the actually-righteous.
				piety_level >= medium_piety_level
				#We also don't want council conversions, since that could make for some awkward chaplains.
				is_councillor_of = root
				#Filter out likely heirs, so that we don't mess up succession too much.
				is_primary_heir_of = root
				is_player_heir_of = root
			}
		}
		add_to_list = possible_converts_pool_list
	}
	#Nab specific courtiers for conversion.
	mysterious_stranger_add_possible_converts_to_specific_list_effect = yes
	mysterious_stranger_add_possible_converts_to_specific_list_effect = yes
	mysterious_stranger_add_possible_converts_to_specific_list_effect = yes
	#Nab even more if it's a a critical effect.
	if = {
		limit = { scope:ms_effect = flag:critical }
		mysterious_stranger_add_possible_converts_to_specific_list_effect = yes
		mysterious_stranger_add_possible_converts_to_specific_list_effect = yes
		mysterious_stranger_add_possible_converts_to_specific_list_effect = yes
	}
}

#	Results: Godi.
fp1_yearly.1011 = {
	type = character_event
	title = fp1_yearly.1011.t
	desc = {
		first_valid = {
			#Critical - separate religion.
			triggered_desc = {
				trigger = {
					scope:ms_effect = flag:critical
					NOR = {
						mysterious_stranger_godi_same_faith_trigger = yes
						mysterious_stranger_godi_same_religion_trigger = yes
					}
				}
				desc = fp1_yearly.1011.desc.separate_religion.critical
			}
			#Standard - separate religion.
			triggered_desc = {
				trigger = {
					scope:ms_effect = flag:standard
					NOR = {
						mysterious_stranger_godi_same_faith_trigger = yes
						mysterious_stranger_godi_same_religion_trigger = yes
					}
				}
				desc = fp1_yearly.1011.desc.separate_religion.standard
			}
			#Critical - same religion, separate faith.
			triggered_desc = {
				trigger = {
					scope:ms_effect = flag:critical
					mysterious_stranger_godi_same_religion_trigger = yes
				}
				desc = fp1_yearly.1011.desc.same_religion.critical
			}
			#Standard - same religion, separate faith.
			triggered_desc = {
				trigger = {
					scope:ms_effect = flag:standard
					mysterious_stranger_godi_same_religion_trigger = yes
				}
				desc = fp1_yearly.1011.desc.same_religion.standard
			}
			#Critical - same faith.
			triggered_desc = {
				trigger = {
					scope:ms_effect = flag:critical
					mysterious_stranger_godi_same_faith_trigger = yes
				}
				desc = fp1_yearly.1011.desc.same_faith.critical
			}
			#Standard - same faith (fallback).
			desc = fp1_yearly.1011.desc.same_faith.standard
		}
	}
	theme = intrigue
	left_portrait = {
		character = scope:stranger
		#The Godi respects fellow Germanic Pagans.
		triggered_animation = {
			trigger = {
				root = {
					OR = {
						mysterious_stranger_godi_same_faith_trigger = yes
						mysterious_stranger_godi_same_religion_trigger = yes
					}
				}
			}
			animation = personality_zealous
		}
		#Less so those outside their religion.
		triggered_animation = {
			trigger = {
				root = {
					NAND = {
						mysterious_stranger_godi_same_faith_trigger = yes
						mysterious_stranger_godi_same_religion_trigger = yes
					}
				}
			}
			animation = anger
		}
	}
	override_background = { reference = bedchamber }

	immediate = {
		scope:stranger = {
			#Boost education by a step.
			##Ordered backwards so that they don't sequentially overwrite each other.
			if = {
				limit = { has_trait = education_learning_3 }
				hidden_effect = { remove_trait = education_learning_3 }
				add_trait = education_learning_4
			}
			if = {
				limit = { has_trait = education_learning_2 }
				hidden_effect = { remove_trait = education_learning_2 }
				add_trait = education_learning_3
			}
			if = {
				limit = { has_trait = education_learning_1 }
				hidden_effect = { remove_trait = education_learning_1 }
				add_trait = education_learning_2
			}
			if = {
				limit = { has_trait = education_intrigue_3 }
				hidden_effect = { remove_trait = education_intrigue_3 }
				add_trait = education_intrigue_4
			}
			if = {
				limit = { has_trait = education_intrigue_2 }
				hidden_effect = { remove_trait = education_intrigue_2 }
				add_trait = education_intrigue_3
			}
			if = {
				limit = { has_trait = education_intrigue_1 }
				hidden_effect = { remove_trait = education_intrigue_1 }
				add_trait = education_intrigue_2
			}
			#Boost stats.
			add_diplomacy_skill = { 5 10 }
			add_martial_skill = { 5 10 }
			add_stewardship_skill = { 3 8 }
			add_intrigue_skill = { 10 15 }
			add_learning_skill = { 10 15 }
			add_prowess_skill = { 5 10 }
			#Change faith.
			hidden_effect = { set_character_faith = scope:ms_faith }
			#Finally: give them an eye-patch, assuming they're going to impersonate Odin. And aren't already missing an eye.
			if = {
				limit = {
					religion = root.religion
					NOT = { has_trait = one_eyed }
				}
				add_character_flag = wears_fake_eye_patch
			}
			#Reveal the godi's true stats.
			hidden_effect = { force_character_skill_recalculation = yes }
		}
		#Organise a list of courtiers who might be affected for conversion.
		mysterious_stranger_different_religion_convert_courtiers_effect = yes
		#Godi is not even of your religion, giving negative effects.
		if = {
			limit = {
				NOR = {
					mysterious_stranger_godi_same_faith_trigger = yes
					mysterious_stranger_godi_same_religion_trigger = yes
				}
			}
			#If the godi is not of your religion, they convert a bunch of your courtiers.
			every_in_list = {
				list = possible_converts_specific_list
				custom = fp1_yearly.1011.possible_converts_specific_list
				set_character_faith = scope:ms_faith
			}
			#You also lose some piety, or realm priest opinion if appropriate. Amount depends on whether you endorsed the godi or not.
			if = {
				limit = { scope:ms_effect = flag:critical }
				if = {
					limit = {
						faith = { has_doctrine = doctrine_theocracy_lay_clergy }
						#Double-check that they actually have a realm priest at the moment.
						any_learning_councillor = { exists = this }
					}
					add_piety = medium_piety_loss
					every_learning_councillor = {
						add_opinion = {
							target = root
							modifier = fp1_honoured_heathen_opinion
						}
					}
				}
				else = { add_piety = major_piety_loss }
			}
			else = { add_piety = medium_piety_loss }
		}
		#Godi is of your religion, but not of your faith.
		else_if = {
			limit = { mysterious_stranger_godi_same_religion_trigger = yes }
			#Better piety gain if you endorsed them.
			if = {
				limit = { scope:ms_effect = flag:critical }
				add_piety = medium_piety_gain
			}
			else = { add_piety = minor_piety_gain }
		}
		#Otherwise, the godi is of your faith.
		else = {
			#As elsewhere, better piety gain if you endorsed them.
			if = {
				limit = { scope:ms_effect = flag:critical }
				add_piety = major_piety_gain
			}
			else = { add_piety = medium_piety_gain }
		}
	}

	#Surely that cannot *truly* have been the Allfather? [spoilers: it wasn't]
	option = {
		name = fp1_yearly.1011.a
		trigger = {
			OR = {
				mysterious_stranger_godi_same_faith_trigger = yes
				mysterious_stranger_godi_same_religion_trigger = yes
			}
		}

		#The godi vanishes.
		mysterious_stranger_disappears_effect = yes

		ai_chance = {
			#Only option.
			base = 100
		}
	}

	#Bastard!
	option = {
		name = fp1_yearly.1011.b
		trigger = {
			NOR = {
				mysterious_stranger_godi_same_faith_trigger = yes
				mysterious_stranger_godi_same_religion_trigger = yes
			}
		}

		#The godi vanishes.
		mysterious_stranger_disappears_effect = yes

		ai_chance = {
			#Only option.
			base = 100
		}
	}
}

#	Results: Reformed Missionary.
fp1_yearly.1012 = {
	type = character_event
	title = fp1_yearly.1012.t
	desc = {
		first_valid = {
			#Critical - different faith.
			triggered_desc = {
				trigger = {
					scope:ms_effect = flag:critical
					faith != scope:ms_faith
				}
				desc = fp1_yearly.1012.desc.different_faith.critical
			}
			#Standard - different faith.
			triggered_desc = {
				trigger = {
					scope:ms_effect = flag:standard
					faith != scope:ms_faith
				}
				desc = fp1_yearly.1012.desc.different_faith.standard
			}
			#Critical - same faith.
			triggered_desc = {
				trigger = {
					scope:ms_effect = flag:critical
					faith = scope:ms_faith
				}
				desc = fp1_yearly.1012.desc.same_faith.critical
			}
			#Standard - same faith (fallback).
			desc = fp1_yearly.1012.desc.same_faith.standard
		}
	}
	theme = intrigue
	left_portrait = {
		character = scope:stranger
		#The missionary is pleased if they share your faith.
		triggered_animation = {
			trigger = {
				root = { faith = scope:ms_faith }
			}
			animation = happiness
		}
		#Otherwise, they'll pray for you.
		triggered_animation = {
			trigger = {
				NOT = {
					root = { faith = scope:ms_faith }
				}
			}
			animation = personality_zealous
		}
	}
	override_background = { reference = bedchamber }

	immediate = {
		scope:stranger = {
			#Boost education by a step.
			##Ordered backwards so that they don't sequentially overwrite each other.
			if = {
				limit = { has_trait = education_learning_3 }
				hidden_effect = { remove_trait = education_learning_3 }
				add_trait = education_learning_4
			}
			if = {
				limit = { has_trait = education_learning_2 }
				hidden_effect = { remove_trait = education_learning_2 }
				add_trait = education_learning_3
			}
			if = {
				limit = { has_trait = education_learning_1 }
				hidden_effect = { remove_trait = education_learning_1 }
				add_trait = education_learning_2
			}
			#Boost stats.
			add_diplomacy_skill = { 5 10 }
			add_martial_skill = { 5 10 }
			add_stewardship_skill = { 3 8 }
			add_intrigue_skill = { 5 10 }
			add_learning_skill = { 10 15 }
			add_prowess_skill = { 5 10 }
			add_trait = theologian
			#Change faith.
			hidden_effect = { set_character_faith = scope:ms_faith }
			#If scope:stranger's faith allows monks, make them a monk.
			if = {
				limit = {
					faith = { has_doctrine_parameter = take_vows_active }
				}
				add_trait = devoted
				#Huahua! Don't you see, they were wearing a toupee the whole time!
			}
			#Reveal the missionary's true stats.
			hidden_effect = { force_character_skill_recalculation = yes }
		}
		#Organise a list of courtiers who might be affected for conversion.
		mysterious_stranger_different_religion_convert_courtiers_effect = yes
		#The missionary does not share your faith.
		if = {
			limit = {
				faith != scope:ms_faith
			}
			#They convert a bunch of your courtiers.
			every_in_list = {
				list = possible_converts_specific_list
				custom = fp1_yearly.1012.possible_converts_specific_list
				set_character_faith = scope:ms_faith
			}
			#You also lose some piety, or realm priest opinion if appropriate. Amount depends on whether you endorsed the missionary or not.
			if = {
				limit = { scope:ms_effect = flag:critical }
				if = {
					limit = {
						faith = { has_doctrine = doctrine_theocracy_lay_clergy }
						#Double-check that they actually have a realm priest at the moment.
						any_learning_councillor = { exists = this }
					}
					add_piety = medium_piety_loss
					every_learning_councillor = {
						add_opinion = {
							target = root
							modifier = fp1_honoured_heathen_opinion
						}
					}
				}
				else = { add_piety = major_piety_loss }
			}
			else = { add_piety = medium_piety_loss }
		}
		#Otherwise, the missionary has the same faith as you.
		else = {
			#If endorsed, they offers you a hook on & opinion with your realm priest (assuming such is valid).
			if = {
				limit = {
					scope:ms_effect = flag:critical
					faith = { has_doctrine = doctrine_theocracy_lay_clergy }
					#Double-check that you actually have a realm priest, and that a weak hook can be added.
					any_learning_councillor = {
						exists = this
						save_temporary_scope_as = learning_councillor
						root = {
							can_add_hook = {
								type = favor_hook
								target = scope:learning_councillor
							}
						}
					}
				}
				random_learning_councillor = {
					limit = {
						can_add_hook = {
							type = favor_hook
							target = root
						}
					}
					save_temporary_scope_as = learning_councillor
					root = {
						add_hook = {
							type = favor_hook
							target = scope:learning_councillor
						}
					}
					add_opinion = {
						target = root
						modifier = impressed_opinion
						opinion = 30
					}
				}
				add_piety = medium_piety_gain
			}
			#Otherwise, they just offers you more piety when endorsed.
			else_if = {
				limit = { scope:ms_effect = flag:critical }
				add_piety = major_piety_gain
			}
			#Otherwise, you just get a bit of piety.
			else = { add_piety = medium_piety_gain }
		}
	}

	#Different faith: they offer to convert you, you accept.
	option = {
		name = fp1_yearly.1012.a
		trigger = {
			faith != scope:ms_faith
			#Block the AI from making stupid conversions.
			OR = {
				is_ai = no
				AND = {
					scope:ms_faith.fervor >= 30
					OR = {
						AND = {
							faith.fervor <= 25
							has_trait = cynical
						}
						AND = {
							faith.fervor <= 15
							NOT = { has_trait = zealous }
						}
						faith.fervor <= 5
					}
				}
			}
		}

		#Perform the conversion.
		set_character_faith_with_conversion = scope:ms_faith
		if = {
			limit = { 
				scope:ms_faith = { has_doctrine = doctrine_monotheist }
			}
			custom_description_no_bullet = { text = mandala_monotheist_warning_tt }
		}

		#Recoup lost piety, and get paid a little extra.
		custom_tooltip = fp1_yearly.1012.a.recoup_lost_piety.tt
		hidden_effect = {
			if = {
				limit = { scope:ms_effect = flag:critical }
				add_piety_no_experience = major_piety_gain
				#^Technically, you gain a little extra here if you have a theocratic faith, but adding another scripted trigger in just these two spots would make the event very hard to read.
			}
			else = { add_piety_no_experience = medium_piety_gain }
		}
		if = {
			limit = { scope:ms_effect = flag:critical }
			add_piety = medium_piety_gain
		}
		else = { add_piety = minor_piety_gain }

		stress_impact = {
			cynical = minor_stress_impact_loss
			zealous = major_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_zeal = -0.5
			}
			modifier = {	#Weight up for stress.
				add = 10
				has_trait = cynical
			}
			modifier = {	#Weight down for stress.
				add = -30
				has_trait = zealous
			}
		}
	}

	#Different faith: they offer to convert you, you turn them down, they leave.
	option = {
		name = fp1_yearly.1012.b
		trigger = {
			faith != scope:ms_faith
		}

		#The missionary vanishes.
		mysterious_stranger_disappears_effect = yes

		stress_impact = {
			forgiving = minor_stress_impact_loss
			cynical = minor_stress_impact_loss
			vengeful = minor_stress_impact_gain
			zealous = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_zeal = -0.5
				ai_vengefulness = -0.25
			}
			modifier = {	#Weight up for stress.
				add = 10
				has_trait = forgiving
			}
			modifier = {	#Weight up for stress.
				add = 10
				has_trait = cynical
			}
			modifier = {	#Weight down for stress.
				add = -10
				has_trait = vengeful
			}
			modifier = {	#Weight down for stress.
				add = -10
				has_trait = zealous
			}
		}
	}

	#Different faith: they offer to convert you, you have them tossed in the dungeon.
	option = {
		name = fp1_yearly.1012.c
		trigger = {
			faith != scope:ms_faith
		}

		imprison = {
			target = scope:stranger
			type = dungeon
		}

		stress_impact = {
			vengeful = minor_stress_impact_loss
			zealous = medium_stress_impact_loss
			forgiving = minor_stress_impact_gain
			cynical = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_zeal = 0.25
				ai_vengefulness = 0.5
			}
			modifier = {	#Weight up for stress.
				add = 10
				has_trait = vengeful
			}
			modifier = {	#Weight up for stress.
				add = 20
				has_trait = zealous
			}
			modifier = {	#Weight down for stress.
				add = -10
				has_trait = forgiving
			}
			modifier = {	#Weight down for stress.
				add = -20
				has_trait = cynical
			}
		}
	}

	#Same faith: offers to stay, you accept.
	option = {
		name = fp1_yearly.1012.d
		trigger = { faith = scope:ms_faith }

		#Add the (rather chuffed) courtier to your court.
		add_courtier = scope:stranger
		reverse_add_opinion = {
			target = scope:stranger
			modifier = pleased_opinion
			opinion = 30
		}

		stress_impact = {
			trusting = minor_stress_impact_loss
			gregarious = minor_stress_impact_loss
			paranoid = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_sociability = 0.5
				ai_zeal = 0.25
			}
			modifier = {	#Weight up for stress.
				add = 10
				has_trait = trusting
			}
			modifier = {	#Weight up for stress.
				add = 10
				has_trait = gregarious
			}
			modifier = {	#Weight down for stress.
				add = -10
				has_trait = paranoid
			}
		}
	}

	#Same faith: offers to stay, you decline.
	option = {
		name = fp1_yearly.1012.e
		trigger = { faith = scope:ms_faith}

		#The missionary vanishes.
		mysterious_stranger_disappears_effect = yes

		stress_impact = {
			paranoid = medium_stress_impact_loss
			gregarious = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_sociability = -0.25
				ai_rationality = -0.25
			}
			modifier = {	#Weight up for stress.
				add = 20
				has_trait = paranoid
			}
			modifier = {	#Weight down for stress.
				add = -10
				has_trait = gregarious
			}
		}
	}
}

#	Results: Nithing.
fp1_yearly.1013 = {
	type = character_event
	title = fp1_yearly.1013.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = { scope:ms_effect = flag:critical }
				desc = fp1_yearly.1013.desc.critical
			}
			desc = fp1_yearly.1013.desc.standard
		}
		first_valid = {
			triggered_desc = {
				trigger = {
					scope:stranger = { has_trait = sodomite }
				}
				desc = fp1_yearly.1013.desc.outro.sodomite
			}
			desc = fp1_yearly.1013.desc.outro
		}
	}
	theme = intrigue
	left_portrait = {
		character = scope:stranger
		triggered_animation = {
			trigger = {
				scope:stranger = { has_trait = sodomite }
			}
			animation = stress
		}
		triggered_animation = {
			trigger = {
				NOT = {
					scope:stranger = { has_trait = sodomite }
				}
			}
			animation = schadenfreude
		}
	}
	override_background = { reference = study }

	immediate = {
		scope:stranger = {
			#Boost education by two steps.
			if = {
				limit = { has_trait = education_martial_1 }
				hidden_effect = { remove_trait = education_martial_1 }
				add_trait = education_martial_3
			}
			if = {
				limit = { has_trait = education_intrigue_1 }
				hidden_effect = { remove_trait = education_intrigue_1 }
				add_trait = education_intrigue_3
			}
			#Boost stats.
			add_diplomacy_skill = { 3 5 }
			add_martial_skill = { 8 12 }
			add_stewardship_skill = { 3 5 }
			add_intrigue_skill = { 8 12 }
			add_learning_skill = { 3 5 }
			add_prowess_skill = { 5 10 }
			#Add nithing things.
			nithing_character_creation_scripted_effect = yes
			#Give them a suitable crime.
			random_list = {
				65 = { add_trait = murderer }
				25 = {
					trigger = {
						faith = { has_doctrine_parameter = witchcraft_illegal }
					}
					add_trait = witch
				}
				10 = {
					trigger = {
						is_male = yes
						faith = { has_doctrine = doctrine_homosexuality_crime }
					}
					add_trait = sodomite
				}
			}
			#Reveal the nithing's true stats.
			hidden_effect = { force_character_skill_recalculation = yes }
		}
		#The nithing robs you, with a harsher effect if you endorsed them!
		if = {
			limit = { scope:ms_effect = flag:critical }
			save_scope_value_as = {
				name = nithing_stolen_loot
				value = massive_gold_value
			}
		}
		else = {
			save_scope_value_as = {
				name = nithing_stolen_loot
				value = major_gold_value
			}
		}
		remove_short_term_gold = scope:nithing_stolen_loot
	}

	#Curses!
	option = {
		name = {
			trigger = {
				NOT = {
					scope:stranger = { has_trait = sodomite }
				}
			}
			text = fp1_yearly.1013.a
		}
		name = {
			trigger = {
				scope:stranger = { has_trait = sodomite }
			}
			text = fp1_yearly.1013.a.sodomite
		}

		#The nithing vanishes.
		mysterious_stranger_disappears_effect = yes

		#No stress: the player has just eaten a nasty result.
		ai_chance = {
			#Only option.
			base = 100
		}
	}

	#I will not rest till that nithing is found! (rage outlet for angry players)
	option = {
		name = fp1_yearly.1013.b
		trigger = { is_ai = no }

		#Make the nithing a wanted individual.
		scope:stranger = {
			#The nithing runs for it.
			hidden_effect = {
				move_to_pool = yes
				# And give them their ill-gotten earnings.
				## We do this here so that their dying doesn't just give you or anyone else the cash back otherwise.
				add_gold = scope:nithing_stolen_loot
			}
			#But they've made a powerful enemy!
			set_relation_rival = {
				target = root
				reason = rival_nithing
			}
		}


		stress_impact = {
			#Minor penalty for RP reasons: we've already given the player a hefty negative, no need to pile on.
			forgiving = minor_stress_impact_loss
			vengeful = major_stress_impact_loss
		}
		ai_chance = {
			#Irrelevant option.
			base = 100
		}
	}
}

#	Results: Warrior.
fp1_yearly.1014 = {
	type = character_event
	title = fp1_yearly.1014.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = { scope:ms_effect = flag:critical }
				desc = fp1_yearly.1014.desc.critical
			}
			desc = fp1_yearly.1014.desc.standard
		}
		desc = fp1_yearly.1014.desc.outro
	}
	theme = intrigue
	left_portrait = {
		character = scope:stranger
		animation = personality_bold
	}
	override_background = { reference = corridor_night }

	immediate = {
		#If they were endorsed, the warrior gets better stats than they would otherwise.
		if = {
			limit = { scope:ms_effect = flag:critical }
			scope:stranger = {
				#Boost education by two steps.
				if = {
					limit = { has_trait = education_martial_1 }
					hidden_effect = { remove_trait = education_martial_1 }
					add_trait = education_martial_3
				}
				if = {
					limit = { has_trait = education_intrigue_1 }
					hidden_effect = { remove_trait = education_intrigue_1 }
					add_trait = education_intrigue_3
				}
				#Boost stats.
				add_diplomacy_skill = { 3 5 }
				add_martial_skill = { 10 12 }
				add_stewardship_skill = { 3 5 }
				add_intrigue_skill = { 3 5 }
				add_learning_skill = { 3 5 }
				add_prowess_skill = { 14 18 }
				#Give him a reputation.
				add_prestige_level = 2
				#Slight chance to add an additional trait or two.
				random_list = {
					25 = {
						trigger = { exists = title:e_byzantium.holder }
						add_trait = varangian
					}
					25 = { add_trait = berserker }
					25 = { add_trait = physique_good_2 }
					25 = {
						add_trait = lifestyle_blademaster
						add_trait_xp = {
			                trait = lifestyle_blademaster
			                value = {
			                    integer_range = {
			                        min = medium_lifestyle_random_xp_low
			                        max = medium_lifestyle_random_xp_high
								}
			                }
			            }
			        }
				}
				#Reveal the warrior's true stats.
				hidden_effect = { force_character_skill_recalculation = yes }
			}
		}
		else = {
			scope:stranger = {
				#Boost education by one step.
				if = {
					limit = { has_trait = education_martial_1 }
					hidden_effect = { remove_trait = education_martial_1 }
					add_trait = education_martial_2
				}
				if = {
					limit = { has_trait = education_intrigue_1 }
					hidden_effect = { remove_trait = education_intrigue_1 }
					add_trait = education_intrigue_2
				}
				#Boost stats.
				add_diplomacy_skill = { 3 5 }
				add_martial_skill = { 5 10 }
				add_stewardship_skill = { 3 5 }
				add_intrigue_skill = { 3 5 }
				add_learning_skill = { 3 5 }
				add_prowess_skill = { 8 12 }
				#Slight chance to add an additional trait or two.
				random_list = {
					50 = {}
					12 = {
						trigger = { exists = title:e_byzantium.holder }
						add_trait = varangian
					}
					12 = { add_trait = berserker }
					12 = { add_trait = physique_good_1 }
					14 = {
						add_trait = lifestyle_blademaster
						add_trait_xp = {
			                trait = lifestyle_blademaster
			                value = {
			                    integer_range = {
			                        min = small_lifestyle_random_xp_low
			                        max = small_lifestyle_random_xp_high
								}
			                }
			            }
					}
				}
				#Reveal the warrior's true stats.
				hidden_effect = { force_character_skill_recalculation = yes }
			}
		}
	}

	#I'll certainly hire you!
	option = {
		name = fp1_yearly.1014.a

		#Gain the warrior, who is also pretty happy to be here.
		add_courtier = scope:stranger
		reverse_add_opinion = {
			target = scope:stranger
			modifier = loyal_servant
		}

		#And pay the price.
		if = {
			limit = { scope:ms_effect = flag:critical }
			remove_short_term_gold = medium_gold_value
		}
		else = { remove_short_term_gold = minor_gold_value }

		stress_impact = {
			gregarious = minor_stress_impact_loss
			greedy = medium_stress_impact_gain
		}
		ai_chance = {
			#Always a no if the AI can't afford the warrior.
			base = -1000
			ai_value_modifier = {
				ai_sociability = 0.5
				ai_greed = -0.5
			}
			#Enable option for the AI if they've the gold to spare.
			modifier = {
				add = 1000
				scope:ms_effect = flag:critical
				short_term_gold >= medium_gold_value
			}
			modifier = {
				add = 1000
				scope:ms_effect = flag:standard
				short_term_gold >= minor_gold_value
			}
			modifier = {	#Weight up for stress.
				add = 10
				has_trait = gregarious
			}
			modifier = {	#Weight down for stress.
				add = -20
				has_trait = greedy
			}
		}
	}

	#Pass. Move along, Conan.
	option = {
		name = fp1_yearly.1014.b

		#The warrior vanishes.
		mysterious_stranger_disappears_effect = yes

		#Have some mild consolation prestige
		add_prestige = minor_prestige_gain

		stress_impact = {
			greedy = minor_stress_impact_loss
			gregarious = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_greed = 0.5
				ai_sociability = -0.5
			}
			modifier = {	#Weight up for stress.
				add = 10
				has_trait = greedy
			}
			modifier = {	#Weight down for stress.
				add = -10
				has_trait = gregarious
			}
		}
	}
}

#	Results: Vagrant.
fp1_yearly.1015 = {
	type = character_event
	title = fp1_yearly.1015.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = { scope:ms_effect = flag:critical }
				desc = fp1_yearly.1015.desc.critical
			}
			desc = fp1_yearly.1015.desc.standard
		}
		desc = fp1_yearly.1015.desc.outro
	}
	theme = intrigue
	#The vagrant's reaction varies a bit depending on your treatment of them.
	left_portrait = {
		character = scope:stranger
		triggered_animation = {
			trigger = { scope:ms_effect = flag:critical }
			animation = ecstasy
		}
		triggered_animation = {
			trigger = { scope:ms_effect = flag:standard }
			animation = happiness
		}
	}
	override_background = { reference = corridor_night }

	immediate = {
		#Vagrants get no stat reveal, as they genuinely suck.
		#Lose a bit of prestige for letting them hang around so long, losing more if you endorsed them.
		if = {
			limit = { scope:ms_effect = flag:critical }
			add_prestige = medium_prestige_loss
		}
		else = { add_prestige = minor_prestige_loss }
	}

	#Eh, I guess you can stay here.
	option = {
		name = fp1_yearly.1015.a

		#You gain the vagrant as a courtier
		add_courtier = scope:stranger
		#And a hook on them: weak if you didn't endorse them, strong if you did.
		if = {
			limit = { scope:ms_effect = flag:critical }
			add_hook = {
				type = loyalty_hook
				target = scope:stranger
			}
		}
		else = {
			add_hook = {
				type = favor_hook
				target = scope:stranger
				years = 50	#You did literally scoop them up off the streets. They won't soon forget that.
			}
		}
		#Either way, they think more of you for it.
		reverse_add_opinion = {
			target = scope:stranger
			modifier = loyal_servant
		}

		stress_impact = {
			gregarious = minor_stress_impact_loss
			humble = medium_stress_impact_loss
			shy = minor_stress_impact_gain
			arrogant = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_sociability = 0.5
				ai_compassion = 0.25
			}
			modifier = {	#Weight up for stress.
				add = 10
				has_trait = gregarious
			}
			modifier = {	#Weight up for stress.
				add = 20
				has_trait = humble
			}
			modifier = {	#Weight down for stress.
				add = -10
				has_trait = shy
			}
			modifier = {	#Weight down for stress.
				add = -20
				has_trait = arrogant
			}
		}
	}

	#What?! Get out!
	option = {
		name = fp1_yearly.1015.b

		#The vagrant vanishes.
		mysterious_stranger_disappears_effect = yes

		stress_impact = {
			shy = minor_stress_impact_loss
			arrogant = medium_stress_impact_loss
			gregarious = minor_stress_impact_gain
			humble = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_sociability = -0.5
				ai_compassion = -0.25
			}
			modifier = {	#Weight up for stress.
				add = 10
				has_trait = shy
			}
			modifier = {	#Weight up for stress.
				add = 20
				has_trait = arrogant
			}
			modifier = {	#Weight down for stress.
				add = -10
				has_trait = gregarious
			}
			modifier = {	#Weight down for stress.
				add = -20
				has_trait = humble
			}
		}
	}
}

# Big RIP to fp1_yearly.1031 through fp1_yearly.1061: it would have been the greatest and bestest event chain ever, but alas, it has been cut, and now no one shall know of its grandeur. It was too beautiful for this world.

##################################################
# Commissioning a Longship for a Funeral
# by Ewan Cowhig Croft
# 1061 - 1070
##################################################

scripted_trigger fp1_funeral_longship_generic_mourner_trigger = {
	is_landed = yes
	is_available_even_at_war_adult = yes
	NOT = { has_character_flag = had_event_fp1_yearly_1062 }
	faith = root.faith
	NOR = {
		any_relation = {
			type = rival
			this = root
		}
		AND = {
			is_ai = yes
			opinion = {
				target = root
				value >= low_negative_opinion
			}
		}
	}
}

scripted_trigger fp1_funeral_longship_likes_parties = {
	has_trait = lifestyle_reveler
	has_trait_xp = {
		trait = lifestyle_reveler
		value >= 100
	}
	# Faith must not consider this a bad thing.
	faith = {
		NOT = { trait_is_virtue = shy }
	}
}

scripted_trigger fp1_funeral_longship_likes_duels = {
	has_trait = lifestyle_blademaster
	has_trait_xp = {
		trait = lifestyle_blademaster
		value >= 100
	}
	# Faith must not consider this a bad thing.
	faith = {
		NOT = { has_doctrine_parameter = holy_wars_forbidden }
	}
}

scripted_trigger fp1_funeral_longship_likes_hunting = {
	hunt_lifestyle_track_greater_equal_trigger = { TRACK = hunter GREATER_EQUAL = 100 }
	# Faith must not consider this a bad thing.
	faith = {
		NOT = { has_doctrine_parameter = holy_wars_forbidden }
	}
}

scripted_trigger fp1_funeral_longship_likes_magic = {
	has_trait = lifestyle_mystic
	has_trait_xp = {
		trait = lifestyle_mystic
		value >= 100
	}
	# Faith must consider this an actively good thing (since Norse paganism's complicated relationship with witchcraft _tended_ towards the negative).
	faith = { has_doctrine_parameter = witchcraft_accepted }
}


#	The family member is earmarked.
fp1_yearly.1061 = {
	hidden = yes

	trigger = {
		# DLC check.
		has_fp1_dlc_trigger = yes
		# Germanic faith.
		religion = religion:folkgerman_religion
		# Shouldn't ever happen, but just in case, exempt sky burials so that the character is never buried twice.
		NOR = {
			faith = { has_doctrine_parameter = sky_burials_active }
			has_dead_character_variable = body_has_been_disposed
		}
		# And we shouldn't really be erecting glorious mounds to long lives that were actually cut short too early.
		age >= 30
		# Must be significant in some way.
		OR = {
			highest_held_title_tier >= tier_duchy
			piety_level >= high_prestige_level
			prestige_level >= high_piety_level
			# Monarch of Parties.
			fp1_funeral_longship_likes_parties = yes
			# Monarch of Duels.
			fp1_funeral_longship_likes_duels = yes
			# Monarch of Hunting.
			fp1_funeral_longship_likes_hunting = yes
			# Monarch of Magic.
			fp1_funeral_longship_likes_magic = yes
		}
		# With a landed player heir of at least duchy tier, or close family, a soulmate, or best friend who's the same.
		OR = {
			player_heir ?= { fp1_funeral_longship_generic_mourner_trigger = yes }
			any_close_family_member = { fp1_funeral_longship_generic_mourner_trigger = yes }
			any_relation = {
				type = soulmate
				fp1_funeral_longship_generic_mourner_trigger = yes
			}
			any_relation = {
				type = best_friend
				fp1_funeral_longship_generic_mourner_trigger = yes
			}
		}
	}

	immediate = {
		save_scope_as = ship_funeral_candidate
		# Determine why they were a big deal.
		## First check their title tier.
		if = {
			limit = { highest_held_title_tier = tier_duchy }
			save_scope_value_as = {
				name = reason_title
				value = flag:duchy
			}
		}
		else_if = {
			limit = { highest_held_title_tier = tier_kingdom }
			save_scope_value_as = {
				name = reason_title
				value = flag:kingdom
			}
		}
		else_if = {
			limit = { highest_held_title_tier = tier_empire }
			save_scope_value_as = {
				name = reason_title
				value = flag:empire
			}
		}
		## Then look at their prestige/piety levels.
		if = {
			limit = { prestige_level = high_prestige_level }
			save_scope_value_as = {
				name = reason_prestige
				value = flag:high
			}
		}
		else_if = {
			limit = { prestige_level = very_high_prestige_level }
			save_scope_value_as = {
				name = reason_prestige
				value = flag:very_high
			}
		}
		else_if = {
			limit = { prestige_level >= max_prestige_level }
			save_scope_value_as = {
				name = reason_prestige
				value = flag:max
			}
		}
		if = {
			limit = { prestige_level = high_prestige_level }
			save_scope_value_as = {
				name = reason_piety
				value = flag:high
			}
		}
		else_if = {
			limit = { prestige_level = very_high_prestige_level }
			save_scope_value_as = {
				name = reason_piety
				value = flag:very_high
			}
		}
		else_if = {
			limit = { prestige_level >= max_prestige_level }
			save_scope_value_as = {
				name = reason_piety
				value = flag:max
			}
		}
		## And finally their aptness at certain lifestyles.
		### Partying.
		if = {
			limit = { fp1_funeral_longship_likes_parties = yes }
			save_scope_value_as = {
				name = reason_lifestyle_partying
				value = yes
			}
		}
		### Hunting.
		if = {
			limit = { fp1_funeral_longship_likes_duels = yes }
			save_scope_value_as = {
				name = reason_lifestyle_duelling
				value = yes
			}
		}
		### Duels.
		if = {
			limit = { fp1_funeral_longship_likes_hunting = yes }
			save_scope_value_as = {
				name = reason_lifestyle_hunting
				value = yes
			}
		}
		### Magic.
		if = {
			limit = { fp1_funeral_longship_likes_magic = yes }
			save_scope_value_as = {
				name = reason_lifestyle_magickerationing
				value = yes
			}
		}
		# Next, determine who gets to hold the funeral.
		## First, we compile a list.
		if = {
			limit = {
				player_heir ?= { fp1_funeral_longship_generic_mourner_trigger = yes }
			}
			player_heir = { add_to_list = potential_mourners_list }
		}
		every_close_family_member = {
			limit = { fp1_funeral_longship_generic_mourner_trigger = yes }
			add_to_list = potential_mourners_list
		}
		every_relation = {
			type = soulmate
			limit = { fp1_funeral_longship_generic_mourner_trigger = yes }
			add_to_list = potential_mourners_list
		}
		every_relation = {
			type = best_friend
			limit = { fp1_funeral_longship_generic_mourner_trigger = yes }
			add_to_list = potential_mourners_list
		}
		## Then, we grab the person in the list with the most direct connection, preferring player heirs, levelled relationships, then close family, in that order. Players get a generic boost up this list.
		ordered_in_list = {
			list = potential_mourners_list
			order_by = { value = fp1_funeral_longship_preferred_mourner_value }
			save_scope_as = mourner
		}
		# Finally, fire an event for scope:mourner to inform them that a ship burial is available.
		if = {
			limit = { exists = scope:mourner }
			scope:mourner = {
				# Set the used character flag here rather than later, so that scope:mourner doesn't queue up multiple ship funerals due to a wave of sudden bereavements.
				add_character_flag = {
					flag = had_event_fp1_yearly_1062
					days = 7300
				}
				trigger_event = {
					id = fp1_yearly.1062
					months = 2
				}
			}
		}
	}
}

#	Inform scope:mourner of a valid ship burial.
fp1_yearly.1062 = {
	type = character_event
	title = fp1_yearly.1062.t
	desc = fp1_yearly.1062.desc
	theme = death
	left_portrait = {
		character = scope:mourner
		animation = sadness
	}
	right_portrait = {
		character = scope:ship_funeral_candidate
		animation = personality_zealous
	}
	override_background = { reference = temple }

	trigger = {
		# DLC check.
		has_fp1_dlc_trigger = yes
		# Standard checks.
		is_available_even_at_war_adult = yes
		# Must still be the same faith as scope:ship_funeral_candidate, for ease of loc and such.
		faith = scope:ship_funeral_candidate.faith
		# Check that they haven't been buried already (e.g. via funeral activity)
		scope:ship_funeral_candidate = {
			NOT = { has_dead_character_variable = body_has_been_disposed }
		}
	}

	# A small stone ship.
	option = {
		name = fp1_yearly.1062.a
		trigger = {
			can_make_expensive_purchase_trigger = { PRICE = medium_gold_value }
		}

		# Remove the appropriate amount of coin.
		set_variable = {
			name = ship_burial_reimbursement
			value = medium_gold_value
		}
		remove_short_term_gold = medium_gold_value
		# Set up the ship burial type scope.
		save_scope_value_as = {
			name = burial_type
			value = flag:stone_small
		}
		# Inform & trigger next event.
		custom_tooltip = fp1_yearly.1062.a.tt
		trigger_event = {
			id = fp1_yearly.1063
			months = 2
		}

		stress_impact = {
			generous = minor_stress_impact_loss
			greedy = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_zeal = 0.25
				ai_greed = -0.25
				ai_boldness = -0.25
			}
			modifier = {	# Weight up for stress.
				add = 10
				has_trait = generous
			}
			modifier = {	# Weight down for stress.
				add = -10
				has_trait = greedy
			}
		}
	}

	# A grand stone ship.
	option = {
		name = fp1_yearly.1062.b
		trigger = {
			can_make_expensive_purchase_trigger = { PRICE = major_gold_value }
		}

		# Remove the appropriate amount of coin.
		set_variable = {
			name = ship_burial_reimbursement
			value = major_gold_value
		}
		remove_short_term_gold = major_gold_value
		# Set up the ship burial type scope.
		save_scope_value_as = {
			name = burial_type
			value = flag:stone_grand
		}
		# Inform & trigger next event.
		custom_tooltip = fp1_yearly.1062.a.tt
		trigger_event = {
			id = fp1_yearly.1063
			months = 2
		}

		stress_impact = {
			generous = medium_stress_impact_loss
			greedy = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 0.25
				ai_boldness = 0.25
				ai_zeal = 0.25
				ai_greed = -0.25
			}
			modifier = {	# Weight up for stress.
				add = 20
				has_trait = generous
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = greedy
			}
		}
	}

	# An purpose-built ornate grave ship.
	option = {
		name = fp1_yearly.1062.c
		trigger = {
			can_make_expensive_purchase_trigger = { PRICE = massive_gold_value }
		}

		# Remove the appropriate amount of coin.
		set_variable = {
			name = ship_burial_reimbursement
			value = massive_gold_value
		}
		remove_treasury_or_gold = massive_treasury_or_gold_value
		# Set up the ship burial type scope.
		save_scope_value_as = {
			name = burial_type
			value = flag:wooden_ornate
		}
		# Inform & trigger next event.
		custom_tooltip = fp1_yearly.1062.a.tt
		trigger_event = {
			id = fp1_yearly.1063
			months = 2
		}

		stress_impact = {
			generous = major_stress_impact_loss
			greedy = major_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_boldness = 0.5
				ai_zeal = 0.5
				ai_greed = -0.75
			}
			modifier = {	# Weight up for stress.
				add = 30
				has_trait = generous
			}
			modifier = {	# Weight down for stress.
				add = -30
				has_trait = greedy
			}
		}
	}

	# This is all *outrageously* expensive.
	option = {
		name = fp1_yearly.1062.d

		# Lose prestige if you're related to scope:ship_funeral_candidate.
		if = {
			limit = {
				OR = {
					scope:ship_funeral_candidate.dynasty = scope:mourner.dynasty
					scope:ship_funeral_candidate = { is_close_family_of = scope:mourner }
				}
			}
			add_prestige = medium_prestige_loss
			stress_impact = {
				greedy = medium_stress_impact_loss
				generous = medium_stress_impact_gain
			}
		}
		# Else, take a stress hit.
		else = {
			stress_impact = {
				base = medium_stress_gain
				greedy = medium_stress_impact_loss
				generous = medium_stress_impact_gain
			}
		}

		# Stress_impact handled in above if statements.
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_greed = 0.5
				ai_boldness = -0.25
				ai_zeal = -0.25
			}
			modifier = {	# Weight up for stress.
				add = 20
				has_trait = greedy
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = generous
			}
		}
	}
}

scripted_effect fp1_funeral_longship_clear_variables_effect = {
	remove_variable = candidate_achievement_count
	remove_variable = ship_burial_reimbursement
}

fp1_yearly.1063 = {
	type = character_event
	title = fp1_yearly.1063.t
	desc = {
		desc = fp1_yearly.1063.desc.intro
		# Notable features of scop:ship_burial_candidate block.
		## Single achievement.
		triggered_desc = {
			trigger = { var:candidate_achievement_count = 1 }
			desc = {
				desc = fp1_yearly.1063.desc.achievements.single.intro
				first_valid = {
					# Title tier.
					triggered_desc = {
						trigger = {
							exists = scope:reason_title
							scope:reason_title = flag:duchy
						}
						desc = fp1_yearly.1063.desc.achievements.title.duchy
					}
					triggered_desc = {
						trigger = {
							exists = scope:reason_title
							scope:reason_title = flag:kingdom
						}
						desc = fp1_yearly.1063.desc.achievements.title.kingdom
					}
					triggered_desc = {
						trigger = {
							exists = scope:reason_title
							scope:reason_title = flag:empire
						}
						desc = fp1_yearly.1063.desc.achievements.title.empire
					}
					# Prestige level.
					triggered_desc = {
						trigger = {
							exists = scope:reason_prestige
							scope:reason_prestige = flag:high
						}
						desc = fp1_yearly.1063.desc.achievements.prestige.high
					}
					triggered_desc = {
						trigger = {
							exists = scope:reason_prestige
							scope:reason_prestige = flag:very_high
						}
						desc = fp1_yearly.1063.desc.achievements.prestige.very_high
					}
					triggered_desc = {
						trigger = {
							exists = scope:reason_prestige
							scope:reason_prestige = flag:max
						}
						desc = fp1_yearly.1063.desc.achievements.prestige.max
					}
					# Piety level.
					triggered_desc = {
						trigger = {
							exists = scope:reason_piety
							scope:reason_piety = flag:high
						}
						desc = fp1_yearly.1063.desc.achievements.piety.high
					}
					triggered_desc = {
						trigger = {
							exists = scope:reason_piety
							scope:reason_piety = flag:very_high
						}
						desc = fp1_yearly.1063.desc.achievements.piety.very_high
					}
					triggered_desc = {
						trigger = {
							exists = scope:reason_piety
							scope:reason_piety = flag:max
						}
						desc = fp1_yearly.1063.desc.achievements.piety.max
					}
					# Lifestyles.
					triggered_desc = {
						trigger = { exists = scope:reason_lifestyle_partying }
						desc = fp1_yearly.1063.desc.achievements.lifestyles.partying
					}
					triggered_desc = {
						trigger = { exists = scope:reason_lifestyle_duelling }
						desc = fp1_yearly.1063.desc.achievements.lifestyles.duelling
					}
					triggered_desc = {
						trigger = { exists = scope:reason_lifestyle_hunting }
						desc = fp1_yearly.1063.desc.achievements.lifestyles.hunting
					}
					triggered_desc = {
						trigger = { exists = scope:reason_lifestyle_magickerationing }
						desc = fp1_yearly.1063.desc.achievements.lifestyles.magickerationing
					}
				}
				desc = fp1_yearly.1063.desc.achievements.single.outro
			}
		}
		## Two achievements.
		triggered_desc = {
			trigger = { var:candidate_achievement_count = 2 }
			desc = {
				desc = fp1_yearly.1063.desc.achievements.double.intro
				first_valid = {
					# Title tier.
					triggered_desc = {
						trigger = {
							exists = scope:reason_title
							scope:reason_title = flag:duchy
						}
						desc = fp1_yearly.1063.desc.achievements.title.duchy
					}
					triggered_desc = {
						trigger = {
							exists = scope:reason_title
							scope:reason_title = flag:kingdom
						}
						desc = fp1_yearly.1063.desc.achievements.title.kingdom
					}
					triggered_desc = {
						trigger = {
							exists = scope:reason_title
							scope:reason_title = flag:empire
						}
						desc = fp1_yearly.1063.desc.achievements.title.empire
					}
					# Prestige level.
					triggered_desc = {
						trigger = {
							exists = scope:reason_prestige
							scope:reason_prestige = flag:high
						}
						desc = fp1_yearly.1063.desc.achievements.prestige.high
					}
					triggered_desc = {
						trigger = {
							exists = scope:reason_prestige
							scope:reason_prestige = flag:very_high
						}
						desc = fp1_yearly.1063.desc.achievements.prestige.very_high
					}
					triggered_desc = {
						trigger = {
							exists = scope:reason_prestige
							scope:reason_prestige = flag:max
						}
						desc = fp1_yearly.1063.desc.achievements.prestige.max
					}
					# Piety level.
					triggered_desc = {
						trigger = {
							exists = scope:reason_piety
							scope:reason_piety = flag:high
						}
						desc = fp1_yearly.1063.desc.achievements.piety.high
					}
					triggered_desc = {
						trigger = {
							exists = scope:reason_piety
							scope:reason_piety = flag:very_high
						}
						desc = fp1_yearly.1063.desc.achievements.piety.very_high
					}
					triggered_desc = {
						trigger = {
							exists = scope:reason_piety
							scope:reason_piety = flag:max
						}
						desc = fp1_yearly.1063.desc.achievements.piety.max
					}
					# Lifestyles.
					triggered_desc = {
						trigger = { exists = scope:reason_lifestyle_partying }
						desc = fp1_yearly.1063.desc.achievements.lifestyles.partying
					}
					triggered_desc = {
						trigger = { exists = scope:reason_lifestyle_duelling }
						desc = fp1_yearly.1063.desc.achievements.lifestyles.duelling
					}
					triggered_desc = {
						trigger = { exists = scope:reason_lifestyle_hunting }
						desc = fp1_yearly.1063.desc.achievements.lifestyles.hunting
					}
					triggered_desc = {
						trigger = { exists = scope:reason_lifestyle_magickerationing }
						desc = fp1_yearly.1063.desc.achievements.lifestyles.magickerationing
					}
				}
				desc = fp1_yearly.1063.desc.achievements.double.connector
				first_valid = {
					# Title tier.
					triggered_desc = {
						trigger = {
							exists = scope:reason_title
							scope:reason_title = flag:duchy
							NOT = { scope:primary_reason = flag:reason_title }
						}
						desc = fp1_yearly.1063.desc.achievements.title.duchy
					}
					triggered_desc = {
						trigger = {
							exists = scope:reason_title
							scope:reason_title = flag:kingdom
							NOT = { scope:primary_reason = flag:reason_title }
						}
						desc = fp1_yearly.1063.desc.achievements.title.kingdom
					}
					triggered_desc = {
						trigger = {
							exists = scope:reason_title
							scope:reason_title = flag:empire
							NOT = { scope:primary_reason = flag:reason_title }
						}
						desc = fp1_yearly.1063.desc.achievements.title.empire
					}
					# Prestige level.
					triggered_desc = {
						trigger = {
							exists = scope:reason_prestige
							scope:reason_prestige = flag:high
							NOT = { scope:primary_reason = flag:reason_prestige }
						}
						desc = fp1_yearly.1063.desc.achievements.prestige.high
					}
					triggered_desc = {
						trigger = {
							exists = scope:reason_prestige
							scope:reason_prestige = flag:very_high
							NOT = { scope:primary_reason = flag:reason_prestige }
						}
						desc = fp1_yearly.1063.desc.achievements.prestige.very_high
					}
					triggered_desc = {
						trigger = {
							exists = scope:reason_prestige
							scope:reason_prestige = flag:max
							NOT = { scope:primary_reason = flag:reason_prestige }
						}
						desc = fp1_yearly.1063.desc.achievements.prestige.max
					}
					# Piety level.
					triggered_desc = {
						trigger = {
							exists = scope:reason_piety
							scope:reason_piety = flag:high
							NOT = { scope:primary_reason = flag:reason_piety }
						}
						desc = fp1_yearly.1063.desc.achievements.piety.high
					}
					triggered_desc = {
						trigger = {
							exists = scope:reason_piety
							scope:reason_piety = flag:very_high
							NOT = { scope:primary_reason = flag:reason_piety }
						}
						desc = fp1_yearly.1063.desc.achievements.piety.very_high
					}
					triggered_desc = {
						trigger = {
							exists = scope:reason_piety
							scope:reason_piety = flag:max
							NOT = { scope:primary_reason = flag:reason_piety }
						}
						desc = fp1_yearly.1063.desc.achievements.piety.max
					}
					# Lifestyles.
					triggered_desc = {
						trigger = {
							exists = scope:reason_lifestyle_partying
							NOT = { scope:primary_reason = flag:reason_partying }
						}
						desc = fp1_yearly.1063.desc.achievements.lifestyles.partying
					}
					triggered_desc = {
						trigger = {
							exists = scope:reason_lifestyle_duelling
							NOT = { scope:primary_reason = flag:reason_duelling }
						}
						desc = fp1_yearly.1063.desc.achievements.lifestyles.duelling
					}
					triggered_desc = {
						trigger = {
							exists = scope:reason_lifestyle_hunting
							NOT = { scope:primary_reason = flag:reason_hunting }
						}
						desc = fp1_yearly.1063.desc.achievements.lifestyles.hunting
					}
					triggered_desc = {
						trigger = {
							exists = scope:reason_lifestyle_magickerationing
							NOT = { scope:primary_reason = flag:reason_magickerationing }
						}
						desc = fp1_yearly.1063.desc.achievements.lifestyles.magickerationing
					}
				}
				desc = fp1_yearly.1063.desc.achievements.double.outro
			}
		}
		## Three or more achievements.
		triggered_desc = {
			trigger = { var:candidate_achievement_count >= 3 }
			desc = {
				desc = fp1_yearly.1063.desc.achievements.triple.intro
				first_valid = {
					# Title tier.
					triggered_desc = {
						trigger = {
							exists = scope:reason_title
							scope:reason_title = flag:duchy
						}
						desc = fp1_yearly.1063.desc.achievements.title.duchy
					}
					triggered_desc = {
						trigger = {
							exists = scope:reason_title
							scope:reason_title = flag:kingdom
						}
						desc = fp1_yearly.1063.desc.achievements.title.kingdom
					}
					triggered_desc = {
						trigger = {
							exists = scope:reason_title
							scope:reason_title = flag:empire
						}
						desc = fp1_yearly.1063.desc.achievements.title.empire
					}
					# Prestige level.
					triggered_desc = {
						trigger = {
							exists = scope:reason_prestige
							scope:reason_prestige = flag:high
						}
						desc = fp1_yearly.1063.desc.achievements.prestige.high
					}
					triggered_desc = {
						trigger = {
							exists = scope:reason_prestige
							scope:reason_prestige = flag:very_high
						}
						desc = fp1_yearly.1063.desc.achievements.prestige.very_high
					}
					triggered_desc = {
						trigger = {
							exists = scope:reason_prestige
							scope:reason_prestige = flag:max
						}
						desc = fp1_yearly.1063.desc.achievements.prestige.max
					}
					# Piety level.
					triggered_desc = {
						trigger = {
							exists = scope:reason_piety
							scope:reason_piety = flag:high
						}
						desc = fp1_yearly.1063.desc.achievements.piety.high
					}
					triggered_desc = {
						trigger = {
							exists = scope:reason_piety
							scope:reason_piety = flag:very_high
						}
						desc = fp1_yearly.1063.desc.achievements.piety.very_high
					}
					triggered_desc = {
						trigger = {
							exists = scope:reason_piety
							scope:reason_piety = flag:max
						}
						desc = fp1_yearly.1063.desc.achievements.piety.max
					}
					# Lifestyles.
					triggered_desc = {
						trigger = { exists = scope:reason_lifestyle_partying }
						desc = fp1_yearly.1063.desc.achievements.lifestyles.partying
					}
					triggered_desc = {
						trigger = { exists = scope:reason_lifestyle_duelling }
						desc = fp1_yearly.1063.desc.achievements.lifestyles.duelling
					}
					triggered_desc = {
						trigger = { exists = scope:reason_lifestyle_hunting }
						desc = fp1_yearly.1063.desc.achievements.lifestyles.hunting
					}
					triggered_desc = {
						trigger = { exists = scope:reason_lifestyle_magickerationing }
						desc = fp1_yearly.1063.desc.achievements.lifestyles.magickerationing
					}
				}
				first_valid = {
					# Title tier.
					triggered_desc = {
						trigger = {
							exists = scope:reason_title
							scope:reason_title = flag:duchy
							NOT = { scope:primary_reason = flag:reason_title }
						}
						desc = fp1_yearly.1063.desc.achievements.title.duchy
					}
					triggered_desc = {
						trigger = {
							exists = scope:reason_title
							scope:reason_title = flag:kingdom
							NOT = { scope:primary_reason = flag:reason_title }
						}
						desc = fp1_yearly.1063.desc.achievements.title.kingdom
					}
					triggered_desc = {
						trigger = {
							exists = scope:reason_title
							scope:reason_title = flag:empire
							NOT = { scope:primary_reason = flag:reason_title }
						}
						desc = fp1_yearly.1063.desc.achievements.title.empire
					}
					# Prestige level.
					triggered_desc = {
						trigger = {
							exists = scope:reason_prestige
							scope:reason_prestige = flag:high
							NOT = { scope:primary_reason = flag:reason_prestige }
						}
						desc = fp1_yearly.1063.desc.achievements.prestige.high
					}
					triggered_desc = {
						trigger = {
							exists = scope:reason_prestige
							scope:reason_prestige = flag:very_high
							NOT = { scope:primary_reason = flag:reason_prestige }
						}
						desc = fp1_yearly.1063.desc.achievements.prestige.very_high
					}
					triggered_desc = {
						trigger = {
							exists = scope:reason_prestige
							scope:reason_prestige = flag:max
							NOT = { scope:primary_reason = flag:reason_prestige }
						}
						desc = fp1_yearly.1063.desc.achievements.prestige.max
					}
					# Piety level.
					triggered_desc = {
						trigger = {
							exists = scope:reason_piety
							scope:reason_piety = flag:high
							NOT = { scope:primary_reason = flag:reason_piety }
						}
						desc = fp1_yearly.1063.desc.achievements.piety.high
					}
					triggered_desc = {
						trigger = {
							exists = scope:reason_piety
							scope:reason_piety = flag:very_high
							NOT = { scope:primary_reason = flag:reason_piety }
						}
						desc = fp1_yearly.1063.desc.achievements.piety.very_high
					}
					triggered_desc = {
						trigger = {
							exists = scope:reason_piety
							scope:reason_piety = flag:max
							NOT = { scope:primary_reason = flag:reason_piety }
						}
						desc = fp1_yearly.1063.desc.achievements.piety.max
					}
					# Lifestyles.
					triggered_desc = {
						trigger = {
							exists = scope:reason_lifestyle_partying
							NOT = { scope:primary_reason = flag:reason_partying }
						}
						desc = fp1_yearly.1063.desc.achievements.lifestyles.partying
					}
					triggered_desc = {
						trigger = {
							exists = scope:reason_lifestyle_duelling
							NOT = { scope:primary_reason = flag:reason_duelling }
						}
						desc = fp1_yearly.1063.desc.achievements.lifestyles.duelling
					}
					triggered_desc = {
						trigger = {
							exists = scope:reason_lifestyle_hunting
							NOT = { scope:primary_reason = flag:reason_hunting }
						}
						desc = fp1_yearly.1063.desc.achievements.lifestyles.hunting
					}
					triggered_desc = {
						trigger = {
							exists = scope:reason_lifestyle_magickerationing
							NOT = { scope:primary_reason = flag:reason_magickerationing }
						}
						desc = fp1_yearly.1063.desc.achievements.lifestyles.magickerationing
					}
				}
				desc = fp1_yearly.1063.desc.achievements.triple.connector
				first_valid = {
					# Title tier.
					triggered_desc = {
						trigger = {
							exists = scope:reason_title
							scope:reason_title = flag:duchy
							NOR = {
								scope:primary_reason = flag:reason_title
								scope:secondary_reason = flag:reason_title
							}
						}
						desc = fp1_yearly.1063.desc.achievements.title.duchy
					}
					triggered_desc = {
						trigger = {
							exists = scope:reason_title
							scope:reason_title = flag:kingdom
							NOR = {
								scope:primary_reason = flag:reason_title
								scope:secondary_reason = flag:reason_title
							}
						}
						desc = fp1_yearly.1063.desc.achievements.title.kingdom
					}
					triggered_desc = {
						trigger = {
							exists = scope:reason_title
							scope:reason_title = flag:empire
							NOR = {
								scope:primary_reason = flag:reason_title
								scope:secondary_reason = flag:reason_title
							}
						}
						desc = fp1_yearly.1063.desc.achievements.title.empire
					}
					# Prestige level.
					triggered_desc = {
						trigger = {
							exists = scope:reason_prestige
							scope:reason_prestige = flag:high
							NOR = {
								scope:primary_reason = flag:reason_prestige
								scope:secondary_reason = flag:reason_prestige
							}
						}
						desc = fp1_yearly.1063.desc.achievements.prestige.high
					}
					triggered_desc = {
						trigger = {
							exists = scope:reason_prestige
							scope:reason_prestige = flag:very_high
							NOR = {
								scope:primary_reason = flag:reason_prestige
								scope:secondary_reason = flag:reason_prestige
							}
						}
						desc = fp1_yearly.1063.desc.achievements.prestige.very_high
					}
					triggered_desc = {
						trigger = {
							exists = scope:reason_prestige
							scope:reason_prestige = flag:max
							NOR = {
								scope:primary_reason = flag:reason_prestige
								scope:secondary_reason = flag:reason_prestige
							}
						}
						desc = fp1_yearly.1063.desc.achievements.prestige.max
					}
					# Piety level.
					triggered_desc = {
						trigger = {
							exists = scope:reason_piety
							scope:reason_piety = flag:high
							NOR = {
								scope:primary_reason = flag:reason_piety
								scope:secondary_reason = flag:reason_piety
							}
						}
						desc = fp1_yearly.1063.desc.achievements.piety.high
					}
					triggered_desc = {
						trigger = {
							exists = scope:reason_piety
							scope:reason_piety = flag:very_high
							NOR = {
								scope:primary_reason = flag:reason_piety
								scope:secondary_reason = flag:reason_piety
							}
						}
						desc = fp1_yearly.1063.desc.achievements.piety.very_high
					}
					triggered_desc = {
						trigger = {
							exists = scope:reason_piety
							scope:reason_piety = flag:max
							NOR = {
								scope:primary_reason = flag:reason_piety
								scope:secondary_reason = flag:reason_piety
							}
						}
						desc = fp1_yearly.1063.desc.achievements.piety.max
					}
					# Lifestyles.
					triggered_desc = {
						trigger = {
							exists = scope:reason_lifestyle_partying
							NOR = {
								scope:primary_reason = flag:reason_partying
								scope:secondary_reason = flag:reason_partying
							}
						}
						desc = fp1_yearly.1063.desc.achievements.lifestyles.partying
					}
					triggered_desc = {
						trigger = {
							exists = scope:reason_lifestyle_duelling
							NOR = {
								scope:primary_reason = flag:reason_duelling
								scope:secondary_reason = flag:reason_duelling
							}
						}
						desc = fp1_yearly.1063.desc.achievements.lifestyles.duelling
					}
					triggered_desc = {
						trigger = {
							exists = scope:reason_lifestyle_hunting
							NOR = {
								scope:primary_reason = flag:reason_hunting
								scope:secondary_reason = flag:reason_hunting
							}
						}
						desc = fp1_yearly.1063.desc.achievements.lifestyles.hunting
					}
					triggered_desc = {
						trigger = {
							exists = scope:reason_lifestyle_magickerationing
							NOR = {
								scope:primary_reason = flag:reason_magickerationing
								scope:secondary_reason = flag:reason_magickerationing
							}
						}
						desc = fp1_yearly.1063.desc.achievements.lifestyles.magickerationing
					}
				}
				desc = fp1_yearly.1063.desc.achievements.triple.outro
			}
		}
		# Burial type block.
		## Small stone ship.
		triggered_desc = {
			trigger = { scope:burial_type = flag:stone_small }
			desc = fp1_yearly.1063.desc.ship_stone_small
		}
		## Grand stone ship.
		triggered_desc = {
			trigger = { scope:burial_type = flag:stone_grand }
			desc = fp1_yearly.1063.desc.ship_stone_grand
		}
		## Ornate wooden ship.
		triggered_desc = {
			trigger = { scope:burial_type = flag:wooden_ornate }
			desc = fp1_yearly.1063.desc.ship_wood_ornate
		}
		desc = fp1_yearly.1063.desc.outro
	}
	theme = death
	left_portrait = {
		character = scope:mourner
		animation = grief
	}
	right_portrait = {
		character = scope:ship_funeral_candidate
		animation = sadness
	}
	override_background = { reference = temple }

	trigger = {
		# DLC check.
		has_fp1_dlc_trigger = yes
		# Standard checks.
		is_available_even_at_war_adult = yes
		# Must still be the same faith as scope:ship_funeral_candidate, for ease of loc and such.
		faith = scope:ship_funeral_candidate.faith

		# Check that they haven't been buried already (e.g. via funeral activity)
		scope:ship_funeral_candidate = {
			NOT = { has_dead_character_variable = body_has_been_disposed }
		}
	}

	on_trigger_fail = {
		# Return invested monies.
		send_interface_toast = {
			title = fp1_yearly.1063.trigger_failure.tt
			left_icon = scope:ship_funeral_candidate
			add_gold = var:ship_burial_reimbursement
		}
		# Clear up variables.
		fp1_funeral_longship_clear_variables_effect = yes
	}

	immediate = {
		# Work out how many achievements scope:ship_funeral_candidate actually had.
		set_variable = {
			name = candidate_achievement_count
			value = 0
		}
		## First, tier.
		if = {
			limit = { exists = scope:reason_title }
			change_variable = {
				name = candidate_achievement_count
				add = 1
			}
		}
		## Then, prestige.
		if = {
			limit = { exists = scope:reason_prestige }
			change_variable = {
				name = candidate_achievement_count
				add = 1
			}
		}
		## Next, piety.
		if = {
			limit = { exists = scope:reason_piety }
			change_variable = {
				name = candidate_achievement_count
				add = 1
			}
		}
		## Finally, lifestyles.
		if = {
			limit = { exists = scope:reason_lifestyle_partying }
			change_variable = {
				name = candidate_achievement_count
				add = 1
			}
		}
		if = {
			limit = { exists = scope:reason_lifestyle_duelling }
			change_variable = {
				name = candidate_achievement_count
				add = 1
			}
		}
		if = {
			limit = { exists = scope:reason_lifestyle_hunting }
			change_variable = {
				name = candidate_achievement_count
				add = 1
			}
		}
		if = {
			limit = { exists = scope:reason_lifestyle_magickerationing }
			change_variable = {
				name = candidate_achievement_count
				add = 1
			}
		}
		# Flag reasons so that they don't repeat; due to variable issues, we just calc this every time.
		# Primary reason.
		## comment_folder = {
			# Cycle through tier.
			if = {
				limit = { exists = scope:reason_title }
				save_scope_value_as = {
					name = primary_reason
					value = flag:reason_title
				}
			}
			# Then prestige.
			else_if = {
				limit = { exists = scope:reason_prestige }
				save_scope_value_as = {
					name = primary_reason
					value = flag:reason_prestige
				}
			}
			# Piety.
			else_if = {
				limit = { exists = scope:reason_piety }
				save_scope_value_as = {
					name = primary_reason
					value = flag:reason_piety
				}
			}
			# And lifestyles.
			else_if = {
				limit = { exists = scope:reason_lifestyle_partying }
				save_scope_value_as = {
					name = primary_reason
					value = flag:reason_partying
				}
			}
			else_if = {
				limit = { exists = scope:reason_lifestyle_duelling }
				save_scope_value_as = {
					name = primary_reason
					value = flag:reason_duelling
				}
			}
			else_if = {
				limit = { exists = scope:reason_lifestyle_hunting }
				save_scope_value_as = {
					name = primary_reason
					value = flag:reason_hunting
				}
			}
			else_if = {
				limit = { exists = scope:reason_lifestyle_magickerationing }
				save_scope_value_as = {
					name = primary_reason
					value = flag:reason_magickerationing
				}
			}
		##}
		# Secondary reason.
		## Comment folder for easy organisation = {
			# Cycle through tier.
			if = {
				limit = {
					exists = scope:reason_title
					NOT = { scope:primary_reason = flag:reason_title }
				}
				save_scope_value_as = {
					name = secondary_reason
					value = flag:reason_title
				}
			}
			# Then prestige.
			else_if = {
				limit = {
					exists = scope:reason_prestige
					NOT = { scope:primary_reason = flag:reason_prestige }
				}
				save_scope_value_as = {
					name = secondary_reason
					value = flag:reason_prestige
				}
			}
			# Piety.
			else_if = {
				limit = {
					exists = scope:reason_piety
					NOT = { scope:primary_reason = flag:reason_piety }
				}
				save_scope_value_as = {
					name = secondary_reason
					value = flag:reason_piety
				}
			}
			# And lifestyles.
			else_if = {
				limit = {
					exists = scope:reason_lifestyle_partying
					NOT = { scope:primary_reason = flag:reason_partying }
				}
				save_scope_value_as = {
					name = secondary_reason
					value = flag:reason_partying
				}
			}
			else_if = {
				limit = {
					exists = scope:reason_lifestyle_duelling
					NOT = { scope:primary_reason = flag:reason_duelling }
				}
				save_scope_value_as = {
					name = secondary_reason
					value = flag:reason_duelling
				}
			}
			else_if = {
				limit = {
					exists = scope:reason_lifestyle_hunting
					NOT = { scope:primary_reason = flag:reason_hunting }
				}
				save_scope_value_as = {
					name = secondary_reason
					value = flag:reason_hunting
				}
			}
			else_if = {
				limit = {
					exists = scope:reason_lifestyle_magickerationing
					NOT = { scope:primary_reason = flag:reason_magickerationing }
				}
				save_scope_value_as = {
					name = secondary_reason
					value = flag:reason_magickerationing
				}
			}
		##}
		# If scope:ship_funeral_candidate is a hunter, set up a suitable place for them to have been hunting (for loc).
		scope:ship_funeral_candidate = {
			if = {
				limit = {
					hunt_lifestyle_track_greater_equal_trigger = { TRACK = hunter GREATER_EQUAL = 100 }
				}
				if = {
					limit = { highest_held_title_tier >= tier_county }
					primary_title = { save_scope_as = hunting_lands }
				}
				else = {
					scope:mourner.primary_title = { save_scope_as = hunting_lands }
				}
			}
		}
	}

	# Boats to boats, tumuli to tumuli.
	option = {
		name = fp1_yearly.1063.a

		# Small stone ships give a modest chunk.
		if = {
			limit = { scope:burial_type = flag:stone_small }
			add_prestige = minor_prestige_gain
		}
		# Grand stone ships give a decent chunk.
		if = {
			limit = { scope:burial_type = flag:stone_grand }
			add_prestige = medium_prestige_gain
		}
		# Ornate wooden ships give a large chunk.
		if = {
			limit = { scope:burial_type = flag:wooden_ornate }
			add_prestige = major_prestige_gain
		}
		# Stress relief is the same regardless of what level you opted for.
		add_stress = major_stress_loss

		# No extra stress impact for single-option events, usually.
		ai_chance = {
			# Only option.
			base = 100
		}
	}

	after = {
		scope:ship_funeral_candidate = {
			set_dead_character_variable = {
				name = body_has_been_disposed
				value = yes
				years = 5
			}
		}

		# Clear up remaining values on the character.
		fp1_funeral_longship_clear_variables_effect = yes
	}
}

##################################################
# Sparklingly Clean
# by Ewan Cowhig Croft
# 1071 - 1080
##################################################

#	You decide to put a little extra effort into your appearance.
fp1_yearly.1071 = {
	type = character_event
	title = fp1_yearly.1071.t
	desc = fp1_yearly.1071.desc
	theme = physical_health
	left_portrait = {
		character = root
		animation = happiness
	}
	override_background = { reference = bedchamber }

	trigger = {
		# DLC check.
		has_fp1_dlc_trigger = yes
		# Standard checks.
		is_available_at_peace_adult = yes
		is_healthy = yes
		NOT = { has_character_flag = had_event_fp1_yearly_1071 }
		is_landed = yes
		# Filter to flavour-appropriate characters.
		fp1_is_norse = yes
	}

	weight_multiplier = {
		base = 1

		# Weight up a bit for the healthy types.
		modifier = {
			add = 0.5
			has_trait = diligent
		}
		modifier = {
			add = 0.5
			has_trait = whole_of_body
		}
	}

	immediate = {
		add_character_flag = {
			flag = had_event_fp1_yearly_1071
			days = 3650
		}
	}

	# Hygiene is the key to a long life!
	option = {
		name = fp1_yearly.1071.a

		# Add a modifier boosting health.
		add_character_modifier = {
			modifier = fp1_bathing_health_modifier
			years = 10
		}

		stress_impact = {
			diligent = medium_stress_impact_loss
			lazy = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_energy = 0.75
				ai_sociability = 0.25
			}
			modifier = {	# Weight up for stress.
				add = 20
				has_trait = diligent
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = lazy
			}
		}
	}

	# I suppose I could take a little extra care...
	option = {
		name = fp1_yearly.1071.b

		# Add a modifier boosting attraction.
		add_character_modifier = {
			modifier = fp1_bathing_attraction_modifier
			years = 10
		}

		stress_impact = {
			diligent = medium_stress_impact_loss
			lazy = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_sociability = 0.75
				ai_energy = 0.25
			}
			modifier = {	# Weight up for stress.
				add = 20
				has_trait = diligent
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = lazy
			}
		}
	}

	# Just the usual is fine.
	option = {
		name = fp1_yearly.1071.c

		# Lose a bit of stress for taking it easy.
		## Stress loss handled in stress_impact.

		stress_impact = {
			base = medium_stress_loss
			lazy = medium_stress_impact_loss
			diligent = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_sociability = -0.1
				ai_energy = -0.5
			}
			modifier = {	# Weight up for stress.
				add = 20
				has_trait = lazy
			}
			modifier = {	# Weight down for stress.
				add = -20
				has_trait = diligent
			}
		}
	}
}

##################################################
# Explorer from Phantom Islands
# by Ewan Cowhig Croft
# 1081 - 1090
##################################################

#	An explorer of the Atlantic wishes to share their tales with you.
fp1_yearly.1081 = {
	type = character_event
	title = fp1_yearly.1081.t
	desc = {
		desc = fp1_yearly.1081.desc.intro
		first_valid = {
			triggered_desc = {
				trigger = { scope:phantom_island = flag:greenland }
				desc = fp1_yearly.1081.desc.greenland
			}
			triggered_desc = {
				trigger = { scope:phantom_island = flag:vinland }
				desc = fp1_yearly.1081.desc.vinland
			}
			triggered_desc = {
				trigger = { scope:phantom_island = flag:antilia }
				desc = fp1_yearly.1081.desc.antilia
			}
			triggered_desc = {
				trigger = {
					scope:phantom_island = flag:fortunate_isles
					religion = religion:theomach_religion
				}
				desc = fp1_yearly.1081.desc.fortunate_isles.hellenist
			}
			triggered_desc = {
				trigger = { scope:phantom_island = flag:fortunate_isles }
				desc = fp1_yearly.1081.desc.fortunate_isles.other
			}
			triggered_desc = {
				trigger = { scope:phantom_island = flag:st_brendans_island }
				desc = fp1_yearly.1081.desc.st_brendans_island
			}
			triggered_desc = {
				trigger = {
					scope:phantom_island = flag:isle_of_the_blessed
					OR = { religion = religion:eastern_orthodox_religion religion = religion:catholic_religion religion = religion:protestant_religion }
				}
				desc = fp1_yearly.1081.desc.isle_of_the_blessed.christian
			}
			triggered_desc = {
				trigger = { scope:phantom_island = flag:isle_of_the_blessed }
				desc = fp1_yearly.1081.desc.isle_of_the_blessed.other
			}
			triggered_desc = {
				trigger = { scope:phantom_island = flag:ard_majhulah }
				desc = fp1_yearly.1081.desc.ard_majhulah
			}
			triggered_desc = {
				trigger = { scope:phantom_island = flag:the_sticky_sea }
				desc = fp1_yearly.1081.desc.the_sticky_sea
			}
			triggered_desc = {
				trigger = { scope:phantom_island = flag:purple_islands }
				desc = fp1_yearly.1081.desc.purple_islands
			}
			triggered_desc = {
				trigger = { scope:phantom_island = flag:hy_brasil }
				desc = fp1_yearly.1081.desc.hy_brasil
			}
			triggered_desc = {
				trigger = { scope:phantom_island = flag:thule }
				desc = fp1_yearly.1081.desc.thule
			}
			triggered_desc = {
				trigger = {
					scope:phantom_island = flag:great_ireland
					religion = { is_in_family = rf_abrahamic }
				}
				desc = fp1_yearly.1081.desc.great_ireland.abrahamic
			}
			triggered_desc = {
				trigger = { scope:phantom_island = flag:great_ireland }
				desc = fp1_yearly.1081.desc.great_ireland.other
			}
			triggered_desc = {
				trigger = { scope:phantom_island = flag:sunset_empire }
				desc = fp1_yearly.1081.desc.sunset_empire
			}
		}
		desc = fp1_yearly.1081.desc.outro
	}
	theme = friendly
	left_portrait = {
		character = root
		animation = toast
		triggered_animation = {
			trigger = {
				scope:phantom_island = flag:sunset_empire 
				has_trait = craven
			}
			animation = fear
		}
	}
	right_portrait = {
		character = scope:norse_explorer
		animation = storyteller
	}
	override_background = { reference = study }

	trigger = {
		#DLC check.
		has_fp1_dlc_trigger = yes
		#No need for these character modifiers to appear in the wild and feel less unique.
		is_ai = no
		#Standard checks.
		is_available_even_at_war_adult = yes
		NOT = { has_character_flag = had_event_fp1_yearly_1081 }
		#Must be North Germanic.
		culture = { has_cultural_pillar = heritage_north_germanic }
		#Has to keep their capital in general Scandinavian core sphere of influence.
		capital_province = {
			OR = {
				geographical_region = world_europe_west
				geographical_region = world_europe_north
				geographical_region = world_europe_east
			}
		}
		#The Norse must still be in their hyper-exploratory phase.
		NOT = {
			culture = { has_cultural_era_or_later = culture_era_high_medieval }
		}
	}

	weight_multiplier = {
		base = 1

		#Learned characters attract people with curious stories.
		modifier = {
			add = 1
			has_trait = scholar
		}
		modifier = {
			add = 1
			learning >= very_high_skill_rating
		}
	}

	immediate = {
		#Once per lifetime.
		add_character_flag = { flag = had_event_fp1_yearly_1081 }
		#Select which phantom island we're looking at!
		##12 items with an 8.3% chance each to be selected, with the remaining 0.4% going to the thirteenth item: Sunset Invasion.
		random_list = {
			#Greenland
			83 = {
				save_scope_value_as = {
					name = phantom_island
					value = flag:greenland
				}
			}
			#Vinland
			83 = {
				save_scope_value_as = {
					name = phantom_island
					value = flag:vinland
				}
			}
			#Antilia
			83 = {
				save_scope_value_as = {
					name = phantom_island
					value = flag:antilia
				}
				#If Portugal exists, then obviously they were time-travelling Portuguese.
				if = {
					limit = {
						always = yes
					}
					culture:portuguese = { save_scope_as = antilia_culture }
				}
				#If Galician exists, they must have been from Galicia!
				else_if = {
					limit = { has_global_variable = visigothic_culture_split }
					culture:galician = { save_scope_as = antilia_culture }
				}
				#Otherwise, bog-standard Visigoths.
				else = {
					culture:visigothic = { save_scope_as = antilia_culture }
				}
			}
			#Fortunate Isles
			83 = {
				save_scope_value_as = {
					name = phantom_island
					value = flag:fortunate_isles
				}
			}
			#St. Brendan's Island
			83 = {
				save_scope_value_as = {
					name = phantom_island
					value = flag:st_brendans_island
				}
			}
			#Isle of the Blessed
			83 = {
				save_scope_value_as = {
					name = phantom_island
					value = flag:isle_of_the_blessed
				}
			}
			#Ard Majhūlah
			83 = {
				save_scope_value_as = {
					name = phantom_island
					value = flag:ard_majhulah
				}
			}
			#The Sticky Sea
			83 = {
				save_scope_value_as = {
					name = phantom_island
					value = flag:the_sticky_sea
				}
			}
			#Purple Islands
			83 = {
				save_scope_value_as = {
					name = phantom_island
					value = flag:purple_islands
				}
			}
			#Hy Brasil
			83 = {
				save_scope_value_as = {
					name = phantom_island
					value = flag:hy_brasil
				}
			}
			#Thule
			83 = {
				save_scope_value_as = {
					name = phantom_island
					value = flag:thule
				}
			}
			#Great Ireland
			83 = {
				save_scope_value_as = {
					name = phantom_island
					value = flag:great_ireland
				}
			}
			#Sunset Empire
			4 = {
				save_scope_value_as = {
					name = phantom_island
					value = flag:sunset_empire
				}
			}
		}
		#Create an explorer, selecting an appropriate template according to whether or not their story is truthful.
		if = {
			limit = {
				OR = {
					scope:phantom_island = flag:greenland
					scope:phantom_island = flag:purple_islands
					scope:phantom_island = flag:sunset_empire	#Mostly here just to freak people out for funsies.
				}
				#Technically, Vinland & the Sargasso Sea are real locations as well, but our loc clearly indicates that the explorer has never been there, and is repeating second-hand tales at best.
			}
			create_character = {
				location = root.capital_province
				template = fp1_truthful_explorer_character
				save_scope_as = norse_explorer
			}
		}
		else = {
			create_character = {
				location = root.capital_province
				template = fp1_deceitful_explorer_character
				save_scope_as = norse_explorer
			}
		}
	}

	#Memorise the interesting trivia.
	option = {
		name = fp1_yearly.1081.a

		#Nice little diplo modifier.
		add_character_modifier = {
			modifier = phantom_island_trivia_fp1_modifier
			years = 20
		}

		stress_impact = {
			humble = minor_stress_impact_loss
			arrogant = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = 0.25
				ai_boldness = -0.25
			}
			modifier = {	#Weight up for stress.
				add = 10
				has_trait = humble
			}
			modifier = {	#Weight down for stress.
				add = -10
				has_trait = arrogant
			}
		}
	}

	#Poke holes in the story.
	option = {
		name = fp1_yearly.1081.b

		#Nice little intrigue modifier.
		add_character_modifier = {
			modifier = phantom_island_critique_fp1_modifier
			years = 20
		}

		stress_impact = {
			paranoid = minor_stress_impact_loss
			trusting = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 0.25
				ai_compassion = -0.25
			}
			modifier = {	#Weight up for stress.
				add = 10
				has_trait = paranoid
			}
			modifier = {	#Weight down for stress.
				add = -10
				has_trait = trusting
			}
		}
	}

	#Wish them well and on their way.
	option = {
		name = {
			trigger = {
				NOT = { scope:phantom_island = flag:sunset_empire }
			}
			text = fp1_yearly.1081.c
		}
		name = {
			trigger = { scope:phantom_island = flag:sunset_empire }
			text = fp1_yearly.1081.c.sunset_empire
		}

		# Assuming you don't have Aztecs, then get a solid bit of stress relief.
		if = {
			limit = {
				NOT = { scope:phantom_island = flag:sunset_empire }
			}
			stress_impact = {
				base = major_stress_loss
				trusting = minor_stress_impact_loss
				paranoid = minor_stress_impact_gain
			}
		}
		# Otherwise...
		else = {
			stress_impact = {
				base = major_stress_gain
				trusting = minor_stress_impact_loss
				paranoid = minor_stress_impact_gain
			}
		}

		# Stress impact handled in above if blocks.
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = 0.25
				ai_energy = -0.25
			}
			modifier = {	#Weight up for stress.
				add = 10
				has_trait = trusting
			}
			modifier = {	#Weight down for stress.
				add = -10
				has_trait = paranoid
			}
		}
	}

	after = {
		#Dispose of our explorer.
		scope:norse_explorer = {
			hidden_effect = {
				death = { death_reason = death_vanished }
			}
		}
	}
}
