###########################
# Ukrainian Events
###########################

add_namespace = russia2_ukraine

# Check if File is Loaded
country_event = {
	id = russia2_ukraine.2092066524

	hidden = yes

	is_triggered_only = yes

	immediate = {
		set_global_flag = russia_reworked_events_loaded_ukraine
	}
}

#White Guard Ask Us to Join Them in Their Fight - No Country Flag
country_event = {
	id = russia2_ukraine.1
	title = russia2_ukraine.1.t
	desc = russia2_ukraine.1.d
	picture = GFX_report_event_british_inspect_troops

	is_triggered_only = yes

	option = { #Accepts
		name = russia2_ukraine.1.a
		ai_chance = {
			base = 20
			modifier = {
				factor = 0
				OR = {
					has_country_flag = UKR_AI_ANARCHIST_BEHAVIOR
					has_country_flag = UKR_AI_ISOLATED_BEHAVIOR
					has_country_flag = UKR_AI_ALLIANCE_FINLAND_BEHAVIOR
				}
			}
			modifier = {
				add = 80
				has_country_flag = UKR_AI_AGGRESSIVE_BEHAVIOR
			}
		}
		set_country_flag = accept_to_help_whiteguard
		add_ai_strategy = {
			type = conquer
			id = SOJ
			value = 200
		}
		hidden_effect = {
			SOJ = {
				country_event = { id = russia2_ukraine.38 days = 1 }
			}
		}
		SOV = {
			country_event = { id = russia2_ukraine.2 hours = 6 }
		}
	}

	option = { #Refuse
		name = russia2_ukraine.1.b
		ai_chance = {
			base = 80
			modifier = {
				add = 20
				OR = {
					has_country_flag = UKR_AI_ANARCHIST_BEHAVIOR
					has_country_flag = UKR_AI_ISOLATED_BEHAVIOR
					has_country_flag = UKR_AI_ALLIANCE_FINLAND_BEHAVIOR
				}
			}
			modifier = {
				factor = 0
				has_country_flag = UKR_AI_AGGRESSIVE_BEHAVIOR
			}
		}
		SOV = {
			country_event = { id = russia2_ukraine.3 hours = 6 }
		}
	}
}

#Ukraine Has Accepted
country_event = {
	id = russia2_ukraine.2
	title = russia2_ukraine.2.t
	desc = russia2_ukraine.2.d
	picture = GFX_soldiers_handshaking_kolchak_russia2

	is_triggered_only = yes

	option = { #Good
		name = russia2_ukraine.2.a
		ai_chance = { base = 100 }
		if = {
			limit = {
				SOV = {
					has_war_with = SOJ
				}
				UKR = {
					NOT = {
						has_war_with = SOJ
					}
				}
			}
			UKR = {
				add_ideas = SOV_Second_civil_war_idea_modifier
				add_to_war = {
					targeted_alliance = SOV
					enemy = SOJ
					hostility_reason = anti_soviet_alliance
				}
			}
		}
	}
}

#Ukraine Refuses
country_event = {
	id = russia2_ukraine.3
	title = russia2_ukraine.3.t
	desc = russia2_ukraine.3.d
	picture = GFX_report_event_ger_civil_war

	is_triggered_only = yes

	option = { #Damn
		name = russia2_ukraine.3.a
		ai_chance = { base = 100 }
		UKR = {
			hidden_effect = {
				country_event = { id = russia2_ukraine.32 days = 5 }
			}
		}
	}
}

#White Guard Ask Us to Join Them in Their Fight - Country Flag
country_event = {
	id = russia2_ukraine.4
	title = russia2_ukraine.4.t
	desc = russia2_ukraine.4.d
	picture = GFX_report_event_british_inspect_troops

	is_triggered_only = yes

	option = { #Accepts
		name = russia2_ukraine.4.a
		ai_chance = {
			base = 75
			modifier = {
				factor = 0
				OR = {
					has_country_flag = UKR_AI_ANARCHIST_BEHAVIOR
					has_country_flag = UKR_AI_ISOLATED_BEHAVIOR
					has_country_flag = UKR_AI_ALLIANCE_FINLAND_BEHAVIOR
				}
			}
			modifier = {
				add = 25
				has_country_flag = UKR_AI_AGGRESSIVE_BEHAVIOR
			}
		}
		set_country_flag = accept_to_help_whiteguard
		add_ai_strategy = {
			type = conquer
			id = SOJ
			value = 200
		}
		hidden_effect = {
			SOJ = {
				country_event = { id = russia2_ukraine.38 days = 1 }
			}
		}
		SOV = {
			country_event = { id = russia2_ukraine.5 hours = 6 }
		}
	}

	option = { #Refuse
		name = russia2_ukraine.4.b
		ai_chance = {
			base = 25
			modifier = {
				add = 75
				OR = {
					has_country_flag = UKR_AI_ANARCHIST_BEHAVIOR
					has_country_flag = UKR_AI_ISOLATED_BEHAVIOR
					has_country_flag = UKR_AI_ALLIANCE_FINLAND_BEHAVIOR
				}
			}
			modifier = {
				factor = 0
				has_country_flag = UKR_AI_AGGRESSIVE_BEHAVIOR
			}
		}
		SOV = {
			country_event = { id = russia2_ukraine.6 hours = 6 }
		}
	}
}

#Ukraine Has Accepted
country_event = {
	id = russia2_ukraine.5
	title = russia2_ukraine.5.t
	desc = russia2_ukraine.5.d
	picture = GFX_soldiers_handshaking_kolchak_russia2

	is_triggered_only = yes

	option = { #Good
		name = russia2_ukraine.5.a
		ai_chance = {
			base = 100
		}
		if = {
			limit = {
				SOV = {
					has_war_with = SOJ
				}
				UKR = {
					NOT = {
						has_war_with = SOJ
					}
				}
			}
			UKR = {
				add_ideas = SOV_Second_civil_war_idea_modifier
				add_to_war = {
					targeted_alliance = SOV
					enemy = SOJ
					hostility_reason = anti_soviet_alliance
				}
			}
		}
	}
}

#Ukraine Refuses
country_event = {
	id = russia2_ukraine.6
	title = russia2_ukraine.6.t
	desc = russia2_ukraine.6.d
	picture = GFX_report_event_ger_civil_war

	is_triggered_only = yes

	option = { #Damn
		name = russia2_ukraine.6.a
		ai_chance = { base = 100 }
		UKR = {
			hidden_effect = {
				country_event = { id = russia2_ukraine.32 days = 5 }
			}
		}
	}
}

#White Guard Asks Us to stay neutral
country_event = {
	id = russia2_ukraine.7
	title = russia2_ukraine.7.t
	desc = russia2_ukraine.7.d
	picture = GFX_report_event_british_inspect_troops

	is_triggered_only = yes

	option = { #Accept
		name = russia2_ukraine.7.a
		ai_chance = {
			base = 50
			modifier = {
				add = 50
				OR = {
					SOV = {
						has_country_flag = sympathize_with_ukraine
					}
					has_country_flag = UKR_AI_ANARCHIST_BEHAVIOR
					has_country_flag = UKR_AI_ISOLATED_BEHAVIOR
					has_country_flag = UKR_AI_ALLIANCE_FINLAND_BEHAVIOR
				}
			}
			modifier = {
				factor = 0
				has_country_flag = UKR_AI_AGGRESSIVE_BEHAVIOR
			}
		}
		SOV = {
			country_event = { id = russia2_ukraine.8 hours = 6 }
		}
	}

	option = { #Refuse
		name = russia2_ukraine.7.b
		ai_chance = {
			base = 50
			modifier = {
				factor = 0
				OR = {
					SOV = {
						has_country_flag = sympathize_with_ukraine
					}
					has_country_flag = UKR_AI_ANARCHIST_BEHAVIOR
					has_country_flag = UKR_AI_ISOLATED_BEHAVIOR
					has_country_flag = UKR_AI_ALLIANCE_FINLAND_BEHAVIOR
				}
			}
			modifier = {
				add = 50
				has_country_flag = UKR_AI_AGGRESSIVE_BEHAVIOR
			}
		}
		SOV = {
			country_event = { id = russia2_ukraine.9 hours = 6 }
		}
		set_country_flag = refused_neutrality
	}
}

#Ukraine Accepts
country_event = {
	id = russia2_ukraine.8
	title = russia2_ukraine.8.t
	desc = russia2_ukraine.8.d
	picture = GFX_soldiers_handshaking_kolchak_russia2

	is_triggered_only = yes

	option = { #Good
		name = russia2_ukraine.8.a
		ai_chance = { base = 100 }
		UKR = {
			add_ideas = SOV_Neutrality_second
			add_opinion_modifier = {
				target = SOV
				modifier = neutral_second_war
			}
			add_opinion_modifier = {
				target = SOJ
				modifier = neutral_second_war
			}
			hidden_effect = {
				country_event = { id = russia2_ukraine.32 days = 5 }
			}
		}
		if = {
			limit = {
				has_country_flag = sympathize_with_ukraine
			}
			set_country_flag = russia_ukraine_accept_neutrality_scw
		}
	}
}

#Ukraine Refuses
country_event = {
	id = russia2_ukraine.9
	title = russia2_ukraine.9.t
	desc = russia2_ukraine.9.d
	picture = GFX_report_event_ger_civil_war

	is_triggered_only = yes

	option = { #Damn
		name = russia2_ukraine.9.a
		ai_chance = { base = 100 }
		hidden_effect = {
			UKR = {
				country_event = { id = russia2_ukraine.37 days = 5 }
			}
		}
	}
}

#Ukraine Gets Event to Intervene in the Second Civil War
country_event = {
	id = russia2_ukraine.10
	title = russia2_ukraine.10.t
	desc = russia2_ukraine.10.d
	picture = GFX_battkle_kursk_russia2

	fire_only_once = yes

	trigger = {
		tag = UKR
		has_war = no
		is_subject = no
		has_global_flag = second_russian_civil_war_in_progress
		NOT = {
			has_government = anarchy
			has_country_flag = ukr_anarchist_rebels
		}
		SOJ = {
			has_war_with = SOV
			surrender_progress > 0.65
		}
	}

	mean_time_to_happen = { days = 1 }

	option = { #Attack SOJ
		name = russia2_ukraine.10.a
		ai_chance = {
			base = 25
			modifier = {
				factor = 0
				OR = {
					has_country_flag = UKR_AI_ANARCHIST_BEHAVIOR
					has_country_flag = UKR_AI_ISOLATED_BEHAVIOR
					has_country_flag = UKR_AI_ALLIANCE_FINLAND_BEHAVIOR
				}
			}
			modifier = {
				add = 75
				has_country_flag = UKR_AI_AGGRESSIVE_BEHAVIOR
			}
		}
		declare_war_on = {
			target = SOJ
			type = annex_everything
		}
		hidden_effect = {
			SOJ = {
				country_event = { id = russia2_ukraine.38 days = 1 }
			}
			for_each_scope_loop = {
				array = global.russian_scw_participants_soj

				if = {
					limit = {
						NOT = {
							ROOT = {
								has_war_with = PREV
							}
						}
					}
					ROOT = {
						declare_war_on = {
							target = PREV
							type = second_russian_civil_war
						}
						add_ai_strategy = {
							type = conquer
							id = PREV
							value = 200
						}
					}
				}
			}
		}
		add_ideas = SOV_Second_civil_war_idea_modifier
		if = {
			limit = {
				has_country_flag = has_accepted_scw_neutrality
			}
			custom_effect_tooltip = sov_might_take_action_sou
			hidden_effect = {
				SOV = {
					country_event = { id = russia2_ukraine.11 hours = 1 }
				}
			}
		}
		if = {
			limit = {
				SOV = {
					has_country_flag = russia_ukraine_accept_neutrality_scw
				}
			}
			SOV = {
				clr_country_flag = russia_ukraine_accept_neutrality_scw
			}
		}
	}

	option = { #Alliance with Finland
		name = russia2_ukraine.10.b
		trigger = {
			FIN = {
				exists = yes
				NOT = {
					has_war = yes
					is_faction_leader = yes
					is_subject = yes
				}
			}
			any_of_scopes = {
				array = global.russian_scw_participants

				is_neighbor_of = FIN
			}
		}
		ai_chance = {
			base = 25
			modifier = {
				factor = 0
				OR = {
					has_country_flag = UKR_AI_ANARCHIST_BEHAVIOR
					has_country_flag = UKR_AI_ISOLATED_BEHAVIOR
				}
			}
			modifier = {
				add = 75
				OR = {
					has_country_flag = UKR_AI_AGGRESSIVE_BEHAVIOR
					has_country_flag = UKR_AI_ALLIANCE_FINLAND_BEHAVIOR
				}
			}
		}
		declare_war_on = {
			target = SOJ
			type = annex_everything
		}
		hidden_effect = {
			SOJ = {
				country_event = { id = russia2_ukraine.38 days = 1 }
			}
			for_each_scope_loop = {
				array = global.russian_scw_participants_soj

				if = {
					limit = {
						NOT = {
							ROOT = {
								has_war_with = PREV
							}
						}
					}
					ROOT = {
						declare_war_on = {
							target = PREV
							type = second_russian_civil_war
						}
						add_ai_strategy = {
							type = conquer
							id = PREV
							value = 200
						}
					}
				}
			}
		}
		add_ideas = SOV_Second_civil_war_idea_modifier
		FIN = {
			country_event = { id = russia2_ukraine.50 days = 3 }
		}
		custom_effect_tooltip = ukr_will_make_concessions_fin
		if = {
			limit = {
				has_country_flag = has_accepted_scw_neutrality
			}
			custom_effect_tooltip = sov_might_take_action_sou
			hidden_effect = {
				SOV = {
					country_event = { id = russia2_ukraine.11 hours = 1 }
				}
			}
		}
		if = {
			limit = {
				SOV = {
					has_country_flag = russia_ukraine_accept_neutrality_scw
				}
			}
			SOV = {
				clr_country_flag = russia_ukraine_accept_neutrality_scw
			}
		}
	}

	option = { #Do nothing
		name = russia2_ukraine.10.c
		ai_chance = {
			base = 50
			modifier = {
				add = 50
				OR = {
					has_country_flag = UKR_AI_ANARCHIST_BEHAVIOR
					has_country_flag = UKR_AI_ISOLATED_BEHAVIOR
				}
			}
			modifier = {
				factor = 0
				OR = {
					has_country_flag = UKR_AI_AGGRESSIVE_BEHAVIOR
					has_country_flag = UKR_AI_ALLIANCE_FINLAND_BEHAVIOR
				}
			}
		}
		add_stability = 0.05
	}
}

#UKR Betrays Neutrality
country_event = {
	id = russia2_ukraine.11
	title = russia2_ukraine.11.t
	desc = russia2_ukraine.11.d
	picture = GFX_report_event_ger_civil_war

	is_triggered_only = yes

	option = { #Kill them
		name = russia2_ukraine.11.a
		ai_chance = { base = 35 }
		declare_war_on = {
			target = UKR
			type = second_russian_civil_war
		}
		hidden_effect = {
			for_each_scope_loop = {
				array = global.russian_scw_participants_ukr

				if = {
					limit = {
						NOT = {
							ROOT = {
								has_war_with = PREV
							}
						}
					}
					ROOT = {
						declare_war_on = {
							target = PREV
							type = second_russian_civil_war
						}
						add_ai_strategy = {
							type = conquer
							id = PREV
							value = 200
						}
					}
				}
			}
		}
	}

	option = { #Nvm
		name = russia2_ukraine.11.b
		ai_chance = { base = 65 }
	}
}

#SOV DEM Sends Ultimatum for Reintegration
country_event = {
	id = russia2_ukraine.12
	title = russia2_ukraine.12.t
	desc = russia2_ukraine.12.d
	picture = GFX_report_event_german_troops

	is_triggered_only = yes

	option = { #Accept
		name = russia2_ukraine.12.a
		ai_chance = { base = 40 }
		SOV = {
			country_event = { id = russia2_russia.451 days = 1 }
		}
	}

	option = { #Refuse
		name = russia2_ukraine.12.b
		ai_chance = { base = 60 }
		SOV = {
			country_event = { id = russia2_russia.452 days = 1 }
		}
		UKR = {
			add_ideas = SOV_Surviving_against_russian
			division_template = {
				name = "Elite Free Infantry"
				priority = 1
				regiments = {
					infantry = { x = 0 y = 0 }
					infantry = { x = 0 y = 1 }
					infantry = { x = 0 y = 2 }
					infantry = { x = 0 y = 3 }
					infantry = { x = 0 y = 4 }
					infantry = { x = 1 y = 0 }
					infantry = { x = 1 y = 1 }
					infantry = { x = 1 y = 2 }
					infantry = { x = 1 y = 3 }
				}
			}
			random_owned_controlled_state = {
				create_unit = {
					division = "name = \"11th Elite Free Infantry\" division_template = \"Elite Free Infantry\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
					owner = UKR
				}
				create_unit = {
					division = "name = \"12th Elite Free Infantry\" division_template = \"Elite Free Infantry\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
					owner = UKR
				}
				create_unit = {
					division = "name = \"13th Elite Free Infantry\" division_template = \"Elite Free Infantry\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
					owner = UKR
				}
				create_unit = {
					division = "name = \"14th Elite Free Infantry\" division_template = \"Elite Free Infantry\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
					owner = UKR
				}
				create_unit = {
					division = "name = \"15th Elite Free Infantry\" division_template = \"Elite Free Infantry\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
					owner = UKR
				}
				create_unit = {
					division = "name = \"16th Elite Free Infantry\" division_template = \"Elite Free Infantry\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
					owner = UKR
				}
				create_unit = {
					division = "name = \"17th Elite Free Infantry\" division_template = \"Elite Free Infantry\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
					owner = UKR
				}
				create_unit = {
					division = "name = \"18th Elite Free Infantry\" division_template = \"Elite Free Infantry\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
					owner = UKR
				}
				create_unit = {
					division = "name = \"19th Elite Free Infantry\" division_template = \"Elite Free Infantry\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
					owner = UKR
				}
				create_unit = {
					division = "name = \"20th Elite Free Infantry\" division_template = \"Elite Free Infantry\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
					owner = UKR
				}
				create_unit = {
					division = "name = \"21th Elite Free Infantry\" division_template = \"Elite Free Infantry\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
					owner = UKR
				}
				create_unit = {
					division = "name = \"22th Elite Free Infantry\" division_template = \"Elite Free Infantry\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
					owner = UKR
				}
				create_unit = {
					division = "name = \"23th Elite Free Infantry\" division_template = \"Elite Free Infantry\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
					owner = UKR
				}
				create_unit = {
					division = "name = \"24th Elite Free Infantry\" division_template = \"Elite Free Infantry\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
					owner = UKR
				}
				create_unit = {
					division = "name = \"25th Elite Free Infantry\" division_template = \"Elite Free Infantry\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
					owner = UKR
				}
				create_unit = {
					division = "name = \"26th Elite Free Infantry\" division_template = \"Elite Free Infantry\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
					owner = UKR
				}
				create_unit = {
					division = "name = \"27th Elite Free Infantry\" division_template = \"Elite Free Infantry\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
					owner = UKR
				}
				create_unit = {
					division = "name = \"28th Elite Free Infantry\" division_template = \"Elite Free Infantry\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
					owner = UKR
				}
				create_unit = {
					division = "name = \"29th Elite Free Infantry\" division_template = \"Elite Free Infantry\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
					owner = UKR
				}
				create_unit = {
					division = "name = \"30th Elite Free Infantry\" division_template = \"Elite Free Infantry\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
					owner = UKR
				}
				create_unit = {
					division = "name = \"31th Elite Free Infantry\" division_template = \"Elite Free Infantry\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
					owner = UKR
				}
				create_unit = {
					division = "name = \"32th Elite Free Infantry\" division_template = \"Elite Free Infantry\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
					owner = UKR
				}
				create_unit = {
					division = "name = \"33th Elite Free Infantry\" division_template = \"Elite Free Infantry\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
					owner = UKR
				}
				create_unit = {
					division = "name = \"34th Elite Free Infantry\" division_template = \"Elite Free Infantry\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
					owner = UKR
				}
				create_unit = {
					division = "name = \"35th Elite Free Infantry\" division_template = \"Elite Free Infantry\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
					owner = UKR
				}
			}
		}
	}
}

#SOV DEM Sends Ultimatum for Puppet
country_event = {
	id = russia2_ukraine.13
	title = russia2_ukraine.13.t
	desc = russia2_ukraine.13.d
	picture = GFX_report_event_gre_allied_diplomacy

	is_triggered_only = yes

	option = { #Accept
		name = russia2_ukraine.13.a
		ai_chance = { base = 60 }
		SOV = {
			country_event = { id = russia2_russia.453 days = 1 }
		}
	}

	option = { #Refuse
		name = russia2_ukraine.13.b
		ai_chance = { base = 40 }
		SOV = {
			country_event = { id = russia2_russia.454 days = 1 }
		}
		UKR = {
			add_ideas = SOV_Surviving_against_russian
		}
	}
}

#Ukraine Future if they have Accepted Puppet
country_event = {
	id = russia2_ukraine.14
	title = russia2_ukraine.14.t
	desc = russia2_ukraine.14.d
	picture = GFX_report_event_german_inspect_troops

	trigger = {
		tag = UKR
		is_subject_of = SOV
		exists = yes
		SOV = {
			has_country_flag = ukr_accepted_puppet_united_russia
			has_government = democratic
			is_subject = no
			exists = yes
		}
	}

	fire_only_once = yes

	mean_time_to_happen = { days = 360 }

	option = { #Reintegrate With Russia
		name = russia2_ukraine.14.a
		ai_chance = { base = 40 }
		SOV = {
			country_event = { id = russia2_russia.455 days = 1 }
		}
	}

	option = { #Ask for Expansion
		name = russia2_ukraine.14.b
		ai_chance = { base = 60 }
		SOV = {
			country_event = { id = russia2_russia.456 days = 1 }
		}
	}
}

# State of the Army
country_event = {
	id = russia2_ukraine.15
	title = russia2_ukraine.15.t
	desc = russia2_ukraine.15.d
	picture = GFX_report_event_por_president_military_inspection
	is_triggered_only = yes

	option = { # Ok
		name = russia2_ukraine.15.a
		ai_chance = { base = 100 }
		army_experience = 25
	}
}

# State of the Air Force
country_event = {
	id = russia2_ukraine.16
	title = russia2_ukraine.16.t
	desc = russia2_ukraine.16.d
	picture = GFX_soviet_plane_russia2

	is_triggered_only = yes

	option = { # Ok
		name = russia2_ukraine.16.a
		ai_chance = { base = 100 }
		air_experience = 25
	}
}

# State of the Navy
country_event = {
	id = russia2_ukraine.17
	title = russia2_ukraine.17.t
	desc = russia2_ukraine.17.d
	picture = GFX_ship_dockyard_russia2

	is_triggered_only = yes

	option = { # Ok
		name = russia2_ukraine.17.a
		ai_chance = { base = 100 }
		navy_experience = 25
	}
}

# Military Pensions
country_event = {
	id = russia2_ukraine.18
	title = russia2_ukraine.18.t
	desc = russia2_ukraine.18.d
	picture = GFX_report_event_german_inspect_troops

	is_triggered_only = yes

	option = { # Moderate Pensions
		name = russia2_ukraine.18.a
		ai_chance = {
			base = 50
			modifier = {
				factor = 0
				has_country_flag = UKR_AI_ANARCHIST_BEHAVIOR
			}
		}
		add_ideas = UKR_Military_pension_1
	}

	option = { # Heavy Pensions
		name = russia2_ukraine.18.b
		ai_chance = {
			base = 25
			modifier = {
				factor = 0
				has_country_flag = UKR_AI_ANARCHIST_BEHAVIOR
			}
		}
		add_ideas = UKR_Military_pension_2
	}

	option = { # No Pensions
		name = russia2_ukraine.18.c
		ai_chance = {
			base = 25
			modifier = {
				add = 75
				has_country_flag = UKR_AI_ANARCHIST_BEHAVIOR
			}
		}
		add_ideas = UKR_Military_pension_3
	}
}

# Industrial Revival
country_event = {
	id = russia2_ukraine.19
	title = russia2_ukraine.19.t
	desc = russia2_ukraine.19.d
	picture = GFX_report_event_generic_lend_lease

	is_triggered_only = yes

	option = { # Big debts
		name = russia2_ukraine.19.a
		ai_chance = { base = 100 }
		remove_ideas = UKR_Sole_proprietorships
		add_ideas = UKR_Industrial_revival
		custom_effect_tooltip = unlocks_industrial_revival_project_decisions
	}
}

# Seize Crimea
country_event = {
	id = russia2_ukraine.20
	title = russia2_ukraine.20.t
	desc = russia2_ukraine.20.d
	picture = GFX_report_event_generic_panzer_attack

	is_triggered_only = yes

	option = { #Seize it! We need to use their territory
		name = russia2_ukraine.20.a
		ai_chance = {
			base = 40
			modifier = {
				factor = 0
				OR = {
					surrender_progress > 0.4
					num_divisions < 35
					has_country_flag = accept_to_help_whiteguard
					has_country_flag = UKR_AI_ISOLATED_BEHAVIOR
				}
			}
			modifier = {
				add = 60
				has_country_flag = UKR_AI_AGGRESSIVE_BEHAVIOR
			}
		}
		declare_war_on = {
			target = CRI
			type = second_russian_civil_war
		}
		if = {
			limit = {
				SOV = {
					exists = yes
					is_subject = no
					has_war = yes
					has_country_flag = control_caucasus
					NOT = {
						has_war_with = ROOT
					}
				}
			}
			custom_effect_tooltip = sov_might_take_action_crimea
			hidden_effect = {
				SOV = {
					country_event = russia2_ukraine.24
				}
			}
		}
	}

	option = { #Ask for their ships and military access
		name = russia2_ukraine.20.b
		ai_chance = {
			base = 40
			modifier = {
				factor = 0
				OR = {
					surrender_progress > 0.4
					has_country_flag = accept_to_help_whiteguard
					has_country_flag = UKR_AI_AGGRESSIVE_BEHAVIOR
					has_country_flag = UKR_AI_ISOLATED_BEHAVIOR
				}
			}
		}
		CRI = {
			country_event = russia2_ukraine.21
		}
		if = {
			limit = {
				SOV = {
					exists = yes
					is_subject = no
					has_war = yes
					has_country_flag = control_caucasus
					NOT = {
						has_war_with = ROOT
					}
				}
			}
			custom_effect_tooltip = sov_might_take_action_crimea
		}
	}

	option = { #We don't want troubles
		name = russia2_ukraine.20.c
		ai_chance = {
			base = 20
			modifier = {
				add = 80
				OR = {
					surrender_progress > 0.4
					has_country_flag = accept_to_help_whiteguard
					has_country_flag = UKR_AI_ISOLATED_BEHAVIOR
				}
			}
			modifier = {
				factor = 0
				has_country_flag = UKR_AI_AGGRESSIVE_BEHAVIOR
			}
		}
		add_political_power = 50
	}
}

# UKR Asks for Navy
country_event = {
	id = russia2_ukraine.21
	title = russia2_ukraine.21.t
	desc = russia2_ukraine.21.d
	picture = GFX_report_event_ast_navy

	is_triggered_only = yes

	option = { #Give in to their demands
		name = russia2_ukraine.20.a
		ai_chance = {
			base = 75
		}
		UKR = {
			country_event = russia2_ukraine.22
		}
	}

	option = { #Refuse...
		name = russia2_ukraine.20.b
		ai_chance = {
			base = 25
		}
		custom_effect_tooltip = cri_will_lead_to_war_with_ukr
		UKR = {
			country_event = russia2_ukraine.23
		}
	}
}

# Crimea Accepts
country_event = {
	id = russia2_ukraine.22
	title = russia2_ukraine.22.t
	desc = russia2_ukraine.22.d
	picture = GFX_handshake_russia2

	is_triggered_only = yes

	option = { #Wonderful
		name = russia2_ukraine.22.a
		ai_chance = {
			base = 100
		}
		CRI = {
			transfer_navy = {
				target = ROOT
			}
			give_military_access = ROOT
		}
	}
}

# Crimea Refuses
country_event = {
	id = russia2_ukraine.23
	title = russia2_ukraine.23.t
	desc = russia2_ukraine.23.d
	picture = GFX_menacing_tanks_russia2

	is_triggered_only = yes

	option = { #Die
		name = russia2_ukraine.23.a
		ai_chance = {
			base = 100
		}
		declare_war_on = {
			target = CRI
			type = second_russian_civil_war
		}
		hidden_effect = {
			SOV = {
				if = {
					limit = {
						exists = yes
						is_subject = no
						has_war = yes
						has_country_flag = control_caucasus
						NOT = {
							has_war_with = ROOT
						}
					}
					country_event = russia2_ukraine.24
				}
			}
		}
	}
}

# Ukraine Attacks Crimea
country_event = {
	id = russia2_ukraine.24
	title = russia2_ukraine.24.t
	desc = russia2_ukraine.24.d
	picture = GFX_menacing_tanks_russia2

	is_triggered_only = yes

	option = { #Ur ded son
		name = russia2_ukraine.24.a
		ai_chance = {
			base = 15
			modifier = {
				add = 15
				is_neighbor_of = CRI
			}
		}
		UKR = {
			country_event = russia2_ukraine.25
		}
		custom_effect_tooltip = sov_will_declare_war_on_ukr_if_refuse
	}

	option = { #Not our business
		name = russia2_ukraine.24.a
		ai_chance = {
			base = 85
			modifier = {
				add = -15
				is_neighbor_of = CRI
			}
		}
		add_political_power = 25
	}
}

# White Guard (SOV) Asks for Withdrawal from Crimea
country_event = {
	id = russia2_ukraine.25
	title = russia2_ukraine.25.t
	desc = russia2_ukraine.25.d
	picture = GFX_cavalry_parade_russia2

	is_triggered_only = yes

	option = { #Ok
		name = russia2_ukraine.25.a
		ai_chance = {
			base = 75
			modifier = {
				add = 25
				surrender_progress > 0.20
			}
		}
		white_peace = {
			tag = CRI
			message = WHITE_GUARD_INTERVENTION_CRIMEA
		}
		SOV = {
			country_event = russia2_ukraine.26
		}
	}

	option = { #No
		name = russia2_ukraine.25.b
		ai_chance = {
			base = 25
			modifier = {
				factor = 0
				surrender_progress > 0.20
			}
		}
		custom_effect_tooltip = ukr_will_lead_to_war_with_sov
		SOV = {
			country_event = russia2_ukraine.27
		}
	}
}

# UKR Accepts
country_event = {
	id = russia2_ukraine.26
	title = russia2_ukraine.26.t
	desc = russia2_ukraine.26.d
	picture = GFX_soldiers_handshaking_kolchak_russia2

	is_triggered_only = yes

	option = { #Good
		name = russia2_ukraine.22.a
		ai_chance = {
			base = 100
		}
	}
}

# UKR Refuses
country_event = {
	id = russia2_ukraine.27
	title = russia2_ukraine.27.t
	desc = russia2_ukraine.27.d
	picture = GFX_operation_barbarossa_russia2

	is_triggered_only = yes

	option = { #Let's kill them
		name = russia2_ukraine.27.a
		ai_chance = {
			base = 100
		}
		declare_war_on = {
			target = UKR
			type = second_russian_civil_war
		}
		hidden_effect = {
			for_each_scope_loop = {
				array = global.russian_scw_participants_ukr

				if = {
					limit = {
						NOT = {
							ROOT = {
								has_war_with = PREV
							}
						}
					}
					ROOT = {
						declare_war_on = {
							target = PREV
							type = second_russian_civil_war
						}
						add_ai_strategy = {
							type = conquer
							id = PREV
							value = 200
						}
					}
				}
			}
		}
		hidden_effect = {
			UKR = {
				add_ideas = SOV_Second_civil_war_idea_modifier
			}
		}
	}
}

# UKR Seeks Help
country_event = {
	id = russia2_ukraine.28
	title = russia2_ukraine.28.t
	desc = russia2_ukraine.28.d
	picture = GFX_soldiers_parade_russia2

	is_triggered_only = yes

	option = { #Sure!
		name = russia2_ukraine.28.a
		ai_chance = {
			base = 50
			modifier = {
				add = 25
				has_equipment = {
					infantry_equipment > 2000
				}
			}
			modifier = {
				add = 25
				has_government = UKR
			}
		}
		send_equipment = {
			equipment = infantry_equipment
			amount = 2000
			target = UKR
		}
		UKR = {
			country_event = russia2_ukraine.29
		}
	}

	option = { #Nah
		name = russia2_ukraine.28.b
		ai_chance = {
			base = 50
			modifier = {
				add = -25
				has_equipment = {
					infantry_equipment > 2000
				}
			}
			modifier = {
				add = -25
				has_government = UKR
			}
		}
	}
}

# FROM Sends Help
country_event = {
	id = russia2_ukraine.29
	title = russia2_ukraine.29.t
	desc = russia2_ukraine.29.d
	picture = GFX_report_event_czech_soldiers_02

	is_triggered_only = yes

	option = { #Yay!
		name = russia2_ukraine.29.a
		ai_chance = {
			base = 100
		}
		effect_tooltip = {
			FROM = {
				send_equipment = {
					equipment = infantry_equipment
					amount = 2000
					target = UKR
				}
			}
		}
		add_opinion_modifier = {
			target = FROM
			modifier = ukr_helped_civil_war
		}
	}
}

# Administration of Occupied Territories
country_event = {
	id = russia2_ukraine.30
	title = russia2_ukraine.30.t
	desc = russia2_ukraine.30.d
	picture = GFX_report_event_generic_sign_treaty3
	is_triggered_only = yes

	option = { #Harsh Administration
		name = russia2_ukraine.30.a
		ai_chance = {
			base = 50
			modifier = {
				add = 25
				NOT = {
					has_government = anarchy
				}
				OR = {
					has_government = communism
					has_government = fascism
				}
			}
			modifier = {
				add = -25
				NOT = {
					has_government = anarchy
				}
				OR = {
					has_government = democratic
					has_government = neutrality
				}
			}
		}
		add_ideas = UKR_Harsh_administration
	}

	option = { #Soft Administration
		name = russia2_ukraine.30.b
		ai_chance = {
			base = 50
			modifier = {
				add = -25
				NOT = {
					has_government = anarchy
				}
				OR = {
					has_government = communism
					has_government = fascism
				}
			}
			modifier = {
				add = 25
				NOT = {
					has_government = anarchy
				}
				OR = {
					has_government = democratic
					has_government = neutrality
				}
			}
		}
		add_ideas = UKR_Soft_administration
	}
}

#You can play as Ukraine or another country
country_event = {
	id = russia2_ukraine.31
	title = russia2_ukraine.31.t
	desc = russia2_ukraine.31.d
	picture = GFX_report_event_gre_allied_diplomacy

	is_triggered_only = yes

	timeout_days = 5

	option = { #No
		name = russia2_ukraine.31.a
		ai_chance = {
			base = 100
		}
		hidden_effect = {
			SOV = {
				country_event = { id = russia2_russia.136 days = 3 }
			}
		}
	}

	option = { #Yes
		name = russia2_ukraine.31.b
		ai_chance = {
			base = 0
		}
		trigger = {
			is_ai = no
		}
		UKR = {
			change_tag_from = ROOT
		}
		hidden_effect = {
			SOV = {
				country_event = { id = russia2_russia.136 days = 3 }
			}
		}
	}

	option = { #Other country set in game rules
		name = russia2_ukraine.31.c
		ai_chance = {
			base = 0
		}
		trigger = {
			NOT = {
				is_ai = no
				check_variable = {
					var = global.russia_switch_country_id_scw
					value = 0
					compare = equals
				}
			}
			country_exists = var:global.russia_switch_country_id_scw
		}
		var:global.russia_switch_country_id_scw = {
			change_tag_from = ROOT
		}
		hidden_effect = {
			SOV = {
				country_event = { id = russia2_russia.136 days = 3 }
			}
		}
	}
}

#Anarchist Rebels
country_event = {
	id = russia2_ukraine.32
	title = russia2_ukraine.32.t
	desc = russia2_ukraine.32.d
	picture = GFX_report_event_generic_riot

	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			country_event = { id = russia2_ukraine.33 days = 15 }
		}
	}

	option = { #Noobs
		name = russia2_ukraine.32.a
		ai_chance = {
			base = 50
			modifier = {
				add = 50
				OR = {
					SOV = {
						has_country_flag = sympathize_with_ukraine
					}
					NOT = {
						has_country_flag = UKR_AI_ANARCHIST_BEHAVIOR
					}
				}
			}
			modifier = {
				factor = 0
				has_country_flag = UKR_AI_ANARCHIST_BEHAVIOR
			}
		}
		add_political_power = -50
		add_to_variable = { ukr_current_non_anarchist_support = 1 }
	}

	option = { #Let them be
		name = russia2_ukraine.32.b
		ai_chance = {
			base = 50
			modifier = {
				factor = 0
				OR = {
					SOV = {
						has_country_flag = sympathize_with_ukraine
					}
					NOT = {
						has_country_flag = UKR_AI_ANARCHIST_BEHAVIOR
					}
				}
			}
			modifier = {
				add = 50
				has_country_flag = UKR_AI_ANARCHIST_BEHAVIOR
			}
		}
		trigger = {
			has_country_flag = ukr_anarchist_rebels
		}
		add_stability = -0.05
		add_to_variable = { ukr_current_anarchist_support = 1 }
	}
}

#Anarchist Rebels 2
country_event = {
	id = russia2_ukraine.33
	title = russia2_ukraine.33.t
	desc = russia2_ukraine.33.d
	picture = GFX_ship_dockyard_russia2

	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			country_event = { id = russia2_ukraine.34 days = 15 }
		}
	}

	option = { #Noobs
		name = russia2_ukraine.33.a
		ai_chance = {
			base = 50
			modifier = {
				add = 50
				OR = {
					SOV = {
						has_country_flag = sympathize_with_ukraine
					}
					NOT = {
						has_country_flag = UKR_AI_ANARCHIST_BEHAVIOR
					}
				}
			}
			modifier = {
				factor = 0
				has_country_flag = UKR_AI_ANARCHIST_BEHAVIOR
			}
		}
		add_manpower = -5000
		add_to_variable = { ukr_current_non_anarchist_support = 1 }
	}

	option = { #Let them be
		name = russia2_ukraine.33.b
		ai_chance = {
			base = 50
			modifier = {
				factor = 0
				OR = {
					SOV = {
						has_country_flag = sympathize_with_ukraine
					}
					NOT = {
						has_country_flag = UKR_AI_ANARCHIST_BEHAVIOR
					}
				}
			}
			modifier = {
				add = 50
				has_country_flag = UKR_AI_ANARCHIST_BEHAVIOR
			}
		}
		trigger = {
			has_country_flag = ukr_anarchist_rebels
		}
		add_war_support = 0.05
		add_to_variable = { ukr_current_anarchist_support = 1 }
	}
}

#Anarchist Rebels 3
country_event = {
	id = russia2_ukraine.34
	title = russia2_ukraine.34.t
	desc = russia2_ukraine.34.d
	picture = GFX_report_event_soviet_soldiers
	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			country_event = { id = russia2_ukraine.35 days = 15 }
		}
	}

	option = { #Noobs
		name = russia2_ukraine.34.a
		ai_chance = {
			base = 50
			modifier = {
				add = 50
				OR = {
					SOV = {
						has_country_flag = sympathize_with_ukraine
					}
					NOT = {
						has_country_flag = UKR_AI_ANARCHIST_BEHAVIOR
					}
				}
			}
			modifier = {
				factor = 0
				has_country_flag = UKR_AI_ANARCHIST_BEHAVIOR
			}
		}
		add_equipment_to_stockpile = {
			type = infantry_equipment
			amount = -2000
		}
		add_to_variable = { ukr_current_non_anarchist_support = 1 }
	}

	option = { #Let them be
		name = russia2_ukraine.34.b
		ai_chance = {
			base = 50
			modifier = {
				factor = 0
				OR = {
					SOV = {
						has_country_flag = sympathize_with_ukraine
					}
					NOT = {
						has_country_flag = UKR_AI_ANARCHIST_BEHAVIOR
					}
				}
			}
			modifier = {
				add = 50
				has_country_flag = UKR_AI_ANARCHIST_BEHAVIOR
			}
		}
		trigger = {
			has_country_flag = ukr_anarchist_rebels
		}
		add_stability = -0.1
		add_to_variable = { ukr_current_anarchist_support = 1 }
	}
}

#Anarchist Rebels 4
country_event = {
	id = russia2_ukraine.35
	title = russia2_ukraine.35.t
	desc = russia2_ukraine.35.d
	picture = GFX_report_event_worker_protests

	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			country_event = { id = russia2_ukraine.36 days = 15 }
		}
	}

	option = { #Noobs
		name = russia2_ukraine.35.a
		ai_chance = {
			base = 50
			modifier = {
				add = 50
				OR = {
					SOV = {
						has_country_flag = sympathize_with_ukraine
					}
					NOT = {
						has_country_flag = UKR_AI_ANARCHIST_BEHAVIOR
					}
				}
			}
			modifier = {
				factor = 0
				has_country_flag = UKR_AI_ANARCHIST_BEHAVIOR
			}
		}
		add_political_power = 50
		random_owned_controlled_state = {
			limit = {
				infrastructure > 3
			}
			damage_building = {
				type = infrastructure
				damage = 1
			}
		}
		add_to_variable = { ukr_current_non_anarchist_support = 1 }
	}

	option = { #Let them be
		name = russia2_ukraine.35.b
		ai_chance = {
			base = 50
			modifier = {
				factor = 0
				OR = {
					SOV = {
						has_country_flag = sympathize_with_ukraine
					}
					NOT = {
						has_country_flag = UKR_AI_ANARCHIST_BEHAVIOR
					}
				}
			}
			modifier = {
				add = 50
				has_country_flag = UKR_AI_ANARCHIST_BEHAVIOR
			}
		}
		trigger = {
			has_country_flag = ukr_anarchist_rebels
		}
		add_stability = -0.2
		add_to_variable = { ukr_current_anarchist_support = 1 }
	}
}

#Results
country_event = {
	id = russia2_ukraine.36
	title = russia2_ukraine.36.t
	desc = russia2_ukraine.36.d
	picture = GFX_report_event_hungary_parliament

	is_triggered_only = yes

	timeout_days = 5

	option = { #Anarchism Fails
		name = russia2_ukraine.36.a
		ai_chance = {
			base = 100
		}
		trigger = {
			check_variable = {
				var = ukr_current_non_anarchist_support
				value = ukr_current_anarchist_support
				compare = greater_than
			}
		}
		add_stability = 0.15
		add_political_power = 200
		clr_country_flag = ukr_anarchist_rebels
	}

	option = { #Anarchism Wins
		name = russia2_ukraine.36.b
		ai_chance = {
			base = 100
		}
		trigger = {
			check_variable = {
				var = ukr_current_anarchist_support
				value = ukr_current_non_anarchist_support
				compare = greater_than
			}
		}
		add_stability = -0.2
		add_political_power = 500
		set_politics = {
			ruling_party = anarchy
			elections_allowed = no
		}
		set_global_flag = ukr_turned_anarchist_free_state
		clr_country_flag = ukr_anarchist_rebels
		custom_effect_tooltip = ukr_loses_all_cores
		custom_effect_tooltip = ukr_unlocks_anarchist_legetimacy_decisions
		add_ideas = UKR_Free_state
		hidden_effect = {
			if = {
				limit = {
					has_global_flag = second_russian_civil_war_in_progress
				}
				country_event = { id = russia2_ukraine.40 days = 10 }
			}
			add_popularity = {
				ideology = anarchy
				popularity = 0.5
			}
			set_temp_variable = { anarchy_support_divided_by_two = ukr.party_popularity_100@anarchy }
			divide_temp_variable = { anarchy_support_divided_by_two = 2 }
			for_each_loop = {
				array = ukr.core_states
				value = v
				index = i
				break = break_array

				add_to_array = { ukr.temp_core_states = var:v }
			}
			for_each_loop = {
				array = ukr.temp_core_states
				value = v
				index = i
				break = break_array

				if = {
					limit = {
						var:v = {
							is_capital = yes
							is_controlled_by = UKR
						}
					}
					set_variable = { ukr.anarchist_support@var:v = 100 }
				}
				else = {
					if = {
						limit = {
							var:v = {
								is_controlled_by = UKR
							}
						}
						set_variable = { ukr.anarchist_support@var:v = var:anarchy_support_divided_by_two }
					}
					var:v = {
						remove_core_of = UKR
					}
				}
			}
			ukr_update_state_cost = yes
			ukr_update_anarchist_states = yes
            ukr_update_current_view = yes
			ukr_add_daily_gain_anarchist_states = yes
			add_ideas = UKR_Anarchist_legitimacy
			for_each_scope_loop = {
				array = global.russian_scw_participants

				country_event = russia2_ukraine.39
			}
		}
	}

	option = { #Both Win (Choose Republic)
		name = russia2_ukraine.36.c
		ai_chance = {
			base = 50
			modifier = {
				add = 50
				NOT = {
					has_country_flag = UKR_AI_ANARCHIST_BEHAVIOR
				}
			}
			modifier = {
				factor = 0
				has_country_flag = UKR_AI_ANARCHIST_BEHAVIOR
			}
		}
		trigger = {
			check_variable = {
				var = ukr_current_non_anarchist_support
				value = ukr_current_anarchist_support
				compare = equals
			}
		}
		add_stability = 0.10
		add_political_power = 150
		add_manpower = -5000
		add_equipment_to_stockpile = {
			type = infantry_equipment
			amount = -3000
		}
		clr_country_flag = ukr_anarchist_rebels
	}

	option = { #Both Wins (Choose Anarchism)
		name = russia2_ukraine.36.e
		ai_chance = {
			base = 50
			modifier = {
				factor = 0
				NOT = {
					has_country_flag = UKR_AI_ANARCHIST_BEHAVIOR
				}
			}
			modifier = {
				add = 50
				has_country_flag = UKR_AI_ANARCHIST_BEHAVIOR
			}
		}
		trigger = {
			check_variable = {
				var = ukr_current_anarchist_support
				value = ukr_current_non_anarchist_support
				compare = equals
			}
		}
		add_stability = -0.15
		add_political_power = 250
		set_politics = {
			ruling_party = anarchy
			elections_allowed = no
		}
		set_global_flag = ukr_turned_anarchist_free_state
		clr_country_flag = ukr_anarchist_rebels
		custom_effect_tooltip = ukr_loses_all_cores
		custom_effect_tooltip = ukr_unlocks_anarchist_legetimacy_decisions
		add_ideas = UKR_Free_state
		hidden_effect = {
			if = {
				limit = {
					has_global_flag = second_russian_civil_war_in_progress
				}
				country_event = { id = russia2_ukraine.40 days = 10 }
			}
			add_popularity = {
				ideology = anarchy
				popularity = 0.5
			}
			set_temp_variable = { anarchy_support_divided_by_two = ukr.party_popularity_100@anarchy }
			divide_temp_variable = { anarchy_support_divided_by_two = 2 }
			for_each_loop = {
				array = ukr.core_states
				value = v
				index = i
				break = break_array

				add_to_array = { ukr.temp_core_states = var:v }
			}
			for_each_loop = {
				array = ukr.temp_core_states
				value = v
				index = i
				break = break_array

				if = {
					limit = {
						var:v = {
							is_capital = yes
							is_controlled_by = UKR
						}
					}
					set_variable = { ukr.anarchist_support@var:v = 100 }
				}
				else = {
					if = {
						limit = {
							var:v = {
								is_controlled_by = UKR
							}
						}
						set_variable = { ukr.anarchist_support@var:v = var:anarchy_support_divided_by_two }
					}
					var:v = {
						remove_core_of = UKR
					}
				}
			}
			ukr_update_state_cost = yes
			ukr_update_anarchist_states = yes
            ukr_update_current_view = yes
			ukr_add_daily_gain_anarchist_states = yes
			add_ideas = UKR_Anarchist_legitimacy
			for_each_scope_loop = {
				array = global.russian_scw_participants

				country_event = russia2_ukraine.39
			}
		}
	}
}

#Join the War or Not
country_event = {
	id = russia2_ukraine.37
	title = russia2_ukraine.37.t
	desc = russia2_ukraine.37.d
	picture = GFX_battkle_kursk_russia2

	is_triggered_only = yes

	option = { #Yes
		name = russia2_ukraine.37.a
		ai_chance = {
			base = 50
			modifier = {
				factor = 0
				OR = {
					has_country_flag = UKR_AI_ANARCHIST_BEHAVIOR
					has_country_flag = UKR_AI_ISOLATED_BEHAVIOR
					has_country_flag = UKR_AI_ALLIANCE_FINLAND_BEHAVIOR
				}
			}
			modifier = {
				add = 50
				has_country_flag = UKR_AI_AGGRESSIVE_BEHAVIOR
			}
		}
		declare_war_on = {
			target = SOJ
			type = second_russian_civil_war
		}
		hidden_effect = {
			SOJ = {
				country_event = { id = russia2_ukraine.38 days = 1 }
			}
			for_each_scope_loop = {
				array = global.russian_scw_participants_soj

				if = {
					limit = {
						NOT = {
							ROOT = {
								has_war_with = PREV
							}
						}
					}
					ROOT = {
						declare_war_on = {
							target = PREV
							type = second_russian_civil_war
						}
						add_ai_strategy = {
							type = conquer
							id = PREV
							value = 200
						}
					}
				}
			}
		}
		add_ai_strategy = {
			type = conquer
			id = SOJ
			value = 200
		}
		add_stability = -0.05
		add_war_support = 0.1
		hidden_effect = {
			add_ideas = SOV_Second_civil_war_idea_modifier
			country_event = { id = russia2_ukraine.48 days = 7 }
		}
	}

	option = { #No
		name = russia2_ukraine.37.b
		ai_chance = {
			base = 50
			modifier = {
				add = 50
				OR = {
					has_country_flag = UKR_AI_ANARCHIST_BEHAVIOR
					has_country_flag = UKR_AI_ISOLATED_BEHAVIOR
					has_country_flag = UKR_AI_ALLIANCE_FINLAND_BEHAVIOR
				}
			}
			modifier = {
				factor = 0
				has_country_flag = UKR_AI_AGGRESSIVE_BEHAVIOR
			}
		}
		add_stability = 0.05
		hidden_effect = {
			country_event = { id = russia2_ukraine.32 days = 5 }
		}
	}
}

#UKR Joins the SCW
country_event = {
	id = russia2_ukraine.38
	title = russia2_ukraine.38.t
	desc = russia2_ukraine.38.d
	picture = GFX_menacing_tanks_russia2

	is_triggered_only = yes

	option = { #Okay...
		name = russia2_ukraine.38.a
		ai_chance = {
			base = 100
		}
	}
}

#UKR Becomes Anarchist
country_event = {
	id = russia2_ukraine.39
	title = russia2_ukraine.39.t
	desc = russia2_ukraine.39.d
	picture = GFX_artillery_with_building_russia2

	is_triggered_only = yes

	option = { #Troubles are coming...
		name = russia2_ukraine.39.a
		ai_chance = {
			base = 100
		}
		custom_effect_tooltip = ukr_will_join_scw_soon
	}
}

#Anarchist Ukraine Event to join the SCW
country_event = {
	id = russia2_ukraine.40
	title = russia2_ukraine.40.t
	desc = russia2_ukraine.40.d
	picture = GFX_soldiers_with_guns_russia2

	is_triggered_only = yes

	option = { #Here we go
		name = russia2_ukraine.40.a
		ai_chance = {
			base = 100
		}
		custom_effect_tooltip = ukr_declares_on_all_scw_participants
		add_political_power = 100
		capital_scope = {
			add_extra_state_shared_building_slots = 4
			add_building_construction = {
				type = industrial_complex
				level = 2
				instant_build = yes
			}
			add_building_construction = {
				type = arms_factory
				level = 2
				instant_build = yes
			}
		}
		hidden_effect = {
			add_ideas = SOV_Second_civil_war_idea_modifier
			for_each_scope_loop = {
				array = global.russian_scw_participants

				if = {
					limit = {
						NOT = {
							ROOT = {
								has_war_with = PREV
								is_in_faction_with = PREV
							}
							PREV = {
								is_subject_of = ROOT
							}
						}
					}
					country_event = { id = russia2_ukraine.38 hours = 1 }
					ROOT = {
						declare_war_on = {
							target = PREV
							type = second_russian_civil_war
						}
						add_ai_strategy = {
							type = conquer
							id = PREV
							value = 200
						}
					}
				}
			}
			country_event = { id = russia2_ukraine.48 days = 7 }
		}
	}
}

#Ukraine Tries to Coup Belarus
country_event = {
	id = russia2_ukraine.41
	title = russia2_ukraine.41.t
	desc = russia2_ukraine.41.d
	picture = GFX_soldiers_parade_russia2

	is_triggered_only = yes

	option = { #Coup Succeeds
		name = russia2_ukraine.41.a
		ai_chance = {
			base = 75
		}
		UKR = {
			set_autonomy = {
				target = ROOT
				autonomy_state = autonomy_puppet
			}
			country_event = { id = russia2_ukraine.42 days = 1 }
		}
		hidden_effect = {
			every_owned_state = {
				limit = {
					any_of_scopes = {
						array = global.russian_scw_participants_ukr

						controls_state = PREV
					}
				}
				ROOT = {
					set_state_controller = PREV
				}
			}
		}
	}

	option = { #Coup Fails
		name = russia2_ukraine.41.b
		ai_chance = {
			base = 25
		}
		add_stability = -0.05
		UKR = {
			country_event = { id = russia2_ukraine.43 days = 1 }
		}
	}
}

#Coup Succeeds
country_event = {
	id = russia2_ukraine.42
	title = russia2_ukraine.42.t
	desc = russia2_ukraine.42.d
	picture = GFX_soldiers_with_guns_russia2

	is_triggered_only = yes

	option = { #Yay
		name = russia2_ukraine.42.a
		ai_chance = {
			base = 100
		}
		set_country_flag = ukr_blr_coup_succeeds
		hidden_effect = {
			if = {
				limit = {
					NOT = {
						has_war_with = SOV
					}
				}
				SOV = {
					country_event = { id = russia2_ukraine.44 days = 1 }
				}
			}
		}
	}
}

#Coup Fails :(
country_event = {
	id = russia2_ukraine.43
	title = russia2_ukraine.43.t
	desc = russia2_ukraine.43.d
	picture = GFX_artillery_with_building_russia2

	is_triggered_only = yes

	option = { #Yay
		name = russia2_ukraine.43.a
		ai_chance = {
			base = 100
		}
		add_political_power = 50
		set_country_flag = ukr_blr_coup_fails
	}
}

#Ukraine Coups Belarus
country_event = {
	id = russia2_ukraine.44
	title = russia2_ukraine.44.t
	desc = russia2_ukraine.44.d
	picture = GFX_soldiers_with_guns_russia2

	is_triggered_only = yes

	option = { #Fuck em up
		name = russia2_ukraine.44.a
		ai_chance = {
			base = 25
			modifier = {
				add = 75
				has_country_flag = sympathize_with_ukraine
			}
			modifier = {
				add = -25
				surrender_progress > 0.1
			}
		}
		add_war_support = 0.05
		if = {
			limit = {
				NOT = {
					has_war_with = UKR
				}
			}
			declare_war_on = {
				target = UKR
				type = second_russian_civil_war
			}
			hidden_effect = {
				for_each_scope_loop = {
					array = global.russian_scw_participants_ukr

					if = {
						limit = {
							NOT = {
								ROOT = {
									has_war_with = PREV
								}
							}
						}
						ROOT = {
							declare_war_on = {
								target = PREV
								type = second_russian_civil_war
							}
							add_ai_strategy = {
								type = conquer
								id = PREV
								value = 200
							}
						}
					}
				}
				UKR = {
					country_event = russia2_ukraine.45
					add_ideas = SOV_Second_civil_war_idea_modifier
				}
			}
		}
	}

	option = { #Don't care
		name = russia2_ukraine.44.b
		ai_chance = {
			base = 75
			modifier = {
				add = -75
				has_country_flag = sympathize_with_ukraine
			}
			modifier = {
				add = 25
				surrender_progress > 0.1
			}
		}
		add_political_power = 50
	}
}

#White Guard Attacks Us
country_event = {
	id = russia2_ukraine.45
	title = russia2_ukraine.45.t
	desc = russia2_ukraine.45.d
	picture = GFX_russian_civil_war_russia2

	is_triggered_only = yes

	option = { #Uh
		name = russia2_ukraine.45.a
		ai_chance = {
			base = 100
		}
	}
}

#End of the Russian Civil War
country_event = {
	id = russia2_ukraine.47
	title = russia2_ukraine.47.t
	desc = russia2_ukraine.47.d
	picture = GFX_report_event_generic_ruins

	is_triggered_only = yes

	option = { #Nice
		name = russia2_ukraine.47.a
		ai_chance = {
			base = 100
		}
		set_global_flag = second_russian_civil_war_over
		clr_global_flag = second_russian_civil_war_in_progress
		remove_ideas = SOV_Second_civil_war_idea_modifier
		add_ideas = low_economic_mobilisation
		add_ideas = limited_conscription 
		SOV = {
			set_country_flag = white_guard_lost_civil_war
		}
		hidden_effect = {
			every_state = {
				limit = {
					is_owned_by = ROOT
					NOT = {
						is_core_of = ROOT
					}
				}
				add_compliance = 40
			}
			SOJ = {
				every_character = {
					set_nationality = SOV
					set_character_flag = russia_is_in_prison_cw
					clr_character_flag = sov_character_switched_to_sou
				}
			}
			if = {
				limit = {
					country_exists = UKR
					UKR = {
						has_completed_focus = UKR_boost_industry
					}
				}
				UKR = {
					add_offsite_building = {
						type = industrial_complex
						level = -1
					}
					add_offsite_building = {
						type = arms_factory
						level = -2
					}
				}
			}
			if = {
				limit = {
					SOV = {
						is_subject_of = UKR
					}
				}
				every_state = {
					limit = {
						is_owned_by = SOV
					}
					SOV = {
						transfer_state = PREV
					}
				}
				SOV = {
					set_capital = {
						state = 217
					}
				}
			}
			else_if = {
				limit = {
					SOJ = {
						is_subject_of = UKR
					}
				}
				every_state = {
					limit = {
						is_owned_by = SOJ
						is_capital = yes
					}
					SOV = {
						transfer_state = PREV
					}
				}
				SOJ = {
					transfer_units_fraction= {
						target = SOV
						size = 1
						stockpile_ratio = 1
						army_ratio = 1
						navy_ratio = 1
						air_ratio = 1
					}
				}
				every_state = {
					limit = {
						is_core_of = SOV
						is_owned_by = SOJ
					}
					SOV = {
						transfer_state = PREV
					}
				}
				if = {
					limit = {
						SOJ = {
							any_owned_state = {
								is_core_of = MON
							}
						}
					}
					SOJ = {
						release = MON
					}
					UKR = {
						set_autonomy = {
							target = MON
							autonomy_state = autonomy_puppet
						}
					}
				}
				UKR = {
					set_autonomy = {
						target = SOV
						autonomy_state = autonomy_puppet
					}
				}
				SOV = {
					every_state = {
						limit = {
							is_owned_by = SOV
						}
						SOV = {
							transfer_state = PREV
						}
					}
					create_country_leader = { #fuck characters
						name = UKR_Ivan_kononov
						desc = UKR_Ivan_kononov_desc
						picture = "gfx/leaders/UKR/Portrait_Ukraine_Ivan_Kononov.dds"
						expire = "1965.1.1"
						ideology = oligarchism
						traits = {
							russia2_loyal_collaborator
						}
					}
					set_cosmetic_tag = AFS
				}
			}
			else = {
				every_state = {
					limit = {
						is_core_of = SOV
						is_owned_by = UKR
						NOT = {
							ukr_is_kievan_rus_state = yes
						}
					}
					SOV = {
						transfer_state = PREV
					}
				}
				UKR = {
					set_autonomy = {
						target = SOV
						autonomy_state = autonomy_puppet
					}
				}
				if = {
					limit = {
						any_owned_state = {
							is_core_of = MON
						}
					}
					UKR = {
						release_autonomy = {
							target = MON
							autonomy_state = autonomy_puppet
						}
					}
				}
				SOV = {
					create_country_leader = { #fuck characters
						name = UKR_Ivan_kononov
						desc = UKR_Ivan_kononov_desc
						picture = "gfx/leaders/UKR/Portrait_Ukraine_Ivan_Kononov.dds"
						expire = "1965.1.1"
						ideology = oligarchism
						traits = {
							russia2_loyal_collaborator
						}
					}
					set_cosmetic_tag = AFS
					hidden_effect = {
						meta_effect = {
							text = {
								division_template = {
									name = "[TEMPLATE_NAME]"
									is_locked = no
		
									regiments = {
										infantry = { x = 0 y = 0 }
										infantry = { x = 0 y = 1 }
										infantry = { x = 0 y = 2 }
										infantry = { x = 1 y = 0 }
										infantry = { x = 1 y = 1 }
										infantry = { x = 1 y = 2 }
										infantry = { x = 2 y = 0 }
										infantry = { x = 2 y = 1 }
										infantry = { x = 2 y = 2 }
									}
									support = {
										artillery = { x = 0 y = 0 }
									}
								}
							}
							TEMPLATE_NAME = "[THIS.GetAdjective] Military Police"
						}
						meta_effect = {
							text = {
								division_template = {
									name = "[TEMPLATE_NAME]"
									is_locked = no
		
									regiments = {
										light_armor = { x = 0 y = 0 }
										light_armor = { x = 0 y = 1 }
										light_armor = { x = 1 y = 0 }
										light_armor = { x = 1 y = 1 }
										light_armor = { x = 1 y = 2 }
										motorized = { x = 2 y = 0 }
										motorized = { x = 2 y = 1 }
										motorized = { x = 2 y = 2 }
										motorized = { x = 2 y = 3 }
									}
								}
							}
							TEMPLATE_NAME = "[THIS.Capital.GetName] Tank Brigade"
						}
		
						set_temp_variable = { num_divisions_russian_state = THIS.owned_states }
						set_temp_variable = { num_divisions_russian_state_loca = 1 }
						set_temp_variable = { tank_division_russian_state = 0 }
						clamp_temp_variable = {
							var = num_divisions_russian_state
							min = 3
							max = 50
						}
		
						while_loop_effect = {
							break = break
							limit = {
								check_variable = {
									var = num_divisions_russian_state
									value = 1
									compare = greater_than_or_equals
								}
							}
		
							random_owned_controlled_state = {
								meta_effect = {
									text = {
										create_unit = {
											division = "name = \"[UNIT_NAME]\" division_template = \"[TEMPLATE_NAME]\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
											owner = PREV
											allow_spawning_on_enemy_provs = yes
										}
									}
									UNIT_NAME = "[PREV.GetAdjective] Military Police [?num_divisions_russian_state_loca]"
									TEMPLATE_NAME = "[PREV.GetAdjective] Military Police"
								}
							}
							add_to_temp_variable = { num_divisions_russian_state_loca = 1 }
							random_owned_controlled_state = {
								meta_effect = {
									text = {
										create_unit = {
											division = "name = \"[UNIT_NAME]\" division_template = \"[TEMPLATE_NAME]\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
											owner = PREV
											allow_spawning_on_enemy_provs = yes
										}
									}
									UNIT_NAME = "[PREV.GetAdjective] Military Police [?num_divisions_russian_state_loca]"
									TEMPLATE_NAME = "[PREV.GetAdjective] Military Police"
								}
							}
							add_to_temp_variable = { num_divisions_russian_state_loca = 1 }
							add_to_temp_variable = { tank_division_russian_state = 1 }
							if = {
								limit = {
									check_variable = {
										var = tank_division_russian_state
										value = 10
										compare = greater_than_or_equals
									}
								}
								capital_scope = {
									meta_effect = {
										text = {
											create_unit = {
												division = "name = \"[UNIT_NAME]\" division_template = \"[TEMPLATE_NAME]\" start_experience_factor = 0.6 start_equipment_factor = 1.0"
												owner = PREV
												allow_spawning_on_enemy_provs = yes
											}
										}
										UNIT_NAME = "[THIS.GetName] Tank Brigade"
										TEMPLATE_NAME = "[THIS.GetName] Tank Brigade"
									}
								}
								set_temp_variable = { tank_division_russian_state = 0 }
							}
							subtract_from_temp_variable = { num_divisions_russian_state = 1 }
						}
					}
				}
			}
			every_country = {
				limit = {
					has_idea = SOV_Second_civil_war_idea_modifier
				}
				remove_ideas = SOV_Second_civil_war_idea_modifier
			}
			every_country = {
				limit = {
					has_idea = SOV_Supply_line
				}
				remove_ideas = SOV_Supply_line
			}
			every_country = {
				limit = {
					has_idea = SOV_Urals_secret
				}
				remove_ideas = SOV_Urals_secret
			}
			every_country = {
				limit = {
					has_idea = SOV_Slow_industry
				}
				remove_ideas = SOV_Slow_industry
			}
			every_country = {
				limit = {
					has_idea = SOV_Organize_volunteer_forces
				}
				remove_ideas = SOV_Organize_volunteer_forces
			}
			582 = {
				remove_dynamic_modifier = {
					modifier = urals_secret
				}
			}
			573 = {
				remove_dynamic_modifier = {
					modifier = urals_secret
				}
			}
			581 = {
				remove_dynamic_modifier = {
					modifier = urals_secret
				}
			}
			SOV = {
				set_capital = {
					state = 217
				}
			}
			hidden_effect = {
				every_state = {
					limit = {
						is_core_of = SOJ
					}
					remove_core_of = SOJ
				}
			}
		}
	}
}

#Deserting White Generals are granting us help
country_event = {
	id = russia2_ukraine.48
	title = russia2_ukraine.48.t
	desc = russia2_ukraine.48.d
	picture = GFX_soldiers_handshaking_kolchak_russia2

	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			SOV = {
				country_event = { id = russia2_ukraine.49 }
			}
			SOJ = {
				country_event = { id = russia2_ukraine.49 }
			}
		}
	}

	option = { #Nice
		name = russia2_ukraine.48.a
		ai_chance = {
			base = 100
		}
		custom_effect_tooltip = some_generals_from_whiteguard_and_union_join
		hidden_effect = {
			SOV = {
				every_character = {
					limit = {
						has_character_flag = flag_former_deserting_generals
					}
					set_nationality = UKR
				}
			}
			SOJ = {
				every_character = {
					limit = {
						has_character_flag = flag_former_deserting_generals
					}
					set_nationality = UKR
				}
			}
		}
	}
}

#General Deserting to Ukraine
country_event = {
	id = russia2_ukraine.49
	title = russia2_ukraine.49.t
	desc = russia2_ukraine.49.d
	picture = GFX_report_event_polish_army

	is_triggered_only = yes

	option = { #Damn
		name = russia2_ukraine.49.a
		ai_chance = {
			base = 100
		}
	}
}

#Ukraine Asks for Alliance
country_event = {
	id = russia2_ukraine.50
	title = russia2_ukraine.50.t
	desc = russia2_ukraine.50.d
	picture = GFX_report_event_SOV_demands

	is_triggered_only = yes

	option = { #Sure
		name = russia2_ukraine.50.a
		ai_chance = {
			base = 75
			modifier = {
				add = 25
				UKR = {
					surrender_progress < 0.05
				}
			}
			modifier = {
				add = -50
				UKR = {
					surrender_progress > 0.25
				}
			}
		}
		set_country_flag = fin_accepted_scw_ukr_alliance
		add_stability = 0.1
		add_war_support = 0.1
		add_political_power = 100
		add_ai_strategy = {
			type = alliance
			id = UKR
			value = 500
		}
		UKR = {
			hidden_effect = {
				if = {
					limit = {
						NOT = {
							is_faction_leader = yes
						}
					}
					create_faction = finnish_ukrainian_alliance
				}
			}
			add_ai_strategy = {
				type = alliance
				id = ROOT
				value = 500
			}
			add_to_faction = ROOT
			country_event = russia2_ukraine.51
		}
		declare_war_on = {
			target = SOJ
			type = second_russian_civil_war
		}
		if = {
			limit = {
				UKR = {
					has_country_flag = has_accepted_scw_neutrality
				}
			}
			custom_effect_tooltip = sov_might_take_action_fin
		}
		hidden_effect = {
			for_each_scope_loop = {
				array = global.russian_scw_participants_soj

				if = {
					limit = {
						NOT = {
							ROOT = {
								has_war_with = PREV
							}
						}
					}
					ROOT = {
						declare_war_on = {
							target = PREV
							type = second_russian_civil_war
						}
						add_ai_strategy = {
							type = conquer
							id = PREV
							value = 200
						}
					}
				}
			}
		}
	}

	option = { #No
		name = russia2_ukraine.50.b
		ai_chance = {
			base = 25
			modifier = {
				add = -25
				UKR = {
					surrender_progress < 0.05
				}
			}
			modifier = {
				add = 50
				UKR = {
					surrender_progress > 0.25
				}
			}
		}
		UKR = {
			country_event = russia2_ukraine.52
		}
	}
}

#Finland Accepts
country_event = {
	id = russia2_ukraine.51
	title = russia2_ukraine.51.t
	desc = russia2_ukraine.51.d
	picture = GFX_soldiers_handshaking_kolchak_russia2

	is_triggered_only = yes

	option = { #Yay
		name = russia2_ukraine.51.a
		ai_chance = {
			base = 100
		}
	}
}

#Finland Refuses
country_event = {
	id = russia2_ukraine.52
	title = russia2_ukraine.52.t
	desc = russia2_ukraine.52.d
	picture = GFX_report_event_polish_army

	is_triggered_only = yes

	option = { #Damn
		name = russia2_ukraine.52.a
		ai_chance = {
			base = 100
		}
	}
}

#Claim Too Many States so Standoff
country_event = {
	id = russia2_ukraine.53
	title = russia2_ukraine.53.t
	desc = russia2_ukraine.53.d
	picture = GFX_russian_civil_war_russia2

	is_triggered_only = yes

	option = { #Damn
		name = russia2_ukraine.53.a
		ai_chance = {
			base = 100
		}
		custom_effect_tooltip = ukr_the_war_is_not_over
	}
}

#Anarchism Fails (Timeout)
country_event = {
	id = russia2_ukraine.54
	title = russia2_ukraine.54.t
	desc = russia2_ukraine.54.d
	picture = GFX_report_event_generic_riot

	is_triggered_only = yes

	option = { #Damn
		name = russia2_ukraine.54.a
		ai_chance = {
			base = 100
		}
		add_political_power = -100
		set_politics = {
			ruling_party = neutrality
			elections_allowed = no
		}
		add_timed_idea = {
			idea = UKR_Defeatist_government
			days = 730
		}
		hidden_effect = {
			add_popularity = {
				ideology = anarchy
				popularity = -1
			}
		}
	}
}

#Anarchism Prevails (Timeout)
country_event = {
	id = russia2_ukraine.55
	title = russia2_ukraine.55.t
	desc = russia2_ukraine.55.d
	picture = GFX_report_event_communists_cheer

	is_triggered_only = yes

	option = { #Yes
		name = russia2_ukraine.55.a
		ai_chance = {
			base = 100
		}
		add_political_power = 150
		custom_effect_tooltip = ukr_can_complete_free_territory_focus
		custom_effect_tooltip = ukr_unlock_recruit_anarchist_divisions_decisions
		add_ideas = UKR_Anarchist_ideal
		if = {
			limit = {
				has_idea = UKR_Free_state
			}
			swap_ideas = {
				add_idea = UKR_Free_state_2
				remove_idea = UKR_Free_state
			}
		}
	}
}

#Give a few divisions to UKR during the SCW (Anarchist)
country_event = {
	id = russia2_ukraine.56
	title = russia2_ukraine.56.t
	desc = russia2_ukraine.56.d
	picture = GFX_report_event_SOV_military_offensive

	fire_only_once = yes

	is_triggered_only = yes

	trigger = {
		tag = UKR
		has_government = anarchy
		is_subject = no
		ukr_in_scw = yes
	}

	option = { #Amazing
		name = russia2_ukraine.56.a
		ai_chance = {
			base = 100
		}
		if = {
			limit = {
				NOT = {
					has_template = "Ukrayins'ka Dyviziya"
				}
			}
			division_template = {
				name = "Ukrayins'ka Dyviziya"
				division_names_group = UKR_INF_01
				priority = 1
				regiments = {
					infantry = { x = 0 y = 0 }
					infantry = { x = 0 y = 1 }
					infantry = { x = 0 y = 2 }
					infantry = { x = 0 y = 3 }
					infantry = { x = 0 y = 4 }
					infantry = { x = 1 y = 0 }
					infantry = { x = 1 y = 1 }
					infantry = { x = 1 y = 2 }
					infantry = { x = 1 y = 3 }
				}
				support = {
					engineer = { x = 0 y = 0 }
					artillery = { x = 0 y = 1 }
				}
			}
		}
		capital_scope = {
			create_unit = {
                division = "name = \"1ya Anarkhist Dobrovolets\" division_template = \"Ukrayins'ka Dyviziya\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = UKR
            }
			create_unit = {
                division = "name = \"2ya Anarkhist Dobrovolets\" division_template = \"Ukrayins'ka Dyviziya\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = UKR
            }
			create_unit = {
                division = "name = \"3ya Anarkhist Dobrovolets\" division_template = \"Ukrayins'ka Dyviziya\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = UKR
            }
			create_unit = {
                division = "name = \"4ya Anarkhist Dobrovolets\" division_template = \"Ukrayins'ka Dyviziya\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = UKR
            }
			create_unit = {
                division = "name = \"5ya Anarkhist Dobrovolets\" division_template = \"Ukrayins'ka Dyviziya\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = UKR
            }
		}
		random_owned_controlled_state = {
			create_unit = {
                division = "name = \"6ya Anarkhist Dobrovolets\" division_template = \"Ukrayins'ka Dyviziya\" start_experience_factor = 0.1 start_equipment_factor = 1.0"
                owner = UKR
            }
		}
		random_owned_controlled_state = {
			create_unit = {
                division = "name = \"7ya Anarkhist Dobrovolets\" division_template = \"Ukrayins'ka Dyviziya\" start_experience_factor = 0.1 start_equipment_factor = 1.0"
                owner = UKR
            }
		}
		random_owned_controlled_state = {
			create_unit = {
                division = "name = \"8ya Anarkhist Dobrovolets\" division_template = \"Ukrayins'ka Dyviziya\" start_experience_factor = 0.1 start_equipment_factor = 1.0"
                owner = UKR
            }
		}
		random_owned_controlled_state = {
			create_unit = {
                division = "name = \"9ya Anarkhist Dobrovolets\" division_template = \"Ukrayins'ka Dyviziya\" start_experience_factor = 0.1 start_equipment_factor = 1.0"
                owner = UKR
            }
		}
		random_owned_controlled_state = {
			create_unit = {
                division = "name = \"10ya Anarkhist Dobrovolets\" division_template = \"Ukrayins'ka Dyviziya\" start_experience_factor = 0.1 start_equipment_factor = 1.0"
                owner = UKR
            }
		}
	}
}

#Execute the Soviet Command
country_event = {
	id = russia2_ukraine.57
	title = russia2_ukraine.57.t
	desc = russia2_ukraine.57.d
	picture = GFX_report_event_soviet_purge_officers_02

	is_triggered_only = yes

	option = { #Rip
		name = russia2_ukraine.57.a
		ai_chance = {
			base = 100
		}
		set_temp_variable = { pp_gain = party_popularity_100@anarchy }
		multiply_temp_variable = { pp_gain = 5 }
		set_temp_variable = { communism_loss = party_popularity@communism }
		multiply_temp_variable = { communism_loss = -1 }
		add_political_power = var:pp_gain
		add_popularity = {
			ideology = communism
			popularity = var:communism_loss
		}
	}
}

#Vladimir Antonov Takes Over?
country_event = {
	id = russia2_ukraine.58
	title = russia2_ukraine.58.t
	desc = russia2_ukraine.58.d
	picture = GFX_report_event_soviet_purge_speech

	is_triggered_only = yes

	option = { #No can do
		name = russia2_ukraine.58.a
		ai_chance = {
			base = 75
		}
		add_political_power = 200
	}

	option = {
		name = russia2_ukraine.58.b
		ai_chance = {
			base = 25
		}
		add_country_leader_role = {
			character = UKR_Vladimir_antonov_ovseyenko_anarchist
			promote_leader = yes
			country_leader = {
				desc = UKR_Vladimir_antonov_ovseyenko_anarchist_desc
				ideology = anarchist
				expire = "1965.1.1.1"
				traits = {
					russia2_anarchist_principles
					russia2_the_storm
				}
			}
		}
		add_corps_commander_role = {
			character = UKR_Makhno_nestor
			traits = {
				russia2_unbreakable_will_trait
				commando
				infantry_leader
				infantry_expert
				urban_assault_specialist
				trickster
				guerilla_fighter
				russia2_weakened_trait
			}
			skill = 6
			attack_skill = 5
			defense_skill = 2
			planning_skill = 2
			logistics_skill = 5
		}
	}
}

#Anarchist Ukraine Wishes to Unify
country_event = {
	id = russia2_ukraine.59
	title = russia2_ukraine.59.t
	desc = russia2_ukraine.59.d
	picture = GFX_report_event_soviet_purge_trial

	is_triggered_only = yes

	option = { #Yes
		name = russia2_ukraine.59.a
		ai_chance = {
			base = 80
			modifier = {
				add = -45
				strength_ratio = {
					tag = FROM
					ratio > 1
				}
			}
		}
		FROM = {
			annex_country = {
				target = ROOT
				transfer_troops = no
			}
			country_event = russia2_ukraine.60
		}
	}

	option = { #No
		name = russia2_ukraine.59.b
		ai_chance = {
			base = 20
			modifier = {
				add = 45
				strength_ratio = {
					tag = FROM
					ratio > 1
				}
			}
		}
		FROM = {
			country_event = russia2_ukraine.61
		}
	}
}

#Anarchist Spain Accepts
country_event = {
	id = russia2_ukraine.60
	title = russia2_ukraine.60.t
	desc = russia2_ukraine.60.d
	picture = GFX_handshake_russia2

	is_triggered_only = yes

	option = { #Nice
		name = russia2_ukraine.60.a
		ai_chance = {
			base = 100
		}
	}
}

#Anarchist Spain Refuses
country_event = {
	id = russia2_ukraine.61
	title = russia2_ukraine.61.t
	desc = russia2_ukraine.61.d
	picture = GFX_report_event_polish_army

	is_triggered_only = yes

	option = { #Die
		name = russia2_ukraine.61.a
		ai_chance = {
			base = 100
		}
		create_wargoal = {
			type = annex_everything
			target = FROM
		}
	}
}

#Anarchist Rebels in our Country
country_event = {
	id = russia2_ukraine.62
	title = russia2_ukraine.62.t
	desc = russia2_ukraine.62.d
	picture = GFX_report_event_generic_riot

	is_triggered_only = yes

	option = { #Uhh
		name = russia2_ukraine.62.a
		ai_chance = {
			base = 100
		}
		if = {
			limit = {
				NOT = {
					has_idea = UKR_Anarchist_rebels_from
				}
			}
			add_timed_idea = {
				idea = UKR_Anarchist_rebels_from
				days = 100
			}
		}
		else = {
			modify_timed_idea = {
				idea = UKR_Anarchist_rebels_from
				days = 100
			}
		}
	}
}

#Emergency Elections
country_event = {
	id = russia2_ukraine.63
	title = russia2_ukraine.63.t
	desc = russia2_ukraine.63.d
	picture = GFX_report_event_SOV_national_academy_of_sciences

	is_triggered_only = yes

	option = { #Democratic
		name = russia2_ukraine.63.a
		ai_chance = {
			base = 25
			modifier = {
				add = 75
				has_country_flag = UKR_AI_DEMOCRATIC_BEHAVIOR
			}
			modifier = {
				factor = 0
				OR = {
					has_country_flag = UKR_AI_NEUTRALITY_BEHAVIOR
					has_country_flag = UKR_AI_COMMUNIST_BEHAVIOR
					has_country_flag = UKR_AI_FASCIST_BEHAVIOR
				}
			}
		}
		trigger = {
			OR = {
				is_subject = no
				has_government = democratic
			}
		}
		if = {
			limit = {
				has_government = democratic
			}
			add_political_power = 150
			add_popularity = {
				ideology = democratic
				popularity = 0.1
			}
		}
		else = {
			set_politics = {
				ruling_party = democratic
				elections_allowed = no
			}
			add_stability = 0.1
			hidden_effect = {
				if = {
					limit = {
						democratic < 0.5
					}
					set_political_party = {
						ideology = democratic
						popularity = 50
					}
				}
			}
		}
	}

	option = { #Non-aligned
		name = russia2_ukraine.63.b
		ai_chance = {
			base = 25
			modifier = {
				add = 75
				has_country_flag = UKR_AI_NEUTRALITY_BEHAVIOR
			}
			modifier = {
				factor = 0
				OR = {
					has_country_flag = UKR_AI_DEMOCRATIC_BEHAVIOR
					has_country_flag = UKR_AI_COMMUNIST_BEHAVIOR
					has_country_flag = UKR_AI_FASCIST_BEHAVIOR
				}
			}
		}
		trigger = {
			OR = {
				is_subject = no
				has_government = neutrality
			}
		}
		if = {
			limit = {
				has_government = neutrality
			}
			add_political_power = 150
			add_popularity = {
				ideology = neutrality
				popularity = 0.1
			}
		}
		else = {
			set_politics = {
				ruling_party = neutrality
				elections_allowed = no
			}
			add_stability = 0.1
			hidden_effect = {
				if = {
					limit = {
						neutrality < 0.5
					}
					set_political_party = {
						ideology = neutrality
						popularity = 50
					}
				}
			}
		}
	}

	option = { #Communist
		name = russia2_ukraine.63.c
		ai_chance = {
			base = 25
			modifier = {
				add = 75
				has_country_flag = UKR_AI_COMMUNIST_BEHAVIOR
			}
			modifier = {
				factor = 0
				OR = {
					has_country_flag = UKR_AI_DEMOCRATIC_BEHAVIOR
					has_country_flag = UKR_AI_NEUTRALITY_BEHAVIOR
					has_country_flag = UKR_AI_FASCIST_BEHAVIOR
				}
			}
		}
		trigger = {
			OR = {
				is_subject = no
				has_government = communism
			}
		}
		if = {
			limit = {
				has_government = communism
			}
			add_political_power = 150
			add_popularity = {
				ideology = communism
				popularity = 0.1
			}
		}
		else = {
			set_politics = {
				ruling_party = communism
				elections_allowed = no
			}
			add_stability = 0.1
			hidden_effect = {
				if = {
					limit = {
						communism < 0.5
					}
					set_political_party = {
						ideology = communism
						popularity = 50
					}
				}
			}
		}
	}

	option = { #Fascist
		name = russia2_ukraine.63.e
		ai_chance = {
			base = 25
			modifier = {
				add = 75
				has_country_flag = UKR_AI_FASCIST_BEHAVIOR
			}
			modifier = {
				factor = 0
				OR = {
					has_country_flag = UKR_AI_DEMOCRATIC_BEHAVIOR
					has_country_flag = UKR_AI_NEUTRALITY_BEHAVIOR
					has_country_flag = UKR_AI_COMMUNIST_BEHAVIOR
				}
			}
		}
		trigger = {
			OR = {
				is_subject = no
				has_government = fascism
			}
		}
		if = {
			limit = {
				has_government = fascism
			}
			add_political_power = 150
			add_popularity = {
				ideology = fascism
				popularity = 0.1
			}
		}
		else = {
			set_politics = {
				ruling_party = fascism
				elections_allowed = no
			}
			add_stability = 0.1
			hidden_effect = {
				if = {
					limit = {
						fascism < 0.5
					}
					set_political_party = {
						ideology = fascism
						popularity = 50
					}
				}
			}
		}
	}
}

#Classic Election
country_event = {
	id = russia2_ukraine.64
	title = russia2_ukraine.64.t
	desc = russia2_ukraine.64.d
	picture = GFX_report_event_polish_army

	is_triggered_only = yes

	option = { #Democratic
		name = russia2_ukraine.64.a
		ai_chance = {
			base = 25
			modifier = {
				add = 75
				has_country_flag = UKR_AI_DEMOCRATIC_BEHAVIOR
			}
			modifier = {
				factor = 0
				OR = {
					has_country_flag = UKR_AI_NEUTRALITY_BEHAVIOR
					has_country_flag = UKR_AI_COMMUNIST_BEHAVIOR
					has_country_flag = UKR_AI_FASCIST_BEHAVIOR
				}
			}
		}
		trigger = {
			OR = {
				is_subject = no
				has_government = democratic
			}
		}
		if = {
			limit = {
				has_government = democratic
			}
			add_political_power = 150
			add_popularity = {
				ideology = democratic
				popularity = 0.1
			}
		}
		else = {
			set_politics = {
				ruling_party = democratic
				elections_allowed = no
			}
			add_stability = 0.1
			if = {
				limit = {
					has_idea = UKR_share_goods
				}
				remove_ideas = UKR_share_goods
			}
			if = {
				limit = {
					has_idea = UKR_Danilo_skoropadskiy_neutrality
				}
				remove_ideas = UKR_Danilo_skoropadskiy_neutrality
				add_ideas = UKR_Danilo_skoropadskiy_democratic
			}
			else_if = {
				limit = {
					has_idea = UKR_Stepan_bandera
				}
				remove_ideas = UKR_Stepan_bandera
				add_ideas = UKR_Danilo_skoropadskiy_democratic
			}
			else_if = {
				limit = {
					has_idea = UKR_Vladimir_alexandrovich_antonov_ovseenko_communism
				}
				remove_ideas = UKR_Vladimir_alexandrovich_antonov_ovseenko_communism
				add_ideas = UKR_Danilo_skoropadskiy_democratic
			}
			hidden_effect = {
				if = {
					limit = {
						democratic < 0.5
					}
					set_political_party = {
						ideology = democratic
						popularity = 50
					}
				}
			}
		}
	}

	option = { #Non-aligned
		name = russia2_ukraine.64.b
		ai_chance = {
			base = 25
			modifier = {
				add = 75
				has_country_flag = UKR_AI_NEUTRALITY_BEHAVIOR
			}
			modifier = {
				factor = 0
				OR = {
					has_country_flag = UKR_AI_DEMOCRATIC_BEHAVIOR
					has_country_flag = UKR_AI_COMMUNIST_BEHAVIOR
					has_country_flag = UKR_AI_FASCIST_BEHAVIOR
				}
			}
		}
		trigger = {
			OR = {
				is_subject = no
				has_government = neutrality
			}
		}
		if = {
			limit = {
				has_government = neutrality
			}
			add_political_power = 150
			add_popularity = {
				ideology = neutrality
				popularity = 0.1
			}
		}
		else = {
			set_politics = {
				ruling_party = neutrality
				elections_allowed = no
			}
			add_stability = 0.1
			if = {
				limit = {
					has_idea = UKR_Danilo_skoropadskiy_democratic
				}
				remove_ideas = UKR_Danilo_skoropadskiy_democratic
				add_ideas = UKR_Danilo_skoropadskiy_neutrality
			}
			else_if = {
				limit = {
					has_idea = UKR_Stepan_bandera
				}
				remove_ideas = UKR_Stepan_bandera
				add_ideas = UKR_Danilo_skoropadskiy_neutrality
			}
			else_if = {
				limit = {
					has_idea = UKR_Vladimir_alexandrovich_antonov_ovseenko_communism
				}
				remove_ideas = UKR_Vladimir_alexandrovich_antonov_ovseenko_communism
				add_ideas = UKR_Danilo_skoropadskiy_neutrality
			}
			hidden_effect = {
				if = {
					limit = {
						neutrality < 0.5
					}
					set_political_party = {
						ideology = neutrality
						popularity = 50
					}
				}
			}
		}
	}

	option = { #Communist
		name = russia2_ukraine.64.c
		ai_chance = {
			base = 25
			modifier = {
				add = 75
				has_country_flag = UKR_AI_COMMUNIST_BEHAVIOR
			}
			modifier = {
				factor = 0
				OR = {
					has_country_flag = UKR_AI_DEMOCRATIC_BEHAVIOR
					has_country_flag = UKR_AI_NEUTRALITY_BEHAVIOR
					has_country_flag = UKR_AI_FASCIST_BEHAVIOR
				}
			}
		}
		trigger = {
			OR = {
				is_subject = no
				has_government = communism
			}
		}
		if = {
			limit = {
				has_government = communism
			}
			add_political_power = 150
			add_popularity = {
				ideology = communism
				popularity = 0.1
			}
		}
		else = {
			set_politics = {
				ruling_party = communism
				elections_allowed = no
			}
			add_stability = 0.1
			if = {
				limit = {
					has_idea = UKR_Empower_upper_class
				}
				remove_ideas = UKR_Empower_upper_class
			}
			if = {
				limit = {
					has_idea = UKR_Danilo_skoropadskiy_democratic
				}
				remove_ideas = UKR_Danilo_skoropadskiy_democratic
				add_ideas = UKR_Vladimir_alexandrovich_antonov_ovseenko_communism
			}
			else_if = {
				limit = {
					has_idea = UKR_Stepan_bandera
				}
				remove_ideas = UKR_Stepan_bandera
				add_ideas = UKR_Vladimir_alexandrovich_antonov_ovseenko_communism
			}
			else_if = {
				limit = {
					has_idea = UKR_Danilo_skoropadskiy_neutrality
				}
				remove_ideas = UKR_Danilo_skoropadskiy_neutrality
				add_ideas = UKR_Vladimir_alexandrovich_antonov_ovseenko_communism
			}
			hidden_effect = {
				if = {
					limit = {
						communism < 0.5
					}
					set_political_party = {
						ideology = communism
						popularity = 50
					}
				}
			}
		}
	}

	option = { #Fascist
		name = russia2_ukraine.64.e
		ai_chance = {
			base = 25
			modifier = {
				add = 75
				has_country_flag = UKR_AI_FASCIST_BEHAVIOR
			}
			modifier = {
				factor = 0
				OR = {
					has_country_flag = UKR_AI_DEMOCRATIC_BEHAVIOR
					has_country_flag = UKR_AI_NEUTRALITY_BEHAVIOR
					has_country_flag = UKR_AI_COMMUNIST_BEHAVIOR
				}
			}
		}
		trigger = {
			OR = {
				is_subject = no
				has_government = fascism
			}
		}
		if = {
			limit = {
				has_government = fascism
			}
			add_political_power = 150
			add_popularity = {
				ideology = fascism
				popularity = 0.1
			}
		}
		else = {
			set_politics = {
				ruling_party = fascism
				elections_allowed = no
			}
			add_stability = 0.1
			if = {
				limit = {
					has_idea = UKR_Danilo_skoropadskiy_democratic
				}
				remove_ideas = UKR_Danilo_skoropadskiy_democratic
				add_ideas = UKR_Stepan_bandera
			}
			else_if = {
				limit = {
					has_idea = UKR_Vladimir_alexandrovich_antonov_ovseenko_communism
				}
				remove_ideas = UKR_Vladimir_alexandrovich_antonov_ovseenko_communism
				add_ideas = UKR_Stepan_bandera
			}
			else_if = {
				limit = {
					has_idea = UKR_Danilo_skoropadskiy_neutrality
				}
				remove_ideas = UKR_Danilo_skoropadskiy_neutrality
				add_ideas = UKR_Stepan_bandera
			}
			hidden_effect = {
				if = {
					limit = {
						fascism < 0.5
					}
					set_political_party = {
						ideology = fascism
						popularity = 50
					}
				}
			}
		}
	}
}

#Ukraine Invites FROM to Faction
country_event = {
	id = russia2_ukraine.65
	title = russia2_ukraine.65.t
	desc = russia2_ukraine.65.d
	picture = GFX_report_event_gre_diplomacy

	is_triggered_only = yes

	option = { #Sure
		name = russia2_ukraine.65.a
		ai_chance = {
			base = 65
			modifier = {
				add = 35
				OR = {
					has_war_together_with = UKR
					has_government = UKR
				}
			}
			modifier = {
				add = 25
				surrender_progress > 0.25
			}
			modifier = {
				add = -15
				is_in_faction = yes
			}
			modifier = {
				add = -50
				is_major = yes
			}
		}
		add_ai_strategy = {
			type = alliance
			id = UKR
			value = 500
		}
		UKR = {
			add_to_faction = ROOT
			add_ai_strategy = {
				type = alliance
				id = ROOT
				value = 500
			}
			country_event = russia2_ukraine.66
		}
	}

	option = { #No
		name = russia2_ukraine.65.b
		ai_chance = {
			base = 35
			modifier = {
				add = -35
				OR = {
					has_war_together_with = UKR
					has_government = UKR
				}
			}
			modifier = {
				add = -25
				surrender_progress > 0.25
			}
			modifier = {
				add = 15
				is_in_faction = yes
			}
			modifier = {
				add = 50
				is_major = yes
			}
		}
		UKR = {
			country_event = russia2_ukraine.67
		}
	}
}

#FROM Accepts
country_event = {
	id = russia2_ukraine.66
	title = russia2_ukraine.66.t
	desc = russia2_ukraine.66.d
	picture = GFX_handshake_russia2

	is_triggered_only = yes

	option = { #Yay
		name = russia2_ukraine.66.a
		ai_chance = {
			base = 100
		}
	}
}

#FROM Refuses
country_event = {
	id = russia2_ukraine.67
	title = russia2_ukraine.67.t
	desc = russia2_ukraine.67.d
	picture = GFX_report_event_poland_rejects

	is_triggered_only = yes

	option = { #Uh
		name = russia2_ukraine.67.a
		ai_chance = {
			base = 100
		}
	}
}

#The Secret Project
country_event = {
	id = russia2_ukraine.68
	title = russia2_ukraine.68.t
	desc = russia2_ukraine.68.d
	picture = GFX_report_event_physics_lab_01

	is_triggered_only = yes

	option = { #Let's go
		name = russia2_ukraine.68.a
		ai_chance = {
			base = 100
		}
		army_experience = 50
		navy_experience = 50
		air_experience = 50
		add_tech_bonus = {
			name = UKR_secret_project
			bonus = 1
			uses = 1
			category = nuclear
		}
		add_tech_bonus = {
			name = UKR_secret_project
			bonus = 1
			uses = 1
			category = cat_strategic_bomber
		}
	}
}

#The Crimean Situation
country_event = {
	id = russia2_ukraine.69
	title = russia2_ukraine.69.t
	desc = russia2_ukraine.69.d
	picture = GFX_operation_barbarossa_russia2

	is_triggered_only = yes

	option = { #Ask for the state
		name = russia2_ukraine.69.a
		ai_chance = {
			base = 35
		}
		137 = {
			OWNER = {
				country_event = { id = russia2_ukraine.70 days = 1 }
			}
		}
	}

	option = { #Ask for puppet
		name = russia2_ukraine.69.b
		trigger = {
			CRI = {
				exists = yes
				is_subject = no
				is_in_faction = no
				has_full_control_of_state = 137
				NOT = {
					has_war_with = ROOT
				}
			}
		}
		ai_chance = {
			base = 35
		}
		CRI = {
			country_event = { id = russia2_ukraine.70 days = 1 }
		}
	}

	option = { #Ask for alliance
		name = russia2_ukraine.69.c
		trigger = {
			is_faction_leader = yes
			CRI = {
				exists = yes
				is_subject = no
				is_in_faction = no
				has_full_control_of_state = 137
				NOT = {
					has_war_with = ROOT
				}
			}
		}
		ai_chance = {
			base = 15
		}
		CRI = {
			country_event = { id = russia2_ukraine.70 days = 1 }
		}
	}

	option = { #Ask for non aggression pact
		name = russia2_ukraine.69.e
		trigger = {
			CRI = {
				exists = yes
				is_subject = no
				is_in_faction = no
				has_full_control_of_state = 137
				NOT = {
					has_war_with = ROOT
				}
			}
		}
		ai_chance = {
			base = 15
		}
		CRI = {
			country_event = { id = russia2_ukraine.70 days = 1 }
		}
	}
}

#Ukraine asks for Crimea
country_event = {
	id = russia2_ukraine.70
	title = russia2_ukraine.70.t
	desc = russia2_ukraine.70.d
	picture = GFX_soviet_plane_russia2

	is_triggered_only = yes

	option = { #Ok
		name = russia2_ukraine.70.a
		ai_chance = {
			base = 40
			modifier = {
				add = 40
				is_in_faction_with = FROM
			}
			modifier = {
				add = -20
				strength_ratio = {
					tag = FROM
					ratio > 1
				}
			}
		}
		FROM = {
			transfer_state = 137
			country_event = { id = russia2_ukraine.71 days = 1 }
		}
		if = {
			limit = {
				all_owned_state = {
					state = 137
				}
			}
			custom_effect_tooltip = SOV_game_totally_over_TT
		}
	}

	option = { #No noob
		name = russia2_ukraine.70.b
		ai_chance = {
			base = 40
			modifier = {
				add = -40
				is_in_faction_with = FROM
			}
			modifier = {
				add = 20
				strength_ratio = {
					tag = FROM
					ratio > 1
				}
			}
		}
		FROM = {
			country_event = { id = russia2_ukraine.72 days = 1 }
		}
	}
}

#FROM Accepts
country_event = {
	id = russia2_ukraine.71
	title = russia2_ukraine.71.t
	desc = russia2_ukraine.71.d
	picture = GFX_handshake_russia2

	is_triggered_only = yes

	option = { #Perfect
		name = russia2_ukraine.71.a
		ai_chance = {
			base = 100
		}
	}
}

#FROM Refuses
country_event = {
	id = russia2_ukraine.72
	title = russia2_ukraine.72.t
	desc = russia2_ukraine.72.d
	picture = GFX_soldiers_parade_russia2

	is_triggered_only = yes

	option = { #Die (if not allied)
		name = russia2_ukraine.72.a
		ai_chance = {
			base = 100
		}
		if = {
			limit = {
				FROM = {
					NOT = {
						is_in_faction_with = ROOT
						is_subject_of = ROOT
					}
				}
			}
			create_wargoal = {
				type = take_state
				target = FROM
				generator = { 137 }
			}
		}
	}
}

#Ukraine asks for Puppet
country_event = {
	id = russia2_ukraine.73
	title = russia2_ukraine.73.t
	desc = russia2_ukraine.73.d
	picture = GFX_operation_barbarossa_russia2

	is_triggered_only = yes

	option = { #Ok
		name = russia2_ukraine.73.a
		ai_chance = {
			base = 40
			modifier = {
				add = 40
				is_in_faction_with = FROM
			}
			modifier = {
				add = -20
				strength_ratio = {
					tag = FROM
					ratio > 1
				}
			}
		}
		FROM = {
			puppet = ROOT
			country_event = { id = russia2_ukraine.74 days = 1 }
		}
	}

	option = { #No noob
		name = russia2_ukraine.73.b
		ai_chance = {
			base = 40
			modifier = {
				add = -40
				is_in_faction_with = FROM
			}
			modifier = {
				add = 20
				strength_ratio = {
					tag = FROM
					ratio > 1
				}
			}
		}
		FROM = {
			country_event = { id = russia2_ukraine.75 days = 1 }
		}
	}
}

#FROM Accepts
country_event = {
	id = russia2_ukraine.74
	title = russia2_ukraine.74.t
	desc = russia2_ukraine.74.d
	picture = GFX_handshake_russia2

	is_triggered_only = yes

	option = { #Perfect
		name = russia2_ukraine.74.a
		ai_chance = {
			base = 100
		}
	}
}

#FROM Refuses
country_event = {
	id = russia2_ukraine.75
	title = russia2_ukraine.75.t
	desc = russia2_ukraine.75.d
	picture = GFX_menacing_tanks_russia2

	is_triggered_only = yes

	option = { #Die (if not allied)
		name = russia2_ukraine.75.a
		ai_chance = {
			base = 100
		}
		create_wargoal = {
			type = puppet_wargoal_focus
			target = FROM
		}
	}
}

#Ukraine asks for Alliance
country_event = {
	id = russia2_ukraine.76
	title = russia2_ukraine.76.t
	desc = russia2_ukraine.76.d
	picture = GFX_military_parade_russia2

	is_triggered_only = yes

	option = { #Ok
		name = russia2_ukraine.76.a
		ai_chance = {
			base = 100
		}
		add_ai_strategy = {
			type = alliance
			id = FROM
			value = 500
		}
		FROM = {
			add_to_faction = ROOT
			add_ai_strategy = {
				type = alliance
				id = ROOT
				value = 500
			}
			country_event = { id = russia2_ukraine.77 days = 1 }
		}
	}

	option = { #No noob
		name = russia2_ukraine.76.b
		ai_chance = {
			base = 0
		}
		FROM = {
			country_event = { id = russia2_ukraine.78 days = 1 }
		}
	}
}

#FROM Accepts
country_event = {
	id = russia2_ukraine.77
	title = russia2_ukraine.77.t
	desc = russia2_ukraine.77.d
	picture = GFX_handshake_russia2

	is_triggered_only = yes

	option = { #Perfect
		name = russia2_ukraine.77.a
		ai_chance = {
			base = 100
		}
	}
}

#FROM Refuses
country_event = {
	id = russia2_ukraine.78
	title = russia2_ukraine.78.t
	desc = russia2_ukraine.78.d
	picture = GFX_report_event_poland_rejects

	is_triggered_only = yes

	option = { #Sad
		name = russia2_ukraine.78.a
		ai_chance = {
			base = 100
		}
	}
}

#Ukraine asks for Non Aggression Pact
country_event = {
	id = russia2_ukraine.79
	title = russia2_ukraine.79.t
	desc = russia2_ukraine.79.d
	picture = GFX_menacing_tanks_russia2

	is_triggered_only = yes

	option = { #Ok
		name = russia2_ukraine.79.a
		ai_chance = {
			base = 100
		}
		FROM = {
			diplomatic_relation = {
				country = ROOT
				relation = non_aggression_pact
				active = yes
			}
			country_event = { id = russia2_ukraine.80 days = 1 }
		}
	}

	option = { #No noob
		name = russia2_ukraine.79.b
		ai_chance = {
			base = 0
		}
		FROM = {
			country_event = { id = russia2_ukraine.81 days = 1 }
		}
	}
}

#FROM Accepts
country_event = {
	id = russia2_ukraine.80
	title = russia2_ukraine.80.t
	desc = russia2_ukraine.80.d
	picture = GFX_handshake_russia2

	is_triggered_only = yes

	option = { #Perfect
		name = russia2_ukraine.80.a
		ai_chance = {
			base = 100
		}
	}
}

#FROM Refuses
country_event = {
	id = russia2_ukraine.81
	title = russia2_ukraine.81.t
	desc = russia2_ukraine.81.d
	picture = GFX_report_event_poland_rejects

	is_triggered_only = yes

	option = { #Sad
		name = russia2_ukraine.81.a
		ai_chance = {
			base = 100
		}
	}
}

#Ukraine Asks Kievan Rus States Puppet
country_event = {
	id = russia2_ukraine.82
	title = russia2_ukraine.82.t
	desc = russia2_ukraine.82.d
	picture = GFX_report_event_chamberlain_announce

	is_triggered_only = yes

	option = { #Give everything we own
		name = russia2_ukraine.82.a
		ai_chance = {
			base = 5
			modifier = {
				add = 45
				UKR = {
					is_ai = no
				}
			}
			modifier = {
				add = -100
				SOV = {
					has_government = neutrality
					has_completed_focus = SOV_reintegrate_lost_state
					NOT = {
						has_country_flag = ukr_accepted_royal_faction_with_sov
					}
				}
			}
		}
		UKR = {
			country_event = { id = russia2_ukraine.83 days = 7 }
		}
		custom_effect_tooltip = we_will_lose_every_state_kievan_rus
	}

	option = { #Give only what's enough for them
		name = russia2_ukraine.82.b
		ai_chance = {
			base = 50
			modifier = {
				add = -20
				UKR = {
					is_ai = no
				}
			}
			modifier = {
				add = -100
				SOV = {
					has_government = neutrality
					has_completed_focus = SOV_reintegrate_lost_state
					NOT = {
						has_country_flag = ukr_accepted_royal_faction_with_sov
					}
				}
			}
		}
		UKR = {
			country_event = { id = russia2_ukraine.84 days = 7 }
		}
		custom_effect_tooltip = we_will_lose_some_state_kievan_rus
	}

	option = { #Give nothing
		name = russia2_ukraine.82.c
		ai_chance = {
			base = 55
			modifier = {
				add = -40
				UKR = {
					is_ai = no
				}
			}
			modifier = {
				add = 100
				SOV = {
					has_government = neutrality
					has_completed_focus = SOV_reintegrate_lost_state
					NOT = {
						has_country_flag = ukr_accepted_royal_faction_with_sov
					}
				}
			}
		}
		UKR = {
			country_event = { id = russia2_ukraine.85 days = 7 }
		}
	}
}

#OVERLORD Accepts to Give everything
country_event = {
	id = russia2_ukraine.83
	title = russia2_ukraine.83.t
	desc = russia2_ukraine.83.d
	picture = GFX_handshake_russia2

	is_triggered_only = yes

	option = { #Let's go
		name = russia2_ukraine.83.a
		ai_chance = {
			base = 100
		}
		every_state = {
			limit = {
				is_owned_by = FROM
				ukr_is_kievan_rus_state = yes
			}
			UKR = {
				transfer_state = PREV
			}
		}
	}
}

#OVERLORD Accepts to Give small bits
country_event = {
	id = russia2_ukraine.84
	title = russia2_ukraine.84.t
	desc = russia2_ukraine.84.d
	picture = GFX_report_event_soviet_german_soldier_handshake

	is_triggered_only = yes

	option = { #Let's go
		name = russia2_ukraine.84.a
		ai_chance = {
			base = 100
		}
		every_state = {
			limit = {
				is_owned_by = FROM
				OR = {
					AND = {
						NOT = {
							is_core_of = FROM
						}
						ukr_is_kievan_rus_state = yes
					}
					state = 218
					state = 137
					state = 240
					state = 220
					state = 222
					state = 224
					state = 234
					state = 241
					state = 194
					state = 204
					state = 206
				}
			}
			UKR = {
				transfer_state = PREV
			}
		}
	}
}

#OVERLORD Refuses
country_event = {
	id = russia2_ukraine.85
	title = russia2_ukraine.85.t
	desc = russia2_ukraine.85.d
	picture = GFX_military_parade_kremlin_russia2

	is_triggered_only = yes

	option = { #Uh
		name = russia2_ukraine.85.a
		ai_chance = {
			base = 100
		}
		set_country_flag = overlord_refused_kievan_rus
	}
}

#People mobilize
country_event = {
	id = russia2_ukraine.86
	title = russia2_ukraine.86.t
	desc = russia2_ukraine.86.d
	picture = GFX_soldiers_parade_russia2

	fire_only_once = yes

	trigger = {
		tag = UKR
		ukr_in_scw = yes
		OR = {
			has_idea = disarmed_nation
			has_idea = volunteer_only
			has_idea = limited_conscription
		}
	}

	mean_time_to_happen = { days = 1 }

	option = { #Let's go
		name = russia2_ukraine.86.a
		ai_chance = {
			base = 100
		}
		add_ideas = extensive_conscription
	}
}

#Fuck Mutinies (Anarchist)
country_event = {
	id = russia2_ukraine.87
	title = russia2_ukraine.87.t
	desc = russia2_ukraine.87.d
	picture = GFX_report_event_ger_civil_war

	is_triggered_only = yes

	option = { #Exactly!
		name = russia2_ukraine.87.a
		ai_chance = {
			base = 100
		}
		if = {
			limit = {
				has_idea = mutiny_1
			}
			remove_ideas = mutiny_1
		}
		if = {
			limit = {
				has_idea = mutiny_2
			}
			remove_ideas = mutiny_2
		}
		if = {
			limit = {
				has_idea = mutiny_3
			}
			remove_ideas = mutiny_3
		}
	}
}

#Fuck Strikes (Anarchist)
country_event = {
	id = russia2_ukraine.88
	title = russia2_ukraine.88.t
	desc = russia2_ukraine.88.d
	picture = GFX_report_event_generic_strike

	is_triggered_only = yes

	option = { #Exactly!
		name = russia2_ukraine.88.a
		ai_chance = {
			base = 100
		}
		if = {
			limit = {
				has_idea = strikes_1
			}
			remove_ideas = strikes_1
		}
		if = {
			limit = {
				has_idea = strikes_2
			}
			remove_ideas = strikes_2
		}
		if = {
			limit = {
				has_idea = strikes_3
			}
			remove_ideas = strikes_3
		}
	}
}

#Makhno Dies ;(
country_event = {
	id = russia2_ukraine.89
	title = russia2_ukraine.89.t
	desc = {
		text = russia2_ukraine.89.d_1
		trigger = {
			has_country_leader = {
				character = UKR_Makhno_nestor
				ruling_only = yes
			}
		}
	}
	desc = {
		text = russia2_ukraine.89.d_2
		trigger = {
			NOT = {
				has_country_leader = {
					character = UKR_Makhno_nestor
					ruling_only = yes
				}
			}
		}
	}
	picture = GFX_report_event_royal_parade

	is_triggered_only = yes

	immediate = {
		set_global_flag = ukr_makhno_dead
	}

	option = { # :(
		trigger = {
			has_country_leader = {
				character = UKR_Makhno_nestor
				ruling_only = yes
			}
		}
		name = russia2_ukraine.89.a
		ai_chance = {
			base = 100
		}
		custom_effect_tooltip = UKR_makhno_nestor_dies
		add_ideas = UKR_Makhno_wish
		add_country_leader_role = {
			character = UKR_Ida_mett
			promote_leader = yes
			country_leader = {
				desc = UKR_Ida_mett_desc
				ideology = anarchist
				expire = "1965.1.1.1"
				traits = {
					russia2_anarchist_principles
					russia2_tactical_and_theoretical_unity
					russia2_collective_responsibility
					russia2_federalism_trait
				}
			}
		}
		hidden_effect = {
			retire_character = UKR_Makhno_nestor
		}
	}

	option = { # :(
		trigger = {
			NOT = {
				has_country_leader = {
					character = UKR_Makhno_nestor
					ruling_only = yes
				}
			}
		}
		name = russia2_ukraine.89.b
		ai_chance = {
			base = 100
		}
		custom_effect_tooltip = UKR_makhno_nestor_dies
		add_ideas = UKR_Makhno_wish
		add_political_power = 100
		hidden_effect = {
			retire_character = UKR_Makhno_nestor
		}
	}
}

#Anarchist Rebels Disappear
country_event = {
	id = russia2_ukraine.90
	title = russia2_ukraine.90.t
	desc = russia2_ukraine.90.d
	picture = GFX_report_event_royal_parade

	trigger = {
		tag = UKR
		has_war = yes
		has_country_flag = ukr_clr_anarchist_rebels_event
		NOT = {
			has_country_flag = ukr_anarchist_rebels
		}
	}

	fire_only_once = yes

	immediate = {
		hidden_effect = {
			clr_country_flag = ukr_clr_anarchist_rebels_event
		}
	}

	option = { # Ok
		name = russia2_ukraine.90.a
		ai_chance = {
			base = 100
		}
		custom_effect_tooltip = ukr_can_complete_provisional_government_focus
	}
}

#Anarchist Rebels Appear
country_event = {
	id = russia2_ukraine.91
	title = russia2_ukraine.91.t
	desc = russia2_ukraine.91.d
	picture = GFX_report_event_royal_parade

	is_triggered_only = yes

	option = { # Ok
		name = russia2_ukraine.91.a
		ai_chance = {
			base = 100
		}
		custom_effect_tooltip = ukr_going_to_war_will_lower_rebels
	}
}

#Fuck Draft Dodging (Anarchist)
country_event = {
	id = russia2_ukraine.92
	title = russia2_ukraine.92.t
	desc = russia2_ukraine.92.d
	picture = GFX_report_event_ger_civil_war

	is_triggered_only = yes

	option = { #Exactly!
		name = russia2_ukraine.92.a
		ai_chance = {
			base = 100
		}
		if = {
			limit = {
				has_idea = draft_dodging
			}
			remove_ideas = draft_dodging
		}
		if = {
			limit = {
				has_idea = draft_dodging_2
			}
			remove_ideas = draft_dodging_2
		}
		if = {
			limit = {
				has_idea = draft_dodging_3
			}
			remove_ideas = draft_dodging_3
		}
	}
}

#Release Russian Puppet if Conditions are Valid
country_event = {
	id = russia2_ukraine.93
	title = russia2_ukraine.93.t
	desc = russia2_ukraine.93.d
	picture = GFX_soldiers_handshaking_kolchak_russia2

	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			SOJ = {
				set_cosmetic_tag = AFS
			}
		}
	}

	option = { #Good
		name = russia2_ukraine.93.a
		ai_chance = {
			base = 100
		}
		hidden_effect = {
			every_state = {
				limit = {
					NOT = {
						state = 137
					}
					is_owned_by = ROOT
					is_core_of = SOV
					NOT = {
						is_in_array = { global.kievan_rus_state_ukraine = THIS }
						is_core_of = ROOT
					}
				}
				SOJ = {
					transfer_state = PREV
				}
			}
		}
		UKR = {
			set_autonomy = {
				target = SOJ
				autonomy_state = autonomy_puppet
			}
		}
		hidden_effect = {
			SOJ = {
				create_country_leader = { #fuck characters
					name = UKR_Ivan_kononov
					desc = UKR_Ivan_kononov_desc
					picture = "gfx/leaders/UKR/Portrait_Ukraine_Ivan_Kononov.dds"
					expire = "1965.1.1"
					ideology = oligarchism
					traits = {
						russia2_loyal_collaborator
					}
				}
				meta_effect = {
					text = {
						division_template = {
							name = "[TEMPLATE_NAME]"
							is_locked = no

							regiments = {
								infantry = { x = 0 y = 0 }
								infantry = { x = 0 y = 1 }
								infantry = { x = 0 y = 2 }
								infantry = { x = 1 y = 0 }
								infantry = { x = 1 y = 1 }
								infantry = { x = 1 y = 2 }
								infantry = { x = 2 y = 0 }
								infantry = { x = 2 y = 1 }
								infantry = { x = 2 y = 2 }
							}
							support = {
								artillery = { x = 0 y = 0 }
							}
						}
					}
					TEMPLATE_NAME = "[THIS.GetAdjective] Military Police"
				}
				meta_effect = {
					text = {
						division_template = {
							name = "[TEMPLATE_NAME]"
							is_locked = no

							regiments = {
								light_armor = { x = 0 y = 0 }
								light_armor = { x = 0 y = 1 }
								light_armor = { x = 1 y = 0 }
								light_armor = { x = 1 y = 1 }
								light_armor = { x = 1 y = 2 }
								motorized = { x = 2 y = 0 }
								motorized = { x = 2 y = 1 }
								motorized = { x = 2 y = 2 }
								motorized = { x = 2 y = 3 }
							}
						}
					}
					TEMPLATE_NAME = "[THIS.Capital.GetName] Tank Brigade"
				}

				set_temp_variable = { num_divisions_russian_state = THIS.owned_states }
				set_temp_variable = { num_divisions_russian_state_loca = 1 }
				set_temp_variable = { tank_division_russian_state = 0 }
				clamp_temp_variable = {
					var = num_divisions_russian_state
					min = 3
					max = 50
				}

				while_loop_effect = {
					break = break
					limit = {
						check_variable = {
							var = num_divisions_russian_state
							value = 1
							compare = greater_than_or_equals
						}
					}

					random_owned_controlled_state = {
						meta_effect = {
							text = {
								create_unit = {
									division = "name = \"[UNIT_NAME]\" division_template = \"[TEMPLATE_NAME]\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
									owner = PREV
									allow_spawning_on_enemy_provs = yes
								}
							}
							UNIT_NAME = "[PREV.GetAdjective] Military Police [?num_divisions_russian_state_loca]"
							TEMPLATE_NAME = "[PREV.GetAdjective] Military Police"
						}
					}
					add_to_temp_variable = { num_divisions_russian_state_loca = 1 }
					random_owned_controlled_state = {
						meta_effect = {
							text = {
								create_unit = {
									division = "name = \"[UNIT_NAME]\" division_template = \"[TEMPLATE_NAME]\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
									owner = PREV
									allow_spawning_on_enemy_provs = yes
								}
							}
							UNIT_NAME = "[PREV.GetAdjective] Military Police [?num_divisions_russian_state_loca]"
							TEMPLATE_NAME = "[PREV.GetAdjective] Military Police"
						}
					}
					add_to_temp_variable = { num_divisions_russian_state_loca = 1 }
					add_to_temp_variable = { tank_division_russian_state = 1 }
					if = {
						limit = {
							check_variable = {
								var = tank_division_russian_state
								value = 10
								compare = greater_than_or_equals
							}
						}
						capital_scope = {
							meta_effect = {
								text = {
									create_unit = {
										division = "name = \"[UNIT_NAME]\" division_template = \"[TEMPLATE_NAME]\" start_experience_factor = 0.6 start_equipment_factor = 1.0"
										owner = PREV
										allow_spawning_on_enemy_provs = yes
									}
								}
								UNIT_NAME = "[THIS.GetName] Tank Brigade"
								TEMPLATE_NAME = "[THIS.GetName] Tank Brigade"
							}
						}
						set_temp_variable = { tank_division_russian_state = 0 }
					}
					subtract_from_temp_variable = { num_divisions_russian_state = 1 }
				}
			}
		}
	}
}

#Abba Kovner Doesn't like Germany
country_event = {
	id = russia2_ukraine.94
	title = russia2_ukraine.94.t
	desc = russia2_ukraine.94.d
	picture = GFX_report_event_ger_civil_war

	fire_only_once = yes

	trigger = {
		original_tag = UKR
		has_character = UKR_Abba_kovner
		has_war_with = GER
		has_completed_focus = UKR_hold_elections
		NOT = {
			has_government = anarchy
			has_country_leader = {
				character = UKR_Abba_kovner
				ruling_only = yes
			}
		}
	}

	mean_time_to_happen = { days = 30 }

	option = { #Come in!
		name = russia2_ukraine.94.a
		ai_chance = {
			base = 50
		}
		custom_effect_tooltip = UKR_Abba_kovner_tt
		hidden_effect = {
			add_country_leader_role = {
				character = UKR_Abba_kovner
				promote_leader = yes
				country_leader = {
					desc = UKR_Abba_kovner_desc
					ideology = conservatism
					expire = "1965.1.1.1"
					traits = {
						russia2_enmity_germany
						russia2_full_powers
						russia2_no_political_alignment
					}
				}
			}
			add_country_leader_role = {
				character = UKR_Abba_kovner
				promote_leader = yes
				country_leader = {
					desc = UKR_Abba_kovner_desc
					ideology = marxism
					expire = "1965.1.1.1"
					traits = {
						russia2_enmity_germany
						russia2_full_powers
						russia2_no_political_alignment
					}
				}
			}
			add_country_leader_role = {
				character = UKR_Abba_kovner
				promote_leader = yes
				country_leader = {
					desc = UKR_Abba_kovner_desc
					ideology = oligarchism
					expire = "1965.1.1.1"
					traits = {
						russia2_enmity_germany
						russia2_full_powers
						russia2_no_political_alignment
					}
				}
			}
			add_country_leader_role = {
				character = UKR_Abba_kovner
				promote_leader = yes
				country_leader = {
					desc = UKR_Abba_kovner_desc
					ideology = fascism_ideology
					expire = "1965.1.1.1"
					traits = {
						russia2_enmity_germany
						russia2_full_powers
						russia2_no_political_alignment
					}
				}
			}
		}
		if = {
			limit = {
				has_elections = yes
			}
			custom_effect_tooltip = ukr_elections_will_not_happen
		}
		hidden_effect = {
			set_politics = {
				ruling_party = ROOT
				elections_allowed = no
			}
		}
	}

	option = { #No.
		name = russia2_ukraine.94.b
		ai_chance = {
			base = 50
		}
		add_political_power = 50
	}
}

#People mobilize
country_event = { #TODO Localization to make
	id = russia2_ukraine.95
	title = russia2_ukraine.95.t
	desc = russia2_ukraine.95.d
	picture = GFX_soldiers_parade_russia2

	fire_only_once = yes

	trigger = {
		tag = UKR
		ukr_in_scw = yes
		OR = {
			has_idea = partial_economic_mobilisation
			has_idea = low_economic_mobilisation
			has_idea = civilian_economy
		}
	}

	mean_time_to_happen = { days = 1 }

	option = { #Let's go
		name = russia2_ukraine.95.a
		ai_chance = {
			base = 100
		}
		add_ideas = war_economy
	}
}
