################################
#  CRIMINAL ENTERPRISE SERIES  #
################################

#################################
# Thieves Guild operates in X	#
#################################

province_event = {
	id = 1053
	
	picture = "event_crime"
	
	trigger = { 
		condition = { 
			type = not 
			value = {
				type = has_improvement
				value = { thieves_guild = yes }
			}
		}
	}

	mean_time_to_happen = {
		months = 240

		modifier = {
			condition = { type = trait value = merciful }
			factor = 0.9
		}
		modifier = {
			condition = { type = has_improvement value = { court_of_justice = yes } }
			factor = 5.0
		}
		modifier = { 
			condition = { type = regiment_mobilized }
			factor = 0.5
		}
	}
	
	action_a = {
		effect = { type = add_improvement value = thieves_guild }
	}
	
}
#################################
# Smugglers Ring operates in X	#
#################################

province_event = {
	id = 1054
	
	picture = "event_crime"
	
	trigger = { 
		condition = { 
			type = not 
			value = {
				type = has_improvement
				value = { smugglers_ring = yes }
			}
		}
		condition = { 
					type = has_improvement
					value = { thieves_guild = yes }
		}
	}

	mean_time_to_happen = {
		months = 240

		modifier = {
			condition = { type = trait value = merciful }
			factor = 0.9
		}
		modifier = {
			condition = { type = has_improvement value = { court_of_justice = yes } }
			factor = 5.0
		}
		modifier = { 
			condition = { type = regiment_mobilized }
			factor = 0.5
		}
	}
	
	action_a = {
		effect = { type = add_improvement value = smugglers_ring }
	}
	
}
#####################################
# Highway Robber Band operates in X	#
#####################################

province_event = {
	id = 1055
	
	picture = "event_crime"
	
	trigger = { 
		condition = { 
			type = not 
			value = {
				type = has_improvement
				value = { highway_robber_band = yes }
			}
		}
		condition = { 
					type = has_improvement
					value = { smugglers_ring = yes }
		}
	}

	mean_time_to_happen = {
		months = 240

		modifier = {
			condition = { type = trait value = merciful }
			factor = 0.9
		}
		modifier = {
			condition = { type = has_improvement value = { court_of_justice = yes } }
			factor = 5.0
		}
		modifier = { 
			condition = { type = regiment_mobilized }
			factor = 0.5
		}
	}
	
	action_a = {
		effect = { type = add_improvement value = highway_robber_band }
	}
	
} 
#################################
# Thieves Guild up in X	        #
#################################

province_event = {
	id = 1056
	
	picture = "event_crime"
	
	trigger = { 
		condition = { 
					type = has_improvement
					value = { thieves_guild = yes }
		}
		condition = { 
					type = not
					value = {
						type = regiment_mobilized
					}
		}
	}

	mean_time_to_happen = {
		months = 240

		modifier = {
			condition = { type = trait value = merciful }
			factor = 1.1
		}
		modifier = {
			condition = { type = has_improvement value = { court_of_justice = yes } }
			factor = 0.1
		}
	}
	
	action_a = {
		effect = { type = remove_improvement value = thieves_guild }
	}
	
}
#########################################
# Smugglers Ring broken up in X	        #
#########################################

province_event = {
	id = 1057
	
	picture = "event_crime"
	
	trigger = { 
		condition = { 
					type = has_improvement
					value = { smugglers_ring = yes }
		}
		condition = { 
					type = not
					value = {
						type = regiment_mobilized
					}
		}
	}

	mean_time_to_happen = {
		months = 240

		modifier = {
			condition = { type = trait value = merciful }
			factor = 1.1
		}
		modifier = {
			condition = { type = has_improvement value = { court_of_justice = yes } }
			factor = 0.1
		}
	}
	
	action_a = {
		effect = { type = remove_improvement value = smugglers_ring }
	}
	
}
#########################################
# Highway Robber Band broken up in X	#
#########################################

province_event = {
	id = 1058
	
	picture = "event_crime"
	
	trigger = { 
		condition = { 
					type = has_improvement
					value = { highway_robber_band = yes }
		}
		condition = { 
					type = not
					value = {
						type = regiment_mobilized
					}
		}
	}

	mean_time_to_happen = {
		months = 240

		modifier = {
			condition = { type = trait value = merciful }
			factor = 1.1
		}
		modifier = {
			condition = { type = has_improvement value = { court_of_justice = yes } }
			factor = 0.1
		}
	}
	
	action_a = {
		effect = { type = remove_improvement value = highway_robber_band }
	}
	
}
################################
#  AGRICULTURAL CHANGE SERIES  #
################################

###############################
# Inadequate soil preparation #
###############################

province_event = {
	id = 1059
	
	picture = "event_agriculture"
	
	trigger = {
		condition = {
			type = not
			value = { type = has_province_effect value = { struggling = yes } }
		}
	}

	mean_time_to_happen = {
		months = 900

		modifier = {
			condition = { type = not value = { type = ruler_stewardship value = 3 } }
			factor = 0.8
		}
		modifier = {
			condition = { type = ruler_stewardship value = 3 }
			condition = { type = not value = { type = ruler_stewardship value = 5 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = ruler_stewardship value = 7 }
			condition = { type = not value = { type = ruler_stewardship value = 9 } }
			factor = 1.05
		}
		modifier = {
			condition = { type = ruler_stewardship value = 9 }
			condition = { type = not value = { type = ruler_stewardship value = 11 } }
			factor = 1.1
		}
		modifier = {
			condition = { type = ruler_stewardship value = 11 }
			factor = 1.15
		}
		modifier = {
			condition = { type = has_advance value = { ironedged_wood_plows = yes } }
			factor = 1.05
		}
		modifier = {
			condition = { type = has_advance value = { ironplows = yes } }
			factor = 1.05
		}
		modifier = {
			condition = { type = has_advance value = { pitchforks_and_harrows = yes } }
			factor = 1.05
		}
		modifier = {
			condition = { type = has_advance value = { padded_horsecollars = yes } }
			factor = 1.05
		}
		modifier = {
			condition = { type = has_advance value = { two_field_system = yes } }
			factor = 1.05
		}
		modifier = {
			condition = { type = has_advance value = { three_field_system = yes } }
			factor = 1.05
		}
		modifier = {
			condition = { type = has_advance value = { stripe_ploughing = yes } }
			factor = 1.05
		}
		modifier = {
			condition = { type = has_advance value = { soil_amelioration = yes } }
			factor = 1.05
		}
		modifier = {
			condition = { type = has_advance value = { rooting_out = yes } }
			factor = 1.05
		}
		modifier = {
			condition = { type = has_province_effect value = { rich  = yes } }
			factor = 0.85
		}
		modifier = {
			condition = { type = has_province_effect value = { prosperous = yes } }
			factor = 0.9
		}
		modifier = {
			condition = { type = has_province_effect value = { poor = yes } }
			factor = 1.1
		}

	}
	
	action_a = {
		effect = { type = prosperity value = -1 }
	}
	
}

#####################################
# Poor seed selection hurts farming #       
#####################################

province_event = {
	id = 1060
	
	picture = "event_agriculture"
	
	trigger = {
		condition = {
			type = not
			value = { type = has_province_effect value = { struggling = yes } }
		}
	}

	mean_time_to_happen = {
		months = 900
		modifier = {
			condition = { type = not value = { type = ruler_stewardship value = 3 } }
			factor = 0.8
		}
		modifier = {
			condition = { type = ruler_stewardship value = 3 }
			condition = { type = not value = { type = ruler_stewardship value = 5 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = ruler_stewardship value = 7 }
			condition = { type = not value = { type = ruler_stewardship value = 9 } }
			factor = 1.05
		}
		modifier = {
			condition = { type = ruler_stewardship value = 9 }
			condition = { type = not value = { type = ruler_stewardship value = 11 } }
			factor = 1.1
		}
		modifier = {
			condition = { type = ruler_stewardship value = 11 }
			factor = 1.15
		}
		modifier = {
			condition = { type = has_advance value = { two_field_system = yes } }
			factor = 1.05
		}
		modifier = {
			condition = { type = has_advance value = { three_field_system = yes } }
			factor = 1.05
		}
		modifier = {
			condition = { type = has_advance value = { stripe_ploughing = yes } }
			factor = 1.05
		}
		modifier = {
			condition = { type = has_advance value = { soil_amelioration = yes } }
			factor = 1.05
		}
		modifier = {
			condition = { type = has_advance value = { rooting_out = yes } }
			factor = 1.05
		}
		modifier = {
			condition = { type = has_province_effect value = { rich  = yes } }
			factor = 0.85
		}
		modifier = {
			condition = { type = has_province_effect value = { prosperous = yes } }
			factor = 0.9
		}
		modifier = {
			condition = { type = has_province_effect value = { poor = yes } }
			factor = 1.1
		}
	}
	
	action_a = {
		effect = { type = prosperity value = -1 }
	}
}

################################
# Lack of manure hurts farming #    
################################

province_event = {
	id = 1061
	
	picture = "event_agriculture"
	
	trigger = {
		condition = {
			type = not
			value = { type = has_province_effect value = { struggling = yes } }
		}
	}

	mean_time_to_happen = {
		months = 900

		modifier = {
			condition = { type = not value = { type = ruler_stewardship value = 3 } }
			factor = 0.8
		}
		modifier = {
			condition = { type = ruler_stewardship value = 3 }
			condition = { type = not value = { type = ruler_stewardship value = 5 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = ruler_stewardship value = 7 }
			condition = { type = not value = { type = ruler_stewardship value = 9 } }
			factor = 1.05
		}
		modifier = {
			condition = { type = ruler_stewardship value = 9 }
			condition = { type = not value = { type = ruler_stewardship value = 11 } }
			factor = 1.1
		}
		modifier = {
			condition = { type = ruler_stewardship value = 11 }
			factor = 1.15
		}
		modifier = {
			condition = { type = has_advance value = { goats = yes } }
			factor = 1.02
		}
		modifier = {
			condition = { type = has_advance value = { pigs = yes } }
			factor = 1.05
		}
		modifier = {
			condition = { type = has_advance value = { sheep = yes } }
			factor = 1.05
		}
		modifier = {
			condition = { type = has_advance value = { cows = yes } }
			factor = 1.1
		}
		modifier = {
			condition = { type = has_province_effect value = { rich  = yes } }
			factor = 0.85
		}
		modifier = {
			condition = { type = has_province_effect value = { prosperous = yes } }
			factor = 0.9
		}
		modifier = {
			condition = { type = has_province_effect value = { poor = yes } }
			factor = 1.1
		}
	}
	
	action_a = {
		effect = { type = prosperity value = -1 }
	}
	
}

#########################################
# Lower mean temperature hurts farming 	#            
#########################################

province_event = {
	id = 1062
	
	picture = "event_agriculture"
	
	trigger = { 
		condition = { type = year value = 1290 }
		condition = { 
			type = not 
			value = {
				type = year
				value = 1365
			}
		}
		condition = {
			type = not
			value = { type = has_province_effect value = { struggling = yes } }
		}
	 }

	mean_time_to_happen = {
		months = 900
		modifier = {
			condition = { type = not value = { type = ruler_stewardship value = 3 } }
			factor = 0.8
		}
		modifier = {
			condition = { type = ruler_stewardship value = 3 }
			condition = { type = not value = { type = ruler_stewardship value = 5 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = ruler_stewardship value = 7 }
			condition = { type = not value = { type = ruler_stewardship value = 9 } }
			factor = 1.05
		}
		modifier = {
			condition = { type = ruler_stewardship value = 0 }
			condition = { type = not value = { type = ruler_stewardship value = 11 } }
			factor = 1.1
		}
		modifier = {
			condition = { type = ruler_stewardship value = 11 }
			factor = 1.15
		}
		modifier = {
			condition = { type = has_advance value = { two_field_system = yes } }
			factor = 1.05
		}
		modifier = {
			condition = { type = has_advance value = { three_field_system = yes } }
			factor = 1.05
		}
		modifier = {
			condition = { type = has_advance value = { stripe_ploughing = yes } }
			factor = 1.05
		}
		modifier = {
			condition = { type = has_advance value = { soil_amelioration = yes } }
			factor = 1.05
		}
		modifier = {
			condition = { type = has_advance value = { rooting_out = yes } }
			factor = 1.05
		}
		modifier = {
			condition = { type = has_province_effect value = { rich  = yes } }
			factor = 0.85
		}
		modifier = {
			condition = { type = has_province_effect value = { prosperous = yes } }
			factor = 0.9
		}
		modifier = {
			condition = { type = has_province_effect value = { poor = yes } }
			factor = 1.1
		}
	}
	
	action_a = {
		effect = { type = prosperity value = -1 }
	}
	
}

########################
# Arable land deserted #
########################

province_event = {
	id = 1063
	
	picture = "event_agriculture"
	
	trigger = { 
		condition = {
			type = or
			condition = {
				type = has_province_effect
				value = { looted = yes }
			}
			condition = {
				type = has_province_effect
				value = { bubonic_plague = yes }
			}
			condition = {
				type = has_province_effect
				value = { pneumonic_plague = yes }
			}
		}
		condition = {
			type = not
			value = { type = has_province_effect value = { struggling = yes } }
		}
	}

	mean_time_to_happen = {
		months = 30

		modifier = {
			condition = { type = not value = { type = ruler_stewardship value = 3 } }
			factor = 0.8
		}
		modifier = {
			condition = { type = ruler_stewardship value = 3 }
			condition = { type = not value = { type = ruler_stewardship value = 5 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = ruler_stewardship value = 7 }
			condition = { type = not value = { type = ruler_stewardship value = 9 } }
			factor = 1.05
		}
		modifier = {
			condition = { type = ruler_stewardship value = 9 }
			condition = { type = not value = { type = ruler_stewardship value = 11 } }
			factor = 1.1
		}
		modifier = {
			condition = { type = ruler_stewardship value = 11 }
			factor = 1.15
		}
		modifier = {
			condition = { type = has_province_effect value = { rich  = yes } }
			factor = 0.85
		}
		modifier = {
			condition = { type = has_province_effect value = { prosperous = yes } }
			factor = 0.9
		}
		modifier = {
			condition = { type = has_province_effect value = { poor = yes } }
			factor = 1.1
		}
	}
	
	action_a = {
		effect = { type = prosperity value = -1 }
	}
	
}

################################
# Draining of marshes and fens #     
################################

province_event = {
	id = 1064
	
	picture = "event_agriculture"
	
	trigger = {
		condition = {
			type = not
			value = { type = has_province_effect value = { rich = yes } }
		}
	}

	mean_time_to_happen = {
		months = 900

		modifier = {
			condition = { type = not value = { type = ruler_stewardship value = 3 } }
			factor = 1.2
		}
		modifier = {
			condition = { type = ruler_stewardship value = 3 }
			condition = { type = not value = { type = ruler_stewardship value = 5 } }
			factor = 1.1
		}
		modifier = {
			condition = { type = ruler_stewardship value = 7 }
			condition = { type = not value = { type = ruler_stewardship value = 9 } }
			factor = 0.95
		}
		modifier = {
			condition = { type = ruler_stewardship value = 9 }
			condition = { type = not value = { type = ruler_stewardship value = 11 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = ruler_stewardship value = 11 }
			factor = 0.85
		}
		modifier = {
			condition = { type = has_law value = { popular_law = yes } }
			factor = 0.90
		}
		modifier = {
			condition = { type = has_advance value = { ironedged_wood_plows = yes } }
			factor = 0.98
		}
		modifier = {
			condition = { type = has_advance value = { ironplows = yes } }
			factor = 0.97
		}
		modifier = {
			condition = { type = has_advance value = { pitchforks_and_harrows = yes } }
			factor = 0.95
		}
		modifier = {
			condition = { type = has_advance value = { padded_horsecollars = yes } }
			factor = 0.95
		}
		modifier = {
			condition = { type = has_advance value = { two_field_system = yes } }
			factor = 0.98
		}
		modifier = {
			condition = { type = has_advance value = { three_field_system = yes } }
			factor = 0.98
		}
		modifier = {
			condition = { type = has_advance value = { stripe_ploughing = yes } }
			factor = 0.98
		}
		modifier = {
			condition = { type = has_advance value = { soil_amelioration = yes } }
			factor = 0.95
		}
		modifier = {
			condition = { type = has_advance value = { rooting_out = yes } }
			factor = 0.9
		}
		modifier = {
			condition = { type = has_province_effect value = { struggling = yes } }
			factor = 0.85
		}
		modifier = {
			condition = { type = has_province_effect value = { poor = yes } }
			factor = 0.9
		}
		modifier = {
			condition = { type = has_province_effect value = { prosperous = yes } }
			factor = 1.1
		}
	}
	
	action_a = {
		effect = { type = prosperity value = 1 }
	}
	
}

######################################
# Resettlement on newly claimed land #            
######################################

province_event = {
	id = 1065
	
	picture = "event_town"
	
	trigger = {
		condition = {
			type = not
			value = { type = has_province_effect value = { rich = yes } }
		}
	}

	mean_time_to_happen = {
		months = 900

		modifier = {
			condition = { type = not value = { type = ruler_stewardship value = 3 } }
			factor = 1.2
		}
		modifier = {
			condition = { type = ruler_stewardship value = 3 }
			condition = { type = not value = { type = ruler_stewardship value = 5 } }
			factor = 1.1
		}
		modifier = {
			condition = { type = ruler_stewardship value = 7 }
			condition = { type = not value = { type = ruler_stewardship value = 9 } }
			factor = 0.95
		}
		modifier = {
			condition = { type = ruler_stewardship value = 9 }
			condition = { type = not value = { type = ruler_stewardship value = 11 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = ruler_stewardship value = 11 }
			factor = 0.85
		}
		modifier = {
			condition = { type = has_law value = { popular_law = yes } }
			factor = 0.90
		}
		modifier = {
			condition = { type = has_advance value = { ironedged_wood_plows = yes } }
			factor = 0.98
		}
		modifier = {
			condition = { type = has_advance value = { ironplows = yes } }
			factor = 0.97
		}
		modifier = {
			condition = { type = has_advance value = { pitchforks_and_harrows = yes } }
			factor = 0.95
		}
		modifier = {
			condition = { type = has_advance value = { padded_horsecollars = yes } }
			factor = 0.95
		}
		modifier = {
			condition = { type = has_advance value = { soil_amelioration = yes } }
			factor = 0.95
		}
		modifier = {
			condition = { type = has_advance value = { rooting_out = yes } }
			factor = 0.95
		}
		modifier = {
			condition = { type = has_province_effect value = { struggling = yes } }
			factor = 0.85
		}
		modifier = {
			condition = { type = has_province_effect value = { poor = yes } }
			factor = 0.9
		}
		modifier = {
			condition = { type = has_province_effect value = { prosperous = yes } }
			factor = 1.1
		}
	}
	
	action_a = {
		effect = { type = prosperity value = 1 }
	}
	
}

###############################
# Increased land productivity #    
###############################

province_event = {
	id = 1066
	
	picture = "event_agriculture"
	
	trigger = {
		condition = {
			type = not
			value = { type = has_province_effect value = { rich = yes } }
		}
	}

	mean_time_to_happen = {
		months = 900

		modifier = {
			condition = { type = not value = { type = ruler_stewardship value = 3 } }
			factor = 1.2
		}
		modifier = {
			condition = { type = ruler_stewardship value = 3 }
			condition = { type = not value = { type = ruler_stewardship value = 5 } }
			factor = 1.1
		}
		modifier = {
			condition = { type = ruler_stewardship value = 7 }
			condition = { type = not value = { type = ruler_stewardship value = 9 } }
			factor = 0.95
		}
		modifier = {
			condition = { type = ruler_stewardship value = 9 }
			condition = { type = not value = { type = ruler_stewardship value = 11 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = ruler_stewardship value = 11 }
			factor = 0.85
		}
		modifier = {
			condition = { type = has_law value = { popular_law = yes } }
			factor = 0.90
		}
		modifier = {
			condition = { type = has_advance value = { ironedged_wood_plows = yes } }
			factor = 0.98
		}
		modifier = {
			condition = { type = has_advance value = { ironplows = yes } }
			factor = 0.97
		}
		modifier = {
			condition = { type = has_advance value = { pitchforks_and_harrows = yes } }
			factor = 0.95
		}
		modifier = {
			condition = { type = has_advance value = { padded_horsecollars = yes } }
			factor = 0.95
		}
		modifier = {
			condition = { type = has_advance value = { two_field_system = yes } }
			factor = 0.98
		}
		modifier = {
			condition = { type = has_advance value = { three_field_system = yes } }
			factor = 0.98
		}
		modifier = {
			condition = { type = has_advance value = { stripe_ploughing = yes } }
			factor = 0.97
		}
		modifier = {
			condition = { type = has_advance value = { soil_amelioration = yes } }
			factor = 0.95
		}
		modifier = {
			condition = { type = has_advance value = { rooting_out = yes } }
			factor = 0.95
		}
		modifier = {
			condition = { type = has_province_effect value = { struggling = yes } }
			factor = 0.85
		}
		modifier = {
			condition = { type = has_province_effect value = { poor = yes } }
			factor = 0.9
		}
		modifier = {
			condition = { type = has_province_effect value = { prosperous = yes } }
			factor = 1.1
		}
	}
	
	action_a = {
		effect = { type = prosperity value = 1 }
	}
	
}

####################################
# Reclaim wasteland and forestland #        
####################################

province_event = {
	id = 1067
	
	picture = "event_agriculture2"
	
	trigger = {
		condition = {
			type = not
			value = { type = has_province_effect value = { rich = yes } }
		}
	}

	mean_time_to_happen = {
		months = 900

		modifier = {
			condition = { type = not value = { type = ruler_stewardship value = 3 } }
			factor = 1.2
		}
		modifier = {
			condition = { type = ruler_stewardship value = 3 }
			condition = { type = not value = { type = ruler_stewardship value = 5 } }
			factor = 1.1
		}
		modifier = {
			condition = { type = ruler_stewardship value = 7 }
			condition = { type = not value = { type = ruler_stewardship value = 9 } }
			factor = 0.95
		}
		modifier = {
			condition = { type = ruler_stewardship value = 9 }
			condition = { type = not value = { type = ruler_stewardship value = 11 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = ruler_stewardship value = 11 }
			factor = 0.85
		}
		modifier = {
			condition = { type = has_law value = { popular_law = yes } }
			factor = 0.90
		}
		modifier = {
			condition = { type = has_advance value = { ironedged_wood_plows = yes } }
			factor = 0.98
		}
		modifier = {
			condition = { type = has_advance value = { ironplows = yes } }
			factor = 0.97
		}
		modifier = {
			condition = { type = has_advance value = { pitchforks_and_harrows = yes } }
			factor = 0.95
		}
		modifier = {
			condition = { type = has_advance value = { padded_horsecollars = yes } }
			factor = 0.95
		}
		modifier = {
			condition = { type = has_advance value = { soil_amelioration = yes } }
			factor = 0.98
		}
		modifier = {
			condition = { type = has_advance value = { rooting_out = yes } }
			factor = 0.95
		}
		modifier = {
			condition = { type = has_province_effect value = { struggling = yes } }
			factor = 0.85
		}
		modifier = {
			condition = { type = has_province_effect value = { poor = yes } }
			factor = 0.9
		}
		modifier = {
			condition = { type = has_province_effect value = { prosperous = yes } }
			factor = 1.1
		}
	}
	
	action_a = {
		effect = { type = prosperity value = 1 }
	}
	
}

########################################
# Towns and hamlets grows considerably #
########################################

province_event = {
	id = 1068
	
	picture = "event_town"
	
	trigger = {
		condition = {
			type = not
			value = { type = has_province_effect value = { rich = yes } }
		}
	}

	mean_time_to_happen = {
		months = 900

		modifier = {
			condition = { type = not value = { type = ruler_stewardship value = 3 } }
			factor = 1.2
		}
		modifier = {
			condition = { type = ruler_stewardship value = 3 }
			condition = { type = not value = { type = ruler_stewardship value = 5 } }
			factor = 1.1
		}
		modifier = {
			condition = { type = ruler_stewardship value = 7 }
			condition = { type = not value = { type = ruler_stewardship value = 9 } }
			factor = 0.95
		}
		modifier = {
			condition = { type = ruler_stewardship value = 9 }
			condition = { type = not value = { type = ruler_stewardship value = 11 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = ruler_stewardship value = 11 }
			factor = 0.85
		}
		modifier = {
			condition = { type = has_advance value = { clothmaking = yes } }
			factor = 0.99
		}
		modifier = {
			condition = { type = has_law value = { popular_law = yes } }
			factor = 0.99
		}
		modifier = {
			condition = { type = has_advance value = { papermaking = yes } }
			factor = 0.99
		}
		modifier = {
			condition = { type = has_advance value = { mint = yes } }
			factor = 0.99
		}
		modifier = {
			condition = { type = has_advance value = { guilds = yes } }
			factor = 0.99
		}
		modifier = {
			condition = { type = has_advance value = { miracle_plays = yes } }
			factor = 0.99
		}
		modifier = {
			condition = { type = has_advance value = { carnivals = yes } }
			factor = 0.95
		}
		modifier = {
			condition = { type = has_advance value = { fashion_clothes = yes } }
			factor = 0.95
		}
		modifier = {
			condition = { type = has_advance value = { tapestries = yes } }
			factor = 0.95
		}
		modifier = {
			condition = { type = has_province_effect value = { struggling = yes } }
			factor = 0.85
		}
		modifier = {
			condition = { type = has_province_effect value = { poor = yes } }
			factor = 0.9
		}
		modifier = {
			condition = { type = has_province_effect value = { prosperous = yes } }
			factor = 1.1
		}
	}
	
	action_a = {
		effect = { type = prosperity value = 1 }
	}
	
}

#######################
# A province recovers #
#######################
province_event = {
	id = 1201
	
	picture = "event_agriculture"

	trigger = { 
		condition = { 
			type = has_province_effect
			value = { looted = yes }
		}
	}

	mean_time_to_happen = {
		months = 12

		modifier = {
			condition = { type = not value = { type = ruler_stewardship value = 3 } }
			factor = 1.5
		}
		modifier = {
			condition = { type = ruler_stewardship value = 3 }
			condition = { type = not value = { type = ruler_stewardship value = 5 } }
			factor = 1.2
		}
		modifier = {
			condition = { type = ruler_stewardship value = 7 }
			condition = { type = not value = { type = ruler_stewardship value = 9 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = ruler_stewardship value = 9 }
			condition = { type = not value = { type = ruler_stewardship value = 11 } }
			factor = 0.8
		}
		modifier = {
			condition = { type = ruler_stewardship value = 11 }
			factor = 0.7
		}
		modifier = {
			condition = { type = owner
				condition = { type = steward_csc
					condition = { type = not value = { type = stewardship value = 5 } }
				}
			}
			factor = 1.25
		}
		modifier = {
			condition = { type = owner
				condition = { type = steward_csc
					condition = { type = not value = { type = stewardship value = 7 } }
				}
			}
			factor = 1.1
		}
		modifier = {
			condition = { type = owner
				condition = { type = steward_csc
					condition = { type = stewardship value = 9 }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = owner
				condition = { type = steward_csc
					condition = { type = stewardship value = 11 }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = owner
				condition = { type = steward_csc
					condition = { type = stewardship value = 13 }
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { type = owner
				condition = { type = steward_csc
					condition = { type = stewardship value = 15 }
				}
			}
			factor = 0.75
		}
		modifier = { #check if no officer occupying post
			condition = { type = not
				value = { type = owner
					condition = { type = steward_csc
						condition = { type = steward }
					}
				}
			}
			factor = 5
		}
	}
	
	immidiate = {
		effect = { type = remove_province_effect value = looted }
	}
}

############################
# Deal with Popular Revolt #
############################
province_event = {
	id = 990
	
	picture = "event_town"

	trigger = { 
		condition = { 
			type = has_province_effect
			value = { revolt = yes }
		}
	}

	mean_time_to_happen = {
		months = 24
		modifier = {
			condition = { type = not value = { type = ruler_diplomacy value = 3 } }
			factor = 1.5
		}
		modifier = {
			condition = { type = ruler_diplomacy value = 3 }
			condition = { type = not value = { type = ruler_diplomacy value = 5 } }
			factor = 1.2
		}
		modifier = {
			condition = { type = ruler_diplomacy value = 9 }
			condition = { type = not value = { type = ruler_diplomacy value = 11 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = ruler_diplomacy value = 11 }
			condition = { type = not value = { type = ruler_diplomacy value = 15 } }
			factor = 0.8
		}
		modifier = {
			condition = { type = ruler_diplomacy value = 15 }
			factor = 0.7
		}
		modifier = {
			condition = { type = owner
				condition = { type = chancellor_csc
					condition = { type = not value = { type = diplomacy value = 5 } }
				}
			}
			factor = 1.25
		}
		modifier = {
			condition = { type = owner
				condition = { type = chancellor_csc
					condition = { type = not value = { type = diplomacy value = 7 } }
				}
			}
			factor = 1.1
		}
		modifier = {
			condition = { type = owner
				condition = { type = chancellor_csc
					condition = { type = diplomacy value = 9 }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = owner
				condition = { type = chancellor_csc
					condition = { type = diplomacy value = 11 }
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = owner
				condition = { type = chancellor_csc
					condition = { type = diplomacy value = 13 }
				}
			}
			factor = 0.85
		}
		modifier = {
			condition = { type = owner
				condition = { type = chancellor_csc
					condition = { type = diplomacy value = 15 }
				}
			}
			factor = 0.75
		}
		modifier = { #check if no officer occupying post
			condition = { type = not
				value = { type = owner
					condition = { type = chancellor_csc
						condition = { type = chancellor }
					}
				}
			}
			factor = 5
		}
	}
	
	action_a = {
		effect = { type = remove_province_effect value = revolt }
		effect = { type = ruler_prestige value = -5 }
	}
	action_b = {
		effect = { type = ruler_prestige value = 5 }
	}
}

############################
# Peasants end revolt due to hunger

province_event = {
	id = 6106

	picture = "event_agriculture"

	trigger = {
		condition = { type = has_province_effect value = { revolt = yes } }
		condition = { type = or
			condition = { type = has_province_effect value = { looted = yes } }
			condition = { type = has_province_effect value = { bubonic_plague = yes } }
			condition = { type = has_province_effect value = { pneumonic_plague = yes } }
			condition = { type = has_province_effect value = { malaria = yes } }
			condition = { type = has_province_effect value = { dysentery = yes } }
			condition = { type = has_province_effect value = { small_pox = yes } }
			condition = { type = has_province_effect value = { typhoid_fever = yes } }
		}
		condition = { type = not value = { type = is_besieged } }
	}

	mean_time_to_happen = {
		months = 60

		modifier = {
			condition = { type = has_province_effect value = { looted = yes } }
			condition = { type = or
				condition = { type = has_province_effect value = { bubonic_plague = yes } }
				condition = { type = has_province_effect value = { pneumonic_plague = yes } }
				condition = { type = has_province_effect value = { malaria = yes } }
				condition = { type = has_province_effect value = { dysentery = yes } }
				condition = { type = has_province_effect value = { small_pox = yes } }
				condition = { type = has_province_effect value = { typhoid_fever = yes } }
			}
			factor = 0.5
		}
		modifier = {
			condition = { type = has_province_effect value = { rich = yes } }
			factor = 1.2
		}
		modifier = {
			condition = { type = has_province_effect value = { prosperous = yes } }
			factor = 1.1
		}
		modifier = {
			condition = { type = has_province_effect value = { poor = yes } }
			factor = 0.9
		}
		modifier = {
			condition = { type = has_province_effect value = { struggling = yes } }
			factor = 0.8
		}
		modifier = {
			condition = { type = ruler_intrigue value = 10 }
			factor = 0.9
		}
		modifier = {
			condition = { type = not
				value = { type = ruler_intrigue value = 4 }
			}
			factor = 1.1
		}
	}

	action_a = {
		ai_chance = 60
		effect = { type = remove_province_effect value = revolt }
		effect = { type = random chance = 50
			effect = { type = prosperity value = -1 }
		}
	}
	action_b = {
		ai_chance = 20
		modifier = {
			condition = { type = ruler_gold value = 100 }
			factor = 2.0
		}
		modifier = {
			condition = { type = trait value = forgiving }
			factor = 1.5
		}
		modifier = {
			condition = { type = trait value = merciful }
			factor = 1.5
		}
		modifier = {
			condition = { type = trait value = generous }
			factor = 1.5
		}
		effect = { type = remove_province_effect value = revolt }
		effect = { type = ruler_gold scale = -1.0 }
		effect = { type = ruler_piety value = 50 }
		effect = { type = remove_province_effect value = looted }
		effect = { type = random chance = 25
			effect = { type = prosperity value = 1 }
		}
	}
	action_c = {
		ai_chance = 20
		modifier = {
			condition = { type = not
				value = { type = ruler_gold value = 20 }
			}
			factor = 2.0
		}
		modifier = {
			condition = { type = trait value = vengeful }
			factor = 1.5
		}
		modifier = {
			condition = { type = trait value = cruel }
			factor = 1.5
		}
		modifier = {
			condition = { type = trait value = selfish }
			factor = 1.5
		}
		effect = { type = ruler_gold scale = 0.2 }
		effect = { type = ruler_piety value = -25 }
		effect = { type = prosperity value = -1 }
		effect = { type = peasant_power value = -0.5 }
		effect = { type = noble_power value = 0.5 }
		effect = { type = random chance = 50
			effect = { type = prosperity value = -1 }
		}
		effect = { type = random chance = 50
			effect = { type = remove_province_effect value = revolt }
		}
	}
}