﻿DI_personality_trait_randomizer_effect = {
    random_list = {
        10 = { add_trait = lustful }
        10 = { add_trait = chaste }
        10 = { add_trait = gluttonous }
        10 = { add_trait = temperate }
        10 = { add_trait = greedy }
        10 = { add_trait = generous }
        10 = { add_trait = lazy }
        10 = { add_trait = diligent }
        10 = { add_trait = wrathful }
        10 = { add_trait = calm }
        10 = { add_trait = patient }
        10 = { add_trait = impatient }
    }
    random_list = {
        10 = { add_trait = arrogant }
        10 = { add_trait = humble }
        10 = { add_trait = authoritative }
        10 = { add_trait = honorable }
        10 = { add_trait = ruthless }
        10 = { add_trait = deceitful }
        10 = { add_trait = honest }
        10 = { add_trait = craven }
        10 = { add_trait = brave }
        10 = { add_trait = shy }
        10 = { add_trait = gregarious }
        10 = { add_trait = ambitious }
        10 = { add_trait = content }
        10 = { add_trait = arbitrary }
    }
    random_list = {
        10 = { add_trait = just }
        10 = { add_trait = cynical }
        10 = { add_trait = zealous }
        10 = { add_trait = paranoid }
        10 = { add_trait = trusting }
        10 = { add_trait = compassionate }
        10 = { add_trait = rude }
        10 = { add_trait = callous }
        10 = { add_trait = sadistic }
        10 = { add_trait = stubborn }
        10 = { add_trait = fickle }
        10 = { add_trait = vengeful }
        10 = { add_trait = forgiving }
    }
}

DI_clear_personality_traits_effect = {
    if = { limit = { has_trait = lustful } remove_trait = lustful }
    if = { limit = { has_trait = chaste } remove_trait = chaste }
    if = { limit = { has_trait = gluttonous } remove_trait = gluttonous }
    if = { limit = { has_trait = temperate } remove_trait = temperate }
    if = { limit = { has_trait = greedy } remove_trait = greedy }
    if = { limit = { has_trait = generous } remove_trait = generous }
    if = { limit = { has_trait = lazy } remove_trait = lazy }
    if = { limit = { has_trait = diligent } remove_trait = diligent }
    if = { limit = { has_trait = wrathful } remove_trait = wrathful }
    if = { limit = { has_trait = calm } remove_trait = calm }
    if = { limit = { has_trait = patient } remove_trait = patient }
    if = { limit = { has_trait = impatient } remove_trait = impatient }
    if = { limit = { has_trait = arrogant } remove_trait = arrogant }
    if = { limit = { has_trait = humble } remove_trait = humble }
    if = { limit = { has_trait = deceitful } remove_trait = deceitful }
    if = { limit = { has_trait = honest } remove_trait = honest }
    if = { limit = { has_trait = craven } remove_trait = craven }
    if = { limit = { has_trait = brave } remove_trait = brave }
    if = { limit = { has_trait = shy } remove_trait = shy }
    if = { limit = { has_trait = gregarious } remove_trait = gregarious }
    if = { limit = { has_trait = ambitious } remove_trait = ambitious }
    if = { limit = { has_trait = content } remove_trait = content }
    if = { limit = { has_trait = arbitrary } remove_trait = arbitrary }
    if = { limit = { has_trait = just } remove_trait = just }
    if = { limit = { has_trait = cynical } remove_trait = cynical }
    if = { limit = { has_trait = zealous } remove_trait = zealous }
    if = { limit = { has_trait = paranoid } remove_trait = paranoid }
    if = { limit = { has_trait = trusting } remove_trait = trusting }
    if = { limit = { has_trait = compassionate } remove_trait = compassionate }
    if = { limit = { has_trait = callous } remove_trait = callous }
    if = { limit = { has_trait = sadistic } remove_trait = sadistic }
    if = { limit = { has_trait = stubborn } remove_trait = stubborn }
    if = { limit = { has_trait = fickle } remove_trait = fickle }
    if = { limit = { has_trait = vengeful } remove_trait = vengeful }
    if = { limit = { has_trait = forgiving } remove_trait = forgiving }
    if = { limit = { has_trait = honorable } remove_trait = honorable }
    if = { limit = { has_trait = ruthless } remove_trait = ruthless }
    if = { limit = { has_trait = authoritative } remove_trait = authoritative }
    if = { limit = { has_trait = rude } remove_trait = rude }
}

DI_set_weight_0 = {
    change_current_weight = 200
    change_current_weight = -100
}

DI_add_commander_traits_effect = {
    add_trait = logistician
    add_trait = military_engineer
    add_trait = aggressive_attacker
    add_trait = unyielding_defender
    add_trait = forder
    add_trait = flexible_leader
    add_trait = desert_warrior
    add_trait = jungle_stalker
    add_trait = reaver
    add_trait = reckless
    add_trait = holy_warrior
    add_trait = open_terrain_expert
    add_trait = rough_terrain_expert
    add_trait = forest_fighter
    add_trait = cautious_leader
    add_trait = organizer
    if = { limit = { has_trait = logistician } add_trait_xp = { trait = logistician value = 100 } }
    if = { limit = { has_trait = military_engineer } add_trait_xp = { trait = military_engineer value = 100 } }
    if = { limit = { has_trait = aggressive_attacker } add_trait_xp = { trait = aggressive_attacker value = 100 } }
    if = { limit = { has_trait = unyielding_defender } add_trait_xp = { trait = unyielding_defender value = 100 } }
    if = { limit = { has_trait = forder } add_trait_xp = { trait = forder value = 100 } }
    if = { limit = { has_trait = flexible_leader } add_trait_xp = { trait = flexible_leader value = 100 } }
    if = { limit = { has_trait = desert_warrior } add_trait_xp = { trait = desert_warrior value = 100 } }
    if = { limit = { has_trait = jungle_stalker } add_trait_xp = { trait = jungle_stalker value = 100 } }
    if = { limit = { has_trait = reaver } add_trait_xp = { trait = reaver value = 100 } }
    if = { limit = { has_trait = reckless } add_trait_xp = { trait = reckless value = 100 } }
    if = { limit = { has_trait = holy_warrior } add_trait_xp = { trait = holy_warrior value = 100 } }
    if = { limit = { has_trait = open_terrain_expert } add_trait_xp = { trait = open_terrain_expert value = 100 } }
    if = { limit = { has_trait = rough_terrain_expert } add_trait_xp = { trait = rough_terrain_expert value = 100 } }
    if = { limit = { has_trait = forest_fighter } add_trait_xp = { trait = forest_fighter value = 100 } }
    if = { limit = { has_trait = cautious_leader } add_trait_xp = { trait = cautious_leader value = 100 } }
    if = { limit = { has_trait = organizer } add_trait_xp = { trait = organizer value = 100 } }
    # adding trait xp to newly added commander traits so they can progress right away #
    # effect add_trait_xp = {trait = organizer value=100}}`
}

DI_remove_commander_traits_effect = {
    if = { limit = { has_trait = logistician } remove_trait = logistician }
    if = { limit = { has_trait = military_engineer } remove_trait = military_engineer }
    if = { limit = { has_trait = aggressive_attacker } remove_trait = aggressive_attacker }
    if = { limit = { has_trait = unyielding_defender } remove_trait = unyielding_defender }
    if = { limit = { has_trait = forder } remove_trait = forder }
    if = { limit = { has_trait = flexible_leader } remove_trait = flexible_leader }
    if = { limit = { has_trait = desert_warrior } remove_trait = desert_warrior }
    if = { limit = { has_trait = jungle_stalker } remove_trait = jungle_stalker }
    if = { limit = { has_trait = reaver } remove_trait = reaver }
    if = { limit = { has_trait = reckless } remove_trait = reckless }
    if = { limit = { has_trait = holy_warrior } remove_trait = holy_warrior }
    if = { limit = { has_trait = open_terrain_expert } remove_trait = open_terrain_expert }
    if = { limit = { has_trait = rough_terrain_expert } remove_trait = rough_terrain_expert }
    if = { limit = { has_trait = forest_fighter } remove_trait = forest_fighter }
    if = { limit = { has_trait = cautious_leader } remove_trait = cautious_leader }
    if = { limit = { has_trait = organizer } remove_trait = organizer }
}

DI_eliminated_health_problem_effect = {
    if = { limit = { has_trait = drunkard } remove_trait = drunkard }
    if = { limit = { has_trait = depressed_1 } remove_trait = depressed_1 }
    if = { limit = { has_trait = depressed_genetic } remove_trait = depressed_genetic }
    if = { limit = { has_trait = lunatic_1 } remove_trait = lunatic_1 }
    if = { limit = { has_trait = lunatic_genetic } remove_trait = lunatic_genetic }
    if = { limit = { has_trait = possessed_1 } remove_trait = possessed_1 }
    if = { limit = { has_trait = possessed_genetic } remove_trait = possessed_genetic }
    if = { limit = { has_trait = ill } remove_trait = ill }
    if = { limit = { has_trait = pneumonic } remove_trait = pneumonic }
    if = { limit = { has_trait = great_pox } remove_trait = great_pox }
    if = { limit = { has_trait = early_great_pox } remove_trait = early_great_pox }
    if = { limit = { has_trait = lovers_pox } remove_trait = lovers_pox }
    if = { limit = { has_trait = leper } remove_trait = leper }
    if = { limit = { has_trait = wounded_1 } remove_trait = wounded_1 }
    if = { limit = { has_trait = wounded_2 } remove_trait = wounded_2 }
    if = { limit = { has_trait = wounded_3 } remove_trait = wounded_3 }
    if = { limit = { has_trait = maimed } remove_trait = maimed }
    if = { limit = { has_trait = one_eyed } remove_trait = one_eyed }
    if = { limit = { has_trait = one_legged } remove_trait = one_legged }
    if = { limit = { has_trait = disfigured } remove_trait = disfigured }
    if = { limit = { has_trait = infirm } remove_trait = infirm }
    if = { limit = { has_trait = incapable } remove_trait = incapable }
    if = { limit = { has_trait = gout_ridden } remove_trait = gout_ridden }
    if = { limit = { has_trait = consumption } remove_trait = consumption }
    if = { limit = { has_trait = cancer } remove_trait = cancer }
    if = { limit = { has_trait = typhus } remove_trait = typhus }
    if = { limit = { has_trait = bubonic_plague } remove_trait = bubonic_plague }
    if = { limit = { has_trait = smallpox } remove_trait = smallpox }
    if = { limit = { has_trait = sickly } remove_trait = sickly }
    if = { limit = { has_trait = scarred } remove_trait = scarred }
    if = { limit = { has_trait = eunuch_1 } remove_trait = eunuch_1 }
    if = { limit = { has_trait = beardless_eunuch } remove_trait = beardless_eunuch }
    if = { limit = { has_trait = blind } remove_trait = blind }
    if = { limit = { has_trait = clubfooted } remove_trait = clubfooted }
    if = { limit = { has_trait = hunchbacked } remove_trait = hunchbacked }
    if = { limit = { has_trait = lisping } remove_trait = lisping }
    if = { limit = { has_trait = stuttering } remove_trait = stuttering }
    if = { limit = { has_trait = dwarf } remove_trait = dwarf }
    if = { limit = { has_trait = giant } remove_trait = giant }
    if = { limit = { has_trait = inbred } remove_trait = inbred }
    if = { limit = { has_trait = weak } remove_trait = weak }
    if = { limit = { has_trait = dull } remove_trait = dull }
    if = { limit = { has_trait = impotent } remove_trait = impotent }
    if = { limit = { has_trait = spindly } remove_trait = spindly }
    if = { limit = { has_trait = scaly } remove_trait = scaly }
    if = { limit = { has_trait = wheezing } remove_trait = wheezing }
    if = { limit = { has_trait = bleeder } remove_trait = bleeder }
    if = { limit = { has_trait = infertile } remove_trait = infertile }

    hidden_effect = {
        if = {
            limit = {
                has_character_flag = will_get_scar
            }
            remove_character_flag = will_get_scar
        }
        if = {
            limit = {
                has_character_modifier = infected_wound_modifier
            }
            remove_character_modifier = infected_wound_modifier
        }

        if = { limit = { has_character_flag = had_event_harm_0002 } remove_character_flag = had_event_harm_0002 }
        if = { limit = { has_character_flag = had_event_harm_0003 } remove_character_flag = had_event_harm_0003 }
        if = { limit = { has_character_flag = had_event_harm_0501 } remove_character_flag = had_event_harm_0501 }
        if = { limit = { has_character_flag = had_event_harm_0502 } remove_character_flag = had_event_harm_0502 }
        if = { limit = { has_character_flag = had_event_harm_0511 } remove_character_flag = had_event_harm_0511 }
        if = { limit = { has_character_flag = had_event_harm_0512 } remove_character_flag = had_event_harm_0512 }
        if = { limit = { has_character_flag = had_event_harm_0521 } remove_character_flag = had_event_harm_0521 }
        if = { limit = { has_character_flag = had_event_harm_0522 } remove_character_flag = had_event_harm_0522 }
        if = { limit = { has_character_flag = had_event_harm_0531 } remove_character_flag = had_event_harm_0531 }
        if = { limit = { has_character_flag = had_event_harm_0532 } remove_character_flag = had_event_harm_0532 }
        if = { limit = { has_character_flag = had_event_harm_0541 } remove_character_flag = had_event_harm_0541 }
        if = { limit = { has_character_flag = had_event_harm_0542 } remove_character_flag = had_event_harm_0542 }
        if = { limit = { has_character_flag = had_event_harm_0551 } remove_character_flag = had_event_harm_0551 }
        if = { limit = { has_character_flag = had_event_harm_0552 } remove_character_flag = had_event_harm_0552 }
        if = { limit = { has_character_flag = had_event_harm_0561 } remove_character_flag = had_event_harm_0561 }
        if = { limit = { has_character_flag = had_event_harm_0562 } remove_character_flag = had_event_harm_0562 }
        if = { limit = { has_character_flag = had_event_harm_0571 } remove_character_flag = had_event_harm_0571 }
        if = { limit = { has_character_flag = had_event_harm_0572 } remove_character_flag = had_event_harm_0572 }
        if = { limit = { has_character_flag = had_event_harm_0581 } remove_character_flag = had_event_harm_0581 }
        if = { limit = { has_character_flag = had_event_harm_0582 } remove_character_flag = had_event_harm_0582 }
        if = { limit = { has_character_flag = had_event_harm_0591 } remove_character_flag = had_event_harm_0591 }
        if = { limit = { has_character_flag = had_event_harm_0592 } remove_character_flag = had_event_harm_0592 }
        if = { limit = { has_character_flag = had_event_harm_0601 } remove_character_flag = had_event_harm_0601 }
        if = { limit = { has_character_flag = had_event_harm_0602 } remove_character_flag = had_event_harm_0602 }
        if = { limit = { has_character_flag = had_event_harm_0611 } remove_character_flag = had_event_harm_0611 }
        if = { limit = { has_character_flag = had_event_harm_0612 } remove_character_flag = had_event_harm_0612 }
        if = { limit = { has_character_flag = had_event_harm_0621 } remove_character_flag = had_event_harm_0621 }
        if = { limit = { has_character_flag = had_event_harm_0622 } remove_character_flag = had_event_harm_0622 }
        if = { limit = { has_character_flag = had_event_harm_0631 } remove_character_flag = had_event_harm_0631 }
        if = { limit = { has_character_flag = had_event_harm_0632 } remove_character_flag = had_event_harm_0632 }
        if = { limit = { has_character_flag = had_event_harm_0641 } remove_character_flag = had_event_harm_0641 }
        if = { limit = { has_character_flag = had_event_harm_0642 } remove_character_flag = had_event_harm_0642 }
        if = { limit = { has_character_flag = had_event_harm_1001 } remove_character_flag = had_event_harm_1001 }
        if = { limit = { has_character_flag = had_event_harm_1002 } remove_character_flag = had_event_harm_1002 }
        if = { limit = { has_character_flag = had_event_harm_1011 } remove_character_flag = had_event_harm_1011 }
        if = { limit = { has_character_flag = had_event_harm_1012 } remove_character_flag = had_event_harm_1012 }
        if = { limit = { has_character_flag = had_event_harm_1021 } remove_character_flag = had_event_harm_1021 }
        if = { limit = { has_character_flag = had_event_harm_1022 } remove_character_flag = had_event_harm_1022 }
        if = { limit = { has_character_flag = had_event_harm_1031 } remove_character_flag = had_event_harm_1031 }
        if = { limit = { has_character_flag = had_event_harm_1032 } remove_character_flag = had_event_harm_1032 }
        if = { limit = { has_character_flag = had_event_harm_1041 } remove_character_flag = had_event_harm_1041 }
        if = { limit = { has_character_flag = had_event_harm_1042 } remove_character_flag = had_event_harm_1042 }
        if = { limit = { has_character_flag = had_event_harm_1051 } remove_character_flag = had_event_harm_1051 }
        if = { limit = { has_character_flag = had_event_harm_1052 } remove_character_flag = had_event_harm_1052 }
        if = { limit = { has_character_flag = had_event_harm_1061 } remove_character_flag = had_event_harm_1061 }
        if = { limit = { has_character_flag = had_event_harm_1062 } remove_character_flag = had_event_harm_1062 }
        if = { limit = { has_character_flag = had_event_harm_1071 } remove_character_flag = had_event_harm_1071 }
        if = { limit = { has_character_flag = had_event_harm_1072 } remove_character_flag = had_event_harm_1072 }
        if = { limit = { has_character_flag = had_event_harm_1081 } remove_character_flag = had_event_harm_1081 }
        if = { limit = { has_character_flag = had_event_harm_1082 } remove_character_flag = had_event_harm_1082 }
        if = { limit = { has_character_flag = had_event_harm_1091 } remove_character_flag = had_event_harm_1091 }
        if = { limit = { has_character_flag = had_event_harm_1092 } remove_character_flag = had_event_harm_1092 }
        if = { limit = { has_character_flag = had_event_harm_1101 } remove_character_flag = had_event_harm_1101 }
        if = { limit = { has_character_flag = had_event_harm_1102 } remove_character_flag = had_event_harm_1102 }
        if = { limit = { has_character_flag = had_event_harm_1111 } remove_character_flag = had_event_harm_1111 }
        if = { limit = { has_character_flag = had_event_harm_1112 } remove_character_flag = had_event_harm_1112 }
        remove_all_character_modifier_instances = infected_wound_modifier
        remove_all_character_modifier_instances = gangrene_modifier
        remove_all_character_modifier_instances = rejected_from_marriage_bed_modifier
        remove_all_character_modifier_instances = safe_disease_treatment_failure_modifier
        remove_all_character_modifier_instances = risky_disease_treatment_failure_modifier
        remove_all_character_modifier_instances = safe_wound_treatment_failure_modifier
        remove_all_character_modifier_instances = risky_wound_treatment_failure_modifier
        remove_all_character_modifier_instances = chastised_physician_modifier
        remove_all_character_modifier_instances = exhausted_modifier
        remove_all_character_modifier_instances = low_social_energy_modifier
        remove_all_character_modifier_instances = lunatic_made_of_glass_modifier
        remove_all_character_modifier_instances = lunatic_bat_ravings_modifier
        remove_all_character_modifier_instances = wounds_quickly_tended_to_modifier
        remove_all_character_modifier_instances = drank_water_modifier
        remove_all_character_modifier_instances = almost_drowned_modifier
        remove_all_character_modifier_instances = malnourished_modifier
        remove_all_character_modifier_instances = obese_modifier
        remove_all_character_modifier_instances = gaining_weight_modifier
        remove_all_character_modifier_instances = losing_weight_modifier
        remove_all_character_modifier_instances = travel_choke_on_a_bone_modifier
        remove_all_character_modifier_instances = travel_sore_muscles_modifier
        remove_all_character_modifier_instances = travel_rich_dining_modifier
        remove_all_character_modifier_instances = travel_mild_frostbite_modifier
        remove_all_character_modifier_instances = travel_severe_frostbite_modifier
        remove_all_character_modifier_instances = travel_ate_poisonous_plant_modifier
        remove_all_character_modifier_instances = travel_touched_poisonous_plant_modifier
        remove_all_character_modifier_instances = drained_by_mosquitoes_modifier
        remove_all_character_modifier_instances = emaciated_modifier
        remove_all_character_modifier_instances = travel_stealing_food_modifier
    }
}

DI_remove_health_conflict_effect = {
    if = { limit = { has_trait = beauty_bad_1 } remove_trait = beauty_bad_1 }
    if = { limit = { has_trait = beauty_bad_2 } remove_trait = beauty_bad_2 }
    if = { limit = { has_trait = beauty_bad_3 } remove_trait = beauty_bad_3 }
    if = { limit = { has_trait = beauty_good_1 } remove_trait = beauty_good_1 }
    if = { limit = { has_trait = beauty_good_2 } remove_trait = beauty_good_2 }
    if = { limit = { has_trait = intellect_bad_1 } remove_trait = intellect_bad_1 }
    if = { limit = { has_trait = intellect_bad_2 } remove_trait = intellect_bad_2 }
    if = { limit = { has_trait = intellect_bad_3 } remove_trait = intellect_bad_3 }
    if = { limit = { has_trait = intellect_good_1 } remove_trait = intellect_good_1 }
    if = { limit = { has_trait = intellect_good_2 } remove_trait = intellect_good_2 }
    if = { limit = { has_trait = physique_bad_1 } remove_trait = physique_bad_1 }
    if = { limit = { has_trait = physique_bad_2 } remove_trait = physique_bad_2 }
    if = { limit = { has_trait = physique_bad_3 } remove_trait = physique_bad_3 }
    if = { limit = { has_trait = physique_good_1 } remove_trait = physique_good_1 }
    if = { limit = { has_trait = physique_good_2 } remove_trait = physique_good_2 }
    if = { limit = { has_trait = clubfooted } remove_trait = clubfooted }
    if = { limit = { has_trait = hunchbacked } remove_trait = hunchbacked }
    if = { limit = { has_trait = lisping } remove_trait = lisping }
    if = { limit = { has_trait = stuttering } remove_trait = stuttering }
    if = { limit = { has_trait = dwarf } remove_trait = dwarf }
    if = { limit = { has_trait = giant } remove_trait = giant }
    if = { limit = { has_trait = inbred } remove_trait = inbred }
    if = { limit = { has_trait = weak } remove_trait = weak }
    if = { limit = { has_trait = dull } remove_trait = dull }
    if = { limit = { has_trait = impotent } remove_trait = impotent }
    if = { limit = { has_trait = spindly } remove_trait = spindly }
    if = { limit = { has_trait = scaly } remove_trait = scaly }
    if = { limit = { has_trait = wheezing } remove_trait = wheezing }
    if = { limit = { has_trait = bleeder } remove_trait = bleeder }
    if = { limit = { has_trait = infertile } remove_trait = infertile }
}

#remove health conflicts other than worst traits (for bad genes present only)
DI_remove_health_conflict_forbadgene_effect = {
    if = { limit = { has_trait = beauty_bad_1 } remove_trait = beauty_bad_1 }
    if = { limit = { has_trait = beauty_bad_2 } remove_trait = beauty_bad_2 }
    if = { limit = { has_trait = beauty_good_1 } remove_trait = beauty_good_1 }
    if = { limit = { has_trait = beauty_good_2 } remove_trait = beauty_good_2 }
    if = { limit = { has_trait = intellect_bad_1 } remove_trait = intellect_bad_1 }
    if = { limit = { has_trait = intellect_bad_2 } remove_trait = intellect_bad_2 }
    if = { limit = { has_trait = intellect_good_1 } remove_trait = intellect_good_1 }
    if = { limit = { has_trait = intellect_good_2 } remove_trait = intellect_good_2 }
    if = { limit = { has_trait = physique_bad_1 } remove_trait = physique_bad_1 }
    if = { limit = { has_trait = physique_bad_2 } remove_trait = physique_bad_2 }
    if = { limit = { has_trait = physique_good_1 } remove_trait = physique_good_1 }
    if = { limit = { has_trait = physique_good_2 } remove_trait = physique_good_2 }
}

#add best education traits
DI_add_education_traits_effect = {
    if = { limit = { NOT = { has_trait = education_learning_5 } } add_trait = education_learning_5 }
    if = { limit = { NOT = { has_trait = education_intrigue_5 } } add_trait = education_intrigue_5 }
    if = { limit = { NOT = { has_trait = education_diplomacy_5 } } add_trait = education_diplomacy_5 }
    if = { limit = { NOT = { has_trait = education_stewardship_5 } } add_trait = education_stewardship_5 }
    if = { limit = { NOT = { has_trait = education_martial_5 } } add_trait = education_martial_5 }
}

#remove all Education traits
DI_remove_education_traits_effect = {
    if = { limit = { has_trait = education_learning_1 } remove_trait = education_learning_1 }
    if = { limit = { has_trait = education_learning_2 } remove_trait = education_learning_2 }
    if = { limit = { has_trait = education_learning_3 } remove_trait = education_learning_3 }
    if = { limit = { has_trait = education_learning_4 } remove_trait = education_learning_4 }
    if = { limit = { has_trait = education_learning_5 } remove_trait = education_learning_5 }
    if = { limit = { has_trait = education_intrigue_1 } remove_trait = education_intrigue_1 }
    if = { limit = { has_trait = education_intrigue_2 } remove_trait = education_intrigue_2 }
    if = { limit = { has_trait = education_intrigue_3 } remove_trait = education_intrigue_3 }
    if = { limit = { has_trait = education_intrigue_4 } remove_trait = education_intrigue_4 }
    if = { limit = { has_trait = education_intrigue_5 } remove_trait = education_intrigue_5 }
    if = { limit = { has_trait = education_diplomacy_1 } remove_trait = education_diplomacy_1 }
    if = { limit = { has_trait = education_diplomacy_2 } remove_trait = education_diplomacy_2 }
    if = { limit = { has_trait = education_diplomacy_3 } remove_trait = education_diplomacy_3 }
    if = { limit = { has_trait = education_diplomacy_4 } remove_trait = education_diplomacy_4 }
    if = { limit = { has_trait = education_diplomacy_5 } remove_trait = education_diplomacy_5 }
    if = { limit = { has_trait = education_stewardship_1 } remove_trait = education_stewardship_1 }
    if = { limit = { has_trait = education_stewardship_2 } remove_trait = education_stewardship_2 }
    if = { limit = { has_trait = education_stewardship_3 } remove_trait = education_stewardship_3 }
    if = { limit = { has_trait = education_stewardship_4 } remove_trait = education_stewardship_4 }
    if = { limit = { has_trait = education_stewardship_5 } remove_trait = education_stewardship_5 }
    if = { limit = { has_trait = education_martial_1 } remove_trait = education_martial_1 }
    if = { limit = { has_trait = education_martial_2 } remove_trait = education_martial_2 }
    if = { limit = { has_trait = education_martial_3 } remove_trait = education_martial_3 }
    if = { limit = { has_trait = education_martial_4 } remove_trait = education_martial_4 }
    if = { limit = { has_trait = education_martial_5 } remove_trait = education_martial_5 }
}

#boost education traits to best level
DI_boost_education_traits_effect = {
    if = { limit = { has_trait = education_learning_1 } remove_trait = education_learning_1 add_trait = education_learning_5 }
    if = { limit = { has_trait = education_learning_2 } remove_trait = education_learning_2 add_trait = education_learning_5 }
    if = { limit = { has_trait = education_learning_3 } remove_trait = education_learning_3 add_trait = education_learning_5 }
    if = { limit = { has_trait = education_learning_4 } remove_trait = education_learning_4 add_trait = education_learning_5 }
    if = { limit = { has_trait = education_intrigue_1 } remove_trait = education_intrigue_1 add_trait = education_intrigue_5 }
    if = { limit = { has_trait = education_intrigue_2 } remove_trait = education_intrigue_2 add_trait = education_intrigue_5 }
    if = { limit = { has_trait = education_intrigue_3 } remove_trait = education_intrigue_3 add_trait = education_intrigue_5 }
    if = { limit = { has_trait = education_intrigue_4 } remove_trait = education_intrigue_4 add_trait = education_intrigue_5 }
    if = { limit = { has_trait = education_diplomacy_1 } remove_trait = education_diplomacy_1 add_trait = education_diplomacy_5 }
    if = { limit = { has_trait = education_diplomacy_2 } remove_trait = education_diplomacy_2 add_trait = education_diplomacy_5 }
    if = { limit = { has_trait = education_diplomacy_3 } remove_trait = education_diplomacy_3 add_trait = education_diplomacy_5 }
    if = { limit = { has_trait = education_diplomacy_4 } remove_trait = education_diplomacy_4 add_trait = education_diplomacy_5 }
    if = { limit = { has_trait = education_stewardship_1 } remove_trait = education_stewardship_1 add_trait = education_stewardship_5 }
    if = { limit = { has_trait = education_stewardship_2 } remove_trait = education_stewardship_2 add_trait = education_stewardship_5 }
    if = { limit = { has_trait = education_stewardship_3 } remove_trait = education_stewardship_3 add_trait = education_stewardship_5 }
    if = { limit = { has_trait = education_stewardship_4 } remove_trait = education_stewardship_4 add_trait = education_stewardship_5 }
    if = { limit = { has_trait = education_martial_1 } remove_trait = education_martial_1 add_trait = education_martial_5 }
    if = { limit = { has_trait = education_martial_2 } remove_trait = education_martial_2 add_trait = education_martial_5 }
    if = { limit = { has_trait = education_martial_3 } remove_trait = education_martial_3 add_trait = education_martial_5 }
    if = { limit = { has_trait = education_martial_4 } remove_trait = education_martial_4 add_trait = education_martial_5 }
}


# add auxillary traits fitting for education
DI_boost_education_extra_traits_effect = {
    if = {
        limit = {
            OR = {
                has_trait = education_learning_1
                has_trait = education_learning_2
                has_trait = education_learning_3
                has_trait = education_learning_4
                has_trait = education_learning_5
            }
        }
        add_trait = lifestyle_herbalist
        add_trait = lifestyle_mystic
    }
    if = {
        limit = {
            OR = {
                has_trait = education_intrigue_1
                has_trait = education_intrigue_2
                has_trait = education_intrigue_3
                has_trait = education_intrigue_4
                has_trait = education_intrigue_5
            }
        }
        add_trait = lifestyle_herbalist
        add_trait = lifestyle_mystic
        add_trait = lifestyle_blademaster
    }
    if = {
        limit = {
            OR = {
                has_trait = education_diplomacy_1
                has_trait = education_diplomacy_2
                has_trait = education_diplomacy_3
                has_trait = education_diplomacy_4
                has_trait = education_diplomacy_5
            }
        }
        add_trait = lifestyle_reveler
        add_trait = lifestyle_poet
    }
    if = {
        limit = {
            OR = {
                has_trait = education_stewardship_1
                has_trait = education_stewardship_2
                has_trait = education_stewardship_3
                has_trait = education_stewardship_4
                has_trait = education_stewardship_5
            }
        }
        add_trait = lifestyle_gardener
        add_trait = lifestyle_poet
    }
    if = {
        limit = {
            OR = {
                has_trait = education_martial_1
                has_trait = education_martial_2
                has_trait = education_martial_3
                has_trait = education_martial_4
                has_trait = education_martial_5
            }
        }
        add_trait = lifestyle_blademaster
        add_trait = lifestyle_hunter
        add_trait = education_martial_prowess_4
    }
    if = { limit = { has_trait = education_martial_prowess_1 } remove_trait = education_martial_prowess_1 add_trait = education_martial_prowess_4 }
    if = { limit = { has_trait = education_martial_prowess_2 } remove_trait = education_martial_prowess_2 add_trait = education_martial_prowess_4 }
    if = { limit = { has_trait = education_martial_prowess_3 } remove_trait = education_martial_prowess_3 add_trait = education_martial_prowess_4 }
    if = { limit = { has_trait = lifestyle_blademaster } add_trait_xp = { trait = lifestyle_blademaster value = 100 } }
    if = { limit = { has_trait = lifestyle_mystic } add_trait_xp = { trait = lifestyle_mystic value = 100 } }
    if = { limit = { has_trait = lifestyle_hunter } add_trait_xp = { trait = lifestyle_hunter track = Venator value = 100 } }
    if = { limit = { has_trait = lifestyle_hunter } add_trait_xp = { trait = lifestyle_hunter track = Falconer value = 100 } }
    if = { limit = { has_trait = lifestyle_reveler } add_trait_xp = { trait = lifestyle_reveler value = 100 } }
}