add_namespace = afr_EGY_vic

#OTO - EGY expands their army
country_event = {
	id = afr_EGY_vic.1
	title = afr_EGY_vic.1.t
	desc = afr_EGY_vic.1.d
	#picture = GFX_report_event_generic_riot

	is_triggered_only = yes

	option = { #reign them in
		name = afr_EGY_vic.1.a
		ai_chance = { factor = 75 }
		trigger = {
			has_political_power > 149
		}
		add_political_power = -150
		FROM = {
			country_event = {
				id = afr_EGY_vic.2
			}
		}
	}

	option = {#we can do nothing
		name = afr_EGY_vic.1.b
		ai_chance = { factor = 25 }
		add_political_power = -15
		FROM = {
			add_autonomy_score = {
				value = 100
				localization = OTO_allows_EGY_army_expansion
			}
		}
	}
}

#EGY - EGY expands their army
country_event = {
	id = afr_EGY_vic.2
	title = afr_EGY_vic.2.t
	desc = afr_EGY_vic.2.d
	#picture = GFX_report_event_generic_riot

	is_triggered_only = yes

	option = { #submit
		name = afr_EGY_vic.2.a
		ai_chance = { factor = 75 }
		set_country_flag = EGY_backed_down_mil
		FROM = {
			add_political_power = 200
		}
		FROM = {
			add_autonomy_ratio = {
				value = 0.100
				localization = EGY_bends_under_pressure
			}
		}
	}

	option = {#fight this
		name = afr_EGY_vic.2.b
		ai_chance = { factor = 25 }
		FROM = {
			country_event = {
				id = afr_EGY_vic.3
			}
		}
	}
}
#EGY refuses to back down
country_event = {
	id = afr_EGY_vic.3
	title = afr_EGY_vic.3.t
	desc = afr_EGY_vic.3.d
	#picture = GFX_report_event_generic_riot

	is_triggered_only = yes

	option = { #war it is
		name = afr_EGY_vic.3.a
		ai_chance = { factor = 75 }
		declare_war_on = {
			target = FROM
			type = puppet_wargoal_focus
		}
	}

	option = {#we are but words
		name = afr_EGY_vic.3.b
		ai_chance = { factor = 25 }
		add_political_power = -50
	}
}

#EGY offers alliance
country_event = {
	id = afr_EGY_vic.4
	title = afr_EGY_vic.4.t
	desc = afr_EGY_vic.4.d
	#picture = GFX_report_event_generic_riot

	is_triggered_only = yes

	option = { #agree
		name = afr_EGY_vic.4.a
		ai_chance = {
			factor = 75
			modifier = {
				add = 25
				has_completed_focus = ETH_friends_with_egypt
			}
			modifier = {
				add = 0
				has_completed_focus = ETH_fortify_the_egyption_boarder
			}
			modifier = {
				add = 25
				has_completed_focus = EGY_vic_rally_the_men_with_ETH
			}
		}
		trigger = {
			OR = {
				TAG = ETH
				TAG = EGY
			}
		}
		EGY = {
			add_ai_strategy = {
				type = alliance
				id = ETH
				value = 200
			}
			add_ai_strategy = {
				type = 	protect
				id = ETH
				value = 200
			}
			add_ai_strategy = {
				type = declare_war
				id = ETH
				value = -200
			}
		}
		ETH = {
			add_ai_strategy = {
				type = alliance
				id = EGY
				value = 200
			}
			add_ai_strategy = {
				type = 	protect
				id = EGY
				value = 200
			}
			add_ai_strategy = {
				type = declare_war
				id = EGY
				value = -200
			}
		}
		set_country_flag = ETH_EGY_alliance
		FROM = {
			set_country_flag = ETH_EGY_alliance
		}
	}

	option = { #agree
		name = afr_EGY_vic.4.a
		ai_chance = {
			factor = 100
			#modifier = {
			#	add = 25
			#	has_completed_focus =
			#}
		}
		trigger = {
			TAG = ALZ
		}
		EGY = {
			add_ai_strategy = {
				type = alliance
				id = ALZ
				value = 200
			}
			add_ai_strategy = {
				type = 	protect
				id = ALZ
				value = 200
			}
			add_ai_strategy = {
				type = declare_war
				id = ALZ
				value = -200
			}
		}
		ETH = {
			add_ai_strategy = {
				type = alliance
				id = ALZ
				value = 200
			}
			add_ai_strategy = {
				type = 	protect
				id = ALZ
				value = 200
			}
			add_ai_strategy = {
				type = declare_war
				id = ALZ
				value = -200
			}
		}
		ALZ = {
			add_ai_strategy = {
				type = alliance
				id = ETH
				value = 200
			}
			add_ai_strategy = {
				type = 	protect
				id = ETH
				value = 200
			}
			add_ai_strategy = {
				type = declare_war
				id = ETH
				value = -200
			}
			add_ai_strategy = {
				type = alliance
				id = EGY
				value = 200
			}
			add_ai_strategy = {
				type = 	protect
				id = EGY
				value = 200
			}
			add_ai_strategy = {
				type = declare_war
				id = EGY
				value = -200
			}
		}
		set_country_flag = ETH_EGY_ALZ_alliance
		EGY = {
			set_country_flag = ETH_EGY_ALZ_alliance
		}
		ETH = {
			set_country_flag = ETH_EGY_ALZ_alliance
		}
		EGY = { add_to_faction = ALZ }
	}

	option = {#refuse
		name = afr_EGY_vic.4.b
		ai_chance = {
			factor = 25
			modifier = {
				add = 0
				has_completed_focus = ETH_warm_up_to_egypt
			}
		}
		FROM = {
			if={
				limit={
					tag = EGY
				}
				country_event = {
					id = afr_EGY_vic.5
				}
			}
			add_political_power = -20
		}
	}
}

#ETH refuses our offer
country_event = {
	id = afr_EGY_vic.5
	title = afr_EGY_vic.5.t
	desc = afr_EGY_vic.5.d
	#picture = GFX_report_event_generic_riot

	is_triggered_only = yes

	option = { #war it is
		name = afr_EGY_vic.5.a
		ai_chance = { factor = 75 }
		declare_war_on = {
			target = FROM
			type = puppet_wargoal_focus
		}
	}

	option = {#fine, we need them not
		name = afr_EGY_vic.5.b
		ai_chance = { factor = 25 }
		add_political_power = -50
	}
}

#EGY - Sa'id dies
country_event = {
	id = afr_EGY_vic.6
	title = afr_EGY_vic.6.t
	desc = afr_EGY_vic.6.d
	#picture = GFX_report_event_generic_riot

	fire_only_once = yes
	is_triggered_only = yes

	trigger = {
		#date > 1862.8.1
		has_country_leader = {
			name = "Muhammad Sa'id Pasha"
			ruling_only = yes
		}
		tag = EGY
	}
	immediate = {
		hidden_effect = {
			#retire_country_leader = yes
			add_country_leader_role = {
				character = EGY_regency_council
				country_leader = {
					expire = "1879.1.1"
					ideology = despotism
					traits = {
						
					}
				}
				promote_leader = yes
			}
			retire_character = EGY_Muhammad_Sa_id_Pasha
		}
	}

	option = { #Praise Ismail
		name = afr_EGY_vic.6.a
		trigger= {
			#OR = {
			#	has_idea = weak_heir
			#	has_idea = has_heir
			#	has_idea = dethroned_heir
			#}
			has_country_flag = heir_ismail
		}
		add_country_leader_role = {
			character = EGY_Ismail_Pasha
			country_leader = {
				expire = "1895.3.2"
				ideology = despotism
				traits = {
					industrial_promoter
				}
			}
			promote_leader = yes
		}
		clr_country_flag = heir_ismail
		OTO = {
			random_character = {
				limit = { is_character =EGY_Ismail_Pasha  }
				set_nationality = {
					character = THIS
					target_country = EGY
				}
			}
			# EGY_Ismail_Pasha = {
			# 	#retire_character = 
			# 	set_nationality = {
			# 		character = THIS
			# 		target_country = EGY
			# 	}
			# }
		}
		#if ={
		#	limit = {
		#		has_idea = weak_heir
		#	}
		#	add_stability = -0.05
		#}

	}
	option = { #Praise Ahmad, not historical, but if he survived he would be crowned
		name = afr_EGY_vic.6.b
		trigger= {
			#OR = {
			#	has_idea = weak_heir
			#	has_idea = has_heir
			#	has_idea = dethroned_heir
			#}
			has_country_flag = heir_ahmad
		}
		add_country_leader_role = {
			character = EGY_Ahmad_Rifaat_Pasha
			country_leader = {
				expire = "1879.1.1"
				ideology = despotism
				traits = {
					
				}
			}
			promote_leader = yes
		}
		clr_country_flag = heir_ahmad
		#if ={
		#	limit = {
		#		has_idea = weak_heir
		#	}
		#	add_stability = -0.05
		#}

	}
	option = { #We have no heir
		name = afr_EGY_vic.6.c
		trigger= {
			#OR = {
			#	has_idea = no_heir
			#	has_idea = nonfamily_heir
			#}
		}
		OTO = {
			country_event = {id= afr_EGY_vic.7 days = 70}
		}
		hidden_effect={
			#add_ideas={
			#	hos_regency
			#}
		}

	}

}
#OTO - Sa'id dies with no heir (no idea how, but must confer to the system)
country_event = {
	id = afr_EGY_vic.7
	title = afr_EGY_vic.7.t
	desc = afr_EGY_vic.7.d
	#picture = GFX_report_event_generic_riot

	is_triggered_only = yes

	option = { #install a loyal leader
		name = afr_EGY_vic.7.a
		#leaving the current regency in place until i find a realistic new leader- maybe this general, he was a governer. maybe a 'promotion'?
		FROM={
			create_country_leader = {
				name = "Abdülkerim Nadir Pasha"
				desc = "POLITICS_GEORGE_V_DESC"
				picture = "Portrait_EGY_regency.png"
				expire = "2100.1.1"
				ideology = despotism
				traits = {
					controversial_figure
				}
			}
			add_stability = -0.15#well he is not egyptian
		}
		set_autonomy = {#the loyal leader is, well loyal
			target = FROM
			autonomy_state = autonomy_eyalet
		}
	}
	option = { #install a war hero
		name = afr_EGY_vic.7.a
		#leaving the current regency in place until i find a realistic new leader- maybe this general, he was a governer. maybe a 'promotion'?
		FROM={
			create_country_leader = {
				name = "Antoni Aleksander Iliński"
				desc = "POLITICS_GEORGE_V_DESC"
				picture = "Portrait_EGY_regency.png"
				expire = "2100.1.1"
				ideology = despotism
				traits = {
					controversial_figure
				}
			}
			add_stability = -0.15#well he is not egyptian
		}
		set_autonomy = {#the loyal leader is, well loyal
			target = FROM
			autonomy_state = autonomy_eyalet
		}
	}
	option = { #scour for a offical heir (just using Isma'il as a place holder here)
		name = afr_EGY_vic.7.b
		FROM={
			create_country_leader = {
				name = "Isma'il Pasha"
				desc = "POLITICS_GEORGE_V_DESC"
				picture = "Portrait_EGY_Ismail_Pasha.png"
				expire = "1879.1.1"
				ideology = despotism
				traits = {
					industrial_promoter
				}
			}
		}
	}

}

#EGY - wins against eth
country_event = {
	id = afr_EGY_vic.8
	title = afr_EGY_vic.8.t
	desc = afr_EGY_vic.8.d
	#picture = GFX_report_event_generic_riot

	fire_only_once = yes

	trigger = {
		has_country_flag = EGY_ETH_war
		OR = {
			AND = {
				controls_state = 817
				if={
					limit = {
						MED = {
							OVERLORD = {tag = ROOT}
						}
					}
					OR = {
						controls_state = 815
						MED = {controls_state = 815}
					}
				}
			}
			any_enemy_country = {
				tag = ETH
				surrender_progress > 0.33
			}
		}
		tag = EGY
	}
	mean_time_to_happen={
		days = 7
	}

	option = { #take what we want
		name = afr_EGY_vic.8.a
		ai_chance = {
			factor = 100
		}
		white_peace = ETH
		set_state_owner = 817
		if = {
			limit = {
				MED = {
					OVERLORD = {tag = ROOT}
				}
			}
			MED = {
				set_state_owner = 815
			}
		}
		set_truce = {
			target = ETH
			days = 200
		}
		clr_country_flag = EGY_ETH_war
	}
	option = { #annex them all
		name = afr_EGY_vic.8.b
		ai_chance = {
			factor = 0
		}
		add_threat = 2.5
	}

}

country_event = {#EGY loses against ETH
	id = afr_EGY_vic.9
	title = afr_EGY_vic.9.t
	desc = afr_EGY_vic.9.d
	#picture = GFX_report_event_generic_riot

	fire_only_once = yes

	trigger = {
		has_country_flag = EGY_ETH_war
		tag = EGY
		surrender_progress > 0.33
		any_enemy_country = {
			tag = ETH
		}
	}
	mean_time_to_happen={
		days = 7
	}

	option = { #we will make peace
		name = afr_EGY_vic.9.a
		ai_chance = {
			factor = 100
		}
		add_stability = -0.2
		white_peace = ETH
		clr_country_flag = EGY_ETH_war
	}
	option = { #never, this is just a minor set back
		name = afr_EGY_vic.9.b
		ai_chance = {
			factor = 0
		}
		add_threat = 2.5
	}

}

#ETH cotton sales are bolstered by usa civil war
country_event = {
	id = afr_EGY_vic.10
	title = afr_EGY_vic.10.t
	desc = afr_EGY_vic.10.d
	#picture = GFX_report_event_generic_riot

	fire_only_once = yes

	trigger = {
		USA = {
			has_war_with = CSA
		}
		tag = EGY
	}

	mean_time_to_happen = {
		days = 100
	}

	option = { #look at all this money
		name = afr_EGY_vic.10.a
		ai_chance = { factor = 75 }
		add_stability = 0.05
		add_political_power = 50
		add_timed_idea = { idea = eoanb_random_event_22_idea days = 360 }
	}

	option = {#pay our debt
		name = afr_EGY_vic.10.b
		ai_chance = { factor = 25 }
		custom_effect_tooltip = EGY_afr_decrease_debt_2
		set_temp_variable = { loans_amount = 2}
		take_loan_without_inflation_effect = yes		
	}
}

country_event = { #ENG- EGY is collapsing due to debt, should we move in?
	id = afr_EGY_vic.11
	title = afr_EGY_vic.11.t
	desc = afr_EGY_vic.11.d

	fire_only_once = yes
	
	trigger = {
		tag = ENG
		EGY={
			set_temp_variable = { loan_size_to_check = 10 }
			has_less_than_specific_loan_size = no
			OR={
				AND={
					date > 1878.1.1
					set_temp_variable = { loan_size_to_check = 25}
					has_less_than_specific_loan_size = no					
				}
				AND={
					date > 1874.1.1
					set_temp_variable = { loan_size_to_check = 30}
					has_less_than_specific_loan_size = no					
				}
				set_temp_variable = { loan_size_to_check = 35}
				has_less_than_specific_loan_size = no				
			}
		}
	}

	option = {#move in with FRA
		name = afr_EGY_vic.11.a
		ai_chance = { factor = 100 }
		add_manpower = -1000
		FRA={
			country_event={id=afr_EGY_vic.13}#egypt capitulates to ENG
		}
	}
	option = {#move in ourselves
		name = afr_EGY_vic.11.a
		ai_chance = { factor = 0 }
		add_manpower = -2000
		EGY={
			country_event={id=afr_EGY_vic.12}
		}
	}
	option = {#we have no desire for egypt
		name = afr_EGY_vic.11.a
		ai_chance = { factor = 0 }
		add_political_power = 75
	}
	mean_time_to_happen = {
		days = 30
	}
}
country_event = { #EGY - FRA and ENG are seizing control of our country, what do we do
	id = afr_EGY_vic.12
	title = afr_EGY_vic.12.t
	desc = afr_EGY_vic.12.d

	is_triggered_only = yes

	option = {#accept the move
		name = afr_EGY_vic.12.a
		ai_chance = { factor = 100 }
		EGY={
			set_temp_variable = { loans_amount = -20}
			take_loan_without_inflation_effect = yes
		}
		ENG={
			country_event={id=afr_EGY_vic.14 days = 7}#egypt capitulates
		}
		add_ideas={
			EGY_ENG_controlled_government
		}
		if={
			limit ={
				FROM={
					has_country_flag = FRA_assists_ENG_in_EGY
				}
			}
			add_ideas={
				EGY_FRA_controlled_government
			}
		}
	}
}
country_event = { #FRA- EGY is collapsing due to debt, ENG is moving in, should we join them
	id = afr_EGY_vic.13
	title = afr_EGY_vic.13.t
	desc = afr_EGY_vic.13.d

	fire_only_once = yes
	is_triggered_only = yes

	option = {#agree to move in
		name = afr_EGY_vic.13.a
		ai_chance = { factor = 95 }
		custom_effect_tooltip = FRA_help_ENG_attempt_seize_EGY
		add_manpower = -1000
		set_country_flag = FRA_assists_ENG_in_EGY
		hidden_effect={
			EGY={
				country_event={id=afr_EGY_vic.12}
			}
		}
	}
	option = {#ignore it
		name = afr_EGY_vic.13.a
		ai_chance = { factor = 5 }
		custom_effect_tooltip = ENG_attempt_seize_EGY
		hidden_effect={
			EGY={
				country_event={id=afr_EGY_vic.12}
			}
		}
	}
}
country_event = { #ENG - EGY submits
	id = afr_EGY_vic.14
	title = afr_EGY_vic.14.t
	desc = afr_EGY_vic.14.d

	fire_only_once = yes
	is_triggered_only = yes

	option = {#great
		name = afr_EGY_vic.14.a
		ai_chance = { factor = 100 }
		add_political_power = 50
	}
}
country_event = { #EGY - establishment of the dual control
	id = afr_EGY_vic.15
	title = afr_EGY_vic.15.t
	desc = afr_EGY_vic.15.d

	fire_only_once = yes
	
	trigger={
		date > 1876.11.5
		has_idea = EGY_ENG_controlled_government
		has_idea = EGY_FRA_controlled_government
	}
	mean_time_to_happen={
		days = 20
	}

	option = {#damn
		name = afr_EGY_vic.15.a
		ai_chance = { factor = 100 }
		remove_ideas ={
			EGY_ENG_controlled_government
			EGY_FRA_controlled_government
		}
		add_ideas={EGY_dual_control}
	}
}
country_event = { #OTO - due to EGY independance, lose hold on AWS and HRR
	id = afr_EGY_vic.16
	title = afr_EGY_vic.16.t
	desc = afr_EGY_vic.16.d

	fire_only_once = yes
	
	trigger={
		EGY = {
			OR={
				AND={
					NOT={controls_state = 268}
					NOT={controls_state = 983}
					NOT={controls_state = 550}
				}
				is_subject = no
			}
		}
		tag = OTO
		HRR = {
			is_subject_of = OTO
		}
		AWS = {
			is_subject_of = OTO
		}
	}
	mean_time_to_happen={
		days = 10
	}

	option = {#damn
		name = afr_EGY_vic.16.a
		ai_chance = { factor = 50 }
		if={
			limit ={
				HRR = {
					is_subject_of = OTO
				}
			}
			set_autonomy = {
				target = HRR
				autonomous_state = autonomy_free
			}
		}
		if={
			limit ={
				AWS = {
					is_subject_of = OTO
				}
			}
			set_autonomy = {
				target = AWS
				autonomous_state = autonomy_free
			}
		}
	}
}

country_event = { #EGY - Ahmed dies in a accident
	id = afr_EGY_vic.17
	title = afr_EGY_vic.17.t
	desc = afr_EGY_vic.17.d

	is_triggered_only = yes

	option = {#Isma'il is the heir now
		name = afr_EGY_vic.17.a
		clr_country_flag = heir_ahmad
		set_country_flag = heir_ismail
	}
}
country_event = {
	id = afr_EGY_vic.18
	title = afr_EGY_vic.18.t
	desc = afr_EGY_vic.18.d
	
	hidden = yes
	
	fire_only_once = yes
	is_triggered_only = yes

	trigger = {
		#date > 1862.5.20
		#date < 1862.6.20
		has_country_leader = {
			name = "Muhammad Sa'id Pasha"
			ruling_only = yes
		}
		tag = EGY
	}

	immediate = {
		random_list = {
			90 = { EGY = { country_event = { id = afr_EGY_vic.17 } } }
			10 = { EGY = { country_event = { id = afr_EGY_vic.19 } } }
		}
	}

	option = {
		name = afr_EGY_vic.18.a
	}
}
country_event = { #EGY - Ahmed accident avoided
	id = afr_EGY_vic.19
	title = afr_EGY_vic.19.t
	desc = afr_EGY_vic.19.d

	is_triggered_only = yes

	option = {#a most fortuitus event
		name = afr_EGY_vic.19.a
	}
}

# Grand Opening of the Suez
news_event = {
	id = afr_EGY_vic.20
	title = afr_EGY_vic.20.t
	desc = {
		text = afr_EGY_vic.20.1.desc    #historical, Egypt and France share the construction, still majorly Egypt
		trigger = {
			check_variable = { FRA.suez_investment > 20 }
			NOT = { has_variable = ENG.suez_investment }
		}
	}
	desc = {
		text = afr_EGY_vic.20.2.desc    #Egypt constructs the canal with less than 20% help from France
		trigger = {
			NOT = {
				has_variable = ENG.suez_investment
			}
			check_variable = { FRA.suez_investment < 20 }
		}
	}
	desc = {
		text = afr_EGY_vic.20.3.desc    #France pulls in Britain
		trigger = {
			has_variable = ENG.suez_investment
		}
	}
	picture = GFX_news_event_suez_canal_complete

	is_triggered_only = yes
	major = yes

	#Truly a marvellous achievement!
	option = {
		name = afr_EGY_vic.20.a
		trigger = {
			tag = EGY
		}
		add_timed_idea = { idea = eoanb_random_event_22_idea days = 360 }
		set_temp_variable = { eoanb_prestige_change = 10 }
		eoanb_change_prestige_score = yes
		hidden_effect = {
			set_global_flag = suez_build_flag
			if = {
				limit = { is_ai = no }
				set_variable = { super_event_displayed = 4 }
			}
		}
	}

	#A new gateway to the East.
	option = {
		name = afr_EGY_vic.20.b
		trigger = {
			NOT = { tag = EGY }
			OR = {
				tag = FRA
				has_country_flag = suez_constructor_flag
			}
		}
		if = {
			limit = {
				has_country_flag = suez_constructor_flag
				check_variable = { suez_investment > 20 }
			}
			set_temp_variable = { eoanb_prestige_change = 10 }
			eoanb_change_prestige_score = yes
		}
		else_if = {    #contributed less than 20% but more than 10%
			limit = {
				has_country_flag = suez_constructor_flag
				check_variable = { suez_investment < 20 }
				check_variable = { suez_investment > 10 }
			}
			set_temp_variable = { eoanb_prestige_change = 5 }
			eoanb_change_prestige_score = yes
		}
		else_if = {    #contributed less than 10% but more than 3%
			limit = {
				has_country_flag = suez_constructor_flag
				check_variable = { suez_investment < 10 }
				check_variable = { suez_investment > 3 }
			}
			set_temp_variable = { eoanb_prestige_change = 2 }
			eoanb_change_prestige_score = yes
		}
		else_if = {    #contributed less than 3%
			limit = {
				has_country_flag = suez_constructor_flag
				check_variable = { suez_investment < 3 }
			}
			set_temp_variable = { eoanb_prestige_change = 1 }
			eoanb_change_prestige_score = yes
		}
		else = {
			add_political_power = 10
		}
	}

	#We should have been there...
	option = {
		name = afr_EGY_vic.20.c
		trigger = {
			tag = ENG
			NOT = { has_country_flag = suez_constructor_flag }
		}
		set_temp_variable = { eoanb_prestige_change = -3 }
		eoanb_change_prestige_score = yes
	}

	#Impressive.
	option = {
		name = afr_EGY_vic.20.e
		trigger = {
			NOT = {
				OR = {
					tag = EGY
					tag = ENG
					tag = FRA
					tag = OMA
					tag = YEM
					tag = MED
				}
			}
			NOT = { has_country_flag = suez_constructor_flag }
		}
	}

	#I guess we might be less irrelevant now?
	option = {
		name = afr_EGY_vic.20.f
		trigger = {
			OR = {
				tag = OMA
				tag = YEM
				tag = MED
			}
		}
		add_timed_idea = { idea = eoanb_random_event_22_idea days = 240 }
	}
}

country_event = { #ENG - a plan to stop EGY using forced labour on the suez
	id = afr_EGY_vic.21
	title = afr_EGY_vic.21.t
	desc = afr_EGY_vic.21.d

	is_triggered_only = yes

	immediate={
		set_country_flag = EGY_corvee_suez_disabled
	}

	option = {#pressure the Egyptian government
		name = afr_EGY_vic.21.a
		add_political_power = -50
		EGY={country_event={id = afr_EGY_vic.25 days = 2}}
	}
	option = {#Incite the Egyptian Bedouins to revolt
		name = afr_EGY_vic.21.b
	}
}

#FRA - Formation of the Compagnie Universelle du Canal Maritime de Suez
country_event = {
	id = afr_EGY_vic.22
	title = afr_EGY_vic.22.t
	desc = afr_EGY_vic.22.d
	picture = GFX_report_event_suez_canal_plan

	is_triggered_only = yes
	fire_only_once = yes

	option = {
		name = afr_EGY_vic.22.a
		add_political_power = 10
		custom_effect_tooltip = Suez_Canal_investment_effect_tt
		hidden_effect = {
			EGY = { country_event = { id = afr_EGY_vic.23 days = 1 } }
			every_other_country = {
				limit = {
					OR = {
						AND = {
							is_great_power = yes
							capital_scope = { is_on_continent = europe }
						}
						tag = PRS
					}
				}
				country_event = { id = afr_EGY_vic.24 days = 3 }
			}
			country_event = { id = france.812 days = 130 }
			set_country_flag = suez_contributor_flag
		}
	}
}

#EGY - Suez Canal Construction to Start in Spring
country_event = {
	id = afr_EGY_vic.23
	title = afr_EGY_vic.23.t
	desc = afr_EGY_vic.23.d
	picture = GFX_report_event_suez_canal_plan

	is_triggered_only = yes
	fire_only_once = yes

	option = {
		name = afr_EGY_vic.23.a
		add_political_power = 10
		hidden_effect = {
			set_country_flag = suez_contributor_flag
		}
	}
}

# France Offers Shares in the Suez Canal Project
country_event = {
	id = afr_EGY_vic.24
	title = afr_EGY_vic.24.t
	desc = afr_EGY_vic.24.d
	picture = GFX_report_event_suez_canal_plan

	is_triggered_only = yes

	#Buy the offered shares.
	option = {
		name = afr_EGY_vic.24.a
		ai_chance = {
			base = 30
			modifier = {
				factor = 0.5
				TAG = ENG
			}
			modifier = {
				factor = 0.2
				OR = {
					TAG = AUS
					TAG = RUS
				}
			}
			modifier = {
				factor = 0.1
				OR = {
					TAG = PRS
					TAG = SPA
					TAG = SWE
					TAG = OTO
				}
			}
		}
		custom_effect_tooltip = Suez_Canal_investment_effect_tt
		add_to_array = { EGY.suezInvestors = THIS.id }
		hidden_effect = {
			set_country_flag = suez_contributor_flag
			set_variable = { suez_investment = 0 }
		}
	}

	#Let others bear the costs.
	option = {
		name = afr_EGY_vic.24.b
		ai_chance = { base = 70 }
	}
}

country_event = { #EGY - ENG pressures our government to stop the corvee system
	id = afr_EGY_vic.25
	title = afr_EGY_vic.25.t
	desc = afr_EGY_vic.25.d

	is_triggered_only = yes

	option = {#submit
		name = afr_EGY_vic.25.a
		set_country_flag= EGY_corvee_suez_disabled
	}
	option = {#refused
		name = afr_EGY_vic.25.b
	}
}

country_event = { # ETH - EGY offers shares in the suez canal
	id = afr_EGY_vic.26
	title = afr_EGY_vic.26.t
	desc = afr_EGY_vic.26.d

	is_triggered_only = yes

	option = {#yes
		name = afr_EGY_vic.26.a
		custom_effect_tooltip=Suez_Canal_investment_effect_tt
		add_to_array = { EGY.suezInvestors = THIS.id }
		hidden_effect={
			set_country_flag = suez_constructor_flag
			set_variable = { suez_investment = 0 }
		}
		ai_chance = {
			factor = 30
			modifier = {
				factor = 0.5
				TAG = ENG
			}
			modifier = {
				factor = 0.2
				OR={
					TAG = AUS
					TAG = RUS
				}
			}
			modifier = {
				factor = 0.1
				OR={
					TAG = PRS
					TAG = SPA
					TAG = SWE
					TAG = OTO
				}
			}
		}
	}
	option = {#no
		name = afr_EGY_vic.26.b
		ai_chance = { factor = 70 }
	}
}
country_event = {#colony of equatoria
	id = afr_EGY_vic.27
	title = afr_EGY_vic.27.t
	desc = afr_EGY_vic.27.d
	#hidden = yes

	fire_only_once = yes

	trigger = {
		is_neighbor_of = EQA
		EQA={
			is_subject = no
		}
		tag = EGY
	}

	mean_time_to_happen={
		days = 8
	}

	option = {
		name = afr_EGY_vic.27.a
		annex_country = {
			target = EQA
			transfer_troops = yes
		}
		add_state_core = 845

	}
}

country_event = {#Britain Sends fleet - Sparking Anti-Christian riots
	id = afr_EGY_vic.28
	title = afr_EGY_vic.28.t
	desc = afr_EGY_vic.28.d

	is_triggered_only = yes
	fire_only_once = yes

	option = {
		name = afr_EGY_vic.28.a
		add_stability = -0.05
		add_war_support = 0.1
		add_political_power = -50
		hidden_effect = {
			ENG = {
				country_event = {
					id = britain.208
					days = 28
				}
			}
		}
	}
}

country_event = {#Britain bombards Alexandria
	id = afr_EGY_vic.29
	title = afr_EGY_vic.29.t
	desc = afr_EGY_vic.29.d

	is_triggered_only = yes
	fire_only_once = yes

	option = {
		name = afr_EGY_vic.29.a
		add_stability = -0.1
		add_war_support = 0.15
		add_political_power = -50
		hidden_effect = {
			country_event = {
				id = afr_EGY_vic.30
				days = 14
			}
		}
	}
}

country_event = {#Revolts spread across country
	id = afr_EGY_vic.30
	title = afr_EGY_vic.30.t
	desc = afr_EGY_vic.30.d

	is_triggered_only = yes
	fire_only_once = yes

	option = {
		name = afr_EGY_vic.30.a
		add_stability = -0.15
		add_political_power = -150
		hidden_effect = {
			ENG = {
				country_event = britain.209
			}
		}
	}
}

country_event = {#Britain intervenes in revolts
	id = afr_EGY_vic.31
	title = afr_EGY_vic.31.t
	desc = afr_EGY_vic.31.d

	is_triggered_only = yes
	fire_only_once = yes

	option = {
		name = afr_EGY_vic.31.a
		add_stability = -0.05
		add_war_support = 0.05
		add_political_power = -50
	}
}

country_event = {#Urabi Revolt
	id = afr_EGY_vic.32
	title = afr_EGY_vic.32.t
	desc = afr_EGY_vic.32.d

	is_triggered_only = yes
	fire_only_once = yes

	option = {#Let him take power
		name = afr_EGY_vic.32.a
		ai_chance = {
			factor = 50
		}
		add_stability = -0.05
		add_war_support = 0.05
		ENG = {
			country_event = {
				id = britain.207
				days = 65
			}
		}
	}

	option = {#Crack down
		name = afr_EGY_vic.32.b
		ai_chance = {
			factor = 0
			modifier = {
				factor = 0
				is_historical_focus_on = yes
			}
		}
		add_stability = -0.25
		add_war_support = -0.1
		add_political_power = -250
	}
}
