namespace = et

# Stability Restored
country_event = {
	id = et.24
	title = "et.EVTNAME24"
	desc = "et.EVTDESC24"
	picture = GOOD_WITH_MONARCH_eventPicture

	trigger = {
		stability = 1
		OR = {
			legitimacy = 50
			NOT = { government = monarchy }
		}
		OR = {
			republican_tradition = 80
			NOT = { government = republic }
		}
		OR = {
			has_country_modifier = pax_romana
			AND = {
				stability = 2
				NOT = { num_of_rebel_controlled_provinces = 2 }
			}
		}
		NOT = { has_country_modifier = country_restabilized }
		OR = {
			has_country_modifier = empire_destabilized
			has_country_modifier = empire_declining
			has_country_modifier = empire_fragmenting
			has_country_modifier = empire_collapsing
			has_country_modifier = total_collapse
		}
		NOT = { num_of_rebel_controlled_provinces = 3 }
		is_at_war = no
		NOT = { war_exhaustion = 2 }
	}

	mean_time_to_happen = {
		months = 12
	}

	immediate = {
		add_country_modifier = {
			name = country_restabilized
			duration = 1825
		}
	}
	
	option = {
		name = "et.EVTOPTA24"
		if = {
			limit = { has_country_modifier = empire_destabilized }
			remove_country_modifier = empire_destabilized
		}
		if = {
			limit = { has_country_modifier = empire_declining }
			remove_country_modifier = empire_declining
			add_country_modifier = {
				name = empire_destabilized
				duration = -1
			}
		}
		if = {
			limit = { has_country_modifier = empire_fragmenting }
			remove_country_modifier = empire_fragmenting
			add_country_modifier = {
				name = empire_declining
				duration = -1
			}
		}
		if = {
			limit = { has_country_modifier = empire_collapsing }
			remove_country_modifier = empire_collapsing
			add_country_modifier = {
				name = empire_fragmenting
				duration = -1
			}
		}
		if = {
			limit = { has_country_modifier = total_collapse }
			remove_country_modifier = total_collapse
			add_country_modifier = {
				name = empire_collapsing
				duration = -1
			}
		}
	}
}

# Pax Romana Ends
country_event = {
	id = et.25
	title = "et.EVTNAME25"
	desc = "et.EVTDESC25"
	picture = COUNTRY_COLLAPSE_eventPicture

	trigger = {
		has_country_modifier = pax_romana
		num_of_rebel_controlled_provinces = 2
		is_at_war = yes
		war_exhaustion = 2
		NOT = { stability = 2 }
		OR = {
			NOT = { stability = 1 }
			war_exhaustion = 6
		}
	}
	mean_time_to_happen = {
		months = 1
	}

	immediate = {
		remove_country_modifier = pax_romana
	}
	
	option = {
		name = "et.EVTOPTA25"
		add_stability = -1
		if = {
			limit = { has_country_modifier = empire_collapsing }
			remove_country_modifier = empire_collapsing
			add_country_modifier = {
				name = total_collapse
			duration = -1
			}
		}
		if = {
			limit = { has_country_modifier = empire_fragmenting }
			remove_country_modifier = empire_fragmenting
			add_country_modifier = {
				name = empire_collapsing
			duration = -1
			}
		}
		if = {
			limit = { has_country_modifier = empire_declining }
			remove_country_modifier = empire_declining
			add_country_modifier = {
				name = empire_fragmenting
			duration = -1
			}
		}
		if = {
			limit = { has_country_modifier = empire_destabilized }
			remove_country_modifier = empire_destabilized
			add_country_modifier = {
				name = empire_declining
			duration = -1
			}
		}
		if = {
			limit = { 
				NOT = { has_country_modifier = empire_destabilized }
				NOT = { has_country_modifier = empire_declining }
				NOT = { has_country_modifier = empire_fragmenting }
				NOT = { has_country_modifier = empire_collapsing }
				NOT = { has_country_modifier = total_collapse }
			}
			add_country_modifier = {
				name = empire_destabilized
			duration = -1
			}
		}
	}
}

# Decline
country_event = {
	id = et.26
	title = "et.EVTNAME26"
	desc = "et.EVTDESC26"
	picture = COUNTRY_COLLAPSE_eventPicture

	trigger = {
		num_of_rebel_controlled_provinces = 2
		NOT = { stability = 1 }
		war_exhaustion = 2
		OR = {
			NOT = { legitimacy = 50 }
			num_of_rebel_controlled_provinces = 6
			war_exhaustion = 10
		}
		OR = {
			has_country_modifier = large_empire
			has_country_modifier = huge_empire
		}
	}
	mean_time_to_happen = {
		months = 200

		modifier = {
			factor = 0.5
			NOT = { stability = 0 }
		}
		modifier = {
			factor = 0.5
			NOT = { stability = -1 }
		}
		modifier = {
			factor = 0.5
			NOT = { stability = -2 }
		}
		modifier = {
			factor = 0.5
			NOT = { legitimacy = 25 }
		}
		modifier = {
			factor = 0.5
			num_of_rebel_controlled_provinces = 8
		}
		modifier = {
			factor = 0.5
			num_of_rebel_controlled_provinces = 12
		}
	}
	
	option = {
		name = "et.EVTOPTA26"
		if = {
			limit = { 
				stability = -2 
				NOT = { stability = -1 }
			}
			add_stability = 1
		}
		if = {
			limit = { NOT = { stability = -2 } }
			add_stability = 2
		}
		if = {
			limit = { has_country_modifier = empire_collapsing }
			remove_country_modifier = empire_collapsing
			add_country_modifier = {
				name = total_collapse
			duration = -1
			}
		}
		if = {
			limit = { has_country_modifier = empire_fragmenting }
			remove_country_modifier = empire_fragmenting
			add_country_modifier = {
				name = empire_collapsing
			duration = -1
			}
		}
		if = {
			limit = { has_country_modifier = empire_declining }
			remove_country_modifier = empire_declining
			add_country_modifier = {
				name = empire_fragmenting
			duration = -1
			}
		}
		if = {
			limit = { has_country_modifier = empire_destabilized }
			remove_country_modifier = empire_destabilized
			add_country_modifier = {
				name = empire_declining
			duration = -1
			}
		}
		if = {
			limit = { 
				NOT = { has_country_modifier = empire_destabilized }
				NOT = { has_country_modifier = empire_declining }
				NOT = { has_country_modifier = empire_fragmenting }
				NOT = { has_country_modifier = empire_collapsing }
				NOT = { has_country_modifier = total_collapse }
			}
			add_country_modifier = {
				name = empire_destabilized
			duration = -1
			}
		}
	}
}

# Assassination of emperor
country_event = {
	id = et.27
	title = "et.EVTNAME27"
	desc = "et.EVTDESC27"
	picture = ASSASSINATION_eventPicture

	trigger = {
		tag = ROM
		government = monarchy
		NOT = { stability = 2 }
		NOT = { adm = 4 }
		NOT = { dip = 4 }
		NOT = { mil = 4 }
		NOT = { legitimacy = 75 }
		OR = {
			NOT = { adm = 2 }
			NOT = { dip = 2 }
			NOT = { mil = 2 }
		}
		NOT = { has_country_flag = rome_formed }
	}
	mean_time_to_happen = {
		months = 150

		modifier = {
			factor = 0.5
			NOT = { legitimacy = 50 }
		}
		modifier = {
			factor = 0.5
			NOT = { legitimacy = 25 }
		}
		modifier = {
			factor = 0.5
			NOT = { adm = 1 }
		}
		modifier = {
			factor = 0.5
			NOT = { dip = 1 }
		}
		modifier = {
			factor = 0.5
			NOT = { mil = 1 }
		}
		modifier = {
			factor = 0.8
			NOT = { stability = 0 }
		}
	}
	
	option = {
		name = "et.EVTOPTA27"
		define_ruler = { mil = 4 }
		add_stability = -2
		random_owned_province = {
			limit = { 
				is_core = ROOT 
				base_tax = 5
			}
			every_neighbor_province = {
				limit = { 
					owned_by = ROOT
				}
				pretender_rebels = 2
			}
			pretender_rebels = 2
			change_siege = 20		#so they take them quickly
		}
		if = {
			limit = { has_country_modifier = empire_collapsing }
			remove_country_modifier = empire_collapsing
			add_country_modifier = {
				name = total_collapse
			duration = -1
			}
		}
		if = {
			limit = { has_country_modifier = empire_fragmenting }
			remove_country_modifier = empire_fragmenting
			add_country_modifier = {
				name = empire_collapsing
			duration = -1
			}
		}
		if = {
			limit = { has_country_modifier = empire_declining }
			remove_country_modifier = empire_declining
			add_country_modifier = {
				name = empire_fragmenting
			duration = -1
			}
		}
		if = {
			limit = { has_country_modifier = empire_destabilized }
			remove_country_modifier = empire_destabilized
			add_country_modifier = {
				name = empire_declining
			duration = -1
			}
		}
		if = {
			limit = { 
				NOT = { has_country_modifier = empire_destabilized }
				NOT = { has_country_modifier = empire_declining }
				NOT = { has_country_modifier = empire_fragmenting }
				NOT = { has_country_modifier = empire_collapsing }
				NOT = { has_country_modifier = total_collapse }
			}
			add_country_modifier = {
				name = empire_destabilized
				duration = -1
			}
		}
	}
}

#Briton Uprisings
country_event = {
	id = et.38
	title = "et.EVTNAME38"
	desc = "et.EVTDESC38"
	picture = CIVIL_WAR_eventPicture

	fire_only_once = yes

	trigger = {
		OR = {
			tag = ROM
			tag = ROW
		}
		is_year = 350
		NOT = { stability = 3 }
		OR = {
			has_country_modifier = empire_destabilized
			has_country_modifier = empire_declining
			has_country_modifier = empire_fragmenting
			has_country_modifier = empire_collapsing
			has_country_modifier = total_collapse
		}
		NOT = { has_country_flag = rome_formed }
		any_owned_province = {
			region = british_isles_region
		}
	}
	mean_time_to_happen = {
		months = 240

		modifier = {
			factor = 0.8
			has_country_modifier = empire_declining
		}
		modifier = {
			factor = 0.6
			has_country_modifier = empire_fragmenting
		}
		modifier = {
			factor = 0.4
			has_country_modifier = empire_collapsing
		}
		modifier = {
			factor = 0.2
			has_country_modifier = total_collapse
		}
		modifier = {
			factor = 0.5
			NOT = { stability = 0 }
		}
		modifier = {
			factor = 0.5
			NOT = { stability = -1 }
		}
		modifier = {
			factor = 0.5
			NOT = { stability = -2 }
		}
	}
	
	option = {
		name = "et.EVTOPTA38"
		add_stability = -2
		every_owned_province = {
			limit = {
				region = british_isles_region
			}
			if = {
				limit = { 
					culture = roman 
					OR = { area = lowlands_area area = highlands_area } 
				}
				change_culture = scottish
			}
			if = {
				limit = { 
					culture = roman 
					OR = {
						area = eastern_ireland_area
						area = western_ireland_area
						area = ulster_area
					}
				}
				change_culture = irish
			}
			if = {
				limit = { 
					culture = roman 
					area = wales_area
				}
				change_culture = welsh
			}
			if = {
				limit = { 
					culture = roman 
					NOT = { area = wales_area } 
					NOT = { area = eastern_ireland_area } 
					NOT = { area = western_ireland_area } 
					NOT = { area = ulster_area } 
					NOT = { area = lowlands_area } 
					NOT = { area = highlands_area } 
				}
				change_culture = briton
			}
		}
		if = {
			limit = {
				owns = 249
			}
			249 = {
				add_core = PCT
				nationalist_rebels = 1
				change_siege = 20
			}
		}
		if = {
			limit = {
				owns = 248
			}
			248 = {
				add_core = PCT
				nationalist_rebels = 1
				change_siege = 20
			}
		}
		if = {
			limit = {
				owns = 250
			}
			250 = {
				add_core = PCT
			}
		}
		if = {
			limit = {
				owns = 251
			}
			251 = {
				add_core = PCT
			}
		}
		if = {
			limit = {
				owns = 252
			}
			252 = {
				add_core = PCT
			}
		}
		if = {
			limit = {
				owns = 253
			}
			253 = {
				add_core = PCT
			}
		}
		if = {
			limit = {
				owns = 369
			}
			369 = {
				add_core = PCT
			}
		}
		if = {
			limit = {
				owns = 372
			}
			372 = {
				add_core = ULS
				nationalist_rebels = 1
				change_siege = 20
			}
		}
		if = {
			limit = {
				owns = 373
			}
			373 = {
				add_core = MTH
				nationalist_rebels = 1
				change_siege = 20
			}
		}
		if = {
			limit = {
				owns = 374
			}
			373 = {
				add_core = LEI
				nationalist_rebels = 1
				change_siege = 20
			}
		}
		if = {
			limit = {
				owns = 375
			}
			373 = {
				add_core = MNS
				nationalist_rebels = 1
				change_siege = 20
			}
		}
		if = {
			limit = {
				owns = 376
			}
			373 = {
				add_core = CNN
				nationalist_rebels = 1
				change_siege = 20
			}
		}
		if = {
			limit = {
				owns = 233
			}
			233 = {
				add_core = DUM
				nationalist_rebels = 1
				change_siege = 20
			}
		}
		if = {
			limit = {
				owns = 234
			}
			234 = {
				add_core = ERG
			}
		}
		if = {
			limit = {
				owns = 235
			}
			235 = {
				add_core = KEN
			}
		}
		if = {
			limit = {
				owns = 236
			}
			236 = {
				add_core = ESX
			}
		}
		if = {
			limit = {
				owns = 237
			}
			237 = {
				add_core = ERG
			}
		}
		if = {
			limit = {
				owns = 238
			}
			238 = {
				add_core = ESX
			}
		}
		if = {
			limit = {
				owns = 239
			}
			239 = {
				add_core = ERG
			}
		}
		if = {
			limit = {
				owns = 1860
			}
			1860 = {
				add_core = EAN
			}
		}
		if = {
			limit = {
				owns = 240
			}
			240 = {
				add_core = ELM
			}
		}
		if = {
			limit = {
				owns = 241
			}
			241 = {
				add_core = DYF
				nationalist_rebels = 1
				change_siege = 20
			}
		}
		if = {
			limit = {
				owns = 242
			}
			242 = {
				add_core = GWY
				nationalist_rebels = 1
				change_siege = 20
			}
		}
		if = {
			limit = {
				owns = 1861
			}
			1861 = {
				add_core = ELM
			}
		}
		if = {
			limit = {
				owns = 243
			}
			243 = {
				add_core = LIN
			}
		}
		if = {
			limit = {
				owns = 244
			}
			244 = {
				add_core = RHE
				nationalist_rebels = 1
				change_siege = 20
			}
		}
		if = {
			limit = {
				owns = 245
			}
			245 = {
				add_core = DEI
				nationalist_rebels = 1
				change_siege = 20
			}
		}
		if = {
			limit = {
				owns = 246
			}
			246 = {
				add_core = BRN
				nationalist_rebels = 1
				change_siege = 20
			}
		}
		if = {
			limit = {
				owns = 247
			}
			247 = {
				add_core = RHE
				nationalist_rebels = 1
				change_siege = 20
			}
		}
		ai_chance = { 
			factor = 50
			modifier = { 
				factor = 0
				OR = {
					has_country_modifier = empire_declining
					has_country_modifier = empire_fragmenting
					has_country_modifier = empire_collapsing
					has_country_modifier = total_collapse
				}
			}
		}
	}
	option = {
		name = "et.EVTOPTB38"
		add_stability = 1
		every_owned_province = {
			limit = {
				region = british_isles_region
			}
			if = {
				limit = { 
					culture = roman 
					OR = { area = lowlands_area area = highlands_area } 
				}
				change_culture = scottish
			}
			if = {
				limit = { 
					culture = roman 
					OR = {
						area = eastern_ireland_area
						area = western_ireland_area
						area = ulster_area
					}
				}
				change_culture = irish
			}
			if = {
				limit = { 
					culture = roman 
					area = wales_area
				}
				change_culture = welsh
			}
			if = {
				limit = { 
					culture = roman 
					NOT = { area = wales_area } 
					NOT = { area = eastern_ireland_area } 
					NOT = { area = western_ireland_area } 
					NOT = { area = ulster_area } 
					NOT = { area = lowlands_area } 
					NOT = { area = highlands_area } 
				}
				change_culture = briton
			}
			if = {
				limit = { religion = hellenism }
				change_religion = druidism
			}
		}
		if = {
			limit = {
				owns = 249
			}
			249 = {
				add_core = PCT
				cede_province = PCT
			}
		}
		if = {
			limit = {
				owns = 248
			}
			248 = {
				add_core = PCT
				cede_province = PCT
			}
		}
		if = {
			limit = {
				owns = 250
			}
			250 = {
				add_core = PCT
				cede_province = PCT
			}
		}
		if = {
			limit = {
				owns = 251
			}
			251 = {
				add_core = PCT
				cede_province = PCT
			}
		}
		if = {
			limit = {
				owns = 252
			}
			252 = {
				add_core = PCT
				cede_province = PCT
			}
		}
		if = {
			limit = {
				owns = 253
			}
			253 = {
				add_core = PCT
				cede_province = PCT
			}
		}
		if = {
			limit = {
				owns = 369
			}
			369 = {
				add_core = PCT
				cede_province = PCT
			}
		}
		if = {
			limit = {
				owns = 372
			}
			372 = {
				add_core = ULS
				cede_province = ULS
			}
		}
		if = {
			limit = {
				owns = 373
			}
			373 = {
				add_core = MTH
				cede_province = MTH
			}
		}
		if = {
			limit = {
				owns = 374
			}
			373 = {
				add_core = LEI
				cede_province = LEI
			}
		}
		if = {
			limit = {
				owns = 375
			}
			373 = {
				add_core = MNS
				cede_province = MNS
			}
		}
		if = {
			limit = {
				owns = 376
			}
			373 = {
				add_core = CNN
				cede_province = CNN
			}
		}
		if = {
			limit = {
				owns = 233
			}
			233 = {
				add_core = DUM
				cede_province = DUM
			}
		}
		if = {
			limit = {
				owns = 234
			}
			234 = {
				add_core = ERG
				cede_province = ERG
			}
		}
		if = {
			limit = {
				owns = 235
			}
			235 = {
				add_core = KEN
				cede_province = KEN
			}
		}
		if = {
			limit = {
				owns = 236
			}
			236 = {
				add_core = ESX
				cede_province = ESX
			}
		}
		if = {
			limit = {
				owns = 237
			}
			237 = {
				add_core = ERG
				cede_province = ERG
			}
		}
		if = {
			limit = {
				owns = 238
			}
			238 = {
				add_core = ESX
				cede_province = ESX
			}
		}
		if = {
			limit = {
				owns = 239
			}
			239 = {
				add_core = ERG
				cede_province = ERG
			}
		}
		if = {
			limit = {
				owns = 1860
			}
			1860 = {
				add_core = EAN
				cede_province = EAN
			}
		}
		if = {
			limit = {
				owns = 240
			}
			240 = {
				add_core = ELM
				cede_province = ELM
			}
		}
		if = {
			limit = {
				owns = 241
			}
			241 = {
				add_core = DYF
				cede_province = DYF
			}
		}
		if = {
			limit = {
				owns = 242
			}
			242 = {
				add_core = GWY
				cede_province = GWY
			}
		}
		if = {
			limit = {
				owns = 1861
			}
			1861 = {
				add_core = ELM
				cede_province = ELM
			}
		}
		if = {
			limit = {
				owns = 243
			}
			243 = {
				add_core = LIN
				cede_province = LIN
			}
		}
		if = {
			limit = {
				owns = 244
			}
			244 = {
				add_core = RHE
				cede_province = RHE
			}
		}
		if = {
			limit = {
				owns = 245
			}
			245 = {
				add_core = DEI
				cede_province = DEI
			}
		}
		if = {
			limit = {
				owns = 246
			}
			246 = {
				add_core = BRN
				cede_province = BRN
			}
		}
		if = {
			limit = {
				owns = 247
			}
			247 = {
				add_core = RHE
				cede_province = RHE
			}
		}
		ai_chance = { 
			factor = 50
		}
	}
}

# Pretender Rises
country_event = {
	id = et.39
	title = "EVTNAME808"
	desc = "EVTDESC808"
	picture = CIVIL_WAR_eventPicture

	trigger = {
		OR = {
			has_country_modifier = large_empire
			has_country_modifier = huge_empire
		}
		NOT = { stability = 1 }
		NOT = { legitimacy = 60 }
	}
	mean_time_to_happen = {
		months = 200

		modifier = {
			factor = 0.5
			NOT = { legitimacy = 30 }
		}
		modifier = {
			factor = 0.6
			NOT = { stability = -1 }
		}
		modifier = {
			factor = 0.6
			NOT = { stability = -2 }
		}
	}
	
	option = {
		name = "EVTOPTB808A"
		add_stability = -1
		random_owned_province = {
			limit = { 
				is_core = ROOT 
			}
			every_neighbor_province = {
				limit = { 
					owned_by = ROOT
				}
				pretender_rebels = 1
			}
			pretender_rebels = 2
			change_siege = 20		#so they take them quickly
		}
	}
}

#Roman culture change
province_event = {

	id = et.53
	title = "et.EVTNAME53"
	desc = "et.EVTDESC53"
	picture = CULTURE_eventPicture
	
	trigger = {
		culture = roman
		NOT = { owner = { primary_culture = roman } }
		NOT = { region = italy_region }
	}
	mean_time_to_happen = {
		months = 24		
	}
	
	option = {
		name = "et.EVTOPTA53"
		change_culture = owner
	}
}

#Boudica
country_event = {

	id = et.55
	title = "et.EVTNAME55"
	desc = "et.EVTDESC55"
	picture = ANGRY_MOB_eventPicture

	fire_only_once = yes
	
	trigger = {
		tag = ROM
		NOT = { is_year = 70 }
		is_year = 59
		owns = 1860
		controls = 1860
	}
	mean_time_to_happen = {
		months = 24		
	}
	
	option = {
		name = "et.EVTOPTA55"
		1860 = { nationalist_rebels = 5 }
	}
}

#Vesuvius
country_event = {

	id = et.56
	title = "et.EVTNAME56"
	desc = "et.EVTDESC56"
	picture = COMET_SIGHTED_eventPicture

	fire_only_once = yes
	
	trigger = {
		owns = 121
		is_year = 79
		NOT = { is_year = 81 }
		OR = { 
			is_year = 80
			is_month = 7
		}
	}
	mean_time_to_happen = {
		months = 4	
	}
	
	option = {
		name = "et.EVTOPTA56"
		add_adm_power = -100
		add_years_of_income = -0.3
	}

	option = {
		name = "et.EVTOPTB56"
		add_stability = -1
		121 = { add_base_tax = -1 }
	}
}