# Migration start
country_event = {
	id = et.29
	title = "et.EVTNAME29"
	desc = "et.EVTDESC29"
	picture = BORDER_TENSION_eventPicture

	trigger = {
		government = barbarian_tribe
		mil_tech = 15
		is_subject = no
		is_at_war = no
		NOT = { has_country_modifier = barbarian_migration }
		NOT = { has_country_flag = migration_starter }
		OR = {
			is_neighbor_of = ROM
			is_neighbor_of = ROW
			is_neighbor_of = BYZ
			is_neighbor_of = GLL
		}
	}
	mean_time_to_happen = {
		months = 12
	}
	
	option = {
		name = "et.EVTOPTA29"
		ai_chance = { 
			factor = 100

			modifier = {
				factor = 0
				NOT = { stability = 0 }
			}
			modifier = {
				factor = 0
				num_of_revolts = 1
			}
		}
		add_prestige = 20

		add_country_modifier = {
			name = barbarian_migration
			duration = 3560
		}
		if = {
			limit = { is_neighbor_of = ROM }
			declare_war = ROM
		}
		if = {
			limit = { is_neighbor_of = ROW NOT = { is_neighbor_of = ROM } }
			declare_war = ROW
		}
		if = {
			limit = { is_neighbor_of = BYZ NOT = { is_neighbor_of = ROW } NOT = { is_neighbor_of = ROM } }
			declare_war = BYZ
		}
		if = {
			limit = { is_neighbor_of = GLL NOT = { is_neighbor_of = ROW } NOT = { is_neighbor_of = ROM } NOT = { is_neighbor_of = BYZ } }
			declare_war = BYZ
		}
		random_owned_province = {
			infantry = ROOT
			infantry = ROOT
			infantry = ROOT
			infantry = ROOT
			infantry = ROOT
			infantry = ROOT
			infantry = ROOT
			infantry = ROOT
		}
	}
	option = {
		name = "et.EVTOPTB29"
		ai_chance = { 
			factor = 1
		}
		add_prestige = -20
		set_country_flag = migration_starter
	}
}

# Serbs
country_event = {
	id = et.22
	title = "et.EVTNAME22"
	desc = "et.EVTDESC22"
	picture = BORDER_TENSION_eventPicture

	fire_only_once = yes

	trigger = {
		owns = 141
		is_year = 610
		NOT = { is_year = 800 }
		NOT = { stability = 2 }
		141 = {
			NOT = { culture = serbian }
			NOT = { religion = slavic }
			NOT = { owned_by = SER }
		}
	}
	mean_time_to_happen = {
		months = 12
	}
	
	option = {
		name = "et.EVTOPTA22"
		141 = {
			change_religion = slavic
			change_culture = serbian
			add_core = SER
		}
		140 = {
			change_religion = slavic
			change_culture = serbian
			add_core = SER
		}
		139 = {
			change_religion = slavic
			change_culture = serbian
			add_core = SER
		}
		1827 = {
			change_religion = slavic
			change_culture = serbian
			add_core = SER
		}
		1828 = {
			change_religion = slavic
			change_culture = serbian
			add_core = SER
		}
		1831 = {
			change_religion = slavic
			change_culture = serbian
			add_core = SER
		}
		138 = {
			change_religion = slavic
			change_culture = serbian
			add_core = DOC
		}
	}
}

# Croats
country_event = {
	id = et.23
	title = "et.EVTNAME23"
	desc = "et.EVTDESC23"
	picture = BORDER_TENSION_eventPicture

	fire_only_once = yes

	trigger = {
		owns = 131
		is_year = 620
		NOT = { is_year = 800 }
		NOT = { stability = 2 }
		131 = {
			NOT = { culture = croatian }
			NOT = { religion = slavic }
			NOT = { owned_by = CRO }
		}
	}
	mean_time_to_happen = {
		months = 12
	}
	
	option = {
		name = "et.EVTOPTA23"
		130 = {
			change_religion = slavic
			change_culture = croatian
			add_core = CRO
		}
		131 = {
			change_religion = slavic
			change_culture = croatian
			add_core = CRO
		}
		136 = {
			change_religion = slavic
			change_culture = croatian
			add_core = CRO
		}
		152 = {
			change_religion = slavic
			change_culture = croatian
			add_core = CRO
		}
		1767 = {
			change_religion = slavic
			change_culture = croatian
			add_core = CRO
		}
		1826 = {
			change_religion = slavic
			change_culture = croatian
			add_core = CRO
		}
	}
}

# Suebi
country_event = {
	id = et.36
	title = "et.EVTNAME36"
	desc = "et.EVTDESC36"
	picture = BORDER_TENSION_eventPicture

	fire_only_once = yes

	trigger = {
		OR = {
			tag = ROM
			tag = ROW
		}
		owns = 206
		NOT = { exists = EAL }
		is_year = 400
		NOT = { stability = 2 }
		206 = {
			NOT = { culture = galician }
			NOT = { religion = germanic }
			NOT = { owned_by = EAL }
		}
	}
	mean_time_to_happen = {
		months = 120
	}
	
	option = {
		name = "et.EVTOPTA36"
		206 = {
			change_religion = germanic
			change_culture = galician
			add_core = EAL
			nationalist_rebels = 2
			change_siege = 20
		}
		207 = {
			change_religion = germanic
			change_culture = galician
			add_core = EAL
		}
		208 = {
			change_religion = germanic
			change_culture = galician
			add_core = EAL
		}
		227 = {
			change_religion = germanic
			change_culture = galician
			add_core = EAL
		}
		228 = {
			change_religion = germanic
			change_culture = galician
			add_core = EAL
		}
		231 = {
			change_religion = germanic
			change_culture = galician
			add_core = EAL
			nationalist_rebels = 1
			change_siege = 20
		}
		232 = {
			change_religion = germanic
			change_culture = galician
			add_core = EAL
		}
		1851 = {
			change_religion = germanic
			change_culture = galician
			add_core = EAL
			nationalist_rebels = 1
			change_siege = 20
		}
		EAL = { 
			change_primary_culture = galician 
			change_religion = germanic
		}
	}
}

# Vandals
country_event = {
	id = et.37
	title = "et.EVTNAME37"
	desc = "et.EVTDESC37"
	picture = BORDER_TENSION_eventPicture

	fire_only_once = yes

	trigger = {
		OR = {
			tag = ROM
			tag = ROW
		}
		owns = 223
		NOT = { exists = VAN }
		is_year = 400
		NOT = { is_year = 800 }
		NOT = { stability = 2 }
		217 = {
			NOT = { culture = vandal }
			NOT = { owned_by = VAN }
		}
	}
	mean_time_to_happen = {
		months = 120
	}
	
	option = {
		name = "et.EVTOPTA37"
		222 = {
			change_culture = vandal
			add_core = VAN
		}
		223 = {
			change_culture = vandal
			add_core = VAN
			nationalist_rebels = 2
			change_siege = 20
		}
		224 = {
			change_culture = vandal
			add_core = VAN
			nationalist_rebels = 1
			change_siege = 20
		}
		225 = {
			change_culture = vandal
			add_core = VAN
			nationalist_rebels = 1
			change_siege = 20
		}
		226 = {
			change_culture = vandal
			add_core = VAN
			nationalist_rebels = 1
			change_siege = 20
		}
		1748 = {
			change_culture = vandal
			add_core = VAN
		}
		1749 = {
			change_culture = vandal
			add_core = VAN
			nationalist_rebels = 1
			change_siege = 20
		}
	}
}


# Visigoths
country_event = {
	id = et.44
	title = "et.EVTNAME44"
	desc = "et.EVTDESC44"
	picture = BORDER_TENSION_eventPicture

	fire_only_once = yes

	trigger = {
		OR = {
			tag = ROM
			tag = ROW
		}
		NOT = { exists = GVI }
		owns = 175
		is_year = 380
		NOT = { is_year = 800 }
		NOT = { stability = 2 }
		175 = {
			NOT = { culture = gothic }
			NOT = { owned_by = GVI }
		}
	}
	mean_time_to_happen = {
		months = 120
	}

	option = {
		name = "et.EVTOPTA44"
		GVI = { change_religion = arianism }
		create_alliance = GVI
		if = {
			limit = { owns = 175 }
			175 = {
				change_culture = gothic
				cede_province = GVI
				add_core = GVI
				change_religion = arianism
			}
		}
		if = {
			limit = { owns = 173 }
			173 = {
				change_culture = gothic
				cede_province = GVI
				add_core = GVI
				change_religion = arianism
			}
		}
		if = {
			limit = { owns = 176 }
			176 = {
				change_culture = gothic
				cede_province = GVI
				add_core = GVI
				change_religion = arianism
			}
		}
		if = {
			limit = { owns = 174 }
			174 = {
				change_culture = gothic
				cede_province = GVI
				add_core = GVI
				change_religion = arianism
			}
		}
		if = {
			limit = { owns = 196 }
			196 = {
				change_culture = gothic
				cede_province = GVI
				add_core = GVI
				change_religion = arianism
			}
		}
	}
	
	option = {
		name = "et.EVTOPTB44"
		GVI = { change_religion = arianism }
		175 = {
			change_culture = gothic
			add_core = GVI
			change_religion = arianism
			nationalist_rebels = 1
			change_siege = 20
		}
		173 = {
			change_culture = gothic
			add_core = GVI
			change_religion = arianism
			nationalist_rebels = 1
			change_siege = 20
		}
		176 = {
			change_culture = gothic
			add_core = GVI
			change_religion = arianism
			nationalist_rebels = 1
			change_siege = 20
		}
		174 = {
			change_culture = gothic
			add_core = GVI
			change_religion = arianism
			nationalist_rebels = 1
			change_siege = 20
		}
		196 = {
			change_culture = gothic
			add_core = GVI
			change_religion = arianism
			nationalist_rebels = 1
			change_siege = 20
		}
	}
}

# Ostrogoths
country_event = {
	id = et.45
	title = "et.EVTNAME45"
	desc = "et.EVTDESC45"
	picture = BORDER_TENSION_eventPicture

	fire_only_once = yes

	trigger = {
		OR = {
			tag = ROM
			tag = ROW
		}
		NOT = { exists = GOS }
		owns = 140
		is_year = 380
		NOT = { is_year = 800 }
		NOT = { stability = 2 }
		140 = { 
			NOT = { culture = gothic }
			NOT = { owned_by = GOS }
		}
	}
	mean_time_to_happen = {
		months = 120
	}

	option = {
		name = "et.EVTOPTA44"
		GOS = { change_religion = arianism }
		create_alliance = GOS
		if = {
			limit = { owns = 140 }
			140 = {
				change_culture = gothic
				cede_province = GOS
				add_core = GOS
				change_religion = arianism
			}
		}
		if = {
			limit = { owns = 139 }
			139 = {
				change_culture = gothic
				cede_province = GOS
				add_core = GOS
				change_religion = arianism
			}
		}
		if = {
			limit = { owns = 1831 }
			1831 = {
				change_culture = gothic
				cede_province = GOS
				add_core = GOS
				change_religion = arianism
			}
		}
		if = {
			limit = { owns = 1828 }
			1828 = {
				change_culture = gothic
				cede_province = GOS
				add_core = GOS
				change_religion = arianism
			}
		}
		if = {
			limit = { owns = 1767 }
			1767 = {
				change_culture = gothic
				cede_province = GOS
				add_core = GOS
				change_religion = arianism
			}
		}
	}
	
	option = {
		name = "et.EVTOPTB44"
		GOS = { change_religion = arianism }
		140 = {
			change_culture = gothic
			add_core = GOS
			change_religion = arianism
			nationalist_rebels = 1
			change_siege = 20
		}
		139 = {
			change_culture = gothic
			add_core = GOS
			change_religion = arianism
			nationalist_rebels = 1
			change_siege = 20
		}
		1831 = {
			change_culture = gothic
			add_core = GOS
			change_religion = arianism
			nationalist_rebels = 1
			change_siege = 20
		}
		1828 = {
			change_culture = gothic
			add_core = GOS
			change_religion = arianism
			nationalist_rebels = 1
			change_siege = 20
		}
		1767 = {
			change_culture = gothic
			add_core = GOS
			change_religion = arianism
			nationalist_rebels = 1
			change_siege = 20
		}
	}
}