﻿acs_switch_filter = {
    $CANDIDATE$ = {
        switch = {
            trigger = $FILTER$
            0 = {
                global_var:acs_gv_main_filters = {
                    any_in_global_list = {
                        variable = acs_gvl_filter_trait_education_general_reduced
                        save_temporary_scope_as = filter2
                        $CANDIDATE$ = {
                            switch = {
                                trigger = scope:filter2
                                0 = { has_trait = education_intrigue_1 }
                                1 = { NOT = { has_trait = education_intrigue_1 } }
                                2 = { has_trait = education_intrigue_2 }
                                3 = { NOT = { has_trait = education_intrigue_2 } }
                                4 = { has_trait = education_intrigue_3 }
                                5 = { NOT = { has_trait = education_intrigue_3 } }
                                6 = { has_trait = education_intrigue_4 }
                                7 = { NOT = { has_trait = education_intrigue_4 } }
                                8 = { has_trait = education_intrigue_5 }
                                9 = { NOT = { has_trait = education_intrigue_5 } }

                                10 = { has_trait = education_diplomacy_1 }
                                11 = { NOT = { has_trait = education_diplomacy_1 } }
                                12 = { has_trait = education_diplomacy_2 }
                                13 = { NOT = { has_trait = education_diplomacy_2 } }
                                14 = { has_trait = education_diplomacy_3 }
                                15 = { NOT = { has_trait = education_diplomacy_3 } }
                                16 = { has_trait = education_diplomacy_4 }
                                17 = { NOT = { has_trait = education_diplomacy_4 } }
                                18 = { has_trait = education_diplomacy_5 }
                                19 = { NOT = { has_trait = education_diplomacy_5 } }

                                20 = { has_trait = education_stewardship_1 }
                                21 = { NOT = { has_trait = education_stewardship_1 } }
                                22 = { has_trait = education_stewardship_2 }
                                23 = { NOT = { has_trait = education_stewardship_2 } }
                                24 = { has_trait = education_stewardship_3 }
                                25 = { NOT = { has_trait = education_stewardship_3 } }
                                26 = { has_trait = education_stewardship_4 }
                                27 = { NOT = { has_trait = education_stewardship_4 } }
                                28 = { has_trait = education_stewardship_5 }
                                29 = { NOT = { has_trait = education_stewardship_5 } }

                                30 = { has_trait = education_martial_1 }
                                31 = { NOT = { has_trait = education_martial_1 } }
                                32 = { has_trait = education_martial_2 }
                                33 = { NOT = { has_trait = education_martial_2 } }
                                34 = { has_trait = education_martial_3 }
                                35 = { NOT = { has_trait = education_martial_3 } }
                                36 = { has_trait = education_martial_4 }
                                37 = { NOT = { has_trait = education_martial_4 } }
                                38 = { has_trait = education_martial_5 }
                                39 = { NOT = { has_trait = education_martial_5 } }

                                40 = { has_trait = education_learning_1 }
                                41 = { NOT = { has_trait = education_learning_1 } }
                                42 = { has_trait = education_learning_2 }
                                43 = { NOT = { has_trait = education_learning_2 } }
                                44 = { has_trait = education_learning_3 }
                                45 = { NOT = { has_trait = education_learning_3 } }
                                46 = { has_trait = education_learning_4 }
                                47 = { NOT = { has_trait = education_learning_4 } }
                                48 = { has_trait = education_learning_5 }
                                49 = { NOT = { has_trait = education_learning_5 } }
                            }
                        }
                        count = global_var:acs_gv_filter_trait_education_general_count
                    }
                }
            }
            1 = {
                global_var:acs_gv_main_filters = {
                    any_in_global_list = {
                        variable = acs_gvl_filter_trait_education_martial_reduced
                        save_temporary_scope_as = filter2
                        $CANDIDATE$ = {
                            switch = {
                                trigger = scope:filter2
                                0 = { has_trait = education_martial_prowess_1 }
                                1 = { NOT = { has_trait = education_martial_prowess_1 } }
                                2 = { has_trait = education_martial_prowess_2 }
                                3 = { NOT = { has_trait = education_martial_prowess_2 } }
                                4 = { has_trait = education_martial_prowess_3 }
                                5 = { NOT = { has_trait = education_martial_prowess_3 } }
                                6 = { has_trait = education_martial_prowess_4 }
                                7 = { NOT = { has_trait = education_martial_prowess_4 } }
                            }
                        }
                        count = global_var:acs_gv_filter_trait_education_martial_count
                    }
                }
            }
            2 = { has_trait = chaste }
            3 = { NOT = { has_trait = chaste } }
            4 = { has_trait = lustful }
            5 = {
                OR = {
                    has_trait = lustful
                    has_trait = chaste
                }
            }
            6 = { has_trait = lustful }
            7 = { NOT = { has_trait = lustful } }
            8 = { has_trait = chaste }
            9 = {
                AND = {
                    NOT = { has_trait = lustful }
                    NOT = { has_trait = chaste }
                }
            }
            10 = { has_trait = temperate }
            11 = { NOT = { has_trait = temperate } }
            12 = { has_trait = gluttonous }
            13 = {
                OR = {
                    has_trait = gluttonous
                    has_trait = temperate
                }
            }
            14 = { has_trait = gluttonous }
            15 = { NOT = { has_trait = gluttonous } }
            16 = { has_trait = temperate }
            17 = {
                AND = {
                    NOT = { has_trait = gluttonous }
                    NOT = { has_trait = temperate }
                }
            }
            18 = { has_trait = generous }
            19 = { NOT = { has_trait = generous } }
            20 = { has_trait = greedy }
            21 = {
                OR = {
                    has_trait = greedy
                    has_trait = generous
                }
            }
            22 = { has_trait = greedy }
            23 = { NOT = { has_trait = greedy } }
            24 = { has_trait = generous }
            25 = {
                AND = {
                    NOT = { has_trait = greedy }
                    NOT = { has_trait = generous }
                }
            }
            26 = { has_trait = diligent }
            27 = { NOT = { has_trait = diligent } }
            28 = { has_trait = lazy }
            29 = {
                OR = {
                    has_trait = lazy
                    has_trait = diligent
                }
            }
            30 = { has_trait = lazy }
            31 = { NOT = { has_trait = lazy } }
            32 = { has_trait = diligent }
            33 = {
                AND = {
                    NOT = { has_trait = lazy }
                    NOT = { has_trait = diligent }
                }
            }
            34 = { has_trait = calm }
            35 = { NOT = { has_trait = calm } }
            36 = { has_trait = wrathful }
            37 = {
                OR = {
                    has_trait = wrathful
                    has_trait = calm
                }
            }
            38 = { has_trait = wrathful }
            39 = { NOT = { has_trait = wrathful } }
            40 = { has_trait = calm }
            41 = {
                AND = {
                    NOT = { has_trait = wrathful }
                    NOT = { has_trait = calm }
                }
            }
            42 = { has_trait = impatient }
            43 = { NOT = { has_trait = impatient } }
            44 = { has_trait = patient }
            45 = {
                OR = {
                    has_trait = patient
                    has_trait = impatient
                }
            }
            46 = { has_trait = patient }
            47 = { NOT = { has_trait = patient } }
            48 = { has_trait = impatient }
            49 = {
                AND = {
                    NOT = { has_trait = patient }
                    NOT = { has_trait = impatient }
                }
            }
            50 = { has_trait = humble }
            51 = { NOT = { has_trait = humble } }
            52 = { has_trait = arrogant }
            53 = {
                OR = {
                    has_trait = arrogant
                    has_trait = humble
                }
            }
            54 = { has_trait = arrogant }
            55 = { NOT = { has_trait = arrogant } }
            56 = { has_trait = humble }
            57 = {
                AND = {
                    NOT = { has_trait = arrogant }
                    NOT = { has_trait = humble }
                }
            }
            58 = { has_trait = honest }
            59 = { NOT = { has_trait = honest } }
            60 = { has_trait = deceitful }
            61 = {
                OR = {
                    has_trait = deceitful
                    has_trait = honest
                }
            }
            62 = { has_trait = deceitful }
            63 = { NOT = { has_trait = deceitful } }
            64 = { has_trait = honest }
            65 = {
                AND = {
                    NOT = { has_trait = deceitful }
                    NOT = { has_trait = honest }
                }
            }
            66 = { has_trait = brave }
            67 = { NOT = { has_trait = brave } }
            68 = { has_trait = craven }
            69 = {
                OR = {
                    has_trait = craven
                    has_trait = brave
                }
            }
            70 = { has_trait = craven }
            71 = { NOT = { has_trait = craven } }
            72 = { has_trait = brave }
            73 = {
                AND = {
                    NOT = { has_trait = craven }
                    NOT = { has_trait = brave }
                }
            }
            74 = { has_trait = gregarious }
            75 = { NOT = { has_trait = gregarious } }
            76 = { has_trait = shy }
            77 = {
                OR = {
                    has_trait = shy
                    has_trait = gregarious
                }
            }
            78 = { has_trait = shy }
            79 = { NOT = { has_trait = shy } }
            80 = { has_trait = gregarious }
            81 = {
                AND = {
                    NOT = { has_trait = shy }
                    NOT = { has_trait = gregarious }
                }
            }
            82 = { has_trait = content }
            83 = { NOT = { has_trait = content } }
            84 = { has_trait = ambitious }
            85 = {
                OR = {
                    has_trait = ambitious
                    has_trait = content
                }
            }
            86 = { has_trait = ambitious }
            87 = { NOT = { has_trait = ambitious } }
            88 = { has_trait = content }
            89 = {
                AND = {
                    NOT = { has_trait = ambitious }
                    NOT = { has_trait = content }
                }
            }
            90 = { has_trait = just }
            91 = { NOT = { has_trait = just } }
            92 = { has_trait = arbitrary }
            93 = {
                OR = {
                    has_trait = arbitrary
                    has_trait = just
                }
            }
            94 = { has_trait = arbitrary }
            95 = { NOT = { has_trait = arbitrary } }
            96 = { has_trait = just }
            97 = {
                AND = {
                    NOT = { has_trait = arbitrary }
                    NOT = { has_trait = just }
                }
            }
            98 = { has_trait = zealous }
            99 = { NOT = { has_trait = zealous } }
            100 = { has_trait = cynical }
            101 = {
                OR = {
                    has_trait = cynical
                    has_trait = zealous
                }
            }
            102 = { has_trait = cynical }
            103 = { NOT = { has_trait = cynical } }
            104 = { has_trait = zealous }
            105 = {
                AND = {
                    NOT = { has_trait = cynical }
                    NOT = { has_trait = zealous }
                }
            }
            106 = { has_trait = trusting }
            107 = { NOT = { has_trait = trusting } }
            108 = { has_trait = paranoid }
            109 = {
                OR = {
                    has_trait = paranoid
                    has_trait = trusting
                }
            }
            110 = { has_trait = paranoid }
            111 = { NOT = { has_trait = paranoid } }
            112 = { has_trait = trusting }
            113 = {
                AND = {
                    NOT = { has_trait = paranoid }
                    NOT = { has_trait = trusting }
                }
            }
            114 = { has_trait = sadistic }
            115 = { NOT = { has_trait = sadistic } }
            116 = { has_trait = callous }
            117 = {
                OR = {
                    has_trait = callous
                    has_trait = sadistic
                }
            }
            118 = { has_trait = callous }
            119 = { NOT = { has_trait = callous } }
            120 = { has_trait = sadistic }
            121 = {
                AND = {
                    NOT = { has_trait = callous }
                    NOT = { has_trait = sadistic }
                }
            }
            122 = { has_trait = compassionate }
            123 = {
                OR = {
                    has_trait = compassionate
                    has_trait = sadistic
                }
            }
            124 = { has_trait = compassionate }
            125 = {
                OR = {
                    has_trait = compassionate
                    has_trait = callous
                }
            }
            126 = {
                OR = {
                    has_trait = compassionate
                    has_trait = callous
                    has_trait = sadistic
                }
            }
            127 = {
                OR = {
                    has_trait = compassionate
                    has_trait = callous
                }
            }
            128 = { has_trait = compassionate }
            129 = {
                OR = {
                    has_trait = compassionate
                    has_trait = sadistic
                }
            }
            130 = { has_trait = compassionate }
            131 = { NOT = { has_trait = compassionate } }
            132 = { has_trait = sadistic }
            133 = {
                AND = {
                    NOT = { has_trait = compassionate }
                    NOT = { has_trait = sadistic }
                }
            }
            134 = { has_trait = callous }
            135 = {
                OR = {
                    has_trait = callous
                    has_trait = sadistic
                }
            }
            136 = { has_trait = callous }
            137 = {
                AND = {
                    NOT = { has_trait = compassionate }
                    NOT = { has_trait = callous }
                }
            }
            138 = { has_trait = sadistic }
            139 = {
                AND = {
                    NOT = { has_trait = compassionate }
                    NOT = { has_trait = callous }
                    NOT = { has_trait = sadistic }
                }
            }
            140 = { has_trait = fickle }
            141 = { NOT = { has_trait = fickle } }
            142 = { has_trait = stubborn }
            143 = {
                OR = {
                    has_trait = stubborn
                    has_trait = fickle
                }
            }
            144 = { has_trait = stubborn }
            145 = { NOT = { has_trait = stubborn } }
            146 = { has_trait = fickle }
            147 = {
                AND = {
                    NOT = { has_trait = stubborn }
                    NOT = { has_trait = fickle }
                }
            }
            148 = { has_trait = forgiving }
            149 = { NOT = { has_trait = forgiving } }
            150 = { has_trait = vengeful }
            151 = {
                OR = {
                    has_trait = vengeful
                    has_trait = forgiving
                }
            }
            152 = { has_trait = vengeful }
            153 = { NOT = { has_trait = vengeful } }
            154 = { has_trait = forgiving }
            155 = {
                AND = {
                    NOT = { has_trait = vengeful }
                    NOT = { has_trait = forgiving }
                }
            }
            156 = {
                global_var:acs_gv_main_filters = {
                    any_in_global_list = {
                        variable = acs_gvl_filter_trait_fame_born_status_reduced
                        save_temporary_scope_as = filter2
                        $CANDIDATE$ = {
                            switch = {
                                trigger = scope:filter2
                                0 = { has_trait = bastard }
                                1 = { NOT = { has_trait = bastard } }
                                2 = { has_trait = legitimized_bastard }
                                3 = { NOT = { has_trait = legitimized_bastard } }
                                4 = { has_trait = disputed_heritage }
                                5 = { NOT = { has_trait = disputed_heritage } }
                                6 = { has_trait = child_of_concubine_female }
                                7 = { NOT = { has_trait = child_of_concubine_female } }
                                8 = { has_trait = child_of_concubine_male }
                                9 = { NOT = { has_trait = child_of_concubine_male } }
                                10 = { has_trait = wild_oat }
                                11 = { NOT = { has_trait = wild_oat } }
                                12 = { has_trait = bastard_founder }
                                13 = { NOT = { has_trait = bastard_founder } }
                            }
                        }
                        count = global_var:acs_gv_filter_trait_fame_born_status_count
                    }
                }
            }
            157 = { has_trait = kinslayer_3 }
            158 = { NOT = { has_trait = kinslayer_3 } }
            159 = { has_trait = kinslayer_2 }
            160 = {
                OR = {
                    has_trait = kinslayer_2
                    has_trait = kinslayer_3
                }
            }
            161 = { has_trait = kinslayer_2 }
            162 = { NOT = { has_trait = kinslayer_2 } }
            163 = { has_trait = kinslayer_3 }
            164 = {
                AND = {
                    NOT = { has_trait = kinslayer_2 }
                    NOT = { has_trait = kinslayer_3 }
                }
            }
            165 = { has_trait = kinslayer_1 }
            166 = {
                OR = {
                    has_trait = kinslayer_1
                    has_trait = kinslayer_3
                }
            }
            167 = { has_trait = kinslayer_1 }
            168 = {
                OR = {
                    has_trait = kinslayer_1
                    has_trait = kinslayer_2
                }
            }
            169 = {
                OR = {
                    has_trait = kinslayer_1
                    has_trait = kinslayer_2
                    has_trait = kinslayer_3
                }
            }
            170 = {
                OR = {
                    has_trait = kinslayer_1
                    has_trait = kinslayer_2
                }
            }
            171 = { has_trait = kinslayer_1 }
            172 = {
                OR = {
                    has_trait = kinslayer_1
                    has_trait = kinslayer_3
                }
            }
            173 = { has_trait = kinslayer_1 }
            174 = { NOT = { has_trait = kinslayer_1 } }
            175 = { has_trait = kinslayer_3 }
            176 = {
                AND = {
                    NOT = { has_trait = kinslayer_1 }
                    NOT = { has_trait = kinslayer_3 }
                }
            }
            177 = { has_trait = kinslayer_2 }
            178 = {
                OR = {
                    has_trait = kinslayer_2
                    has_trait = kinslayer_3
                }
            }
            179 = { has_trait = kinslayer_2 }
            180 = {
                AND = {
                    NOT = { has_trait = kinslayer_1 }
                    NOT = { has_trait = kinslayer_2 }
                }
            }
            181 = { has_trait = kinslayer_3 }
            182 = {
                AND = {
                    NOT = { has_trait = kinslayer_1 }
                    NOT = { has_trait = kinslayer_2 }
                    NOT = { has_trait = kinslayer_3 }
                }
            }
            183 = { has_trait = berserker  }
            184 = { NOT = { has_trait = berserker } }
            185 = { has_trait = shieldmaiden  }
            186 = { NOT = { has_trait = shieldmaiden } }
            187 = { has_trait = varangian  }
            188 = { NOT = { has_trait = varangian } }
            191 = { has_trait = twin  }
            192 = { NOT = { has_trait = twin } }
            193 = { has_trait = deviant  }
            194 = { NOT = { has_trait = deviant } }
            195 = { has_trait = cannibal  }
            196 = { NOT = { has_trait = cannibal } }
            197 = { has_trait = sodomite  }
            198 = { NOT = { has_trait = sodomite } }
            199 = { has_trait = incestuous  }
            200 = { NOT = { has_trait = incestuous } }
            201 = { has_trait = adulterer  }
            202 = { NOT = { has_trait = adulterer } }
            203 = { has_trait = fornicator  }
            204 = { NOT = { has_trait = fornicator } }
            205 = { has_trait = murderer  }
            206 = { NOT = { has_trait = murderer } }
            207 = { has_trait = born_in_the_purple  }
            208 = { NOT = { has_trait = born_in_the_purple } }
            209 = { has_trait = augustus  }
            210 = { NOT = { has_trait = augustus } }
            211 = { has_trait = viking  }
            212 = { NOT = { has_trait = viking } }
            213 = { has_trait = reincarnation  }
            214 = { NOT = { has_trait = reincarnation } }
            215 = { has_trait = adventurer  }
            216 = { NOT = { has_trait = adventurer } }
            217 = { has_trait = heresiarch  }
            218 = { NOT = { has_trait = heresiarch } }
            221 = { has_trait = witch  }
            222 = { NOT = { has_trait = witch } }
            223 = { has_trait = disinherited  }
            224 = { NOT = { has_trait = disinherited } }
            225 = { has_trait = denounced  }
            226 = { NOT = { has_trait = denounced } }
            227 = { has_trait = chakravarti  }
            228 = { NOT = { has_trait = chakravarti } }
            229 = { has_trait = greatest_of_khans  }
            230 = { NOT = { has_trait = greatest_of_khans } }

            ###
            240 = { has_trait = measles }
            241 = { NOT = { has_trait = measles } }
            242 = { has_trait = dysentery } # Bloody Flux
            243 = { NOT = { has_trait = dysentery } }
            244 = { has_trait = ergotism } # Holy Fire
            245 = { NOT = { has_trait = ergotism } }

            ###
            # Infertility traits
            246 = { has_trait = impotent }
            247 = { NOT = { has_trait = impotent } }
            248 = { has_trait = infertile }
            249 = { NOT = { has_trait = infertile } }

            ###
            # Old age traits
            250 = { has_trait = fragile_bones }
            251 = { NOT = { has_trait = fragile_bones } }
            252 = { has_trait = faltering_heart }
            253 = { NOT = { has_trait = faltering_heart } }
            254 = { has_trait = clouded_eyes }
            255 = { NOT = { has_trait = clouded_eyes } }
            256 = { has_trait = withering_mind }
            257 = { NOT = { has_trait = withering_mind } }

            ###
            # Religious traits
            258 = { has_trait = hajjaj }
            259 = { NOT = { has_trait = hajjaj } }

            ### 
            # Genetic mental traits
            260 = { has_trait = depressed_genetic }
            261 = { NOT = { has_trait = depressed_genetic } }
            262 = { has_trait = lunatic_genetic }
            263 = { NOT = { has_trait = lunatic_genetic } }
            264 = { has_trait = possessed_genetic}
            265 = { NOT = { has_trait = possessed_genetic } }

            ###
            # Fame traits
            266 = { has_trait = legend }
            267 = { NOT = { has_trait = legend } }
            268 = { has_trait = extolled }
            269 = { NOT = { has_trait = extolled } }
            270 = { has_trait = decadent }
            271 = { NOT = { has_trait = decadent } }

            ###
            # Struggle traits
            272 = { has_trait = fp3_struggle_supporter }
            273 = { NOT = { has_trait = fp3_struggle_supporter } }
            274 = { has_trait = fp3_struggle_detractor }
            275 = { NOT = { has_trait = fp3_struggle_detractor } }

            ###
            # Charioteer traits
            276 = { 
                OR = {
                    has_trait = charioteer_red
                    has_trait = charioteer_white
                    has_trait = charioteer_green
                    has_trait = charioteer_blue
                }
            }
            277 = {
                NOR = {
                    has_trait = charioteer_red
                    has_trait = charioteer_white
                    has_trait = charioteer_green
                    has_trait = charioteer_blue
                }
            }
            278 = { has_trait = charioteer_red }
            279 = { NOT = { has_trait = charioteer_red } }
            280 = { has_trait = charioteer_white }
            281 = { NOT = { has_trait = charioteer_white } }
            282 = { has_trait = charioteer_green }
            283 = { NOT = { has_trait = charioteer_green } }
            284 = { has_trait = charioteer_blue }
            285 = { NOT = { has_trait = charioteer_blue } }

            ###
            # Other traits
            286 = { has_trait = the_wake }
            287 = { NOT = { has_trait = the_wake } }
            288 = { has_trait = immortal }
            289 = { NOT = { has_trait = immortal } }

            ###
            # has Relationships
            300 = { 
                OR = {
					any_relation = { type = nemesis }
					any_relation = { type = rival }
                    any_relation = { type = soulmate } 
                    AND = {
                        any_relation = { type = lover }
                        OR = {
                            has_trait = adulterer
                            has_trait = incestuous
                            has_trait = sodomite
                            has_trait = fornicator
                        }
                    }
                    scope:acs_filter_hooks_root = {
                        any_known_secret = {
                            OR = {
                                secret_type = secret_lover
                                secret_type = secret_incest
                                secret_type = secret_homosexual
                                secret_type = secret_disputed_heritage
                                secret_type = secret_unmarried_illegitimate_child
                            }
                            secret_target ?= prev
                        }
                    }
					any_relation = { type = best_friend }
					any_relation = { type = friend }
					any_relation = { type = elder }
					any_relation = { type = guardian }
					any_relation = { type = ward }
					any_relation = { type = disciple }
					any_relation = { type = bully }
					any_relation = { type = victim }
					any_relation = { type = crush }
                    any_relation = { type = mentor }
                }
            }
            301 = { any_relation = { type = nemesis } }
            302 = { any_relation = { type = rival } }
            303 = { any_relation = { type = soulmate } }
            304 = {
                OR = {
                    any_relation = { type = soulmate } 
                    AND = {
                        any_relation = { type = lover }
                        OR = {
                            has_trait = adulterer
                            has_trait = incestuous
                            has_trait = sodomite
                            has_trait = fornicator
                        }
                    }
                    scope:acs_filter_hooks_root = {
                        any_known_secret = {
                            OR = {
                                secret_type = secret_lover
                                secret_type = secret_incest
                                secret_type = secret_homosexual
                                secret_type = secret_disputed_heritage
                                secret_type = secret_unmarried_illegitimate_child
                            }
                            secret_target ?= prev
                        }
                    }
                }
            }
            305 = { any_relation = { type = best_friend } }
            306 = { any_relation = { type = friend } }
            307 = { any_relation = { type = guardian } }
            308 = { any_relation = { type = mentor } }
            309 = { any_relation = { type = ward } }
            310 = { any_relation = { type = disciple } }
            311 = { any_relation = { type = blood_brother } }
            312 = { any_relation = { type = crush } }
            313 = { any_relation = { type = bully } }
            314 = { any_relation = { type = victim } }

            # doesn't have Relationships
            320 = { 
                NOR = {
					any_relation = { type = soulmate }
                    AND = {
                        any_relation = { type = lover }
                        OR = {
                            has_trait = adulterer
                            has_trait = incestuous
                            has_trait = sodomite
                            has_trait = fornicator
                        }
                    }
                    scope:acs_filter_hooks_root = {
                        any_known_secret = {
                            OR = {
                                secret_type = secret_lover
                                secret_type = secret_incest
                                secret_type = secret_homosexual
                                secret_type = secret_disputed_heritage
                                secret_type = secret_unmarried_illegitimate_child
                            }
                            secret_target ?= prev
                        }
                    }
					any_relation = { type = best_friend }
					any_relation = { type = friend }
					any_relation = { type = elder }
					any_relation = { type = guardian }
					any_relation = { type = ward }
					any_relation = { type = rival }
					any_relation = { type = nemesis }
					any_relation = { type = elder }
					any_relation = { type = disciple }
					any_relation = { type = blood_brother }
					any_relation = { type = bully }
					any_relation = { type = victim }
					any_relation = { type = crush }
                }
            }
            321 = { NOT = { any_relation = { type = nemesis } } }
            322 = { NOT = { any_relation = { type = rival } } }
            323 = { NOT = { any_relation = { type = soulmate } } }
            324 = { 
                NOR = {
                    any_relation = { type = soulmate }
                    AND = {
                        any_relation = { type = lover }
                        OR = {
                            has_trait = adulterer
                            has_trait = incestuous
                            has_trait = sodomite
                            has_trait = fornicator
                        }
                    }
                    scope:acs_filter_hooks_root = {
                        any_known_secret = {
                            OR = {
                                secret_type = secret_lover
                                secret_type = secret_incest
                                secret_type = secret_homosexual
                                secret_type = secret_disputed_heritage
                                secret_type = secret_unmarried_illegitimate_child
                            }
                            secret_target ?= prev
                        }
                    }
                }
            }
            325 = { NOT = { any_relation = { type = best_friend } } }
            326 = { NOT = { any_relation = { type = friend } } }
            327 = { NOT = { any_relation = { type = guardian } } }
            328 = { NOT = { any_relation = { type = mentor } } }
            329 = { NOT = { any_relation = { type = ward } } }
            330 = { NOT = { any_relation = { type = student } } }
            331 = { NOT = { any_relation = { type = blood_brother } } }
            332 = { NOT = { any_relation = { type = crush } } }
            333 = { NOT = { any_relation = { type = bully } } }
            334 = { NOT = { any_relation = { type = victim } } }

			###
            395 = { has_trait = diplomat  }
            396 = { NOT = { has_trait = diplomat } }
            397 = { has_trait = family_first  }
            398 = { NOT = { has_trait = family_first } }
            399 = { has_trait = august  }
            400 = { NOT = { has_trait = august } }
            401 = { has_trait = strategist  }
            402 = { NOT = { has_trait = strategist } }
            403 = { has_trait = overseer  }
            404 = { NOT = { has_trait = overseer } }
            405 = { has_trait = gallant  }
            406 = { NOT = { has_trait = gallant } }
            407 = { has_trait = architect  }
            408 = { NOT = { has_trait = architect } }
            409 = { has_trait = administrator  }
            410 = { NOT = { has_trait = administrator } }
            411 = { has_trait = avaricious  }
            412 = { NOT = { has_trait = avaricious } }
            413 = { has_trait = schemer  }
            414 = { NOT = { has_trait = schemer } }
            415 = { has_trait = seducer  }
            416 = { NOT = { has_trait = seducer } }
            417 = { has_trait = torturer  }
            418 = { NOT = { has_trait = torturer } }
            419 = { has_trait = whole_of_body  }
            420 = { NOT = { has_trait = whole_of_body } }
            421 = { has_trait = scholar  }
            422 = { NOT = { has_trait = scholar } }
            423 = { has_trait = theologian  }
            424 = { NOT = { has_trait = theologian } }
            425 = { has_trait = lifestyle_herbalist  }
            426 = { NOT = { has_trait = lifestyle_herbalist } }
            427 = { has_trait = rowdy  }
            428 = { NOT = { has_trait = rowdy } }
            429 = { has_trait = charming  }
            430 = { NOT = { has_trait = charming } }
            431 = { has_trait = curious  }
            432 = { NOT = { has_trait = curious } }
            433 = { has_trait = pensive  }
            434 = { NOT = { has_trait = pensive } }
            435 = { has_trait = bossy  }
            436 = { NOT = { has_trait = bossy } }
            437 = { has_trait = drunkard  }
            438 = { NOT = { has_trait = drunkard } }
            439 = { has_trait = hashishiyah  }
            440 = { NOT = { has_trait = hashishiyah } }
            441 = { has_trait = rakish  }
            442 = { NOT = { has_trait = rakish } }
            443 = { has_trait = reclusive  }
            444 = { NOT = { has_trait = reclusive } }
            445 = { has_trait = irritable  }
            446 = { NOT = { has_trait = irritable } }
            447 = { has_trait = flagellant  }
            448 = { NOT = { has_trait = flagellant } }
            449 = { has_trait = profligate  }
            450 = { NOT = { has_trait = profligate } }
            451 = { has_trait = improvident  }
            452 = { NOT = { has_trait = improvident } }
            453 = { has_trait = contrite  }
            454 = { NOT = { has_trait = contrite } }
            455 = { has_trait = comfort_eater  }
            456 = { NOT = { has_trait = comfort_eater } }
            457 = { has_trait = inappetetic  }
            458 = { NOT = { has_trait = inappetetic } }
            459 = { has_trait = journaller  }
            460 = { NOT = { has_trait = journaller } }
            461 = { has_trait = confider  }
            462 = { NOT = { has_trait = confider } }
            463 = { has_trait = athletic  }
            464 = { NOT = { has_trait = athletic } }
            465 = { has_trait = wounded_3 }
            466 = { NOT = { has_trait = wounded_3 } }
            467 = { has_trait = wounded_2 }
            468 = {
                OR = {
                    has_trait = wounded_2
                    has_trait = wounded_3
                }
            }
            469 = { has_trait = wounded_2 }
            470 = { NOT = { has_trait = wounded_2 } }
            471 = { has_trait = wounded_3 }
            472 = {
                AND = {
                    NOT = { has_trait = wounded_2 }
                    NOT = { has_trait = wounded_3 }
                }
            }
            473 = { has_trait = wounded_1 }
            474 = {
                OR = {
                    has_trait = wounded_1
                    has_trait = wounded_3
                }
            }
            475 = { has_trait = wounded_1 }
            476 = {
                OR = {
                    has_trait = wounded_1
                    has_trait = wounded_2
                }
            }
            477 = {
                OR = {
                    has_trait = wounded_1
                    has_trait = wounded_2
                    has_trait = wounded_3
                }
            }
            478 = {
                OR = {
                    has_trait = wounded_1
                    has_trait = wounded_2
                }
            }
            479 = { has_trait = wounded_1 }
            480 = {
                OR = {
                    has_trait = wounded_1
                    has_trait = wounded_3
                }
            }
            481 = { has_trait = wounded_1 }
            482 = { NOT = { has_trait = wounded_1 } }
            483 = { has_trait = wounded_3 }
            484 = {
                AND = {
                    NOT = { has_trait = wounded_1 }
                    NOT = { has_trait = wounded_3 }
                }
            }
            485 = { has_trait = wounded_2 }
            486 = {
                OR = {
                    has_trait = wounded_2
                    has_trait = wounded_3
                }
            }
            487 = { has_trait = wounded_2 }
            488 = {
                AND = {
                    NOT = { has_trait = wounded_1 }
                    NOT = { has_trait = wounded_2 }
                }
            }
            489 = { has_trait = wounded_3 }
            490 = {
                AND = {
                    NOT = { has_trait = wounded_1 }
                    NOT = { has_trait = wounded_2 }
                    NOT = { has_trait = wounded_3 }
                }
            }
            491 = { has_trait = depressed_1 }
            492 = { NOT = { has_trait = depressed_1 } }
            493 = { has_trait = lunatic_1 }
            494 = { NOT = { has_trait = lunatic_1 } }
            495 = { has_trait = possessed_1 }
            496 = { NOT = { has_trait = possessed_1 } }
            
            497 = { has_trait = ill  }
            498 = { NOT = { has_trait = ill } }
            499 = { has_trait = pneumonic  }
            500 = { NOT = { has_trait = pneumonic } }
            501 = { has_trait = great_pox  }
            502 = { NOT = { has_trait = great_pox } }
            503 = {
                OR = {
                    has_trait = lovers_pox
                    has_trait = early_great_pox
                }
            }
            504 = { 
                NOR = {
                    has_trait = lovers_pox
                    has_trait = early_great_pox
                }
            }
            505 = { has_trait = leper  }
            506 = { NOT = { has_trait = leper } }
            507 = { has_trait = maimed  }
            508 = { NOT = { has_trait = maimed } }
            509 = { has_trait = one_eyed  }
            510 = { NOT = { has_trait = one_eyed } }
            511 = { has_trait = one_legged  }
            512 = { NOT = { has_trait = one_legged } }
            513 = { has_trait = disfigured  }
            514 = { NOT = { has_trait = disfigured } }
            515 = { has_trait = infirm  }
            516 = { NOT = { has_trait = infirm } }
            517 = { has_trait = incapable  }
            518 = { NOT = { has_trait = incapable } }
            519 = { has_trait = gout_ridden  }
            520 = { NOT = { has_trait = gout_ridden } }
            521 = { has_trait = consumption  }
            522 = { NOT = { has_trait = consumption } }
            523 = { has_trait = cancer  }
            524 = { NOT = { has_trait = cancer } }
            525 = { has_trait = typhus  }
            526 = { NOT = { has_trait = typhus } }
            527 = { has_trait = bubonic_plague  }
            528 = { NOT = { has_trait = bubonic_plague } }
            529 = { has_trait = smallpox  }
            530 = { NOT = { has_trait = smallpox } }
            531 = { has_trait = sickly  }
            532 = { NOT = { has_trait = sickly } }

            535 = {
                OR = { 
                    has_trait = eunuch 
                    has_trait = eunuch_1
                }
            }
            536 = { 
                NOR = { 
                    has_trait = eunuch 
                    has_trait = eunuch_1
                }
            }
            537 = { has_trait = blind  }
            538 = { NOT = { has_trait = blind } }
            539 = {
                global_var:acs_gv_main_filters = {
                    any_in_global_list = {
                        variable = acs_gvl_filter_trait_physical_beauty_reduced
                        save_temporary_scope_as = filter2
                        $CANDIDATE$ = {
                            switch = {
                                trigger = scope:filter2
                                0 = { has_trait = beauty_bad_1 }
                                1 = { NOT = { has_trait = beauty_bad_1 } }
                                2 = { has_trait = beauty_bad_2 }
                                3 = { NOT = { has_trait = beauty_bad_2 } }
                                4 = { has_trait = beauty_bad_3 }
                                5 = { NOT = { has_trait = beauty_bad_3 } }
                                6 = { has_trait = beauty_good_1 }
                                7 = { NOT = { has_trait = beauty_good_1 } }
                                8 = { has_trait = beauty_good_2 }
                                9 = { NOT = { has_trait = beauty_good_2 } }
                                10 = { has_trait = beauty_good_3 }
                                11 = { NOT = { has_trait = beauty_good_3 } }
                            }
                        }
                        count = global_var:acs_gv_filter_trait_physical_beauty_count
                    }
                }
            }
            540 = {
                global_var:acs_gv_main_filters = {
                    any_in_global_list = {
                        variable = acs_gvl_filter_trait_physical_intellect_reduced
                        save_temporary_scope_as = filter2
                        $CANDIDATE$ = {
                            switch = {
                                trigger = scope:filter2
                                0 = { has_trait = intellect_bad_1 }
                                1 = { NOT = { has_trait = intellect_bad_1 } }
                                2 = { has_trait = intellect_bad_2 }
                                3 = { NOT = { has_trait = intellect_bad_2 } }
                                4 = { has_trait = intellect_bad_3 }
                                5 = { NOT = { has_trait = intellect_bad_3 } }
                                6 = { has_trait = intellect_good_1 }
                                7 = { NOT = { has_trait = intellect_good_1 } }
                                8 = { has_trait = intellect_good_2 }
                                9 = { NOT = { has_trait = intellect_good_2 } }
                                10 = { has_trait = intellect_good_3 }
                                11 = { NOT = { has_trait = intellect_good_3 } }
                            }
                        }
                        count = global_var:acs_gv_filter_trait_physical_intellect_count
                    }
                }
            }
            541 = {
                global_var:acs_gv_main_filters = {
                    any_in_global_list = {
                        variable = acs_gvl_filter_trait_physical_physique_reduced
                        save_temporary_scope_as = filter2
                        $CANDIDATE$ = {
                            switch = {
                                trigger = scope:filter2
                                0 = { has_trait = physique_bad_1 }
                                1 = { NOT = { has_trait = physique_bad_1 } }
                                2 = { has_trait = physique_bad_2 }
                                3 = { NOT = { has_trait = physique_bad_2 } }
                                4 = { has_trait = physique_bad_3 }
                                5 = { NOT = { has_trait = physique_bad_3 } }
                                6 = { has_trait = physique_good_1 }
                                7 = { NOT = { has_trait = physique_good_1 } }
                                8 = { has_trait = physique_good_2 }
                                9 = { NOT = { has_trait = physique_good_2 } }
                                10 = { has_trait = physique_good_3 }
                                11 = { NOT = { has_trait = physique_good_3 } }
                            }
                        }
                        count = global_var:acs_gv_filter_trait_physical_physique_count
                    }
                }
            }
            542 = { has_trait = pure_blooded }
            543 = { NOT = { has_trait = pure_blooded } }
            544 = { has_trait = fecund }
            545 = { NOT = { has_trait = fecund } }
            546 = { has_trait = strong }
            547 = { NOT = { has_trait = strong } }
            548 = { has_trait = shrewd }
            549 = { NOT = { has_trait = shrewd } }
            550 = { has_trait = clubfooted }
            551 = { NOT = { has_trait = clubfooted } }
            552 = { has_trait = hunchbacked }
            553 = { NOT = { has_trait = hunchbacked } }
            554 = { has_trait = lisping }
            555 = { NOT = { has_trait = lisping } }
            556 = { has_trait = stuttering  }
            557 = { NOT = { has_trait = stuttering } }
            558 = { has_trait = dwarf }
            559 = { NOT = { has_trait = dwarf } }
            560 = { has_trait = giant }
            561 = { NOT = { has_trait = giant } }
            562 = { has_trait = inbred }
            563 = { NOT = { has_trait = inbred } }
            564 = { has_trait = weak  }
            565 = { NOT = { has_trait = weak } }
            566 = { has_trait = dull }
            567 = { NOT = { has_trait = dull } }
            570 = { has_trait = spindly }
            571 = { NOT = { has_trait = spindly } }
            572 = { has_trait = scaly }
            573 = { NOT = { has_trait = scaly } }
            574 = { has_trait = albino }
            575 = { NOT = { has_trait = albino } }
            576 = { has_trait = wheezing }
            577 = { NOT = { has_trait = wheezing } }
            578 = { has_trait = bleeder }
            579 = { NOT = { has_trait = bleeder } }
            580 = { has_trait = pregnant }
            581 = { NOT = { has_trait = pregnant } }
            582 = { has_trait = celibate  }
            583 = { NOT = { has_trait = celibate } }
            586 = { has_trait = excommunicated }
            587 = { NOT = { has_trait = excommunicated } }
            588 = { has_trait = devoted }
            589 = { NOT = { has_trait = devoted } }
            590 = { has_trait = sayyid }
            591 = { NOT = { has_trait = sayyid } }
            592 = { has_trait = saoshyant }
            593 = { NOT = { has_trait = saoshyant } }
            594 = { has_trait = saoshyant_descendant }
            595 = { NOT = { has_trait = saoshyant_descendant } }
            596 = { has_trait = savior }
            597 = { NOT = { has_trait = savior } }
            598 = { has_trait = divine_blood  }
            599 = { NOT = { has_trait = divine_blood } }
            600 = { has_trait = blood_of_prophet }
            601 = { NOT = { has_trait = blood_of_prophet } }
            602 = { has_trait = faith_warrior }
            603 = { NOT = { has_trait = faith_warrior } }
            604 = { has_trait = saint }
            605 = { NOT = { has_trait = saint } }
            606 = { has_trait = order_member  }
            607 = { NOT = { has_trait = order_member } }
            608 = { has_trait = paragon }
            609 = { NOT = { has_trait = paragon } }
            610 = { has_trait = consecrated_blood  }
            611 = { NOT = { has_trait = consecrated_blood } }
            612 = { has_trait = crusader_king }
            613 = { NOT = { has_trait = crusader_king } }
            614 = { num_sinful_traits = { value > 0 target = scope:acs_filter_faith } }
            615 = { num_sinful_traits = { value = 0 target = scope:acs_filter_faith } }
            616 = { num_virtuous_traits = { value > 0 target = scope:acs_filter_faith } }
            617 = { num_virtuous_traits = { value = 0 target = scope:acs_filter_faith } }
            618 = { num_sinful_traits > 0 }
            619 = { num_sinful_traits = 0 }
            620 = { num_virtuous_traits > 0 }
            621 = { num_virtuous_traits = 0 }
            622 = { num_of_bad_genetic_traits > 0 }
            623 = { num_of_bad_genetic_traits = 0 }
            624 = { num_of_good_genetic_traits > 0 }
            625 = { num_of_good_genetic_traits = 0 }
            626 = { number_of_commander_traits > 0 }
            627 = { number_of_commander_traits = 0 }
            628 = { number_of_lifestyle_traits > 0 }
            629 = { number_of_lifestyle_traits = 0 }
            630 = {
                OR = { 
                    has_trait = adulterer
                    has_trait = fornicator
                    has_trait = murderer
                    has_trait = deviant
                    has_trait = cannibal
                    has_trait = sodomite
                    has_trait = kinslayer
                    has_trait = incestuous
                    has_trait = witch
                    has_trait = excommunicated
                }
            }
            631 = { 
                NOR = {
                    has_trait = adulterer
                    has_trait = fornicator
                    has_trait = murderer
                    has_trait = deviant
                    has_trait = cannibal
                    has_trait = sodomite
                    has_trait = kinslayer
                    has_trait = incestuous
                    has_trait = witch
                    has_trait = excommunicated
                }
            }
            632 = {
                OR = {
                    has_trait = ill
                    has_trait = bubonic_plague
                    has_trait = cancer
                    has_trait = consumption
                    has_trait = great_pox
                    has_trait = gout_ridden
                    has_trait = leper
                    has_trait = lovers_pox
                    has_trait = pneumonic
                    has_trait = smallpox
                    has_trait = typhus
                    has_trait = early_great_pox
                }
            }
            633 = { 
                NOR = {
                    has_trait = ill
                    has_trait = bubonic_plague
                    has_trait = cancer
                    has_trait = consumption
                    has_trait = great_pox
                    has_trait = gout_ridden
                    has_trait = leper
                    has_trait = lovers_pox
                    has_trait = pneumonic
                    has_trait = smallpox
                    has_trait = typhus
                    has_trait = early_great_pox 
                }
            }
            634 = { in_diplomatic_range = scope:acs_filter_diplomatic_range_root }
            635 = { NOT = { in_diplomatic_range = scope:acs_filter_diplomatic_range_root } }
            643 = { any_heir_title = { tier = tier_empire } }
            644 = { any_heir_title = { tier >= tier_kingdom } }
            645 = { any_heir_title = { tier >= tier_duchy } }
            646 = { any_heir_title = { tier >= tier_county } }
            647 = { any_heir_title = { } }
            648 = {
                OR = {
                	any_heir_title = { tier = tier_empire  }
                	any_pretender_title = { 
                		tier = tier_empire
                		place_in_line_of_succession = {
                			target = scope:candidate
                			value <= 2
                		}
                	}
                }
            }
            649 = {
                OR = {
                	any_heir_title = { tier >= tier_kingdom }
                	any_pretender_title = { 
                		tier >= tier_kingdom
                		place_in_line_of_succession = {
                			target = scope:candidate
                			value <= 2
                		}
                	}
                }
            }
            650 = {
                OR = {
                	any_heir_title = { tier >= tier_duchy }
                	any_pretender_title = { 
                		tier >= tier_duchy
                		place_in_line_of_succession = {
                			target = scope:candidate
                			value <= 2
                		}
                	}
                }
            }
            651 = {
                OR = {
                	any_heir_title = { tier >= tier_county }
                	any_pretender_title = { 
                		tier >= tier_county
                		place_in_line_of_succession = {
                			target = scope:candidate
                			value <= 2
                		}
                	}
                }
            }
            652 = {
                OR = {
                	any_heir_title = {  }
                	any_pretender_title = {
                		place_in_line_of_succession = {
                			target = scope:candidate
                			value <= 2
                		}
                	}
                }
            }
            653 = {
                OR = {
                	any_heir_title = { tier = tier_empire  }
                	any_pretender_title = { 
                		tier = tier_empire
                		place_in_line_of_succession = {
                			target = scope:candidate
                			value <= 3
                		}
                	}
                }
            }
            654 = {
                OR = {
                	any_heir_title = { tier >= tier_kingdom }
                	any_pretender_title = { 
                		tier >= tier_kingdom
                		place_in_line_of_succession = {
                			target = scope:candidate
                			value <= 3
                		}
                	}
                }
            }
            655 = {
                OR = {
                	any_heir_title = { tier >= tier_duchy }
                	any_pretender_title = { 
                		tier >= tier_duchy
                		place_in_line_of_succession = {
                			target = scope:candidate
                			value <= 3
                		}
                	}
                }
            }
            656 = {
                OR = {
                	any_heir_title = { tier >= tier_county }
                	any_pretender_title = { 
                		tier >= tier_county
                		place_in_line_of_succession = {
                			target = scope:candidate
                			value <= 3
                		}
                	}
                }
            }
            657 = {
                OR = {
                	any_heir_title = {  }
                	any_pretender_title = {
                		place_in_line_of_succession = {
                			target = scope:candidate
                			value <= 3
                		}
                	}
                }
            }
            658 = {
                OR = {
                	any_heir_title = { tier = tier_empire  }
                	any_pretender_title = { 
                		tier = tier_empire
                		place_in_line_of_succession = {
                			target = scope:candidate
                			value <= 4
                		}
                	}
                }
            }
            659 = {
                OR = {
                	any_heir_title = { tier >= tier_kingdom }
                	any_pretender_title = { 
                		tier >= tier_kingdom
                		place_in_line_of_succession = {
                			target = scope:candidate
                			value <= 4
                		}
                	}
                }
            }
            660 = {
                OR = {
                	any_heir_title = { tier >= tier_duchy }
                	any_pretender_title = { 
                		tier >= tier_duchy
                		place_in_line_of_succession = {
                			target = scope:candidate
                			value <= 4
                		}
                	}
                }
            }
            661 = {
                OR = {
                	any_heir_title = { tier >= tier_county }
                	any_pretender_title = { 
                		tier >= tier_county
                		place_in_line_of_succession = {
                			target = scope:candidate
                			value <= 4
                		}
                	}
                }
            }
            662 = {
                OR = {
                	any_heir_title = {  }
                	any_pretender_title = {
                		place_in_line_of_succession = {
                			target = scope:candidate
                			value <= 4
                		}
                	}
                }
            }
            663 = {
                OR = {
                	any_heir_title = { tier = tier_empire }
                	any_pretender_title = { tier = tier_empire }
                }
            }
            664 = {
                OR = {
                	any_heir_title = { tier >= tier_kingdom }
                	any_pretender_title = { tier >= tier_kingdom }
                }
            }
            665 = {
                OR = {
                	any_heir_title = { tier >= tier_duchy }
                	any_pretender_title = { tier >= tier_duchy }
                }
            }
            666 = {
                OR = {
                	any_heir_title = { tier >= tier_county }
                	any_pretender_title = { tier >= tier_county }
                }
            }
            667 = {
                OR = {
                	any_heir_title = {  }
                	any_pretender_title = { }
                }
            }
            668 = {
                OR = {
                	any_heir_title = { tier = tier_empire }
                	any_pretender_title = { tier = tier_empire }
                	any_parent = { 
                		highest_held_title_tier = tier_empire
                		is_alive = yes
                	} 
                }
            }
            669 = {
                OR = {
                	any_heir_title = { tier >= tier_kingdom } 
                	any_pretender_title = { tier >= tier_kingdom }
                	any_parent = { 
                		highest_held_title_tier >= tier_kingdom
                		is_alive = yes
                	} 
                }
            }
            670 = {
                OR = {
                	any_heir_title = { tier >=  tier_duchy } 
                	any_pretender_title = { tier >= tier_duchy }
                	any_parent = { 
                		highest_held_title_tier >= tier_duchy
                		is_alive = yes
                	} 
                }
            }
            671 = {
                OR = {
                	any_heir_title = { tier >= tier_county }
                	any_pretender_title = { tier >= tier_county }
                	any_parent = { 
                		highest_held_title_tier >=  tier_county
                		is_alive = yes
                	} 
                }
            }
            672 = {
                OR = {
                	any_heir_title = { } 
                	any_pretender_title = { }
                	any_parent = { 
                		highest_held_title_tier >= tier_county 
                		is_alive = yes
                	} 
                }
            }
            674 = { any_heir_title = { tier = tier_empire count = 0 } }
            675 = { any_heir_title = { tier >= tier_kingdom count = 0 } }
            676 = { any_heir_title = { tier >= tier_duchy count = 0 } }
            677 = { any_heir_title = { tier >= tier_county count = 0 } }
            678 = { any_heir_title = { count = 0 } }
            679 = { 
                NOR = {
                	any_heir_title = { tier = tier_empire  }
                	any_pretender_title = { 
                		tier = tier_empire
                		place_in_line_of_succession = {
                			target = scope:candidate
                			value <= 2
                		}
                	}
                }
            }
            680 = { 
                NOR = {
                	any_heir_title = { tier >= tier_kingdom }
                	any_pretender_title = { 
                		tier >= tier_kingdom
                		place_in_line_of_succession = {
                			target = scope:candidate
                			value <= 2
                		}
                	}
                }
            }
            681 = { 
                NOR = {
                	any_heir_title = { tier >= tier_duchy }
                	any_pretender_title = { 
                		tier >= tier_duchy
                		place_in_line_of_succession = {
                			target = scope:candidate
                			value <= 2
                		}
                	}
                }
            }
            682 = { 
                NOR = {
                	any_heir_title = { tier >= tier_county }
                	any_pretender_title = { 
                		tier >= tier_county
                		place_in_line_of_succession = {
                			target = scope:candidate
                			value <= 2
                		}
                	}
                }
            }
            683 = { 
                NOR = {
                	any_heir_title = {  }
                	any_pretender_title = {
                		place_in_line_of_succession = {
                			target = scope:candidate
                			value <= 2
                		}
                	}
                }
            }
            684 = { 
                NOR = {
                	any_heir_title = { tier = tier_empire  }
                	any_pretender_title = { 
                		tier = tier_empire
                		place_in_line_of_succession = {
                			target = scope:candidate
                			value <= 3
                		}
                	}
                }
            }
            685 = { 
                NOR = {
                	any_heir_title = { tier >= tier_kingdom }
                	any_pretender_title = { 
                		tier >= tier_kingdom
                		place_in_line_of_succession = {
                			target = scope:candidate
                			value <= 3
                		}
                	}
                }
            }
            686 = { 
                NOR = {
                	any_heir_title = { tier >= tier_duchy }
                	any_pretender_title = { 
                		tier >= tier_duchy
                		place_in_line_of_succession = {
                			target = scope:candidate
                			value <= 3
                		}
                	}
                }
            }
            687 = { 
                NOR = {
                	any_heir_title = { tier >= tier_county }
                	any_pretender_title = { 
                		tier >= tier_county
                		place_in_line_of_succession = {
                			target = scope:candidate
                			value <= 3
                		}
                	}
                }
            }
            688 = { 
                NOR = {
                	any_heir_title = {  }
                	any_pretender_title = {
                		place_in_line_of_succession = {
                			target = scope:candidate
                			value <= 3
                		}
                	}
                }
            }
            689 = { 
                NOR = {
                	any_heir_title = { tier = tier_empire  }
                	any_pretender_title = { 
                		tier = tier_empire
                		place_in_line_of_succession = {
                			target = scope:candidate
                			value <= 4
                		}
                	}
                }
            }
            690 = { 
                NOR = {
                	any_heir_title = { tier >= tier_kingdom }
                	any_pretender_title = { 
                		tier >= tier_kingdom
                		place_in_line_of_succession = {
                			target = scope:candidate
                			value <= 4
                		}
                	}
                }
            }
            691 = { 
                NOR = {
                	any_heir_title = { tier >= tier_duchy }
                	any_pretender_title = { 
                		tier >= tier_duchy
                		place_in_line_of_succession = {
                			target = scope:candidate
                			value <= 4
                		}
                	}
                }
            }
            692 = { 
                NOR = {
                	any_heir_title = { tier >= tier_county }
                	any_pretender_title = { 
                		tier >= tier_county
                		place_in_line_of_succession = {
                			target = scope:candidate
                			value <= 4
                		}
                	}
                }
            }
            693 = { 
                NOR = {
                	any_heir_title = {  }
                	any_pretender_title = {
                		place_in_line_of_succession = {
                			target = scope:candidate
                			value <= 4
                		}
                	}
                }
            }
            694 = { 
                NOR = {
                	any_heir_title = { tier = tier_empire }
                	any_pretender_title = { tier = tier_empire }
                }
            }
            695 = { 
                NOR = {
                	any_heir_title = { tier >= tier_kingdom }
                	any_pretender_title = { tier >= tier_kingdom }
                }
            }
            696 = { 
                NOR = {
                	any_heir_title = { tier >= tier_duchy }
                	any_pretender_title = { tier >= tier_duchy }
                }
            }
            697 = { 
                NOR = {
                	any_heir_title = { tier >= tier_county }
                	any_pretender_title = { tier >= tier_county }
                }
            }
            698 = { 
                NOR = {
                	any_heir_title = {  }
                	any_pretender_title = { }
                }
            }
            699 = { 
                NOR = {
                	any_heir_title = { tier = tier_empire }
                	any_pretender_title = { tier = tier_empire }
                	any_parent = { 
                		highest_held_title_tier = tier_empire
                		is_alive = yes
                	} 
                }
            }
            700 = { 
                NOR = {
                	any_heir_title = { tier >= tier_kingdom } 
                	any_pretender_title = { tier >= tier_kingdom }
                	any_parent = { 
                		highest_held_title_tier >= tier_kingdom
                		is_alive = yes
                	} 
                }
            }
            701 = { 
                NOR = {
                	any_heir_title = { tier >=  tier_duchy } 
                	any_pretender_title = { tier >= tier_duchy }
                	any_parent = { 
                		highest_held_title_tier >= tier_duchy
                		is_alive = yes
                	} 
                }
            }
            702 = { 
                NOR = {
                	any_heir_title = { tier >= tier_county }
                	any_pretender_title = { tier >= tier_county }
                	any_parent = { 
                		highest_held_title_tier >=  tier_county
                		is_alive = yes
                	} 
                }
            }
            703 = { 
                NOR = {
                	any_heir_title = { } 
                	any_pretender_title = { }
                	any_parent = { 
                		highest_held_title_tier >= tier_county 
                		is_alive = yes
                	} 
                }
            }
            705 = { any_parent = { count = 2 is_alive = yes } }
            706 = { any_parent = { count >= 1 is_alive = yes } }
            707 = { any_parent = { count = 1 is_alive = yes } }
            708 = {
                AND = {
                    has_mother = yes
                    NOT = { has_father = yes }
                }
            }
            709 = {
                AND = {
                    NOT = { has_mother = yes }
                    has_father = yes
                }
            }
            710 = { any_parent = { count = 0 is_alive = yes } }
            711 = { NOT = { exists = mother } }
            712 = {
                AND = {
                    NOT = { exists = mother }
                    has_father = yes
                }
            }
            713 = {
                AND = {
                    NOT = { exists = mother }
                    exists = father
                    father = { is_alive = no }
                }
            }
            714 = { NOT = { exists = father } }
            715 = {
                AND = {
                    NOT = { exists = father }
                    has_mother = yes
                }
            }
            716 = {
                AND = {
                    NOT = { exists = father }
                    exists = mother
                    mother = { is_alive = no }
                }
            }
            717 = {
                AND = {
                    exists = father
                    exists = mother
                }
            }
            718 = {
                OR = {
                    AND = {
                        NOT = { exists = father }
                        exists = mother
                    }
                    AND = {
                        NOT = { exists = mother }
                        exists = father
                    }
                }
            }
            719 = {
                OR = {
                    exists = father
                    exists = mother
                }
            }
            720 = {
                AND = {
                    NOT = { exists = father }
                    NOT = { exists = mother }
                }
            }
            722 = { is_adult = no }
            723 = { is_adult = yes }
            724 = {
                is_adult = yes
                age < 35 
			}
            725 = {
                is_adult = yes
                age >= 35
				age < 50 
			}
            726 = {
                is_adult = yes
                age >= 50 
			}
            728 = { is_male = no }
            729 = { is_male = yes }
            735 = { is_imprisoned = yes }
            736 = { is_imprisoned = no }
            738 = { scope:acs_filter_hooks_root = { has_hook = prev } }
            739 = { NOT = { scope:acs_filter_hooks_root = { has_hook = prev } } }
            740 = { any_secret_knower = { this = scope:acs_filter_hooks_root } }
            741 = { 
				NOT = { scope:acs_filter_hooks_root = { has_hook = prev } }
                NOT = { any_secret_knower = { this = scope:acs_filter_hooks_root } } 
			}
            750 = { culture = { has_same_culture_heritage = scope:acs_filter_culture_root.culture } }
            751 = { culture = scope:acs_filter_culture_root.culture }
            752 = { NOT = { culture = { has_same_culture_heritage = scope:acs_filter_culture_root.culture } } }
            753 = { NOT = { culture = scope:acs_filter_culture_root.culture } }
            755 = { dynasty = scope:acs_filter_dynasty_root.dynasty }
            756 = { NOT = { dynasty = scope:acs_filter_dynasty_root.dynasty } }
            757 = { house = scope:acs_filter_dynasty_root.house }
            758 = { NOT = { house = scope:acs_filter_dynasty_root.house } }
            759 = { is_lowborn = no }
            760 = { is_lowborn = yes }
            761 = {
                is_lowborn = no
                NOT = { dynasty = scope:acs_filter_dynasty_root.dynasty } 
			}
            763 = {
                global_var:acs_gv_main_filters = {
                    any_in_list = {
                        variable = acs_vl_religion_filter
                        save_temporary_scope_as = filter2
                        $CANDIDATE$ = {
                            switch = {
                                trigger = scope:filter2
                                0 = { religion = { is_in_family = rf_pagan } }
                                1 = { NOT = { religion = { is_in_family = rf_pagan } } }
                                2 = { religion = { is_in_family = rf_eastern } }
                                3 = { NOT = { religion = { is_in_family = rf_eastern } } }
                                4 = { religion = { is_in_family = rf_abrahamic } }
                                5 = { NOT = { religion = { is_in_family = rf_abrahamic } } }
                                6 = {
                                    NOR = {
                                        religion = { is_in_family = rf_pagan }
                                        religion = { is_in_family = rf_eastern }
                                        religion = { is_in_family = rf_abrahamic }
                                    } 
								}
                                7 = { 
                                    AND = {
                                        religion = { is_in_family = rf_pagan }
                                        religion = { is_in_family = rf_eastern }
                                        religion = { is_in_family = rf_abrahamic }
                                    }
								}
                                8 = {
                                    faith = { 
                                        save_temporary_scope_as = acs_ts_faith
                                        global_var:acs_gv_main_filters = {
                                            any_in_list = { variable = acs_vl_has_faith this = scope:acs_ts_faith count > 0 }
                                        }
                                    } 
								}
                                9 = { religion = { 
                                        save_temporary_scope_as = acs_ts_religion
                                        global_var:acs_gv_main_filters = {
                                            any_in_list = { variable = acs_vl_has_religion this = scope:acs_ts_religion count > 0 }
                                        }
                                    } 
								}
                                10 = {
                                    faith = { 
                                        save_temporary_scope_as = acs_ts_faith
                                        global_var:acs_gv_main_filters = {
                                            any_in_list = { variable = acs_vl_dont_have_faith this = scope:acs_ts_faith count = 0 }
                                        }
                                        
                                    } 
								}
                                11 = { religion = { 
                                        save_temporary_scope_as = acs_ts_religion
                                        global_var:acs_gv_main_filters = { 
											any_in_list = { variable = acs_vl_dont_have_religion this = scope:acs_ts_religion count = 0 }
                                        }          
                                    } 
								}
                            }
                        }
                        count = global_var:acs_gv_main_filters.var:acs_v_religion_filter_count
                    }
                }
            }
            765= { has_trait = tourney_participant
                    OR = {
                        has_trait_xp = {
                            trait = tourney_participant
                            track = foot
                            value >= 20
                        }
                    }
                }
            766 = { NOT = { has_trait = tourney_participant
                    OR = {
                        has_trait_xp = {
                            trait = tourney_participant
                            track = foot
                            value >= 20 }
                    }
                }
            }
            767 = {   #Blademaster Accolade Requirements
                has_trait = tourney_participant
                    OR = {
                        has_trait_xp = {
                            trait = tourney_participant
                            track = horse
                            value >= 20
                        }
                    }
                }
            768 = { NOT = { has_trait = tourney_participant
                    OR = {
                        has_trait_xp = {
                            trait = tourney_participant
                            track = horse
                            value >= 20 }
                    }
                }
            }
            769 = { 
				has_trait = lifestyle_blademaster
                has_trait_xp = {
					trait = lifestyle_blademaster
					value >= 100
				}
			}
            770 = { 
				NOT = { 
					has_trait = lifestyle_blademaster
					has_trait_xp = {
						trait = lifestyle_blademaster
						value >= 100
					} 
				}
			}
            779 = {acs_invite_to_court >= 1 }
            780 = {acs_invite_to_court <= 0 }
            
            781 = {  #Archer Accolade Requirements
                prowess >= accolade_prowess_requirement_value
                OR = {
                    has_trait_xp = {
                        trait = tourney_participant
                        track = bow
                        value >= 20
                    }
                    has_trait = forest_fighter
                }
            }
            782 = { NOT = {
                    prowess >= accolade_prowess_requirement_value
                    OR = {
                        has_trait_xp = {
                            trait = tourney_participant
                            track = bow
                            value >= 20
                    }
                    has_trait = forest_fighter
                    }
                }
            }
            783 = {     #Fanatic Accolade Requirements
                prowess >= accolade_prowess_requirement_value            
                exists = liege
                faith = liege.faith
                OR = {
                    has_trait = zealous
                    has_trait = holy_warrior
                }
            }
            784 = { 
				NOT = {
                    prowess >= accolade_prowess_requirement_value
                    exists = liege
                    faith = liege.faith
                    OR = {
                        has_trait = zealous
                        has_trait = holy_warrior
                    }   
                }
			}
            785 = {     #Besieger Accolade Requirements
                prowess >= accolade_prowess_requirement_value
                OR = {
                    has_trait = military_engineer
                    has_trait = logistician
                }
                culture ?= { has_innovation = innovation_mangonel }
			}
            786 = { 
				NOT = {
                    prowess >= accolade_prowess_requirement_value
                    OR = {
                        has_trait = military_engineer
                        has_trait = logistician
                    }
                    culture ?= { has_innovation = innovation_mangonel }
                }
			}
            787 = {     #Huntsmaster Accolade Requirements
                prowess >= accolade_prowess_requirement_value
                has_trait = lifestyle_hunter
                scope:owner ?= {
                    culture = {
                        NOT = {
                            has_cultural_tradition = tradition_vegetarianism
                        }
                    }
                }
            }
            788 = { 
				NOT = {
                    prowess >= accolade_prowess_requirement_value
                    has_trait = lifestyle_hunter
                    scope:owner ?= {
                        culture = {
                            NOT = {
                                has_cultural_tradition = tradition_vegetarianism
                            }
                        }
                    }
                }
			}
            789 = {     #Camerly Accolade Requirements
                prowess >= accolade_prowess_requirement_value
                OR = {
                    has_trait_xp = {
                        trait = tourney_participant
                        track = horse
                        value >= 20
                    }
                    has_trait = desert_warrior
                }
                culture ?= { has_innovation = innovation_war_camels }
			}
            790 = { 
				NOT = {
                    prowess >= accolade_prowess_requirement_value
                    OR = {
                        has_trait_xp = {
                            trait = tourney_participant
                            track = horse
                            value >= 20
                        }
                        has_trait = desert_warrior
                    }
                    culture ?= { has_innovation = innovation_war_camels }
                }
			}
            791 = {     #House Knight Accolade Requirements
                prowess >= accolade_prowess_requirement_value
                exists = house
                house = liege.house
                NOT = { has_trait = denounced }
                dynasty = { has_dynasty_perk = kin_legacy_4 }
            }
            792 = { 
				NOT = {
                    prowess >= accolade_prowess_requirement_value
                    exists = house
                    house = liege.house
                    NOT = { has_trait = denounced }
                    dynasty = { has_dynasty_perk = kin_legacy_4 } 
                }
			}
            793 = {     #Crossbownmen Accolade Requirements
				prowess >= accolade_prowess_requirement_value
                OR = {
                    has_trait_xp = {
                        trait = tourney_participant
                        track = bow
                        value >= 20
                    }
                    has_trait = cautious_leader
                }
                culture ?= {
                    OR = {
                        has_innovation = innovation_advanced_bowmaking
                        has_innovation = innovation_repeating_crossbow
                    }
                }
            }
            794 = { 
				NOT = {
                    prowess >= accolade_prowess_requirement_value
                    OR = {
                        has_trait_xp = {
                            trait = tourney_participant
                            track = bow
                            value >= 20
                        }
                        has_trait = cautious_leader
                    }
                    culture ?= {
                        OR = {
                            has_innovation = innovation_advanced_bowmaking
                            has_innovation = innovation_repeating_crossbow
                        }
                    }
                }
			}
            795 = {   #Idealist Accolade Requirements
                prowess >= accolade_prowess_requirement_value
                OR = {
                    has_trait = compassionate
                    has_trait = forgiving
                    has_trait = trusting
                    has_trait = generous
                }
            }
            796 = { NOT = {
                    prowess >= accolade_prowess_requirement_value
                    OR = {
                        has_trait = compassionate
                        has_trait = forgiving
                        has_trait = trusting
                        has_trait = generous 
                    }
                }
            }
            797 = {     #Elephantry Accolade Requirements
                prowess >= accolade_prowess_requirement_value
                OR = {
                    has_trait_xp = {
                        trait = tourney_participant
                        track = horse
                        value >= 20
                    }
                    has_trait = jungle_stalker
                }
                culture ?= { has_innovation = innovation_elephantry }
			}
            798 = { 
				NOT = {
                    prowess >= accolade_prowess_requirement_value
                    OR = {
                        has_trait_xp = {
                            trait = tourney_participant
                            track = horse
                            value >= 20
                        }
                        has_trait = jungle_stalker
                    }
                    culture ?= { has_innovation = innovation_elephantry }
                }
			}
            799 = {    #Marauder Accolade Requirements
                prowess >= accolade_prowess_requirement_value
                OR = {
                    has_trait = sadistic
                    has_trait = callous
                    has_trait = vengeful
                }
            }
            800 = { NOT = {
                    prowess >= accolade_prowess_requirement_value
                    OR = {
                        has_trait = sadistic
                        has_trait = callous
                        has_trait = vengeful
                    }
                }
            }
            801 = {     #Horse Archer Accolade Requirements
                prowess >= accolade_prowess_requirement_value
                OR = {
                    has_trait_xp = {
                        trait = tourney_participant
                        track = horse
                        value >= 20
                    }
                    has_trait_xp = {
                        trait = tourney_participant
                        track = bow
                        value >= 20
                    }
                    has_trait = flexible_leader
                }
                culture ?= { has_cultural_tradition = tradition_horse_lords }
			}
            802 = { 
				NOT = {
                    prowess >= accolade_prowess_requirement_value
                    OR = {
                        has_trait_xp = {
                            trait = tourney_participant
                            track = horse
                            value >= 20
                        }
                        has_trait_xp = {
                            trait = tourney_participant
                            track = bow
                            value >= 20
                        }
                        has_trait = flexible_leader
                    }
                    culture ?= { has_cultural_tradition = tradition_horse_lords } 
                }
			}
            803 = {   #Manipulator Accolade Requirements
                prowess >= accolade_prowess_requirement_value
                OR = {
                    intrigue >= 15
                    has_trait = schemer
                }
            }
            804 = { NOT = {
                    prowess >= accolade_prowess_requirement_value
                    OR = {
                        intrigue >= 15
                        has_trait = schemer
                    }
                }
            }
            805 = {     #Lancer Accolade Requirements
                prowess >= accolade_prowess_requirement_value
                OR = {
                    has_trait_xp = {
                        trait = tourney_participant
                        track = horse
                        value >= 20
                    }
                    has_trait = aggressive_attacker
                }
                culture ?= {
                    OR = {
                        has_innovation = innovation_arched_saddle
                        has_cultural_tradition = tradition_caucasian_wolves
                        has_cultural_tradition = tradition_roman_legacy
                        has_innovation = innovation_valets
                        has_cultural_tradition = tradition_ep3_audacious_cadets
                        has_cultural_tradition = tradition_ep3_imperial_tagmata
                    }
                }
            }
            806 = { 
				NOT = {
                    prowess >= accolade_prowess_requirement_value
                    OR = {
                        has_trait_xp = {
                            trait = tourney_participant
                            track = horse
                            value >= 20
                        }
                        has_trait = aggressive_attacker
                    }
                    culture ?= {
                        OR = {
                            has_innovation = innovation_arched_saddle
                            has_cultural_tradition = tradition_caucasian_wolves
                            has_cultural_tradition = tradition_roman_legacy
                            has_innovation = innovation_valets
                            has_cultural_tradition = tradition_ep3_audacious_cadets
                            has_cultural_tradition = tradition_ep3_imperial_tagmata
                        }
                    }
                }
			}
            807 = {     #Master of Revels Accolade Requirements
                prowess >= accolade_prowess_requirement_value
                has_trait = lifestyle_reveler
			}
            808 = { 
				NOT = {
                    prowess >= accolade_prowess_requirement_value
                    has_trait = lifestyle_reveler 
                }
			}
            809 = {     #Outrider Accolade Requirements
                prowess >= accolade_prowess_requirement_value
                OR = {
                    has_trait_xp = {
                        trait = tourney_participant
                        track = horse
                        value >= 20
                    }
                    has_trait = open_terrain_expert
                }
            }
            810 = { 
				NOT = {
                    prowess >= accolade_prowess_requirement_value
                    OR = {
                        has_trait_xp = {
                            trait = tourney_participant
                            track = horse
                            value >= 20
                        }
                        has_trait = open_terrain_expert
                    } 
                }
			}
            811 = {     #Mentor Accolade Requirements
                prowess >= accolade_prowess_requirement_value
                OR = {
                    learning >= 15
                    has_trait = whole_of_body
                }
            }
            812 = { NOT = {
                    prowess >= accolade_prowess_requirement_value
                    OR = {
                        learning >= 15
                        has_trait = whole_of_body
                    } 
                }
			}
            813 = {     #Pike Accolade Requirements
                prowess >= accolade_prowess_requirement_value
                OR = {
                    has_trait_xp = {
                        trait = tourney_participant
                        track = foot
                        value >= 20
                    }
                    has_trait = rough_terrain_expert
                }
            }
            814 = { 
				NOT = {
                    prowess >= accolade_prowess_requirement_value
                    OR = {
                        has_trait_xp = {
                            trait = tourney_participant
                            track = foot
                            value >= 20
                        }
                        has_trait = rough_terrain_expert
                    } 
                }
			}
            815 = {     #Politicker Accolade Requirements
                prowess >= accolade_prowess_requirement_value
                OR = {
                    diplomacy >= 15
                    has_trait = diplomat
                }
            }
            816 = { 
				NOT = {
                    prowess >= accolade_prowess_requirement_value
                    OR = {
                        diplomacy >= 15
                        has_trait = diplomat
                    } 
                }
			}
            817 = {     #Skirmisher Accolade Requirements
                prowess >= accolade_prowess_requirement_value
                OR = {
                    has_trait_xp = {
                        trait = tourney_participant
                        track = bow
                        value >= 20
                    }
                    has_trait_xp = {
                        trait = tourney_participant
                        track = foot
                        value >= 20
                    }
                    has_trait = winter_soldier
                    has_trait = jungle_stalker
                }
            }
            818 = { 
				NOT = {
                    prowess >= accolade_prowess_requirement_value
                    OR = {
                        has_trait_xp = {
                            trait = tourney_participant
                            track = bow
                            value >= 20
                        }
                        has_trait_xp = {
                            trait = tourney_participant
                            track = foot
                            value >= 20
                        }
                        has_trait = winter_soldier
                        has_trait = jungle_stalker
                    }
                }
			}
            819 = {     #Reeve Accolade Requirements
                prowess >= accolade_prowess_requirement_value
                OR = {
                    has_trait = administrator
                    stewardship >= 15
                }
            }
            820 = { 
				NOT = {
                    prowess >= accolade_prowess_requirement_value
                    OR = {
                        has_trait = administrator
                        stewardship >= 15
                    } 
                }
			}
            821 = {     #Vanguard Accolade Requirements
                # Has the MaA unlocked.
                prowess >= accolade_prowess_requirement_value
                OR = {
                    has_trait = strong
                    has_trait = athletic
                    has_trait = physique_good
                    has_trait_xp = {
                        trait = tourney_participant
                        track = foot
                        value >= 20
                    }
                }
                culture ?= {
                    OR = {
                        has_innovation = innovation_quilted_armor
                        has_cultural_tradition = tradition_fp1_coastal_warriors
                        has_cultural_tradition = tradition_hird
                        has_cultural_tradition = tradition_futuwaa
                        has_cultural_tradition = tradition_druzhina
                        has_cultural_tradition = tradition_khadga_puja
                        has_cultural_tradition = tradition_garuda_warriors
                        has_cultural_tradition = tradition_himalayan_settlers
                        has_cultural_tradition = tradition_mubarizuns
                        has_cultural_tradition = tradition_burman_royal_army
                        has_cultural_tradition = tradition_mountaineer_ruralism
                        has_innovation = innovation_sarawit
                        has_innovation = innovation_legionnaires
                    }
                }
            }
            822 = { 
				NOT = {
                    # Has the MaA unlocked.
                    prowess >= accolade_prowess_requirement_value
                    OR = {
                        has_trait = strong
                        has_trait = athletic
                        has_trait = physique_good
                        has_trait_xp = {
                            trait = tourney_participant
                            track = foot
                            value >= 20
                        }
                    }
                    culture ?= {
                        OR = {
                            has_innovation = innovation_quilted_armor
                            has_cultural_tradition = tradition_fp1_coastal_warriors
                            has_cultural_tradition = tradition_hird
                            has_cultural_tradition = tradition_futuwaa
                            has_cultural_tradition = tradition_druzhina
                            has_cultural_tradition = tradition_khadga_puja
                            has_cultural_tradition = tradition_garuda_warriors
                            has_cultural_tradition = tradition_himalayan_settlers
                            has_cultural_tradition = tradition_mubarizuns
                            has_cultural_tradition = tradition_burman_royal_army
                            has_cultural_tradition = tradition_mountaineer_ruralism
                            has_innovation = innovation_sarawit
                            has_innovation = innovation_legionnaires
                        }
                    }
                }
			}
            823 = {     #Scoundrel Accolade Requirements
                prowess >= accolade_prowess_requirement_value
                OR = {
                    has_trait = ambitious
                    has_trait = gregarious
                    has_trait = greedy
                    has_trait = deceitful
                    has_trait = adventurer
                }
            }
            824 = { 
				NOT = {
                    prowess >= accolade_prowess_requirement_value
                    OR = {
                        has_trait = ambitious
                        has_trait = gregarious
                        has_trait = greedy
                        has_trait = deceitful
                        has_trait = adventurer
                    } 
                }
			}
            825 = {   #Blademaster Accolade Requirements
                prowess >= accolade_prowess_requirement_value
                OR = {
                    has_trait_xp = {
                        trait = lifestyle_blademaster
                        value >= 100
                    }
                }
            }
            826 = { NOT = { 
                    prowess >= accolade_prowess_requirement_value
                    OR = {
                        has_trait_xp = {
                            trait = lifestyle_blademaster
                            value >= 100
                        }
                    }
                }
            }
            827 = {     #Stalwart Accolade Requirements
                prowess >= accolade_prowess_requirement_value
                OR = {
                    has_trait = honest
                    has_trait = just
                    has_trait = patient
                    has_trait = unyielding_defender
                    has_trait = loyal
                }
            }
            828 = { 
				NOT = {
                    prowess >= accolade_prowess_requirement_value
                    OR = {
                        has_trait = honest
                        has_trait = just
                        has_trait = patient
                        has_trait = unyielding_defender
                        has_trait = loyal
                    } 
                }
			}
            829 = {    #Charmer Accolade Requirements
                prowess >= accolade_prowess_requirement_value
                OR = {
                    has_trait = lustful
                    has_trait = seducer
                }
            }
            830 = { 
				NOT = {
                    prowess >= accolade_prowess_requirement_value
                    OR = {
                        has_trait = lustful
                        has_trait = seducer
                    }                    
                }
			}
            831 = {     #Tactician Accolade Requirements
                prowess >= accolade_prowess_requirement_value
                OR = {
                    has_trait = strategist
                    martial >= 15
                }
            }
            832 = { 
				NOT = {
                    prowess >= accolade_prowess_requirement_value
                    OR = {
                        has_trait = strategist
                        martial >= 15
                    } 
                }
			}
            833 = {   #Contender Accolade Requirements
                prowess >= accolade_prowess_requirement_value
                OR = {
                    prowess >= 20
                    has_trait_xp = {
                        trait = tourney_participant
                        track = bow
                        value >= 50
                    }
                    has_trait_xp = {
                        trait = tourney_participant
                        track = horse
                        value >= 50
                    }
                    has_trait_xp = {
                        trait = tourney_participant
                        track = foot
                        value >= 50
                    }
                    has_trait_xp = {
                        trait = tourney_participant
                        track = wit
                        value >= 50
                    }
                }
            }
            834 = { NOT = {
                    prowess >= accolade_prowess_requirement_value
                    OR = {
                        prowess >= 20
                        has_trait_xp = {
                            trait = tourney_participant
                            track = bow
                            value >= 50
                        }
                        has_trait_xp = {
                            trait = tourney_participant
                            track = horse
                            value >= 50
                        }
                        has_trait_xp = {
                            trait = tourney_participant
                            track = foot
                            value >= 50
                        }
                        has_trait_xp = {
                            trait = tourney_participant
                            track = wit
                            value >= 50
                        }
                    }
                }
            }
            835 = {    #Thug Accolade Requirements
                prowess >= accolade_prowess_requirement_value
                OR = {
                    has_trait = wrathful
                    has_trait = arbitrary
                    has_trait = impatient
                    has_trait = arrogant
                    has_trait = reaver
                }
			}
            836 = { 
				NOT = {
                    prowess >= accolade_prowess_requirement_value
                    OR = {
                        has_trait = wrathful
                        has_trait = arbitrary
                        has_trait = impatient
                        has_trait = arrogant
                        has_trait = reaver
                    }               
                }
			}
            837 = {      #Disciplinarian Accolade Requirements
                prowess >= accolade_prowess_requirement_value
                OR = {
                    has_trait = stubborn
                    has_trait = diligent
                    has_trait = temperate
                    has_trait = organizer
                    has_trait = overseer
                }
			}
            838 = { 
				NOT = {
                    prowess >= accolade_prowess_requirement_value
                    OR = {
                        has_trait = stubborn
                        has_trait = diligent
                        has_trait = temperate
                        has_trait = organizer
                        has_trait = overseer
                    }                 
                }
			}
            839 = {  #Valiant Accolade Requirements
                prowess >= accolade_prowess_requirement_value
                OR = {
                    has_trait = brave
                    has_trait = berserker
                    has_trait = reckless
                }
            }
            840 = { NOT = {
                    prowess >= accolade_prowess_requirement_value
                    OR = {
                        has_trait = brave
                        has_trait = berserker
                        has_trait = reckless
                    }
                }
            }
            841 = {  #Gunner Accolade Requirements
                prowess >= accolade_prowess_requirement_value
                OR = {
                    has_trait = scholar
                    learning >= 10
                }
                culture ?= {
                    OR = {
                        has_innovation = innovation_gunpowder
                        has_innovation = innovation_fire_medicine
                    }
                }
            }
            842 = { NOT = {
                    prowess >= accolade_prowess_requirement_value
                    OR = {
                        has_trait = scholar
                        learning >= 10
                    }
                    culture ?= {
                        OR = {
                            has_innovation = innovation_gunpowder
                            has_innovation = innovation_fire_medicine
                        }
                    }
                }
            }
			
            900 = { is_ruler = yes }
            901 = {
                holds_landed_title = yes
                is_ruler = yes
			}
            902 = {
                holds_landed_title = no
                is_ruler = yes
			}
            903 = { is_ruler = no }
            904 = { is_independent_ruler = yes }
            905 = { is_tributary = yes }
            906 = { is_tributary = no }
            907 = { is_confederation_member = yes }
            908 = { is_confederation_member = no }

            # Council Positions
            950 = {
                AND = {
                    has_council_position = councillor_court_chaplain
                    NOT = { has_title = title:e_minister_of_justice }
                    NOT = { has_title = title:e_minister_of_rites }
                }
            }
            951 = {
                OR = {
                    NOT = { has_council_position = councillor_court_chaplain }
                    has_title = title:e_minister_of_justice
                    has_title = title:e_minister_of_rites
                }
            }
            952 = {
                AND = {
                    has_council_position = councillor_chancellor
                    NOT = { has_title = title:e_minister_chancellor }
                    NOT = { has_title = title:e_minister_of_personnel }
                }
            }
            953 = {
                OR = {
                    NOT = { has_council_position = councillor_chancellor }
                    has_title = title:e_minister_chancellor
                    has_title = title:e_minister_of_personnel
                }
            }
            954 = {
                AND = {
                    has_council_position = councillor_steward
                    NOT = { has_title = title:e_minister_of_revenue }
                    NOT = { has_title = title:e_minister_of_works }
                }
            }
            955 = {
                OR = {
                    NOT = { has_council_position = councillor_steward }
                    has_title = title:e_minister_of_revenue
                    has_title = title:e_minister_of_works
                }
            }
            956 = {
                AND = {
                    has_council_position = councillor_marshal
                    NOT = { has_title = title:e_minister_grand_marshal }
                    NOT = { has_title = title:e_minister_of_war }
                }
            }
            957 ={
                OR = {
                    NOT = { has_council_position = councillor_marshal }
                    has_title = title:e_minister_grand_marshal
                    has_title = title:e_minister_of_war
                }
            }
            958 = {
                AND = {
                    has_council_position = councillor_spymaster
                    NOT = { has_title = title:e_minister_censor}
                }
            }
            959 = {
                OR = {
                    NOT = { has_council_position = councillor_spymaster }
                    has_title = title:e_minister_censor
                }
            }
            960 = { has_council_position = councillor_spouse }
            961 = { NOT = { has_council_position = councillor_spouse } }
            962 = { has_council_position = councillor_vizier }
            963 = { NOT = { has_council_position = councillor_vizier } }
            964 = { 
                OR = {
                    has_council_position = councillor_kurultai_1
                    has_council_position = councillor_kurultai_2
                    has_council_position = councillor_kurultai_3
                    has_council_position = councillor_kurultai_4
                }
            }
            965 = { 
                NOR = {
                    has_council_position = councillor_kurultai_1
                    has_council_position = councillor_kurultai_2
                    has_council_position = councillor_kurultai_3
                    has_council_position = councillor_kurultai_4
                }
            }
            
            # Ministers
            966 = {
                OR = {
                    has_council_position = minister_justice
                    has_title = title:e_minister_of_justice
                }
            }
            967 = { 
                NOR = {
                    has_council_position = minister_justice
                    has_title = title:e_minister_of_justice
                }
            }
            968 = {
                OR = {
                    has_council_position = minister_personnel
                    has_title = title:e_minister_of_personnel
                }
            }
            969 = { 
                NOR = {
                    has_council_position = minister_personnel
                    has_title = title:e_minister_of_personnel
                }
            }
            970 = {
                OR = {
                    has_council_position = minister_works
                    has_title = title:e_minister_of_works
                }
            }
            971 = { 
                NOR = {
                    has_council_position = minister_works
                    has_title = title:e_minister_of_works
                }
            }
            972 = {
                OR = {
                    has_council_position = minister_grand_marshal
                    has_title = title:e_minister_grand_marshal
                }
            }
            973 = { 
                NOR = {
                    has_council_position = minister_grand_marshal
                    has_title = title:e_minister_grand_marshal
                }
            }
            974 = { has_title = title:e_minister_chancellor }
            975 = { NOT = { has_title = title:e_minister_chancellor } }
            976 = { has_title = title:e_minister_censor }
            977 = { NOT = { has_title = title:e_minister_censor } }
            978 = { has_title = title:e_minister_of_revenue }
            979 = { NOT = { has_title = title:e_minister_of_revenue } }
            980 = { has_title = title:e_minister_of_rites }
            981 = { NOT = { has_title = title:e_minister_of_rites } }
            982 = { has_title = title:e_minister_of_war }
            983 = { NOT = { has_title = title:e_minister_of_war } }

            998 = { has_trait = beardless_eunuch }
            999 = { NOT = { has_trait = beardless_eunuch } }
            
            1000 = {
                global_var:acs_gv_main_filters = {
                    any_in_global_list = {
                        variable = acs_gvl_filter_inspiration_reduced
                        save_temporary_scope_as = filter2
                        $CANDIDATE$ = {
                            switch = {
                                trigger = scope:filter2
                                0 = { any_inspiration = { has_inspiration_type = weapon_inspiration inspiration_owner = scope:candidate } }
                                1 = { any_inspiration = { NOT = { has_inspiration_type = weapon_inspiration inspiration_owner = scope:candidate } } }
                                2 = { any_inspiration = { has_inspiration_type = armor_inspiration inspiration_owner = scope:candidate } }
                                3 = { any_inspiration = { NOT = { has_inspiration_type = armor_inspiration inspiration_owner = scope:candidate } } }
                                4 = { any_inspiration = { has_inspiration_type = book_inspiration inspiration_owner = scope:candidate } }
                                5 = { any_inspiration = { NOT = { has_inspiration_type = book_inspiration inspiration_owner = scope:candidate } } }
                                6 = { any_inspiration = { has_inspiration_type = weaver_inspiration inspiration_owner = scope:candidate } }
                                7 = { any_inspiration = { NOT = { has_inspiration_type = weaver_inspiration inspiration_owner = scope:candidate } } }
                                8 = { any_inspiration = { has_inspiration_type = adventure_inspiration inspiration_owner = scope:candidate } }
                                9 = { any_inspiration = { NOT = { has_inspiration_type = adventure_inspiration inspiration_owner = scope:candidate } } }
                                10 = { any_inspiration = { has_inspiration_type = artisan_inspiration inspiration_owner = scope:candidate } }
                                11 = { any_inspiration = { NOT = { has_inspiration_type = artisan_inspiration inspiration_owner = scope:candidate } } }
                                12 = { any_inspiration = { has_inspiration_type = smith_inspiration inspiration_owner = scope:candidate } }
                                13 = { any_inspiration = { NOT = { has_inspiration_type = smith_inspiration inspiration_owner = scope:candidate } } }
                                14 = { any_inspiration = { has_inspiration_type = alchemy_inspiration inspiration_owner = scope:candidate } }
                                15 = { any_inspiration = { NOT = { has_inspiration_type = alchemy_inspiration inspiration_owner = scope:candidate } } }
                                26 = { any_inspiration = { inspiration_owner = scope:candidate } }
                                27 = { NOT = { any_inspiration = { inspiration_owner = scope:candidate } } }
                            }
                        }
                        count = global_var:acs_gv_filter_inspiration_count
                    }
                }
            }
            1001 = { has_completed_inspiration = yes  }
            1002 = { NOT = { has_completed_inspiration = yes } }
            1003 = { any_character_artifact = { category = inventory } }
            1004 = { NOT = { any_character_artifact = { category = inventory } } }
            1005 = { any_character_artifact = { category = court } }
            1006 = { NOT = { any_character_artifact = { category = court } } }

            1101 = { has_trait = diplomatic_court_1 }
            1102 = { NOT = { has_trait = diplomatic_court_1 } }
            1103 = { has_trait = diplomatic_court_2 }
            1104 = { NOT = { has_trait = diplomatic_court_2 } }
            1105 = { has_trait = warlike_court_1 }
            1106 = { NOT = { has_trait = warlike_court_1 } }
            1107 = { has_trait = warlike_court_2 }
            1108 = { NOT = { has_trait = warlike_court_2 } }
            1109 = { has_trait = administrative_court_1 }
            1110 = { NOT = { has_trait = administrative_court_1 } }
            1111 = { has_trait = administrative_court_2 }
            1112 = { NOT = { has_trait = administrative_court_2 } }
            1113 = { has_trait = intrigue_court_1 }
            1114 = { NOT = { has_trait = intrigue_court_1 } }
            1115 = { has_trait = intrigue_court_2 }
            1116 = { NOT = { has_trait = intrigue_court_2 } }
            1117 = { has_trait = scholarly_court_1 }
            1118 = { NOT = { has_trait = scholarly_court_1 } }
            1119 = { has_trait = scholarly_court_2 }
            1120 = { NOT = { has_trait = scholarly_court_2 } }
            1121 = { has_trait = education_republican_knowledge_1 }
            1122 = { NOT = { has_trait = education_republican_knowledge_1 } }
            1123 = { has_trait = education_republican_knowledge_2 }
            1124 = { NOT = { has_trait = education_republican_knowledge_2 } }
            1125 = { has_trait = education_republican_knowledge_3 }
            1126 = { NOT = { has_trait = education_republican_knowledge_3 } }
            1127 = { has_trait = education_republican_knowledge_4 }
            1128 = { NOT = { has_trait = education_republican_knowledge_4 } }
            1129 = { has_trait = lifestyle_voyager }
            1130 = { NOT = { has_trait = lifestyle_voyager } }
            1131 = { has_trait = lifestyle_wayfarer }
            1132 = { NOT = { has_trait = lifestyle_wayfarer } }
            1133 = { has_trait = lifestyle_surveyor }
            1134 = { NOT = { has_trait = lifestyle_surveyor } }
            1137 = { has_trait = despoiler_of_byzantium }
            1138 = { NOT = { has_trait = despoiler_of_byzantium } }
            1139 = { has_trait = campeador }
            1140 = { NOT = { has_trait = campeador } }
            1143 = { has_trait = lifestyle_seasoned_pastor }
            1144 = { NOT = { has_trait = lifestyle_seasoned_pastor } }
            1145 = { has_trait = nomadic_philosophy }
            1146 = { NOT = { has_trait = nomadic_philosophy } }
            1147 = { has_trait = adventurer_follower }
            1148 = { NOT = { has_trait = adventurer_follower } }
            1151 = { has_trait = historical_character }
            1152 = { NOT = { has_trait = historical_character } }
            1153 = { has_trait = conqueror }
            1154 = { NOT = { has_trait = conqueror } }
            1155 = { has_trait = loyal }
            1156 = { NOT = { has_trait = loyal } }
            1157 = { has_trait = former_emperor }
            1158 = { NOT = { has_trait = former_emperor } }
            1159 = { has_trait = populist_leader }
            1160 = { NOT = { has_trait = populist_leader } }
            1161 = { has_trait = burdened }
            1162 = { NOT = { has_trait = burdened } }
            1163 = { has_trait = gallivanter }
            1164 = { NOT = { has_trait = gallivanter } }
            1165 = { has_trait = disloyal }
            1166 = { NOT = { has_trait = disloyal } }
            1169 = { has_trait = golden_lineage }
            1170 = { NOT = { has_trait = golden_lineage } }

            1171 = { has_trait = education_diplomacy_5 }
            1172 = { NOT = { has_trait = education_diplomacy_5 } }
            1173 = { has_trait = education_martial_5 }
            1174 = { NOT = { has_trait = education_martial_5 } }
            1175 = { has_trait = education_stewardship_5 }
            1176 = { NOT = { has_trait = education_stewardship_5 } }
            1177 = { has_trait = education_intrigue_5 }
            1178 = { NOT = { has_trait = education_intrigue_5 } }
            1179 = { has_trait = education_learning_5 }
            1180 = { NOT = { has_trait = education_learning_5 } }

            1190 = { has_sexuality = heterosexual }
            1191 = { has_sexuality = homosexual }
            1192 = { has_sexuality = bisexual }
            1193 = { has_sexuality = asexual }
            1194 = { is_attracted_to_men = yes }
            1195 = { is_attracted_to_men = no }
            1196 = { is_attracted_to_women = yes }
            1197 = { is_attracted_to_women = no }

            1200 = { is_married = yes }
            1201 = { is_married = no }
            1202 = { is_betrothed = yes }
            1203 = { is_betrothed = no }
            1204 = { matrilinear_marriage = yes }
            1205 = { matrilinear_marriage = no }
            1206 = { patrilinear_marriage = yes }
            1207 = { patrilinear_marriage = no }
            1208 = { matrilinear_betrothal = yes }
            1209 = { matrilinear_betrothal = no }
            1210 = { patrilinear_betrothal = yes }
            1211 = { patrilinear_betrothal = no }
            1212 = { is_concubine = yes }
            1213 = { is_concubine = no }
            1214 = { 
                is_concubine = no
                is_married = no
                is_betrothed = no
            }
			
            1220 = { is_at_war = yes }
            1221 = { is_at_war = no }
            1222 = { is_in_civil_war = yes }
            1223 = { 
                is_at_war = yes
                is_in_civil_war = no 
			}
            1224 = { is_at_war_with_liege = yes}
            1225 = { 
                is_at_war = yes
                is_at_war_with_liege = no 
			}
            1226 = { is_at_war_as_attacker = yes }
            1227 = { is_at_war_as_defender = yes }
            1228 = { 
                is_at_war_as_attacker = yes 
                is_at_war_as_defender = yes 
			}

	        1231 = { 
                OR = { 
                    is_in_army = yes 
                    is_commanding_army = yes
                }
            }
	        1232 = { 
                NOR = { 
                    is_in_army = yes 
                    is_commanding_army = yes
                }
            }
	        1233 = { is_commanding_army = yes }
	        1234 = { 
                is_in_army = yes
                is_commanding_army = no 
			}

            1236 = { 
                OR = { 
                    is_a_faction_leader = yes 
                    is_a_faction_member = yes
                }
            }
            1237 = { 
                NOR = { 
                    is_a_faction_leader = yes 
                    is_a_faction_member = yes
                }
            }
            1238 = { is_a_faction_leader = yes }
            1239 = { is_a_faction_leader = no }
            
	        1241 = { has_targeting_faction = yes }
	        1242 = { has_targeting_faction = no }

            1250 = { is_house_head = yes }
            1251 = { is_house_head = no }
            1252 = { this = this.dynasty.dynast }
            1253 = { NOT = { this = this.dynasty.dynast } }
            1254 = { this = this.faith.religious_head }
            1255 = { this != this.faith.religious_head }

            1300 = { has_government = feudal_government }
            1301 = { has_government = republic_government }
            1302 = { has_government = theocracy_government }
            1303 = { has_government = clan_government }
            1304 = { has_government = tribal_government }
            1305 = { has_government = mercenary_government }
            1306 = { has_government = holy_order_government }
            1307 = { has_government = administrative_government }
            1308 = { has_government = landless_adventurer_government }
            1309 = { has_government = nomad_government }
            1310 = { has_government = herder_government }
            1311 = { has_government = wanua_government }
            1312 = { has_government = celestial_government }
            1313 = { has_government = mandala_government }
            1314 = { has_government = steppe_admin_government }
            1315 = { has_government = meritocratic_government }
            1316 = { has_government = japan_administrative_government }
            1317 = { has_government = japan_feudal_government }

            1320 = { NOT = { has_government = feudal_government } }
            1321 = { NOT = { has_government = republic_government } }
            1322 = { NOT = { has_government = theocracy_government } }
            1323 = { NOT = { has_government = clan_government } }
            1324 = { NOT = { has_government = tribal_government } }
            1325 = { NOT = { has_government = mercenary_government } }
            1326 = { NOT = { has_government = holy_order_government } }
            1327 = { NOT = { has_government = administrative_government } }
            1328 = { NOT = { has_government = landless_adventurer_government } }
            1329 = { NOT = { has_government = nomad_government } }
            1330 = { NOT = { has_government = herder_government } }
            1331 = { NOT = { has_government = wanua_government } }
            1332 = { NOT = { has_government = celestial_government } }
            1333 = { NOT = { has_government = mandala_government } }
            1334 = { NOT = { has_government = steppe_admin_government } }
            1335 = { NOT = { has_government = meritocratic_government } }
            1336 = { NOT = { has_government = japan_administrative_government } }
            1337 = { NOT = { has_government = japan_feudal_government } }
            
            1350 = { 
                is_ruler = yes
                vassal_contract_has_modifiable_obligations = yes
            }
            1351 = { 
                is_ruler = yes
                vassal_contract_has_modifiable_obligations = no
            }
            1352 = { 
                is_ruler = yes
                subject_contract_is_blocked_from_modification = yes
            }
            1353 = { 
                is_ruler = yes
                subject_contract_is_blocked_from_modification = no
            }
            1354 = { 
                is_ruler = yes
                has_free_council_slot = yes 
            }
            1355 = { 
                is_ruler = yes
                has_free_council_slot = no 
            }
            1356 = {
                is_ruler = yes
                is_powerful_vassal = yes
            }
            1357 = {
                is_ruler = yes
                is_powerful_vassal = no
            }

            1400 = { is_travelling_at_activity = yes }
            1401 = { NOT = { is_travelling_at_activity = yes } }

            1410 = { 
                OR = { 
                    is_travelling = yes 
                    is_travelling_at_activity = yes
                    is_travelling_not_at_activity = yes
                    is_in_army = yes
                    is_commanding_army = yes
                    is_imprisoned = yes
                }
            }
            1411 = { 
                NOR = { 
                    is_travelling = yes
                    is_travelling_at_activity = yes
                    is_travelling_not_at_activity = yes
                    is_in_army = yes
                    is_commanding_army = yes
                    is_imprisoned = yes
                }
            }

            1500 = { is_courtier = yes }
            1501 = { is_courtier = no }
            1502 = { # All guests, whether they have a liege or not
                is_foreign_court_or_pool_guest = yes 
                is_imprisoned = no 
			} 
            1503 = { 
                OR = {
                    is_foreign_court_or_pool_guest = no 
                    is_imprisoned = yes
                }
            }
            1504 = { is_pool_character = yes } # not a ruler, courtier or guest at any court
            1505 = { is_pool_character = no }

            # Court positions
            1510 = { has_court_position = court_physician_court_position }
            1511 = { NOT = { has_court_position = court_physician_court_position } }
            1512 = { has_court_position = chief_qadi_court_position }
            1513 = { NOT = { has_court_position = chief_qadi_court_position } }
            1514 = { has_court_position = antiquarian_court_position }
            1515 = { NOT = { has_court_position = antiquarian_court_position } }
            1516 = { has_court_position = wet_nurse_court_position }
            1517 = { NOT = { has_court_position = wet_nurse_court_position } }
            1518 = { has_court_position = high_almoner_court_position }
            1519 = { NOT = { has_court_position = high_almoner_court_position } }
            1520 = { has_court_position = court_artificer_court_position }
            1521 = { NOT = { has_court_position = court_artificer_court_position } }
            1522 = { has_court_position = cave_hermit_court_position }
            1523 = { NOT = { has_court_position = cave_hermit_court_position } }
            1524 = { has_court_position = court_astrologer_court_position }
            1525 = { NOT = { has_court_position = court_astrologer_court_position } }
            1526 = { has_court_position = bookmaker_court_position }
            1527 = { NOT = { has_court_position = bookmaker_court_position } }
            1528 = { has_court_position = court_gardener_court_position }
            1529 = { NOT = { has_court_position = court_gardener_court_position } }
            1530 = { has_court_position = travel_leader_court_position }
            1531 = { NOT = { has_court_position = travel_leader_court_position } }
            1532 = { has_court_position = royal_architect_court_position }
            1533 = { NOT = { has_court_position = royal_architect_court_position } }
            1534 = { has_court_position = seneschal_court_position }
            1535 = { NOT = { has_court_position = seneschal_court_position } }
            1536 = { has_court_position = yurtchi_court_position }
            1537 = { NOT = { has_court_position = yurtchi_court_position } }
            1538 = { has_court_position = akolouthos_court_position }
            1539 = { NOT = { has_court_position = akolouthos_court_position } }
            1540 = { has_court_position = master_of_horse_court_position }
            1541 = { NOT = { has_court_position = master_of_horse_court_position } }
            1542 = { has_court_position = boyan_court_position }
            1543 = { NOT = { has_court_position = boyan_court_position } }
            1544 = { has_court_position = siege_engineer_court_position }
            1545 = { NOT = { has_court_position = siege_engineer_court_position } }
            1546 = { has_court_position = cultural_emissary_court_position }
            1547 = { NOT = { has_court_position = cultural_emissary_court_position } }
            1548 = { has_court_position = lady_in_waiting_court_position }
            1549 = { NOT = { has_court_position = lady_in_waiting_court_position } }
            1550 = { has_court_position = cupbearer_court_position }
            1551 = { NOT = { has_court_position = cupbearer_court_position } }
            1552 = { has_court_position = chief_eunuch_court_position }
            1553 = { NOT = { has_court_position = chief_eunuch_court_position } }
            1554 = { has_court_position = court_jester_court_position }
            1555 = { NOT = { has_court_position = court_jester_court_position } }
            1556 = { has_court_position = chronicler_court_position }
            1557 = { NOT = { has_court_position = chronicler_court_position } }
            1558 = { has_court_position = grand_preceptor_court_position }
            1559 = { NOT = { has_court_position = grand_preceptor_court_position } }
            1560 = { has_court_position = grand_guardian_court_position }
            1561 = { NOT = { has_court_position = grand_guardian_court_position } }
            1562 = { has_court_position = grand_mentor_court_position }
            1563 = { NOT = { has_court_position = grand_mentor_court_position } }
            1564 = { has_court_position = fire_dragon_engineer_court_position }
            1565 = { NOT = { has_court_position = fire_dragon_engineer_court_position } }
            1566 = { has_court_position = keeper_of_the_harem_court_position }
            1567 = { NOT = { has_court_position = keeper_of_the_harem_court_position } }
            1568 = { has_court_position = yeke_jarquchi_court_position }
            1569 = { NOT = { has_court_position = yeke_jarquchi_court_position } }
            1570 = { has_court_position = foreign_emissary_court_position }
            1571 = { NOT = { has_court_position = foreign_emissary_court_position } }
            1572 = { has_court_position = court_scholar_court_position }
            1573 = { NOT = { has_court_position = court_scholar_court_position } }
            1574 = { has_court_position = food_taster_court_position }
            1575 = { NOT = { has_court_position = food_taster_court_position } }
            1576 = { has_court_position = court_brewmaster_court_position }
            1577 = { NOT = { has_court_position = court_brewmaster_court_position } }
            1578 = { has_court_position = keeper_of_swans_court_position }
            1579 = { NOT = { has_court_position = keeper_of_swans_court_position } }
            1580 = { has_court_position = master_of_hunt_court_position }
            1581 = { NOT = { has_court_position = master_of_hunt_court_position } }
            1582 = { has_court_position = garuda_court_position }
            1583 = { NOT = { has_court_position = garuda_court_position } }
            1584 = { has_court_position = bodyguard_court_position }
            1585 = { NOT = { has_court_position = bodyguard_court_position } }
            1586 = { has_court_position = champion_court_position }
            1587 = { NOT = { has_court_position = champion_court_position } }
            1588 = { has_court_position = master_assassin_court_position }
            1589 = { NOT = { has_court_position = master_assassin_court_position } }
            1590 = { has_court_position = charioteer_court_position }
            1591 = { NOT = { has_court_position = charioteer_court_position } }
            1592 = { has_court_position = executioner_court_position }
            1593 = { NOT = { has_court_position = executioner_court_position } }
            1594 = { has_court_position = favored_minister_court_position }
            1595 = { NOT = { has_court_position = favored_minister_court_position } }
            1596 = { has_court_position = court_tutor_court_position }
            1597 = { NOT = { has_court_position = court_tutor_court_position } }
            1598 = { has_court_position = court_guru_court_position }
            1599 = { NOT = { has_court_position = court_guru_court_position } }
            1600 = { has_court_position = eparch_court_position }
            1601 = { NOT = { has_court_position = eparch_court_position } }
            1602 = { has_court_position = cherbi_court_position }
            1603 = { NOT = { has_court_position = cherbi_court_position } }
            1604 = { has_court_position = keeper_of_the_horses_court_position }
            1605 = { NOT = { has_court_position = keeper_of_the_horses_court_position } }
            1606 = { has_court_position = court_poet_court_position }
            1607 = { NOT = { has_court_position = court_poet_court_position } }
            1608 = { has_court_position = court_musician_court_position }
            1609 = { NOT = { has_court_position = court_musician_court_position } }

            # Camp positions
            1700 = { has_court_position = stooge_camp_officer }
            1701 = { NOT = { has_court_position = stooge_camp_officer } }
            1702 = { has_court_position = master_of_arms_camp_officer }
            1703 = { NOT = { has_court_position = master_of_arms_camp_officer } }
            1704 = { has_court_position = light_cavalry_captain_camp_officer }
            1705 = { NOT = { has_court_position = light_cavalry_captain_camp_officer } }
            1706 = { has_court_position = camelry_captain_camp_officer }
            1707 = { NOT = { has_court_position = camelry_captain_camp_officer } }
            1708 = { has_court_position = elephantry_captain_camp_officer }
            1709 = { NOT = { has_court_position = elephantry_captain_camp_officer } }
            1710 = { has_court_position = heavy_cavalry_captain_camp_officer }
            1711 = { NOT = { has_court_position = heavy_cavalry_captain_camp_officer } }
            1712 = { has_court_position = horse_archer_captain_camp_officer }
            1713 = { NOT = { has_court_position = horse_archer_captain_camp_officer } }
            1714 = { has_court_position = archer_captain_camp_officer }
            1715 = { NOT = { has_court_position = archer_captain_camp_officer } }
            1716 = { has_court_position = heavy_infantry_captain_camp_officer }
            1717 = { NOT = { has_court_position = heavy_infantry_captain_camp_officer } }
            1718 = { has_court_position = light_infantry_captain_camp_officer }
            1719 = { NOT = { has_court_position = light_infantry_captain_camp_officer } }
            1720 = { has_court_position = pike_captain_camp_officer }
            1721 = { NOT = { has_court_position = pike_captain_camp_officer } }
            1722 = { has_court_position = second_camp_officer }
            1723 = { NOT = { has_court_position = second_camp_officer } }
            1724 = { has_court_position = quartermaster_camp_officer }
            1725 = { NOT = { has_court_position = quartermaster_camp_officer } }
            1726 = { has_court_position = armorer_camp_officer }
            1727 = { NOT = { has_court_position = armorer_camp_officer } }
            1728 = { has_court_position = chief_forager_camp_officer }
            1729 = { NOT = { has_court_position = chief_forager_camp_officer } }
            1730 = { has_court_position = master_thief_camp_officer }
            1731 = { NOT = { has_court_position = master_thief_camp_officer } }
            1732 = { has_court_position = head_porter_camp_officer }
            1733 = { NOT = { has_court_position = head_porter_camp_officer } }
            1734 = { has_court_position = head_groom_camp_officer }
            1735 = { NOT = { has_court_position = head_groom_camp_officer } }
            1736 = { has_court_position = huntperson_camp_officer }
            1737 = { NOT = { has_court_position = huntperson_camp_officer } }
            1738 = { has_court_position = kennelperson_camp_officer }
            1739 = { NOT = { has_court_position = kennelperson_camp_officer } }
            1740 = { has_court_position = chief_engineer_camp_officer }
            1741 = { NOT = { has_court_position = chief_engineer_camp_officer } }
            1742 = { has_court_position = witness_camp_officer }
            1743 = { NOT = { has_court_position = witness_camp_officer } }
            1744 = { has_court_position = person_haggler_camp_officer }
            1745 = { NOT = { has_court_position = person_haggler_camp_officer } }
            1746 = { has_court_position = camp_cook_camp_officer }
            1747 = { NOT = { has_court_position = camp_cook_camp_officer } }
            1748 = { has_court_position = master_bard_camp_officer }
            1749 = { NOT = { has_court_position = master_bard_camp_officer } }
            1750 = { has_court_position = master_of_spoils_camp_officer }
            1751 = { NOT = { has_court_position = master_of_spoils_camp_officer } }
            1752 = { has_court_position = laureate_camp_officer }
            1753 = { NOT = { has_court_position = laureate_camp_officer } }
            1754 = { has_court_position = camp_priest_camp_officer }
            1755 = { NOT = { has_court_position = camp_priest_camp_officer } }

            # Commander traits
            3000 = { has_trait = logistician }
            3001 = { NOT = { has_trait = logistician } }
            3002 = { is_level_0_of_3 = { TRAIT = logistician } }
            3003 = { is_not_level_0_of_3 = { TRAIT = logistician } }
            3004 = { is_level_1_of_3 = { TRAIT = logistician } }
            3005 = { is_not_level_1_of_3 = { TRAIT = logistician } }
            3006 = { is_level_2_of_3 = { TRAIT = logistician } }
            3007 = { is_not_level_2_of_3 = { TRAIT = logistician } }
            3008 = { is_level_3_of_3 = { TRAIT = logistician } }
            3009 = { is_not_level_3_of_3 = { TRAIT = logistician } }
            3010 = { has_trait = military_engineer }
            3011 = { NOT = { has_trait = military_engineer } }
            3012 = { is_level_0_of_3 = { TRAIT = military_engineer } }
            3013 = { is_not_level_0_of_3 = { TRAIT = military_engineer } }
            3014 = { is_level_1_of_3 = { TRAIT = military_engineer } }
            3015 = { is_not_level_1_of_3 = { TRAIT = military_engineer } }
            3016 = { is_level_2_of_3 = { TRAIT = military_engineer } }
            3017 = { is_not_level_2_of_3 = { TRAIT = military_engineer } }
            3018 = { is_level_3_of_3 = { TRAIT = military_engineer } }
            3019 = { is_not_level_3_of_3 = { TRAIT = military_engineer } }
            3020 = { has_trait = aggressive_attacker }
            3021 = { NOT = { has_trait = aggressive_attacker } }
            3022 = { is_level_0_of_3 = { TRAIT = aggressive_attacker } }
            3023 = { is_not_level_0_of_3 = { TRAIT = aggressive_attacker } }
            3024 = { is_level_1_of_3 = { TRAIT = aggressive_attacker } }
            3025 = { is_not_level_1_of_3 = { TRAIT = aggressive_attacker } }
            3026 = { is_level_2_of_3 = { TRAIT = aggressive_attacker } }
            3027 = { is_not_level_2_of_3 = { TRAIT = aggressive_attacker } }
            3028 = { is_level_3_of_3 = { TRAIT = aggressive_attacker } }
            3029 = { is_not_level_3_of_3 = { TRAIT = aggressive_attacker } }
            3030 = { has_trait = unyielding_defender }
            3031 = { NOT = { has_trait = unyielding_defender } }
            3032 = { is_level_0_of_3 = { TRAIT = unyielding_defender } }
            3033 = { is_not_level_0_of_3 = { TRAIT = unyielding_defender } }
            3034 = { is_level_1_of_3 = { TRAIT = unyielding_defender } }
            3035 = { is_not_level_1_of_3 = { TRAIT = unyielding_defender } }
            3036 = { is_level_2_of_3 = { TRAIT = unyielding_defender } }
            3037 = { is_not_level_2_of_3 = { TRAIT = unyielding_defender } }
            3038 = { is_level_3_of_3 = { TRAIT = unyielding_defender } }
            3039 = { is_not_level_3_of_3 = { TRAIT = unyielding_defender } }
            3040 = { has_trait = forder }
            3041 = { NOT = { has_trait = forder } }
            3042 = { is_level_0_of_3 = { TRAIT = forder } }
            3043 = { is_not_level_0_of_3 = { TRAIT = forder } }
            3044 = { is_level_1_of_3 = { TRAIT = forder } }
            3045 = { is_not_level_1_of_3 = { TRAIT = forder } }
            3046 = { is_level_2_of_3 = { TRAIT = forder } }
            3047 = { is_not_level_2_of_3 = { TRAIT = forder } }
            3048 = { is_level_3_of_3 = { TRAIT = forder } }
            3049 = { is_not_level_3_of_3 = { TRAIT = forder } }
            3050 = { has_trait = flexible_leader }
            3051 = { NOT = { has_trait = flexible_leader } }
            3052 = { is_level_0_of_3 = { TRAIT = flexible_leader } }
            3053 = { is_not_level_0_of_3 = { TRAIT = flexible_leader } }
            3054 = { is_level_1_of_3 = { TRAIT = flexible_leader } }
            3055 = { is_not_level_1_of_3 = { TRAIT = flexible_leader } }
            3056 = { is_level_2_of_3 = { TRAIT = flexible_leader } }
            3057 = { is_not_level_2_of_3 = { TRAIT = flexible_leader } }
            3058 = { is_level_3_of_3 = { TRAIT = flexible_leader } }
            3059 = { is_not_level_3_of_3 = { TRAIT = flexible_leader } }
            3060 = { has_trait = desert_warrior }
            3061 = { NOT = { has_trait = desert_warrior } }
            3062 = { is_level_0_of_3 = { TRAIT = desert_warrior } }
            3063 = { is_not_level_0_of_3 = { TRAIT = desert_warrior } }
            3064 = { is_level_1_of_3 = { TRAIT = desert_warrior } }
            3065 = { is_not_level_1_of_3 = { TRAIT = desert_warrior } }
            3066 = { is_level_2_of_3 = { TRAIT = desert_warrior } }
            3067 = { is_not_level_2_of_3 = { TRAIT = desert_warrior } }
            3068 = { is_level_3_of_3 = { TRAIT = desert_warrior } }
            3069 = { is_not_level_3_of_3 = { TRAIT = desert_warrior } }
            3070 = { has_trait = jungle_stalker }
            3071 = { NOT = { has_trait = jungle_stalker } }
            3072 = { is_level_0_of_3 = { TRAIT = jungle_stalker } }
            3073 = { is_not_level_0_of_3 = { TRAIT = jungle_stalker } }
            3074 = { is_level_1_of_3 = { TRAIT = jungle_stalker } }
            3075 = { is_not_level_1_of_3 = { TRAIT = jungle_stalker } }
            3076 = { is_level_2_of_3 = { TRAIT = jungle_stalker } }
            3077 = { is_not_level_2_of_3 = { TRAIT = jungle_stalker } }
            3078 = { is_level_3_of_3 = { TRAIT = jungle_stalker } }
            3079 = { is_not_level_3_of_3 = { TRAIT = jungle_stalker } }
            3080 = { has_trait = reaver }
            3081 = { NOT = { has_trait = reaver } }
            3082 = { is_level_0_of_3 = { TRAIT = reaver } }
            3083 = { is_not_level_0_of_3 = { TRAIT = reaver } }
            3084 = { is_level_1_of_3 = { TRAIT = reaver } }
            3085 = { is_not_level_1_of_3 = { TRAIT = reaver } }
            3086 = { is_level_2_of_3 = { TRAIT = reaver } }
            3087 = { is_not_level_2_of_3 = { TRAIT = reaver } }
            3088 = { is_level_3_of_3 = { TRAIT = reaver } }
            3089 = { is_not_level_3_of_3 = { TRAIT = reaver } }
            3090 = { has_trait = reckless }
            3091 = { NOT = { has_trait = reckless } }
            3092 = { is_level_0_of_3 = { TRAIT = reckless } }
            3093 = { is_not_level_0_of_3 = { TRAIT = reckless } }
            3094 = { is_level_1_of_3 = { TRAIT = reckless } }
            3095 = { is_not_level_1_of_3 = { TRAIT = reckless } }
            3096 = { is_level_2_of_3 = { TRAIT = reckless } }
            3097 = { is_not_level_2_of_3 = { TRAIT = reckless } }
            3098 = { is_level_3_of_3 = { TRAIT = reckless } }
            3099 = { is_not_level_3_of_3 = { TRAIT = reckless } }
            3100 = { has_trait = holy_warrior }
            3101 = { NOT = { has_trait = holy_warrior } }
            3102 = { is_level_0_of_3 = { TRAIT = holy_warrior } }
            3103 = { is_not_level_0_of_3 = { TRAIT = holy_warrior } }
            3104 = { is_level_1_of_3 = { TRAIT = holy_warrior } }
            3105 = { is_not_level_1_of_3 = { TRAIT = holy_warrior } }
            3106 = { is_level_2_of_3 = { TRAIT = holy_warrior } }
            3107 = { is_not_level_2_of_3 = { TRAIT = holy_warrior } }
            3108 = { is_level_3_of_3 = { TRAIT = holy_warrior } }
            3109 = { is_not_level_3_of_3 = { TRAIT = holy_warrior } }
            3110 = { has_trait = open_terrain_expert }
            3111 = { NOT = { has_trait = open_terrain_expert } }
            3112 = { is_level_0_of_3 = { TRAIT = open_terrain_expert } }
            3113 = { is_not_level_0_of_3 = { TRAIT = open_terrain_expert } }
            3114 = { is_level_1_of_3 = { TRAIT = open_terrain_expert } }
            3115 = { is_not_level_1_of_3 = { TRAIT = open_terrain_expert } }
            3116 = { is_level_2_of_3 = { TRAIT = open_terrain_expert } }
            3117 = { is_not_level_2_of_3 = { TRAIT = open_terrain_expert } }
            3118 = { is_level_3_of_3 = { TRAIT = open_terrain_expert } }
            3119 = { is_not_level_3_of_3 = { TRAIT = open_terrain_expert } }
            3120 = { has_trait = rough_terrain_expert }
            3121 = { NOT = { has_trait = rough_terrain_expert } }
            3122 = { is_level_0_of_3 = { TRAIT = rough_terrain_expert } }
            3123 = { is_not_level_0_of_3 = { TRAIT = rough_terrain_expert } }
            3124 = { is_level_1_of_3 = { TRAIT = rough_terrain_expert } }
            3125 = { is_not_level_1_of_3 = { TRAIT = rough_terrain_expert } }
            3126 = { is_level_2_of_3 = { TRAIT = rough_terrain_expert } }
            3127 = { is_not_level_2_of_3 = { TRAIT = rough_terrain_expert } }
            3128 = { is_level_3_of_3 = { TRAIT = rough_terrain_expert } }
            3129 = { is_not_level_3_of_3 = { TRAIT = rough_terrain_expert } }
            3130 = { has_trait = forest_fighter }
            3131 = { NOT = { has_trait = forest_fighter } }
            3132 = { is_level_0_of_3 = { TRAIT = forest_fighter } }
            3133 = { is_not_level_0_of_3 = { TRAIT = forest_fighter } }
            3134 = { is_level_1_of_3 = { TRAIT = forest_fighter } }
            3135 = { is_not_level_1_of_3 = { TRAIT = forest_fighter } }
            3136 = { is_level_2_of_3 = { TRAIT = forest_fighter } }
            3137 = { is_not_level_2_of_3 = { TRAIT = forest_fighter } }
            3138 = { is_level_3_of_3 = { TRAIT = forest_fighter } }
            3139 = { is_not_level_3_of_3 = { TRAIT = forest_fighter } }
            3140 = { has_trait = cautious_leader }
            3141 = { NOT = { has_trait = cautious_leader } }
            3142 = { is_level_0_of_3 = { TRAIT = cautious_leader } }
            3143 = { is_not_level_0_of_3 = { TRAIT = cautious_leader } }
            3144 = { is_level_1_of_3 = { TRAIT = cautious_leader } }
            3145 = { is_not_level_1_of_3 = { TRAIT = cautious_leader } }
            3146 = { is_level_2_of_3 = { TRAIT = cautious_leader } }
            3147 = { is_not_level_2_of_3 = { TRAIT = cautious_leader } }
            3148 = { is_level_3_of_3 = { TRAIT = cautious_leader } }
            3149 = { is_not_level_3_of_3 = { TRAIT = cautious_leader } }
            3150 = { has_trait = organizer }
            3151 = { NOT = { has_trait = organizer } }
            3152 = { is_level_0_of_3 = { TRAIT = organizer } }
            3153 = { is_not_level_0_of_3 = { TRAIT = organizer } }
            3154 = { is_level_1_of_3 = { TRAIT = organizer } }
            3155 = { is_not_level_1_of_3 = { TRAIT = organizer } }
            3156 = { is_level_2_of_3 = { TRAIT = organizer } }
            3157 = { is_not_level_2_of_3 = { TRAIT = organizer } }
            3158 = { is_level_3_of_3 = { TRAIT = organizer } }
            3159 = { is_not_level_3_of_3 = { TRAIT = organizer } }
            3160 = { has_trait = winter_soldier }
            3161 = { NOT = { has_trait = winter_soldier } }
            3162 = { is_level_0_of_3 = { TRAIT = winter_soldier } }
            3163 = { is_not_level_0_of_3 = { TRAIT = winter_soldier } }
            3164 = { is_level_1_of_3 = { TRAIT = winter_soldier } }
            3165 = { is_not_level_1_of_3 = { TRAIT = winter_soldier } }
            3166 = { is_level_2_of_3 = { TRAIT = winter_soldier } }
            3167 = { is_not_level_2_of_3 = { TRAIT = winter_soldier } }
            3168 = { is_level_3_of_3 = { TRAIT = winter_soldier } }
            3169 = { is_not_level_3_of_3 = { TRAIT = winter_soldier } }

            # leveled traits
            # Scarred
            3300 = { has_trait = scarred  }
            3301 = { NOT = { has_trait = scarred } }
            3302 = { is_level_0_of_2 = { TRAIT = scarred } }
            3303 = { is_not_level_0_of_2 = { TRAIT = scarred } }
            3304 = { is_level_1_of_2 = { TRAIT = scarred } }
            3305 = { is_not_level_1_of_2 = { TRAIT = scarred } }
            3306 = { is_level_2_of_2 = { TRAIT = scarred } }
            3307 = { is_not_level_2_of_2 = { TRAIT = scarred } }
            # Pilgrim
            3308 = { has_trait = pilgrim }
            3309 = { NOT = { has_trait = pilgrim } }
            3310 = { is_level_0_of_2 = { TRAIT = pilgrim } }
            3311 = { is_not_level_0_of_2 = { TRAIT = pilgrim } }
            3312 = { is_level_1_of_2 = { TRAIT = pilgrim } }
            3313 = { is_not_level_1_of_2 = { TRAIT = pilgrim } }
            3314 = { is_level_2_of_2 = { TRAIT = pilgrim } }
            3315 = { is_not_level_2_of_2 = { TRAIT = pilgrim } }
            # Reveler
            3316 = { has_trait = lifestyle_reveler }
            3317 = { NOT = { has_trait = lifestyle_reveler } }
            3318 = { is_level_0_of_2 = { TRAIT = lifestyle_reveler } }
            3319 = { is_not_level_0_of_2 = { TRAIT = lifestyle_reveler } }
            3320 = { is_level_1_of_2 = { TRAIT = lifestyle_reveler } }
            3321 = { is_not_level_1_of_2 = { TRAIT = lifestyle_reveler } }
            3322 = { is_level_2_of_2 = { TRAIT = lifestyle_reveler } }
            3323 = { is_not_level_2_of_2 = { TRAIT = lifestyle_reveler } }
            # Blademaster
            3324 = { has_trait = lifestyle_blademaster }
            3325 = { NOT = { has_trait = lifestyle_blademaster } }
            3326 = { is_level_0_of_2 = { TRAIT = lifestyle_blademaster } }
            3327 = { is_not_level_0_of_2 = { TRAIT = lifestyle_blademaster } }
            3328 = { is_level_1_of_2 = { TRAIT = lifestyle_blademaster } }
            3329 = { is_not_level_1_of_2 = { TRAIT = lifestyle_blademaster } }
            3330 = { is_level_2_of_2 = { TRAIT = lifestyle_blademaster } }
            3331 = { is_not_level_2_of_2 = { TRAIT = lifestyle_blademaster } }
            # Hunter
            3332 = { has_trait = lifestyle_hunter }
            3333 = { NOT = { has_trait = lifestyle_hunter } }
            # Hunter - venator (hunter)
            3334 = { is_track_level_0_of_2 = { TRAIT = lifestyle_hunter TRACK = hunter } }
            3335 = { is_not_track_level_0_of_2 = { TRAIT = lifestyle_hunter TRACK = hunter } }
            3336 = { is_track_level_1_of_2 = { TRAIT = lifestyle_hunter TRACK = hunter } }
            3337 = { is_not_track_level_1_of_2 = { TRAIT = lifestyle_hunter TRACK = hunter } }
            3338 = { is_track_level_2_of_2 = { TRAIT = lifestyle_hunter TRACK = hunter } }
            3339 = { is_not_track_level_2_of_2 = { TRAIT = lifestyle_hunter TRACK = hunter } }
            # Hunter - Falconer
            3340 = { is_track_level_0_of_2 = { TRAIT = lifestyle_hunter TRACK = falconer } }
            3341 = { is_not_track_level_0_of_2 = { TRAIT = lifestyle_hunter TRACK = falconer } }
            3342 = { is_track_level_1_of_2 = { TRAIT = lifestyle_hunter TRACK = falconer } }
            3343 = { is_not_track_level_1_of_2 = { TRAIT = lifestyle_hunter TRACK = falconer } }
            3344 = { is_track_level_2_of_2 = { TRAIT = lifestyle_hunter TRACK = falconer } }
            3345 = { is_not_track_level_2_of_2 = { TRAIT = lifestyle_hunter TRACK = falconer } }
            # Mystic
            3346 = { has_trait = lifestyle_mystic }
            3347 = { NOT = { has_trait = lifestyle_mystic } }
            3348 = { is_level_0_of_2 = { TRAIT = lifestyle_mystic } }
            3349 = { is_not_level_0_of_2 = { TRAIT = lifestyle_mystic } }
            3350 = { is_level_1_of_2 = { TRAIT = lifestyle_mystic } }
            3351 = { is_not_level_1_of_2 = { TRAIT = lifestyle_mystic } }
            3352 = { is_level_2_of_2 = { TRAIT = lifestyle_mystic } }
            3353 = { is_not_level_2_of_2 = { TRAIT = lifestyle_mystic } }
            # Physician
            2998 = { has_trait = lifestyle_physician }
            2999 = { NOT = { has_trait = lifestyle_physician } }
            3354 = { is_level_0_of_2 = { TRAIT = lifestyle_physician } }
            3355 = { is_not_level_0_of_2 = { TRAIT = lifestyle_physician } }
            3356 = { is_level_1_of_2 = { TRAIT = lifestyle_physician } }
            3357 = { is_not_level_1_of_2 = { TRAIT = lifestyle_physician } }
            3358 = { is_level_2_of_2 = { TRAIT = lifestyle_physician } }
            3359 = { is_not_level_2_of_2 = { TRAIT = lifestyle_physician } }
            # Traveler
			3360 = { has_trait = lifestyle_traveler }
            3361 = { NOT = { has_trait = lifestyle_traveler } }
            # Traveler - wanderer (travel)
            3362 = { is_track_level_0_of_2 = { TRAIT = lifestyle_traveler TRACK = travel } }
            3363 = { is_not_track_level_0_of_2 = { TRAIT = lifestyle_traveler TRACK = travel } }
            3364 = { is_track_level_1_of_2 = { TRAIT = lifestyle_traveler TRACK = travel } }
            3365 = { is_not_track_level_1_of_2 = { TRAIT = lifestyle_traveler TRACK = travel } }
            3366 = { is_track_level_2_of_2 = { TRAIT = lifestyle_traveler TRACK = travel } }
            3367 = { is_not_track_level_2_of_2 = { TRAIT = lifestyle_traveler TRACK = travel } }
            # Traveler - seasoned (danger)
            3368 = { is_track_level_0_of_2 = { TRAIT = lifestyle_traveler TRACK = danger } }
            3369 = { is_not_track_level_0_of_2 = { TRAIT = lifestyle_traveler TRACK = danger } }
            3370 = { is_track_level_1_of_2 = { TRAIT = lifestyle_traveler TRACK = danger } }
            3371 = { is_not_track_level_1_of_2 = { TRAIT = lifestyle_traveler TRACK = danger } }
            3372 = { is_track_level_2_of_2 = { TRAIT = lifestyle_traveler TRACK = danger } }
            3373 = { is_not_track_level_2_of_2 = { TRAIT = lifestyle_traveler TRACK = danger } }
            # Tourney participant (Hastiluder)
			3374 = { has_trait = tourney_participant }
            3375 = { NOT = { has_trait = tourney_participant } }
            # Tourney participant - bow
			3376 = { is_track_level_0_of_3 = { TRAIT = tourney_participant TRACK = bow } }
            3377 = { is_not_track_level_0_of_3 = { TRAIT = tourney_participant TRACK = bow } }
            3378 = { is_track_level_1_of_3 = { TRAIT = tourney_participant TRACK = bow } }
            3379 = { is_not_track_level_1_of_3 = { TRAIT = tourney_participant TRACK = bow } }
            3380 = { is_track_level_2_of_3 = { TRAIT = tourney_participant TRACK = bow } }
            3381 = { is_not_track_level_2_of_3 = { TRAIT = tourney_participant TRACK = bow } }
            3382 = { is_track_level_3_of_3 = { TRAIT = tourney_participant TRACK = bow } }
            3383 = { is_not_track_level_3_of_3 = { TRAIT = tourney_participant TRACK = bow } }
            # Tourney participant - foot
			3384 = { is_track_level_0_of_3 = { TRAIT = tourney_participant TRACK = foot } }
            3385 = { is_not_track_level_0_of_3 = { TRAIT = tourney_participant TRACK = foot } }
            3386 = { is_track_level_1_of_3 = { TRAIT = tourney_participant TRACK = foot } }
            3387 = { is_not_track_level_1_of_3 = { TRAIT = tourney_participant TRACK = foot } }
            3388 = { is_track_level_2_of_3 = { TRAIT = tourney_participant TRACK = foot } }
            3389 = { is_not_track_level_2_of_3 = { TRAIT = tourney_participant TRACK = foot } }
            3390 = { is_track_level_3_of_3 = { TRAIT = tourney_participant TRACK = foot } }
            3391 = { is_not_track_level_3_of_3 = { TRAIT = tourney_participant TRACK = foot } }
            # Tourney participant - horse
            3392 = { is_track_level_0_of_3 = { TRAIT = tourney_participant TRACK = horse } }
            3393 = { is_not_track_level_0_of_3 = { TRAIT = tourney_participant TRACK = horse } }
            3394 = { is_track_level_1_of_3 = { TRAIT = tourney_participant TRACK = horse } }
            3395 = { is_not_track_level_1_of_3 = { TRAIT = tourney_participant TRACK = horse } }
            3396 = { is_track_level_2_of_3 = { TRAIT = tourney_participant TRACK = horse } }
            3397 = { is_not_track_level_2_of_3 = { TRAIT = tourney_participant TRACK = horse } }
            3398 = { is_track_level_3_of_3 = { TRAIT = tourney_participant TRACK = horse } }
            3399 = { is_not_track_level_3_of_3 = { TRAIT = tourney_participant TRACK = horse } }
            # Tourney participant - wit
            3400 = { is_track_level_0_of_3 = { TRAIT = tourney_participant TRACK = wit } }
            3401 = { is_not_track_level_0_of_3 = { TRAIT = tourney_participant TRACK = wit } }
            3402 = { is_track_level_1_of_3 = { TRAIT = tourney_participant TRACK = wit } }
            3403 = { is_not_track_level_1_of_3 = { TRAIT = tourney_participant TRACK = wit } }
            3404 = { is_track_level_2_of_3 = { TRAIT = tourney_participant TRACK = wit } }
            3405 = { is_not_track_level_2_of_3 = { TRAIT = tourney_participant TRACK = wit } }
            3406 = { is_track_level_3_of_3 = { TRAIT = tourney_participant TRACK = wit } }
            3407 = { is_not_track_level_3_of_3 = { TRAIT = tourney_participant TRACK = wit } }
            # Governor
            3408 = { has_trait = governor }
            3409 = { NOT = { has_trait = governor } }
            3410 = { is_level_0_of_4 = { TRAIT = governor } }
            3411 = { is_not_level_0_of_4 = { TRAIT = governor } }
            3412 = { is_level_1_of_4 = { TRAIT = governor } }
            3413 = { is_not_level_1_of_4 = { TRAIT = governor } }
            3414 = { is_level_2_of_4 = { TRAIT = governor } }
            3415 = { is_not_level_2_of_4 = { TRAIT = governor } }
            3416 = { is_level_3_of_4 = { TRAIT = governor } }
            3417 = { is_not_level_3_of_4 = { TRAIT = governor } }
            3418 = { is_level_4_of_4 = { TRAIT = governor } }
            3419 = { is_not_level_4_of_4 = { TRAIT = governor } }
            # Poet
            3420 = { has_trait = lifestyle_poet }
            3421 = { NOT = { has_trait = lifestyle_poet } }
            3422 = { is_level_0_of_2 = { TRAIT = lifestyle_poet } }
            3423 = { is_not_level_0_of_2 = { TRAIT = lifestyle_poet } }
            3424 = { is_level_1_of_2 = { TRAIT = lifestyle_poet } }
            3425 = { is_not_level_1_of_2 = { TRAIT = lifestyle_poet } }
            3426 = { is_level_2_of_2 = { TRAIT = lifestyle_poet } }
            3427 = { is_not_level_2_of_2 = { TRAIT = lifestyle_poet } }
            # Knight Errant
            3430 = { has_trait = knight_errant }
            3431 = { NOT = { has_trait = knight_errant } }
            3432 = { is_level_0_of_2 = { TRAIT = knight_errant } }
            3433 = { is_not_level_0_of_2 = { TRAIT = knight_errant } }
            3434 = { is_level_1_of_2 = { TRAIT = knight_errant } }
            3435 = { is_not_level_1_of_2 = { TRAIT = knight_errant } }
            3436 = { is_level_2_of_2 = { TRAIT = knight_errant } }
            3437 = { is_not_level_2_of_2 = { TRAIT = knight_errant } }
            # Gallowsbait
            3452 = { has_trait = gallowsbait }
            3453 = { NOT = { has_trait = gallowsbait } }
            # Gallowsbait - bandit
            3454 = { is_track_level_0_of_5 = { TRAIT = gallowsbait TRACK = bandit } }
            3455 = { is_not_track_level_0_of_5 = { TRAIT = gallowsbait TRACK = bandit } }
            3456 = { is_track_level_1_of_5 = { TRAIT = gallowsbait TRACK = bandit } }
            3457 = { is_not_track_level_1_of_5 = { TRAIT = gallowsbait TRACK = bandit } }
            3458 = { is_track_level_2_of_5 = { TRAIT = gallowsbait TRACK = bandit } }
            3459 = { is_not_track_level_2_of_5 = { TRAIT = gallowsbait TRACK = bandit } }
            3460 = { is_track_level_3_of_5 = { TRAIT = gallowsbait TRACK = bandit } }
            3461 = { is_not_track_level_3_of_5 = { TRAIT = gallowsbait TRACK = bandit } }
            3462 = { is_track_level_4_of_5 = { TRAIT = gallowsbait TRACK = bandit } }
            3463 = { is_not_track_level_4_of_5 = { TRAIT = gallowsbait TRACK = bandit } }
            3464 = { is_track_level_5_of_5 = { TRAIT = gallowsbait TRACK = bandit } }
            3465 = { is_not_track_level_5_of_5 = { TRAIT = gallowsbait TRACK = bandit } }
            # Gallowsbait - trickster
            3466 = { is_track_level_0_of_5 = { TRAIT = gallowsbait TRACK = trickster } }
            3467 = { is_not_track_level_0_of_5 = { TRAIT = gallowsbait TRACK = trickster } }
            3468 = { is_track_level_1_of_5 = { TRAIT = gallowsbait TRACK = trickster } }
            3469 = { is_not_track_level_1_of_5 = { TRAIT = gallowsbait TRACK = trickster } }
            3470 = { is_track_level_2_of_5 = { TRAIT = gallowsbait TRACK = trickster } }
            3471 = { is_not_track_level_2_of_5 = { TRAIT = gallowsbait TRACK = trickster } }
            3472 = { is_track_level_3_of_5 = { TRAIT = gallowsbait TRACK = trickster } }
            3473 = { is_not_track_level_3_of_5 = { TRAIT = gallowsbait TRACK = trickster } }
            3474 = { is_track_level_4_of_5 = { TRAIT = gallowsbait TRACK = trickster } }
            3475 = { is_not_track_level_4_of_5 = { TRAIT = gallowsbait TRACK = trickster } }
            3476 = { is_track_level_5_of_5 = { TRAIT = gallowsbait TRACK = trickster } }
            3477 = { is_not_track_level_5_of_5 = { TRAIT = gallowsbait TRACK = trickster } }
            # Gallowsbait - thief
            3478 = { is_track_level_0_of_5 = { TRAIT = gallowsbait TRACK = thief } }
            3479 = { is_not_track_level_0_of_5 = { TRAIT = gallowsbait TRACK = thief } }
            3480 = { is_track_level_1_of_5 = { TRAIT = gallowsbait TRACK = thief } }
            3481 = { is_not_track_level_1_of_5 = { TRAIT = gallowsbait TRACK = thief } }
            3482 = { is_track_level_2_of_5 = { TRAIT = gallowsbait TRACK = thief } }
            3483 = { is_not_track_level_2_of_5 = { TRAIT = gallowsbait TRACK = thief } }
            3484 = { is_track_level_3_of_5 = { TRAIT = gallowsbait TRACK = thief } }
            3485 = { is_not_track_level_3_of_5 = { TRAIT = gallowsbait TRACK = thief } }
            3486 = { is_track_level_4_of_5 = { TRAIT = gallowsbait TRACK = thief } }
            3487 = { is_not_track_level_4_of_5 = { TRAIT = gallowsbait TRACK = thief } }
            3488 = { is_track_level_5_of_5 = { TRAIT = gallowsbait TRACK = thief } }
            3489 = { is_not_track_level_5_of_5 = { TRAIT = gallowsbait TRACK = thief } }
            # Gallowsbait - poacher
            3490 = { is_track_level_0_of_5 = { TRAIT = gallowsbait TRACK = poacher } }
            3491 = { is_not_track_level_0_of_5 = { TRAIT = gallowsbait TRACK = poacher } }
            3492 = { is_track_level_1_of_5 = { TRAIT = gallowsbait TRACK = poacher } }
            3493 = { is_not_track_level_1_of_5 = { TRAIT = gallowsbait TRACK = poacher } }
            3494 = { is_track_level_2_of_5 = { TRAIT = gallowsbait TRACK = poacher } }
            3495 = { is_not_track_level_2_of_5 = { TRAIT = gallowsbait TRACK = poacher } }
            3496 = { is_track_level_3_of_5 = { TRAIT = gallowsbait TRACK = poacher } }
            3497 = { is_not_track_level_3_of_5 = { TRAIT = gallowsbait TRACK = poacher } }
            3498 = { is_track_level_4_of_5 = { TRAIT = gallowsbait TRACK = poacher } }
            3499 = { is_not_track_level_4_of_5 = { TRAIT = gallowsbait TRACK = poacher } }
            3500 = { is_track_level_5_of_5 = { TRAIT = gallowsbait TRACK = poacher } }
            3501 = { is_not_track_level_5_of_5 = { TRAIT = gallowsbait TRACK = poacher } }
            # Gallowsbait - marauder
            3502 = { is_track_level_0_of_5 = { TRAIT = gallowsbait TRACK = marauder } }
            3503 = { is_not_track_level_0_of_5 = { TRAIT = gallowsbait TRACK = marauder } }
            3504 = { is_track_level_1_of_5 = { TRAIT = gallowsbait TRACK = marauder } }
            3505 = { is_not_track_level_1_of_5 = { TRAIT = gallowsbait TRACK = marauder } }
            3506 = { is_track_level_2_of_5 = { TRAIT = gallowsbait TRACK = marauder } }
            3507 = { is_not_track_level_2_of_5 = { TRAIT = gallowsbait TRACK = marauder } }
            3508 = { is_track_level_3_of_5 = { TRAIT = gallowsbait TRACK = marauder } }
            3509 = { is_not_track_level_3_of_5 = { TRAIT = gallowsbait TRACK = marauder } }
            3510 = { is_track_level_4_of_5 = { TRAIT = gallowsbait TRACK = marauder } }
            3511 = { is_not_track_level_4_of_5 = { TRAIT = gallowsbait TRACK = marauder } }
            3512 = { is_track_level_5_of_5 = { TRAIT = gallowsbait TRACK = marauder } }
            3513 = { is_not_track_level_5_of_5 = { TRAIT = gallowsbait TRACK = marauder } }
            # Peasant Leader
            3514 = { has_trait = peasant_leader  }
            3515 = { NOT = { has_trait = peasant_leader } }
            3516 = { is_level_0_of_3 = { TRAIT = peasant_leader } }
            3517 = { is_not_level_0_of_3 = { TRAIT = peasant_leader } }
            3518 = { is_level_1_of_3 = { TRAIT = peasant_leader } }
            3519 = { is_not_level_1_of_3 = { TRAIT = peasant_leader } }
            3520 = { is_level_2_of_3 = { TRAIT = peasant_leader } }
            3521 = { is_not_level_2_of_3 = { TRAIT = peasant_leader } }
            3522 = { is_level_3_of_3 = { TRAIT = peasant_leader } }
            3523 = { is_not_level_3_of_3 = { TRAIT = peasant_leader } }
            # Confucian Education
            3550 = { has_trait = confucian_education }
            3551 = { NOT = { has_trait = confucian_education } }
            3552 = { is_level_0_of_5 = { TRAIT = confucian_education } }
            3553 = { is_not_level_0_of_5 = { TRAIT = confucian_education } }
            3554 = { is_level_1_of_5 = { TRAIT = confucian_education } }
            3555 = { is_not_level_1_of_5 = { TRAIT = confucian_education } }
            3556 = { is_level_2_of_5 = { TRAIT = confucian_education } }
            3557 = { is_not_level_2_of_5 = { TRAIT = confucian_education } }
            3558 = { is_level_3_of_5 = { TRAIT = confucian_education } }
            3559 = { is_not_level_3_of_5 = { TRAIT = confucian_education } }
            3560 = { is_level_4_of_5 = { TRAIT = confucian_education } }
            3561 = { is_not_level_4_of_5 = { TRAIT = confucian_education } }
            3562 = { is_level_5_of_5 = { TRAIT = confucian_education } }
            3563 = { is_not_level_5_of_5 = { TRAIT = confucian_education } }
        }
    }
}