############################
## CHARACTER DEATH SERIES ##
############################

###########################
# Death - Young Age  		  #
###########################

character_event = {
	id = 999

	picture = "event_plague"

	trigger = {
		condition = {
			type = not
			value = {
			  type = age value = 5
			  }
		}
	}


	mean_time_to_happen = {
		months = 450

		modifier = {
			condition = { type = trait value = illness }
			factor = 0.25
		}
		modifier = {
			condition = { type = trait value = pneumonia }
			factor = 0.005
		}
		modifier = {
			condition = { type = not value = { type = ai } }
			condition = { type = difficulty value = 1 }
			factor = 0.95
		}
		modifier = {
			condition = { type = not value = { type = ai } }
			condition = { type = difficulty value = 2 }
			factor = 0.95
		}
		modifier = {
			condition = { type = not value = { type = ai } }
			condition = { type = difficulty value = 3 }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = ai } }
			condition = { type = difficulty value = 4 }
			factor = 0.9
		}
		modifier = {
			condition = { type = health value = 14 }
			factor = 1.25
		}
		modifier = {
			condition = { type = health value = 9 }
			factor = 1.1
		}
		modifier = {
			condition = { type = not value = { type = health value = 6 } }
			factor = 0.95
		}
		modifier = {
			condition = { type = not value = { type = health value = 5 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = health value = 4 } }
			factor = 0.8
		}
		modifier = {
			condition = { type = not value = { type = health value = 3 } }
			factor = 0.7
		}
		modifier = {
			condition = { type = not value = { type = health value = 2 } }
			factor = 0.1
		}
		modifier = {
			condition = { type = not value = { type = age value = 2 } }
			factor = 0.85
		}
		modifier = { 
			condition = { type = ai }
			factor = 0.85
		}
		modifier = {
			condition = { type = court value = 15 }
			factor = 0.9
		}
		modifier = {
			condition = { type = court value = 20 }
			factor = 0.85
		}
		modifier = {
			condition = { type = court value = 30 }
			factor = 0.8
		}
		modifier = {
			condition = { type = court value = 50 }
			factor = 0.75
		}
		modifier = {
			condition = { type = ruler }
			factor = 1.5
		}
		modifier = {
			condition = { type = not value = { type = ruler } }
			condition = { type = ruler_child }
			factor = 2
		}
	}

	immidiate = {
		effect = { type = death }
	}
}



###########################
# Death - Old Age 	  #
###########################

character_event = {
	id = 998

	picture = "event_plague"

	trigger = {
		condition = { type = age value = 35 }
	}
	
	mean_time_to_happen = {
		months = 360

		modifier = {
			condition = { type = not value = { type = ai } }
			condition = { type = difficulty value = 1 }
			factor = 0.95
		}
		modifier = {
			condition = { type = not value = { type = ai } }
			condition = { type = difficulty value = 2 }
			factor = 0.95
		}
		modifier = {
			condition = { type = not value = { type = ai } }
			condition = { type = difficulty value = 3 }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = ai } }
			condition = { type = difficulty value = 4 }
			factor = 0.9
		}
		modifier = {
			condition = { type = age value = 40 }
			factor = 0.95
		}
		modifier = {
			condition = { type = age value = 45 }
			factor = 0.9
		}
		modifier = {
			condition = { type = age value = 50 }
			factor = 0.85
		}
		modifier = {
			condition = { type = age value = 55 }
			factor = 0.8
		}
		modifier = {
			condition = { type = age value = 60 }
			factor = 0.75
		}
		modifier = {
			condition = { type = age value = 65 }
			factor = 0.5
		}
		modifier = {
			condition = { type = age value = 70 }
			factor = 0.1
		}
		modifier = {
			condition = { type = age value = 80 }
			factor = 0.01
		}
		modifier = {
			condition = { type = health value = 14 }
			factor = 1.25
		}
		modifier = {
			condition = { type = health value = 10 }
			factor = 1.1
		}
		modifier = {
			condition = { type = not value = { type = health value = 6 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = health value = 5 } }
			factor = 0.8
		}
		modifier = {
			condition = { type = not value = { type = health value = 4 } }
			factor = 0.75
		}
		modifier = {
			condition = { type = not value = { type = health value = 3 } }
			factor = 0.7
		}
		modifier = {
			condition = { type = not value = { type = health value = 2 } }
			factor = 0.1
		}
		modifier = { 
			condition = { type = ai }
			factor = 0.8
		}
		modifier = {
			condition = { type = court value = 10 }
			factor = 0.9
		}
		modifier = {
			condition = { type = court value = 20 }
			factor = 0.9
		}
		modifier = {
			condition = { type = court value = 30 }
			factor = 0.9
		}
		modifier = {
			condition = { type = court value = 50 }
			factor = 0.9
		}
		modifier = {
			condition = { type = ruler }
			condition = { type = not value = { type = age value = 10 } }
			factor = 1.25
		}
		modifier = {
			condition = { type = ruler }
			condition = { type = not value = { type = age value = 50 } }
			factor = 1.25
		}
		modifier = {
			condition = { type = not value = { type = ruler } }
			condition = { type = ruler_child }
			factor = 1.15
		}
	}

	immidiate = {
		effect = { type = death }
	}
}



###########################
# Death - Old Age  		  #
###########################

character_event = {
	id = 1000

	picture = "event_plague"

	trigger = {
		condition = { type = age value = 45 }
		condition = { 
			type = or
			condition = { type = religion value = catholic	}
			condition = { type = religion value = orthodox	}
		}
		condition = {
			type = and
			condition = { type = not value = { type = trait value = excommunicated } }
			condition = { type = not value = { type = trait value = heretic } }
			condition = { type = not value = { type = trait value = sceptical } }
		}
		condition = {
			type = or
			condition = { type = trait value = chaste }
			condition = { type = trait value = forgiving }
			condition = { type = trait value = honest }
			condition = { type = trait value = just }
			condition = { type = trait value = merciful }
			condition = { type = trait value = modest }
			condition = { type = trait value = zealous }
			condition = { type = trait value = temperate }
		}
		condition = { type = piety value = 25 }
	}

	mean_time_to_happen = {
		months = 600

		modifier = {
			condition = { type = age value = 50 }
			factor = 0.9
		}
		modifier = {
			condition = { type = age value = 55 }
			factor = 0.85
		}
		modifier = {
			condition = { type = age value = 60 }
			factor = 0.75
		}
		modifier = {
			condition = { type = age value = 65 }
			factor = 0.5
		}
		modifier = {
			condition = { type = age value = 70 }
			factor = 0.1
		}
		modifier = {
			condition = { type = age value = 80 }
			factor = 0.01
		}
		modifier = {
			condition = { type = health value = 14 }
			factor = 1.25
		}
		modifier = {
			condition = { type = health value = 10 }
			factor = 1.1
		}
		modifier = {
			condition = {
				type = trait
				value = bastard
			}
			factor = 5
		}
		modifier = {
			condition = { type = not value = { type = health value = 7 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = health value = 6 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = health value = 5 } }
			factor = 0.8
		}
		modifier = {
			condition = { type = not value = { type = health value = 4 } }
			factor = 0.75
		}
		modifier = {
			condition = { type = not value = { type = health value = 3 } }
			factor = 0.7
		}
		modifier = {
			condition = { type = not value = { type = health value = 2 } }
			factor = 0.1
		}
		modifier = {
			condition = { type = piety value = 50 }
			factor = 0.9
		}
		modifier = {
			condition = { type = piety value = 100 }
			factor = 0.9
		}
		modifier = {
			condition = { type = piety value = 300 }
			factor = 0.9
		}
		modifier = {
			condition = { type = piety value = 1000 }
			factor = 0.5
		}
		modifier = { 
			condition = { type = ai }
			factor = 0.8
		}
		modifier = {
			condition = { type = court value = 10 }
			factor = 0.9
		}
		modifier = {
			condition = { type = court value = 20 }
			factor = 0.9
		}
		modifier = {
			condition = { type = court value = 30 }
			factor = 0.9
		}
		modifier = {
			condition = { type = court value = 50 }
			factor = 0.9
		}
		modifier = {
			condition = { type = ruler }
			condition = { type = not value = { type = age value = 10 } }
			factor = 1.25
		}
		modifier = {
			condition = { type = ruler }
			condition = { type = not value = { type = age value = 50 } }
			factor = 1.25
		}
		modifier = {
			condition = { type = not value = { type = ruler } }
			condition = { type = ruler_child }
			factor = 1.15
		}
	}

	immidiate = {
		effect = { type = death }
		effect = { type = add_trait value = canonized }
	}
}
###########################
# Death - Old Age  	  #
###########################

character_event = {
	id = 1127

	picture = "event_plague"

	trigger = {
		condition = { type = age value = 45 }
		condition = {
			type = not
			value = {
				type = and
				condition = { 
					type = or
					condition = { type = religion value = catholic	}
					condition = { type = religion value = orthodox	}
				}
				condition = {
					type = and
					condition = { type = not value = { type = trait value = excommunicated } }
					condition = { type = not value = { type = trait value = heretic } }
					condition = { type = not value = { type = trait value = sceptical } }
				}
				condition = {
					type = or
					condition = { type = trait value = chaste }
					condition = { type = trait value = forgiving }
					condition = { type = trait value = honest }
					condition = { type = trait value = just }
					condition = { type = trait value = merciful }
					condition = { type = trait value = modest }
					condition = { type = trait value = zealous }
					condition = { type = trait value = temperate }
				}
			}			
		}
	}

	mean_time_to_happen = {
		months = 600

		modifier = {
			condition = { type = not value = { type = ai } }
			condition = { type = difficulty value = 1 }
			factor = 0.95
		}
		modifier = {
			condition = { type = not value = { type = ai } }
			condition = { type = difficulty value = 2 }
			factor = 0.95
		}
		modifier = {
			condition = { type = not value = { type = ai } }
			condition = { type = difficulty value = 3 }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = ai } }
			condition = { type = difficulty value = 4 }
			factor = 0.9
		}
		modifier = {
			condition = { type = age value = 50 }
			factor = 0.85
		}
		modifier = {
			condition = { type = age value = 55 }
			factor = 0.8
		}
		modifier = {
			condition = { type = age value = 60 }
			factor = 0.75
		}
		modifier = {
			condition = { type = age value = 65 }
			factor = 0.5
		}
		modifier = {
			condition = { type = age value = 70 }
			factor = 0.1
		}
		modifier = {
			condition = { type = age value = 80 }
			factor = 0.01
		}
		modifier = {
			condition = { type = health value = 14 }
			factor = 1.25
		}
		modifier = {
			condition = { type = health value = 10 }
			factor = 1.1
		}

		modifier = {
			condition = { type = not value = { type = health value = 7 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = health value = 6 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = health value = 5 } }
			factor = 0.8
		}
		modifier = {
			condition = { type = not value = { type = health value = 4 } }
			factor = 0.75
		}
		modifier = {
			condition = { type = not value = { type = health value = 3 } }
			factor = 0.7
		}
		modifier = {
			condition = { type = not value = { type = health value = 2 } }
			factor = 0.1
		}
		modifier = { 
			condition = { type = ai }
			factor = 0.8
		}
		modifier = {
			condition = { type = court value = 10 }
			factor = 0.9
		}
		modifier = {
			condition = { type = court value = 20 }
			factor = 0.9
		}
		modifier = {
			condition = { type = court value = 30 }
			factor = 0.9
		}
		modifier = {
			condition = { type = court value = 50 }
			factor = 0.9
		}
		modifier = {
			condition = { type = ruler }
			condition = { type = not value = { type = age value = 10 } }
			factor = 1.25
		}
		modifier = {
			condition = { type = ruler }
			condition = { type = not value = { type = age value = 50 } }
			factor = 1.25
		}
		modifier = {
			condition = { type = not value = { type = ruler } }
			condition = { type = ruler_child }
			factor = 1.15
		}
	}

	immidiate = {
		effect = { type = death }
	}
}

################################
# Unemployed character retires #
################################

# this event is intended to help reduce the number of excess characters in various courts
# is not really all that historical and is inserted for game balance and playability reasons

character_event = { #A courtier seeks permission to retire from public service
	id = 997

	picture = "event_intrigue"

	trigger = {
		condition = { type = age value = 30 }
		condition = { type = not value = { type = is_married } }
		condition = { type = not value = { type = ruler } }
		condition = { type = not value = { type = ruler_child } }
		condition = { type = not value = { type = steward } }
		condition = { type = not value = { type = chancellor } }
		condition = { type = not value = { type = spymaster } }
		condition = { type = not value = { type = chaplain } }
		condition = { type = not value = { type = marshal } }
		condition = { type = not value = { type = command } }
		condition = { type = not value = { type = prestige value = 29 } } #to reduce repeated requests - see action b
	}

	mean_time_to_happen = {
		months = 240

		modifier = {
			condition = { type = gender value = female }
			factor = 0.5
		}
		modifier = {
			condition = {
				type = and
				condition = { type = not value = { type = diplomacy value = 6 } }
				condition = { type = not value = { type = martial value = 6 } }
				condition = { type = not value = { type = intrigue value = 6 } }
				condition = { type = not value = { type = stewardship value = 6 } }
			}
			factor = 0.5
		}
		modifier = {
			condition = {
				type = and
				condition = { type = not value = { type = diplomacy value = 3 } }
				condition = { type = not value = { type = martial value = 3 } }
				condition = { type = not value = { type = intrigue value = 3 } }
				condition = { type = not value = { type = stewardship value = 3 } }
			}
			factor = 0.5
		}
		modifier = {
			condition = {
				type = and
				condition = { type = gender value = male }
				condition = { type = martial value = 9 }
			}
			factor = 3
		}
		modifier = {
			condition = { type = diplomacy value = 9 }
			factor = 3
		}
		modifier = {
			condition = { type = stewardship value = 9 }
			factor = 3
		}
		modifier = {
			condition = { type = intrigue value = 9 }
			factor = 3
		}
		modifier = {
			condition = { type = age value = 40 }
			factor = 0.8
		}
		modifier = {
			condition = { type = age value = 50 }
			factor = 0.5
		}
		modifier = {
			condition = { type = age value = 60 }
			factor = 0.5
		}
		modifier = {
			condition = { type = county }
			condition = { type = court value = 6 }
			factor = 0.5
		}
		modifier = {
			condition = { type = county }
			condition = { type = court value = 10 }
			factor = 0.5
		}
		modifier = {
			condition = { type = duchy }
			condition = { type = court value = 8 }
			factor = 0.5
		}
		modifier = {
			condition = { type = duchy }
			condition = { type = court value = 12 }
			factor = 0.5
		}
		modifier = {
			condition = { type = kingdom }
			condition = { type = court value = 10 }
			factor = 0.5
		}
		modifier = {
			condition = { type = kingdom }
			condition = { type = court value = 15 }
			factor = 0.5
		}
	}

	action_a = { # grant the courtier's request
		ai_chance = 85
		effect = { type	= death }
	}
	action_b = { # Ask the courtier to serve you a little longer
		ai_chance = 15
		effect = { type = prestige value = 10 } #combined with trigger condition, should prevent asking to retire more than three times
	}
}


#######################################
#### Death - Illness - Cannonized #####
#######################################

character_event = {
	id = 1001

	picture = "event_sickness"

	trigger = {
		condition = {
			type = or
			condition = { type = trait value = illness }
			condition = { type = trait value = plagueinfested }
			condition = { type = trait value = pneumonia }
		}
		condition = { 
			type = or
			condition = { type = religion value = catholic	}
			condition = { type = religion value = orthodox	}
		}
		condition = {
			type = and
			condition = { type = not value = { type = trait value = excommunicated } }
			condition = { type = not value = { type = trait value = heretic } }
			condition = { type = not value = { type = trait value = sceptical } }
			condition = { type = piety value = 1 }
			condition = {
				type = or
				condition = { type = trait value = chaste }
				condition = { type = trait value = forgiving }
				condition = { type = trait value = honest }
				condition = { type = trait value = just }
				condition = { type = trait value = merciful }
				condition = { type = trait value = modest }
				condition = { type = trait value = zealous }
				condition = { type = trait value = temperate }
			}
		}
	}

	mean_time_to_happen = {
		months = 5000

		modifier = {
			condition = { type = not value = { type = ai } }
			condition = { type = difficulty value = 1 }
			factor = 0.95
		}
		modifier = {
			condition = { type = not value = { type = ai } }
			condition = { type = difficulty value = 2 }
			factor = 0.95
		}
		modifier = {
			condition = { type = not value = { type = ai } }
			condition = { type = difficulty value = 3 }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = ai } }
			condition = { type = difficulty value = 4 }
			factor = 0.9
		}
		modifier = {
			condition = { type = health value = 10 }
			factor = 1.5
		}
		modifier = {
			condition = { type = health value = 8 }
			factor = 1.1
		}
		modifier = {
			condition = { type = not value = { type = health value = 7 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = health value = 6 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = health value = 5 } }
			factor = 0.8
		}
		modifier = {
			condition = { type = not value = { type = health value = 4 } }
			factor = 0.75
		}
		modifier = {
			condition = { type = not value = { type = health value = 3 } }
			factor = 0.7
		}
		modifier = {
			condition = { type = not value = { type = health value = 2 } }
			factor = 0.1
		}
		modifier = {
			condition = { type = trait value = illness }
			factor = 1.2
		}
		modifier = {
			condition = { type = trait value = plagueinfested }
			factor = 0.3
		}
		modifier = {
			condition = { type = not value = { type = age value = 10 } }
			factor = 0.8
		}
		modifier = {
			condition = { type = not value = { type = age value = 5 } }
			factor = 0.8
		}
		modifier = {
			condition = { type = not value = { type = age value = 2 } }
			factor = 0.8
		}
	}

	immidiate = {
		effect = { type = death }
		effect = { type = add_trait value = canonized }
	}
}
###########################
#### Death - Illness  #####
###########################

character_event = {
	id = 1128

	picture = "event_sickness"

	trigger = {
		condition = {
			type = or
			condition = { type = trait value = illness }
			condition = { type = trait value = plagueinfested }
			condition = { type = trait value = pneumonia }
		}
	}

	mean_time_to_happen = {
		months = 400

		modifier = {
			condition = { type = not value = { type = ai } }
			condition = { type = difficulty value = 1 }
			factor = 0.95
		}
		modifier = {
			condition = { type = not value = { type = ai } }
			condition = { type = difficulty value = 2 }
			factor = 0.95
		}
		modifier = {
			condition = { type = not value = { type = ai } }
			condition = { type = difficulty value = 3 }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = ai } }
			condition = { type = difficulty value = 4 }
			factor = 0.9
		}
		modifier = {
			condition = { type = health value = 12 }
			factor = 1.25
		}
		modifier = {
			condition = { type = health value = 9 }
			factor = 1.1
		}
		modifier = {
			condition = { type = not value = { type = health value = 7 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = health value = 6 } }
			factor = 0.85
		}
		modifier = {
			condition = { type = not value = { type = health value = 5 } }
			factor = 0.8
		}
		modifier = {
			condition = { type = not value = { type = health value = 4 } }
			factor = 0.75
		}
		modifier = {
			condition = { type = not value = { type = health value = 3 } }
			factor = 0.7
		}
		modifier = {
			condition = { type = not value = { type = health value = 2 } }
			factor = 0.1
		}
		modifier = {
			condition = { type = trait value = pneumonia }
			factor = 0.5
		}
		modifier = {
			condition = { type = trait value = plagueinfested }
			factor = 0.15
		}
		modifier = {
			condition = { type = not value = { type = age value = 10 } }
			factor = 0.85
		}
		modifier = {
			condition = { type = not value = { type = age value = 5 } }
			factor = 0.85
		}
		modifier = {
			condition = { type = not value = { type = age value = 2 } }
			factor = 0.75
		}
		modifier = { 
			condition = { type = ai }
			factor = 0.8
		}
		modifier = {
			condition = { type = court value = 10 }
			factor = 0.9
		}
		modifier = {
			condition = { type = court value = 20 }
			factor = 0.9
		}
		modifier = {
			condition = { type = court value = 30 }
			factor = 0.9
		}
		modifier = {
			condition = { type = court value = 50 }
			factor = 0.9
		}
		modifier = {
			condition = { type = ruler }
			condition = { type = not value = { type = age value = 10 } }
			factor = 1.25
		}
		modifier = {
			condition = { type = ruler }
			condition = { type = not value = { type = age value = 50 } }
			factor = 1.25
		}
		modifier = {
			condition = { type = not value = { type = ruler } }
			condition = { type = ruler_child }
			factor = 1.5
		}
	}

	immidiate = {
		effect = { type = death }
	}
}

################################
# Death by Plague
################################
character_event = {
	id = 4901
	
	picture = "event_plague"
	
	trigger = {
		condition = { type = trait value = plagueinfested}
	}
	
	mean_time_to_happen = {
		months = 24

		modifier = {
			condition = { type = not value = { type = ai } }
			condition = { type = difficulty value = 1 }
			factor = 0.95
		}
		modifier = {
			condition = { type = not value = { type = ai } }
			condition = { type = difficulty value = 2 }
			factor = 0.95
		}
		modifier = {
			condition = { type = not value = { type = ai } }
			condition = { type = difficulty value = 3 }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = ai } }
			condition = { type = difficulty value = 4 }
			factor = 0.9
		}
		modifier = {
			condition = { type = health value = 5 }
			factor = 1.2
		}
		modifier = {
			condition = { type = health value = 6 }
			factor = 1.2
		}
		modifier = {
			condition = { type = health value = 7 }
			factor = 1.2
		}
		modifier = {
			condition = { type = health value = 8 }
			factor = 1.2
		}
		modifier = {
			condition = { type = health value = 9 }
			factor = 1.2
		}
		modifier = {
			condition = { type = health value = 10 }
			factor = 1.2
		}
		modifier = {
			condition = { type = not value = { type = age value = 10 } }
			factor = 0.8
		}
		modifier = {
			condition = { type = not value = { type = age value = 5 } }
			factor = 0.8
		}
		modifier = {
			condition = { type = not value = { type = age value = 2 } }
			factor = 0.8
		}

	}
	immidiate = {
		effect = { type = death }
	}	
}


###########################
#### Death - Suicide  #####
###########################

character_event = {
	id = 1002

	picture = "event_plague"

	trigger = {
		condition = { type = age value = 12 }
		condition = {
			type = or
			condition = { type = trait value = stress_symptom }
			condition = { type = trait value = depression }
			condition = { type = trait value = schizofrenia }
		}
	}

	mean_time_to_happen = {
		months = 500

		modifier = {
			condition = { type = trait value = depression }
			factor = 0.5
		}
		modifier = {
			condition = { type = trait value = schizofrenia }
			factor = 0.75
		}
		modifier = {
			condition = { type = not value = { type = ai } }
			condition = { type = difficulty value = 1 }
			factor = 0.95
		}
		modifier = {
			condition = { type = not value = { type = ai } }
			condition = { type = difficulty value = 2 }
			factor = 0.95
		}
		modifier = {
			condition = { type = not value = { type = ai } }
			condition = { type = difficulty value = 3 }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = ai } }
			condition = { type = difficulty value = 4 }
			factor = 0.9
		}

	}

	immidiate = {
		effect = { type = death }
	}
}

#############################
## ILLNESS RECOVERY SERIES ##
#############################

###########################
#  Recovery from Illness  #
###########################

character_event = {
	id = 1004

	picture = "event_sickness"

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

	mean_time_to_happen = {
		months = 24

		modifier = {
			condition = {
				type = not
				value = {
					type = health
					value = 5
				}
			}
			factor = 2.0
		}
		modifier = {
			condition = {
				type = not
				value = {
					type = health
					value = 3
				}
			}
			factor = 20.0
		}
	}

	action_a = {
		effect = { type = remove_trait value = illness }
	}
}
###########################
#  Recovery from Plague   #
###########################

character_event = {
	id = 1005

	picture = "event_plague"

	trigger = {
		condition = { type = trait value = plagueinfested }
	}

	mean_time_to_happen = {
		months = 12

		modifier = {
			condition = {
				type = not
				value = {
					type = health
					value = 5
				}
			}
			factor = 2.0
		}
		modifier = {
			condition = {
				type = not
				value = {
					type = health
					value = 3
				}
			}
			factor = 20.0
		}
		modifier = {
			condition = { type = location
				condition = { type = or
					condition = { type = has_province_effect value = { bubonic_plague_immunity = yes } }
					condition = { type = has_province_effect value = { pneumonic_plague_immunity = yes } }
				}
			}
			factor = 0.5
		}
	}

	action_a = {
		effect = { type = remove_trait value = plagueinfested }
		effect = { type = health value = -2 }
	}
}
###########################
#  Recovery from Leprosy  #
###########################

#removed ID 1006 - this trait now used for something else

#############################
#  Recovery from Pneumonia  #
#############################

character_event = {
	id = 1007

	picture = "event_sickness"

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

	mean_time_to_happen = {
		months = 24

		modifier = {
			condition = {
				type = not
				value = {
					type = health
					value = 5
				}
			}
			factor = 2.0
		}
		modifier = {
			condition = {
				type = not
				value = {
					type = health
					value = 3
				}
			}
			factor = 20.0
		}
	}

	action_a = {
		effect = { type = remove_trait value = pneumonia }
		effect = { type = health value = -1 }
	}
}
##################################
#  Recovery from Stress Symptom  #
##################################

character_event = {
	id = 1008

	picture = "event_plague"

	trigger = {
		condition = { type = trait value = stress_symptom }
	}

	mean_time_to_happen = {
		months = 120

		modifier = {
			condition = {
				type = not
				value = {
					type = health
					value = 5
				}
			}
			factor = 2.0
		}
		modifier = {
			condition = {
				type = not
				value = {
					type = health
					value = 3
				}
			}
			factor = 20.0
		}
		modifier = {
			condition = { type = ruler }
			condition = { type = atwar }
			factor = 2
		}
		modifier = {
			condition = { type = ruler }
			condition = { type = not value = { type = efficiency value = 0.9 } }
			factor = 1.1
		}
		modifier = {
			condition = { type = ruler }
			condition = { type = not value = { type = efficiency value = 0.7 } }
			factor = 1.1
		}
		modifier = {
			condition = { type = ruler }
			condition = { type = not value = { type = efficiency value = 0.5 } }
			factor = 1.1
		}
		modifier = {
			condition = { type = ruler }
			condition = { type = not value = { type = efficiency value = 0.3 } }
			factor = 1.15
		}
		modifier = {
			condition = { type = ruler }
			condition = { type = not value = { type = efficiency value = 0.1 } }
			factor = 1.25
		}
	}

	action_a = {
		effect = { type = remove_trait value = stress_symptom }
	}
}
##############################
#  Recovery from Depression  #
##############################

character_event = {
	id = 1009

	picture = "event_plague"

	trigger = {
		condition = { type = trait value = depression }
	}

	mean_time_to_happen = {
		months = 90

		modifier = {
			condition = {
				type = not
				value = {
					type = health
					value = 5
				}
			}
			factor = 2.0
		}
		modifier = {
			condition = {
				type = not
				value = {
					type = health
					value = 3
				}
			}
			factor = 20.0
		}
		modifier = {
			condition = { type = ruler }
			condition = { type = atwar }
			factor = 2
		}
		modifier = {
			condition = { type = ruler }
			condition = { type = not value = { type = efficiency value = 0.9 } }
			factor = 1.1
		}
		modifier = {
			condition = { type = ruler }
			condition = { type = not value = { type = efficiency value = 0.7 } }
			factor = 1.1
		}
		modifier = {
			condition = { type = ruler }
			condition = { type = not value = { type = efficiency value = 0.5 } }
			factor = 1.1
		}
		modifier = {
			condition = { type = ruler }
			condition = { type = not value = { type = efficiency value = 0.3 } }
			factor = 1.15
		}
		modifier = {
			condition = { type = ruler }
			condition = { type = not value = { type = efficiency value = 0.1 } }
			factor = 1.25
		}
	}

	action_a = {
		effect = { type = remove_trait value = depression }
	}
}
################################
#  Recovery from Schizofrenia  #
################################

character_event = {
	id = 1010

	picture = "event_plague"

	trigger = {
		condition = { type = trait value = schizofrenia }
	}

	mean_time_to_happen = {
		months = 240

		modifier = {
			condition = {
				type = not
				value = {
					type = health
					value = 5
				}
			}
			factor = 2.0
		}
		modifier = {
			condition = {
				type = not
				value = {
					type = health
					value = 3
				}
			}
			factor = 20.0
		}
	}

	action_a = {
		effect = { type = remove_trait value = schizofrenia }
	}
}
##########################
#  Recovery from Maniac  #
##########################

character_event = {
	id = 1011

	picture = "event_plague"

	trigger = {
		condition = { type = trait value = maniac }
	}

	mean_time_to_happen = {
		months = 120

		modifier = {
			condition = {
				type = not
				value = {
					type = health
					value = 5
				}
			}
			factor = 2.0
		}
		modifier = {
			condition = {
				type = not
				value = {
					type = health
					value = 3
				}
			}
			factor = 20.0
		}
	}

	action_a = {
		effect = { type = remove_trait value = maniac }
	}
}

###############################
# SCHIZOPHRENIA EVENT SERIES  #
###############################

############################
# Enemies are everywhere!  #
############################

character_event = {
	id = 1122

	picture = "event_plague"

	trigger = {
		condition = { type = trait value = schizofrenia }
		condition = { type = age value = 13 }
	}

	mean_time_to_happen = {
		months = 90
	}

	action_a = {
		effect = { type = death value = random_vassal }
		effect = { type = death value = random_courtier }
	}
}
############################
# Everybody is after me!  #
############################

character_event = {
	id = 1123

	picture = "event_plague"

	trigger = {
		condition = { 
			type = any_child
			condition = { type = gender value = male }
		}
		condition = { type = trait value = schizofrenia }
	}

	mean_time_to_happen = {
		months = 90
	}

	action_a = {
		effect = { type = death value = random_son }
		effect = { type = add_trait value = kinslayer }
	}
}
#########################################
# Periods of Catatonic Schizofrenia!    #
#########################################

character_event = {
	id = 1124

	picture = "event_plague"

	trigger = {
		condition = { type = trait value = schizofrenia }
	}

	mean_time_to_happen = {
		months = 90
	}

	action_a = {
		effect = { type = fertility value = -5 }
		effect = { type = health value = -3 }
		effect = { type = diplomacy value = -5 }
		effect = { type = martial value = -5 }
		effect = { type = intrigue value = -5 }
		effect = { type = stewardship value = -5 }
	}
}
###################################
# Angels speak to you!  		  #
###################################

character_event = {
	id = 1125

	picture = "event_plague"

	trigger = {
		condition = { type = trait value = schizofrenia }
		condition = { type = not value = { type = trait value = zealous } }
		condition = { type = not value = { type = trait value = chaste } }
		condition = { type = not value = { type = trait value = modest } }
		condition = { type = not value = { type = trait value = temperate } }
	}

	mean_time_to_happen = {
		months = 90
	}

	action_a = {
		effect = { type = piety value = 75 }
		effect = { type = add_trait value = zealous }
		effect = { type = add_trait value = chaste }
		effect = { type = add_trait value = modest }
		effect = { type = add_trait value = temperate }
	}
}
############################
# Locked up for good!  	   #
############################

character_event = {
	id = 1126

	picture = "event_plague"

	trigger = {
		condition = { type = trait value = schizofrenia }
	}

	mean_time_to_happen = {
		months = 90
	}

	immidiate = {
		effect = { type = death }
	}
}
###########################
# MANIAC EVENT SERIES	  #
###########################

#########################################
# Let us rebuild the Tower of Babylon!  #
#########################################

character_event = {
	id = 1129

	picture = "event_plague"

	trigger = {
		condition = { type = trait value = maniac }
		condition = { type = ruler }
		condition = { type = age value = 13 }
	}

	mean_time_to_happen = {
		months = 90
	}

	action_a = {
		effect = { type = gold scale = -1 }
	}
}
#############################################
# I have been called! I am the Messias!  	#
#############################################

character_event = {
	id = 1130

	picture = "event_plague"

	trigger = {
		condition = { type = trait value = maniac }
		condition = { type = not value = { type = trait value = heretic } }
		condition = { type = not value = { type = trait value = zealous } }
		condition = { type = not value = { type = trait value = proud } }
		condition = { type = age value = 15 }
	}

	mean_time_to_happen = {
		months = 90
	}

	action_a = {
		effect = { type = add_trait value = heretic }
		effect = { type = add_trait value = zealous }
		effect = { type = add_trait value = proud }
	}
}
###########################
# Deep Depression		  #
###########################

character_event = {
	id = 1131

	picture = "event_plague"

	trigger = {
		condition = { type = trait value = maniac }
		condition = { type = not value = { type = trait value = depression } }
	}

	mean_time_to_happen = {
		months = 90
	}

	action_a = {
		effect = { type = add_trait value = depression }
	}
}
##################################
# Sociopath behaviour			 #
##################################

character_event = {
	id = 1132

	picture = "event_plague"

	trigger = {
		condition = { type = trait value = maniac }
		condition = { type = age value = 11 }
		condition = { type = not value = { type = trait value = selfish } }
		condition = { type = not value = { type = trait value = deceitful } }
		condition = { type = not value = { type = trait value = arbitrary } }
		condition = { type = not value = { type = trait value = cruel } }
	}

	mean_time_to_happen = {
		months = 90
	}

	action_a = {
		effect = { type = add_trait value = selfish }
		effect = { type = add_trait value = deceitful }
		effect = { type = add_trait value = arbitrary }
		effect = { type = add_trait value = cruel }
	}
}
###########################
# Investment Obsession	  #
###########################

character_event = {
	id = 1133

	picture = "event_plague"

	trigger = {
		condition = { type = trait value = maniac }
		condition = { type = age value = 16 }
		condition = { type = not value = { type = trait value = indulgent } }
	}

	mean_time_to_happen = {
		months = 90
	}

	action_a = {
		effect = { type = stewardship value = 1 }
		effect = { type = diplomacy value = -3 }
		effect = { type = intrigue value = -3 }
		effect = { type = martial value = -3 }
		effect = { type = add_trait value = indulgent }
	}
}
###########################
# Military Obsession	  #
###########################

character_event = {
	id = 1134

	picture = "event_plague"

	trigger = {
		condition = { type = trait value = maniac }
		condition = { type = age value = 16 }
		condition = { type = not value = { type = trait value = reckless } }
	}

	mean_time_to_happen = {
		months = 90
	}

	action_a = {
		effect = { type = martial value = 1 }
		effect = { type = diplomacy value = -3 }
		effect = { type = intrigue value = -3 }
		effect = { type = stewardship value = -3 }
		effect = { type = add_trait value = reckless }
	}
}
###########################
# INCUBATION EVENT SERIES #
###########################

###########################
# Character catch Illness #
###########################

character_event = {
	id = 1158

	picture = "event_plague"

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

	mean_time_to_happen = {
		months = 900

		modifier = {
			condition = { type = not value = { type= age value = 2 } }
			factor = 0.85
		}
		modifier = {
			condition = { type = not value = { type= age value = 5 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = age value = 40 }
			factor = 0.9
		}
		modifier = {
			condition = { type = age value = 50 }
			factor = 0.75
		}
		modifier = {
			condition = { type = age value = 60 }
			factor = 0.5
		}
		modifier = {
			condition = { type = age value = 70 }
			factor = 0.25
		}
		modifier = {
			condition = { type = health value = 15 }
			factor = 1.25
		}
		modifier = {
			condition = { type = health value = 10 }
			condition = {
				type = not
				value = {
					type = health
					value = 15
				}
			}
			factor = 1.15
		}
		modifier = {
			condition = { type = health value = 6 }
			condition = {

				type = not
				value = {
					type = health
					value = 7
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = health value = 5 }
			condition = {
				type = not
				value = {
					type = health
					value = 6
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = health value = 4 }
			condition = {
				type = not
				value = {
					type = health
					value = 5
				}
			}
			factor = 0.8
		}
		modifier = {
			condition = { type = health value = 3 }
			condition = {
				type = not
				value = {
					type = health
					value = 4
				}
			}
			factor = 0.75
		}
		modifier = {
			condition = { type = health value = 2 }
			condition = {
				type = not
				value = {
					type = health
					value = 3
				}
			}
			factor = 0.7
		}
		modifier = {
			condition = {
				type = not
				value = {
					type = health
					value = 2
				}
			}
			factor = 0.1
		}
		modifier = { 
			condition = { type = ai }
			factor = 0.8
		}
		modifier = {
			condition = { type = court value = 10 }
			factor = 0.9
		}
		modifier = {
			condition = { type = court value = 20 }
			factor = 0.9
		}
		modifier = {
			condition = { type = court value = 30 }
			factor = 0.9
		}
		modifier = {
			condition = { type = court value = 50 }
			factor = 0.9
		}
		modifier = {
			condition = { type = ruler }
			condition = { type = not value = { type = age value = 10 } }
			factor = 1.25
		}
		modifier = {
			condition = { type = ruler }
			condition = { type = not value = { type = age value = 50 } }
			factor = 1.25
		}
		modifier = {
			condition = { type = not value = { type = ruler } }
			condition = { type = ruler_child }
			factor = 1.25
		}
	}

	action_a = {
		effect = {
			type = add_trait
			value = illness
		}
	}
}
###################################
# Character show Stress Symptoms  #
###################################

character_event = {
	id = 1159

	picture = "event_plague"

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

	mean_time_to_happen = {
		months = 960

		modifier = {
			condition = { type = health value = 10 }
			factor = 1.5
		}
		modifier = {
			condition = { type = health value = 7 }
			condition = {
				type = not
				value = {
					type = health
					value = 10
				}
			}
			factor = 1.0
		}
		modifier = {
			condition = { type = health value = 6 }
			condition = {
				type = not
				value = {
					type = health
					value = 7
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = health value = 5 }
			condition = {
				type = not
				value = {
					type = health
					value = 6
				}
			}
			factor = 0.9
		}
		modifier = {
			condition = { type = health value = 4 }
			condition = {
				type = not
				value = {
					type = health
					value = 5
				}
			}
			factor = 0.8
		}
		modifier = {
			condition = { type = health value = 3 }
			condition = {
				type = not
				value = {
					type = health
					value = 4
				}
			}
			factor = 0.75
		}
		modifier = {
			condition = { type = health value = 2 }
			condition = {
				type = not
				value = {
					type = health
					value = 3
				}
			}
			factor = 0.7
		}
		modifier = {
			condition = {
				type = not
				value = {
					type = health
					value = 2
				}
			}
			factor = 0.1
		}
	}

	action_a = {
		effect = {
			type = add_trait
			value = stress_symptom
		}
	}
}

