﻿namespace = childhood

scripted_trigger appropriate_adult = {
	is_available_ai_adult = yes
	intrigue <= root.intrigue # A sporting chance!
	NOT = {
		has_character_modifier = diplomacy_majesty_4090_no_raiment_modifier
	}
	OR = {
		sex_same_as = root
		is_parent_of = root
		is_grandparent_of = root
		is_great_grandparent_of = root
	}
	age >= 14
	NOR = { # Wears clothes
		faith = {
			has_doctrine_parameter = naked_adherents_active
		}
		AND = {
			faith = {
				has_doctrine_parameter = naked_priests_active
			}
			OR = {
				ai_zeal >= 50
				has_trait = devoted
				has_trait = zealous
				government_has_flag = government_is_theocracy
				has_council_position = councillor_court_chaplain
			}
		}
		has_character_modifier = diplomacy_majesty_4090_no_raiment_modifier # Lunatic event where character goes naked instead of buying new clothes.
		has_character_flag = is_naked # Special flag used in certain events.
	}
}

# Steal an adults clothes!
childhood.7000 = {
	type = character_event
	title = childhood.7000.t
	desc = {
		desc = childhood.7000.desc
		triggered_desc = {
			trigger = {
				exists = scope:child_helper
			}
			desc = childhood.7000.desc_child
		}
		desc = childhood.7000.desc_end
	}

	theme = friendly
	override_background = { reference = council_chamber }
	left_portrait = {
		character = root
		animation = scheme
	}
	right_portrait = {
		character = scope:stolen_clothes
		animation = worry
	}
	lower_left_portrait = scope:child_helper
	
	cooldown = { years = 5 }

	trigger = {
		has_dlc = "Friends and Foes"
		is_available_child = yes
		age >= 6
		any_courtier_or_guest = {
			appropriate_adult = yes
		}
	}

	immediate = {
		random_courtier_or_guest = {
			limit = {
				appropriate_adult = yes
			}
			weight = {
				base = 1
				modifier = {
					add = 20
					OR = {
						has_relation_rival = root
						has_relation_potential_rival = root
					}
				}
				modifier = {
					add = 10
					is_of_major_interest_to_root_trigger = yes
				}
				modifier = {
					add = 5
					is_of_minor_interest_to_root_trigger = yes
				}
			}
			save_scope_as = stolen_clothes
		}
		if = { # Save a friend if there is one.
			limit = {
				any_relation = {
					type = friend
					is_available_ai_child = yes
					age >= 6
				}
			}
			random_relation = {
				type = friend
				limit = {
					is_available_ai_child = yes
					age >= 6
				}
				save_scope_as = child_helper
			}
		}
		else = {
			if = {
				limit = {
					any_relation = {
						type = potential_friend
						is_available_ai_child = yes
						age >= 6
					}
				}
				random_relation = {
					type = potential_friend
					limit = {
						is_available_ai_child = yes
						age >= 6
					}
					save_scope_as = child_helper
				}
			}
		}
	}

	option = { # Steal the clothes yourself
		name = childhood.7000.a
		duel = {
			skill = intrigue
			value = scope:stolen_clothes.intrigue

			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}

				custom_tooltip = childhood.7000.a.success
				trigger_event = childhood.7001
			}
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}

				custom_tooltip = childhood.7000.a.failure
				trigger_event = childhood.7002
			}
		}
		stress_impact = {
			pensive = minor_stress_impact_gain
			honest = minor_stress_impact_gain
			compassionate = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = pensive
					has_trait = honest
					has_trait = compassionate
				}
			}
		}
	}

	option = { # You and friend steal the clothes!
		name = childhood.7000.b
		trigger = {
			exists = scope:child_helper
		}
		scope:child_helper = {
			save_scope_as = child_helped
		}
		
		random_list = {
			20 = {
				custom_tooltip = childhood.7000.a.failure
				trigger_event = childhood.7002
			}
			80 = {
				custom_tooltip = childhood.7000.a.success
				trigger_event = childhood.7001
			}
		}
		
		stress_impact = {
			pensive = minor_stress_impact_gain
			honest = minor_stress_impact_gain
			compassionate = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = pensive
					has_trait = honest
					has_trait = compassionate
				}
			}
		}
	}

	option = { # Just order them to rest a bit.
		name = childhood.7000.c
		scope:stolen_clothes = {
			if = { # Diligent people are stressed out by being told to stop working.
				limit = {
					has_trait = diligent
				}
				add_stress = major_stress_impact_gain
				add_opinion = {
					modifier = disapproving_opinion
					opinion = -20
					years = 20
					target = root
				}
			}
			else = {
				add_stress = minor_stress_loss
				add_opinion = {
					modifier = kindness_opinion
					opinion = 25
					target = root
				}
			}
		}
		if = {
			limit = {
				scope:stolen_clothes = {
					has_trait = diligent
				}
			}
			stress_impact = {
				compassionate = major_stress_impact_gain
			}
		}
		else = {
			stress_impact = {
				rowdy = minor_stress_impact_gain
				deceitful = medium_stress_impact_gain
				sadistic = major_stress_impact_gain
			}
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = rowdy
					has_trait = deceitful
					has_trait = sadistic
				}
			}
		}
	}

	option = { # Better not do it.
		name = childhood.7000.d
		stress_impact = {
			rowdy = miniscule_stress_impact_gain
			deceitful = miniscule_stress_impact_gain
			sadistic = miniscule_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = rowdy
					has_trait = deceitful
					has_trait = sadistic
				}
			}
		}
	}
}

# Success!
childhood.7001 = {
	type = character_event
	title = childhood.7000.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					exists = scope:child_helped
				}
				desc = childhood.7001.desc_helper
			}
			triggered_desc = {
				trigger = {
					NOT = { exists = scope:child_helped }
				}
				desc = childhood.7001.desc_nohelper
			}
		}
		first_valid = {
			triggered_desc = {
				trigger = {
					exists = scope:angry
				}
				desc = childhood.7001.desc_angry
			}
			triggered_desc = {
				trigger = {
					exists = scope:happy
				}
				desc = childhood.7001.desc_funny
			}
		}
	}

	theme = friendly
	override_background = { reference = council_chamber }
	left_portrait = {
		character = root
		animation = happiness
	}
	right_portrait = {
		character = scope:stolen_clothes
		triggered_animation = {
			trigger = {
				exists = scope:angry
			}
			animation = rage
		}
		triggered_animation = {
			trigger = {
				exists = scope:happy
			}
			animation = throne_room_applaud_1
		}
	}
	lower_left_portrait = scope:child_helped

	immediate = {
		scope:stolen_clothes = {
			random_list = {
				10 = {
					modifier = {
						factor = 100
						has_personality_malicious_trigger = yes
					}
					modifier = {
						factor = 5
						has_trait_malicious_trigger = yes
					}
					save_scope_as = angry
				}
				10 = {
					modifier = {
						factor = 100
						has_personality_benevolent_trigger = yes
					}
					modifier = {
						factor = 5
						has_trait_benevolent_trigger = yes
					}
					save_scope_as = happy
				}
			}
			hidden_effect = {
				add_character_modifier = {
					modifier = diplomacy_majesty_4090_no_raiment_modifier
					years = 1
				}
			}
		}
	}

	option = { # Who's saying that I'll stop!?
		name = childhood.7001.a
		
		scope:stolen_clothes = {
			add_stress = medium_stress_impact_gain
			add_character_modifier = {
				modifier = diplomacy_majesty_4090_no_raiment_modifier
				years = 5
			}
			add_opinion = {
				target = root
				modifier = annoyed_opinion
				opinion = -25
			}
			
			progress_towards_rival_effect = {
				REASON = rival_pilfered_clothes
				CHARACTER = root
				OPINION = 0
			}
		}
		
		if = {
			limit = {
				exists = scope:child_helped
			}
			add_intrigue_skill = 1
			add_intrigue_lifestyle_xp = minor_lifestyle_experience
		}
		else = {
			add_intrigue_skill = 2
			add_intrigue_lifestyle_xp = minor_lifestyle_experience
		}
		
		stress_impact = {
			pensive = minor_stress_impact_gain
			honest = minor_stress_impact_gain
			compassionate = minor_stress_impact_gain
			sadistic = medium_stress_impact_loss
			deceitful = medium_stress_impact_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = pensive
					has_trait = honest
					has_trait = compassionate
				}
			}
		}
	}

	option = { # I couldn't have done it without you!
		name = childhood.7001.b
		trigger = {
			exists = scope:child_helped
		}
		if = {
			limit = {
				stress > 0
			}
			add_stress = minor_stress_loss
		}
		random = {
			chance = 50
			send_interface_toast = {
				title = skill_increased
				left_icon = root
				add_diplomacy_skill = 1
			}
		}
		scope:child_helper = {
			scope:stolen_clothes = { save_scope_as = relationship_reason_involved_character }
			progress_towards_friend_effect = {
				CHARACTER = root
				OPINION = 50
				REASON = friend_stole_clothes_together
			}
			clear_saved_scope = relationship_reason_involved_character
		}
		scope:stolen_clothes = {
			if = {
				limit = {
					exists = scope:angry
				}
				add_opinion = {
					target = root
					modifier = annoyed_opinion
					opinion = -15
				}
			
				hidden_effect = {
					random = {
						chance = 50
						if = {
							limit = {
								can_set_relation_potential_rival_trigger = { CHARACTER = root }
							}
							set_relation_potential_rival = root
						}
					}
				}
			}
			else_if = {
				limit = {
					exists = scope:happy
				}
				add_opinion = {
					target = root
					modifier = funny_opinion
					opinion = 15
				}
				add_stress = minor_stress_loss
			}
			hidden_effect = {
				remove_character_modifier = diplomacy_majesty_4090_no_raiment_modifier
			}
		}
		
		stress_impact = {
			arrogant = medium_stress_impact_gain
			sadistic = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = arrogant
					has_trait = sadistic
				}
			}
		}
	}

	option = { # This was fun!
		name = childhood.7001.c
		if = {
			limit = {
				stress > 0
			}
			add_stress = minor_stress_loss
		}
		random = {
			chance = 50
			send_interface_toast = {
				title = skill_increased
				left_icon = root
				add_intrigue_skill = 1
			}
		}
		scope:stolen_clothes = {
			if = {
				limit = {
					exists = scope:angry
				}
				add_opinion = {
					target = root
					modifier = annoyed_opinion
					opinion = -15
				}
			
				hidden_effect = {
					random = {
						chance = 50
						if = {
							limit = {
								can_set_relation_potential_rival_trigger = { CHARACTER = root }
							}
							set_relation_potential_rival = root
						}
					}
				}
			}
			else_if = {
				limit = {
					exists = scope:happy
				}
				add_opinion = {
					target = root
					modifier = funny_opinion
					opinion = 15
				}
				add_stress = minor_stress_loss
			}
			hidden_effect = {
				remove_character_modifier = diplomacy_majesty_4090_no_raiment_modifier
			}
		}
		ai_chance = {
			base = 100
		}
	}
}

# Failure!
childhood.7002 = {
	type = character_event
	title = childhood.7000.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					exists = scope:child_helper
				}
				desc = childhood.7002.desc_helper
			}
			triggered_desc = {
				trigger = {
					NOT = { exists = scope:child_helper }
				}
				desc = childhood.7002.desc_nohelper
			}
		}
		first_valid = {
			triggered_desc = {
				trigger = {
					exists = scope:angry
				}
				desc = childhood.7002.desc_angry
			}
			triggered_desc = {
				trigger = {
					exists = scope:happy
				}
				desc = childhood.7002.desc_funny
			}
		}
	}

	theme = friendly
	override_background = { reference = bedchamber }
	left_portrait = {
		character = root
		triggered_animation = {
			trigger = {
				exists = scope:angry
			}
			animation = poison
		}
		triggered_animation = {
			trigger = {
				exists = scope:happy
			}
			animation = shock
		}
	}
	right_portrait = {
		character = scope:stolen_clothes
		triggered_animation = {
			trigger = {
				exists = scope:angry
			}
			animation = rage
		}
		triggered_animation = {
			trigger = {
				exists = scope:happy
			}
			animation = personality_rational
		}
	}
	lower_left_portrait = scope:child_helped

	immediate = {
		scope:stolen_clothes = {
			random_list = {
				10 = {
					modifier = {
						factor = 100
						has_personality_malicious_trigger = yes
					}
					modifier = {
						factor = 5
						has_trait_malicious_trigger = yes
					}
					save_scope_as = angry
				}
				10 = {
					modifier = {
						factor = 100
						has_personality_benevolent_trigger = yes
					}
					modifier = {
						factor = 5
						has_trait_benevolent_trigger = yes
					}
					save_scope_as = happy
				}
			}
		}
	}

	option = { # Angry response
		name = childhood.7002.a
		
		trigger = {
			exists = scope:angry
		}
		
		scope:stolen_clothes = {
			add_opinion = {
				target = root
				modifier = annoyed_opinion
				opinion = -25
			}
			
			hidden_effect = {
				random = {
					chance = 25
					if = {
						limit = {
							can_set_relation_potential_rival_trigger = { CHARACTER = root }
						}
						set_relation_potential_rival = root
					}
				}
			}
		}
		
		add_prestige = minor_prestige_loss
		add_character_modifier = {
			modifier = covered_in_feces
			years = 2
		}
		if = {
			limit = {
				exists = scope:child_helper
			}
			scope:child_helper = {
				add_character_modifier = {
					modifier = covered_in_feces
					years = 2
				}
			}
		}
		
		stress_impact = {
			rowdy = minor_stress_impact_gain
			sadistic = minor_stress_impact_gain
			deceitful = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = rowdy
					has_trait = sadistic
					has_trait = deceitful
				}
			}
		}
	}

	option = { # Happy response
		name = childhood.7002.b
		trigger = {
			exists = scope:happy
		}
		random = {
			chance = 25
			send_interface_toast = {
				title = skill_increased
				left_icon = root
				add_diplomacy_skill = 1
			}
		}
		scope:stolen_clothes = {
			add_opinion = {
				target = root
				modifier = annoyed_opinion
				opinion = -10
			}
		}
		
		stress_impact = {
			rowdy = miniscule_stress_impact_gain
			sadistic = miniscule_stress_impact_gain
			deceitful = miniscule_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = rowdy
					has_trait = sadistic
					has_trait = deceitful
				}
			}
		}
	}

	option = { # Throw your friend under the bus... under the carriage?
		name = childhood.7002.c
		
		trigger = {
			exists = scope:child_helped
		}
		
		add_intrigue_skill = 1
		scope:child_helped = {
			if = {
				limit = {
					has_relation_friend = root
				}
				remove_relation_friend = root
			}
			add_opinion = {
				target = root
				modifier = betrayed_me_opinion
				opinion = -50
			}
			hidden_effect = {
				if = {
					limit = {
						has_relation_potential_friend = root
					}
					remove_relation_potential_friend = root
				}
				if = {
					limit = {
						can_set_relation_potential_rival_trigger = { CHARACTER = root }
					}
					set_relation_potential_rival = root
				}
			}
		}
		scope:stolen_clothes = {
			add_opinion = {
				target = scope:child_helped
				modifier = annoyed_opinion
				opinion = -15
			}
			
			hidden_effect = {
				random = {
					chance = 50
					if = {
						limit = {
							can_set_relation_potential_rival_trigger = { CHARACTER = scope:child_helped }
						}
						set_relation_potential_rival = scope:child_helped
					}
				}
			}
		}
		
		stress_impact = {
			base = miniscule_stress_impact_gain
			charming = minor_stress_impact_gain
			honest = major_stress_impact_gain
			compassionate = major_stress_impact_gain
			sadistic = major_stress_impact_loss
		}
		ai_chance = {
			base = 25
			modifier = {
				factor = 0
				OR = {
					has_trait = charming
					has_trait = honest
					has_trait = compassionate
				}
			}
		}
	}
}

scripted_trigger appropriate_child_to_annihilate = {
	is_available_ai_child = yes
	age >= 4
	NOT = {
		this = root
	}
	NOT = { # Don't kill player children.
		any_parent = {
			is_ai = no
		}
	}
}

# See another child get annihilated in a brutal but historically-appropriate fashion!
childhood.7100 = {
	type = character_event
	title = childhood.7100.t
	desc = {
		desc = childhood.7100.desc
		first_valid = {
			triggered_desc = {
				trigger = {
					exists = scope:killed_by_sow
				}
				desc = childhood.7100.killed_by_sow
			}
			triggered_desc = {
				trigger = {
					exists = scope:kicked_by_horse
				}
				desc = childhood.7100.kicked_by_horse
			}
			triggered_desc = {
				trigger = {
					exists = scope:kicked_by_camel
				}
				desc = childhood.7100.kicked_by_camel
			}
			triggered_desc = {
				trigger = {
					exists = scope:stomped_by_elephant
				}
				desc = childhood.7100.stomped_by_elephant
			}
			triggered_desc = {
				trigger = {
					exists = scope:smashed_by_roof_tile
				}
				desc = childhood.7100.smashed_by_roof_tile
			}
		}
		desc = childhood.7100.desc_end
	}

	theme = unfriendly
	override_background = { reference = courtyard }
	left_portrait = {
		character = root
		animation = shock
	}
	right_portrait = {
		character = scope:child_to_annihilate
		animation = pain
	}
	lower_left_portrait = scope:friend_to_comfort
	
	cooldown = { years = 20 } # Once per childhood, max

	trigger = {
		has_dlc = "Friends and Foes"
		is_available_child = yes
		age >= 6
		OR = {
			any_vassal = {
				appropriate_child_to_annihilate = yes
			}
			any_vassal = {
				any_child = {
					appropriate_child_to_annihilate = yes
				}
			}
			any_courtier_or_guest = {
				appropriate_child_to_annihilate = yes
			}
			AND = {
				is_independent_ruler = no
				exists = liege
				liege = {
					appropriate_child_to_annihilate = yes
				}
			}
			AND = {
				is_independent_ruler = no
				exists = liege
				liege = {
					any_vassal = {
						appropriate_child_to_annihilate = yes
					}
				}
			}
			AND = {
				is_independent_ruler = no
				exists = liege
				liege = {
					any_vassal = {
						any_child = {
							appropriate_child_to_annihilate = yes
						}
					}
				}
			}
			AND = {
				is_independent_ruler = no
				exists = liege
				liege = {
					any_courtier_or_guest = {
						appropriate_child_to_annihilate = yes
					}
				}
			}
		}
	}

	immediate = {
		play_music_cue = mx_cue_death
		every_vassal = {
			limit = {
				appropriate_child_to_annihilate = yes
			}
			add_to_list = potential_children_to_annihilate
		}
		every_vassal = {
			every_child = {
				limit = {
					appropriate_child_to_annihilate = yes
				}
				add_to_list = potential_children_to_annihilate
			}
		}
		every_courtier_or_guest = {
			limit = {
				appropriate_child_to_annihilate = yes
			}
			add_to_list = potential_children_to_annihilate
		}
		if = {
			limit = {
				is_independent_ruler = no
				exists = liege
				liege = {
					appropriate_child_to_annihilate = yes
				}
			}
			liege = {
				add_to_list = potential_children_to_annihilate
			}
		}
		if = {
			limit = {
				is_independent_ruler = no
				exists = liege
				liege = {
					any_vassal = {
						appropriate_child_to_annihilate = yes
					}
				}
			}
			liege = {
				every_vassal = {
					limit = {
						appropriate_child_to_annihilate = yes
					}
					add_to_list = potential_children_to_annihilate
				}
			}
		}
		if = {
			limit = {
				is_independent_ruler = no
				exists = liege
				liege = {
					any_vassal = {
						any_child = {
							appropriate_child_to_annihilate = yes
						}
					}
				}
			}
			liege = {
				every_vassal = {
					every_child = {
						limit = {
							appropriate_child_to_annihilate = yes
						}
						add_to_list = potential_children_to_annihilate
					}
				}
			}
		}
		if = {
			limit = {
				is_independent_ruler = no
				exists = liege
				liege = {
					any_courtier_or_guest = {
						appropriate_child_to_annihilate = yes
					}
				}
			}
			liege = {
				every_courtier_or_guest = {
					limit = {
						appropriate_child_to_annihilate = yes
					}
					add_to_list = potential_children_to_annihilate
				}
			}
		}
		
		random_in_list = {
			list = potential_children_to_annihilate
			weight = {
				base = 1
				modifier = {
					add = -10
					OR = {
						is_of_major_interest_to_root_trigger = no
						is_of_minor_interest_to_root_trigger = no
					}
				}
				modifier = {
					add = 25
					has_no_particular_noble_roots_trigger = yes
				}
			}
			save_scope_as = child_to_annihilate
		}
		random_list = {
			10 = {
				trigger = {
					scope:child_to_annihilate = {
						age <= 6
					}
					#AGOT Disabled
					# NOR = {
					# 	faith.religion = religion:judaism_religion
					# 	faith.religion = religion:islam_religion
					# }
				}
				save_scope_as = killed_by_sow
				scope:child_to_annihilate = {
					death = { death_reason = death_sow }
				}
			}
			10 = {
				trigger = {
					scope:child_to_annihilate = {
						age > 6
					}
				}
				save_scope_as = kicked_by_horse
				scope:child_to_annihilate = {
					death = { death_reason = death_horse }
				}
			}
			10 = {
				trigger = {
					scope:child_to_annihilate = {
						age > 6
					}
					location = {
						geographical_region = world_innovation_camels
					}
				}
				save_scope_as = kicked_by_camel
				scope:child_to_annihilate = {
					death = { death_reason = death_camel }
				}
			}
			10 = {
				trigger = {
					scope:child_to_annihilate = {
						age > 6
					}
					location = {
						geographical_region = world_innovation_elephants
					}
				}
				save_scope_as = stomped_by_elephant
				scope:child_to_annihilate = {
					death = { death_reason = death_crushed_by_elephant }
				}
			}
			10 = {
				trigger = {
					scope:child_to_annihilate = {
						age > 6
					}
				}
				save_scope_as = smashed_by_roof_tile
				scope:child_to_annihilate = {
					death = { death_reason = death_roof_tile }
				}
			}
		}
		if = {
			limit = {
				any_relation = {
					type = friend
					is_available_child = yes
					NOT = { this = scope:child_to_annihilate }
				}
			}
			random_relation = {
				type = friend
				limit = {
					is_available_child = yes
					NOT = { this = scope:child_to_annihilate }
				}
				save_scope_as = friend_to_comfort
			}
		}
		if = {
			limit = {
				NOR = {
					has_trait = sadistic
					has_trait = callous
				}
			}
			if = {
				limit = {
					exists = scope:killed_by_sow
				}
				create_character_memory = {
					type = saw_other_child_die_from_sow
					
					participants = {
						dead_child = scope:child_to_annihilate
					}
				}
			}
			else_if = {
				limit = {
					exists = scope:kicked_by_horse
				}
				create_character_memory = {
					type = saw_other_child_die_from_horse
					
					participants = {
						dead_child = scope:child_to_annihilate
					}
				}
			}
			else_if = {
				limit = {
					exists = scope:kicked_by_camel
				}
				create_character_memory = {
					type = saw_other_child_die_from_camel
					
					participants = {
						dead_child = scope:child_to_annihilate
					}
				}
			}
			else_if = {
				limit = {
					exists = scope:stomped_by_elephant
				}
				create_character_memory = {
					type = saw_other_child_die_from_elephant
					
					participants = {
						dead_child = scope:child_to_annihilate
					}
				}
			}
			else_if = {
				limit = {
					exists = scope:smashed_by_roof_tile
				}
				create_character_memory = {
					type = saw_other_child_die_from_roof_tile
					
					participants = {
						dead_child = scope:child_to_annihilate
					}
				}
			}
		}
	}

	option = { # Friend helps mitigate trauma
		name = childhood.7100.d
		trigger = {
			NOR = {
				has_trait = sadistic
				has_trait = callous
			}
			exists = scope:friend_to_comfort
		}
		custom_tooltip = childhood.7100.d.friend
		stress_impact = {
			base = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
		}
	}

	option = { # Trauma
		name = childhood.7100.a
		trigger = {
			NOR = {
				has_trait = sadistic
				has_trait = callous
			}
		}
		stress_impact = {
			base = major_stress_impact_gain
		}
		ai_chance = {
			base = 100
		}
	}

	option = { # Sadists enjoy this
		name = childhood.7100.b
		trait = sadistic
		trigger = {
			has_trait = sadistic
		}
		stress_impact = {
			base = major_stress_impact_loss
		}
		ai_chance = {
			base = 100
		}
	}

	option = { # Callous people don't care
		name = childhood.7100.c
		trait = callous
		trigger = {
			has_trait = callous
		}
		ai_chance = {
			base = 100
		}
	}
}

# Try to learn the language of a Friend/crush
childhood.7200 = {
	type = character_event
	title = childhood.7200.t
	desc = childhood.7200.desc

	theme = education
	override_background = { reference = corridor_day }
	left_portrait = {
		character = root
		animation = personality_rational
	}
	right_portrait = {
		character = scope:language_friend
		animation = happiness
	}
	
	cooldown = { years = 5 }

	trigger = {
		has_dlc = "Friends and Foes"
		is_available_child = yes
		age >= 6
		OR = {
			any_relation = {
				type = friend
				is_available_child = yes
				root = {
					can_start_scheme = {
						type = learn_language
						target_character = prev
					}
				}
			}
			any_relation = {
				type = crush
				is_available_child = yes
				root = {
					can_start_scheme = {
						type = learn_language
						target_character = prev
					}
				}
			}
		}
	}

	immediate = {
		every_relation = {
			type = friend
			limit = {
				is_available_child = yes
				root = {
					can_start_scheme = {
						type = learn_language
						target_character = prev
					}
				}
			}
			add_to_list = language_friends
		}
		every_relation = {
			type = crush
			limit = {
				is_available_child = yes
				root = {
					can_start_scheme = {
						type = learn_language
						target_character = prev
					}
				}
			}
			add_to_list = language_friends
		}
		
		random_in_list = {
			list = language_friends
			weight = {
				base = 1
				
				modifier = {
					add = 10
					is_of_major_interest_to_root_trigger = yes
				}
				modifier = {
					add = 5
					is_of_minor_interest_to_root_trigger = yes
				}
			}
			save_scope_as = language_friend
		}
	}

	option = { # Try to learn their language
		name = childhood.7200.a
		if = {
			limit = {
				NOT = {
					any_scheme = {
						scheme_type = learn_language
						scheme_target_character = scope:language_friend
					}
				}
			}
			start_scheme = {
				target_character = scope:language_friend
				type = learn_language
			}
		}
		custom_tooltip = diplomacy_family.2250.b.tt
		hidden_effect = {
			random_scheme = {
				limit = {
					scheme_type = learn_language
					scheme_target_character = scope:language_friend
				}
				add_scheme_modifier = {
					type = extra_success_chance_modifier
				}
			}
		}
		scope:language_friend = {
			add_opinion = {
				modifier = sweet_opinion
				target = root
				opinion = 15
			}
		}
		stress_impact = {
			base = minor_stress_impact_gain
			lazy = medium_stress_impact_gain
			shy = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = lazy
					has_trait = shy
				}
			}
		}
	}

	option = { # Read a book instead
		name = childhood.7200.b
		scope:language_friend = {
			add_opinion = {
				modifier = entertained_opinion
				target = root
				opinion = 25
			}
		}
		random = {
			chance = 15
			send_interface_toast = {
				title = skill_increased
				left_icon = root
				add_learning_skill = 1
			}
		}
		stress_impact = {
			diligent = minor_stress_impact_gain
			shy = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = diligent
					has_trait = shy
				}
			}
		}
	}

	option = { # Don't try
		name = childhood.7200.c
		stress_impact = {
			base = minor_stress_impact_loss
			diligent = minor_stress_impact_gain
		}
		ai_chance = {
			base = 25
			modifier = {
				factor = 0
				has_trait = diligent
			}
		}
	}
}

scripted_trigger appropriate_target_to_beat_up = {
	is_available_ai_child = yes
	age >= 6
	age <= root.age_dif_child_up_friend
	prowess < root.prowess
	sex_same_as = root
	NOR = {
		root = {
			has_relation_crush = prev
		}
		root = {
			has_relation_bully = prev
		}
		has_relation_friend = root
	}
	NOT = {
		root = {
			has_hook = prev
		}
	}
	root = {
		can_add_hook = {
			type = threat_hook
			target = prev
		}
	}
}

# Beat up another child for a hook
childhood.7300 = {
	type = character_event
	title = childhood.7300.t
	desc = {
		desc = childhood.7300.desc
		triggered_desc = {
			trigger = {
				exists = scope:beating_target_2
			}
			desc = childhood.7100.beating_target_2
		}
		triggered_desc = {
			trigger = {
				exists = scope:beating_target_3
			}
			desc = childhood.7100.beating_target_3
		}
		desc = childhood.7300.desc_end
	}

	theme = unfriendly
	override_background = { reference = alley_day }
	left_portrait = {
		character = root
		animation = personality_dishonorable
	}
	right_portrait = {
		character = scope:beating_target_1
		animation = worry
	}
	lower_center_portrait = scope:beating_target_2
	lower_right_portrait = scope:beating_target_3
	
	cooldown = { years = 2 }

	trigger = {
		has_dlc = "Friends and Foes"
		is_available_child = yes
		age >= 6
		has_personality_dominant_trigger = yes
		OR = {
			any_vassal = {
				appropriate_target_to_beat_up = yes
			}
			any_vassal = {
				any_child = {
					appropriate_target_to_beat_up = yes
				}
			}
			any_courtier_or_guest = {
				appropriate_target_to_beat_up = yes
			}
			AND = {
				is_independent_ruler = no
				exists = liege
				liege = {
					appropriate_target_to_beat_up = yes
				}
			}
			AND = {
				is_independent_ruler = no
				exists = liege
				liege = {
					any_vassal = {
						appropriate_target_to_beat_up = yes
					}
				}
			}
			AND = {
				is_independent_ruler = no
				exists = liege
				liege = {
					any_vassal = {
						any_child = {
							appropriate_target_to_beat_up = yes
						}
					}
				}
			}
			AND = {
				is_independent_ruler = no
				exists = liege
				liege = {
					any_courtier_or_guest = {
						appropriate_target_to_beat_up = yes
					}
				}
			}
		}
	}

	immediate = {
		every_vassal = {
			limit = {
				appropriate_target_to_beat_up = yes
			}
			add_to_list = beating_targets
		}
		every_vassal = {
			every_child = {
				limit = {
					appropriate_target_to_beat_up = yes
				}
				add_to_list = beating_targets
			}
		}
		every_courtier_or_guest = {
			limit = {
				appropriate_target_to_beat_up = yes
			}
			add_to_list = beating_targets
		}
		if = {
			limit = {
				is_independent_ruler = no
				exists = liege
				liege = {
					appropriate_target_to_beat_up = yes
				}
			}
			liege = {
				add_to_list = beating_targets
			}
		}
		if = {
			limit = {
				is_independent_ruler = no
				exists = liege
				liege = {
					any_vassal = {
						appropriate_target_to_beat_up = yes
					}
				}
			}
			liege = {
				every_vassal = {
					limit = {
						appropriate_target_to_beat_up = yes
					}
					add_to_list = beating_targets
				}
			}
		}
		if = {
			limit = {
				is_independent_ruler = no
				exists = liege
				liege = {
					any_vassal = {
						any_child = {
							appropriate_target_to_beat_up = yes
						}
					}
				}
			}
			liege = {
				every_vassal = {
					every_child = {
						limit = {
							appropriate_target_to_beat_up = yes
						}
						add_to_list = beating_targets
					}
				}
			}
		}
		if = {
			limit = {
				is_independent_ruler = no
				exists = liege
				liege = {
					any_courtier_or_guest = {
						appropriate_target_to_beat_up = yes
					}
				}
			}
			liege = {
				every_courtier_or_guest = {
					limit = {
						appropriate_target_to_beat_up = yes
					}
					add_to_list = beating_targets
				}
			}
		}
		
		random_in_list = {
			list = beating_targets
			weight = {
				base = 1
				modifier = {
					add = 10
					is_independent_ruler = no
					exists = liege
					is_primary_heir_of = liege
				}
				modifier = {
					add = 5
					is_independent_ruler = no
					exists = liege
					is_heir_of = liege
				}
				modifier = {
					add = 10
					any_parent = {
						is_powerful_vassal_of = root
					}
				}
				modifier = {
					add = 5
					any_parent = {
						is_vassal_of = root
					}
				}
				modifier = {
					add = 10
					is_of_major_interest_to_root_trigger = yes
				}
				modifier = {
					add = 5
					is_of_minor_interest_to_root_trigger = yes
				}
			}
			save_scope_as = beating_target_1
		}
		
		random_in_list = {
			list = beating_targets
			limit = {
				NOT = {
					this = scope:beating_target_1
				}
			}
			weight = {
				base = 1
				modifier = {
					add = 10
					is_independent_ruler = no
					exists = liege
					is_primary_heir_of = liege
				}
				modifier = {
					add = 5
					is_independent_ruler = no
					exists = liege
					is_heir_of = liege
				}
				modifier = {
					add = 10
					any_parent = {
						is_powerful_vassal_of = root
					}
				}
				modifier = {
					add = 5
					any_parent = {
						is_vassal_of = root
					}
				}
				modifier = {
					add = 10
					is_of_major_interest_to_root_trigger = yes
				}
				modifier = {
					add = 5
					is_of_minor_interest_to_root_trigger = yes
				}
			}
			save_scope_as = beating_target_2
		}
		
		random_in_list = {
			list = beating_targets
			limit = {
				NOR = {
					this = scope:beating_target_1
					this = scope:beating_target_2
				}
			}
			weight = {
				base = 1
				modifier = {
					add = 10
					is_independent_ruler = no
					exists = liege
					is_primary_heir_of = liege
				}
				modifier = {
					add = 5
					is_independent_ruler = no
					exists = liege
					is_heir_of = liege
				}
				modifier = {
					add = 10
					any_parent = {
						is_powerful_vassal_of = root
					}
				}
				modifier = {
					add = 5
					any_parent = {
						is_vassal_of = root
					}
				}
				modifier = {
					add = 10
					is_of_major_interest_to_root_trigger = yes
				}
				modifier = {
					add = 5
					is_of_minor_interest_to_root_trigger = yes
				}
			}
			save_scope_as = beating_target_3
		}
	}

	option = { # Beat up target 1
		name = childhood.7300.a
		
		duel = {
			skill = prowess
			value = scope:beating_target_1.prowess

			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}

				desc = childhood.7300.a.success
				
				send_interface_toast = {
					title = childhood.7300.a.success
					left_icon = scope:beating_target_1
					add_hook = {
						target = scope:beating_target_1
						type = threat_hook
					}
					scope:beating_target_1 = {
						random = {
							chance = 10
							increase_wounds_effect = { REASON = fight }
						}
					}
				}
			}
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}

				desc = childhood.7300.a.failure
				
				send_interface_toast = {
					title = childhood.7300.a.failure
					left_icon = scope:beating_target_1
					add_stress = miniscule_stress_impact_gain
					random = {
						chance = 10
						increase_wounds_effect = { REASON = fight }
					}
				}
			}
		}
		stress_impact = {
			honest = minor_stress_impact_gain
			forgiving = medium_stress_impact_gain
			just = medium_stress_impact_gain
			compassionate = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = honest
					has_trait = forgiving
					has_trait = compassionate
				}
			}
		}
	}

	option = { # Beat up target 2
		name = childhood.7300.b
		trigger = {
			exists = scope:beating_target_2
		}
		duel = {
			skill = prowess
			value = scope:beating_target_2.prowess

			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}

				desc = childhood.7300.b.success
				
				send_interface_toast = {
					title = childhood.7300.b.success
					left_icon = scope:beating_target_2
					add_hook = {
						target = scope:beating_target_2
						type = threat_hook
					}
					scope:beating_target_2 = {
						random = {
							chance = 10
							increase_wounds_effect = { REASON = fight }
						}
					}
				}
			}
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}

				desc = childhood.7300.b.failure
				
				send_interface_toast = {
					title = childhood.7300.b.failure
					left_icon = scope:beating_target_2
					add_stress = miniscule_stress_impact_gain
					random = {
						chance = 10
						increase_wounds_effect = { REASON = fight }
					}
				}
			}
		}
		stress_impact = {
			honest = minor_stress_impact_gain
			forgiving = medium_stress_impact_gain
			just = medium_stress_impact_gain
			compassionate = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = honest
					has_trait = forgiving
					has_trait = compassionate
				}
			}
		}
	}

	option = { # Beat up target 3
		name = childhood.7300.c
		trigger = {
			exists = scope:beating_target_3
		}
		duel = {
			skill = prowess
			value = scope:beating_target_3.prowess

			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}

				desc = childhood.7300.c.success
				
				send_interface_toast = {
					title = childhood.7300.c.success
					left_icon = scope:beating_target_3
					add_hook = {
						target = scope:beating_target_3
						type = threat_hook
					}
					scope:beating_target_3 = {
						random = {
							chance = 10
							increase_wounds_effect = { REASON = fight }
						}
					}
				}
			}
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}

				desc = childhood.7300.c.failure
				
				send_interface_toast = {
					title = childhood.7300.c.failure
					left_icon = scope:beating_target_3
					add_stress = miniscule_stress_impact_gain
					random = {
						chance = 10
						increase_wounds_effect = { REASON = fight }
					}
				}
			}
		}
		stress_impact = {
			honest = minor_stress_impact_gain
			forgiving = medium_stress_impact_gain
			just = medium_stress_impact_gain
			compassionate = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = honest
					has_trait = forgiving
					has_trait = compassionate
				}
			}
		}
	}

	option = { # Don't try
		name = childhood.7300.d
		stress_impact = {
			sadistic = minor_stress_impact_gain
			wrathful = minor_stress_impact_gain
			rowdy = miniscule_stress_impact_gain
			bossy = miniscule_stress_impact_gain
		}
		ai_chance = {
			base = 25
			modifier = {
				factor = 0
				OR = {
					has_trait = sadistic
					has_trait = wrathful
					has_trait = rowdy
					has_trait = bossy
				}
			}
		}
	}
}

# You have a bully... and a bodyguard!
childhood.7400 = {
	type = character_event
	title = childhood.7400.t
	desc = {
		desc = childhood.7400.desc
		first_valid = {
			triggered_desc = {
				trigger = {
					exists = father
					father = {
						is_alive = no
					}
					NOT = {
						scope:bully = {
							exists = father
							father = root.father
						}
					}
				}
				desc = childhood.7400_father_dead
			}
			triggered_desc = {
				trigger = {
					exists = mother
					mother = {
						is_alive = no
					}
					NOT = {
						scope:bully = {
							exists = mother
							mother = root.mother
						}
					}
				}
				desc = childhood.7400_mother_dead
			}
			desc = childhood.7400_none_dead
		}
		desc = childhood.7400.desc_2
	}

	theme = unfriendly
	override_background = { reference = courtyard }
	left_portrait = {
		character = scope:bodyguard
		animation = marshal
	}
	right_portrait = {
		character = scope:bully
		animation = shock
	}
	
	cooldown = { years = 5 }

	trigger = {
		has_dlc = "Friends and Foes"
		is_available_child = yes
		age >= 6
		OR = {
			AND = {
				employs_court_position = bodyguard_court_position
				any_court_position_holder = {
					type = bodyguard_court_position
					is_available = yes
				}
			}
			AND = {
				employs_court_position = akolouthos_court_position
				any_court_position_holder = {
					type = akolouthos_court_position
					is_available = yes
				}
			}
		}
		any_relation = {
			type = bully
			is_available_ai_child = yes
		}
	}

	immediate = {
		if = {
			limit = {
				employs_court_position = bodyguard_court_position
			}
			random_court_position_holder = {
				type = bodyguard_court_position
				limit = {
					is_available = yes
				}
				save_scope_as = bodyguard
			}
		}
		else = {
			random_court_position_holder = {
				type = akolouthos_court_position
				limit = {
					is_available = yes
				}
				save_scope_as = bodyguard
			}
		}
		
		random_relation = {
			type = bully
			limit = {
				is_available_ai_child = yes
			}
			save_scope_as = bully
		}
	}

	option = { # Threaten for a hook
		name = childhood.7400.a
		
		trigger = {
			NOT = {
				has_hook = scope:bully
			}
		}
		
		add_hook = {
			target = scope:bully
			type = threat_hook
		}
		
		random = {
			chance = 25
			send_interface_toast = {
				title = bully_stops
				left_icon = scope:bully
				remove_relation_bully = scope:bully
			}
		}
		
		stress_impact = {
			forgiving = medium_stress_impact_gain
			honest = minor_stress_impact_gain
			compassionate = minor_stress_impact_gain
			content = minor_stress_impact_gain
			charming = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = honest
					has_trait = forgiving
					has_trait = compassionate
				}
			}
		}
	}

	option = { # Rough them up!
		name = childhood.7400.b
		
		add_prestige = medium_prestige_gain

		scope:bully = {
			add_opinion = {
				modifier = hate_opinion
				opinion = -40
				target = root
			}
			increase_wounds_effect = { REASON = beaten }
			hidden_effect = {
				if = {
					limit = {
						can_set_relation_potential_rival_trigger = { CHARACTER = root }
					}
					set_relation_potential_rival = root
				}
			}
			
			every_parent = {
				custom = every_parent_of_bully
				limit = { NOT = { this = root } }
				add_opinion = {
					modifier = hurt_someone_close_to_me_crime
					target = root
				}
			}
		}
		
		random = {
			chance = 50
			send_interface_toast = {
				title = bully_stops
				left_icon = scope:bully
				remove_relation_bully = scope:bully
			}
		}
		
		stress_impact = {
			forgiving = medium_stress_impact_gain
			compassionate = medium_stress_impact_gain
			patient = minor_stress_impact_gain
			charming = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = patient
					has_trait = forgiving
					has_trait = compassionate
				}
			}
		}
	}

	option = { # Teach them to be nice
		name = childhood.7400.c
		
		random = {
			chance = 75
			send_interface_toast = {
				title = bully_stops
				left_icon = scope:bully
				remove_relation_bully = scope:bully
			}
		}
		
		stress_impact = {
			bossy = minor_stress_impact_gain
			rowdy = minor_stress_impact_gain
			vengeful = medium_stress_impact_gain
			sadistic = medium_stress_impact_gain
			callous = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = bossy
					has_trait = rowdy
					has_trait = vengeful
					has_trait = sadistic
					has_trait = callous
				}
			}
		}
	}
}

# Your guardian tells you a story about one of their memories around the bonfire
childhood.7500 = {
	type = character_event
	title = childhood.7500.t
	desc = {
		desc = childhood.7500.desc
		first_valid = {
			triggered_desc = {
				trigger = {
					exists = scope:memory_participant
					OR = {
						scope:memory_participant = {
							is_alive = yes
						}
						exists = scope:death
					}
				}
				desc = childhood.7500.participant
			}
			triggered_desc = {
				trigger = {
					exists = scope:memory_participant
					scope:memory_participant = {
						is_alive = no
					}
				}
				desc = childhood.7500.participant_dead
			}
			desc = childhood.7500.no_participant
		}
		desc = childhood.7500.midpoint
		random_valid = {
			triggered_desc = {
				trigger = {
					exists = scope:family
				}
				desc = childhood.7500.family
			}
			triggered_desc = {
				trigger = {
					exists = scope:martial
				}
				desc = childhood.7500.martial
			}
			triggered_desc = {
				trigger = {
					exists = scope:death
				}
				desc = childhood.7500.death
			}
			triggered_desc = {
				trigger = {
					exists = scope:war
				}
				desc = childhood.7500.war
			}
			triggered_desc = {
				trigger = {
					exists = scope:relationships
				}
				desc = childhood.7500.relationships
			}
			triggered_desc = {
				trigger = {
					exists = scope:childhood
				}
				desc = childhood.7500.childhood
			}
		}
	}

	theme = memory_positive
	override_background = { reference = bp1_bonfire }
	
	left_portrait = {
		character = root
		triggered_animation = {
			trigger = { 
				exists = scope:death
			}
  			animation = shock
  		}
		triggered_animation = {
			trigger = { 
				exists = scope:war
			}
  			animation = worry
  		}
		triggered_animation = {
			trigger = { 
				exists = scope:family
			}
  			animation = personality_rational
  		}
		triggered_animation = {
			trigger = { 
				exists = scope:martial
			}
  			animation = personality_honorable
  		}
		triggered_animation = {
			trigger = { 
				exists = scope:relationships
			}
  			animation = boredom
  		}
		triggered_animation = {
			trigger = { 
				exists = scope:childhood
			}
  			animation = happiness
  		}
	}
	right_portrait = {
		character = scope:guardian
		animation = throne_room_conversation_2
	}
	
	lower_right_portrait = scope:memory_participant
	
	cooldown = { years = 4 }

	trigger = {
		has_dlc = "Friends and Foes"
		exists = house
		exists = location
		is_available_child = yes
		age >= 6
		OR = {
			any_relation = {
				type = guardian
				is_available = yes
				any_memory = {
					OR = {
						has_memory_category = family
						has_memory_category = martial
						has_memory_category = death
						has_memory_category = war
						has_memory_category = relationships
						has_memory_category = childhood
					}
					NOR = {
						has_memory_category = private
						any_memory_participant = {
							this = ROOT
						}
					}
				}
			}
			any_parent = {
				exists = location
				location = root.location
				is_available = yes
				any_memory = {
					OR = {
						has_memory_category = family
						has_memory_category = martial
						has_memory_category = death
						has_memory_category = war
						has_memory_category = relationships
						has_memory_category = childhood
					}
					NOR = {
						has_memory_category = private
						any_memory_participant = {
							this = ROOT
						}
					}
				}
			}
		}
	}

	immediate = {
		if = {
			limit = {
				any_relation = {
					type = guardian
					is_available = yes
					any_memory = {
						OR = {
							has_memory_category = family
							has_memory_category = martial
							has_memory_category = death
							has_memory_category = war
							has_memory_category = relationships
							has_memory_category = childhood
						}
						NOR = {
							has_memory_category = private
							any_memory_participant = {
								this = ROOT
							}
						}
					}
				}
			}
			random_relation = {
				type = guardian
				assign_quirk_effect = yes
				save_scope_as = guardian
			}
		}
		else = {
			random_parent = {
				limit = {
					exists = location
					location = root.location
					is_available = yes
					any_memory = {
						OR = {
							has_memory_category = family
							has_memory_category = martial
							has_memory_category = death
							has_memory_category = war
							has_memory_category = relationships
							has_memory_category = childhood
						}
						NOR = {
							has_memory_category = private
							any_memory_participant = {
								this = ROOT
							}
						}
					}
				}
				assign_quirk_effect = yes
				save_scope_as = guardian
			}
		}
		scope:guardian = {
			random_memory = {
				limit = {
					OR = {
						has_memory_category = family
						has_memory_category = martial
						has_memory_category = death
						has_memory_category = war
						has_memory_category = relationships
						has_memory_category = childhood
					}
					NOR = {
						has_memory_category = private
						any_memory_participant = {
							this = ROOT
						}
					}
				}
				save_scope_as = guardian_memory
				if = {
					limit = {
						has_memory_category = family
					}
					save_scope_as = family
				}
				if = {
					limit = {
						has_memory_category = martial
					}
					save_scope_as = martial
				}
				if = {
					limit = {
						has_memory_category = death
					}
					save_scope_as = death
				}
				if = {
					limit = {
						has_memory_category = war
					}
					save_scope_as = war
				}
				if = {
					limit = {
						has_memory_category = relationships
					}
					save_scope_as = relationships
				}
				if = {
					limit = {
						has_memory_category = childhood
					}
					save_scope_as = childhood
				}
				if = {
					limit = {
						any_memory_participant = {
							exists = this
							NOT = { this = scope:guardian }
						}
					}
					random_memory_participant = {
						limit = {
							NOT = { this = scope:guardian }
						}
						save_scope_as = memory_participant
					}
				}
			}
		}
	}

	option = { # haha what a story mark
		name = childhood.7500.a
		
		random_list = {
			10 = {
				trigger = {
					exists = scope:family
				}
				
				send_interface_toast = {
					title = skill_increased
					left_icon = root
					add_diplomacy_skill = 1
				}
			}
			10 = {
				trigger = {
					exists = scope:martial
				}
				
				send_interface_toast = {
					title = skill_increased
					left_icon = root
					add_prowess_skill = 1
				}
			}
			10 = {
				trigger = {
					exists = scope:death
				}
				
				send_interface_toast = {
					title = skill_increased
					left_icon = root
					add_intrigue_skill = 1
				}
			}
			10 = {
				trigger = {
					exists = scope:war
				}
				
				send_interface_toast = {
					title = skill_increased
					left_icon = root
					add_martial_skill = 1
				}
			}
			10 = {
				trigger = {
					exists = scope:relationships
				}
				
				send_interface_toast = {
					title = skill_increased
					left_icon = root
					add_stewardship_skill = 1
				}
			}
			10 = {
				trigger = {
					exists = scope:childhood
				}
				
				send_interface_toast = {
					title = skill_increased
					left_icon = root
					add_learning_skill = 1
				}
			}
		}
		
		stress_impact = {
			lazy = major_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				has_trait = lazy
			}
		}
	}

	option = { # zzz
		name = childhood.7500.b
		
		stress_impact = {
			base = minor_stress_impact_loss
			lazy = medium_stress_impact_loss
			diligent = miniscule_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				NOT = {
					has_trait = lazy
				}
			}
		}
	}
}
