###########################
#    Kuban   Events
###########################

add_namespace = kuban

# Distribution of collective farm lands
country_event = {
	id = kuban.1
	title = kuban.1.t
	desc = kuban.1.d
	picture = GFX_report_event_kuban_disband_kolhoses

	is_triggered_only = yes

	option = {
		name = kuban.1.a
		ai_chance = { #priority for Holodomors injured
			factor = 40
			modifier = {
				factor = 0
				OR = {
					has_country_flag = KUB_AI_go_center
					has_country_flag = KUB_AI_go_right
				}
			}
		}
		add_to_variable = { kub_blacksea_support_var = 10 }
		add_to_variable = { kub_neutrals_support_var = -5 }
		add_to_variable = { kub_democratic_support_var = -5 }
		custom_effect_tooltip = add_10_blacksea_support_tt
	}
	option = {
		name = kuban.1.b
		ai_chance = { #priority for cossacks
			factor = 30
			modifier = {
				factor = 0
				OR = {
					has_country_flag = KUB_AI_go_left
					has_country_flag = KUB_AI_go_center
				}
			}
		}
		add_to_variable = { kub_blacksea_support_var = -5 }
		add_to_variable = { kub_neutrals_support_var = 10 }
		add_to_variable = { kub_democratic_support_var = -5 }
		custom_effect_tooltip = add_10_neutrals_support_tt
	}
	option = {
		name = kuban.1.c
		ai_chance = { #equable distribution
			factor = 30
			modifier = {
				factor = 0
				OR = {
					has_country_flag = KUB_AI_go_left
					has_country_flag = KUB_AI_go_right
				}
			}
		}
		add_to_variable = { kub_blacksea_support_var = -5 }
		add_to_variable = { kub_neutrals_support_var = -5 }
		add_to_variable = { kub_democratic_support_var = 10 }
		custom_effect_tooltip = add_10_democratic_support_tt
	}
}
# Language question
country_event = {
	id = kuban.2
	title = kuban.2.t
	desc = kuban.2.d

	is_triggered_only = yes

	option = {
		name = kuban.1.a
		ai_chance = { #only ukrainian language
			factor = 40
			modifier = {
				factor = 0
				OR = {
					has_country_flag = KUB_AI_go_center
					has_country_flag = KUB_AI_go_right
				}
			}
		}
		add_to_variable = { kub_blacksea_support_var = 10 }
		add_to_variable = { kub_neutrals_support_var = -5 }
		add_to_variable = { kub_democratic_support_var = -5 }
		custom_effect_tooltip = add_10_blacksea_support_tt
	}
	option = {
		name = kuban.1.b
		ai_chance = { #russian and ukrainian languages
			factor = 30
			modifier = {
				factor = 0
				OR = {
					has_country_flag = KUB_AI_go_left
					has_country_flag = KUB_AI_go_center
				}
			}
		}
		add_to_variable = { kub_blacksea_support_var = -5 }
		add_to_variable = { kub_neutrals_support_var = 10 }
		add_to_variable = { kub_democratic_support_var = -5 }
		custom_effect_tooltip = add_10_neutrals_support_tt
	}
	option = {
		name = kuban.1.c
		ai_chance = { #all languages
			factor = 30
			modifier = {
				factor = 0
				OR = {
					has_country_flag = KUB_AI_go_left
					has_country_flag = KUB_AI_go_right
				}
			}
		}
		add_to_variable = { kub_blacksea_support_var = -5 }
		add_to_variable = { kub_neutrals_support_var = -5 }
		add_to_variable = { kub_democratic_support_var = 10 }
		custom_effect_tooltip = add_10_democratic_support_tt
	}
}
# Start of Kuban rada
country_event = {
	id = kuban.3
	title = kuban.3.t
	desc = kuban.3.d

	is_triggered_only = yes

	option = {
		name = kuban.3.a
	}
}
# Kuban want be annexed by Ukraine
country_event = {
	id = kuban.4
	title = kuban.4.t
	desc = kuban.4.d

	is_triggered_only = yes
	
	option = {
		ai_chance = {
			base = 100
		}
		name = kuban.4.a
		effect_tooltip = {
			UKR = { annex_country = { target = KUB } }
		}
		FROM = { 
			country_event = { id = kuban.5 }
		}
		set_country_flag = UKR_crimson_ukraine_integrated
	}

	option = {
		ai_chance = {
			base = 0
		}
		name = kuban.4.b
		FROM = { 
			country_event = { id = kuban.6 }
		}
	}
}
# Kuban joined to Ukraine
country_event = {
	id = kuban.5
	title = kuban.5.t
	desc = kuban.5.d
	picture = GFX_report_event_generic_peaceful_annexation
	
	is_triggered_only = yes
	
	option = {
		name = kuban.5.a
		if = {
			limit = { has_idea = KUB_vasily_prokhoda }
			retire_character = KUB_sergei_ulagay
			retire_character = KUB_boris_gontarev
		}
		if = {
			limit = { has_character = KUB_vyacheslav_tkachov }
			KUB_vyacheslav_tkachov = { set_nationality = UKR }
		}
		if = {
			limit = { has_character = KUB_daniil_dracenko }
			KUB_daniil_dracenko = { set_nationality = UKR }
		}
		if = {
			limit = { has_character = KUB_ivan_tsapko }
			KUB_ivan_tsapko = { set_nationality = UKR }
		}
		if = {
			limit = { has_character = KUB_leonid_baidak }
			KUB_leonid_baidak = { set_nationality = UKR }
		}
		every_unit_leader = {
			set_nationality = UKR
		}
		every_navy_leader = {
			set_nationality = UKR
		}
		remove_state_core = 233
		remove_state_core = 234
		remove_state_core = 985
		FROM = { annex_country = { target = ROOT transfer_troops = yes } }
		custom_effect_tooltip = GAME_OVER_TT
	}
}
# Ukraine refuse annexation
country_event = {
	id = kuban.6
	title = kuban.6.t
	desc = kuban.6.d

	is_triggered_only = yes

	option = {
		name = kuban.6.a
	}
}
# Kuban want united with DON - ask to OVERLORD
country_event = {
	id = kuban.7
	title = kuban.7.t
	desc = kuban.7.d

	is_triggered_only = yes
	
	option = {
		ai_chance = {
			base = 100
		}
		name = kuban.7.a
		effect_tooltip = {
			FROM = { annex_country = { target = DON } }
		}
		if = {
			limit = { 235 = { is_owned_and_controlled_by = ROOT } }
			FROM = { transfer_state = 235 }
		}
		FROM = { 
			country_event = { id = kuban.8 }
		}
		DON = { 
			country_event = { id = kuban.10 }
		}
	}

	option = {
		ai_chance = {
			base = 0
		}
		name = kuban.7.b
		FROM = { 
			country_event = { id = kuban.9 }
		}
	}
}
# Ukraine agree union
country_event = {
	id = kuban.8
	title = kuban.8.t
	desc = kuban.8.d
	picture = GFX_report_event_generic_peaceful_annexation
	
	is_triggered_only = yes
	
	option = {
		name = kuban.8.a
		add_state_core = 235
	}
}
# Ukraine refuse union
country_event = {
	id = kuban.9
	title = kuban.9.t
	desc = kuban.9.d

	is_triggered_only = yes

	option = {
		name = kuban.9.a
	}
}
# United Cossackia - mesage for Don
country_event = {
	id = kuban.10
	title = kuban.10.t
	desc = kuban.10.d
	picture = GFX_report_event_generic_peaceful_annexation
	
	is_triggered_only = yes
	
	option = {
		name = kuban.10.a
		every_unit_leader = {
			set_nationality = KUB
		}
		every_navy_leader = {
			set_nationality = KUB
		}
		every_state = {
			limit = {
				is_core_of = DON
				NOT = { is_core_of = KUB }
				is_controlled_by = DON
			}
			add_core_of = KUB
		}
		KUB = { 
			annex_country = { target = ROOT transfer_troops = yes } 
			set_cosmetic_tag = DON_KUB_UNION
		}
		custom_effect_tooltip = GAME_OVER_TT
	}
}
# Unity of command - choice army chief
country_event = {
	id = kuban.11
	title = kuban.11.t
	desc = kuban.11.d

	is_triggered_only = yes
	
	option = {
		ai_chance = {
			factor = 50
			modifier = {
				factor = 0
				has_country_flag = KUB_AI_go_right
			}
		}
		name = kuban.11.a
		activate_advisor = KUB_vasily_prokhoda
	}

	option = {
		ai_chance = {
			factor = 50
			modifier = {
				factor = 0
				has_country_flag = KUB_AI_go_left
			}
		}
		name = kuban.11.b
		activate_advisor = KUB_sergei_ulagay
	}
}
# Ukrainization of Transkuban
country_event = {
	id = kuban.12
	title = kuban.12.t
	desc = kuban.12.d

	is_triggered_only = yes
	
	option = {
		name = kuban.12.a
		add_state_core = 233
		add_state_core = 985
		UKR = {
			add_state_core = 233
			add_state_core = 985
		}
		SOV = {
			remove_state_core = 233
			remove_state_core = 985
		}
	}
	
}
# Native people of Adygea - decision for they autonomy
country_event = {
	id = kuban.13
	title = kuban.13.t
	desc = kuban.13.d

	is_triggered_only = yes
	
	option = {
		ai_chance = {
			factor = 70
		}
		name = kuban.13.a
		set_country_flag = adygean_autonomy_approved
		add_political_power = 100
			division_template = {
			name = "Caucasian Native Cavalry Division"
			regiments = {
				cavalry = { x = 0 y = 0 }
				cavalry = { x = 0 y = 1 }
				cavalry = { x = 0 y = 2 }
			}
			support = {
				recon = { x = 0 y = 0 }     
			}
		}
		985 = {
			create_unit = {
				division = "name = \"Dykaya divisia\" division_template = \"Caucasian Native Cavalry Division\" start_experience_factor = 0.5"
				owner = ROOT
				prioritize_location = 6736
			}
		}
		custom_effect_tooltip = KUB_sultan_kilich_girey_tt
	}

	option = {
		ai_chance = {
			factor = 30
		}
		name = kuban.13.b
		add_political_power = -100
		985 = { 
			remove_dynamic_modifier = { modifier = KUB_adygean_autonomy } 
			add_dynamic_modifier = {
				modifier = KUB_adygean_unrests
				days = 180
				scope = KUB
			}
		}
	}
}
#Rename of Krasnodar for neutrals
country_event = {
	id = kuban.14
	title = kuban.14.t
	desc = kuban.14.d
	picture = GFX_report_event_krasnodar

	fire_only_once = yes

	trigger = {
		tag = KUB
		has_government = neutrality
		has_completed_focus = KUB_cossaks_autonomy
		234 = { 
			is_owned_and_controlled_by = KUB
			NOT = { has_state_flag = KUB_krasnodar_is_renamed }
		}
	}

	option = { #a great idea!
		name = kuban.14.a
		ai_chance = {
			base = 100
		}
		set_province_name = { id = 3734 name = UKR_yekaterinodar }
		234 = { set_state_flag = KUB_krasnodar_is_renamed }
	}

	option = { #rather not
		name = ukraine.273.e
		ai_chance = {
			base = 0
		}
	}
}
# Kuban proclaim independety - decision for OVERLORD
country_event = {
	id = kuban.15
	title = kuban.15.t
	desc = kuban.15.d

	is_triggered_only = yes
	
	option = {
		ai_chance = {
			factor = 70
		}
		name = kuban.15.a
		create_wargoal = {
			type = puppet_wargoal_focus
			target = FROM
			expire = 0
		}
		FROM = {
			country_event = { id = kuban.16 }
		}
	}

	option = {
		ai_chance = {
			factor = 30
		}
		name = kuban.15.b
		FROM = {
			country_event = { id = kuban.17 }
		}
	}
}
# OVERLORD disagree independent and create wargoal
country_event = {
	id = kuban.16
	title = kuban.16.t
	desc = kuban.16.d

	is_triggered_only = yes
	
	option = {
		name = kuban.16.a
	}
}
# OVERLORD confirm independent 
country_event = {
	id = kuban.17
	title = kuban.17.t
	desc = kuban.17.d

	is_triggered_only = yes
	
	option = {
		name = kuban.17.a
	}
}
# debug event
country_event = {
	id = kuban.100
	title = kuban.100.t
	desc = kuban.100.d

	is_triggered_only = yes

	immediate = {
		release = KUB
	}
	
	option = {
		name = kuban.100.a
		KUB = { change_tag_from = ROOT }
	}
	option = {
		name = kuban.100.b
	}
}