###################################
#
# SUNSET INVASION
# - The Fantasy Menace
#
###################################
# Written by Henrik Fhraeus and Henrik Eklund
# Modified by Sergei Ivanov

namespace = SSI

# First Contact - Beads and Feathers
province_event = {
	id = SSI.1
	hide_window = yes

	has_dlc = "Sunset Invasion"
	
	trigger = {
		OR = {
			AND = {
				has_game_rule = {
					name = aztec_invasion
					value = historical
				}
				year = 1250
			}
			AND = {
				has_game_rule = {
					name = aztec_invasion
					value = random
				}
				total_years_played = 50
			}
			AND = {
				has_game_rule = {
					name = aztec_invasion
					value = delayed_random
				}
				year = 1000
				total_years_played = 50
			}
		}
		NOR = {
			year = 1350
			has_global_flag = aztec_explorers 
			has_game_rule = {
				name = aztec_invasion
				value = off
			}
		}
		duchy = {
			OR = {
				title = d_galicia
				title = d_porto
				title = d_balata
				title = d_beja
				title = d_sevilla
				title = d_tangiers
				title = d_fes	
				title = d_marrakech
				title = d_sous
			}
		}
		port = yes
	}
	
	mean_time_to_happen = {
		months = 720
		modifier = {
			factor = 0.5
			year = 1320
		}
		modifier = {
			factor = 4
			has_game_rule = {
				name = aztec_invasion
				value = random
			}
		}
		modifier = {
			factor = 3
			has_game_rule = {
				name = aztec_invasion
				value = delayed_random
			}
		}
		modifier = { # For 1066 start
			factor = 0.5
			has_global_flag = aztecs_encountered
		}
	}
	
	immediate = {
		if = { 
			limit = {  
				OR = {
					has_game_rule = {
						name = aztec_invasion
						value = random
					}
					has_game_rule = {
						name = aztec_invasion
						value = delayed_random
					}
				}
				NOT = { year = 1300 } #Will never fire otherwise.
			}
			random = { 
				chance = 40
					modifier = {
						factor = 0.75
						total_years_played = 100
					}
					modifier = {
						factor = 0.5
						total_years_played = 150
					}
					modifier = {
						factor = 0.25
						total_years_played = 200
					}
				break = yes #Chance of misfire to prevent the randomized invasions from firing immediately after 50 years of game.
			}
		}
		log = "AZTEC INVASION IMMEDIATE 5532432005"
		set_global_flag = aztec_explorers
		activate_title = { title = e_mexikha status = yes }
		create_random_soldier = {
			culture = nahuatl
			religion = aztec
			dynasty = actually_culture
			random_traits = yes
		}
		new_character = {
			add_ambition = obj_aggression_zero
			remove_all_negative_congenital_traits_effect = yes
			e_mexikha = {
				grant_title = PREV
			}
		}
		owner = { character_event = { id = SSI.74 } }
		
		e_mexikha = {
			holder_scope = {
				narrative_event = { id = SSI.2 days = 7 }
			}
		}
	}
	
	option = {
		name = EVTOPTA_SSI_001
	}
}

# Rumors of people from across the Atlantic
narrative_event = {
	id = SSI.2
	title = EVTNAME_SSI_002
	
	desc = EVTDESC_SSI_002
	
	major = yes
	
	picture = GFX_evt_aztec_explorers
	border = GFX_event_narrative_frame_war
	
	is_triggered_only = yes
	
	major_trigger = {
		FROM = { owner = { NOT = { character = PREVPREV } } }
	}
	
	immediate = {
		e_mexikha = {
			holder_scope = {
				add_trait = adventurer
				give_nickname = nick_the_explorer
				character_event = { id = SSI.80 }
				character_event = { id = CM.10018 }  # Chronicle
			}
		}
		offmap_mexikha = {
			set_offmap_flag = no_policy_news
			set_offmap_flag = mexikha_expansionist_trend # Likely for the new ruler to pick Expansionist policy
			#clr_offmap_flag = mexikha_had_unrest
			set_status = mexikha_golden_age
			set_offmap_flag = mexikha_had_golden_age
			clr_offmap_flag = no_policy_news
			offmap_ruler = {
				health = -3
			}
		}
	}
	
	option = {
		name = EVTOPTA_SSI_002
	}
}

# character_event = { id = CM.10020 }  # Chronicle CHRONICLE_AZTEC_INVASION

# Aztecs Thrown Back Into the Sea
# ROOT = holder of e_mexikha
narrative_event = {
	id = SSI.105
	title = EVTNAME_SSI_105
	desc = EVTDESC_SSI_105
	
	picture = GFX_evt_aztec_arrival
	border = GFX_event_narrative_frame_war
	portrait = ROOT
	
	major = yes
	
	only_playable = yes
	
	is_triggered_only = yes
	
	trigger = {
		is_landed = no
	}
	
	major_trigger = {
		ai = no
	}
	
	immediate = {
		any_demesne_title = {
			
		}
		offmap_mexikha = {
			set_offmap_flag = aztecs_defeated
		}
		any_close_relative = { death = { death_reason = death_went_back_to_mexikha } }
		spouse = { death = { death_reason = death_went_back_to_mexikha } }
		death = { death_reason = death_went_back_to_mexikha }
		unsafe_destroy_landed_title = e_mexikha
		activate_title = { title = e_mexikha status = no }
	}
	
	option = {
		name = EVTOPTA_SSI_105
		trigger = {
			AND = { 
				race = nahuatl
				religion = aztec
			}
		}
	}
	option = {
		name = EVTOPTB_SSI_105
		trigger = {
			NAND = { 
				race = nahuatl
				religion = aztec
			}
		}
	}
}

# Aztecs Fight Incas
narrative_event = {
	id = SSI.30
	has_dlc = "Sunset Invasion"
    title = NEWS_FROM_MEXIKHA
	picture = GFX_evt_throne_room_mesoamerican
	portrait = offmap_mexikha
	window = EventWindowOffmap
	background = GFX_event_window_news_from_mexikha
	
	desc = EVTDESC_SSI_030
    
	major = yes
	
	only_playable = yes
	has_global_flag = aztec_arrival
	
	trigger = {
		has_landed_title = e_mexikha
		offmap_mexikha = { 
			had_offmap_tmp_flag = { flag = mexikha_has_horse_regiments years = 10 }
		}
		NOT = { has_global_flag = aztec_incas }
	}
	
	major_trigger = {
		ai = no
	}
	
	mean_time_to_happen = {
		months = 220
	}
	
	immediate = {
		set_global_flag = aztec_incas
		set_offmap_flag = mexikha_inca_invasion_trend
		#disband_event_forces = aztec_invasion_doomstack
	}
	
	option = {
		name = EVTOPTA_SSI_030
		trigger = {
			NOR = {
				suzerain = {
					has_landed_title = e_mexikha
				}
				top_liege = {
					is_offmap_governor = offmap_mexikha
				}
				has_landed_title = e_mexikha
			}
		}
	}
	option = {
		name = EVTOPTB_SSI_030
		trigger = {
			OR = {
				suzerain = {
					has_landed_title = e_mexikha
				}
				top_liege = {
					is_offmap_governor = offmap_mexikha
				}
				has_landed_title = e_mexikha
			}
		}
	}
}

# Aztecs Pacify Northern Plains
narrative_event = {
	id = SSI.31
	has_dlc = "Sunset Invasion"
    title = NEWS_FROM_MEXIKHA
	picture = GFX_evt_throne_room_mesoamerican
	portrait = offmap_mexikha
	window = EventWindowOffmap
	background = GFX_event_window_news_from_mexikha
	
	desc = EVTDESC_SSI_031 # Sioux?
    
	major = yes
	
	only_playable = yes
	has_global_flag = aztec_arrival
	
	trigger = {
		has_landed_title = e_mexikha
		NOT = { has_global_flag = aztec_plains }
		offmap_mexikha = { 
			has_offmap_tmp_flag = mexikha_has_horse_regiments
			NOR = {
				has_policy = mexikha_isolationist
				has_status = mexikha_norse_invasion # Resolution handled by SSI.50160
				has_status = mexikha_inca_invasion # Resolution handled by SSI.50200
				has_status = mexikha_civil_war # Resolution handled by SSI.50300
			}
		}
	}
	
	major_trigger = {
		ai = no
	}	
	
	mean_time_to_happen = {
		months = 220
	}
	
	immediate = {
		set_global_flag = aztec_plains
	}
	
	option = {
		name = EVTOPTA_SSI_031
		trigger = {
			NOR = {
				top_liege = {
					is_offmap_governor = offmap_mexikha
				}
				has_landed_title = e_mexikha
			}
		}
	}
	option = {
		name = EVTOPTB_SSI_031
		trigger = {
			OR = {
				top_liege = {
					is_offmap_governor = offmap_mexikha
				}
				has_landed_title = e_mexikha
			}
		}
	}
}

# Food From the Americas
# someth to do with ttr trade_route
narrative_event = {
	id = SSI.35
	has_dlc = "Sunset Invasion"
    title = NEWS_FROM_MEXIKHA
	picture = GFX_evt_aztec_explorers
	portrait = offmap_mexikha
	window = EventWindowOffmap
	background = GFX_event_window_news_from_mexikha
	
	desc = EVTDESC_SSI_035
    
	major = yes
	
	only_playable = yes
	has_global_flag = aztec_arrival
	
	trigger = {
		has_landed_title = e_mexikha
		NOT = { has_global_flag = aztec_food }
		NOR = {
			offmap_mexikha = { has_status = mexikha_famine }
			offmap_mexikha = { has_status = mexikha_plague }
			offmap_mexikha = { has_policy = mexikha_isolationist }
		}
	}
	
	major_trigger = {
		ai = no
	}
	
	mean_time_to_happen = {
		months = 220
	}
	
	immediate = {
		set_global_flag = aztec_food
	}
	
	option = {
		name = EVTOPTA_SSI_035
		trigger = {
			NOT = { race = nahuatl }
		}
	}
	option = {
		name = EVTOPTB_SSI_035
		trigger = {
			race = nahuatl
		}
	}
}

# Aztecs Sacrifice Prisoner
character_event = {
	id = SSI.60
	desc = {
		trigger = {
			NOR = {
				religion = aztec
				religion = aztec_reformed
				has_religion_feature = religion_ritual_sacrifice
			}
		}
		text = EVTDESC_SSI_060
	}
	desc = {
		trigger = {
			OR = {
				religion = aztec
				religion = aztec_reformed
				has_religion_feature = religion_ritual_sacrifice
			}
		}
		text = EVTDESC_SSI_060_B
	}
	
	picture = GFX_evt_bishop_aztec
	border = GFX_event_normal_frame_war
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_SSI_060
		trigger = {
			NOR = {
				religion = aztec
				religion = aztec_reformed
				has_religion_feature = religion_ritual_sacrifice
			}
		}
	}
	option = {
		name = EVTOPTB_SSI_060
		trigger = {
			OR = {
				religion = aztec
				religion = aztec_reformed
				has_religion_feature = religion_ritual_sacrifice
			}
		}
	}
}

# Aztecs Sacrifice Occupied Province Character
character_event = {
	id = SSI.61
	hide_window = yes
	
	ai = yes
	min_age = 16
	prisoner = no
	
	is_triggered_only = yes
	
	trigger = {
		in_command = no
		NOT = { religion = aztec }
		NOT = {
			any_liege = {
				has_landed_title = e_mexikha
			}
		}
		new_character = {
			OR = {
				religion = aztec
				religion = aztec_reformed
			}
		}
	}
	
	immediate = {
		liege = {
			character_event = { id = SSI.62 }
		}
		new_character = {
			if = {
				limit = {
					ai = no
					ROOT = {
						controls_religion = yes
						NOR = {
							religion = aztec
							religion = aztec_reformed
						}
					}
				}
				set_character_flag = achievement_holy_smoke
			}
		}
		death = { death_reason = death_sacrificed }
	}
	
	option = {
		name = OK
	}
}

# Liege Informed of Sacrifice
character_event = {
	id = SSI.62
	desc = EVTDESC_SSI_060
	
	picture = GFX_evt_bishop_aztec
	border = GFX_event_normal_frame_war
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_SSI_060
	}
}

# Aztecs Bring Syphilis
narrative_event = {
    id = SSI.70
	has_dlc = "Sunset Invasion"
    title = NEWS_FROM_MEXIKHA
	picture = GFX_evt_plague_spreading
	portrait = offmap_mexikha
	window = EventWindowOffmap
	background = GFX_event_window_news_from_mexikha
    
	desc = EVTDESC_SSI_070
    
	major = yes
	
	only_playable = yes
	has_global_flag = aztec_arrival
	
	trigger = {
		has_landed_title = e_mexikha
		NOT = { has_global_flag = aztec_syphilis }
	}
	
	major_trigger = {
		ai = no
	}
	
	mean_time_to_happen = {
		months = 150
	}
		
	immediate = {
		set_global_flag = aztec_syphilis
		activate_disease = syphilis
	}
	
    option = {
		name = EVTOPTA_SSI_070
		trigger = {
			NOT = { race = nahuatl }
		}
	}
	option = {
		name = EVTOPTB_SSI_070
		trigger = {
			race = nahuatl
		}
	}
}

# Aztecs Struck by Smallpox
narrative_event = {
    id = SSI.71
	has_dlc = "Sunset Invasion"
    title = NEWS_FROM_MEXIKHA
	picture = GFX_evt_plague_spreading
	portrait = offmap_mexikha
	window = EventWindowOffmap
	background = GFX_event_window_news_from_mexikha
    
	desc = EVTDESC_SSI_071
    
	major = yes
	
	only_playable = yes
	has_global_flag = aztec_syphilis
	
	trigger = {
		has_landed_title = e_mexikha
		offmap_mexikha = {
			NOR = {
				AND = { # Famines don't tend to happen too close to each other
					has_offmap_flag = mexikha_had_plague
					NOT = {
						had_offmap_tmp_flag = { flag = mexikha_had_plague years = 90 }
					}
				}
				AND = { # Golden Ages tend to not end with a Famine or Plague
					has_status = mexikha_golden_age
					has_offmap_flag = mexikha_had_golden_age
					NOT = {
						had_offmap_tmp_flag = { flag = mexikha_had_golden_age years = 50 }
					}
				}
				has_status = mexikha_plague
				has_status = mexikha_norse_invasion # Resolution handled by SSI.50160
				has_status = mexikha_inca_invasion # Resolution handled by SSI.50200
				has_status = mexikha_civil_war # Resolution handled by SSI.50300
			}
		}
		NOT = { has_global_flag = aztec_smallpox }
	}
	
	major_trigger = {
		ai = no
	}
	
	mean_time_to_happen = {
		months = 150
	}
		
	immediate = {
		offmap_mexikha = {
			set_offmap_flag = mexikha_had_plague
			set_status = mexikha_plague # Players will be notified by SSI.50030
		}
		set_global_flag = aztec_smallpox
	}
	
    option = {
		name = EVTOPTA_SSI_071
		trigger = {
			NOR = { 
				race = nahuatl
				culture = nahuatl
			}
		}
	}
	option = {
		name = EVTOPTB_SSI_071
		trigger = {
			OR = { 
				race = nahuatl
				culture = nahuatl
			}
		}
	}
}

# Aztecs Sacrifice Prisoner (Aztec perspective)
character_event = {
	id = SSI.72
	desc = EVTDESC_SSI_072
	
	picture = GFX_evt_bishop_aztec
	border = GFX_event_normal_frame_war
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_SSI_072
		if = { 
			limit = { 
				FROM = { 
					is_ruler = no 
				} 
			}
			piety = 5
		}
		if = { 
			limit = { 
				FROM = { 
					tier = BARON
				} 
			}
			piety = 15
		}
		if = { 
			limit = { 
				FROM = { 
					tier = COUNT
				} 
			}
			piety = 30
		}
		if = { 
			limit = { 
				FROM = { 
					tier = DUKE
				} 
			}
			piety = 75
		}
		if = { 
			limit = { 
				FROM = { 
					tier = KING
				} 
			}
			piety = 150
		}
		if = { 
			limit = { 
				FROM = { 
					tier = EMPEROR
				} 
			}
			piety = 250
		}
	}
}

# Notification event at beginning of invasion.
character_event = {
	id = SSI.74
	desc = EVTDESC_SSI_001
	
	picture = GFX_evt_aztec_explorers
	border = GFX_event_normal_frame_war

	has_dlc = "Sunset Invasion"
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_SSI_001
	}
}

###
# on_new_holder setup mexikha governor & e_mexikha
character_event = {
	id = SSI.80
	hide_window = yes
	
	has_dlc = "Sunset Invasion"
	
	is_triggered_only = yes
	
	trigger = {
		OR = {
			FROM = { # on_action calls
				title = e_mexikha
			}
			primary_title = { # character_event calls
				title = e_mexikha
			}
		}
		is_adult = yes
		is_married = no
	}
	
	immediate = {
		dynasty = father_bastard
		add_ambition = obj_aggression_zero
		#set_character_flag = ai_flag_refuse_marriage
		set_character_flag = ai_flag_refuse_concubinage
		# Less likely dead plague
		set_character_flag = immune_aztec_disease
		set_character_flag = immune_syphilis
		if = {
			limit = {
				FROMFROM = {
					spouse = { 
						is_alive = yes
					}
				}
			}
			
			FROMFROM = {
				spouse = {
					death = { death_reason = death_went_back_to_mexikha }
				}
			}
		}
		offmap_ruler = {
			create_character = {
				age = 16
				dynasty = THIS
				religion = THIS
				culture = THIS
				female = yes
				health = 6 
				fertility = 0
				random_traits = yes
			}
			new_character = {
				save_event_target_as = imperial_marriage_spouse_2
				random_list = {
					85 = { 
						add_trait = child_of_consort
					}
					10 = {
						add_trait = legit_bastard
					}
					5 = {
						add_trait = bastard 
					}
				}
			}
			if = { #If Emperor is 32+ and the imperial target is female then make it his child
				limit = {
					could_be_parent_of = event_target:imperial_marriage_spouse_2
				}
				save_event_target_as = imperial_marriage_parent
			}
			else_if = { #Else if Emperor has a father make them siblings
				limit = {
					father_even_if_dead = {
						could_be_parent_of = event_target:imperial_marriage_spouse_2
					}
				}
				father_even_if_dead = {
					save_event_target_as = imperial_marriage_parent
				}
			}
			else_if = { #Else if Emperor has a grandfather make them siblings
				limit = {
					father_even_if_dead = {
						father_even_if_dead = {
							could_be_parent_of = event_target:imperial_marriage_spouse_2
						}
					}
				}
				father_even_if_dead = {
					father_even_if_dead = {
						save_event_target_as = imperial_marriage_parent
					}
				}
			}
			else_if = {
				limit = {
					any_dynasty_member_even_if_dead = {
						is_or_was_offmap_power_ruler = yes
						could_be_parent_of = event_target:imperial_marriage_spouse_2
					}
				}
				random_dynasty_member_even_if_dead = {
					limit = {
						is_or_was_offmap_power_ruler = yes
						could_be_parent_of = event_target:imperial_marriage_spouse_2
					}
					save_event_target_as = imperial_marriage_parent
				}
			}
			else_if = {
				limit = {
					any_dynasty_member_even_if_dead = {
						could_be_parent_of = event_target:imperial_marriage_spouse_2
					}
				}
				random_dynasty_member_even_if_dead = {
					limit = {
						could_be_parent_of = event_target:imperial_marriage_spouse_2
					}
					save_event_target_as = imperial_marriage_parent
				}
			}
			else = { #Else make a new father to make them siblings
				#limit = {
				#	father_even_if_dead = {
				#		always = no
				#	}
				#}
				create_character = {
					age = 60
					dynasty = THIS
					religion = THIS
					culture = THIS
				}
				new_character = { 
					death = { death_reason = death_in_mexikha_historic }
					save_event_target_as = imperial_marriage_parent
				}
				set_father = event_target:imperial_marriage_parent
			}
			event_target:imperial_marriage_parent = {
				gfx_culture_scope = { save_event_target_as = imperial_marriage_parent_gfx_culture }
			}
			event_target:imperial_marriage_spouse_2 = { 
				set_father = event_target:imperial_marriage_parent
				set_graphical_culture = event_target:imperial_marriage_parent_gfx_culture
			}
		}
		add_spouse = event_target:imperial_marriage_spouse_2
		#race = event_target:imperial_marriage_spouse_2
		add_character_modifier = { 
			modifier = aztec_warpaint_1
			years = -1
			hidden = yes
		}
		spouse = {
			if = {
				limit = { race = norse }
				#culture = nahuatl
				random_list = { 
					10 = { 
						add_trait = norse_tattoo_1
					}
					10 = { 
						add_trait = norse_tattoo_2
					}
					10 = { 
						add_trait = norse_tattoo_3
					}
					10 = { 
						add_trait = norse_tattoo_4
					}
					10 = { 
						add_trait = norse_tattoo_5
					}
					10 = { 
						add_trait = norse_tattoo_6
					}
				}
			}
			if = {
				limit = { race = nahuatl }
				add_character_modifier = { 
					modifier = aztec_warpaint_2
					years = -1
					hidden = yes
				}
			}
			if = {
				limit = { race = tamil }
				add_character_modifier = { 
					modifier = zun_warpaint_1
					years = -1
					hidden = yes
				}
			}
		}
		random_list = { # Give a chance to get commander traits
			30 = {
				trigger = {
					can_have_more_leadership_traits = yes
					NOT = { trait = aggressive_leader }
				}
				add_trait = aggressive_leader
			}
			30 = {
				trigger = {
					can_have_more_leadership_traits = yes
					NOT = { trait = jungle_terrain_leader }
				}
				add_trait = jungle_terrain_leader
			}
			30 = {
				trigger = {
					can_have_more_leadership_traits = yes
					NOT = { trait = light_foot_leader }
				}
				add_trait = light_foot_leader
			}
			30 = {
				trigger = {
					can_have_more_leadership_traits = yes
					NOT = { trait = holy_warrior }
				}
				add_trait = holy_warrior
			}
			90 = {}
		}
		random_list = { # Give a chance to get life style traits
			30 = {
				trigger = {
					NOT = { trait = administrator }
				}
				add_trait = administrator
			}
			30 = {
				trigger = {
					NOT = { trait = gardener }
				}
				add_trait = gardener
			}
			30 = {
				trigger = {
					NOT = { trait = hunter }
				}
				add_trait = hunter
			}
			30 = {
				trigger = {
					NOT = { trait = falconer }
				}
				add_trait = falconer
			}
			90 = {}
		}
	}
}

#on_startup setup mexikha governor & e_mexikha
#save-game compablilties v1
character_event = {
	id = SSI.81
	hide_window =yes
	
	has_dlc = "Sunset Invasion"
	
	is_triggered_only = yes
	
	trigger = {
		is_offmap_governor = yes
		offmap_power = { is_offmap_tag = offmap_mexikha }
	}
	
	immediate = {
		if = {
			limit = { is_save_game = no	}
			any_character = {
				limit = { 
					#culture = ROOT
					culture = nahuatl
					is_landed = no
				}
				move_character = ROOT
				death = { death_reason = death_went_back_to_mexikha }
			}
			dynasty = none
			#abdicate = yes # and triggers on_new_holder setup
			activate_title = { title = e_mexikha status = no }
			death = {
				#death_reason = death_in_mexikha_historic
				death_reason = death_went_back_to_mexikha
			}
		}
		primary_title = { 
			reset_coa = THIS
			set_name = " "
		}
		# Savegame fix
		add_ambition = obj_aggression_zero
		e_mexikha = {
			add_law = { law = succ_offmap_succession opinion_effect = no }
		}
	}
}

character_event = {
    id = SSI.82
    is_triggered_only = yes
	offmap = only

    hide_window = yes
	
	trigger = {
		is_offmap_tag = offmap_mexikha
	}

    immediate = {
		if = {
			limit = { dynasty = FROM }
			offmap_mexikha = {
				offmap_prev_ruler = {
					gfx_culture_scope = { save_event_target_as = offmap_prev_ruler_gfx_culture }
				}
			}
			random_list = { 
				10 = { 
				}
				100 = { 
					set_graphical_culture = event_target:offmap_prev_ruler_gfx_culture
				}
			}
		}
		if = {
			limit = {
				race = nahuatl
			} 
			add_character_modifier = { 
				modifier = aztec_warpaint_2
				years = -1
				hidden = yes
			}
		}
		else_if = {
			limit = {
				race = norse
			}
			random_list = { 
				10 = { 
					add_trait = norse_tattoo_1
				}
				10 = { 
					add_trait = norse_tattoo_2
				}
				10 = { 
					add_trait = norse_tattoo_3
				}
				10 = { 
					add_trait = norse_tattoo_4
				}
				10 = { 
					add_trait = norse_tattoo_5
				}
				10 = { 
					add_trait = norse_tattoo_6
				}
			}
			random_list = { 
				50 = { 
				}
				50 = { 
					add_trait = scarred
				}
			}
		}
		else_if = {
			limit = {
				race = tamil
			}
			add_character_modifier = { 
				modifier = zun_warpaint_1
				years = -1
				hidden = yes
			}
		}
		#else_if others...
		add_trait = dead_crown_aztec_fylkir
    }
}

# OVERRIDE
# The Demon Child travels to the New World and
# the stupid kid just wakes up Sunset Invasion, Waaaaagh!
character_event = {
	id = SoA.3080

	hide_window = yes
	
	is_triggered_only = yes
	
	immediate = {
		random_province = {
			limit = {
				duchy = {
					OR = {
						title = d_galicia
						title = d_porto
						title = d_balata
						title = d_beja
						title = d_sevilla
						title = d_tangiers
						title = d_fes	
						title = d_marrakech
						title = d_sous
					}
				}
				port = yes
			}
			province_event = { id = SSI.1 }
		}
	}
}
