# Time of Troubles
country_event = {

	id = 3001
	
	trigger = {
		NOT = { has_country_flag = time_of_troubles }
		NOT = { centralization_decentralization = -2 }
		NOT = { aristocracy_plutocracy = -2 }
		NOT = { serfdom_freesubjects = -2 }
		war = yes
	}
	
	mean_time_to_happen = {
		months = 432
		
		modifier = {
			factor = 0.9
			NOT = { aristocracy_plutocracy = -3 }
		}
		modifier = {
			factor = 0.9
			NOT = { aristocracy_plutocracy = -4 }
		}		
		modifier = {
			factor = 0.9
			NOT = { centralization_decentralization = -3 }
		}
		modifier = {
			factor = 0.9
			NOT = { serfdom_freesubjects = -3 }
		}
		modifier = {
			factor = 0.9
			NOT = { serfdom_freesubjects = -4 }
		}
		modifier = {
			factor = 0.6
			revolt_percentage = 0.1
		}
		modifier = {
			factor = 0.9
			NOT = { stability = 0 }
		}
		modifier = {
			factor = 0.9
			NOT = { stability = -1 }
		}
		modifier = {
			factor = 0.9
			NOT = { stability = -2 }
		}
		modifier = {
			factor = 1.1
			stability = 1
		}
		modifier = {
			factor = 1.1
			stability = 2
		}
		modifier = {
			factor = 1.1
			stability = 3
		}
	}
	
	title = "EVTNAME3001"
	desc = "EVTDESC3001"
	
	option = {
		name = "EVTOPTA3001"			# Dire times are ahead of us
		set_country_flag = time_of_troubles
		stability = -2	
	}
}


# Religious struggles
province_event = {

	id = 3002
	
	trigger = {
		owner = {
			has_country_flag = time_of_troubles 
			NOT = { has_country_flag = religious_struggles }
			NOT = { religion = THIS }
			war = yes
		}
	}

	mean_time_to_happen = {
		months = 36

		modifier = {
			factor = 0.9
			owner = {
				NOT = { protestant = 0 }
			}
		}
		modifier = {
			factor = 0.9
			owner = {
				NOT = { reformed = 0 }
			}
		}
		modifier = {
			factor = 1.1
			owner = {
				NOT = { protestant = -2 }
			}
		}
		modifier = {
			factor = 1.1
			owner = {
				NOT = { reformed = -2 }
			}
		}
		
		modifier = {
			factor = 1.2
			owner = {
				protestant = 1
			}
		}
		modifier = {
			factor = 1.2
			owner = {
				reformed = 1
			}
		}
		modifier = {
			factor = 0.9
			owner = {
				revolt_percentage = 0.1
			}
		}
		modifier = {
			factor = 0.8
			owner = {
				revolt_percentage = 0.2
			}
		}
		modifier = {
			factor = 0.7
			owner = {
				revolt_percentage = 0.3
			}
		}	
		modifier = {
			factor = 0.9
			owner = { NOT = { stability = 0 } }
		}
		modifier = {
			factor = 0.9
			owner = { NOT = { stability = -1 } }
		}
		modifier = {
			factor = 0.9
			owner = { NOT = { stability = -2 } }
		}
		modifier = {
			factor = 1.1
			owner = { stability = 1 }
		}
		modifier = {
			factor = 1.1
			owner = { stability = 2 }
		}
		modifier = {
			factor = 1.1
			owner = { stability = 3 }
		}
	}
	
	title = "EVTNAME3002"
	desc = "EVTDESC3002"
	
	option = {
		name = "EVTOPTA3002"			# One nation, one belief!
		ai_chance = { factor = 55 }
		owner = {
			set_country_flag = religious_struggles
			missionaries = 1
			add_country_modifier = {
				name = "religious_intolerance"
				duration = 720
			}
		}
	}
	option = {
		name = "EVTOPTB3002"			# Tolerate all beliefs
		ai_chance = { factor = 45 }
		owner = {
			set_country_flag = religious_struggles
			missionaries = -1
			add_country_modifier = {
				name = "religious_tolerance"
				duration = 720
			}
		}
	}
}


# National instability
country_event = {

	id = 3003
	
	trigger = {
		has_country_flag = time_of_troubles
		NOT = { has_country_flag = national_instability }
		NOT = { stability = 0 }
		war = yes
	}
	
	mean_time_to_happen = {
		months = 32

		modifier = {
			factor = 0.95
			NOT = { stability = -1 }
		}	
		modifier = {
			factor = 0.85
			NOT = { stability = -2 }
		}
		modifier = {
			factor = 0.85
			revolt_percentage = 0.4
		}
		modifier = {
			factor = 0.85
			revolt_percentage = 0.5
		}
		modifier = {
			factor = 0.85
			revolt_percentage = 0.6
		}
		modifier = {
			factor = 0.95
			war_exhaustion = 2
		}
		modifier = {
			factor = 0.85
			war_exhaustion = 4
		}
	}
	
	title = "EVTNAME3003"
	desc = "EVTDESC3003"
	
	option = {
		name = "EVTOPTA3003"			# The war is our main concern
		ai_chance = { factor = 65 }
		set_country_flag = national_instability
		add_country_modifier = {
			name = "decreased_morale"
			duration = 720
		}
	}
	option = {
		name = "EVTOPTB3003"			# Our domestic problems are our main concern
		ai_chance = { factor = 35 }
		set_country_flag = national_instability
		treasury = -100
		add_country_modifier = {
			name = "domestic_improvements"
			duration = 720
		}
	}
}


# Unrest among the peasants
country_event = {

	id = 3004
	
	trigger = {
		has_country_flag = time_of_troubles
		NOT = { has_country_flag = unrest }
	}
	
	mean_time_to_happen = {
		months = 30

		modifier = {
			factor = 0.95
			NOT = { serfdom_freesubjects = -4 }
		}
		modifier = {
			factor = 0.95
			revolt_percentage = 0.1
		}
		modifier = {
			factor = 0.95
			revolt_percentage = 0.2
		}
		modifier = {
			factor = 0.95
			revolt_percentage = 0.3
		}
		modifier = {
			factor = 0.9
			NOT = { stability = 0 }
		}
		modifier = {
			factor = 0.9
			NOT = { stability = -1 }
		}
		modifier = {
			factor = 0.9
			NOT = { stability = -2 }
		}
		modifier = {
			factor = 1.1
			stability = 1
		}
		modifier = {
			factor = 1.1
			stability = 2
		}
		modifier = {
			factor = 1.1
			stability = 3
		}
	}
	
	title = "EVTNAME3004"
	desc = "EVTDESC3004"
	
	option = {
		name = "EVTOPTA3004"			# Restrict serfdom
		ai_chance = { factor = 60 }
		set_country_flag = unrest
		serfdom_freesubjects = 2
		add_country_modifier = {
			name = "restrict_serfdom"
			duration = 720
		}
	}
	option = {
		name = "EVTOPTB3004"			# Keep the masses in chains
		ai_chance = { factor = 40 }
		set_country_flag = unrest
		serfdom_freesubjects = -2
		random_owned = { create_revolt = 1 }
		add_country_modifier = {
			name = "enforce_serfdom"
			duration = 720
		}
	}
}


# War exhaustion
country_event = {

	id = 3005
	
	trigger = {
		has_country_flag = time_of_troubles
		NOT = { has_country_flag = war_exhuastion }		
		war_exhaustion = 5
		wartax = yes
	}
	
	mean_time_to_happen = {
		months = 28
		
		modifier = {
			factor = 0.9
			war_exhaustion = 6
		}
		modifier = {
			factor = 0.9
			war_exhaustion = 7
		}
		modifier = {
			factor = 0.9
			war_exhaustion = 8
		}
		modifier = {
			factor = 0.8
			revolt_percentage = 0.1
		}		
		modifier = {
			factor = 0.8
			revolt_percentage = 0.2
		}		
		modifier = {
			factor = 0.8
			revolt_percentage = 0.3
		}
		modifier = {
			factor = 0.9
			NOT = { stability = 0 }
		}
		modifier = {
			factor = 0.9
			NOT = { stability = -1 }
		}
		modifier = {
			factor = 0.9
			NOT = { stability = -2 }
		}
		modifier = {
			factor = 1.1
			stability = 1
		}
		modifier = {
			factor = 1.1
			stability = 2
		}
		modifier = {
			factor = 1.1
			stability = 3
		}
	}
	
	title = "EVTNAME3005"
	desc = "EVTDESC3005"
	
	option = {
		name = "EVTOPTA3005"			# There is no immediate solution at hand
		ai_chance = { factor = 40 }
		set_country_flag = war_exhuastion
		add_country_modifier = {
			name = "decreased_morale"
			duration = 720
		}
	}
	
	option = {
		name = "EVTOPTB3005"			# Let their voices be heard
		ai_chance = { factor = 60 }
		set_country_flag = war_exhuastion
		add_country_modifier = {
			name = "disarmament"
			duration = 720
		}
	}
}


# Inefficient ruler
country_event = {

	id = 3006
	
	trigger = {
		has_country_flag = time_of_troubles
		NOT = { has_country_flag = inefficient_ruler }		
		NOT = { ADM = 4 }
		NOT = { MIL = 4}
	}
	
	mean_time_to_happen = {
		months = 24

		modifier = {
			factor = 0.9
			NOT = { stability = 0 }
		}
		modifier = {
			factor = 0.9
			NOT = { stability = -1 }
		}
		modifier = {
			factor = 0.9
			NOT = { stability = -2 }
		}
		modifier = {
			factor = 1.1
			stability = 1
		}
		modifier = {
			factor = 1.1
			stability = 2
		}
		modifier = {
			factor = 1.1
			stability = 3
		}
	}
	
	title = "EVTNAME3006"
	desc = "EVTDESC3006"
	
	option = {
		name = "EVTOPTA3006"			# Leave the nation's fate in his hands
		ai_chance = { factor = 40 }
		set_country_flag = inefficient_ruler
		add_country_modifier = {
			name = "support_monarch"
			duration = 720
		}
	}
	option = {
		name = "EVTOPTB3006"			# Oppose him
		ai_chance = { factor = 60 }
		set_country_flag = inefficient_ruler
		random_owned = { create_revolt = 1 }
		add_country_modifier = {
			name = "oppose_monarch"
			duration = 720
		}
	}
}


# Famine
country_event = {

	id = 3007
	
	trigger = {
		has_country_flag = time_of_troubles
		NOT = { has_country_flag = famine }
		grain = 3
		NOT = { stability = 0 }
	}
	
	mean_time_to_happen = {
		months = 24
		
		modifier = {
			factor = 0.9
			revolt_percentage = 0.1 
		}
		modifier = {
			factor = 0.9
			revolt_percentage = 0.3
		}
		modifier = {
			factor = 0.9
			grain = 4
		}
		modifier = {
			factor = 0.9
			NOT = { production_efficiency = 0.5 }
		}
		modifier = {
			factor = 0.9
			NOT = { production_efficiency = 0.4 }
		}
		modifier = {
			factor = 0.9
			NOT = { stability = -1 }
		}		
		modifier = {
			factor = 0.9
			NOT = { stability = -2 }
		}
	}
	
	title = "EVTNAME3007"
	desc = "EVTDESC3007"
	
	option = {
		name = "EVTOPTA3007"			# Try to alleviate the suffering
		ai_chance = { factor = 40 }
		set_country_flag = famine
		treasury = -60
		add_country_modifier = {
			name = "alleviate_population"
			duration = 720
		}
	}
	option = {
		name = "EVTOPTB3007"			# We are helpless in the face of such a disaster...
		ai_chance = { factor = 60 }
		set_country_flag = famine
		random_owned = {
			limit = { citysize = 2000 }
			citysize = -1000
		}
		add_country_modifier = {
			name = "starvation"
			duration = 720
		}
	}
}


# Stability returns
country_event = {

	id = 3008
	
	trigger = {
		has_country_flag = time_of_troubles
		NOT = { num_of_revolts = 1 }
		war = no
		stability = 1
	}
	
	mean_time_to_happen = {
		months = 84
				
		modifier = {
			factor = 0.9
			MIL = 6
		}
		modifier = {
			factor = 0.8
			MIL = 7
		}
		modifier = {
			factor = 1.1
			NOT = { MIL = 6 }
		}	
		modifier = {
			factor = 1.2
			NOT = { MIL = 5 }
		}
		modifier = {
			factor = 0.9
			ADM = 6
		}	
		modifier = {
			factor = 0.8
			ADM = 7
		}
		modifier = {
			factor = 1.1
			NOT = { ADM = 6 }
		}	
		modifier = {
			factor = 1.2
			NOT = { ADM = 5 }
		}
		modifier = {
			factor = 0.9
			statesman = 5
		}
		modifier = {
			factor = 0.8
			statesman = 6
		}
		modifier = {
			factor = 1.1
			NOT = { statesman = 5 }
		}
		modifier = {
			factor = 1.2
			NOT = { statesman = 4 }
		}
		modifier = {
			factor = 0.9
			stability = 1
		}
		modifier = {
			factor = 0.9
			stability = 2
		}
		modifier = {
			factor = 0.9
			stability = 3
		}
		modifier = {
			factor = 1.1
			NOT = { stability = 0 }
		}
		modifier = {
			factor = 1.1
			NOT = { stability = -1 }
		}
		modifier = {
			factor = 1.1
			NOT = { stability = -2 }
		}
	}
	
	title = "EVTNAME3008"
	desc = "EVTDESC3008"
	
	option = {
		name = "EVTOPTA3008"			# Restore order
		clr_country_flag = time_of_troubles
		clr_country_flag = religious_struggles
		clr_country_flag = national_instability
		clr_country_flag = unrest
		clr_country_flag = war_exhuastion
		clr_country_flag = famine
		clr_country_flag = inefficient_ruler
		stability = 2
	}
}
