# This file holds the diseases for The Reaper's due, with all new values and effects
# note the "rip = yes" -- this will make it so that the disease is The Reaper's Due exclusive, so that we can have both versions of the disease
# if "rip" is not specified, the disease will be available in both version (with the same values in both) and doesn't need to be set twice

justinian_plague = {
	rip = yes
	contagiousness = 0.95
	outbreak_chance = 0.002
	effect = {
		local_tax_modifier = -0.75
		supply_limit = -4
		max_attrition = 0.075
	}
	yearly_province_pulse = {
		random_list = {		
			10 = {
				modifier = {
					factor = 1.1
					location = {
						hospital_level = 1
					}
				}
				modifier = {
					factor = 1.1
					location = {
						hospital_level = 2
					}
				}
				modifier = {
					factor = 1.1
					location = {
						hospital_level = 3
					}
				}
				modifier = {
					factor = 1.1
					location = {
						hospital_level = 4
					}
				}
				modifier = {
					factor = 1.1
					location = {
						hospital_level = 5
					}
				}
				modifier = {
					factor = 1.1
					location = {
						hospital_level = 6
					}
				}
			}
			90 = {
				increase_depopulation_effect = yes
			}
		}
	}
	icon = 4
	tooltip = JUSTINIAN_PLAGUE_INFO
	months = 36
	trait = has_bubonic_plague
	character_infection_chances = {
		months = 3
	}
	on_character_infection = {
		if = {
			limit = {
				NOR = {
					has_character_flag = immune_bubonic_plague
					has_character_flag = got_bubonic_plague
					trait = has_bubonic_plague
					trait = horse
				}
			}
			random_list = {
				90 = { # Get the disease
					modifier = {
						factor = 0
						has_character_modifier = in_seclusion
					}
					modifier = {
						factor = 0
						AND = {
							is_nomadic = yes
							NOT = { is_unimportant_trigger = yes }
						}
					}
					modifier = {
						factor = 0.5
						AND = {
							is_tribal = yes
							NOT = { is_unimportant_trigger = yes }
						}
					}
					modifier = {
						factor = 5000
						is_unimportant_trigger = yes
					}
					#clr_character_flag = got_bubonic_plague #clear out other diseases
					clr_character_flag = got_aztec_disease
					clr_character_flag = got_smallpox
					clr_character_flag = got_measles
					clr_character_flag = got_typhus
					clr_character_flag = got_typhoid_fever
					clr_character_flag = got_tuberculosis
					clr_character_flag = got_syphilis
					clr_character_flag = got_pneumonia
					clr_character_flag = got_cancer
					clr_character_flag = got_rabies
					clr_character_flag = got_gout
					clr_character_flag = got_flu
					clr_character_flag = got_dysentery
					clr_character_flag = got_food_poisoning
					clr_character_flag = disease_not_serious
					
					set_character_flag = got_bubonic_plague
					set_character_flag = developing_illness
					character_event = { id = RIP.5012 }
				}
				10 = { # Nothing happens
				}
			}
		}
		if = {
			limit = {
				NOT = { has_global_flag = black_death_happened }
			}
			set_global_flag = black_death_happened
		}
	}
	on_province_infection = {
		province_event = { id = RIP.10000 }
		province_event = { id = RIP.10005 }
		province_event = { id = RIP.11703 } #prosperity ended by epidemic
	}
	always_get_message = yes
	color = { 255 0 0 }
	major = yes
	
	timeperiod = {	# Dynamic plague outbreak
		start_date = 1.1.1
		end_date = 1400.1.1
		
		outbreak_chance = 0.01

		months = 0
		
		can_outbreak = {
			total_years_played = 200
			NOT = { has_global_flag = black_death_happened }
			has_game_rule = {
				name = epidemics
				value = dynamic
			}
		}
		
		min_nb_province = 1		# ignored if 0
		max_nb_province = 15	# ignored if 0

		one_only = yes

		province_infection_duration = 36
		
		outbreak_scenario = { # Classic plague, misses India and respects the HPFZ
			chance = 0.30
			start_provinces = {
				789 # Pelusia
			}
			excluded_regions = {
				world_india_deccan world_india_bengal world_india_rajastan custom_historical_justinian_plague_free_zone
			}
		}
		
		outbreak_scenario = { # Classic plague, misses India but does not respect the HPFZ
			chance = 0.20
			start_provinces = {
				789 # Pelusia
			}
			excluded_regions = {
				world_india_deccan world_india_bengal world_india_rajastan
			}
		}
		
		outbreak_scenario = { # Classic plague, misses Africa rather than India and respects the HPFZ
			chance = 0.10
			start_provinces = {
				789 # Pelusia
			}
			excluded_regions = {
				world_africa custom_historical_justinian_plague_free_zone
			}
		}
		
		outbreak_scenario = { # Classic plague, misses Africa rather than India but does not respect the HPFZ
			chance = 0.10
			start_provinces = {
				789 # Pelusia
			}
			excluded_regions = {
				world_africa
			}
		}
		
		outbreak_scenario = { # Comes via India and misses Scandinavia and respects the HPFZ
			chance = 0.10
			start_provinces = {
				1177
			}
			excluded_regions = {
				world_europe_north custom_historical_justinian_plague_free_zone
			}
		}
		
		outbreak_scenario = { # Comes via India and misses Britain
			chance = 0.10
			start_provinces = {
				1177
			}
			excluded_regions = {
				world_europe_west_brittania
			}
		}
		
		outbreak_scenario = { # Comes via India and misses the Steppe
			chance = 0.10
			start_provinces = {
				1177
			}
			excluded_regions = {
				world_steppe
			}
		}
		
	}
	
	timeperiod = {	# Dynamic plague outbreak, take 2 (late game)
		start_date = 1000.1.1
		end_date = 1453.1.1
		
		outbreak_chance = 0.01

		months = 0
		
		
		can_outbreak = {
			total_years_played = 500
			has_game_rule = {
				name = epidemics
				value = dynamic
			}
		}
		
		min_nb_province = 1		# ignored if 0
		max_nb_province = 15	# ignored if 0

		one_only = yes

		province_infection_duration = 36
		
		outbreak_scenario = { # Classic plague, misses India and respects the HPFZ
			chance = 0.30
			start_provinces = {
				789 # Pelusia
			}
			excluded_regions = {
				world_india_deccan world_india_bengal world_india_rajastan custom_historical_justinian_plague_free_zone
			}
		}
		
		outbreak_scenario = { # Classic plague, misses India but does not respect the HPFZ
			chance = 0.20
			start_provinces = {
				789 # Pelusia
			}
			excluded_regions = {
				world_india_deccan world_india_bengal world_india_rajastan
			}
		}
		
		outbreak_scenario = { # Classic plague, misses Africa rather than India and respects the HPFZ
			chance = 0.10
			start_provinces = {
				789 # Pelusia
			}
			excluded_regions = {
				world_africa custom_historical_justinian_plague_free_zone
			}
		}
		
		outbreak_scenario = { # Classic plague, misses Africa rather than India but does not respect the HPFZ
			chance = 0.10
			start_provinces = {
				789 # Pelusia
			}
			excluded_regions = {
				world_africa
			}
		}
		
		outbreak_scenario = { # Comes via India and misses Scandinavia and respects the HPFZ
			chance = 0.10
			start_provinces = {
				1177
			}
			excluded_regions = {
				world_europe_north custom_historical_justinian_plague_free_zone
			}
		}
		
		outbreak_scenario = { # Comes via India and misses Britain
			chance = 0.10
			start_provinces = {
				1177
			}
			excluded_regions = {
				world_europe_west_brittania
			}
		}
		
		outbreak_scenario = { # Comes via India and misses the Steppe
			chance = 0.10
			start_provinces = {
				1177
			}
			excluded_regions = {
				world_steppe
			}
		}
		
	}
	
	timeperiod = {	# Delayed Dynamic plague outbreak
		start_date = 600.1.1
		end_date = 1400.1.1
		
		outbreak_chance = 0.01

		months = 0
				
		can_outbreak = {
			total_years_played = 25
			NOT = { has_global_flag = black_death_happened }
			has_game_rule = {
				name = epidemics
				value = delayed_dynamic
			}
		}
		
		min_nb_province = 1		# ignored if 0
		max_nb_province = 15	# ignored if 0

		one_only = yes

		province_infection_duration = 36
		
		outbreak_scenario = { # Classic plague, misses India and respects the HPFZ
			chance = 0.30
			start_provinces = {
				789 # Pelusia
			}
			excluded_regions = {
				world_india_deccan world_india_bengal world_india_rajastan custom_historical_justinian_plague_free_zone
			}
		}
		
		outbreak_scenario = { # Classic plague, misses India but does not respect the HPFZ
			chance = 0.20
			start_provinces = {
				789 # Pelusia
			}
			excluded_regions = {
				world_india_deccan world_india_bengal world_india_rajastan
			}
		}
		
		outbreak_scenario = { # Classic plague, misses Africa rather than India and respects the HPFZ
			chance = 0.10
			start_provinces = {
				789 # Pelusia
			}
			excluded_regions = {
				world_africa custom_historical_justinian_plague_free_zone
			}
		}
		
		outbreak_scenario = { # Classic plague, misses Africa rather than India but does not respect the HPFZ
			chance = 0.10
			start_provinces = {
				789 # Pelusia
			}
			excluded_regions = {
				world_africa
			}
		}
		
		outbreak_scenario = { # Comes via India and misses Scandinavia and respects the HPFZ
			chance = 0.10
			start_provinces = {
				1177
			}
			excluded_regions = {
				world_europe_north custom_historical_justinian_plague_free_zone
			}
		}
		
		outbreak_scenario = { # Comes via India and misses Britain
			chance = 0.10
			start_provinces = {
				1177
			}
			excluded_regions = {
				world_europe_west_brittania
			}
		}
		
		outbreak_scenario = { # Comes via India and misses the Steppe
			chance = 0.10
			start_provinces = {
				1177
			}
			excluded_regions = {
				world_steppe
			}
		}
		
	}

	timeperiod = {	# Dynamic historical plague
		start_date = 500.1.1
		end_date = 600.1.1

		months = 0

		can_outbreak = {
			NOT = { has_global_flag = black_death_happened }
			has_game_rule = {
				name = epidemics
				value = dynamic
			}
		}
		
		min_nb_province = 1		# ignored if 0
		max_nb_province = 15	# ignored if 0

		one_only = yes
		
		outbreak_scenario = { # Classic plague, misses India and respects the HPFZ
			chance = 0.30
			start_provinces = {
				789 # Pelusia
			}
			excluded_regions = {
				world_india_deccan world_india_bengal world_india_rajastan custom_historical_justinian_plague_free_zone
			}
		}
		
		outbreak_scenario = { # Classic plague, misses India but does not respect the HPFZ
			chance = 0.20
			start_provinces = {
				789 # Pelusia
			}
			excluded_regions = {
				world_india_deccan world_india_bengal world_india_rajastan
			}
		}
		
		outbreak_scenario = { # Classic plague, misses Africa rather than India and respects the HPFZ
			chance = 0.10
			start_provinces = {
				789 # Pelusia
			}
			excluded_regions = {
				world_africa custom_historical_justinian_plague_free_zone
			}
		}
		
		outbreak_scenario = { # Classic plague, misses Africa rather than India but does not respect the HPFZ
			chance = 0.10
			start_provinces = {
				789 # Pelusia
			}
			excluded_regions = {
				world_africa
			}
		}
		
		outbreak_scenario = { # Comes via India and misses Scandinavia and respects the HPFZ
			chance = 0.10
			start_provinces = {
				1177
			}
			excluded_regions = {
				world_europe_north custom_historical_justinian_plague_free_zone
			}
		}
		
		outbreak_scenario = { # Comes via India and misses Britain
			chance = 0.10
			start_provinces = {
				1177
			}
			excluded_regions = {
				world_europe_west_brittania
			}
		}
		
		outbreak_scenario = { # Comes via India and misses the Steppe
			chance = 0.10
			start_provinces = {
				1177
			}
			excluded_regions = {
				world_steppe
			}
		}
	}
	
	timeperiod = {	# Purely historical plague
		start_date = 541.1.1
		end_date = 600.1.1
		
		outbreak_chance = 1

		months = 0

		can_outbreak = {
			NOT = { has_global_flag = black_death_happened }
			has_game_rule = {
				name = epidemics
				value = historical
			}
		}
		
		min_nb_province = 1		# ignored if 0
		max_nb_province = 15	# ignored if 0

		one_only = yes
		
		outbreak_scenario = { # Classic plague
			chance = 1
			start_provinces = {
				789 # Pelusia
			}
			excluded_regions = {
				custom_historical_justinian_plague_free_zone
			}
		}
	}
	
	timeperiod = {	# Dynamic plague - becomes endemic 
		start_date = 1.1.1
		end_date = 1400.1.1
		
		max_total_provinces = 35
		
		months = 24
		
		outbreak_chance = 0.00075
		
		can_outbreak = {			
			had_global_flag = { flag = black_death_happened days = 18250 }
			has_game_rule = {
				name = epidemics
				value = dynamic
			}
		}
		
		min_nb_province = 1		# ignored if 0
		max_nb_province = 10	# ignored if 0

		one_only = no

		province_infection_duration = 30
		
	}
	
	timeperiod = {	# Absurdly deadly plague - doesn't care if it's happened before!
		start_date = 1.1.1
		end_date = 1400.1.1
		
		months = 50
		
		outbreak_chance = 0.0008
		
		min_nb_province = 1		# ignored if 0
		max_nb_province = 15	# ignored if 0

		can_outbreak = {
			total_years_played = 20
			has_game_rule = {
				name = epidemics
				value = deadly
			}
		}
		
		one_only = no
		
	}
	
	disease_gfx = disease_gfx_bubonic_plague
}

justinian_plague_recurrence_1 = {
	rip = yes
	contagiousness = 0.95
	outbreak_chance = 0.002
	effect = {
		local_tax_modifier = -0.75
		supply_limit = -4
		max_attrition = 0.075
	}
	yearly_province_pulse = {
		random_list = {		
			10 = {
				modifier = {
					factor = 1.1
					location = {
						hospital_level = 1
					}
				}
				modifier = {
					factor = 1.1
					location = {
						hospital_level = 2
					}
				}
				modifier = {
					factor = 1.1
					location = {
						hospital_level = 3
					}
				}
				modifier = {
					factor = 1.1
					location = {
						hospital_level = 4
					}
				}
				modifier = {
					factor = 1.1
					location = {
						hospital_level = 5
					}
				}
				modifier = {
					factor = 1.1
					location = {
						hospital_level = 6
					}
				}
			}
			90 = {
				increase_depopulation_effect = yes
			}
		}
	}
	icon = 4
	tooltip = JUSTINIAN_PLAGUE_INFO
	months = 30
	trait = has_bubonic_plague
	character_infection_chances = {
		months = 3
	}
	on_character_infection = {
		if = {
			limit = {
				NOR = {
					has_character_flag = immune_bubonic_plague
					has_character_flag = got_bubonic_plague
					trait = has_bubonic_plague
					trait = horse
					trait = cat
				}
			}
			random_list = {
				90 = { # Get the disease
					modifier = {
						factor = 0
						has_character_modifier = in_seclusion
					}
					modifier = {
						factor = 0
						AND = {
							is_nomadic = yes
							NOT = { is_unimportant_trigger = yes }
						}
					}
					modifier = {
						factor = 0.5
						AND = {
							is_tribal = yes
							NOT = { is_unimportant_trigger = yes }
						}
					}
					modifier = {
						factor = 5000
						is_unimportant_trigger = yes
					}
					#clr_character_flag = got_bubonic_plague #clear out other diseases
					clr_character_flag = got_aztec_disease
					clr_character_flag = got_smallpox
					clr_character_flag = got_measles
					clr_character_flag = got_typhus
					clr_character_flag = got_typhoid_fever
					clr_character_flag = got_tuberculosis
					clr_character_flag = got_syphilis
					clr_character_flag = got_pneumonia
					clr_character_flag = got_cancer
					clr_character_flag = got_rabies
					clr_character_flag = got_gout
					clr_character_flag = got_flu
					clr_character_flag = got_dysentery
					clr_character_flag = got_food_poisoning
					clr_character_flag = disease_not_serious
					
					set_character_flag = got_bubonic_plague
					set_character_flag = developing_illness
					character_event = { id = RIP.5012 }
				}
				10 = { # Nothing happens
				}
			}
		}
		if = {
			limit = {
				NOT = { has_global_flag = black_death_happened }
			}
			set_global_flag = black_death_happened
		}
	}
	on_province_infection = {
		province_event = { id = RIP.10000 }
		province_event = { id = RIP.10005 }
		province_event = { id = RIP.11703 } #prosperity ended by epidemic
	}
	always_get_message = yes
	color = { 255 0 0 }
	major = yes
	
	timeperiod = {	# Dynamic plague outbreak
		start_date = 1.1.1
		end_date = 1400.1.1
		
		months = 0
		
		outbreak_chance = 0.01
		
		can_outbreak = {
			total_years_played = 200
			NOT = { has_global_flag = black_death_happened }
			has_game_rule = {
				name = epidemics
				value = dynamic
			}
		}
		
		min_nb_province = 1		# ignored if 0
		max_nb_province = 15	# ignored if 0

		one_only = yes

		province_infection_duration = 36
		
		outbreak_scenario = { # Classic plague, misses India and respects the HPFZ
			chance = 0.30
			start_provinces = {
				496 # Byzantion
			}
			excluded_regions = {
				world_india_deccan world_india_bengal world_india_rajastan custom_historical_justinian_plague_free_zone #world_himalayas #Disabled for Tibet
			}
		}
		
		outbreak_scenario = { # Classic plague, misses India but does not respect the HPFZ
			chance = 0.20
			start_provinces = {
				496 # Byzantion
			}
			excluded_regions = {
				world_india_deccan world_india_bengal world_india_rajastan #world_himalayas #Disabled for Tibet
			}
		}
		
		outbreak_scenario = { # Classic plague, misses Africa rather than India and respects the HPFZ
			chance = 0.10
			start_provinces = {
				496 # Byzantion
			}
			excluded_regions = {
				world_africa custom_historical_justinian_plague_free_zone
			}
		}
		
		outbreak_scenario = { # Classic plague, misses Africa rather than India but does not respect the HPFZ
			chance = 0.10
			start_provinces = {
				496 # Byzantion
			}
			excluded_regions = {
				world_africa
			}
		}
		
		outbreak_scenario = { # Comes via India and misses Scandinavia and respects the HPFZ
			chance = 0.10
			start_provinces = {
				1177
			}
			excluded_regions = {
				world_europe_north custom_historical_justinian_plague_free_zone
			}
		}
		
		outbreak_scenario = { # Comes via India and misses Britain
			chance = 0.10
			start_provinces = {
				1177
			}
			excluded_regions = {
				world_europe_west_brittania
			}
		}
		
		outbreak_scenario = { # Comes via India and misses the Steppe and Himalaya
			chance = 0.10
			start_provinces = {
				1177
			}
			excluded_regions = {
				world_steppe #world_himalayas #Disabled for Tibet
			}
		}
		
	}
	
	timeperiod = {	# Dynamic plague outbreak, take 2 (late game)
		start_date = 1000.1.1
		end_date = 1453.1.1
		
		months = 0
		
		outbreak_chance = 0.01
		
		can_outbreak = {
			total_years_played = 500
			has_game_rule = {
				name = epidemics
				value = dynamic
			}
		}
		
		min_nb_province = 1		# ignored if 0
		max_nb_province = 15	# ignored if 0

		one_only = yes

		province_infection_duration = 36
		
		outbreak_scenario = { # Classic plague, misses India and respects the HPFZ
			chance = 0.30
			start_provinces = {
				496 # Byzantion
			}
			excluded_regions = {
				world_india_deccan world_india_bengal world_india_rajastan custom_historical_justinian_plague_free_zone #world_himalayas #Disabled for Tibet
			}
		}
		
		outbreak_scenario = { # Classic plague, misses India but does not respect the HPFZ
			chance = 0.20
			start_provinces = {
				496 # Byzantion
			}
			excluded_regions = {
				world_india_deccan world_india_bengal world_india_rajastan #world_himalayas #Disabled for Tibet
			}
		}
		
		outbreak_scenario = { # Classic plague, misses Africa rather than India and respects the HPFZ
			chance = 0.10
			start_provinces = {
				496 # Byzantion
			}
			excluded_regions = {
				world_africa custom_historical_justinian_plague_free_zone
			}
		}
		
		outbreak_scenario = { # Classic plague, misses Africa rather than India but does not respect the HPFZ
			chance = 0.10
			start_provinces = {
				496 # Byzantion
			}
			excluded_regions = {
				world_africa
			}
		}
		
		outbreak_scenario = { # Comes via India and misses Scandinavia and respects the HPFZ
			chance = 0.10
			start_provinces = {
				1177
			}
			excluded_regions = {
				world_europe_north custom_historical_justinian_plague_free_zone
			}
		}
		
		outbreak_scenario = { # Comes via India and misses Britain
			chance = 0.10
			start_provinces = {
				1177
			}
			excluded_regions = {
				world_europe_west_brittania
			}
		}
		
		outbreak_scenario = { # Comes via India and misses the Steppe and Himalaya
			chance = 0.10
			start_provinces = {
				1177
			}
			excluded_regions = {
				world_steppe
			}
		}
		
	}
	
	timeperiod = {	# Delayed Dynamic plague outbreak
		start_date = 650.1.1
		end_date = 1400.1.1
		
		months = 0
		
		outbreak_chance = 0.01
		
		can_outbreak = {
			total_years_played = 25
			NOT = { has_global_flag = black_death_happened }
			has_game_rule = {
				name = epidemics
				value = delayed_dynamic
			}
		}
		
		min_nb_province = 1		# ignored if 0
		max_nb_province = 15	# ignored if 0

		one_only = yes

		province_infection_duration = 36
		
		outbreak_scenario = { # Classic plague, misses India and respects the HPFZ
			chance = 0.30
			start_provinces = {
				496 # Byzantion
			}
			excluded_regions = {
				world_india_deccan world_india_bengal world_india_rajastan custom_historical_justinian_plague_free_zone #world_himalayas #Disabled for Tibet
			}
		}
		
		outbreak_scenario = { # Classic plague, misses India but does not respect the HPFZ
			chance = 0.20
			start_provinces = {
				496 # Byzantion
			}
			excluded_regions = {
				world_india_deccan world_india_bengal world_india_rajastan #world_himalayas #Disabled for Tibet
			}
		}
		
		outbreak_scenario = { # Classic plague, misses Africa rather than India and respects the HPFZ
			chance = 0.10
			start_provinces = {
				496 # Byzantion
			}
			excluded_regions = {
				world_africa custom_historical_justinian_plague_free_zone
			}
		}
		
		outbreak_scenario = { # Classic plague, misses Africa rather than India but does not respect the HPFZ
			chance = 0.10
			start_provinces = {
				496 # Byzantion
			}
			excluded_regions = {
				world_africa
			}
		}
		
		outbreak_scenario = { # Comes via India and misses Scandinavia and respects the HPFZ
			chance = 0.10
			start_provinces = {
				1177
			}
			excluded_regions = {
				world_europe_north custom_historical_justinian_plague_free_zone
			}
		}
		
		outbreak_scenario = { # Comes via India and misses Britain
			chance = 0.10
			start_provinces = {
				1177
			}
			excluded_regions = {
				world_europe_west_brittania
			}
		}
		
		outbreak_scenario = { # Comes via India and misses the Steppe and Himalaya
			chance = 0.10
			start_provinces = {
				1177
			}
			excluded_regions = {
				world_steppe #world_himalayas #Disabled for Tibet
			}
		}
		
	}

	timeperiod = {	# Dynamic historical plague
		start_date = 550.1.1
		end_date = 750.1.1

		months = 0

		can_outbreak = {
			NOT = { has_global_flag = black_death_happened }
			has_game_rule = {
				name = epidemics
				value = dynamic
			}
		}
		
		min_nb_province = 1		# ignored if 0
		max_nb_province = 15	# ignored if 0

		one_only = yes
		
		outbreak_scenario = { # Classic plague, misses India and respects the HPFZ
			chance = 0.30
			start_provinces = {
				496 # Byzantion
			}
			excluded_regions = {
				world_india_deccan world_india_bengal world_india_rajastan custom_historical_justinian_plague_free_zone  #world_himalayas #Disabled for Tibet
			}
		}
		
		outbreak_scenario = { # Classic plague, misses India but does not respect the HPFZ
			chance = 0.20
			start_provinces = {
				496 # Byzantion
			}
			excluded_regions = {
				world_india_deccan world_india_bengal world_india_rajastan #world_himalayas #Disabled for Tibet
			}
		}
		
		outbreak_scenario = { # Classic plague, misses Africa rather than India and respects the HPFZ
			chance = 0.10
			start_provinces = {
				496 # Byzantion
			}
			excluded_regions = {
				world_africa custom_historical_justinian_plague_free_zone
			}
		}
		
		outbreak_scenario = { # Classic plague, misses Africa rather than India but does not respect the HPFZ
			chance = 0.10
			start_provinces = {
				496 # Byzantion
			}
			excluded_regions = {
				world_africa
			}
		}
		
		outbreak_scenario = { # Comes via India and misses Scandinavia and respects the HPFZ
			chance = 0.10
			start_provinces = {
				1177
			}
			excluded_regions = {
				world_europe_north custom_historical_justinian_plague_free_zone
			}
		}
		
		outbreak_scenario = { # Comes via India and misses Britain
			chance = 0.10
			start_provinces = {
				1177
			}
			excluded_regions = {
				world_europe_west_brittania
			}
		}
		
		outbreak_scenario = { # Comes via India and misses the Steppe and Himalaya
			chance = 0.10
			start_provinces = {
				1177
			}
			excluded_regions = {
				world_steppe #world_himalayas #Disabled for Tibet
			}
		}
	}
	
	timeperiod = {	# Purely historical plague
		start_date = 600.1.1
		end_date = 700.1.1
	
		months = 0
		
		outbreak_chance = 1

		can_outbreak = {
			NOT = { has_global_flag = black_death_happened }
			has_game_rule = {
				name = epidemics
				value = historical
			}
		}
		
		min_nb_province = 1		# ignored if 0
		max_nb_province = 15	# ignored if 0

		one_only = yes
		
		outbreak_scenario = { # Classic plague
			chance = 1
			start_provinces = {
				496 # Byzantion
			}
			excluded_regions = {
				world_india_deccan world_india_bengal world_india_rajastan custom_historical_justinian_plague_free_zone #world_himalayas #Disabled for Tibet
			}
		}
	}
	
	timeperiod = {	# Dynamic plague - becomes endemic 
		start_date = 1.1.1
		end_date = 1400.1.1
		
		max_total_provinces = 35
		
		months = 24
		
		outbreak_chance = 0.00075
		
		can_outbreak = {			
			had_global_flag = { flag = black_death_happened days = 18250 }
			has_game_rule = {
				name = epidemics
				value = dynamic
			}
		}
		
		min_nb_province = 1		# ignored if 0
		max_nb_province = 10	# ignored if 0

		one_only = no

		province_infection_duration = 30
		
	}
	
	timeperiod = {	# Absurdly deadly plague - doesn't care if it's happened before!
		start_date = 1.1.1
		end_date = 1400.1.1
		
		months = 50
		
		outbreak_chance = 0.0008
		
		min_nb_province = 1		# ignored if 0
		max_nb_province = 15	# ignored if 0

		can_outbreak = {
			total_years_played = 20
			has_game_rule = {
				name = epidemics
				value = deadly
			}
		}
		
		one_only = no
		
	}
	
	disease_gfx = disease_gfx_bubonic_plague
}

justinian_plague_recurrence_2 = {
	rip = yes
	contagiousness = 0.95
	outbreak_chance = 0.002
	effect = {
		local_tax_modifier = -0.75
		supply_limit = -4
		max_attrition = 0.075
	}
	yearly_province_pulse = {
		random_list = {		
			10 = {
				modifier = {
					factor = 1.1
					location = {
						hospital_level = 1
					}
				}
				modifier = {
					factor = 1.1
					location = {
						hospital_level = 2
					}
				}
				modifier = {
					factor = 1.1
					location = {
						hospital_level = 3
					}
				}
				modifier = {
					factor = 1.1
					location = {
						hospital_level = 4
					}
				}
				modifier = {
					factor = 1.1
					location = {
						hospital_level = 5
					}
				}
				modifier = {
					factor = 1.1
					location = {
						hospital_level = 6
					}
				}
			}
			90 = {
				increase_depopulation_effect = yes
			}
		}
	}
	icon = 4
	tooltip = JUSTINIAN_PLAGUE_INFO
	months = 22
	trait = has_bubonic_plague
	character_infection_chances = {
		months = 3
	}
	on_character_infection = {
		if = {
			limit = {
				NOR = {
					has_character_flag = immune_bubonic_plague
					has_character_flag = got_bubonic_plague
					trait = has_bubonic_plague
					trait = horse
				}
			}
			random_list = {
				90 = { # Get the disease
					modifier = {
						factor = 0
						has_character_modifier = in_seclusion
					}
					modifier = {
						factor = 0
						AND = {
							is_nomadic = yes
							NOT = { is_unimportant_trigger = yes }
						}
					}
					modifier = {
						factor = 0.5
						AND = {
							is_tribal = yes
							NOT = { is_unimportant_trigger = yes }
						}
					}
					modifier = {
						factor = 5000
						is_unimportant_trigger = yes
					}
					#clr_character_flag = got_bubonic_plague #clear out other diseases
					clr_character_flag = got_aztec_disease
					clr_character_flag = got_smallpox
					clr_character_flag = got_measles
					clr_character_flag = got_typhus
					clr_character_flag = got_typhoid_fever
					clr_character_flag = got_tuberculosis
					clr_character_flag = got_syphilis
					clr_character_flag = got_pneumonia
					clr_character_flag = got_cancer
					clr_character_flag = got_rabies
					clr_character_flag = got_gout
					clr_character_flag = got_flu
					clr_character_flag = got_dysentery
					clr_character_flag = got_food_poisoning
					clr_character_flag = disease_not_serious
					
					set_character_flag = got_bubonic_plague
					set_character_flag = developing_illness
					character_event = { id = RIP.5012 }
				}
				10 = { # Nothing happens
				}
			}
		}
		if = {
			limit = {
				NOT = { has_global_flag = black_death_happened }
			}
			set_global_flag = black_death_happened
		}
	}
	on_province_infection = {
		province_event = { id = RIP.10000 }
		province_event = { id = RIP.10005 }
		province_event = { id = RIP.11703 } #prosperity ended by epidemic	
	}
	always_get_message = yes
	color = { 255 0 0 }
	major = yes
	
	timeperiod = {	# Dynamic plague outbreak
		start_date = 1.1.1
		end_date = 1400.1.1
	
		months = 0
		
		outbreak_chance = 0.01
		
		can_outbreak = {
			total_years_played = 200
			NOT = { has_global_flag = black_death_happened }
			has_game_rule = {
				name = epidemics
				value = dynamic
			}
		}
		
		min_nb_province = 1		# ignored if 0
		max_nb_province = 15	# ignored if 0

		one_only = yes

		province_infection_duration = 36
		
		outbreak_scenario = { # Classic plague, misses India and respects the HPFZ
			chance = 0.30
			start_provinces = {
				496 # Byzantion
			}
			excluded_regions = {
				world_india_deccan world_india_bengal world_india_rajastan custom_historical_justinian_plague_free_zone
			}
		}
		
		outbreak_scenario = { # Classic plague, misses India but does not respect the HPFZ
			chance = 0.20
			start_provinces = {
				496 # Byzantion
			}
			excluded_regions = {
				world_india_deccan world_india_bengal world_india_rajastan
			}
		}
		
		outbreak_scenario = { # Classic plague, misses Africa rather than India and respects the HPFZ
			chance = 0.10
			start_provinces = {
				496 # Byzantion
			}
			excluded_regions = {
				world_africa custom_historical_justinian_plague_free_zone
			}
		}
		
		outbreak_scenario = { # Classic plague, misses Africa rather than India but does not respect the HPFZ
			chance = 0.10
			start_provinces = {
				496 # Byzantion
			}
			excluded_regions = {
				world_africa
			}
		}
		
		outbreak_scenario = { # Comes via India and misses Scandinavia and respects the HPFZ
			chance = 0.10
			start_provinces = {
				1177
			}
			excluded_regions = {
				world_europe_north custom_historical_justinian_plague_free_zone
			}
		}
		
		outbreak_scenario = { # Comes via India and misses Britain
			chance = 0.10
			start_provinces = {
				1177
			}
			excluded_regions = {
				world_europe_west_brittania
			}
		}
		
		outbreak_scenario = { # Comes via India and misses the Steppe
			chance = 0.10
			start_provinces = {
				1177
			}
			excluded_regions = {
				world_steppe
			}
		}
		
	}
	
	timeperiod = {	# Dynamic plague outbreak, take 2 (late game)
		start_date = 1000.1.1
		end_date = 1453.1.1
		
		outbreak_chance = 0.01
		
		months = 0
		
		can_outbreak = {
			total_years_played = 500
			has_game_rule = {
				name = epidemics
				value = dynamic
			}
		}
		
		min_nb_province = 1		# ignored if 0
		max_nb_province = 15	# ignored if 0

		one_only = yes

		province_infection_duration = 36
		
		outbreak_scenario = { # Classic plague, misses India and respects the HPFZ
			chance = 0.30
			start_provinces = {
				496 # Byzantion
			}
			excluded_regions = {
				world_india_deccan world_india_bengal world_india_rajastan custom_historical_justinian_plague_free_zone
			}
		}
		
		outbreak_scenario = { # Classic plague, misses India but does not respect the HPFZ
			chance = 0.20
			start_provinces = {
				496 # Byzantion
			}
			excluded_regions = {
				world_india_deccan world_india_bengal world_india_rajastan
			}
		}
		
		outbreak_scenario = { # Classic plague, misses Africa rather than India and respects the HPFZ
			chance = 0.10
			start_provinces = {
				496 # Byzantion
			}
			excluded_regions = {
				world_africa custom_historical_justinian_plague_free_zone
			}
		}
		
		outbreak_scenario = { # Classic plague, misses Africa rather than India but does not respect the HPFZ
			chance = 0.10
			start_provinces = {
				496 # Byzantion
			}
			excluded_regions = {
				world_africa
			}
		}
		
		outbreak_scenario = { # Comes via India and misses Scandinavia and respects the HPFZ
			chance = 0.10
			start_provinces = {
				1177
			}
			excluded_regions = {
				world_europe_north custom_historical_justinian_plague_free_zone
			}
		}
		
		outbreak_scenario = { # Comes via India and misses Britain
			chance = 0.10
			start_provinces = {
				1177
			}
			excluded_regions = {
				world_europe_west_brittania
			}
		}
		
		outbreak_scenario = { # Comes via India and misses the Steppe
			chance = 0.10
			start_provinces = {
				1177
			}
			excluded_regions = {
				world_steppe
			}
		}
		
	}
	
	timeperiod = {	# Delayed Dynamic plague outbreak
		start_date = 700.1.1
		end_date = 1400.1.1
		
		outbreak_chance = 0.01
		
		months = 0
		
		can_outbreak = {
			total_years_played = 25
			NOT = { has_global_flag = black_death_happened }
			has_game_rule = {
				name = epidemics
				value = delayed_dynamic
			}
		}
		
		min_nb_province = 1		# ignored if 0
		max_nb_province = 15	# ignored if 0

		one_only = yes

		province_infection_duration = 36
		
		outbreak_scenario = { # Classic plague, misses India and respects the HPFZ
			chance = 0.30
			start_provinces = {
				496 # Byzantion
			}
			excluded_regions = {
				world_india_deccan world_india_bengal world_india_rajastan custom_historical_justinian_plague_free_zone
			}
		}
		
		outbreak_scenario = { # Classic plague, misses India but does not respect the HPFZ
			chance = 0.20
			start_provinces = {
				496 # Byzantion
			}
			excluded_regions = {
				world_india_deccan world_india_bengal world_india_rajastan
			}
		}
		
		outbreak_scenario = { # Classic plague, misses Africa rather than India and respects the HPFZ
			chance = 0.10
			start_provinces = {
				496 # Byzantion
			}
			excluded_regions = {
				world_africa custom_historical_justinian_plague_free_zone
			}
		}
		
		outbreak_scenario = { # Classic plague, misses Africa rather than India but does not respect the HPFZ
			chance = 0.10
			start_provinces = {
				496 # Byzantion
			}
			excluded_regions = {
				world_africa
			}
		}
		
		outbreak_scenario = { # Comes via India and misses Scandinavia and respects the HPFZ
			chance = 0.10
			start_provinces = {
				1177
			}
			excluded_regions = {
				world_europe_north custom_historical_justinian_plague_free_zone
			}
		}
		
		outbreak_scenario = { # Comes via India and misses Britain
			chance = 0.10
			start_provinces = {
				1177
			}
			excluded_regions = {
				world_europe_west_brittania
			}
		}
		
		outbreak_scenario = { # Comes via India and misses the Steppe
			chance = 0.10
			start_provinces = {
				1177
			}
			excluded_regions = {
				world_steppe
			}
		}
		
	}

	timeperiod = {	# Dynamic historical plague
		start_date = 650.1.1
		end_date = 850.1.1
		
		months = 0

		can_outbreak = {
			NOT = { has_global_flag = black_death_happened }
			has_game_rule = {
				name = epidemics
				value = dynamic
			}
		}
		
		min_nb_province = 1		# ignored if 0
		max_nb_province = 15	# ignored if 0

		one_only = yes
		
		outbreak_scenario = { # Classic plague, misses India and respects the HPFZ
			chance = 0.30
			start_provinces = {
				496 # Byzantion
			}
			excluded_regions = {
				world_india_deccan world_india_bengal world_india_rajastan custom_historical_justinian_plague_free_zone
			}
		}
		
		outbreak_scenario = { # Classic plague, misses India but does not respect the HPFZ
			chance = 0.20
			start_provinces = {
				496 # Byzantion
			}
			excluded_regions = {
				world_india_deccan world_india_bengal world_india_rajastan
			}
		}
		
		outbreak_scenario = { # Classic plague, misses Africa rather than India and respects the HPFZ
			chance = 0.10
			start_provinces = {
				496 # Byzantion
			}
			excluded_regions = {
				world_africa custom_historical_justinian_plague_free_zone
			}
		}
		
		outbreak_scenario = { # Classic plague, misses Africa rather than India but does not respect the HPFZ
			chance = 0.10
			start_provinces = {
				496 # Byzantion
			}
			excluded_regions = {
				world_africa
			}
		}
		
		outbreak_scenario = { # Comes via India and misses Scandinavia and respects the HPFZ
			chance = 0.10
			start_provinces = {
				1177
			}
			excluded_regions = {
				world_europe_north custom_historical_justinian_plague_free_zone
			}
		}
		
		outbreak_scenario = { # Comes via India and misses Britain
			chance = 0.10
			start_provinces = {
				1177
			}
			excluded_regions = {
				world_europe_west_brittania
			}
		}
		
		outbreak_scenario = { # Comes via India and misses the Steppe
			chance = 0.10
			start_provinces = {
				1177
			}
			excluded_regions = {
				world_steppe
			}
		}
	}
	
	timeperiod = {	# Purely historical plague
		start_date = 700.1.1
		end_date = 800.1.1
		
		outbreak_chance = 1
		
		months = 0

		can_outbreak = {
			NOT = { has_global_flag = black_death_happened }
			has_game_rule = {
				name = epidemics
				value = historical
			}
		}
		
		min_nb_province = 1		# ignored if 0
		max_nb_province = 15	# ignored if 0

		one_only = yes
		
		outbreak_scenario = { # Classic plague
			chance = 1
			start_provinces = {
				496 # Byzantion
			}
			excluded_regions = {
				world_india_deccan world_india_bengal world_india_rajastan custom_historical_justinian_plague_free_zone
			}
		}
	}
	
	timeperiod = {	# Dynamic plague - becomes endemic 
		start_date = 1.1.1
		end_date = 1400.1.1
		
		max_total_provinces = 35
		
		months = 24
		
		outbreak_chance = 0.00075
		
		can_outbreak = {			
			had_global_flag = { flag = black_death_happened days = 18250 }
			has_game_rule = {
				name = epidemics
				value = dynamic
			}
		}
		
		min_nb_province = 1		# ignored if 0
		max_nb_province = 10	# ignored if 0

		one_only = no

		province_infection_duration = 30
		
	}
	
	timeperiod = {	# Absurdly deadly plague - doesn't care if it's happened before!
		start_date = 1.1.1
		end_date = 1400.1.1
		
		months = 50
		
		outbreak_chance = 0.0008
		
		min_nb_province = 1		# ignored if 0
		max_nb_province = 15	# ignored if 0

		can_outbreak = {
			total_years_played = 20
			has_game_rule = {
				name = epidemics
				value = deadly
			}
		}
		
		one_only = no
		
	}
	
	disease_gfx = disease_gfx_bubonic_plague
}