You are on page 1of 39

#Events dealing with coming of age

namespace = coming_of_age

#Learning
#Stewardship
#Martial
#Intrigue
#Diplomacy

#Learning - notification event for child


#by Linnéa Thimrén and Petter Vilberg
coming_of_age.0001 = {
title = coming_of_age.0001.t
desc = {
triggered_desc = {
trigger = {
exists = scope:educator
}
desc = {
first_valid = {
triggered_desc = {
trigger = {
has_character_flag =
studied_at_university
}
desc = coming_of_age.0001.educator_university
}
desc = coming_of_age.0001.educator
}
}
}
first_valid = {
triggered_desc = {
trigger = {
has_trait_rank = {
trait = education_learning
rank = 1
}
}
desc = {
desc = coming_of_age.0001.desc1
first_valid = {
triggered_desc = {
trigger = {

has_learning_education_affinity_childhood_trait_trigger = yes
}
desc =
coming_of_age.0001.desc1_good_trait
}
triggered_desc = {
trigger = {

has_learning_education_disaffinity_childhood_trait_trigger = yes
}
desc = coming_of_age.0001.desc1_bad_trait
}
desc = coming_of_age.0001.desc1_fallback_trait
}
}
}
triggered_desc = {
trigger = {
has_trait_rank = {
trait = education_learning
rank = 2
}
}
desc = {
desc = coming_of_age.0001.desc2
first_valid = {
triggered_desc = {
trigger = {

has_learning_education_affinity_childhood_trait_trigger = yes
}
desc =
coming_of_age.0001.desc2_good_trait
}
triggered_desc = {
trigger = {

has_learning_education_disaffinity_childhood_trait_trigger = yes
}
desc = coming_of_age.0001.desc2_bad_trait
}
desc = coming_of_age.0001.desc2_fallback_trait
}
}
}
triggered_desc = {
trigger = {
has_trait_rank = {
trait = education_learning
rank = 3
}
}
desc = {
desc = coming_of_age.0001.desc3
first_valid = {
triggered_desc = {
trigger = {

has_learning_education_affinity_childhood_trait_trigger = yes
}
desc =
coming_of_age.0001.desc3_good_trait
}
triggered_desc = {
trigger = {

has_learning_education_disaffinity_childhood_trait_trigger = yes
}
desc = coming_of_age.0001.desc3_bad_trait
}
desc = coming_of_age.0001.desc3_fallback_trait
}
}
}
triggered_desc = {
trigger = {
has_trait_rank = {
trait = education_learning
rank = 4
}
}
desc = {
desc = coming_of_age.0001.desc4
first_valid = {
triggered_desc = {
trigger = {

has_learning_education_affinity_childhood_trait_trigger = yes
}
desc =
coming_of_age.0001.desc4_good_trait
}
triggered_desc = {
trigger = {

has_learning_education_disaffinity_childhood_trait_trigger = yes
}
desc = coming_of_age.0001.desc4_bad_trait
}
desc = coming_of_age.0001.desc4_fallback_trait
}
}
}
}
first_valid = { #If a learned court owner spouse has improved education
triggered_desc = {
trigger = {
exists = scope:education_rank_patronage_bonus
scope:education_rank_patronage_bonus = flag:1
}
desc = coming_of_age.0001.patronaged_spouse_plus_1.desc
}
triggered_desc = {
trigger = {
exists = scope:education_rank_patronage_bonus
scope:education_rank_patronage_bonus = flag:2_or_more
}
desc =
coming_of_age.0001.patronaged_spouse_plus_2_or_more.desc
}
}
first_valid = {
triggered_desc = {
trigger = {
OR = {
any_relation = { type = friend always = yes }
exists = var:had_childhood_crush_variable
exists = var:had_childhood_bully_variable
exists = var:had_childhood_victim_variable
}
}
desc = {
desc = coming_of_age.0001.relationships
triggered_desc = {
trigger = {
any_relation = { type = friend always =
yes }
}
desc = coming_of_age.0001.friend
}
triggered_desc = {
trigger = {
exists = var:had_childhood_crush_variable
}
desc = coming_of_age.0001.crush
}
first_valid = {
triggered_desc = {
trigger = {
AND = {
exists =
var:had_childhood_bully_variable
NOT = { has_character_flag =
bully_destroyed_toy }
}
}
desc = coming_of_age.0001.bully1
}
triggered_desc = {
trigger = {
AND = {
exists =
var:had_childhood_bully_variable
has_character_flag =
bully_destroyed_toy
}
}
desc = coming_of_age.0001.bully2
}
}
first_valid = {
triggered_desc = {
trigger = {
AND = {
exists =
var:had_childhood_victim_variable
scope:victim = {
NOT =
{ has_character_flag = bully_destroyed_toy }
}
}
}
desc = coming_of_age.0001.victim1
}
triggered_desc = {
trigger = {
AND = {
exists =
var:had_childhood_victim_variable
scope:victim = {
has_character_flag =
bully_destroyed_toy
}
}
}
desc = coming_of_age.0001.victim2
}
}
triggered_desc = {
trigger = {
any_relation = { type = friend always =
no }
}
desc = coming_of_age.0001.relationships_end
}
}
}
triggered_desc = {
trigger = {
NOT = {
OR = {
any_relation = { type = friend always =
yes }
exists = var:had_childhood_crush_variable
exists = var:had_childhood_bully_variable
exists =
var:had_childhood_victim_variable
}
}
}
desc = coming_of_age.0001.no_relationships
}
}
}
theme = education
left_portrait = root

trigger = {
has_focus = education_learning
}

immediate = {
play_music_cue = "mx_cue_positive_effect"
save_event_targets_from_childhood_effect = yes
random_relation = {
type = guardian
save_scope_as = educator
}
results_of_patronage_spouse_education_points_effect = yes
#patronage/high learning spouses of court owner can add points
results_of_university_education_points_effect = yes #Did you send the
child to university? Lucky them!
dynasty_legacy_education_boost_effect = yes # Adds a few points if you
have the second Kin legacy
cultural_traditions_education_boost_effect = yes # Adds points based on
Cultural Traditions
court_tutor_education_boost_effect = yes # A Court Tutor gives a better
education
if = {
limit = {
var:education_learning_variable <= education_level_1
}

set_trait_rank = {
trait = education_learning
rank = 1
}
}
else_if = {
limit = {
var:education_learning_variable <= education_level_2
}

set_trait_rank = {
trait = education_learning
rank = 2
}
}
else_if = {
limit = {
var:education_learning_variable <= education_level_3
}

set_trait_rank = {
trait = education_learning
rank = 3
}
}
else = {

set_trait_rank = {
trait = education_learning
rank = 4
}
}

#Chance of gaining Mystic if your religion or educator's religion is


esoteric
if = {
limit = {
faith = {
has_doctrine_parameter =
tenet_esotericism_mystic_education
}
}
random = {
chance = 5
modifier = {
add = 5
has_trait_rank = {
trait = education_learning
rank > 1
}
}
modifier = {
add = 10
has_trait_rank = {
trait = education_learning
rank > 2
}
}
modifier = {
add = 10
has_trait_rank = {
trait = education_learning
rank > 3
}
}
add_trait = mystic_1
}

#Secondary chance if your tutor also has an esoteric faith


if = {
limit = {
NOT = { has_trait = lifestyle_mystic }
exists = scope:educator
scope:educator.faith = {
has_doctrine_parameter =
tenet_esotericism_mystic_education
}
}
random = {
chance = 5
modifier = {
add = 5
scope:educator = {
has_trait_rank = {
trait = education_learning
rank > 1
}
}
}
modifier = {
add = 10
scope:educator = {
has_trait_rank = {
trait = education_learning
rank > 2
}
}
}
modifier = {
add = 10
scope:educator = {
has_trait_rank = {
trait = education_learning
rank > 3
}
}
}
add_trait = mystic_1
}
}
}
post_education_bonuses_effect = yes
save_childhood_trait_as_variable_effect = yes
education_complete_notification_effect = yes
wrap_up_education_effect = yes
custom_tooltip_learning_coming_of_age_effect = yes
show_as_tooltip = { remove_variables_and_trait_coming_of_age_effect =
yes }#To give a good tooltip
}

option = {
name = coming_of_age.0001.a
}

after = {
remove_variable = education_learning_variable
hidden_effect = {
remove_variables_and_trait_coming_of_age_effect = yes
apply_hold_court_grace_effect = yes
}
}
}

#Stewardship - notification event for child


#by Linnéa Thimrén and Petter Vilberg
coming_of_age.0002 = {
title = coming_of_age.0001.t
desc = {
triggered_desc = {
trigger = {
exists = scope:educator
}
desc = {
first_valid = {
triggered_desc = {
trigger = {
has_character_flag =
studied_at_university
}
desc = coming_of_age.0001.educator_university
}
desc = coming_of_age.0001.educator
}
}
}
first_valid = {
triggered_desc = {
trigger = {
has_trait_rank = {
trait = education_stewardship
rank = 1
}
}
desc = {
desc = coming_of_age.0001.desc1
first_valid = {
triggered_desc = {
trigger = {

has_stewardship_education_affinity_childhood_trait_trigger = yes
}
desc =
coming_of_age.0001.desc1_good_trait
}
triggered_desc = {
trigger = {

has_stewardship_education_disaffinity_childhood_trait_trigger = yes
}
desc = coming_of_age.0001.desc1_bad_trait
}
desc = coming_of_age.0001.desc1_fallback_trait
}
}
}
triggered_desc = {
trigger = {
has_trait_rank = {
trait = education_stewardship
rank = 2
}
}
desc = {
desc = coming_of_age.0001.desc2
first_valid = {
triggered_desc = {
trigger = {

has_stewardship_education_affinity_childhood_trait_trigger = yes
}
desc =
coming_of_age.0001.desc2_good_trait
}
triggered_desc = {
trigger = {

has_stewardship_education_disaffinity_childhood_trait_trigger = yes
}
desc = coming_of_age.0001.desc2_bad_trait
}
desc = coming_of_age.0001.desc2_fallback_trait
}
}
}
triggered_desc = {
trigger = {
has_trait_rank = {
trait = education_stewardship
rank = 3
}
}
desc = {
desc = coming_of_age.0001.desc3
first_valid = {
triggered_desc = {
trigger = {

has_stewardship_education_affinity_childhood_trait_trigger = yes
}
desc =
coming_of_age.0001.desc3_good_trait
}
triggered_desc = {
trigger = {

has_stewardship_education_disaffinity_childhood_trait_trigger = yes
}
desc = coming_of_age.0001.desc3_bad_trait
}
desc = coming_of_age.0001.desc3_fallback_trait
}
}
}
triggered_desc = {
trigger = {
has_trait_rank = {
trait = education_stewardship
rank = 4
}
}
desc = {
desc = coming_of_age.0001.desc4
first_valid = {
triggered_desc = {
trigger = {

has_stewardship_education_affinity_childhood_trait_trigger = yes
}
desc =
coming_of_age.0001.desc4_good_trait
}
triggered_desc = {
trigger = {

has_stewardship_education_disaffinity_childhood_trait_trigger = yes
}
desc = coming_of_age.0001.desc4_bad_trait
}
desc = coming_of_age.0001.desc4_fallback_trait
}
}
}
}
first_valid = { #If a learned court owner spouse has improved education
triggered_desc = {
trigger = {
exists = scope:education_rank_patronage_bonus
scope:education_rank_patronage_bonus = flag:1
}
desc = coming_of_age.0001.patronaged_spouse_plus_1.desc
}
triggered_desc = {
trigger = {
exists = scope:education_rank_patronage_bonus
scope:education_rank_patronage_bonus = flag:2_or_more
}
desc =
coming_of_age.0001.patronaged_spouse_plus_2_or_more.desc
}
}
first_valid = {
triggered_desc = {
trigger = {
OR = {
any_relation = { type = friend always = yes }
exists = var:had_childhood_crush_variable
exists = var:had_childhood_bully_variable
exists = var:had_childhood_victim_variable
}
}
desc = {
desc = coming_of_age.0001.relationships
triggered_desc = {
trigger = {
any_relation = { type = friend always =
yes }
}
desc = coming_of_age.0001.friend
}
triggered_desc = {
trigger = {
exists = var:had_childhood_crush_variable
}
desc = coming_of_age.0001.crush
}
first_valid = {
triggered_desc = {
trigger = {
AND = {
exists =
var:had_childhood_bully_variable
NOT = { has_character_flag =
bully_destroyed_toy }
}
}
desc = coming_of_age.0001.bully1
}
triggered_desc = {
trigger = {
AND = {
exists =
var:had_childhood_bully_variable
has_character_flag =
bully_destroyed_toy
}
}
desc = coming_of_age.0001.bully2
}
}
first_valid = {
triggered_desc = {
trigger = {
AND = {
exists =
var:had_childhood_victim_variable
scope:victim = {
NOT =
{ has_character_flag = bully_destroyed_toy }
}
}
}
desc = coming_of_age.0001.victim1
}
triggered_desc = {
trigger = {
AND = {
exists =
var:had_childhood_victim_variable
scope:victim = {
has_character_flag =
bully_destroyed_toy
}
}
}
desc = coming_of_age.0001.victim2
}
}
triggered_desc = {
trigger = {
any_relation = { type = friend always =
no }
}
desc = coming_of_age.0001.relationships_end
}
}
}
triggered_desc = {
trigger = {
NOT = {
OR = {
any_relation = { type = friend always =
yes }
exists = var:had_childhood_crush_variable
exists = var:had_childhood_bully_variable
exists =
var:had_childhood_victim_variable
}
}
}
desc = coming_of_age.0001.no_relationships
}
}
}
theme = education
left_portrait = root

trigger = {
has_focus = education_stewardship
}

immediate = {
play_music_cue = "mx_cue_positive_effect"
save_event_targets_from_childhood_effect = yes
random_relation = {
type = guardian
save_scope_as = educator
}
results_of_patronage_spouse_education_points_effect = yes
#patronage/high learning spouses of court owner can add points
results_of_university_education_points_effect = yes #Did you send the
child to university? Lucky them!
dynasty_legacy_education_boost_effect = yes # Adds a few points if you
have the second Kin legacy
cultural_traditions_education_boost_effect = yes # Adds points based on
Cultural Traditions
court_tutor_education_boost_effect = yes # A Court Tutor gives a better
education
if = {
limit = {
var:education_stewardship_variable <= education_level_1
}

set_trait_rank = {
trait = education_stewardship
rank = 1
}
}
else_if = {
limit = {
var:education_stewardship_variable <= education_level_2
}

set_trait_rank = {
trait = education_stewardship
rank = 2
}
}
else_if = {
limit = {
var:education_stewardship_variable <= education_level_3
}

set_trait_rank = {
trait = education_stewardship
rank = 3
}
}
else = {

set_trait_rank = {
trait = education_stewardship
rank = 4
}
}
post_education_bonuses_effect = yes
save_childhood_trait_as_variable_effect = yes
education_complete_notification_effect = yes
wrap_up_education_effect = yes
custom_tooltip_stewardship_coming_of_age_effect = yes
show_as_tooltip = { remove_variables_and_trait_coming_of_age_effect =
yes }#To give a good tooltip
}

option = {
name = coming_of_age.0001.a
}
after = {
remove_variable = education_stewardship_variable
hidden_effect = {
remove_variables_and_trait_coming_of_age_effect = yes
apply_hold_court_grace_effect = yes #start the grace period for
hold court
}
}
}

#Martial - notification event for child


#by Linnéa Thimrén and Petter Vilberg
coming_of_age.0003 = {
title = coming_of_age.0001.t
desc = {
triggered_desc = {
trigger = {
exists = scope:educator
}
desc = {
first_valid = {
triggered_desc = {
trigger = {
has_character_flag =
studied_at_university
}
desc = coming_of_age.0001.educator_university
}
desc = coming_of_age.0001.educator
}
}
}
first_valid = {
triggered_desc = {
trigger = {
has_trait_rank = {
trait = education_martial
rank = 1
}
}
desc = {
desc = coming_of_age.0001.desc1
first_valid = {
triggered_desc = {
trigger = {

has_martial_education_affinity_childhood_trait_trigger = yes
}
desc =
coming_of_age.0001.desc1_good_trait
}
triggered_desc = {
trigger = {

has_martial_education_disaffinity_childhood_trait_trigger = yes
}
desc = coming_of_age.0001.desc1_bad_trait
}
desc = coming_of_age.0001.desc1_fallback_trait
}
}
}
triggered_desc = {
trigger = {
has_trait_rank = {
trait = education_martial
rank = 2
}
}
desc = {
desc = coming_of_age.0001.desc2
first_valid = {
triggered_desc = {
trigger = {

has_martial_education_affinity_childhood_trait_trigger = yes
}
desc =
coming_of_age.0001.desc2_good_trait
}
triggered_desc = {
trigger = {

has_martial_education_disaffinity_childhood_trait_trigger = yes
}
desc = coming_of_age.0001.desc2_bad_trait
}
desc = coming_of_age.0001.desc2_fallback_trait
}
}
}
triggered_desc = {
trigger = {
has_trait_rank = {
trait = education_martial
rank = 3
}
}
desc = {
desc = coming_of_age.0001.desc3
first_valid = {
triggered_desc = {
trigger = {

has_martial_education_affinity_childhood_trait_trigger = yes
}
desc =
coming_of_age.0001.desc3_good_trait
}
triggered_desc = {
trigger = {

has_martial_education_disaffinity_childhood_trait_trigger = yes
}
desc = coming_of_age.0001.desc3_bad_trait
}
desc = coming_of_age.0001.desc3_fallback_trait
}
}
}
triggered_desc = {
trigger = {
has_trait_rank = {
trait = education_martial
rank = 4
}
}
desc = {
desc = coming_of_age.0001.desc4
first_valid = {
triggered_desc = {
trigger = {

has_martial_education_affinity_childhood_trait_trigger = yes
}
desc =
coming_of_age.0001.desc4_good_trait
}
triggered_desc = {
trigger = {

has_martial_education_disaffinity_childhood_trait_trigger = yes
}
desc = coming_of_age.0001.desc4_bad_trait
}
desc = coming_of_age.0001.desc4_fallback_trait
}
}
}
}
first_valid = { #If a learned court owner spouse has improved education
triggered_desc = {
trigger = {
exists = scope:education_rank_patronage_bonus
scope:education_rank_patronage_bonus = flag:1
}
desc = coming_of_age.0001.patronaged_spouse_plus_1.desc
}
triggered_desc = {
trigger = {
exists = scope:education_rank_patronage_bonus
scope:education_rank_patronage_bonus = flag:2_or_more
}
desc =
coming_of_age.0001.patronaged_spouse_plus_2_or_more.desc
}
}
triggered_desc = {
trigger = {
OR = {
has_trait = education_martial_prowess_1
has_trait = education_martial_prowess_2
has_trait = education_martial_prowess_3
has_trait = education_martial_prowess_4
}
}
desc = coming_of_age.0003.desc_child_start
}
first_valid = {
triggered_desc = {
trigger = { has_trait = education_martial_prowess_1 }
desc = coming_of_age.0003.desc_child_1
}
triggered_desc = {
trigger = { has_trait = education_martial_prowess_2 }
desc = coming_of_age.0003.desc_child_2
}
triggered_desc = {
trigger = { has_trait = education_martial_prowess_3 }
desc = coming_of_age.0003.desc_child_3
}
triggered_desc = {
trigger = { has_trait = education_martial_prowess_4 }
desc = coming_of_age.0003.desc_child_4
}
}
first_valid = {
triggered_desc = {
trigger = {
OR = {
any_relation = { type = friend always = yes }
exists = var:had_childhood_crush_variable
exists = var:had_childhood_bully_variable
exists = var:had_childhood_victim_variable
}
}
desc = {
desc = coming_of_age.0001.relationships
triggered_desc = {
trigger = {
any_relation = { type = friend always =
yes }
}
desc = coming_of_age.0001.friend
}
triggered_desc = {
trigger = {
exists = var:had_childhood_crush_variable
}
desc = coming_of_age.0001.crush
}
first_valid = {
triggered_desc = {
trigger = {
AND = {
exists =
var:had_childhood_bully_variable
NOT = { has_character_flag =
bully_destroyed_toy }
}
}
desc = coming_of_age.0001.bully1
}
triggered_desc = {
trigger = {
AND = {
exists =
var:had_childhood_bully_variable
has_character_flag =
bully_destroyed_toy
}
}
desc = coming_of_age.0001.bully2
}
}
first_valid = {
triggered_desc = {
trigger = {
AND = {
exists =
var:had_childhood_victim_variable
scope:victim = {
NOT =
{ has_character_flag = bully_destroyed_toy }
}
}
}
desc = coming_of_age.0001.victim1
}
triggered_desc = {
trigger = {
AND = {
exists =
var:had_childhood_victim_variable
scope:victim = {
has_character_flag =
bully_destroyed_toy
}
}
}
desc = coming_of_age.0001.victim2
}
}
triggered_desc = {
trigger = {
any_relation = { type = friend always =
no }
}
desc = coming_of_age.0001.relationships_end
}
}
}
triggered_desc = {
trigger = {
NOT = {
OR = {
any_relation = { type = friend always =
yes }
exists = var:had_childhood_crush_variable
exists = var:had_childhood_bully_variable
exists =
var:had_childhood_victim_variable
}
}
}
desc = coming_of_age.0001.no_relationships
}
}
}
theme = education
left_portrait = root

trigger = {
has_focus = education_martial
}

immediate = {
play_music_cue = "mx_cue_positive_effect"
save_event_targets_from_childhood_effect = yes
random_relation = {
type = guardian
save_scope_as = educator
}
results_of_patronage_spouse_education_points_effect = yes
#patronage/high learning spouses of court owner can add points
results_of_university_education_points_effect = yes #Did you send the
child to university? Lucky them! Unless you wanted a knight, in which case they
spend time book-learning rather than squiring.
dynasty_legacy_education_boost_effect = yes # Adds a few points if you
have the second Kin legacy
cultural_traditions_education_boost_effect = yes # Adds points based on
Cultural Traditions
court_tutor_education_boost_effect = yes # A Court Tutor gives a better
education
#Martial trait acquisition.
if = {
limit = {
var:education_martial_variable <= education_level_1
}

set_trait_rank = {
trait = education_martial
rank = 1
}
}
else_if = {
limit = {
var:education_martial_variable <= education_level_2
}

set_trait_rank = {
trait = education_martial
rank = 2
}
}
else_if = {
limit = {
var:education_martial_variable <= education_level_3
}

set_trait_rank = {
trait = education_martial
rank = 3
}
}
else = {

set_trait_rank = {
trait = education_martial
rank = 4
}
}

#Prowess trait acquisition.


if = {
limit = {
can_be_combatant_based_on_gender_trigger = { ARMY_OWNER =
root }
OR = {
#If the child belongs to a knightly culture, then
their martial education includes squirehood.
culture = { has_innovation = innovation_knighthood }
AND = { #If the child's guardian belongs to a
knightly culture, then they will naturally introduce them to the rigours of
squiredom.
exists = scope:educator
scope:educator = {
culture = { has_innovation =
innovation_knighthood }
}
}
}
}

#Set a temp variable based on education level and add/subtract


based on some traits
set_variable = {
name = education_prowess_variable
value = {
value = var:education_martial_variable
if = {
limit = { has_trait = physique_good_3 }
add = education_large_bonus
}
if = {
limit = { has_trait = physique_good_2 }
add = education_medium_bonus
}
if = {
limit = { has_trait = physique_good_1 }
add = education_small_bonus
}
if = {
limit = { has_trait = strong }
add = education_medium_bonus
}
if = {
limit = { has_trait = giant }
add = education_medium_bonus
}
if = {
limit = { has_trait = physique_bad_3 }
add = education_large_penalty
}
if = {
limit = { has_trait = physique_bad_2 }
add = education_medium_penalty
}
if = {
limit = { has_trait = physique_bad_1 }
add = education_small_penalty
}
if = {
limit = { has_trait = weak }
add = education_medium_penalty
}
if = {
limit = { has_trait = dwarf }
add = education_medium_penalty
}
if = {
limit = { has_trait = spindly }
add = education_small_penalty
}
if = {
limit = { has_trait = wheezing }
add = education_small_penalty
}
if = {
limit = { has_trait = hunchbacked }
add = education_small_penalty
}
if = {
limit = { has_trait = inbred }
add = education_small_penalty
}
if = {
limit = { has_trait = bleeder }
add = education_small_penalty
}
}
}

#Do a little randomization


random_list = {
100 = { # Better
ai_boldness_target_modifier = { VALUE = 50 }
ai_energy_target_modifier = { VALUE = 50 }
change_variable = {
name = education_prowess_variable
add = 2
}
}
200 = { } # Nothing
100 = { # Worse
ai_boldness_target_modifier = { VALUE = -50 }
ai_energy_target_modifier = { VALUE = -50 }
change_variable = {
name = education_prowess_variable
add = -2
}
}
}

#Set trait
if = {
limit = {
var:education_prowess_variable <= education_level_1
}

set_trait_rank = {
trait = education_martial_prowess
rank = 1
}
}
else_if = {
limit = {
var:education_prowess_variable <= education_level_2
}

set_trait_rank = {
trait = education_martial_prowess
rank = 2
}
}
else_if = {
limit = {
var:education_prowess_variable <= education_level_3
}

set_trait_rank = {
trait = education_martial_prowess
rank = 3
}
}
else = {

set_trait_rank = {
trait = education_martial_prowess
rank = 4
}
}

remove_variable = education_prowess_variable
}

#Other martial education things.


hidden_effect = { #To assign a commander trait
random_list = {
20 = {
modifier = {
add = 5
has_trait_rank = {
trait = education_martial
rank >= 1
}
}
modifier = {
add = 15
has_trait_rank = {
trait = education_martial
rank >= 2
}
}
modifier = {
add = 20
has_trait_rank = {
trait = education_martial
rank >= 3
}
}
modifier = {
add = 25
has_trait_rank = {
trait = education_martial
rank >= 4
}
}
assign_commander_trait_effect = yes
}
10 = {
#A chance that you get no commander trait
}
}
}
post_education_bonuses_effect = yes
save_childhood_trait_as_variable_effect = yes
education_complete_notification_effect = yes
wrap_up_education_effect = yes
custom_tooltip_martial_coming_of_age_effect = yes
show_as_tooltip = { remove_variables_and_trait_coming_of_age_effect =
yes }#To give a good tooltip
}

option = {
name = coming_of_age.0001.a
}
after = {
remove_variable = education_martial_variable
hidden_effect = {
remove_variables_and_trait_coming_of_age_effect = yes
apply_hold_court_grace_effect = yes #start the grace period for
hold court
}
}
}

#Intrigue - notification event for child


#by Linnéa Thimrén and Petter Vilberg
coming_of_age.0004 = {
title = coming_of_age.0001.t
desc = {
triggered_desc = {
trigger = {
exists = scope:educator
}
desc = {
first_valid = {
triggered_desc = {
trigger = {
has_character_flag =
studied_at_university
}
desc = coming_of_age.0001.educator_university
}
desc = coming_of_age.0001.educator
}
}
}
first_valid = {
triggered_desc = {
trigger = {
has_trait_rank = {
trait = education_intrigue
rank = 1
}
}
desc = {
desc = coming_of_age.0001.desc1
first_valid = {
triggered_desc = {
trigger = {

has_intrigue_education_affinity_childhood_trait_trigger = yes
}
desc =
coming_of_age.0001.desc1_good_trait
}
triggered_desc = {
trigger = {

has_intrigue_education_disaffinity_childhood_trait_trigger = yes
}
desc = coming_of_age.0001.desc1_bad_trait
}
desc = coming_of_age.0001.desc1_fallback_trait
}
}
}
triggered_desc = {
trigger = {
has_trait_rank = {
trait = education_intrigue
rank = 2
}
}
desc = {
desc = coming_of_age.0001.desc2
first_valid = {
triggered_desc = {
trigger = {

has_intrigue_education_affinity_childhood_trait_trigger = yes
}
desc =
coming_of_age.0001.desc2_good_trait
}
triggered_desc = {
trigger = {

has_intrigue_education_disaffinity_childhood_trait_trigger = yes
}
desc = coming_of_age.0001.desc2_bad_trait
}
desc = coming_of_age.0001.desc2_fallback_trait
}
}
}
triggered_desc = {
trigger = {
has_trait_rank = {
trait = education_intrigue
rank = 3
}
}
desc = {
desc = coming_of_age.0001.desc3
first_valid = {
triggered_desc = {
trigger = {

has_intrigue_education_affinity_childhood_trait_trigger = yes
}
desc =
coming_of_age.0001.desc3_good_trait
}
triggered_desc = {
trigger = {

has_intrigue_education_disaffinity_childhood_trait_trigger = yes
}
desc = coming_of_age.0001.desc3_bad_trait
}
desc = coming_of_age.0001.desc3_fallback_trait
}
}
}
triggered_desc = {
trigger = {
has_trait_rank = {
trait = education_intrigue
rank = 4
}
}
desc = {
desc = coming_of_age.0001.desc4
first_valid = {
triggered_desc = {
trigger = {

has_intrigue_education_affinity_childhood_trait_trigger = yes
}
desc =
coming_of_age.0001.desc4_good_trait
}
triggered_desc = {
trigger = {
has_intrigue_education_disaffinity_childhood_trait_trigger = yes
}
desc = coming_of_age.0001.desc4_bad_trait
}
desc = coming_of_age.0001.desc4_fallback_trait
}
}
}
}
first_valid = { #If a learned court owner spouse has improved education
triggered_desc = {
trigger = {
exists = scope:education_rank_patronage_bonus
scope:education_rank_patronage_bonus = flag:1
}
desc = coming_of_age.0001.patronaged_spouse_plus_1.desc
}
triggered_desc = {
trigger = {
exists = scope:education_rank_patronage_bonus
scope:education_rank_patronage_bonus = flag:2_or_more
}
desc =
coming_of_age.0001.patronaged_spouse_plus_2_or_more.desc
}
}
first_valid = {
triggered_desc = {
trigger = {
OR = {
any_relation = { type = friend always = yes }
exists = var:had_childhood_crush_variable
exists = var:had_childhood_bully_variable
exists = var:had_childhood_victim_variable
}
}
desc = {
desc = coming_of_age.0001.relationships
triggered_desc = {
trigger = {
any_relation = { type = friend always =
yes }
}
desc = coming_of_age.0001.friend
}
triggered_desc = {
trigger = {
exists = var:had_childhood_crush_variable
}
desc = coming_of_age.0001.crush
}
first_valid = {
triggered_desc = {
trigger = {
AND = {
exists =
var:had_childhood_bully_variable
NOT = { has_character_flag =
bully_destroyed_toy }
}
}
desc = coming_of_age.0001.bully1
}
triggered_desc = {
trigger = {
AND = {
exists =
var:had_childhood_bully_variable
has_character_flag =
bully_destroyed_toy
}
}
desc = coming_of_age.0001.bully2
}
}
first_valid = {
triggered_desc = {
trigger = {
AND = {
exists =
var:had_childhood_victim_variable
scope:victim = {
NOT =
{ has_character_flag = bully_destroyed_toy }
}
}
}
desc = coming_of_age.0001.victim1
}
triggered_desc = {
trigger = {
AND = {
exists =
var:had_childhood_victim_variable
scope:victim = {
has_character_flag =
bully_destroyed_toy
}
}
}
desc = coming_of_age.0001.victim2
}
}
triggered_desc = {
trigger = {
any_relation = { type = friend always =
no }
}
desc = coming_of_age.0001.relationships_end
}
}
}
triggered_desc = {
trigger = {
NOT = {
OR = {
any_relation = { type = friend always =
yes }
exists = var:had_childhood_crush_variable
exists = var:had_childhood_bully_variable
exists =
var:had_childhood_victim_variable
}
}
}
desc = coming_of_age.0001.no_relationships
}
}
}
theme = education
left_portrait = root

trigger = {
has_focus = education_intrigue
}

immediate = {
play_music_cue = "mx_cue_positive_effect"
save_event_targets_from_childhood_effect = yes
random_relation = {
type = guardian
save_scope_as = educator
}
results_of_patronage_spouse_education_points_effect = yes
#patronage/high learning spouses of court owner can add points
results_of_university_education_points_effect = yes #Did you send the
child to university? Lucky them!
dynasty_legacy_education_boost_effect = yes # Adds a few points if you
have the second Kin legacy
cultural_traditions_education_boost_effect = yes # Adds points based on
Cultural Traditions
court_tutor_education_boost_effect = yes # A Court Tutor gives a better
education
if = {
limit = {
var:education_intrigue_variable <= education_level_1
}

set_trait_rank = {
trait = education_intrigue
rank = 1
}
}
else_if = {
limit = {
var:education_intrigue_variable <= education_level_2
}

set_trait_rank = {
trait = education_intrigue
rank = 2
}
}
else_if = {
limit = {
var:education_intrigue_variable <= education_level_3
}

set_trait_rank = {
trait = education_intrigue
rank = 3
}
}
else = {

set_trait_rank = {
trait = education_intrigue
rank = 4
}
}
post_education_bonuses_effect = yes
save_childhood_trait_as_variable_effect = yes
education_complete_notification_effect = yes
wrap_up_education_effect = yes
custom_tooltip_intrigue_coming_of_age_effect = yes
show_as_tooltip = { remove_variables_and_trait_coming_of_age_effect =
yes }#To give a good tooltip
}

option = {
name = coming_of_age.0001.a
}
after = {
remove_variable = education_intrigue_variable
hidden_effect = {
remove_variables_and_trait_coming_of_age_effect = yes
apply_hold_court_grace_effect = yes #start the grace period for
hold court
}
}
}

#Diplomacy - notification event for child


#by Linnéa Thimrén and Petter Vilberg
coming_of_age.0005 = {
title = coming_of_age.0001.t
desc = {
triggered_desc = {
trigger = {
exists = scope:educator
}
desc = {
first_valid = {
triggered_desc = {
trigger = {
has_character_flag =
studied_at_university
}
desc = coming_of_age.0001.educator_university
}
desc = coming_of_age.0001.educator
}
}
}
first_valid = {
triggered_desc = {
trigger = {
has_trait_rank = {
trait = education_diplomacy
rank = 1
}
}
desc = {
desc = coming_of_age.0001.desc1
first_valid = {
triggered_desc = {
trigger = {

has_diplomacy_education_affinity_childhood_trait_trigger = yes
}
desc =
coming_of_age.0001.desc1_good_trait
}
triggered_desc = {
trigger = {

has_diplomacy_education_disaffinity_childhood_trait_trigger = yes
}
desc = coming_of_age.0001.desc1_bad_trait
}
desc = coming_of_age.0001.desc1_fallback_trait
}
}
}
triggered_desc = {
trigger = {
has_trait_rank = {
trait = education_diplomacy
rank = 2
}
}
desc = {
desc = coming_of_age.0001.desc2
first_valid = {
triggered_desc = {
trigger = {

has_diplomacy_education_affinity_childhood_trait_trigger = yes
}
desc =
coming_of_age.0001.desc2_good_trait
}
triggered_desc = {
trigger = {

has_diplomacy_education_disaffinity_childhood_trait_trigger = yes
}
desc = coming_of_age.0001.desc2_bad_trait
}
desc = coming_of_age.0001.desc2_fallback_trait
}
}
}
triggered_desc = {
trigger = {
has_trait_rank = {
trait = education_diplomacy
rank = 3
}
}
desc = {
desc = coming_of_age.0001.desc3
first_valid = {
triggered_desc = {
trigger = {

has_diplomacy_education_affinity_childhood_trait_trigger = yes
}
desc =
coming_of_age.0001.desc3_good_trait
}
triggered_desc = {
trigger = {

has_diplomacy_education_disaffinity_childhood_trait_trigger = yes
}
desc = coming_of_age.0001.desc3_bad_trait
}
desc = coming_of_age.0001.desc3_fallback_trait
}
}
}
triggered_desc = {
trigger = {
has_trait_rank = {
trait = education_diplomacy
rank = 4
}
}
desc = {
desc = coming_of_age.0001.desc4
first_valid = {
triggered_desc = {
trigger = {

has_diplomacy_education_affinity_childhood_trait_trigger = yes
}
desc =
coming_of_age.0001.desc4_good_trait
}
triggered_desc = {
trigger = {

has_diplomacy_education_disaffinity_childhood_trait_trigger = yes
}
desc = coming_of_age.0001.desc4_bad_trait
}
desc = coming_of_age.0001.desc4_fallback_trait
}
}
}
}
first_valid = { #If a learned court owner spouse has improved education
triggered_desc = {
trigger = {
exists = scope:education_rank_patronage_bonus
scope:education_rank_patronage_bonus = flag:1
}
desc = coming_of_age.0001.patronaged_spouse_plus_1.desc
}
triggered_desc = {
trigger = {
exists = scope:education_rank_patronage_bonus
scope:education_rank_patronage_bonus = flag:2_or_more
}
desc =
coming_of_age.0001.patronaged_spouse_plus_2_or_more.desc
}
}
first_valid = {
triggered_desc = {
trigger = {
OR = {
any_relation = { type = friend always = yes }
exists = var:had_childhood_crush_variable
exists = var:had_childhood_bully_variable
exists = var:had_childhood_victim_variable
}
}
desc = {
desc = coming_of_age.0001.relationships
triggered_desc = {
trigger = {
any_relation = { type = friend always =
yes }
}
desc = coming_of_age.0001.friend
}
triggered_desc = {
trigger = {
exists = var:had_childhood_crush_variable
}
desc = coming_of_age.0001.crush
}
first_valid = {
triggered_desc = {
trigger = {
AND = {
exists =
var:had_childhood_bully_variable
NOT = { has_character_flag =
bully_destroyed_toy }
}
}
desc = coming_of_age.0001.bully1
}
triggered_desc = {
trigger = {
AND = {
exists =
var:had_childhood_bully_variable
has_character_flag =
bully_destroyed_toy
}
}
desc = coming_of_age.0001.bully2
}
}
first_valid = {
triggered_desc = {
trigger = {
AND = {
exists =
var:had_childhood_victim_variable
scope:victim = {
NOT =
{ has_character_flag = bully_destroyed_toy }
}
}
}
desc = coming_of_age.0001.victim1
}
triggered_desc = {
trigger = {
AND = {
exists =
var:had_childhood_victim_variable
scope:victim = {
has_character_flag =
bully_destroyed_toy
}
}
}
desc = coming_of_age.0001.victim2
}
}
triggered_desc = {
trigger = {
any_relation = { type = friend always =
no }
}
desc = coming_of_age.0001.relationships_end
}
}
}
triggered_desc = {
trigger = {
NOT = {
OR = {
any_relation = { type = friend always =
yes }
exists = var:had_childhood_crush_variable
exists = var:had_childhood_bully_variable
exists =
var:had_childhood_victim_variable
}
}
}
desc = coming_of_age.0001.no_relationships
}
}
}
theme = education
left_portrait = root

trigger = {
has_focus = education_diplomacy
}

immediate = {
play_music_cue = "mx_cue_positive_effect"
save_event_targets_from_childhood_effect = yes
random_relation = {
type = guardian
save_scope_as = educator
}
results_of_patronage_spouse_education_points_effect = yes
#patronage/high learning spouses of court owner can add points
results_of_university_education_points_effect = yes #Did you send the
child to university? Lucky them!
dynasty_legacy_education_boost_effect = yes # Adds a few points if you
have the second Kin legacy
cultural_traditions_education_boost_effect = yes # Adds points based on
Cultural Traditions
court_tutor_education_boost_effect = yes # A Court Tutor gives a better
education
if = {
limit = {
var:education_diplomacy_variable <= education_level_1
}

set_trait_rank = {
trait = education_diplomacy
rank = 1
}
}
else_if = {
limit = {
var:education_diplomacy_variable <= education_level_2
}

set_trait_rank = {
trait = education_diplomacy
rank = 2
}
}
else_if = {
limit = {
var:education_diplomacy_variable <= education_level_3
}

set_trait_rank = {
trait = education_diplomacy
rank = 3
}
}
else = {

set_trait_rank = {
trait = education_diplomacy
rank = 4
}
}
post_education_bonuses_effect = yes
save_childhood_trait_as_variable_effect = yes
education_complete_notification_effect = yes
wrap_up_education_effect = yes
custom_tooltip_diplomacy_coming_of_age_effect = yes
show_as_tooltip = { remove_variables_and_trait_coming_of_age_effect =
yes }#To give a good tooltip
}

option = {
name = coming_of_age.0001.a
}
after = {
remove_variable = education_diplomacy_variable
hidden_effect = {
remove_variables_and_trait_coming_of_age_effect = yes
apply_hold_court_grace_effect = yes #start the grace period for
hold court
}
}
}

#############################
# Coming of Age - Notification events for others
# 1000 - 1999
#############################

#Notification event for a Parent Guardian


coming_of_age.1001 = {
type = character_event
title = coming_of_age.1001.t
desc = {
first_valid = {
triggered_desc = {
trigger = {
scope:educated_child = {
has_character_flag = studied_at_university
}
}
desc = coming_of_age.1001.desc_university
}
desc = coming_of_age.1001.desc
}
first_valid = { #If a learned court owner spouse has improved education
triggered_desc = {
trigger = {
exists = scope:education_rank_patronage_bonus
scope:education_rank_patronage_bonus = flag:1
NOT = { this = scope:patronage_spouse_tutor }
}
desc = coming_of_age.1001.patronaged_spouse_plus_1.desc
}
triggered_desc = {
trigger = {
exists = scope:education_rank_patronage_bonus
scope:education_rank_patronage_bonus = flag:2_or_more
NOT = { this = scope:patronage_spouse_tutor }
}
desc =
coming_of_age.1001.patronaged_spouse_plus_2_or_more.desc
}
}
}
theme = education
left_portrait = scope:educated_child

trigger = {
this = scope:parent_guardian
}

option = {
name = coming_of_age.1001.a
scope:educated_child =
{ display_correct_education_trait_gain_tooltip_effect = yes }
}
}

#Notification event for a non-guardian Parent


coming_of_age.1002 = {
type = character_event
title = coming_of_age.1002.t
desc = {
desc = coming_of_age.1002.desc
first_valid = { #If a learned court owner spouse has improved education
triggered_desc = {
trigger = {
exists = scope:education_rank_patronage_bonus
scope:education_rank_patronage_bonus = flag:1
NOT = { this = scope:patronage_spouse_tutor }
}
desc = coming_of_age.1002.patronaged_spouse_plus_1.desc
}
triggered_desc = {
trigger = {
exists = scope:education_rank_patronage_bonus
scope:education_rank_patronage_bonus = flag:2_or_more
NOT = { this = scope:patronage_spouse_tutor }
}
desc =
coming_of_age.1002.patronaged_spouse_plus_2_or_more.desc
}
}
}
theme = education
left_portrait = scope:educated_child

option = {
name = coming_of_age.1001.a
scope:educated_child =
{ display_correct_education_trait_gain_tooltip_effect = yes }
}
}

#Notification event for a non-parent Guardian when both parents are alive
coming_of_age.1003 = {
type = character_event
title = coming_of_age.1003.t
desc = {
desc = coming_of_age.1003.standard
first_valid = { #If a learned court owner spouse has improved education
triggered_desc = {
trigger = {
exists = scope:education_rank_patronage_bonus
scope:education_rank_patronage_bonus = flag:1
NOT = { this = scope:patronage_spouse_tutor }
}
desc = coming_of_age.1002.patronaged_spouse_plus_1.desc
}
triggered_desc = {
trigger = {
exists = scope:education_rank_patronage_bonus
scope:education_rank_patronage_bonus = flag:2_or_more
NOT = { this = scope:patronage_spouse_tutor }
}
desc =
coming_of_age.1002.patronaged_spouse_plus_2_or_more.desc
}
}
first_valid = {
triggered_desc = {
trigger = {
scope:educated_child = {
has_education_rank_1_trigger = yes
}
}
desc = coming_of_age.1003.rank_1
}
triggered_desc = {
trigger = {
scope:educated_child = {
has_education_rank_2_trigger = yes
}
}
desc = coming_of_age.1003.rank_2
}
triggered_desc = {
trigger = {
scope:educated_child = {
has_education_rank_3_trigger = yes
}
}
desc = coming_of_age.1003.rank_3
}
triggered_desc = {
trigger = {
scope:educated_child = {
has_education_rank_4_trigger = yes
}
}
desc = coming_of_age.1003.rank_4
}
}
}
theme = education
left_portrait = scope:educated_child

trigger = {
this = scope:guardian
}

option = {
name = coming_of_age.1003.a
scope:educated_child =
{ display_correct_education_trait_gain_tooltip_effect = yes }
}
}

#Notification event for a non-parent Guardian both parents are alive


coming_of_age.1004 = {
type = character_event
title = coming_of_age.1004.t
desc = {
desc = coming_of_age.1004.desc
first_valid = { #If a learned court owner spouse has improved education
triggered_desc = {
trigger = {
exists = scope:education_rank_patronage_bonus
scope:education_rank_patronage_bonus = flag:1
NOT = { this = scope:patronage_spouse_tutor }
}
desc = coming_of_age.1002.patronaged_spouse_plus_1.desc
}
triggered_desc = {
trigger = {
exists = scope:education_rank_patronage_bonus
scope:education_rank_patronage_bonus = flag:2_or_more
NOT = { this = scope:patronage_spouse_tutor }
}
desc =
coming_of_age.1002.patronaged_spouse_plus_2_or_more.desc
}
}
}
theme = education
left_portrait = scope:educated_child

trigger = {
this = scope:guardian
}

option = {
name = coming_of_age.1004.a
scope:educated_child =
{ display_correct_education_trait_gain_tooltip_effect = yes }
}
}

#Notification event for a non-parent Guardian when both parents are dead
coming_of_age.1005 = {
type = character_event
title = coming_of_age.1005.t
desc = {
desc = coming_of_age.1005.desc
first_valid = { #If a learned court owner spouse has improved education
triggered_desc = {
trigger = {
exists = scope:education_rank_patronage_bonus
scope:education_rank_patronage_bonus = flag:1
NOT = { this = scope:patronage_spouse_tutor }
}
desc = coming_of_age.1002.patronaged_spouse_plus_1.desc
}
triggered_desc = {
trigger = {
exists = scope:education_rank_patronage_bonus
scope:education_rank_patronage_bonus = flag:2_or_more
NOT = { this = scope:patronage_spouse_tutor }
}
desc =
coming_of_age.1002.patronaged_spouse_plus_2_or_more.desc
}
}
}
theme = education
left_portrait = scope:educated_child

trigger = {
this = scope:guardian
}

option = {
name = coming_of_age.1005.a
scope:educated_child = {
if = {
limit = { has_variable = hold_court_8100_fosterer }
scope:guardian = {
if = {
limit = {
can_add_hook = {
target = scope:educated_child
type = loyalty_hook
}
}
add_hook = {
target = scope:educated_child
type = loyalty_hook
}
}
}
remove_variable = hold_court_8100_fosterer
}
display_correct_education_trait_gain_tooltip_effect = yes
}
}
}

You might also like