#Events for learning Commander Traits from a character
# by Petter Vilberg

namespace = learn_commander_trait


#AI event for granting characters random commander traits
learn_commander_trait.0001 = {
	hidden = yes

	trigger = {
		NOT = { has_character_flag = being_taught_commander_trait }
		number_of_commander_traits < 3
		is_available_adult = yes
	}

	weight_multiplier = {
		base = 1
		compare_modifier = {
			factor = martial
			multiplier = 0.1
			max = 2
		}
		modifier = {
			add = 1
			culture = { has_cultural_parameter = commanders_likelier_to_gain_commander_traits }
		}
		modifier = {
			factor = 0.25
			number_of_commander_traits > 0
		}
		modifier = {
			factor = 0.25
			number_of_commander_traits > 1
		}
	}

	immediate = {
		give_random_commander_trait_effect = yes
	}
}


#Choose whether to become aggressive_attacker, unyielding_defender or flexible_leader
learn_commander_trait.0002 = {
	type = character_event
	title = learn_commander_trait.0002.t
	desc = learn_commander_trait.0002.desc
	theme = war
	left_portrait = {
		character = root
		animation = inspect_weapon
	}

	trigger = {
		NOT = { has_character_flag = being_taught_commander_trait }
		number_of_commander_traits < 3
	}

	weight_multiplier = {
		base = 1
		compare_modifier = {
			factor = martial
			multiplier = 0.1
			max = 2
		}
		modifier = {
			add = 1
			culture = { has_cultural_parameter = commanders_likelier_to_gain_commander_traits }
		}
		modifier = {
			factor = 0.3
			number_of_commander_traits > 0
		}
		modifier = {
			factor = 0.3
			number_of_commander_traits > 1
		}
	}

	option = {
		name = learn_commander_trait.0002.a
		trigger = { NOT = { has_trait = aggressive_attacker } }
		add_trait = aggressive_attacker
		stress_impact = {
			calm = minor_stress_impact_gain
			lazy = minor_stress_impact_gain
			forgiving = minor_stress_impact_gain
			patient = minor_stress_impact_gain
			craven = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_zeal = 0.25
				ai_energy = 0.5
				ai_boldness = 1
				ai_vengefulness = 0.2
				ai_compassion = -0.5
			}
		}
	}

	option = {
		name = learn_commander_trait.0002.b
		trigger = { NOT = { has_trait = unyielding_defender } }
		add_trait = unyielding_defender
		stress_impact = {
			arrogant = minor_stress_impact_gain
			fickle = minor_stress_impact_gain
			ambitious = minor_stress_impact_gain
			impatient = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_zeal = -0.25
				ai_boldness = -0.2
				ai_rationality = 0.2
				ai_honor = 0.2
			}
		}
	}

	option = {
		name = learn_commander_trait.0002.c
		trigger = { NOT = { has_trait = flexible_leader } }
		add_trait = flexible_leader
		stress_impact = {
			stubborn = medium_stress_impact_gain
			content = minor_stress_impact_gain
			impatient = minor_stress_impact_gain
			wrathful = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 1
				ai_boldness = 0.5
				ai_vengefulness = -0.5
			}
		}
	}
}

#Choose whether to become a Logistician, a Military Engineer, or forder
learn_commander_trait.0003 = {
	type = character_event
	title = learn_commander_trait.0003.t
	desc = learn_commander_trait.0003.desc
	theme = war
	left_portrait = {
		character = root
		animation = inspect_weapon
	}

	trigger = {
		NOT = { has_character_flag = being_taught_commander_trait }
		number_of_commander_traits < 3
	}

	weight_multiplier = {
		base = 1
		compare_modifier = {
			factor = martial
			multiplier = 0.1
			max = 2
		}
		modifier = {
			add = 1
			culture = { has_cultural_parameter = commanders_likelier_to_gain_commander_traits }
		}
		modifier = {
			factor = 0.3
			number_of_commander_traits > 0
		}
		modifier = {
			factor = 0.3
			number_of_commander_traits > 1
		}
	}

	option = {
		name = learn_commander_trait.0003.a
		trigger = { NOT = { has_trait = logistician } }
		add_trait = logistician
		stress_impact = {
			impatient = minor_stress_impact_gain
			greedy = minor_stress_impact_gain
			arrogant = minor_stress_impact_gain
			stubborn = minor_stress_impact_gain
			lazy = minor_stress_impact_gain
			eccentric = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 1
				ai_energy = 0.25
				ai_greed = -0.5
			}
		}
	}

	option = {
		name = learn_commander_trait.0003.b
		trigger = { NOT = { has_trait = military_engineer } }
		add_trait = military_engineer
		stress_impact = {
			impatient = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_energy = -0.25
				ai_greed = 0.5
				ai_boldness = -0.25
			}
		}
	}

	option = {
		name = learn_commander_trait.0003.c
		trigger = { NOT = { has_trait = forder } }
		add_trait = forder
		stress_impact = {
			eccentric = minor_stress_impact_loss
			patient = minor_stress_impact_gain
			content = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_boldness = 0.5
				ai_energy = 0.5
				ai_rationality = -0.25
			}
		}
	}
}

#Choose whether to become Reckless or a Reaver
learn_commander_trait.0004 = {
	type = character_event
	title = learn_commander_trait.0004.t
	desc = learn_commander_trait.0004.desc
	theme = war
	left_portrait = {
		character = root
		animation = inspect_weapon
	}

	trigger = {
		NOT = { has_character_flag = being_taught_commander_trait }
		number_of_commander_traits < 3
		OR = {
			NOT = { has_trait = reckless }
			NOT = { has_trait = reaver }
		}
	}

	weight_multiplier = {
		base = 1
		compare_modifier = {
			factor = martial
			multiplier = 0.1
			max = 2
		}
		modifier = {
			add = 1
			culture = { has_cultural_parameter = commanders_likelier_to_gain_commander_traits }
		}
		modifier = {
			factor = 0.3
			number_of_commander_traits > 0
		}
		modifier = {
			factor = 0.3
			number_of_commander_traits > 1
		}
	}

	option = { #Reckless
		name = learn_commander_trait.0004.b
		trigger = { NOT = { has_trait = reckless } }
		add_trait = reckless
		stress_impact = {
			eccentric = minor_stress_impact_loss
			calm = minor_stress_impact_gain
			paranoid = medium_stress_impact_gain
			diligent = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = -0.5
				ai_zeal = 0.5
				ai_boldness = 1
				ai_vengefulness = 0.5
			}
		}
	}

	option = { #Reaver
		name = learn_commander_trait.0004.c
		trigger = { NOT = { has_trait = reaver } }
		add_trait = reaver
		stress_impact = {
			generous = medium_stress_impact_gain
			forgiving = minor_stress_impact_gain
			eccentric = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = -1
				ai_honor = -0.25
				ai_boldness = 0.5
				ai_energy = 0.5
			}
		}
	}
}


#Become a Holy Warrior
learn_commander_trait.0006 = {
	type = character_event
	title = learn_commander_trait.0006.t
	desc = learn_commander_trait.0006.desc
	theme = war
	left_portrait = {
		character = root
		animation = inspect_weapon
	}

	trigger = {
		NOT = { has_character_flag = being_taught_commander_trait }
		NOT = { has_trait = holy_warrior }
		number_of_commander_traits < 3
		NOT = { has_trait = cynical }
		piety > 0
	}

	weight_multiplier = {
		base = 1
		modifier = {
			factor = 5
			has_trait = zealous
		}
		modifier = {
			add = 1
			culture = { has_cultural_parameter = commanders_likelier_to_gain_commander_traits }
		}
		modifier = {
			factor = 0.3
			number_of_commander_traits > 0
		}
		modifier = {
			factor = 0.3
			number_of_commander_traits > 1
		}
	}

	option = {
		name = learn_commander_trait.0006.a
		add_trait = holy_warrior
	}
}

#Become a Desert Warrior
learn_commander_trait.0007 = {
	type = character_event
	title = learn_commander_trait.0007.t
	desc = learn_commander_trait.0007.desc
	theme = war
	left_portrait = {
		character = root
		animation = inspect_weapon
	}

	trigger = {
		NOT = { has_character_flag = being_taught_commander_trait }
		NOT = { has_trait = desert_warrior }
		number_of_commander_traits < 3
		any_directly_owned_province = {
			terrain = desert
		}
	}

	weight_multiplier = {
		base = 1
		modifier = {
			add = 1
			capital_province = {
				terrain = desert
			}
		}
		modifier = {
			add = 1
			culture = { has_cultural_parameter = commanders_likelier_to_gain_commander_traits }
		}
		modifier = {
			factor = 1.5
			any_directly_owned_province = {
				count > 3
				terrain = desert
			}
		}
		modifier = {
			factor = 0.3
			number_of_commander_traits > 0
		}
		modifier = {
			factor = 0.3
			number_of_commander_traits > 1
		}
	}

	option = {
		name = learn_commander_trait.0007.a
		add_trait = desert_warrior
	}
}

#Become a Jungle Stalker
learn_commander_trait.0008 = {
	type = character_event
	title = learn_commander_trait.0008.t
	desc = learn_commander_trait.0008.desc
	theme = war
	left_portrait = {
		character = root
		animation = inspect_weapon
	}

	trigger = {
		NOT = { has_character_flag = being_taught_commander_trait }
		NOT = { has_trait = jungle_stalker }
		number_of_commander_traits < 3
		any_directly_owned_province = {
			terrain = jungle
		}
	}

	weight_multiplier = {
		base = 1
		modifier = {
			add = 1
			capital_province = {
				terrain = jungle
			}
		}
		modifier = {
			add = 1
			culture = { has_cultural_parameter = commanders_likelier_to_gain_commander_traits }
		}
		modifier = {
			factor = 1.5
			any_directly_owned_province = {
				count > 3
				terrain = jungle
			}
		}
		modifier = {
			factor = 0.3
			number_of_commander_traits > 0
		}
		modifier = {
			factor = 0.3
			number_of_commander_traits > 1
		}
	}

	option = {
		name = learn_commander_trait.0008.a
		add_trait = jungle_stalker
	}
}

#Become a Winter Soldier
learn_commander_trait.0009 = {
	type = character_event
	title = learn_commander_trait.0009.t
	desc = learn_commander_trait.0009.desc
	theme = war
	left_portrait = {
		character = root
		animation = inspect_weapon
	}

	trigger = {
		NOT = { has_character_flag = being_taught_commander_trait }
		NOT = { has_trait = winter_soldier }
		number_of_commander_traits < 3
		any_directly_owned_province = {
			OR = {
				terrain = taiga
				geographical_region = world_tibet
				geographical_region = world_europe_north
				geographical_region = world_europe_east
				geographical_region = world_steppe
			}
		}
	}

	weight_multiplier = {
		base = 1
		modifier = {
			add = 1
			capital_province = {
				terrain = taiga
			}
		}
		modifier = {
			add = 1
			culture = { has_cultural_parameter = commanders_likelier_to_gain_commander_traits }
		}
		modifier = {
			factor = 1.5
			any_directly_owned_province = {
				count > 3
				terrain = taiga
			}
		}
		modifier = {
			factor = 0.3
			number_of_commander_traits > 0
		}
		modifier = {
			factor = 0.3
			number_of_commander_traits > 1
		}
	}

	option = {
		name = learn_commander_trait.0009.a
		add_trait = winter_soldier
	}
}


##################
# Commander Trait Teaching/Learning Chain
# 1000-1999
# by Petter Vilberg
##################
#NOTE: All last two digits (xx03, xx21, etc.) should refer to the same trait.

learn_commander_trait.1000 = {
	type = character_event
	hidden = yes

	trigger = {
		NOT = { has_character_flag = being_taught_commander_trait }
		number_of_commander_traits < commander_trait_limit
		#Check for a suitable teacher
		OR = {
			any_vassal = {
				is_available_adult = yes
				opinion = {
					target = root
					value > 10
				}
				#has_trait = education_martial
				root = {
					character_has_commander_trait_scope_does_not = prev
				}
			}
			any_courtier = {
				is_available_adult = yes
				opinion = {
					target = root
					value > 10
				}
				#has_trait = education_martial
				root = {
					character_has_commander_trait_scope_does_not = prev
				}
			}
		}
	}

	weight_multiplier = {
		base = 1
		modifier = {
			add = 1
			culture = { has_cultural_parameter = commanders_likelier_to_gain_commander_traits }
		}
		modifier = {
			factor = 0.5
			number_of_commander_traits > 0
		}
		modifier = {
			factor = 0.5
			number_of_commander_traits > 1
		}
	}

	immediate = {
		#Find an AI Vassal or Commander who has a CT you don't
		random_vassal = {
			limit = {
				is_available_adult = yes
				opinion = {
					target = root
					value > 10
				}
				root = {
					character_has_commander_trait_scope_does_not = prev
				}
			}
			weight = {
				base = 1
				modifier = {
					add = 4
					has_trait = education_martial
				}
			}
			save_scope_as = teacher
		}
		if = {
			limit = {
				NOT = { exists = scope:teacher }
			}
			random_courtier = {
				limit = {
					is_available_adult = yes
					opinion = {
						target = root
						value > 10
					}
					#has_trait = education_martial
					root = {
						character_has_commander_trait_scope_does_not = prev
					}
				}
				save_scope_as = teacher
			}
		}
		if = {
			limit = { root = { is_ai = no }	}
			scope:teacher = { #Make sure they have a quirk to refer to.
				assign_quirk_effect = yes
			}
		}
		add_character_flag = {
			flag = being_taught_commander_trait
			days = 1825
		}
		randomize_commander_trait_to_be_taught_effect = yes
		if = {
			limit = {
				has_variable = commander_trait_being_taught
			}
			trigger_event = {
				on_action = learn_commander_trait_offer
			}
		}
	}
}


##############
#TRAIT CHAINS
##############


#Logistician
##############

#Training offer
learn_commander_trait.1101 = {
	type = character_event
	title = learn_commander_trait.01.t
	desc = {
		desc = learn_commander_trait.11.opening
		desc = learn_commander_trait.1101.desc
	}
	theme = war
	left_portrait = {
		character = root
		animation = inspect_weapon
	}
	right_portrait = {
		character = scope:teacher
		animation = happy_teacher
	}
	trigger = {
		has_variable = commander_trait_being_taught
		var:commander_trait_being_taught = flag:logistician
		is_imprisoned = no
	}

	weight_multiplier = {
		base = 1
	}

	option = { #Please teach me
		name = learn_commander_trait.11.a
		commander_trait_teaching_setup_effect = yes
		custom_tooltip = learn_commander_trait.11.martial_tt
	}

	option = { #No, I already know enough
		name = learn_commander_trait.11.b
		remove_variable = commander_trait_being_taught
		remove_character_flag = being_taught_commander_trait
		custom_tooltip = learn_commander_trait.11.b.tt
	}
}

#Final Test
learn_commander_trait.1201 = {
	type = character_event
	title = learn_commander_trait.01.t
	desc = learn_commander_trait.1201.desc
	theme = war
		left_portrait = {
		character = root
		animation = stress
	}
	right_portrait = {
		character = scope:teacher
		animation = happy_teacher
	}

	trigger = {
		has_variable = commander_trait_being_taught
		var:commander_trait_being_taught = flag:logistician
	}

	option = {
		name = learn_commander_trait.12.a
		learn_commander_trait_final_test_duel_effect = yes
	}

	option = { #Back out
		name = learn_commander_trait.12.b
		stress_impact = {
			base = minor_stress_gain
		}
		giving_up_on_commander_trait_training_effect = yes
	}
}

#Success
learn_commander_trait.1301 = {
	type = character_event
	title = learn_commander_trait.01.t
	desc = learn_commander_trait.1301.desc
	theme = war
		left_portrait = {
		character = root
		animation = celebrate_wooden_sword
	}
	right_portrait = {
		character = scope:teacher
		animation = happy_teacher
	}

	trigger = {
		var:commander_trait_being_taught = flag:logistician
	}

	option = {
		name = learn_commander_trait.13.a
		learn_commander_trait_success_effect = yes
	}

	after = {
		if = {
			limit = {
				exists = var:commander_trait_being_taught
			}
			remove_variable = commander_trait_being_taught
		}
		if = {
			limit = {
				has_character_flag = being_taught_commander_trait
			}
			remove_character_flag = being_taught_commander_trait
		}
	}
}

#Failure
learn_commander_trait.1401 = {
	type = character_event
	title = learn_commander_trait.01.t
	desc = learn_commander_trait.1401.desc
	theme = war
		left_portrait = {
		character = root
		animation = shame
	}
	right_portrait = {
		character = scope:teacher
		animation = stressed_teacher
	}

	trigger = {
		var:commander_trait_being_taught = flag:logistician
	}

	immediate = {

	}

	option = { #I will try again!
		name = learn_commander_trait.14.a
		custom_tooltip = learn_commander_trait.14.a.tt
		trigger_event = {
			on_action = learn_commander_trait_test
			days = { 50 600 }
		}
	}

	option = { #I give up
		name = learn_commander_trait.14.b
		custom_tooltip = learn_commander_trait.14.b.tt
		giving_up_on_commander_trait_training_effect = yes
	}
}







#Military Engineer
##################

#Training offer
learn_commander_trait.1102 = {
	type = character_event
	title = learn_commander_trait.02.t
	desc = {
		desc = learn_commander_trait.11.opening
		desc = learn_commander_trait.1102.desc
	}
	theme = war
		left_portrait = {
		character = root
		animation = inspect_weapon
	}
	right_portrait = {
		character = scope:teacher
		animation = happy_teacher
	}

	trigger = {
		has_variable = commander_trait_being_taught
		var:commander_trait_being_taught = flag:military_engineer
	}

	weight_multiplier = {
		base = 1
	}

	option = { #Please teach me
		name = learn_commander_trait.11.a
		commander_trait_teaching_setup_effect = yes
		custom_tooltip = learn_commander_trait.11.martial_tt
	}

	option = { #No, I already know enough
		name = learn_commander_trait.11.b
		remove_variable = commander_trait_being_taught
		remove_character_flag = being_taught_commander_trait
		custom_tooltip = learn_commander_trait.11.b.tt
	}
}

#Final test
learn_commander_trait.1202 = {
	type = character_event
	title = learn_commander_trait.02.t
	desc = learn_commander_trait.1202.desc
	theme = war
		left_portrait = {
		character = root
		animation = stress
	}
	right_portrait = {
		character = scope:teacher
		animation = happy_teacher
	}

	trigger = {
		has_variable = commander_trait_being_taught
		var:commander_trait_being_taught = flag:military_engineer
	}

	option = {
		name = learn_commander_trait.12.a
		learn_commander_trait_final_test_duel_effect = yes
	}

	option = { #Back out
		name = learn_commander_trait.12.b
		stress_impact = {
			base = minor_stress_gain
		}
		giving_up_on_commander_trait_training_effect = yes
	}
}


#Success
learn_commander_trait.1302 = {
	type = character_event
	title = learn_commander_trait.02.t
	desc = learn_commander_trait.1302.desc
	theme = war
		left_portrait = {
		character = root
		animation = celebrate_wooden_sword
	}
	right_portrait = {
		character = scope:teacher
		animation = happy_teacher
	}

	trigger = {
		var:commander_trait_being_taught = flag:military_engineer
	}

	option = {
		name = learn_commander_trait.13.a
		learn_commander_trait_success_effect = yes
	}

	after = {
		if = {
			limit = {
				exists = var:commander_trait_being_taught
			}
			remove_variable = commander_trait_being_taught
		}
		if = {
			limit = {
				has_character_flag = being_taught_commander_trait
			}
			remove_character_flag = being_taught_commander_trait
		}
	}
}


#Failure
learn_commander_trait.1402 = {
	type = character_event
	title = learn_commander_trait.02.t
	desc = learn_commander_trait.1402.desc
	theme = war
		left_portrait = {
		character = root
		animation = shame
	}
	right_portrait = {
		character = scope:teacher
		animation = stressed_teacher
	}

	trigger = {
		var:commander_trait_being_taught = flag:military_engineer
	}

	immediate = {

	}

	option = {
		name = learn_commander_trait.14.a
		custom_tooltip = learn_commander_trait.14.a.tt
		trigger_event = {
			on_action = learn_commander_trait_test
			days = { 50 600 }
		}
	}

	option = {
		name = learn_commander_trait.14.b
		custom_tooltip = learn_commander_trait.14.b.tt
		giving_up_on_commander_trait_training_effect = yes
	}
}







#aggressive_attacker
##################

#Training offer
learn_commander_trait.1103 = {
	type = character_event
	title = learn_commander_trait.03.t
	desc = {
		desc = learn_commander_trait.11.opening
		desc = learn_commander_trait.11.desc
	}
	theme = war
		left_portrait = {
		character = root
		animation = inspect_weapon
	}
	right_portrait = {
		character = scope:teacher
		animation = happy_teacher
	}

	trigger = {
		has_variable = commander_trait_being_taught
		var:commander_trait_being_taught = flag:aggressive_attacker
	}

	weight_multiplier = {
		base = 1
	}

	option = { #Please teach me
		name = learn_commander_trait.11.a
		commander_trait_teaching_setup_effect = yes
		custom_tooltip = learn_commander_trait.11.martial_tt
	}

	option = { #No, I already know enough
		name = learn_commander_trait.11.b
		remove_variable = commander_trait_being_taught
		remove_character_flag = being_taught_commander_trait
		custom_tooltip = learn_commander_trait.11.b.tt
	}
}

#Final test
learn_commander_trait.1203 = {
	type = character_event
	title = learn_commander_trait.03.t
	desc = learn_commander_trait.12.desc
	theme = war
		left_portrait = {
		character = root
		animation = stress
	}
	right_portrait = {
		character = scope:teacher
		animation = happy_teacher
	}

	trigger = {
		has_variable = commander_trait_being_taught
		var:commander_trait_being_taught = flag:aggressive_attacker
	}

	option = {
		name = learn_commander_trait.12.a
		learn_commander_trait_final_test_duel_effect = yes
	}

	option = { #Back out
		name = learn_commander_trait.12.b
		stress_impact = {
			base = minor_stress_gain
		}
		giving_up_on_commander_trait_training_effect = yes
	}
}


#Success
learn_commander_trait.1303 = {
	type = character_event
	title = learn_commander_trait.03.t
	desc = learn_commander_trait.13.desc
	theme = war
		left_portrait = {
		character = root
		animation = celebrate_wooden_sword
	}
	right_portrait = {
		character = scope:teacher
		animation = happy_teacher
	}

	trigger = {
		var:commander_trait_being_taught = flag:aggressive_attacker
	}

	option = {
		name = learn_commander_trait.13.a
		learn_commander_trait_success_effect = yes
	}

	after = {
		if = {
			limit = {
				exists = var:commander_trait_being_taught
			}
			remove_variable = commander_trait_being_taught
		}
		if = {
			limit = {
				has_character_flag = being_taught_commander_trait
			}
			remove_character_flag = being_taught_commander_trait
		}
	}
}


#Failure
learn_commander_trait.1403 = {
	type = character_event
	title = learn_commander_trait.03.t
	desc = learn_commander_trait.14.desc
	theme = war
		left_portrait = {
		character = root
		animation = shame
	}
	right_portrait = {
		character = scope:teacher
		animation = stressed_teacher
	}

	trigger = {
		var:commander_trait_being_taught = flag:aggressive_attacker
	}

	immediate = {

	}

	option = {
		name = learn_commander_trait.14.a
		custom_tooltip = learn_commander_trait.14.a.tt
		trigger_event = {
			on_action = learn_commander_trait_test
			days = { 50 600 }
		}
	}

	option = {
		name = learn_commander_trait.14.b
		custom_tooltip = learn_commander_trait.14.b.tt
		giving_up_on_commander_trait_training_effect = yes
	}
}





#unyielding_defender
##################

#Training offer
learn_commander_trait.1104 = {
	type = character_event
	title = learn_commander_trait.04.t
	desc = {
		desc = learn_commander_trait.11.opening
		desc = learn_commander_trait.11.desc
	}
	theme = war
		left_portrait = {
		character = root
		animation = inspect_weapon
	}
	right_portrait = {
		character = scope:teacher
		animation = happy_teacher
	}

	trigger = {
		has_variable = commander_trait_being_taught
		var:commander_trait_being_taught = flag:unyielding_defender
	}

	weight_multiplier = {
		base = 1
	}

	option = { #Please teach me
		name = learn_commander_trait.11.a
		commander_trait_teaching_setup_effect = yes
		custom_tooltip = learn_commander_trait.11.martial_tt
	}

	option = { #No, I already know enough
		name = learn_commander_trait.11.b
		remove_variable = commander_trait_being_taught
		remove_character_flag = being_taught_commander_trait
		custom_tooltip = learn_commander_trait.11.b.tt
	}
}

#Final test
learn_commander_trait.1204 = {
	type = character_event
	title = learn_commander_trait.04.t
	desc = learn_commander_trait.12.desc
	theme = war
		left_portrait = {
		character = root
		animation = stress
	}
	right_portrait = {
		character = scope:teacher
		animation = happy_teacher
	}

	trigger = {
		has_variable = commander_trait_being_taught
		var:commander_trait_being_taught = flag:unyielding_defender
	}

	option = {
		name = learn_commander_trait.12.a
		learn_commander_trait_final_test_duel_effect = yes
	}

	option = { #Back out
		name = learn_commander_trait.12.b
		stress_impact = {
			base = minor_stress_gain
		}
		giving_up_on_commander_trait_training_effect = yes
	}
}


#Success
learn_commander_trait.1304 = {
	type = character_event
	title = learn_commander_trait.04.t
	desc = learn_commander_trait.13.desc
	theme = war
		left_portrait = {
		character = root
		animation = celebrate_wooden_sword
	}
	right_portrait = {
		character = scope:teacher
		animation = happy_teacher
	}

	trigger = {
		var:commander_trait_being_taught = flag:unyielding_defender
	}

	option = {
		name = learn_commander_trait.13.a
		learn_commander_trait_success_effect = yes
	}

	after = {
		if = {
			limit = {
				exists = var:commander_trait_being_taught
			}
			remove_variable = commander_trait_being_taught
		}
		if = {
			limit = {
				has_character_flag = being_taught_commander_trait
			}
			remove_character_flag = being_taught_commander_trait
		}
	}
}


#Failure
learn_commander_trait.1404 = {
	type = character_event
	title = learn_commander_trait.04.t
	desc = learn_commander_trait.14.desc
	theme = war
		left_portrait = {
		character = root
		animation = shame
	}
	right_portrait = {
		character = scope:teacher
		animation = stressed_teacher
	}

	trigger = {
		var:commander_trait_being_taught = flag:unyielding_defender
	}

	immediate = {

	}

	option = {
		name = learn_commander_trait.14.a
		custom_tooltip = learn_commander_trait.14.a.tt
		trigger_event = {
			on_action = learn_commander_trait_test
			days = { 50 600 }
		}
	}

	option = {
		name = learn_commander_trait.14.b
		custom_tooltip = learn_commander_trait.14.b.tt
		giving_up_on_commander_trait_training_effect = yes
	}
}









#forder
##################

#Training offer
learn_commander_trait.1105 = {
	type = character_event
	title = learn_commander_trait.05.t
	desc = {
		desc = learn_commander_trait.11.opening
		desc = learn_commander_trait.11.desc
	}
	theme = war
		left_portrait = {
		character = root
		animation = inspect_weapon
	}
	right_portrait = {
		character = scope:teacher
		animation = happy_teacher
	}

	trigger = {
		has_variable = commander_trait_being_taught
		var:commander_trait_being_taught = flag:forder
	}

	weight_multiplier = {
		base = 1
	}

	option = { #Please teach me
		name = learn_commander_trait.11.a
		commander_trait_teaching_setup_effect = yes
		custom_tooltip = learn_commander_trait.11.martial_tt
	}

	option = { #No, I already know enough
		name = learn_commander_trait.11.b
		remove_variable = commander_trait_being_taught
		remove_character_flag = being_taught_commander_trait
		custom_tooltip = learn_commander_trait.11.b.tt
	}
}

#Final test
learn_commander_trait.1205 = {
	type = character_event
	title = learn_commander_trait.05.t
	desc = learn_commander_trait.12.desc
	theme = war
		left_portrait = {
		character = root
		animation = stress
	}
	right_portrait = {
		character = scope:teacher
		animation = happy_teacher
	}

	trigger = {
		has_variable = commander_trait_being_taught
		var:commander_trait_being_taught = flag:forder
	}

	option = {
		name = learn_commander_trait.12.a
		learn_commander_trait_final_test_duel_effect = yes
	}

	option = { #Back out
		name = learn_commander_trait.12.b
		stress_impact = {
			base = minor_stress_gain
		}
		giving_up_on_commander_trait_training_effect = yes
	}
}


#Success
learn_commander_trait.1305 = {
	type = character_event
	title = learn_commander_trait.05.t
	desc = learn_commander_trait.13.desc
	theme = war
		left_portrait = {
		character = root
		animation = celebrate_wooden_sword
	}
	right_portrait = {
		character = scope:teacher
		animation = happy_teacher
	}

	trigger = {
		var:commander_trait_being_taught = flag:forder
	}

	option = {
		name = learn_commander_trait.13.a
		learn_commander_trait_success_effect = yes
	}

	after = {
		if = {
			limit = {
				exists = var:commander_trait_being_taught
			}
			remove_variable = commander_trait_being_taught
		}
		if = {
			limit = {
				has_character_flag = being_taught_commander_trait
			}
			remove_character_flag = being_taught_commander_trait
		}
	}
}


#Failure
learn_commander_trait.1405 = {
	type = character_event
	title = learn_commander_trait.05.t
	desc = learn_commander_trait.14.desc
	theme = war
		left_portrait = {
		character = root
		animation = shame
	}
	right_portrait = {
		character = scope:teacher
		animation = stressed_teacher
	}

	trigger = {
		var:commander_trait_being_taught = flag:forder
	}

	immediate = {

	}

	option = {
		name = learn_commander_trait.14.a
		custom_tooltip = learn_commander_trait.14.a.tt
		trigger_event = {
			on_action = learn_commander_trait_test
			days = { 50 600 }
		}
	}

	option = {
		name = learn_commander_trait.14.b
		custom_tooltip = learn_commander_trait.14.b.tt
		giving_up_on_commander_trait_training_effect = yes
	}
}










#flexible_leader
##################

#Training offer
learn_commander_trait.1106 = {
	type = character_event
	title = learn_commander_trait.06.t
	desc = {
		desc = learn_commander_trait.11.opening
		desc = learn_commander_trait.11.desc
	}
	theme = war
		left_portrait = {
		character = root
		animation = inspect_weapon
	}
	right_portrait = {
		character = scope:teacher
		animation = happy_teacher
	}

	trigger = {
		has_variable = commander_trait_being_taught
		var:commander_trait_being_taught = flag:flexible_leader
	}

	weight_multiplier = {
		base = 1
	}

	option = { #Please teach me
		name = learn_commander_trait.11.a
		commander_trait_teaching_setup_effect = yes
		custom_tooltip = learn_commander_trait.11.martial_tt
	}

	option = { #No, I already know enough
		name = learn_commander_trait.11.b
		remove_variable = commander_trait_being_taught
		remove_character_flag = being_taught_commander_trait
		custom_tooltip = learn_commander_trait.11.b.tt
	}
}

#Final test
learn_commander_trait.1206 = {
	type = character_event
	title = learn_commander_trait.06.t
	desc = learn_commander_trait.12.desc
	theme = war
		left_portrait = {
		character = root
		animation = stress
	}
	right_portrait = {
		character = scope:teacher
		animation = happy_teacher
	}

	trigger = {
		has_variable = commander_trait_being_taught
		var:commander_trait_being_taught = flag:flexible_leader
	}

	option = {
		name = learn_commander_trait.12.a
		learn_commander_trait_final_test_duel_effect = yes
	}

	option = { #Back out
		name = learn_commander_trait.12.b
		stress_impact = {
			base = minor_stress_gain
		}
		giving_up_on_commander_trait_training_effect = yes
	}
}


#Success
learn_commander_trait.1306 = {
	type = character_event
	title = learn_commander_trait.06.t
	desc = learn_commander_trait.13.desc
	theme = war
		left_portrait = {
		character = root
		animation = celebrate_wooden_sword
	}
	right_portrait = {
		character = scope:teacher
		animation = happy_teacher
	}

	trigger = {
		var:commander_trait_being_taught = flag:flexible_leader
	}

	option = {
		name = learn_commander_trait.13.a
		learn_commander_trait_success_effect = yes
	}

	after = {
		if = {
			limit = {
				exists = var:commander_trait_being_taught
			}
			remove_variable = commander_trait_being_taught
		}
		if = {
			limit = {
				has_character_flag = being_taught_commander_trait
			}
			remove_character_flag = being_taught_commander_trait
		}
	}
}


#Failure
learn_commander_trait.1406 = {
	type = character_event
	title = learn_commander_trait.06.t
	desc = learn_commander_trait.14.desc
	theme = war
		left_portrait = {
		character = root
		animation = shame
	}
	right_portrait = {
		character = scope:teacher
		animation = stressed_teacher
	}

	trigger = {
		var:commander_trait_being_taught = flag:flexible_leader
	}

	immediate = {

	}

	option = {
		name = learn_commander_trait.14.a
		custom_tooltip = learn_commander_trait.14.a.tt
		trigger_event = {
			on_action = learn_commander_trait_test
			days = { 50 600 }
		}	}

	option = {
		name = learn_commander_trait.14.b
		custom_tooltip = learn_commander_trait.14.b.tt
		giving_up_on_commander_trait_training_effect = yes
	}
}









#desert_warrior
##################

#Training offer
learn_commander_trait.1107 = {
	type = character_event
	title = learn_commander_trait.07.t
	desc = {
		desc = learn_commander_trait.11.opening
		desc = learn_commander_trait.11.desc
	}
	theme = war
		left_portrait = {
		character = root
		animation = inspect_weapon
	}
	right_portrait = {
		character = scope:teacher
		animation = happy_teacher
	}

	trigger = {
		has_variable = commander_trait_being_taught
		var:commander_trait_being_taught = flag:desert_warrior
	}

	weight_multiplier = {
		base = 1
	}

	option = { #Please teach me
		name = learn_commander_trait.11.a
		commander_trait_teaching_setup_effect = yes
		custom_tooltip = learn_commander_trait.11.martial_tt
	}

	option = { #No, I already know enough
		name = learn_commander_trait.11.b
		remove_variable = commander_trait_being_taught
		remove_character_flag = being_taught_commander_trait
		custom_tooltip = learn_commander_trait.11.b.tt
	}
}

#Final test
learn_commander_trait.1207 = {
	type = character_event
	title = learn_commander_trait.07.t
	desc = learn_commander_trait.12.desc
	theme = war
		left_portrait = {
		character = root
		animation = stress
	}
	right_portrait = {
		character = scope:teacher
		animation = happy_teacher
	}

	trigger = {
		has_variable = commander_trait_being_taught
		var:commander_trait_being_taught = flag:desert_warrior
	}

	option = {
		name = learn_commander_trait.12.a
		learn_commander_trait_final_test_duel_effect = yes
	}

	option = { #Back out
		name = learn_commander_trait.12.b
		stress_impact = {
			base = minor_stress_gain
		}
		giving_up_on_commander_trait_training_effect = yes
	}
}


#Success
learn_commander_trait.1307 = {
	type = character_event
	title = learn_commander_trait.07.t
	desc = learn_commander_trait.13.desc
	theme = war
		left_portrait = {
		character = root
		animation = celebrate_wooden_sword
	}
	right_portrait = {
		character = scope:teacher
		animation = happy_teacher
	}

	trigger = {
		var:commander_trait_being_taught = flag:desert_warrior
	}

	option = {
		name = learn_commander_trait.13.a
		learn_commander_trait_success_effect = yes
	}

	after = {
		if = {
			limit = {
				exists = var:commander_trait_being_taught
			}
			remove_variable = commander_trait_being_taught
		}
		if = {
			limit = {
				has_character_flag = being_taught_commander_trait
			}
			remove_character_flag = being_taught_commander_trait
		}
	}
}


#Failure
learn_commander_trait.1407 = {
	type = character_event
	title = learn_commander_trait.07.t
	desc = learn_commander_trait.14.desc
	theme = war
		left_portrait = {
		character = root
		animation = shame
	}
	right_portrait = {
		character = scope:teacher
		animation = stressed_teacher
	}

	trigger = {
		var:commander_trait_being_taught = flag:desert_warrior
	}

	immediate = {

	}

	option = {
		name = learn_commander_trait.14.a
		custom_tooltip = learn_commander_trait.14.a.tt
		trigger_event = {
			on_action = learn_commander_trait_test
			days = { 50 600 }
		}
	}

	option = {
		name = learn_commander_trait.14.b
		custom_tooltip = learn_commander_trait.14.b.tt
		giving_up_on_commander_trait_training_effect = yes
	}
}







#jungle_stalker
##################

#Training offer
learn_commander_trait.1108 = {
	type = character_event
	title = learn_commander_trait.08.t
	desc = {
		desc = learn_commander_trait.11.opening
		desc = learn_commander_trait.11.desc
	}
	theme = war
		left_portrait = {
		character = root
		animation = inspect_weapon
	}
	right_portrait = {
		character = scope:teacher
		animation = happy_teacher
	}

	trigger = {
		has_variable = commander_trait_being_taught
		var:commander_trait_being_taught = flag:jungle_stalker
	}

	weight_multiplier = {
		base = 1
	}

	option = { #Please teach me
		name = learn_commander_trait.11.a
		commander_trait_teaching_setup_effect = yes
		custom_tooltip = learn_commander_trait.11.martial_tt
	}

	option = { #No, I already know enough
		name = learn_commander_trait.11.b
		remove_variable = commander_trait_being_taught
		remove_character_flag = being_taught_commander_trait
		custom_tooltip = learn_commander_trait.11.b.tt
	}
}

#Final test
learn_commander_trait.1208 = {
	type = character_event
	title = learn_commander_trait.08.t
	desc = learn_commander_trait.12.desc
	theme = war
		left_portrait = {
		character = root
		animation = stress
	}
	right_portrait = {
		character = scope:teacher
		animation = happy_teacher
	}

	trigger = {
		has_variable = commander_trait_being_taught
		var:commander_trait_being_taught = flag:jungle_stalker
	}

	option = {
		name = learn_commander_trait.12.a
		learn_commander_trait_final_test_duel_effect = yes
	}

	option = { #Back out
		name = learn_commander_trait.12.b
		stress_impact = {
			base = minor_stress_gain
		}
		giving_up_on_commander_trait_training_effect = yes
	}
}


#Success
learn_commander_trait.1308 = {
	type = character_event
	title = learn_commander_trait.08.t
	desc = learn_commander_trait.13.desc
	theme = war
		left_portrait = {
		character = root
		animation = celebrate_wooden_sword
	}
	right_portrait = {
		character = scope:teacher
		animation = happy_teacher
	}

	trigger = {
		var:commander_trait_being_taught = flag:jungle_stalker
	}

	option = {
		name = learn_commander_trait.13.a
		learn_commander_trait_success_effect = yes
	}

	after = {
		if = {
			limit = {
				exists = var:commander_trait_being_taught
			}
			remove_variable = commander_trait_being_taught
		}
		if = {
			limit = {
				has_character_flag = being_taught_commander_trait
			}
			remove_character_flag = being_taught_commander_trait
		}
	}
}


#Failure
learn_commander_trait.1408 = {
	type = character_event
	title = learn_commander_trait.08.t
	desc = learn_commander_trait.14.desc
	theme = war
		left_portrait = {
		character = root
		animation = shame
	}
	right_portrait = {
		character = scope:teacher
		animation = stressed_teacher
	}

	trigger = {
		var:commander_trait_being_taught = flag:jungle_stalker
	}

	immediate = {

	}

	option = {
		name = learn_commander_trait.14.a
		custom_tooltip = learn_commander_trait.14.a.tt
		trigger_event = {
			on_action = learn_commander_trait_test
			days = { 50 600 }
		}
	}

	option = {
		name = learn_commander_trait.14.b
		custom_tooltip = learn_commander_trait.14.b.tt
		giving_up_on_commander_trait_training_effect = yes
	}
}


#winter_soldier
##################

#Training offer
learn_commander_trait.1109 = {
	type = character_event
	title = learn_commander_trait.09.t
	desc = {
		desc = learn_commander_trait.11.opening
		desc = learn_commander_trait.11.desc
	}
	theme = war
		left_portrait = {
		character = root
		animation = inspect_weapon
	}
	right_portrait = {
		character = scope:teacher
		animation = happy_teacher
	}

	trigger = {
		has_variable = commander_trait_being_taught
		var:commander_trait_being_taught = flag:winter_soldier
	}

	weight_multiplier = {
		base = 1
	}

	option = { #Please teach me
		name = learn_commander_trait.11.a
		commander_trait_teaching_setup_effect = yes
		custom_tooltip = learn_commander_trait.11.martial_tt
	}

	option = { #No, I already know enough
		name = learn_commander_trait.11.b
		remove_variable = commander_trait_being_taught
		remove_character_flag = being_taught_commander_trait
		custom_tooltip = learn_commander_trait.11.b.tt
	}
}

#Final test
learn_commander_trait.1209 = {
	type = character_event
	title = learn_commander_trait.09.t
	desc = learn_commander_trait.12.desc
	theme = war
		left_portrait = {
		character = root
		animation = stress
	}
	right_portrait = {
		character = scope:teacher
		animation = happy_teacher
	}

	trigger = {
		has_variable = commander_trait_being_taught
		var:commander_trait_being_taught = flag:winter_soldier
	}

	option = {
		name = learn_commander_trait.12.a
		learn_commander_trait_final_test_duel_effect = yes
	}

	option = { #Back out
		name = learn_commander_trait.12.b
		stress_impact = {
			base = minor_stress_gain
		}
		giving_up_on_commander_trait_training_effect = yes
	}
}


#Success
learn_commander_trait.1309 = {
	type = character_event
	title = learn_commander_trait.09.t
	desc = learn_commander_trait.13.desc
	theme = war
		left_portrait = {
		character = root
		animation = celebrate_wooden_sword
	}
	right_portrait = {
		character = scope:teacher
		animation = happy_teacher
	}

	trigger = {
		var:commander_trait_being_taught = flag:winter_soldier
	}

	option = {
		name = learn_commander_trait.13.a
		learn_commander_trait_success_effect = yes
	}

	after = {
		if = {
			limit = {
				exists = var:commander_trait_being_taught
			}
			remove_variable = commander_trait_being_taught
		}
		if = {
			limit = {
				has_character_flag = being_taught_commander_trait
			}
			remove_character_flag = being_taught_commander_trait
		}
	}
}


#Failure
learn_commander_trait.1409 = {
	type = character_event
	title = learn_commander_trait.09.t
	desc = learn_commander_trait.14.desc
	theme = war
		left_portrait = {
		character = root
		animation = shame
	}
	right_portrait = {
		character = scope:teacher
		animation = stressed_teacher
	}

	trigger = {
		var:commander_trait_being_taught = flag:winter_soldier
	}

	immediate = {

	}

	option = {
		name = learn_commander_trait.14.a
		custom_tooltip = learn_commander_trait.14.a.tt
		trigger_event = {
			on_action = learn_commander_trait_test
			days = { 50 600 }
		}
	}

	option = {
		name = learn_commander_trait.14.b
		custom_tooltip = learn_commander_trait.14.b.tt
		giving_up_on_commander_trait_training_effect = yes
	}
}

#reaver
##################

#Training offer
learn_commander_trait.1110 = {
	type = character_event
	title = learn_commander_trait.10.t
	desc = {
		desc = learn_commander_trait.11.opening
		desc = learn_commander_trait.11.desc
	}
	theme = war
		left_portrait = {
		character = root
		animation = inspect_weapon
	}
	right_portrait = {
		character = scope:teacher
		animation = happy_teacher
	}

	trigger = {
		has_variable = commander_trait_being_taught
		var:commander_trait_being_taught = flag:reaver
	}

	weight_multiplier = {
		base = 1
	}

	option = { #Please teach me
		name = learn_commander_trait.11.a
		commander_trait_teaching_setup_effect = yes
		custom_tooltip = learn_commander_trait.11.martial_tt
	}

	option = { #No, I already know enough
		name = learn_commander_trait.11.b
		remove_variable = commander_trait_being_taught
		remove_character_flag = being_taught_commander_trait
		custom_tooltip = learn_commander_trait.11.b.tt
	}
}

#Final test
learn_commander_trait.1210 = {
	type = character_event
	title = learn_commander_trait.10.t
	desc = learn_commander_trait.12.desc
	theme = war
		left_portrait = {
		character = root
		animation = stress
	}
	right_portrait = {
		character = scope:teacher
		animation = happy_teacher
	}

	trigger = {
		has_variable = commander_trait_being_taught
		var:commander_trait_being_taught = flag:reaver
	}

	option = {
		name = learn_commander_trait.12.a
		learn_commander_trait_final_test_duel_effect = yes
	}

	option = { #Back out
		name = learn_commander_trait.12.b
		stress_impact = {
			base = minor_stress_gain
		}
		giving_up_on_commander_trait_training_effect = yes
	}
}


#Success
learn_commander_trait.1310 = {
	type = character_event
	title = learn_commander_trait.10.t
	desc = learn_commander_trait.13.desc
	theme = war
		left_portrait = {
		character = root
		animation = celebrate_wooden_sword
	}
	right_portrait = {
		character = scope:teacher
		animation = happy_teacher
	}

	trigger = {
		var:commander_trait_being_taught = flag:reaver
	}

	option = {
		name = learn_commander_trait.13.a
		learn_commander_trait_success_effect = yes
	}

	after = {
		if = {
			limit = {
				exists = var:commander_trait_being_taught
			}
			remove_variable = commander_trait_being_taught
		}
		if = {
			limit = {
				has_character_flag = being_taught_commander_trait
			}
			remove_character_flag = being_taught_commander_trait
		}
	}
}


#Failure
learn_commander_trait.1410 = {
	type = character_event
	title = learn_commander_trait.10.t
	desc = learn_commander_trait.14.desc
	theme = war
		left_portrait = {
		character = root
		animation = shame
	}
	right_portrait = {
		character = scope:teacher
		animation = stressed_teacher
	}

	trigger = {
		var:commander_trait_being_taught = flag:reaver
	}

	immediate = {

	}

	option = {
		name = learn_commander_trait.14.a
		custom_tooltip = learn_commander_trait.14.a.tt
		trigger_event = {
			on_action = learn_commander_trait_test
			days = { 50 600 }
		}
	}

	option = {
		name = learn_commander_trait.14.b
		custom_tooltip = learn_commander_trait.14.b.tt
		giving_up_on_commander_trait_training_effect = yes
	}
}




#reckless
##################

#Training offer
learn_commander_trait.1112 = {
	type = character_event
	title = learn_commander_trait.12.t
	desc = {
		desc = learn_commander_trait.11.opening
		desc = learn_commander_trait.11.desc
	}
	theme = war
		left_portrait = {
		character = root
		animation = inspect_weapon
	}
	right_portrait = {
		character = scope:teacher
		animation = happy_teacher
	}

	trigger = {
		has_variable = commander_trait_being_taught
		var:commander_trait_being_taught = flag:reckless
	}

	weight_multiplier = {
		base = 1
	}

	option = { #Please teach me
		name = learn_commander_trait.11.a
		commander_trait_teaching_setup_effect = yes
		custom_tooltip = learn_commander_trait.11.martial_tt
	}

	option = { #No, I already know enough
		name = learn_commander_trait.11.b
		remove_variable = commander_trait_being_taught
		remove_character_flag = being_taught_commander_trait
		custom_tooltip = learn_commander_trait.11.b.tt
	}
}

#Final test
learn_commander_trait.1212 = {
	type = character_event
	title = learn_commander_trait.12.t
	desc = learn_commander_trait.12.desc
	theme = war
		left_portrait = {
		character = root
		animation = stress
	}
	right_portrait = {
		character = scope:teacher
		animation = happy_teacher
	}

	trigger = {
		has_variable = commander_trait_being_taught
		var:commander_trait_being_taught = flag:reckless
	}

	option = {
		name = learn_commander_trait.12.a
		learn_commander_trait_final_test_duel_effect = yes
	}

	option = { #Back out
		name = learn_commander_trait.12.b
		stress_impact = {
			base = minor_stress_gain
		}
		giving_up_on_commander_trait_training_effect = yes
	}
}


#Success
learn_commander_trait.1312 = {
	type = character_event
	title = learn_commander_trait.12.t
	desc = learn_commander_trait.13.desc
	theme = war
		left_portrait = {
		character = root
		animation = celebrate_wooden_sword
	}
	right_portrait = {
		character = scope:teacher
		animation = happy_teacher
	}

	trigger = {
		var:commander_trait_being_taught = flag:reckless
	}

	option = {
		name = learn_commander_trait.13.a
		learn_commander_trait_success_effect = yes
	}

	after = {
		if = {
			limit = {
				exists = var:commander_trait_being_taught
			}
			remove_variable = commander_trait_being_taught
		}
		if = {
			limit = {
				has_character_flag = being_taught_commander_trait
			}
			remove_character_flag = being_taught_commander_trait
		}
	}
}


#Failure
learn_commander_trait.1412 = {
	type = character_event
	title = learn_commander_trait.12.t
	desc = learn_commander_trait.14.desc
	theme = war
		left_portrait = {
		character = root
		animation = shame
	}
	right_portrait = {
		character = scope:teacher
		animation = stressed_teacher
	}

	trigger = {
		var:commander_trait_being_taught = flag:reckless
	}

	immediate = {

	}

	option = {
		name = learn_commander_trait.14.a
		custom_tooltip = learn_commander_trait.14.a.tt
		trigger_event = {
			on_action = learn_commander_trait_test
			days = { 50 600 }
		}	}

	option = {
		name = learn_commander_trait.14.b
		custom_tooltip = learn_commander_trait.14.b.tt
		giving_up_on_commander_trait_training_effect = yes
	}
}






#holy_warrior
##################

#Training offer
learn_commander_trait.1113 = {
	type = character_event
	title = learn_commander_trait.13.t
	desc = {
		desc = learn_commander_trait.11.opening
		desc = learn_commander_trait.11.desc
	}
	theme = war
		left_portrait = {
		character = root
		animation = inspect_weapon
	}
	right_portrait = {
		character = scope:teacher
		animation = happy_teacher
	}

	trigger = {
		has_variable = commander_trait_being_taught
		var:commander_trait_being_taught = flag:holy_warrior
	}

	weight_multiplier = {
		base = 1
	}

	option = { #Please teach me
		name = learn_commander_trait.11.a
		commander_trait_teaching_setup_effect = yes
		custom_tooltip = learn_commander_trait.11.martial_tt
	}

	option = { #No, I already know enough
		name = learn_commander_trait.11.b
		remove_variable = commander_trait_being_taught
		remove_character_flag = being_taught_commander_trait
		custom_tooltip = learn_commander_trait.11.b.tt
	}
}

#Final test
learn_commander_trait.1213 = {
	type = character_event
	title = learn_commander_trait.13.t
	desc = learn_commander_trait.12.desc
	theme = war
		left_portrait = {
		character = root
		animation = stress
	}
	right_portrait = {
		character = scope:teacher
		animation = happy_teacher
	}

	trigger = {
		has_variable = commander_trait_being_taught
		var:commander_trait_being_taught = flag:holy_warrior
	}

	option = {
		name = learn_commander_trait.12.a
		learn_commander_trait_final_test_duel_effect = yes
	}

	option = { #Back out
		name = learn_commander_trait.12.b
		stress_impact = {
			base = minor_stress_gain
		}
		giving_up_on_commander_trait_training_effect = yes
	}
}


#Success
learn_commander_trait.1313 = {
	type = character_event
	title = learn_commander_trait.13.t
	desc = learn_commander_trait.13.desc
	theme = war
		left_portrait = {
		character = root
		animation = celebrate_wooden_sword
	}
	right_portrait = {
		character = scope:teacher
		animation = happy_teacher
	}

	trigger = {
		var:commander_trait_being_taught = flag:holy_warrior
	}

	option = {
		name = learn_commander_trait.13.a
		learn_commander_trait_success_effect = yes
	}

	after = {
		if = {
			limit = {
				exists = var:commander_trait_being_taught
			}
			remove_variable = commander_trait_being_taught
		}
		if = {
			limit = {
				has_character_flag = being_taught_commander_trait
			}
			remove_character_flag = being_taught_commander_trait
		}
	}
}


#Failure
learn_commander_trait.1413 = {
	type = character_event
	title = learn_commander_trait.13.t
	desc = learn_commander_trait.14.desc
	theme = war
		left_portrait = {
		character = root
		animation = shame
	}
	right_portrait = {
		character = scope:teacher
		animation = stressed_teacher
	}

	trigger = {
		var:commander_trait_being_taught = flag:holy_warrior
	}

	immediate = {

	}

	option = {
		name = learn_commander_trait.14.a
		custom_tooltip = learn_commander_trait.14.a.tt
		trigger_event = {
			on_action = learn_commander_trait_test
			days = { 50 600 }
		}
	}

	option = {
		name = learn_commander_trait.14.b
		custom_tooltip = learn_commander_trait.14.b.tt
		giving_up_on_commander_trait_training_effect = yes
	}
}


######
# The Teacher has died or been imprisoned
#####

#Final Test
learn_commander_trait.1291 = {
	type = character_event
	title = learn_commander_trait.91.t
	desc = learn_commander_trait.1291.desc
	theme = war
	left_portrait = {
		character = root
		animation = sadness
	}
	right_portrait = {
		character = scope:teacher
		animation = dead
	}

	trigger = {
		scope:teacher = {
			OR = {
				is_alive = no
				is_imprisoned = yes
			}
		}
	}

	option = {
		name = learn_commander_trait.1291.a
		learn_commander_trait_final_test_duel_effect = yes
	}

	option = { #No, there's no point
		name = learn_commander_trait.1291.b
		custom_tooltip = learn_commander_trait.giving_up_tt
		if = {
			limit = {
				NOT = {
					exists = scope:long_term_mentor
				}
				scope:teacher = { is_alive = yes }
				has_relation_mentor = scope:teacher
			}
			remove_relation_mentor = scope:teacher
		}
		remove_character_flag = being_taught_commander_trait
		remove_variable = commander_trait_being_taught
	}
}


#Success
learn_commander_trait.1391 = {
	type = character_event
	title = learn_commander_trait.91.t
	desc = learn_commander_trait.1391.desc
	theme = war
		left_portrait = {
		character = root
		animation = wedding_happy_cry
	}
	right_portrait = {
		character = scope:teacher
		animation = dead
	}

	trigger = {
		scope:teacher = {
			OR = {
				is_alive = no
				is_imprisoned = yes
			}
		}
	}

	option = {
		name = learn_commander_trait.1391.a
		learn_commander_trait_success_effect = yes
	}

	after = {
		if = {
			limit = {
				exists = var:commander_trait_being_taught
			}
			remove_variable = commander_trait_being_taught
		}
		if = {
			limit = {
				has_character_flag = being_taught_commander_trait
			}
			remove_character_flag = being_taught_commander_trait
		}
	}
}

#Failure
learn_commander_trait.1491 = {
	type = character_event
	title = learn_commander_trait.91.t
	desc = learn_commander_trait.1491.desc
	theme = war
		left_portrait = {
		character = root
		animation = shame
	}
	right_portrait = {
		character = scope:teacher
		animation = dead
	}

	trigger = {
		scope:teacher = {
			OR = {
				is_alive = no
				is_imprisoned = yes
			}
		}
	}

	option = {
		name = learn_commander_trait.1491.a
		remove_variable = commander_trait_being_taught
		remove_character_flag = being_taught_commander_trait
		if = {
			limit = {
				scope:teacher = {
					is_alive = yes
				}
				has_relation_mentor = scope:teacher
				NOT = {
					exists = scope:long_term_mentor
				}
			}
			remove_relation_mentor = scope:teacher
		}
		stress_impact = {
			arrogant = minor_stress_impact_gain
		}
	}
}
