add_namespace = tunisia
# NO CAPITAL LETTER FOR THE COUNTRY!
#-----------------------------------------------
# Batto Sfez Affair (Events: 1-10 & 20-25)
#-----------------------------------------------
country_event = {
	id = tunisia.1 # Last Appeal in Batto Sfez Affair (1857 05 23)
	title = tunisia.1.t
	desc = tunisia.1.d
	picture = GFX_report_event_generic_carriage_accident

	is_triggered_only = yes

	option = { #His fate will be decided
		name = tunisia.1.a
		ai_chance = { factor = 100 }
		country_event = {
			id = tunisia.2
			days =  10
		}
	}
}
country_event = {
	id = tunisia.2 # Bey Decides His Fate
	title = tunisia.2.t
	desc = tunisia.2.d
	picture = GFX_report_event_generic_carriage_accident

	is_triggered_only = yes

	option = { #He is executed
		name = tunisia.2.a
		ai_chance = { factor = 100 }
		custom_effect_tooltip = TUN_tt_non_muslim_outrage
		country_event = {
			id = tunisia.5
			days = 15
		}
	}
	option = { #He is Freed
		name = tunisia.2.b
		ai_chance = { factor = 50 }
		add_stability = -0.06
		set_temp_variable = { money_to_gain = 0.2}
		add_money_with_inflation_included_with_tooltip_effect = yes #-> Small bribe
		custom_effect_tooltip = TUN_tt_muslim_outrage
		country_event = {
			id = tunisia.3
			days = 15
		}
	}
}

country_event = {
	id = tunisia.3 # Muslims Outraged
	title = tunisia.3.t
	desc = tunisia.3.d
	picture = GFX_report_event_generic_carriage_accident

	is_triggered_only = yes

	option = { #What will a protest achieve?
		name = tunisia.3.a
		ai_chance = { factor = 100 }
		add_stability = -0.1
		add_war_support = -0.05
		country_event = {
			id = tunisia.4
			days = 10
		}
	}
}

country_event = {
	id = tunisia.4 # Muslim Streets Riots
	title = tunisia.4.t
	desc = tunisia.4.d
	picture = GFX_report_event_generic_carriage_accident

	is_triggered_only = yes

	option = { #This is not looking good...
		name = tunisia.4.a
		ai_chance = { factor = 100 }
		add_timed_idea = {
			idea = TUN_street_riots
			days = 365
		}
	}
}

country_event = {
	id = tunisia.5 # Non-muslims Outraged
	title = tunisia.5.t
	desc = tunisia.5.d
	picture = GFX_report_event_generic_carriage_accident

	is_triggered_only = yes

	option = { #What will a protest achieve?
		name = tunisia.5.a
		ai_chance = { factor = 100 }
		add_stability = 0.3
		country_event = {
			id = tunisia.6
			days = 10
		}
	}
}

country_event = {
	id = tunisia.6 # Non-muslims Ask Consuls for Support
	title = tunisia.6.t
	desc = tunisia.6.d
	picture = GFX_report_event_generic_carriage_accident

	is_triggered_only = yes

	option = { #Who will they run to?
		name = tunisia.6.a	
		ai_chance = { factor = 100 }
		add_opinion_modifier = { target = ENG modifier = small_decrease }
		add_opinion_modifier = { target = FRA modifier = small_decrease }
		country_event = {
			id = tunisia.7
			days = 10
		}
		FRA = {
			country_event = {
				id = tunisia.8
				days = 10
			}
		}
	}
}

country_event = {
	id = tunisia.7 # Tunisian Delegations Audience in front of Emperor Napoleon
	title = tunisia.7.t
	desc = tunisia.7.d
	picture = GFX_report_event_napoleon_iii_generic

	is_triggered_only = yes

	option = { #They think he will accept their demands?
		name = tunisia.7.a	
		ai_chance = { factor = 100 }
		add_political_power = 35
		
	}
}
country_event = {
	id = tunisia.8 # Tunisian Delegations Audience from Emperor Napoleon (French Version)
	title = tunisia.8.t
	desc = tunisia.8.d
	picture = GFX_report_event_napoleon_iii_generic

	is_triggered_only = yes

	option = { #Ignore them
		name = tunisia.8.a	
		ai_chance = { factor = 50 }
		TUN = {
			country_event  = {
				id = tunisia.9
				days = 5
			}
		}
	}
	option = { #Support them
		name = tunisia.8.b	
		ai_chance = { factor = 100 }
		TUN = {
			country_event  = {
				id = tunisia.10
				days = 5
			}
		}
		FRA = {
			news_event  = {
				id = tunisia.20
				days = 5
			}
		}
		hidden_effect = {
			every_country = {
				limit = {
					AND = {
						NOT = {
							AND = {
								tag = TUN
								tag = FRA
							}
						}
						is_major = yes
					}
				}
				news_event = {
					id = tunisia.20
					days = 5
				}
			}
		}
	}
}

country_event = {
	id = tunisia.9 # French Emperor Ignores Them
	title = tunisia.9.t
	desc = tunisia.9.d
	picture = GFX_report_event_napoleon_iii_generic

	is_triggered_only = yes

	option = { #We are victorious
		name = tunisia.9.a	
		ai_chance = { factor = 100 }
		add_war_support = 0.05
		add_political_power = 25
	}
}
country_event = {
	id = tunisia.10 # French Fleet in Tunis (Tunisian Version)
	title = tunisia.10.t
	desc = tunisia.10.d
	picture = GFX_report_event_kor_warships_western

	is_triggered_only = yes

	option = { #This is a dangeorus game...
		name = tunisia.10.a	
		ai_chance = { factor = 100 }
		country_event = {
			id = tunisia.21
			days = 10
		}
	}
}
news_event = {
	id = tunisia.20 # French Fleet in Tunis (World Version)
	title = tunisia.20.t
	desc = tunisia.20.d
	picture = GFX_report_event_kor_warships_western

	is_triggered_only = yes

	option = { #This is not good for Tunisia
		name = tunisia.20.a
		ai_chance = { factor = 100 }
	}
}

country_event = {
	id = tunisia.21 # French Force us to Create Fundamental Pact
	title = tunisia.21.t
	desc = tunisia.21.d
	picture = GFX_report_event_tun_fundamental_pact

	is_triggered_only = yes

	option = { #Try to resist
		name = tunisia.21.a	
		ai_chance = { factor = 100 }
		custom_effect_tooltip = TUN_popular_response_tt
		add_war_support = 0.03
		country_event = {
			id = tunisia.22
			days = 10
		}
	}
	option = { #Submit to the pressure
		name = tunisia.21.b	
		ai_chance = { factor = 70 }
		add_war_support = -0.03
		country_event = {
			id = tunisia.23
			days = 10
		}
	}
}

country_event = {
	id = tunisia.22 # French Bombard Tunis
	title = tunisia.22.t
	desc = tunisia.22.d
	picture = GFX_report_event_tun_coastal_bombing

	is_triggered_only = yes

	option = { #What a tragedy
		name = tunisia.22.a	
		ai_chance = { factor = 100 }
		add_war_support = -0.1
		add_manpower = -2000
		458 = {
			damage_building = {
				type = infrastructure
				damage = 1
			}
		}
		country_event = {
			id = tunisia.23
			days = 10
		}
	}
}
country_event = {
	id = tunisia.23 # Start Creating Fundamental Pact
	title = tunisia.23.t
	desc = tunisia.23.d
	picture = GFX_report_event_tun_fundamental_pact

	is_triggered_only = yes

	option = { #Start of something great
		name = tunisia.23.a	
		ai_chance = { factor = 100 }
		if = {
			limit = {
				tag = TUN
			}
			TUN = {
				add_timed_idea = {
					idea = TUN_creating_the_fundementalist_pact
					days = 14
				}
			}
			hidden_effect = {
				TUN = {
					country_event = {
						id = tunisia.24
						days = 10
					}
				}
				FRA = {
					country_event = {
						id = tunisia.24
						days = 10
					}
				}
			}
		}
	}
}
country_event = {
	id = tunisia.24 # Fundamental Pact Signed 
	title = tunisia.24.t
	desc = tunisia.24.d
	picture = GFX_report_event_tun_fundamental_pact

	is_triggered_only = yes

	option = { #This will greatly benefit the future of Tunis
		name = tunisia.24.a	
		ai_chance = { factor = 100 }
		if = {
			limit = {
				tag = TUN
			}
			TUN = {
				add_ideas = {
					TUN_the_fundamental_pact
				}
			}
		}
		else_if = {
			limit = {
				tag = FRA
			}
			FRA = {
				add_war_support = 0.05
				}
			}
		}	
	}

#-----------------------------------------------
country_event = {
	id = tunisia.11 # Khazdanar scandal
	title = tunisia.11.t
	desc = tunisia.11.d
	picture = GFX_tun_Khazdanar_removed

	is_triggered_only = yes

	option = {
		name = tunisia.11.a
		#TO ADD
	}
}

country_event = {
	id = tunisia.12 # economic and political reforms
	title = tunisia.12.t
	desc = tunisia.12.d
	picture = placeholder

	is_triggered_only = yes

	option = {
		ai_chance = { factor = 80 }
		name = tunisia.12.a

			set_country_flag = TUN_Khezdanar_grand_vizier #in this case debt will be managed by asking for loans to france and england
	}
	option = {
		ai_chance = { factor = 20 }
		name = tunisia.12.b
			set_country_flag = TUN_hayreddin_pasha_grand_vizier #new_economic_policy
	}
}

country_event = {
	id = tunisia.13 #decision on navy budget
	title = tunisia.13.t
	desc = tunisia.13.d
	picture = GFX_
	is_triggered_only = yes
	fire_only_once = yes
	option = {
		name = tunisia.13.a # do not expand budget
		ai_chance = { factor = 100 }
		complete_national_focus = TUN_no_budget_expansion
	}
	option = {
		name = tunisia.13.b # expand budget
		ai_chance = { factor = 100 }
		complete_national_focus = TUN_all_power_to_navy
	}
}
country_event = {
	id = tunisia.14 # Palace Renovations
	title = tunisia.14.t
	desc = tunisia.14.d
	picture = GFX_
	is_triggered_only = yes
	fire_only_once = yes
	option = {
		name = tunisia.14.a 
		ai_chance = { factor = 100 }
		add_political_power = 50
	}
}
country_event = {
	id = tunisia.15 # Renovations of the great Mosque of Tunis
	title = tunisia.15.t
	desc = tunisia.15.d
	picture = GFX_
	fire_only_once = yes
	is_triggered_only = yes
	option = {
		name = tunisia.15.a 
		ai_chance = { factor = 100 }
		add_stability = 0.05
		increase_legitimacy_by_two = yes
	}
}
#Tunisian Culture event chain
country_event = {
	id = tunisia.17 # Spreading Tunisian Culture
	title = tunisia.17.t
	desc = tunisia.17.d
	picture = GFX_report_event_tun_cultural_reforms

	is_triggered_only = yes
	
	option = {
		name = tunisia.17.a
		ai_chance = { factor = 100 }
		add_tech_bonus = { bonus = 0.75 uses = 1 category = infantry_weapons }   
		add_political_power = 10
		add_war_support = 0.03
		country_event = {
			id = tunisia.18
			days = 15
		}
	}
}
country_event = {
	id = tunisia.18 # Spreading Tunisian Culture
	title = tunisia.18.t
	desc = tunisia.18.d
	picture = GFX_report_event_tun_cultural_reforms

	is_triggered_only = yes
	
	option = {
		name = tunisia.18.a
		ai_chance = { factor = 100 }
		add_tech_bonus = { bonus = 0.25 uses = 3 category = humanities_tech }   
		add_political_power = 15
		country_event = {
			id = tunisia.19
			days = 25
		}
	}
}
country_event = {
	id = tunisia.19 # Spreading Tunisian Culture
	title = tunisia.19.t
	desc = tunisia.19.d
	picture = GFX_report_event_tun_cultural_reforms

	is_triggered_only = yes
	
	option = {
		name = tunisia.19.a
		ai_chance = { factor = 100 }
		add_tech_bonus = { bonus = 0.25 uses = 1 category = biochemistry_tech }   
		add_political_power = 25
		add_stability = 0.07
	}
}

# General Husain Takes Office
country_event = {
	id = tunisia.25 
	title = tunisia.25.t
	desc = tunisia.25.d
	picture = GFX_report_event_tun_cultural_reforms

	is_triggered_only = yes
	
	option = {
		name = tunisia.25.a
		ai_chance = { factor = 100 }
		activate_advisor = TUN_al_fariq_hussein
		set_country_flag = tun_modernize_tunis
		activate_mission = TUN_mission_preparing_modernazition_plans
		add_timed_idea = {
			idea = TUN_preparing_modernization_plans
			days = 365
		}

	}
}
# General Husain Announce His Plans
country_event = {
	id = tunisia.26
	title = tunisia.26.t
	desc = tunisia.26.d
	picture = GFX_report_event_tun_cultural_reforms

	is_triggered_only = yes
	
	option = {
		name = tunisia.26.a
		ai_chance = { factor = 100 }
		set_country_flag = tun_start_phase_one
		activate_mission = TUN_mission_finish_phase_one
	}
}
# General Husain Announce His Plans for Phase 2
country_event = {
	id = tunisia.27
	title = tunisia.27.t
	desc = tunisia.27.d
	picture = GFX_report_event_tun_cultural_reforms

	is_triggered_only = yes
	
	option = {
		name = tunisia.27.a
		ai_chance = { factor = 100 }
		activate_mission = TUN_mission_finish_phase_two
	}
}

# Gen. Husain Establish Tunisian Official Journal
news_event = {
	id = tunisia.28
	title = tunisia.28.t
	desc = tunisia.28.d
	picture = GFX_report_event_tun_cultural_reforms

	is_triggered_only = yes
	
	option = {
		name = tunisia.28.a
		ai_chance = { factor = 100 }
	}
}

# General Husain Announce His Plans for Phase 3
country_event = {
	id = tunisia.29
	title = tunisia.29.t
	desc = tunisia.29.d
	picture = GFX_report_event_tun_cultural_reforms

	is_triggered_only = yes
	
	option = {
		name = tunisia.29.a
		ai_chance = { factor = 100 }
		activate_mission = TUN_mission_finish_phase_three
	}
}
country_event = {
	id = tunisia.30 # telegraph concession
	title = tunisia.30.t
	desc = tunisia.30.d
	picture = GFX_report_event_generic_telegraph_line
	
	is_triggered_only = yes
	
	option = {
		name = tunisia.30.a
			random_owned_state = {
				add_building_construction = {
				type = infrastructure
				level = 1
				instant_build = yes
				}
			}
		}
	}

country_event = {
	id = tunisia.31 # the constitution
	title = tunisia.31.t
	desc = tunisia.31.d
	picture = GFX_report_event_tun_generic_meeting

	is_triggered_only = yes

	option = {
		name = tunisia.31.a
			hidden_effect = {
			remove_ideas = { TUN_reformism }
				#swap_ideas = {
				#	remove_idea = human_rights
				#	add_idea = limited_constitution
				#}
			}
		}
	}

country_event = {
	id = tunisia.32 # invite the reformists
	title = tunisia.32.t
	desc = tunisia.32.d
	picture = GFX_report_event_generic_ball_aristocracy

	is_triggered_only = yes

	option = {
		name = tunisia.32.a
			hidden_effect = {
			add_ideas = TUN_reformism
			}
		}
	}

country_event = {
	id = tunisia.33 # cultural reforms
	title = tunisia.33.t
	desc = tunisia.33.d
	picture = GFX_report_event_tun_cultural_reforms

	is_triggered_only = yes
	
	option = {
		name = tunisia.33.a
		add_tech_bonus = { bonus = 0.75 uses = 1 category = infantry_weapons }   
		activate_mission = TUN_mission_cultural_reforms
		}
	}

country_event = {
	id = tunisia.34 # trans saharian network
	title = tunisia.34.t
	desc = tunisia.34.d
	picture = GFX_report_event_generic_railway_2

	is_triggered_only = yes

	option = {
		name = tunisia.34.a
			swap_ideas = {
			remove_idea = slavery_all_but_name
			add_idea = limited_equality
			}
		}
	}

#------------------------------------------------------------
# Mejba Revolt
#------------------------------------------------------------
#Mejba rebellion
country_event = {
	id = tunisia.100
	title = tunisia.100.t
	desc = tunisia.100.d
	picture = GFX_report_event_tun_general_death

	is_triggered_only = yes
	option = {
		name = tunisia.100.a #Khra...
		ai_chance = { factor = 100 }
		1012 = {
			set_demilitarized_zone = yes
		}
		add_dynamic_modifier = { modifier = TUN_Mejba_Revolt_Modifier }
		hidden_effect = {
			every_country = {
				limit = {
					AND = {
						NOT = {
							tag = TUN
						}
						is_major = yes
					}
				}
				news_event = {
					id = tunisia.105
					days = 5
				}
			}
		}
	}
}
# Rural Nobles Revolt against New Tax
country_event = {
	id = tunisia.101
	title = tunisia.101.t
	desc = tunisia.101.d
	picture = GFX_report_event_tun_general_death

	is_triggered_only = yes
	option = {
		name = tunisia.101.a #Send Farhat to them
		ai_chance = { factor = 100 }
		add_stability = -0.05
		hidden_effect = {
			country_event = {
				id = tunisia.103
				days = 20
			}
		}
	}
}

# The tax rates are doubled
country_event = {
	id = tunisia.102
	title = tunisia.102.t
	desc = tunisia.102.d
	picture = GFX_report_event_tun_general_death

	is_triggered_only = yes
	option = {
		name = tunisia.102.a #Okay
		ai_chance = { factor = 100 }
		complete_national_focus = TUN_double_the_rate
		hidden_effect = {
			country_event = {
				id = tunisia.100
				days = 10
			}
		}
	}
}

# Farhat killed!
country_event = {
	id = tunisia.103
	title = tunisia.103.t
	desc = tunisia.103.d
	picture = GFX_report_event_tun_general_death

	is_triggered_only = yes
	option = {
		name = tunisia.103.a #Oh damn them...
		ai_chance = { factor = 100 }
		add_manpower = -160
		hidden_effect = {
			country_event = {
				id = tunisia.104
				days = 20
			}
		}
	}
}

# El Kef falls
country_event = {
	id = tunisia.104
	title = tunisia.104.t
	desc = tunisia.104.d
	picture = GFX_report_event_tun_general_death

	is_triggered_only = yes
	option = {
		name = tunisia.104.a #NO!
		ai_chance = { factor = 100 }
		add_stability = -0.1
		add_equipment_to_stockpile = {
			type = infantry_equipment
			amount = -200
			producer = TUN
		}
	}
}

#World News: Majba Revolt
news_event = {
	id = tunisia.105
	title = tunisia.105.t
	desc = tunisia.105.d
	picture = GFX_report_event_tun_general_death

	is_triggered_only = yes
	option = {
		name = tunisia.105.a #We must do somethings about this
		ai_chance = { factor = 100 }
		hidden_effect = {
			FRA = {
				country_event = {
					id = tunisia.106
					days = 5
				}
			}
			PIE = {
				country_event = {
					id = tunisia.107
					days = 5
				}
			}
			set_global_flag = TUN_majba_revolt_flag
		}
	}
}

# France: Establish Contact with the rebels
country_event = {
	id = tunisia.106
	title = tunisia.106.t
	desc = tunisia.106.d
	picture = GFX_report_event_tun_general_death

	is_triggered_only = yes
	option = {
		name = tunisia.106.a #This is not good
		ai_chance = { factor = 100 }
		FRA = {
			country_event = {
				id = tunisia.109
				days = 15
			}
		}
		hidden_effect = {
			set_global_flag = TUN_france_established_contact_with_the_rebels
		}
	}
}

# France: Pressure The Bey to Avoid a Revolt
country_event = {
	id = tunisia.109
	title = tunisia.109.t
	desc = tunisia.109.d
	picture = GFX_report_event_tun_general_death

	is_triggered_only = yes
	option = {
		name = tunisia.109.a #We must avoid a rebellion
		ai_chance = { factor = 100 }
		hidden_effect = {
			set_global_flag = TUN_french_pressure
		}
	}
}

# Italy: An intervention in Tunisia?
country_event = {
	id = tunisia.107
	title = tunisia.107.t
	desc = tunisia.107.d
	picture = GFX_report_event_tun_general_death

	is_triggered_only = yes
	option = {
		name = tunisia.107.a #Prepare an army
		ai_chance = { factor = 100 }
		hidden_effect = {
			set_global_flag = TUN_italy_intervention
			country_event = {
				id = tunisia.108
				days = 10
			}
		}
	}
}

# Italy: Plans Exposed
country_event = {
	id = tunisia.108
	title = tunisia.108.t
	desc = tunisia.108.d
	picture = GFX_report_event_tun_general_death

	is_triggered_only = yes
	option = {
		name = tunisia.108.a #Mierda!
		ai_chance = { factor = 100 }
		add_war_support = -0.05
		hidden_effect = {
			ENG = {
				country_event = {
					id = tunisia.110
					days = 5
				}
			}
		}
	}
}

# Britain: Italy has plans to invade Tunis
country_event = {
	id = tunisia.110
	title = tunisia.110.t
	desc = tunisia.110.d
	picture = GFX_report_event_tun_general_death

	is_triggered_only = yes
	option = {
		name = tunisia.110.a #We cannot allow this
		ai_chance = { factor = 100 }
		PIE = {
			country_event = {
				id = tunisia.111
				days = 5
			}
		}
	}
}

# Italy: British Anger
country_event = {
	id = tunisia.111
	title = tunisia.111.t
	desc = tunisia.111.d
	picture = GFX_report_event_tun_general_death

	is_triggered_only = yes
	option = {
		name = tunisia.111.a #We can't wake up the sleeping lion
		ai_chance = { factor = 100 }
		hidden_effect = {
			set_global_flag = TUN_italy_wont_invade
		}
	}
}

# European Interventions
country_event = {
	id = tunisia.112
	title = tunisia.112.t
	desc = tunisia.112.d
	picture = GFX_report_event_tun_general_death

	trigger = {
		AND = {
			has_global_flag = TUN_majba_revolt_flag
			has_global_flag = TUN_france_established_contact_with_the_rebels
			has_global_flag = TUN_italy_intervention
		}
	}

	is_triggered_only = yes
	option = {
		name = tunisia.112.a #Ya rabbi...!
		ai_chance = { factor = 100 }
		hidden_effect = {
			set_global_flag = TUN_europe_intervenes
			
		}
	}
}

# Diplomat steals 20 Million Piastres
country_event = {
	id = tunisia.113
	title = tunisia.113.t
	desc = tunisia.113.d
	picture = GFX_report_event_tun_general_death

	is_triggered_only = yes
	option = {
		name = tunisia.113.a #Damn him
		ai_chance = { factor = 100 }
		hidden_effect = {
		}
	}
}

# French pressure to begin negotiations
country_event = {
	id = tunisia.114
	title = tunisia.114.t
	desc = tunisia.114.d
	picture = GFX_report_event_tun_general_death

	trigger = {
		AND = {
			has_global_flag = TUN_french_pressure
			has_global_flag = TUN_europe_intervenes
		}
	}

	is_triggered_only = yes
	option = {
		name = tunisia.114.a #We have nothing to lose
		ai_chance = { factor = 100 }
		TUN = {
			country_event = {
				id = tunisia.115
				days = 10
			}
		}
		hidden_effect = {
			FRA = {
				country_event = {
					id = tunisia.115
					days = 10
				}
			}
			ITA = {
				country_event = {
					id = tunisia.115
					days = 10
				}
			}
			ENG = {
				country_event = {
					id = tunisia.115
					days = 10
				}
			}
			OTO = {
				country_event = {
					id = tunisia.115
					days = 10
				}
			}
		}
	}
}

# Non-Intervention Agreement
country_event = {
	id = tunisia.115
	title = tunisia.115.t
	desc = tunisia.115.d
	picture = GFX_report_event_tun_general_death

	is_triggered_only = yes
	option = {
		name = tunisia.115.a #We must keep peace in Tunisia
		ai_chance = { factor = 100 }
		if = {
			limit = {
				tag = TUN
			}
			TUN = {
				country_event = {
					id = tunisia.116
					days = 10
				}
			}
		}
	}
}

# Negotiations begin...
country_event = {
	id = tunisia.116
	title = tunisia.116.t
	desc = tunisia.116.d
	picture = GFX_report_event_tun_general_death

	is_triggered_only = yes
	option = {
		name = tunisia.116.a #We have to be patient
		unlock_decision_category_tooltip = tunisia_revolt_category
		set_variable = {
			var = Mejba_Revolt_var
			value = 3
		}
		country_event = {
			id = tunisia.117
			days = 5
		}
	}
}

# Repealing the mejba tax
country_event = {
	id = tunisia.117
	title = tunisia.117.t
	desc = tunisia.117.d
	picture = GFX_report_event_tun_general_death

	is_triggered_only = yes
	option = {
		name = tunisia.117.a #Accept
		ai_chance = { factor = 100 }
		add_to_variable = {
			var = Mejba_Revolt_var
			value = -1
		}
		remove_ideas = {
			TUN_idea_mejba_tax
		}
		country_event = {
			id = tunisia.118
			days = 5
		}
	}

	option = {
		name = tunisia.117.b #Refuse
		ai_chance = { factor = 80 }
		add_to_variable = {
			var = Mejba_Revolt_var
			value = 2
		}
		
		country_event = {
			id = tunisia.118
			days = 5
		}
	}
}


# Abolish the Constitution
country_event = {
	id = tunisia.118
	title = tunisia.118.t
	desc = tunisia.118.d
	picture = GFX_report_event_tun_general_death

	is_triggered_only = yes
	option = {
		name = tunisia.118.a #Accept
		ai_chance = { factor = 100 }
		add_to_variable = {
			var = Mejba_Revolt_var
			value = -1
		}
		add_political_power = -100
		country_event = {
			id = tunisia.119
			days = 5
		}
	}

	option = {
		name = tunisia.118.b #Refuse
		ai_chance = { factor = 80 }
		add_to_variable = {
			var = Mejba_Revolt_var
			value = 1
		}
		
		country_event = {
			id = tunisia.119
			days = 5
		}
	}
}


#Remove Foreign Goverment
country_event = {
	id = tunisia.119
	title = tunisia.119.t
	desc = tunisia.119.d
	picture = GFX_report_event_tun_general_death

	is_triggered_only = yes
	option = {
		name = tunisia.119.a #Accept
		ai_chance = { factor = 100 }
		add_to_variable = {
			var = Mejba_Revolt_var
			value = -1
		}
		add_political_power = -250
		add_stability = -0.05
		country_event = {
			id = tunisia.120
			days = 5
		}
	}

	option = {
		name = tunisia.119.b #Refuse
		ai_chance = { factor = 80 }
		add_to_variable = {
			var = Mejba_Revolt_var
			value = 1
		}

		country_event = {
			id = tunisia.120
			days = 5
		}
	}
}

#Restore Slavery
country_event = {
	id = tunisia.120
	title = tunisia.120.t
	desc = tunisia.120.d
	picture = GFX_report_event_tun_general_death

	is_triggered_only = yes
	option = {
		name = tunisia.120.a #Accept
		ai_chance = { factor = 80 }
		add_to_variable = {
			var = Mejba_Revolt_var
			value = -1
		}
		swap_ideas = {
			add_idea = slavery
			remove_idea = slavery_all_but_name
		}
		hidden_effect = {
			add_opinion_modifier = {
				target = ENG
				modifier = medium_decrease 
			}
			add_opinion_modifier = {
				target = ITA
				modifier = medium_decrease 
			}
			add_opinion_modifier = {
				target = FRA
				modifier = medium_decrease 
			}
		}
		country_event = {
			id = tunisia.121
			days = 5
		}
	}

	option = {
		name = tunisia.120.b #Refuse
		ai_chance = { factor = 100 }
		add_to_variable = {
			var = Mejba_Revolt_var
			value = 1
		}

		country_event = {
			id = tunisia.121
			days = 5
		}
	}
}

#Bribing the Tribes
country_event = {
	id = tunisia.121
	title = tunisia.121.t
	desc = tunisia.121.d
	picture = GFX_report_event_tun_general_death

	is_triggered_only = yes
	option = {
		name = tunisia.121.a #Accept
		ai_chance = { factor = 100 }
		add_to_variable = {
			var = Mejba_Revolt_var
			value = -2
		}

		set_temp_variable = { money_to_gain = -0.5 }
		add_money_with_tooltip_effect = yes
	
		country_event = {
			id = tunisia.122
			days = 5
		}
	}

	option = {
		name = tunisia.120.b #Medium Amount
		ai_chance = { factor = 80 }
		add_to_variable = {
			var = Mejba_Revolt_var
			value = -1
		}

		set_temp_variable = { money_to_gain = -0.3 }
		add_money_with_tooltip_effect = yes

		country_event = {
			id = tunisia.122
			days = 5
		}
	}

	option = {
		name = tunisia.120.c #Refuse
		ai_chance = { factor = 50 }

		country_event = {
			id = tunisia.122
			days = 5
		}
	}
}


#The big day...
country_event = {
	id = tunisia.122
	title = tunisia.122.t
	desc = tunisia.122.d
	picture = GFX_report_event_tun_general_death

	is_triggered_only = yes
	option = {
		name = tunisia.122.a #Accept
		ai_chance = { factor = 100 }
		if = {
			limit = {
				check_variable = { 
					var = Mejba_Revolt_var
					value = 0
					compare = less_than_or_equals
				}
			}
			add_stability = 0.05
			remove_dynamic_modifier = { modifier = TUN_Mejba_Revolt_Modifier }
		}
		else_if = {
			limit = {
				check_variable = { Mejba_Revolt_var = 2 }
			}
			set_global_flag = TUN_mejba_revolt_started
			start_civil_war = {
				ideology = ROOT
				size = 0.3
				capital = 1012
				states = {
					1012
				}
				PREV = {
					create_unit = {
						division = "name = \"Infantry Divison\" division_template = \"Reformed infantry\" start_experience_factor = 0.5"
						owner = TUN
					}
					create_unit = {
						division = "name = \"Infantry Divison\" division_template = \"Reformed infantry\" start_experience_factor = 0.5"
						owner = TUN
					}
				}
			}
		}

		else_if = {
			limit = {
				check_variable = { Mejba_Revolt_var = 3 }
			}
			set_global_flag = TUN_mejba_revolt_started
			start_civil_war = {
				ideology = ROOT
				size = 0.3
				capital = 1012
				states = {
					1012
				}
				PREV = {
					create_unit = {
						division = "name = \"Infantry Divison\" division_template = \"Reformed infantry\" start_experience_factor = 0.5"
						owner = TUN
					}
					create_unit = {
						division = "name = \"Infantry Divison\" division_template = \"Reformed infantry\" start_experience_factor = 0.5"
						owner = TUN
					}
					create_unit = {
						division = "name = \"Infantry Divison\" division_template = \"Reformed infantry\" start_experience_factor = 0.5"
						owner = TUN
					}
				}
			}
		}
		else_if = {
			limit = {
				check_variable = { Mejba_Revolt_var = 4 }
			}
			set_global_flag = TUN_mejba_revolt_started
			start_civil_war = {
				ideology = ROOT
				size = 0.3
				capital = 1012
				states = {
					1012
				}
				PREV = {
					create_unit = {
						division = "name = \"Infantry Divison\" division_template = \"Reformed infantry\" start_experience_factor = 0.5"
						owner = TUN
					}
					create_unit = {
						division = "name = \"Infantry Divison\" division_template = \"Reformed infantry\" start_experience_factor = 0.5"
						owner = TUN
					}
					create_unit = {
						division = "name = \"Infantry Divison\" division_template = \"Reformed infantry\" start_experience_factor = 0.5"
						owner = TUN
					}
					create_unit = {
						division = "name = \"Infantry Divison\" division_template = \"Reformed infantry\" start_experience_factor = 0.5"
						owner = TUN
					}
				}
			}
		}

		else_if = {
			limit = {
				check_variable = { Mejba_Revolt_var = 5 }
			}
			set_global_flag = TUN_mejba_revolt_started
			start_civil_war = {
				ideology = ROOT
				size = 0.3
				capital = 1012
				states = {
					1012
				}
				PREV = {
					create_unit = {
						division = "name = \"Infantry Divison\" division_template = \"Reformed infantry\" start_experience_factor = 0.5"
						owner = TUN
					}
					create_unit = {
						division = "name = \"Infantry Divison\" division_template = \"Reformed infantry\" start_experience_factor = 0.5"
						owner = TUN
					}
					create_unit = {
						division = "name = \"Infantry Divison\" division_template = \"Reformed infantry\" start_experience_factor = 0.5"
						owner = TUN
					}
					create_unit = {
						division = "name = \"Infantry Divison\" division_template = \"Reformed infantry\" start_experience_factor = 0.5"
						owner = TUN
					}
					create_unit = {
						division = "name = \"Infantry Divison\" division_template = \"Reformed infantry\" start_experience_factor = 0.5"
						owner = TUN
					}
				}
			}
		}

		else_if = {
			limit = {
				check_variable = { Mejba_Revolt_var = 6 }
			}
			set_global_flag = TUN_mejba_revolt_started
			start_civil_war = {
				ideology = ROOT
				size = 0.3
				capital = 1012
				states = {
					1012
				}
				PREV = {
					create_unit = {
						division = "name = \"Infantry Divison\" division_template = \"Reformed infantry\" start_experience_factor = 0.5"
						owner = TUN
					}
					create_unit = {
						division = "name = \"Infantry Divison\" division_template = \"Reformed infantry\" start_experience_factor = 0.5"
						owner = TUN
					}
					create_unit = {
						division = "name = \"Infantry Divison\" division_template = \"Reformed infantry\" start_experience_factor = 0.5"
						owner = TUN
					}
					create_unit = {
						division = "name = \"Infantry Divison\" division_template = \"Reformed infantry\" start_experience_factor = 0.5"
						owner = TUN
					}
					create_unit = {
						division = "name = \"Infantry Divison\" division_template = \"Reformed infantry\" start_experience_factor = 0.5"
						owner = TUN
					}
					create_unit = {
						division = "name = \"Infantry Divison\" division_template = \"Reformed infantry\" start_experience_factor = 0.5"
						owner = TUN
					}
				}
			}
		}

		else_if = {
			limit = {
				check_variable = { Mejba_Revolt_var = 7 }
			}
			set_global_flag = TUN_mejba_revolt_started
			start_civil_war = {
				ideology = ROOT
				size = 0.3
				capital = 1012
				states = {
					1012
				}
				PREV = {
					create_unit = {
						division = "name = \"Infantry Divison\" division_template = \"Reformed infantry\" start_experience_factor = 0.5"
						owner = TUN
					}
					create_unit = {
						division = "name = \"Infantry Divison\" division_template = \"Reformed infantry\" start_experience_factor = 0.5"
						owner = TUN
					}
					create_unit = {
						division = "name = \"Infantry Divison\" division_template = \"Reformed infantry\" start_experience_factor = 0.5"
						owner = TUN
					}
					create_unit = {
						division = "name = \"Infantry Divison\" division_template = \"Reformed infantry\" start_experience_factor = 0.5"
						owner = TUN
					}
					create_unit = {
						division = "name = \"Infantry Divison\" division_template = \"Reformed infantry\" start_experience_factor = 0.5"
						owner = TUN
					}
					create_unit = {
						division = "name = \"Infantry Divison\" division_template = \"Reformed infantry\" start_experience_factor = 0.5"
						owner = TUN
					}
					create_unit = {
						division = "name = \"Infantry Divison\" division_template = \"Reformed infantry\" start_experience_factor = 0.5"
						owner = TUN
					}
				}
			}
		}
		else_if = {
			limit = {
				check_variable = { Mejba_Revolt_var = 8 }
			}
			set_global_flag = TUN_mejba_revolt_started
			start_civil_war = {
				ideology = ROOT
				size = 0.3
				capital = 1012
				states = {
					1012
				}
				PREV = {
					create_unit = {
						division = "name = \"Infantry Divison\" division_template = \"Reformed infantry\" start_experience_factor = 0.5"
						owner = TUN
					}
					create_unit = {
						division = "name = \"Infantry Divison\" division_template = \"Reformed infantry\" start_experience_factor = 0.5"
						owner = TUN
					}
					create_unit = {
						division = "name = \"Infantry Divison\" division_template = \"Reformed infantry\" start_experience_factor = 0.5"
						owner = TUN
					}
					create_unit = {
						division = "name = \"Infantry Divison\" division_template = \"Reformed infantry\" start_experience_factor = 0.5"
						owner = TUN
					}
					create_unit = {
						division = "name = \"Infantry Divison\" division_template = \"Reformed infantry\" start_experience_factor = 0.5"
						owner = TUN
					}
					create_unit = {
						division = "name = \"Infantry Divison\" division_template = \"Reformed infantry\" start_experience_factor = 0.5"
						owner = TUN
					}
					create_unit = {
						division = "name = \"Infantry Divison\" division_template = \"Reformed infantry\" start_experience_factor = 0.5"
						owner = TUN
					}
					create_unit = {
						division = "name = \"Infantry Divison\" division_template = \"Reformed infantry\" start_experience_factor = 0.5"
						owner = TUN
					}
				}
			}
		}
		else = {
			set_global_flag = TUN_mejba_revolt_started
			start_civil_war = {
				ideology = ROOT
				size = 0.3
				capital = 1012
				states = {
					1012
				}
				PREV = {
					create_unit = {
						division = "name = \"Infantry Divison\" division_template = \"Reformed infantry\" start_experience_factor = 0.5"
						owner = TUN
					}
					create_unit = {
						division = "name = \"Infantry Divison\" division_template = \"Reformed infantry\" start_experience_factor = 0.5"
						owner = TUN
					}
					create_unit = {
						division = "name = \"Infantry Divison\" division_template = \"Reformed infantry\" start_experience_factor = 0.5"
						owner = TUN
					}
					create_unit = {
						division = "name = \"Infantry Divison\" division_template = \"Reformed infantry\" start_experience_factor = 0.5"
						owner = TUN
					}
					create_unit = {
						division = "name = \"Infantry Divison\" division_template = \"Reformed infantry\" start_experience_factor = 0.5"
						owner = TUN
					}
					create_unit = {
						division = "name = \"Infantry Divison\" division_template = \"Reformed infantry\" start_experience_factor = 0.5"
						owner = TUN
					}
					create_unit = {
						division = "name = \"Infantry Divison\" division_template = \"Reformed infantry\" start_experience_factor = 0.5"
						owner = TUN
					}
					create_unit = {
						division = "name = \"Infantry Divison\" division_template = \"Reformed infantry\" start_experience_factor = 0.5"
						owner = TUN
					}
					create_unit = {
						division = "name = \"Infantry Divison\" division_template = \"Reformed infantry\" start_experience_factor = 0.5"
						owner = TUN
					}
				}
			}
		}
	}
}
