#Secede The Levant
country_event = {

	id = 103101
	title = "EVTNAME103101"
	desc = "EVTDESC103101"
	
	fire_only_once = yes
	
	trigger = { 
			tag = EGY
			war_with = TUR
			national_provinces_occupied = 0.15
			has_global_flag = oriental_crisis }

	
	option = {
		name = "EVTOPTA103101"
		TUR = { country_event = 1031010 } }
}
#Secede The Levant - TUR response
country_event = {

	id = 1031010
	title = "EVTNAME103101"
	desc = "EVTDESC103101"
	
	fire_only_once = yes
	
	is_triggered_only = yes

	
	option = {
		name = "This will not end until Egypt ceases to exist"
	}
	
	option = {
		name = "EVTOPTA103101"
		set_country_flag = nosiosi
		end_war = EGY
		create_vassal = EGY
		any_country= { leave_alliance = EGY }
		any_pop = {
			consciousness = 2
			militancy = 1
		}
		847 = { add_core = TUR }
		848 = { add_core = TUR }
		TUR = {
			inherit = HDJ
		}
		EGY = { any_owned = {
			limit = {
				is_core = TUR
				}
			secede_province = TUR }
	}
		EGY_903 = { remove_core = EGY } 
        	EGY_897 = { remove_core = EGY } 
        	EGY_915 = { remove_core = EGY } 
        	EGY_921 = { remove_core = EGY } 
		EGY_910 = { remove_core = EGY } 
        	1156 = { remove_core = EGY } 
        	900 = { remove_core = EGY } 
        	894 = { remove_core = EGY } 
        	896 = { remove_core = EGY } #Chania
        	898 = { remove_core = EGY } #Iraklion
			
        ai_chance = {
            factor = 100
        }
	}
}
#Anexation_of_Egypt
country_event = {

	id = 103102
	title = "EVTNAME103102"
	desc = "EVTDESC103102"
	major = yes
	
	fire_only_once = yes
	
	trigger = { 
			tag = EGY
		TUR = { NOT = { has_country_flag = nosiosi }	}	
        OR = {
            NOT = {
                any_owned_province = {
                    is_core = TUR
                    controlled_by = THIS
                }
            }
			national_provinces_occupied = 0.50
        }
			has_global_flag = oriental_crisis 
			NOT = { THIS = { has_country_flag = gorda } } }

	option = {
		name = "EVTOPTA103102"
		TUR = { country_event = 1031020 }
	}
}
#Anexation_of_Egypt - TUR
country_event = {

	id = 1031020
	title = "EVTNAME103102"
	desc = "EVTDESC103102"
	major = yes
	
	fire_only_once = yes
	
	
	is_triggered_only = yes

	option = {
		name = "EVTOPTA103102"
		TUR = { set_country_flag = annexation_of_Egypt }
		end_war = EGY
		TUR = {
			inherit = EGY
		}
		TUR = {
			inherit = HDJ
		}
		EGY_903 = { remove_core = EGY } 
        	EGY_897 = { remove_core = EGY } 
        	EGY_915 = { remove_core = EGY } 
        	EGY_921 = { remove_core = EGY } 
		EGY_910 = { remove_core = EGY } 
        	1156 = { remove_core = EGY } 
        	900 = { remove_core = EGY } 
        	894 = { remove_core = EGY } 
        	896 = { remove_core = EGY } #Chania
        	898 = { remove_core = EGY }
	}
}

#annexation of northern Eritrea
country_event = {

	id = 1240203
	title = "EVTNAME1240203"
	desc = "EVTDESC1240203"
	
	fire_only_once = yes
	
	trigger = { tag = EGY 
	has_country_flag = ismail's_reforms_enacted
	year = 1873 
	exists = ETH
	owns = 1832
	NOT = { vassal_of = TUR } }
	
	mean_time_to_happen = { months = 2 }
	
	option = {
		name = "EVTOPTA1240203"
		set_country_flag = setup_for_the_war
		ETH = { 1850 = { secede_province = EGY } }
	}
}
#egyptian ethiopian war 
country_event = {

	id = 1240204
	title = "EVTNAME1240204"
	desc = "EVTDESC1240204"
	major = yes
	
	fire_only_once = yes
	
	trigger = { tag = EGY 
	has_country_flag = setup_for_the_war
	year = 1874
	exists = ETH
	owns = 1832
	owns = 1850 
	ETH = { war = no } 
	NOT = { vassal_of = TUR } }
	
	mean_time_to_happen = { months = 2 }
	
	option = {
		name = "EVTOPTA1240204"
		set_country_flag = egyptian_ethiopian_war
		ETH = { 
            add_country_modifier = {
                name = small_country_draft
                duration = 30
            } }
		casus_belli = {
            target = ETH
            type = conquest
            months = 12
        }
		war = {
			target = ETH
			attacker_goal = {
				casus_belli = conquest
			}
			
			defender_goal = {
				casus_belli = ethiopian_demands }
			
		}
	}
}

#Egypt loses
country_event = {

	id = 37030000
	title = "The great defeat"
	desc = "Being defeated by the Ethiopians, Egypt fell into a spiral of debt that never recovered from."
	
	fire_only_once = yes
	
	is_triggered_only = yes
	
	option = {
		name = "EVTOPTA1240203"
		ETH = { all_core = { secede_province = ETH } }
		remove_country_modifier = ismails_reforms
		set_country_flag = urabi_revolt
	}
}
#mahdist war 
country_event = {

	id = 1240205
	title = "Mahdist war"
	desc = "With the failure asserting our control in Sudan, the Sudanese are trying to achieve independence."
	
	fire_only_once = yes
	
	trigger = { tag = EGY 
	has_country_flag = setup_for_the_war
	year = 1878
	owns = 1832
	NOT = { exists = SUD } 
	NOT = { vassal_of = TUR } }
	
	mean_time_to_happen = { days = 10 }
	
	option = {
		name = "EVTOPTA1240203"
		set_country_flag = mahdist_war
		SUD = { all_core = { secede_province = SUD } }
		war = {
			target = SUD
			attacker_goal = {
				casus_belli = civil_war
			}
		}
	}
}
#egipto thiqq
country_event = {
	id = 106000
	title = "EVTNAME106000"
	desc = "EVTDESC106000"
	picture = "colonizationnnn"
	
	trigger = {
		tag = EGY
		year = 1870
		EGY = { exists = yes }
		NOT = {
			year = 1871
				has_global_flag = sudan_is_ours }
	}
	option = {
		name = "EVTOPTA106000"
		set_global_flag = sudan_is_ours
			1841 = { secede_province = EGY any_pop = { literacy = -0.99 } life_rating = 5 }	
			1842 = { secede_province = EGY any_pop = { literacy = -0.99 } life_rating = 5 } 
			1758 = { secede_province = EGY any_pop = { literacy = -0.99 } life_rating = 15 }
			2564 = { secede_province = EGY any_pop = { literacy = -0.99 } life_rating = 15 }
			1838 = { secede_province = EGY any_pop = { literacy = -0.99 } life_rating = 15 }
			1839 = { secede_province = EGY any_pop = { literacy = -0.99 } life_rating = 15 }
			2564 = { secede_province = EGY any_pop = { literacy = -0.99 } life_rating = 15 }
			1844 = { secede_province = EGY any_pop = { literacy = -0.99 } life_rating = 15 }
			1845 = { secede_province = EGY any_pop = { literacy = -0.99 } life_rating = 15 }
			1843 = { secede_province = EGY any_pop = { literacy = -0.99 } life_rating = 15 }
			1847 = { secede_province = EGY any_pop = { literacy = -0.99 } life_rating = 15 }
			1846 = { secede_province = EGY any_pop = { literacy = -0.99 } life_rating = 15 }
			1846 = {
				add_core = THIS
			}
			1842 = {
				add_core = THIS
			}
			1843 = {
				add_core = THIS
			}
			1844 = {
				add_core = THIS
			}
			1845 = {
				add_core = THIS
			}
			1846 = {
				add_core = THIS
			}
			1847 = {
				add_core = THIS
			}
			1758 = {
				add_core = THIS
			}
			2564 = {
				add_core = THIS
			}
			1838 = {
				add_core = THIS
			}
			1839 = {
				add_core = THIS
			}	
	}
}
#zanzibar thiqq
country_event = {
	id = 106010
	title = "EVTNAME1060010"
	desc = "EVTDESC1060010"
	picture = "colonizationnnn"
	
	trigger = {
		tag = ZAN
		ZAN = { exists = yes }
		year = 1870
		NOT = {
			year = 1871
				has_country_flag = kilwa_is_ours}
	}
	option = {
		name = "EVTOPTA106000"
		set_country_flag = kilwa_is_ours
			2033 = { secede_province = ZAN any_pop = { literacy = -0.99 } life_rating = 5 }	
			2039 = { secede_province = ZAN any_pop = { literacy = -0.99 } life_rating = 5 }	
	}
}

#Mali thiqq
country_event = {
	id = 4060300
	title = "EVTNAME106000"
	desc = "EVTDESC106000"
	picture = "colonizationnnn"
	
	trigger = {
		tag = MLE
		exists = yes
		NOT = {
				has_global_flag = mali_is_ours
				year = 1870}
	}
	option = {
		name = "EVTOPTA106000"
		set_global_flag = mali_is_ours
			1893 = { secede_province = THIS any_pop = { literacy = -0.99 } life_rating = 15 add_core = THIS}	
			1896 = { secede_province = THIS any_pop = { literacy = -0.99 } life_rating = 15 add_core = THIS}
			1895 = { secede_province = THIS any_pop = { literacy = -0.99 } life_rating = 15 add_core = THIS}
			1897 = { secede_province = THIS any_pop = { literacy = -0.99 } life_rating = 15 add_core = THIS}
			1892 = { secede_province = THIS any_pop = { literacy = -0.99 } life_rating = 15 add_core = THIS}
			1894 = { add_core = THIS}	
			1909 = { add_core = THIS}
			1908 = { add_core = THIS}
			1918 = { secede_province = THIS any_pop = { literacy = -0.99 } life_rating = 15 add_core = THIS}}
			1933 = { secede_province = THIS any_pop = { literacy = -0.99 } life_rating = 15 add_core = THIS}
			1934 = { secede_province = THIS any_pop = { literacy = -0.99 } life_rating = 15 add_core = THIS}
			1912 = { secede_province = THIS any_pop = { literacy = -0.99 } life_rating = 15 add_core = THIS}
			1913 = { secede_province = THIS any_pop = { literacy = -0.99 } life_rating = 15 add_core = THIS}
			1935 = { secede_province = THIS life_rating = 15 add_core = THIS}
	}
	
#Mali thiqq 2
country_event = {
	id = 5060300
	title = "EVTNAME106000"
	desc = "EVTDESC106000"
	picture = "colonizationnnn"
	
	trigger = {
		tag = MLE
		exists = yes
		1893 = { empty = no }
		1892 = { empty = no }
		1914 = { empty = no }
		NOT = {
				has_global_flag = mali_is_ours }
	}
	option = {
		name = "EVTOPTA106000"
		set_global_flag = mali_is_ours
			1893 = { add_core = THIS }	
			1896 = { add_core = THIS }
			1895 = { add_core = THIS }
			1900 = { add_core = THIS }
			1898 = { add_core = THIS }
			1899 = { add_core = THIS }
			1897 = { add_core = THIS }
			1892 = { add_core = THIS }
			1894 = { add_core = THIS }	
			1909 = { add_core = THIS }
			1908 = { add_core = THIS }
			1918 = { add_core = THIS }
			1917 = { add_core = THIS }
			1914 = { add_core = THIS }
			1923 = { add_core = THIS }
			1926 = { add_core = THIS }
			1924 = { add_core = THIS }	
			1925 = { add_core = THIS }
			1929 = { add_core = THIS }
			1928 = { add_core = THIS }
			1931 = { add_core = THIS }
			1932 = { add_core = THIS }
			1933 = { add_core = THIS }
			1934 = { add_core = THIS }
			1935 = { add_core = THIS }
	}
}

#Patagonia thiqq
country_event = {
	id = 106000000
	title = "EVTNAME106000"
	desc = "EVTDESC106000"
	picture = "colonizationnnn"
	

	is_triggered_only = yes
	
	option = {
		name = "EVTOPTA106000"
		set_country_flag = pat_is_ours
			2391 = { secede_province = PTG any_pop = { literacy = -0.99 } life_rating = 5 }	
			2394 = { secede_province = PTG any_pop = { literacy = -0.99 } life_rating = 5 } 
			2392 = { secede_province = PTG any_pop = { literacy = -0.99 } life_rating = 15 }
			2397 = { secede_province = PTG any_pop = { literacy = -0.99 } life_rating = 15 }
			2396 = { secede_province = PTG any_pop = { literacy = -0.99 } life_rating = 15 }
			2398 = { secede_province = PTG any_pop = { literacy = -0.99 } life_rating = 15 }
			2399 = { secede_province = PTG any_pop = { literacy = -0.99 } life_rating = 15 }
			2334 = { secede_province = PTG any_pop = { literacy = -0.99 } life_rating = 15 }
			2400 = { secede_province = PTG any_pop = { literacy = -0.99 } life_rating = 15 }
			2333 = { secede_province = PTG any_pop = { literacy = -0.99 } life_rating = 15 }
			2335 = { secede_province = PTG any_pop = { literacy = -0.99 } life_rating = 15 }
			2391 = {
				add_core = THIS
				add_core = ARG
			}
			2394 = {
				add_core = THIS
				
				add_core = ARG
			}
			2392 = {
				add_core = THIS
				add_core = ARG
			}
			2397 = {
				add_core = THIS
				add_core = ARG
			}
			2396 = {
				add_core = THIS
				add_core = ARG
			}
			2398 = {
				add_core = THIS
				add_core = ARG
			}
			2399 = {
				add_core = THIS
				add_core = ARG
			}
			2334 = {
				add_core = THIS
				add_core = ARG
			}
			2400 = {
				add_core = THIS
				add_core = ARG
			}
			2333 = {
				add_core = THIS
				add_core = CHL
			}
			2335 = {
				add_core = THIS
				add_core = CHL
			}	
	}
}