society_decisions = {
    #######################################
    # RANK 1
    #######################################

    ggsm_take_sacred_prostitution = {
        ai = no

        potential = {
            ggsm_order_member_trigger = yes
            society_rank >= 1
            ggsm_adult_catholic_woman_trigger = yes
            NOT = { has_character_flag = ggsm_sacred_prostitute }
        }

        allow = {
            has_society_currency_tiny_trigger = yes
            is_inaccessible_trigger = no
            prisoner = no
            in_command = no
        }

        effect = {
            detract_society_currency_tiny_effect = yes

            ggsm_progress_sacred_prostitution_effect = yes

            long_character_event = {
                id = ggsm.10
            }

            hidden_tooltip = {
                long_character_event = {
                    id = ggsm.1
                }
            }
        }

        ai_will_do = {
            factor = 1
        }
    }


    ggsm_vow_nymphomania = {
        ai = no

        potential = {
            ggsm_order_member_trigger = yes
            society_rank >= 1
            ggsm_adult_catholic_woman_trigger = yes

            NOT = {
                trait = nymphomaniac
            }
        }

        allow = {
            has_society_currency_minor_trigger = yes

            NOR = {
                trait = nymphomaniac
                trait = chaste
                trait = celibate
            }

            is_inaccessible_trigger = no
            prisoner = no
            in_command = no
        }

        effect = {
            detract_society_currency_minor_effect = yes

            long_character_event = {
                id = ggsm.13
            }

            hidden_tooltip = {
                long_character_event = {
                    id = ggsm.1
                }
            }
        }

        ai_will_do = {
            factor = 11
        }
    }


    #######################################
    # RANK 2
    #######################################

    ggsm_carnal_confession = {
        ai = no

        potential = {
            ggsm_order_member_trigger = yes
            society_rank >= 2
            ggsm_adult_catholic_woman_trigger = yes
        }

        allow = {
            is_inaccessible_trigger = no
            prisoner = no
            in_command = no

            NOT = {
                has_character_flag = ggsm_carnal_confession_cooldown
            }
        }

        effect = {
            # Select and save the penitent first, then leave the random scope.
            random_realm_character = {
                limit = {
                    is_adult = yes
                    religion = catholic
                    NOT = { character = ROOT }
                    NOT = { trait = incapable }
                    prisoner = no
                    in_command = no
                }

                save_event_target_as = ggsm_carnal_confession_target
            }

            # Female penitent route.
            if = {
                limit = {
                    event_target:ggsm_carnal_confession_target = {
                        is_female = yes
                    }
                }

                long_character_event = {
                    id = ggsm.20
                }
            }

            # Male penitent route.
            if = {
                limit = {
                    event_target:ggsm_carnal_confession_target = {
                        is_female = no
                    }
                }

                long_character_event = {
                    id = ggsm.23
                }
            }
        }

        ai_will_do = {
            factor = 1
        }
    }


    ggsm_study_sacred_scripture = {
        ai = no

        potential = {
            ggsm_order_member_trigger = yes
            society_rank >= 2
            ggsm_adult_catholic_woman_trigger = yes
        }

        allow = {
            is_inaccessible_trigger = no
            prisoner = no
            in_command = no

            NOT = {
                has_character_flag = ggsm_scripture_study_cooldown
            }
        }

        effect = {
            long_character_event = {
                id = ggsm.30
            }
        }

        ai_will_do = {
            factor = 1
        }
    }


    ggsm_cleanse_lovers_pox_self = {
        ai = no

        potential = {
            ggsm_order_member_trigger = yes
            society_rank >= 2
            ggsm_adult_catholic_woman_trigger = yes
            trait = lovers_pox
        }

        allow = {
            has_society_currency_medium_trigger = yes
            is_inaccessible_trigger = no
            prisoner = no
            in_command = no

            NOT = {
                has_character_flag = ggsm_self_cleansing_cooldown
            }
        }

        effect = {
            detract_society_currency_medium_effect = yes

            set_character_flag = ggsm_self_cleansing_cooldown

            ggsm_cleanse_lovers_pox_effect = yes

            hidden_tooltip = {
                long_character_event = {
                    id = ggsm.42
                    days = 1095
                }
            }

            long_character_event = {
                id = ggsm.40
            }
        }

        ai_will_do = {
            factor = 1
        }
    }


    #######################################
    # RANK 4
    #######################################

    ggsm_public_altar_rite = {
        ai = no

        potential = {
            ggsm_order_member_trigger = yes
            society_rank >= 4
            ggsm_adult_catholic_woman_trigger = yes
        }

        allow = {
            is_inaccessible_trigger = no
            prisoner = no
            in_command = no

            NOT = {
                has_character_flag = ggsm_public_altar_cooldown
            }
        }

        effect = {
            long_character_event = {
                id = ggsm.70
            }
        }

        ai_will_do = {
            factor = 1
        }
    }

    #######################################
    # SOCIETY MISSION DECISIONS
    #######################################

    ggsm_begin_temple_prostitute_mission = {
        ai = no

        potential = {
            society_member_of = ggsm_order_sacred_magdalene
            has_quest = ggsm_quest_temple_prostitute
            NOT = { has_character_flag = ggsm_temple_prostitute_mission_started }
            has_character_flag = ggsm_sacred_prostitute
        }

        allow = {
            has_quest = ggsm_quest_temple_prostitute
            is_inaccessible_trigger = no
            prisoner = no
            in_command = no
            any_realm_province = {
            any_province_holding = {
                OR = {
                        has_building = tb_ggsm_magdalene_house_1
                        has_building = tb_ggsm_magdalene_house_2
                        has_building = tb_ggsm_magdalene_house_3
                        has_building = tb_ggsm_magdalene_house_4
                        has_building = tb_ggsm_magdalene_house_5
                        has_building = ca_ggsm_magdalene_house_1
                        has_building = ca_ggsm_magdalene_house_2
                        has_building = ca_ggsm_magdalene_house_3
                        has_building = ca_ggsm_magdalene_house_4
                        has_building = ca_ggsm_magdalene_house_5
                        has_building = ct_ggsm_magdalene_house_1
                        has_building = ct_ggsm_magdalene_house_2
                        has_building = ct_ggsm_magdalene_house_3
                        has_building = ct_ggsm_magdalene_house_4
                        has_building = ct_ggsm_magdalene_house_5
                    }
            }
        }
        }

        effect = {
            set_character_flag = ggsm_temple_prostitute_mission_started
            set_variable = { which = ggsm_temple_prostitute_months value = 0 }
            long_character_event = { id = ggsm.9100 }
        }

        ai_will_do = { factor = .25 }
    }

    ggsm_begin_temple_gangbang_mission = {
        ai = no

        potential = {
            society_member_of = ggsm_order_sacred_magdalene
            has_quest = ggsm_quest_temple_gangbang
            NOT = { has_character_flag = ggsm_temple_gangbang_mission_started }
            has_character_flag = ggsm_sacred_prostitute
        }

        allow = {
            has_quest = ggsm_quest_temple_gangbang
            is_inaccessible_trigger = no
            prisoner = no
            in_command = no
            any_realm_province = {
            any_province_holding = {
                OR = {
                        has_building = tb_ggsm_magdalene_house_1
                        has_building = tb_ggsm_magdalene_house_2
                        has_building = tb_ggsm_magdalene_house_3
                        has_building = tb_ggsm_magdalene_house_4
                        has_building = tb_ggsm_magdalene_house_5
                        has_building = ca_ggsm_magdalene_house_1
                        has_building = ca_ggsm_magdalene_house_2
                        has_building = ca_ggsm_magdalene_house_3
                        has_building = ca_ggsm_magdalene_house_4
                        has_building = ca_ggsm_magdalene_house_5
                        has_building = ct_ggsm_magdalene_house_1
                        has_building = ct_ggsm_magdalene_house_2
                        has_building = ct_ggsm_magdalene_house_3
                        has_building = ct_ggsm_magdalene_house_4
                        has_building = ct_ggsm_magdalene_house_5
                    }
            }
        }
        }

        effect = {
            set_character_flag = ggsm_temple_gangbang_mission_started
            long_character_event = { id = ggsm.9140 }
        }

        ai_will_do = { factor = .25 }
    }

    ggsm_begin_teach_house_mission = {
        ai = no

        potential = {
            society_member_of = ggsm_order_sacred_magdalene
            has_quest = ggsm_quest_teach_house
            NOT = { has_character_flag = ggsm_teach_house_mission_started }
        }

        allow = {
            has_quest = ggsm_quest_teach_house
            is_inaccessible_trigger = no
            prisoner = no
            in_command = no
            any_realm_province = {
            any_province_holding = {
                OR = {
                        has_building = tb_ggsm_magdalene_house_1
                        has_building = tb_ggsm_magdalene_house_2
                        has_building = tb_ggsm_magdalene_house_3
                        has_building = tb_ggsm_magdalene_house_4
                        has_building = tb_ggsm_magdalene_house_5
                        has_building = ca_ggsm_magdalene_house_1
                        has_building = ca_ggsm_magdalene_house_2
                        has_building = ca_ggsm_magdalene_house_3
                        has_building = ca_ggsm_magdalene_house_4
                        has_building = ca_ggsm_magdalene_house_5
                        has_building = ct_ggsm_magdalene_house_1
                        has_building = ct_ggsm_magdalene_house_2
                        has_building = ct_ggsm_magdalene_house_3
                        has_building = ct_ggsm_magdalene_house_4
                        has_building = ct_ggsm_magdalene_house_5
                    }
            }
        }
        }

        effect = {
            set_character_flag = ggsm_teach_house_mission_started
            set_variable = { which = ggsm_teach_house_months value = 0 }
            long_character_event = { id = ggsm.9180 }
        }

        ai_will_do = { factor = .25 }
    }

    ggsm_begin_feed_poor_mission = {
        ai = no

        potential = {
            society_member_of = ggsm_order_sacred_magdalene
            has_quest = ggsm_quest_feed_poor
            NOT = { has_character_flag = ggsm_feed_poor_mission_started }
        }

        allow = {
            has_quest = ggsm_quest_feed_poor
            is_inaccessible_trigger = no
            prisoner = no
            in_command = no
            any_realm_province = {
            any_province_holding = {
                OR = {
                        has_building = tb_ggsm_magdalene_house_1
                        has_building = tb_ggsm_magdalene_house_2
                        has_building = tb_ggsm_magdalene_house_3
                        has_building = tb_ggsm_magdalene_house_4
                        has_building = tb_ggsm_magdalene_house_5
                        has_building = ca_ggsm_magdalene_house_1
                        has_building = ca_ggsm_magdalene_house_2
                        has_building = ca_ggsm_magdalene_house_3
                        has_building = ca_ggsm_magdalene_house_4
                        has_building = ca_ggsm_magdalene_house_5
                        has_building = ct_ggsm_magdalene_house_1
                        has_building = ct_ggsm_magdalene_house_2
                        has_building = ct_ggsm_magdalene_house_3
                        has_building = ct_ggsm_magdalene_house_4
                        has_building = ct_ggsm_magdalene_house_5
                    }
            }
        }
        }

        effect = {
            set_character_flag = ggsm_feed_poor_mission_started
            set_variable = { which = ggsm_feed_poor_months value = 0 }
            long_character_event = { id = ggsm.9220 }
        }

        ai_will_do = { factor = .25 }
    }

    ggsm_begin_minister_sick_mission = {
        ai = no

        potential = {
            society_member_of = ggsm_order_sacred_magdalene
            has_quest = ggsm_quest_minister_sick
            NOT = { has_character_flag = ggsm_minister_sick_mission_started }
        }

        allow = {
            has_quest = ggsm_quest_minister_sick
            is_inaccessible_trigger = no
            prisoner = no
            in_command = no
            any_realm_province = {
            any_province_holding = {
                OR = {
                        has_building = tb_ggsm_magdalene_house_1
                        has_building = tb_ggsm_magdalene_house_2
                        has_building = tb_ggsm_magdalene_house_3
                        has_building = tb_ggsm_magdalene_house_4
                        has_building = tb_ggsm_magdalene_house_5
                        has_building = ca_ggsm_magdalene_house_1
                        has_building = ca_ggsm_magdalene_house_2
                        has_building = ca_ggsm_magdalene_house_3
                        has_building = ca_ggsm_magdalene_house_4
                        has_building = ca_ggsm_magdalene_house_5
                        has_building = ct_ggsm_magdalene_house_1
                        has_building = ct_ggsm_magdalene_house_2
                        has_building = ct_ggsm_magdalene_house_3
                        has_building = ct_ggsm_magdalene_house_4
                        has_building = ct_ggsm_magdalene_house_5
                    }
            }
        }
        }

        effect = {
            set_character_flag = ggsm_minister_sick_mission_started
            set_variable = { which = ggsm_minister_sick_months value = 0 }
            long_character_event = { id = ggsm.9260 }
        }

        ai_will_do = { factor = .25 }
    }

    ggsm_begin_receive_pilgrims_mission = {
        ai = no

        potential = {
            society_member_of = ggsm_order_sacred_magdalene
            has_quest = ggsm_quest_receive_pilgrims
            NOT = { has_character_flag = ggsm_receive_pilgrims_mission_started }
        }

        allow = {
            has_quest = ggsm_quest_receive_pilgrims
            is_inaccessible_trigger = no
            prisoner = no
            in_command = no
            any_realm_province = {
            any_province_holding = {
                OR = {
                        has_building = tb_ggsm_magdalene_house_1
                        has_building = tb_ggsm_magdalene_house_2
                        has_building = tb_ggsm_magdalene_house_3
                        has_building = tb_ggsm_magdalene_house_4
                        has_building = tb_ggsm_magdalene_house_5
                        has_building = ca_ggsm_magdalene_house_1
                        has_building = ca_ggsm_magdalene_house_2
                        has_building = ca_ggsm_magdalene_house_3
                        has_building = ca_ggsm_magdalene_house_4
                        has_building = ca_ggsm_magdalene_house_5
                        has_building = ct_ggsm_magdalene_house_1
                        has_building = ct_ggsm_magdalene_house_2
                        has_building = ct_ggsm_magdalene_house_3
                        has_building = ct_ggsm_magdalene_house_4
                        has_building = ct_ggsm_magdalene_house_5
                    }
            }
        }
        }

        effect = {
            set_character_flag = ggsm_receive_pilgrims_mission_started
            set_variable = { which = ggsm_receive_pilgrims_months value = 0 }
            long_character_event = { id = ggsm.9300 }
        }

        ai_will_do = { factor = .25 }
    }

    ggsm_begin_copy_scripture_mission = {
        ai = no

        potential = {
            society_member_of = ggsm_order_sacred_magdalene
            has_quest = ggsm_quest_copy_scripture
            NOT = { has_character_flag = ggsm_copy_scripture_mission_started }
        }

        allow = {
            has_quest = ggsm_quest_copy_scripture
            is_inaccessible_trigger = no
            prisoner = no
            in_command = no
            any_realm_province = {
            any_province_holding = {
                OR = {
                        has_building = tb_ggsm_magdalene_house_1
                        has_building = tb_ggsm_magdalene_house_2
                        has_building = tb_ggsm_magdalene_house_3
                        has_building = tb_ggsm_magdalene_house_4
                        has_building = tb_ggsm_magdalene_house_5
                        has_building = ca_ggsm_magdalene_house_1
                        has_building = ca_ggsm_magdalene_house_2
                        has_building = ca_ggsm_magdalene_house_3
                        has_building = ca_ggsm_magdalene_house_4
                        has_building = ca_ggsm_magdalene_house_5
                        has_building = ct_ggsm_magdalene_house_1
                        has_building = ct_ggsm_magdalene_house_2
                        has_building = ct_ggsm_magdalene_house_3
                        has_building = ct_ggsm_magdalene_house_4
                        has_building = ct_ggsm_magdalene_house_5
                    }
            }
        }
        }

        effect = {
            set_character_flag = ggsm_copy_scripture_mission_started
            set_variable = { which = ggsm_copy_scripture_months value = 0 }
            long_character_event = { id = ggsm.9340 }
        }

        ai_will_do = { factor = .25 }
    }

    ggsm_begin_widows_orphans_mission = {
        ai = no

        potential = {
            society_member_of = ggsm_order_sacred_magdalene
            has_quest = ggsm_quest_widows_orphans
            NOT = { has_character_flag = ggsm_widows_orphans_mission_started }
        }

        allow = {
            has_quest = ggsm_quest_widows_orphans
            is_inaccessible_trigger = no
            prisoner = no
            in_command = no
            any_realm_province = {
            any_province_holding = {
                OR = {
                        has_building = tb_ggsm_magdalene_house_1
                        has_building = tb_ggsm_magdalene_house_2
                        has_building = tb_ggsm_magdalene_house_3
                        has_building = tb_ggsm_magdalene_house_4
                        has_building = tb_ggsm_magdalene_house_5
                        has_building = ca_ggsm_magdalene_house_1
                        has_building = ca_ggsm_magdalene_house_2
                        has_building = ca_ggsm_magdalene_house_3
                        has_building = ca_ggsm_magdalene_house_4
                        has_building = ca_ggsm_magdalene_house_5
                        has_building = ct_ggsm_magdalene_house_1
                        has_building = ct_ggsm_magdalene_house_2
                        has_building = ct_ggsm_magdalene_house_3
                        has_building = ct_ggsm_magdalene_house_4
                        has_building = ct_ggsm_magdalene_house_5
                    }
            }
        }
        }

        effect = {
            set_character_flag = ggsm_widows_orphans_mission_started
            set_variable = { which = ggsm_widows_orphans_months value = 0 }
            long_character_event = { id = ggsm.9380 }
        }

        ai_will_do = { factor = .25 }
    }

    ggsm_begin_steward_house_mission = {
        ai = no

        potential = {
            society_member_of = ggsm_order_sacred_magdalene
            has_quest = ggsm_quest_steward_house
            NOT = { has_character_flag = ggsm_steward_house_mission_started }
        }

        allow = {
            has_quest = ggsm_quest_steward_house
            is_inaccessible_trigger = no
            prisoner = no
            in_command = no
            any_realm_province = {
            any_province_holding = {
                OR = {
                        has_building = tb_ggsm_magdalene_house_1
                        has_building = tb_ggsm_magdalene_house_2
                        has_building = tb_ggsm_magdalene_house_3
                        has_building = tb_ggsm_magdalene_house_4
                        has_building = tb_ggsm_magdalene_house_5
                        has_building = ca_ggsm_magdalene_house_1
                        has_building = ca_ggsm_magdalene_house_2
                        has_building = ca_ggsm_magdalene_house_3
                        has_building = ca_ggsm_magdalene_house_4
                        has_building = ca_ggsm_magdalene_house_5
                        has_building = ct_ggsm_magdalene_house_1
                        has_building = ct_ggsm_magdalene_house_2
                        has_building = ct_ggsm_magdalene_house_3
                        has_building = ct_ggsm_magdalene_house_4
                        has_building = ct_ggsm_magdalene_house_5
                    }
            }
        }
        }

        effect = {
            set_character_flag = ggsm_steward_house_mission_started
            set_variable = { which = ggsm_steward_house_months value = 0 }
            long_character_event = { id = ggsm.9420 }
        }

        ai_will_do = { factor = .25 }
    }

    ggsm_begin_feast_magdalene_mission = {
        ai = no

        potential = {
            society_member_of = ggsm_order_sacred_magdalene
            has_quest = ggsm_quest_feast_magdalene
            NOT = { has_character_flag = ggsm_feast_magdalene_mission_started }
        }

        allow = {
            has_quest = ggsm_quest_feast_magdalene
            is_inaccessible_trigger = no
            prisoner = no
            in_command = no
            any_realm_province = {
            any_province_holding = {
                OR = {
                        has_building = tb_ggsm_magdalene_house_1
                        has_building = tb_ggsm_magdalene_house_2
                        has_building = tb_ggsm_magdalene_house_3
                        has_building = tb_ggsm_magdalene_house_4
                        has_building = tb_ggsm_magdalene_house_5
                        has_building = ca_ggsm_magdalene_house_1
                        has_building = ca_ggsm_magdalene_house_2
                        has_building = ca_ggsm_magdalene_house_3
                        has_building = ca_ggsm_magdalene_house_4
                        has_building = ca_ggsm_magdalene_house_5
                        has_building = ct_ggsm_magdalene_house_1
                        has_building = ct_ggsm_magdalene_house_2
                        has_building = ct_ggsm_magdalene_house_3
                        has_building = ct_ggsm_magdalene_house_4
                        has_building = ct_ggsm_magdalene_house_5
                    }
            }
        }
        }

        effect = {
            set_character_flag = ggsm_feast_magdalene_mission_started
            long_character_event = { id = ggsm.9460 }
        }

        ai_will_do = { factor = .25 }
    }

}


#######################################
# TARGETED SOCIETY POWERS
#
# ROOT = target character
# FROM = society member using the decision
#######################################

targeted_decisions = {


    #######################################
    # INVITE A WOMAN TO THE ORDER
    #######################################

    ggsm_invite_to_order = {
        filter = all
        ai_target_filter = realm
        is_in_society = yes
        ai_check_interval = 12

        from_potential = {
            ggsm_order_member_trigger = yes
            society_rank >= 3
            ggsm_adult_catholic_woman_trigger = yes
        }

        potential = {
            NOT = { character = FROM }

            ggsm_adult_catholic_woman_trigger = yes

            NOT = {
                is_in_society = yes
            }

            can_join_society = ggsm_order_sacred_magdalene

            NOT = {
                trait = incapable
            }

            NOT = {
                has_character_flag = ggsm_order_invitation_cooldown
            }

            is_within_diplo_range = FROM
        }

        allow = {
            FROM = {
                is_inaccessible_trigger = no
                prisoner = no
                in_command = no
            }

            is_inaccessible_trigger = no
            prisoner = no
            in_command = no
        }

        effect = {
            long_character_event = {
                id = ggsm.80
            }
        }

        ai_will_do = {
            factor = .1
        }
    }



  ggsm_teach_carnal_charity = {
    filter = all
    ai_target_filter = realm
    is_in_society = yes
    ai_check_interval = 12

    from_potential = {
        ggsm_order_member_trigger = yes
        society_rank >= 2
        ggsm_adult_catholic_woman_trigger = yes
    }

    potential = {
        NOT = { character = FROM }
        is_adult = yes
        religion = catholic

        NOT = {
            trait = incapable
        }

        is_within_diplo_range = FROM

        OR = {
            trait = chaste
            trait = celibate
            NOT = { trait = lustful }
            NOT = { trait = nymphomaniac }
            NOT = { trait = exhibitionist }
        }
    }

    allow = {
        FROM = {
            is_inaccessible_trigger = no
            prisoner = no
            in_command = no
        }

        is_inaccessible_trigger = no
        prisoner = no
        in_command = no

        NOT = {
            has_character_flag = ggsm_carnal_charity_cooldown
        }
    }

    effect = {
        set_character_flag = ggsm_carnal_charity_cooldown

        hidden_tooltip = {
            long_character_event = {
                id = ggsm.82
                days = 730
            }
        }

        if = {
            limit = {
                trait = chaste
            }
            remove_trait = chaste
        }

        if = {
            limit = {
                trait = celibate
            }
            remove_trait = celibate
        }

        if = {
            limit = {
                OR = {
                    NOT = { trait = lustful }
                    NOT = { trait = nymphomaniac }
                    NOT = { trait = exhibitionist }
                }
            }

            random_list = {
                100 = {
                    trigger = {
                        NOT = { trait = lustful }
                    }
                    add_trait = lustful
                }

                100 = {
                    trigger = {
                        NOT = { trait = nymphomaniac }
                    }
                    add_trait = nymphomaniac
                }

                100 = {
                    trigger = {
                        NOT = { trait = exhibitionist }
                    }
                    add_trait = exhibitionist
                }
            }
        }

        FROM = {
            long_character_event = {
                id = ggsm.50
            }
        }

        long_character_event = {
            id = ggsm.51
        }
    }

    ai_will_do = {
        factor = .1
    }
}


    ggsm_minister_lovers_pox = {
        filter = all
        ai_target_filter = realm
        is_in_society = yes
        ai_check_interval = 12

        from_potential = {
            ggsm_order_member_trigger = yes
            society_rank >= 3
            ggsm_adult_catholic_woman_trigger = yes
        }

        potential = {
            NOT = { character = FROM }
            is_adult = yes
            religion = catholic
            trait = lovers_pox

            NOT = {
                trait = incapable
            }

            is_within_diplo_range = FROM

        }

        allow = {
            FROM = {
                is_inaccessible_trigger = no
                prisoner = no
                in_command = no
            }

            is_inaccessible_trigger = no
            prisoner = no
            in_command = no

            NOT = {
                has_character_flag = ggsm_lovers_pox_ministry_cooldown
            }
        }

        effect = {
            set_character_flag = ggsm_lovers_pox_ministry_cooldown

            hidden_tooltip = {
                long_character_event = {
                    id = ggsm.83
                    days = 365
                }
            }

            FROM = {
                long_character_event = {
                    id = ggsm.60
                }
            }

            long_character_event = {
                id = ggsm.61
            }
        }

        ai_will_do = {
            factor = .1
        }
    }


    ggsm_teach_virtue = {
        filter = all
        ai_target_filter = realm
        is_in_society = yes
        ai_check_interval = 12

        from_potential = {
            ggsm_order_member_trigger = yes
            society_rank >= 3
            ggsm_adult_catholic_woman_trigger = yes
        }

        potential = {
            NOT = { character = FROM }
            religion = catholic

            NOT = {
                trait = incapable
            }

            is_within_diplo_range = FROM

            OR = {
                NOT = { trait = temperate }
                NOT = { trait = charitable }
                NOT = { trait = diligent }
                NOT = { trait = patient }
                NOT = { trait = kind }
                NOT = { trait = humble }
            }
        }

        allow = {
            FROM = {
                is_inaccessible_trigger = no
                prisoner = no
                in_command = no
            }

            is_inaccessible_trigger = no
            prisoner = no
            in_command = no

            NOT = {
                has_character_flag = ggsm_teach_virtue_cooldown
            }
        }

        effect = {
            set_character_flag = ggsm_teach_virtue_cooldown

            hidden_tooltip = {
                long_character_event = {
                    id = ggsm.84
                    days = 730
                }
            }

            random_list = {
                100 = {
                    modifier = {
                        factor = 0
                        trait = temperate
                    }
                    add_trait = temperate
                }

                100 = {
                    modifier = {
                        factor = 0
                        trait = charitable
                    }
                    add_trait = charitable
                }

                100 = {
                    modifier = {
                        factor = 0
                        trait = diligent
                    }
                    add_trait = diligent
                }

                100 = {
                    modifier = {
                        factor = 0
                        trait = patient
                    }
                    add_trait = patient
                }

                100 = {
                    modifier = {
                        factor = 0
                        trait = kind
                    }
                    add_trait = kind
                }

                100 = {
                    modifier = {
                        factor = 0
                        trait = humble
                    }
                    add_trait = humble
                }
            }

            opinion = {
                who = FROM
                modifier = ggsm_taught_carnal_charity
                years = 5
            }
        }

        ai_will_do = {
            factor = .1
        }
    }
}
