#########################
# MENTORING SCHEME EVENTS
#########################
namespace = mentoring_scheme_event

# Outcome event - Become better at whatever you studied
mentoring_scheme_event.0001 = {
	hidden = yes
	
	immediate = {
		send_interface_message = {
			type = mentoring_scheme_good_message
			title = mentoring_success_message
			left_icon = scope:target
			
			## Base
			# Merit
			if = {
				limit = {
					scope:scheme = { has_variable = mentoring_merit }
				}
				change_merit = {
					value = 10
					multiply = {
						value = scope:target.merit_level
						subtract = merit_level
					}
				}
			}
			# Confucian Education
			else_if = {
				limit = {
					scope:scheme = { has_variable = mentoring_confucian_education }
				}
				if = {
					limit = {
						has_trait = confucian_education
					}
					add_trait_xp = {
						trait = confucian_education
						value = 2
					}
				}
				else = {
					add_trait = confucian_education
				}
			}
			## Commander Traits
			# Logistician
			else_if = {
				limit = {
					scope:scheme = { has_variable = mentoring_logistician }
				}
				if = {
					limit = {
						has_trait = logistician
					}
					add_trait_xp = {
						trait = logistician
						value = 5
					}
				}
				else = {
					add_trait = logistician
				}
			}
			# Military Engineer
			else_if = {
				limit = {
					scope:scheme = { has_variable = mentoring_military_engineer }
				}
				if = {
					limit = {
						has_trait = military_engineer
					}
					add_trait_xp = {
						trait = military_engineer
						value = 5
					}
				}
				else = {
					add_trait = military_engineer
				}
			}
			# Aggressive Attacker
			else_if = {
				limit = {
					scope:scheme = { has_variable = mentoring_aggressive_attacker }
				}
				if = {
					limit = {
						has_trait = aggressive_attacker
					}
					add_trait_xp = {
						trait = aggressive_attacker
						value = 5
					}
				}
				else = {
					add_trait = aggressive_attacker
				}
			}
			# Unyielding Defender
			else_if = {
				limit = {
					scope:scheme = { has_variable = mentoring_unyielding_defender }
				}
				if = {
					limit = {
						has_trait = unyielding_defender
					}
					add_trait_xp = {
						trait = unyielding_defender
						value = 5
					}
				}
				else = {
					add_trait = unyielding_defender
				}
			}
			# Forder
			else_if = {
				limit = {
					scope:scheme = { has_variable = mentoring_forder }
				}
				if = {
					limit = {
						has_trait = forder
					}
					add_trait_xp = {
						trait = forder
						value = 5
					}
				}
				else = {
					add_trait = forder
				}
			}
			# Flexible Leader
			else_if = {
				limit = {
					scope:scheme = { has_variable = mentoring_flexible_leader }
				}
				if = {
					limit = {
						has_trait = flexible_leader
					}
					add_trait_xp = {
						trait = flexible_leader
						value = 5
					}
				}
				else = {
					add_trait = flexible_leader
				}
			}
			# Desert Warrior
			else_if = {
				limit = {
					scope:scheme = { has_variable = mentoring_desert_warrior }
				}
				if = {
					limit = {
						has_trait = desert_warrior
					}
					add_trait_xp = {
						trait = desert_warrior
						value = 5
					}
				}
				else = {
					add_trait = desert_warrior
				}
			}
			# Jungle Stalker
			else_if = {
				limit = {
					scope:scheme = { has_variable = mentoring_jungle_stalker }
				}
				if = {
					limit = {
						has_trait = jungle_stalker
					}
					add_trait_xp = {
						trait = jungle_stalker
						value = 5
					}
				}
				else = {
					add_trait = jungle_stalker
				}
			}
			# Reaver
			else_if = {
				limit = {
					scope:scheme = { has_variable = mentoring_reaver }
				}
				if = {
					limit = {
						has_trait = reaver
					}
					add_trait_xp = {
						trait = reaver
						value = 5
					}
				}
				else = {
					add_trait = reaver
				}
			}
			# Reckless
			else_if = {
				limit = {
					scope:scheme = { has_variable = mentoring_reckless }
				}
				if = {
					limit = {
						has_trait = reckless
					}
					add_trait_xp = {
						trait = reckless
						value = 5
					}
				}
				else = {
					add_trait = reckless
				}
			}
			# Holy Warrior
			else_if = {
				limit = {
					scope:scheme = { has_variable = mentoring_holy_warrior }
				}
				if = {
					limit = {
						has_trait = holy_warrior
					}
					add_trait_xp = {
						trait = holy_warrior
						value = 5
					}
				}
				else = {
					add_trait = holy_warrior
				}
			}
			# Open Terrain Expert
			else_if = {
				limit = {
					scope:scheme = { has_variable = mentoring_open_terrain_expert }
				}
				if = {
					limit = {
						has_trait = open_terrain_expert
					}
					add_trait_xp = {
						trait = open_terrain_expert
						value = 5
					}
				}
				else = {
					add_trait = open_terrain_expert
				}
			}
			# Rough Terrain Expert
			else_if = {
				limit = {
					scope:scheme = { has_variable = mentoring_rough_terrain_expert }
				}
				if = {
					limit = {
						has_trait = rough_terrain_expert
					}
					add_trait_xp = {
						trait = rough_terrain_expert
						value = 5
					}
				}
				else = {
					add_trait = rough_terrain_expert
				}
			}
			# Forest Fighter
			else_if = {
				limit = {
					scope:scheme = { has_variable = mentoring_forest_fighter }
				}
				if = {
					limit = {
						has_trait = forest_fighter
					}
					add_trait_xp = {
						trait = forest_fighter
						value = 5
					}
				}
				else = {
					add_trait = forest_fighter
				}
			}
			# Cautious Leader
			else_if = {
				limit = {
					scope:scheme = { has_variable = mentoring_cautious_leader }
				}
				if = {
					limit = {
						has_trait = cautious_leader
					}
					add_trait_xp = {
						trait = cautious_leader
						value = 5
					}
				}
				else = {
					add_trait = cautious_leader
				}
			}
			# Organizer
			else_if = {
				limit = {
					scope:scheme = { has_variable = mentoring_organizer }
				}
				if = {
					limit = {
						has_trait = organizer
					}
					add_trait_xp = {
						trait = organizer
						value = 5
					}
				}
				else = {
					add_trait = organizer
				}
			}
			# Winter Soldier
			else_if = {
				limit = {
					scope:scheme = { has_variable = mentoring_winter_soldier }
				}
				if = {
					limit = {
						has_trait = winter_soldier
					}
					add_trait_xp = {
						trait = winter_soldier
						value = 5
					}
				}
				else = {
					add_trait = winter_soldier
				}
			}
		}
	}
}

# Outcome event - You did not make progress
mentoring_scheme_event.0002 = {
	hidden = yes
	
	immediate = {
		send_interface_message = {
			type = mentoring_scheme_bad_message
			title = mentoring_failure_message
			left_icon = scope:target
			
			custom_tooltip = mentoring_failure_message_desc
		}
	}
}
