namespace = VIK
character_event = {
	id = VIK.1000
	
	is_triggered_only = yes
	hide_window = yes
	only_playable = yes
	
	trigger = {
		NOT = {year = 869}

		character = 163113 # Bagsecg
		
	}
	immediate = {
		character_event = {id = 62900}
	}
}

character_event = {
	id = VIK.1001
	
	is_triggered_only = yes
	hide_window = yes
	only_playable = yes
	
	immediate = {
		if = {
			limit = {war = yes}
			character_event = {id = VIK.1001 days = 60}
		}
		if = {
			limit = {war = no}
			character_event = {id = 62900 days = 1}
		}
		
	}
}

character_event = {
	id = VIK.1002
	
	is_triggered_only = yes
	hide_window = yes
	
	immediate = {
		if = {
			limit = {ai = yes}
			any_playable_ruler = {
				if = {
					limit = {
						character = 163112
						ai = yes
					}
					add_alliance = { who = ROOT years = 5 }
				}
				if = {
					limit = {
						character = 163111
						ai = yes
					}
					add_alliance = { who = ROOT years = 5 }
				}
			}
		}
	}
}


character_event = {
	id = VIK.1003
	desc = EVTDESC62320
	
	picture = GFX_evt_vikings_arriving_oldgods
	border = GFX_event_normal_frame_war
	hide_from = yes
	is_triggered_only = yes
	trigger = {
		NOT = {has_character_flag = failed_invasion}
	}
	option = {
		name = EVTOPTA62320
		random_realm_province = {
			ROOT = {
				spawn_unit = {
					province = PREV
					owner = ROOT
					match_character = ROOT
					match_mult = 0.5
					match_min = 421
					match_max = 1612
					earmark = prepared_invasion
					attrition = 1.0
				}
				spawn_unit = {
					province = PREV
					owner = ROOT
					match_character = ROOT
					match_mult = 0.5
					match_min = 421
					match_max = 1612
					earmark = prepared_invasion
					attrition = 1.0
				}
				spawn_unit = {
					province = PREV
					owner = ROOT
					troops ={
						light_infantry = { 692 692 }
						heavy_infantry = { 745 745 }
						archers = { 126 126 }
					}
					earmark = prepared_invasion
					attrition = 1.0
				}
				spawn_fleet = {
					province = closest
					owner = ROOT
					earmark = prepared_invasion
					troops =
					{
						galleys = { 50 50 }
					}
				}
				spawn_fleet = {
					province = closest
					owner = ROOT
					match_character = ROOT
					match_mult = 0.15
					match_min = 10
					earmark = prepared_invasion
				}
				
			}
		}
	}
}