###################################
#
# Random Horde Events
#
# 
###################################

namespace = SM

# War focus bonus troops
character_event = {
	id = SM.20
	title = SM.20.title
	desc = SM.20.desc
	is_triggered_only = yes
	picture = GFX_evt_battle
	
	only_playable = yes
	
	trigger = {
		has_focus = focus_war
		mercenary = no
		is_landed = yes
		controls_religion = no
		holy_order = no
	}

	option = {
		name = SM.20.option
		capital_scope = {
			ROOT = {
				spawn_unit = {
					owner = ROOT
					province = PREV
					home = PREV
					troops = {
						archers = { 150 150 }
						light_infantry = { 350 350 }
						heavy_infantry = { 50 50 }
					}
					attrition = 1.0
					maintenance_multiplier = 0.5
				}
			}
		}
		prestige = -50
		wealth = -50
		ai_chance = {
			factor = 1
			modifier = {
				factor = 0.1
				NOR = {
					wealth = 50
					prestige = 50
				}
			}
		}
	}
	
	option = {
		name = SM.20.option2
		piety = 10
		ai_chance = {
			factor = 1
		}
	}
	
}

# Event to remove the flag preventing new random hordes
character_event = {
	id = SM.2
	#major = yes
	hide_window = yes
	is_triggered_only = yes
	picture = GFX_evt_battle
	
	trigger = {
		OR = {
			AND = {
				has_game_rule = {
				  name = sm_horde_freq
				  value = horde_insane
				}
				had_global_flag = {flag = ran_horde_active days = 3650}   # 10 years = 3650 days
			}
			AND = {
				had_global_flag = {flag = ran_horde_active days = 18250}   # 50 years = 18250 days till next chance for horde spawning
			}
		}
		religion = catholic
		controls_religion = yes # Let it happen for the Pope - he's always around
	}
	immediate = {
		clr_global_flag = ran_horde_active 
		any_playable_ruler = {
			limit = {
				has_character_flag = hordling
			}
			clr_character_flag = hordling
			#remove_trait = adventurer
		}
	}
	option = {
		name = SM.2.option
	}

}

# Event from pope asking cathlolic ruler to reconsider his actions in the future
#character_event = {
#	id = SM.18
	
#	is_triggered_only = yes
	
#	option = {
#		name = SM.18.option1
#		opinion = { modifier = opinion_very_disappointed who = ROOT years = 5 
#	}
	
#}

# Clear the character flag
#character_event = {
#	id = SM.3
#	
#	is_triggered_only = yes
#	major = yes
#	
#	trigger = {
#		has_character_flag = hordling
#		only_capable = yes
#		only_playable = yes
#	}
#	
#	immediate = {
#		clr_character_flag = hordling
#		clr_global_flag = ran_horde_active 
#	}
#	
#	option = {
#		name = SM.3.option
#	}
#}

# Event to schedule the horde spawning
character_event = {
	id = SM.4
	picture = GFX_evt_battle

	ai = yes
	only_rulers = yes
	prisoner = no
	only_independent = yes
	min_age = 16
	max_age = 60
	only_capable = yes
	only_playable = yes
	
	trigger = {
		controls_religion = no
		holy_order = no
		has_regent = no
		in_revolt = no
		is_landed = yes
		mercenary = no
		is_tributary = no
		OR = {
			NOT = {
				higher_tier_than = DUKE
			}
			AND = {
				is_nomadic = yes
				NOT = {
					any_demesne_title = {
						count = 5
					}
				}
			}
		}
		OR = {
			total_years_played = 10 # Dont spawn hordes at game start
			has_game_rule = {
				  name = sm_horde_delay
				  value = horde_nodelay
			}
		}
		NOT = {
			has_global_flag = ran_horde_active
			has_game_rule = {
				  name = sm_horde_freq
				  value = horde_off
			}
		}
	}
	
	mean_time_to_happen = {
		months = 60
		modifier = {
			# 25 years
			factor = 5
			has_game_rule = {
				  name = sm_horde_freq
				  value = horde_slow
			}
		}
		modifier = {
			# 15 years
			factor = 3
			has_game_rule = {
				  name = sm_horde_freq
				  value = horde_default
			}
		}
		modifier = {
			# 8 years
			factor = 1.6
			has_game_rule = {
				  name = sm_horde_freq
				  value = horde_fast
			}
		}
	}
	
	option = {

		random = {
			chance = 3  # 3% chance
		  modifier = {
			factor = 0.5
			has_game_rule = {
				  name = sm_horde_freq
				  value = horde_slow
			}
		  }
		  modifier = {
			factor = 3
			has_game_rule = {
				  name = sm_horde_freq
				  value = horde_fast
			}
		  }
		  modifier = {
			factor = 5
			has_game_rule = {
				  name = sm_horde_freq
				  value = horde_insane
			}
		  }
		  modifier = {
			factor = 2 #2
			has_focus = focus_war
		  }
		  modifier = {
			factor = 1.25
			OR = {
				AND = {
					religion_group = pagan_group
					is_reformed_religion = no
				}
				is_tribal = yes
				mercenary = yes
			}
		  }
		  modifier = {
			factor = 1.5
			OR = {
				trait = ambitious
				trait = strong
				trait = robust
			}
		  }
		  modifier = {
			factor = 1.15
			OR = {
				trait = brilliant_strategist
				trait = strategist
				martial = 20
			}
		  }
		  modifier = {
			factor = 1.10
			trait = skilled_tactician
		  }
		  modifier = {
			factor = 1.05
			trait = tough_soldier
		  }
		  modifier = {
			factor = 0.5
			OR = {
				trait = stressed
				religion_group = christian
				is_reformed_religion = yes
				age = 45
			}
		  }
		  modifier = {
			# Lets avoid occurring during the major horde events, not including aztecs
			factor = 0.33
			has_game_rule = {
				  name = mongol_invasion
				  value = historical
			}
			OR = {
				AND = {
				    year = 960
					NOT = { year = 1010 }
				}
				AND = {
				    year = 1215
					NOT = { year = 1250 }
				}
				AND = {
				    year = 1360
					NOT = { year = 1405 }
				}
			}
		  }
		  modifier = {
			factor = 0.25
			OR = {
				trait = dwarf
				trait = stutter
				trait = lisp
				trait = hunchback
				trait = harelip
				trait = imbecile
				trait = inbred
				trait = slothful
				trait = monk
				trait = nun
				trait = in_hiding
			}
		  }
		  modifier = {
			factor = 0
			OR = {
				NOT = {martial = 8}
				trait = wounded
				trait = maimed
				trait = infirm
				trait = drunkard
				trait = slow
				trait = weak
				trait = clubfooted
				trait = content
				trait = shy
				trait = timid
				trait = dull
				trait = feeble
				trait = craven
				trait = depressed
				has_disease = yes
				is_weak_trigger = yes
			}
		  }
		  character_event = { id = SM.1 }
		}
	}
}

character_event = {
	id = SM.6
	hide_window = yes
	is_triggered_only = yes
	
	option = {
		capital_scope = {
			ROOT = {
				# Max 30000
				if = {
					limit = {
						NOT = {year = 867}
					}
					random_realm_province = {
						limit = {
							port = yes
						}
						ROOT = {
							spawn_fleet = {
								province = closest
								owner = ROOT
								disband_on_peace = no
								cannot_inherit = yes
								troops = {
									galleys = { 300 300 }
								}
							}
						}
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = ROOT
						disband_on_peace = no
						match_character = ROOT
						match_mult = 2.0  # 3000 troops the max troop count
						match_max = 6000
						attrition = 0.5
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = ROOT
						disband_on_peace = no
						match_character = ROOT
						match_mult = 0.66 
						match_max = 6000
						attrition = 0.5
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = ROOT
						disband_on_peace = no
						match_character = ROOT
						match_mult = 0.4
						match_max = 6000
						attrition = 0.5
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = ROOT
						disband_on_peace = no
						match_character = ROOT
						match_mult = 0.29 
						match_max = 6000
						attrition = 0.5
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = ROOT
						disband_on_peace = no
						match_character = ROOT
						match_mult = 0.22 
						match_max = 6000
						attrition = 0.5
					}
				}
				# max 45000
				if = {
					limit = {
						NOT = {year = 1066}
						year = 867
					}
					random_realm_province = {
						limit = {
							port = yes
						}
						ROOT = {
							spawn_fleet = {
								province = closest
								owner = ROOT
								disband_on_peace = no
								cannot_inherit = yes
								troops = {
									galleys = { 450 450 }
								}
							}
						}
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = ROOT
						disband_on_peace = no
						match_character = ROOT
						match_mult = 2.0  # 3750 troops the max troop count
						match_max = 7500
						attrition = 0.5
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = ROOT
						disband_on_peace = no
						match_character = ROOT
						match_mult = 0.66 
						match_max = 7500
						attrition = 0.5
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = ROOT
						disband_on_peace = no
						match_character = ROOT
						match_mult = 0.4
						match_max = 7500
						attrition = 0.5
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = ROOT
						disband_on_peace = no
						match_character = ROOT
						match_mult = 0.29 
						match_max = 7500
						attrition = 0.5
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = ROOT
						disband_on_peace = no
						match_character = ROOT
						match_mult = 0.22 
						match_max = 7500
						attrition = 0.5
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = ROOT
						disband_on_peace = no
						match_character = ROOT
						match_mult = 0.18
						match_max = 7500
						attrition = 0.5
					}
				}
				# max 60000
				if = {
					limit = {
						NOT = {year = 1241}
						year = 1066
					}
					random_realm_province = {
						limit = {
							port = yes
						}
						ROOT = {
							spawn_fleet = {
								province = closest
								owner = ROOT
								disband_on_peace = no
								cannot_inherit = yes
								troops = {
									galleys = { 500 500 }
								}
							}
						}
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = ROOT
						disband_on_peace = no
						match_character = ROOT
						match_mult = 2.0  # 5000 troops the max troop count
						match_max = 10000
						attrition = 0.5
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = ROOT
						disband_on_peace = no
						match_character = ROOT
						match_mult = 0.66 
						match_max = 10000
						attrition = 0.5
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = ROOT
						disband_on_peace = no
						match_character = ROOT
						match_mult = 0.4
						match_max = 10000
						attrition = 0.5
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = ROOT
						disband_on_peace = no
						match_character = ROOT
						match_mult = 0.29 
						match_max = 10000
						attrition = 0.5
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = ROOT
						disband_on_peace = no
						match_character = ROOT
						match_mult = 0.22 
						match_max = 10000
						attrition = 0.5
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = ROOT
						disband_on_peace = no
						match_character = ROOT
						match_mult = 0.18
						match_max = 10000
						attrition = 0.5
					}
				}
				# max 100000
				if = {
					limit = {
						year = 1241
					}
					random_realm_province = {
						limit = {
							port = yes
						}
						ROOT = {
							spawn_fleet = {
								province = closest
								owner = ROOT
								disband_on_peace = no
								cannot_inherit = yes
								troops = {
									galleys = { 500 500 }
								}
							}
						}
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = ROOT
						disband_on_peace = no
						match_character = ROOT
						match_mult = 2.0  # 5000 troops the max troop count
						match_max = 10000
						attrition = 0.5
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = ROOT
						disband_on_peace = no
						match_character = ROOT
						match_mult = 0.66 
						match_max = 10000
						attrition = 0.5
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = ROOT
						disband_on_peace = no
						match_character = ROOT
						match_mult = 0.4
						match_max = 10000
						attrition = 0.5
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = ROOT
						disband_on_peace = no
						match_character = ROOT
						match_mult = 0.29 
						match_max = 10000
						attrition = 0.5
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = ROOT
						disband_on_peace = no
						match_character = ROOT
						match_mult = 0.22 
						match_max = 10000
						attrition = 0.5
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = ROOT
						disband_on_peace = no
						match_character = ROOT
						match_mult = 0.18
						match_max = 10000
						attrition = 0.5
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = ROOT
						disband_on_peace = no
						match_character = ROOT
						match_mult = 0.15
						match_max = 10000
						attrition = 0.5
					}
										spawn_unit = {
						province = PREV
						home = PREV
						owner = ROOT
						disband_on_peace = no
						match_character = ROOT
						match_mult = 0.13
						match_max = 10000
						attrition = 0.5
					}
										spawn_unit = {
						province = PREV
						home = PREV
						owner = ROOT
						disband_on_peace = no
						match_character = ROOT
						match_mult = 0.12
						match_max = 10000
						attrition = 0.5
					}
										spawn_unit = {
						province = PREV
						home = PREV
						owner = ROOT
						disband_on_peace = no
						match_character = ROOT
						match_mult = 0.10
						match_max = 10000
						attrition = 0.5
					}
					
				}
			}
		}
	}
}

# Spawns the standard amount of units
character_event = {
	id = SM.5
	hide_window = yes
	is_triggered_only = yes
	
	option = {
		capital_scope = {
			ROOT = {
				# Minimum 11000, max 30000
				if = {
					limit = {
						NOT = {year = 867}
					}
					random_realm_province = {
						limit = {
							port = yes
						}
						ROOT = {
							spawn_fleet = {
								province = closest
								owner = ROOT
								disband_on_peace = no
								cannot_inherit = yes
								troops = {
									galleys = { 300 300 }
								}
							}
						}
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = ROOT
						disband_on_peace = no
						match_character = ROOT
						match_mult = 2.0  # 3000 troops the max troop count
						match_min = 2200
						match_max = 6000
						attrition = 0.5
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = ROOT
						disband_on_peace = no
						match_character = ROOT
						match_mult = 0.66 
						match_min = 2200
						match_max = 6000
						attrition = 0.5
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = ROOT
						disband_on_peace = no
						match_character = ROOT
						match_mult = 0.4
						match_min = 2200
						match_max = 6000
						attrition = 0.5
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = ROOT
						disband_on_peace = no
						match_character = ROOT
						match_mult = 0.29 
						match_min = 2200
						match_max = 6000
						attrition = 0.5
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = ROOT
						disband_on_peace = no
						match_character = ROOT
						match_mult = 0.22 
						match_min = 2200
						match_max = 6000
						attrition = 0.5
					}
				}
				# Minimum 15000, max 45000
				if = {
					limit = {
						NOT = {year = 1066}
						year = 867
					}
					random_realm_province = {
						limit = {
							port = yes
						}
						ROOT = {
							spawn_fleet = {
								province = closest
								owner = ROOT
								disband_on_peace = no
								cannot_inherit = yes
								troops = {
									galleys = { 450 450 }
								}
							}
						}
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = ROOT
						disband_on_peace = no
						match_character = ROOT
						match_mult = 2.0  # 3750 troops the max troop count
						match_min = 2500
						match_max = 7500
						attrition = 0.5
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = ROOT
						disband_on_peace = no
						match_character = ROOT
						match_mult = 0.66 
						match_min = 2500
						match_max = 7500
						attrition = 0.5
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = ROOT
						disband_on_peace = no
						match_character = ROOT
						match_mult = 0.4
						match_min = 2500
						match_max = 7500
						attrition = 0.5
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = ROOT
						disband_on_peace = no
						match_character = ROOT
						match_mult = 0.29 
						match_min = 2500
						match_max = 7500
						attrition = 0.5
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = ROOT
						disband_on_peace = no
						match_character = ROOT
						match_mult = 0.22 
						match_min = 2500
						match_max = 7500
						attrition = 0.5
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = ROOT
						disband_on_peace = no
						match_character = ROOT
						match_mult = 0.18
						match_min = 2500
						match_max = 7500
						attrition = 0.5
					}
				}
				# Minimum 30000, max 60000
				if = {
					limit = {
						NOT = {year = 1241}
						year = 1066
					}
					random_realm_province = {
						limit = {
							port = yes
						}
						ROOT = {
							spawn_fleet = {
								province = closest
								owner = ROOT
								disband_on_peace = no
								cannot_inherit = yes
								troops = {
									galleys = { 500 500 }
								}
							}
						}
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = ROOT
						disband_on_peace = no
						match_character = ROOT
						match_mult = 2.0  # 5000 troops the max troop count
						match_min = 5000
						match_max = 10000
						attrition = 0.5
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = ROOT
						disband_on_peace = no
						match_character = ROOT
						match_mult = 0.66 
						match_min = 5000
						match_max = 10000
						attrition = 0.5
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = ROOT
						disband_on_peace = no
						match_character = ROOT
						match_mult = 0.4
						match_min = 5000
						match_max = 10000
						attrition = 0.5
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = ROOT
						disband_on_peace = no
						match_character = ROOT
						match_mult = 0.29 
						match_min = 5000
						match_max = 10000
						attrition = 0.5
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = ROOT
						disband_on_peace = no
						match_character = ROOT
						match_mult = 0.22 
						match_min = 5000
						match_max = 10000
						attrition = 0.5
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = ROOT
						disband_on_peace = no
						match_character = ROOT
						match_mult = 0.18
						match_min = 5000
						match_max = 10000
						attrition = 0.5
					}
				}
				# Minimum 40000, max 100000
				if = {
					limit = {
						NOT = {year = 1337}
						year = 1241
					}
					random_realm_province = {
						limit = {
							port = yes
						}
						ROOT = {
							spawn_fleet = {
								province = closest
								owner = ROOT
								disband_on_peace = no
								cannot_inherit = yes
								troops = {
									galleys = { 500 500 }
								}
							}
						}
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = ROOT
						disband_on_peace = no
						match_character = ROOT
						match_mult = 3.33  # 5000 troops the max troop count
						match_min = 6700
						match_max = 16700
						attrition = 0.5
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = ROOT
						disband_on_peace = no
						match_character = ROOT
						match_mult = 0.77 
						match_min = 6700
						match_max = 16700
						attrition = 0.5
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = ROOT
						disband_on_peace = no
						match_character = ROOT
						match_mult = 0.43
						match_min = 6700
						match_max = 16700
						attrition = 0.5
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = ROOT
						disband_on_peace = no
						match_character = ROOT
						match_mult = 0.30
						match_min = 6700
						match_max = 16700
						attrition = 0.5
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = ROOT
						disband_on_peace = no
						match_character = ROOT
						match_mult = 0.23
						match_min = 6700
						match_max = 16700
						attrition = 0.5
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = ROOT
						disband_on_peace = no
						match_character = ROOT
						match_mult = 0.19
						match_min = 6700
						match_max = 16700
						attrition = 0.5
					}
				}
				# Minimum 50000, max 120000
				if = {
					limit = {
						year = 1337
					}
					random_realm_province = {
						limit = {
							port = yes
						}
						ROOT = {
							spawn_fleet = {
								province = closest
								owner = ROOT
								disband_on_peace = no
								cannot_inherit = yes
								troops = {
									galleys = { 500 500 }
								}
							}
						}
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = ROOT
						disband_on_peace = no
						match_character = ROOT
						match_mult = 4.0  # 5000 troops the max troop count
						match_min = 8333
						match_max = 20000
						attrition = 0.5
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = ROOT
						disband_on_peace = no
						match_character = ROOT
						match_mult = 0.8
						match_min = 8333
						match_max = 20000
						attrition = 0.5
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = ROOT
						disband_on_peace = no
						match_character = ROOT
						match_mult = 0.44
						match_min = 8333
						match_max = 20000
						attrition = 0.5
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = ROOT
						disband_on_peace = no
						match_character = ROOT
						match_mult = 0.31
						match_min = 8333
						match_max = 20000
						attrition = 0.5
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = ROOT
						disband_on_peace = no
						match_character = ROOT
						match_mult = 0.24
						match_min = 8333
						match_max = 20000
						attrition = 0.5
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = ROOT
						disband_on_peace = no
						match_character = ROOT
						match_mult = 0.19
						match_min = 8333
						match_max = 20000
						attrition = 0.5
					}
				}
			}
		}
	}
	
}

character_event = {
	id = SM.1
	is_triggered_only = yes
	hide_window = yes
	
	option = {
		random_list = {
			# General events
			10 = {
				narrative_event = {id = SM.7}
			}
			10 = {
				narrative_event = {id = SM.15}
			}
			# Government events
			10 = {
				modifier = {
					factor = 0
					is_tribal = no
				}
				narrative_event = {id = SM.8}
			}
			10 = {
				modifier = {
					factor = 0
					is_nomadic = no
				}
				narrative_event = {id = SM.9}
			}
			10 = {
				modifier = {
					factor = 0
					is_feudal = no
				}
				narrative_event = {id = SM.10}
			}
			10 = {
				modifier = {
					factor = 0
					is_republic = no
				}
				narrative_event = {id = SM.11}
			}
			10 = {
				modifier = {
					factor = 0
					is_heretic = no
				}
				narrative_event = {id = SM.12}
			}
			# Religious events
			10 = {
				modifier = {
					factor = 0
					NOR = {
						religion = catholic
						trait = zealous
					}
				}
				narrative_event = {id = SM.13}
			}
			10 = {
				modifier = {
					factor = 0
					NOR = {
						religion = norse_pagan_reformed
						religion = norse_pagan
					}
				}
				narrative_event = {id = SM.14}
			}
		}
		if = {
			limit = {
				has_game_rule = {
				  name = sm_horde_size
				  value = horde_scaled
				}
			}
			character_event = { id = SM.6 }
		}
		if = {
			limit = {
				has_game_rule = {
				  name = sm_horde_size
				  value = horde_default
				}
			}
			character_event = { id = SM.5 }
		}
		#add_trait = adventurer
		add_trait = ambitious
		set_global_flag = ran_horde_active
		set_character_flag = hordling # For the HORDE!!!
		prestige = 3000 # We are prestigious
		any_independent_ruler = {
			limit = { NOT = { distance = { who = PREV distance = 500} } }
			opinion = { modifier = opinion_hate who = PREV years = 10 }
			reverse_opinion = { modifier = opinion_hate who = PREV years = 10 }
		}
	}
}

# ----------- Message Horde Events --------------


# Tribal Event
narrative_event = {
	id = SM.8
	title = SM.1.title
	desc = SM.1.desc.tribe
		picture = GFX_evt_battle
	border = GFX_event_narrative_frame_war
	major = yes
		is_triggered_only = yes
	
	option = {
		name = SM.1.option
		trigger = {
			character = ROOT
		}
		#character_event = { id = SM.3 days = 180}
	}
	option = {
		name = SM.1.option2
		trigger = {
			NOT= {
				character = ROOT
			}
		}
	}
}

# Nomadic Event
narrative_event = {
	id = SM.9
	title = SM.1.title
	desc = SM.1.desc.nomad
		picture = GFX_evt_battle
	border = GFX_event_narrative_frame_war
	major = yes
		is_triggered_only = yes
	
	option = {
		name = SM.1.option
		trigger = {
			character = ROOT
		}
		#character_event = { id = SM.3 days = 180}
	}
	option = {
		name = SM.1.option2
		trigger = {
			NOT= {
				character = ROOT
			}
		}
	}
}

#Feudal Event
narrative_event = {
	id = SM.10
	title = SM.1.title
	desc = SM.1.desc.feudal
		picture = GFX_evt_battle
	border = GFX_event_narrative_frame_war
	major = yes
		is_triggered_only = yes
	
	option = {
		name = SM.1.option
		trigger = {
			character = ROOT
		}
		#character_event = { id = SM.3 days = 180}
	}
	option = {
		name = SM.1.option2
		trigger = {
			NOT= {
				character = ROOT
			}
		}
	}
}

#Republic Event
narrative_event = {
	id = SM.11
	title = SM.1.title
	desc = SM.1.desc.republic
		picture = GFX_evt_battle
	border = GFX_event_narrative_frame_war
	major = yes
		is_triggered_only = yes
	
	option = {
		name = SM.1.option
		trigger = {
			character = ROOT
		}
		#character_event = { id = SM.3 days = 180}
	}
	option = {
		name = SM.1.option2
		trigger = {
			NOT= {
				character = ROOT
			}
		}
	}
}

#Heretic Event
narrative_event = {
	id = SM.12
	title = SM.1.title
	desc = SM.1.desc.heretic
		picture = GFX_evt_battle
	border = GFX_event_narrative_frame_war
	major = yes
	
		is_triggered_only = yes
	
	option = {
		name = SM.1.option
		trigger = {
			character = ROOT
		}
		#character_event = { id = SM.3 days = 180}
	}
	option = {
		name = SM.1.option2
		trigger = {
			NOT= {
				character = ROOT
			}
		}
	}
}

#Catholic Event
narrative_event = {
	id = SM.13
	title = SM.1.title
	desc = SM.1.desc.cath
		picture = GFX_evt_battle
	border = GFX_event_narrative_frame_war
	major = yes
	
	is_triggered_only = yes
	
	option = {
		name = SM.1.option
		trigger = {
			character = ROOT
		}
		#character_event = { id = SM.3 days = 180}
	}
	option = {
		name = SM.1.option2
		trigger = {
			NOT= {
				character = ROOT
			}
		}
	}
}

#Norse Event
narrative_event = {
	id = SM.14
	title = SM.1.title
	desc = SM.1.desc.norse
		picture = GFX_evt_battle
	border = GFX_event_narrative_frame_war
	major = yes
	
		is_triggered_only = yes
	
	option = {
		name = SM.1.option
		trigger = {
			character = ROOT
		}
		#character_event = { id = SM.3 days = 180}
	}
	option = {
		name = SM.1.option2
		trigger = {
			NOT= {
				character = ROOT
			}
		}
	}
}

# Standard event 2
narrative_event = { 
	id = SM.15
	title = SM.1.title
	desc = SM.1.desc.gen2
	picture = GFX_evt_battle
	border = GFX_event_narrative_frame_war
	major = yes
	
	is_triggered_only = yes
	
	option = {
		name = SM.1.option
		trigger = {
			character = ROOT
		}
		#character_event = { id = SM.3 days = 180}
	}
	option = {
		name = SM.1.option2
		trigger = {
			NOT= {
				character = ROOT
			}
		}
	}
}

# Standard Event popup
narrative_event = { 
	id = SM.7
	title = SM.1.title
	desc = SM.1.desc.gen
	picture = GFX_evt_battle
	border = GFX_event_narrative_frame_war
	major = yes
	
	is_triggered_only = yes
	
	option = {
		name = SM.1.option
		trigger = {
			character = ROOT
		}
		#character_event = { id = SM.3 days = 180}
	}
	option = {
		name = SM.1.option2
		trigger = {
			NOT= {
				character = ROOT
			}
		}
	}
}