﻿#Events for children developing personality traits

namespace = child_personality

#####
# CHILD EVENTS
# 7000
#####
#diligent, gregarious, temperate
#Another child has stolen a keg of local alcohol, and wants to share it with you
child_personality.7000 = {
	type = character_event
	title = child_personality.7000.t
	desc = child_personality.7000.desc
	theme = education
	override_background = { reference = bp1_kitchen_western }
	left_portrait = {
		character = root
		animation = worry
	}
	right_portrait = {
		character = scope:other_child
		animation = ecstasy
	}

	trigger = {
		is_available_child_allow_travel = yes
		suitable_same_realm_child = yes
		NAND = {
			OR = {
				has_trait = lazy
				has_trait = diligent
			}
			OR = {
				has_trait = shy
				has_trait = gregarious
			}
			OR = {
				has_trait = gluttonous
				has_trait = temperate
			}
		}
	}

	weight_multiplier = {
		base = 1
		
		child_personality_main_event_weight_modifier = { TRAIT = diligent }
		child_personality_main_event_weight_modifier = { TRAIT = gregarious }
		child_personality_main_event_weight_modifier = { TRAIT = temperate }
	}

	immediate = {
		save_scope_as = child
		add_suitable_same_realm_children_to_list = yes
		random_in_list = {
			list = suitable_same_realm_children
			limit = {
				NOR = {
					has_trait = honest
					has_relation_bully = root
					has_relation_victim = root
					has_relation_rival = root
				}
			}
			alternative_limit = {
				NOR = {
					has_relation_bully = root
					has_relation_victim = root
					has_relation_rival = root
				}
			}
			alternative_limit = {
				always = yes
			}
			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
					has_trait = rowdy
				}
				modifier = {
					add = 5
					has_trait = deceitful
				}
			}
			save_scope_as = other_child
		}
	}

	option = { # diligent
		name = child_personality.7000.a
		trigger = {
			NOR = {
				has_trait = lazy
				has_trait = diligent
			}
		}
		add_trait = diligent
		scope:other_child = {
			add_opinion = {
				target = root
				modifier = spoilsport_opinion
			}
		}
		if = {
			limit = {
				is_ai = yes
			}
			add_character_flag = diligent
			random_relation = {
				type = guardian
				trigger_event = child_personality.7001
			}
		}
		ai_chance = {
			base = 1
			
			child_personality_option_weight_modifier = { TRAIT = diligent }
		}
	}

	option = { # gregarious
		name = child_personality.7000.b
		trigger = {
			NOR = {
				has_trait = shy
				has_trait = gregarious
			}
		}
		add_trait = gregarious
		progress_towards_friend_effect = {
			CHARACTER = scope:other_child
			OPINION = 25
			REASON = friend_children_stole_alcohol
		}
		random = {
			chance = 1
			add_trait = drunkard
		}
		if = {
			limit = {
				is_ai = yes
			}
			add_character_flag = gregarious
			random_relation = {
				type = guardian
				trigger_event = child_personality.7001
			}
		}
		ai_chance = {
			base = 1
			
			child_personality_option_weight_modifier = { TRAIT = gregarious }
		}
	}

	option = { # temperate
		name = child_personality.7000.c
		trigger = {
			NOR = {
				has_trait = gluttonous
				has_trait = temperate
			}
		}
		add_trait = temperate
		if = {
			limit = {
				is_ai = yes
			}
			add_character_flag = temperate
			random_relation = {
				type = guardian
				trigger_event = child_personality.7001
			}
		}
		ai_chance = {
			base = 1
			
			child_personality_option_weight_modifier = { TRAIT = temperate }
		}
	}
}

#Guardian response to diligent, gregarious, temperate
child_personality.7001 = {
	type = character_event
	title = child_personality.7001.t
	desc = {
		desc = child_personality.7001.desc
		first_valid = {
			triggered_desc = {
			    trigger = {
					scope:child = {
						has_character_flag = diligent
					}
			    }
			    desc = {
			    	desc = child_personality.diligent.desc
			    }
			}
			triggered_desc = {
			    trigger = {
					scope:child = {
						has_character_flag = gregarious
					}
			    }
			    desc = {
			    	desc = child_personality.gregarious.desc
			    }
			}
			triggered_desc = {
			    trigger = {
					scope:child = {
						has_character_flag = temperate
					}
			    }
			    desc = {
			    	desc = child_personality.temperate.desc
			    }
			}
		}
	}
	theme = education
	override_background = { reference = bp1_kitchen_western }
	left_portrait = {
		character = scope:cook
		animation = anger
	}
	right_portrait = {
		character = scope:child
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = diligent
				}
			}
  			animation = personality_honorable
  		}
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = gregarious
				}
			}
  			animation = personality_irrational
  		}
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = temperate
				}
			}
  			animation = personality_content
  		}
	}
	lower_left_portrait = scope:other_child
	
	immediate = {
		hidden_effect = { # Set up an irate cook for flavor & fun
			if = {
				limit = {
					is_landless_adventurer = yes
					any_courtier = {
						is_available_ai_adult = yes
					}
				}
				random_courtier = {
					limit = {
						is_available_ai_adult = yes
					}
					save_scope_as = cook
				}
			}
			else_if = {
				limit = {
					any_courtier = {
						has_character_flag = cook
						is_available_ai_adult = yes
					}
				}
				random_courtier = {
					limit = {
						has_character_flag = cook
						is_available_ai_adult = yes
					}
					save_scope_as = cook
				}
			}
			else_if = {
				limit = {
					exists = root.capital_province
					any_pool_character = {
						province = root.capital_province
						is_available_ai_adult = yes
						has_no_particular_noble_roots_trigger = yes
					}
				}
				random_pool_character = {
					province = root.capital_province
					limit = {
						is_available_ai_adult = yes
						has_no_particular_noble_roots_trigger = yes
					}
					root = {
						add_courtier = prev
					}
					add_character_flag = peasant_outfit
					add_character_flag = cook
					save_scope_as = cook
				}
			}
			else_if = {
				limit = {
					exists = root.capital_province
				}
				create_character = {
					template = servant_character
					dynasty = none
					location = root.capital_province
					gender_female_chance = 50
					save_scope_as = cook
				}
				scope:cook = {
					add_character_flag = peasant_outfit
					add_character_flag = cook
					change_current_weight = 60
				}
			}
		}
	}

	option = {
		trigger = {
			scope:child = {
				has_character_flag = diligent
			}
		}
		name = child_personality.7001.diligent
		custom_tooltip = child_personality.keeps_diligent_tt
	}

	option = {
		trigger = {
			scope:child = {
				has_character_flag = gregarious
			}
		}
		if = { # Gregarious characters really like each other!
			limit = {
				has_trait = gregarious
			}
			if = {
				limit = {
					can_set_relation_friend_trigger = { CHARACTER = scope:child }
				}
				set_relation_friend = { reason = friend_childhood_antics target = scope:child }
			}
		}
		else = { # You let the child get away with its merriment.
			progress_towards_friend_effect = {
				CHARACTER = scope:child
				OPINION = 25
				REASON = friend_childhood_antics
			}
		}
		name = child_personality.7001.gregarious
		custom_tooltip = child_personality.keeps_gregarious_tt
	}

	option = {
		trigger = {
			scope:child = {
				has_character_flag = temperate
			}
		}
		name = child_personality.7001.temperate
		custom_tooltip = child_personality.keeps_temperate_tt
	}

	option = {
		name = child_personality.7001.change.diligent
		trigger = {
			scope:child = {
				NOR = {
					has_trait = lazy
					has_trait = diligent
				}
			}
		}
		ai_chance = {
			base = 0
		}
		stress_impact = {
			base = child_trait_change_stress_penalty
		}
		scope:child = {
			if = {
				limit = {
					has_character_flag = gregarious
				}
				remove_trait = gregarious
			}
			if = {
				limit = {
					has_character_flag = temperate
				}
				remove_trait = temperate
			}
			add_trait_force_tooltip = diligent
		}
	}

	option = {
		name = child_personality.7001.change.gregarious
		trigger = {
			scope:child = {
				NOR = {
					has_trait = shy
					has_trait = gregarious
				}
			}
		}
		ai_chance = {
			base = 0
		}
		stress_impact = {
			base = child_trait_change_stress_penalty
		}
		scope:child = {
			if = {
				limit = {
					has_character_flag = diligent
				}
				remove_trait = diligent
			}
			if = {
				limit = {
					has_character_flag = temperate
				}
				remove_trait = temperate
			}
			add_trait_force_tooltip = gregarious
		}
	}

	option = {
		name = child_personality.7001.change.temperate
		trigger = {
			scope:child = {
				NOR = {
					has_trait = gluttonous
					has_trait = temperate
				}
			}
		}
		ai_chance = {
			base = 0
		}
		stress_impact = {
			base = child_trait_change_stress_penalty
		}
		scope:child = {
			if = {
				limit = {
					has_character_flag = gregarious
				}
				remove_trait = gregarious
			}
			if = {
				limit = {
					has_character_flag = diligent
				}
				remove_trait = diligent
			}
			add_trait_force_tooltip = temperate
		}
	}
	
	after = {
		scope:child = {
			remove_character_flag = diligent
			remove_character_flag = gregarious
			remove_character_flag = temperate
		}
	}
}

scripted_trigger appropriate_priest = {
	is_available_ai_adult = yes
	faith = root.faith
	OR = {
		is_clergy = yes
		has_trait = devoted
		has_council_position = councillor_court_chaplain
		has_court_position = high_almoner_court_position
		has_court_position = chief_qadi_court_position
	}
}

#zealous, ambitious, sadistic
#Realm priest is holding a sermon for the children
child_personality.7010 = {
	type = character_event
	title = child_personality.7010.t
	desc = child_personality.7010.desc
	theme = education
	override_background = { reference = temple }
	left_portrait = {
		character = root
		animation = personality_rational
	}
	right_portrait = {
		character = scope:sermon_priest
		animation = personality_zealous
	}

	trigger = {
		exists = location.county.holder
		location.county.holder = {
			OR = {
				any_courtier = {
					appropriate_priest = yes
				}
				any_vassal = {
					appropriate_priest = yes
				}
			}
		}
		NAND = {
			OR = {
				has_trait = zealous
				has_trait = cynical
			}
			OR = {
				has_trait = ambitious
				has_trait = content
			}
			OR = {
				has_trait = sadistic
				has_trait = compassionate
				has_trait = callous
			}
		}
	}

	weight_multiplier = {
		base = 1
		
		child_personality_main_event_weight_modifier = { TRAIT = zealous }
		child_personality_main_event_weight_modifier = { TRAIT = ambitious }
		child_personality_main_event_weight_modifier = { TRAIT = sadistic }
	}

	immediate = {
		save_scope_as = child
		location.county.holder = {
			every_courtier = {
				limit = {
					appropriate_priest = yes
				}
				add_to_list = potential_priests
			}
			every_vassal = {
				limit = {
					appropriate_priest = yes
				}
				add_to_list = potential_priests
			}
		}
		random_in_list = {
			list = potential_priests
			weight = {
				base = 1
				modifier = {
					add = 10
					is_of_major_interest_to_root_trigger = yes
				}
				modifier = {
					add = 5
					is_of_minor_interest_to_root_trigger = yes
				}
			}
			save_scope_as = sermon_priest
		}
	}

	option = { # zealous
		name = child_personality.7010.a
		trigger = {
			NOR = {
				has_trait = cynical
				has_trait = zealous
			}
		}
		add_trait = zealous
		if = {
			limit = {
				scope:sermon_priest = {
					NOT = {
						has_trait = cynical
					}
				}
			}
			progress_towards_friend_effect = {
				CHARACTER = scope:sermon_priest
				OPINION = 50
				REASON = friend_child_sermon
			}
		}
		if = {
			limit = {
				is_ai = yes
			}
			add_character_flag = zealous
			random_relation = {
				type = guardian
				trigger_event = child_personality.7011
			}
		}
		ai_chance = {
			base = 1
			
			child_personality_option_weight_modifier = { TRAIT = zealous }
		}
	}

	option = { # ambitious
		name = child_personality.7010.b
		trigger = {
			NOR = {
				has_trait = content
				has_trait = ambitious
			}
		}
		add_trait = ambitious
		scope:sermon_priest = {
			if = {
				limit = {
					OR = {
						has_trait = cynical
						has_trait = ambitious
						AND = {
							NOT = {
								has_trait = zealous
							}
							has_personality_malicious_trigger = yes
						}
					}
				}
				if = {
					limit = {
						can_set_relation_friend_trigger = { CHARACTER = scope:child }
					}
					set_relation_friend = { reason = friend_took_lessons_to_heart target = scope:child }
					add_opinion = {
						target = scope:child
						modifier = clever_child_opinion
					}
				}
			}
			else = {
				add_opinion = {
					target = scope:child
					modifier = disappointed_opinion
					opinion = -10
				}
			}
		}
		if = {
			limit = {
				is_ai = yes
			}
			add_character_flag = ambitious
			random_relation = {
				type = guardian
				trigger_event = child_personality.7011
			}
		}
		ai_chance = {
			base = 1
			
			child_personality_option_weight_modifier = { TRAIT = ambitious }
		}
	}

	option = { # sadistic
		name = child_personality.7010.c
		trigger = {
			NOR = {
				has_trait = compassionate
				has_trait = callous
				has_trait = sadistic
			}
		}
		add_trait = sadistic
		scope:sermon_priest = {
			if = {
				limit = {
					OR = {
						has_trait = sadistic
						AND = {
							has_trait = cynical
							has_personality_malicious_trigger = yes
						}
					}
				}
				if = {
					limit = {
						can_set_relation_friend_trigger = { CHARACTER = scope:child }
					}
					set_relation_friend = { reason = friend_took_lessons_to_heart target = scope:child }
					add_opinion = {
						target = scope:child
						modifier = delightfully_devilish_opinion
					}
				}
			}
			else = {
				add_opinion = {
					target = scope:child
					modifier = worried_opinion
				}
			}
		}
		if = {
			limit = {
				is_ai = yes
			}
			add_character_flag = sadistic
			random_relation = {
				type = guardian
				trigger_event = child_personality.7011
			}
		}
		ai_chance = {
			base = 1
			
			child_personality_option_weight_modifier = { TRAIT = sadistic }
		}
	}
}

#Guardian response to zealous, ambitious, sadistic
child_personality.7011 = {
	type = character_event
	title = child_personality.7011.t
	desc = {
		desc = child_personality.7011.desc
		first_valid = {
			triggered_desc = {
			    trigger = {
					scope:child = {
						has_character_flag = zealous
					}
			    }
			    desc = {
			    	desc = child_personality.zealous.desc
			    }
			}
			triggered_desc = {
			    trigger = {
					scope:child = {
						has_character_flag = ambitious
					}
			    }
			    desc = {
			    	desc = child_personality.ambitious.desc
			    }
			}
			triggered_desc = {
			    trigger = {
					scope:child = {
						has_character_flag = sadistic
					}
			    }
			    desc = {
			    	desc = child_personality.sadistic.desc
			    }
			}
		}
	}
	theme = education
	override_background = { reference = temple }
	left_portrait = {
		character = scope:sermon_priest
		animation = personality_zealous
	}
	right_portrait = {
		character = scope:child
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = zealous
				}
			}
  			animation = personality_zealous
  		}
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = ambitious
				}
			}
  			animation = personality_greedy
  		}
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = sadistic
				}
			}
  			animation = schadenfreude
  		}
	}
	
	immediate = {
		
	}

	option = {
		trigger = {
			scope:child = {
				has_character_flag = zealous
			}
		}
		if = {
			limit = {
				has_trait = zealous
				faith = scope:child.faith
			}
			progress_towards_friend_effect = {
				CHARACTER = scope:child
				OPINION = 10
				REASON = friend_encouraged_zealous
			}
		}
		name = child_personality.7011.zealous
		custom_tooltip = child_personality.keeps_zealous_tt
	}

	option = {
		trigger = {
			scope:child = {
				has_character_flag = ambitious
			}
		}
		name = child_personality.7011.ambitious
		custom_tooltip = child_personality.keeps_ambitious_tt
	}

	option = {
		trigger = {
			scope:child = {
				has_character_flag = sadistic
			}
		}
		name = child_personality.7011.sadistic
		custom_tooltip = child_personality.keeps_sadistic_tt
	}

	option = {
		name = child_personality.7011.change.zealous
		trigger = {
			scope:child = {
				NOR = {
					has_trait = zealous
					has_trait = cynical
				}
			}
		}
		ai_chance = {
			base = 0
		}
		stress_impact = {
			base = child_trait_change_stress_penalty
		}
		scope:child = {
			if = {
				limit = {
					has_character_flag = ambitious
				}
				remove_trait = ambitious
			}
			if = {
				limit = {
					has_character_flag = sadistic
				}
				remove_trait = sadistic
			}
			add_trait_force_tooltip = zealous
		}
	}

	option = {
		name = child_personality.7011.change.ambitious
		trigger = {
			scope:child = {
				NOR = {
					has_trait = ambitious
					has_trait = content
				}
			}
		}
		ai_chance = {
			base = 0
		}
		stress_impact = {
			base = child_trait_change_stress_penalty
		}
		scope:child = {
			if = {
				limit = {
					has_character_flag = zealous
				}
				remove_trait = zealous
			}
			if = {
				limit = {
					has_character_flag = sadistic
				}
				remove_trait = sadistic
			}
			add_trait_force_tooltip = ambitious
		}
	}

	option = {
		name = child_personality.7011.change.sadistic
		trigger = {
			scope:child = {
				NOR = {
					has_trait = sadistic
					has_trait = callous
					has_trait = compassionate
				}
			}
		}
		ai_chance = {
			base = 0
		}
		stress_impact = {
			base = child_trait_change_stress_penalty
		}
		scope:child = {
			if = {
				limit = {
					has_character_flag = zealous
				}
				remove_trait = zealous
			}
			if = {
				limit = {
					has_character_flag = ambitious
				}
				remove_trait = ambitious
			}
			add_trait_force_tooltip = sadistic
		}
	}
	
	after = {
		scope:child = {
			remove_character_flag = zealous
			remove_character_flag = ambitious
			remove_character_flag = sadistic
		}
	}
}

scripted_trigger sutiably_evil_person = {
	is_available_ai = yes
	OR = {
		AND = { # Either another child
			age >= 13
			age > root.age
			is_adult = no
		}
		AND = { # Or an 'untouchable' noble adult
			is_adult = yes
			exists = dynasty
			dynasty = {
				any_dynasty_member = {
					count >= 2
				}
			}
		}
	}
	NOR = {
		ai_compassion >= 0
		ai_honor >= 0
		has_relation_friend = root
		has_relation_potential_friend = root
	}
	OR = {
		has_trait = sadistic
		has_trait = callous
		has_personality_malicious_trigger = yes
	}
}

#shy, paranoid, craven
#An older child (or noble of some stature) beats you up real bad, with no chance of defending yourself
child_personality.7020 = {
	type = character_event
	title = child_personality.7020.t
	desc = child_personality.7020.desc
	theme = education
	override_background = { reference = market }
	left_portrait = {
		character = root
		animation = fear
	}
	right_portrait = {
		character = scope:evil_person
		animation = rage
	}

	trigger = {
		exists = location.county.holder
		location.county.holder = {
			OR = {
				any_courtier_or_guest = {
					sutiably_evil_person = yes
				}
				any_vassal = {
					sutiably_evil_person = yes
				}
			}
		}
		NAND = {
			OR = {
				has_trait = shy
				has_trait = gregarious
			}
			OR = {
				has_trait = paranoid
				has_trait = trusting
			}
			OR = {
				has_trait = craven
				has_trait = brave
			}
		}
	}

	weight_multiplier = {
		base = 1
		
		child_personality_main_event_weight_modifier = { TRAIT = shy }
		child_personality_main_event_weight_modifier = { TRAIT = paranoid }
		child_personality_main_event_weight_modifier = { TRAIT = craven }
	}

	immediate = {
		save_scope_as = child
		location.county.holder = {
			every_courtier_or_guest = {
				limit = {
					sutiably_evil_person = yes
				}
				add_to_list = potential_evil_people
			}
			every_vassal = {
				limit = {
					sutiably_evil_person = yes
				}
				add_to_list = potential_evil_people
			}
		}
		random_in_list = {
			list = potential_evil_people
			weight = {
				base = 1
				modifier = {
					add = 100
					has_relation_bully = root
				}
				modifier = {
					add = 10
					has_trait = sadistic
				}
				modifier = {
					add = 10
					has_relation_rival = root
				}
				modifier = {
					add = 10
					has_relation_potential_rival = root
				}
				modifier = {
					add = 10
					is_adult = no
				}
				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 = evil_person
		}
	}

	option = { # shy
		name = child_personality.7020.a
		trigger = {
			NOR = {
				has_trait = shy
				has_trait = gregarious
			}
		}
		add_trait = shy
		random = {
			chance = 5
			increase_wounds_effect = { REASON = attacked }
		}
		if = {
			limit = {
				is_ai = yes
			}
			add_character_flag = shy
			random_relation = {
				type = guardian
				trigger_event = child_personality.7021
			}
		}
		ai_chance = {
			base = 1
			
			child_personality_option_weight_modifier = { TRAIT = shy }
		}
	}

	option = { # paranoid
		name = child_personality.7020.b
		trigger = {
			NOR = {
				has_trait = paranoid
				has_trait = trusting
			}
		}
		add_trait = paranoid
		random = {
			chance = 5
			increase_wounds_effect = { REASON = attacked }
		}
		if = {
			limit = {
				is_ai = yes
			}
			add_character_flag = paranoid
			random_relation = {
				type = guardian
				trigger_event = child_personality.7021
			}
		}
		ai_chance = {
			base = 1
			
			child_personality_option_weight_modifier = { TRAIT = paranoid }
		}
	}

	option = { # craven
		name = child_personality.7020.c
		trigger = {
			NOR = {
				has_trait = craven
				has_trait = brave
			}
		}
		add_trait = craven
		scope:evil_person = {
			if = {
				limit = {
					can_add_hook = {
						target = root
						type = threat_hook
					}
				}
				add_hook = {
					target = root
					type = threat_hook
				}
			}
		}
		if = {
			limit = {
				is_ai = yes
			}
			add_character_flag = craven
			random_relation = {
				type = guardian
				trigger_event = child_personality.7021
			}
		}
		ai_chance = {
			base = 1
			
			child_personality_option_weight_modifier = { TRAIT = craven }
		}
	}
	
	after = {
		if = {
			limit = {
				scope:evil_person = {
					is_adult = no
				}
			}
			if = {
				limit = {
					can_set_relation_bully_trigger = { CHARACTER = scope:child }
				}
				set_relation_bully = scope:child
			}
		}
		else = {
			progress_towards_rival_effect = {
				REASON = rival_beaten_badly
				CHARACTER = scope:evil_person
				OPINION = 0
			}
		}
	}
}

#Guardian response to shy, paranoid, craven
child_personality.7021 = {
	type = character_event
	title = child_personality.7021.t
	desc = {
		desc = child_personality.7021.desc
		first_valid = {
			triggered_desc = {
			    trigger = {
					scope:child = {
						has_character_flag = shy
					}
			    }
			    desc = {
			    	desc = child_personality.shy.desc
			    }
			}
			triggered_desc = {
			    trigger = {
					scope:child = {
						has_character_flag = paranoid
					}
			    }
			    desc = {
			    	desc = child_personality.paranoid.desc
			    }
			}
			triggered_desc = {
			    trigger = {
					scope:child = {
						has_character_flag = craven
					}
			    }
			    desc = {
			    	desc = child_personality.craven.desc
			    }
			}
		}
	}
	theme = education
	left_portrait = {
		character = root
		animation = shock
	}
	right_portrait = {
		character = scope:child
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = shy
				}
			}
  			animation = worry
  		}
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = paranoid
				}
			}
  			animation = paranoia
  		}
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = craven
				}
			}
  			animation = personality_coward
  		}
	}
	
	immediate = {
		
	}

	option = {
		trigger = {
			scope:child = {
				has_character_flag = shy
			}
		}
		name = child_personality.7021.shy
		custom_tooltip = child_personality.keeps_shy_tt
		
		scope:child = {
			add_opinion = {
				target = root
				modifier = comforted_opinion
				opinion = 25
			}
		}
		progress_towards_friend_effect = {
			CHARACTER = scope:child
			OPINION = 0
			REASON = friend_comforted_shy_child
		}
	}

	option = {
		trigger = {
			scope:child = {
				has_character_flag = paranoid
			}
		}
		name = child_personality.7021.paranoid
		custom_tooltip = child_personality.keeps_paranoid_tt
	}

	option = {
		trigger = {
			scope:child = {
				has_character_flag = craven
			}
		}
		name = child_personality.7021.craven
		custom_tooltip = child_personality.keeps_craven_tt
	}

	option = {
		name = child_personality.7021.change.shy
		trigger = {
			scope:child = {
				NOR = {
					has_trait = shy
					has_trait = gregarious
				}
			}
		}
		ai_chance = {
			base = 0
		}
		stress_impact = {
			base = child_trait_change_stress_penalty
		}
		scope:child = {
			if = {
				limit = {
					has_character_flag = paranoid
				}
				remove_trait = paranoid
			}
			if = {
				limit = {
					has_character_flag = craven
				}
				remove_trait = craven
			}
			add_trait_force_tooltip = shy
		}
	}

	option = {
		name = child_personality.7021.change.paranoid
		trigger = {
			scope:child = {
				NOR = {
					has_trait = paranoid
					has_trait = trusting
				}
			}
		}
		ai_chance = {
			base = 0
		}
		stress_impact = {
			base = child_trait_change_stress_penalty
		}
		scope:child = {
			if = {
				limit = {
					has_character_flag = shy
				}
				remove_trait = shy
			}
			if = {
				limit = {
					has_character_flag = craven
				}
				remove_trait = craven
			}
			add_trait_force_tooltip = paranoid
		}
	}

	option = {
		name = child_personality.7021.change.craven
		trigger = {
			scope:child = {
				NOR = {
					has_trait = craven
					has_trait = brave
				}
			}
		}
		ai_chance = {
			base = 0
		}
		stress_impact = {
			base = child_trait_change_stress_penalty
		}
		scope:child = {
			if = {
				limit = {
					has_character_flag = shy
				}
				remove_trait = shy
			}
			if = {
				limit = {
					has_character_flag = paranoid
				}
				remove_trait = paranoid
			}
			add_trait_force_tooltip = craven
		}
	}
	
	after = {
		scope:child = {
			remove_character_flag = shy
			remove_character_flag = paranoid
			remove_character_flag = craven
		}
	}
}

#lazy, gluttonous, compassionate
#You are entrusted by the cooks to do chores in the kitchen while they are gone/you are left in the kitchen alone
child_personality.7030 = {
	type = character_event
	title = child_personality.7030.t
	desc = child_personality.7030.desc
	theme = education
	override_background = { reference = bp1_kitchen_western }
	left_portrait = {
		character = root
		animation = admiration
	}
	right_portrait = {
		character = scope:cook
		animation = steward
	}

	trigger = {
		is_available_child_allow_travel = yes
		exists = location.county.holder
		NAND = {
			OR = {
				has_trait = lazy
				has_trait = diligent
			}
			OR = {
				has_trait = gluttonous
				has_trait = temperate
			}
			OR = {
				has_trait = compassionate
				has_trait = callous
				has_trait = sadistic
			}
		}
	}

	weight_multiplier = {
		base = 1
		
		child_personality_main_event_weight_modifier = { TRAIT = lazy }
		child_personality_main_event_weight_modifier = { TRAIT = gluttonous }
		child_personality_main_event_weight_modifier = { TRAIT = compassionate }
	}

	immediate = {
		save_scope_as = child
		set_favorite_treat_effect = yes
		hidden_effect = { # Set up an irate cook for flavor & fun
			location.county.holder = {
				if = {
					limit = {
						any_courtier = {
							is_available_ai_adult = yes
							has_character_flag = cook
						}
					}
					random_courtier = {
						limit = {
							is_available_ai_adult = yes
							has_character_flag = cook
						}
						save_scope_as = cook
					}
				}
				else_if = {
					limit = {
						exists = location.county.holder.capital_province
						any_pool_character = {
							province = location.county.holder.capital_province
							is_available_ai_adult = yes
							has_no_particular_noble_roots_trigger = yes
						}
					}
					random_pool_character = {
						province = location.county.holder.capital_province
						limit = {
							is_available_ai_adult = yes
							has_no_particular_noble_roots_trigger = yes
						}
						location.county.holder = {
							add_courtier = prev
						}
						add_character_flag = peasant_outfit
						add_character_flag = cook
						save_scope_as = cook
					}
				}
				else_if = {
					limit = {
						exists = location.county.holder.capital_province
					}
					create_character = {
						template = servant_character
						dynasty = none
						location = location.county.holder.capital_province
						gender_female_chance = 50
						save_scope_as = cook
					}
					scope:cook = {
						add_character_flag = peasant_outfit
						add_character_flag = cook
						change_current_weight = 60
					}
				}
			}
		}
	}

	option = { # lazy
		name = child_personality.7030.a
		trigger = {
			NOR = {
				has_trait = lazy
				has_trait = diligent
			}
		}
		add_trait = lazy
		if = {
			limit = {
				exists = scope:cook
			}
			scope:cook = {
				add_opinion = {
					target = root
					modifier = lazy_child_opinion
				}
			}
		}
		if = {
			limit = {
				is_ai = yes
			}
			add_character_flag = lazy
			random_relation = {
				type = guardian
				trigger_event = child_personality.7031
			}
		}
		ai_chance = {
			base = 1
			
			child_personality_option_weight_modifier = { TRAIT = lazy }
		}
	}

	option = { # gluttonous
		name = child_personality.7030.b
		trigger = {
			NOR = {
				has_trait = temperate
				has_trait = gluttonous
			}
		}
		add_trait = gluttonous
		hidden_effect = {
			change_current_weight = 50
		}
		if = {
			limit = {
				exists = scope:cook
			}
			scope:cook = {
				add_opinion = {
					target = root
					modifier = little_pig_opinion
				}
			}
		}
		if = {
			limit = {
				is_ai = yes
			}
			add_character_flag = gluttonous
			random_relation = {
				type = guardian
				trigger_event = child_personality.7031
			}
		}
		ai_chance = {
			base = 1
			
			child_personality_option_weight_modifier = { TRAIT = gluttonous }
		}
	}

	option = { # compassionate
		name = child_personality.7030.c
		trigger = {
			NOR = {
				has_trait = compassionate
				has_trait = callous
				has_trait = sadistic
			}
		}
		add_trait = compassionate
		add_stress = minor_stress_gain
		if = {
			limit = {
				exists = scope:cook
			}
			scope:cook = {
				progress_towards_friend_effect = {
					CHARACTER = scope:child
					OPINION = 0
					REASON = friend_impressed_by_childs_compassion
				}
				add_opinion = {
					target = root
					modifier = sweet_child_opinion
				}
			}
		}
		if = {
			limit = {
				is_ai = yes
			}
			add_character_flag = compassionate
			random_relation = {
				type = guardian
				trigger_event = child_personality.7031
			}
		}
		ai_chance = {
			base = 1
			
			child_personality_option_weight_modifier = { TRAIT = compassionate }
		}
	}
}

#Guardian response to lazy, gluttonous, compassionate
child_personality.7031 = {
	type = character_event
	title = child_personality.7031.t
	desc = {
		desc = child_personality.7031.desc
		first_valid = {
			triggered_desc = {
			    trigger = {
					scope:child = {
						has_character_flag = lazy
					}
			    }
			    desc = {
			    	desc = child_personality.lazy.desc
			    }
			}
			triggered_desc = {
			    trigger = {
					scope:child = {
						has_character_flag = gluttonous
					}
			    }
			    desc = {
			    	desc = child_personality.gluttonous.desc
			    }
			}
			triggered_desc = {
			    trigger = {
					scope:child = {
						has_character_flag = compassionate
					}
			    }
			    desc = {
			    	desc = child_personality.compassionate.desc
			    }
			}
		}
	}
	theme = education
	override_background = { reference = bp1_kitchen_western }
	left_portrait = {
		character = scope:cook
		triggered_animation = {
			trigger = {
				scope:child = {
					OR = {
						has_character_flag = lazy
						has_character_flag = gluttonous
					}
				}
			}
  			animation = anger
  		}
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = compassionate
				}
			}
  			animation = happiness
  		}
	}
	right_portrait = {
		character = scope:child
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = lazy
				}
			}
  			animation = shame
  		}
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = gluttonous
				}
			}
  			animation = beg
  		}
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = compassionate
				}
			}
  			animation = personality_compassionate
  		}
	}
	
	immediate = {
	}

	option = {
		trigger = {
			scope:child = {
				has_character_flag = lazy
			}
		}
		name = child_personality.7031.lazy
		custom_tooltip = child_personality.keeps_lazy_tt
	}

	option = {
		trigger = {
			scope:child = {
				has_character_flag = gluttonous
			}
		}
		name = child_personality.7031.gluttonous
		custom_tooltip = child_personality.keeps_gluttonous_tt
	}

	option = {
		trigger = {
			scope:child = {
				has_character_flag = compassionate
			}
		}
		name = child_personality.7031.compassionate
		custom_tooltip = child_personality.keeps_compassionate_tt
	}

	option = {
		name = child_personality.7031.change.lazy
		trigger = {
			scope:child = {
				NOR = {
					has_trait = lazy
					has_trait = diligent
				}
			}
		}
		ai_chance = {
			base = 0
		}
		stress_impact = {
			base = child_trait_change_stress_penalty
		}
		scope:child = {
			if = {
				limit = {
					has_character_flag = gluttonous
				}
				remove_trait = gluttonous
			}
			if = {
				limit = {
					has_character_flag = compassionate
				}
				remove_trait = compassionate
			}
			add_trait_force_tooltip = lazy
		}
	}

	option = {
		name = child_personality.7031.change.gluttonous
		trigger = {
			scope:child = {
				NOR = {
					has_trait = gluttonous
					has_trait = temperate
				}
			}
		}
		ai_chance = {
			base = 0
		}
		stress_impact = {
			base = child_trait_change_stress_penalty
		}
		scope:child = {
			if = {
				limit = {
					has_character_flag = lazy
				}
				remove_trait = lazy
			}
			if = {
				limit = {
					has_character_flag = compassionate
				}
				remove_trait = compassionate
			}
			add_trait_force_tooltip = gluttonous
		}
	}

	option = {
		name = child_personality.7031.change.compassionate
		trigger = {
			scope:child = {
				NOR = {
					has_trait = compassionate
					has_trait = callous
					has_trait = sadistic
				}
			}
		}
		scope:cook = {
			add_opinion = {
				target = root
				modifier = thankful_opinion
			}
			progress_towards_friend_effect = {
				CHARACTER = root
				OPINION = 0
				REASON = friend_taught_child_compassion
			}
		}
		ai_chance = {
			base = 0
		}
		stress_impact = {
			base = child_trait_change_stress_penalty
		}
		scope:child = {
			if = {
				limit = {
					has_character_flag = gluttonous
				}
				remove_trait = gluttonous
			}
			if = {
				limit = {
					has_character_flag = lazy
				}
				remove_trait = lazy
			}
			add_trait_force_tooltip = compassionate
		}
	}
	
	after = {
		scope:child = {
			remove_character_flag = lazy
			remove_character_flag = gluttonous
			remove_character_flag = compassionate
		}
	}
}

scripted_trigger appropriate_traumatizing_lover_target = {
	is_available_ai_adult = yes
	OR = {
		any_relation = {
			type = lover
			is_available_ai_adult = yes
		}
		any_secret = {
			secret_type = secret_lover
			NOT = { is_known_by = root }
			secret_target = {
				is_available_ai_adult = yes
			}
		}
	}
}

#lustful, chaste
#Child hides in wardrobe, sees two adults having sex
child_personality.7040 = {
	type = character_event
	title = child_personality.7040.t
	desc = {
		desc = child_personality.7040.desc
		first_valid = {
			triggered_desc = {
			    trigger = {
					scope:lover_1 = {
						is_parent_of = root
					}
					scope:lover_2 = {
						is_parent_of = root
					}
			    }
			    desc = {
			    	desc = child_personality.7040.desc_motherfather
			    }
			}
			triggered_desc = {
			    trigger = {
					OR = {
						AND = {
							exists = father
							father = scope:lover_1
						}
						AND = {
							exists = father
							father = scope:lover_2
						}
					}
			    }
			    desc = {
			    	desc = child_personality.7040.desc_father
			    }
			}
			triggered_desc = {
			    trigger = {
					OR = {
						AND = {
							exists = mother
							mother = scope:lover_1
						}
						AND = {
							exists = mother
							mother = scope:lover_2
						}
					}
			    }
			    desc = {
			    	desc = child_personality.7040.desc_mother
			    }
			}
			triggered_desc = {
			    trigger = {
					NOR = {
						scope:lover_1 = {
							is_parent_of = root
						}
						scope:lover_2 = {
							is_parent_of = root
						}
					}
			    }
			    desc = {
			    	desc = child_personality.7040.desc_default
			    }
			}
		}
	}
	theme = education
	override_background = { reference = bedchamber }
	left_portrait = {
		character = scope:lover_1
		animation = admiration
		outfit_tags = { no_clothes }
	}
	right_portrait = {
		character = scope:lover_2
		animation = flirtation
		outfit_tags = { no_clothes }
	}

	trigger = {
		is_available_child_allow_travel = yes
		age >= 13 #Because chaste/lustful are only given at age 13
		NOR = {
			has_trait = chaste
			has_trait = lustful
		}
		exists = location.county.holder
		location.county.holder = {
			OR = {
				appropriate_traumatizing_lover_target = yes
				any_courtier_or_guest = {
					appropriate_traumatizing_lover_target = yes
				}
				any_vassal = {
					appropriate_traumatizing_lover_target = yes
				}
				AND = {
					exists = liege
					liege = {
						appropriate_traumatizing_lover_target = yes
					}
				}
				AND = {
					exists = liege
					liege = {
						any_courtier_or_guest = {
							appropriate_traumatizing_lover_target = yes
						}
					}
				}
			}
		}
	}

	weight_multiplier = {
		base = 1
		
		child_personality_main_event_weight_modifier = { TRAIT = lustful }
		child_personality_main_event_weight_modifier = { TRAIT = chaste }
	}

	immediate = {
		save_scope_as = child
		location.county.holder = {
			if = {
				limit = {
					appropriate_traumatizing_lover_target = yes
				}
				add_to_list = potential_child_traumatizers
			}
			every_courtier_or_guest = {
				limit = {
					appropriate_traumatizing_lover_target = yes
				}
				add_to_list = potential_child_traumatizers
			}
			every_vassal = {
				limit = {
					appropriate_traumatizing_lover_target = yes
				}
				add_to_list = potential_child_traumatizers
			}
			if = {
				limit = {
					exists = liege
					liege = {
						appropriate_traumatizing_lover_target = yes
					}
				}
				liege = {
					add_to_list = potential_child_traumatizers
				}
			}
			if = {
				limit = {
					exists = liege
				}
				liege = {
					if = {
						limit = {
							appropriate_traumatizing_lover_target = yes
						}
						add_to_list = potential_child_traumatizers
					}
					every_courtier_or_guest = {
						limit = {
							appropriate_traumatizing_lover_target = yes
						}
						add_to_list = potential_child_traumatizers
					}
					every_vassal = {
						limit = {
							appropriate_traumatizing_lover_target = yes
						}
						add_to_list = potential_child_traumatizers
					}
				}
			}
		}
		random_in_list = {
			list = potential_child_traumatizers
			limit = {
				any_secret = {
					secret_type = secret_lover
					NOT = { is_known_by = root }
					secret_target = {
						is_available_ai_adult = yes
					}
				}
			}
			alternative_limit = {
				always = yes
			}
			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 = 10
					has_trait = lustful
				}
				modifier = {
					add = 10
					exists = location
					exists = root.location
					location = root.location
				}
			}
			save_scope_as = lover_1
			if = {
				limit = {
					any_secret = {
						secret_type = secret_lover
						NOT = { is_known_by = root }
						secret_target = {
							is_available_ai_adult = yes
						}
					}
				}
				random_secret = {
					limit = {
						secret_type = secret_lover
						secret_target = {
							is_available_ai_adult = yes
						}
					}
					secret_target = {
						save_scope_as = lover_2
					}
					reveal_to = root
				}
			}
			else = {
				random_relation = {
					type = lover
					save_scope_as = lover_2
				}
			}
		}
		if = {
			limit = {
				OR = {
					has_sexuality = heterosexual
					has_sexuality = bisexual
				}
			}
			if = {
				limit = {
					is_attracted_to_gender_of = scope:lover_1
					scope:lover_1 = {
						is_attracted_to_gender_of = root
					}
				}
				scope:lover_1 = {
					save_scope_as = child_crush_target
				}
			}
			else_if = {
				limit = {
					is_attracted_to_gender_of = scope:lover_2
					scope:lover_2 = {
						is_attracted_to_gender_of = root
					}
				}
				scope:lover_2 = {
					save_scope_as = child_crush_target
				}
			}
		}
	}

	option = { # lustful + crush
		name = child_personality.7040.a.crush_version
		trigger = {
			exists = scope:child_crush_target
			NOT = {
				has_relation_crush = scope:child_crush_target
			}
		}
		add_trait = lustful
		set_relation_crush = scope:child_crush_target
		if = {
			limit = {
				is_ai = yes
			}
			add_character_flag = lustful
			random_relation = {
				type = guardian
				trigger_event = child_personality.7041
			}
		}
		ai_chance = {
			base = 1
			
			child_personality_option_weight_modifier = { TRAIT = lustful }
		}
	}

	option = { # lustful
		name = child_personality.7040.a
		trigger = {
			OR = {
				is_ai = no
				NOT = { exists = scope:child_crush_target }
			}
		}
		add_trait = lustful
		if = {
			limit = {
				is_ai = yes
			}
			add_character_flag = lustful
			random_relation = {
				type = guardian
				trigger_event = child_personality.7041
			}
		}
		ai_chance = {
			base = 1
			
			child_personality_option_weight_modifier = { TRAIT = lustful }
		}
	}

	option = { # chaste
		name = child_personality.7040.b
		add_trait = chaste
		if = {
			limit = {
				is_ai = yes
			}
			add_character_flag = chaste
			random_relation = {
				type = guardian
				trigger_event = child_personality.7041
			}
		}
		ai_chance = {
			base = 1
			
			child_personality_option_weight_modifier = { TRAIT = chaste }
		}
	}
}

#Guardian response to lustful, chaste
child_personality.7041 = {
	type = character_event
	title = child_personality.7041.t
	desc = {
		desc = child_personality.7041.desc
		first_valid = {
			triggered_desc = {
			    trigger = {
					scope:child = {
						has_character_flag = lustful
					}
			    }
			    desc = {
			    	desc = child_personality.lustful.desc
			    }
			}
			triggered_desc = {
			    trigger = {
					scope:child = {
						has_character_flag = chaste
					}
			    }
			    desc = {
			    	desc = child_personality.chaste.desc
			    }
			}
		}
	}
	theme = education
	override_background = { reference = bedchamber }
	left_portrait = {
		character = root
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = lustful
				}
			}
  			animation = disapproval
  		}
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = chaste
				}
			}
  			animation = worry
  		}
	}
	right_portrait = {
		character = scope:child
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = lustful
				}
			}
  			animation = personality_irrational
  		}
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = chaste
				}
			}
  			animation = shock
  		}
	}
	
	immediate = {
	}

	option = {
		trigger = {
			scope:child = {
				has_character_flag = lustful
			}
		}
		name = child_personality.7041.lustful
		custom_tooltip = child_personality.keeps_lustful_tt
	}

	option = {
		trigger = {
			scope:child = {
				has_character_flag = chaste
			}
		}
		name = child_personality.7041.chaste
		custom_tooltip = child_personality.keeps_chaste_tt
	}

	option = {
		name = child_personality.7041.change.lustful
		trigger = {
			scope:child = {
				NOT = {
					has_trait = lustful
				}
			}
		}
		ai_chance = {
			base = 0
		}
		stress_impact = {
			base = child_trait_change_stress_penalty
		}
		scope:child = {
			if = {
				limit = {
					has_character_flag = chaste
				}
				remove_trait = chaste
			}
			add_trait_force_tooltip = lustful
		}
	}

	option = {
		name = child_personality.7041.change.chaste
		trigger = {
			scope:child = {
				NOT = {
					has_trait = chaste
				}
			}
		}
		ai_chance = {
			base = 0
		}
		stress_impact = {
			base = child_trait_change_stress_penalty
		}
		scope:child = {
			if = {
				limit = {
					has_character_flag = lustful
				}
				remove_trait = lustful
			}
			add_trait_force_tooltip = chaste
		}
	}
	
	after = {
		scope:child = {
			remove_character_flag = lustful
			remove_character_flag = chaste
		}
	}
}

#just, greedy, callous
#The Steward/Tutor is teaching you a lesson in how to manage the treasury
child_personality.7050 = {
	type = character_event
	title = child_personality.7050.t
	desc = child_personality.7050.desc
	theme = education
	left_portrait = {
		character = root
		animation = personality_rational
	}
	right_portrait = {
		character = scope:teacher
		animation = throne_room_writer
	}

	trigger = {
		is_available_child_allow_travel = yes
		OR = {
			exists = location.county.holder.cp:councillor_steward
			AND = {
				exists = location.county.holder
				location.county.holder = {
					employs_court_position = court_tutor_court_position
				}
			}
		}
		NAND = {
			OR = {
				has_trait = just
				has_trait = arbitrary
			}
			OR = {
				has_trait = greedy
				has_trait = generous
			}
			OR = {
				has_trait = callous
				has_trait = compassionate
				has_trait = sadistic
			}
		}
	}

	weight_multiplier = {
		base = 1
		
		child_personality_main_event_weight_modifier = { TRAIT = just }
		child_personality_main_event_weight_modifier = { TRAIT = greedy }
		child_personality_main_event_weight_modifier = { TRAIT = callous }
	}

	immediate = {
		save_scope_as = child
		location.county.holder = {
			if = {
				limit = {
					employs_court_position = court_tutor_court_position
				}
				random_court_position_holder = {
					type = court_tutor_court_position
					save_scope_as = teacher
				}
			}
			else = {
				cp:councillor_steward = {
					save_scope_as = teacher
				}
			}
		}
		scope:teacher = {
			assign_quirk_effect = yes
		}
	}

	option = { # just
		name = child_personality.7050.a
		trigger = {
			NOR = {
				has_trait = just
				has_trait = arbitrary
			}
		}
		add_trait = just
		
		if = {
			limit = {
				scope:teacher = {
					is_ai = yes
					NOR = {
						has_trait = greedy
						has_trait = arbitrary
						has_trait = callous
						has_trait = paranoid
					}
				}
			}
			scope:teacher = {
				progress_towards_friend_effect = {
					CHARACTER = scope:child
					OPINION = 0
					REASON = friend_impressed_by_justice
				}
				add_opinion = {
					target = scope:child
					modifier = clever_child_opinion
				}
			}
		}
		
		if = {
			limit = {
				is_ai = yes
			}
			add_character_flag = just
			random_relation = {
				type = guardian
				trigger_event = child_personality.7051
			}
		}
		ai_chance = {
			base = 1
			
			child_personality_option_weight_modifier = { TRAIT = just }
		}
	}

	option = { # greedy
		name = child_personality.7050.b
		trigger = {
			NOR = {
				has_trait = generous
				has_trait = greedy
			}
		}
		add_trait = greedy
		
		if = {
			limit = {
				scope:teacher = {
					is_ai = yes
					OR = {
						has_trait = greedy
						has_trait = arbitrary
					}
				}
			}
			scope:teacher = {
				if = {
					limit = {
						can_set_relation_friend_trigger = { CHARACTER = scope:child }
					}
					set_relation_friend = { reason = friend_took_lessons_to_heart target = scope:child }
				}
				add_opinion = {
					target = scope:child
					modifier = clever_child_opinion
				}
			}
		}
		
		if = {
			limit = {
				is_ai = yes
			}
			add_character_flag = greedy
			random_relation = {
				type = guardian
				trigger_event = child_personality.7051
			}
		}
		ai_chance = {
			base = 1
			
			child_personality_option_weight_modifier = { TRAIT = greedy }
		}
	}

	option = { # callous
		name = child_personality.7050.c
		trigger = {
			NOR = {
				has_trait = callous
				has_trait = compassionate
				has_trait = sadistic
			}
		}
		add_trait = callous
		
		if = {
			limit = {
				scope:teacher = {
					is_ai = yes
					OR = {
						has_trait = callous
						has_trait = sadistic
						has_trait = paranoid
					}
				}
			}
			scope:teacher = {
				if = {
					limit = {
						can_set_relation_friend_trigger = { CHARACTER = scope:child }
					}
					set_relation_friend = { reason = friend_took_lessons_to_heart target = scope:child }
				}
				add_opinion = {
					target = scope:child
					modifier = clever_child_opinion
				}
			}
		}
		
		if = {
			limit = {
				is_ai = yes
			}
			add_character_flag = callous
			random_relation = {
				type = guardian
				trigger_event = child_personality.7051
			}
		}
		ai_chance = {
			base = 1
			
			child_personality_option_weight_modifier = { TRAIT = callous }
		}
	}
}

#Guardian response to just, greedy, callous
child_personality.7051 = {
	type = character_event
	title = child_personality.7051.t
	desc = {
		desc = child_personality.7051.desc
		first_valid = {
			triggered_desc = {
			    trigger = {
					this = scope:teacher
			    }
			    desc = {
			    	desc = child_personality.7051.desc_1
			    }
			}
			triggered_desc = {
			    trigger = {
					NOT = { this = scope:teacher }
			    }
			    desc = {
			    	desc = child_personality.7051.desc_2
			    }
			}
		}
		desc = child_personality.7051.desc_fin
		first_valid = {
			triggered_desc = {
			    trigger = {
					scope:child = {
						has_character_flag = just
					}
			    }
			    desc = {
			    	desc = child_personality.just.desc
			    }
			}
			triggered_desc = {
			    trigger = {
					scope:child = {
						has_character_flag = greedy
					}
			    }
			    desc = {
			    	desc = child_personality.greedy.desc
			    }
			}
			triggered_desc = {
			    trigger = {
					scope:child = {
						has_character_flag = callous
					}
			    }
			    desc = {
			    	desc = child_personality.callous.desc
			    }
			}
		}
	}
	theme = education
	left_portrait = {
		character = scope:teacher
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = just
				}
			}
  			animation = personality_rational
  		}
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = greedy
				}
			}
  			animation = disapproval
  		}
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = callous
				}
			}
  			animation = worry
  		}
	}
	right_portrait = {
		character = scope:child
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = just
				}
			}
  			animation = personality_honorable
  		}
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = greedy
				}
			}
  			animation = steward
  		}
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = callous
				}
			}
  			animation = personality_callous
  		}
	}
	
	immediate = {
	}

	option = {
		trigger = {
			scope:child = {
				has_character_flag = just
			}
		}
		name = child_personality.7051.just
		custom_tooltip = child_personality.keeps_just_tt
	}

	option = {
		trigger = {
			scope:child = {
				has_character_flag = greedy
			}
		}
		name = child_personality.7051.greedy
		custom_tooltip = child_personality.keeps_greedy_tt
	}

	option = {
		trigger = {
			scope:child = {
				has_character_flag = callous
			}
		}
		name = child_personality.7051.callous
		custom_tooltip = child_personality.keeps_callous_tt
	}

	option = {
		name = child_personality.7051.change.just
		trigger = {
			scope:child = {
				NOR = {
					has_trait = just
					has_trait = arbitrary
				}
			}
		}
		ai_chance = {
			base = 0
		}
		stress_impact = {
			base = child_trait_change_stress_penalty
		}
		scope:child = {
			if = {
				limit = {
					has_character_flag = greedy
				}
				remove_trait = greedy
			}
			if = {
				limit = {
					has_character_flag = callous
				}
				remove_trait = callous
			}
			add_trait_force_tooltip = just
		}
	}

	option = {
		name = child_personality.7051.change.greedy
		trigger = {
			scope:child = {
				NOR = {
					has_trait = greedy
					has_trait = generous
				}
			}
		}
		ai_chance = {
			base = 0
		}
		stress_impact = {
			base = child_trait_change_stress_penalty
		}
		scope:child = {
			if = {
				limit = {
					has_character_flag = just
				}
				remove_trait = just
			}
			if = {
				limit = {
					has_character_flag = callous
				}
				remove_trait = callous
			}
			add_trait_force_tooltip = greedy
		}
	}

	option = {
		name = child_personality.7051.change.callous
		trigger = {
			scope:child = {
				NOR = {
					has_trait = callous
					has_trait = compassionate
					has_trait = sadistic
				}
			}
		}
		ai_chance = {
			base = 0
		}
		stress_impact = {
			base = child_trait_change_stress_penalty
		}
		scope:child = {
			if = {
				limit = {
					has_character_flag = greedy
				}
				remove_trait = greedy
			}
			if = {
				limit = {
					has_character_flag = just
				}
				remove_trait = just
			}
			add_trait_force_tooltip = callous
		}
	}
	
	after = {
		scope:child = {
			remove_character_flag = just
			remove_character_flag = greedy
			remove_character_flag = callous
		}
	}
}

#humble, cynical, content
#You are reading your faiths holy book
child_personality.7060 = {
	type = character_event
	title = child_personality.7060.t
	desc = child_personality.7060.desc
	theme = education
	override_background = { reference = relaxing_room }
	left_portrait = {
		character = root
		animation = personality_rational
	}
	right_portrait = {
		character = scope:other_child
		animation = throne_room_writer
	}

	trigger = {
		is_available_child_allow_travel = yes
		suitable_same_realm_child = yes
		NAND = {
			OR = {
				has_trait = humble
				has_trait = arrogant
			}
			OR = {
				has_trait = cynical
				has_trait = zealous
			}
			OR = {
				has_trait = content
				has_trait = ambitious
			}
		}
	}

	weight_multiplier = {
		base = 1
		
		child_personality_main_event_weight_modifier = { TRAIT = humble }
		child_personality_main_event_weight_modifier = { TRAIT = cynical }
		child_personality_main_event_weight_modifier = { TRAIT = content }
	}

	immediate = {
		save_scope_as = child
		add_suitable_same_realm_children_to_list = yes
		set_favorite_toy_effect = yes
		random_in_list = {
			list = suitable_same_realm_children
			limit = {
				NOR = {
					has_trait = cynical
					has_relation_bully = root
					has_relation_victim = root
					has_relation_rival = root
				}
			}
			alternative_limit = {
				NOR = {
					has_relation_bully = root
					has_relation_victim = root
					has_relation_rival = root
				}
			}
			alternative_limit = {
				always = yes
			}
			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
					has_trait = pensive
				}
				modifier = {
					add = 5
					has_trait = zealous
				}
			}
			save_scope_as = other_child
		}
	}

	option = { # humble
		name = child_personality.7060.a
		trigger = {
			NOR = {
				has_trait = humble
				has_trait = arrogant
			}
		}
		add_trait = humble
		
		progress_towards_friend_effect = {
			CHARACTER = scope:other_child
			OPINION = 25
			REASON = friend_bonded_after_reading_book
		}
		random = {
			chance = 1
			add_trait = lifestyle_mystic
		}
		if = {
			limit = {
				is_ai = yes
			}
			add_character_flag = humble
			random_relation = {
				type = guardian
				trigger_event = child_personality.7061
			}
		}
		ai_chance = {
			base = 1
			
			child_personality_option_weight_modifier = { TRAIT = humble }
		}
	}

	option = { # cynical
		name = child_personality.7060.b
		trigger = {
			NOR = {
				has_trait = zealous
				has_trait = cynical
			}
		}
		add_trait = cynical
		if = {
			limit = {
				can_set_relation_friend_trigger = { CHARACTER = scope:other_child }
			}
			set_relation_friend = { reason = friend_toy target = scope:other_child }
		}
		
		if = {
			limit = {
				is_ai = yes
			}
			add_character_flag = cynical
			random_relation = {
				type = guardian
				trigger_event = child_personality.7061
			}
		}
		ai_chance = {
			base = 1
			
			child_personality_option_weight_modifier = { TRAIT = cynical }
		}
	}

	option = { # content
		name = child_personality.7060.c
		trigger = {
			NOR = {
				has_trait = content
				has_trait = ambitious
			}
		}
		add_trait = content
		add_stress = major_stress_loss
		
		if = {
			limit = {
				is_ai = yes
			}
			add_character_flag = content
			random_relation = {
				type = guardian
				trigger_event = child_personality.7061
			}
		}
		ai_chance = {
			base = 1
			
			child_personality_option_weight_modifier = { TRAIT = content }
		}
	}
}

#Guardian response to humble, cynical, content
child_personality.7061 = {
	type = character_event
	title = child_personality.7061.t
	desc = {
		desc = child_personality.7061.desc
		first_valid = {
			triggered_desc = {
			    trigger = {
					scope:child = {
						has_character_flag = humble
					}
			    }
			    desc = {
			    	desc = child_personality.humble.desc
			    }
			}
			triggered_desc = {
			    trigger = {
					scope:child = {
						has_character_flag = cynical
					}
			    }
			    desc = {
			    	desc = child_personality.cynical.desc
			    }
			}
			triggered_desc = {
			    trigger = {
					scope:child = {
						has_character_flag = content
					}
			    }
			    desc = {
			    	desc = child_personality.content.desc
			    }
			}
		}
	}
	theme = education
	override_background = { reference = relaxing_room }
	left_portrait = {
		character = scope:child
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = humble
				}
			}
  			animation = admiration
  		}
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = cynical
				}
			}
  			animation = shame
  		}
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = content
				}
			}
  			animation = happiness
  		}
	}
	right_portrait = {
		character = scope:other_child
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = humble
				}
			}
  			animation = personality_zealous
  		}
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = cynical
				}
			}
  			animation = shame
  		}
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = content
				}
			}
  			animation = personality_rational
  		}
	}
	
	immediate = {
	}

	option = {
		trigger = {
			scope:child = {
				has_character_flag = humble
			}
		}
		name = child_personality.7061.humble
		custom_tooltip = child_personality.keeps_humble_tt
	}

	option = {
		trigger = {
			scope:child = {
				has_character_flag = cynical
			}
		}
		name = child_personality.7061.cynical
		custom_tooltip = child_personality.keeps_cynical_tt
	}

	option = {
		trigger = {
			scope:child = {
				has_character_flag = content
			}
		}
		name = child_personality.7061.content
		custom_tooltip = child_personality.keeps_content_tt
	}

	option = {
		name = child_personality.7061.change.humble
		trigger = {
			scope:child = {
				NOR = {
					has_trait = humble
					has_trait = arrogant
				}
			}
		}
		ai_chance = {
			base = 0
		}
		stress_impact = {
			base = child_trait_change_stress_penalty
		}
		scope:child = {
			if = {
				limit = {
					has_character_flag = cynical
				}
				remove_trait = cynical
			}
			if = {
				limit = {
					has_character_flag = content
				}
				remove_trait = content
			}
			add_trait_force_tooltip = humble
		}
	}

	option = {
		name = child_personality.7061.change.cynical
		trigger = {
			scope:child = {
				NOR = {
					has_trait = cynical
					has_trait = zealous
				}
			}
		}
		ai_chance = {
			base = 0
		}
		stress_impact = {
			base = child_trait_change_stress_penalty
		}
		scope:child = {
			if = {
				limit = {
					has_character_flag = humble
				}
				remove_trait = humble
			}
			if = {
				limit = {
					has_character_flag = content
				}
				remove_trait = content
			}
			add_trait_force_tooltip = cynical
		}
	}

	option = {
		name = child_personality.7061.change.content
		trigger = {
			scope:child = {
				NOR = {
					has_trait = content
					has_trait = ambitious
				}
			}
		}
		ai_chance = {
			base = 0
		}
		stress_impact = {
			base = child_trait_change_stress_penalty
		}
		scope:child = {
			if = {
				limit = {
					has_character_flag = cynical
				}
				remove_trait = cynical
			}
			if = {
				limit = {
					has_character_flag = humble
				}
				remove_trait = humble
			}
			add_trait_force_tooltip = content
		}
	}
	
	after = {
		scope:child = {
			remove_character_flag = humble
			remove_character_flag = cynical
			remove_character_flag = content
		}
	}
}

#vengeful, deceitful, calm
#A bully spits in your food
child_personality.7070 = {
	type = character_event
	title = child_personality.7070.t
	desc = child_personality.7070.desc
	theme = education
	override_background = { reference = feast }
	left_portrait = {
		character = root
		animation = rage
	}
	right_portrait = {
		character = scope:other_child
		animation = ecstasy
	}

	trigger = {
		is_available_child_allow_travel = yes
		OR = {
			suitable_same_realm_child = yes
			any_relation = {
				type = bully
				is_available_ai = yes
			}
		}
		NAND = {
			OR = {
				has_trait = vengeful
				has_trait = forgiving
			}
			OR = {
				has_trait = deceitful
				has_trait = honest
			}
			OR = {
				has_trait = calm
				has_trait = wrathful
			}
		}
	}

	weight_multiplier = {
		base = 1
		
		child_personality_main_event_weight_modifier = { TRAIT = vengeful }
		child_personality_main_event_weight_modifier = { TRAIT = deceitful }
		child_personality_main_event_weight_modifier = { TRAIT = calm }
	}

	immediate = {
		save_scope_as = child
		if = {
			limit = {
				any_relation = {
					type = bully
					is_available_ai = yes
				}
			}
			random_relation = {
				type = bully
				limit = {
					is_available_ai = yes
				}
				save_scope_as = other_child
			}
		}
		else = {
			add_suitable_same_realm_children_to_list = yes
			random_in_list = {
				list = suitable_same_realm_children
				limit = {
					NOR = {
						has_trait = compassionate
						has_trait = forgiving
						has_relation_friend = root
						has_relation_potential_friend = root
						has_relation_crush = root
					}
				}
				alternative_limit = {
					NOR = {
						has_relation_friend = root
						has_relation_potential_friend = root
						has_relation_crush = root
					}
				}
				alternative_limit = {
					NOR = {
						has_trait = compassionate
						has_trait = forgiving
					}
				}
				alternative_limit = {
					always = yes
				}
				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 = 10
						has_trait = sadistic
					}
					modifier = {
						add = 5
						has_trait = rowdy
					}
					modifier = {
						add = 5
						has_trait = wrathful
					}
				}
				save_scope_as = other_child
			}
		}
		
		if = {
			limit = {
				NOT = {
					has_relation_bully = scope:other_child
				}
			}
			set_relation_bully = scope:other_child
		}
	}

	option = { # vengeful
		name = child_personality.7070.a
		trigger = {
			NOR = {
				has_trait = vengeful
				has_trait = forgiving
			}
		}
		add_trait = vengeful
		
		progress_towards_rival_effect = {
			REASON = rival_spat_food
			CHARACTER = scope:other_child
			OPINION = -50
		}
		
		scope:other_child = {
			random = {
				chance = 15
				increase_wounds_effect = { REASON = fight }
			}
		}
		
		add_prestige = medium_prestige_gain
		
		if = {
			limit = {
				is_ai = yes
			}
			add_character_flag = vengeful
			random_relation = {
				type = guardian
				trigger_event = child_personality.7071
			}
		}
		ai_chance = {
			base = 1
			
			child_personality_option_weight_modifier = { TRAIT = vengeful }
		}
	}

	option = { # deceitful
		name = child_personality.7070.b
		trigger = {
			NOR = {
				has_trait = honest
				has_trait = deceitful
			}
		}
		add_trait = deceitful
		
		scope:other_child = {
			add_stress = medium_stress_gain
		}
		
		if = {
			limit = {
				is_ai = yes
			}
			add_character_flag = deceitful
			random_relation = {
				type = guardian
				trigger_event = child_personality.7071
			}
		}
		ai_chance = {
			base = 1
			
			child_personality_option_weight_modifier = { TRAIT = deceitful }
		}
	}

	option = { # calm
		name = child_personality.7070.c
		flavor = child_personality.7070.c.flavor
		trigger = {
			NOR = {
				has_trait = calm
				has_trait = wrathful
			}
		}
		add_trait = calm
		
		random = {
			chance = 50
			remove_relation_bully = scope:other_child
		}
		
		if = {
			limit = {
				is_ai = yes
			}
			add_character_flag = calm
			random_relation = {
				type = guardian
				trigger_event = child_personality.7071
			}
		}
		ai_chance = {
			base = 1
			
			child_personality_option_weight_modifier = { TRAIT = calm }
		}
	}
}

#Guardian response to vengeful, deceitful, calm
child_personality.7071 = {
	type = character_event
	title = child_personality.7071.t
	desc = {
		desc = child_personality.7071.desc
		first_valid = {
			triggered_desc = {
			    trigger = {
					scope:child = {
						has_character_flag = vengeful
					}
			    }
			    desc = {
			    	desc = child_personality.vengeful.desc
			    }
			}
			triggered_desc = {
			    trigger = {
					scope:child = {
						has_character_flag = deceitful
					}
			    }
			    desc = {
			    	desc = child_personality.deceitful.desc
			    }
			}
			triggered_desc = {
			    trigger = {
					scope:child = {
						has_character_flag = calm
					}
			    }
			    desc = {
			    	desc = child_personality.calm.desc
			    }
			}
		}
	}
	theme = education
	override_background = { reference = feast }
	left_portrait = {
		character = scope:child
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = vengeful
				}
			}
  			animation = rage
  		}
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = deceitful
				}
			}
  			animation = scheme
  		}
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = calm
				}
			}
  			animation = dismissal
  		}
	}
	right_portrait = {
		character = scope:other_child
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = vengeful
				}
			}
  			animation = anger
  		}
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = deceitful
				}
			}
  			animation = poison
  		}
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = calm
				}
			}
  			animation = personality_dishonorable
  		}
	}
	
	immediate = {
	}

	option = {
		trigger = {
			scope:child = {
				has_character_flag = vengeful
			}
		}
		name = child_personality.7071.vengeful
		custom_tooltip = child_personality.keeps_vengeful_tt
	}

	option = {
		trigger = {
			scope:child = {
				has_character_flag = deceitful
			}
		}
		progress_towards_friend_effect = {
			CHARACTER = scope:child
			OPINION = 0
			REASON = friend_encouraged_deceitfulness
		}
		name = child_personality.7071.deceitful
		custom_tooltip = child_personality.keeps_deceitful_tt
	}

	option = {
		trigger = {
			scope:child = {
				has_character_flag = calm
			}
		}
		name = child_personality.7071.calm
		custom_tooltip = child_personality.keeps_calm_tt
	}

	option = {
		name = child_personality.7071.change.vengeful
		trigger = {
			scope:child = {
				NOR = {
					has_trait = vengeful
					has_trait = forgiving
				}
			}
		}
		ai_chance = {
			base = 0
		}
		stress_impact = {
			base = child_trait_change_stress_penalty
		}
		scope:child = {
			if = {
				limit = {
					has_character_flag = deceitful
				}
				remove_trait = deceitful
			}
			if = {
				limit = {
					has_character_flag = calm
				}
				remove_trait = calm
			}
			add_trait_force_tooltip = vengeful
		}
	}

	option = {
		name = child_personality.7071.change.deceitful
		trigger = {
			scope:child = {
				NOR = {
					has_trait = deceitful
					has_trait = honest
				}
			}
		}
		ai_chance = {
			base = 0
		}
		stress_impact = {
			base = child_trait_change_stress_penalty
		}
		scope:child = {
			if = {
				limit = {
					has_character_flag = vengeful
				}
				remove_trait = vengeful
			}
			if = {
				limit = {
					has_character_flag = calm
				}
				remove_trait = calm
			}
			add_trait_force_tooltip = deceitful
		}
	}

	option = {
		name = child_personality.7071.change.calm
		trigger = {
			scope:child = {
				NOR = {
					has_trait = calm
					has_trait = wrathful
				}
			}
		}
		ai_chance = {
			base = 0
		}
		stress_impact = {
			base = child_trait_change_stress_penalty
		}
		scope:child = {
			if = {
				limit = {
					has_character_flag = deceitful
				}
				remove_trait = deceitful
			}
			if = {
				limit = {
					has_character_flag = vengeful
				}
				remove_trait = vengeful
			}
			add_trait_force_tooltip = calm
		}
	}
	
	after = {
		scope:child = {
			remove_character_flag = vengeful
			remove_character_flag = deceitful
			remove_character_flag = calm
		}
	}
}

#generous, fickle, arrogant
#The Realm Priest take you out to distribute alms, and tells you to find those that deserve it the most
child_personality.7080 = {
	type = character_event
	title = child_personality.7080.t
	desc = {
		desc = child_personality.7080.desc_1
		first_valid = {
			triggered_desc = {
			    trigger = {
					scope:teacher = {
						NOT = {
							is_councillor = yes
						}
					}
			    }
			    desc = {
			    	desc = child_personality.7080.desc_name_1
			    }
			}
			triggered_desc = {
			    trigger = {
					scope:teacher = {
						is_councillor = yes
					}
			    }
			    desc = {
			    	desc = child_personality.7080.desc_name_2
			    }
			}
		}
	}
	theme = education
	override_background = { reference = market }
	left_portrait = {
		character = root
		animation = steward
	}
	right_portrait = {
		character = scope:teacher
		animation = chaplain
	}

	trigger = {
		is_available_child_allow_travel = yes
		OR = {
			AND = {
				exists = location.county.holder.cp:councillor_court_chaplain
				location.county.holder.cp:councillor_court_chaplain = {
					is_available_ai_adult = yes
				}
			}
			AND = {
				exists = location.county.holder
				location.county.holder = {
					any_vassal = {
						is_available_ai_adult = yes
						has_education_learning_trigger = yes
					}
				}
			}
		}
		NAND = {
			OR = {
				has_trait = generous
				has_trait = greedy
			}
			OR = {
				has_trait = fickle
				has_trait = stubborn
				has_trait = eccentric
			}
			OR = {
				has_trait = arrogant
				has_trait = humble
			}
		}
	}

	weight_multiplier = {
		base = 1
		
		child_personality_main_event_weight_modifier = { TRAIT = generous }
		child_personality_main_event_weight_modifier = { TRAIT = fickle }
		child_personality_main_event_weight_modifier = { TRAIT = arrogant }
	}

	immediate = {
		save_scope_as = child
		if = {
			limit = {
				exists = location.county.holder.cp:councillor_court_chaplain
			}
			location.county.holder.cp:councillor_court_chaplain = {
				save_scope_as = teacher
			}
		}
		else = {
			location.county.holder = {
				random_vassal = {
					limit = {
						is_available_ai_adult = yes
						has_education_learning_trigger = yes
					}
					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 = 10
							has_trait = humble
						}
						modifier = {
							add = 5
							has_trait = zealous
						}
					}
					save_scope_as = teacher
				}
			}
		}
	}

	option = { # generous
		name = child_personality.7080.a
		trigger = {
			NOR = {
				has_trait = generous
				has_trait = greedy
			}
		}
		add_trait = generous
		
		add_piety = medium_piety_gain
		add_stress = minor_stress_gain
		
		if = {
			limit = {
				is_ai = yes
			}
			add_character_flag = generous
			random_relation = {
				type = guardian
				trigger_event = child_personality.7081
			}
		}
		ai_chance = {
			base = 1
			
			child_personality_option_weight_modifier = { TRAIT = generous }
		}
	}

	option = { # fickle
		name = child_personality.7080.b
		trigger = {
			NOR = {
				has_trait = stubborn
				has_trait = fickle
			}
		}
		add_trait = fickle
		
		if = {
			limit = {
				is_ai = yes
			}
			add_character_flag = fickle
			random_relation = {
				type = guardian
				trigger_event = child_personality.7081
			}
		}
		ai_chance = {
			base = 1
			
			child_personality_option_weight_modifier = { TRAIT = fickle }
		}
	}

	option = { # arrogant
		name = child_personality.7080.c
		trigger = {
			NOR = {
				has_trait = arrogant
				has_trait = humble
			}
		}
		add_trait = arrogant
		
		scope:teacher = {
			add_opinion = {
				target = scope:child
				modifier = disappointed_opinion
				opinion = -30
			}
			pay_short_term_gold = {
				target = scope:child
				gold = tiny_gold_value
			}
		}
		
		if = {
			limit = {
				is_ai = yes
			}
			add_character_flag = arrogant
			random_relation = {
				type = guardian
				trigger_event = child_personality.7081
			}
		}
		ai_chance = {
			base = 1
			
			child_personality_option_weight_modifier = { TRAIT = arrogant }
		}
	}
}

#Guardian response to generous, fickle, arrogant
child_personality.7081 = {
	type = character_event
	title = child_personality.7081.t
	desc = {
		desc = child_personality.7081.desc
		first_valid = {
			triggered_desc = {
			    trigger = {
					scope:child = {
						has_character_flag = generous
					}
			    }
			    desc = {
			    	desc = child_personality.generous.desc
			    }
			}
			triggered_desc = {
			    trigger = {
					scope:child = {
						has_character_flag = fickle
					}
			    }
			    desc = {
			    	desc = child_personality.fickle.desc
			    }
			}
			triggered_desc = {
			    trigger = {
					scope:child = {
						has_character_flag = arrogant
					}
			    }
			    desc = {
			    	desc = child_personality.arrogant.desc
			    }
			}
		}
	}
	theme = education
	left_portrait = {
		character = scope:child
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = generous
				}
			}
  			animation = personality_forgiving
  		}
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = fickle
				}
			}
  			animation = personality_irrational
  		}
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = arrogant
				}
			}
  			animation = dismissal
  		}
	}
	right_portrait = {
		character = scope:teacher
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = generous
				}
			}
  			animation = chaplain
  		}
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = fickle
				}
			}
  			animation = stress
  		}
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = arrogant
				}
			}
  			animation = worry
  		}
	}
	
	immediate = {
		scope:child = {
			set_favorite_treat_effect = yes
		}
	}

	option = {
		trigger = {
			scope:child = {
				has_character_flag = generous
			}
		}
		name = child_personality.7081.generous
		custom_tooltip = child_personality.keeps_generous_tt
	}

	option = {
		trigger = {
			scope:child = {
				has_character_flag = fickle
			}
		}
		progress_towards_friend_effect = {
			CHARACTER = scope:child
			OPINION = 0
			REASON = friend_encouraged_fickleness
		}
		name = child_personality.7081.fickle
		custom_tooltip = child_personality.keeps_fickle_tt
	}

	option = {
		trigger = {
			scope:child = {
				has_character_flag = arrogant
			}
		}
		name = child_personality.7081.arrogant
		custom_tooltip = child_personality.keeps_arrogant_tt
	}

	option = {
		name = child_personality.7081.change.generous
		trigger = {
			scope:child = {
				NOR = {
					has_trait = generous
					has_trait = greedy
				}
			}
		}
		ai_chance = {
			base = 0
		}
		stress_impact = {
			base = child_trait_change_stress_penalty
		}
		scope:child = {
			if = {
				limit = {
					has_character_flag = fickle
				}
				remove_trait = fickle
			}
			if = {
				limit = {
					has_character_flag = arrogant
				}
				remove_trait = arrogant
			}
			add_trait_force_tooltip = generous
		}
	}

	option = {
		name = child_personality.7081.change.fickle
		trigger = {
			scope:child = {
				NOR = {
					has_trait = fickle
					has_trait = stubborn
				}
			}
		}
		ai_chance = {
			base = 0
		}
		stress_impact = {
			base = child_trait_change_stress_penalty
		}
		scope:child = {
			if = {
				limit = {
					has_character_flag = generous
				}
				remove_trait = generous
			}
			if = {
				limit = {
					has_character_flag = arrogant
				}
				remove_trait = arrogant
			}
			add_trait_force_tooltip = fickle
		}
	}

	option = {
		name = child_personality.7081.change.arrogant
		trigger = {
			scope:child = {
				NOR = {
					has_trait = arrogant
					has_trait = humble
				}
			}
		}
		ai_chance = {
			base = 0
		}
		stress_impact = {
			base = child_trait_change_stress_penalty
		}
		scope:child = {
			if = {
				limit = {
					has_character_flag = fickle
				}
				remove_trait = fickle
			}
			if = {
				limit = {
					has_character_flag = generous
				}
				remove_trait = generous
			}
			add_trait_force_tooltip = arrogant
		}
	}
	
	after = {
		scope:child = {
			remove_character_flag = generous
			remove_character_flag = fickle
			remove_character_flag = arrogant
		}
	}
}

#forgiving, trusting, patient
#The Chancellor/Tutor gives you a lesson in diplomacy
child_personality.7090 = {
	type = character_event
	title = child_personality.7090.t
	desc = child_personality.7090.desc
	theme = education
	left_portrait = {
		character = root
		animation = personality_rational
	}
	right_portrait = {
		character = scope:teacher
		animation = chancellor
	}

	trigger = {
		is_available_child_allow_travel = yes
		OR = {
			exists = location.county.holder.cp:councillor_chancellor
			AND = {
				exists = location.county.holder
				location.county.holder = {
					employs_court_position = court_tutor_court_position
				}
			}
		}
		NAND = {
			OR = {
				has_trait = forgiving
				has_trait = vengeful
			}
			OR = {
				has_trait = trusting
				has_trait = paranoid
			}
			OR = {
				has_trait = patient
				has_trait = impatient
			}
		}
	}

	weight_multiplier = {
		base = 1
		
		child_personality_main_event_weight_modifier = { TRAIT = forgiving }
		child_personality_main_event_weight_modifier = { TRAIT = trusting }
		child_personality_main_event_weight_modifier = { TRAIT = patient }
	}

	immediate = {
		save_scope_as = child
		location.county.holder = {
			if = {
				limit = {
					employs_court_position = court_tutor_court_position
				}
				random_court_position_holder = {
					type = court_tutor_court_position
					save_scope_as = teacher
				}
			}
			else = {
				cp:councillor_chancellor = {
					save_scope_as = teacher
				}
			}
		}
	}

	option = { # forgiving
		name = child_personality.7090.a
		trigger = {
			NOR = {
				has_trait = forgiving
				has_trait = vengeful
			}
		}
		add_trait = forgiving
		
		scope:teacher = {
			if = {
				limit = {
					OR = {
						has_trait = forgiving
						has_trait = compassionate
					}
					NOT = {
						has_trait = vengeful
					}
				}
				progress_towards_friend_effect = {
					CHARACTER = scope:child
					OPINION = 0
					REASON = friend_impressed_by_forgiveness
				}
				add_opinion = {
					target = scope:child
					modifier = clever_child_opinion
				}
			}
		}
		
		if = {
			limit = {
				is_ai = yes
			}
			add_character_flag = forgiving
			random_relation = {
				type = guardian
				trigger_event = child_personality.7091
			}
		}
		ai_chance = {
			base = 1
			
			child_personality_option_weight_modifier = { TRAIT = forgiving }
		}
	}

	option = { # trusting
		name = child_personality.7090.b
		trigger = {
			NOR = {
				has_trait = paranoid
				has_trait = trusting
			}
		}
		add_trait = trusting
		
		scope:teacher = {
			if = {
				limit = {
					OR = {
						has_trait = trusting
						has_trait = gregarious
					}
					NOT = {
						has_trait = paranoid
					}
				}
				progress_towards_friend_effect = {
					CHARACTER = scope:child
					OPINION = 0
					REASON = friend_impressed_by_forgiveness
				}
				add_opinion = {
					target = scope:child
					modifier = clever_child_opinion
				}
			}
		}
		
		if = {
			limit = {
				is_ai = yes
			}
			add_character_flag = trusting
			random_relation = {
				type = guardian
				trigger_event = child_personality.7091
			}
		}
		ai_chance = {
			base = 1
			
			child_personality_option_weight_modifier = { TRAIT = trusting }
		}
	}

	option = { # patient
		name = child_personality.7090.c
		trigger = {
			NOR = {
				has_trait = patient
				has_trait = impatient
			}
		}
		add_trait = patient
		
		scope:teacher = {
			if = {
				limit = {
					OR = {
						has_trait = patient
						has_trait = calm
					}
					NOT = {
						has_trait = impatient
					}
				}
				progress_towards_friend_effect = {
					CHARACTER = scope:child
					OPINION = 0
					REASON = friend_impressed_by_forgiveness
				}
				add_opinion = {
					target = scope:child
					modifier = clever_child_opinion
				}
			}
		}
		
		if = {
			limit = {
				is_ai = yes
			}
			add_character_flag = patient
			random_relation = {
				type = guardian
				trigger_event = child_personality.7091
			}
		}
		ai_chance = {
			base = 1
			
			child_personality_option_weight_modifier = { TRAIT = patient }
		}
	}
}

#Guardian response to forgiving, trusting, patient
child_personality.7091 = {
	type = character_event
	title = child_personality.7091.t
	desc = {
		desc = child_personality.7091.desc
		first_valid = {
			triggered_desc = {
			    trigger = {
					scope:child = {
						has_character_flag = forgiving
					}
			    }
			    desc = {
			    	desc = child_personality.forgiving.desc
			    }
			}
			triggered_desc = {
			    trigger = {
					scope:child = {
						has_character_flag = trusting
					}
			    }
			    desc = {
			    	desc = child_personality.trusting.desc
			    }
			}
			triggered_desc = {
			    trigger = {
					scope:child = {
						has_character_flag = patient
					}
			    }
			    desc = {
			    	desc = child_personality.patient.desc
			    }
			}
		}
	}
	theme = education
	left_portrait = {
		character = scope:child
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = forgiving
				}
			}
  			animation = personality_forgiving
  		}
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = trusting
				}
			}
  			animation = personality_compassionate
  		}
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = patient
				}
			}
  			animation = personality_rational
  		}
	}
	right_portrait = {
		character = scope:teacher
		animation = chancellor
	}
	
	immediate = {
	}

	option = {
		trigger = {
			scope:child = {
				has_character_flag = forgiving
			}
		}
		name = child_personality.7091.forgiving
		custom_tooltip = child_personality.keeps_forgiving_tt
	}

	option = {
		trigger = {
			scope:child = {
				has_character_flag = trusting
			}
		}
		name = child_personality.7091.trusting
		custom_tooltip = child_personality.keeps_trusting_tt
	}

	option = {
		trigger = {
			scope:child = {
				has_character_flag = patient
			}
		}
		name = child_personality.7091.patient
		custom_tooltip = child_personality.keeps_patient_tt
	}

	option = {
		name = child_personality.7091.change.forgiving
		trigger = {
			scope:child = {
				NOR = {
					has_trait = forgiving
					has_trait = vengeful
				}
			}
		}
		ai_chance = {
			base = 0
		}
		stress_impact = {
			base = child_trait_change_stress_penalty
		}
		scope:child = {
			if = {
				limit = {
					has_character_flag = trusting
				}
				remove_trait = trusting
			}
			if = {
				limit = {
					has_character_flag = patient
				}
				remove_trait = patient
			}
			add_trait_force_tooltip = forgiving
		}
	}

	option = {
		name = child_personality.7091.change.trusting
		trigger = {
			scope:child = {
				NOR = {
					has_trait = trusting
					has_trait = paranoid
				}
			}
		}
		ai_chance = {
			base = 0
		}
		stress_impact = {
			base = child_trait_change_stress_penalty
		}
		scope:child = {
			if = {
				limit = {
					has_character_flag = forgiving
				}
				remove_trait = forgiving
			}
			if = {
				limit = {
					has_character_flag = patient
				}
				remove_trait = patient
			}
			add_trait_force_tooltip = trusting
		}
	}

	option = {
		name = child_personality.7091.change.patient
		trigger = {
			scope:child = {
				NOR = {
					has_trait = patient
					has_trait = impatient
				}
			}
		}
		ai_chance = {
			base = 0
		}
		stress_impact = {
			base = child_trait_change_stress_penalty
		}
		scope:child = {
			if = {
				limit = {
					has_character_flag = trusting
				}
				remove_trait = trusting
			}
			if = {
				limit = {
					has_character_flag = forgiving
				}
				remove_trait = forgiving
			}
			add_trait_force_tooltip = patient
		}
	}
	
	after = {
		scope:child = {
			remove_character_flag = forgiving
			remove_character_flag = trusting
			remove_character_flag = patient
		}
	}
}

#honest, arbitrary, impatient
# You break into the armory with another kid and play with the weapons. The other kid is hurt.
child_personality.7100 = {
	type = character_event
	title = child_personality.7100.t
	desc = child_personality.7100.desc
	theme = education
	override_background = { reference = armory }
	left_portrait = {
		character = root
		animation = spymaster
	}
	right_portrait = {
		character = scope:other_child
		animation = severelywounded
	}

	trigger = {
		is_available_child_allow_travel = yes
		suitable_same_realm_child = yes
		NAND = {
			OR = {
				has_trait = honest
				has_trait = deceitful
			}
			OR = {
				has_trait = arbitrary
				has_trait = just
			}
			OR = {
				has_trait = impatient
				has_trait = patient
			}
		}
	}

	weight_multiplier = {
		base = 1
		
		child_personality_main_event_weight_modifier = { TRAIT = honest }
		child_personality_main_event_weight_modifier = { TRAIT = arbitrary }
		child_personality_main_event_weight_modifier = { TRAIT = impatient }
	}

	immediate = {
		save_scope_as = child
		add_suitable_same_realm_children_to_list = yes
		random_in_list = {
			list = suitable_same_realm_children
			limit = {
				NOR = {
					has_trait = honest
					has_relation_bully = root
					has_relation_victim = root
					has_relation_rival = root
				}
			}
			alternative_limit = {
				NOR = {
					has_relation_bully = root
					has_relation_victim = root
					has_relation_rival = root
				}
			}
			alternative_limit = {
				always = yes
			}
			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
					has_trait = rowdy
				}
			}
			save_scope_as = other_child
		}
		set_signature_weapon_effect = yes
		scope:other_child = {
			set_signature_weapon_effect = yes
		}
	}

	option = { # honest
		name = child_personality.7100.a
		trigger = {
			NOR = {
				has_trait = honest
				has_trait = deceitful
			}
		}
		add_trait = honest
		
		if = {
			limit = {
				is_ai = yes
			}
			add_character_flag = honest
			random_relation = {
				type = guardian
				trigger_event = child_personality.7101
			}
		}
		ai_chance = {
			base = 1
			
			child_personality_option_weight_modifier = { TRAIT = honest }
		}
	}

	option = { # arbitrary
		name = child_personality.7100.b
		trigger = {
			NOR = {
				has_trait = just
				has_trait = arbitrary
			}
		}
		add_trait = arbitrary
		
		scope:other_child = {
			random = {
				chance = 15
				increase_wounds_effect = { REASON = wounds }
			}
			random = {
				chance = 35
				progress_towards_rival_effect = {
					REASON = rival_ignored_suffering
					CHARACTER = scope:child
					OPINION = 0
				}
			}
		}
		
		if = {
			limit = {
				is_ai = yes
			}
			add_character_flag = arbitrary
			random_relation = {
				type = guardian
				trigger_event = child_personality.7101
			}
		}
		ai_chance = {
			base = 1
			
			child_personality_option_weight_modifier = { TRAIT = arbitrary }
		}
	}

	option = { # impatient
		name = child_personality.7100.c
		trigger = {
			NOR = {
				has_trait = impatient
				has_trait = patient
			}
		}
		add_trait = impatient
		
		progress_towards_friend_effect = {
			CHARACTER = scope:child
			OPINION = 0
			REASON = friend_tried_to_save_my_life
		}
		
		if = {
			limit = {
				is_ai = yes
			}
			add_character_flag = impatient
			random_relation = {
				type = guardian
				trigger_event = child_personality.7101
			}
		}
		ai_chance = {
			base = 1
			
			child_personality_option_weight_modifier = { TRAIT = impatient }
		}
	}
}

#Guardian response to honest, arbitrary, impatient
child_personality.7101 = {
	type = character_event
	title = child_personality.7101.t
	desc = {
		desc = child_personality.7101.desc
		first_valid = {
			triggered_desc = {
			    trigger = {
					scope:child = {
						has_character_flag = honest
					}
			    }
			    desc = {
			    	desc = child_personality.honest.desc
			    }
			}
			triggered_desc = {
			    trigger = {
					scope:child = {
						has_character_flag = arbitrary
					}
			    }
			    desc = {
			    	desc = child_personality.arbitrary.desc
			    }
			}
			triggered_desc = {
			    trigger = {
					scope:child = {
						has_character_flag = impatient
					}
			    }
			    desc = {
			    	desc = child_personality.impatient.desc
			    }
			}
		}
	}
	theme = education
	override_background = { reference = armory }
	left_portrait = {
		character = scope:child
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = honest
				}
			}
  			animation = worry
  		}
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = arbitrary
				}
			}
  			animation = disapproval
  		}
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = impatient
				}
			}
  			animation = paranoia
  		}
	}
	right_portrait = {
		character = scope:other_child
		animation = severelywounded
	}
	
	immediate = {
	}

	option = {
		trigger = {
			scope:child = {
				has_character_flag = honest
			}
		}
		name = child_personality.7101.honest
		custom_tooltip = child_personality.keeps_honest_tt
	}

	option = {
		trigger = {
			scope:child = {
				has_character_flag = arbitrary
			}
		}
		scope:other_child = {
			progress_towards_rival_effect = {
				REASON = rival_guardian_armory
				CHARACTER = root
				OPINION = 0
			}
		}
		name = child_personality.7101.arbitrary
		custom_tooltip = child_personality.keeps_arbitrary_tt
	}

	option = {
		trigger = {
			scope:child = {
				has_character_flag = impatient
			}
		}
		name = child_personality.7101.impatient
		custom_tooltip = child_personality.keeps_impatient_tt
	}

	option = {
		name = child_personality.7101.change.honest
		trigger = {
			scope:child = {
				NOR = {
					has_trait = honest
					has_trait = deceitful
				}
			}
		}
		ai_chance = {
			base = 0
		}
		stress_impact = {
			base = child_trait_change_stress_penalty
		}
		scope:child = {
			if = {
				limit = {
					has_character_flag = arbitrary
				}
				remove_trait = arbitrary
			}
			if = {
				limit = {
					has_character_flag = impatient
				}
				remove_trait = impatient
			}
			add_trait_force_tooltip = honest
		}
	}

	option = {
		name = child_personality.7101.change.arbitrary
		trigger = {
			scope:child = {
				NOR = {
					has_trait = arbitrary
					has_trait = just
				}
			}
		}
		ai_chance = {
			base = 0
		}
		stress_impact = {
			base = child_trait_change_stress_penalty
		}
		scope:other_child = {
			progress_towards_rival_effect = {
				REASON = rival_guardian_armory
				CHARACTER = root
				OPINION = 0
			}
		}
		scope:child = {
			if = {
				limit = {
					has_character_flag = honest
				}
				remove_trait = honest
			}
			if = {
				limit = {
					has_character_flag = impatient
				}
				remove_trait = impatient
			}
			add_trait_force_tooltip = arbitrary
		}
	}

	option = {
		name = child_personality.7101.change.impatient
		trigger = {
			scope:child = {
				NOR = {
					has_trait = impatient
					has_trait = patient
				}
			}
		}
		ai_chance = {
			base = 0
		}
		stress_impact = {
			base = child_trait_change_stress_penalty
		}
		scope:child = {
			if = {
				limit = {
					has_character_flag = arbitrary
				}
				remove_trait = arbitrary
			}
			if = {
				limit = {
					has_character_flag = honest
				}
				remove_trait = honest
			}
			add_trait_force_tooltip = impatient
		}
	}
	
	after = {
		scope:child = {
			remove_character_flag = honest
			remove_character_flag = arbitrary
			remove_character_flag = impatient
		}
	}
}

#brave, stubborn, wrathful
# A mean child throws another kids toy into a cave
child_personality.7200 = {
	type = character_event
	title = child_personality.7200.t
	desc = child_personality.7200.desc
	theme = education
	override_background = { reference = ep2_hunt_forest_cave }
	left_portrait = {
		character = root
		animation = shock
	}
	right_portrait = {
		character = scope:other_child
		animation = schadenfreude
	}

	trigger = {
		is_available_child_allow_travel = yes
		suitable_same_realm_child = yes
		NAND = {
			OR = {
				has_trait = brave
				has_trait = craven
			}
			OR = {
				has_trait = stubborn
				has_trait = fickle
			}
			OR = {
				has_trait = wrathful
				has_trait = calm
			}
		}
	}

	weight_multiplier = {
		base = 1
		
		child_personality_main_event_weight_modifier = { TRAIT = brave }
		child_personality_main_event_weight_modifier = { TRAIT = stubborn }
		child_personality_main_event_weight_modifier = { TRAIT = wrathful }
	}

	immediate = {
		save_scope_as = child
		location.county = {
			save_scope_as = capital_county_scope
		}
		add_suitable_same_realm_children_to_list = yes
		random_in_list = {
			list = suitable_same_realm_children
			limit = {
				OR = {
					has_trait = sadistic
					has_trait = callous
				}
				NOR = {
					has_trait = brave
					has_relation_friend = root
					has_relation_potential_friend = root
				}
			}
			alternative_limit = {
				NOR = {
					has_trait = brave
					has_relation_friend = root
					has_relation_potential_friend = root
				}
			}
			alternative_limit = {
				NOR = {
					has_relation_bully = root
					has_relation_friend = root
					has_relation_potential_friend = root
				}
			}
			alternative_limit = {
				always = yes
			}
			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
					has_trait = rowdy
				}
			}
			save_scope_as = other_child
		}
		scope:other_child = {
			set_favorite_toy_effect = yes
		}
	}

	option = { # brave
		name = child_personality.7200.a
		trigger = {
			NOR = {
				has_trait = brave
				has_trait = craven
			}
		}
		add_trait = brave
		
		random = {
			chance = 10
			increase_wounds_effect = { REASON = fall }
		}
		
		add_prestige = medium_prestige_gain
		
		if = {
			limit = {
				is_ai = yes
			}
			add_character_flag = brave
			random_relation = {
				type = guardian
				trigger_event = child_personality.7201
			}
		}
		ai_chance = {
			base = 1
			
			child_personality_option_weight_modifier = { TRAIT = brave }
		}
	}

	option = { # stubborn
		name = child_personality.7200.b
		trigger = {
			NOR = {
				has_trait = fickle
				has_trait = stubborn
			}
		}
		add_trait = stubborn
		
		scope:other_child = {
			progress_towards_rival_effect = {
				REASON = rival_guardian_armory_stubborn
				CHARACTER = scope:child
				OPINION = 0
			}
			add_stress = medium_stress_gain
		}
		
		if = {
			limit = {
				is_ai = yes
			}
			add_character_flag = stubborn
			random_relation = {
				type = guardian
				trigger_event = child_personality.7201
			}
		}
		ai_chance = {
			base = 1
			
			child_personality_option_weight_modifier = { TRAIT = stubborn }
		}
	}

	option = { # wrathful
		name = child_personality.7200.c
		trigger = {
			NOR = {
				has_trait = wrathful
				has_trait = calm
			}
		}
		add_trait = wrathful
		
		scope:other_child = {
			random = {
				chance = 10
				increase_wounds_effect = { REASON = fight }
			}
			progress_towards_rival_effect = {
				REASON = rival_cave_wrathful
				CHARACTER = scope:child
				OPINION = 0
			}
		}
		
		if = {
			limit = {
				is_ai = yes
			}
			add_character_flag = wrathful
			random_relation = {
				type = guardian
				trigger_event = child_personality.7201
			}
		}
		ai_chance = {
			base = 1
			
			child_personality_option_weight_modifier = { TRAIT = wrathful }
		}
	}
}

#Guardian response to brave, stubborn, wrathful
child_personality.7201 = {
	type = character_event
	title = child_personality.7201.t
	desc = {
		desc = child_personality.7201.desc
		first_valid = {
			triggered_desc = {
			    trigger = {
					scope:child = {
						has_character_flag = brave
					}
			    }
			    desc = {
			    	desc = child_personality.brave.desc
			    }
			}
			triggered_desc = {
			    trigger = {
					scope:child = {
						has_character_flag = stubborn
					}
			    }
			    desc = {
			    	desc = child_personality.stubborn.desc
			    }
			}
			triggered_desc = {
			    trigger = {
					scope:child = {
						has_character_flag = wrathful
					}
			    }
			    desc = {
			    	desc = child_personality.wrathful.desc
			    }
			}
		}
	}
	theme = education
	override_background = { reference = terrain_scope }
	left_portrait = {
		character = scope:child
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = brave
				}
			}
  			animation = personality_bold
  		}
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = stubborn
				}
			}
  			animation = disapproval
  		}
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = wrathful
				}
			}
  			animation = rage
  		}
	}
	right_portrait = {
		character = scope:other_child
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = brave
				}
			}
  			animation = shock
  		}
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = stubborn
				}
			}
  			animation = fear
  		}
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = wrathful
				}
			}
  			animation = severelywounded
  		}
	}
	
	immediate = {
	}

	option = {
		trigger = {
			scope:child = {
				has_character_flag = brave
			}
		}
		name = child_personality.7201.brave
		custom_tooltip = child_personality.keeps_brave_tt
	}

	option = {
		trigger = {
			scope:child = {
				has_character_flag = stubborn
			}
		}
		scope:other_child = {
			progress_towards_rival_effect = {
				REASON = rival_guardian_cave_stubborn
				CHARACTER = root
				OPINION = 0
			}
		}
		name = child_personality.7201.stubborn
		custom_tooltip = child_personality.keeps_stubborn_tt
	}

	option = {
		trigger = {
			scope:child = {
				has_character_flag = wrathful
			}
		}
		name = child_personality.7201.wrathful
		custom_tooltip = child_personality.keeps_wrathful_tt
	}

	option = {
		name = child_personality.7201.change.brave
		trigger = {
			scope:child = {
				NOR = {
					has_trait = brave
					has_trait = craven
				}
			}
		}
		ai_chance = {
			base = 0
		}
		stress_impact = {
			base = child_trait_change_stress_penalty
		}
		scope:child = {
			if = {
				limit = {
					has_character_flag = stubborn
				}
				remove_trait = stubborn
			}
			if = {
				limit = {
					has_character_flag = wrathful
				}
				remove_trait = wrathful
			}
			add_trait_force_tooltip = brave
		}
	}

	option = {
		name = child_personality.7201.change.stubborn
		trigger = {
			scope:child = {
				NOR = {
					has_trait = stubborn
					has_trait = fickle
				}
			}
		}
		ai_chance = {
			base = 0
		}
		stress_impact = {
			base = child_trait_change_stress_penalty
		}
		scope:other_child = {
			scope:child = { save_scope_as = relationship_reason_involved_character }
			progress_towards_rival_effect = {
				REASON = rival_guardian_cave_change_stubborn
				CHARACTER = root
				OPINION = 0
			}
			clear_saved_scope = relationship_reason_involved_character
		}
		scope:child = {
			if = {
				limit = {
					has_character_flag = brave
				}
				remove_trait = brave
			}
			if = {
				limit = {
					has_character_flag = wrathful
				}
				remove_trait = wrathful
			}
			add_trait_force_tooltip = stubborn
		}
	}

	option = {
		name = child_personality.7201.change.wrathful
		trigger = {
			scope:child = {
				NOR = {
					has_trait = wrathful
					has_trait = calm
				}
			}
		}
		ai_chance = {
			base = 0
		}
		stress_impact = {
			base = child_trait_change_stress_penalty
		}
		scope:child = {
			if = {
				limit = {
					has_character_flag = stubborn
				}
				remove_trait = stubborn
			}
			if = {
				limit = {
					has_character_flag = brave
				}
				remove_trait = brave
			}
			add_trait_force_tooltip = wrathful
		}
	}
	
	after = {
		scope:child = {
			remove_character_flag = brave
			remove_character_flag = stubborn
			remove_character_flag = wrathful
		}
	}
}

#eccentric, compassionate, callous
# You're spending a lot of time with the animals
child_personality.7300 = {
	type = character_event
	title = child_personality.7300.t
	desc = child_personality.7300.desc
	theme = education
	override_background = { reference = wilderness }
	left_portrait = {
		character = root
		animation = jockey_idle
		camera = camera_event_horse_left
	}

	trigger = {
		is_available_child_allow_travel = yes
		NAND = {
			OR = {
				has_trait = eccentric
				has_trait = stubborn
				has_trait = fickle
			}
			OR = {
				has_trait = compassionate
				has_trait = callous
				has_trait = sadistic
			}
		}
	}

	weight_multiplier = {
		base = 1
		
		child_personality_main_event_weight_modifier = { TRAIT = eccentric }
		child_personality_main_event_weight_modifier = { TRAIT = compassionate }
		child_personality_main_event_weight_modifier = { TRAIT = callous }
		
	}

	immediate = {
		save_scope_as = child
		location.county = {
			save_scope_as = capital_county_scope
		}
	}

	option = { # eccentric, I can talk to animals
		name = child_personality.7300.a
		trigger = {
			NOR = {
				has_trait = eccentric
				has_trait = fickle
				has_trait = stubborn
			}
		}
		add_trait = eccentric
		
		if = {
			limit = {
				is_ai = yes
			}
			add_character_flag = eccentric
			random_relation = {
				type = guardian
				trigger_event = child_personality.7301
			}
		}
		ai_chance = {
			base = 1
			
			child_personality_option_weight_modifier = { TRAIT = eccentric }
			
		}
	}

	option = { # compassionate, I just love animals
		name = child_personality.7300.b
		trigger = {
			NOR = {
				has_trait = compassionate
				has_trait = sadistic
				has_trait = callous
			}
		}
		add_trait = compassionate

		if = {
			limit = {
				is_ai = yes
			}
			add_character_flag = compassionate
			random_relation = {
				type = guardian
				trigger_event = child_personality.7301
			}
		}
		ai_chance = {
			base = 1
			
			child_personality_option_weight_modifier = { TRAIT = compassionate }
			
		}
	}

	option = { # callous, they are boring and predictable, much like people
		name = child_personality.7300.c
		trigger = {
			NOR = {
				has_trait = compassionate
				has_trait = callous
				has_trait = sadistic
			}
		}
		add_trait = callous
		
		if = {
			limit = {
				is_ai = yes
			}
			add_character_flag = callous
			random_relation = {
				type = guardian
				trigger_event = child_personality.7301
			}
		}
		ai_chance = {
			base = 1
			
			child_personality_option_weight_modifier = { TRAIT = callous }
			
		}
	}
}

#Guardian response to eccentric, compassionate, callous
child_personality.7301 = {
	type = character_event
	title = child_personality.7301.t
	desc = {
		desc = child_personality.7301.desc
		first_valid = {
			triggered_desc = {
			    trigger = {
					scope:child = {
						has_character_flag = eccentric
					}
			    }
			    desc = child_personality.7301.eccentric.desc
			}
			triggered_desc = {
			    trigger = {
					scope:child = {
						has_character_flag = compassionate
					}
			    }
			    desc = child_personality.7301.compassionate.desc
			}
			triggered_desc = {
			    trigger = {
					scope:child = {
						has_character_flag = callous
					}
			    }
			    desc = child_personality.7301.callous.desc
			}
		}
		random_valid = {
			triggered_desc = {
				trigger = {
					scope:child = {
						has_character_flag = eccentric
						faith = { NOT = { has_doctrine_parameter = no_head_of_faith } }
					}
				}
				desc = child_personality.7301.eccentric.obligatory_glitterhoof_reference
			}
			triggered_desc = {
				trigger = {
					scope:child = {
						has_character_flag = eccentric
					}
				}
				desc = child_personality.7301.eccentric.fallback
			}
		}
	}
	theme = education
	override_background = { reference = terrain_scope }
	left_portrait = {
		character = scope:child
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = eccentric
				}
			}
  			animation = manic
  		}
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = compassionate
				}
			}
  			animation = personality_compassionate
  		}
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = callous
				}
			}
  			animation = personality_dishonorable
  		}
	}
	right_portrait = {
		character = root
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = eccentric
				}
			}
  			animation = shock
  		}
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = compassionate
				}
			}
  			animation = fear
  		}
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = callous
				}
			}
  			animation = rage
  		}
	}
	
	immediate = {
	}

	option = {
		trigger = {
			scope:child = {
				has_character_flag = eccentric
			}
		}
		name = child_personality.7301.eccentric
		custom_tooltip = child_personality.keeps_eccentric_tt
	}

	option = {
		trigger = {
			scope:child = {
				has_character_flag = compassionate
			}
		}
		name = child_personality.7301.compassionate
		custom_tooltip = child_personality.keeps_compassionate_tt
	}

	option = {
		trigger = {
			scope:child = {
				has_character_flag = callous
			}
		}
		name = child_personality.7301.callous
		custom_tooltip = child_personality.keeps_callous_tt
	}

	option = {
		name = child_personality.7301.change.eccentric
		trigger = {
			scope:child = {
				NOR = {
					has_trait = eccentric
					has_trait = fickle
					has_trait = stubborn
				}
			}
		}
		ai_chance = {
			base = 0
		}
		stress_impact = {
			base = child_trait_change_stress_penalty
		}
		scope:child = {
			if = {
				limit = {
					has_character_flag = compassionate
				}
				remove_trait = compassionate
			}
			if = {
				limit = {
					has_character_flag = callous
				}
				remove_trait = callous
			}
			add_trait_force_tooltip = eccentric
		}
	}

	option = {
		name = child_personality.7301.change.compassionate
		trigger = {
			scope:child = {
				NOT = {
					has_trait = compassionate
				}
			}
		}
		ai_chance = {
			base = 0
		}
		stress_impact = {
			base = child_trait_change_stress_penalty
		}
		scope:child = {
			if = {
				limit = {
					has_character_flag = eccentric
				}
				remove_trait = eccentric
			}
			if = {
				limit = {
					has_character_flag = callous
				}
				remove_trait = callous
			}
			add_trait_force_tooltip = compassionate
		}
	}

	option = {
		name = child_personality.7301.change.callous
		trigger = {
			scope:child = {
				NOT = {
					has_trait = callous
				}
			}
		}
		ai_chance = {
			base = 0
		}
		stress_impact = {
			base = child_trait_change_stress_penalty
		}
		scope:child = {
			if = {
				limit = {
					has_character_flag = compassionate
				}
				remove_trait = compassionate
			}
			if = {
				limit = {
					has_character_flag = eccentric
				}
				remove_trait = eccentric
			}
			add_trait_force_tooltip = callous
		}
	}
	
	after = {
		scope:child = {
			remove_character_flag = eccentric
			remove_character_flag = compassionate
			remove_character_flag = callous
		}
	}
}

#eccentric, fickle, stubborn
# You want to play board games, but your friend wants to play *outside* (°ー°〃)
child_personality.7400 = {
	type = character_event
	title = child_personality.7400.t
	desc = { 
		desc = child_personality.7400.desc
		first_valid = {
			triggered_desc = {
				trigger = {
					scope:other_child = {
						child_not_teen_trigger = yes
					}
				}
				desc = child_personality.7400.desc.outro.young
			}
			triggered_desc = {
				trigger = {
					scope:other_child = {
						child_is_teen_trigger = yes
					}
				}
				desc = child_personality.7400.desc.outro.older
			}
		}
	}
	theme = education
	override_background = { reference = bedchamber }
	left_portrait = {
		character = root
		animation = personality_compassionate
	}
	right_portrait = {
		character = scope:other_child
		animation = boredom
	}

	trigger = {
		is_available_child_allow_travel = yes
		suitable_same_realm_child = yes
		NOR = {
			has_trait = eccentric
			has_trait = stubborn
			has_trait = fickle
		}
	}

	weight_multiplier = {
		base = 1
		
		child_personality_main_event_weight_modifier = { TRAIT = eccentric }
		child_personality_main_event_weight_modifier = { TRAIT = fickle }
		child_personality_main_event_weight_modifier = { TRAIT = stubborn }
		
	}

	immediate = {
		save_scope_as = child
		location.county = {
			save_scope_as = capital_county_scope
		}
		add_suitable_same_realm_children_to_list = yes
		random_in_list = {
			list = suitable_same_realm_children
			limit = {
				OR = {
					has_relation_friend = root
					has_relation_potential_friend = root
					is_sibling_of = root
					has_relation_potential_friend = root
					warden ?= root.location.county.holder
				}
			}
			alternative_limit = {
				always = yes
			}
			weight = {
				base = 1
				modifier = {
					add = 10
					is_of_major_interest_to_root_trigger = yes
				}
				modifier = {
					add = 5
					is_of_minor_interest_to_root_trigger = yes
				}
			}
			save_scope_as = other_child
		}
	}

	option = { # eccentric, both I say!
		name = child_personality.7400.a
		add_trait = eccentric
		
		if = {
			limit = {
				is_ai = yes
			}
			add_character_flag = eccentric
			random_relation = {
				type = guardian
				trigger_event = { id = child_personality.7401 days = 1 }
			}
		}
		progress_towards_friend_effect = {
			REASON = friend_boardgames_on_horseback
			CHARACTER = scope:other_child
			OPINION = default_friend_opinion
		}
		create_character_memory = {
			type = board_games_on_horseback
			participants = {
				friend = scope:other_child
			}
		}
		ai_chance = {
			base = 1
			
			child_personality_option_weight_modifier = { TRAIT = eccentric }
			
		}
	}

	option = { # stubborn, we play MY game MY way
		name = child_personality.7400.b
		add_trait = stubborn
		
		if = {
			limit = {
				is_ai = yes
			}
			add_character_flag = stubborn
			random_relation = {
				type = guardian
				trigger_event = child_personality.7401
			}
		}
		ai_chance = {
			base = 1
			
			child_personality_option_weight_modifier = { TRAIT = stubborn }
			
		}
	}

	option = { # fickle, I'm okay with horseback too! I make no commitments to anything ever!
		name = child_personality.7400.c
		add_trait = fickle
		
		if = {
			limit = {
				is_ai = yes
			}
			add_character_flag = fickle
			random_relation = {
				type = guardian
				trigger_event = child_personality.7401
			}
		}
		ai_chance = {
			base = 1
			
			child_personality_option_weight_modifier = { TRAIT = fickle }
			
		}
	}
}

#Guardian response to eccentric, fickle, stubborn
child_personality.7401 = {
	type = character_event
	title = child_personality.7401.t
	desc = {
		desc = child_personality.7401.desc
		first_valid = {
			triggered_desc = {
			    trigger = {
					scope:child = {
						has_character_flag = eccentric
					}
			    }
			    desc = child_personality.7401.eccentric.desc
			}
			triggered_desc = {
			    trigger = {
					scope:child = {
						has_character_flag = fickle
					}
			    }
			    desc = child_personality.7401.fickle.desc
			}
			triggered_desc = {
			    trigger = {
					scope:child = {
						has_character_flag = stubborn
					}
			    }
			    desc = child_personality.7401.stubborn.desc
			}
		}
	}
	theme = education
	override_background = { reference = terrain_scope }
	left_portrait = {
		character = scope:child
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = eccentric
				}
			}
  			animation = manic
  		}
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = fickle
				}
			}
  			animation = happiness
  		}
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = stubborn
				}
			}
  			animation = personality_dishonorable
  		}
	}
	right_portrait = {
		character = root
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = eccentric
				}
			}
  			animation = shock
  		}
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = fickle
				}
			}
  			animation = fear
  		}
		triggered_animation = {
			trigger = {
				scope:child = {
					has_character_flag = stubborn
				}
			}
  			animation = rage
  		}
	}
	
	immediate = {
	}

	option = {
		trigger = {
			scope:child = {
				has_character_flag = eccentric
			}
		}
		name = child_personality.7401.eccentric
		custom_tooltip = child_personality.keeps_eccentric_tt
	}

	option = {
		trigger = {
			scope:child = {
				has_character_flag = fickle
			}
		}
		name = child_personality.7401.fickle
		custom_tooltip = child_personality.keeps_fickle_tt
	}

	option = {
		trigger = {
			scope:child = {
				has_character_flag = stubborn
			}
		}
		name = child_personality.7401.stubborn
		custom_tooltip = child_personality.keeps_stubborn_tt
	}

	option = {
		name = child_personality.7401.change.eccentric
		trigger = {
			scope:child = {
				NOT = {
					has_trait = eccentric
				}
			}
		}
		ai_chance = {
			base = 0
		}
		stress_impact = {
			base = child_trait_change_stress_penalty
		}
		scope:child = {
			if = {
				limit = {
					has_character_flag = fickle
				}
				remove_trait = fickle
			}
			if = {
				limit = {
					has_character_flag = stubborn
				}
				remove_trait = stubborn
			}
			add_trait_force_tooltip = eccentric
		}
	}

	option = {
		name = child_personality.7401.change.fickle
		trigger = {
			scope:child = {
				NOT = {
					has_trait = fickle
				}
			}
		}
		ai_chance = {
			base = 0
		}
		stress_impact = {
			base = child_trait_change_stress_penalty
		}
		scope:child = {
			if = {
				limit = {
					has_character_flag = eccentric
				}
				remove_trait = eccentric
			}
			if = {
				limit = {
					has_character_flag = stubborn
				}
				remove_trait = stubborn
			}
			add_trait_force_tooltip = fickle
		}
	}

	option = {
		name = child_personality.7401.change.stubborn
		trigger = {
			scope:child = {
				NOT = {
					has_trait = stubborn
				}
			}
		}
		ai_chance = {
			base = 0
		}
		stress_impact = {
			base = child_trait_change_stress_penalty
		}
		scope:child = {
			if = {
				limit = {
					has_character_flag = fickle
				}
				remove_trait = fickle
			}
			if = {
				limit = {
					has_character_flag = eccentric
				}
				remove_trait = eccentric
			}
			add_trait_force_tooltip = stubborn
		}
	}
	
	after = {
		scope:child = {
			remove_character_flag = eccentric
			remove_character_flag = fickle
			remove_character_flag = stubborn
		}
	}
}
