add_namespace = ET_Independence_SouthKorea # KOR
add_namespace = ET_Independence_NorthKorea # DPR
add_namespace = ET_Independence_UnifyKorea

country_event = { # ET_Independence_NorthKorea.0 (Release)
    id = ET_Independence_NorthKorea.0
    title = ET_Independence_NorthKorea.0.t
    desc = ET_Independence_NorthKorea.0.desc

    is_triggered_only = yes
    
    immediate = {}

    option = { # Release
        name = ET_Independence_NorthKorea.0.a
        ai_chance = {
            base = 10
            
            modifier = {
                factor = 0
                OR = {
                    has_war = no
                    is_puppet = no
                    is_subject = no
                    threat < 0.30
                }
            }
        }
        hidden_effect = { set_global_flag = ET_flag_global_free_DPR }

        ET_DPR_INIT = yes
        release_on_controlled = DRP
        
        country_event = { # TODO move to focustree
            id = ET_Independence_UnifyKorea.0
            days = 10
        }
    }
    option = { # Dont Release
        name = ET_Independence_NorthKorea.0.b
        ai_chance = {
            base = 0
            modifier = {
                add = 10
                OR = {
                    has_war = yes
                    is_puppet = yes
                    is_subject = yes
                    threat > 0.30
                }
            }
        }
    }
    option = { # Release play as 
        name = ET_Independence_NorthKorea.0.c
        ai_chance = { base = 0 }

        ET_DPR_INIT = yes
        release_on_controlled = DPR
        
        custom_effect_tooltip = ET_play_as_nation_effect_tt
        hidden_effect = { DPR = { change_tag_from = ROOT } }
        hidden_effect = { set_global_flag = ET_flag_global_free_DPR }

        country_event = { # TODO move to focustree
            id = ET_Independence_UnifyKorea.0
            days = 10
        }
    }
}

country_event = { # ET_Independence_SouthKorea.0 (Release)
    id = ET_Independence_SouthKorea.0
    title = ET_Independence_SouthKorea.0.t
    desc = ET_Independence_SouthKorea.0.desc

    is_triggered_only = yes
    
    immediate = { set_global_flag = ET_flag_global_free_KOR }

    option = { # Release
        name = ET_Independence_SouthKorea.0.a
        ai_chance = {
            base = 10
            
            modifier = {
                factor = 0
                OR = {
                    has_war = no
                    is_puppet = no
                    is_subject = no
                    threat < 0.30
                }
            }
        }


        ET_KOR_INIT = yes
        release_on_controlled = KOR

        hidden_effect = { set_global_flag = ET_flag_global_free_KOR }

        KOR = {
            country_event = { # TODO move to focustree
                id = ET_Independence_UnifyKorea.1
                days = 10
            }
        }
    }
    option = { # Dont Release
        name = ET_Independence_SouthKorea.0.b
        ai_chance = {
            base = 0
            modifier = {
                add = 10
                OR = {
                    has_war = yes
                    is_puppet = yes
                    is_subject = yes
                    threat > 0.30
                }
            }
        }
    }
    option = { # Release play as 
        name = ET_Independence_SouthKorea.0.c
        ai_chance = { base = 0 }

        ET_KOR_INIT = yes
        release_on_controlled = KOR

        custom_effect_tooltip = ET_play_as_nation_effect_tt
        hidden_effect = { KOR = { change_tag_from = ROOT } }
        hidden_effect = { set_global_flag = ET_flag_global_free_KOR }
        
        KOR = {
            country_event = { # TODO move to focustree
                id = ET_Independence_UnifyKorea.1
                days = 10
            }
        }
    }
}


# TODO move to focus tree
country_event = { # ET_Independence_UnifyKorea.0 (War goal on south)
    id = ET_Independence_UnifyKorea.0
    title = ET_Independence_UnifyKorea.0.t
    desc = ET_Independence_UnifyKorea.0.desc

    is_triggered_only = yes
    
    immediate = {}

    option = {
        name = ET_Independence_UnifyKorea.0.a
        create_wargoal = {
            type = ET_unify_war
            target = KOR
        }
    }
}
country_event = { # ET_Independence_UnifyKorea.1 (War goal on north)
    id = ET_Independence_UnifyKorea.1
    title = ET_Independence_UnifyKorea.1.t
    desc = ET_Independence_UnifyKorea.1.desc

    is_triggered_only = yes
    
    immediate = {}

    option = {
        name = ET_Independence_UnifyKorea.1.a
        create_wargoal = {
            type = ET_unify_war
            target = DPR
        }
    }
}