add_namespace = ET_S1_Division_Init
add_namespace = ET_S1_Division_Europe
add_namespace = ET_S1_Division_Europe_State
add_namespace = ET_S1_Division_Europe_Special

add_namespace = ET_S1_Division_Asia
add_namespace = ET_S1_Division_Asia_State

country_event = { # Init Checks
    id = ET_S1_Division_Init.0

    is_triggered_only = yes
    hidden = yes

    immediate = {
        # # 
        # EUROPE
        # #

        # 1 POLAND
        if = {
            limit = {
                AND = {
                    NOT = { original_tag = SOV }
                    NOT = { original_tag = POL }
                    OR = {
                        controls_state = 10
                        controls_state = 63
                        controls_state = 66
                        controls_state = 67
                        controls_state = 68
                        controls_state = 762
                        controls_state = 807
                        controls_state = 86
                        controls_state = 87
                        controls_state = 88
                        controls_state = 92
                        controls_state = 97
                        controls_state = 98
                    }
                }
            }
            if = { limit = { is_debug = yes } log = "[GetDateText]: [This.GetTag] Checking Poland..." }
            country_event = { id = ET_S1_Division_Europe.1 }
        }
        # 3 WESTERN POLAND
        if = {
            limit = {
                NOT = { original_tag = POL }
                OR = {
                    controls_state = 63
                    controls_state = 66
                    controls_state = 67
                    controls_state = 68
                    controls_state = 762
                }
            }
            if = { limit = { is_debug = yes } log = "[GetDateText]: [This.GetTag] Checking West Poland..." }
            country_event = { id = ET_S1_Division_Europe.3 }
        }
        # 4 EAST GERMANY
        if = {
            limit = {
                NOT = { original_tag = DDR }
                OR = {
                    controls_state = 62
                    controls_state = 61
                    controls_state = 64
                    controls_state = 65
                    controls_state = 60
                }
            }
            if = { limit = { is_debug = yes } log = "[GetDateText]: [This.GetTag] Checking East Germany..." }
            country_event = { id = ET_S1_Division_Europe.4 }
        }
        #   EAST GERMANY - Special case
        if = {
            limit = {
                original_tag = SOV
                controls_state = 64
            }
            if = { limit = { is_debug = yes } log = "[GetDateText]: [This.GetTag] Soviet Own East Germany check add trait..." }
            country_event = { id = ET_S1_Division_Europe_Special.1 }
        }
        # 5 CZECHSLOVAKIA
        if = {
            limit = {
                NOT = { original_tag =  SOV }
                NOT = { original_tag =  CZE }
                NOT = { original_tag =  SLO }
                country_exists = SLO
                OR = {
                    controls_state = 69
                    controls_state = 9 
                    controls_state = 75
                    controls_state = 74
                    controls_state = 62

                    controls_state = 70
                    controls_state = 664
                    controls_state = 71
                }
            }
            if = { limit = { is_debug = yes } log = "[GetDateText]: [This.GetTag] Checking Czechslovakia..." }
            country_event = { id = ET_S1_Division_Europe.5 }
        }
        # 7 EAST AUSTRIA
        if = {
            limit = {
                NOT = { original_tag = AUS }
                NOT = { original_tag = SOV }
                controls_state = 4
            }
            if = { limit = { is_debug = yes } log = "[GetDateText]: [This.GetTag] Checking East Austria..." }
            country_event = { id = ET_S1_Division_Europe.7 }
        }
        #   EAST AUSTRIA - Special case
        if = {
            limit = {
                original_tag = SOV
                controls_state = 4
            }
            if = { limit = { is_debug = yes } log = "[GetDateText]: [This.GetTag] Soviet Own East Austria check add trait..." }
            country_event = { id = ET_S1_Division_Europe_Special.2 }
        }
        # 8 WEST AUSTRIA
        if = {
            limit = {
                OR = {
                    controls_state = 152
                    controls_state = 153
                }
            }
            if = { limit = { is_debug = yes } log = "[GetDateText]: [This.GetTag] Checking West Austria..." }
            country_event = { id = ET_S1_Division_Europe.8 }
        }
        # 9 WEST GERMANY
        if = {
            limit = {
                OR = {
                    controls_state = 58
                    controls_state = 59
                    controls_state = 56
                    controls_state = 57
                    controls_state = 51
                    controls_state = 42
                    controls_state = 55
                    controls_state = 54
                    controls_state = 50
                    controls_state = 52
                    controls_state = 53
                }
            }
            if = { limit = { is_debug = yes } log = "[GetDateText]: [This.GetTag] Checking West Germany..." }
            country_event = { id = ET_S1_Division_Europe.9 }
        }

        # 20 YUGOSLAVIA
        if = {
            limit = {
                NOT = { original_tag = YUG }
                OR = {
                    controls_state = 102
                    controls_state = 103
                    controls_state = 103
                    controls_state = 106
                    controls_state = 107
                    controls_state = 108
                    controls_state = 109
                    controls_state = 109
                    controls_state = 163
                    controls_state = 736 # Trieste
                    controls_state = 802
                    controls_state = 804
                }
            }
            if = { limit = { is_debug = yes } log = "[GetDateText]: [This.GetTag] Checking Yugoslavia..." }
            country_event = { id = ET_S1_Division_Europe.20 }
        }

        # 25 FRANCE
        if = {
            limit = {
                NOT = { original_tag = FRA }
                OR = {
                    controls_state = 1
                    controls_state = 14
                    controls_state = 15
                    controls_state = 16
                    controls_state = 17
                    controls_state = 18
                    controls_state = 19
                    controls_state = 20
                    controls_state = 21
                    controls_state = 22
                    controls_state = 23
                    controls_state = 24
                    controls_state = 25
                    controls_state = 27
                    controls_state = 28
                    controls_state = 29
                    controls_state = 30
                    controls_state = 31
                    controls_state = 32
                    controls_state = 33
                    controls_state = 735
                    controls_state = 785
                    controls_state = 806
                }
            }
            if = { limit = { is_debug = yes } log = "[GetDateText]: [This.GetTag] Checking France..." }
            country_event = { id = ET_S1_Division_Europe.25 }
        }
        # 26 SPAIN
        if = {
            limit = {
                NOT = { original_tag = SPA }
                OR = {
                    controls_state = 165
                    controls_state = 166
                    controls_state = 167
                    controls_state = 168
                    controls_state = 169
                    controls_state = 170
                    controls_state = 171
                    controls_state = 172
                    controls_state = 173
                    controls_state = 174
                    controls_state = 175
                    controls_state = 176
                    controls_state = 190
                    controls_state = 41 
                    controls_state = 788
                    controls_state = 789
                    controls_state = 791
                    controls_state = 792
                    controls_state = 793
                    controls_state = 794

                    controls_state = 177
                    controls_state = 178
                    controls_state = 290
                }
            }
            if = { limit = { is_debug = yes } log = "[GetDateText]: [This.GetTag] Checking Spain..." }
            country_event = { id = ET_S1_Division_Europe.26 }
        }



        # 1 STATE: Ermland-Masuren
        if = {
            limit = {
                NOT = { original_tag =  POL }
                controls_state = 5
            }
            if = { limit = { is_debug = yes } log = "[GetDateText]: Ermland-Masuren state is not controlled by Soviet Union." }
            country_event = { id = ET_S1_Division_Europe_State.1 }
        }
        # 2 STATE: Wilno
        if = {
            limit = {
                NOT = { original_tag =  SOV }
                controls_state = 784
            }
            if = { limit = { is_debug = yes } log = "[GetDateText]: Wilno state is not controlled by Soviet Union." }
            country_event = { id = ET_S1_Division_Europe_State.2 }
        }
        # 3 STATE: Köninsberg
        if = {
            limit = {
                NOT = { original_tag =  SOV }
                controls_state = 763
            }
            if = { limit = { is_debug = yes } log = "[GetDateText]: Köninsberg state is not controlled by Soviet Union." }
            country_event = { id = ET_S1_Division_Europe_State.3 }
        }

        # 5 STATE: Carpathian Ruthenia
        if = {
            limit = {
                NOT = { original_tag =  SOV }
                controls_state = 73
            }
            if = { limit = { is_debug = yes } log = "[GetDateText]: Carpathian Ruthenia state is not controlled by Soviet Union." }
            country_event = { id = ET_S1_Division_Europe_State.5 }
        }
        # 6 STATE: Memel
        if = {
            limit = {
                NOT = { original_tag =  SOV }
                NOT = { original_tag =  LIT }
                controls_state = 188
            }
            if = { limit = { is_debug = yes } log = "[GetDateText]: Memel state is not controlled correct controll" }
            country_event= { id = ET_S1_Division_Europe_State.6 }
        }

        # 26 STATE: GIBRALTAR
        if = {
            limit = {
                NOT = { original_tag =  ENG }
                controls_state = 118
            }
            if = { limit = { is_debug = yes } log = "[GetDateText]: Gibraltar state is not controlled correct controll" }
            country_event= { id = ET_S1_Division_Europe_State.26 }
        }


        # # 
        # ASIA
        # #

        # 1 North KOREA
        if = {
            limit = {
                NOT = { original_tag = DPR } # Democratic Peoples Republik [of Korea]
                NOT = { original_tag = SOV }
                controls_state = 527
            }
            if = { limit = { is_debug = yes } log = "[GetDateText]: [This.GetTag] Checking North Korea..." }
            country_event = { id = ET_S1_Division_Asia.1 }
        }
        # 2 SOUTH KOREA
        if = {
            limit = {
                NOT = { original_tag = KOR } # Korea
                NOT = { original_tag = USA }
                controls_state = 525
            }
            if = { limit = { is_debug = yes } log = "[GetDateText]: [This.GetTag] Checking South Korea..." }
            country_event = { id = ET_S1_Division_Asia.2 }
        }
        # 3 JAPAN
        if = {
            limit = {
                NOT = { original_tag = JAP }
                OR = {
                    controls_state = 555
                    controls_state = 536
                    controls_state = 533
                    controls_state = 534
                    controls_state = 282
                    controls_state = 535
                    controls_state = 532
                    controls_state = 531
                    controls_state = 529
                    controls_state = 530
                    controls_state = 526
                    controls_state = 526
                    controls_state = 645
                    controls_state = 649
                    controls_state = 646
                    controls_state = 638
                }
            }
            if = { limit = { is_debug = yes } log = "[GetDateText]: [This.GetTag] Checking Japan..." }
            country_event = { id = ET_S1_Division_Asia.3 }
        }
    }

    option = { }
}

# # 
# EUROPE
# #
country_event = { # 1 POLAND
    id = ET_S1_Division_Europe.1
    title = ET_S1_Division_Europe.1.t
    desc = ET_S1_Division_Europe.1.desc

    is_triggered_only = yes

    immediate = { }

    option = { # A: Give States to Poland *
        name = ET_S1_Division_Europe.1.a
        trigger = {
            country_exists = POL
        }
        hidden_effect = {
            if = { limit = { is_debug = yes } log = "[GetDateText]: [This.GetTag] transfering Polish states to Poland and make a Puppet of Poland." }
            POL = {
                add_state_core = 10
                add_state_core = 807
                add_state_core = 85
                add_state_core = 88
                add_state_core = 90
                add_state_core = 92
                add_state_core = 97
                add_state_core = 98
            
                remove_state_core = 784
                remove_state_core = 89
                remove_state_core = 91
                remove_state_core = 93
                remove_state_core = 94
                remove_state_core = 95
                remove_state_core = 96
            }
            SOV = {
                add_state_core = 784
                add_state_core = 89 
                add_state_core = 91 
                add_state_core = 93 
                add_state_core = 94 
                add_state_core = 95 
                add_state_core = 96
            }
        }
        custom_effect_tooltip = ET_S1_Division_World_Historical_TT

        if = { limit = { controls_state = 10  } 10 =  { transfer_state_to  = POL } }
        if = { limit = { controls_state = 807 } 807 = { transfer_state_to  = POL } }
        if = { limit = { controls_state = 85  } 85 =  { transfer_state_to  = POL } }
        if = { limit = { controls_state = 88  } 88 =  { transfer_state_to  = POL } }
        if = { limit = { controls_state = 90  } 90 =  { transfer_state_to  = POL } }
        if = { limit = { controls_state = 92  } 92 =  { transfer_state_to  = POL } }
        if = { limit = { controls_state = 97  } 97 =  { transfer_state_to  = POL } }
        if = { limit = { controls_state = 98  } 98 =  { transfer_state_to  = POL } }

        POL = { annex_country = { target = KSH transfer_troops = yes } }

        if = { limit = { controls_state = 89  } 89 =  { transfer_state_to  = SOV } } # POL core provinces
        if = { limit = { controls_state = 91  } 91 =  { transfer_state_to  = SOV } } # POL core provinces
        if = { limit = { controls_state = 93  } 93 =  { transfer_state_to  = SOV } } # POL core provinces
        if = { limit = { controls_state = 94  } 94 =  { transfer_state_to  = SOV } } # POL core provinces
        if = { limit = { controls_state = 95  } 95 =  { transfer_state_to  = SOV } } # POL core provinces
        if = { limit = { controls_state = 96  } 96 =  { transfer_state_to  = SOV } } # POL core provinces

        if = {
            limit = { POL = { NOT = { is_puppet_of = SOV } } }
            SOV = { puppet = POL }
        }

        ai_chance = { factor = 1 }
    }
    option = { # B: Give States to Soviet
        name = ET_S1_Division_Europe.1.b
        trigger = {
            NOT = { original_tag =  SOV }
            NOT = { country_exists = POL }
        }

        hidden_effect = {
            if = { limit = { is_debug = yes } log = "[GetDateText]: [This.GetTag] transfering Polish states to Soviet Union..." }
            POL = {
                add_state_core = 10
                add_state_core = 807
                add_state_core = 85
                add_state_core = 88
                add_state_core = 90
                add_state_core = 92
                add_state_core = 97
                add_state_core = 98
            
                remove_state_core = 784
                remove_state_core = 89
                remove_state_core = 91
                remove_state_core = 93
                remove_state_core = 94
                remove_state_core = 95
                remove_state_core = 96
            }
            SOV = {
                add_state_core = 784
                add_state_core = 89 
                add_state_core = 91 
                add_state_core = 93 
                add_state_core = 94 
                add_state_core = 95 
                add_state_core = 96
            }
        }
        if = { limit = { controls_state = 10  } 10 =  { transfer_state_to  = SOV } }
        if = { limit = { controls_state = 807 } 807 = { transfer_state_to  = SOV } }
        if = { limit = { controls_state = 85  } 85 =  { transfer_state_to  = SOV } }
        if = { limit = { controls_state = 88  } 88 =  { transfer_state_to  = SOV } }
        if = { limit = { controls_state = 90  } 90 =  { transfer_state_to  = SOV } }
        if = { limit = { controls_state = 92  } 92 =  { transfer_state_to  = SOV } }
        if = { limit = { controls_state = 97  } 97 =  { transfer_state_to  = SOV } }
        if = { limit = { controls_state = 98  } 98 =  { transfer_state_to  = SOV } }

        if = { limit = { controls_state = 89  } 89 =  { transfer_state_to  = SOV } } # POL core provinces
        if = { limit = { controls_state = 91  } 91 =  { transfer_state_to  = SOV } } # POL core provinces
        if = { limit = { controls_state = 93  } 93 =  { transfer_state_to  = SOV } } # POL core provinces
        if = { limit = { controls_state = 94  } 94 =  { transfer_state_to  = SOV } } # POL core provinces
        if = { limit = { controls_state = 95  } 95 =  { transfer_state_to  = SOV } } # POL core provinces
        if = { limit = { controls_state = 96  } 96 =  { transfer_state_to  = SOV } } # POL core provinces

        SOV = { country_event = { id = ET_S1_Division_Europe.2 days = 1 } }

        ai_chance = { factor = 0 }
    }
    option = { # C: Refuce
        name = ET_S1_Division_Europe.1.c

        reverse_add_opinion_modifier = {
            target = SOV
            modifier = ET_broke_agreements
        }

        ai_chance = { factor = 0 }
    }
}
country_event = { # 2 POLAND - Puppet
    id = ET_S1_Division_Europe.2
    title = ET_S1_Division_Europe.2.t
    desc = ET_S1_Division_Europe.2.desc

    is_triggered_only = yes
    fire_only_once = yes

    immediate = { }

    option = { # A: Release Poland as a puppet
        name = ET_S1_Division_Europe.2.a

        hidden_effect = {
            if = { limit = { is_debug = yes } log = "[GetDateText]: [This.GetTag] Releases Poland as Puppet" }
            SOV = {
                add_state_core = 784
                add_state_core = 89
                add_state_core = 91
                add_state_core = 93
                add_state_core = 94
                add_state_core = 95
                add_state_core = 96
            }
            POL = {
                remove_state_core = 784
                remove_state_core = 89
                remove_state_core = 91
                remove_state_core = 93
                remove_state_core = 94
                remove_state_core = 95
                remove_state_core = 96
            }
            SOV = { country_event = { id = ET_S1_Division_Europe_State.3 days = 3 } }
        }
        custom_effect_tooltip = ET_S1_Division_World_Historical_TT
        if = { limit = { controls_state = 10  } 10 =  { transfer_state_to  = SOV } }
        if = { limit = { controls_state = 807 } 807 = { transfer_state_to  = SOV } }
        if = { limit = { controls_state = 85  } 85 =  { transfer_state_to  = SOV } }
        if = { limit = { controls_state = 88  } 88 =  { transfer_state_to  = SOV } }
        if = { limit = { controls_state = 90  } 90 =  { transfer_state_to  = SOV } }
        if = { limit = { controls_state = 92  } 92 =  { transfer_state_to  = SOV } }
        if = { limit = { controls_state = 97  } 97 =  { transfer_state_to  = SOV } }
        if = { limit = { controls_state = 98  } 98 =  { transfer_state_to  = SOV } }

        if = { limit = { controls_state = 89  } 89 =  { transfer_state_to  = SOV } } # POL core provinces
        if = { limit = { controls_state = 91  } 91 =  { transfer_state_to  = SOV } } # POL core provinces
        if = { limit = { controls_state = 93  } 93 =  { transfer_state_to  = SOV } } # POL core provinces
        if = { limit = { controls_state = 94  } 94 =  { transfer_state_to  = SOV } } # POL core provinces
        if = { limit = { controls_state = 95  } 95 =  { transfer_state_to  = SOV } } # POL core provinces
        if = { limit = { controls_state = 96  } 96 =  { transfer_state_to  = SOV } } # POL core provinces

        release_puppet = POL
        
        ai_chance = { factor = 0 }
    }
    option = { # B: Keep it under our occupation
        name = ET_S1_Division_Europe.2.b
        hidden_effect = {
            if = { limit = { is_debug = yes } log = "[GetDateText]: [This.GetTag] keeping the states under occupation" }
            SOV = {
                add_state_core = 784
                add_state_core = 89 
                add_state_core = 91 
                add_state_core = 93 
                add_state_core = 94 
                add_state_core = 95 
                add_state_core = 96
            }
            POL = {
                remove_state_core = 784
                remove_state_core = 89
                remove_state_core = 91
                remove_state_core = 93
                remove_state_core = 94
                remove_state_core = 95
                remove_state_core = 96
            }
        }

        if = { limit = { controls_state = 10  } 10 =  { transfer_state_to  = SOV } }
        if = { limit = { controls_state = 807 } 807 = { transfer_state_to  = SOV } }
        if = { limit = { controls_state = 85  } 85 =  { transfer_state_to  = SOV } }
        if = { limit = { controls_state = 88  } 88 =  { transfer_state_to  = SOV } }
        if = { limit = { controls_state = 90  } 90 =  { transfer_state_to  = SOV } }
        if = { limit = { controls_state = 92  } 92 =  { transfer_state_to  = SOV } }
        if = { limit = { controls_state = 97  } 97 =  { transfer_state_to  = SOV } }
        if = { limit = { controls_state = 98  } 98 =  { transfer_state_to  = SOV } }

        if = { limit = { controls_state = 89  } 89 =  { transfer_state_to  = SOV } } # POL core provinces
        if = { limit = { controls_state = 91  } 91 =  { transfer_state_to  = SOV } } # POL core provinces
        if = { limit = { controls_state = 93  } 93 =  { transfer_state_to  = SOV } } # POL core provinces
        if = { limit = { controls_state = 94  } 94 =  { transfer_state_to  = SOV } } # POL core provinces
        if = { limit = { controls_state = 95  } 95 =  { transfer_state_to  = SOV } } # POL core provinces
        if = { limit = { controls_state = 96  } 96 =  { transfer_state_to  = SOV } } # POL core provinces

        reverse_add_opinion_modifier = {
            target = USA
            modifier = ET_broke_agreements
        }
        reverse_add_opinion_modifier = {
            target = ENG
            modifier = ET_broke_agreements
        }
        reverse_add_opinion_modifier = {
            target = FRA
            modifier = ET_broke_agreements
        }

        ai_chance = { factor = 0 }
    }
}

country_event = { # 3 WESTERN POLAND
    id = ET_S1_Division_Europe.3
    title = ET_S1_Division_Europe.3.t
    desc = ET_S1_Division_Europe.3.desc

    is_triggered_only = yes

    immediate = { }

    option = { # A: Transfer Western Poland to the Soviet Union
        name = ET_S1_Division_Europe.3.a
        trigger = {
            NOT = { country_exists = POL }
        }
        ai_chance = {
            factor = 1
        }
        hidden_effect = {
            if = { limit = { is_debug = yes } log = "[GetDateText]: [This.GetTag] transfering Western Poland states to the Soviet Union" }
            GER = {
                remove_state_core = 762
                remove_state_core = 784
                remove_state_core = 67
                remove_state_core = 66
                remove_state_core = 5
                remove_state_core = 63
                remove_state_core = 66
                remove_state_core = 67
                remove_state_core = 68
            }
            DDR = {
                remove_state_core = 762
                remove_state_core = 784
                remove_state_core = 67
                remove_state_core = 66
                remove_state_core = 5
                remove_state_core = 63
                remove_state_core = 66
                remove_state_core = 67
                remove_state_core = 68
            }
        }
        custom_effect_tooltip = ET_S1_Division_World_Historical_TT
        if = { limit = { controls_state = 63  } 63  = { transfer_state_to  = SOV } }
        if = { limit = { controls_state = 68  } 68  = { transfer_state_to  = SOV } }
        if = { limit = { controls_state = 66  } 66  = { transfer_state_to  = SOV } }
        if = { limit = { controls_state = 67  } 67  = { transfer_state_to  = SOV } }
        if = { limit = { controls_state = 762 } 762 = { transfer_state_to  = SOV } }
    }
    option = { # B: Transfer Western Poland to Poland
        name = ET_S1_Division_Europe.3.b
        trigger = {
            country_exists = POL
        }
        hidden_effect = {
            if = { limit = { is_debug = yes } log = "[GetDateText]: [This.GetTag] transfering Western Poland states to Poland" }
            GER = {
                remove_state_core = 762
                remove_state_core = 784
                remove_state_core = 67
                remove_state_core = 66
                remove_state_core = 5
                remove_state_core = 63
                remove_state_core = 66
                remove_state_core = 67
                remove_state_core = 68
            }
            DDR = {
                remove_state_core = 762
                remove_state_core = 784
                remove_state_core = 67
                remove_state_core = 66
                remove_state_core = 5
                remove_state_core = 63
                remove_state_core = 66
                remove_state_core = 67
                remove_state_core = 68
            }
        }
        custom_effect_tooltip = ET_S1_Division_World_Historical_TT
        if = { limit = { controls_state = 63  } 63  = { transfer_state_to  = POL } }
        if = { limit = { controls_state = 68  } 68  = { transfer_state_to  = POL } }
        if = { limit = { controls_state = 66  } 66  = { transfer_state_to  = POL } }
        if = { limit = { controls_state = 67  } 67  = { transfer_state_to  = POL } }
        if = { limit = { controls_state = 762 } 762 = { transfer_state_to  = POL } }
        
        ai_chance = { factor = 1 }
    }
    option = { # C: Refuce
        name = ET_S1_Division_Europe.3.c

        reverse_add_opinion_modifier = {
            target = SOV
            modifier = ET_broke_agreements
        }

        ai_chance = { factor = 0 }
    }
}
country_event = { # 4 EASTERN GERMANY
    id = ET_S1_Division_Europe.4
    title = ET_S1_Division_Europe.4.t
    desc = ET_S1_Division_Europe.4.desc

    is_triggered_only = yes

    immediate = { }

    option = { # A: Transfer East Germany to the Soviet Union
        name = ET_S1_Division_Europe.4.a
        trigger = {
            NOT = { country_exists = POL }
        }
        ai_chance = {
            factor = 1
        }
        hidden_effect = {
            if = { limit = { is_debug = yes } log = "[GetDateText]: [This.GetTag] transfering East Germany states to the Soviet Union" }
        }
        custom_effect_tooltip = ET_S1_Division_World_Historical_TT
        if = { limit = { controls_state = 61  } 61  = { transfer_state_to  = SOV } }
        if = { limit = { controls_state = 62  } 62  = { transfer_state_to  = SOV } }
        if = { limit = { controls_state = 64  } 64  = { transfer_state_to  = SOV } }
        if = { limit = { controls_state = 65  } 65  = { transfer_state_to  = SOV } }
        if = { limit = { controls_state = 66  } 66  = { transfer_state_to  = SOV } }
        SOV = {
            country_event = {
                id = ET_S1_Division_Europe_Special.1
                days = 1
            }
        }
    }
    option = { # B: Transfer East Germany to DDR
        name = ET_S1_Division_Europe.4.b
        trigger = {
            country_exists = DDR
        }
        ai_chance = {
            factor = 1
        }
        hidden_effect = {
            if = { limit = { is_debug = yes } log = "[GetDateText]: [This.GetTag] transfering East Germany states to DDR" }
        }
        custom_effect_tooltip = ET_S1_Division_World_Historical_TT
        if = { limit = { controls_state = 61  } 61  = { transfer_state_to  = DDR } }
        if = { limit = { controls_state = 62  } 62  = { transfer_state_to  = DDR } }
        if = { limit = { controls_state = 64  } 64  = { transfer_state_to  = DDR } }
        if = { limit = { controls_state = 65  } 65  = { transfer_state_to  = DDR } }
        if = { limit = { controls_state = 66  } 66  = { transfer_state_to  = DDR } }

        SOV = { puppet = DDR }
        DDR = {
            country_event = {
                id = ET_S1_Division_Europe_Special.1
                days = 1
            }
        }
    }
    option = { # C: Refuce
        name = ET_S1_Division_Europe.4.b

        reverse_add_opinion_modifier = {
            target = SOV
            modifier = ET_broke_agreements
        }

        ai_chance = { factor = 0 }
    }
}

country_event = { # 5 CZECHSLOVAKIA
    id = ET_S1_Division_Europe.5
    title = ET_S1_Division_Europe.5.t
    desc = ET_S1_Division_Europe.5.desc

    is_triggered_only = yes

    immediate = { }

    option = { # A: No CZE && No SLO give to Soviet
        name = ET_S1_Division_Europe.5.a
        trigger = {
            NOT = { country_exists = CZE }
            NOT = { country_exists = SLO }
        }
        
        hidden_effect = {
            SOV = { country_event = { id = ET_S1_Division_Europe.6 days = 1 } }
        }
        custom_effect_tooltip = ET_S1_Division_World_Historical_TT
        if = { limit = { controls_state = 69  } 69  = { transfer_state_to  = SOV } } # Czechslovakia core provinces
        if = { limit = { controls_state = 9   } 9   = { transfer_state_to  = SOV } } # Czechslovakia core provinces
        if = { limit = { controls_state = 75  } 75  = { transfer_state_to  = SOV } } # Czechslovakia core provinces
        if = { limit = { controls_state = 74  } 74  = { transfer_state_to  = SOV } } # Czechslovakia core provinces
        if = { limit = { controls_state = 72  } 72  = { transfer_state_to  = SOV } } # Czechslovakia core provinces

        if = { limit = { controls_state = 70  } 70  = { transfer_state_to  = SOV } } # Czechslovakia core provinces
        if = { limit = { controls_state = 664 } 664 = { transfer_state_to  = SOV } } # Czechslovakia core provinces
        if = { limit = { controls_state = 71  } 71  = { transfer_state_to  = SOV } } # Czechslovakia core provinces

        country_event = { id = ET_S1_Division_Europe.6 days = 1 }
        
        ai_chance = { factor = 1 }
    }
    option = { # B: SLO give to SLO
        name = ET_S1_Division_Europe.5.b
        trigger = {
            NOT = { country_exists = CZE }
            country_exists = SLO
        }

        hidden_effect = {
            SOV = { country_event = { id = ET_S1_Division_Europe.6 days = 1 } }
        }
        custom_effect_tooltip = ET_S1_Division_World_Historical_TT
        if = { limit = { controls_state = 69  } 69  = { transfer_state_to  = SLO } } # Czechslovakia core provinces
        if = { limit = { controls_state = 9   } 9   = { transfer_state_to  = SLO } } # Czechslovakia core provinces
        if = { limit = { controls_state = 75  } 75  = { transfer_state_to  = SLO } } # Czechslovakia core provinces
        if = { limit = { controls_state = 74  } 74  = { transfer_state_to  = SLO } } # Czechslovakia core provinces
        if = { limit = { controls_state = 72  } 72  = { transfer_state_to  = SLO } } # Czechslovakia core provinces

        if = { limit = { controls_state = 70  } 70  = { transfer_state_to  = SLO } } # Czechslovakia core provinces
        if = { limit = { controls_state = 664 } 664 = { transfer_state_to  = SLO } } # Czechslovakia core provinces
        if = { limit = { controls_state = 71  } 71  = { transfer_state_to  = SLO } } # Czechslovakia core provinces

        ai_chance = { factor = 1 }
    }
    option = { # C: CZE give to CZE
        name = ET_S1_Division_Europe.5.c
        trigger = {
            country_exists = CZE
            NOT = { country_exists = SLO }
        }

        hidden_effect = {
            SOV = { country_event = { id = ET_S1_Division_Europe.6 days = 1 } }
        }
        custom_effect_tooltip = ET_S1_Division_World_Historical_TT
        if = { limit = { controls_state = 69  } 69  = { transfer_state_to  = CZE } } # Czechslovakia core provinces
        if = { limit = { controls_state = 9   } 9   = { transfer_state_to  = CZE } } # Czechslovakia core provinces
        if = { limit = { controls_state = 75  } 75  = { transfer_state_to  = CZE } } # Czechslovakia core provinces
        if = { limit = { controls_state = 74  } 74  = { transfer_state_to  = CZE } } # Czechslovakia core provinces
        if = { limit = { controls_state = 72  } 72  = { transfer_state_to  = CZE } } # Czechslovakia core provinces

        if = { limit = { controls_state = 70  } 70  = { transfer_state_to  = CZE } } # Czechslovakia core provinces
        if = { limit = { controls_state = 664 } 664 = { transfer_state_to  = CZE } } # Czechslovakia core provinces
        if = { limit = { controls_state = 71  } 71  = { transfer_state_to  = CZE } } # Czechslovakia core provinces

        ai_chance = { factor = 1 }
    }
    option = { # D: SLO give to CZE
        name = ET_S1_Division_Europe.5.d
        trigger = {
            country_exists = CZE
            country_exists = SLO
        }
        
        hidden_effect = {
            SOV = { country_event = { id = ET_S1_Division_Europe.6 days = 1 } }
        }
        custom_effect_tooltip = ET_S1_Division_World_Historical_TT
        if = { limit = { controls_state = 69  } 69  = { transfer_state_to  = CZE } } # Czechslovakia core provinces
        if = { limit = { controls_state = 9   } 9   = { transfer_state_to  = CZE } } # Czechslovakia core provinces
        if = { limit = { controls_state = 75  } 75  = { transfer_state_to  = CZE } } # Czechslovakia core provinces
        if = { limit = { controls_state = 74  } 74  = { transfer_state_to  = CZE } } # Czechslovakia core provinces
        if = { limit = { controls_state = 72  } 72  = { transfer_state_to  = CZE } } # Czechslovakia core provinces

        if = { limit = { controls_state = 70  } 70  = { transfer_state_to  = CZE } } # Czechslovakia core provinces
        if = { limit = { controls_state = 664 } 664 = { transfer_state_to  = CZE } } # Czechslovakia core provinces
        if = { limit = { controls_state = 71  } 71  = { transfer_state_to  = CZE } } # Czechslovakia core provinces

        ai_chance = { factor = 1 }
    }
    option = { # E: Refuce
        name = ET_S1_Division_Europe.5.e

        reverse_add_opinion_modifier = {
            target = SOV
            modifier = ET_broke_agreements
        }
    
        ai_chance = { factor = 0 }
    }
}
country_event = { # 6 CZECHSLOVAKIA - Puppet
    id = ET_S1_Division_Europe.6
    title = ET_S1_Division_Europe.6.t
    desc = ET_S1_Division_Europe.6.desc

    is_triggered_only = yes

    immediate = { }

    option = { # A: Release Czechslovakia as a puppet
        name = ET_S1_Division_Europe.6.a
        trigger = {
            NOT = { country_exists = CZE }
            NOT = { country_exists = SLO }
        }
        hidden_effect = {
            CZE = { remove_state_core = 73 }
            HUN = { remove_state_core = 73 }
        }
        custom_effect_tooltip = ET_S1_Division_World_Historical_TT

        SOV = { release_puppet = CZE }

        ai_chance = { factor = 1 }
    }
    option = { # B: Create a unified Czechslovakian puppet state
        name = ET_S1_Division_Europe.6.b
        trigger = {
            NOT = { country_exists = CZE }
            country_exists = SLO
        }
        hidden_effect = {
            CZE = { remove_state_core = 73 }
            HUN = { remove_state_core = 73 }
        }
        custom_effect_tooltip = ET_S1_Division_World_Historical_TT

        SOV = { release_puppet = CZE }
        CZE = { annex_country = { target = SLO transfer_troops = yes } }

        69  = { transfer_state_to  = CZE } # Czechslovakia core provinces
        9   = { transfer_state_to  = CZE } # Czechslovakia core provinces
        75  = { transfer_state_to  = CZE } # Czechslovakia core provinces
        74  = { transfer_state_to  = CZE } # Czechslovakia core provinces
        72  = { transfer_state_to  = CZE } # Czechslovakia core provinces

        70  = { transfer_state_to  = CZE } # Czechslovakia core provinces
        664 = { transfer_state_to  = CZE } # Czechslovakia core provinces
        71  = { transfer_state_to  = CZE } # Czechslovakia core provinces

        CZE = { set_capital = { state = 9 } }

        ai_chance = { factor = 1 }
    }
    option = { # C: Create a unified Czechslovakian puppet state
        name = ET_S1_Division_Europe.6.c
        trigger = {
            country_exists = CZE
            NOT = { country_exists = SLO }
        }
        hidden_effect = {
            CZE = { remove_state_core = 73 }
            HUN = { remove_state_core = 73 }
        }
        custom_effect_tooltip = ET_S1_Division_World_Historical_TT

        69  = { transfer_state_to  = CZE } # Czechslovakia core provinces
        9   = { transfer_state_to  = CZE } # Czechslovakia core provinces
        75  = { transfer_state_to  = CZE } # Czechslovakia core provinces
        74  = { transfer_state_to  = CZE } # Czechslovakia core provinces
        72  = { transfer_state_to  = CZE } # Czechslovakia core provinces

        70  = { transfer_state_to  = CZE } # Czechslovakia core provinces
        664 = { transfer_state_to  = CZE } # Czechslovakia core provinces
        71  = { transfer_state_to  = CZE } # Czechslovakia core provinces

        SOV = { puppet = CZE }

        ai_chance = { factor = 1 }
    }
    option = { # D: Keep the current state
        name = ET_S1_Division_Europe.6.d
    
        reverse_add_opinion_modifier = {
            target = USA
            modifier = ET_broke_agreements
        }
        reverse_add_opinion_modifier = {
            target = ENG
            modifier = ET_broke_agreements
        }
        reverse_add_opinion_modifier = {
            target = FRA
            modifier = ET_broke_agreements
        }
    }
}

country_event = { # 7 AUSTRIA EAST
    id = ET_S1_Division_Europe.7
    title = ET_S1_Division_Europe.7.t
    desc = ET_S1_Division_Europe.7.desc

    is_triggered_only = yes

    immediate = { }

    option = { # A: Give States to Austria (If Austria exist)
        name = ET_S1_Division_Europe.7.a
        trigger = {
            country_exists = AUS
        }

        hidden_effect = {
            if = { limit = { is_debug = yes } log = "[GetDateText]: [This.GetTag] transfering Austrian states to Austria." }
        }
        if = { limit = { controls_state = 4    } 4   =  { transfer_state_to  = AUS } } # Austria core provinces

        ai_chance = { factor = 1 }
    }
    option = { # B: Give States to Occupyer (If Astria does not exist)
        name = ET_S1_Division_Europe.7.b
        trigger = {
            NOT = { country_exists = AUS }
        }
        
        hidden_effect = {
            if = { limit = { is_debug = yes } log = "[GetDateText]: [This.GetTag] transfering Austrian states to occupying force." }
        }
        if = { limit = { controls_state = 4    } 4   =  { transfer_state_to  = SOV } } # Austria core provinces

        SOV = {
            country_event = {
                id = ET_S1_Division_Europe_Special.2
                days = 1
            }
        }

        ai_chance = { factor = 1 }
    }
    option = { # C: Refuce
        name = ET_S1_Division_Europe.5.c

        if = {
            limit = { controls_state = 152 }
            reverse_add_opinion_modifier = {
                target = USA
                modifier = ET_broke_agreements
            }
        }
        if = {
            limit = { controls_state = 153 }
            reverse_add_opinion_modifier = {
                target = FRA
                modifier = ET_broke_agreements
            }
        }

        ai_chance = { factor = 0 }
    }
}
country_event = { # 8 AUSTRIA WEST
    id = ET_S1_Division_Europe.8
    title = ET_S1_Division_Europe.8.t
    desc = ET_S1_Division_Europe.8.desc

    is_triggered_only = yes

    immediate = { }

    option = { # A: Give States to Austria (If Austria exist)
        name = ET_S1_Division_Europe.8.a
        trigger = {
            country_exists = AUS
        }

        hidden_effect = {
            if = { limit = { is_debug = yes } log = "[GetDateText]: [This.GetTag] transfering Austrian states to Austria." }
        }
        if = { limit = { controls_state = 152  } 152 =  { transfer_state_to  = AUS } } # Austria core provinces
        if = { limit = { controls_state = 153  } 153 =  { transfer_state_to  = AUS } } # Austria core provinces

        ai_chance = { factor = 1 }
    }
    option = { # B: Give States to Occupyer (If Astria does not exist)
        name = ET_S1_Division_Europe.8.b
        trigger = {
            NOT = { country_exists = AUS }
        }
        
        hidden_effect = {
            if = { limit = { is_debug = yes } log = "[GetDateText]: [This.GetTag] transfering Austrian states to occupying force." }
        }
        if = { limit = { controls_state = 152  } 152 =  { transfer_state_to  = USA } } # Austria core provinces
        if = { limit = { controls_state = 153  } 153 =  { transfer_state_to  = FRA } } # Austria core provinces

        ai_chance = { factor = 1 }
    }
    option = { # C: Refuce
        name = ET_S1_Division_Europe.8.c

        if = {
            limit = { controls_state = 152 }
            reverse_add_opinion_modifier = {
                target = USA
                modifier = ET_broke_agreements
            }
        }
        if = {
            limit = { controls_state = 153 }
            reverse_add_opinion_modifier = {
                target = FRA
                modifier = ET_broke_agreements
            }
        }

        ai_chance = { factor = 0 }
    }
}

country_event = { # 9 WEST GERMANY
    id = ET_S1_Division_Europe.9
    title = ET_S1_Division_Europe.9.t
    desc = ET_S1_Division_Europe.9.desc

    is_triggered_only = yes

    immediate = { }

    option = { # A: Give States to West Germany if exist
        name = ET_S1_Division_Europe.9.a
        trigger = {
            country_exists = WGR
        }

        hidden_effect = {
            if = { limit = { is_debug = yes } log = "[GetDateText]: [This.GetTag] transfering Austrian states to West Germany." }
        }
        
        if = { limit = { controls_state = 58 } 58  =  { transfer_state_to  = WGR } } # german core provinces
        if = { limit = { controls_state = 59 } 59  =  { transfer_state_to  = WGR } } # german core provinces
        if = { limit = { controls_state = 56 } 56  =  { transfer_state_to  = WGR } } # german core provinces
        if = { limit = { controls_state = 57 } 57  =  { transfer_state_to  = WGR } } # german core provinces
        if = { limit = { controls_state = 51 } 51  =  { transfer_state_to  = WGR } } # german core provinces
        if = { limit = { controls_state = 42 } 42  =  { transfer_state_to  = WGR } } # german core provinces
        if = { limit = { controls_state = 55 } 55  =  { transfer_state_to  = WGR } } # german core provinces
        if = { limit = { controls_state = 54 } 54  =  { transfer_state_to  = WGR } } # german core provinces
        if = { limit = { controls_state = 50 } 50  =  { transfer_state_to  = WGR } } # german core provinces
        if = { limit = { controls_state = 52 } 52  =  { transfer_state_to  = WGR } } # german core provinces
        if = { limit = { controls_state = 53 } 53  =  { transfer_state_to  = WGR } } # german core provinces

        ai_chance = { factor = 1 }
    }
    option = { # B: Give States to Occupyer if exist
        name = ET_S1_Division_Europe.9.b
        trigger = {
            NOT = { country_exists = WGR }
        }

        hidden_effect = {
            if = { limit = { is_debug = yes } log = "[GetDateText]: [This.GetTag] transfering West Germany states to occupying force." }
        }
        if = { limit = { controls_state = 58 } 58  =  { transfer_state_to  = ENG } } # german core provinces
        if = { limit = { controls_state = 59 } 59  =  { transfer_state_to  = ENG } } # german core provinces
        if = { limit = { controls_state = 56 } 56  =  { transfer_state_to  = ENG } } # german core provinces
        if = { limit = { controls_state = 57 } 57  =  { transfer_state_to  = ENG } } # german core provinces
        if = { limit = { controls_state = 51 } 51  =  { transfer_state_to  = ENG } } # german core provinces
        if = { limit = { controls_state = 42 } 42  =  { transfer_state_to  = FRA } } # german core provinces
        if = { limit = { controls_state = 55 } 55  =  { transfer_state_to  = USA } } # german core provinces
        if = { limit = { controls_state = 54 } 54  =  { transfer_state_to  = USA } } # german core provinces
        if = { limit = { controls_state = 50 } 50  =  { transfer_state_to  = FRA } } # german core provinces
        if = { limit = { controls_state = 52 } 52  =  { transfer_state_to  = USA } } # german core provinces
        if = { limit = { controls_state = 53 } 53  =  { transfer_state_to  = USA } } # german core provinces

        ai_chance = { factor = 1 }
    }
    option = { # C: Refuce
        name = ET_S1_Division_Europe_State.9.c

        ai_chance = { factor = 0 }
    }
}


country_event = { # 20 YUGOSLAVIA
    id = ET_S1_Division_Europe.20
    title = ET_S1_Division_Europe.20.t
    desc = ET_S1_Division_Europe.20.desc

    is_triggered_only = yes

    immediate = { 
        hidden_effect = {
            YUG = {
                add_state_core = 102
                add_state_core = 103
                add_state_core = 103
                add_state_core = 106
                add_state_core = 107
                add_state_core = 108
                add_state_core = 109
                add_state_core = 109
                add_state_core = 163 # Zara
                add_state_core = 736
                add_state_core = 802
                add_state_core = 804

                add_state_core = 102
                add_state_core = 103
                add_state_core = 103
                add_state_core = 106
                add_state_core = 107
                add_state_core = 108
                add_state_core = 109
                add_state_core = 109
                add_state_core = 163 # Zara
                add_state_core = 736
                add_state_core = 802
                add_state_core = 804
            }
        }
    }

    option = { # A: Give terretory to Yugoslavia
        name = ET_S1_Division_Europe.20.a
        custom_effect_tooltip = ET_S1_Division_World_Historical_TT

        if = { limit = { is_debug = yes } log = "[GetDateText]: [This.GetTag] Transfer terretory to [YUG.GetName] Yugoslavia" }
        if = { limit = { NOT = { country_exists = YUG } } release_on_controlled = YUG }
    
        if = { limit = { controls_state = 102  } 102  = { transfer_state_to = YUG } }
        if = { limit = { controls_state = 103  } 103  = { transfer_state_to = YUG } }
        if = { limit = { controls_state = 103  } 103  = { transfer_state_to = YUG } }
        if = { limit = { controls_state = 106  } 106  = { transfer_state_to = YUG } }
        if = { limit = { controls_state = 107  } 107  = { transfer_state_to = YUG } }
        if = { limit = { controls_state = 108  } 108  = { transfer_state_to = YUG } }
        if = { limit = { controls_state = 109  } 109  = { transfer_state_to = YUG } }
        if = { limit = { controls_state = 109  } 109  = { transfer_state_to = YUG } }
        if = { limit = { controls_state = 163  } 163  = { transfer_state_to = YUG } }
        if = { limit = { controls_state = 736  } 736  = { transfer_state_to = YUG } }
        if = { limit = { controls_state = 802  } 802  = { transfer_state_to = YUG } }
        if = { limit = { controls_state = 804  } 804  = { transfer_state_to = YUG } }

        ai_chance = { factor = 1 }
    }
    option = { # B: Refuce
        name = ET_S1_Division_Europe_State.20.b

        if = { limit = { controls_state = 102  } 102  = { force_enable_resistance = { occupier = THIS occupied = YUG } } }
        if = { limit = { controls_state = 103  } 103  = { force_enable_resistance = { occupier = THIS occupied = YUG } } }
        if = { limit = { controls_state = 103  } 103  = { force_enable_resistance = { occupier = THIS occupied = YUG } } }
        if = { limit = { controls_state = 106  } 106  = { force_enable_resistance = { occupier = THIS occupied = YUG } } }
        if = { limit = { controls_state = 107  } 107  = { force_enable_resistance = { occupier = THIS occupied = YUG } } }
        if = { limit = { controls_state = 108  } 108  = { force_enable_resistance = { occupier = THIS occupied = YUG } } }
        if = { limit = { controls_state = 109  } 109  = { force_enable_resistance = { occupier = THIS occupied = YUG } } }
        if = { limit = { controls_state = 109  } 109  = { force_enable_resistance = { occupier = THIS occupied = YUG } } }
        if = { limit = { controls_state = 163  } 163  = { force_enable_resistance = { occupier = THIS occupied = YUG } } }
        if = { limit = { controls_state = 736  } 736  = { force_enable_resistance = { occupier = THIS occupied = YUG } } }
        if = { limit = { controls_state = 802  } 802  = { force_enable_resistance = { occupier = THIS occupied = YUG } } }
        if = { limit = { controls_state = 804  } 804  = { force_enable_resistance = { occupier = THIS occupied = YUG } } }

        ai_chance = { factor = 0 }
    }
}

country_event = { # 25 FRANCE
    id = ET_S1_Division_Europe.25
    title = ET_S1_Division_Europe.25.t
    desc = ET_S1_Division_Europe.25.desc

    is_triggered_only = yes

    immediate = { }

    option = { # A: Give terretory to France
        name = ET_S1_Division_Europe.25.a
        custom_effect_tooltip = ET_S1_Division_World_Historical_TT

        if = { limit = { is_debug = yes } log = "[GetDateText]: [This.GetTag] Transfer terretory to France" }

        if = { limit = { NOT = { country_exists = FRA } } release_on_controlled = FRA }
        if = { limit = { controls_state = 1    } 1   = { transfer_state_to = FRA } }
        if = { limit = { controls_state = 14   } 14  = { transfer_state_to = FRA } }
        if = { limit = { controls_state = 15   } 15  = { transfer_state_to = FRA } }
        if = { limit = { controls_state = 16   } 16  = { transfer_state_to = FRA } }
        if = { limit = { controls_state = 17   } 17  = { transfer_state_to = FRA } }
        if = { limit = { controls_state = 18   } 18  = { transfer_state_to = FRA } }
        if = { limit = { controls_state = 19   } 19  = { transfer_state_to = FRA } }
        if = { limit = { controls_state = 20   } 20  = { transfer_state_to = FRA } }
        if = { limit = { controls_state = 21   } 21  = { transfer_state_to = FRA } }
        if = { limit = { controls_state = 22   } 22  = { transfer_state_to = FRA } }
        if = { limit = { controls_state = 23   } 23  = { transfer_state_to = FRA } }
        if = { limit = { controls_state = 24   } 24  = { transfer_state_to = FRA } }
        if = { limit = { controls_state = 25   } 25  = { transfer_state_to = FRA } }
        if = { limit = { controls_state = 27   } 27  = { transfer_state_to = FRA } }
        if = { limit = { controls_state = 28   } 28  = { transfer_state_to = FRA } }
        if = { limit = { controls_state = 29   } 29  = { transfer_state_to = FRA } }
        if = { limit = { controls_state = 30   } 30  = { transfer_state_to = FRA } }
        if = { limit = { controls_state = 31   } 31  = { transfer_state_to = FRA } }
        if = { limit = { controls_state = 32   } 32  = { transfer_state_to = FRA } }
        if = { limit = { controls_state = 33   } 33  = { transfer_state_to = FRA } }
        if = { limit = { controls_state = 735  } 735 = { transfer_state_to = FRA } }
        if = { limit = { controls_state = 785  } 785 = { transfer_state_to = FRA } }
        if = { limit = { controls_state = 806  } 806 = { transfer_state_to = FRA } }

        ai_chance = { factor = 1 }
    }
    option = { # B: Refuce
        name = ET_S1_Division_Europe_State.25.b

        reverse_add_opinion_modifier = {
            target = FRA
            modifier = ET_broke_agreements
        }

        ai_chance = { factor = 0 }
    }
}

# Spain joins war handlers 
country_event = { # 26 SPAIN Occupation
    id = ET_S1_Division_Europe.26
    title = ET_S1_Division_Europe.26.t
    desc = ET_S1_Division_Europe.26.desc

    is_triggered_only = yes

    immediate = { }

    option = { # B: Give States to Occupyer if exist
        name = ET_S1_Division_Europe.26.a

        if = { limit = { is_debug = yes } log = "[GetDateText]: [This.GetTag] transfering spanish states to occupying force." }

        if = { limit = { controls_state = 166  } 166 =  { transfer_state_to  = FRA } }
        if = { limit = { controls_state = 172  } 172 =  { transfer_state_to  = FRA } }
        if = { limit = { controls_state = 176  } 176 =  { transfer_state_to  = FRA } }
        if = { limit = { controls_state = 792  } 792 =  { transfer_state_to  = FRA } }
        if = { limit = { controls_state = 165  } 165 =  { transfer_state_to  = FRA } }
        if = { limit = { controls_state = 167  } 167 =  { transfer_state_to  = FRA } }

        if = { limit = { controls_state = 168  } 168 =  { transfer_state_to  = USA } }
        if = { limit = { controls_state = 169  } 169 =  { transfer_state_to  = USA } }
        if = { limit = { controls_state = 170  } 170 =  { transfer_state_to  = USA } }
        if = { limit = { controls_state = 173  } 173 =  { transfer_state_to  = USA } }
        if = { limit = { controls_state = 175  } 175 =  { transfer_state_to  = USA } }
        if = { limit = { controls_state = 789  } 789 =  { transfer_state_to  = USA } }

        if = { limit = { controls_state = 41   } 41  =  { transfer_state_to  = ENG } }
        if = { limit = { controls_state = 171  } 171 =  { transfer_state_to  = ENG } }
        if = { limit = { controls_state = 174  } 174 =  { transfer_state_to  = ENG } }
        if = { limit = { controls_state = 788  } 788 =  { transfer_state_to  = ENG } }
        if = { limit = { controls_state = 791  } 791 =  { transfer_state_to  = ENG } }
        if = { limit = { controls_state = 793  } 793 =  { transfer_state_to  = ENG } }
        if = { limit = { controls_state = 794  } 794 =  { transfer_state_to  = ENG } }

        if = { limit = { controls_state = 177  } 177 =  { transfer_state_to  = FRA } } # Islas Baleares
        if = { limit = { controls_state = 178  } 178 =  { transfer_state_to  = FRA } } # Islas Canarias
        if = { limit = { controls_state = 290  } 290 =  { transfer_state_to  = ENG } } # Spanish Africa
        
        ai_chance = { factor = 1 }
    }
    option = { # B: Refuce
        name = ET_S1_Division_Europe_State.26.b

        if = { # Have French States
            limit = {
                controls_state = 166
                controls_state = 172
                controls_state = 176
                controls_state = 792
                controls_state = 165
                controls_state = 167

                controls_state = 177 # Islas Baleares
                controls_state = 178 # Islas Canarias
            }
            reverse_add_opinion_modifier = {
                target = FRA
                modifier = ET_broke_agreements
            }
        }
        if = { # Have USA States
            limit = {
                controls_state = 168
                controls_state = 169
                controls_state = 170
                controls_state = 173
                controls_state = 175
                controls_state = 789
            }
            reverse_add_opinion_modifier = {
                target = USA
                modifier = ET_broke_agreements
            }
        }
        if = { # Have UK States
            limit = {
                controls_state = 41
                controls_state = 171
                controls_state = 174
                controls_state = 788
                controls_state = 791
                controls_state = 793
                controls_state = 794

                controls_state = 290 # Spanish Africa
            }
            reverse_add_opinion_modifier = {
                target = ENG
                modifier = ET_broke_agreements
            }
        }
        ai_chance = { factor = 0 }
    }
}


# States
country_event = { # 1 STATE: Ermland-Masuren
    id = ET_S1_Division_Europe_State.1
    title = ET_S1_Division_Europe_State.1.t
    desc = ET_S1_Division_Europe_State.1.desc

    is_triggered_only = yes

    immediate = { }

    option = { # A: Transfer Ermland-Masuren to Poland
        name = ET_S1_Division_Europe_State.1.a
        trigger = {
            country_exists = POL
        }

        hidden_effect = {
            POL = { add_state_core = 5 }
            GER = { remove_state_core = 5 }
        }

        custom_effect_tooltip = ET_S1_Division_World_Historical_TT
        5 =  { transfer_state_to  = POL } # German core provinces

        ai_chance = { factor = 1 }
    }
    option = { # B: Transfer Ermland-Masuren to Soviet Union
        name = ET_S1_Division_Europe_State.1.a
        trigger = {
            NOT = { country_exists = POL }
        }
        
        hidden_effect = {
            POL = { add_state_core = 5 }
            GER = { remove_state_core = 5 }
        }

        custom_effect_tooltip = ET_S1_Division_World_Historical_TT
        5 =  { transfer_state_to  = SOV } # German core provinces

        ai_chance = { factor = 1 }
    }
    option = { # C: Refuce
        name = ET_S1_Division_Europe_State.1.c
        hidden_effect = {
            POL = { add_state_core = 5 }
            GER = { remove_state_core = 5 }
        }

        reverse_add_opinion_modifier = {
            target = SOV
            modifier = ET_broke_agreements
        }

        ai_chance = { factor = 0 }
    }
}
country_event = { # 2 STATE: Wilno
    id = ET_S1_Division_Europe_State.2
    title = ET_S1_Division_Europe_State.2.t
    desc = ET_S1_Division_Europe_State.2.desc

    is_triggered_only = yes

    immediate = { }

    option = { # A: Transfer Wilno to the Soviet Union
        name = ET_S1_Division_Europe_State.2.a
        ai_chance = {
            factor = 1
        }
        custom_effect_tooltip = ET_S1_Division_World_Historical_TT
        784 =  { transfer_state_to = SOV } # POL & LIT core provinces
        SOV = { add_state_core = 784 }
    }
    option = { # B: Refuce
        name = ET_S1_Division_Europe_State.2.b
        reverse_add_opinion_modifier = {
            target = SOV
            modifier = ET_broke_agreements
        }

        ai_chance = { factor = 0 }
    }
}
country_event = { # 3 STATE: Köningsberg
    id = ET_S1_Division_Europe_State.3
    title = ET_S1_Division_Europe_State.3.t
    desc = ET_S1_Division_Europe_State.3.desc

    is_triggered_only = yes

    immediate = { }

    option = { # A: Transfer Köningsberg to the Soviet Union
        name = ET_S1_Division_Europe_State.3.a
        ai_chance = {
            factor = 1
        }
        custom_effect_tooltip = ET_S1_Division_World_Historical_TT
        763 =  { transfer_state_to  = SOV } # Köningsberg
        SOV = { add_state_core = 763 }

        hidden_effect = {
            GER = { remove_state_core = 763 }
            SOV = {
                if = {
                    limit = { has_government = communism }
                    country_event = { id = ET_SovietUnion_Renaming_Renaming.1 days = 30 }
                }
            }
        }
    }
    option = { # B: Refuce
        name = ET_S1_Division_Europe_State.3.b

        reverse_add_opinion_modifier = {
            target = SOV
            modifier = ET_broke_agreements
        }

        ai_chance = { factor = 0 }
    }
}
country_event = { # 5 STATE: Carpathian Ruthenia
    id = ET_S1_Division_Europe_State.5
    title = ET_S1_Division_Europe_State.5.t
    desc = ET_S1_Division_Europe_State.5.desc

    is_triggered_only = yes

    immediate = { }

    option = {
        name = ET_S1_Division_Europe_State.5.a
        custom_effect_tooltip = ET_S1_Division_World_Historical_TT

        73 = { transfer_state_to  = SOV } # CZE core provinces
        SOV = { add_state_core = 73 }

        hidden_effect = {
            CZE = { remove_state_core = 73 }
            HUN = { remove_state_core = 73 }
        }

        ai_chance = { factor = 1 }
    }
    option = { # B: Refuce
        name = ET_S1_Division_Europe_State.5.b
        reverse_add_opinion_modifier = {
            target = SOV
            modifier = ET_broke_agreements
        }

        ai_chance = { factor = 0 }
    }
}
country_event = { # 6 STATE: Memel
    id = ET_S1_Division_Europe_State.6
    title = ET_S1_Division_Europe_State.6.t
    desc = ET_S1_Division_Europe_State.6.desc

    is_triggered_only = yes

    immediate = { }

    option = {
        name = ET_S1_Division_Europe_State.6.a
        trigger = { NOT = { country_exists = LIT } }
        custom_effect_tooltip = ET_S1_Division_World_Historical_TT

        188 = { transfer_state_to  = SOV }
        SOV = { add_state_core = 188 }
        hidden_effect = {
            GER = { remove_state_core = 188 }
        }

        ai_chance = { factor = 1 }
    }
    option = {
        name = ET_S1_Division_Europe_State.6.b
        trigger = { country_exists = LIT }

        188 = { transfer_state_to  = LIT }
        hidden_effect = {
            GER = { remove_state_core = 188 }
        }

        ai_chance = { factor = 1 }
    }
    option = { # Refuce
        name = ET_S1_Division_Europe_State.6.c

        reverse_add_opinion_modifier = {
            target = SOV
            modifier = ET_broke_agreements
        }

        ai_chance = { factor = 0}
    }
}

country_event = { # 26 STATE: Gibraltar
    id = ET_S1_Division_Europe_State.26
    title = ET_S1_Division_Europe_State.26.t
    desc = ET_S1_Division_Europe_State.26.desc

    is_triggered_only = yes

    immediate = { }

    option = {
        name = ET_S1_Division_Europe_State.26.a
        custom_effect_tooltip = ET_S1_Division_World_Historical_TT

        118 = { transfer_state_to  = ENG }

        hidden_effect = {
            SPA = { remove_state_core = 118 }
        }

        ai_chance = { factor = 1 }
    }
    option = { # Refuce
        name = ET_S1_Division_Europe_State.26.c

        reverse_add_opinion_modifier = {
            target = ENG
            modifier = ET_broke_agreements
        }

        ai_chance = { factor = 0}
    }
}


# Special
country_event = { # 1 SPECIAL: Divide Berlin
    id = ET_S1_Division_Europe_Special.1
    title = ET_S1_Division_Europe_Special.1.t
    desc = ET_S1_Division_Europe_Special.1.desc

    is_triggered_only = yes

    immediate = { }

    option = { # A: Add devided city modifier
        custom_effect_tooltip = ET_S1_Division_World_Historical_TT
        name = ET_S1_Division_Europe_Special.1.a

        add_province_modifier = {
            static_modifiers = { ET_divided_city }
            province = 6521
        }

        set_province_name = {
            id = 11666
            name = ET_S1_Division_CityName_Berlin
        }

        ai_chance = { factor = 1 }
    }
    option = { # B: Refuce
        name = ET_S1_Division_Europe_Special.1.b

        ai_chance = { factor = 0 }
    }
}
country_event = { # 2 SPECIAL: Divide Vienna
    id = ET_S1_Division_Europe_Special.2
    title = ET_S1_Division_Europe_Special.2.t
    desc = ET_S1_Division_Europe_Special.2.desc

    is_triggered_only = yes

    immediate = { }

    option = { # A: Add devided city modifier
        name = ET_S1_Division_Europe_Special.2.a
        custom_effect_tooltip = ET_S1_Division_World_Historical_TT

        add_province_modifier = {
            static_modifiers = { ET_divided_city }
            province = 11666
        }

        set_province_name = {
            id = 11666
            name = ET_S1_Division_CityName_Vienna
        }

        ai_chance = { factor = 1 }
    }
    option = { # B: Refuce
        name = ET_S1_Division_Europe_Special.2.b

        ai_chance = { factor = 0 }
    }
}


# # 
# ASIA
# #
country_event = { # 1 NORTH KOREA
    id = ET_S1_Division_Asia.1
    title = ET_S1_Division_Asia.1.t
    desc = ET_S1_Division_Asia.1.desc

    is_triggered_only = yes

    immediate = { }

    option = { # A: Give States to Soviet Union
        name = ET_S1_Division_Asia.1.a
        if = { limit = { is_debug = yes } log = "[GetDateText]: [This.GetTag] transfering North Korea to Soviet Union." }

        if = { limit = { controls_state = 527 } 527 = { transfer_state_to  = SOV } }

        ai_chance = { factor = 1 }
    }
    option = { # B: Refuce
        name = ET_S1_Division_Asia.2.b
        if = { limit = { is_debug = yes } log = "[GetDateText]: [This.GetTag] does not transfer North Korea state to Soviet Union" }

        ai_chance = { factor = 0 }
    }
}
country_event = { # 2 SOUTH KOREA
    id = ET_S1_Division_Asia.2
    title = ET_S1_Division_Asia.2.t
    desc = ET_S1_Division_Asia.2.desc

    is_triggered_only = yes

    immediate = { }

    option = { # A: Give States to USA
        name = ET_S1_Division_Asia.2.a
        if = { limit = { is_debug = yes } log = "[GetDateText]: [This.GetTag] transfering South Korea to USA." }

        if = { limit = { controls_state = 525 } 525 = { transfer_state_to  = USA } }

        ai_chance = { factor = 1 }
    }
    option = { # B: Refuce
        name = ET_S1_Division_Asia.2.b
        if = { limit = { is_debug = yes } log = "[GetDateText]: [This.GetTag] does not transfer South Korea state to USA" }

        ai_chance = { factor = 0 }
    }
}
country_event = { # 3 JAPAN
    id = ET_S1_Division_Asia.3
    title = ET_S1_Division_Asia.3.t
    desc = ET_S1_Division_Asia.3.desc

    is_triggered_only = yes

    immediate = { }

    option = { # A: Give States to United States
        name = ET_S1_Division_Asia.3.a
        if = { limit = { is_debug = yes } log = "[GetDateText]: [This.GetTag] transfering Japanese states to USA." }

        if = { limit = { controls_state = 555 } 555 = { transfer_state_to  = USA } } # Main land
        if = { limit = { controls_state = 536 } 536 = { transfer_state_to  = USA } } # Main land
        if = { limit = { controls_state = 533 } 533 = { transfer_state_to  = USA } } # Main land
        if = { limit = { controls_state = 534 } 534 = { transfer_state_to  = USA } } # Main land
        if = { limit = { controls_state = 282 } 282 = { transfer_state_to  = USA } } # Main land
        if = { limit = { controls_state = 535 } 535 = { transfer_state_to  = USA } } # Main land
        if = { limit = { controls_state = 532 } 532 = { transfer_state_to  = USA } } # Main land
        if = { limit = { controls_state = 531 } 531 = { transfer_state_to  = USA } } # Main land
        if = { limit = { controls_state = 529 } 529 = { transfer_state_to  = USA } } # Main land
        if = { limit = { controls_state = 530 } 530 = { transfer_state_to  = USA } } # Main land
        if = { limit = { controls_state = 526 } 526 = { transfer_state_to  = USA } } # Main land

        if = { limit = { controls_state = 526 } 526 = { transfer_state_to  = USA } } # Island

        if = { limit = { controls_state = 645 } 645 = { transfer_state_to  = USA } }
        if = { limit = { controls_state = 649 } 649 = { transfer_state_to  = USA } }
        if = { limit = { controls_state = 646 } 646 = { transfer_state_to  = USA } }
        if = { limit = { controls_state = 638 } 638 = { transfer_state_to  = USA } }

        ai_chance = { factor = 1 }
    }
    option = { # B: Refuce
        name = ET_S1_Division_Asia.3.b
        if = { limit = { is_debug = yes } log = "[GetDateText]: [This.GetTag] Does not transfer Japanese states to USA." }

        ai_chance = { factor = 0 }
    }
}
country_event = { # 4 FRENCH INDOCHINA (Colonies)
    id = ET_S1_Division_Asia.4
    title = ET_S1_Division_Asia.3.t
    desc = ET_S1_Division_Asia.3.desc

    is_triggered_only = yes

    immediate = { }

    option = { # A: Give States to United States
        name = ET_S1_Division_Asia.3.a
        if = { limit = { is_debug = yes } log = "[GetDateText]: [This.GetTag] transfering French Colonies back to Franse" }

        if = { limit = { controls_state = 671 } 671 = { transfer_state_to  = FRA } }
        if = { limit = { controls_state = 670 } 670 = { transfer_state_to  = FRA } }
        if = { limit = { controls_state = 741 } 741 = { transfer_state_to  = FRA } }
        if = { limit = { controls_state = 286 } 286 = { transfer_state_to  = FRA } }
 
        ai_chance = { factor = 1 }
    }
    option = { # B: Refuce
        name = ET_S1_Division_Asia.3.b

        ai_chance = { factor = 0 }
    }
}