############################################
# Clergy requests Aid in a Time of Trouble #
############################################
province_event = {
	id = 5000
	
	picture = "event_religion"

	trigger = {
		condition = {
			type = has_improvement
			value = { church = yes }
		}
		condition = {
			type = not
			value = {
				type = has_improvement
				value = { large_church = yes }
			}
		}
		condition = {
			type = not
			value = {
				type = has_improvement
				value = { domed_church = yes }
			}
		}
		condition = {
			type = not
			value = {
				type = has_improvement
				value = { cathedral = 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}
			}
			condition = {
				type = has_province_effect
				value = { looted =  yes}
			}
			condition = {
				type = has_province_effect
				value = { struggling =  yes}
			}
			condition = {
				type = has_province_effect
				value = { poor =  yes}
			}
		}
	
	}

	mean_time_to_happen = {
		months = 1500

		modifier = {
			condition = {
				type = has_province_effect
				value = { bubonic_plague =  yes}
			}
			factor = 0.5
		}
		modifier = {
			condition = {
				type = has_province_effect
				value = { pneumonic_plague =  yes}
			}
			factor = 0.5
		}
		modifier = {
			condition = {
				type = has_province_effect
				value = { malaria =  yes}
			}
			factor = 0.2
		}
		modifier = {
			condition = {
				type = has_province_effect
				value = { dysentery =  yes}
			}
			factor = 0.2
		}
		modifier = {
			condition = {
				type = has_province_effect
				value = { small_pox =  yes}
			}
			factor = 0.2
		}
		modifier = {
			condition = {
				type = has_province_effect
				value = { small_pox =  yes}
			}
			factor = 0.2
		}
		modifier = {
			condition = {
				type = has_province_effect
				value = { typhoid_fever =  yes}
			}
			factor = 0.2
		}
		modifier = {
			condition = {
				type = has_province_effect
				value = { looted =  yes}
			}
			factor = 0.35
		}
		modifier = {
			condition = {
				type = has_province_effect
				value = { struggling =  yes}
			}
			factor = 0.5
		}
		modifier = {
			condition = {
				type = has_province_effect
				value = { poor =  yes}
			}
			factor = 0.65
		}
		modifier = {
			condition = {
				type = not
				value = {
					type = ruler_stewardship
					value = 3
				}
			}
			factor = 0.75
		}
		modifier = {
			condition = {
				type = not
				value = {
					type = ruler_stewardship
					value = 5
				}
			}
			factor = 0.75
		}
		modifier = {
			condition = {
				type = ruler_stewardship
				value = 8
			}
			factor = 1.25
		}
		modifier = {
			condition = {
				type = ruler_stewardship
				value = 10
			}
			factor = 1.25
		}
		modifier = {
			condition = {
				type = ruler_stewardship
				value = 12
			}
			factor = 1.25
		}
		modifier = {
			condition = {
				type = clergy_power
				value = 0.35
			}
			factor = 0.9
		}
		modifier = {
			condition = {
				type = clergy_power
				value = 0.5
			}
			factor = 0.9
		}
		modifier = {
			condition = {
				type = trait
				value = generous
			}
			factor = 0.85
		}
		modifier = {
			condition = {
				type = trait
				value = just
			}
			factor = 0.9
		}
		modifier = {
			condition = {
				type = trait
				value = arbitrary
			}
			factor = 1.15
		}
		modifier = {
			condition = {
				type = trait
				value = merciful
			}
			factor = 0.8
		}
		modifier = {
			condition = {
				type = trait
				value = cruel
			}
			factor = 1.2
		}
	}

	action_a = {
		effect = { type = ruler_piety value = 15 }
		effect = { type = ruler_gold scale = -0.25 }
		effect = { type = peasant_loyalty value = 0.05 }
		effect = { type = clergy_loyalty value = 0.05 }
	}
	action_b = {
		effect = { type = ruler_piety value = -15 }
		effect = { type = ruler_prestige value = -30 }
		effect = { type = peasant_loyalty value = -0.05 }
		effect = { type = clergy_loyalty value = -0.05 }
	}
}

############################################
# Clergy requests Aid in a Time of Trouble #
############################################
province_event = {
	id = 5001
	
	picture = "event_religion"

	trigger = {
		condition = {
			type = has_improvement
			value = { large_church = yes }
		}
		condition = {
			type = not
			value = {
				type = has_improvement
				value = { domed_church = yes }
			}
		}
		condition = {
			type = not
			value = {
				type = has_improvement
				value = { cathedral = 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}
			}
			condition = {
				type = has_province_effect
				value = { looted =  yes}
			}
			condition = {
				type = has_province_effect
				value = { struggling =  yes}
			}
			condition = {
				type = has_province_effect
				value = { poor =  yes}
			}
		}
	
	}

	mean_time_to_happen = {
		months = 1000

		modifier = {
			condition = {
				type = has_province_effect
				value = { bubonic_plague =  yes}
			}
			factor = 0.5
		}
		modifier = {
			condition = {
				type = has_province_effect
				value = { pneumonic_plague =  yes}
			}
			factor = 0.5
		}
		modifier = {
			condition = {
				type = has_province_effect
				value = { malaria =  yes}
			}
			factor = 0.2
		}
		modifier = {
			condition = {
				type = has_province_effect
				value = { dysentery =  yes}
			}
			factor = 0.2
		}
		modifier = {
			condition = {
				type = has_province_effect
				value = { small_pox =  yes}
			}
			factor = 0.2
		}
		modifier = {
			condition = {
				type = has_province_effect
				value = { small_pox =  yes}
			}
			factor = 0.2
		}
		modifier = {
			condition = {
				type = has_province_effect
				value = { typhoid_fever =  yes}
			}
			factor = 0.2
		}
		modifier = {
			condition = {
				type = has_province_effect
				value = { looted =  yes}
			}
			factor = 0.35
		}
		modifier = {
			condition = {
				type = has_province_effect
				value = { struggling =  yes}
			}
			factor = 0.5
		}
		modifier = {
			condition = {
				type = has_province_effect
				value = { poor =  yes}
			}
			factor = 0.65
		}
		modifier = {
			condition = {
				type = not
				value = {
					type = ruler_stewardship
					value = 3
				}
			}
			factor = 0.75
		}
		modifier = {
			condition = {
				type = not
				value = {
					type = ruler_stewardship
					value = 5
				}
			}
			factor = 0.75
		}
		modifier = {
			condition = {
				type = ruler_stewardship
				value = 8
			}
			factor = 1.25
		}
		modifier = {
			condition = {
				type = ruler_stewardship
				value = 10
			}
			factor = 1.25
		}
		modifier = {
			condition = {
				type = ruler_stewardship
				value = 12
			}
			factor = 1.25
		}
		modifier = {
			condition = {
				type = clergy_power
				value = 0.35
			}
			factor = 0.9
		}
		modifier = {
			condition = {
				type = clergy_power
				value = 0.5
			}
			factor = 0.9
		}
		modifier = {
			condition = {
				type = trait
				value = generous
			}
			factor = 0.85
		}
		modifier = {
			condition = {
				type = trait
				value = just
			}
			factor = 0.9
		}
		modifier = {
			condition = {
				type = trait
				value = arbitrary
			}
			factor = 1.15
		}
		modifier = {
			condition = {
				type = trait
				value = merciful
			}
			factor = 0.8
		}
		modifier = {
			condition = {
				type = trait
				value = cruel
			}
			factor = 1.2
		}
	}

	action_a = {
		effect = { type = ruler_piety value = 25 }
		effect = { type = ruler_gold scale = -0.5 }
		effect = { type = peasant_loyalty value = 0.05 }
		effect = { type = clergy_loyalty value = 0.05 }
	}
	action_b = {
		effect = { type = ruler_piety value = -25 }
		effect = { type = ruler_prestige value = -50 }
		effect = { type = peasant_loyalty value = -0.1 }
		effect = { type = clergy_loyalty value = -0.1 }
	}
}

############################################
# Clergy requests Aid in a Time of Trouble #
############################################
province_event = {
	id = 5002
	
	picture = "event_religion"

	trigger = {
		condition = {
			type = has_improvement
			value = { domed_church = yes }
		}
		condition = {
			type = not
			value = {
				type = has_improvement
				value = { cathedral = 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}
			}
			condition = {
				type = has_province_effect
				value = { looted =  yes}
			}
			condition = {
				type = has_province_effect
				value = { struggling =  yes}
			}
			condition = {
				type = has_province_effect
				value = { poor =  yes}
			}
		}
	
	}

	mean_time_to_happen = {
		months = 750

		modifier = {
			condition = {
				type = has_province_effect
				value = { bubonic_plague =  yes}
			}
			factor = 0.5
		}
		modifier = {
			condition = {
				type = has_province_effect
				value = { pneumonic_plague =  yes}
			}
			factor = 0.5
		}
		modifier = {
			condition = {
				type = has_province_effect
				value = { malaria =  yes}
			}
			factor = 0.2
		}
		modifier = {
			condition = {
				type = has_province_effect
				value = { dysentery =  yes}
			}
			factor = 0.2
		}
		modifier = {
			condition = {
				type = has_province_effect
				value = { small_pox =  yes}
			}
			factor = 0.2
		}
		modifier = {
			condition = {
				type = has_province_effect
				value = { small_pox =  yes}
			}
			factor = 0.2
		}
		modifier = {
			condition = {
				type = has_province_effect
				value = { typhoid_fever =  yes}
			}
			factor = 0.2
		}
		modifier = {
			condition = {
				type = has_province_effect
				value = { looted =  yes}
			}
			factor = 0.35
		}
		modifier = {
			condition = {
				type = has_province_effect
				value = { struggling =  yes}
			}
			factor = 0.5
		}
		modifier = {
			condition = {
				type = has_province_effect
				value = { poor =  yes}
			}
			factor = 0.65
		}
		modifier = {
			condition = {
				type = not
				value = {
					type = ruler_stewardship
					value = 3
				}
			}
			factor = 0.75
		}
		modifier = {
			condition = {
				type = not
				value = {
					type = ruler_stewardship
					value = 5
				}
			}
			factor = 0.75
		}
		modifier = {
			condition = {
				type = ruler_stewardship
				value = 8
			}
			factor = 1.25
		}
		modifier = {
			condition = {
				type = ruler_stewardship
				value = 10
			}
			factor = 1.25
		}
		modifier = {
			condition = {
				type = ruler_stewardship
				value = 12
			}
			factor = 1.25
		}
		modifier = {
			condition = {
				type = clergy_power
				value = 0.35
			}
			factor = 0.9
		}
		modifier = {
			condition = {
				type = clergy_power
				value = 0.5
			}
			factor = 0.9
		}
		modifier = {
			condition = {
				type = trait
				value = generous
			}
			factor = 0.85
		}
		modifier = {
			condition = {
				type = trait
				value = just
			}
			factor = 0.9
		}
		modifier = {
			condition = {
				type = trait
				value = arbitrary
			}
			factor = 1.15
		}
		modifier = {
			condition = {
				type = trait
				value = merciful
			}
			factor = 0.8
		}
		modifier = {
			condition = {
				type = trait
				value = cruel
			}
			factor = 1.2
		}
	}

	action_a = {
		effect = { type = ruler_piety value = 50 }
		effect = { type = ruler_gold scale = -0.75 }
		effect = { type = peasant_loyalty value = 0.05 }
		effect = { type = clergy_loyalty value = 0.05 }
	}
	action_b = {
		effect = { type = ruler_piety value = -50 }
		effect = { type = ruler_prestige value = -100 }
		effect = { type = peasant_loyalty value = -0.15 }
		effect = { type = clergy_loyalty value = -0.15 }
	}
}

############################################
# Clergy requests Aid in a Time of Trouble #
############################################
province_event = {
	id = 5003
	
	picture = "event_religion"

	trigger = {
		condition = {
			type = has_improvement
			value = { cathedral = 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}
			}
			condition = {
				type = has_province_effect
				value = { looted =  yes}
			}
			condition = {
				type = has_province_effect
				value = { struggling =  yes}
			}
			condition = {
				type = has_province_effect
				value = { poor =  yes}
			}
		}
	
	}

	mean_time_to_happen = {
		months = 500

		modifier = {
			condition = {
				type = has_province_effect
				value = { bubonic_plague =  yes}
			}
			factor = 0.5
		}
		modifier = {
			condition = {
				type = has_province_effect
				value = { pneumonic_plague =  yes}
			}
			factor = 0.5
		}
		modifier = {
			condition = {
				type = has_province_effect
				value = { malaria =  yes}
			}
			factor = 0.2
		}
		modifier = {
			condition = {
				type = has_province_effect
				value = { dysentery =  yes}
			}
			factor = 0.2
		}
		modifier = {
			condition = {
				type = has_province_effect
				value = { small_pox =  yes}
			}
			factor = 0.2
		}
		modifier = {
			condition = {
				type = has_province_effect
				value = { small_pox =  yes}
			}
			factor = 0.2
		}
		modifier = {
			condition = {
				type = has_province_effect
				value = { typhoid_fever =  yes}
			}
			factor = 0.2
		}
		modifier = {
			condition = {
				type = has_province_effect
				value = { looted =  yes}
			}
			factor = 0.35
		}
		modifier = {
			condition = {
				type = has_province_effect
				value = { struggling =  yes}
			}
			factor = 0.5
		}
		modifier = {
			condition = {
				type = has_province_effect
				value = { poor =  yes}
			}
			factor = 0.65
		}
		modifier = {
			condition = {
				type = not
				value = {
					type = ruler_stewardship
					value = 3
				}
			}
			factor = 0.75
		}
		modifier = {
			condition = {
				type = not
				value = {
					type = ruler_stewardship
					value = 5
				}
			}
			factor = 0.75
		}
		modifier = {
			condition = {
				type = ruler_stewardship
				value = 8
			}
			factor = 1.25
		}
		modifier = {
			condition = {
				type = ruler_stewardship
				value = 10
			}
			factor = 1.25
		}
		modifier = {
			condition = {
				type = ruler_stewardship
				value = 12
			}
			factor = 1.25
		}
		modifier = {
			condition = {
				type = clergy_power
				value = 0.35
			}
			factor = 0.9
		}
		modifier = {
			condition = {
				type = clergy_power
				value = 0.5
			}
			factor = 0.9
		}
		modifier = {
			condition = {
				type = trait
				value = generous
			}
			factor = 0.85
		}
		modifier = {
			condition = {
				type = trait
				value = just
			}
			factor = 0.9
		}
		modifier = {
			condition = {
				type = trait
				value = arbitrary
			}
			factor = 1.15
		}
		modifier = {
			condition = {
				type = trait
				value = merciful
			}
			factor = 0.8
		}
		modifier = {
			condition = {
				type = trait
				value = cruel
			}
			factor = 1.2
		}
	}

	action_a = {
		effect = { type = ruler_piety value = 100 }
		effect = { type = ruler_gold scale = -1 }
		effect = { type = peasant_loyalty value = 0.05 }
		effect = { type = clergy_loyalty value = 0.05 }
	}
	action_b = {
		effect = { type = ruler_piety value = -100 }
		effect = { type = ruler_prestige value = -200 }
		effect = { type = peasant_loyalty value = -0.20 }
		effect = { type = clergy_loyalty value = -0.20 }
	}
}


###########################################
# A Particularly Good Year at the Fishery #
###########################################

province_event = {
	id = 5004
	
	picture = "event_default"

	trigger = {
		condition = {
			type = has_improvement
			value = { fishing_wharf = yes }
		}
	}

	mean_time_to_happen = {
		months = 1000
	}

	action_a = {
		effect = { type = ruler_gold scale = 0.25 }
	}
}

##########################################
# A Particularly Bad Year at the Fishery #
##########################################

province_event = {
	id = 5005
	
	picture = "event_default"

	trigger = {
		condition = {
			type = has_improvement
			value = { fishing_wharf = yes }
		}
	}

	mean_time_to_happen = {
		months = 1000
	}

	action_a = {
		effect = { type = ruler_gold scale = -0.25 }
		effect = { type = peasant_loyalty value = 0.05 }
	}
	action_b = {
		effect = { type = peasant_loyalty value = -0.05 }
		effect = {
			type = random
			chance = 33
			effect = { type = remove_improvement value = fishing_wharf }
		}
		
	}
}

###############################
# Fire has struck our fishery #
###############################

province_event = {
	id = 5006
	
	picture = "event_default"

	trigger = {
		condition = {
			type = has_improvement
			value = { fishing_wharf = yes }
		}
	}

	mean_time_to_happen = {
		months = 2000
	}

	action_a = {
		effect = { type = remove_improvement value = fishing_wharf }
	}
}


########################################
# Extra Tolls Collected at the Harbour #
########################################

province_event = {
	id = 5007
	
	picture = "event_moneycollection"

	trigger = {
		condition = {
			type = has_improvement
			value = { civilian_harbour = yes }
		}
	}

	mean_time_to_happen = {
		months = 1000
	}

	action_a = {
		effect = { type = ruler_gold scale = 0.35 }
	}
}

####################################################
# Corruption by the Toll Collectors at the Harbour #
####################################################

province_event = {
	id = 5008
	
	picture = "event_crime"

	trigger = {
		condition = {
			type = has_improvement
			value = { civilian_harbour = yes }
		}
	}

	mean_time_to_happen = {
		months = 1000

		modifier = {
			condition = {
				type = has_improvement
				value = { court_of_justice = yes }
			}
			factor = 1.5		
		}
	}

	action_a = {
		effect = { type = ruler_gold scale = -0.35 }
	}
}

##################################
# Fire Sweeps Through the Docks! #
##################################

province_event = {
	id = 5009
	
	picture = "event_default"

	trigger = {
		condition = {
			type = has_improvement
			value = { civilian_harbour = yes }
		}
		condition = {
			type = not
			value = {
				type = has_improvement
				value = { naval_harbour = yes }
			}
		}
		condition = {
			type = not
			value = {
				type = has_improvement
				value = { grand_shipyard = yes }
			}
		}
	}

	mean_time_to_happen = {
		months = 2000
	}

	action_a = {
		effect = { type = remove_improvement value = civilian_harbour }
	}
}

########################################
# Extra Tolls Collected at the Harbour #
########################################

province_event = {
	id = 5010
	
	picture = "event_moneycollection"

	trigger = {
		condition = {
			type = has_improvement
			value = { naval_harbour = yes }
		}
	}

	mean_time_to_happen = {
		months = 1000
	}

	action_a = {
		effect = { type = ruler_gold scale = 0.5 }
	}
}

####################################################
# Corruption by the Toll Collectors at the Harbour #
####################################################

province_event = {
	id = 5011
	
	picture = "event_crime"

	trigger = {
		condition = {
			type = has_improvement
			value = { naval_harbour = yes }
		}
	}

	mean_time_to_happen = {
		months = 1000

		modifier = {
			condition = {
				type = has_improvement
				value = { court_of_justice = yes }
			}
			factor = 1.5		
		}
	}

	action_a = {
		effect = { type = ruler_gold scale = -0.5 }
	}
}

##################################
# Fire Sweeps Through the Docks! #
##################################

province_event = {
	id = 5012
	
	picture = "event_default"

	trigger = {
		condition = {
			type = has_improvement
			value = { naval_harbour = yes }
		}
		condition = {
			type = not
			value = {
				type = has_improvement
				value = { grand_shipyard = yes }
			}
		}
	}

	mean_time_to_happen = {
		months = 3000
	}

	action_a = {
		effect = { type = remove_improvement value = naval_harbour }
	}
}

########################################
# Extra Tolls Collected at the Harbour #
########################################

province_event = {
	id = 5013
	
	picture = "event_moneycollection"

	trigger = {
		condition = {
			type = has_improvement
			value = { grand_shipyard = yes }
		}
	}

	mean_time_to_happen = {
		months = 1250
	}

	action_a = {
		effect = { type = ruler_gold scale = 0.75 }
	}
}

####################################################
# Corruption by the Toll Collectors at the Harbour #
####################################################

province_event = {
	id = 5014
	
	picture = "event_crime"

	trigger = {
		condition = {
			type = has_improvement
			value = { grand_shipyard = yes }
		}
	}

	mean_time_to_happen = {
		months = 1250

		modifier = {
			condition = {
				type = has_improvement
				value = { court_of_justice = yes }
			}
			factor = 1.5		
		}
	}

	action_a = {
		effect = { type = ruler_gold scale = -0.75 }
	}
}

##################################
# Fire Sweeps Through the Docks! #
##################################

province_event = {
	id = 5015
	
	picture = "event_default"

	trigger = {
		condition = {
			type = has_improvement
			value = { grand_shipyard = yes }
		}
	}

	mean_time_to_happen = {
		months = 4000
	}

	action_a = {
		effect = { type = remove_improvement value = grand_shipyard }
	}
}


#####################################
# A Fire has Destroyed our Sawmill! #
#####################################

province_event = {
	id = 5016
	
	picture = "event_agriculture2"

	trigger = {
		condition = {
			type = has_improvement
			value = { sawmill = yes }
		}
	}

	mean_time_to_happen = {
		months = 2400
	}

	action_a = {
		effect = { type = remove_improvement value = sawmill }
	}
}

##############################
# A Good year at our Sawmill #
##############################

province_event = {
	id = 5017
	
	picture = "event_agriculture2"

	trigger = {
		condition = {
			type = has_improvement
			value = { sawmill = yes }
		}
	}

	mean_time_to_happen = {
		months = 2000
	}

	action_a = {
		effect = { type = ruler_gold scale = 0.25 }
	}
}

######################################################
# Our Smiths have Found a Better Way Use Local Metal #
######################################################

province_event = {
	id = 5018

	picture = "event_techinvention"

	trigger = {
		condition = {
			type = has_improvement
			value = { smithy = yes }
		}
		condition = {
			type = has_improvement
			value = { mine = yes }
		}
	}

	mean_time_to_happen = {
		months = 2400

		modifier = {
			condition = {
				type = has_advance
				value = { science = yes }
			}
			factor = 0.25
		}
		modifier = {
			condition = {
				type = has_improvement
				value = { improved_mine = yes }
				}
			factor = 0.25
		}
	}

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

################################################################
# Our Smiths Think They can Make Gold with a bit More Research #
################################################################

province_event = {
	id = 5019

	picture = "event_techinvention"

	trigger = {
		condition = {
			type = has_improvement
			value = { smithy = yes }
		}
		condition = {
			type = has_improvement
			value = { mine = yes }
		}
	}

	mean_time_to_happen = {
		months = 2400

		modifier = {
			condition = {
				type = has_advance
				value = { science = yes }
			}
			factor = 5
		}
	}

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


####################################
# Our Miners Have Found a New Vein #
####################################

province_event = {
	id = 5020
	
	picture = "event_default"

	trigger = {
		condition = {
			type = has_improvement
			value = { mine = yes }
		}
	}

	mean_time_to_happen = {
		months = 2400
	}

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

##############################
# Our miners Exhaused a Vein #
##############################

province_event = {
	id = 5021
	
	picture = "event_default"

	trigger = {
		condition = {
			type = has_improvement
			value = { mine = yes }
		}
	}

	mean_time_to_happen = {
		months = 2400
	}

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

####################################
# Disaster! Our Mine has Collapsed #
####################################

province_event = {
	id = 5022
	
	picture = "event_default"

	trigger = {
		condition = {
			type = has_improvement
			value = { mine = yes }
		}
		condition = {
			type = not
			value = {
				type = has_improvement
				value = { improved_mine = yes }
			}
		}
	}

	mean_time_to_happen = {
		months = 4000
	}

	action_a = {
		effect = { type = remove_improvement value = mine }
	}
}

####################################
# Our Miners Have Found a New Vein #
####################################

province_event = {
	id = 5023
	
	picture = "event_default"

	trigger = {
		condition = {
			type = has_improvement
			value = { improved_mine = yes }
		}
	}

	mean_time_to_happen = {
		months = 2400
	}

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

##############################
# Our miners Exhaused a Vein #
##############################

province_event = {
	id = 5024
	
	picture = "event_default"

	trigger = {
		condition = {
			type = has_improvement
			value = { improved_mine = yes }
		}
	}

	mean_time_to_happen = {
		months = 2400
	}

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

####################################
# Disaster! Our Mine has Collapsed #
####################################

province_event = {
	id = 5025
	
	picture = "event_default"

	trigger = {
		condition = {
			type = has_improvement
			value = { improved_mine = yes }
		}
	}

	mean_time_to_happen = {
		months = 4000
	}

	action_a = {
		effect = { type = remove_improvement value = improved_mine }
	}
}

##############
# Atholl fix #
##############

province_event = { # AI event - We need a Court of Justice
	id = 5026

	picture = "event_default"

	trigger = {
		condition = { type = province value = 44 }
		condition = { type = ai }
		condition = { type = ruler_gold value = 100 }
		condition = { type = not value = { type = has_improvement value = { court_of_justice = yes } } }
	}

	mean_time_to_happen = {
		months = 60

		modifier = {
			condition = { type = has_improvement value = { thieves_guild = yes } }
			factor = 0.5
		}
		modifier = {
			condition = { type = has_improvement value = { smugglers_ring = yes } }
			factor = 0.5
		}
		modifier = {
			condition = { type = has_improvement value = { highway_robber_band = yes } }
			factor = 0.5
		}
	}

	immidiate = { # Yay!
		effect = { type = ruler_gold value = -100 }
		effect = { type = add_improvement value = court_of_justice }
	}
}

province_event = { # AI event - We need a Royal Post
	id = 5027

	picture = "event_default"

	trigger = {
		condition = { type = province value = 44 }
		condition = { type = ai }
		condition = { type = ruler_gold value = 100 }
		condition = { type = not value = { type = has_improvement value = { royal_post = yes } } }
	}

	mean_time_to_happen = {
		months = 60

		modifier = {
			condition = { type = owner condition = { type = not value = { type = efficiency value = 1.0 } } }
			factor = 0.5
		}
	}

	immidiate = { # Yay!
		effect = { type = ruler_gold value = -100 }
		effect = { type = add_improvement value = royal_post }
	}
}

province_event = { # AI event - We need a Fishing Wharf
	id = 5028

	picture = "event_default"

	trigger = {
		condition = { type = province value = 44 }
		condition = { type = ai }
		condition = { type = ruler_gold value = 100 }
		condition = { type = not value = { type = has_improvement value = { fishing_wharf = yes } } }
	}

	mean_time_to_happen = {
		months = 60

	}

	immidiate = { # Yay!
		effect = { type = ruler_gold value = -100 }
		effect = { type = add_improvement value = fishing_wharf }
	}
}

province_event = { # AI event - We need a Forestry
	id = 5029

	picture = "event_default"

	trigger = {
		condition = { type = province value = 44 }
		condition = { type = ai }
		condition = { type = ruler_gold value = 100 }
		condition = { type = not value = { type = has_improvement value = { forestry = yes } } }
	}

	mean_time_to_happen = {
		months = 60

	}

	immidiate = { # Yay!
		effect = { type = ruler_gold value = -100 }
		effect = { type = add_improvement value = forestry }
	}
}

province_event = { # AI event - We need a Sawmill
	id = 5030

	picture = "event_default"

	trigger = {
		condition = { type = province value = 44 }
		condition = { type = ai }
		condition = { type = ruler_gold value = 250 }
		condition = { type = not value = { type = has_improvement value = { sawmill = yes } } }
	}

	mean_time_to_happen = {
		months = 60

	}

	immidiate = { # Yay!
		effect = { type = ruler_gold value = -250 }
		effect = { type = add_improvement value = sawmill }
	}
}

province_event = { # AI event - We need a Hill Fort
	id = 5031

	picture = "event_default"

	trigger = {
		condition = { type = province value = 44 }
		condition = { type = ai }
		condition = { type = ruler_gold value = 200 }
		condition = { type = not value = { type = has_improvement value = { hill_fort = yes } } }
	}

	mean_time_to_happen = {
		months = 60

	}

	immidiate = { # Yay!
		effect = { type = ruler_gold value = -200 }
		effect = { type = add_improvement value = hill_fort }
	}
}

province_event = { # AI event - We need a Small Castle
	id = 5032

	picture = "event_default"

	trigger = {
		condition = { type = province value = 44 }
		condition = { type = ai }
		condition = { type = ruler_gold value = 500 }
		condition = { type = has_improvement value = { hill_fort = yes } }
		condition = { type = not value = { type = has_improvement value = { small_castle = yes } } }
		condition = { type = has_advance value = { small_castle = yes } }
	}

	mean_time_to_happen = {
		months = 60

	}

	immidiate = { # Yay!
		effect = { type = ruler_gold value = -500 }
		effect = { type = add_improvement value = small_castle }
	}
}

province_event = { # AI event - We need a Medium Castle
	id = 5033

	picture = "event_default"

	trigger = {
		condition = { type = province value = 44 }
		condition = { type = ai }
		condition = { type = ruler_gold value = 1500 }
		condition = { type = has_improvement value = { hill_fort = yes } }
		condition = { type = has_improvement value = { small_castle = yes } }
		condition = { type = not value = { type = has_improvement value = { medium_castle = yes } } }
		condition = { type = has_advance value = { medium_castle = yes } }
	}

	mean_time_to_happen = {
		months = 60

	}

	immidiate = { # Yay!
		effect = { type = ruler_gold value = -1500 }
		effect = { type = add_improvement value = medium_castle }
	}
}

province_event = { # AI event - We need a Large Castle
	id = 5034

	picture = "event_default"

	trigger = {
		condition = { type = province value = 44 }
		condition = { type = ai }
		condition = { type = ruler_gold value = 3000 }
		condition = { type = has_improvement value = { hill_fort = yes } }
		condition = { type = has_improvement value = { small_castle = yes } }
		condition = { type = has_improvement value = { medium_castle = yes } }
		condition = { type = not value = { type = has_improvement value = { large_castle = yes } } }
		condition = { type = has_advance value = { large_castle = yes } }
	}

	mean_time_to_happen = {
		months = 60

	}

	immidiate = { # Yay!
		effect = { type = ruler_gold value = -3000 }
		effect = { type = add_improvement value = large_castle }
	}
}

province_event = { # AI event - We need a Huge Castle
	id = 5035

	picture = "event_default"

	trigger = {
		condition = { type = province value = 44 }
		condition = { type = ai }
		condition = { type = ruler_gold value = 5000 }
		condition = { type = has_improvement value = { hill_fort = yes } }
		condition = { type = has_improvement value = { small_castle = yes } }
		condition = { type = has_improvement value = { medium_castle = yes } }
		condition = { type = has_improvement value = { large_castle = yes } }
		condition = { type = not value = { type = has_improvement value = { huge_castle = yes } } }
		condition = { type = has_advance value = { huge_castle = yes } }
	}

	mean_time_to_happen = {
		months = 60

	}

	immidiate = { # Yay!
		effect = { type = ruler_gold value = -5000 }
		effect = { type = add_improvement value = huge_castle }
	}
}

province_event = { # AI event - We need a Church
	id = 5036

	picture = "event_default"

	trigger = {
		condition = { type = province value = 44 }
		condition = { type = ai }
		condition = { type = ruler_gold value = 100 }
		condition = { type = has_improvement value = { tilefactory = yes } }
		condition = { type = not value = { type = has_improvement value = { church = yes } } }
		condition = { type = has_advance value = { brickwork_structures = yes } }
		condition = { type = has_advance value = { basilican_structures = yes } }
	}

	mean_time_to_happen = {
		months = 60

	}

	immidiate = { # Yay!
		effect = { type = ruler_gold value = -100 }
		effect = { type = add_improvement value = church }
	}
}

province_event = { # AI event - We need a Large Church
	id = 5037

	picture = "event_default"

	trigger = {
		condition = { type = province value = 44 }
		condition = { type = ai }
		condition = { type = ruler_gold value = 300 }
		condition = { type = has_improvement value = { tilefactory = yes } }
		condition = { type = has_improvement value = { church = yes } }
		condition = { type = not value = { type = has_improvement value = { large_church = yes } } }
		condition = { type = has_advance value = { romanesque_vaulting = yes } }
	}

	mean_time_to_happen = {
		months = 60

	}

	immidiate = { # Yay!
		effect = { type = ruler_gold value = -300 }
		effect = { type = add_improvement value = large_church }
	}
}

province_event = { # AI event - We need a Domed Church
	id = 5038

	picture = "event_default"

	trigger = {
		condition = { type = province value = 44 }
		condition = { type = ai }
		condition = { type = ruler_gold value = 600 }
		condition = { type = has_improvement value = { tilefactory = yes } }
		condition = { type = has_improvement value = { large_church = yes } }
		condition = { type = not value = { type = has_improvement value = { domed_church = yes } } }
		condition = { type = has_advance value = { cylindrical_structures = yes } }
	}

	mean_time_to_happen = {
		months = 60

	}

	immidiate = { # Yay!
		effect = { type = ruler_gold value = -600 }
		effect = { type = add_improvement value = large_church }
	}
}

province_event = { # AI event - We need a Monastery
	id = 5039

	picture = "event_default"

	trigger = {
		condition = { type = province value = 44 }
		condition = { type = ai }
		condition = { type = ruler_gold value = 200 }
		condition = { type = has_improvement value = { tilefactory = yes } }
		condition = { type = not value = { type = has_improvement value = { monastery = yes } } }
		condition = { type = has_advance value = { monastic_schools = yes } }
	}

	mean_time_to_happen = {
		months = 60

	}

	immidiate = { # Yay!
		effect = { type = ruler_gold value = -200 }
		effect = { type = add_improvement value = monastery }
	}
}

province_event = { # AI event - We need a Templar House
	id = 5040

	picture = "event_default"

	trigger = {
		condition = { type = province value = 44 }
		condition = { type = ai }
		condition = { type = ruler_gold value = 250 }
		condition = { type = has_improvement value = { monastery = yes } }
		condition = { type = not value = { type = has_improvement value = { templar_house = yes } } }
	}

	mean_time_to_happen = {
		months = 60

	}

	immidiate = { # Yay!
		effect = { type = ruler_gold value = -250 }
		effect = { type = add_improvement value = templar_house }
	}
}

province_event = { # AI event - We need a School
	id = 5041

	picture = "event_default"

	trigger = {
		condition = { type = province value = 44 }
		condition = { type = ai }
		condition = { type = ruler_gold value = 100 }
		condition = { type = not value = { type = has_improvement value = { school = yes } } }
		condition = { type = has_advance value = { monastic_schools = yes } }
	}

	mean_time_to_happen = {
		months = 60

	}

	immidiate = { # Yay!
		effect = { type = ruler_gold value = -100 }
		effect = { type = add_improvement value = school }
	}
}

province_event = { # AI event - We need a Library
	id = 5042

	picture = "event_default"

	trigger = {
		condition = { type = province value = 44 }
		condition = { type = ai }
		condition = { type = ruler_gold value = 100 }
		condition = { type = not value = { type = has_improvement value = { library = yes } } }
		condition = { type = has_advance value = { the_seven_liberal_arts = yes } }
	}

	mean_time_to_happen = {
		months = 60

	}

	immidiate = { # Yay!
		effect = { type = ruler_gold value = -100 }
		effect = { type = add_improvement value = library }
	}
}

province_event = { # AI event - We need a Tile Factory
	id = 5043

	picture = "event_default"

	trigger = {
		condition = { type = province value = 44 }
		condition = { type = ai }
		condition = { type = ruler_gold value = 100 }
		condition = { type = not value = { type = has_improvement value = { tilefactory = yes } } }
		condition = { type = has_advance value = { stonepit = yes } }
	}

	mean_time_to_happen = {
		months = 60

	}

	immidiate = { # Yay!
		effect = { type = ruler_gold value = -100 }
		effect = { type = add_improvement value = tilefactory }
	}
}

province_event = { # AI event - We need a Mine
	id = 5044

	picture = "event_default"

	trigger = {
		condition = { type = province value = 44 }
		condition = { type = ai }
		condition = { type = ruler_gold value = 100 }
		condition = { type = not value = { type = has_improvement value = { mine = yes } } }
		condition = { type = has_advance value = { coalpit = yes } }
	}

	mean_time_to_happen = {
		months = 60

	}

	immidiate = { # Yay!
		effect = { type = ruler_gold value = -100 }
		effect = { type = add_improvement value = mine }
	}
}

province_event = { # AI event - We need a Smithy
	id = 5045

	picture = "event_default"

	trigger = {
		condition = { type = province value = 44 }
		condition = { type = ai }
		condition = { type = ruler_gold value = 250 }
		condition = { type = not value = { type = has_improvement value = { smithy = yes } } }
		condition = { type = has_advance value = { ironworks = yes } }
	}

	mean_time_to_happen = {
		months = 60

	}

	immidiate = { # Yay!
		effect = { type = ruler_gold value = -250 }
		effect = { type = add_improvement value = smithy }
	}
}

province_event = { # AI event - We need a Improved Mine
	id = 5046

	picture = "event_default"

	trigger = {
		condition = { type = province value = 44 }
		condition = { type = ai }
		condition = { type = ruler_gold value = 200 }
		condition = { type = has_improvement value = { mine = yes } }
		condition = { type = not value = { type = has_improvement value = { improved_mine = yes } } }
		condition = { type = has_advance value = { percussion_drilling = yes } }
	}

	mean_time_to_happen = {
		months = 60

	}

	immidiate = { # Yay!
		effect = { type = ruler_gold value = -200 }
		effect = { type = add_improvement value = improved_mine }
	}
}

province_event = { # AI event - We need a Armoury
	id = 5047

	picture = "event_default"

	trigger = {
		condition = { type = province value = 44 }
		condition = { type = ai }
		condition = { type = ruler_gold value = 500 }
		condition = { type = has_improvement value = { smithy = yes } }
		condition = { type = not value = { type = has_improvement value = { armory = yes } } }
		condition = { type = has_advance value = { cast_iron = yes } }
		condition = { type = has_advance value = { black_coal = yes } }
	}

	mean_time_to_happen = {
		months = 60

	}

	immidiate = { # Yay!
		effect = { type = ruler_gold value = -500 }
		effect = { type = add_improvement value = armory }
	}
}

province_event = { # AI event - We need a Roadnet
	id = 5048

	picture = "event_default"

	trigger = {
		condition = { type = province value = 44 }
		condition = { type = ai }
		condition = { type = ruler_gold value = 100 }
		condition = { type = not value = { type = has_improvement value = { roadnet = yes } } }
		condition = { type = has_advance value = { road_building = yes } }
	}

	mean_time_to_happen = {
		months = 60

	}

	immidiate = { # Yay!
		effect = { type = ruler_gold value = -100 }
		effect = { type = add_improvement value = roadnet }
	}
}

province_event = { # AI event - We need a Extensive Roadnet
	id = 5049

	picture = "event_default"

	trigger = {
		condition = { type = province value = 44 }
		condition = { type = ai }
		condition = { type = ruler_gold value = 400 }
		condition = { type = has_improvement value = { roadnet = yes } }
		condition = { type = not value = { type = has_improvement value = { extensive_roadnet = yes } } }
		condition = { type = has_advance value = { road_building = yes } }
	}

	mean_time_to_happen = {
		months = 60

	}

	immidiate = { # Yay!
		effect = { type = ruler_gold value = -400 }
		effect = { type = add_improvement value = extensive_roadnet }
	}
}

province_event = { # AI event - We need a Civilian Harbour
	id = 5050

	picture = "event_default"

	trigger = {
		condition = { type = province value = 44 }
		condition = { type = ai }
		condition = { type = ruler_gold value = 200 }
		condition = { type = not value = { type = has_improvement value = { civilian_harbour = yes } } }
		condition = { type = has_advance value = { large_ship_building = yes } }
	}

	mean_time_to_happen = {
		months = 60

	}

	immidiate = { # Yay!
		effect = { type = ruler_gold value = -200 }
		effect = { type = add_improvement value = civilian_harbour }
	}
}

province_event = { # AI event - We need a Naval Harbour
	id = 5051

	picture = "event_default"

	trigger = {
		condition = { type = province value = 44 }
		condition = { type = ai }
		condition = { type = ruler_gold value = 400 }
		condition = { type = has_improvement value = { civilian_harbour = yes } }
		condition = { type = not value = { type = has_improvement value = { naval_harbour = yes } } }
	}

	mean_time_to_happen = {
		months = 60

	}

	immidiate = { # Yay!
		effect = { type = ruler_gold value = -400 }
		effect = { type = add_improvement value = naval_harbour }
	}
}

province_event = { # AI event - We need a Watermill
	id = 5052

	picture = "event_default"

	trigger = {
		condition = { type = province value = 44 }
		condition = { type = ai }
		condition = { type = ruler_gold value = 100 }
		condition = { type = not value = { type = has_improvement value = { watermills = yes } } }
		condition = { type = has_advance value = { waterwheel = yes } }
	}

	mean_time_to_happen = {
		months = 60

	}

	immidiate = { # Yay!
		effect = { type = ruler_gold value = -100 }
		effect = { type = add_improvement value = watermills }
	}
}

province_event = { # AI event - We need a Windmill
	id = 5053

	picture = "event_default"

	trigger = {
		condition = { type = province value = 44 }
		condition = { type = ai }
		condition = { type = ruler_gold value = 100 }
		condition = { type = not value = { type = has_improvement value = { windmills = yes } } }
		condition = { type = has_advance value = { windwheel = yes } }
	}

	mean_time_to_happen = {
		months = 60

	}

	immidiate = { # Yay!
		effect = { type = ruler_gold value = -100 }
		effect = { type = add_improvement value = windmills }
	}
}

province_event = { # AI event - We need a Cheese Dairy
	id = 5054

	picture = "event_default"

	trigger = {
		condition = { type = province value = 44 }
		condition = { type = ai }
		condition = { type = ruler_gold value = 200 }
		condition = { type = not value = { type = has_improvement value = { cheese_dairy = yes } } }
		condition = { type = has_advance value = { cows = yes } }
	}

	mean_time_to_happen = {
		months = 60

	}

	immidiate = { # Yay!
		effect = { type = ruler_gold value = -200 }
		effect = { type = add_improvement value = cheese_dairy }
	}
}

province_event = { # AI event - We need a Brewery
	id = 5055

	picture = "event_default"

	trigger = {
		condition = { type = province value = 44 }
		condition = { type = ai }
		condition = { type = ruler_gold value = 100 }
		condition = { type = not value = { type = has_improvement value = { brewery = yes } } }
		condition = { type = has_advance value = { sugerrefinery = yes } }
	}

	mean_time_to_happen = {
		months = 60

	}

	immidiate = { # Yay!
		effect = { type = ruler_gold value = -100 }
		effect = { type = add_improvement value = brewery }
	}
}

province_event = { # AI event - We need a Dyeworks
	id = 5056

	picture = "event_default"

	trigger = {
		condition = { type = province value = 44 }
		condition = { type = ai }
		condition = { type = ruler_gold value = 100 }
		condition = { type = not value = { type = has_improvement value = { dyeworks = yes } } }
		condition = { type = has_advance value = { clothmaking = yes } }
	}

	mean_time_to_happen = {
		months = 60

	}

	immidiate = { # Yay!
		effect = { type = ruler_gold value = -100 }
		effect = { type = add_improvement value = dyeworks }
	}
}

province_event = { # AI event - We need a Glassworks
	id = 5057

	picture = "event_default"

	trigger = {
		condition = { type = province value = 44 }
		condition = { type = ai }
		condition = { type = ruler_gold value = 100 }
		condition = { type = not value = { type = has_improvement value = { glassworks = yes } } }
		condition = { type = has_advance value = { glassblowing = yes } }
	}

	mean_time_to_happen = {
		months = 60

	}

	immidiate = { # Yay!
		effect = { type = ruler_gold value = -100 }
		effect = { type = add_improvement value = glassworks }
	}
}

province_event = { # AI event - We need a Spinningmill
	id = 5058

	picture = "event_default"

	trigger = {
		condition = { type = province value = 44 }
		condition = { type = ai }
		condition = { type = ruler_gold value = 100 }
		condition = { type = not value = { type = has_improvement value = { spinningmill = yes } } }
		condition = { type = has_advance value = { clothmaking = yes } }
	}

	mean_time_to_happen = {
		months = 60

	}

	immidiate = { # Yay!
		effect = { type = ruler_gold value = -100 }
		effect = { type = add_improvement value = spinningmill }
	}
}

province_event = { # AI event - We need a Traininggrounds
	id = 5059

	picture = "event_default"

	trigger = {
		condition = { type = province value = 44 }
		condition = { type = ai }
		condition = { type = ruler_gold value = 150 }
		condition = { type = not value = { type = has_improvement value = { traininggrounds = yes } } }
	}

	mean_time_to_happen = {
		months = 60

	}

	immidiate = { # Yay!
		effect = { type = ruler_gold value = -150 }
		effect = { type = add_improvement value = traininggrounds }
	}
}

province_event = { # AI event - We need a Moneylenders
	id = 5060

	picture = "event_default"

	trigger = {
		condition = { type = province value = 44 }
		condition = { type = ai }
		condition = { type = ruler_gold value = 100 }
		condition = { type = not value = { type = has_improvement value = { moneylenders = yes } } }
		condition = { type = has_advance value = { local_merchant_houses = yes } }
	}

	mean_time_to_happen = {
		months = 60

	}

	immidiate = { # Yay!
		effect = { type = ruler_gold value = -100 }
		effect = { type = add_improvement value = moneylenders }
	}
}