namespace = islamic_revolt

country_event = {
	id = islamic_revolt.1
	title = "islamic_revolt.1.t"
	desc = "islamic_revolt.1.d"
	picture = RELIGIOUS_WARS_eventPicture
	
	major = yes
	
	is_triggered_only = yes

	mean_time_to_happen = {
		days = 1
	}

	immediate = {
		hidden_effect = { set_country_flag = active_islamic_revolt }
	}
	
	option = {
		name = "EVTOPTA2031"				# Eradicate the heretics to bring peace
		random_owned_province = {
			limit = {
				religion_group = muslim
				has_owner_religion = no
			}
			spawn_rebels = {
				type = religious_rebels
				size = 5
				win = yes
			}
		}
		random_owned_province = {
			limit = {
				religion_group = muslim
				has_owner_religion = no
			}
			spawn_rebels = {
				type = religious_rebels
				size = 5
				win = yes
			}
		}
		
		if = {
			limit = {
				has_disaster = islamic_revolt
			}
			add_country_modifier = {
				name = "per_islamic_revolt"
				duration = -1
				desc = "END_OF_REL_CIV_DIS"
			}
		}		
	}
	option = {
		name = "EVTOPTB2031"				# We should strive for a tolerant society
		if = {
			limit = {
				has_disaster =islamic_revolt
			}
			add_country_modifier = {
				name = "per_islamic_revolt_tolerant"
				duration = -1
				desc = "END_OF_REL_CIV_DIS"
			}
		}		
	}
}

# End of Religious Turmoil
country_event = {
	id = islamic_revolt.2
	title = "islamic_revolt.2.t"
	desc = "islamic_revolt.2.d"
	picture = RELIGIOUS_WARS_eventPicture
	
	major = yes
	
	is_triggered_only = yes

	immediate = {
		hidden_effect = { clr_country_flag = active_islamic_revolt }
	}


	mean_time_to_happen = {
		days = 1
	}
	
	
	option = {
		name = "islamic_revolt.2.a"				# One Faith
		add_stability_or_adm_power = yes
		set_country_flag = had_islamic_revolt
		remove_country_modifier = "per_islamic_revolt"
		remove_country_modifier = "per_islamic_revolt_tolerant"
		add_country_modifier = {
				name = "per_end_of_revolt"
				duration = 7300
	    }
	}	
}







# Intolerant society, large number of heretics
country_event = {
	id = islamic_revolt.3

	title = "EVTNAME2032"
	desc = "EVTDESC2032"
	picture = RELIGIOUS_WARS_eventPicture
	
	trigger = {
		has_country_modifier = per_islamic_revolt
	}
	
	is_triggered_only = yes
	mean_time_to_happen = {
		days = 1
	}
	
	
	option = {
		name = "EVTOPTA2032"		# Banish the nonconformists.
		ai_chance = { factor = 10 }
		random_province = {
        limit = {
				NOT = { religion = zoroastrian }
				owned_by = PER
				}
					
			spawn_rebels = {
				type = religious_rebels
				size = 2
			}
		}
	}
	option = {
		name = "EVTOPTB2032"		# Increase funding to convert the heretics.
		ai_chance = { factor = 90 }
		add_years_of_income = -0.25
	}
}

# Intolerant society
country_event = {
	id = islamic_revolt.4
	title = "EVTNAME2033"
	desc = "EVTDESC2033"
	picture = RELIGIOUS_WARS_eventPicture
	
	trigger = {
		has_country_modifier = per_islamic_revolt
	}
	
	is_triggered_only = yes
	mean_time_to_happen = {
		days = 1
	}
	
	option = {				# Increase funding to suppress the heretics.
		name = "EVTOPTA2033"
		add_years_of_income = -0.33
	}
	option = {				# Ignore them.
		name = "EVTOPTB2033"
		every_province = {
		limit = {
		        owned_by = PER
				NOT = { religion = zoroastrian }
				}
			add_unrest = 3
		}
	}
}

# Tolerant society
country_event = {
	id = islamic_revolt.5
	title = "EVTNAME2034"
	desc = "EVTDESC2034"
	picture = RELIGIOUS_WARS_eventPicture
	
	
	trigger = {
		has_country_modifier = per_islamic_revolt_tolerant
		any_heretic_province = {
			is_capital = no
			has_missionary = no
			can_spawn_rebels = religious_rebels
		}
	}
	
	
	is_triggered_only = yes
	mean_time_to_happen = {
		days = 1
	}	
	
	option = {
		name = "EVTOPTA2034"		# Subdue the heretics.
		ai_chance = { factor = 90 }
		random_province = {
			limit = {
			NOT = { religion = zoroastrian }
				has_missionary = no
				can_spawn_rebels = religious_rebels
			}
			religious_rebels = 3
		}		
	
	}
	option = {
		name = "EVTOPTB2034"		# Convert them.
		ai_chance = { factor = 10 }
		random_province = {
			limit = {
				is_capital = no
				has_missionary = no
				can_spawn_rebels = religious_rebels
				NOT = { religion = zoroastrian }
				owned_by = PER
			}
			add_years_of_income = -0.5
			change_religion = root	
			add_local_autonomy = 20
		}		
		
	}
}

# Tolerant society
country_event = {
	id = islamic_revolt.6
	title = "EVTNAME2035"
	desc = "EVTDESC2035"
	picture = RELIGIOUS_WARS_eventPicture
	
	trigger = {
		has_country_modifier = per_islamic_revolt_tolerant
	}
	
	is_triggered_only = yes
	mean_time_to_happen = {
		days = 1
	}
	
	option = {
		name = "EVTOPTA2035"		# Our time is better spent elsewhere
		every_province = {
		limit = {
				NOT = { religion = zoroastrian }
				owned_by = PER
				}
			add_unrest = 1
		}
		random_province = {
		limit = {
				NOT = { religion = zoroastrian }
				owned_by = PER
				}
			religious_rebels = 3
		}
	}
	option = {
		name = "EVTOPTB2035"		# Issue a new edict
		add_adm_power = -25
		add_dip_power = -25
		add_mil_power = -25
	}
}

country_event = {
	id = islamic_revolt.7
	title = "islamic_revolt.7.t"
	desc = "islamic_revolt.7.d"
	picture = RELIGIOUS_WARS_eventPicture
	
	trigger = {
		has_country_modifier = per_islamic_revolt
	}
	
	is_triggered_only = yes
	mean_time_to_happen = {
		days = 1
	}
	
	option = {
		name = "islamic_revolt.7.a"		# Our time is better spent elsewhere
		random_province = {
		limit = {
				NOT = { religion = zoroastrian }
				owned_by = ROOT
				}
			change_religion = zoroastrian
		}
		add_manpower = 8
	}
	
	option = {
		name = "islamic_revolt.7.b"		# Our time is better spent elsewhere
		random_province = {
		limit = {
				NOT = { religion = zoroastrian }
				owned_by = ROOT
				}
			change_religion = zoroastrian
		}
		add_years_of_income = 0.20
	}
}


