#######################################
# ilness series  4900-4999 block      #
# Last updated by Chris Stone Feb/06  #
#######################################


################################
# Character catches the plague. 
################################ 

character_event = {
	id = 4900
	
	picture = "event_plague"
	
	trigger = {
		condition = {
			type = not
			value = { type = trait value = plagueinfested }
		}
		condition = { type = or
			condition = { type = and
				condition = { type = command }
				condition = { type = location
					condition = { type = or
						condition = { type = has_province_effect value = { bubonic_plague = yes } }
						condition = { type = has_province_effect value = { pneumonic_plague = yes } }
					}
				}
			}
			condition = { type = and
				condition = { type = not value = { type = command } }
				condition = { type = or
					condition = { type = has_province_effect value = { bubonic_plague = yes } }
					condition = { type = has_province_effect value = { pneumonic_plague = yes } }
				}
			}
			condition = { type = and
				condition = { type = not value = { type = command } }
				condition = { type = age value = 16 }
				condition = { type = or
					condition = { type = ruler }
					condition = { type = steward }
					condition = { type = marshal }
					condition = { type = spymaster }
					condition = { type = chancellor }
					condition = { type = chaplain }
				}
				condition = { type = any_demesne_province
					condition = { type = or
						condition = { type = has_province_effect value = { bubonic_plague = yes } }
						condition = { type = has_province_effect value = { pneumonic_plague = yes } }
					}
				}
			}
		}
	}
	
	mean_time_to_happen = {
		months = 360
		modifier = {
			condition = { type = not value = { type = age value = 5 } }
			factor = 0.5
		}
		modifier = {
			condition = { type = age value =  50 }
			factor = 0.5
		}
		modifier = {
			condition = { type = not value = { type = health value = 2 } }
			factor = 0.2
		}
		modifier = {
			condition = { type = health value = 2 }
			condition = { type = not value = { type = health value = 4 } }
			factor = 0.5
		}
		modifier = {
			condition = { type = health value = 7 }
			condition = { type = not value = { type = health value = 9 } }
			factor = 1.1
		}
		modifier = {
			condition = { type = health value = 9 }
			factor = 1.5
		}
		modifier = {
			condition = {
				type = or
				condition = { type = trait value = detached_priest }
				condition = { type = trait value = scholarly_theologian }
			}
			factor = 1.2
		}
		modifier = {
			condition = { type = trait value = illness }
			factor = 0.5
		}
		modifier = {
			condition = { type = not value = { type = command } }
			condition = { type = court value = 10 }
			factor = 0.85
		}
		modifier = {
			condition = { type = not value = { type = command } }
			condition = { type = court value = 14 }
			factor = 0.85
		}
		modifier = {
			condition = { type = not value = { type = command } }
			condition = { type = court value = 18 }
			factor = 0.75
		}
		modifier = {
			condition = { type = not value = { type = command } }
			condition = { type = court value = 22 }
			factor = 0.75
		}
		modifier = {
			condition = { type = and
				condition = { type = command }
				condition = { type = location
					condition = { type = or
						condition = { type = has_province_effect value = { bubonic_plague = yes } }
						condition = { type = has_province_effect value = { pneumonic_plague = yes } }
					}
				}
			}
			factor = 0.33
		}
	}
	immidiate = {
		effect = { type = add_trait value = plagueinfested }
	}	
}




################################
#God punishes sins!
################################

#deleted - leper trait changed id = 4903

################################
#Sickness worses into Pneumonia 
################################

character_event = {
	id = 4904

	picture = "event_sickness"

	trigger = {
		condition = { type = trait value = illness }
		condition = { type = not value = { type = trait value = pneumonia  } }
	}

	mean_time_to_happen = {
		months = 240

		modifier = {
			condition = { type = not value = { type = age value = 5 } }
			factor = 0.5
		}
		modifier = {
			condition = { type = age value =  50 }
			factor = 0.5
		}
		modifier = {
			condition = { type = not value = { type = health value = 2 } }
			factor = 0.2
		}
		modifier = {
			condition = { type = health value = 2 }
			condition = { type = not value = { type = health value = 4 } }
			factor = 0.5
		}
		modifier = {
			condition = { type = health value = 7 }
			condition = { type = not value = { type = health value = 9 } }
			factor = 1.1
		}
		modifier = {
			condition = { type = health value = 9 }
			factor = 1.5
		}
		modifier = {
			condition = {
				type = or
				condition = { type = trait value = detached_priest }
				condition = { type = trait value = scholarly_theologian }
			}
			factor = 1.2
		}
	}

	#Intense coughing.
	immidiate = {
		effect = { type = remove_trait value = illness }
		effect = { type = add_trait value = pneumonia }
	}

}


################################
# Worms cause of sickness.
################################
#event deleted - trait changed id = 4905

###########################################
# Intense Stress causes Severe Depression 
###########################################
character_event = {
	id = 4906

	picture = "event_sickness"

	trigger = {
		condition = { type = trait value = stress_symptom }
		condition = { type = not value = { type = trait value = depression  } }
		condition = { type = age value = 5 }
	}

	mean_time_to_happen = {
		months = 120

		modifier = {
			condition = { type = trait value = honest }
			factor = 0.8
		}
		modifier = {
			condition = { type = trait value = generous }
			factor = 0.8
		}
		modifier = {
			condition = { type = trait value = suspicious }
			factor = 1.2
		}
		modifier = {
			condition = { type = not value = { type = age value = 10 } }
			factor = 5
		}
		modifier = {
			condition = { type = age value = 10 }
			condition = { type = not value = { type = age value = 13 } }
			factor = 2.5
		}
		modifier = {
			condition = { type = age value = 13 }
			condition = { type = not value = { type = age value = 16 } }
			factor = 1.75
		}
	}

	#The Sun will never rise again!
	immidiate = {
		effect = { type = remove_trait value = stress_symptom }
		effect = { type = add_trait value = depression }
	}

}



###########################################
# There are voices in my head. 
###########################################
character_event = {
	id = 4907

	picture = "event_sickness"

	trigger = {
		condition = { type = trait value = stress_symptom }
		condition = { type = not value = { type = trait value = schizofrenia  } }
		condition = { type = age value = 10 }
	}

	mean_time_to_happen = {
		months = 480

		modifier = {
			condition = { type = trait value = arbitrary }
			factor = 0.9
		}
		modifier = {
			condition = { type = trait value = deceitful }
			factor = 0.8
		}
		modifier = {
			condition = { type = trait value = selfish }
			factor = 0.8
		}
		modifier = {
			condition = { type = trait value = suspicious }
			factor = 0.8
		}

		modifier = {
			condition = { type = trait value = vengeful }
			factor = 0.8
		}
		modifier = {
			condition = { type = not value = { type = age value = 12 } }
			factor = 5
		}
		modifier = {
			condition = { type = age value = 12 }
			condition = { type = not value = { type = age value = 14 } }
			factor = 2.5
		}
		modifier = {
			condition = { type = age value = 14 }
			condition = { type = not value = { type = age value = 16 } }
			factor = 1.75
		}
	}

	#We no longer agree with Me, Myself and I!
	immidiate = {
		effect = { type = remove_trait value = stress_symptom }
		effect = { type = add_trait value = schizofrenia }
	}

}


###########################################
# The stress goes over into madness. 
###########################################
character_event = {
	id = 4908

	picture = "event_sickness"

	trigger = {
		condition = { type = trait value = stress_symptom }
		condition = { type = not value = { type = trait value = maniac  } }
		condition = { type = age value = 12 }
	}

	mean_time_to_happen = {
		months = 480

		modifier = {
			condition = { type = trait value = kinslayer }
			factor = 0.8
		}

		modifier = {
			condition = { type = trait value = selfish }
			factor = 0.8
		}
		modifier = {
			condition = { type = trait value = energetic }
			factor = 0.8
		}
		modifier = {
			condition = { type = trait value = proud }
			factor = 0.8
		}
		modifier = {
			condition = { type = trait value = zealous }
			factor = 0.8
		}
		modifier = {
			condition = { type = not value = { type = age value = 14 } }
			factor = 2.5
		}
		modifier = {
			condition = { type = age value = 14 }
			condition = { type = not value = { type = age value = 17 } }
			factor = 1.75
		}
	}

	#Muahahahahah!
	immidiate = {
		effect = { type = remove_trait value = stress_symptom }
		effect = { type = add_trait value = maniac }
	}

}

##################################
# MASQUE OF THE RED DEATH SERIES #
##################################

##########################
# DEATH COMES A-KNOCKING #
##########################

character_event = { #There is wide-spread fever in the countryside.

	id = 4910
	picture = "event_sickness"

	trigger = {
		condition = { type = difficulty value = 1 }
		condition = { type = not value = { type = trait value = illness } }
		condition = { type = not value = { type = trait value = plagueinfested } }
		condition = { type = not value = { type = trait value = pneumonia } }
		condition = { type = or
			condition = { type = and
				condition = { type = ruler }
				condition = {
					type = or
					condition = {
						type = and
						condition = { type = county }
						condition = { type = court value = 20 }
					}
					condition = {
						type = and
						condition = { type = duchy }
						condition = { type = court value = 25 }
					}
					condition = {
						type = and
						condition = { type = kingdom }
						condition = { type = court value = 30 }
					}
				}
			}
			condition = { type = and
				condition = { type = not value = { type = ruler } }
				condition = { type = ruler_csc
					condition = {
						type = or
						condition = {
							type = and
							condition = { type = county }
							condition = { type = court value = 20 }
						}
						condition = {
							type = and
							condition = { type = duchy }
							condition = { type = court value = 25 }
						}
						condition = {
							type = and
							condition = { type = kingdom }
							condition = { type = court value = 30 }
						}
					}
				}
			}
		}
		condition = { type = or
			condition = { type = and
				condition = { type = command }
				condition = { type = location
					condition = { type = or
						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 = and
				condition = { type = not value = { type = command } }
				condition = { type = or
					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 = and
						condition = { type = or
							condition = { type = ruler }
							condition = { type = and
								condition = { type = not value = { type = ai } }
								condition = { type = age value = 16 }
								condition = { type = or
									condition = { type = marshal }
									condition = { type = steward }
									condition = { type = chancellor }
									condition = { type = spymaster }
									condition = { type = chaplain }
									condition = { type = ruler_child }
								}
							}
						}
						condition = { type = any_demesne_province
							condition = { type = or
								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 } }
							}
						}
					}
				}
			}
		}
	}

	mean_time_to_happen = {
		months = 1200

		modifier = {
			condition = { type = not value = { type = difficulty value = 2 } }
			factor = 1.5
		}
		modifier = {
			condition = { type = difficulty value = 3 }
			factor = 0.9
		}
		modifier = {
			condition = { type = difficulty value = 4 }
			factor = 0.9
		}
		modifier = {
			condition = { type = has_province_effect value = { struggling = yes } }
			factor = 0.8
		}
		modifier = {
			condition = { type = has_province_effect value = { poor = yes } }
			factor = 0.9
		}
		modifier = {
			condition = { type = has_province_effect value = { prosperous = yes } }
			factor = 1.1
		}
		modifier = {
			condition = { type = has_province_effect value = { rich = yes } }
			factor = 1.2
		}
		modifier = {
			condition = { type = not value = { type = health value = 8 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = health value = 6 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = health value = 4 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = health value = 2 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = health value = 1 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = health value = 8 }
			factor = 1.1
		}
		modifier = {
			condition = { type = health value = 9 }
			factor = 1.1
		}
		modifier = {
			condition = { type = health value = 10 }
			factor = 1.1
		}
		modifier = {
			condition = { type = not value = { type = age value = 5 } }
			factor = 0.5
		}
		modifier = {
			condition = { type = not value = { type = age value = 10 } }
			factor = 0.75
		}
		modifier = {
			condition = { type = age value = 40 }
			factor = 0.75
		}
		modifier = {
			condition = { type = age value = 50 }
			factor = 0.5
		}
		modifier = {
			condition = { type = marshal }
			factor = 1.5
		}
		modifier = {
			condition = { type = steward }
			factor = 1.5
		}
		modifier = {
			condition = { type = chancellor }
			factor = 1.5
		}
		modifier = {
			condition = { type = spymaster }
			factor = 1.5
		}
		modifier = {
			condition = { type = chaplain }
			factor = 1.5
		}
		modifier = {
			condition = { type = ruler }
			factor = 1.75
		}
		modifier = {
			condition = { type = ruler_child }
			factor = 2
		}
		modifier = {
			condition = {
				type = or
				condition = { type = trait value = detached_priest }
				condition = { type = trait value = scholarly_theologian }
			}
			factor = 1.2
		}
		modifier = {
			condition = { type = command }
			condition = { type = location
				condition = { type = or
					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.25
		}
	}

	immidiate = { # This can't be good!
		effect = { type = add_trait value = illness }
	}
}

######################
# Death on the prowl #
######################

character_event = { #It seems that this disease is spreading through the court!

	id = 4911
	picture = "event_sickness"

	trigger = {
		condition = { type = not value = { type = command } }
		condition = { type = difficulty value = 1 }
		condition = { type = not value = { type = trait value = illness } }
		condition = { type = not value = { type = trait value = plagueinfested } }
		condition = { type = not value = { type = trait value = pneumonia } }
		condition = { type = or
			condition = { type = and
				condition = { type = ruler }
				condition = {
					type = or
					condition = {
						type = and
						condition = { type = county }
						condition = { type = court value = 20 }
					}
					condition = {
						type = and
						condition = { type = duchy }
						condition = { type = court value = 25 }
					}
					condition = {
						type = and
						condition = { type = kingdom }
						condition = { type = court value = 30 }
					}
				}
			}
			condition = { type = and
				condition = { type = not value = { type = ruler } }
				condition = { type = ruler_csc
					condition = {
						type = or
						condition = {
							type = and
							condition = { type = county }
							condition = { type = court value = 20 }
						}
						condition = {
							type = and
							condition = { type = duchy }
							condition = { type = court value = 25 }
						}
						condition = {
							type = and
							condition = { type = kingdom }
							condition = { type = court value = 30 }
						}
					}
				}
			}
		}
		condition = {
			type = any_courtier
			condition = { type = and
				condition = { type = not value = { type = command } }
				condition = {
					type = or
					condition = { type = trait value = illness }
					condition = { type = trait value = pneumonia }
				}
			}
		}
	}

	mean_time_to_happen = {
		months = 600

		modifier = {
			condition = { type = not value = { type = difficulty value = 2 } }
			factor = 1.5
		}
		modifier = {
			condition = { type = difficulty value = 3 }
			factor = 0.9
		}
		modifier = {
			condition = { type = difficulty value = 4 }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = health value = 7 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = health value = 5 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = health value = 3 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = health value = 1 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = age value = 5 } }
			factor = 0.5
		}
		modifier = {
			condition = { type = not value = { type = age value = 10 } }
			factor = 0.75
		}
		modifier = {
			condition = { type = age value = 40 }
			factor = 0.75
		}
		modifier = {
			condition = { type = age value = 50 }
			factor = 0.5
		}
		modifier = {
			condition = { type = marshal }
			factor = 1.5
		}
		modifier = {
			condition = { type = steward }
			factor = 1.5
		}
		modifier = {
			condition = { type = chancellor }
			factor = 1.5
		}
		modifier = {
			condition = { type = spymaster }
			factor = 1.5
		}
		modifier = {
			condition = { type = chaplain }
			factor = 1.5
		}
		modifier = {
			condition = { type = ruler }
			factor = 1.75
		}
		modifier = {
			condition = { type = ruler_child }
			factor = 2
		}
		modifier = {
			condition = {
				type = or
				condition = { type = trait value = detached_priest }
				condition = { type = trait value = scholarly_theologian }
			}
			factor = 1.2
		}
	}

	immidiate = { # The court may soon be in a shambles!
		effect = { type = add_trait value = illness }
	}
}

##################
# THE WHITE ROOM #
##################

character_event = { # This is a particularly nasty illness!
	id = 4912
	picture = "event_sickness"

	trigger = {
		condition = { type = difficulty value = 1 }
		condition = { type = trait value = illness }
		condition = { type = not value = { type = trait value = plagueinfested } }
		condition = { type = not value = { type = trait value = pneumonia } }
		condition = { type = or
			condition = { type = and
				condition = { type = ruler }
				condition = {
					type = or
					condition = {
						type = and
						condition = { type = county }
						condition = { type = court value = 20 }
					}
					condition = {
						type = and
						condition = { type = duchy }
						condition = { type = court value = 25 }
					}
					condition = {
						type = and
						condition = { type = kingdom }
						condition = { type = court value = 30 }
					}
				}
			}
			condition = { type = and
				condition = { type = not value = { type = ruler } }
				condition = { type = ruler_csc
					condition = {
						type = or
						condition = {
							type = and
							condition = { type = county }
							condition = { type = court value = 20 }
						}
						condition = {
							type = and
							condition = { type = duchy }
							condition = { type = court value = 25 }
						}
						condition = {
							type = and
							condition = { type = kingdom }
							condition = { type = court value = 30 }
						}
					}
				}
			}
		}
	}

	mean_time_to_happen = {
		months = 240

		modifier = {
			condition = { type = not value = { type = difficulty value = 2 } }
			factor = 1.5
		}
		modifier = {
			condition = { type = difficulty value = 3 }
			factor = 0.9
		}
		modifier = {
			condition = { type = difficulty value = 4 }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = health value = 5 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = health value = 4 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = health value = 3 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = health value = 2 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = health value = 1 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = health value = 8 }
			factor = 1.1
		}
		modifier = {
			condition = { type = health value = 9 }
			factor = 1.1
		}
		modifier = {
			condition = { type = health value = 10 }
			factor = 1.1
		}
		modifier = {
			condition = { type = not value = { type = age value = 5 } }
			factor = 0.5
		}
		modifier = {
			condition = { type = not value = { type = age value = 10 } }
			factor = 0.75
		}
		modifier = {
			condition = { type = age value = 40 }
			factor = 0.75
		}
		modifier = {
			condition = { type = age value = 50 }
			factor = 0.5
		}
		modifier = {
			condition = { type = marshal }
			factor = 1.5
		}
		modifier = {
			condition = { type = steward }
			factor = 1.5
		}
		modifier = {
			condition = { type = chancellor }
			factor = 1.5
		}
		modifier = {
			condition = { type = spymaster }
			factor = 1.5
		}
		modifier = {
			condition = { type = chaplain }
			factor = 1.5
		}
		modifier = {
			condition = { type = ruler }
			factor = 1.75
		}
		modifier = {
			condition = { type = ruler_child }
			factor = 2
		}
		modifier = {
			condition = {
				type = or
				condition = { type = trait value = detached_priest }
				condition = { type = trait value = scholarly_theologian }
			}
			factor = 1.2
		}
	}

	immidiate = { # God save us all!
		effect = { type = remove_trait value = illness }
		effect = { type = add_trait value = pneumonia }
	}
}

################
# THE RED ROOM #
################

character_event = { # There is no hope remaining for this one
	id = 4913
	picture = "event_death"

	trigger = {
		condition = { type = difficulty value = 1 }
		condition = { type = trait value = pneumonia }
		condition = { type = or
			condition = { type = and
				condition = { type = ruler }
				condition = {
					type = or
					condition = {
						type = and
						condition = { type = county }
						condition = { type = court value = 15}
					}
					condition = {
						type = and
						condition = { type = duchy }
						condition = { type = court value = 20 }
					}
					condition = {
						type = and
						condition = { type = kingdom }
						condition = { type = court value = 25 }
					}
				}
			}
			condition = { type = and
				condition = { type = not value = { type = ruler } }
				condition = { type = ruler_csc
					condition = {
						type = or
						condition = {
							type = and
							condition = { type = county }
							condition = { type = court value = 15 }
						}
						condition = {
							type = and
							condition = { type = duchy }
							condition = { type = court value = 20 }
						}
						condition = {
							type = and
							condition = { type = kingdom }
							condition = { type = court value = 25 }
						}
					}
				}
			}
		}
	}

	mean_time_to_happen = {
		months = 60

		modifier = {
			condition = { type = not value = { type = difficulty value = 2 } }
			factor = 1.5
		}
		modifier = {
			condition = { type = difficulty value = 3 }
			factor = 0.9
		}
		modifier = {
			condition = { type = difficulty value = 4 }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = health value = 5 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = health value = 4 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = health value = 3 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = health value = 2 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = health value = 1 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = health value = 8 }
			factor = 1.1
		}
		modifier = {
			condition = { type = health value = 9 }
			factor = 1.1
		}
		modifier = {
			condition = { type = health value = 10 }
			factor = 1.1
		}
		modifier = {
			condition = { type = not value = { type = age value = 5 } }
			factor = 0.5
		}
		modifier = {
			condition = { type = not value = { type = age value = 10 } }
			factor = 0.75
		}
		modifier = {
			condition = { type = age value = 40 }
			factor = 0.75
		}
		modifier = {
			condition = { type = age value = 50 }
			factor = 0.5
		}
		modifier = {
			condition = { type = marshal }
			factor = 1.5
		}
		modifier = {
			condition = { type = steward }
			factor = 1.5
		}
		modifier = {
			condition = { type = chancellor }
			factor = 1.5
		}
		modifier = {
			condition = { type = spymaster }
			factor = 1.5
		}
		modifier = {
			condition = { type = chaplain }
			factor = 1.5
		}
		modifier = {
			condition = { type = ruler }
			factor = 1.75
		}
		modifier = {
			condition = { type = ruler_child }
			factor = 2
		}
		modifier = {
			condition = {
				type = or
				condition = { type = trait value = detached_priest }
				condition = { type = trait value = scholarly_theologian }
			}
			factor = 1.2
		}
	}

	immidiate = { # Soon there may be no one left!
		effect = { type = death }
	}
}


##############
# Recovery 1 #
##############

character_event = { # A miracle-worker offers to heal you

	id = 4914
	picture = "event_sickness"

	trigger = {
		condition = { type = trait value = illness }
		condition = { type = piety value = 0 }
		condition = { type = not value = { type = trait value = plagueinfested } }
		condition = { type = not value = { type = trait value = pneumonia } }
		condition = { type = or
			condition = { type = and
				condition = { type = ruler }
				condition = {
					type = or
					condition = {
						type = and
						condition = { type = county }
						condition = { type = not value = { type = court value = 15 } }
					}
					condition = {
						type = and
						condition = { type = duchy }
						condition = { type = not value = { type = court value = 20 } }
					}
					condition = {
						type = and
						condition = { type = kingdom }
						condition = { type = not value = { type = court value = 25 } }
					}
				}
			}
			condition = { type = and
				condition = { type = not value = { type = ruler } }
				condition = { type = ruler_csc
					condition = {
						type = or
						condition = {
							type = and
							condition = { type = county }
							condition = { type = not value = { type = court value = 15 } }
						}
						condition = {
							type = and
							condition = { type = duchy }
							condition = { type = not value = { type = court value = 20 } }
						}
						condition = {
							type = and
							condition = { type = kingdom }
							condition = { type = not value = { type = court value = 25 } }
						}
					}
				}
			}
		}
	}

	mean_time_to_happen = {
		months = 24

		modifier = {
			condition = { type = not value = { type = difficulty value = 2 } }
			factor = 0.75
		}
		modifier = {
			condition = { type = difficulty value = 3 }
			factor = 1.15
		}
		modifier = {
			condition = { type = difficulty value = 4 }
			factor = 2
		}
		modifier = {
			condition = { type = piety value = 25 }
			factor = 0.9
		}
		modifier = {
			condition = { type = piety value = 50 }
			factor = 0.9
		}
		modifier = {
			condition = { type = piety value = 100 }
			factor = 0.9
		}
		modifier = {
			condition = { type = ruler }
			condition = { type = not value = { type = court value = 8 } }
			factor = 0.75
		}
		modifier = {
			condition = { type = ruler }
			condition = { type = not value = { type = court value = 6 } }
			factor = 0.5
		}
		modifier = {
			condition = { type = ruler }
			condition = { type = not value = { type = court value = 4 } }
			factor = 0.1
		}
		modifier = {
			condition = { type = not value = { type = ruler } }
			condition = { type = ruler_csc
				condition = { type = not value = { type = court value = 5 } }
			}
			factor = 0.1
		}
		modifier = {
			condition = { type = marshal }
			factor = 0.85
		}
		modifier = {
			condition = { type = steward }
			factor = 0.85
		}
		modifier = {
			condition = { type = chancellor }
			factor = 0.85
		}
		modifier = {
			condition = { type = spymaster }
			factor = 0.85
		}
		modifier = {
			condition = { type = chaplain }
			factor = 0.85
		}
		modifier = {
			condition = { type = ruler }
			factor = 0.75
		}
		modifier = {
			condition = { type = ruler_child }
			factor = 0.75
		}
	}

	action_a = { # I would gladly pay to have my health restored!
		effect = { type = gold value = -10 }
		effect = {
			type = random
			chance = 75
			effect = { type = remove_trait value = illness }
		}
	}
	action_b = { # I implore you to heal me out of the godness of your heart!
		effect = { type = prestige value = -10 }
		effect = {
			type = random
			chance = 33
			effect = { type = remove_trait value = illness }
		}
	}
	action_c = { # I will put my trust in God!
		effect = { type = piety value = 5 }
		effect = {
			type = random
			chance = 50 #note that net effect of the two chances is to give you 25% chance of being cured
			effect = { type = remove_trait value = illness }
		}
		effect = {
			type = random
			chance = 50
			effect = { type = remove_trait value = illness }
			effect = { type = add_trait value = pneumonia }
		}
	}
}

##############
# Recovery 2 #
##############

character_event = { # A miracle-worker offers to heal you

	id = 4915
	picture = "event_sickness"

	trigger = {
		condition = { type = trait value = pneumonia }
		condition = { type = piety value = 0 }
		condition = { type = or
			condition = { type = and
				condition = { type = ruler }
				condition = {
					type = or
					condition = {
						type = and
						condition = { type = county }
						condition = { type = not value = { type = court value = 15 } }
					}
					condition = {
						type = and
						condition = { type = duchy }
						condition = { type = not value = { type = court value = 20 } }
					}
					condition = {
						type = and
						condition = { type = kingdom }
						condition = { type = not value = { type = court value = 25 } }
					}
				}
			}
			condition = { type = and
				condition = { type = not value = { type = ruler } }
				condition = { type = ruler_csc
					condition = {
						type = or
						condition = {
							type = and
							condition = { type = county }
							condition = { type = not value = { type = court value = 15 } }
						}
						condition = {
							type = and
							condition = { type = duchy }
							condition = { type = not value = { type = court value = 20 } }
						}
						condition = {
							type = and
							condition = { type = kingdom }
							condition = { type = not value = { type = court value = 25 } }
						}
					}
				}
			}
		}
	}

	mean_time_to_happen = {
		months = 36

		modifier = {
			condition = { type = not value = { type = difficulty value = 2 } }
			factor = 0.75
		}
		modifier = {
			condition = { type = difficulty value = 3 }
			factor = 1.15
		}
		modifier = {
			condition = { type = difficulty value = 4 }
			factor = 2
		}
		modifier = {
			condition = { type = piety value = 25 }
			factor = 0.9
		}
		modifier = {
			condition = { type = piety value = 50 }
			factor = 0.9
		}
		modifier = {
			condition = { type = piety value = 100 }
			factor = 0.9
		}
		modifier = {
			condition = { type = ruler }
			condition = { type = not value = { type = court value = 8 } }
			factor = 0.75
		}
		modifier = {
			condition = { type = ruler }
			condition = { type = not value = { type = court value = 6 } }
			factor = 0.5
		}
		modifier = {
			condition = { type = ruler }
			condition = { type = not value = { type = court value = 4 } }
			factor = 0.1
		}
		modifier = {
			condition = { type = not value = { type = ruler } }
			condition = { type = ruler_csc
				condition = { type = not value = { type = court value = 5 } }
			}
			factor = 0.1
		}
		modifier = {
			condition = { type = marshal }
			factor = 0.85
		}
		modifier = {
			condition = { type = steward }
			factor = 0.85
		}
		modifier = {
			condition = { type = chancellor }
			factor = 0.85
		}
		modifier = {
			condition = { type = spymaster }
			factor = 0.85
		}
		modifier = {
			condition = { type = chaplain }
			factor = 0.85
		}
		modifier = {
			condition = { type = ruler }
			factor = 0.75
		}
		modifier = {
			condition = { type = ruler_child }
			factor = 0.75
		}
	}

	action_a = { # I would gladly pay to have my health restored!
		effect = { type = gold value = -25 }
		effect = {
			type = random
			chance = 75
			effect = { type = remove_trait value = pneumonia }
		}
	}
	action_b = { # I beg you to heal me out of the godness of your heart!
		effect = { type = prestige value = -25 }
		effect = {
			type = random
			chance = 33
			effect = { type = remove_trait value = pneumonia }
		}
	}
	action_c = { # I will put my trust in God!
		effect = { type = piety value = 10 }
		effect = {
			type = random
			chance = 50
			effect = { type = remove_trait value = pneumonia }
		}
		effect = {
			type = random
			chance = 50
			effect = { type = remove_trait value = pneumonia }
			effect = { type = add_trait value = illness }
		}
		effect = {
			type = random
			chance = 25
			effect = { type = death }
		}
	}
}

######################
# Death on the prowl #
######################

character_event = { #It seems that this disease is spreading through the court!

	id = 4916
	picture = "event_sickness"

	trigger = {
		condition = { type = not value = { type = command } }
		condition = { type = difficulty value = 1 }
		condition = { type = not value = { type = health value = 5 } }
		condition = { type = not value = { type = trait value = illness } }
		condition = { type = not value = { type = trait value = plagueinfested } }
		condition = { type = not value = { type = trait value = pneumonia } }
		condition = { type = or
			condition = { type = and
				condition = { type = ruler }
				condition = {
					type = or
					condition = {
						type = and
						condition = { type = county }
						condition = { type = court value = 20 }
					}
					condition = {
						type = and
						condition = { type = duchy }
						condition = { type = court value = 25 }
					}
					condition = {
						type = and
						condition = { type = kingdom }
						condition = { type = court value = 30 }
					}
				}
			}
			condition = { type = and
				condition = { type = not value = { type = ruler } }
				condition = { type = ruler_csc
					condition = {
						type = or
						condition = {
							type = and
							condition = { type = county }
							condition = { type = court value = 20 }
						}
						condition = {
							type = and
							condition = { type = duchy }
							condition = { type = court value = 25 }
						}
						condition = {
							type = and
							condition = { type = kingdom }
							condition = { type = court value = 30 }
						}
					}
				}
			}
		}
		condition = {
			type = any_courtier
			condition = { type = and
				condition = { type = not value = { type = command } }
				condition = { type = trait value = plagueinfested }
			}
		}
	}

	mean_time_to_happen = {
		months = 180

		modifier = {
			condition = { type = not value = { type = difficulty value = 2 } }
			factor = 1.5
		}
		modifier = {
			condition = { type = difficulty value = 3 }
			factor = 0.9
		}
		modifier = {
			condition = { type = difficulty value = 4 }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = health value = 4 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = health value = 3 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = health value = 2 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = health value = 1 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = age value = 5 } }
			factor = 0.5
		}
		modifier = {
			condition = { type = not value = { type = age value = 10 } }
			factor = 0.75
		}
		modifier = {
			condition = { type = age value = 40 }
			factor = 0.75
		}
		modifier = {
			condition = { type = age value = 50 }
			factor = 0.5
		}
		modifier = {
			condition = {
				type = or
				condition = { type = trait value = detached_priest }
				condition = { type = trait value = scholarly_theologian }
			}
			factor = 1.2
		}
		modifier = {
			condition = { type = has_province_effect value = { bubonic_plague_immunity = yes } }
			factor = 10
		}
		modifier = {
			condition = { type = has_province_effect value = { pneumonic_plague_immunity = yes } }
			factor = 10
		}
		modifier = {
			condition = { type = marshal }
			factor = 1.5
		}
		modifier = {
			condition = { type = steward }
			factor = 1.5
		}
		modifier = {
			condition = { type = chancellor }
			factor = 1.5
		}
		modifier = {
			condition = { type = spymaster }
			factor = 1.5
		}
		modifier = {
			condition = { type = chaplain }
			factor = 1.5
		}
		modifier = {
			condition = { type = ruler }
			factor = 1.75
		}
		modifier = {
			condition = { type = ruler_child }
			factor = 2
		}
	}

	immidiate = { # The court may soon be in a shambles!
		effect = { type = add_trait value = illness }
		effect = {
			type = random
			chance = 33
			effect = { type = remove_trait value = illness }
			effect = { type = add_trait value = plagueinfested }
		}
	}
}

################
# THE RED ROOM #
################

character_event = { # There is no hope remaining for this one
	id = 4917
	picture = "event_death"

	trigger = {
		condition = { type = difficulty value = 1 }
		condition = { type = trait value = plagueinfested }
		condition = { type = or
			condition = { type = and
				condition = { type = ruler }
				condition = {
					type = or
					condition = {
						type = and
						condition = { type = county }
						condition = { type = court value = 15 }
					}
					condition = {
						type = and
						condition = { type = duchy }
						condition = { type = court value = 20 }
					}
					condition = {
						type = and
						condition = { type = kingdom }
						condition = { type = court value = 25 }
					}
				}
			}
			condition = { type = and
				condition = { type = not value = { type = ruler } }
				condition = { type = ruler_csc
					condition = {
						type = or
						condition = {
							type = and
							condition = { type = county }
							condition = { type = court value = 15 }
						}
						condition = {
							type = and
							condition = { type = duchy }
							condition = { type = court value = 20 }
						}
						condition = {
							type = and
							condition = { type = kingdom }
							condition = { type = court value = 25 }
						}
					}
				}
			}
		}
	}

	mean_time_to_happen = {
		months = 90

		modifier = {
			condition = { type = not value = { type = difficulty value = 2 } }
			factor = 1.5
		}
		modifier = {
			condition = { type = difficulty value = 3 }
			factor = 0.9
		}
		modifier = {
			condition = { type = difficulty value = 4 }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = health value = 5 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = health value = 4 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = health value = 3 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = health value = 2 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = health value = 1 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = health value = 8 }
			factor = 1.1
		}
		modifier = {
			condition = { type = health value = 9 }
			factor = 1.1
		}
		modifier = {
			condition = { type = health value = 10 }
			factor = 1.1
		}
		modifier = {
			condition = { type = not value = { type = age value = 5 } }
			factor = 0.5
		}
		modifier = {
			condition = { type = not value = { type = age value = 10 } }
			factor = 0.75
		}
		modifier = {
			condition = { type = age value = 40 }
			factor = 0.75
		}
		modifier = {
			condition = { type = age value = 50 }
			factor = 0.5
		}
		modifier = {
			condition = {
				type = or
				condition = { type = trait value = detached_priest }
				condition = { type = trait value = scholarly_theologian }
			}
			factor = 1.2
		}
		modifier = {
			condition = { type = marshal }
			factor = 1.5
		}
		modifier = {
			condition = { type = steward }
			factor = 1.5
		}
		modifier = {
			condition = { type = chancellor }
			factor = 1.5
		}
		modifier = {
			condition = { type = spymaster }
			factor = 1.5
		}
		modifier = {
			condition = { type = chaplain }
			factor = 1.5
		}
		modifier = {
			condition = { type = ruler }
			factor = 1.75
		}
		modifier = {
			condition = { type = ruler_child }
			factor = 2
		}
	}

	immidiate = { # Soon there may be no one left!
		effect = { type = death }
	}
}

##############
# Recovery 3 #
##############

character_event = { # A miracle-worker offers to heal you

	id = 4918
	picture = "event_sickness"

	trigger = {
		condition = { type = trait value = plagueinfested }
		condition = { type = piety value = 0 }
		condition = { type = or
			condition = { type = and
				condition = { type = ruler }
				condition = {
					type = or
					condition = {
						type = and
						condition = { type = county }
						condition = { type = not value = { type = court value = 10 } }
					}
					condition = {
						type = and
						condition = { type = duchy }
						condition = { type = not value = { type = court value = 15 } }
					}
					condition = {
						type = and
						condition = { type = kingdom }
						condition = { type = not value = { type = court value = 20 } }
					}
				}
			}
			condition = { type = and
				condition = { type = not value = { type = ruler } }
				condition = { type = ruler_csc
					condition = {
						type = or
						condition = {
							type = and
							condition = { type = county }
							condition = { type = not value = { type = court value = 10 } }
						}
						condition = {
							type = and
							condition = { type = duchy }
							condition = { type = not value = { type = court value = 15 } }
						}
						condition = {
							type = and
							condition = { type = kingdom }
							condition = { type = not value = { type = court value = 20 } }
						}
					}
				}
			}
		}
	}

	mean_time_to_happen = {
		months = 18

		modifier = {
			condition = { type = not value = { type = difficulty value = 2 } }
			factor = 0.75
		}
		modifier = {
			condition = { type = difficulty value = 3 }
			factor = 1.15
		}
		modifier = {
			condition = { type = difficulty value = 4 }
			factor = 2
		}
		modifier = {
			condition = { type = piety value = 25 }
			factor = 0.9
		}
		modifier = {
			condition = { type = piety value = 50 }
			factor = 0.9
		}
		modifier = {
			condition = { type = piety value = 100 }
			factor = 0.9
		}
		modifier = {
			condition = { type = ruler }
			condition = { type = not value = { type = court value = 8 } }
			factor = 0.75
		}
		modifier = {
			condition = { type = ruler }
			condition = { type = not value = { type = court value = 6 } }
			factor = 0.5
		}
		modifier = {
			condition = { type = ruler }
			condition = { type = not value = { type = court value = 4 } }
			factor = 0.1
		}
		modifier = {
			condition = { type = not value = { type = ruler } }
			condition = { type = ruler_csc
				condition = { type = not value = { type = court value = 5 } }
			}
			factor = 0.1
		}
		modifier = {
			condition = { type = marshal }
			factor = 0.85
		}
		modifier = {
			condition = { type = steward }
			factor = 0.85
		}
		modifier = {
			condition = { type = chancellor }
			factor = 0.85
		}
		modifier = {
			condition = { type = spymaster }
			factor = 0.85
		}
		modifier = {
			condition = { type = chaplain }
			factor = 0.85
		}
		modifier = {
			condition = { type = ruler }
			factor = 0.75
		}
		modifier = {
			condition = { type = ruler_child }
			factor = 0.75
		}
	}

	action_a = { # I would gladly pay to have my health restored!
		effect = { type = gold value = -50 }
		effect = {
			type = random
			chance = 66
			effect = { type = remove_trait value = plagueinfested }
		}
		effect = {
			type = random
			chance = 33
			effect = { type = remove_trait value = plagueinfested }
			effect = { type = add_trait value = illness }
		}
	}
	action_b = { # I beg you to heal me out of the godness of your heart!
		effect = { type = prestige value = -50 }
		effect = {
			type = random
			chance = 25
			effect = { type = remove_trait value = plagueinfested }
		}
	}
	action_c = { # I will put my trust in God!
		effect = { type = piety value = 25 }
		effect = { type = health value = -2 }
		effect = {
			type = random
			chance = 50
			effect = { type = remove_trait value = plagueinfested }
			effect = { type = add_trait value = illness }
		}
		effect = {
			type = random
			chance = 50
			effect = { type = death }
		}
	}
}


##############
# Recovery 4 #
##############

character_event = { # A miracle-worker offers to heal you

	id = 4919
	picture = "event_sickness"

	trigger = {
		condition = { type = trait value = war_invalid }
		condition = { type = piety value = 0 }
		condition = { type = or
			condition = { type = and
				condition = { type = ruler }
				condition = {
					type = or
					condition = {
						type = and
						condition = { type = county }
						condition = { type = not value = { type = court value = 10 } }
					}
					condition = {
						type = and
						condition = { type = duchy }
						condition = { type = not value = { type = court value = 15 } }
					}
					condition = {
						type = and
						condition = { type = kingdom }
						condition = { type = not value = { type = court value = 20 } }
					}
				}
			}
			condition = { type = and
				condition = { type = not value = { type = ruler } }
				condition = { type = ruler_csc
					condition = {
						type = or
						condition = {
							type = and
							condition = { type = county }
							condition = { type = not value = { type = court value = 10 } }
						}
						condition = {
							type = and
							condition = { type = duchy }
							condition = { type = not value = { type = court value = 15 } }
						}
						condition = {
							type = and
							condition = { type = kingdom }
							condition = { type = not value = { type = court value = 20 } }
						}
					}
				}
			}
		}
	}

	mean_time_to_happen = {
		months = 36

		modifier = {
			condition = { type = not value = { type = difficulty value = 2 } }
			factor = 0.75
		}
		modifier = {
			condition = { type = difficulty value = 3 }
			factor = 1.15
		}
		modifier = {
			condition = { type = difficulty value = 4 }
			factor = 2
		}
		modifier = {
			condition = { type = piety value = 25 }
			factor = 0.9
		}
		modifier = {
			condition = { type = piety value = 50 }
			factor = 0.9
		}
		modifier = {
			condition = { type = piety value = 100 }
			factor = 0.9
		}
		modifier = {
			condition = { type = ruler }
			condition = { type = not value = { type = court value = 8 } }
			factor = 0.75
		}
		modifier = {
			condition = { type = ruler }
			condition = { type = not value = { type = court value = 6 } }
			factor = 0.5
		}
		modifier = {
			condition = { type = ruler }
			condition = { type = not value = { type = court value = 4 } }
			factor = 0.1
		}
		modifier = {
			condition = { type = not value = { type = ruler } }
			condition = { type = ruler_csc
				condition = { type = not value = { type = court value = 5 } }
			}
			factor = 0.1
		}
		modifier = {
			condition = { type = marshal }
			factor = 0.85
		}
		modifier = {
			condition = { type = steward }
			factor = 0.85
		}
		modifier = {
			condition = { type = chancellor }
			factor = 0.85
		}
		modifier = {
			condition = { type = spymaster }
			factor = 0.85
		}
		modifier = {
			condition = { type = chaplain }
			factor = 0.85
		}
		modifier = {
			condition = { type = ruler }
			factor = 0.75
		}
		modifier = {
			condition = { type = ruler_child }
			factor = 0.75
		}
	}

	action_a = { # I would gladly pay to have my health restored!
		effect = { type = gold value = -50 }
		effect = {
			type = random
			chance = 66
			effect = { type = remove_trait value = war_invalid }
		}
		effect = {
			type = random
			chance = 33
			effect = { type = remove_trait value = war_invalid }
			effect = { type = add_trait value = illness }
		}
	}
	action_b = { # I beg you to heal me out of the godness of your heart!
		effect = { type = prestige value = -50 }
		effect = {
			type = random
			chance = 25
			effect = { type = remove_trait value = war_invalid }
		}
	}
	action_c = { # I will put my trust in God!
		effect = { type = piety value = 25 }
		effect = { type = health value = -2 }
		effect = {
			type = random
			chance = 50
			effect = { type = remove_trait value = war_invalid }
			effect = { type = add_trait value = illness }
		}
		effect = {
			type = random
			chance = 50
			effect = { type = death }
		}
	}
}
