add_namespace = morocco

###########################
# Moroccan Events
###########################

##Event: Abd al Rahman dies!
country_event = {
	id = morocco.1
	title = morocco.1.t
	desc = morocco.1.d
	picture = GFX_report_event_mor_muhammad
	fire_only_once = yes

	is_triggered_only = yes
	option = {
		name = morocco.1.a
		ai_chance = { factor = 1}
		kill_country_leader= yes
		remove_unit_leader= 2020
		create_country_leader= {
 			name = "Muhammad IV" 
			desc = "POLITICS_GEORGE_V_DESC"
			picture = "GFX_Portrait_MOR_Muhammad_Ibn_Abderrahamae_Alawite"
			expire = "1873.9.16"
			ideology = despotism 
			traits = {
			}
		}
	}
}

#Event: Unsanctioned Raid on Spain
country_event = {
	id = morocco.2
	title = morocco.2.t
	desc = morocco.2.d
	fire_only_once = yes
	is_triggered_only = yes
	
	option = {
		name = morocco.2.a
		ai_chance = { base = 100}
		MOR = {
			add_political_power = -50
			add_stability = -5
		}
		hidden_effect = { 
			SPR = { set_country_flag = SPR_deal_with_the_sultan_flag } 
			SPR = { complete_national_focus = SPR_deal_with_the_sultan }
		}
	}
}

#Event: UBL Railway Offer
country_event = {
	id = morocco.3
	title = morocco.3.t
	desc = morocco.3.d
	fire_only_once = yes
	is_triggered_only = yes
	
	option = {
		name = morocco.3.a #Reject the offer
		ai_chance = { base = 100}
		MOR = {
			
		}
		hidden_effect = { 
			complete_national_focus = MOR_reject
		}
	}
	option = {
		name = morocco.3.b  #Begin constructing the railway lines
		ai_chance = { base = 100}
		MOR = {
			
		}
		hidden_effect = { 
			complete_national_focus = MOR_begin_construction_railline
		}
	}
}

#Event: Fabric market in Marrakesh
country_event = {
	id = morocco.4
	title = morocco.4.t
	desc = morocco.4.d
	fire_only_once = yes
	is_triggered_only = yes
	
	option = {
		name = morocco.4.a #This will make us rich
		ai_chance = { base = 100}
		unlock_decision_tooltip = MOR_decision_berber_jewelry_market
		add_resource = {
			type = fabric
			amount = 2
			state = 462
		}
		set_country_flag = MOR_berber_market
		hidden_effect = { 
			
		}
	}
}

#Event: Time to Redo the Administration
country_event = {
	id = morocco.5
	title = morocco.5.t
	desc = morocco.5.d
	fire_only_once = yes
	is_triggered_only = yes
	
	option = {
		name = morocco.5.a #We shall destroy corruption
		ai_chance = { base = 100}
		add_timed_idea = {
			idea = MOR_idea_administration_overhaul
			days = 1095
		}
		hidden_effect = { 
			
		}
	}
}

#Event: The arrival of the Drummond-Hays plan
country_event = {
	id = morocco.6
	title = morocco.6.t
	desc = morocco.6.d
	fire_only_once = yes
	is_triggered_only = yes
	
	option = {
		name = morocco.6.a #Down with Corruption
		ai_chance = { base = 100}
		remove_ideas = {
			MOR_rampant_corruption
		}
		hidden_effect = { 
			
		}
	}
}

#Event: Judicial Reform
country_event = {
	id = morocco.7
	title = morocco.7.t
	desc = morocco.7.d
	fire_only_once = yes
	is_triggered_only = yes
	
	option = {
		name = morocco.7.a #Enact Judicial Reforms
		ai_chance = { base = 100}
		add_stability = 0.05
		add_political_power = 25
		hidden_effect = { 
			
		}
	}
}

#Event: Begin General Centralization
country_event = {
	id = morocco.8
	title = morocco.8.t
	desc = morocco.8.d
	fire_only_once = yes
	is_triggered_only = yes
	
	option = {
		name = morocco.8.a #Begin Qaidization
		ai_chance = { base = 100}
		complete_national_focus = MOR_begin_qaidization
		add_political_power = 50
		add_stability = -0.03
		hidden_effect = { 
			
		}
	}

	option = {
		name = morocco.8.b #Decentralization
		ai_chance = { base = 100}
		complete_national_focus = MOR_decentralization
		add_political_power = -50
		add_stability = 0.03
		hidden_effect = { 
			
		}
	}
}

#Event: Respecting the authority of local leaders
country_event = {
	id = morocco.9
	title = morocco.9.t
	desc = morocco.9.d
	fire_only_once = yes
	is_triggered_only = yes
	
	option = {
		name = morocco.9.a #We shall cooperrate with them
		ai_chance = { base = 100}
		decrease_legitimacy_by_five = yes
		add_stability = 0.03
		hidden_effect = { 
			
		}
	}
}

#Event: We will start training our own local leaders
country_event = {
	id = morocco.10
	title = morocco.10.t
	desc = morocco.10.d
	fire_only_once = yes
	is_triggered_only = yes
	
	option = {
		name = morocco.10.a #This will bring prosperity to our country
		ai_chance = { base = 100}
		add_timed_idea = {
			idea = MOR_idea_qaid_training
			days = 365
		}
		hidden_effect = { 
			
		}
	}
}

#Event: Delay the Naval Reforms
country_event = {
	id = morocco.11
	title = morocco.11.t
	desc = morocco.11.d
	fire_only_once = yes
	is_triggered_only = yes
	
	option = {
		name = morocco.11.a #We need this money elsewhere
		ai_chance = { base = 100}
		custom_effect_tooltip = MOR_tt_naval_reform
		set_country_flag = MOR_naval_reform_delayed
		hidden_effect = { 
			country_event = {
				id = morocco.12
				days = 720
			}
		}
	}
}

#Event: Navy another day
country_event = {
	id = morocco.12
	title = morocco.12.t
	desc = morocco.12.d
	fire_only_once = yes
	is_triggered_only = yes
	
	option = {
		name = morocco.12.a #We have the money now
		ai_chance = { base = 100}
		clr_country_flag = MOR_naval_reform_delayed
		set_temp_variable = { money_to_gain = 5 }
		add_money_with_tooltip_effect = yes
		complete_national_focus =  MOR_additional_funds_treasury
		hidden_effect = { 
		}
	}
}

#Event: A New Navy...
country_event = {
	id = morocco.13
	title = morocco.13.t
	desc = morocco.13.d
	fire_only_once = yes
	is_triggered_only = yes
	
	option = {
		name = morocco.13.a #We shall rule the wawes of Africa
		ai_chance = { base = 100}
		remove_ideas = {
			MOR_mothballed_navy
		}
		hidden_effect = { 
		}
	}
}
### Jewish Event Chain (Flavour events)###

#Event: Mellah of Teutan Sacked
news_event = {
	id = morocco.14
	title = morocco.14.t
	desc = morocco.14.d
	fire_only_once = yes
	is_triggered_only = yes
	trigger = {
		AND = {
			date > 1860.2.4
			has_country_flag = SPR_morocco_expedition_morocco_invades
		}
	}
	
	option = {
		name = morocco.14.a #Okay
		ai_chance = { base = 100}
		hidden_effect = { 
		}
	}
}
#Event:  Moses Montefiore and the Morocco Relief committee collect over 14,000 pounds for Jews in Morocco. (1859 12 1) -> Fires for ENG and MOR
news_event = {
	id = morocco.15
	title = morocco.15.t
	desc = morocco.15.d
	fire_only_once = yes
	is_triggered_only = yes
	
	option = {
		name = morocco.15.a #Okay
		ai_chance = { base = 100}
		hidden_effect = { 
		}
	}
}
#Event:  Moses Montefiore hears about the boy executed in Saffi, and the man executed in Tangier. The Hay mission prepares to assist Jewish victims of persecution. (1863 6 11) -> Fires for ENG and MOR
news_event = {
	id = morocco.16
	title = morocco.16.t
	desc = morocco.16.d
	fire_only_once = yes
	is_triggered_only = yes
	
	option = {
		name = morocco.16.a #Okay
		ai_chance = { base = 100}
		hidden_effect = { 
		}
	}
}
#Event:  Spanish authorities in Saffi torture and execute a Jewish boy suspected of Murder and another Jewish man. (1863 6 7) -> Fires for SPR and MOR
news_event = {
	id = morocco.17
	title = morocco.17.t
	desc = morocco.17.d
	fire_only_once = yes
	is_triggered_only = yes
	
	option = {
		name = morocco.17.a #Okay
		ai_chance = { base = 100}
		hidden_effect = { 
		}
	}
}

#Event: Moses Montefiore gets a letter of distress from Jews in Gibraltar (1863 10 31) -> Fires for ENG and MOR
news_event = {
	id = morocco.18
	title = morocco.18.t
	desc = morocco.18.d
	fire_only_once = yes
	is_triggered_only = yes
	
	option = {
		name = morocco.18.a #Okay
		ai_chance = { base = 100}
		hidden_effect = { 
		}
	}
}

#Event: Moses Montefiore gets a letter of distress from Jews in Gibraltar (1863 11 17) -> Fires for ENG and MOR
news_event = {
	id = morocco.19
	title = morocco.19.t
	desc = morocco.19.d
	fire_only_once = yes
	is_triggered_only = yes
	
	option = {
		name = morocco.19.a #Okay
		ai_chance = { base = 100}
		hidden_effect = { 
		}
	}
}

#Event: Sir Moses arrives in Madrid (1863 11 23) -> Fires for ENG and SPR
news_event = {
	id = morocco.20
	title = morocco.20.t
	desc = morocco.20.d
	fire_only_once = yes
	is_triggered_only = yes
	
	option = {
		name = morocco.20.a #Okay
		ai_chance = { base = 100}
		hidden_effect = { 
		}
	}
}

#Event:  Sir Moses received by the Queen of Spain (1863 11 28) -> Fires for ENG and SPR
news_event = {
	id = morocco.21
	title = morocco.21.t
	desc = morocco.21.d
	fire_only_once = yes
	is_triggered_only = yes
	
	option = {
		name = morocco.21.a #Support him
		ai_chance = { base = 200}
		if = {
			limit = {
				TAG  = SPR
			}
			add_opinion_modifier = {
				target = ENG
				modifier = large_increase
			}
		}
		else = {
			add_opinion_modifier = {
				target = SPR
				modifier = large_increase
			}
		}
		hidden_effect = { 
		}
	}
	option = {
		name = morocco.21.b #Decline him
		ai_chance = { base = 100}
		add_political_power = 25
		if = {
			limit = {
				TAG = SPR
			}
			add_opinion_modifier = {
				target = ENG
				modifier = small_decrease
			}
		}
		else = {
			ENG = {
				add_opinion_modifier = {
					target = SPR
					modifier = small_decrease
				}
			}
		}
		hidden_effect = { 
		}
	}
}

#Event: Sir Moses arrives in Tangier and meets with the Hay Mission. 2 Jewish Prisoners are released by the Spanish minister at Tangier. (1863 12 13) -> Fires for ENG and SPR
news_event = {
	id = morocco.22
	title = morocco.22.t
	desc = morocco.22.d
	fire_only_once = yes
	is_triggered_only = yes
	
	option = {
		name = morocco.22.a #Okay
		ai_chance = { base = 100}
		if = {
			limit = {
				TAG = SPR
			}
			add_opinion_modifier = {
				target = ENG
				modifier = small_increase
			}
		}
		else = {
			ENG = {
				add_opinion_modifier = {
					target = SPR
					modifier = small_increase
				}
			}
		}
		hidden_effect = { 
		}
	}
}

#Event:  Sir Moses received by the Sultan (1864 2 1) -> Fires for ENG and MOR
news_event = {
	id = morocco.23
	title = morocco.23.t
	desc = morocco.23.d
	fire_only_once = yes
	is_triggered_only = yes
	
	option = {
		name = morocco.23.a #Okay
		ai_chance = { base = 100}
		hidden_effect = { 
		}
	}
}

#Event:   The Sultan pledges to support the Jews of Morocco.(1864 2 5) -> Fires for ENG and MOR
news_event = {
	id = morocco.24
	title = morocco.24.t
	desc = morocco.24.d
	fire_only_once = yes
	is_triggered_only = yes
	
	option = {
		name = morocco.24.a #Okay
		ai_chance = { base = 100}
		hidden_effect = { 
		}
	}
}

#Event:   Sultan decides whether or not to issue the decree (1864 2 15) -> Fires for MOR
news_event = {
	id = morocco.25
	title = morocco.25.t
	desc = morocco.25.d
	fire_only_once = yes
	is_triggered_only = yes
	
	option = {
		name = morocco.25.a #Support this idea
		ai_chance = { base = 100}
		add_stability = -0.05
		add_opinion_modifier = {
			target = ENG
			modifier = large_increase
		}
		ENG = {
			add_opinion_modifier = {
				target = MOR
				modifier = large_increase
			}
		}
		hidden_effect = { 
			ENG = {
				news_event = {
					id = morocco.26
					days = 10
				}
			}
			SPR = {
				news_event = {
					id = morocco.26
					days = 10
				}
			}
		}
	}

	option = {
		name = morocco.25.b #This would just lead to unrest
		ai_chance = { base = 100}
		add_political_power = 50
		add_opinion_modifier = {
			target = ENG
			modifier = medium_decrease
		}
		ENG = {
			add_opinion_modifier = {
				target = MOR
				modifier = medium_decrease
			}
		}
		

		hidden_effect = { 
			ENG = {
				news_event = {
					id = morocco.27
					days = 10
				}
			}
			SPR = {
				news_event = {
					id = morocco.27
					days = 10
				}
			}
		}
	}
}

#Event:   The Sultan supports the Jews
news_event = {
	id = morocco.26
	title = morocco.26.t
	desc = morocco.26.d
	fire_only_once = yes
	is_triggered_only = yes
	
	option = {
		name = morocco.26.a #Okay
		ai_chance = { base = 100}
		hidden_effect = { 
		}
	}
}

#Event:   The Sultan declines support for the Jews
news_event = {
	id = morocco.27
	title = morocco.27.t
	desc = morocco.27.d
	fire_only_once = yes
	is_triggered_only = yes
	
	option = {
		name = morocco.27.a #Okay
		ai_chance = { base = 100}
		hidden_effect = { 
		}
	}
}

#Event:  Hotel Cecil built in Tangier
news_event = {
	id = morocco.28
	title = morocco.28.t
	desc = morocco.28.d
	fire_only_once = yes
	is_triggered_only = yes
	
	option = {
		name = morocco.28.a #Okay
		ai_chance = { base = 100}
		hidden_effect = { 
		}
	}
}

#Event:  Hotel Continental built in Tangier
news_event = {
	id = morocco.29
	title = morocco.29.t
	desc = morocco.29.d
	fire_only_once = yes
	is_triggered_only = yes
	
	option = {
		name = morocco.29.a #Okay
		ai_chance = { base = 100}
		hidden_effect = { 
		}
	}
}

#Event:  El Eco de Teutan
news_event = {
	id = morocco.30
	title = morocco.30.t
	desc = morocco.30.d
	fire_only_once = yes
	is_triggered_only = yes
	
	option = {
		name = morocco.30.a #Okay
		ai_chance = { base = 100}
		hidden_effect = { 
		}
	}
}

#Event:  Ulema Revolt - at the start of the game
country_event = {
	id = morocco.31
	title = morocco.31.t
	desc = morocco.31.d
	fire_only_once = yes
	is_triggered_only = yes
	
	option = {
		name = morocco.31.a #What do we do about it?
		ai_chance = { base = 100}
		hidden_effect = { 
		}

		set_power_balance = {
			id = MOR_Balance_of_Power_Ulema_Unrest
			left_side = MOR_BOP_Ulema_Strength
			right_side = MOR_BOP_Goverment_Strength
		
			set_value = 0.15
		}
	}
}