namespace = perf_patch

event = {
    id = perf_patch.1
    type = character_event
    hidden = yes
    is_triggered_only = yes

    trigger = {
        is_ai = yes
        has_court = yes
    }
    immediate = {
        every_courtier = {
            limit = {
                is_alive = yes
                NOT = { has_landed_title = yes }
                age >= 40
                NOT = { has_trait = trait_intellect_good_3 }
                NOT = { has_trait = trait_intellect_good_2 }
                NOT = { has_trait = trait_strong }
                NOT = { has_trait = hero }
                NOT = { has_any_court_position = yes }
                NOT = { is_involved_in_any_plot = yes }
                num_of_living_children >= 5
            }
            death = {
                death_reason = death_natural_causes
            }
        }
    }
}