﻿# Events for children centering around the relationships bully/crush/friend

namespace = childhood

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

# 0000-0999:	- Child gains relationship status events
# 0010-0012:	- Response events for crush/bully/friend
# 0900-0999:	- Crush + bully relationship into opinion modifiers on adulthood
# 1000-1999:	- Events related to the relationships crush/bully/friend/ward
# 1015-1019:	- Child studies with friend/crush
# 2000-2999:	- Random events

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

##################################################
#
# Child gains relationship status events
# by Linnéa Thimrén, reworked by Alexander Oltner
#
##################################################

# Get a Crush
childhood.0001 = {
	type = character_event
	title = childhood.0002.t
	desc = {
		desc = childhood.0002.opening
		first_valid = {
			random_valid = {
				triggered_desc = {
					trigger = {
						scope:crush = {
							OR = {
								has_trait = bossy
								has_trait = curious
								has_trait = rowdy
							}
						}
					}
					desc = childhood.0002.loud
				}
				triggered_desc = {
					trigger = {
						scope:crush = {
							has_trait = pensive
						}
					}
					desc = childhood.0002.quiet
				}
			}
			desc = childhood.0002.fallback
		}
		desc = childhood.0002.end
	}

	theme = seduction
	override_background = { reference = garden }
	
	left_portrait = {
		character = root
		animation = admiration
	}
	right_portrait = {
		character = scope:crush
		animation = happiness
	}
	
	cooldown = { years = 2 }

	trigger = {
		num_of_relation_crush <= 0
		NOT = {
			has_trait = chaste
		}
		OR = {
			has_sexuality = heterosexual
			has_sexuality = bisexual
			has_sexuality = homosexual
		}
		OR = {
			any_vassal = {
				save_good_crush_character_trigger_check = yes
			}
			any_vassal = {
				any_child = {
					save_good_crush_character_trigger_check = yes
				}
			}
			any_courtier_or_guest = {
				save_good_crush_character_trigger_check = yes
			}
			AND = {
				top_liege != this
				liege ?= {
					save_good_crush_character_trigger_check = yes
				}
			}
			AND = {
				top_liege != this
				liege ?= {
					any_vassal = {
						save_good_crush_character_trigger_check = yes
					}
				}
			}
			AND = {
				top_liege != this
				liege ?= {
					any_vassal = {
						any_child = {
							save_good_crush_character_trigger_check = yes
						}
					}
				}
			}
			AND = {
				top_liege != this
				liege ?= {
					any_courtier_or_guest = {
						save_good_crush_character_trigger_check = yes
					}
				}
			}
		}
	}

	immediate = {
		play_music_cue = "mx_cue_touching_moment"
		every_vassal = {
			limit = {
				save_good_crush_character_trigger_check = yes
			}
			add_to_list = crushes
		}
		every_vassal = {
			every_child = {
				limit = {
					save_good_crush_character_trigger_check = yes
				}
				add_to_list = crushes
			}
		}
		every_courtier_or_guest = {
			limit = {
				save_good_crush_character_trigger_check = yes
			}
			add_to_list = crushes
		}
		if = {
			limit = {
				top_liege != this
				liege ?= {
					save_good_crush_character_trigger_check = yes
				}
			}
			liege = {
				add_to_list = crushes
			}
		}
		if = {
			limit = {
				top_liege != this
				liege ?= {
					any_vassal = {
						save_good_crush_character_trigger_check = yes
					}
				}
			}
			liege = {
				every_vassal = {
					limit = {
						save_good_crush_character_trigger_check = yes
					}
					add_to_list = crushes
				}
			}
		}
		if = {
			limit = {
				top_liege != this
				liege ?= {
					any_vassal = {
						any_child = {
							save_good_crush_character_trigger_check = yes
						}
					}
				}
			}
			liege = {
				every_vassal = {
					every_child = {
						limit = {
							save_good_crush_character_trigger_check = yes
						}
						add_to_list = crushes
					}
				}
			}
		}
		if = {
			limit = {
				top_liege != this
				liege ?= {
					any_courtier_or_guest = {
						save_good_crush_character_trigger_check = yes
					}
				}
			}
			liege = {
				every_courtier_or_guest = {
					limit = {
						save_good_crush_character_trigger_check = yes
					}
					add_to_list = crushes
				}
			}
		}
		
		random_in_list = {
			list = crushes
			weight = {
				base = 1
				modifier = {
					add = 10
					top_liege != this
					exists = liege
					is_primary_heir_of = liege
				}
				modifier = {
					add = 5
					top_liege != this
					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 = crush
		}
	}

	option = {
		name = childhood.0002.a
		set_relation_crush = scope:crush
		add_stress = minor_stress_impact_loss
		save_scope_as = crush_holder
		scope:crush = {
			trigger_event = childhood.0012
		}
		
		ai_chance = {
			base = 90
		}
	}
	option = {
		name = childhood.0002.b
		
		if = {
			limit = {
				scope:crush = {
					is_ai = yes
				}
			}
			progress_towards_friend_effect = {
				CHARACTER = scope:crush
				OPINION = 10
				REASON = friend_childhood_friendzoned
			}
		}
		
		stress_impact = {
			base = minor_stress_impact_gain
			lustful = minor_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				factor = 0
				has_trait = lustful
			}
		}
	}
}

# Get a Friend
childhood.0003 = {
	type = character_event
	title = childhood.0004.t
	desc = {
		desc = childhood.0004.desc1
		triggered_desc = {
			trigger = {
				is_adult = no
			}
			desc = {
				desc = double_line_break
				first_valid = {
					triggered_desc = {
						trigger= {
							scope:friend = {
								has_trait = rowdy
							}
						}
						desc = childhood_0004.desc3_rowdy
					}
					triggered_desc = {
						trigger= {
							scope:friend = {
								has_trait = charming
							}
						}
						desc = childhood_0004.desc3_charming
					}
					triggered_desc = {
						trigger= {
							scope:friend = {
								has_trait = curious
							}
						}
						desc = childhood_0004.desc3_curious
					}
					triggered_desc = {
						trigger= {
							scope:friend = {
								has_trait = pensive
							}
						}
						desc = childhood_0004.desc3_pensive
					}
					triggered_desc = {
						trigger= {
							scope:friend = {
								has_trait = bossy
							}
						}
						desc = childhood_0004.desc3_bossy
					}
					desc = childhood_0004.desc3_fallback
				}
			}
		}
	}
	theme = friendly
	override_background = { reference = corridor_day }
	left_portrait = {
		character = root
		animation = ecstasy
	}
	right_portrait = {
		character = scope:friend
		animation = happiness
	}

	trigger = {
		age >= 4
		is_adult = no
		NOT = {
			has_trait = paranoid
		}
		OR = {
			any_vassal = {
				save_good_friend_character_trigger_check = yes
				is_ai = yes
			}
			any_vassal = {
				any_child = {
					save_good_friend_character_trigger_check = yes
					is_ai = yes
				}
			}
			any_courtier_or_guest = {
				save_good_friend_character_trigger_check = yes
				is_ai = yes
			}
			AND = {
				top_liege != this
				liege ?= {
					save_good_friend_character_trigger_check = yes
					is_ai = yes
				}
			}
			AND = {
				top_liege != this
				liege ?= {
					any_vassal = {
						save_good_friend_character_trigger_check = yes
						is_ai = yes
					}
				}
			}
			AND = {
				top_liege != this
				liege ?= {
					any_vassal = {
						any_child = {
							save_good_friend_character_trigger_check = yes
							is_ai = yes
						}
					}
				}
			}
			AND = {
				top_liege != this
				liege ?= {
					any_courtier_or_guest = {
						save_good_friend_character_trigger_check = yes
						is_ai = yes
					}
				}
			}
		}
	}

	weight_multiplier = {
		base = 1
		modifier = {
			factor = -0.2
			any_relation = { type = friend count = 1 }
		}
		modifier = {
			factor = -0.5
			any_relation = { type = friend count >= 2 }
		}
	}

	immediate = {
		play_music_cue = "mx_cue_touching_moment"
		every_vassal = {
			limit = {
				save_good_friend_character_trigger_check = yes
				is_ai = yes
			}
			add_to_list = friends
		}
		every_vassal = {
			every_child = {
				limit = {
					save_good_friend_character_trigger_check = yes
					is_ai = yes
				}
				add_to_list = friends
			}
		}
		every_courtier_or_guest = {
			limit = {
				save_good_friend_character_trigger_check = yes
				is_ai = yes
			}
			add_to_list = friends
		}
		if = {
			limit = {
				top_liege != this
				liege ?= {
					save_good_friend_character_trigger_check = yes
					is_ai = yes
				}
			}
			liege = {
				add_to_list = friends
			}
		}
		if = {
			limit = {
				top_liege != this
				liege ?= {
					any_vassal = {
						save_good_friend_character_trigger_check = yes
						is_ai = yes
					}
				}
			}
			liege = {
				every_vassal = {
					limit = {
						save_good_friend_character_trigger_check = yes
						is_ai = yes
					}
					add_to_list = friends
				}
			}
		}
		if = {
			limit = {
				top_liege != this
				liege ?= {
					any_vassal = {
						any_child = {
							save_good_friend_character_trigger_check = yes
							is_ai = yes
						}
					}
				}
			}
			liege = {
				every_vassal = {
					every_child = {
						limit = {
							save_good_friend_character_trigger_check = yes
							is_ai = yes
						}
						add_to_list = friends
					}
				}
			}
		}
		if = {
			limit = {
				top_liege != this
				liege ?= {
					any_courtier_or_guest = {
						save_good_friend_character_trigger_check = yes
						is_ai = yes
					}
				}
			}
			liege = {
				every_courtier_or_guest = {
					limit = {
						save_good_friend_character_trigger_check = yes
						is_ai = yes
					}
					add_to_list = friends
				}
			}
		}
		
		random_in_list = {
			list = 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
				}
				modifier = {
					add = 5
					number_of_personality_traits_in_common = {
						target = root
						value >= 1
					}
				}
				modifier = {
					add = 5
					number_of_personality_traits_in_common = {
						target = root
						value >= 2
					}
				}
				modifier = {
					add = 5
					number_of_personality_traits_in_common = {
						target = root
						value >= 3
					}
				}
				modifier = {
					add = -5
					has_trait = shy
				}
				modifier = {
					add = -10
					has_trait = paranoid
				}
			}
			save_scope_as = friend
			set_favorite_toy_effect = yes
		}
		save_scope_as = child
	}

	option = { # Become Best Friends
		name = childhood.0004.a_alt
		trait = charming
		trait = gregarious
		trigger = {
			OR = {
				has_trait = charming
				has_trait = gregarious
			}
			can_set_relation_best_friend_trigger = { CHARACTER = scope:friend }
		}
		if = {
			limit = {
				can_set_relation_best_friend_trigger = { CHARACTER = scope:friend }
			}
			set_relation_best_friend = { reason = best_friend_childhood_oath copy_reason = friend target = scope:friend }
		}
		
		stress_impact = {
			arrogant = medium_stress_impact_gain
			sadistic = medium_stress_impact_gain
			callous = medium_stress_impact_gain
			shy = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = arrogant
					has_trait = sadistic
					has_trait = callous
					has_trait = shy
				}
			}
		}
	}
	option = { # Become friends
		name = childhood.0013.a
		if = {
			limit = {
				can_set_relation_friend_trigger = { CHARACTER = scope:friend }
			}
			set_relation_friend = { reason = friend_shared_toy target = scope:friend }
		}

		stress_impact = {
			sadistic = medium_stress_impact_gain
			callous = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = sadistic
					has_trait = callous
				}
			}
		}
	}
	option = { # Start bullying the other kid
		name = childhood.0004.c_alt
		trait = rowdy
		trait = sadistic
		trigger = {
			OR = {
				has_trait = rowdy
				has_trait = sadistic
			}
			can_set_relation_victim_trigger = { CHARACTER = scope:friend }
		}
		random = {
			chance = 50
			send_interface_toast = {
				type = event_toast_effect_good
				title = skill_increased
				left_icon = root
				add_intrigue_skill = 1
			}
		}
		scope:friend = {
			add_opinion = {
				target = root
				modifier = how_could_you_opinion
				opinion = -50
			}
		}
		if = {
			limit = {
				can_set_relation_victim_trigger = { CHARACTER = scope:friend }
			}
			set_relation_victim = scope:friend
		}
		
		create_character_memory = {
			type = childhood_started_bullying_positive
			
			participants = {
				victim = scope:friend
			}
		}
		
		stress_impact = {
			base = medium_stress_impact_gain
			just = medium_stress_impact_gain
			gregarious = medium_stress_impact_gain
			sadistic = massive_stress_impact_loss
			callous = major_stress_impact_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				NOR = {
					has_trait = sadistic
					has_trait = callous
				}
			}
		}
	}
	option = {
		name = childhood.0004.d
		
		scope:friend = {
			add_opinion = {
				target = root
				modifier = annoyed_opinion
				opinion = -25
			}
			
			hidden_effect = {
				random = {
					chance = 50
					if = {
						limit = {
							can_set_relation_potential_rival_trigger = { CHARACTER = root }
						}
						set_relation_potential_rival = root
					}
				}
			}
			pay_short_term_gold = {
				target = root
				gold = tiny_gold_value
			}
		}
		
		stress_impact = {
			base = minor_stress_impact_gain
			generous = massive_stress_impact_gain
			compassionate = medium_stress_impact_gain
			just = medium_stress_impact_gain
			charming = minor_stress_impact_gain
			pensive = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				NOR = {
					has_trait = greedy
					has_trait = arbitrary
				}
			}
		}
	}
}

# Get a Bully
childhood.0005 = {
	type = character_event
	title = childhood.0006.t
	 desc = {
		desc = childhood.0006.opening
		first_valid = {
			random_valid = {
				triggered_desc = {
					trigger = {
						scope:bully = {
							childhood_mean_child_trigger = yes
						}
					}
					desc = childhood.0006.mean
				}
				triggered_desc = {
					trigger = {
						scope:bully = {
							childhood_loud_child_trigger = yes
						}
					}
					desc = childhood.0006.loud
				}
				triggered_desc = {
					trigger = {
						scope:bully = {
							childhood_quiet_child_trigger = yes
						}
					}
					desc = childhood.0006.quiet
				}
				triggered_desc = {
					trigger = {
						scope:bully = {
							childhood_nice_child_trigger = yes
						}
					}
					desc = childhood.0006.nice
				}
			}
			desc = childhood.0006.fallback
		}
		desc = childhood.0006.toy
		desc = double_line_break
		desc = childhood.0006.end
	}
	theme = unfriendly
	override_background = { reference = corridor_night }
	left_portrait = {
		character = root
		animation = sadness
	}
	right_portrait = {
		character = scope:bully
		animation = schadenfreude
	}

	trigger = {
		age >= 4
		is_adult = no
		OR = {
			any_vassal = {
				save_good_bully_character_trigger_check = yes
				is_ai = yes
			}
			any_vassal = {
				any_child = {
					save_good_bully_character_trigger_check = yes
					is_ai = yes
				}
			}
			any_courtier_or_guest = {
				save_good_bully_character_trigger_check = yes
				is_ai = yes
			}
			AND = {
				top_liege != this
				liege ?= {
					save_good_bully_character_trigger_check = yes
					is_ai = yes
				}
			}
			AND = {
				top_liege != this
				liege ?= {
					any_vassal = {
						save_good_bully_character_trigger_check = yes
						is_ai = yes
					}
				}
			}
			AND = {
				top_liege != this
				liege ?= {
					any_vassal = {
						any_child = {
							save_good_bully_character_trigger_check = yes
							is_ai = yes
						}
					}
				}
			}
			AND = {
				top_liege != this
				liege ?= {
					any_courtier_or_guest = {
						save_good_bully_character_trigger_check = yes
						is_ai = yes
					}
				}
			}
		}
	}

	weight_multiplier = {
		base = 1
		modifier = {
			factor = -0.2
			any_relation = { type = bully count = 1 }
		}
		modifier = {
			factor = -0.5
			any_relation = { type = bully count >= 2 }
		}
	}
	
	immediate = {
		every_vassal = {
			limit = {
				save_good_bully_character_trigger_check = yes
				is_ai = yes
			}
			add_to_list = bullies
		}
		every_vassal = {
			every_child = {
				limit = {
					save_good_bully_character_trigger_check = yes
					is_ai = yes
				}
				add_to_list = bullies
			}
		}
		every_courtier_or_guest = {
			limit = {
				save_good_bully_character_trigger_check = yes
				is_ai = yes
			}
			add_to_list = bullies
		}
		if = {
			limit = {
				top_liege != this
				liege ?= {
					save_good_bully_character_trigger_check = yes
					is_ai = yes
				}
			}
			liege = {
				add_to_list = bullies
			}
		}
		if = {
			limit = {
				top_liege != this
				liege ?= {
					any_vassal = {
						save_good_bully_character_trigger_check = yes
						is_ai = yes
					}
				}
			}
			liege = {
				every_vassal = {
					limit = {
						save_good_bully_character_trigger_check = yes
						is_ai = yes
					}
					add_to_list = bullies
				}
			}
		}
		if = {
			limit = {
				top_liege != this
				liege ?= {
					any_vassal = {
						any_child = {
							save_good_bully_character_trigger_check = yes
							is_ai = yes
						}
					}
				}
			}
			liege = {
				every_vassal = {
					every_child = {
						limit = {
							save_good_bully_character_trigger_check = yes
							is_ai = yes
						}
						add_to_list = bullies
					}
				}
			}
		}
		if = {
			limit = {
				top_liege != this
				liege ?= {
					any_courtier_or_guest = {
						save_good_bully_character_trigger_check = yes
						is_ai = yes
					}
				}
			}
			liege = {
				every_courtier_or_guest = {
					limit = {
						save_good_bully_character_trigger_check = yes
						is_ai = yes
					}
					add_to_list = bullies
				}
			}
		}
		
		random_in_list = {
			list = bullies
			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
				}
				modifier = {
					add = 5
					number_of_opposing_personality_traits = {
						target = root
						value >= 1
					}
				}
				modifier = {
					add = 5
					number_of_opposing_personality_traits = {
						target = root
						value >= 2
					}
				}
				modifier = {
					add = 5
					number_of_opposing_personality_traits = {
						target = root
						value >= 3
					}
				}
				modifier = {
					add = 5
					has_trait = wrathful
				}
				modifier = {
					add = 10
					has_trait = sadistic
				}
			}
			save_scope_as = bully
		}
		play_music_cue = "mx_cue_prison"
		save_scope_as = victim
		set_favorite_toy_effect = yes
	}

	option = {
		name = childhood.0006.a
		if = {
			limit = {
				NOT = { has_relation_bully = scope:bully }
			}
			set_relation_bully = scope:bully
		}
		stress_impact = {
			base = miniscule_stress_impact_gain
			wrathful = minor_stress_impact_gain
			impatient = minor_stress_impact_gain
			vengeful = minor_stress_impact_gain
		}
		ai_chance = {
			base = 90
			modifier = {
				factor = 0
				prowess >= scope:bully.prowess
				OR = {
					has_trait = wrathful
					has_trait = impatient
					has_trait = vengeful
				}
			}
		}
	}

	option = {
		name = childhood.0006.b
		
		duel = {
			skill = prowess
			value = scope:bully.prowess

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

				desc = childhood.0006.b.critical_success
				send_interface_toast = {
					type = event_toast_effect_good
					title = childhood.0006.b.critical_success
					left_icon = root
					right_icon = scope:bully
					add_martial_skill = 2
					add_prowess_skill = 2
					if = {
						limit = {
							scope:bully = {
								any_close_family_member = {
									exists = this
									is_alive = yes
								}
							}
						}
						scope:bully = {
							every_close_family_member = {
								custom = every_family_member_tt
								add_opinion = {
									target = root
									modifier = accidentally_killed_family_opinion
									opinion = -40
								}
							}
						}
					}
					if = {
						limit = {
							OR = {
								liege = scope:bully
								scope:bully = {
									any_close_family_member = {
										exists = this
										is_alive = yes
										this = root.liege
									}
								}
							}
						}
						rightfully_imprison_character_less_verbose_effect = {
							TARGET = root
							IMPRISONER = root.liege
						}
					}
					scope:bully = {
						death = {
							death_reason = death_beaten
							killer = root
						}
					}
				}
			}

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

				desc = childhood.0006.b.success
				send_interface_toast = {
					type = event_toast_effect_good
					title = childhood.0006.b.success
					left_icon = root
					right_icon = scope:bully
					add_martial_skill = 1
					add_prowess_skill = 1
				}
			}
			40 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}

				desc = childhood.0006.b.failure
				send_interface_toast = {
					type = event_toast_effect_bad
					title = childhood.0006.b.failure
					left_icon = root
					right_icon = scope:bully
					if = {
						limit = {
							NOT = { has_relation_bully = scope:bully }
						}
						set_relation_bully = scope:bully
					}
				}
				
			}
			9 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}

				desc = childhood.0006.b.critical_failure
				send_interface_toast = {
					type = event_toast_effect_bad
					title = childhood.0006.b.critical_failure
					left_icon = root
					right_icon = scope:bully
					if = {
						limit = {
							NOT = { has_relation_nemesis = scope:bully }
						}
						set_relation_nemesis = {
							target = scope:bully
							reason = nemesis_bully_beating
						}
					}
					increase_wounds_effect = { REASON = fight }
					epilepsy_brain_trauma_risk_effect = { CHANCE = 5 }
				}
			}
			1 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}

				desc = childhood.0006.b.death
				send_interface_toast = {
					type = event_toast_effect_bad
					title = childhood.0006.b.death
					left_icon = root
					right_icon = scope:bully
					death = {
						death_reason = death_beaten
						killer = scope:bully
					}
				}
			}
		}
		if = {
			limit = {
				is_alive = yes
			}
			stress_impact = {
				compassionate = minor_stress_impact_gain
				patient = minor_stress_impact_gain
				forgiving = major_stress_impact_gain
				pensive = minor_stress_impact_gain
			}
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				NOR = {
					has_trait = wrathful
					has_trait = impatient
					has_trait = vengeful
				}
			}
		}
	}

	option = {
		name = childhood.0006.c
		
		pay_short_term_gold = {
			target = scope:bully
			gold = 5
		}
		random = {
			chance = 50
			send_interface_toast = {
				type = event_toast_effect_neutral
				title = childhood.0006.c_leave
				left_icon = root
				right_icon = scope:bully
				if = {
					limit = {
						NOT = { has_relation_bully = scope:bully }
					}
					set_relation_bully = scope:bully
				}
			}
		}
		stress_impact = {
			greedy = major_stress_impact_gain
			vengeful = minor_stress_impact_gain
			wrathful = minor_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				factor = 0
				prowess >= scope:bully.prowess
				OR = {
					has_trait = wrathful
					has_trait = impatient
					has_trait = vengeful
				}
			}
		}
	}
}

# Get a Victim
childhood.0007 = {
	type = character_event
	title = childhood.0008.t
	desc = {
		desc = childhood.0008.desc
		first_valid = {
			random_valid = {
				triggered_desc = {
					trigger = {
						scope:victim = {
							childhood_mean_child_trigger = yes
						}
					}
					desc = childhood.0008.mean
				}
				triggered_desc = {
					trigger = {
						scope:victim = {
							childhood_loud_child_trigger = yes
						}
					}
					desc = childhood.0008.loud
				}
				triggered_desc = {
					trigger = {
						scope:victim = {
							childhood_quiet_child_trigger = yes
						}
					}
					desc = childhood.0008.quiet
				}
				triggered_desc = {
					trigger = {
						scope:victim = {
							 childhood_nice_child_trigger = yes
						}
					}
					desc = childhood.0008.nice
				}
			}
			desc = childhood.0008.fallback
		}
		desc = double_line_break
		first_valid = {
			random_valid = {
				triggered_desc = {
					trigger = {
						has_trait = rowdy
					}
					desc = childhood.0009.desc1
				}
				triggered_desc = {
					trigger = {
						OR = {
							has_trait = bossy
							has_trait = curious
						}
					}
					desc = childhood.0009.desc2
				}
				triggered_desc = {
					trigger = {
						OR = {
							has_trait = charming
							has_trait = pensive
							has_trait = bossy
						}
					}
					desc = childhood.0009.desc3
				}
			}
			desc = childhood.0009.fallback
		}
	}
	left_portrait = {
		character = root
		animation = schadenfreude
	}
	right_portrait = {
		character = scope:victim
		animation = grief
	}
	
	theme = unfriendly
	
	trigger = {
		age >= 4
		is_adult = no
		NOR = {
			has_trait = compassionate
			has_trait = forgiving
		}
		OR = {
			any_vassal = {
				save_good_victim_character_trigger_check = yes
				is_ai = yes
			}
			any_vassal = {
				any_child = {
					save_good_victim_character_trigger_check = yes
					is_ai = yes
				}
			}
			any_courtier_or_guest = {
				save_good_victim_character_trigger_check = yes
				is_ai = yes
			}
			AND = {
				top_liege != this
				liege ?= {
					save_good_victim_character_trigger_check = yes
					is_ai = yes
				}
			}
			AND = {
				top_liege != this
				liege ?= {
					any_vassal = {
						save_good_victim_character_trigger_check = yes
						is_ai = yes
					}
				}
			}
			AND = {
				top_liege != this
				liege ?= {
					any_vassal = {
						any_child = {
							save_good_victim_character_trigger_check = yes
							is_ai = yes
						}
					}
				}
			}
			AND = {
				top_liege != this
				liege ?= {
					any_courtier_or_guest = {
						save_good_victim_character_trigger_check = yes
						is_ai = yes
					}
				}
			}
		}
	}

	weight_multiplier = {
		base = 1
		modifier = {
			factor = 1.5
			has_trait = sadistic
		}
		modifier = {
			factor = 1.25
			has_trait = callous
		}
		modifier = {
			factor = -0.5
			has_trait = patient
		}
		modifier = {
			factor = -0.2
			any_relation = { type = victim count = 1 }
		}
		modifier = {
			factor = -0.5
			any_relation = { type = victim count >= 2 }
		}
	}
	
	immediate = {
		play_music_cue = "mx_cue_stress"
		every_vassal = {
			limit = {
				save_good_victim_character_trigger_check = yes
				is_ai = yes
			}
			add_to_list = victims
		}
		every_vassal = {
			every_child = {
				limit = {
					save_good_victim_character_trigger_check = yes
					is_ai = yes
				}
				add_to_list = victims
			}
		}
		every_courtier_or_guest = {
			limit = {
				save_good_victim_character_trigger_check = yes
				is_ai = yes
			}
			add_to_list = victims
		}
		if = {
			limit = {
				top_liege != this
				liege ?= {
					save_good_victim_character_trigger_check = yes
					is_ai = yes
				}
			}
			liege = {
				add_to_list = victims
			}
		}
		if = {
			limit = {
				top_liege != this
				liege ?= {
					any_vassal = {
						save_good_victim_character_trigger_check = yes
						is_ai = yes
					}
				}
			}
			liege = {
				every_vassal = {
					limit = {
						save_good_victim_character_trigger_check = yes
						is_ai = yes
					}
					add_to_list = victims
				}
			}
		}
		if = {
			limit = {
				top_liege != this
				liege ?= {
					any_vassal = {
						any_child = {
							save_good_victim_character_trigger_check = yes
							is_ai = yes
						}
					}
				}
			}
			liege = {
				every_vassal = {
					every_child = {
						limit = {
							save_good_victim_character_trigger_check = yes
							is_ai = yes
						}
						add_to_list = victims
					}
				}
			}
		}
		if = {
			limit = {
				top_liege != this
				liege ?= {
					any_courtier_or_guest = {
						save_good_victim_character_trigger_check = yes
						is_ai = yes
					}
				}
			}
			liege = {
				every_courtier_or_guest = {
					limit = {
						save_good_victim_character_trigger_check = yes
						is_ai = yes
					}
					add_to_list = victims
				}
			}
		}
		
		random_in_list = {
			list = victims
			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
				}
				modifier = {
					add = 5
					number_of_opposing_personality_traits = {
						target = root
						value >= 1
					}
				}
				modifier = {
					add = 5
					number_of_opposing_personality_traits = {
						target = root
						value >= 2
					}
				}
				modifier = {
					add = 5
					number_of_opposing_personality_traits = {
						target = root
						value >= 3
					}
				}
				modifier = {
					add = 5
					has_trait_submissive_trigger = yes
				}
				modifier = {
					add = 10
					has_trait = trusting
				}
			}
			save_scope_as = victim
			set_favorite_toy_effect = yes
		}
		save_scope_as = bully
	}

	option = {
		name = childhood.0008.c
		trigger = {
			can_start_scheme = {
				type = murder
				target_character = scope:victim
			}
		}
		if = {
			limit = {
				NOT = { has_relation_victim = scope:victim }
			}
			set_relation_victim = scope:victim
		}
		scope:victim = {
			add_stress = medium_stress_impact_gain
		}
		if = {
			limit = {
				NOT = {
					any_scheme = {
						type = murder
						scheme_target_character = scope:victim
					}
				}
			}
			start_scheme = {
				target_character = scope:victim
				type = murder
			}
		}
		custom_tooltip = diplomacy_family.2250.b.tt
		hidden_effect = {
			random_scheme = {
				type = murder
				limit = {
					scheme_target_character = scope:victim
				}
				add_scheme_modifier = {
					type = extra_success_chance_modifier
				}
			}
		}
		
		if = {
			limit = {
				OR = {
					has_trait = sadistic
					has_trait = callous
				}
			}
			create_character_memory = {
				type = childhood_started_bullying_positive
				
				participants = {
					victim = scope:victim
				}
			}
		}
		ai_chance = {
			base = 25
			modifier = {
				factor = 0
				NOR = {
					has_trait = sadistic
					has_trait = callous
				}
			}
		}
		stress_impact = {
			base = medium_stress_impact_loss
			callous = medium_stress_impact_loss
			wrathful = medium_stress_impact_loss
			sadistic = major_stress_impact_loss
			patient = major_stress_impact_gain
			charming = major_stress_impact_gain
			pensive = major_stress_impact_gain
		}
	}

	option = {
		name = childhood.0008.a
		if = {
			limit = {
				NOT = { has_relation_victim = scope:victim }
			}
			set_relation_victim = scope:victim
		}
		scope:victim = {
			add_stress = medium_stress_impact_gain
		}
		
		if = {
			limit = {
				OR = {
					has_trait = sadistic
					has_trait = callous
				}
			}
			create_character_memory = {
				type = childhood_started_bullying_positive
				
				participants = {
					victim = scope:victim
				}
			}
		}
		
		ai_chance = {
			base = 75
			modifier = {
				factor = 0
				has_trait = patient
			}
		}
		stress_impact = {
			base = medium_stress_impact_loss
			patient = medium_stress_impact_gain
		}
	}

	option = {
		name = childhood.0008.b
		scope:victim = {
			add_opinion = {
				modifier = friendly_interaction
				target = root
			}
		}
		ai_chance = {
			base = 25
			modifier = {
				factor = 0
				OR = {
					has_trait = wrathful
					has_trait = sadistic
					has_trait = vengeful
				}
			}
		}
		stress_impact = {
			base = minor_stress_impact_gain
			wrathful = medium_stress_impact_gain
			sadistic = medium_stress_impact_gain
			vengeful = medium_stress_impact_gain
		}
	}
}

# Response event for crush
childhood.0012 = {
	type = character_event
	title = childhood.0012.t
	desc = childhood.0012.desc
	theme = friendly
	override_background = { reference = garden }
	
	left_portrait = {
		character = root
		animation = happiness
	}
	right_portrait = {
		character = scope:crush_holder
		animation = admiration
	}

	trigger = {
		is_alive = yes
		scope:crush_holder = {
			is_alive = yes
		}
	}

	immediate = {
		scope:crush_holder = {
			save_scope_as = crushed_crush
		}
	}

	option = {
		name = childhood.0012.a
		
		scope:crush_holder = {
			send_interface_toast = {
				type = event_toast_effect_neutral
				title = crush_returned
				left_icon = scope:crush
				root = {
					if = {
						limit = {
							NOT = { has_relation_crush = scope:crush_holder }
						}
						set_relation_crush = scope:crush_holder
					}
				}
			}
		}
		
		stress_impact = {
			celibate = minor_stress_impact_gain
			chaste = minor_stress_impact_gain
			shy = minor_stress_impact_gain
			paranoid = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = chaste
					has_trait = celibate
				}
			}
		}
	}
	option = {
		name = childhood.0012.b
		set_variable = {
			name = unrequited_crush
			value = scope:crushed_crush
		}
		
		scope:crush_holder = {
			if = {
				limit = {
					exists = scope:potential_friendship_end
				}
				random_list = {
					50 = {
						send_interface_toast = {
							type = event_toast_effect_bad
							title = crush_crushed_hard
							left_icon = scope:crush
							add_stress = medium_stress_impact_gain
							scope:crush = {
								remove_relation_friend = scope:crush_holder
							}
							random = {
								chance = 3
								if = {
									limit = {
										NOT = { has_trait = depressed_1 }
									}
									add_trait = depressed_1
								}
							}
						}
					}
					50 = {
						send_interface_toast = {
							type = event_toast_effect_neutral
							title = crush_crushed
							left_icon = scope:crush
							add_stress = miniscule_stress_impact_gain
						}
					}
				}
			}
			else = {
				send_interface_toast = {
					type = event_toast_effect_neutral
					title = crush_crushed
					left_icon = scope:crush
					add_stress = miniscule_stress_impact_gain
				}
			}
		}
		
		stress_impact = {
			lustful = minor_stress_impact_gain
			gregarious = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = lustful
					has_trait = gregarious
				}
			}
		}
	}
}


##################################################
#
# Crush + bully relationship into opinion modifiers on adulthood
# by Linnéa Thimrén
#
##################################################

# victim transforms into opinion modifier on adulthood
# by Linnéa Thimrén
childhood.0900 = {
	type = character_event
	hidden = yes
	
	trigger = {
		any_relation = { type = victim }
	}

	immediate = {
		if = {
			limit = {
				any_relation = { type = victim }
			}
			random_relation = { type = victim save_scope_as = victim }
			if = {
				limit = {
					is_ai = no
				}
				set_variable = {
					name = had_childhood_victim_variable
					value = scope:victim
				}
			}
		}
		add_opinion = {
			modifier = childhood_victim
			target = scope:victim
		}
		if = {
			limit = {
				NOT = { has_relation_potential_rival = scope:victim }
			}
			hidden_effect = {
				set_relation_potential_rival = scope:victim
			}
		}
		if = {
			limit = {
				any_relation = { type = victim }
			}
			remove_relation_victim = scope:victim
		}
		save_scope_as = bully
		scope:victim = {
			trigger_event = childhood.0901
		}
	}
}

# Response event for victim, bully is now an adult
# by Linnéa Thimrén
childhood.0901 = {
	type = character_event
	title = childhood.0910.t
	desc = {
		desc = childhood.0910.opening
		first_valid = {
			triggered_desc = {
				trigger = {
					NOT = { has_character_flag = bully_destroyed_toy }
				}
				desc = childhood.0910.desc1
			}
			triggered_desc = {
				trigger = {
					has_character_flag = bully_destroyed_toy
				}
				desc = childhood.0910.desc2
			}
		}
	}
	theme = unfriendly
	left_portrait = scope:bully

	immediate = {
		if = {
			limit = {
				is_ai = no
			}
			set_variable = {
				name = had_childhood_bully_variable
				value = scope:bully
			}
		}
	}

	option = {
		name = childhood.0910.a
		add_opinion = {
			modifier = childhood_bully
			target = scope:bully
		}
		if = {
			limit = {
				NOT = { has_relation_potential_rival = scope:bully }
			}
			hidden_effect = {
				set_relation_potential_rival = scope:bully
			}
		}
	}
}


# bully transforms into opinion modifier on adulthood
# by Linnéa Thimrén
childhood.0910 = {
	type = character_event
	hidden = yes
	
	trigger = {
		any_relation = { type = bully }	
	}

	immediate = {
		if = {
			limit = {
				any_relation = { type = bully }
			}
			random_relation = { type = bully save_scope_as = bully }
		}
		if = {
			limit = {
				is_ai = no
			}
			set_variable = {
				name = had_childhood_bully_variable
				value = scope:bully
			}
		}
		add_opinion = {
			modifier = childhood_bully
			target = scope:bully
		}
		if = {
			limit = {
				NOT = { has_relation_potential_rival = scope:bully }
			}
			hidden_effect = {
				set_relation_potential_rival = scope:bully
			}
		}
		if = {
			limit = {
				any_relation = { type = bully }
			}
			remove_relation_bully = scope:bully
		}
		save_scope_as = victim
		scope:bully = {
			trigger_event = childhood.0911
		}
	}
}


# Response event for bully, victim is now an adult
# by Linnéa Thimrén
childhood.0911 = {
	type = character_event
	title = childhood.0911.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					scope:victim = {
						has_relation_rival = prev
					}
				}
				desc = childhood.0911.desc_rival
			}
			triggered_desc = {
				trigger = {
					scope:victim = {
						NOT = { has_relation_rival = prev }
					}
				}
				desc = {
					desc = childhood.0911.opening
					triggered_desc = {
						trigger = {
							scope:victim = {
								NOT = { has_character_flag = bully_destroyed_toy }
							}
						}
						desc = childhood.0911.desc1
					}
					triggered_desc = {
						trigger = {
							scope:victim = {
								has_character_flag = bully_destroyed_toy
							}
						}
						desc = childhood.0911.desc2
					}
				}
			}
		}
	}
	theme = unfriendly
	left_portrait = scope:victim

	immediate = {
		if = {
			limit = {
				is_ai = no
			}
			set_variable = {
				name = had_childhood_victim_variable
				value = scope:victim
			}
		}
	}

	option = {
		name = childhood.0911.a
		add_opinion = {
			modifier= childhood_victim
			target = scope:victim
		}
		if = {
			limit = {
				NOT = { has_relation_potential_rival = scope:victim }
			}
			hidden_effect = {
				set_relation_potential_rival = scope:victim
			}
		}
	}
}

# crush transforms into opinion modifier on adulthood
# by Linnéa Thimrén
childhood.0998 = {
	type = character_event
	hidden = yes

	trigger = {
		OR = {
			any_relation = { type = crush }
			exists = var:unrequited_crush
		}
	}

	immediate = {
		# Grab scopes.
		if = {
			limit = {
				any_relation = { type = crush }
			}
			random_relation = {
				type = crush
				save_scope_as = crush
			}
		}
		# Automatic conversion.
		## REMEMBER TO MAKE SURE THE CRUSH IS OLDER THAN ROOT WHEN YOU SET THIS FLAG.
		if = {
			limit = {
				exists = scope:crush
				has_relation_flag = {
					target = scope:crush
					relation = crush
					flag = auto_progress_to_lover
				}
				is_ai = yes
				scope:crush = {
					is_ai = yes
					has_relation_crush = root
				}
			}
			remove_relation_crush = scope:crush
			scope:crush = { remove_relation_crush = root }
			set_relation_lover = {
				reason = lover_childhood_sweatheart
				target = scope:crush
			}
		}
		# Normal flow.
		else = {
			if = {
				limit = {
					exists = var:unrequited_crush
				}
				var:unrequited_crush = {
					save_scope_as = crushed_crush
				}
				scope:crushed_crush = {
					if = {
						limit = {
							is_ai = no
						}
						set_variable = {
							name = had_childhood_crush_variable
							value = root
						}
					}
				}
			}
			if = {
				limit = {
					is_ai = no
				}
				set_variable = {
					name = had_childhood_crush_variable
					value = scope:crush
				}
			}
			if = {
				limit = {
					exists = scope:crush
				}
				save_scope_as = root_crush
				scope:crush = {
					if = {
						limit = {
							has_relation_crush = root
						}
						add_character_flag = crush_over
						trigger_event = {
							id = childhood.0999
						}
					}
				}
			}
			if = {
				limit = {
					exists = var:unrequited_crush
				}
				save_scope_as = root_crush
				scope:crushed_crush = {
					if = {
						limit = {
							has_relation_crush = root
						}
						add_character_flag = crush_over
						add_character_flag = unrequited_crush
						trigger_event = {
							id = childhood.0999
						}
					}
				}
			}
			if = {
				limit = {
					exists = scope:crush
				}
				add_opinion = {
					modifier = childhood_crush
					target = scope:crush
				}
			}
			every_relation = {
				type = crush
				reverse_add_opinion = {
					modifier = childhood_crush
					target = root
				}
				root = {
					remove_relation_crush = prev
				}
			}
		}
	}
}

# Response event for crush
# by Linnéa Thimrén
childhood.0999 = {
	type = character_event
	title = childhood.0999.t
	desc = {
		desc = childhood.0999.desc
		triggered_desc = {
			trigger = {
				has_character_flag = unrequited_crush
			}
			desc = childhood.0999.desc_unrequited
		}
	}
	theme = friendly
	left_portrait = scope:root_crush
	
	trigger = {
		has_character_flag = crush_over	
	}

	immediate = {
		if = {
			limit = {
				NOT = { has_character_flag = unrequited_crush }
			}
			if = {
				limit = {
					is_ai = no
				}
				set_variable = {
					name = had_childhood_crush_variable
					value = scope:root_crush
				}
			}
		}
	}

	option = {
		name = childhood.0999.a
		add_opinion = {
			modifier = childhood_crush
			target = scope:root_crush
		}
		if = {
			limit = {
				has_relation_crush = scope:root_crush
			}
			remove_relation_crush = scope:root_crush
		}
	}
	after = {
		remove_character_flag = crush_over
		remove_character_flag = unrequited_crush
	}
}


##################################################
#
# Events related to the relationships crush/bully/friend/guardian
# by Linnéa Thimrén, revised by Alexander Oltner
#
##################################################

# Your friendship can turn into a crush
scripted_trigger childhood_1000_friend_sexuality_trigger = {
	is_available_ai_child = yes
	NOT = { root = { has_relation_crush = prev } }
	reverse_opinion = {
		target = root
		value >= low_positive_opinion
	}
	is_close_family_of_root_trigger = no
	save_temporary_scope_as = child_check
	matching_gender_and_sexuality_trigger = {
		CHARACTER_1 = scope:child_check
		CHARACTER_2 = root
	}
}

childhood.1000 = {
	type = character_event
	title = childhood.1000.t
	desc = childhood.1000.desc
	theme = seduction
	override_background = { reference = garden }
	left_portrait = {
		character = root
		animation = love
	}
	right_portrait = {
		character = scope:friend_to_crush
		animation = personality_content
	}
	
	cooldown = { years = 2 }
	
	trigger = {
		NOT = { has_sexuality = asexual }
		any_relation = {
			type = friend
			childhood_1000_friend_sexuality_trigger = yes
		}
	}

	immediate = {
		random_relation = {
			type = friend
			limit = {
				childhood_1000_friend_sexuality_trigger = yes
			}
			save_scope_as = friend_to_crush
			save_scope_as = crush
			set_favorite_treat_effect = yes
		}
	}
	option = {
		name = childhood.1000.b
		trait = charming
		trait = lustful
		trigger = {
			OR = {
				has_trait = lustful
				has_trait = charming
			}
		}
		set_relation_crush = scope:friend_to_crush
		scope:friend_to_crush = {
			set_relation_crush = root
			add_opinion = {
				modifier = sweet_opinion
				target = root
				opinion = 25
			}
		}
		
		stress_impact = {
			chaste = major_stress_impact_gain
			shy = medium_stress_impact_gain
			callous = minor_stress_impact_gain
			sadistic = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = chaste
					has_trait = shy
				}
			}
		}
	}
	option = {
		name = childhood.1000.a
		set_relation_crush = scope:friend_to_crush
		save_scope_as = crush_holder
		save_scope_as = potential_friendship_end
		custom_tooltip = risks_childhood.1000
		scope:friend_to_crush = {
			trigger_event = childhood.0012
		}
		
		stress_impact = {
			chaste = major_stress_impact_gain
			shy = medium_stress_impact_gain
			callous = minor_stress_impact_gain
			sadistic = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = chaste
					has_trait = shy
				}
			}
		}
	}
	option = {
		name = childhood.1000.c
		scope:friend_to_crush = {
			add_opinion = {
				modifier = friendliness_opinion
				target = root
				opinion = 15
			}
		}
		
		stress_impact = {
			lustful = major_stress_impact_gain
			charming = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = lustful
					has_trait = charming
				}
			}
		}
	}
}

# You make your bully stop being such a bully
childhood.1001 = {
	type = character_event
	title = childhood.1001.t
	desc = {
		desc = childhood.1001.opening
		first_valid = {
			random_valid = {
				triggered_desc = {
					trigger = {
						OR = {
							diplomacy >= scope:bully.diplomacy
							prowess >= scope:bully.prowess
						}
						exists = scope:bully
					}
					desc = childhood.1001.desc
				}
			}
			desc = childhood.1001.fallback	
		}
	}
	theme = unfriendly
	override_background = { reference = courtyard }
	left_portrait = {
		character = root
		animation = stress
	}
	right_portrait = {
		character = scope:bully
		animation = personality_vengeful
	}
	lower_center_portrait = scope:adult_friend

	cooldown = { years = 3 }
	
	trigger = {
		any_relation = {
			type = bully
			count >= 1
			is_available_ai_child = yes
			save_temporary_scope_as = bully_check
		}
		OR = {
			prowess >= scope:bully_check.prowess
			diplomacy >= scope:bully_check.diplomacy
		}
	}
	
	immediate = {
		play_music_cue = "mx_cue_stress"
		random_relation = {
			type = bully
			limit = {
				is_available_ai_child = yes
			}
			save_scope_as = bully
		}
		if = {
			limit = {
				any_relation = {
					type = friend
					is_available_ai_adult = yes
				}
			}
			random_relation = {
				type = friend
				limit = {
					is_available_ai_adult = yes
				}
				save_scope_as = adult_friend
			}
		}
	}

	option = {
		name = childhood.1001.d
		trigger = {
			exists = scope:adult_friend
		}
		
		scope:adult_friend = {
			add_opinion = {
				modifier = disappointed_opinion
				target = scope:bully
				opinion = -20
			}
		}
		
		remove_relation_bully = scope:bully
		
		scope:bully = {
			random = {
				chance = 5
				increase_wounds_effect = { REASON = beaten }
			}
		}
		
		stress_impact = {
			forgiving = miniscule_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				has_trait = forgiving
			}
		}
	}

	option = {
		name = childhood.1001.a
		trigger = {
			prowess >= scope:bully.prowess
		}
		duel = {
			skill = prowess
			target = scope:bully
			8 = {
				desc = childhood.1001.a.success
				compare_modifier = {
					value = scope:duel_value
				}
				send_interface_toast = {
					type = event_toast_effect_neutral
					left_icon = scope:bully
					title = childhood.1001.a.success
					remove_relation_bully = scope:bully
				}
			}
			4 = {
				desc = childhood.1001.a.failure
				send_interface_toast = {
					type = event_toast_effect_bad
					left_icon = scope:bully
					title = childhood.1001.a.failure
					increase_wounds_effect = { REASON = fight }
				}
			}
		}
		
		stress_impact = {
			craven = major_stress_impact_gain
			charming = miniscule_stress_impact_gain
			pensive = miniscule_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				has_trait = craven
			}
		}
	}
	
	option = {
		name = childhood.1001.b
		trigger = {
			diplomacy >= scope:bully.diplomacy
		}
		duel = {
			skill = diplomacy
			target = scope:bully
			8 = {
				desc = childhood.1001.b.success
				compare_modifier = {
					value = scope:duel_value
				}
				send_interface_toast = {
					type = event_toast_effect_neutral
					left_icon = scope:bully
					title = childhood.1001.b.success
					remove_relation_bully = scope:bully
				}
			}
			4 = {
				desc = childhood.1001.a.failure
				send_interface_toast = {
					type = event_toast_effect_bad
					title = childhood.1001.a.failure
					left_icon = scope:bully
					increase_wounds_effect = { REASON = fight }
				}
			}
		}
		
		stress_impact = {
			shy = major_stress_impact_gain
			rowdy = miniscule_stress_impact_gain
			bossy = miniscule_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				has_trait = shy
			}
		}
	}
	option = {
		name = childhood.1001.c
		random = {
			chance = 3
			if = {
				limit = {
					NOT = { has_trait = depressed_1 }
				}
				add_trait = depressed_1
			}
		}
		
		stress_impact = {
			shy = major_stress_impact_gain
			rowdy = miniscule_stress_impact_gain
			bossy = miniscule_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				NOR = {
					has_trait = shy
					has_trait = craven
				}
			}
		}
	}
}

# Parent is supportive
childhood.1002 = {
	type = character_event
	title = childhood.1002.t
	desc = {
		triggered_desc = {
			trigger = {
				exists = scope:guardian_parent
				OR = {
					has_focus = education_martial
					has_focus = education_intrigue
					has_focus = education_nht_prowess
				}
			}
			desc = childhood.1002.desc2
		}
		triggered_desc = {
			trigger = {
				exists = scope:guardian_parent
				OR = {
					has_focus = education_martial
					has_focus = education_intrigue
				}
			}
			desc = childhood.1002.desc2_add
		}
		triggered_desc = {
			trigger = {
				exists = scope:guardian_parent
				OR = {
					has_focus = education_learning
					has_focus = education_stewardship
					has_focus = education_diplomacy
					has_focus = education_nht_leadership
				}
			}
			desc = childhood.1002.desc3
		}
	}
	theme = family
	
	override_background = { reference = garden }
	left_portrait = {
		character = root
		
		triggered_animation = {
			trigger = { 
				OR = {
					has_focus = education_martial
					has_focus = education_intrigue
					has_focus = education_nht_prowess
				}
			}
  			animation = pain
  		}
		triggered_animation = {
			trigger = { 
				NOR = {
					has_focus = education_martial
					has_focus = education_intrigue
					has_focus = education_nht_prowess
				}
			}
  			animation = throne_room_writer
  		}
	}
	right_portrait = {
		character = scope:guardian_parent
		animation = worry
	}
	
	cooldown = { years = 8 }
	
	trigger = {
		OR = {
			has_focus = education_martial
			has_focus = education_intrigue
			has_focus = education_learning
			has_focus = education_stewardship
			has_focus = education_diplomacy
			has_focus = education_nht_prowess
			has_focus = education_nht_leadership
		}
		any_parent = {
			is_available_ai_adult = yes
			NOR = {
				has_trait = sadistic
				has_trait = callous
			}
			OR = {
				any_relation = { type = ward this = root }
				AND = {
					exists = location
					exists = root.location
					location = root.location
				}
			}
		}
	}

	weight_multiplier = {
		base = 1
	}

	immediate = {
		random_parent = {
			limit = {
				is_available_ai_adult = yes
				NOR = {
					has_trait = sadistic
					has_trait = callous
				}
				OR = {
					any_relation = { type = ward this = root }
					AND = {
						exists = location
						exists = root.location
						location = root.location
					}
				}
			}
			save_scope_as = guardian_parent
		}
		set_favorite_toy_effect = yes
	}

	option = {
		name = childhood.1002.a
		ai_chance = {
			base = 100
		}
		if = {
			limit = {
				is_ai = yes
			}
			save_scope_as = child
		}
		scope:guardian_parent = {
			add_opinion = {
				modifier = supportive_parent
				target = root
			}
		}
		if = {
			limit = {
				OR = {
					has_focus = education_martial
					has_focus = education_intrigue
					has_focus = education_nht_prowess
				}
			}
			random_list = {
				50 = {
					send_interface_toast = {
						type = event_martial_good
						title = skill_increased
						left_icon = root
						add_martial_skill = 1
					}
				}
				50 = {
					send_interface_toast = {
						type = event_intrigue_good
						title = skill_increased
						left_icon = root
						add_intrigue_skill = 1
					}
				}
				50 = {
					send_interface_toast = {
						title = skill_increased
						left_icon = root
						add_prowess_skill = 1
					}
				}
			}
		}
		else = {
			random_list = {
				50 = {
					send_interface_toast = {
						type = event_diplomacy_good
						title = skill_increased
						left_icon = root
						add_diplomacy_skill = 1
					}
				}
				50 = {
					send_interface_toast = {
						type = event_learning_good
						title = skill_increased
						left_icon = root
						add_learning_skill = 1
					}
				}
				50 = {
					send_interface_toast = {
						type = event_stewardship_good
						title = skill_increased
						left_icon = root
						add_stewardship_skill = 1
					}
				}
			}
		}
		
		stress_impact = {
			paranoid = minor_stress_impact_gain
			arrogant = minor_stress_impact_gain
			bossy = miniscule_stress_impact_gain
		}
		ai_chance = {
			base = 80
			modifier = {
				factor = 0
				NOR = {
					has_trait = paranoid
					has_trait = arrogant
				}
			}
		}
	}

	option = {
		name = childhood.1002.b
		if = {
			limit = {
				OR = {
					has_focus = education_martial
					has_focus = education_intrigue
					has_focus = education_nht_prowess
				}
			}
			random_list = {
				30 = {
					send_interface_toast = {
						type = event_martial_good
						title = childhood.1002.b_2
						left_icon = root
						add_martial_skill = 2
						add_intrigue_skill = 1
						add_prowess_skill = 1
					}
				}
				70 = {
					send_interface_toast = {
						type = event_stress_bad
						title = childhood.1002.b_1
						left_icon = root
						stress_impact = {
							base = minor_stress_gain
						}
					}
				}
			}
		}
		else = {
			random_list = {
				30 = {
					send_interface_toast = {
						type = event_learning_good
						title = childhood.1002.b_2
						left_icon = root
						add_diplomacy_skill = 1
						add_learning_skill = 1
						add_stewardship_skill = 1
					}
				}
				70 = {
					send_interface_toast = {
						type = event_stress_bad
						title = childhood.1002.b_1
						left_icon = root
						stress_impact = {
							base = minor_stress_gain
						}
					}
				}
			}
		}
		stress_impact = {
			trusting = medium_stress_impact_gain
			patient = minor_stress_impact_gain
			pensive = miniscule_stress_impact_gain
		}
		ai_chance = {
			base = 20
			modifier = {
				factor = 0
				NOR = {
					has_trait = trusting
					has_trait = patient
				}
			}
		}
	}
}

# Parent reduces stress
childhood.1004 = {
	type = character_event
	title = childhood.1004.t
	desc = childhood.1004.desc
	theme = education
	
	override_background = { reference = bedchamber }
	left_portrait = {
		character = root
		animation = stress
	}
	right_portrait = {
		character = scope:guardian_parent
		animation = personality_compassionate
	}
	
	cooldown = { years = 4 }
	
	trigger = {
		stress > 0
		any_parent = {
			is_available_ai_adult = yes
			OR = {
				any_relation = { type = ward this = root }
				AND = {
					exists = location
					exists = root.location
					location = root.location
				}
			}
			NOR = {
				has_trait = callous
				has_trait = sadistic
			}
		}
	}

	immediate = {
		random_parent = {
			limit = {
				is_available_ai_adult = yes
				OR = {
					any_relation = { type = ward this = root }
					AND = {
						exists = location
						exists = root.location
						location = root.location
					}
				}
				NOR = {
					has_trait = callous
					has_trait = sadistic
				}
			}
			save_scope_as = guardian_parent
		}
	}

	option = {
		name = childhood.1004.a
		stress_impact = {
			base = minor_stress_impact_loss
			diligent = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				has_trait = diligent
			}
		}
	}

	option = {
		name = childhood.1004.b
		random = {
			chance = 25
			send_interface_toast = {
				type = event_learning_good
				title = skill_increased
				left_icon = root
				add_learning_skill = 1
			}
		}
		stress_impact = {
			base = minor_stress_impact_gain
			diligent = minor_stress_impact_loss
			lazy = medium_stress_impact_gain
		}
		ai_chance = {
			base = 25
			modifier = {
				factor = 0
				has_trait = lazy
			}
		}
	}

	option = {
		name = childhood.1004.c
		random = {
			chance = 25
			send_interface_toast = {
				type = event_intrigue_good
				title = skill_increased
				left_icon = root
				add_intrigue_skill = 1
			}
		}
		scope:guardian_parent = {
			add_opinion = {
				target = root
				modifier = sweet_opinion
				opinion = 15
			}
		}
		stress_impact = {
			base = minor_stress_impact_gain
			diligent = minor_stress_impact_loss
		}
		ai_chance = {
			base = 25
			modifier = {
				factor = 0
				has_trait = lazy
			}
		}
	}
}

# Guardian parent gives stress
childhood.1005 = {
	type = character_event
	title = childhood.1005.t
	desc = childhood.1005.desc
	theme = education
	
	left_portrait = {
		character = root
		animation = stress
	}
	right_portrait = {
		character = scope:guardian_parent
		animation = anger
	}
	
	cooldown = { years = 4 }
	
	trigger = {
		any_parent = {
			is_available_ai_adult = yes
			OR = {
				any_relation = { type = ward this = root }
				AND = {
					exists = location
					exists = root.location
					location = root.location
				}
			}
			OR = {
				stress > high_medium_stress
				has_trait_malicious_trigger = yes
			}
		}
	}

	immediate = {
		random_parent = {
			limit = {
				is_available_ai_adult = yes
				OR = {
					any_relation = { type = ward this = root }
					AND = {
						exists = location
						exists = root.location
						location = root.location
					}
				}
				OR = {
					stress > high_medium_stress
					has_trait_malicious_trigger = yes
				}
			}
			save_scope_as = guardian_parent
		}
	}

	option = {
		name = childhood.1005.c
		trait = bossy
		trait = arbitrary
		trait = arrogant
		trigger = {
			OR = {
				has_trait = bossy
				has_trait = arbitrary
				has_trait = arrogant
			}
		}
		scope:guardian_parent = {
			add_opinion = {
				target = root
				modifier = disappointed_opinion
				opinion = -15
			}
			add_stress = minor_stress_impact_gain
			
			hidden_effect = {
				random = {
					chance = 50
					if = {
						limit = {
							can_set_relation_potential_rival_trigger = { CHARACTER = root }
						}
						set_relation_potential_rival = root
					}
				}
			}
		}
		ai_chance = {
			base = 100
		}
	}
	option = {
		name = childhood.1005.a
		
		random_list = {
			2 = {
				send_interface_toast = {
					type = event_martial_good
					title = skill_increased
					left_icon = root
					add_martial_skill = 1
				}
			}
			2 = {
				send_interface_toast = {
					type = event_martial_good
					title = skill_increased
					left_icon = root
					add_prowess_skill = 1
				}
			}
			2 = {
				send_interface_toast = {
					type = event_stewardship_good
					title = skill_increased
					left_icon = root
					add_stewardship_skill = 1
				}
			}
			2 = {
				send_interface_toast = {
					type = event_learning_good
					title = skill_increased
					left_icon = root
					add_learning_skill = 1
				}
			}
			2 = {
				send_interface_toast = {
					type = event_diplomacy_good
					title = skill_increased
					left_icon = root
					add_diplomacy_skill = 1
				}
			}
			2 = {
				send_interface_toast = {
					type = event_intrigue_good
					title = skill_increased
					left_icon = root
					add_intrigue_skill = 1
				}
			}
			2 = {
				trigger = {
					NOT = { has_trait = depressed_1 }
				}
				add_trait = depressed_1
			}
			88 = {
			}
		}
		stress_impact = {
			base = medium_stress_gain
			lazy = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				has_trait = lazy
			}
		}
	}
	option = {
		name = childhood.1005.b
		stress_impact = {
			base = minor_stress_gain
			diligent = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				has_trait = diligent
			}
		}
	}
}

# Guardian parent (diligent) gives stress to lazy child
childhood.1006 = {
	type = character_event
	title = childhood.1006.t
	desc = childhood.1006.desc
	theme = education
	override_background = { reference = bedchamber }
	
	left_portrait = {
		character = root
		animation = personality_irrational
	}
	right_portrait = {
		character = scope:guardian_parent
		animation = stress
	}
	
	cooldown = { years = 4 }
	
	trigger = {
		has_trait = lazy
		any_parent = {
			is_available_ai_adult = yes
			has_trait = diligent
			OR = {
				any_relation = { type = ward this = root }
				AND = {
					exists = location
					exists = root.location
					location = root.location
				}
			}
		}
	}

	immediate = {
		random_parent = {
			limit = {
				is_available_ai_adult = yes
				has_trait = diligent
				OR = {
					any_relation = { type = ward this = root }
					AND = {
						exists = location
						exists = root.location
						location = root.location
					}
				}
			}
			save_scope_as = guardian_parent
		}
	}

	option = {
		name = childhood.1006.b
		random = {
			chance = 10
			remove_trait = lazy
			add_trait_force_tooltip = diligent
		}
		stress_impact = {
			lazy = major_stress_gain
		}
		ai_chance = {
			base = 5
		}
	}

	option = {
		name = childhood.1006.c
		add_prestige = medium_prestige_gain
		random = {
			chance = 1
			add_trait = dull
		}
		scope:guardian_parent = {
			add_opinion = {
				target = root
				modifier = disappointed_opinion
				opinion = -25
			}
		}
		ai_chance = {
			base = 100
		}
	}
	
	option = {
		name = childhood.1006.a
		stress_impact = {
			lazy = medium_stress_gain
		}
		ai_chance = {
			base = 100
		}
	}
}

# Bully gives you stress
childhood.1007 = {
	type = character_event
	title = childhood.1007.t
	desc = {
		desc = childhood.1007.opening
		first_valid = {
			random_valid = {
				triggered_desc = {
					trigger = {
						exists = scope:bully
						scope:bully = {
							has_personality_malicious_trigger = yes
						}
						age < childhood_education_start_age
					}
					desc = childhood.1007.young_malicious
				}
				triggered_desc = {
					trigger = {
						exists = scope:bully
						scope:bully = {
							has_personality_dominant_trigger = yes
						}
						age < childhood_education_start_age
					}
					desc = childhood.1007.young_dominant
				}
				triggered_desc = {
					trigger = {
						exists = scope:bully
						scope:bully = {
							has_personality_extroverted_trigger = yes
						}
						age < childhood_education_start_age
					}
					desc = childhood.1007.young_extroverted
				}
				triggered_desc = {
					trigger = {
						exists = scope:bully
						scope:bully = {
							has_personality_emotional_trigger = yes
						}
						age < childhood_education_start_age
					}
					desc = childhood.1007.young_emotional
				}
				triggered_desc = {
					trigger = {
						exists = scope:bully
						scope:bully = {
							has_personality_malicious_trigger = yes
						}
						age >= childhood_education_start_age
					}
					desc = childhood.1007.malicious
				}
				triggered_desc = {
					trigger = {
						exists = scope:bully
						scope:bully = {
							has_personality_dominant_trigger = yes
						}
						age >= childhood_education_start_age
					}
					desc = childhood.1007.dominant
				}
				triggered_desc = {
					trigger = {
						exists = scope:bully
						scope:bully = {
							has_personality_extroverted_trigger = yes
						}
						age >= childhood_education_start_age
					}
					desc = childhood.1007.extroverted
				}
			}
			triggered_desc = {
				trigger = {
					exists = scope:bully
				}
				desc = childhood.1007.fallback
			}
		}
		desc = childhood.1007.end
	}
	theme = unfriendly
	
	override_background = { reference = garden }
	
	left_portrait = {
		character = root
		animation = stress
	}
	right_portrait = {
		character = scope:bully
		animation = personality_vengeful
	}
	lower_center_portrait = scope:victim
	
	cooldown = { years = 3 }

	trigger = {
		any_relation = {
			type = bully
			is_available_ai_child = yes
		}
	}

	immediate = {
		random_relation = {
			type = bully
			limit = {
				is_available_ai_child = yes
			}
			save_scope_as = bully
		}
		set_favorite_toy_effect = yes
		if = {
			limit = {
				any_relation = {
					type = victim
					is_available_child = yes
				}
			}
			random_relation = {
				type = victim
				limit = {
					is_available_child = yes
				}
				save_scope_as = victim
			}
		}
		save_scope_as = child
	}

	option = {
		name = childhood.1007.d
		trait = sadistic
		trigger = {
			has_trait = sadistic
		}
		duel = {
			skill = intrigue
			value = scope:bully.intrigue

			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				
				desc = childhood.1007.d.success
				send_interface_toast = {
					type = event_toast_effect_good
					title = childhood.1007.d.success
					left_icon = scope:bully
					remove_relation_bully = scope:bully
					scope:bully = {
						add_stress = medium_stress_impact_gain
					}
					if = {
						limit = {
							NOT = { has_relation_victim = scope:bully }
						}
						set_relation_victim = scope:bully
					}
				}
			}
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = childhood.1007.d.failure
				send_interface_toast = {
					type = event_toast_effect_bad
					title = childhood.1007.d.failure
					left_icon = scope:bully
					add_stress = minor_stress_impact_gain
				}
			}
		}
		ai_chance = {
			base = 500
		}
	}

	option = {
		name = childhood.1007.c
		trigger = {
			exists = scope:victim
		}
		scope:victim = {
			send_interface_toast = {
				type = event_stress_bad
				title = childhood.1007.c.toast
				left_icon = scope:child
				add_opinion = {
					target = root
					modifier = annoyed_opinion
					opinion = -25
				}
				add_stress = medium_stress_impact_gain
			}
		}
		stress_impact = {
			base = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				has_trait = compassionate
			}
		}
	}

	option = {
		name = childhood.1007.b
		
		duel = {
			skill = diplomacy
			value = scope:bully.diplomacy

			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				
				desc = childhood.1007.b.success
				send_interface_toast = {
					type = event_stress_neutral
					title = childhood.1007.b.success
					left_icon = scope:bully
					add_stress = minor_stress_impact_gain
					remove_relation_bully = scope:bully
				}
			}
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = childhood.1007.b.failure
				send_interface_toast = {
					type = event_stress_bad
					title = childhood.1007.b.failure
					left_icon = scope:bully
					add_stress = major_stress_impact_gain
				}
			}
		}
		stress_impact = {
			rowdy = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				has_trait = rowdy
			}
		}
	}

	option = {
		name = childhood.1007.a
		stress_impact = {
			base = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
		}
	}
}

# To have a victim reduces stress
childhood.1008 = {
	type = character_event
	title = childhood.1008.t
	desc = {
		desc = childhood.1008.opening
		first_valid = {
			random_valid = {
				triggered_desc = {
					trigger = {
						OR = {
							has_trait = rowdy
							has_trait = charming
						}
					}
					desc = childhood.1008.1
				}
				triggered_desc = {
					trigger = {
						OR = {
							has_trait = pensive
							has_trait = curious
							has_trait = bossy
						}
					}
					desc = childhood.1008.2
				}
				triggered_desc = {
					trigger = {
						OR = {
							has_trait = bossy
							has_trait = rowdy
						}
					}
					desc = childhood.1008.3
				}
			}
		}
	}
	theme = unfriendly
	override_background = { reference = bp1_kitchen_western }
	
	left_portrait = {
		character = root
		animation = personality_callous
	}
	right_portrait = {
		character = scope:victim
		animation = sadness
	}
	lower_center_portrait = scope:extra_bully
	
	cooldown = { years = 3 }
	
	trigger = {
		stress > 0
		NOT = {
			has_trait = compassionate
		}
		any_relation = {
			type = victim count >= 1
			is_available_ai_child = yes
		}
	}

	immediate = {
		random_relation = {
			type = victim
			limit = {
				is_available_ai_child = yes
			}
			save_scope_as = victim
		}
		
		if = {
			limit = {
				OR = {
					has_trait = charming
					has_trait = gregarious
				}
			}
			every_vassal = {
				limit = {
					save_good_bully_character_trigger_check = yes
					NOR = {
						has_relation_victim = scope:victim
						has_relation_bully = scope:victim
						has_relation_friend = scope:victim
						has_relation_crush = scope:victim
					}
					is_ai = yes
				}
				add_to_list = bullies
			}
			every_vassal = {
				every_child = {
					limit = {
						save_good_bully_character_trigger_check = yes
						NOR = {
							has_relation_victim = scope:victim
							has_relation_bully = scope:victim
							has_relation_friend = scope:victim
							has_relation_crush = scope:victim
						}
						is_ai = yes
					}
					add_to_list = bullies
				}
			}
			every_courtier_or_guest = {
				limit = {
					save_good_bully_character_trigger_check = yes
					NOR = {
						has_relation_victim = scope:victim
						has_relation_bully = scope:victim
						has_relation_friend = scope:victim
						has_relation_crush = scope:victim
					}
					is_ai = yes
				}
				add_to_list = bullies
			}
			if = {
				limit = {
					top_liege != this
					liege ?= {
						save_good_bully_character_trigger_check = yes
						NOR = {
							has_relation_victim = scope:victim
							has_relation_bully = scope:victim
							has_relation_friend = scope:victim
							has_relation_crush = scope:victim
						}
						is_ai = yes
					}
				}
				liege = {
					add_to_list = bullies
				}
			}
			if = {
				limit = {
					top_liege != this
					liege ?= {
						any_vassal = {
							save_good_bully_character_trigger_check = yes
							NOR = {
								has_relation_victim = scope:victim
								has_relation_bully = scope:victim
								has_relation_friend = scope:victim
								has_relation_crush = scope:victim
							}
							is_ai = yes
						}
					}
				}
				liege = {
					every_vassal = {
						limit = {
							save_good_bully_character_trigger_check = yes
							NOR = {
								has_relation_victim = scope:victim
								has_relation_bully = scope:victim
								has_relation_friend = scope:victim
								has_relation_crush = scope:victim
							}
							is_ai = yes
						}
						add_to_list = bullies
					}
				}
			}
			if = {
				limit = {
					top_liege != this
					liege ?= {
						any_vassal = {
							any_child = {
								save_good_bully_character_trigger_check = yes
								NOR = {
									has_relation_victim = scope:victim
									has_relation_bully = scope:victim
									has_relation_friend = scope:victim
									has_relation_crush = scope:victim
								}
								is_ai = yes
							}
						}
					}
				}
				liege = {
					every_vassal = {
						every_child = {
							limit = {
								save_good_bully_character_trigger_check = yes
								NOR = {
									has_relation_victim = scope:victim
									has_relation_bully = scope:victim
									has_relation_friend = scope:victim
									has_relation_crush = scope:victim
								}
								is_ai = yes
							}
							add_to_list = bullies
						}
					}
				}
			}
			if = {
				limit = {
					top_liege != this
					liege ?= {
						any_courtier_or_guest = {
							save_good_bully_character_trigger_check = yes
							NOR = {
								has_relation_victim = scope:victim
								has_relation_bully = scope:victim
								has_relation_friend = scope:victim
								has_relation_crush = scope:victim
							}
							is_ai = yes
						}
					}
				}
				liege = {
					every_courtier_or_guest = {
						limit = {
							save_good_bully_character_trigger_check = yes
							NOR = {
								has_relation_victim = scope:victim
								has_relation_bully = scope:victim
								has_relation_friend = scope:victim
								has_relation_crush = scope:victim
							}
							is_ai = yes
						}
						add_to_list = bullies
					}
				}
			}
			
			if = {
				limit = {
					any_in_list = {
						list = bullies
						is_alive = yes
					}
				}
				random_in_list = {
					list = bullies
					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
						}
						modifier = {
							add = 5
							number_of_opposing_personality_traits = {
								target = scope:victim
								value >= 1
							}
						}
						modifier = {
							add = 5
							number_of_opposing_personality_traits = {
								target = scope:victim
								value >= 2
							}
						}
						modifier = {
							add = 5
							number_of_opposing_personality_traits = {
								target = scope:victim
								value >= 3
							}
						}
						modifier = {
							add = 5
							has_trait = wrathful
						}
						modifier = {
							add = 10
							has_trait = sadistic
						}
					}
					save_scope_as = extra_bully
				}
			}
		}
	}

	option = {
		name = childhood.1008.c
		trait = charming
		trait = gregarious
		trigger = {
			OR = {
				has_trait = charming
				has_trait = gregarious
			}
			exists = scope:extra_bully
		}
		random = {
			chance = 50
			send_interface_toast = {
				type = event_diplomacy_good
				title = skill_increased
				left_icon = root
				add_diplomacy_skill = 1
			}
		}
		scope:extra_bully = {
			set_relation_victim = scope:victim
			progress_towards_friend_effect = {
				CHARACTER = root
				OPINION = 0
				REASON = friend_fellow_bullies
			}
			add_opinion = {
				target = root
				modifier = shared_interests_opinion
				opinion = 25
				years = 10
			}
		}
		scope:victim = {
			add_opinion = {
				target = root
				modifier = how_could_you_opinion
				opinion = -25
				years = 10
			}
		}
		stress_impact = {
			sadistic = minor_stress_impact_loss
			charming = medium_stress_impact_loss
			forgiving = medium_stress_impact_gain
			just = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = forgiving
					has_trait = just
				}
			}
		}
	}

	option = {
		name = childhood.1008.b
		random = {
			chance = 25
			send_interface_toast = {
				type = event_prowess_good
				title = skill_increased
				left_icon = root
				add_prowess_skill = 1
			}
		}
		scope:victim = {
			random = {
				chance = 15
				increase_wounds_effect = { REASON = fight }
			}
			progress_towards_rival_effect = {
				REASON = rival_bullied_other_child
				CHARACTER = root
				OPINION = 0
			}
		}
		stress_impact = {
			sadistic = minor_stress_impact_loss
			rowdy = medium_stress_impact_loss
			bossy = medium_stress_impact_loss
			curious = minor_stress_impact_gain
			charming = minor_stress_impact_gain
			pensive = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = curious
					has_trait = charming
					has_trait = pensive
				}
			}
		}
	}

	option = {
		name = childhood.1008.a
		stress_impact = {
			sadistic = minor_stress_impact_loss
			base = medium_stress_impact_loss
		}
		ai_chance = {
			base = 100
		}
	}
}

# Your friend reduces your stress
childhood.1009 = {
	type = character_event
	title = childhood.1009.t
	desc = {
		desc = childhood.1009.opening
		random_valid = {
			desc = childhood.1009.1
			desc = childhood.1009.2
			desc = childhood.1009.3
		}
		desc = childhood.1009.end
	}
	theme = friendly
	override_background = { reference = corridor_day }
	
	left_portrait = {
		character = root
		animation = happiness
	}
	right_portrait = {
		character = scope:friend
		animation = personality_compassionate
	}
	
	cooldown = { years = 3 }
	
	trigger = {
		stress > 0
		any_relation = {
			type = friend count >= 1
			is_available_child = yes
		}
	}

	immediate = {
		set_favorite_toy_effect = yes
		random_relation = {
			type = friend
			limit = {
				learning >= root.learning
				is_available_child = yes
			}
			alternative_limit = {
				is_available_child = yes
			}
			save_scope_as = friend
		}
	}

	option = {
		name = childhood.1009.c
		trigger = {
			scope:friend = {
				learning >= root.learning
			}
		}
		random = {
			chance = 50
			send_interface_toast = {
				type = event_learning_good
				title = skill_increased
				left_icon = root
				add_learning_skill = 1
			}
		}
		stress_impact = {
			base = minor_stress_impact_loss
			impatient = minor_stress_impact_gain
			rowdy = minor_stress_impact_gain
			bossy = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = impatient
					has_trait = rowdy
					has_trait = bossy
				}
			}
		}
	}

	option = {
		name = childhood.1009.b
		pay_short_term_gold = {
			target = scope:friend
			gold = minor_gold_value
		}
		scope:friend = {
			add_opinion = {
				target = root
				modifier = gave_toy_opinion
				opinion = 25
			}
		}
		stress_impact = {
			base = major_stress_impact_loss
			greedy = massive_stress_impact_gain
			callous = medium_stress_impact_gain
			sadistic = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = greedy
					has_trait = callous
					has_trait = sadistic
				}
			}
		}
	}

	option = {
		name = childhood.1009.a
		stress_impact = {
			base = medium_stress_impact_loss
		}
		ai_chance = {
			base = 100
		}
	}
}

# Crush gives/reduces stress
childhood.1010 = {
	type = character_event
	title = childhood.1010.t
	desc = {
		desc = childhood.1010.opening
		first_valid = {
			triggered_desc = {
				trigger = {
					exists = scope:crush
					scope:crush = {
						has_relation_crush = root
					}
				}
				desc = childhood.1010.returned
			}
			triggered_desc = {
				trigger = {
					exists = scope:crush
					NOT = {
						scope:crush = {
							has_relation_crush = root
						}
					}
				}
				desc = childhood.1010.not_returned
			}
		}
	}
	theme = seduction
	override_background = { reference = corridor_day }
	
	left_portrait = {
		character = root
		triggered_animation = {
			trigger = {
				scope:crush = {
					has_relation_crush = root
				}
			}
			animation = flirtation_left
		}
		triggered_animation = {
			trigger = {
				NOT = {
					scope:crush = {
						has_relation_crush = root
					}
				}
			}
			animation = sadness
		}
	}
	right_portrait = {
		character = scope:crush
		triggered_animation = {
			trigger = {
				scope:crush = {
					has_relation_crush = root
				}
			}
			animation = flirtation
		}
		triggered_animation = {
			trigger = {
				NOT = {
					scope:crush = {
						has_relation_crush = root
					}
				}
			}
			animation = disapproval
		}
	}
	
	cooldown = { years = 3 }
	
	trigger = {
		any_relation = {
			type = crush
			count >= 1
			OR = {
				root = {
					stress > 0
				}
				NOT = {
					has_relation_crush = root
				}
			}
		}
	}

	immediate = {
		random_relation = {
			type = crush
			limit = {
				OR = {
					root = {
						stress > 0
					}
					NOT = {
						has_relation_crush = root
					}
				}
			}
			save_scope_as = crush
		}
	}

	option = {
		name = childhood.1010.e
		trigger = {
			NOT = {
				has_character_modifier = hopeless_romantic_modifier
			}
			scope:crush = {
				has_relation_crush = root
			}
		}
		add_character_modifier = {
			modifier = hopeless_romantic_modifier
		}
		scope:crush = {
			add_opinion = {
				target = root
				modifier = romantic_gesture_opinion
				opinion = 20
				years = 10
			}
		}
		stress_impact = {
			base = medium_stress_impact_loss
			sadistic = medium_stress_impact_gain
			callous = medium_stress_impact_gain
			cynical = medium_stress_impact_gain
			calm = minor_stress_impact_gain
			patient = minor_stress_impact_gain
			content = minor_stress_impact_gain
			rowdy = minor_stress_impact_gain
			pensive = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = sadistic
					has_trait = callous
					has_trait = cynical
					has_trait = calm
					has_trait = patient
					has_trait = content
					has_trait = rowdy
					has_trait = pensive
				}
			}
		}
	}

	option = {
		name = childhood.1010.a
		trigger = {
			scope:crush = {
				has_relation_crush = root
			}
		}
		stress_impact = {
			base = medium_stress_impact_loss
		}
		ai_chance = {
			base = 100
		}
	}
	
	option = {
		name = childhood.1010.d
		trait = charming
		trigger = {
			has_trait = charming
			NOT = {
				scope:crush = {
					has_relation_crush = root
				}
			}
		}
		custom_tooltip = childhood.1010.d.effect
		save_scope_as = crush_holder
		scope:crush = {
			trigger_event = childhood.0012
		}
		stress_impact = {
			base = medium_stress_impact_gain
		}
		stress_impact = {
			base = medium_stress_impact_loss
			sadistic = medium_stress_impact_gain
			callous = medium_stress_impact_gain
			cynical = medium_stress_impact_gain
			calm = minor_stress_impact_gain
			patient = minor_stress_impact_gain
			content = minor_stress_impact_gain
			rowdy = minor_stress_impact_gain
			pensive = minor_stress_impact_gain
		}
		ai_chance = {
			base = 500
		}
	}
	
	option = {
		name = childhood.1010.c
		trigger = {
			NOT = {
				scope:crush = {
					has_relation_crush = root
				}
			}
		}
		random = {
			chance = 50
			send_interface_toast = {
				type = event_intrigue_good
				title = skill_increased
				left_icon = root
				add_intrigue_skill = 1
			}
		}
		random = {
			chance = 3
			if = {
				limit = {
					NOT = { has_trait = depressed_1 }
				}
				add_trait = depressed_1
			}
		}
		remove_relation_crush = scope:crush
		stress_impact = {
			base = major_stress_impact_gain
			cynical = massive_stress_impact_loss
			fickle = major_stress_impact_loss
			arbitrary = major_stress_impact_loss
		}
		ai_chance = {
			base = 20
			modifier = {
				factor = 0
				OR = {
					has_trait = trusting
					has_trait = patient
					has_trait = calm
				}
			}
		}
	}

	option = {
		name = childhood.1010.b
		trigger = {
			NOT = {
				scope:crush = {
					has_relation_crush = root
				}
			}
		}
		stress_impact = {
			base = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
		}
	}
}

# Child might return an existing crush
childhood.1011 = {
	type = character_event
	title = childhood.1011.t
	desc = {
		desc = childhood.1011.opening
		first_valid = {
			triggered_desc = {
				trigger = {
					exists = scope:crush_returned
					has_character_flag = returning_crush
				}
				desc = childhood.1011.returned
			}
			triggered_desc = {
				trigger = {
					exists = scope:crush_returned
					NOT = { has_character_flag = returning_crush }
				}
				desc = childhood.1011.not_returned
			}
		}
	}
	theme = seduction
	override_background = { reference = garden }
	
	left_portrait = {
		character = root
		animation = personality_rational
	}
	right_portrait = {
		character = scope:crush_returned
		animation = flirtation
	}
	lower_center_portrait = scope:true_crush
	
	cooldown = { years = 3 }
	
	trigger = {
		OR = {
			any_vassal = {
				is_available_ai_child = yes
				has_relation_crush = root
				NOT = {
					root = {
						has_relation_crush = prev
					}
				}
			}
			any_vassal = {
				any_child = {
					is_available_ai_child = yes
					has_relation_crush = root
					NOT = {
						root = {
							has_relation_crush = prev
						}
					}
				}
			}
			any_courtier_or_guest = {
				is_available_ai_child = yes
				has_relation_crush = root
				NOT = {
					root = {
						has_relation_crush = prev
					}
				}
			}
			AND = {
				top_liege != this
				liege ?= {
					is_available_ai_child = yes
					has_relation_crush = root
					NOT = {
						root = {
							has_relation_crush = prev
						}
					}
				}
			}
			AND = {
				top_liege != this
				liege ?= {
					any_vassal = {
						is_available_ai_child = yes
						has_relation_crush = root
						NOT = {
							root = {
								has_relation_crush = prev
							}
						}
					}
				}
			}
			AND = {
				top_liege != this
				liege ?= {
					any_vassal = {
						any_child = {
							is_available_ai_child = yes
							has_relation_crush = root
							NOT = {
								root = {
									has_relation_crush = prev
								}
							}
						}
					}
				}
			}
			AND = {
				top_liege != this
				liege ?= {
					any_courtier_or_guest = {
						is_available_ai_child = yes
						has_relation_crush = root
						NOT = {
							root = {
								has_relation_crush = prev
							}
						}
					}
				}
			}
		}
	}

	immediate = {
		every_vassal = {
			limit = {
				is_available_ai_child = yes
				has_relation_crush = root
				NOT = {
					root = {
						has_relation_crush = prev
					}
				}
			}
			add_to_list = crushes
		}
		every_vassal = {
			every_child = {
				limit = {
					is_available_ai_child = yes
					has_relation_crush = root
					NOT = {
						root = {
							has_relation_crush = prev
						}
					}
				}
				add_to_list = crushes
			}
		}
		every_courtier_or_guest = {
			limit = {
				save_good_crush_character_trigger_check = yes
			}
			add_to_list = crushes
		}
		if = {
			limit = {
				top_liege != this
				liege ?= {
					is_available_ai_child = yes
					has_relation_crush = root
					NOT = {
						root = {
							has_relation_crush = prev
						}
					}
				}
			}
			liege = {
				add_to_list = crushes
			}
		}
		if = {
			limit = {
				top_liege != this
				liege ?= {
					any_vassal = {
						is_available_ai_child = yes
						has_relation_crush = root
						NOT = {
							root = {
								has_relation_crush = prev
							}
						}
					}
				}
			}
			liege = {
				every_vassal = {
					limit = {
						is_available_ai_child = yes
						has_relation_crush = root
						NOT = {
							root = {
								has_relation_crush = prev
							}
						}
					}
					add_to_list = crushes
				}
			}
		}
		if = {
			limit = {
				top_liege != this
				liege ?= {
					any_vassal = {
						any_child = {
							is_available_ai_child = yes
							has_relation_crush = root
							NOT = {
								root = {
									has_relation_crush = prev
								}
							}
						}
					}
				}
			}
			liege = {
				every_vassal = {
					every_child = {
						limit = {
							is_available_ai_child = yes
							has_relation_crush = root
							NOT = {
								root = {
									has_relation_crush = prev
								}
							}
						}
						add_to_list = crushes
					}
				}
			}
		}
		if = {
			limit = {
				top_liege != this
				liege ?= {
					any_courtier_or_guest = {
						is_available_ai_child = yes
						has_relation_crush = root
						NOT = {
							root = {
								has_relation_crush = prev
							}
						}
					}
				}
			}
			liege = {
				every_courtier_or_guest = {
					limit = {
						is_available_ai_child = yes
						has_relation_crush = root
						NOT = {
							root = {
								has_relation_crush = prev
							}
						}
					}
					add_to_list = crushes
				}
			}
		}
		
		random_in_list = {
			list = crushes
			weight = {
				base = 1
				modifier = {
					add = 10
					top_liege != this
					exists = liege
					is_primary_heir_of = liege
				}
				modifier = {
					add = 5
					top_liege != this
					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 = crush_returned
		}
		hidden_effect = {
			# Is the crush returned?
			if = {
				limit = {
					is_attracted_to_gender_of = scope:crush_returned
				}
				add_character_flag = returning_crush
			}
		}
		if = {
			limit = {
				any_relation = {
					type = crush
					is_alive = yes
				}
			}
			random_relation = {
				type = crush
				limit = {
					is_alive = yes
				}
				save_scope_as = true_crush
			}
		}
	}

	option = {
		name = childhood.1011.c
		trigger = {
			exists = scope:true_crush
		}
		scope:true_crush = {
			add_opinion = {
				target = root
				modifier = sweet_opinion
				opinion = 20
			}
		}
		scope:crush_returned = {
			add_opinion = {
				target = root
				modifier = heartbroken_opinion
				opinion = -20
			}
		}
		stress_impact = {
			lustful = major_stress_impact_gain
			fickle = medium_stress_impact_gain
			arbitrary = medium_stress_impact_gain
			rowdy = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = lustful
					has_trait = fickle
					has_trait = arbitrary
					has_trait = rowdy
				}
			}
		}
	}

	option = {
		name = childhood.1011.a
		if = {
			limit = {
				NOT = { has_relation_crush = scope:crush_returned }
			}
			set_relation_crush = scope:crush_returned
		}
		stress_impact = {
			chaste = major_stress_impact_gain
			rowdy = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = chaste
					has_trait = rowdy
				}
			}
		}
	}

	option = {
		name = childhood.1011.b
		scope:crush_returned = {
			add_opinion = {
				target = root
				modifier = refusal_opinion
				opinion = -10
			}
		}
		stress_impact = {
			lustful = major_stress_impact_gain
			trusting = major_stress_impact_gain
			charming = minor_stress_impact_gain
		}
		ai_chance = {
			base = 20
			modifier = {
				factor = 0
				OR = {
					has_trait = lustful
					has_trait = trusting
					has_trait = charming
				}
			}
		}
	}
}

# Cruel parent take child's toy away
scripted_trigger childhood_1012_parent_trigger = {
	is_available_ai_adult = yes
	OR = {
		any_relation = { type = ward this = root }
		AND = {
			exists = location
			exists = root.location
			location = root.location
		}
	}
	NOT = {
		has_trait = compassionate
	}
	OR = {
		has_trait = callous
		has_trait = sadistic
		has_trait = arbitrary
	}
}

childhood.1012 = {
	type = character_event
	title = childhood.1012.t
	desc = {
		desc = childhood.1012.desc
		desc = childhood.1012.desc_2
		random_valid = {
			triggered_desc = {
				trigger= {
					scope:guardian_parent = {
						OR = {
							has_trait = callous
							has_trait = arbitrary
						}
					}
				}
				desc = childhood.1012.desc2
			}
			triggered_desc = {
				trigger= {
					scope:guardian_parent = {
						has_trait = sadistic
					}
				}
				desc = childhood.1012.desc3
			}
		}
	}
	theme = education
	override_background = { reference = sitting_room }
	
	left_portrait = {
		character = root
		animation = grief
	}
	right_portrait = {
		character = scope:guardian_parent
		animation = anger
	}
	
	cooldown = { years = 5 }

	trigger = {
		any_parent = {
			childhood_1012_parent_trigger = yes
		}
	}
	
	immediate = {
		set_favorite_toy_effect = yes
		random_parent = {
			limit = {
				childhood_1012_parent_trigger = yes
			}
			save_scope_as = guardian_parent
		}
		
		create_character_memory = {
			type = tormented_me_during_childhood
			
			participants = {
				tormentor = scope:guardian_parent
			}
		}
	}

	option = {
		name = childhood.1012.b
		trigger = {
			NOT = {
				has_character_modifier = cruel_upbringing_modifier
			}
		}
		
		progress_towards_rival_effect = {
			REASON = rival_took_childs_toy
			CHARACTER = scope:guardian_parent
			OPINION = 0
		}
		
		add_character_modifier = {
			modifier = cruel_upbringing_modifier
		}
		stress_impact = {
			base = medium_stress_impact_gain
			vengeful = massive_stress_impact_loss
			forgiving = massive_stress_impact_gain
			compassionate = minor_stress_impact_gain
			trusting = minor_stress_impact_gain
			charming = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = forgiving
					has_trait = compassionate
					has_trait = trusting
					has_trait = charming
				}
			}
		}
	}

	option = {
		name = childhood.1012.a
		stress_impact = {
			base = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				has_trait = vengeful
			}
		}
	}
}

# You destroy your victims toy
childhood.1013 = {
	type = character_event
	title = childhood.1013.t
	desc = childhood.1013.desc
	theme = unfriendly
	
	override_background = { reference = alley_day }
	
	left_portrait = {
		character = root
		animation = ecstasy
	}
	right_portrait = {
		character = scope:victim
		animation = grief
	}
	
	cooldown = { years = 3 }
	
	trigger = {
		stress > 0
		any_relation = {
			type = victim
			is_available_child = yes
		}
	}

	immediate = {
		save_scope_as = bully
		random_relation = {
			type = victim
			limit = {
				is_available_child = yes
			}
			save_scope_as = victim
		}
		scope:victim = {
			set_favorite_toy_effect = yes
		}
		scope:victim = {
			add_opinion = {
				target = root
				modifier = cruelty_opinion
				opinion = -25
			}
		}
	}

	option = {
		name = childhood.1013.b
		random = {
			chance = 50
			send_interface_toast = {
				type = event_diplomacy_good
				title = skill_increased
				left_icon = root
				add_diplomacy_skill = 1
				remove_relation_victim = scope:victim
			}
		}
		
		stress_impact = {
			base = medium_stress_impact_gain
			sadistic = massive_stress_impact_gain
			callous = massive_stress_impact_gain
			arbitrary = minor_stress_impact_gain
			arrogant = minor_stress_impact_gain
			rowdy = minor_stress_impact_gain
			bossy = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				NOR = {
					has_trait = compassionate
					has_trait = forgiving
				}
			}
		}
	}

	option = {
		name = childhood.1013.a
		add_stress = medium_stress_loss
	}
	after = {
		scope:victim = {
			trigger_event = childhood.1014
		}
	}
}

# Bully destroys your toy
childhood.1014 = {
	type = character_event
	title = childhood.1014.t
	desc = childhood.1014.desc
	theme = unfriendly
	
	override_background = { reference = alley_day }
	
	left_portrait = {
		character = root
		animation = grief
	}
	right_portrait = {
		character = scope:bully
		animation = ecstasy
	}
	
	immediate = {
		add_character_flag = bully_destroyed_toy
		if = {
			limit = {
				NOT = {
					exists = scope:bully
				}
			}
			random_relation = { type = bully save_scope_as = bully }
		}
	}

	option = {
		name = childhood.1014.a
		add_stress = minor_stress_impact_gain
		scope:bully = {
			add_opinion = {
				target = root
				modifier = respect_opinion
				opinion = -10
			}
		}
	}
}


##################################################
#
# You have the same focus as a friend/crush, study together!
# by Linnéa Thimrén
#
##################################################

# Study diplomacy
# by Linnéa Thimrén
scripted_trigger childhood_1015_relation_trigger = {
	has_focus = education_diplomacy
	is_available_ai_child = yes
	exists = top_liege
	exists = root.top_liege
	top_liege = root.top_liege
}

childhood.1015 = {
	type = character_event
	title = childhood.1015.t
	desc = childhood.1015.desc
	theme = education
	
	left_portrait = {
		character = root
		animation = personality_rational
	}
	right_portrait = {
		character = scope:study_friend
		animation = personality_rational
	}
	lower_left_portrait = scope:educator
	lower_right_portrait = scope:province_holder
	
	cooldown = { years = 5 }
	
	trigger = {
		has_focus = education_diplomacy
		OR = {
			any_relation = {
				type = friend
				childhood_1015_relation_trigger = yes
			}
			any_relation = {
				type = crush
				childhood_1015_relation_trigger = yes
			}
		}
		any_relation = { type = guardian }
		exists = location.county.holder.top_liege
		location.county.holder.top_liege = {
			any_sub_realm_county = {
				holder = {
					is_available_ai_adult = yes
				}
			}
		}
	}

	immediate = {
		random_relation = {
			type = friend
			limit = {
				childhood_1015_relation_trigger = yes
			}
			save_scope_as = study_friend
		}
		if = {
			limit = {
				NOT = { exists = scope:study_friend }
			}
			random_relation = {
				type = crush
				limit = {
					childhood_1015_relation_trigger = yes
				}
				save_scope_as = study_friend
			}
		}
		if = {
			limit = {
				any_relation = { type = guardian }
			}
			random_relation = {
				type = guardian
				save_scope_as = educator
			}
		}
		location.county.holder.top_liege = {
			random_sub_realm_county = {
				limit = {
					holder = {
						is_available_ai_adult = yes
					}
				}
				save_scope_as = province
				holder = {
					save_scope_as = province_holder
				}
			}
		}
	}

	option = {
		name = childhood.1015.a
		flavor = childhood.1015.a.flavor
		scope:educator = {
			add_opinion = {
				target = root
				modifier = amused_opinion
				opinion = 30
			}
		}
		scope:province_holder = {
			add_opinion = {
				target = root
				modifier = amused_opinion
				opinion = 30
			}
		}
		
		stress_impact = {
			pensive = minor_stress_impact_gain
			curious = minor_stress_impact_gain
			humble = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				NOR = {
					has_trait = pensive
					has_trait = curious
					has_trait = humble
				}
			}
		}
	}

	option = {
		name = childhood.1015.b
		custom_tooltip = childhood.1015.b.tt
		hidden_effect = {
			education_point_acquisition_effect = yes
			scope:study_friend = {
				education_point_acquisition_effect = yes
			}
		}
		stress_impact = {
			bossy = minor_stress_impact_gain
			arrogant = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0.5
				NOR = {
					has_trait = bossy
					has_trait = arrogant
				}
			}
		}
	}
}

# Study martial
# by Linnéa Thimrén
scripted_trigger childhood_1016_relation_trigger = {
	has_focus = education_martial
	is_available_ai_child = yes
	exists = top_liege
	exists = root.top_liege
	top_liege = root.top_liege
}

childhood.1016 = {
	type = character_event
	title = childhood.1016.t
	desc = childhood.1016.desc
	theme = education
	
	override_background = { reference = courtyard }
	
	left_portrait = {
		character = root
		animation = personality_rational
	}
	right_portrait = {
		character = scope:commander
		animation = marshal
	}
	lower_left_portrait = scope:study_friend
	lower_right_portrait = scope:educator
	
	cooldown = { years = 5 }
	
	trigger = {
		has_focus = education_martial
		OR = {
			any_relation = {
				type = friend
				childhood_1016_relation_trigger = yes
			}
			any_relation = {
				type = crush
				childhood_1016_relation_trigger = yes
			}
		}
		any_relation = { type = guardian }
		exists = location.county.holder
		location.county.holder = {
			any_knight = {
				is_available_ai_adult = yes
				NOT = {
					any_relation = {
						type = ward
						this = root
					}
				}
			}
		}
	}

	immediate = {
		location.county.holder = {
			random_knight = {
				limit = {
					is_available_ai_adult = yes
					NOT = {
						any_relation = {
							type = ward
							this = root
						}
					}
				}
				save_scope_as = commander
			}
		}
		random_relation = {
			type = friend
			limit = {
				childhood_1016_relation_trigger = yes
			}
			save_scope_as = study_friend
		}
		if = {
			limit = {
				NOT = { exists = scope:study_friend }
			}
			random_relation = {
				type = crush
				limit = {
					childhood_1016_relation_trigger = yes
				}
				save_scope_as = study_friend
			}
		}
		random_relation = {
			type = guardian
			save_scope_as = educator
		}
	}

	option = {
		name = childhood.1016.a
		flavor = childhood.1015.a.flavor
		scope:educator = {
			add_opinion = {
				target = root
				modifier = amused_opinion
				opinion = 30
			}
		}
		scope:commander = {
			add_opinion = {
				target = root
				modifier = amused_opinion
				opinion = 30
			}
		}
		
		stress_impact = {
			pensive = minor_stress_impact_gain
			curious = minor_stress_impact_gain
			humble = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				NOR = {
					has_trait = pensive
					has_trait = curious
					has_trait = humble
				}
			}
		}
	}

	option = {
		name = childhood.1016.b
		custom_tooltip = childhood.1016.b.tt
		hidden_effect = {
			education_point_acquisition_effect = yes
			scope:study_friend = {
				education_point_acquisition_effect = yes
			}
		}
		stress_impact = {
			bossy = minor_stress_impact_gain
			arrogant = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0.5
				NOR = {
					has_trait = bossy
					has_trait = arrogant
				}
			}
		}
	}
}

# Study stewardship
# by Linnéa Thimrén
scripted_trigger childhood_1017_relation_trigger = {
	has_focus = education_stewardship
	is_available_ai_child = yes
	exists = top_liege
	exists = root.top_liege
	top_liege = root.top_liege
}

childhood.1017 = {
	type = character_event
	title = childhood.1017.t
	desc = childhood.1017.desc
	theme = education
	
	override_background = { reference = council_chamber }
	
	left_portrait = {
		character = root
		animation = throne_room_writer
	}
	right_portrait = {
		character = scope:province_holder
		animation = personality_rational
	}
	lower_left_portrait = scope:study_friend
	lower_right_portrait = scope:educator
	
	trigger = {
		has_focus = education_stewardship
		OR = {
			any_relation = {
				type = friend
				childhood_1017_relation_trigger = yes
			}
			any_relation = {
				type = crush
				childhood_1017_relation_trigger = yes
			}
		}
		any_relation = { type = guardian }
		exists = location.county.holder.top_liege
		location.county.holder.top_liege = {
			any_vassal_or_below = {
				is_available_ai_adult = yes
				any_held_title = {
					title_tier = county
				}
			}
		}
	}

	immediate = {
		location.county.holder.top_liege = {
			random_vassal_or_below = {
				limit = {
					is_available_ai_adult = yes
					any_held_title = {
						title_tier = county
					}
				}
				save_scope_as = province_holder
				capital_county = {
					save_scope_as = province
				}
			}
		}
		random_relation = {
			type = friend
			limit = {
				childhood_1017_relation_trigger = yes
			}
			save_scope_as = study_friend
		}
		if = {
			limit = {
				NOT = { exists = scope:study_friend }
			}
			random_relation = {
				type = crush
				limit = {
					childhood_1017_relation_trigger = yes
				}
				save_scope_as = study_friend
			}
		}
		random_relation = {
			type = guardian
			save_scope_as = educator
		}
	}

	option = {
		name = childhood.1017.b
		scope:province = {
			add_county_modifier = {
				modifier = governance_good_guidance_modifier
				years = 20
			}
		}
		stress_impact = {
			arrogant = minor_stress_impact_gain
			curious = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				NOR = {
					has_trait = arrogant
					has_trait = curious
				}
			}
		}
	}

	option = {
		name = childhood.1017.a
		custom_tooltip = childhood.1017.a.tt
		hidden_effect = {
			education_point_acquisition_effect = yes
			scope:study_friend = {
				education_point_acquisition_effect = yes
			}
		}
		scope:province_holder = {
			add_opinion = {
				target = root
				modifier = annoyed_opinion
				opinion = -15
			}
		}
		scope:educator = {
			add_opinion = {
				target = root
				modifier = annoyed_opinion
				opinion = -15
			}
		}
		stress_impact = {
			just = minor_stress_impact_gain
			honest = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0.5
				NOR = {
					has_trait = honest
					has_trait = just
				}
			}
		}
	}
}

# Study intrigue
# by Linnéa Thimrén
scripted_trigger childhood_1018_relation_trigger = {
	has_focus = education_intrigue
	is_available_ai_child = yes
	exists = top_liege
	exists = root.top_liege
	top_liege = root.top_liege
}

childhood.1018 = {
	type = character_event
	title = childhood.1018.t
	desc = childhood.1018.desc
	theme = education
	
	override_background = { reference = council_chamber }
	
	left_portrait = {
		character = root
		animation = personality_rational
	}
	right_portrait = {
		character = scope:province_holder
		animation = paranoia
	}
	lower_left_portrait = scope:study_friend
	lower_right_portrait = scope:educator
	
	cooldown = { years = 5 }
	
	trigger = {
		has_focus = education_intrigue
		or = {
			any_relation = {
				type = friend
				childhood_1018_relation_trigger = yes
			}
			any_relation = {
				type = crush
				childhood_1018_relation_trigger = yes
			}
		}
		any_relation = { type = guardian }
		exists = location.county.holder.top_liege
		location.county.holder.top_liege = {
			any_vassal_or_below = {
				is_available_ai_adult = yes
				any_held_title = {
					title_tier = county
				}
			}
		}
	}

	immediate = {
		location.county.holder.top_liege = {
			random_vassal_or_below = {
				limit = {
					is_available_ai_adult = yes
					any_held_title = {
						title_tier = county
					}
				}
				save_scope_as = province_holder
				capital_county = {
					save_scope_as = province
				}
			}
		}
		random_relation = {
			type = friend
			limit = {
				childhood_1018_relation_trigger = yes
			}
			save_scope_as = study_friend
		}
		if = {
			limit = {
				NOT = { exists = scope:study_friend }
			}
			random_relation = {
				type = crush
				limit = {
					childhood_1018_relation_trigger = yes
				}
				save_scope_as = study_friend
			}
		}
		random_relation = {
			type = guardian
			save_scope_as = educator
		}
	}

	option = {
		name = childhood.1018.a
		hidden_effect = {
			education_point_acquisition_effect = yes
			scope:study_friend = {
				education_point_acquisition_effect = yes
			}
		}
		custom_tooltip = childhood.1018.a.tt
		scope:educator = {
			add_opinion = {
				target = root
				modifier = annoyed_opinion
				opinion = -15
			}
		}
		ai_chance = {
			base = 100
		}
	}

	option = {
		name = childhood.1018.b
		scope:province = {
			add_county_modifier = {
				modifier = governance_lenient_tax_policy_modifier
				years = 5
			}
		}
		stress_impact = {
			just = minor_stress_impact_gain
			honest = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0.5
				NOR = {
					has_trait = honest
					has_trait = just
				}
			}
		}
	}
}

# Study learning
# by Linnéa Thimrén
scripted_trigger childhood_1019_relation_trigger = {
	has_same_focus_as = root
	is_available_ai_child = yes
	exists = top_liege
	exists = root.top_liege
	top_liege = root.top_liege
}

childhood.1019 = {
	type = character_event
	title = childhood.1019.t
	desc = childhood.1019.desc
	theme = education
	
	left_portrait = {
		character = root
		animation = throne_room_writer
	}
	right_portrait = {
		character = scope:study_friend
		animation = happiness
	}
	lower_right_portrait = scope:educator
	
	cooldown = { years = 5 }
	
	trigger = {
		or = {
			has_focus = education_learning
			has_focus = education_stewardship
		}
		or = {
			any_relation = {
				type = friend
				childhood_1019_relation_trigger = yes
			}
			any_relation = {
				type = crush
				childhood_1019_relation_trigger = yes
			}
		}
		any_relation = { type = guardian }
		exists = location.county.holder.top_liege
		location.county.holder.top_liege = {
			any_vassal_or_below = {
				is_available_ai_adult = yes
				any_held_title = {
					title_tier = county
				}
			}
		}
	}

	immediate = {
		location.county.holder.top_liege = {
			random_vassal_or_below = {
				limit = {
					is_available_ai_adult = yes
					any_held_title = {
						title_tier = county
					}
				}
				capital_county = {
					save_scope_as = province
				}
			}
		}
		random_relation = {
			type = friend
			limit = {
				childhood_1019_relation_trigger = yes
			}
			save_scope_as = study_friend
		}
		if = {
			limit = {
				NOT = { exists = scope:study_friend }
			}
			random_relation = {
				type = crush
				limit = {
					childhood_1019_relation_trigger = yes
				}
				save_scope_as = study_friend
			}
		}
		random_relation = {
			type = guardian
			save_scope_as = educator
		}
	}

	option = {
		name = childhood.1019.a
		if = {
			limit = {
				has_focus = education_learning
			}
			custom_tooltip = childhood.1019.a.tt1
		}
		else = {
			custom_tooltip = childhood.1019.a.tt2
		}
		hidden_effect = {
			education_point_acquisition_effect = yes
			scope:study_friend = {
				education_point_acquisition_effect = yes
			}
		}
		scope:educator = {
			add_opinion = {
				target = root
				modifier = annoyed_opinion
				opinion = -15
			}
		}
		stress_impact = {
			honest = minor_stress_impact_gain
			trusting = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0.5
				NOR = {
					has_trait = honest
					has_trait = trusting
				}
			}
		}
	}

	option = {
		name = childhood.1019.b
		scope:province = {
			add_county_modifier = {
				modifier = governance_good_guidance_modifier
				years = 5
			}
		}
		scope:educator = {
			add_opinion = {
				target = root
				modifier = pleased_opinion
				opinion = 15
			}
		}
		stress_impact = {
			pensive = minor_stress_impact_gain
			curious = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				NOR = {
					has_trait = pensive
					has_trait = curious
				}
			}
		}
	}
}


#####################
#
# Random events
# by Linnéa Thimrén
#
#####################

# Get a pet cat!
# by Linnéa Thimrén
childhood.2001 = {
	type = character_event
	title = childhood.2001.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					exists = scope:educator
				}
				desc = childhood.2001.desc_educator
			}
			desc = childhood.2001.desc
		}
		desc = childhood.2001.desc_ending
	}
	theme = friendly
	
	override_background = { reference = terrain_scope }
	
	left_portrait = {
		character = root
		animation = ecstasy
	}
	right_portrait = {
		character = scope:educator
		triggered_animation = {
			trigger = {
				NOT = { has_trait = sadistic }
			}
			animation = admiration
		}
		triggered_animation = {
			trigger = {
				has_trait = sadistic
			}
			animation = disapproval
		}
	}
	lower_left_portrait = scope:friend
	
	cooldown = { years = 5 }
	
	trigger = {
		NOT = { #No cats around already
			any_owned_story = {
				type = story_cycle_pet_cat
			}
		}
	}

	immediate = {
		location = { save_scope_as = background_terrain_scope }
		save_scope_as = ward
		every_relation = {
			type = potential_friend
			limit = {
				is_available = yes
			}
			add_to_list = pet_targets
		}
		every_relation = {
			type = crush
			limit = {
				is_available = yes
			}
			add_to_list = pet_targets
		}
		every_relation = {
			type = friend
			limit = {
				is_available = yes
			}
			add_to_list = pet_targets
		}
		random_in_list = {
			list = pet_targets
			weight = {
				base = 1
				modifier = {
					add = 10
					has_relation_potential_friend = root
				}
				modifier = {
					add = 10
					has_relation_crush = root
				}
			}
			save_scope_as = friend
		}
		if = {
			limit = {
				any_relation = {
					type = guardian
					NOT = {
						any_owned_story = {
							type = story_cycle_pet_cat
						}
					}
				}
			}
			random_relation = {
				type = guardian
				save_scope_as = educator
			}
		}
		play_music_cue = "mx_cue_low_key_positive"
	}

	option = { #Keep it!
		name = childhood.2001.a
		start_cat_story_cycle_effect = yes
		ai_chance = {
			base = 100
		}
	}

	option = { #Give it to educator
		name = childhood.2001.b
		trigger = {
			exists = scope:educator
			scope:educator = {
				NOT = { #No cats around already
					any_owned_story = {
						type = story_cycle_pet_cat
					}
				}
			}
		}
		scope:educator = {
			add_opinion = {
				target = root
				modifier = gift_of_cat_opinion
				opinion = 30
			}
		}
		scope:educator = {
			trigger_event = childhood.2002
		}
		stress_impact = {
			greedy = minor_stress_impact_gain
			bossy = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = greedy
					has_trait = bossy
				}
			}
		}
	}

	option = { #Give it to friend
		name = childhood.2003.b
		trigger = {
			exists = scope:friend
			scope:friend = {
				NOT = {  #No cats around already
					any_owned_story = {
						type = story_cycle_pet_cat
					}
				}
			}
		}
		if = {
			limit = {
				scope:friend = {
					is_ai = yes
				}
				can_set_relation_friend_trigger = { CHARACTER = scope:friend }
			}
			set_relation_friend = { reason = friend_given_a_dog_2 target = scope:friend }
		}
		scope:friend = {
			add_opinion = {
				target = root
				modifier = gift_of_cat_opinion
				opinion = 30
			}
			trigger_event = childhood.2006
		}
		stress_impact = {
			greedy = minor_stress_impact_gain
			bossy = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = greedy
					has_trait = bossy
				}
			}
		}
	}

	option = { #Kill it
		name = childhood.2001.c
		trigger = {
			has_trait = sadistic
		}
		trait = sadistic
		add_learning_skill = 1
		add_intrigue_skill = 1

		ai_chance = {
			base = 100
		}
	}
}

# Ward has found cat, gives it to you
# by Linnéa Thimrén
childhood.2002 = {
	type = character_event
	title = childhood.2001.t
	desc = childhood.2002.desc
	theme = education
	
	override_background = { reference = terrain_scope }
	
	left_portrait = {
		character = root
		triggered_animation = {
			trigger = {
				NOT = { has_trait = sadistic }
			}
			animation = admiration
		}
		triggered_animation = {
			trigger = {
				has_trait = sadistic
			}
			animation = disapproval
		}
	}
	right_portrait = {
		character = scope:ward
		animation = ecstasy
	}

	option = { #Accept it
		name = childhood.2002.a
		start_cat_story_cycle_effect = yes
		ai_chance = {
			base = 100
		}
	}

	option = { #Decline it
		name = childhood.2002.b
		ai_chance = {
			base = 0
		}
	}

	option = { #Convince them they owe you for the kitty
		name = childhood.2002.c
		trigger = {
			scope:ward = { is_ai = yes }
			has_trait = deceitful
			can_add_hook = {
				target = scope:ward
				type = favor_hook
			}
		}
		trait = deceitful
		scope:ward = {
			start_cat_story_cycle_effect = yes
		}
		add_hook = {
			type = favor_hook
			target = scope:ward
			days = default_favor_duration
		}
		ai_chance = {
			base = 100
			modifier = {
				add = 50
				has_trait = deceitful
			}
			ai_value_modifier = {
				ai_honor = -0.75
			}
		}
	}

	option = { #Kill it
		name = childhood.2002.d
		trigger = {
			has_trait = sadistic
		}
		trait = sadistic
		add_learning_skill = 1
		add_intrigue_skill = 1

		ai_chance = {
			base = 100
		}
	}
}

# Get a pet dog!
# by Linnéa Thimrén
childhood.2003 = {
	type = character_event
	title = childhood.2003.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					exists = scope:educator
				}
				desc = childhood.2003.desc_educator
			}
			triggered_desc = {
				trigger = {
					exists = scope:friend
				}
				desc = childhood.2003.desc_friend
			}
			desc = childhood.2003.desc
		}
		desc = childhood.2003.desc_ending
	}
	theme = friendly
	override_background = { reference = terrain_scope }
	
	left_portrait = {
		character = root
		animation = ecstasy
	}
	right_portrait = {
		character = scope:educator
		triggered_animation = {
			trigger = {
				NOT = { has_trait = sadistic }
			}
			animation = admiration
		}
		triggered_animation = {
			trigger = {
				has_trait = sadistic
			}
			animation = disapproval
		}
	}
	lower_left_portrait = scope:friend
	
	cooldown = { years = 5 }

	trigger = {
		NOT = { #No dogs around already
			any_owned_story = {
				type = story_cycle_pet_dog
			}
		}
	}

	immediate = {
		location = { save_scope_as = background_terrain_scope }
		save_scope_as = ward
		every_relation = {
			type = potential_friend
			limit = {
				is_available = yes
			}
			add_to_list = pet_targets
		}
		every_relation = {
			type = crush
			limit = {
				is_available = yes
			}
			add_to_list = pet_targets
		}
		every_relation = {
			type = friend
			limit = {
				is_available = yes
			}
			add_to_list = pet_targets
		}
		random_in_list = {
			list = pet_targets
			weight = {
				base = 1
				modifier = {
					add = 10
					has_relation_potential_friend = root
				}
				modifier = {
					add = 10
					has_relation_crush = root
				}
			}
			save_scope_as = friend
		}
		if = {
			limit = {
				any_relation = {
					type = guardian
					NOT = {
						any_owned_story = {
							type = story_cycle_pet_dog
						}
					}
				}
			}
			random_relation = {
				type = guardian
				save_scope_as = educator
			}
		}
		play_music_cue = "mx_cue_low_key_positive"
	}

	option = { #Keep it!
		name = childhood.2003.a
		start_dog_story_cycle_effect = yes
		ai_chance = {
			base = 100
		}
	}

	option = { #Give it to friend
		name = childhood.2003.b
		trigger = {
			exists = scope:friend
			scope:friend = {
				NOT = {  #No dogs around already
					any_owned_story = {
						type = story_cycle_pet_dog
					}
				}
			}
		}
		if = {
			limit = {
				scope:friend = {
					is_ai = yes
				}
				can_set_relation_friend_trigger = { CHARACTER = scope:friend }
			}
			set_relation_friend = { reason = friend_given_a_dog_2 target = scope:friend }
		}
		scope:friend = {
			add_opinion = {
				target = root
				modifier = gift_of_dog_opinion
				opinion = 30
			}
			trigger_event = childhood.2005
		}
		stress_impact = {
			greedy = minor_stress_impact_gain
			bossy = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = greedy
					has_trait = bossy
				}
			}
		}
	}

	option = { #Give it to educator
		name = childhood.2003.c
		trigger = {
			exists = scope:educator
			scope:educator = {
				NOT = { #No cats around already
					any_owned_story = {
						type = story_cycle_pet_dog
					}
				}
			}
		}
		scope:educator = {
			add_opinion = {
				target = root
				modifier = gift_of_dog_opinion
				opinion = 30
			}
			trigger_event = childhood.2004
		}
		stress_impact = {
			greedy = minor_stress_impact_gain
			bossy = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = greedy
					has_trait = bossy
				}
			}
		}
	}

	option = { #Kill it
		name = childhood.2003.d
		trigger = {
			has_trait = sadistic
		}
		trait = sadistic
		add_learning_skill = 1
		add_intrigue_skill = 1
		
		ai_chance = {
			base = 100
		}
	}
}

# Ward has found dog, gives it to you
# by Linnéa Thimrén
childhood.2004 = {
	type = character_event
	title = childhood.2003.t
	desc = childhood.2004.desc
	theme = education
	
	override_background = { reference = terrain_scope }
	
	left_portrait = {
		character = root
		triggered_animation = {
			trigger = {
				NOT = { has_trait = sadistic }
			}
			animation = admiration
		}
		triggered_animation = {
			trigger = {
				has_trait = sadistic
			}
			animation = disapproval
		}
	}
	right_portrait = {
		character = scope:ward
		animation = ecstasy
	}

	option = { #Accept it
		name = childhood.2002.a
		start_dog_story_cycle_effect = yes
		ai_chance = {
			base = 100
		}
	}

	option = { #Decline it
		name = childhood.2002.b
		ai_chance = {
			base = 0
		}
	}

	option = { #Convince them they owe you for the puppy
		name = childhood.2002.c
		trigger = {
			scope:ward = { is_ai = yes }
			has_trait = deceitful
			can_add_hook = {
				target = scope:ward
				type = favor_hook
			}
		}
		trait = deceitful
		scope:ward = {
			start_dog_story_cycle_effect = yes
		}
		add_hook = {
			type = favor_hook
			target = scope:ward
			days = default_favor_duration
		}
		ai_chance = {
			base = 100
			modifier = {
				add = 50
				has_trait = deceitful
			}
			ai_value_modifier = {
				ai_honor = -0.75
			}
		}
	}

	option = { #Kill it
		name = childhood.2002.d
		trigger = {
			has_trait = sadistic
		}
		trait = sadistic
		add_learning_skill = 1
		add_intrigue_skill = 1

		ai_chance = {
			base = 100
		}
	}
}

# Other child has found puppy, gives it to you
# by Linnéa Thimrén
childhood.2005 = {
	type = character_event
	title = childhood.2003.t
	desc = childhood.2005.desc
	theme = education
	
	override_background = { reference = terrain_scope }
	
	left_portrait = {
		character = root
		triggered_animation = {
			trigger = {
				NOT = { has_trait = sadistic }
			}
			animation = admiration
		}
		triggered_animation = {
			trigger = {
				has_trait = sadistic
			}
			animation = disapproval
		}
	}
	right_portrait = {
		character = scope:ward
		animation = ecstasy
	}

	option = { #Accept it
		name = childhood.2005.a
		start_dog_story_cycle_effect = yes
		if = {
			limit = {
				can_set_relation_friend_trigger = { CHARACTER = scope:ward }
			}
			set_relation_friend = { reason = friend_given_a_dog target = scope:ward }
		}
		ai_chance = {
			base = 100
		}
	}

	option = { #Decline it
		name = childhood.2005.b
		ai_chance = {
			base = 0
		}
	}

	option = { #Kill it
		name = childhood.2002.d
		trigger = {
			has_trait = sadistic
		}
		trait = sadistic
		add_learning_skill = 1
		add_intrigue_skill = 1

		ai_chance = {
			base = 100
		}
	}
}

# Other child has found kitten, gives it to you
# by Linnéa Thimrén
childhood.2006 = {
	type = character_event
	title = childhood.2001.t
	desc = childhood.2006.desc
	theme = education
	
	override_background = { reference = terrain_scope }
	
	left_portrait = {
		character = root
		triggered_animation = {
			trigger = {
				NOT = { has_trait = sadistic }
			}
			animation = admiration
		}
		triggered_animation = {
			trigger = {
				has_trait = sadistic
			}
			animation = disapproval
		}
	}
	right_portrait = {
		character = scope:ward
		animation = ecstasy
	}

	option = { #Accept it
		name = childhood.2006.a
		start_cat_story_cycle_effect = yes
		if = {
			limit = {
				can_set_relation_friend_trigger = { CHARACTER = scope:ward }
			}
			set_relation_friend = { reason = friend_given_a_cat target = scope:ward }
		}
		ai_chance = {
			base = 100
		}
	}

	option = { #Decline it
		name = childhood.2006.b
		ai_chance = {
			base = 0
		}
	}

	option = { #Kill it
		name = childhood.2002.d
		trigger = {
			has_trait = sadistic
		}
		trait = sadistic
		add_learning_skill = 1
		add_intrigue_skill = 1

		ai_chance = {
			base = 100
		}
	}
}

# Convince ward they owe you
# by Linnéa Thimrén
scripted_trigger childhood_2010_ward_trigger = {
	age >= 4
	root = {
		can_add_hook = {
			target = prev
			type = favor_hook
		}
	}
}

childhood.2010 = {
	type = character_event
	title = childhood.2010.t
	desc = {
		desc = childhood.2010.desc_opening
		first_valid = {
			triggered_desc = {
			    trigger = {
					has_personality_introverted_trigger = yes
			    }
			    desc = childhood.2010.desc_shy
			}
			triggered_desc = {
			    trigger = {
					has_personality_malicious_trigger = yes
			    }
			    desc = childhood.2010.desc_mean
			}
			triggered_desc = {
			    trigger = {
					has_personality_dominant_trigger = yes
			    }
			    desc = childhood.2010.desc_proud
			}
			desc = childhood.2010.desc_fallback
		}
	}
	theme = education
	left_portrait = {
		character = root
		animation = happy_teacher
	}
	right_portrait = {
		character = scope:ward
		animation = admiration
	}
	
	cooldown = { years = 3 }
	
	trigger = {
		any_relation = {
			type = ward
			childhood_2010_ward_trigger = yes
		}
	}

	immediate = {
		save_scope_as = guardian #For ward's event
		random_relation = {
			type = ward
			limit = {
				childhood_2010_ward_trigger = yes
			}
			save_scope_as = ward
		}
	}

	option = { #I'll get a hook pls!
		name = childhood.2010.a
		add_hook = {
			type = favor_hook
			target = scope:ward
			days = default_favor_duration
		}
		scope:ward = {
			trigger_event = childhood.2011
		}
		stress_impact = {
			honest = minor_stress_impact_gain
			compassionate = minor_stress_impact_gain
			forgiving = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = honest
					has_trait = compassionate
					has_trait = forgiving
				}
			}
		}
	}

	option = { #I am a good person thank you very much
		name = childhood.2010.b
		progress_towards_friend_effect = {
			CHARACTER = scope:ward
			OPINION = default_friend_opinion
			REASON = friend_good_relationship_ward
		}
		stress_impact = {
			greedy = minor_stress_impact_gain
			deceitful = minor_stress_impact_gain
			arrogant = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = greedy
					has_trait = deceitful
					has_trait = arrogant
				}
			}
		}
	}
}

# Event for ward about them now owing a hook to guardian
# by Linnéa Thimrén
childhood.2011 = {
	type = character_event
	title = childhood.2010.t
	desc = childhood.2011.desc
	theme = education
	left_portrait = scope:guardian

	immediate = {
		show_as_tooltip = {
			scope:guardian = {
				add_hook = {
					type = favor_hook
					target = root
				}
			}
		}
		hidden_effect = {
			education_point_acquisition_effect = yes
		}
		custom_tooltip = childhood.2011.tt
	}

	option = { #Sounds legit
		name = childhood.2011.a
	}
}

# Learn the Language of your Guardian
childhood.2100 = {
	type = character_event
	title = childhood.2100.t
	desc = childhood.2100.desc
	theme = education
	left_portrait = scope:educator

	trigger = {
		age >= 6
		any_relation = {
			type = guardian
			learning > 0
			NOR = {
				culture = {
					has_same_culture_language = root.culture
				}
				root = {
					knows_language_of_culture = prev.culture
				}
			}
		}
		NOT = { has_character_flag = had_event_childhood_2100 }
	}

	immediate = {
		add_character_flag = {
			flag = had_event_childhood_2100
			years = 16
		}
		save_scope_as = ward
		random_relation = {
			type = guardian
			limit = {
				NOT = {
					culture = {
						has_same_culture_language = root.culture
					}
				}
			}
			save_scope_as = educator
		}
	}

	weight_multiplier = {
		base = 1
		modifier = {
			add = -0.75
			any_relation = {
				type = guardian
				learning <= 8
				NOT = {
					culture = {
						has_same_culture_language = root.culture
					}
				}
			}
		}
		modifier = {
			add = 0.5
			any_relation = {
				type = guardian
				learning >= 12
				NOT = {
					culture = {
						has_same_culture_language = root.culture
					}
				}
			}
		}
		modifier = {
			add = 1
			any_relation = {
				type = guardian
				learning >= 16
				NOT = {
					culture = {
						has_same_culture_language = root.culture
					}
				}
			}
		}
		modifier = {
			add = 1.5
			any_relation = {
				type = guardian
				learning >= 24
				NOT = {
					culture = {
						has_same_culture_language = root.culture
					}
				}
			}
		}
	}

	option = {
		name = childhood.2100.a
		random_list = {
			0 = {
				send_interface_toast = {
					type = event_language_neutral
					title = learn_language_ongoing.2100.a.success
					left_icon = scope:educator
					
					learn_language_of_culture = scope:educator.culture
				}
				every_parent = {
					limit = {
						is_ai = no
					}
					send_interface_toast = {
						type = msg_child_language
						title = learn_language_ongoing.2100.a.success_parent
						left_icon = scope:educator
						right_icon = scope:ward
						custom_tooltip = learn_language_ongoing.2100.a.success_parent_desc
					}
				}
				modifier = {
					add = {
						value = scope:educator.learning
						multiply = 2
						if = {
							limit = {
								scope:educator = {
									has_trait = diligent
								}
							}
							add = 5
						}
						if = {
							limit = {
								scope:educator = {
									has_trait = intellect_good_1
								}
							}
							add = 5
						}
						else_if = {
							limit = {
								scope:educator = {
									has_trait = intellect_good_2
								}
							}
							add = 10
						}
						else_if = {
							limit = {
								scope:educator = {
									has_trait = intellect_good_3
								}
							}
							add = 15
						}
						multiply = 2
					}
				}
				modifier = {
					add = {
						value = learning
						multiply = 3
					}
				}
				modifier = {
					add = 15
					OR = {
						has_trait = curious
						has_trait = pensive
					}
				}
				modifier = {
					add = -15
					has_trait = rowdy
				}
				modifier = {
					add = 5
					has_trait = intellect_good_1
				}
				modifier = {
					add = 10
					has_trait = intellect_good_2
				}
				modifier = {
					add = 15
					has_trait = intellect_good_3
				}
			}
			25 = {
				send_interface_toast = {
					type = event_language_bad
					title = learn_language_ongoing.2100.a.failure
					left_icon = scope:educator
				}
			}
		}
		stress_impact = {
			rowdy = medium_stress_impact_gain
			bossy = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
		}
	}

	option = {
		name = childhood.2100.b_hash
		
		add_stress = medium_stress_impact_loss
		
		ai_chance = {
			base = 0
		}
	}

}

scripted_trigger 2200_guardian_trigger = {
	learning > 0
	OR = {
		AND = { # Is a child ruler and doesn't speak their own court language
			root = { has_royal_court = yes }
			knows_court_language_of = root
			root = {
				NOT = { knows_court_language_of = root }
			}
		}
		AND = { # Is a child of someone with a royal court and doesn't speak their language
			exists = root.employer
			root.employer = { has_royal_court = yes }
			knows_court_language_of = root.employer
			root = {
				NOT = { knows_court_language_of = root.employer }
			}
		}
		AND = {
			exists = root.liege
			root.liege = { has_royal_court = yes }
			knows_court_language_of = root.liege
			root = {
				NOT = { knows_court_language_of = root.liege }
			}
		}
		AND = { # Is a child of someone whose liege has a royal court and doesn't speak their language
			exists = root.employer.liege
			root.employer.liege = { has_royal_court = yes }
			knows_court_language_of = root.employer.liege
			root = {
				NOT = { knows_court_language_of = root.employer.liege }
			}
		}
	}
}

scripted_trigger 2200_parent_tutor_trigger = {
	is_ruler = yes
	OR = {
		is_employer_of = root
		root.liege = this
	}
	employs_court_position = court_tutor_court_position
	save_temporary_scope_as = parent_scope
	court_position:court_tutor_court_position = {
		OR = {
			AND = {
				scope:parent_scope = { has_royal_court = yes }
				knows_court_language_of = scope:parent_scope
				root = {
					NOT = { knows_court_language_of = scope:parent_scope }
				}
			}
			AND = { # Is a child of someone whose liege has a royal court and doesn't speak their language
				scope:parent_scope.liege = { has_royal_court = yes }
				knows_court_language_of = scope:parent_scope.liege
				root = {
					NOT = { knows_court_language_of = scope:parent_scope.liege }
				}
			}
		}
	}
}

scripted_trigger 2200_own_tutor_trigger = {
	employs_court_position = court_tutor_court_position
	court_position:court_tutor_court_position = {
		OR = {
			AND = {
				root = { has_royal_court = yes }
				knows_court_language_of = root
				root = {
					NOT = { knows_court_language_of = root }
				}
			}
			AND = {
				exists = root.liege
				root.liege = { has_royal_court = yes }
				knows_court_language_of = root.liege
				root = {
					NOT = { knows_court_language_of = root.liege }
				}
			}
			AND = {
				exists = root.employer
				root.employer = { has_royal_court = yes }
				knows_court_language_of = root.employer
				root = {
					NOT = { knows_court_language_of = root.employer }
				}
			}
		}
	}
}

# Learn the court Language from your Guardian or tutor
childhood.2200 = {
	type = character_event
	title = childhood.2200.t
	desc = childhood.2200.desc
	theme = education
	left_portrait = scope:educator

	trigger = {
		age >= 6
		OR = {
			# Guardian speaks court language
			any_relation = {
				type = guardian
				2200_guardian_trigger = yes
			}
			# Tutor speaks court language
			AND = {
				is_ruler = no
				any_parent = {
					2200_parent_tutor_trigger = yes
				}
			}
			# Is a landed child and their tutor speaks their court language
			AND = {
				is_ruler = yes
				2200_own_tutor_trigger = yes
			}
		}
		NOT = { has_character_flag = had_event_childhood_2200 }
	}

	immediate = {
		add_character_flag = {
			flag = had_event_childhood_2200
			years = 16
		}
		save_scope_as = ward
		random_relation = {
			type = guardian
			limit = {
				2200_guardian_trigger = yes
			}
			save_scope_as = educator
		}
		if = {
			limit = {
				is_ruler = yes
				2200_own_tutor_trigger = yes
			}
			court_position:court_tutor_court_position = {
				save_scope_as = educator
			}
		}
		else_if = {
			limit = {
				is_ruler = no
				any_parent = {
					2200_parent_tutor_trigger = yes
				}
			}
			random_parent = {
				limit = {
					2200_parent_tutor_trigger = yes
				}
				court_position:court_tutor_court_position = {
					save_scope_as = educator
				}
			}
		}
	}

	weight_multiplier = {
		base = 2 # Should basically happen a lot, it's already quite hard to get someone who speaks your court language
		modifier = {
			add = 0.25
			any_relation = {
				type = guardian
				learning <= 8
			}
		}
		modifier = {
			add = 0.5
			any_relation = {
				type = guardian
				learning >= 12
			}
		}
		modifier = {
			add = 1
			any_relation = {
				type = guardian
				learning >= 16
			}
		}
		modifier = {
			add = 1.5
			any_relation = {
				type = guardian
				learning >= 24
			}
		}
	}

	option = {
		name = childhood.2200.a
		if = {
			limit = {
				scope:educator = {
					root = { has_royal_court = yes }
					knows_court_language_of = root
					root = {
						NOT = { knows_court_language_of = root }
					}
				}
			}
			learn_court_language_of = root
		}
		if = {
			limit = {
				scope:educator = {
					root.liege = { has_royal_court = yes }
					knows_court_language_of = root.liege
					root = {
						NOT = { knows_court_language_of = root.liege }
					}
				}
			}
			learn_court_language_of = root.liege
		}
		if = {
			limit = {
				scope:educator = {
					root.liege.liege = { has_royal_court = yes }
					knows_court_language_of = root.liege.liege
					root = {
						NOT = { knows_court_language_of = root.liege.liege }
					}
				}
			}
			learn_court_language_of = root.liege.liege
		}
		if = { # Stress should only apply to players as they have a choice where the AI does not
			limit = { is_ai = no }
			stress_impact = {
				base = medium_stress_impact_gain
				rowdy = major_stress_impact_gain
				bossy = minor_stress_impact_gain
			}
		}
		ai_chance = {
			base = 100
		}
	}

	option = {
		name = childhood.2200.b
		
		add_stress = medium_stress_impact_loss
		
		ai_chance = { # AI should always say yes
			base = 0
		}
	}

}

#Child picks up on parent's language
childhood.2300 = {
	type = character_event
	title = childhood.2300.t
	desc = childhood.2300.desc
	theme = education
	cooldown = { years = 4 }

	left_portrait = { 
		character = scope:parent
		animation = personality_rational 
	}

	trigger = {
		age >= 6
		any_parent = {
			culture = {
				NOT = { has_same_culture_language = root.culture }
			}
			save_temporary_scope_as = temp_scope_parent
		}

		NOT = { knows_language_of_culture = scope:temp_scope_parent.culture }
	}

	immediate = {
		random_parent = {
			limit = {
				culture = {
					NOT = { has_same_culture_language = root.culture }
				}
				root = { NOT = { knows_language_of_culture = prev.culture } }
			}
			save_scope_as = parent
		}
	}

	option = { #learn
		name = childhood.2300.a
		learn_language_of_culture = scope:parent.culture

		save_scope_as = ward #for loc purposes 

		every_parent = {
			limit = {
				is_ai = no
			}
			send_interface_toast = {
				type = msg_child_language
				title = learn_language_ongoing.2100.a.success_parent
				left_icon = scope:parent
				right_icon = scope:ward
				custom_tooltip = childhood.2300.a.success_parent_desc
			}
		}
		if = { # Stress should only apply to players as they have a choice where the AI does not
			limit = { is_ai = no }
			stress_impact = {
				base = medium_stress_impact_gain
				rowdy = major_stress_impact_gain
				bossy = minor_stress_impact_gain
			}
		}
		ai_chance = {
			base = 100
		}
	}

	option = { #nah
		name = childhood.2300.b
		
		add_stress = medium_stress_impact_loss
		
		ai_chance = { # AI should always say yes
			base = 0
		}
	}
}

# Checks whether a ward can plausibly question their faith and approach their guardian about those doubts
scripted_trigger childhood_2400_is_valid_ward = {
	has_relation_guardian = root
	is_at_same_location = root

	is_available_ai_child = yes
	age >= 12
	
	ai_zeal < 0
	faith = ROOT.faith
	opinion = {
		target = root
		value > neutral_opinion
	}
	OR = {
		has_trait = trusting
		has_trait = honest
		root = {
			# Yes, the second "or" is needed :(
			OR = {
				has_trait = forgiving
				has_trait = compassionate
			}
		}
	}
	AND = {
		NOR = {
			has_trait = paranoid
			has_trait = deceitful
			has_trait = content
			# Don't select a ward that has a non-believer secret that the guardian knows about
			any_secret = {
				NOT = {
					secret_type = secret_non_believer
					is_known_by = root
				}
			}
		}
		NOR = {
			root = {
				has_trait = callous
				has_trait = sadistic
			}
		}
	}
}

# A little more comprehensive than "has_trait = zealous"
scripted_trigger childhood_2400_guardian_is_zealous = {
	ai_zeal > high_positive_ai_value
}

scripted_effect childhood_2400_remove_secret_effect = {
	scope:ward_non_believer_secret = {
		remove_secret = yes
	}
}

# Ward approaches guardian with doubts about their faith
childhood.2400 = {
	type = character_event
	title = childhood.2400.t
	desc = childhood.2400.desc
	theme = education
	left_portrait = {
		character = root
		#A zealous guardian will be more upset than a non-zealous one
		triggered_animation = {
			trigger = { childhood_2400_guardian_is_zealous = yes }
			animation = stress
		}
		animation = worry
	}
	right_portrait = {
		character = scope:questioning_ward
		animation = personality_rational
	}
	lower_left_portrait = {
		character = scope:realm_priest
	}

	cooldown = { years = 10 }

	trigger = {
		any_courtier_or_guest = {
			childhood_2400_is_valid_ward = yes
		}
	}

	immediate = {
		random_courtier_or_guest = {
			limit = {
				childhood_2400_is_valid_ward = yes
			}
			save_scope_as = questioning_ward
		}
		# Let the guardian know the ward is a non-believer
		scope:questioning_ward = {
			add_secret = {
				type = secret_non_believer
			}
			random_secret = {
				type = secret_non_believer
				reveal_to = root
				save_scope_as = ward_non_believer_secret
			}
		}
		cp:councillor_court_chaplain = {
			save_scope_as = realm_priest
		}
	}

	# Attempt to explain ward's doubts
	option = {
		# Zealous flavor text
		name = {
			text = childhood.2400.a.zealous
			trigger = { childhood_2400_guardian_is_zealous = yes }
		}
		# Otherwise, neutral flavor text
		name = {
			text = childhood.2400.a.neutral
			trigger = { childhood_2400_guardian_is_zealous = no }
		}
		ai_chance = {
			base = 1
			ai_value_modifier = {
				ai_zeal = 1
			}
			# Favor this option if guardian's learning is greater/equal to realm priest's
			modifier = {
				factor = 0
				learning < scope:realm_priest.learning
			}
		}
		stress_impact = {
			zealous = medium_stress_impact_loss
			cynical = medium_stress_impact_gain
		}
		duel = {
			skill = learning
			target = scope:questioning_ward
			# Debate won
			# (Handicap since guardian is debating a precocious ward)
			40 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 4
				}
				add_piety = minor_piety_gain
				childhood_2400_remove_secret_effect = yes
				send_interface_toast = {
					type = event_toast_effect_good
					title = childhood.2400.a.toast.succ
					left_icon = scope:questioning_ward
					scope:questioning_ward = {
						add_opinion = {
							modifier = grateful_opinion
							target = root
							opinion = 20
						}
					}
				}
			}
			# Child stays nonbeliever
			60 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -4
				}
				send_interface_toast = {
					type = event_toast_effect_bad
					title = childhood.2400.a.toast.fail
					left_icon = scope:questioning_ward
					scope:questioning_ward = {
						add_opinion = {
							modifier = disappointed_opinion
							target = root
							opinion = -10
						}
					}
				}
			}
		}
	}

	#Have realm priest attempt to explain away ward's doubts
	option = {
		name = childhood.2400.b
		ai_chance = {
			base = 1
			ai_value_modifier = {
				ai_zeal = 1
			}
			# Dumbos more likely to rely on realm priest
			modifier = {
				factor = 0
				learning >= scope:realm_priest.learning
			}
		}
		stress_impact = {
			zealous = medium_stress_impact_loss
			cynical = medium_stress_impact_gain
		}
		scope:realm_priest = {
			duel = {
				skill = learning
				target = scope:questioning_ward
				# Realm priest convinces successfully
				40 = {
					compare_modifier = {
						value = scope:duel_value
						multiplier = 4
					}
					childhood_2400_remove_secret_effect = yes
					root = {
						send_interface_toast = {
							type = event_toast_effect_good
							title = childhood.2400.b.toast.succ
							left_icon = scope:questioning_ward
							right_icon = scope:realm_priest
							scope:questioning_ward = {
								add_opinion = {
									target = root
									modifier = grateful_opinion
									opinion = 20
								}
							}
							scope:realm_priest = {
								add_opinion = {
									target = root
									modifier = grateful_opinion
									opinion = 20
								}
							}
						}
					}
					
				}
				# Realm priest can't convince
				60 = {
					compare_modifier = {
						value = scope:duel_value
						multiplier = -4
					}
					add_opinion = {
						modifier = disappointed_opinion
						target = root
						opinion = -10
					}
					root = {
						send_interface_toast = {
							type = event_toast_effect_bad
							title = childhood.2400.b.toast.fail
							left_icon = scope:questioning_ward
							right_icon = scope:realm_priest
							scope:questioning_ward = {
								add_opinion = {
									modifier = disappointed_opinion
									target = root
									opinion = -10
								}
							}
						}
					}
				}
			}

		}
	}

	# Agree with ward, possibly become friends
	option = {
		name = childhood.2400.c
		stress_impact = {
			zealous = massive_stress_impact_gain
			paranoid = major_stress_impact_gain
			cynical = major_stress_impact_loss
		}
		# Guardian becomes nonbeliever if not already
		if = {
			limit = {
				NOT = {
					any_secret = {
						type = secret_non_believer
					}
				}
			}
			add_secret = {
				type = secret_non_believer
			}
		}
		random_secret = {
			type = secret_non_believer
			reveal_to = scope:questioning_ward
			disable_exposure_by = scope:questioning_ward
		}
		# Guardian can't reveal ward's nonbeliever secret
		scope:questioning_ward = {
			random_secret = {
				type = secret_non_believer
				disable_exposure_by = root
			}
			add_opinion = {
				target = root
				# Ignore the "lover" prefix here...
				modifier = lover_shared_secret_with_me_opinion
				opinion = 30
			}
		}
		hidden_effect = {
			add_opinion = {
				target = scope:questioning_ward
				# Still ignoring the prefix
				modifier = lover_shared_secret_with_me_opinion
				opinion = 30
			}
		}
		progress_towards_friend_effect = {
			REASON =  friend_found_common_ground
			CHARACTER = scope:questioning_ward
			OPINION = 0
		}
		trigger_event = childhood.2410
	}
	

	#Blackmail ward with their nonbeliever secret
	option = {
		name = childhood.2400.d
		trigger = {
			has_trait = schemer
			# Guardian doesn't already have a weak hook on ward
			NOT = {
				has_weak_hook = scope:questioning_ward
			}
		}
		scope:questioning_ward = {
			hidden_effect = {
				scope:ward_non_believer_secret = {
					disable_exposure_by = root
				}
			}
			add_opinion = {
				target = root
				modifier = fabricate_hook_threatened_me
				years = -15
			}
		}
		add_hook = {
			target = scope:questioning_ward
			type = weak_blackmail_hook
			secret = scope:ward_non_believer_secret
		}
	}
}

# Guardian and ward become secret confidants and potential friends
childhood.2410 = {
	type = character_event
	title = childhood.2400.t
	desc = {
		desc = childhood.2410.desc.intro
		first_valid = {
			triggered_desc = {
				trigger = {
					is_parent_of = scope:questioning_ward
				}
				desc = childhood.2410.desc.parentchild
			}
			desc = childhood.2410.desc.guardianward
		}
		desc = childhood.2410.desc.outro
	}
	theme = education
	left_portrait = 
	{
		character = root
		animation = happiness
	}
	right_portrait = {
		character = scope:questioning_ward
		animation = personality_compassionate
	}

	option = {
		name = childhood.2410.a
	}
}
