###################################
#
# Mongol Horde Events
#
# Id 60000 - 61000 is reserved
#
###################################

## Rumors of a Steppe Menace
#narrative_event = {
#	id = 60000
#	title = EVTNAME60000
#	desc = EVTDESC60000
#	major = yes
#	
#	picture = "GFX_evt_mongols"
#	border = "GFX_event_narrative_frame_war"
#	
#	only_playable = yes
#	religion = catholic
#	only_men = yes
#	min_age = 16
#	
#	trigger = {
#		always = no # replaced by new mongol arrival event
#		year = 1215
#		
#		controls_religion = yes # Let it happen for the Pope - he's always around
#		
#		NOT = { has_global_flag = mongol_horde_rumors }
#		NOT = { has_global_flag = il_khanate_arrival }
#		NOT = { has_global_flag = golden_horde_arrival }
#	}
#	
#	mean_time_to_happen = {
#		months = 1
#	}
#	
#	immediate = {
#		set_global_flag = mongol_horde_rumors
#		activate_title = { title = e_il-khanate status = yes }
#		create_random_soldier = {
#			random_traits = no
#			dynasty = 101916 # Toluid
#			name = "Hulegu"
#			culture = mongol
#			religion = tengri_pagan
#			age = 30
#			attributes = {
#				martial = 8
#				diplomacy = 4
#				stewardship = 5
#				intrigue = 4
#				learning = 3
#			}
#			health = 6
#			fertility = 0.7
#			trait = brilliant_strategist
#			trait = wroth
#			trait = cruel
#			trait = proud
#			trait = zealous
#		}
#		new_character = {
#			e_il-khanate = {
#				grant_title = PREV
#			}
#			set_defacto_liege = THIS
#		}
#		any_playable_ruler = {
#			limit = { ai = no }
#			chronicle = {
#				entry = CHRONICLE_MONGOL_RUMORS
#				portrait = [New.GetID]
#			}
#		}
#		
#		activate_title = { title = e_golden_horde status = yes }
#		create_random_soldier = {
#			random_traits = no
#			dynasty = 7379 # Jochid
#			name = "Batu"
#			culture = mongol
#			religion = tengri_pagan
#			age = 33
#			attributes = {
#				martial = 9
#				diplomacy = 5
#				stewardship = 8
#				intrigue = 7
#				learning = 3
#			}
#			health = 6
#			fertility = 0.7
#			trait = brilliant_strategist
#			trait = diligent
#			trait = humble
#			trait = gregarious
#			trait = just
#		}
#		new_character = {
#			e_golden_horde = {
#				grant_title = PREV
#			}
#			set_defacto_liege = THIS
#		}
#	}
#	
#	option = {
#		name = "EVTOPTA60000"
#	}
#}
#
## Arrival of the Ilkhanate
#narrative_event = {
#	id = 60001
#	title = "EVTNAME60001"
#	desc = "EVTDESC60001"
#	major = yes
#	hide_new = yes
#	
#	picture = "GFX_evt_mongols"
#	border = "GFX_event_narrative_frame_war"
#	
#	only_playable = yes
#	
#	trigger = {
#		always = no # replaced by new mongol arrival event
#		year = 1216
#		has_landed_title = e_il-khanate
#		NOT = { year = 1224 }
#		NOT = { has_global_flag = il_khanate_arrival }
#	}
#	
#	mean_time_to_happen = {
#		months = 24
#	}
#	
#	option = {
#		name = "OK"
#		trigger = {
#			has_landed_title = e_il-khanate
#		}
#		set_global_flag = il_khanate_arrival
#		1423 = { # Fergana
#			kingdom = {
#				ROOT = {
#					war = {
#						casus_belli = tribal_invasion
#						target = PREVPREV # The top liege of the owner
#						thirdparty_title = PREV # The de jure kingdom
#					}
#				}
#			}
#		}
#		wealth = 5000
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = no
#			age = 30
#			attributes = {
#				martial = 12
#			}
#			trait = brilliant_strategist
#		}
#		new_character = {
#			spawn_unit = {
#				province = 1423 # Fergana
#				troops =
#				{
#					horse_archers = { 2700 2700 }
#					light_cavalry = { 1600 1600 }
#					light_infantry = { 541 541 }
#					heavy_infantry = { 210 210 }
#					knights = { 47 47 }
#				}
#			}
#		}
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = no
#			age = 35
#			attributes = {
#				martial = 12
#			}
#			trait = brilliant_strategist
#		}
#		new_character = {
#			spawn_unit = {
#				province = 1423 # Fergana
#				troops =
#				{
#					horse_archers = { 2700 2700 }
#					light_cavalry = { 1600 1600 }
#					light_infantry = { 541 541 }
#					heavy_infantry = { 210 210 }
#					knights = { 47 47 }
#				}
#			}
#		}
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = no
#			age = 39
#			attributes = {
#				martial = 12
#			}
#			trait = brilliant_strategist
#		}
#		new_character = {
#			spawn_unit = {
#				province = 1423 # Fergana
#				troops =
#				{
#					horse_archers = { 2700 2700 }
#					light_cavalry = { 1600 1600 }
#					light_infantry = { 541 541 }
#					heavy_infantry = { 210 210 }
#					knights = { 47 47 }
#				}
#			}
#		}
#		
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = no
#			age = 30
#			attributes = {
#				martial = 12
#			}
#			trait = brilliant_strategist
#		}
#		new_character = {
#			spawn_unit = {
#				province = 1423 # Fergana
#				troops =
#				{
#					horse_archers = { 2700 2700 }
#					light_cavalry = { 1600 1600 }
#					light_infantry = { 541 541 }
#					heavy_infantry = { 210 210 }
#					knights = { 47 47 }
#				}
#			}
#		}
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = no
#			age = 35
#			attributes = {
#				martial = 12
#			}
#			trait = brilliant_strategist
#		}
#		new_character = {
#			spawn_unit = {
#				province = 1423 # Fergana
#				troops =
#				{
#					horse_archers = { 2700 2700 }
#					light_cavalry = { 1600 1600 }
#					light_infantry = { 541 541 }
#					heavy_infantry = { 210 210 }
#					knights = { 47 47 }
#				}
#			}
#		}
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = no
#			age = 39
#			attributes = {
#				martial = 12
#			}
#			trait = brilliant_strategist
#		}
#		new_character = {
#			spawn_unit = {
#				province = 1423 # Fergana
#				troops =
#				{
#					horse_archers = { 2700 2700 }
#					light_cavalry = { 1600 1600 }
#					light_infantry = { 541 541 }
#					heavy_infantry = { 210 210 }
#					knights = { 47 47 }
#				}
#			}
#		}
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = no
#			age = 30
#			attributes = {
#				martial = 12
#			}
#			trait = brilliant_strategist
#		}
#		new_character = {
#			spawn_unit = {
#				province = 1423 # Fergana
#				troops =
#				{
#					horse_archers = { 2700 2700 }
#					light_cavalry = { 1600 1600 }
#					light_infantry = { 541 541 }
#					heavy_infantry = { 210 210 }
#					knights = { 47 47 }
#				}
#			}
#		}
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = no
#			age = 35
#			attributes = {
#				martial = 12
#			}
#			trait = brilliant_strategist
#		}
#		new_character = {
#			spawn_unit = {
#				province = 1423 # Fergana
#				troops =
#				{
#					horse_archers = { 2700 2700 }
#					light_cavalry = { 1600 1600 }
#					light_infantry = { 541 541 }
#					heavy_infantry = { 210 210 }
#					knights = { 47 47 }
#				}
#			}
#		}
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = no
#			age = 39
#			attributes = {
#				martial = 12
#			}
#			trait = brilliant_strategist
#		}
#		new_character = {
#			spawn_unit = {
#				province = 1423 # Fergana
#				troops =
#				{
#					horse_archers = { 2700 2700 }
#					light_cavalry = { 1600 1600 }
#					light_infantry = { 541 541 }
#					heavy_infantry = { 210 210 }
#					knights = { 47 47 }
#				}
#			}
#		}
#		
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = no
#			age = 30
#			attributes = {
#				martial = 12
#			}
#			trait = brilliant_strategist
#		}
#		new_character = {
#			spawn_unit = {
#				province = 1181 # Oshrusana
#				troops =
#				{
#					horse_archers = { 2700 2700 }
#					light_cavalry = { 1600 1600 }
#					light_infantry = { 541 541 }
#					heavy_infantry = { 210 210 }
#					knights = { 47 47 }
#				}
#			}
#		}
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = no
#			age = 35
#			attributes = {
#				martial = 12
#			}
#			trait = brilliant_strategist
#		}
#		new_character = {
#			spawn_unit = {
#				province = 1181 # Oshrusana
#				troops =
#				{
#					horse_archers = { 2700 2700 }
#					light_cavalry = { 1600 1600 }
#					light_infantry = { 541 541 }
#					heavy_infantry = { 210 210 }
#					knights = { 47 47 }
#				}
#			}
#		}
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = no
#			age = 39
#			attributes = {
#				martial = 12
#			}
#			trait = brilliant_strategist
#		}
#		new_character = {
#			spawn_unit = {
#				province = 1181 # Oshrusana
#				troops =
#				{
#					horse_archers = { 2700 2700 }
#					light_cavalry = { 1600 1600 }
#					light_infantry = { 541 541 }
#					heavy_infantry = { 210 210 }
#					knights = { 47 47 }
#				}
#			}
#		}
#		
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = no
#			age = 30
#			attributes = {
#				martial = 12
#			}
#			trait = brilliant_strategist
#		}
#		new_character = {
#			spawn_unit = {
#				province = 1181 # Oshrusana
#				troops =
#				{
#					horse_archers = { 2700 2700 }
#					light_cavalry = { 1600 1600 }
#					light_infantry = { 541 541 }
#					heavy_infantry = { 210 210 }
#					knights = { 47 47 }
#				}
#			}
#		}
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = no
#			age = 35
#			attributes = {
#				martial = 12
#			}
#			trait = brilliant_strategist
#		}
#		new_character = {
#			spawn_unit = {
#				province = 1181 # Oshrusana
#				troops =
#				{
#					horse_archers = { 2700 2700 }
#					light_cavalry = { 1600 1600 }
#					light_infantry = { 541 541 }
#					heavy_infantry = { 210 210 }
#					knights = { 47 47 }
#				}
#			}
#		}
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = no
#			age = 39
#			attributes = {
#				martial = 12
#			}
#			trait = brilliant_strategist
#		}
#		new_character = {
#			spawn_unit = {
#				province = 1181 # Oshrusana
#				troops =
#				{
#					horse_archers = { 2700 2700 }
#					light_cavalry = { 1600 1600 }
#					light_infantry = { 541 541 }
#					heavy_infantry = { 210 210 }
#					knights = { 47 47 }
#				}
#			}
#		}
#		
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = no
#			age = 30
#			attributes = {
#				martial = 12
#			}
#			trait = brilliant_strategist
#		}
#		new_character = {
#			spawn_unit = {
#				province = 1181 # Oshrusana
#				troops =
#				{
#					horse_archers = { 2700 2700 }
#					light_cavalry = { 1600 1600 }
#					light_infantry = { 541 541 }
#					heavy_infantry = { 210 210 }
#					knights = { 47 47 }
#				}
#			}
#		}
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = no
#			age = 35
#			attributes = {
#				martial = 12
#			}
#			trait = brilliant_strategist
#		}
#		new_character = {
#			spawn_unit = {
#				province = 1181 # Oshrusana
#				troops =
#				{
#					horse_archers = { 2700 2700 }
#					light_cavalry = { 1600 1600 }
#					light_infantry = { 541 541 }
#					heavy_infantry = { 210 210 }
#					knights = { 47 47 }
#				}
#			}
#		}
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = no
#			age = 39
#			attributes = {
#				martial = 12
#			}
#			trait = brilliant_strategist
#		}
#		new_character = {
#			spawn_unit = {
#				province = 1181 # Oshrusana
#				troops =
#				{
#					horse_archers = { 2700 2700 }
#					light_cavalry = { 1600 1600 }
#					light_infantry = { 541 541 }
#					heavy_infantry = { 210 210 }
#					knights = { 47 47 }
#				}
#			}
#		}
#		
#		random = {
#			chance = 50
#			
#			create_character = {
#				random_traits = yes
#				dynasty = random
#				religion = tengri_pagan
#				culture = ROOT
#				female = no
#				age = 30
#				attributes = {
#					martial = 12
#				}
#				trait = brilliant_strategist
#			}
#			new_character = {
#				spawn_unit = {
#					province = 903 # Samarkand
#					troops =
#					{
#						horse_archers = { 2700 2700 }
#						light_cavalry = { 1600 1600 }
#						light_infantry = { 541 541 }
#						heavy_infantry = { 210 210 }
#						knights = { 47 47 }
#					}
#				}
#			}
#			create_character = {
#				random_traits = yes
#				dynasty = random
#				religion = tengri_pagan
#				culture = ROOT
#				female = no
#				age = 35
#				attributes = {
#					martial = 12
#				}
#				trait = brilliant_strategist
#			}
#			new_character = {
#				spawn_unit = {
#					province = 903 # Samarkand
#					troops =
#					{
#						horse_archers = { 2700 2700 }
#						light_cavalry = { 1600 1600 }
#						light_infantry = { 541 541 }
#						heavy_infantry = { 210 210 }
#						knights = { 47 47 }
#					}
#				}
#			}
#			create_character = {
#				random_traits = yes
#				dynasty = random
#				religion = tengri_pagan
#				culture = ROOT
#				female = no
#				age = 39
#				attributes = {
#					martial = 12
#				}
#				trait = brilliant_strategist
#			}
#			new_character = {
#				spawn_unit = {
#					province = 903 # Samarkand
#					troops =
#					{
#						horse_archers = { 2700 2700 }
#						light_cavalry = { 1600 1600 }
#						light_infantry = { 541 541 }
#						heavy_infantry = { 210 210 }
#						knights = { 47 47 }
#					}
#				}
#			}
#		}
#		random = {
#			chance = 50
#			create_character = {
#				random_traits = yes
#				dynasty = random
#				religion = tengri_pagan
#				culture = ROOT
#				female = no
#				age = 30
#				attributes = {
#					martial = 12
#				}
#				trait = brilliant_strategist
#			}
#			new_character = {
#				spawn_unit = {
#					province = 903 # Samarkand
#					troops =
#					{
#						horse_archers = { 2700 2700 }
#						light_cavalry = { 1600 1600 }
#						light_infantry = { 541 541 }
#						heavy_infantry = { 210 210 }
#						knights = { 47 47 }
#					}
#				}
#			}
#			create_character = {
#				random_traits = yes
#				dynasty = random
#				religion = tengri_pagan
#				culture = ROOT
#				female = no
#				age = 35
#				attributes = {
#					martial = 12
#				}
#				trait = brilliant_strategist
#			}
#			new_character = {
#				spawn_unit = {
#					province = 903 # Samarkand
#					troops =
#					{
#						horse_archers = { 2700 2700 }
#						light_cavalry = { 1600 1600 }
#						light_infantry = { 541 541 }
#						heavy_infantry = { 210 210 }
#						knights = { 47 47 }
#					}
#				}
#			}
#			create_character = {
#				random_traits = yes
#				dynasty = random
#				religion = tengri_pagan
#				culture = ROOT
#				female = no
#				age = 39
#				attributes = {
#					martial = 12
#				}
#				trait = brilliant_strategist
#			}
#			new_character = {
#				spawn_unit = {
#					province = 903 # Samarkand
#					troops =
#					{
#						horse_archers = { 2700 2700 }
#						light_cavalry = { 1600 1600 }
#						light_infantry = { 541 541 }
#						heavy_infantry = { 210 210 }
#						knights = { 47 47 }
#					}
#				}
#			}
#		}
#		
#		# Some extra courtiers
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = no
#			age = 16
#		}
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = no
#			age = 18
#		}
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = no
#			age = 18
#		}
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = no
#			age = 20
#		}
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = no
#			age = 25
#		}
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = no
#			age = 26
#		}
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = no
#			age = 28
#		}
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = yes
#			age = 16
#		}
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = yes
#			age = 17
#		}
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = yes
#			age = 18
#		}
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = yes
#			age = 18
#		}
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = yes
#			age = 20
#		}
#	}
#	option = {
#		name = "EVTOPTB60001"
#		trigger = {
#			religion_group = muslim
#			NOT = { has_landed_title = e_il-khanate }
#		}
#	}
#	option = {
#		name = "EVTOPTC60001"
#		trigger = {
#			religion_group = christian
#			NOT = { has_landed_title = e_il-khanate }
#		}
#	}
#	option = {
#		name = "EVTOPTD60001"
#		trigger = {
#			NOT = { religion_group = christian }
#			NOT = { religion_group = muslim }
#			NOT = { has_landed_title = e_il-khanate }
#		}
#	}
#}
#
#
## Arrival of the Golden Horde
#narrative_event = {
#	id = 60002
#	title = "EVTNAME60002"
#	desc = "EVTDESC60002"
#	major = yes
#	hide_new = yes
#	
#	picture = "GFX_evt_mongols"
#	border = "GFX_event_narrative_frame_war"
#	
#	only_playable = yes
#	
#	trigger = {
#		always = no # replaced by new mongol arrival event
#		year = 1224
#		NOT = { year = 1250 }
#		has_landed_title = e_golden_horde
#		has_global_flag = il_khanate_arrival
#		NOT = { has_global_flag = golden_horde_arrival }
#	}
#	
#	mean_time_to_happen = {
#		months = 120
#		modifier = {
#			factor = 0.5
#			year = 1235
#		}
#		modifier = {
#			factor = 0.5
#			year = 1240
#		}
#	}
#	
#	option = {
#		name = "OK"
#		trigger = {
#			has_landed_title = e_golden_horde
#		}
#		set_global_flag = golden_horde_arrival
#		if = {
#			limit = {
#				1425 = {
#					owner = {
#						realm = {
#							NOT = { title = e_il-khanate }
#						}
#					}
#				}
#			}
#			1425 = { # Ili
#				kingdom = {
#					ROOT = {
#						war = {
#							casus_belli = tribal_invasion
#							target = PREVPREV # The top liege of the owner of the province
#							thirdparty_title = PREV # The de jure kingdom
#						}
#					}
#				}
#			}
#		}
#		if = {
#			limit = {
#				war = no
#				1427 = {
#					owner = {
#						realm = {
#							NOT = { title = e_il-khanate }
#						}
#					}
#				}
#			}
#			1427 = { # Urzhar
#				kingdom = {
#					ROOT = {
#						war = {
#							casus_belli = tribal_invasion
#							target = PREVPREV # The top liege of the owner of the province
#							thirdparty_title = PREV # The de jure kingdom
#						}
#					}
#				}
#			}
#		}
#		if = {
#			limit = {
#				war = no
#				1132 = {
#					owner = {
#						realm = {
#							NOT = { title = e_il-khanate }
#						}
#					}
#				}
#			}
#			1132 = { # Kirghiz
#				kingdom = {
#					ROOT = {
#						war = {
#							casus_belli = tribal_invasion
#							target = PREVPREV # The top liege of the owner of the province
#							thirdparty_title = PREV # The de jure kingdom
#						}
#					}
#				}
#			}
#		}
#		if = {
#			limit = {
#				war = no
#				1329 = {
#					owner = {
#						realm = {
#							NOT = { title = e_il-khanate }
#						}
#					}
#				}
#			}
#			1329 = { # Ket
#				kingdom = {
#					ROOT = {
#						war = {
#							casus_belli = tribal_invasion
#							target = PREVPREV # The top liege of the owner of the province
#							thirdparty_title = PREV # The de jure kingdom
#						}
#					}
#				}
#			}
#		}
#		if = {
#			limit = {
#				war = no
#				1205 = {
#					owner = {
#						realm = {
#							NOT = { title = e_il-khanate }
#						}
#					}
#				}
#			}
#			1205 = { # Narim
#				kingdom = {
#					ROOT = {
#						war = {
#							casus_belli = tribal_invasion
#							target = PREVPREV # The top liege of the owner of the province
#							thirdparty_title = PREV # The de jure kingdom
#						}
#					}
#				}
#			}
#		}
#		if = {
#			limit = {
#				war = no
#				1306 = {
#					owner = {
#						realm = {
#							NOT = { title = e_il-khanate }
#						}
#					}
#				}
#			}
#			1306 = { # Tura
#				kingdom = {
#					ROOT = {
#						war = {
#							casus_belli = tribal_invasion
#							target = PREVPREV # The top liege of the owner of the province
#							thirdparty_title = PREV # The de jure kingdom
#						}
#					}
#				}
#			}
#		}
#		if = {
#			limit = {
#				war = no
#			}
#			1425 = { # Ili - Ok, we have no choice. DoW on the Il-Khanate.
#				kingdom = {
#					ROOT = {
#						war = {
#							casus_belli = tribal_invasion
#							target = PREVPREV # The top liege of the owner of the province
#							thirdparty_title = PREV # The de jure kingdom
#						}
#					}
#				}
#			}
#		}
#		
#		wealth = 5000
#		
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = no
#			age = 30
#			attributes = {
#				martial = 12
#			}
#			trait = brilliant_strategist
#		}
#		new_character = {
#			spawn_unit = {
#				province = 1425 # Ili
#				troops =
#				{
#					horse_archers = { 2700 2700 }
#					light_cavalry = { 1600 1600 }
#					light_infantry = { 541 541 }
#					heavy_infantry = { 210 210 }
#					knights = { 47 47 }
#				}
#			}
#		}
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = no
#			age = 35
#			attributes = {
#				martial = 12
#			}
#			trait = brilliant_strategist
#		}
#		new_character = {
#			spawn_unit = {
#				province = 1425 # Ili
#				troops =
#				{
#					horse_archers = { 2700 2700 }
#					light_cavalry = { 1600 1600 }
#					light_infantry = { 541 541 }
#					heavy_infantry = { 210 210 }
#					knights = { 47 47 }
#				}
#			}
#		}
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = no
#			age = 39
#			attributes = {
#				martial = 12
#			}
#			trait = brilliant_strategist
#		}
#		new_character = {
#			spawn_unit = {
#				province = 1425 # Ili
#				troops =
#				{
#					horse_archers = { 2700 2700 }
#					light_cavalry = { 1600 1600 }
#					light_infantry = { 541 541 }
#					heavy_infantry = { 210 210 }
#					knights = { 47 47 }
#				}
#			}
#		}
#		
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = no
#			age = 30
#			attributes = {
#				martial = 12
#			}
#			trait = brilliant_strategist
#		}
#		new_character = {
#			spawn_unit = {
#				province = 1425 # Ili
#				troops =
#				{
#					horse_archers = { 2700 2700 }
#					light_cavalry = { 1600 1600 }
#					light_infantry = { 541 541 }
#					heavy_infantry = { 210 210 }
#					knights = { 47 47 }
#				}
#			}
#		}
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = no
#			age = 35
#			attributes = {
#				martial = 12
#			}
#			trait = brilliant_strategist
#		}
#		new_character = {
#			spawn_unit = {
#				province = 1425 # Ili
#				troops =
#				{
#					horse_archers = { 2700 2700 }
#					light_cavalry = { 1600 1600 }
#					light_infantry = { 541 541 }
#					heavy_infantry = { 210 210 }
#					knights = { 47 47 }
#				}
#			}
#		}
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = no
#			age = 39
#			attributes = {
#				martial = 12
#			}
#			trait = brilliant_strategist
#		}
#		new_character = {
#			spawn_unit = {
#				province = 1425 # Ili
#				troops =
#				{
#					horse_archers = { 2700 2700 }
#					light_cavalry = { 1600 1600 }
#					light_infantry = { 541 541 }
#					heavy_infantry = { 210 210 }
#					knights = { 47 47 }
#				}
#			}
#		}
#		
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = no
#			age = 30
#			attributes = {
#				martial = 12
#			}
#			trait = brilliant_strategist
#		}
#		new_character = {
#			spawn_unit = {
#				province = 1425 # Ili
#				troops =
#				{
#					horse_archers = { 2700 2700 }
#					light_cavalry = { 1600 1600 }
#					light_infantry = { 541 541 }
#					heavy_infantry = { 210 210 }
#					knights = { 47 47 }
#				}
#			}
#		}
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = no
#			age = 35
#			attributes = {
#				martial = 12
#			}
#			trait = brilliant_strategist
#		}
#		new_character = {
#			spawn_unit = {
#				province = 1425 # Ili
#				troops =
#				{
#					horse_archers = { 2700 2700 }
#					light_cavalry = { 1600 1600 }
#					light_infantry = { 541 541 }
#					heavy_infantry = { 210 210 }
#					knights = { 47 47 }
#				}
#			}
#		}
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = no
#			age = 39
#			attributes = {
#				martial = 12
#			}
#			trait = brilliant_strategist
#		}
#		new_character = {
#			spawn_unit = {
#				province = 1425 # Ili
#				troops =
#				{
#					horse_archers = { 2700 2700 }
#					light_cavalry = { 1600 1600 }
#					light_infantry = { 541 541 }
#					heavy_infantry = { 210 210 }
#					knights = { 47 47 }
#				}
#			}
#		}
#		
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = no
#			age = 30
#			attributes = {
#				martial = 12
#			}
#			trait = brilliant_strategist
#		}
#		new_character = {
#			spawn_unit = {
#				province = 1427 # Urzhar
#				troops =
#				{
#					horse_archers = { 2700 2700 }
#					light_cavalry = { 1600 1600 }
#					light_infantry = { 541 541 }
#					heavy_infantry = { 210 210 }
#					knights = { 47 47 }
#				}
#			}
#		}
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = no
#			age = 35
#			attributes = {
#				martial = 12
#			}
#			trait = brilliant_strategist
#		}
#		new_character = {
#			spawn_unit = {
#				province = 1427 # Urzhar
#				troops =
#				{
#					horse_archers = { 2700 2700 }
#					light_cavalry = { 1600 1600 }
#					light_infantry = { 541 541 }
#					heavy_infantry = { 210 210 }
#					knights = { 47 47 }
#				}
#			}
#		}
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = no
#			age = 39
#			attributes = {
#				martial = 12
#			}
#			trait = brilliant_strategist
#		}
#		new_character = {
#			spawn_unit = {
#				province = 1427 # Urzhar
#				troops =
#				{
#					horse_archers = { 2700 2700 }
#					light_cavalry = { 1600 1600 }
#					light_infantry = { 541 541 }
#					heavy_infantry = { 210 210 }
#					knights = { 47 47 }
#				}
#			}
#		}
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = no
#			age = 30
#			attributes = {
#				martial = 12
#			}
#			trait = brilliant_strategist
#		}
#		new_character = {
#			spawn_unit = {
#				province = 1427 # Urzhar
#				troops =
#				{
#					horse_archers = { 2700 2700 }
#					light_cavalry = { 1600 1600 }
#					light_infantry = { 541 541 }
#					heavy_infantry = { 210 210 }
#					knights = { 47 47 }
#				}
#			}
#		}
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = no
#			age = 35
#			attributes = {
#				martial = 12
#			}
#			trait = brilliant_strategist
#		}
#		new_character = {
#			spawn_unit = {
#				province = 1427 # Urzhar
#				troops =
#				{
#					horse_archers = { 2700 2700 }
#					light_cavalry = { 1600 1600 }
#					light_infantry = { 541 541 }
#					heavy_infantry = { 210 210 }
#					knights = { 47 47 }
#				}
#			}
#		}
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = no
#			age = 39
#			attributes = {
#				martial = 12
#			}
#			trait = brilliant_strategist
#		}
#		new_character = {
#			spawn_unit = {
#				province = 1427 # Urzhar
#				troops =
#				{
#					horse_archers = { 2700 2700 }
#					light_cavalry = { 1600 1600 }
#					light_infantry = { 541 541 }
#					heavy_infantry = { 210 210 }
#					knights = { 47 47 }
#				}
#			}
#		}
#		random = {
#			chance = 50
#			create_character = {
#				random_traits = yes
#				dynasty = random
#				religion = tengri_pagan
#				culture = ROOT
#				female = no
#				age = 30
#				attributes = {
#					martial = 12
#				}
#				trait = brilliant_strategist
#			}
#			new_character = {
#				spawn_unit = {
#					province = 1132 # Kirghiz
#					troops =
#					{
#						horse_archers = { 2700 2700 }
#						light_cavalry = { 1600 1600 }
#						light_infantry = { 541 541 }
#						heavy_infantry = { 210 210 }
#						knights = { 47 47 }
#					}
#				}
#			}
#			create_character = {
#				random_traits = yes
#				dynasty = random
#				religion = tengri_pagan
#				culture = ROOT
#				female = no
#				age = 35
#				attributes = {
#					martial = 12
#				}
#				trait = brilliant_strategist
#			}
#			new_character = {
#				spawn_unit = {
#					province = 1132 # Kirghiz
#					troops =
#					{
#						horse_archers = { 2700 2700 }
#						light_cavalry = { 1600 1600 }
#						light_infantry = { 541 541 }
#						heavy_infantry = { 210 210 }
#						knights = { 47 47 }
#					}
#				}
#			}
#			create_character = {
#				random_traits = yes
#				dynasty = random
#				religion = tengri_pagan
#				culture = ROOT
#				female = no
#				age = 39
#				attributes = {
#					martial = 12
#				}
#				trait = brilliant_strategist
#			}
#			new_character = {
#				spawn_unit = {
#					province = 1132 # Kirghiz
#					troops =
#					{
#						horse_archers = { 2700 2700 }
#						light_cavalry = { 1600 1600 }
#						light_infantry = { 541 541 }
#						heavy_infantry = { 210 210 }
#						knights = { 47 47 }
#					}
#				}
#			}
#		}
#		random = {
#			chance = 50
#			create_character = {
#				random_traits = yes
#				dynasty = random
#				religion = tengri_pagan
#				culture = ROOT
#				female = no
#				age = 30
#				attributes = {
#					martial = 12
#				}
#				trait = brilliant_strategist
#			}
#			new_character = {
#				spawn_unit = {
#					province = 1132 # Kirghiz
#					troops =
#					{
#						horse_archers = { 2700 2700 }
#						light_cavalry = { 1600 1600 }
#						light_infantry = { 541 541 }
#						heavy_infantry = { 210 210 }
#						knights = { 47 47 }
#					}
#				}
#			}
#			create_character = {
#				random_traits = yes
#				dynasty = random
#				religion = tengri_pagan
#				culture = ROOT
#				female = no
#				age = 35
#				attributes = {
#					martial = 12
#				}
#				trait = brilliant_strategist
#			}
#			new_character = {
#				spawn_unit = {
#					province = 1132 # Kirghiz
#					troops =
#					{
#						horse_archers = { 2700 2700 }
#						light_cavalry = { 1600 1600 }
#						light_infantry = { 541 541 }
#						heavy_infantry = { 210 210 }
#						knights = { 47 47 }
#					}
#				}
#			}
#			create_character = {
#				random_traits = yes
#				dynasty = random
#				religion = tengri_pagan
#				culture = ROOT
#				female = no
#				age = 39
#				attributes = {
#					martial = 12
#				}
#				trait = brilliant_strategist
#			}
#			new_character = {
#				spawn_unit = {
#					province = 1132 # Kirghiz
#					troops =
#					{
#						horse_archers = { 2700 2700 }
#						light_cavalry = { 1600 1600 }
#						light_infantry = { 541 541 }
#						heavy_infantry = { 210 210 }
#						knights = { 47 47 }
#					}
#				}
#			}
#		}
#		
#		# Some extra courtiers
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = no
#			age = 16
#		}
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = no
#			age = 18
#		}
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = no
#			age = 18
#		}
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = no
#			age = 20
#		}
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = no
#			age = 25
#		}
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = no
#			age = 26
#		}
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = no
#			age = 28
#		}
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = yes
#			age = 16
#		}
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = yes
#			age = 17
#		}
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = yes
#			age = 18
#		}
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = yes
#			age = 18
#		}
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = yes
#			age = 20
#		}
#	}
#	option = {
#		name = "EVTOPTB60002"
#		trigger = {
#			religion_group = christian
#			NOT = { has_landed_title = e_golden_horde }
#		}
#	}
#	option = {
#		name = "EVTOPTC60002"
#		trigger = {
#			religion_group = muslim
#			NOT = { has_landed_title = e_golden_horde }
#		}
#	}
#	option = {
#		name = "EVTOPTD60002"
#		trigger = {
#			NOT = { religion_group = christian }
#			NOT = { religion_group = muslim }
#			NOT = { has_landed_title = e_golden_horde }
#		}
#	}
#}
#
## Ilkhanate reinforcements
#character_event = {
#	id = 60004
#	desc = "EVTDESC60004"
#	
#	picture = "GFX_evt_mongols"
#	border = "GFX_event_normal_frame_war"
#	
#	only_playable = yes
#	
#	trigger = {
#		always = no # replaced by new mongol arrival event
#		NOT = { year = 1300 }
#		has_landed_title = e_il-khanate
#		NOT = { has_character_flag = ilkhanate_reinf }
#		had_global_flag = { flag = il_khanate_arrival days = 3650 }
#		e_il-khanate = {
#			holder_scope = {
#				culture = mongol
#				religion = tengri_pagan
#				OR = {
#					war = yes
#					is_landed = yes
#				}
#			}
#		}
#	}
#	
#	mean_time_to_happen = {
#		months = 1
#	}
#	
#	option = {
#		name = "OK"
#		set_character_flag = ilkhanate_reinf
#		
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = no
#			age = 25
#			attributes = {
#				martial = 12
#			}
#			trait = brilliant_strategist
#		}
#		new_character = {
#			spawn_unit = {
#				province = 1423 # Fergana
#				troops =
#				{
#					horse_archers = { 2700 2700 }
#					light_cavalry = { 1600 1600 }
#					light_infantry = { 541 541 }
#					heavy_infantry = { 210 210 }
#					knights = { 47 47 }
#				}
#			}
#		}
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = no
#			age = 26
#			attributes = {
#				martial = 12
#			}
#			trait = brilliant_strategist
#		}
#		new_character = {
#			spawn_unit = {
#				province = 1423 # Fergana
#				troops =
#				{
#					horse_archers = { 2700 2700 }
#					light_cavalry = { 1600 1600 }
#					light_infantry = { 541 541 }
#					heavy_infantry = { 210 210 }
#					knights = { 47 47 }
#				}
#			}
#		}
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = no
#			age = 27
#			attributes = {
#				martial = 12
#			}
#			trait = brilliant_strategist
#		}
#		new_character = {
#			spawn_unit = {
#				province = 1423 # Fergana
#				troops =
#				{
#					horse_archers = { 2700 2700 }
#					light_cavalry = { 1600 1600 }
#					light_infantry = { 541 541 }
#					heavy_infantry = { 210 210 }
#					knights = { 47 47 }
#				}
#			}
#		}
#		
#		random = {
#			chance = 50
#			create_character = {
#				random_traits = yes
#				dynasty = random
#				religion = tengri_pagan
#				culture = ROOT
#				female = no
#				age = 25
#				attributes = {
#					martial = 12
#				}
#				trait = brilliant_strategist
#			}
#			new_character = {
#				spawn_unit = {
#					province = 1423 # Fergana
#					troops =
#					{
#						horse_archers = { 2700 2700 }
#						light_cavalry = { 1600 1600 }
#						light_infantry = { 541 541 }
#						heavy_infantry = { 210 210 }
#						knights = { 47 47 }
#					}
#				}
#			}
#			create_character = {
#				random_traits = yes
#				dynasty = random
#				religion = tengri_pagan
#				culture = ROOT
#				female = no
#				age = 26
#				attributes = {
#					martial = 12
#				}
#				trait = brilliant_strategist
#			}
#			new_character = {
#				spawn_unit = {
#					province = 1423 # Fergana
#					troops =
#					{
#						horse_archers = { 2700 2700 }
#						light_cavalry = { 1600 1600 }
#						light_infantry = { 541 541 }
#						heavy_infantry = { 210 210 }
#						knights = { 47 47 }
#					}
#				}
#			}
#			create_character = {
#				random_traits = yes
#				dynasty = random
#				religion = tengri_pagan
#				culture = ROOT
#				female = no
#				age = 27
#				attributes = {
#					martial = 12
#				}
#				trait = brilliant_strategist
#			}
#			new_character = {
#				spawn_unit = {
#					province = 1423 # Fergana
#					troops =
#					{
#						horse_archers = { 2700 2700 }
#						light_cavalry = { 1600 1600 }
#						light_infantry = { 541 541 }
#						heavy_infantry = { 210 210 }
#						knights = { 47 47 }
#					}
#				}
#			}
#		}
#	}
#}
#
## Golden Horde reinforcements
#character_event = {
#	id = 60005
#	desc = "EVTDESC60004"
#	
#	picture = "GFX_evt_mongols"
#	border = "GFX_event_normal_frame_war"
#	
#	only_playable = yes
#	
#	trigger = {
#		always = no # replaced by new mongol arrival event
#		NOT = { year = 1320 }
#		has_landed_title = e_golden_horde
#		NOT = { has_character_flag = golden_horde_reinf }
#		had_global_flag = { flag = golden_horde_arrival days = 3650 }
#		e_golden_horde = {
#			holder_scope = {
#				culture = mongol
#				religion = tengri_pagan
#				OR = {
#					war = yes
#					is_landed = yes
#				}
#			}
#		}
#	}
#	
#	mean_time_to_happen = {
#		months = 1
#	}
#	
#	option = {
#		name = "OK"
#		set_character_flag = golden_horde_reinf
#		
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = no
#			age = 30
#			attributes = {
#				martial = 12
#			}
#			trait = brilliant_strategist
#		}
#		new_character = {
#			spawn_unit = {
#				province = 1425 # Ili
#				troops =
#				{
#					horse_archers = { 2700 2700 }
#					light_cavalry = { 1600 1600 }
#					light_infantry = { 541 541 }
#					heavy_infantry = { 210 210 }
#					knights = { 47 47 }
#				}
#			}
#		}
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = no
#			age = 32
#			attributes = {
#				martial = 12
#			}
#			trait = brilliant_strategist
#		}
#		new_character = {
#			spawn_unit = {
#				province = 1425 # Ili
#				troops =
#				{
#					horse_archers = { 2700 2700 }
#					light_cavalry = { 1600 1600 }
#					light_infantry = { 541 541 }
#					heavy_infantry = { 210 210 }
#					knights = { 47 47 }
#				}
#			}
#		}
#		create_character = {
#			random_traits = yes
#			dynasty = random
#			religion = tengri_pagan
#			culture = ROOT
#			female = no
#			age = 36
#			attributes = {
#				martial = 12
#			}
#			trait = brilliant_strategist
#		}
#		new_character = {
#			spawn_unit = {
#				province = 1425 # Ili
#				troops =
#				{
#					horse_archers = { 2700 2700 }
#					light_cavalry = { 1600 1600 }
#					light_infantry = { 541 541 }
#					heavy_infantry = { 210 210 }
#					knights = { 47 47 }
#				}
#			}
#		}
#	}
#}

### The Hordes Convert ###

# Ilkhanate converts to Catholic
character_event = {
	id = 60010
	title = "EVTNAME60010"
	desc = "EVTDESC60010"
	picture = "GFX_evt_mongols"
	border = "GFX_event_normal_frame_war"
	major = yes
	
	only_playable = yes
	only_independent = yes
	only_capable = yes
	min_age = 16
	prisoner = no 
	
	trigger = {
		primary_title = {
			title = e_il-khanate
			holder_scope = {
				religion = tengri_pagan
				NOT = { trait = zealous }
			}
		}
		had_global_flag = { flag = il_khanate_arrival days = 14600 }
		NOT = { had_global_flag = { flag = il_khanate_arrival days = 29200 } }
		NOT = { has_global_flag = il_khanate_converts }
		any_realm_province = {
			religion = catholic
		}
	}

	mean_time_to_happen = {
		months = 1440
		modifier = {
			factor = 0.75
			any_demesne_province = {
				is_capital = yes
				religion = catholic
			}
		}
	}
	
	immediate = {
		set_global_flag = il_khanate_converts
	}
	
	option = {	# Catholic
		name = "EVTOPTA60010"
		trigger = {
			has_landed_title = e_il-khanate
		}
		religion = catholic
		capital_scope = {
			religion = catholic
		}
		
		any_realm_character = {
			limit = { religion = tengri_pagan }
			religion = catholic
			if = {
				limit = {
					is_playable = yes
					capital_scope = {
						religion = tengri_pagan
					}
				}
				capital_scope = {
					religion = catholic
				}
			}
		}
	}
	# Other rulers are informed
	option = {
		name = "EVTOPTB60010"
		trigger = {
			religion_group = muslim
			NOT = { has_landed_title = e_il-khanate }
		}
	}
	option = {
		name = "EXCELLENT"
		trigger = {
			religion_group = christian
			NOT = { has_landed_title = e_il-khanate }
		}
	}
	option = {
		name = "EVTOPTD60010"
		trigger = {
			NOT = { religion_group = christian }
			NOT = { religion_group = muslim }
			NOT = { has_landed_title = e_il-khanate }
		}
	}
}

# Ilkhanate converts to Orthodox
character_event = {
	id = 60011
	title = "EVTNAME60010"
	desc = "EVTDESC60011"
	picture = "GFX_evt_mongols"
	border = "GFX_event_normal_frame_religion"
	major = yes
	
	only_playable = yes
	only_independent = yes
	only_capable = yes
	min_age = 16
	prisoner = no 
	
	trigger = {
		primary_title = {
			title = e_il-khanate
			holder_scope = {
				religion = tengri_pagan
				NOT = { trait = zealous }
			}
		}
		had_global_flag = { flag = il_khanate_arrival days = 14600 }
		NOT = { had_global_flag = { flag = il_khanate_arrival days = 29200 } }
		NOT = { has_global_flag = il_khanate_converts }
		any_realm_province = {
			religion = orthodox
		}
	}

	mean_time_to_happen = {
		months = 960
		modifier = {
			factor = 0.75
			any_demesne_province = {
				is_capital = yes
				religion = orthodox
			}
		}
	}
	
	immediate = {
		set_global_flag = il_khanate_converts
	}
	
	option = {	# Orthodox
		name = "EVTOPTA60010"
		trigger = {
			has_landed_title = e_il-khanate
		}
		religion = orthodox
		any_realm_character = {
			limit = { religion = tengri_pagan }
			religion = orthodox
			if = {
				limit = {
					is_playable = yes
					capital_scope = {
						religion = tengri_pagan
					}
				}
				capital_scope = {
					religion = orthodox
				}
			}
		}
	}
	# Other rulers are informed
	option = {
		name = "EVTOPTB60010"
		trigger = {
			religion_group = muslim
			NOT = { has_landed_title = e_il-khanate }
		}
	}
	option = {
		name = "EXCELLENT"
		trigger = {
			religion_group = christian
			NOT = { has_landed_title = e_il-khanate }
		}
	}
	option = {
		name = "EVTOPTD60010"
		trigger = {
			NOT = { religion_group = christian }
			NOT = { religion_group = muslim }
			NOT = { has_landed_title = e_il-khanate }
		}
	}
}

# Ilkhanate converts to Sunni
character_event = {
	id = 60012
	title = "EVTNAME60010"
	desc = "EVTDESC60012"
	picture = "GFX_evt_mongols"
	border = "GFX_event_normal_frame_religion"
	major = yes
	
	only_playable = yes
	only_independent = yes
	only_capable = yes
	min_age = 16
	prisoner = no
	
	trigger = {
		primary_title = {
			title = e_il-khanate
			holder_scope = {
				religion = tengri_pagan
				NOT = { trait = zealous }
			}
		}
		had_global_flag = { flag = il_khanate_arrival days = 14600 }
		NOT = { had_global_flag = { flag = il_khanate_arrival days = 29200 } }
		NOT = { has_global_flag = il_khanate_converts }
		any_realm_province = {
			religion = sunni
		}
	}

	mean_time_to_happen = {
		months = 420
		modifier = {
			factor = 0.75
			any_demesne_province = {
				is_capital = yes
				religion = sunni
			}
		}
	}
	
	immediate = {
		set_global_flag = il_khanate_converts
	}
	
	option = {	# Sunni
		name = "EVTOPTA60010"
		trigger = {
			has_landed_title = e_il-khanate
		}
		religion = sunni
		any_realm_character = {
			limit = { religion = tengri_pagan }
			religion = sunni
			if = {
				limit = {
					is_playable = yes
					capital_scope = {
						religion = tengri_pagan
					}
				}
				capital_scope = {
					religion = sunni
				}
			}
		}
	}
	# Other rulers are informed
	option = {
		name = "EXCELLENT"
		trigger = {
			religion_group = muslim
			NOT = { has_landed_title = e_il-khanate }
		}
	}
	option = {
		name = "EVTOPTC60010"
		trigger = {
			religion_group = christian
			NOT = { has_landed_title = e_il-khanate }
		}
	}
	option = {
		name = "EVTOPTD60010"
		trigger = {
			NOT = { religion_group = christian }
			NOT = { religion_group = muslim }
			NOT = { has_landed_title = e_il-khanate }
		}
	}
}

# Ilkhanate converts to Shiite
character_event = {
	id = 60013
	title = "EVTNAME60010"
	desc = "EVTDESC60013"
	picture = "GFX_evt_mongols"
	border = "GFX_event_normal_frame_religion"
	
	major = yes
	
	only_playable = yes
	only_independent = yes
	only_capable = yes
	min_age = 16
	prisoner = no
	
	trigger = {
		primary_title = {
			title = e_il-khanate
			holder_scope = {
				religion = tengri_pagan
				NOT = { trait = zealous }
			}
		}
		had_global_flag = { flag = il_khanate_arrival days = 14600 }
		NOT = { had_global_flag = { flag = il_khanate_arrival days = 29200 } }
		NOT = { has_global_flag = il_khanate_converts }
		any_realm_province = {
			religion = shiite
		}
	}

	mean_time_to_happen = {
		months = 420
		modifier = {
			factor = 0.75
			any_demesne_province = {
				is_capital = yes
				religion = shiite
			}
		}
	}
	
	immediate = {
		set_global_flag = il_khanate_converts
	}
	
	option = {	# Shiite
		name = "EVTOPTA60010"
		trigger = {
			has_landed_title = e_il-khanate
		}
		religion = shiite
		any_realm_character = {
			limit = { religion = tengri_pagan }
			religion = shiite
			if = {
				limit = {
					is_playable = yes
					capital_scope = {
						religion = tengri_pagan
					}
				}
				capital_scope = {
					religion = shiite
				}
			}
		}
	}
	# Other rulers are informed
	option = {
		name = "EXCELLENT"
		trigger = {
			religion_group = muslim
			NOT = { has_landed_title = e_il-khanate }
		}
	}
	option = {
		name = "EVTOPTC60010"
		trigger = {
			religion_group = christian
			NOT = { has_landed_title = e_il-khanate }
		}
	}
	option = {
		name = "EVTOPTD60010"
		trigger = {
			NOT = { religion_group = christian }
			NOT = { religion_group = muslim }
			NOT = { has_landed_title = e_il-khanate }
		}
	}
}

# Ilkhanate converts to Nestorian
character_event = {
	id = 60014
	title = "EVTNAME60010"
	desc = "EVTDESC60014"
	picture = "GFX_evt_mongols"
	border = "GFX_event_normal_frame_war"
	major = yes
	
	only_playable = yes
	only_independent = yes
	only_capable = yes
	min_age = 16
	prisoner = no
	
	trigger = {
		primary_title = {
			title = e_il-khanate
			holder_scope = {
				religion = tengri_pagan
				NOT = { trait = zealous }
			}
		}
		had_global_flag = { flag = il_khanate_arrival days = 14600 }
		NOT = { had_global_flag = { flag = il_khanate_arrival days = 29200 } }
		NOT = { has_global_flag = il_khanate_converts }
	}

	mean_time_to_happen = {
		months = 420
		modifier = {
			factor = 0.75
			any_demesne_province = {
				is_capital = yes
				religion = nestorian
			}
		}
	}
	
	immediate = {
		set_global_flag = il_khanate_converts
	}
	
	option = {	# Nestorian
		name = "EVTOPTA60010"
		trigger = {
			has_landed_title = e_il-khanate
		}
		religion = nestorian
		capital_scope = {
			religion = nestorian
		}
		any_realm_character = {
			limit = { religion = tengri_pagan }
			religion = nestorian
			if = {
				limit = {
					is_playable = yes
					capital_scope = {
						religion = tengri_pagan
					}
				}
				capital_scope = {
					religion = nestorian
				}
			}
		}
	}
	# Other rulers are informed
	option = {
		name = "EVTOPTB60010"
		trigger = {
			religion_group = muslim
			NOT = { has_landed_title = e_il-khanate }
		}
	}
	option = {
		name = "EXCELLENT"
		trigger = {
			religion_group = christian
			NOT = { has_landed_title = e_il-khanate }
		}
	}
	option = {
		name = "EVTOPTD60010"
		trigger = {
			NOT = { religion_group = christian }
			NOT = { religion_group = muslim }
			NOT = { has_landed_title = e_il-khanate }
		}
	}
}

# Golden Horde converts to Catholic
character_event = {
	id = 60020
	title = "EVTNAME60020"
	desc = "EVTDESC60010"
	picture = "GFX_evt_mongols"
	border = "GFX_event_normal_frame_religion"
	
	major = yes
	
	only_playable = yes
	only_independent = yes
	only_capable = yes
	min_age = 16
	prisoner = no
	
	trigger = {
		primary_title = {
			title = e_golden_horde
			holder_scope = {
				religion = tengri_pagan
				NOT = { trait = zealous }
			}
		}
		had_global_flag = { flag = golden_horde_arrival days = 14600 }
		NOT = { had_global_flag = { flag = il_khanate_arrival days = 29200 } }
		NOT = { has_global_flag = golden_horde_converts }
		any_realm_province = {
			religion = catholic
		}
	}

	mean_time_to_happen = {
		months = 960
		modifier = {
			factor = 0.75
			any_demesne_province = {
				is_capital = yes
				religion = catholic
			}
		}
	}
	
	immediate = {
		set_global_flag = golden_horde_converts
	}
	
	option = {	# Catholic
		name = "EVTOPTA60010"
		trigger = {
			has_landed_title = e_golden_horde
		}
		religion = catholic
		capital_scope = {
			religion = catholic
		}
		any_realm_character = {
			limit = { religion = tengri_pagan }
			religion = catholic
			if = {
				limit = {
					is_playable = yes
					capital_scope = {
						religion = tengri_pagan
					}
				}
				capital_scope = {
					religion = catholic
				}
			}
		}
	}
	# Other rulers are informed
	option = {
		name = "EVTOPTB60010"
		trigger = {
			religion_group = muslim
			NOT = { has_landed_title = e_golden_horde }
		}
	}
	option = {
		name = "EXCELLENT"
		trigger = {
			religion_group = christian
			NOT = { has_landed_title = e_golden_horde }
		}
	}
	option = {
		name = "EVTOPTD60010"
		trigger = {
			NOT = { religion_group = christian }
			NOT = { religion_group = muslim }
			NOT = { has_landed_title = e_golden_horde }
		}
	}
}

# Golden Horde converts to Orthodox
character_event = {
	id = 60021
	title = "EVTNAME60020"
	desc = "EVTDESC60011"
	picture = "GFX_evt_mongols"
	border = "GFX_event_normal_frame_religion"
	
	major = yes
	
	only_playable = yes
	only_independent = yes
	only_capable = yes
	min_age = 16
	prisoner = no
	
	trigger = {
		primary_title = {
			title = e_golden_horde
			holder_scope = {
				religion = tengri_pagan
				NOT = { trait = zealous }
			}
		}
		had_global_flag = { flag = golden_horde_arrival days = 14600 }
		NOT = { had_global_flag = { flag = il_khanate_arrival days = 29200 } }
		NOT = { has_global_flag = golden_horde_converts }
		any_realm_province = {
			religion = orthodox
		}
	}

	mean_time_to_happen = {
		months = 480
		modifier = {
			factor = 0.75
			any_demesne_province = {
				is_capital = yes
				religion = orthodox
			}
		}
	}
	
	immediate = {
		set_global_flag = golden_horde_converts
	}
	
	option = {	# Orthodox
		name = "EVTOPTA60010"
		trigger = {
			has_landed_title = e_golden_horde
		}
		religion = orthodox
		any_realm_character = {
			limit = { religion = tengri_pagan }
			religion = orthodox
			if = {
				limit = {
					is_playable = yes
					capital_scope = {
						religion = tengri_pagan
					}
				}
				capital_scope = {
					religion = orthodox
				}
			}
		}
	}
	# Other rulers are informed
	option = {
		name = "EVTOPTB60010"
		trigger = {
			religion_group = muslim
			NOT = { has_landed_title = e_golden_horde }
		}
	}
	option = {
		name = "EXCELLENT"
		trigger = {
			religion_group = christian
			NOT = { has_landed_title = e_golden_horde }
		}
	}
	option = {
		name = "EVTOPTD60010"
		trigger = {
			NOT = { religion_group = christian }
			NOT = { religion_group = muslim }
			NOT = { has_landed_title = e_golden_horde }
		}
	}
}

# Golden Horde converts to Sunni
character_event = {
	id = 60022
	title = "EVTNAME60020"
	desc = "EVTDESC60012"
	picture = "GFX_evt_mongols"
	border = "GFX_event_normal_frame_religion"
	
	major = yes
	
	only_playable = yes
	only_independent = yes
	only_capable = yes
	min_age = 16
	prisoner = no
	
	trigger = {
		primary_title = {
			title = e_golden_horde
			holder_scope = {
				religion = tengri_pagan
				NOT = { trait = zealous }
			}
		}
		had_global_flag = { flag = golden_horde_arrival days = 14600 }
		NOT = { had_global_flag = { flag = il_khanate_arrival days = 29200 } }
		NOT = { has_global_flag = golden_horde_converts }
		any_realm_province = {
			religion = sunni
		}
	}

	mean_time_to_happen = {
		months = 420
		modifier = {
			factor = 0.75
			any_demesne_province = {
				is_capital = yes
				religion = sunni
			}
		}
	}
	
	immediate = {
		set_global_flag = golden_horde_converts
	}
	
	option = {	# Sunni
		name = "EVTOPTA60010"
		trigger = {
			has_landed_title = e_golden_horde
		}
		religion = sunni
		any_realm_character = {
			limit = { religion = tengri_pagan }
			religion = sunni
			if = {
				limit = {
					is_playable = yes
					capital_scope = {
						religion = tengri_pagan
					}
				}
				capital_scope = {
					religion = sunni
				}
			}
		}
	}
	# Other rulers are informed
	option = {
		name = "EXCELLENT"
		trigger = {
			religion_group = muslim
			NOT = { has_landed_title = e_golden_horde }
		}
	}
	option = {
		name = "EVTOPTC60010"
		trigger = {
			religion_group = christian
			NOT = { has_landed_title = e_golden_horde }
		}
	}
	option = {
		name = "EVTOPTD60010"
		trigger = {
			NOT = { religion_group = christian }
			NOT = { religion_group = muslim }
			NOT = { has_landed_title = e_golden_horde }
		}
	}
}

# Golden Horde converts to Shiite
character_event = {
	id = 60023
	title = "EVTNAME60020"
	desc = "EVTDESC60013"
	picture = "GFX_evt_mongols"
	border = "GFX_event_normal_frame_religion"
	
	major = yes
	
	only_playable = yes
	only_independent = yes
	only_capable = yes
	min_age = 16
	prisoner = no
	
	trigger = {
		primary_title = {
			title = e_golden_horde
			holder_scope = {
				religion = tengri_pagan
				NOT = { trait = zealous }
			}
		}
		had_global_flag = { flag = golden_horde_arrival days = 14600 }
		NOT = { had_global_flag = { flag = il_khanate_arrival days = 29200 } }
		NOT = { has_global_flag = golden_horde_converts }
		any_realm_province = {
			religion = shiite
		}
	}

	mean_time_to_happen = {
		months = 420
		modifier = {
			factor = 0.75
			any_demesne_province = {
				is_capital = yes
				religion = shiite
			}
		}
	}
	
	immediate = {
		set_global_flag = golden_horde_converts
	}
	
	option = {	# Shiite
		name = "EVTOPTA60010"
		trigger = {
			has_landed_title = e_golden_horde
		}
		religion = shiite
		any_realm_character = {
			limit = { religion = tengri_pagan }
			religion = shiite
			if = {
				limit = {
					is_playable = yes
					capital_scope = {
						religion = tengri_pagan
					}
				}
				capital_scope = {
					religion = shiite
				}
			}
		}
	}
	# Other rulers are informed
	option = {
		name = "EXCELLENT"
		trigger = {
			religion_group = muslim
			NOT = { has_landed_title = e_golden_horde }
		}
	}
	option = {
		name = "EVTOPTC60010"
		trigger = {
			religion_group = christian
			NOT = { has_landed_title = e_golden_horde }
		}
	}
	option = {
		name = "EVTOPTD60010"
		trigger = {
			NOT = { religion_group = christian }
			NOT = { religion_group = muslim }
			NOT = { has_landed_title = e_golden_horde }
		}
	}
}

# Golden Horde converts to Nestorian
character_event = {
	id = 60024
	title = "EVTNAME60020"
	desc = "EVTDESC60014"
	picture = "GFX_evt_mongols"
	border = "GFX_event_normal_frame_religion"
	
	major = yes
	
	only_playable = yes
	only_independent = yes
	only_capable = yes
	min_age = 16
	prisoner = no
	
	trigger = {
		primary_title = {
			title = e_golden_horde
			holder_scope = {
				religion = tengri_pagan
				NOT = { trait = zealous }
			}
		}
		had_global_flag = { flag = golden_horde_arrival days = 14600 }
		NOT = { had_global_flag = { flag = il_khanate_arrival days = 29200 } }
		NOT = { has_global_flag = golden_horde_converts }
	}

	mean_time_to_happen = {
		months = 1440
		modifier = {
			factor = 0.75
			any_demesne_province = {
				is_capital = yes
				religion = nestorian
			}
		}
	}
	
	immediate = {
		set_global_flag = golden_horde_converts
	}
	
	option = {	# Nestorian
		name = "EVTOPTA60010"
		trigger = {
			has_landed_title = e_golden_horde
		}
		religion = nestorian
		any_realm_character = {
			limit = { religion = tengri_pagan }
			religion = nestorian
			if = {
				limit = {
					is_playable = yes
					capital_scope = {
						religion = tengri_pagan
					}
				}
				capital_scope = {
					religion = nestorian
				}
			}
		}
	}
	# Other rulers are informed
	option = {
		name = "EVTOPTB60010"
		trigger = {
			religion_group = muslim
			NOT = { has_landed_title = e_golden_horde }
		}
	}
	option = {
		name = "EXCELLENT"
		trigger = {
			religion_group = christian
			NOT = { has_landed_title = e_golden_horde }
		}
	}
	option = {
		name = "EVTOPTD60010"
		trigger = {
			NOT = { religion_group = christian }
			NOT = { religion_group = muslim }
			NOT = { has_landed_title = e_golden_horde }
		}
	}
}


### Mongols sack European cities ###

# Mongols sack Kiev
narrative_event = {
	id = 60100
	title = "EVTNAME60100"
	desc = "EVTDESC60100"
	major = yes
	
	picture = "GFX_evt_mongols"
	border = "GFX_event_narrative_frame_war"
	
	is_triggered_only = yes
	
	culture = mongol
	
	trigger = {
		NOT = { has_global_flag = mongols_sack_kiev }
		OR = {
			has_landed_title = e_il-khanate
			has_landed_title = e_golden_horde
			has_landed_title = e_mongol_empire
			liege = { has_landed_title = e_il-khanate }
			liege = { has_landed_title = e_golden_horde }
			liege = { has_landed_title = e_mongol_empire }
			top_liege = { has_landed_title = e_il-khanate }
			top_liege = { has_landed_title = e_golden_horde }
			top_liege = { has_landed_title = e_mongol_empire }
		}
		FROM = { title = b_kiev }
		NOT = {
			FROM = {
				owner = {
					OR = {
						has_landed_title = e_il-khanate
						has_landed_title = e_golden_horde
						has_landed_title = e_mongol_empire
						liege = { has_landed_title = e_il-khanate }
						liege = { has_landed_title = e_golden_horde }
						liege = { has_landed_title = e_mongol_empire }
						top_liege = { has_landed_title = e_il-khanate }
						top_liege = { has_landed_title = e_golden_horde }
						top_liege = { has_landed_title = e_mongol_empire }
					}
				}
			}
		}		
	}
	
	major_trigger = {
		NOT = {
			has_landed_title = e_il-khanate
			has_landed_title = e_golden_horde
			has_landed_title = e_mongol_empire
			liege = { has_landed_title = e_il-khanate }
			liege = { has_landed_title = e_golden_horde }
			liege = { has_landed_title = e_mongol_empire }
			top_liege = { has_landed_title = e_il-khanate }
			top_liege = { has_landed_title = e_golden_horde }
			top_liege = { has_landed_title = e_mongol_empire }
		}
	}
	
	immediate = {
		set_global_flag = mongols_sack_kiev
		any_player = {
			limit = {
				OR = {
					has_landed_title = e_il-khanate
					has_landed_title = e_golden_horde
					has_landed_title = e_mongol_empire
					liege = { has_landed_title = e_il-khanate }
					liege = { has_landed_title = e_golden_horde }
					liege = { has_landed_title = e_mongol_empire }
					top_liege = { has_landed_title = e_il-khanate }
					top_liege = { has_landed_title = e_golden_horde }
					top_liege = { has_landed_title = e_mongol_empire }
				}
			}
			narrative_event = { id = TOG.1 }
		}
	}
	
	option = {
		name = "EVTOPTA60100"
		trigger = { NOT = { religion_group = muslim } }
	}
	option = {
		name = "EVTOPTB60100"
		trigger = { religion_group = muslim }
	}
}

# Mongols sack Novgorod
narrative_event = {
	id = 60101
	title = "EVTNAME60101"
	desc = "EVTDESC60101"
	major = yes
	
	picture = "GFX_evt_mongols"
	border = "GFX_event_narrative_frame_war"
	
	is_triggered_only = yes
	
	culture = mongol
	
	trigger = {
		NOT = { has_global_flag = mongols_sack_novgorod }
		OR = {
			has_landed_title = e_il-khanate
			has_landed_title = e_golden_horde
			has_landed_title = e_mongol_empire
			liege = { has_landed_title = e_il-khanate }
			liege = { has_landed_title = e_golden_horde }
			liege = { has_landed_title = e_mongol_empire }
			top_liege = { has_landed_title = e_il-khanate }
			top_liege = { has_landed_title = e_golden_horde }
			top_liege = { has_landed_title = e_mongol_empire }
		}
		FROM = { title = b_novgorod }
		NOT = {
			FROM = {
				owner = {
					OR = {
						has_landed_title = e_il-khanate
						has_landed_title = e_golden_horde
						has_landed_title = e_mongol_empire
						liege = { has_landed_title = e_il-khanate }
						liege = { has_landed_title = e_golden_horde }
						liege = { has_landed_title = e_mongol_empire }
						top_liege = { has_landed_title = e_il-khanate }
						top_liege = { has_landed_title = e_golden_horde }
						top_liege = { has_landed_title = e_mongol_empire }
					}
				}
			}
		}		
	}
	
	major_trigger = {
		NOT = {
			has_landed_title = e_il-khanate
			has_landed_title = e_golden_horde
			has_landed_title = e_mongol_empire
			liege = { has_landed_title = e_il-khanate }
			liege = { has_landed_title = e_golden_horde }
			liege = { has_landed_title = e_mongol_empire }
			top_liege = { has_landed_title = e_il-khanate }
			top_liege = { has_landed_title = e_golden_horde }
			top_liege = { has_landed_title = e_mongol_empire }
		}
	}
	
	immediate = {
		set_global_flag = mongols_sack_novgorod
		any_player = {
			limit = {
				OR = {
					has_landed_title = e_il-khanate
					has_landed_title = e_golden_horde
					has_landed_title = e_mongol_empire
					liege = { has_landed_title = e_il-khanate }
					liege = { has_landed_title = e_golden_horde }
					liege = { has_landed_title = e_mongol_empire }
					top_liege = { has_landed_title = e_il-khanate }
					top_liege = { has_landed_title = e_golden_horde }
					top_liege = { has_landed_title = e_mongol_empire }
				}
			}
			narrative_event = { id = TOG.2 }
		}
	}
	
	option = {
		name = EVTOPTA60101 # Perhaps their bloodlust has been sated now
		trigger = { NOT = { culture = mongol } }
	}
	option = {
		name = EVTOPTB60101 # May the snows of the frozen north claim them
		trigger = {
			culture = mongol
		}
	}
}

# Mongols sack Krakow
narrative_event = {
	id = 60102
	title = "EVTNAME60102"
	desc = "EVTDESC60102"
	major = yes
	
	picture = "GFX_evt_mongols"
	border = "GFX_event_narrative_frame_war"
	
	is_triggered_only = yes
	
	culture = mongol
	
	trigger = {
		NOT = { has_global_flag = mongols_sack_krakow }
		OR = {
			has_landed_title = e_il-khanate
			has_landed_title = e_golden_horde
			has_landed_title = e_mongol_empire
			liege = { has_landed_title = e_il-khanate }
			liege = { has_landed_title = e_golden_horde }
			liege = { has_landed_title = e_mongol_empire }
			top_liege = { has_landed_title = e_il-khanate }
			top_liege = { has_landed_title = e_golden_horde }
			top_liege = { has_landed_title = e_mongol_empire }
		}
		FROM = { title = b_krakow }
		
		NOT = {
			FROM = {
				owner = {
					OR = {
						has_landed_title = e_il-khanate
						has_landed_title = e_golden_horde
						has_landed_title = e_mongol_empire
						liege = { has_landed_title = e_il-khanate }
						liege = { has_landed_title = e_golden_horde }
						liege = { has_landed_title = e_mongol_empire }
						top_liege = { has_landed_title = e_il-khanate }
						top_liege = { has_landed_title = e_golden_horde }
						top_liege = { has_landed_title = e_mongol_empire }
					}
				}
			}
		}		
	}
	
	major_trigger = {
		NOT = {
			has_landed_title = e_il-khanate
			has_landed_title = e_golden_horde
			has_landed_title = e_mongol_empire
			liege = { has_landed_title = e_il-khanate }
			liege = { has_landed_title = e_golden_horde }
			liege = { has_landed_title = e_mongol_empire }
			top_liege = { has_landed_title = e_il-khanate }
			top_liege = { has_landed_title = e_golden_horde }
			top_liege = { has_landed_title = e_mongol_empire }
		}
	}
	
	immediate = {
		set_global_flag = mongols_sack_krakow
		any_player = {
			limit = {
				OR = {
					has_landed_title = e_il-khanate
					has_landed_title = e_golden_horde
					has_landed_title = e_mongol_empire
					liege = { has_landed_title = e_il-khanate }
					liege = { has_landed_title = e_golden_horde }
					liege = { has_landed_title = e_mongol_empire }
					top_liege = { has_landed_title = e_il-khanate }
					top_liege = { has_landed_title = e_golden_horde }
					top_liege = { has_landed_title = e_mongol_empire }
				}
			}
			narrative_event = { id = TOG.3 }
		}
	}
	
	option = {
		name = "EVTOPTA60102"
		trigger = { NOT = { religion_group = muslim } }
	}
	option = {
		name = "EVTOPTB60102"
		trigger = { religion_group = muslim }
	}
}

# Mongols sack Aachen
narrative_event = {
	id = 60103
	title = "EVTNAME60103"
	desc = "EVTDESC60103"
	major = yes
	
	picture = "GFX_evt_mongols"
	border = "GFX_event_narrative_frame_war"
	
	is_triggered_only = yes
	
	culture = mongol
	
	trigger = {
		NOT = { has_global_flag = mongols_sack_aachen }
		OR = {
			has_landed_title = e_il-khanate
			has_landed_title = e_golden_horde
			has_landed_title = e_mongol_empire
			liege = { has_landed_title = e_il-khanate }
			liege = { has_landed_title = e_golden_horde }
			liege = { has_landed_title = e_mongol_empire }
			top_liege = { has_landed_title = e_il-khanate }
			top_liege = { has_landed_title = e_golden_horde }
			top_liege = { has_landed_title = e_mongol_empire }
		}
		FROM = { title = b_aachen }
		
		NOT = {
			FROM = {
				owner = {
					OR = {
						has_landed_title = e_il-khanate
						has_landed_title = e_golden_horde
						has_landed_title = e_mongol_empire
						liege = { has_landed_title = e_il-khanate }
						liege = { has_landed_title = e_golden_horde }
						liege = { has_landed_title = e_mongol_empire }
						top_liege = { has_landed_title = e_il-khanate }
						top_liege = { has_landed_title = e_golden_horde }
						top_liege = { has_landed_title = e_mongol_empire }
					}
				}
			}
		}		
	}
	
	major_trigger = {
		NOT = {
			has_landed_title = e_il-khanate
			has_landed_title = e_golden_horde
			has_landed_title = e_mongol_empire
			liege = { has_landed_title = e_il-khanate }
			liege = { has_landed_title = e_golden_horde }
			liege = { has_landed_title = e_mongol_empire }
			top_liege = { has_landed_title = e_il-khanate }
			top_liege = { has_landed_title = e_golden_horde }
			top_liege = { has_landed_title = e_mongol_empire }
		}
	}
	
	immediate = {
		set_global_flag = mongols_sack_aachen
		any_player = {
			limit = {
				OR = {
					has_landed_title = e_il-khanate
					has_landed_title = e_golden_horde
					has_landed_title = e_mongol_empire
					liege = { has_landed_title = e_il-khanate }
					liege = { has_landed_title = e_golden_horde }
					liege = { has_landed_title = e_mongol_empire }
					top_liege = { has_landed_title = e_il-khanate }
					top_liege = { has_landed_title = e_golden_horde }
					top_liege = { has_landed_title = e_mongol_empire }
				}
			}
			narrative_event = { id = TOG.4 }
		}
	}
	
	option = {
		name = "EVTOPTA60103"
		trigger = { NOT = { religion_group = muslim } }
	}
	option = {
		name = "EVTOPTB60103"
		trigger = { religion_group = muslim }
	}
}

# Mongols sack Paris
narrative_event = {
	id = 60104
	title = "EVTNAME60104"
	desc = "EVTDESC60104"
	major = yes
	
	picture = "GFX_evt_mongols"
	border = "GFX_event_narrative_frame_war"
	
	is_triggered_only = yes
	
	culture = mongol
	
	trigger = {
		NOT = { has_global_flag = mongols_sack_paris }
		OR = {
			has_landed_title = e_il-khanate
			has_landed_title = e_golden_horde
			has_landed_title = e_mongol_empire
			liege = { has_landed_title = e_il-khanate }
			liege = { has_landed_title = e_golden_horde }
			liege = { has_landed_title = e_mongol_empire }
			top_liege = { has_landed_title = e_il-khanate }
			top_liege = { has_landed_title = e_golden_horde }
			top_liege = { has_landed_title = e_mongol_empire }
		}
		FROM = { title = b_paris }
		
		NOT = {
			FROM = {
				owner = {
					OR = {
						has_landed_title = e_il-khanate
						has_landed_title = e_golden_horde
						has_landed_title = e_mongol_empire
						liege = { has_landed_title = e_il-khanate }
						liege = { has_landed_title = e_golden_horde }
						liege = { has_landed_title = e_mongol_empire }
						top_liege = { has_landed_title = e_il-khanate }
						top_liege = { has_landed_title = e_golden_horde }
						top_liege = { has_landed_title = e_mongol_empire }
					}
				}
			}
		}		
	}
	
	major_trigger = {
		NOT = {
			has_landed_title = e_il-khanate
			has_landed_title = e_golden_horde
			has_landed_title = e_mongol_empire
			liege = { has_landed_title = e_il-khanate }
			liege = { has_landed_title = e_golden_horde }
			liege = { has_landed_title = e_mongol_empire }
			top_liege = { has_landed_title = e_il-khanate }
			top_liege = { has_landed_title = e_golden_horde }
			top_liege = { has_landed_title = e_mongol_empire }
		}
	}
	
	immediate = {
		set_global_flag = mongols_sack_paris
		any_player = {
			limit = {
				OR = {
					has_landed_title = e_il-khanate
					has_landed_title = e_golden_horde
					has_landed_title = e_mongol_empire
					liege = { has_landed_title = e_il-khanate }
					liege = { has_landed_title = e_golden_horde }
					liege = { has_landed_title = e_mongol_empire }
					top_liege = { has_landed_title = e_il-khanate }
					top_liege = { has_landed_title = e_golden_horde }
					top_liege = { has_landed_title = e_mongol_empire }
				}
			}
			narrative_event = { id = TOG.5 }
		}
	}
	
	option = {
		name = "EVTOPTA60104"
		trigger = { NOT = { religion_group = muslim } }
	}
	option = {
		name = "EVTOPTB60104"
		trigger = { religion_group = muslim }
	}
}

# Mongols sack London
narrative_event = {
	id = 60105
	title = "EVTNAME60105"
	desc = "EVTDESC60105"
	major = yes
	
	picture = "GFX_evt_mongols"
	border = "GFX_event_narrative_frame_war"
	
	is_triggered_only = yes
	
	culture = mongol
	
	trigger = {
		NOT = { has_global_flag = mongols_sack_london }
		OR = {
			has_landed_title = e_il-khanate
			has_landed_title = e_golden_horde
			has_landed_title = e_mongol_empire
			liege = { has_landed_title = e_il-khanate }
			liege = { has_landed_title = e_golden_horde }
			liege = { has_landed_title = e_mongol_empire }
			top_liege = { has_landed_title = e_il-khanate }
			top_liege = { has_landed_title = e_golden_horde }
			top_liege = { has_landed_title = e_mongol_empire }
		}
		FROM = { title = b_london }
		
		NOT = {
			FROM = {
				owner = {
					OR = {
						has_landed_title = e_il-khanate
						has_landed_title = e_golden_horde
						has_landed_title = e_mongol_empire
						liege = { has_landed_title = e_il-khanate }
						liege = { has_landed_title = e_golden_horde }
						liege = { has_landed_title = e_mongol_empire }
						top_liege = { has_landed_title = e_il-khanate }
						top_liege = { has_landed_title = e_golden_horde }
						top_liege = { has_landed_title = e_mongol_empire }
					}
				}
			}
		}		
	}
	
	major_trigger = {
		NOT = {
			has_landed_title = e_il-khanate
			has_landed_title = e_golden_horde
			has_landed_title = e_mongol_empire
			liege = { has_landed_title = e_il-khanate }
			liege = { has_landed_title = e_golden_horde }
			liege = { has_landed_title = e_mongol_empire }
			top_liege = { has_landed_title = e_il-khanate }
			top_liege = { has_landed_title = e_golden_horde }
			top_liege = { has_landed_title = e_mongol_empire }
		}
	}
	
	immediate = {
		set_global_flag = mongols_sack_london
		any_player = {
			limit = {
				OR = {
					has_landed_title = e_il-khanate
					has_landed_title = e_golden_horde
					has_landed_title = e_mongol_empire
					liege = { has_landed_title = e_il-khanate }
					liege = { has_landed_title = e_golden_horde }
					liege = { has_landed_title = e_mongol_empire }
					top_liege = { has_landed_title = e_il-khanate }
					top_liege = { has_landed_title = e_golden_horde }
					top_liege = { has_landed_title = e_mongol_empire }
				}
			}
			narrative_event = { id = TOG.6 }
		}
	}
	
	option = {
		name = "EVTOPTA60105"
		trigger = { NOT = { religion_group = muslim } }
	}
	option = {
		name = "EVTOPTB60105"
		trigger = { religion_group = muslim }
	}
}

# Mongols sack Rome
narrative_event = {
	id = 60106
	title = "EVTNAME60106"
	desc = "EVTDESC60106"
	major = yes
	
	picture = "GFX_evt_rome_falls"
	border = "GFX_event_narrative_frame_war"
	
	is_triggered_only = yes
	
	culture = mongol
	
	trigger = {
		NOT = { has_global_flag = mongols_sack_rome }
		OR = {
			has_landed_title = e_il-khanate
			has_landed_title = e_golden_horde
			has_landed_title = e_mongol_empire
			liege = { has_landed_title = e_il-khanate }
			liege = { has_landed_title = e_golden_horde }
			liege = { has_landed_title = e_mongol_empire }
			top_liege = { has_landed_title = e_il-khanate }
			top_liege = { has_landed_title = e_golden_horde }
			top_liege = { has_landed_title = e_mongol_empire }
		}
		FROM = { title = b_roma }
		
		NOT = {
			FROM = {
				owner = {
					OR = {
						has_landed_title = e_il-khanate
						has_landed_title = e_golden_horde
						has_landed_title = e_mongol_empire
						liege = { has_landed_title = e_il-khanate }
						liege = { has_landed_title = e_golden_horde }
						liege = { has_landed_title = e_mongol_empire }
						top_liege = { has_landed_title = e_il-khanate }
						top_liege = { has_landed_title = e_golden_horde }
						top_liege = { has_landed_title = e_mongol_empire }
					}
				}
			}
		}		
	}
	
	major_trigger = {
		NOT = {
			has_landed_title = e_il-khanate
			has_landed_title = e_golden_horde
			has_landed_title = e_mongol_empire
			liege = { has_landed_title = e_il-khanate }
			liege = { has_landed_title = e_golden_horde }
			liege = { has_landed_title = e_mongol_empire }
			top_liege = { has_landed_title = e_il-khanate }
			top_liege = { has_landed_title = e_golden_horde }
			top_liege = { has_landed_title = e_mongol_empire }
		}
	}
	
	immediate = {
		set_global_flag = mongols_sack_rome
		any_player = {
			limit = {
				OR = {
					has_landed_title = e_il-khanate
					has_landed_title = e_golden_horde
					has_landed_title = e_mongol_empire
					liege = { has_landed_title = e_il-khanate }
					liege = { has_landed_title = e_golden_horde }
					liege = { has_landed_title = e_mongol_empire }
					top_liege = { has_landed_title = e_il-khanate }
					top_liege = { has_landed_title = e_golden_horde }
					top_liege = { has_landed_title = e_mongol_empire }
				}
			}
			narrative_event = { id = TOG.7 }
		}
	}
	
	option = {
		name = "EVTOPTA60106"
		trigger = { NOT = { religion_group = muslim } }
	}
	option = {
		name = "EVTOPTB60106"
		trigger = { religion_group = muslim }
	}
}

# Mongols sack Venice
narrative_event = {
	id = 60107
	title = "EVTNAME60107"
	desc = "EVTDESC60107"
	major = yes
	
	picture = "GFX_evt_mongols"
	border = "GFX_event_narrative_frame_war"
	
	is_triggered_only = yes
	
	culture = mongol
	
	trigger = {
		FROM = { title = b_venezia }
		NOT = { has_global_flag = mongols_sack_venice }
		OR = {
			has_landed_title = e_il-khanate
			has_landed_title = e_golden_horde
			has_landed_title = e_mongol_empire
			liege = { has_landed_title = e_il-khanate }
			liege = { has_landed_title = e_golden_horde }
			liege = { has_landed_title = e_mongol_empire }
			top_liege = { has_landed_title = e_il-khanate }
			top_liege = { has_landed_title = e_golden_horde }
			top_liege = { has_landed_title = e_mongol_empire }
		}
		NOT = {
			FROM = {
				owner = {
					OR = {
						has_landed_title = e_il-khanate
						has_landed_title = e_golden_horde
						has_landed_title = e_mongol_empire
						liege = { has_landed_title = e_il-khanate }
						liege = { has_landed_title = e_golden_horde }
						liege = { has_landed_title = e_mongol_empire }
						top_liege = { has_landed_title = e_il-khanate }
						top_liege = { has_landed_title = e_golden_horde }
						top_liege = { has_landed_title = e_mongol_empire }
					}
				}
			}
		}		
	}
	
	major_trigger = {
		NOT = {
			has_landed_title = e_il-khanate
			has_landed_title = e_golden_horde
			has_landed_title = e_mongol_empire
			liege = { has_landed_title = e_il-khanate }
			liege = { has_landed_title = e_golden_horde }
			liege = { has_landed_title = e_mongol_empire }
			top_liege = { has_landed_title = e_il-khanate }
			top_liege = { has_landed_title = e_golden_horde }
			top_liege = { has_landed_title = e_mongol_empire }
		}
	}
	
	immediate = {
		set_global_flag = mongols_sack_venice
		any_player = {
			limit = {
				OR = {
					has_landed_title = e_il-khanate
					has_landed_title = e_golden_horde
					has_landed_title = e_mongol_empire
					liege = { has_landed_title = e_il-khanate }
					liege = { has_landed_title = e_golden_horde }
					liege = { has_landed_title = e_mongol_empire }
					top_liege = { has_landed_title = e_il-khanate }
					top_liege = { has_landed_title = e_golden_horde }
					top_liege = { has_landed_title = e_mongol_empire }
				}
			}
			narrative_event = { id = TOG.8 }
		}
	}
	
	option = {
		name = "EVTOPTA60107"
		trigger = { NOT = { religion_group = muslim } }
	}
	option = {
		name = "EVTOPTB60107"
		trigger = { religion_group = muslim }
	}
}

# Mongols sack Constantinople
narrative_event = {
	id = 60108
	title = "EVTNAME60108"
	desc = "EVTDESC60108"
	major = yes
	
	picture = "GFX_evt_mongols"
	border = "GFX_event_narrative_frame_war"
	
	is_triggered_only = yes
	
	culture = mongol
	
	trigger = {
		FROM = { title = b_constantinople }
		NOT = { has_global_flag = mongols_sack_constantinople }
		OR = {
			has_landed_title = e_il-khanate
			has_landed_title = e_golden_horde
			has_landed_title = e_mongol_empire
			liege = { has_landed_title = e_il-khanate }
			liege = { has_landed_title = e_golden_horde }
			liege = { has_landed_title = e_mongol_empire }
			top_liege = { has_landed_title = e_il-khanate }
			top_liege = { has_landed_title = e_golden_horde }
			top_liege = { has_landed_title = e_mongol_empire }
		}
		
		NOT = {
			FROM = {
				owner = {
					OR = {
						has_landed_title = e_il-khanate
						has_landed_title = e_golden_horde
						has_landed_title = e_mongol_empire
						liege = { has_landed_title = e_il-khanate }
						liege = { has_landed_title = e_golden_horde }
						liege = { has_landed_title = e_mongol_empire }
						top_liege = { has_landed_title = e_il-khanate }
						top_liege = { has_landed_title = e_golden_horde }
						top_liege = { has_landed_title = e_mongol_empire }
					}
				}
			}
		}		
	}
	
	major_trigger = {
		NOT = {
			has_landed_title = e_il-khanate
			has_landed_title = e_golden_horde
			has_landed_title = e_mongol_empire
			liege = { has_landed_title = e_il-khanate }
			liege = { has_landed_title = e_golden_horde }
			liege = { has_landed_title = e_mongol_empire }
			top_liege = { has_landed_title = e_il-khanate }
			top_liege = { has_landed_title = e_golden_horde }
			top_liege = { has_landed_title = e_mongol_empire }
		}
	}
	
	immediate = {
		set_global_flag = mongols_sack_constantinople
		any_player = {
			limit = {
				OR = {
					has_landed_title = e_il-khanate
					has_landed_title = e_golden_horde
					has_landed_title = e_mongol_empire
					liege = { has_landed_title = e_il-khanate }
					liege = { has_landed_title = e_golden_horde }
					liege = { has_landed_title = e_mongol_empire }
					top_liege = { has_landed_title = e_il-khanate }
					top_liege = { has_landed_title = e_golden_horde }
					top_liege = { has_landed_title = e_mongol_empire }
				}
			}
			narrative_event = { id = TOG.9 }
		}
	}
	
	option = {
		name = "EVTOPTA60108"
		trigger = { NOT = { religion_group = muslim } }
	}
	option = {
		name = "EVTOPTB60108"
		trigger = { religion_group = muslim }
	}
}

# Mongols sack Lisbon
narrative_event = {
	id = 60109
	title = "EVTNAME60109"
	desc = "EVTDESC60109"
	major = yes
	
	picture = "GFX_evt_mongols"
	border = "GFX_event_narrative_frame_war"
	
	is_triggered_only = yes
	
	culture = mongol
	
	trigger = {
		FROM = { title = b_lisboa }
		NOT = { has_global_flag = mongols_sack_lisbon }
		OR = {
			has_landed_title = e_il-khanate
			has_landed_title = e_golden_horde
			has_landed_title = e_mongol_empire
			liege = { has_landed_title = e_il-khanate }
			liege = { has_landed_title = e_golden_horde }
			liege = { has_landed_title = e_mongol_empire }
			top_liege = { has_landed_title = e_il-khanate }
			top_liege = { has_landed_title = e_golden_horde }
			top_liege = { has_landed_title = e_mongol_empire }
		}
		
		NOT = {
			FROM = {
				owner = {
					OR = {
						has_landed_title = e_il-khanate
						has_landed_title = e_golden_horde
						has_landed_title = e_mongol_empire
						liege = { has_landed_title = e_il-khanate }
						liege = { has_landed_title = e_golden_horde }
						liege = { has_landed_title = e_mongol_empire }
						top_liege = { has_landed_title = e_il-khanate }
						top_liege = { has_landed_title = e_golden_horde }
						top_liege = { has_landed_title = e_mongol_empire }
					}
				}
			}
		}		
	}
	
	major_trigger = {
		NOT = {
			has_landed_title = e_il-khanate
			has_landed_title = e_golden_horde
			has_landed_title = e_mongol_empire
			liege = { has_landed_title = e_il-khanate }
			liege = { has_landed_title = e_golden_horde }
			liege = { has_landed_title = e_mongol_empire }
			top_liege = { has_landed_title = e_il-khanate }
			top_liege = { has_landed_title = e_golden_horde }
			top_liege = { has_landed_title = e_mongol_empire }
		}
	}
	
	immediate = {
		set_global_flag = mongols_sack_lisbon
		any_player = {
			limit = {
				OR = {
					has_landed_title = e_il-khanate
					has_landed_title = e_golden_horde
					has_landed_title = e_mongol_empire
					liege = { has_landed_title = e_il-khanate }
					liege = { has_landed_title = e_golden_horde }
					liege = { has_landed_title = e_mongol_empire }
					top_liege = { has_landed_title = e_il-khanate }
					top_liege = { has_landed_title = e_golden_horde }
					top_liege = { has_landed_title = e_mongol_empire }
				}
			}
			narrative_event = { id = TOG.10 }
		}
	}
	
	option = {
		name = "EVTOPTA60109"
		trigger = { NOT = { religion_group = muslim } }
	}
	option = {
		name = "EVTOPTB60109"
		trigger = { religion_group = muslim }
	}
}

# Mongols sack Smolensk
narrative_event = {
	id = 60110
	title = "EVTNAME60110"
	desc = "EVTDESC60110"
	major = yes
	
	picture = "GFX_evt_mongols"
	border = "GFX_event_narrative_frame_war"
	
	is_triggered_only = yes
	
	culture = mongol
	
	trigger = {
		FROM = { title = b_smolensk }
		NOT = { has_global_flag = mongols_sack_smolensk }
		OR = {
			has_landed_title = e_il-khanate
			has_landed_title = e_golden_horde
			has_landed_title = e_mongol_empire
			liege = { has_landed_title = e_il-khanate }
			liege = { has_landed_title = e_golden_horde }
			liege = { has_landed_title = e_mongol_empire }
			top_liege = { has_landed_title = e_il-khanate }
			top_liege = { has_landed_title = e_golden_horde }
			top_liege = { has_landed_title = e_mongol_empire }
		}
		
		NOT = {
			FROM = {
				owner = {
					OR = {
						has_landed_title = e_il-khanate
						has_landed_title = e_golden_horde
						has_landed_title = e_mongol_empire
						liege = { has_landed_title = e_il-khanate }
						liege = { has_landed_title = e_golden_horde }
						liege = { has_landed_title = e_mongol_empire }
						top_liege = { has_landed_title = e_il-khanate }
						top_liege = { has_landed_title = e_golden_horde }
						top_liege = { has_landed_title = e_mongol_empire }
					}
				}
			}
		}		
	}
	
	major_trigger = {
		NOT = {
			has_landed_title = e_il-khanate
			has_landed_title = e_golden_horde
			has_landed_title = e_mongol_empire
			liege = { has_landed_title = e_il-khanate }
			liege = { has_landed_title = e_golden_horde }
			liege = { has_landed_title = e_mongol_empire }
			top_liege = { has_landed_title = e_il-khanate }
			top_liege = { has_landed_title = e_golden_horde }
			top_liege = { has_landed_title = e_mongol_empire }
		}
	}
	
	immediate = {
		set_global_flag = mongols_sack_smolensk
		any_player = {
			limit = {
				OR = {
					has_landed_title = e_il-khanate
					has_landed_title = e_golden_horde
					has_landed_title = e_mongol_empire
					liege = { has_landed_title = e_il-khanate }
					liege = { has_landed_title = e_golden_horde }
					liege = { has_landed_title = e_mongol_empire }
					top_liege = { has_landed_title = e_il-khanate }
					top_liege = { has_landed_title = e_golden_horde }
					top_liege = { has_landed_title = e_mongol_empire }
				}
			}
			narrative_event = { id = TOG.11 }
		}
	}
	
	option = {
		name = "EVTOPTA60110"
		trigger = { NOT = { religion_group = muslim } }
	}
	option = {
		name = "EVTOPTB60110"
		trigger = { religion_group = muslim }
	}
}

# Mongols sack Prague
narrative_event = {
	id = 60111
	title = "EVTNAME60111"
	desc = "EVTDESC60111"
	major = yes
	
	picture = "GFX_evt_mongols"
	border = "GFX_event_narrative_frame_war"
	
	is_triggered_only = yes
	
	culture = mongol
	
	trigger = {
		FROM = { title = b_praha }
		NOT = { has_global_flag = mongols_sack_prague }
		OR = {
			has_landed_title = e_il-khanate
			has_landed_title = e_golden_horde
			has_landed_title = e_mongol_empire
			liege = { has_landed_title = e_il-khanate }
			liege = { has_landed_title = e_golden_horde }
			liege = { has_landed_title = e_mongol_empire }
			top_liege = { has_landed_title = e_il-khanate }
			top_liege = { has_landed_title = e_golden_horde }
			top_liege = { has_landed_title = e_mongol_empire }
		}
		
		NOT = {
			FROM = {
				owner = {
					OR = {
						has_landed_title = e_il-khanate
						has_landed_title = e_golden_horde
						has_landed_title = e_mongol_empire
						liege = { has_landed_title = e_il-khanate }
						liege = { has_landed_title = e_golden_horde }
						liege = { has_landed_title = e_mongol_empire }
						top_liege = { has_landed_title = e_il-khanate }
						top_liege = { has_landed_title = e_golden_horde }
						top_liege = { has_landed_title = e_mongol_empire }
					}
				}
			}
		}		
	}
	
	major_trigger = {
		NOT = {
			has_landed_title = e_il-khanate
			has_landed_title = e_golden_horde
			has_landed_title = e_mongol_empire
			liege = { has_landed_title = e_il-khanate }
			liege = { has_landed_title = e_golden_horde }
			liege = { has_landed_title = e_mongol_empire }
			top_liege = { has_landed_title = e_il-khanate }
			top_liege = { has_landed_title = e_golden_horde }
			top_liege = { has_landed_title = e_mongol_empire }
		}
	}
	
	immediate = {
		set_global_flag = mongols_sack_prague
		any_player = {
			limit = {
				OR = {
					has_landed_title = e_il-khanate
					has_landed_title = e_golden_horde
					has_landed_title = e_mongol_empire
					liege = { has_landed_title = e_il-khanate }
					liege = { has_landed_title = e_golden_horde }
					liege = { has_landed_title = e_mongol_empire }
					top_liege = { has_landed_title = e_il-khanate }
					top_liege = { has_landed_title = e_golden_horde }
					top_liege = { has_landed_title = e_mongol_empire }
				}
			}
			narrative_event = { id = TOG.12 }
		}
	}
	
	option = {
		name = "EVTOPTA60111"
		trigger = { NOT = { religion_group = muslim } }
	}
	option = {
		name = "EVTOPTB60111"
		trigger = { religion_group = muslim }
	}
}

# Mongols sack Vienna
narrative_event = {
	id = 60112
	title = "EVTNAME60112"
	desc = "EVTDESC60112"
	major = yes
	
	picture = "GFX_evt_mongols"
	border = "GFX_event_narrative_frame_war"
	
	is_triggered_only = yes
	
	culture = mongol
	
	trigger = {
		FROM = { title = b_wien }
		NOT = { has_global_flag = mongols_sack_vienna }
		OR = {
			has_landed_title = e_il-khanate
			has_landed_title = e_golden_horde
			has_landed_title = e_mongol_empire
			liege = { has_landed_title = e_il-khanate }
			liege = { has_landed_title = e_golden_horde }
			liege = { has_landed_title = e_mongol_empire }
			top_liege = { has_landed_title = e_il-khanate }
			top_liege = { has_landed_title = e_golden_horde }
			top_liege = { has_landed_title = e_mongol_empire }
		}
		
		NOT = {
			FROM = {
				owner = {
					OR = {
						has_landed_title = e_il-khanate
						has_landed_title = e_golden_horde
						has_landed_title = e_mongol_empire
						liege = { has_landed_title = e_il-khanate }
						liege = { has_landed_title = e_golden_horde }
						liege = { has_landed_title = e_mongol_empire }
						top_liege = { has_landed_title = e_il-khanate }
						top_liege = { has_landed_title = e_golden_horde }
						top_liege = { has_landed_title = e_mongol_empire }
					}
				}
			}
		}		
	}
	
	major_trigger = {
		NOT = {
			has_landed_title = e_il-khanate
			has_landed_title = e_golden_horde
			has_landed_title = e_mongol_empire
			liege = { has_landed_title = e_il-khanate }
			liege = { has_landed_title = e_golden_horde }
			liege = { has_landed_title = e_mongol_empire }
			top_liege = { has_landed_title = e_il-khanate }
			top_liege = { has_landed_title = e_golden_horde }
			top_liege = { has_landed_title = e_mongol_empire }
		}
	}
	
	immediate = {
		set_global_flag = mongols_sack_vienna
		any_player = {
			limit = {
				OR = {
					has_landed_title = e_il-khanate
					has_landed_title = e_golden_horde
					has_landed_title = e_mongol_empire
					liege = { has_landed_title = e_il-khanate }
					liege = { has_landed_title = e_golden_horde }
					liege = { has_landed_title = e_mongol_empire }
					top_liege = { has_landed_title = e_il-khanate }
					top_liege = { has_landed_title = e_golden_horde }
					top_liege = { has_landed_title = e_mongol_empire }
				}
			}
			narrative_event = { id = TOG.13 }
		}
	}
	
	option = {
		name = "EVTOPTA60112"
		trigger = { NOT = { religion_group = muslim } }
	}
	option = {
		name = "EVTOPTB60112"
		trigger = { religion_group = muslim }
	}
}

# Mongols sack Esztergom
narrative_event = {
	id = 60113
	title = "EVTNAME60113"
	desc = "EVTDESC60113"
	major = yes
	
	picture = "GFX_evt_mongols"
	border = "GFX_event_narrative_frame_war"
	
	is_triggered_only = yes
	
	culture = mongol
	
	trigger = {
		FROM = { title = b_esztergom }
		NOT = { has_global_flag = mongols_sack_esztergom }
		OR = {
			has_landed_title = e_il-khanate
			has_landed_title = e_golden_horde
			has_landed_title = e_mongol_empire
			liege = { has_landed_title = e_il-khanate }
			liege = { has_landed_title = e_golden_horde }
			liege = { has_landed_title = e_mongol_empire }
			top_liege = { has_landed_title = e_il-khanate }
			top_liege = { has_landed_title = e_golden_horde }
			top_liege = { has_landed_title = e_mongol_empire }
		}
		
		NOT = {
			FROM = {
				owner = {
					OR = {
						has_landed_title = e_il-khanate
						has_landed_title = e_golden_horde
						has_landed_title = e_mongol_empire
						liege = { has_landed_title = e_il-khanate }
						liege = { has_landed_title = e_golden_horde }
						liege = { has_landed_title = e_mongol_empire }
						top_liege = { has_landed_title = e_il-khanate }
						top_liege = { has_landed_title = e_golden_horde }
						top_liege = { has_landed_title = e_mongol_empire }
					}
				}
			}
		}		
	}
	
	major_trigger = {
		NOT = {
			has_landed_title = e_il-khanate
			has_landed_title = e_golden_horde
			has_landed_title = e_mongol_empire
			liege = { has_landed_title = e_il-khanate }
			liege = { has_landed_title = e_golden_horde }
			liege = { has_landed_title = e_mongol_empire }
			top_liege = { has_landed_title = e_il-khanate }
			top_liege = { has_landed_title = e_golden_horde }
			top_liege = { has_landed_title = e_mongol_empire }
		}
	}
	
	immediate = {
		set_global_flag = mongols_sack_esztergom
		any_player = {
			limit = {
				OR = {
					has_landed_title = e_il-khanate
					has_landed_title = e_golden_horde
					has_landed_title = e_mongol_empire
					liege = { has_landed_title = e_il-khanate }
					liege = { has_landed_title = e_golden_horde }
					liege = { has_landed_title = e_mongol_empire }
					top_liege = { has_landed_title = e_il-khanate }
					top_liege = { has_landed_title = e_golden_horde }
					top_liege = { has_landed_title = e_mongol_empire }
				}
			}
			narrative_event = { id = TOG.14 }
		}
	}
	
	option = {
		name = "EVTOPTA60113"
		trigger = { NOT = { religion_group = muslim } }
	}
	option = {
		name = "EVTOPTB60113"
		trigger = { religion_group = muslim }
	}
}

# Mongols sack Athens
narrative_event = {
	id = 60114
	title = "EVTNAME60114"
	desc = "EVTDESC60114"
	major = yes
	
	picture = "GFX_evt_mongols"
	border = "GFX_event_narrative_frame_war"
	
	is_triggered_only = yes
	
	culture = mongol
	
	trigger = {
		FROM = { title = b_athens }
		NOT = { has_global_flag = mongols_sack_athens }
		OR = {
			has_landed_title = e_il-khanate
			has_landed_title = e_golden_horde
			has_landed_title = e_mongol_empire
			liege = { has_landed_title = e_il-khanate }
			liege = { has_landed_title = e_golden_horde }
			liege = { has_landed_title = e_mongol_empire }
			top_liege = { has_landed_title = e_il-khanate }
			top_liege = { has_landed_title = e_golden_horde }
			top_liege = { has_landed_title = e_mongol_empire }
		}
		
		NOT = {
			FROM = {
				owner = {
					OR = {
						has_landed_title = e_il-khanate
						has_landed_title = e_golden_horde
						has_landed_title = e_mongol_empire
						liege = { has_landed_title = e_il-khanate }
						liege = { has_landed_title = e_golden_horde }
						liege = { has_landed_title = e_mongol_empire }
						top_liege = { has_landed_title = e_il-khanate }
						top_liege = { has_landed_title = e_golden_horde }
						top_liege = { has_landed_title = e_mongol_empire }
					}
				}
			}
		}		
	}
	
	major_trigger = {
		NOT = {
			has_landed_title = e_il-khanate
			has_landed_title = e_golden_horde
			has_landed_title = e_mongol_empire
			liege = { has_landed_title = e_il-khanate }
			liege = { has_landed_title = e_golden_horde }
			liege = { has_landed_title = e_mongol_empire }
			top_liege = { has_landed_title = e_il-khanate }
			top_liege = { has_landed_title = e_golden_horde }
			top_liege = { has_landed_title = e_mongol_empire }
		}
	}
	
	immediate = {
		set_global_flag = mongols_sack_athens
		any_player = {
			limit = {
				OR = {
					has_landed_title = e_il-khanate
					has_landed_title = e_golden_horde
					has_landed_title = e_mongol_empire
					liege = { has_landed_title = e_il-khanate }
					liege = { has_landed_title = e_golden_horde }
					liege = { has_landed_title = e_mongol_empire }
					top_liege = { has_landed_title = e_il-khanate }
					top_liege = { has_landed_title = e_golden_horde }
					top_liege = { has_landed_title = e_mongol_empire }
				}
			}
			narrative_event = { id = TOG.15 }
		}
	}
	
	option = {
		name = "EVTOPTA60114"
		trigger = { NOT = { religion_group = muslim } }
	}
	option = {
		name = "EVTOPTB60114"
		trigger = { religion_group = muslim }
	}
}

# Mongols sack Belgrade
narrative_event = {
	id = 60115
	title = "EVTNAME60115"
	desc = "EVTDESC60115"
	major = yes
	
	picture = "GFX_evt_mongols"
	border = "GFX_event_narrative_frame_war"
	
	is_triggered_only = yes
	
	culture = mongol
	
	trigger = {
		FROM = { title = b_belgrade }
		NOT = { has_global_flag = mongols_sack_belgrade }
		OR = {
			has_landed_title = e_il-khanate
			has_landed_title = e_golden_horde
			has_landed_title = e_mongol_empire
			liege = { has_landed_title = e_il-khanate }
			liege = { has_landed_title = e_golden_horde }
			liege = { has_landed_title = e_mongol_empire }
			top_liege = { has_landed_title = e_il-khanate }
			top_liege = { has_landed_title = e_golden_horde }
			top_liege = { has_landed_title = e_mongol_empire }
		}
		
		NOT = {
			FROM = {
				owner = {
					OR = {
						has_landed_title = e_il-khanate
						has_landed_title = e_golden_horde
						has_landed_title = e_mongol_empire
						liege = { has_landed_title = e_il-khanate }
						liege = { has_landed_title = e_golden_horde }
						liege = { has_landed_title = e_mongol_empire }
						top_liege = { has_landed_title = e_il-khanate }
						top_liege = { has_landed_title = e_golden_horde }
						top_liege = { has_landed_title = e_mongol_empire }
					}
				}
			}
		}		
	}
	
	major_trigger = {
		NOT = {
			has_landed_title = e_il-khanate
			has_landed_title = e_golden_horde
			has_landed_title = e_mongol_empire
			liege = { has_landed_title = e_il-khanate }
			liege = { has_landed_title = e_golden_horde }
			liege = { has_landed_title = e_mongol_empire }
			top_liege = { has_landed_title = e_il-khanate }
			top_liege = { has_landed_title = e_golden_horde }
			top_liege = { has_landed_title = e_mongol_empire }
		}
	}
	
	immediate = {
		set_global_flag = mongols_sack_belgrade
		any_player = {
			limit = {
				OR = {
					has_landed_title = e_il-khanate
					has_landed_title = e_golden_horde
					has_landed_title = e_mongol_empire
					liege = { has_landed_title = e_il-khanate }
					liege = { has_landed_title = e_golden_horde }
					liege = { has_landed_title = e_mongol_empire }
					top_liege = { has_landed_title = e_il-khanate }
					top_liege = { has_landed_title = e_golden_horde }
					top_liege = { has_landed_title = e_mongol_empire }
				}
			}
			narrative_event = { id = TOG.16 }
		}
	}
	
	option = {
		name = "EVTOPTA60115"
		trigger = { NOT = { religion_group = muslim } }
	}
	option = {
		name = "EVTOPTB60115"
		trigger = { religion_group = muslim }
	}
}

### Mongols sack Middle Eastern cities ###

# Mongols sack Baghdad
narrative_event = {
	id = 60116
	title = "EVTNAME60116"
	desc = "EVTDESC60116"
	major = yes
	
	picture = "GFX_evt_mongols"
	border = "GFX_event_narrative_frame_war"
	
	is_triggered_only = yes
	
	culture = mongol
	
	trigger = {
		FROM = { title = b_bagdad }
		NOT = { has_global_flag = mongols_sack_baghdad }
		OR = {
			has_landed_title = e_il-khanate
			has_landed_title = e_golden_horde
			has_landed_title = e_mongol_empire
			liege = { has_landed_title = e_il-khanate }
			liege = { has_landed_title = e_golden_horde }
			liege = { has_landed_title = e_mongol_empire }
			top_liege = { has_landed_title = e_il-khanate }
			top_liege = { has_landed_title = e_golden_horde }
			top_liege = { has_landed_title = e_mongol_empire }
		}
		
		NOT = {
			FROM = {
				owner = {
					OR = {
						has_landed_title = e_il-khanate
						has_landed_title = e_golden_horde
						has_landed_title = e_mongol_empire
						liege = { has_landed_title = e_il-khanate }
						liege = { has_landed_title = e_golden_horde }
						liege = { has_landed_title = e_mongol_empire }
						top_liege = { has_landed_title = e_il-khanate }
						top_liege = { has_landed_title = e_golden_horde }
						top_liege = { has_landed_title = e_mongol_empire }
					}
				}
			}
		}		
	}
	
	major_trigger = {
		NOT = {
			has_landed_title = e_il-khanate
			has_landed_title = e_golden_horde
			has_landed_title = e_mongol_empire
			liege = { has_landed_title = e_il-khanate }
			liege = { has_landed_title = e_golden_horde }
			liege = { has_landed_title = e_mongol_empire }
			top_liege = { has_landed_title = e_il-khanate }
			top_liege = { has_landed_title = e_golden_horde }
			top_liege = { has_landed_title = e_mongol_empire }
		}
	}
	
	immediate = {
		set_global_flag = mongols_sack_baghdad
		any_player = {
			limit = {
				OR = {
					has_landed_title = e_il-khanate
					has_landed_title = e_golden_horde
					has_landed_title = e_mongol_empire
					liege = { has_landed_title = e_il-khanate }
					liege = { has_landed_title = e_golden_horde }
					liege = { has_landed_title = e_mongol_empire }
					top_liege = { has_landed_title = e_il-khanate }
					top_liege = { has_landed_title = e_golden_horde }
					top_liege = { has_landed_title = e_mongol_empire }
				}
			}
			narrative_event = { id = TOG.17 }
		}
	}
	
	option = {
		name = "EVTOPTA60116"
		trigger = { religion_group = muslim }
	}
	option = {
		name = "EVTOPTB60116"
		trigger = { NOT = { religion_group = muslim } }
	}
}

# Mongols sack Damascus
narrative_event = {
	id = 60117
	title = "EVTNAME60117"
	desc = "EVTDESC60117"
	major = yes
	
	picture = "GFX_evt_mongols"
	border = "GFX_event_narrative_frame_war"
	
	is_triggered_only = yes
	
	culture = mongol
	
	trigger = {
		FROM = { title = b_damascus }
		NOT = { has_global_flag = mongols_sack_damascus }
		OR = {
			has_landed_title = e_il-khanate
			has_landed_title = e_golden_horde
			has_landed_title = e_mongol_empire
			liege = { has_landed_title = e_il-khanate }
			liege = { has_landed_title = e_golden_horde }
			liege = { has_landed_title = e_mongol_empire }
			top_liege = { has_landed_title = e_il-khanate }
			top_liege = { has_landed_title = e_golden_horde }
			top_liege = { has_landed_title = e_mongol_empire }
		}
		
		NOT = {
			FROM = {
				owner = {
					OR = {
						has_landed_title = e_il-khanate
						has_landed_title = e_golden_horde
						has_landed_title = e_mongol_empire
						liege = { has_landed_title = e_il-khanate }
						liege = { has_landed_title = e_golden_horde }
						liege = { has_landed_title = e_mongol_empire }
						top_liege = { has_landed_title = e_il-khanate }
						top_liege = { has_landed_title = e_golden_horde }
						top_liege = { has_landed_title = e_mongol_empire }
					}
				}
			}
		}		
	}
	
	major_trigger = {
		NOT = {
			has_landed_title = e_il-khanate
			has_landed_title = e_golden_horde
			has_landed_title = e_mongol_empire
			liege = { has_landed_title = e_il-khanate }
			liege = { has_landed_title = e_golden_horde }
			liege = { has_landed_title = e_mongol_empire }
			top_liege = { has_landed_title = e_il-khanate }
			top_liege = { has_landed_title = e_golden_horde }
			top_liege = { has_landed_title = e_mongol_empire }
		}
	}
	
	immediate = {
		set_global_flag = mongols_sack_damascus
		any_player = {
			limit = {
				OR = {
					has_landed_title = e_il-khanate
					has_landed_title = e_golden_horde
					has_landed_title = e_mongol_empire
					liege = { has_landed_title = e_il-khanate }
					liege = { has_landed_title = e_golden_horde }
					liege = { has_landed_title = e_mongol_empire }
					top_liege = { has_landed_title = e_il-khanate }
					top_liege = { has_landed_title = e_golden_horde }
					top_liege = { has_landed_title = e_mongol_empire }
				}
			}
			narrative_event = { id = TOG.18 }
		}
	}
	
	option = {
		name = "EVTOPTA60117"
		trigger = { religion_group = muslim }
	}
	option = {
		name = "EVTOPTB60117"
		trigger = { NOT = { religion_group = muslim } }
	}
}

# Mongols sack Jerusalem
narrative_event = {
	id = 60118
	title = "EVTNAME60118"
	desc = "EVTDESC60118"
	major = yes
	
	picture = "GFX_evt_mongols"
	border = "GFX_event_narrative_frame_war"
	
	is_triggered_only = yes
	
	culture = mongol
	
	trigger = {
		FROM = { title = b_jerusalem }
		NOT = { has_global_flag = mongols_sack_jerusalem }
		NOT = {
			OR = {
				religion_group = muslim 
				religion_group = christian 
			}
		}
		OR = {
			has_landed_title = e_il-khanate
			has_landed_title = e_golden_horde
			has_landed_title = e_mongol_empire
			liege = { has_landed_title = e_il-khanate }
			liege = { has_landed_title = e_golden_horde }
			liege = { has_landed_title = e_mongol_empire }
			top_liege = { has_landed_title = e_il-khanate }
			top_liege = { has_landed_title = e_golden_horde }
			top_liege = { has_landed_title = e_mongol_empire }
		}
		
		NOT = {
			FROM = {
				owner = {
					OR = {
						has_landed_title = e_il-khanate
						has_landed_title = e_golden_horde
						has_landed_title = e_mongol_empire
						liege = { has_landed_title = e_il-khanate }
						liege = { has_landed_title = e_golden_horde }
						liege = { has_landed_title = e_mongol_empire }
						top_liege = { has_landed_title = e_il-khanate }
						top_liege = { has_landed_title = e_golden_horde }
						top_liege = { has_landed_title = e_mongol_empire }
					}
				}
			}
		}		
	}
	
	major_trigger = {
		NOT = {
			has_landed_title = e_il-khanate
			has_landed_title = e_golden_horde
			has_landed_title = e_mongol_empire
			liege = { has_landed_title = e_il-khanate }
			liege = { has_landed_title = e_golden_horde }
			liege = { has_landed_title = e_mongol_empire }
			top_liege = { has_landed_title = e_il-khanate }
			top_liege = { has_landed_title = e_golden_horde }
			top_liege = { has_landed_title = e_mongol_empire }
		}
	}
	
	immediate = {
		set_global_flag = mongols_sack_jerusalem
		any_player = {
			limit = {
				OR = {
					has_landed_title = e_il-khanate
					has_landed_title = e_golden_horde
					has_landed_title = e_mongol_empire
					liege = { has_landed_title = e_il-khanate }
					liege = { has_landed_title = e_golden_horde }
					liege = { has_landed_title = e_mongol_empire }
					top_liege = { has_landed_title = e_il-khanate }
					top_liege = { has_landed_title = e_golden_horde }
					top_liege = { has_landed_title = e_mongol_empire }
				}
			}
			narrative_event = { id = TOG.19 }
		}
	}
	
	option = {
		name = "EVTOPTA60118"
		trigger = { religion_group = muslim }
	}
	option = {
		name = "EVTOPTB60118"
		trigger = { NOT = { religion_group = muslim } }
	}
}

# Mongols sack Alexandria
narrative_event = {
	id = 60119
	title = "EVTNAME60119"
	desc = "EVTDESC60119"
	major = yes
	
	picture = "GFX_evt_mongols"
	border = "GFX_event_narrative_frame_war"
	
	is_triggered_only = yes
	
	culture = mongol
	
	trigger = {
		FROM = { title = b_alexandria }
		NOT = { has_global_flag = mongols_sack_alexandria }
		OR = {
			has_landed_title = e_il-khanate
			has_landed_title = e_golden_horde
			has_landed_title = e_mongol_empire
			liege = { has_landed_title = e_il-khanate }
			liege = { has_landed_title = e_golden_horde }
			liege = { has_landed_title = e_mongol_empire }
			top_liege = { has_landed_title = e_il-khanate }
			top_liege = { has_landed_title = e_golden_horde }
			top_liege = { has_landed_title = e_mongol_empire }
		}
		
		NOT = {
			FROM = {
				owner = {
					OR = {
						has_landed_title = e_il-khanate
						has_landed_title = e_golden_horde
						has_landed_title = e_mongol_empire
						liege = { has_landed_title = e_il-khanate }
						liege = { has_landed_title = e_golden_horde }
						liege = { has_landed_title = e_mongol_empire }
						top_liege = { has_landed_title = e_il-khanate }
						top_liege = { has_landed_title = e_golden_horde }
						top_liege = { has_landed_title = e_mongol_empire }
					}
				}
			}
		}		
	}
	
	major_trigger = {
		NOT = {
			has_landed_title = e_il-khanate
			has_landed_title = e_golden_horde
			has_landed_title = e_mongol_empire
			liege = { has_landed_title = e_il-khanate }
			liege = { has_landed_title = e_golden_horde }
			liege = { has_landed_title = e_mongol_empire }
			top_liege = { has_landed_title = e_il-khanate }
			top_liege = { has_landed_title = e_golden_horde }
			top_liege = { has_landed_title = e_mongol_empire }
		}
	}
	
	immediate = {
		set_global_flag = mongols_sack_alexandria
		any_player = {
			limit = {
				OR = {
					has_landed_title = e_il-khanate
					has_landed_title = e_golden_horde
					has_landed_title = e_mongol_empire
					liege = { has_landed_title = e_il-khanate }
					liege = { has_landed_title = e_golden_horde }
					liege = { has_landed_title = e_mongol_empire }
					top_liege = { has_landed_title = e_il-khanate }
					top_liege = { has_landed_title = e_golden_horde }
					top_liege = { has_landed_title = e_mongol_empire }
				}
			}
			narrative_event = { id = TOG.20 }
		}
	}
	
	option = {
		name = "EVTOPTA60119"
		trigger = { religion_group = muslim }
	}
	option = {
		name = "EVTOPTB60119"
		trigger = { NOT = { religion_group = muslim } }
	}
}

# Mongols sack Cairo
narrative_event = {
	id = 60120
	title = "EVTNAME60120"
	desc = "EVTDESC60120"
	major = yes
	
	picture = "GFX_evt_mongols"
	border = "GFX_event_narrative_frame_war"
	
	is_triggered_only = yes
	
	culture = mongol
	
	trigger = {
		FROM = { title = b_cairo }
		NOT = { has_global_flag = mongols_sack_cairo }
		OR = {
			has_landed_title = e_il-khanate
			has_landed_title = e_golden_horde
			has_landed_title = e_mongol_empire
			liege = { has_landed_title = e_il-khanate }
			liege = { has_landed_title = e_golden_horde }
			liege = { has_landed_title = e_mongol_empire }
			top_liege = { has_landed_title = e_il-khanate }
			top_liege = { has_landed_title = e_golden_horde }
			top_liege = { has_landed_title = e_mongol_empire }
		}
		
		NOT = {
			FROM = {
				owner = {
					OR = {
						has_landed_title = e_il-khanate
						has_landed_title = e_golden_horde
						has_landed_title = e_mongol_empire
						liege = { has_landed_title = e_il-khanate }
						liege = { has_landed_title = e_golden_horde }
						liege = { has_landed_title = e_mongol_empire }
						top_liege = { has_landed_title = e_il-khanate }
						top_liege = { has_landed_title = e_golden_horde }
						top_liege = { has_landed_title = e_mongol_empire }
					}
				}
			}
		}		
	}
	
	major_trigger = {
		NOT = {
			has_landed_title = e_il-khanate
			has_landed_title = e_golden_horde
			has_landed_title = e_mongol_empire
			liege = { has_landed_title = e_il-khanate }
			liege = { has_landed_title = e_golden_horde }
			liege = { has_landed_title = e_mongol_empire }
			top_liege = { has_landed_title = e_il-khanate }
			top_liege = { has_landed_title = e_golden_horde }
			top_liege = { has_landed_title = e_mongol_empire }
		}
	}
	
	immediate = {
		set_global_flag = mongols_sack_cairo
		any_player = {
			limit = {
				OR = {
					has_landed_title = e_il-khanate
					has_landed_title = e_golden_horde
					has_landed_title = e_mongol_empire
					liege = { has_landed_title = e_il-khanate }
					liege = { has_landed_title = e_golden_horde }
					liege = { has_landed_title = e_mongol_empire }
					top_liege = { has_landed_title = e_il-khanate }
					top_liege = { has_landed_title = e_golden_horde }
					top_liege = { has_landed_title = e_mongol_empire }
				}
			}
			narrative_event = { id = TOG.21 }
		}
	}
	
	option = {
		name = "EVTOPTA60120"
		trigger = { religion_group = muslim }
	}
	option = {
		name = "EVTOPTB60120"
		trigger = { NOT = { religion_group = muslim } }
	}
}

# Mongols sack Mecca
narrative_event = {
	id = 60121
	title = "EVTNAME60121"
	desc = "EVTDESC60121"
	major = yes
	
	picture = "GFX_evt_mecca_falls_soa"
	border = "GFX_event_narrative_frame_war"
	
	is_triggered_only = yes
	
	culture = mongol
	
	trigger = {
		FROM = { title = b_mecca }
		NOT = { has_global_flag = mongols_sack_mecca }
		NOT = { religion_group = muslim }
		OR = {
			has_landed_title = e_il-khanate
			has_landed_title = e_golden_horde
			has_landed_title = e_mongol_empire
			liege = { has_landed_title = e_il-khanate }
			liege = { has_landed_title = e_golden_horde }
			liege = { has_landed_title = e_mongol_empire }
			top_liege = { has_landed_title = e_il-khanate }
			top_liege = { has_landed_title = e_golden_horde }
			top_liege = { has_landed_title = e_mongol_empire }
		}
		
		NOT = {
			FROM = {
				owner = {
					OR = {
						has_landed_title = e_il-khanate
						has_landed_title = e_golden_horde
						has_landed_title = e_mongol_empire
						liege = { has_landed_title = e_il-khanate }
						liege = { has_landed_title = e_golden_horde }
						liege = { has_landed_title = e_mongol_empire }
						top_liege = { has_landed_title = e_il-khanate }
						top_liege = { has_landed_title = e_golden_horde }
						top_liege = { has_landed_title = e_mongol_empire }
					}
				}
			}
		}		
	}
	
	major_trigger = {
		NOT = {
			has_landed_title = e_il-khanate
			has_landed_title = e_golden_horde
			has_landed_title = e_mongol_empire
			liege = { has_landed_title = e_il-khanate }
			liege = { has_landed_title = e_golden_horde }
			liege = { has_landed_title = e_mongol_empire }
			top_liege = { has_landed_title = e_il-khanate }
			top_liege = { has_landed_title = e_golden_horde }
			top_liege = { has_landed_title = e_mongol_empire }
		}
	}
	
	immediate = {
		set_global_flag = mongols_sack_mecca
		any_player = {
			limit = {
				OR = {
					has_landed_title = e_il-khanate
					has_landed_title = e_golden_horde
					has_landed_title = e_mongol_empire
					liege = { has_landed_title = e_il-khanate }
					liege = { has_landed_title = e_golden_horde }
					liege = { has_landed_title = e_mongol_empire }
					top_liege = { has_landed_title = e_il-khanate }
					top_liege = { has_landed_title = e_golden_horde }
					top_liege = { has_landed_title = e_mongol_empire }
				}
			}
			narrative_event = { id = TOG.22 }
		}
	}
	
	option = {
		name = "EVTOPTA60121"
		trigger = { religion_group = muslim }
	}
	option = {
		name = "EVTOPTB60121"
		trigger = { NOT = { religion_group = muslim } }
	}
}

##################################
# Rise of the Seljuks
##################################

# Seljuk distinguishes himself in a Turkish court
character_event = {
	id = 60200
	desc = EVTDESC60200
	
	picture = GFX_evt_mongols
	border = GFX_event_normal_frame_war
	
	only_playable = yes
	
	trigger = {
		is_landed = yes
		culture_group = altaic
		NOT = {
			has_game_rule = {
				name = turkic_invasions
				value = off
			}
		}
		OR = {
			AND = {
				NOT = {
					has_game_rule = {
						name = turkic_invasions
						value = random
					}
				}
				year = 965
				NOT = { year = 985 }
			}
			AND = {
				has_game_rule = {
					name = turkic_invasions
					value = random
				}
				year = 809
				NOT = { year = 1200 }
			}
		}
		
		higher_tier_than = count
		
		NOT = { has_global_flag = seljuk_spawned }
	}
	
	mean_time_to_happen = {
		months = 24
		modifier = {
			factor = 4.0
			NOT = { culture = turkish }
		}
	}
	
	immediate = {
		create_random_soldier = {
			random_traits = no
			dynasty = 613 # Seljuk
			name = Seljuk
			culture = turkish
			religion = sunni
			age = 18
			attributes = {
				martial = 8
				diplomacy = 4
				stewardship = 5
				intrigue = 4
				learning = 3
			}
			health = 9
			fertility = 0.8
			trait = brilliant_strategist
			trait = wroth
			trait = cruel
			trait = proud
			trait = zealous
			trait = ambitious
			trait = adventurer
		}
		new_character = {
			if = {
				limit = {
					has_dlc = "Holy Fury"
				}
				create_bloodline = {
					type = seljuk
				}
			}
			character_event = {
				id = 60201
				days = 1095
				random = 730
			}
			set_character_flag = seljuk_himself
			set_character_flag = do_not_disturb
		}
	}
	
	option = { # A most capable young man
		name = EVTOPTA60200
		
		set_global_flag = seljuk_spawned
		set_global_flag = seljuk_spawned_by_event
		
		tooltip = {
			create_random_soldier = {
				random_traits = no
				dynasty = 613 # Seljuk
				name = Seljuk
				culture = turkish
				religion = sunni
				age = 18
				attributes = {
					martial = 8
					diplomacy = 4
					stewardship = 5
					intrigue = 4
					learning = 3
				}
				health = 7
				fertility = 0.8
				trait = brilliant_strategist
				trait = wroth
				trait = cruel
				trait = proud
				trait = zealous
				trait = ambitious
			}
		}
	}
}

# Seljuk and his men consider starting an adventure
character_event = {
	id = 60201
	desc = EVTDESC60201
	
	picture = GFX_evt_mongols
	border = GFX_event_normal_frame_war
	
	is_triggered_only = yes
	
	prisoner = no
	only_capable = yes
	
	trigger = {
		is_alive = yes
		NOT = { trait = blinded }
		NOT = { trait = eunuch }
		NOT = { trait = infirm }
		lower_tier_than = king
		
		OR = {
			630 = { # Merv
				owner = {
					NOT = { same_realm = ROOT }
				}
			}
			631 = { # Dihistan
				owner = {
					NOT = { same_realm = ROOT }
				}
			}
			632 = { # Tus
				owner = {
					NOT = { same_realm = ROOT }
				}
			}
		}
	}
	
	option = { # Merv it is!
		name = EVTOPTA60201
		trigger = {
			630 = { # Merv
				owner = {
					NOT = { same_realm = ROOT }
				}
			}
		}
		
		ai_chance = {
			factor = 10000
		}
		
		630 = {
			province_event = {
				id = 60202
				days = 2
			}
		}
		
		clr_character_flag = do_not_disturb
	}
	option = { # Khorasan
		name = EVTOPTB60201
		trigger = {
			632 = { # Tus
				owner = {
					NOT = { same_realm = ROOT }
				}
			}
		}
		
		ai_chance = {
			factor = 1000
		}
		
		632 = {
			province_event = {
				id = 60202
				days = 2
			}
		}
		
		clr_character_flag = do_not_disturb
	}
	option = { # Dihistan
		name = EVTOPTC60201
		trigger = {
			631 = { # Dihistan
				owner = {
					NOT = { same_realm = ROOT }
				}
			}
		}
		
		ai_chance = {
			factor = 100
		}
		
		631 = {
			province_event = {
				id = 60202
				days = 2
			}
		}
		
		clr_character_flag = do_not_disturb
	}
}

# Ping the target province
province_event = {
	id = 60202
	hide_window = yes
	
	is_triggered_only = yes
	
	immediate = {
		if = {
			limit = {
				FROM = {
					is_ruler = yes
				}
			}
			FROM = {
				character_event = {
					id = 60204
				}
			}
		}
		if = {
			limit = {
				FROM = {
					is_ruler = no
				}
			}
			FROM = {
				character_event = {
					id = 60203
				}
			}
		}
	}
}

# The landless Seljuk and his men start an adventure
character_event = {
	id = 60203
	hide_window = yes
	
	is_triggered_only = yes
	
	prisoner = no
	only_capable = yes
	
	trigger = {
		is_alive = yes
		NOT = { trait = blinded }
		NOT = { trait = eunuch }
		NOT = { trait = infirm }
		lower_tier_than = king
	}
	
	immediate = {
		wealth = 500
		
		any_liege = {
			character_event = {
				id = 60205
				days = 1
			}
		}
		
		liege = {
			capital_scope = {
				FROM = {
					owner = {
						top_liege = {
							ROOT = {
								set_defacto_liege = ROOT
								create_title = {
									tier = DUKE
									landless = yes
									temporary = yes
									culture = ROOT
									name = "CLAIMANT_ADVENTURE"
									holder = ROOT
								}
								
								set_character_flag = duchy_adventurer
							
								spawn_unit = {
									province = PREVPREVPREVPREV
									troops =
									{
										light_cavalry = { 2750 2750 }
										horse_archers = { 2250 2250 }
										knights = { 500 500 }
									}
								}
								spawn_unit = {
									province = PREVPREVPREVPREV
									troops =
									{
										light_cavalry = { 2750 2750 }
										horse_archers = { 2250 2250 }
										knights = { 500 500 }
									}
								}
								spawn_unit = {
									province = PREVPREVPREVPREV
									troops =
									{
										light_cavalry = { 2750 2750 }
										horse_archers = { 2250 2250 }
										knights = { 500 500 }
									}
								}
								spawn_unit = {
									province = PREVPREVPREVPREV
									troops =
									{
										light_cavalry = { 2750 2750 }
										horse_archers = { 2250 2250 }
										knights = { 500 500 }
									}
								}
								spawn_unit = {
									province = PREVPREVPREVPREV
									troops =
									{
										light_cavalry = { 2750 2750 }
										horse_archers = { 2250 2250 }
										knights = { 500 500 }
									}
								}
								spawn_unit = {
									province = PREVPREVPREVPREV
									troops =
									{
										light_cavalry = { 2750 2750 }
										horse_archers = { 2250 2250 }
										knights = { 500 500 }
									}
								}
								spawn_unit = {
									province = PREVPREVPREVPREV
									troops =
									{
										light_cavalry = { 2750 2750 }
										horse_archers = { 2250 2250 }
										knights = { 500 500 }
									}
								}
								spawn_unit = {
									province = PREVPREVPREVPREV
									troops =
									{
										light_cavalry = { 2750 2750 }
										horse_archers = { 2250 2250 }
										knights = { 500 500 }
									}
								}
								spawn_unit = {
									province = PREVPREVPREVPREV
									troops =
									{
										light_cavalry = { 2750 2750 }
										horse_archers = { 2250 2250 }
										knights = { 500 500 }
									}
								}
								spawn_unit = {
									province = PREVPREVPREVPREV
									troops =
									{
										light_cavalry = { 2750 2750 }
										horse_archers = { 2250 2250 }
										knights = { 500 500 }
									}
								}
								spawn_unit = {
									province = PREVPREVPREVPREV
									troops =
									{
										light_cavalry = { 2750 2750 }
										horse_archers = { 2250 2250 }
										knights = { 500 500 }
									}
								}
								spawn_unit = {
									province = PREVPREVPREVPREV
									troops =
									{
										light_cavalry = { 2750 2750 }
										horse_archers = { 2250 2250 }
										knights = { 500 500 }
									}
								}
								war = {
									target = PREV
									casus_belli = duchy_adventure
									thirdparty_title = PREVPREVPREV
									tier = DUKE
								}
							}
						}
					}
				}
			}
		}
		
		if = {
			limit = {
				NOT = { religion_group = muslim }
			}
			religion = sunni
		}
		
		# Create some characters
		create_random_soldier = {
			random_traits = yes
			dynasty = none
			religion = sunni
			culture = turkish
			female = no
			age = 30
		}
		create_random_soldier = {
			random_traits = yes
			dynasty = none
			religion = sunni
			culture = turkish
			female = no
			age = 25
		}
		create_random_soldier = {
			random_traits = yes
			dynasty = none
			religion = sunni
			culture = turkish
			female = no
			age = 22
		}
		create_character = {
			random_traits = yes
			dynasty = none
			religion = sunni
			culture = turkish
			female = yes
			age = 16
		}
		create_character = {
			random_traits = yes
			dynasty = none
			religion = sunni
			culture = turkish
			female = yes
			age = 17
		}
		create_character = {
			random_traits = yes
			dynasty = none
			religion = sunni
			culture = turkish
			female = yes
			age = 18
		}
		
		log = "60203: Seljuk starts his first war as a landless character!"
	}
}

# The landed Seljuk and his men start an adventure
character_event = {
	id = 60204
	desc = EVTDESC60204
	
	picture = GFX_evt_mongols
	border = GFX_event_normal_frame_war
	
	is_triggered_only = yes
	
	prisoner = no
	only_capable = yes
	
	trigger = {
		is_alive = yes
		NOT = { trait = blinded }
		NOT = { trait = eunuch }
		NOT = { trait = infirm }
		lower_tier_than = king
	}
	
	immediate = {
		if = {
			limit = {
				tier = BARON
			}
			abdicate = yes
			character_event = { id = 60203 }
			break = yes
		}
		wealth = 500
		
		any_liege = {
			character_event = {
				id = 60205
				days = 1
			}
		}
		
		FROM = {
			owner = {
				top_liege = {
					ROOT = {
						capital_scope = {
							ROOT = {
								set_character_flag = duchy_adventurer
								spawn_unit = {
									province = PREV
									troops =
									{
										light_cavalry = { 2750 2750 }
										horse_archers = { 2250 2250 }
										knights = { 500 500 }
									}
								}
								spawn_unit = {
									province = PREV
									troops =
									{
										light_cavalry = { 2750 2750 }
										horse_archers = { 2250 2250 }
										knights = { 500 500 }
									}
								}
								spawn_unit = {
									province = PREV
									troops =
									{
										light_cavalry = { 2750 2750 }
										horse_archers = { 2250 2250 }
										knights = { 500 500 }
									}
								}
								spawn_unit = {
									province = PREV
									troops =
									{
										light_cavalry = { 2750 2750 }
										horse_archers = { 2250 2250 }
										knights = { 500 500 }
									}
								}
								spawn_unit = {
									province = PREV
									troops =
									{
										light_cavalry = { 2750 2750 }
										horse_archers = { 2250 2250 }
										knights = { 500 500 }
									}
								}
								spawn_unit = {
									province = PREV
									troops =
									{
										light_cavalry = { 2750 2750 }
										horse_archers = { 2250 2250 }
										knights = { 500 500 }
									}
								}
								spawn_unit = {
									province = PREV
									troops =
									{
										light_cavalry = { 2750 2750 }
										horse_archers = { 2250 2250 }
										knights = { 500 500 }
									}
								}
								spawn_unit = {
									province = PREV
									troops =
									{
										light_cavalry = { 2750 2750 }
										horse_archers = { 2250 2250 }
										knights = { 500 500 }
									}
								}
								spawn_unit = {
									province = PREV
									troops =
									{
										light_cavalry = { 2750 2750 }
										horse_archers = { 2250 2250 }
										knights = { 500 500 }
									}
								}
								spawn_unit = {
									province = PREV
									troops =
									{
										light_cavalry = { 2750 2750 }
										horse_archers = { 2250 2250 }
										knights = { 500 500 }
									}
								}
								spawn_unit = {
									province = PREV
									troops =
									{
										light_cavalry = { 2750 2750 }
										horse_archers = { 2250 2250 }
										knights = { 500 500 }
									}
								}
								spawn_unit = {
									province = PREV
									troops =
									{
										light_cavalry = { 2750 2750 }
										horse_archers = { 2250 2250 }
										knights = { 500 500 }
									}
								}
							}
						}
						
						war = {
							target = PREV
							casus_belli = duchy_adventure
							thirdparty_title = PREVPREVPREV
							tier = DUKE
						}
					}
				}
			}
		}
		
		if = {
			limit = {
				NOT = { religion_group = muslim }
			}
			religion = sunni
		}
		
		# Create some characters
		create_random_soldier = {
			random_traits = yes
			dynasty = none
			religion = sunni
			culture = turkish
			female = no
			age = 30
		}
		create_random_soldier = {
			random_traits = yes
			dynasty = none
			religion = sunni
			culture = turkish
			female = no
			age = 25
		}
		create_random_soldier = {
			random_traits = yes
			dynasty = none
			religion = sunni
			culture = turkish
			female = no
			age = 22
		}
		create_character = {
			random_traits = yes
			dynasty = none
			religion = sunni
			culture = turkish
			female = yes
			age = 16
		}
		create_character = {
			random_traits = yes
			dynasty = none
			religion = sunni
			culture = turkish
			female = yes
			age = 17
		}
		create_character = {
			random_traits = yes
			dynasty = none
			religion = sunni
			culture = turkish
			female = yes
			age = 18
		}
		
		log = "60204: Seljuk starts his first war as a landed character!"
	}
	
	option = {
		name = EVTOPTA60204
	}
}

# Notify Seljuk's old liege
character_event = {
	id = 60205
	desc = EVTDESC60205
	picture = GFX_evt_mongols
	border = GFX_event_normal_frame_war
	
	is_triggered_only = yes
	
	trigger = {
		FROM = { is_ruler = yes } # The DoW worked and the adventurer has a temporary title
	}
	
	option = {
		name = EVTOPTA60205
	}
}

# Seljuk is successful!
# Fired from the duchy_adventure CB
narrative_event = {
	id = 60206
	title = EVTNAME60206
	desc = EVTDESC60206
	picture = GFX_evt_mongols
	border = GFX_event_narrative_frame_war
	
	is_triggered_only = yes
	
	major = yes
	
	immediate = {
		if = {
			limit = {
				OR = {
					independent = yes
					liege = {
						ai = yes
					}
				}
			}
			set_defacto_liege = ROOT
			activate_title = { title = e_seljuk_turks status = yes }
			e_seljuk_turks = {
				grant_title = ROOT
			}
		}
		
		if = {
			limit = {
				uses_decadence = yes
			}
			decadence = -25
		}
		
		prestige = 1000
		
		#capital_scope = {
		#	ROOT = {
		#		spawn_unit = {
		#			province = PREV
		#			home = PREV
		#			owner = THIS
		#			troops = {
		#				light_infantry = { 2250 2250 }
		#				light_cavalry = { 2000 2000 }
		#				horse_archers = { 1500 1500 }
		#				knights = { 50 50 }
		#			}
		#		}
		#		spawn_unit = {
		#			province = PREV
		#			home = PREV
		#			owner = THIS
		#			troops = {
		#				light_infantry = { 2250 2250 }
		#				light_cavalry = { 2000 2000 }
		#				horse_archers = { 1500 1500 }
		#				knights = { 50 50 }
		#			}
		#		}
		#		spawn_unit = {
		#			province = PREV
		#			home = PREV
		#			owner = THIS
		#			troops = {
		#				light_infantry = { 2250 2250 }
		#				light_cavalry = { 2000 2000 }
		#				horse_archers = { 1500 1500 }
		#				knights = { 50 50 }
		#			}
		#		}
		#		spawn_unit = {
		#			province = PREV
		#			home = PREV
		#			owner = THIS
		#			troops = {
		#				light_infantry = { 2250 2250 }
		#				light_cavalry = { 2000 2000 }
		#				horse_archers = { 1500 1500 }
		#				knights = { 50 50 }
		#			}
		#		}
		#		spawn_unit = {
		#			province = PREV
		#			home = PREV
		#			owner = THIS
		#			troops = {
		#				light_infantry = { 2250 2250 }
		#				light_cavalry = { 2000 2000 }
		#				horse_archers = { 1500 1500 }
		#				knights = { 50 50 }
		#			}
		#		}
		#		spawn_unit = {
		#			province = PREV
		#			home = PREV
		#			owner = THIS
		#			troops = {
		#				light_infantry = { 2250 2250 }
		#				light_cavalry = { 2000 2000 }
		#				horse_archers = { 1500 1500 }
		#				knights = { 50 50 }
		#			}
		#		}
		#	}
		#}
		
		log = "60206: Seljuk wins his first war!"
	}
	
	option = {
		name = EVTOPTA60206
		trigger = {
			has_character_flag = seljuk_himself
		}
	}
	option = {
		name = EVTOPTB60206
		trigger = {
			NOT = { has_character_flag = seljuk_himself }
			culture_group = altaic
		}
	}
	option = {
		name = EVTOPTC60206
		trigger = {
			NOT = { has_character_flag = seljuk_himself }
			NOT = { culture_group = altaic }
		}
	}
}

# Seljuk's successor revitalizes the new state
character_event = {
	id = 60207
	desc = EVTDESC60207
	
	picture = GFX_evt_mongols
	border = GFX_event_normal_frame_war
	
	only_playable = yes
	only_independent = yes
	has_global_flag = seljuk_spawned_by_event
	
	trigger = {
		year = 980
		NOT = { year = 1100 }
		uses_decadence = yes
		
		dynasty = 613 # Seljuk
		
		higher_tier_than = duke
		
		martial = 7
		
		NOT = { has_character_flag = seljuk_himself }
		NOT = { has_character_flag = seljuk_reinforcements }
	}
	
	mean_time_to_happen = {
		months = 240
		modifier = {
			factor = 0.5
			martial = 9
		}
		modifier = {
			factor = 0.5
			martial = 11
		}
		modifier = {
			factor = 0.5
			martial = 13
		}
	}
	
	immediate = {
		set_character_flag = seljuk_reinforcements
		
		decadence = -75
		
		capital_scope = {
			ROOT = {
				spawn_unit = {
					province = PREV
					home = PREV
					owner = THIS
					troops = {
						light_infantry = { 2250 2250 }
						light_cavalry = { 2000 2000 }
						horse_archers = { 1500 1500 }
						knights = { 50 50 }
					}
				}
				spawn_unit = {
					province = PREV
					home = PREV
					owner = THIS
					troops = {
						light_infantry = { 2250 2250 }
						light_cavalry = { 2000 2000 }
						horse_archers = { 1500 1500 }
						knights = { 50 50 }
					}
				}
				spawn_unit = {
					province = PREV
					home = PREV
					owner = THIS
					troops = {
						light_infantry = { 2250 2250 }
						light_cavalry = { 2000 2000 }
						horse_archers = { 1500 1500 }
						knights = { 50 50 }
					}
				}
				spawn_unit = {
					province = PREV
					home = PREV
					owner = THIS
					troops = {
						light_infantry = { 2250 2250 }
						light_cavalry = { 2000 2000 }
						horse_archers = { 1500 1500 }
						knights = { 50 50 }
					}
				}
				if = {
					limit = {
						martial = 9
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = THIS
						troops = {
							light_infantry = { 2250 2250 }
							light_cavalry = { 2000 2000 }
							horse_archers = { 1500 1500 }
							knights = { 50 50 }
						}
					}
				}
				if = {
					limit = {
						martial = 11
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = THIS
						troops = {
							light_infantry = { 2250 2250 }
							light_cavalry = { 2000 2000 }
							horse_archers = { 1500 1500 }
							knights = { 50 50 }
						}
					}
				}
				if = {
					limit = {
						martial = 13
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = THIS
						troops = {
							light_infantry = { 2250 2250 }
							light_cavalry = { 2000 2000 }
							horse_archers = { 1500 1500 }
							knights = { 50 50 }
						}
					}
				}
			}
		}
	}
	
	option = {
		name = EVTOPTA60207
	}
}

##################################
# Rise of the Timurids
##################################

# Timur distinguishes himself at a Mongol court
character_event = {
	id = 60300
	desc = EVTDESC60300
	
	picture = GFX_evt_mongols
	border = GFX_event_normal_frame_war
	
	only_playable = yes
	culture_group = altaic
	
	trigger = {
		NOT = {
			has_game_rule = {
				name = turkic_invasions
				value = off
			}
		}
		OR = {
			AND = {
				has_game_rule = {
					name = turkic_invasions
					value = historical
				}
				has_global_flag = mongol_empire_arrival
				has_global_flag = mongol_horde_arrival
				year = 1350
				NOT = { year = 1370 }
			}
			AND = {
				has_game_rule = {
					name = turkic_invasions
					value = random
				}
				year = 1200
			}
		}
		
		culture = mongol
		higher_tier_than = count
		
		NOT = { has_global_flag = timur_spawned }
		
		any_realm_province = {
			region = world_persia
		}
	}
	
	mean_time_to_happen = {
		months = 24
	}
	
	immediate = {
		create_character = {
			random_traits = no
			name = "Timur"
			dynasty = 800
			religion = ROOT
			culture = ROOT
			female = no
			age = 18
			attributes = {
				martial = 12
				diplomacy = 8
				stewardship = 9
				intrigue = 9
				learning = 6
			}
			health = 6
			fertility = 0.8
			trait = brilliant_strategist
			trait = diligent
			trait = ambitious
			trait = proud
			trait = quick
			trait = clubfooted
			trait = adventurer
		}
		
		new_character = {
			set_character_flag = timur_himself
			if = {
				limit = {
					has_dlc = "Holy Fury"
				}
				create_bloodline = {
					type = timur
				}
			}
			character_event = {
				id = 60301
				days = 1095
				random = 730
			}
		}
	}
	
	option = { # A most capable young man
		name = EVTOPTA60300
		
		set_global_flag = timur_spawned
		set_global_flag = timur_spawned_by_event
		
		tooltip = {
			create_character = {
				random_traits = no
				name = "Timur"
				dynasty = 800
				religion = ROOT
				culture = ROOT
				female = no
				age = 18
				attributes = {
					martial = 12
					diplomacy = 8
					stewardship = 9
					intrigue = 9
					learning = 6
				}
				health = 6
				fertility = 0.8
				trait = brilliant_strategist
				trait = diligent
				trait = ambitious
				trait = proud
				trait = quick
				trait = clubfooted
			}
		}
	}
}

# Timur and his men consider starting an adventure
character_event = {
	id = 60301
	desc = EVTDESC60201
	
	picture = GFX_evt_mongols
	border = GFX_event_normal_frame_war
	
	is_triggered_only = yes
	
	prisoner = no
	only_capable = yes
	
	trigger = {
		is_alive = yes
		NOT = { trait = blinded }
		NOT = { trait = eunuch }
		NOT = { trait = infirm }
		lower_tier_than = king
		
		OR = {
			903 = { # Samarkand
				owner = {
					NOT = { same_realm = ROOT }
				}
			}
			904 = { # Balkh
				owner = {
					NOT = { same_realm = ROOT }
				}
			}
			630 = { # Merv
				owner = {
					NOT = { same_realm = ROOT }
				}
			}
			631 = { # Dihistan
				owner = {
					NOT = { same_realm = ROOT }
				}
			}
			632 = { # Tus
				owner = {
					NOT = { same_realm = ROOT }
				}
			}
		}
	}
	
	option = { # Merv it is!
		name = EVTOPTA60201
		trigger = {
			630 = { # Merv
				owner = {
					NOT = { same_realm = ROOT }
				}
			}
		}
		
		ai_chance = {
			factor = 10000
		}
		
		630 = {
			province_event = {
				id = 60302
				days = 2
			}
		}
	}
	option = { # Khorasan
		name = EVTOPTB60201
		trigger = {
			632 = { # Tus
				owner = {
					NOT = { same_realm = ROOT }
				}
			}
		}
		
		ai_chance = {
			factor = 1000
		}
		
		632 = {
			province_event = {
				id = 60302
				days = 2
			}
		}
	}
	option = { # Dihistan
		name = EVTOPTC60201
		trigger = {
			631 = { # Dihistan
				owner = {
					NOT = { same_realm = ROOT }
				}
			}
		}
		
		ai_chance = {
			factor = 100
		}
		
		631 = {
			province_event = {
				id = 60302
				days = 2
			}
		}
	}
	option = { # Samarkand
		name = EVTOPTD60201
		trigger = {
			903 = { # Samarkand
				owner = {
					NOT = { same_realm = ROOT }
				}
			}
		}
		
		ai_chance = {
			factor = 100
		}
		
		903 = {
			province_event = {
				id = 60302
				days = 2
			}
		}
	}
	option = { # Balkh
		name = EVTOPTE60201
		trigger = {
			904 = { # Balkh
				owner = {
					NOT = { same_realm = ROOT }
				}
			}
		}
		
		ai_chance = {
			factor = 100
		}
		
		904 = {
			province_event = {
				id = 60302
				days = 2
			}
		}
	}
}

# Ping the target province
province_event = {
	id = 60302
	hide_window = yes
	
	is_triggered_only = yes
	
	immediate = {
		if = {
			limit = {
				FROM = {
					is_ruler = yes
				}
			}
			FROM = {
				character_event = {
					id = 60304
				}
			}
		}
		if = {
			limit = {
				FROM = {
					is_ruler = no
				}
			}
			FROM = {
				character_event = {
					id = 60303
				}
			}
		}
	}
}

# The landless Timur and his men start an adventure
character_event = {
	id = 60303
	hide_window = yes
	
	is_triggered_only = yes
	
	prisoner = no
	only_capable = yes
	
	trigger = {
		is_alive = yes
		NOT = { trait = blinded }
		NOT = { trait = eunuch }
		NOT = { trait = infirm }
		lower_tier_than = king
	}
	
	immediate = {
		wealth = 500
		
		any_liege = {
			character_event = {
				id = 60305
				days = 1
			}
		}
		
		liege = {
			capital_scope = {
				FROM = {
					owner = {
						top_liege = {
							ROOT = {
								set_defacto_liege = ROOT
								create_title = {
									tier = DUKE
									landless = yes
									temporary = yes
									culture = ROOT
									name = "CLAIMANT_ADVENTURE"
									holder = ROOT
								}
								
								set_character_flag = duchy_adventurer
							
								spawn_unit = {
									province = PREVPREVPREVPREV
									troops =
									{
										light_cavalry = { 2750 2750 }
										horse_archers = { 2250 2250 }
										knights = { 500 500 }
									}
								}
								spawn_unit = {
									province = PREVPREVPREVPREV
									troops =
									{
										light_cavalry = { 2750 2750 }
										horse_archers = { 2250 2250 }
										knights = { 500 500 }
									}
								}
								spawn_unit = {
									province = PREVPREVPREVPREV
									troops =
									{
										light_cavalry = { 2750 2750 }
										horse_archers = { 2250 2250 }
										knights = { 500 500 }
									}
								}
								spawn_unit = {
									province = PREVPREVPREVPREV
									troops =
									{
										light_cavalry = { 2750 2750 }
										horse_archers = { 2250 2250 }
										knights = { 500 500 }
									}
								}
								spawn_unit = {
									province = PREVPREVPREVPREV
									troops =
									{
										light_cavalry = { 2750 2750 }
										horse_archers = { 2250 2250 }
										knights = { 500 500 }
									}
								}
								spawn_unit = {
									province = PREVPREVPREVPREV
									troops =
									{
										light_cavalry = { 2750 2750 }
										horse_archers = { 2250 2250 }
										knights = { 500 500 }
									}
								}
								spawn_unit = {
									province = PREVPREVPREVPREV
									troops =
									{
										light_cavalry = { 2750 2750 }
										horse_archers = { 2250 2250 }
										knights = { 500 500 }
									}
								}
								spawn_unit = {
									province = PREVPREVPREVPREV
									troops =
									{
										light_cavalry = { 2750 2750 }
										horse_archers = { 2250 2250 }
										knights = { 500 500 }
									}
								}
								spawn_unit = {
									province = PREVPREVPREVPREV
									troops =
									{
										light_cavalry = { 2750 2750 }
										horse_archers = { 2250 2250 }
										knights = { 500 500 }
									}
								}
								spawn_unit = {
									province = PREVPREVPREVPREV
									troops =
									{
										light_cavalry = { 2750 2750 }
										horse_archers = { 2250 2250 }
										knights = { 500 500 }
									}
								}
								spawn_unit = {
									province = PREVPREVPREVPREV
									troops =
									{
										light_cavalry = { 2750 2750 }
										horse_archers = { 2250 2250 }
										knights = { 500 500 }
									}
								}
								war = {
									target = PREV
									casus_belli = duchy_adventure
									thirdparty_title = PREVPREVPREV
									tier = DUKE
								}
							}
						}
					}
				}
			}
		}
		
		# Create some characters
		create_character = {
			random_traits = yes
			dynasty = none
			religion = ROOT
			culture = ROOT
			female = no
			age = 28
			attributes = {
				martial = 12
			}
			trait = brilliant_strategist
		}
		create_character = {
			random_traits = yes
			dynasty = none
			religion = ROOT
			culture = ROOT
			female = no
			age = 24
			attributes = {
				martial = 12
			}
			trait = brilliant_strategist
		}
		create_character = {
			random_traits = yes
			dynasty = none
			religion = ROOT
			culture = ROOT
			female = no
			age = 23
			attributes = {
				martial = 12
			}
			trait = brilliant_strategist
		}
		create_character = {
			random_traits = yes
			dynasty = none
			religion = ROOT
			culture = ROOT
			female = no
			age = 30
			attributes = {
				martial = 12
			}
			trait = brilliant_strategist
		}
		create_character = {
			random_traits = yes
			dynasty = none
			religion = ROOT
			culture = ROOT
			female = no
			age = 30
			attributes = {
				martial = 12
			}
			trait = brilliant_strategist
		}
		create_character = {
			random_traits = yes
			dynasty = none
			religion = ROOT
			culture = ROOT
			female = yes
			age = 16
		}
		create_character = {
			random_traits = yes
			dynasty = none
			religion = ROOT
			culture = ROOT
			female = yes
			age = 17
		}
		create_character = {
			random_traits = yes
			dynasty = none
			religion = ROOT
			culture = ROOT
			female = yes
			age = 18
		}
		
		log = "60303: Timur starts his first war (landless)!"
	}
}

# The landed Timur and his men start an adventure
character_event = {
	id = 60304
	desc = EVTDESC60304
	
	picture = GFX_evt_mongols
	border = GFX_event_normal_frame_war
	
	is_triggered_only = yes
	
	prisoner = no
	only_capable = yes
	
	trigger = {
		is_alive = yes
		NOT = { trait = blinded }
		NOT = { trait = eunuch }
		NOT = { trait = infirm }
		lower_tier_than = king
	}
	
	immediate = {
		if = {
			limit = {
				tier = BARON
			}
			abdicate = yes
			character_event = { id = 60303 }
			break = yes
		}
		wealth = 500
		
		any_liege = {
			character_event = {
				id = 60305
				days = 1
			}
		}
		
		FROM = {
			owner = {
				top_liege = {
					ROOT = {
						capital_scope = {
							ROOT = {
								set_character_flag = duchy_adventurer
								spawn_unit = {
									province = PREVPREVPREVPREV
									troops =
									{
										light_cavalry = { 2750 2750 }
										horse_archers = { 2250 2250 }
										knights = { 500 500 }
									}
								}
								spawn_unit = {
									province = PREVPREVPREVPREV
									troops =
									{
										light_cavalry = { 2750 2750 }
										horse_archers = { 2250 2250 }
										knights = { 500 500 }
									}
								}
								spawn_unit = {
									province = PREVPREVPREVPREV
									troops =
									{
										light_cavalry = { 2750 2750 }
										horse_archers = { 2250 2250 }
										knights = { 500 500 }
									}
								}
								spawn_unit = {
									province = PREVPREVPREVPREV
									troops =
									{
										light_cavalry = { 2750 2750 }
										horse_archers = { 2250 2250 }
										knights = { 500 500 }
									}
								}
								spawn_unit = {
									province = PREVPREVPREVPREV
									troops =
									{
										light_cavalry = { 2750 2750 }
										horse_archers = { 2250 2250 }
										knights = { 500 500 }
									}
								}
								spawn_unit = {
									province = PREVPREVPREVPREV
									troops =
									{
										light_cavalry = { 2750 2750 }
										horse_archers = { 2250 2250 }
										knights = { 500 500 }
									}
								}
								spawn_unit = {
									province = PREVPREVPREVPREV
									troops =
									{
										light_cavalry = { 2750 2750 }
										horse_archers = { 2250 2250 }
										knights = { 500 500 }
									}
								}
								spawn_unit = {
									province = PREVPREVPREVPREV
									troops =
									{
										light_cavalry = { 2750 2750 }
										horse_archers = { 2250 2250 }
										knights = { 500 500 }
									}
								}
								spawn_unit = {
									province = PREVPREVPREVPREV
									troops =
									{
										light_cavalry = { 2750 2750 }
										horse_archers = { 2250 2250 }
										knights = { 500 500 }
									}
								}
								spawn_unit = {
									province = PREVPREVPREVPREV
									troops =
									{
										light_cavalry = { 2750 2750 }
										horse_archers = { 2250 2250 }
										knights = { 500 500 }
									}
								}
								spawn_unit = {
									province = PREVPREVPREVPREV
									troops =
									{
										light_cavalry = { 2750 2750 }
										horse_archers = { 2250 2250 }
										knights = { 500 500 }
									}
								}
							}
						}
						
						war = {
							target = PREV
							casus_belli = duchy_adventure
							thirdparty_title = PREVPREVPREV
							tier = DUKE
						}
					}
				}
			}
		}
		
		# Create some characters
		create_character = {
			random_traits = yes
			dynasty = none
			religion = ROOT
			culture = ROOT
			female = no
			age = 28
			attributes = {
				martial = 12
			}
			trait = brilliant_strategist
		}
		create_character = {
			random_traits = yes
			dynasty = none
			religion = ROOT
			culture = ROOT
			female = no
			age = 24
			attributes = {
				martial = 12
			}
			trait = brilliant_strategist
		}
		create_character = {
			random_traits = yes
			dynasty = none
			religion = ROOT
			culture = ROOT
			female = no
			age = 23
			attributes = {
				martial = 12
			}
			trait = brilliant_strategist
		}
		create_character = {
			random_traits = yes
			dynasty = none
			religion = ROOT
			culture = ROOT
			female = no
			age = 30
			attributes = {
				martial = 12
			}
			trait = brilliant_strategist
		}
		create_character = {
			random_traits = yes
			dynasty = none
			religion = ROOT
			culture = ROOT
			female = no
			age = 30
			attributes = {
				martial = 12
			}
			trait = brilliant_strategist
		}
		
		create_character = {
			random_traits = yes
			dynasty = none
			religion = ROOT
			culture = ROOT
			female = yes
			age = 16
		}
		create_character = {
			random_traits = yes
			dynasty = none
			religion = ROOT
			culture = ROOT
			female = yes
			age = 17
		}
		create_character = {
			random_traits = yes
			dynasty = none
			religion = ROOT
			culture = ROOT
			female = yes
			age = 18
		}
		
		log = "60303: Timur starts his first war (landed)!"
	}
	
	option = {
		name = EVTOPTA60204
	}
}

# Notify Timur's old liege
character_event = {
	id = 60305
	desc = EVTDESC60205
	picture = GFX_evt_mongols
	border = GFX_event_normal_frame_war
	
	is_triggered_only = yes
	
	trigger = {
		FROM = { is_ruler = yes } # The DoW worked and the adventurer has a temporary title
	}
	
	option = {
		name = EVTOPTA60305
	}
}

# Timur is successful!
# Fired from the duchy_adventure CB
narrative_event = {
	id = 60306
	title = EVTNAME60306
	desc = EVTDESC60306
	picture = GFX_evt_mongols
	border = GFX_event_narrative_frame_war
	
	is_triggered_only = yes
	
	major = yes
	
	immediate = {
		if = {
			limit = {
				OR = {
					independent = yes
					liege = {
						ai = yes
					}
				}
			}
			set_defacto_liege = ROOT
			activate_title = { title = e_timurids status = yes }
			e_timurids = {
				grant_title = ROOT
			}
		}
		
		prestige = 1000
		
		if = {
			limit = {
				uses_decadence = yes
			}
			decadence = -25
		}
		
		capital_scope = {
			ROOT = {
				spawn_unit = {
					province = PREV
					troops =
					{
						light_cavalry = { 2750 2750 }
						horse_archers = { 2250 2250 }
						knights = { 500 500 }
					}
				}
				spawn_unit = {
					province = PREV
					troops =
					{
						light_cavalry = { 2750 2750 }
						horse_archers = { 2250 2250 }
						knights = { 500 500 }
					}
				}
				spawn_unit = {
					province = PREV
					troops =
					{
						light_cavalry = { 2750 2750 }
						horse_archers = { 2250 2250 }
						knights = { 500 500 }
					}
				}
				spawn_unit = {
					province = PREV
					troops =
					{
						light_cavalry = { 2750 2750 }
						horse_archers = { 2250 2250 }
						knights = { 500 500 }
					}
				}
				spawn_unit = {
					province = PREV
					troops =
					{
						light_cavalry = { 2750 2750 }
						horse_archers = { 2250 2250 }
						knights = { 500 500 }
					}
				}
				spawn_unit = {
					province = PREV
					troops =
					{
						light_cavalry = { 2750 2750 }
						horse_archers = { 2250 2250 }
						knights = { 500 500 }
					}
				}
				spawn_unit = {
					province = PREV
					troops =
					{
						light_cavalry = { 2750 2750 }
						horse_archers = { 2250 2250 }
						knights = { 500 500 }
					}
				}
				spawn_unit = {
					province = PREV
					troops =
					{
						light_cavalry = { 2750 2750 }
						horse_archers = { 2250 2250 }
						knights = { 500 500 }
					}
				}
				
				random = {
					chance = 50
						spawn_unit = {
						province = PREV
						troops =
						{
							light_cavalry = { 2750 2750 }
							horse_archers = { 2250 2250 }
							knights = { 500 500 }
						}
					}
				}
				random = {
					chance = 50
					spawn_unit = {
					province = PREV
					troops =
					{
						light_cavalry = { 2750 2750 }
						horse_archers = { 2250 2250 }
						knights = { 500 500 }
					}
				}
				}
				random = {
					chance = 50
					spawn_unit = {
						province = PREV
						troops =
						{
							light_cavalry = { 2750 2750 }
							horse_archers = { 2250 2250 }
							knights = { 500 500 }
						}
					}
				}
				random = {
					chance = 50
					spawn_unit = {
						province = PREV
						troops =
						{
							light_cavalry = { 2750 2750 }
							horse_archers = { 2250 2250 }
							knights = { 500 500 }
						}
					}
				}
				random = {
					chance = 50
					spawn_unit = {
						province = PREV
						troops =
						{
							light_cavalry = { 2750 2750 }
							horse_archers = { 2250 2250 }
							knights = { 500 500 }
						}
					}
				}
				random = {
					chance = 50
					spawn_unit = {
						province = PREV
						troops =
						{
							light_cavalry = { 2750 2750 }
							horse_archers = { 2250 2250 }
							knights = { 500 500 }
						}
					}
				}
			}
		}
		
		log = "60306: Timur wins his first war!"
	}
	
	option = {
		name = EVTOPTA60306
		trigger = {
			has_character_flag = timur_himself
		}
	}
	option = {
		name = EVTOPTB60306
		trigger = {
			NOT = { has_character_flag = timur_himself }
			culture = mongol
		}
	}
	option = {
		name = EVTOPTC60306
		trigger = {
			NOT = { has_character_flag = timur_himself }
			NOT = { culture = mongol }
		}
	}
}

# Timur's successors revitalize the state
character_event = {
	id = 60307
	desc = EVTDESC60307
	
	picture = GFX_evt_mongols
	border = GFX_event_normal_frame_war
	
	only_playable = yes
	only_independent = yes
	has_global_flag = timur_spawned_by_event
	
	trigger = {
		year = 1370
		NOT = { year = 1500 }
		
		dynasty = 800 # Timurid
		
		higher_tier_than = duke
		
		martial = 7
		
		NOT = { has_character_flag = timur_himself }
		NOT = { has_character_flag = timur_reinforcements }
	}
	
	mean_time_to_happen = {
		months = 360
		modifier = {
			factor = 0.5
			martial = 9
		}
		modifier = {
			factor = 0.5
			martial = 11
		}
		modifier = {
			factor = 0.5
			martial = 13
		}
	}
	
	immediate = {
		set_character_flag = timur_reinforcements
		
		if = {
			limit = {
				uses_decadence = yes
			}
			decadence = -75
		}
		
		capital_scope = { 
			ROOT = {
				spawn_unit = {
					province = PREV
					home = PREV
					owner = THIS
					troops = {
						light_infantry = { 2250 2250 }
						light_cavalry = { 2000 2000 }
						horse_archers = { 1500 1500 }
						knights = { 50 50 }
					}
				}
				spawn_unit = {
					province = PREV
					home = PREV
					owner = THIS
					troops = {
						light_infantry = { 2250 2250 }
						light_cavalry = { 2000 2000 }
						horse_archers = { 1500 1500 }
						knights = { 50 50 }
					}
				}
				spawn_unit = {
					province = PREV
					home = PREV
					owner = THIS
					troops = {
						light_infantry = { 2250 2250 }
						light_cavalry = { 2000 2000 }
						horse_archers = { 1500 1500 }
						knights = { 50 50 }
					}
				}
				spawn_unit = {
					province = PREV
					home = PREV
					owner = THIS
					troops = {
						light_infantry = { 2250 2250 }
						light_cavalry = { 2000 2000 }
						horse_archers = { 1500 1500 }
						knights = { 50 50 }
					}
				}
				spawn_unit = {
					province = PREV
					home = PREV
					owner = THIS
					troops = {
						light_infantry = { 2250 2250 }
						light_cavalry = { 2000 2000 }
						horse_archers = { 1500 1500 }
						knights = { 50 50 }
					}
				}
				spawn_unit = {
					province = PREV
					home = PREV
					owner = THIS
					troops = {
						light_infantry = { 2250 2250 }
						light_cavalry = { 2000 2000 }
						horse_archers = { 1500 1500 }
						knights = { 50 50 }
					}
				}
				spawn_unit = {
					province = PREV
					home = PREV
					owner = THIS
					troops = {
						light_infantry = { 2250 2250 }
						light_cavalry = { 2000 2000 }
						horse_archers = { 1500 1500 }
						knights = { 50 50 }
					}
				}
				if = {
					limit = {
						martial = 9
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = THIS
						troops = {
							light_infantry = { 2250 2250 }
							light_cavalry = { 2000 2000 }
							horse_archers = { 1500 1500 }
							knights = { 50 50 }
						}
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = THIS
						troops = {
							light_infantry = { 2250 2250 }
							light_cavalry = { 2000 2000 }
							horse_archers = { 1500 1500 }
							knights = { 50 50 }
						}
					}
				}
				if = {
					limit = {
						martial = 11
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = THIS
						troops = {
							light_infantry = { 2250 2250 }
							light_cavalry = { 2000 2000 }
							horse_archers = { 1500 1500 }
							knights = { 50 50 }
						}
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = THIS
						troops = {
							light_infantry = { 2250 2250 }
							light_cavalry = { 2000 2000 }
							horse_archers = { 1500 1500 }
							knights = { 50 50 }
						}
					}
				}
				if = {
					limit = {
						martial = 13
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = THIS
						troops = {
							light_infantry = { 2250 2250 }
							light_cavalry = { 2000 2000 }
							horse_archers = { 1500 1500 }
							knights = { 50 50 }
						}
					}
					spawn_unit = {
						province = PREV
						home = PREV
						owner = THIS
						troops = {
							light_infantry = { 2250 2250 }
							light_cavalry = { 2000 2000 }
							horse_archers = { 1500 1500 }
							knights = { 50 50 }
						}
					}
				}
			}
		}
	}
	
	option = {
		name = EVTOPTA60307
	}
}


##########################################
# Rise of the Ghaznavids under Sabuktigin
##########################################

# Sabuktigin distinguishes himself at a Mongol court
character_event = {
	id = 60400
	desc = EVTDESC60400
	
	picture = GFX_evt_mongols
	border = GFX_event_normal_frame_war
	
	only_playable = yes
	religion_group = muslim
	
	trigger = {
		NOT = {
			has_game_rule = {
				name = turkic_invasions
				value = off
			}
		}
		OR = {
			AND = {
				has_game_rule = {
					name = turkic_invasions
					value = historical
				}
				year = 965
				NOT = { year = 1010 }
			}
			AND = {
				has_game_rule = {
					name = turkic_invasions
					value = random
				}
				year = 809
				NOT = { year = 1200 }
			}
		}
		
		higher_tier_than = count
		
		NOT = { has_global_flag = sabuktigin_spawned }
		
		OR = {
			1182 = { # Ghazna
				owner = {
					same_realm = ROOT
				}
			}
			1183 = { # Bost
				owner = {
					same_realm = ROOT
				}
			}
			907 = { # Mandesh
				owner = {
					same_realm = ROOT
				}
			}
		}
	}
	
	mean_time_to_happen = {
		months = 24
	}
	
	immediate = {
		create_character = {
			random_traits = no
			name = "Sabuktigin"
			dynasty = 790
			religion = ROOT
			culture = ROOT
			female = no
			age = 18
			attributes = {
				martial = 12
				diplomacy = 8
				stewardship = 9
				intrigue = 9
				learning = 6
			}
			health = 6
			fertility = 0.8
			trait = brilliant_strategist
			trait = diligent
			trait = ambitious
			trait = proud
			trait = quick
			trait = adventurer
		}
		
		new_character = {
			set_character_flag = sabuktigin_himself
			if = {
				limit = {
					has_dlc = "Holy Fury"
				}
				create_bloodline = {
					type = ghaznavid
				}
			}
			character_event = {
				id = 60401
				days = 1095
				random = 730
			}
		}
	}
	
	option = { # A most capable young man
		name = EVTOPTA60300
		
		set_global_flag = sabuktigin_spawned
		set_global_flag = sabuktigin_spawned_by_event
		
		tooltip = {
			create_character = {
				random_traits = no
				name = "Sabuktigin"
				dynasty = 790
				religion = ROOT
				culture = ROOT
				female = no
				age = 18
				attributes = {
					martial = 12
					diplomacy = 8
					stewardship = 9
					intrigue = 9
					learning = 6
				}
				health = 6
				fertility = 0.8
				trait = brilliant_strategist
				trait = diligent
				trait = ambitious
				trait = proud
				trait = quick
			}
		}
	}
}

# Sabuktigin and his men consider starting an adventure
character_event = {
	id = 60401
	desc = EVTDESC60201
	
	picture = GFX_evt_mongols
	border = GFX_event_normal_frame_war
	
	is_triggered_only = yes
	
	prisoner = no
	only_capable = yes
	
	trigger = {
		is_alive = yes
		NOT = { trait = blinded }
		NOT = { trait = eunuch }
		NOT = { trait = infirm }
		lower_tier_than = king
		
		OR = {
			1341 = { # Nandana in Gandhara
				owner = {
					NOT = { same_realm = ROOT }
				}
			}
			1338 = { # Multan
				owner = {
					NOT = { same_realm = ROOT }
				}
			}
			1362 = { # Lahore
				owner = {
					NOT = { same_realm = ROOT }
				}
			}
			1138 = { # Bhakkar
				owner = {
					NOT = { same_realm = ROOT }
				}
			}
		}
	}
	
	option = { # Gandhara it is!
		name = EVTOPTA60401
		trigger = {
			1341 = { # Nandana
				owner = {
					NOT = { same_realm = ROOT }
				}
			}
		}
		
		ai_chance = {
			factor = 10000
		}
		
		1341 = {
			province_event = {
				id = 60402
				days = 2
			}
		}
	}
	option = { # Multan
		name = EVTOPTB60401
		trigger = {
			1338 = { # Multan
				owner = {
					NOT = { same_realm = ROOT }
				}
			}
		}
		
		ai_chance = {
			factor = 1000
		}
		
		1338 = {
			province_event = {
				id = 60402
				days = 2
			}
		}
	}
	option = { # Lahore
		name = EVTOPTC60401
		trigger = {
			1362 = { # Lahore
				owner = {
					NOT = { same_realm = ROOT }
				}
			}
		}
		
		ai_chance = {
			factor = 100
		}
		
		1362 = {
			province_event = {
				id = 60402
				days = 2
			}
		}
	}
	option = { # Bhakkar
		name = EVTOPTD60401
		trigger = {
			1138 = { # Bhakkar
				owner = {
					NOT = { same_realm = ROOT }
				}
			}
		}
		
		ai_chance = {
			factor = 100
		}
		
		1138 = {
			province_event = {
				id = 60402
				days = 2
			}
		}
	}
}

# Ping the target province
province_event = {
	id = 60402
	hide_window = yes
	
	is_triggered_only = yes
	
	immediate = {
		if = {
			limit = {
				FROM = {
					is_ruler = yes
				}
			}
			FROM = {
				character_event = {
					id = 60404
				}
			}
		}
		if = {
			limit = {
				FROM = {
					is_ruler = no
				}
			}
			FROM = {
				character_event = {
					id = 60403
				}
			}
		}
	}
}

# The landless Sabuktigin and his men start an adventure
character_event = {
	id = 60403
	hide_window = yes
	
	is_triggered_only = yes
	
	prisoner = no
	only_capable = yes
	
	trigger = {
		is_alive = yes
		NOT = { trait = blinded }
		NOT = { trait = eunuch }
		NOT = { trait = infirm }
		lower_tier_than = king
	}
	
	immediate = {
		wealth = 500
		
		any_liege = {
			character_event = {
				id = 60405
				days = 1
			}
		}
		
		liege = {
			capital_scope = {
				FROM = {
					owner = {
						top_liege = {
							ROOT = {
								set_defacto_liege = ROOT
								create_title = {
									tier = DUKE
									landless = yes
									temporary = yes
									culture = ROOT
									name = "CLAIMANT_ADVENTURE"
									holder = ROOT
								}
								
								set_character_flag = duchy_adventurer
							
								spawn_unit = {
									province = PREVPREVPREVPREV
									home = PREVPREVPREVPREV
									owner = THIS
									#leader = THIS
									match_character = PREV
									match_mult = 0.33
									match_min = 500
									match_max = 10000
									attrition = 0.25
								}
								spawn_unit = {
									province = PREVPREVPREVPREV
									home = PREVPREVPREVPREV
									owner = THIS
									match_character = PREV
									match_mult = 0.33
									match_min = 500
									match_max = 10000
									attrition = 0.25
								}
								spawn_unit = {
									province = PREVPREVPREVPREV
									home = PREVPREVPREVPREV
									owner = THIS
									match_character = PREV
									match_mult = 0.33
									match_min = 500
									match_max = 10000
									attrition = 0.25
								}
								spawn_unit = {
									province = PREVPREVPREVPREV
									home = PREVPREVPREVPREV
									owner = THIS
									match_character = PREV
									match_mult = 0.33
									match_min = 500
									match_max = 10000
									attrition = 0.25
								}
								spawn_unit = {
									province = PREVPREVPREVPREV
									home = PREVPREVPREVPREV
									owner = THIS
									match_character = PREV
									match_mult = 0.33
									match_min = 500
									match_max = 10000
									attrition = 0.25
								}
								spawn_unit = {
									province = PREVPREVPREVPREV
									home = PREVPREVPREVPREV
									owner = THIS
									match_character = PREV
									match_mult = 0.33
									match_min = 500
									match_max = 10000
									attrition = 0.25
								}
								spawn_unit = {
									province = PREVPREVPREVPREV
									home = PREVPREVPREVPREV
									owner = THIS
									match_character = PREV
									match_mult = 0.33
									match_min = 500
									match_max = 10000
									attrition = 0.25
								}
								spawn_unit = {
									province = PREVPREVPREVPREV
									home = PREVPREVPREVPREV
									owner = THIS
									match_character = PREV
									match_mult = 0.33
									match_min = 500
									match_max = 10000
									attrition = 0.25
								}
								spawn_unit = {
									province = PREVPREVPREVPREV
									home = PREVPREVPREVPREV
									owner = THIS
									match_character = PREV
									match_mult = 0.33
									match_min = 500
									match_max = 10000
									attrition = 0.25
								}
								war = {
									target = PREV
									casus_belli = duchy_adventure
									thirdparty_title = PREVPREVPREV
									tier = DUKE
								}
							}
						}
					}
				}
			}
		}
		
		# Create some characters
		create_character = {
			random_traits = yes
			dynasty = none
			religion = ROOT
			culture = ROOT
			female = no
			age = 28
			attributes = {
				martial = 12
			}
			trait = brilliant_strategist
		}
		create_character = {
			random_traits = yes
			dynasty = none
			religion = ROOT
			culture = ROOT
			female = no
			age = 24
			attributes = {
				martial = 12
			}
			trait = brilliant_strategist
		}
		create_character = {
			random_traits = yes
			dynasty = none
			religion = ROOT
			culture = ROOT
			female = no
			age = 23
			attributes = {
				martial = 12
			}
			trait = brilliant_strategist
		}
		create_character = {
			random_traits = yes
			dynasty = none
			religion = ROOT
			culture = ROOT
			female = no
			age = 30
			attributes = {
				martial = 12
			}
			trait = brilliant_strategist
		}
		create_character = {
			random_traits = yes
			dynasty = none
			religion = ROOT
			culture = ROOT
			female = no
			age = 30
			attributes = {
				martial = 12
			}
			trait = brilliant_strategist
		}
		create_character = {
			random_traits = yes
			dynasty = none
			religion = ROOT
			culture = ROOT
			female = yes
			age = 16
		}
		create_character = {
			random_traits = yes
			dynasty = none
			religion = ROOT
			culture = ROOT
			female = yes
			age = 17
		}
		create_character = {
			random_traits = yes
			dynasty = none
			religion = ROOT
			culture = ROOT
			female = yes
			age = 18
		}
		
		log = "60403: Sabuktigin starts his first war (landless)!"
	}
}

# The landed Sabuktigin and his men start an adventure
character_event = {
	id = 60404
	desc = EVTDESC60304
	
	picture = GFX_evt_mongols
	border = GFX_event_normal_frame_war
	
	is_triggered_only = yes
	
	prisoner = no
	only_capable = yes
	
	trigger = {
		is_alive = yes
		NOT = { trait = blinded }
		NOT = { trait = eunuch }
		NOT = { trait = infirm }
		lower_tier_than = king
	}
	
	immediate = {
		if = {
			limit = {
				tier = BARON
			}
			abdicate = yes
			character_event = { id = 60403 }
			break = yes
		}
		wealth = 500
		
		any_liege = {
			character_event = {
				id = 60405
				days = 1
			}
		}
		
		FROM = {
			owner = {
				top_liege = {
					ROOT = {
						capital_scope = {
							ROOT = {
								set_character_flag = duchy_adventurer
								spawn_unit = {
									province = PREV
									home = PREV
									owner = THIS
									#leader = THIS
									match_character = PREVPREVPREV
									match_mult = 0.33
									match_min = 500
									match_max = 10000
									attrition = 0.25
								}
								spawn_unit = {
									province = PREV
									home = PREV
									owner = THIS
									match_character = PREVPREVPREV
									match_mult = 0.33
									match_min = 500
									match_max = 10000
									attrition = 0.25
								}
								spawn_unit = {
									province = PREV
									home = PREV
									owner = THIS
									match_character = PREVPREVPREV
									match_mult = 0.33
									match_min = 500
									match_max = 10000
									attrition = 0.25
								}
								spawn_unit = {
									province = PREV
									home = PREV
									owner = THIS
									match_character = PREVPREVPREV
									match_mult = 0.33
									match_min = 500
									match_max = 10000
									attrition = 0.25
								}
								spawn_unit = {
									province = PREV
									home = PREV
									owner = THIS
									match_character = PREVPREVPREV
									match_mult = 0.33
									match_min = 500
									match_max = 10000
									attrition = 0.25
								}
								spawn_unit = {
									province = PREV
									home = PREV
									owner = THIS
									match_character = PREVPREVPREV
									match_mult = 0.33
									match_min = 500
									match_max = 10000
									attrition = 0.25
								}
								spawn_unit = {
									province = PREV
									home = PREV
									owner = THIS
									match_character = PREVPREVPREV
									match_mult = 0.33
									match_min = 500
									match_max = 10000
									attrition = 0.25
								}
								spawn_unit = {
									province = PREV
									home = PREV
									owner = THIS
									match_character = PREVPREVPREV
									match_mult = 0.33
									match_min = 500
									match_max = 10000
									attrition = 0.25
								}
								spawn_unit = {
									province = PREV
									home = PREV
									owner = THIS
									match_character = PREVPREVPREV
									match_mult = 0.33
									match_min = 500
									match_max = 10000
									attrition = 0.25
								}
							}
						}
						
						war = {
							target = PREV
							casus_belli = duchy_adventure
							thirdparty_title = PREVPREVPREV
							tier = DUKE
						}
					}
				}
			}
		}
		
		# Create some characters
		create_character = {
			random_traits = yes
			dynasty = none
			religion = ROOT
			culture = ROOT
			female = no
			age = 28
			attributes = {
				martial = 12
			}
			trait = brilliant_strategist
		}
		create_character = {
			random_traits = yes
			dynasty = none
			religion = ROOT
			culture = ROOT
			female = no
			age = 24
			attributes = {
				martial = 12
			}
			trait = brilliant_strategist
		}
		create_character = {
			random_traits = yes
			dynasty = none
			religion = ROOT
			culture = ROOT
			female = no
			age = 23
			attributes = {
				martial = 12
			}
			trait = brilliant_strategist
		}
		create_character = {
			random_traits = yes
			dynasty = none
			religion = ROOT
			culture = ROOT
			female = no
			age = 30
			attributes = {
				martial = 12
			}
			trait = brilliant_strategist
		}
		create_character = {
			random_traits = yes
			dynasty = none
			religion = ROOT
			culture = ROOT
			female = no
			age = 30
			attributes = {
				martial = 12
			}
			trait = brilliant_strategist
		}
		
		create_character = {
			random_traits = yes
			dynasty = none
			religion = ROOT
			culture = ROOT
			female = yes
			age = 16
		}
		create_character = {
			random_traits = yes
			dynasty = none
			religion = ROOT
			culture = ROOT
			female = yes
			age = 17
		}
		create_character = {
			random_traits = yes
			dynasty = none
			religion = ROOT
			culture = ROOT
			female = yes
			age = 18
		}
		
		log = "60404: Sabuktigin starts his first war (landed)!"
	}
	
	option = {
		name = EVTOPTA60204
	}
}

# Notify Sabuktigin's old liege
character_event = {
	id = 60405
	desc = EVTDESC60205
	picture = GFX_evt_mongols
	border = GFX_event_normal_frame_war
	
	is_triggered_only = yes
	
	trigger = {
		FROM = { is_ruler = yes } # The DoW worked and the adventurer has a temporary title
	}
	
	option = {
		name = EVTOPTA60305
	}
}

# Sabuktigin is successful!
# Fired from the duchy_adventure CB
narrative_event = {
	id = 60406
	title = EVTNAME60406
	desc = EVTDESC60406
	picture = GFX_evt_mongols
	border = GFX_event_narrative_frame_war
	
	is_triggered_only = yes
	
	major = yes
	
	immediate = {
		if = {
			limit = {
				OR = {
					independent = yes
					liege = {
						ai = yes
					}
				}
			}
			set_defacto_liege = ROOT
		}
		
		prestige = 1000
		
		if = {
			limit = {
				uses_decadence = yes
			}
			decadence = -25
		}
		
		capital_scope = {
			religion = ROOT
			culture = ROOT
			
			ROOT = {
				spawn_unit = {
					province = PREV
					home = PREV
					owner = THIS
					troops = {
						light_infantry = { 2250 2250 }
						light_cavalry = { 2000 2000 }
						horse_archers = { 1500 1500 }
						knights = { 50 50 }
					}
				}
				spawn_unit = {
					province = PREV
					home = PREV
					owner = THIS
					troops = {
						light_infantry = { 2250 2250 }
						light_cavalry = { 2000 2000 }
						horse_archers = { 1500 1500 }
						knights = { 50 50 }
					}
				}
				spawn_unit = {
					province = PREV
					home = PREV
					owner = THIS
					troops = {
						light_infantry = { 2250 2250 }
						light_cavalry = { 2000 2000 }
						horse_archers = { 1500 1500 }
						knights = { 50 50 }
					}
				}
				spawn_unit = {
					province = PREV
					home = PREV
					owner = THIS
					troops = {
						light_infantry = { 2250 2250 }
						light_cavalry = { 2000 2000 }
						horse_archers = { 1500 1500 }
						knights = { 50 50 }
					}
				}
				spawn_unit = {
					province = PREV
					home = PREV
					owner = THIS
					troops = {
						light_infantry = { 2250 2250 }
						light_cavalry = { 2000 2000 }
						horse_archers = { 1500 1500 }
						knights = { 50 50 }
					}
				}
				
				random = {
					chance = 50
					spawn_unit = {
						province = PREV
						home = PREV
						owner = THIS
						troops = {
							light_infantry = { 2250 2250 }
							light_cavalry = { 2000 2000 }
							horse_archers = { 1500 1500 }
							knights = { 50 50 }
						}
					}
				}
				random = {
					chance = 50
					spawn_unit = {
						province = PREV
						home = PREV
						owner = THIS
						troops = {
							light_infantry = { 2250 2250 }
							light_cavalry = { 2000 2000 }
							horse_archers = { 1500 1500 }
							knights = { 50 50 }
						}
					}
				}
				random = {
					chance = 50
					spawn_unit = {
						province = PREV
						home = PREV
						owner = THIS
						troops = {
							light_infantry = { 2250 2250 }
							light_cavalry = { 2000 2000 }
							horse_archers = { 1500 1500 }
							knights = { 50 50 }
						}
					}
				}
			}
		}
		
		random_realm_province = {
			limit = {
				OR = {
					NOT = { culture = ROOT }
					NOT = { religion = ROOT }
				}
			}
			religion = ROOT
			culture = ROOT
		}
		
		log = "60406: Sabuktigin wins his first war!"
	}
	
	option = {
		name = EVTOPTA60406
		trigger = {
			has_character_flag = sabuktigin_himself
		}
	}
	option = {
		name = EVTOPTB60406
		trigger = {
			NOT = { has_character_flag = sabuktigin_himself }
		}
	}
}

# Mongol horde starts forming
narrative_event = {
	id = 60500
	title = "EVTNAME60500"
	desc = "EVTDESC60500"
	major = yes
	hide_from = yes
	
	picture = "GFX_evt_mongols"
	border = "GFX_event_narrative_frame_war"
	
	only_playable = yes
	religion = catholic
	min_age = 16
	portrait = event_target:mongol_china_invader
	
	trigger = {
		OR = {
			year = 1206
			AND = {
				has_game_rule = {
					name = mongol_invasion
					value = random
				}
				total_years_played = 50
			}
			AND = {
				has_game_rule = {
					name = mongol_invasion
					value = delayed_random
				}
				year = 1000
				total_years_played = 50
			}
		}
		NOR = { 
			year = 1226
			has_game_rule = {
				name = mongol_invasion
				value = off
			}
		}
		controls_religion = yes # Let it happen for the Pope. He's always around.
		NOR = {
			has_global_flag = il_khanate_arrival # Backwards compatibility
			has_global_flag = golden_horde_arrival # Backwards compatibility
			has_global_flag = mongol_empire_arrival
			has_global_flag = mongol_horde_arrival
		}
	}
	
	#major_trigger = {
	#	NOT = { has_character_flag = is_temujin }
	#}
	
	mean_time_to_happen = {
		months = 5
	}
	
	immediate = {
		if = {
			limit = {
				NOT = { has_global_flag = mongol_empire_arrival }
			}
			set_global_flag = mongol_empire_arrival
			activate_title = { title = e_mongol_empire status = yes }
			
			if = {
				limit = {
					has_global_flag = temujin_born
				}
				if = {
					limit = {
						any_independent_ruler = {
							has_character_flag = is_temujin
							demesne_size = 1
							ai = yes
						}
					}
					log = "Temujin exists as independent ai"
					random_independent_ruler = {
						limit = {
							has_character_flag = is_temujin
							ai = yes
						}
						any_demesne_title = {
							limit = {
								tier = EMPEROR
							}
							set_title_flag = to_be_destroyed
						}
						e_mongol_empire = {
							grant_title = PREV
						}
						any_demesne_title = {
							limit = {
								has_title_flag = to_be_destroyed
							}
							activate_title = { title = THIS status = no }
							destroy_landed_title = THIS
						}
						wealth = 12000
						prestige = 10000
						set_character_flag = horde_invader
						character_event = { id = 60510 } # Spawn troops
						character_event = { id = 60515 days = 1 } # Spawn population
						save_event_target_as = mongol_china_invader
						if = {
							limit = {
								has_dlc = "Holy Fury"
								NOT = {
									any_owned_bloodline = {
										has_bloodline_flag = genghis_khan_line
									}
								}
							}
							create_bloodline = {
								type = genghis_khan
							}
						}
					}
					break = yes
				}
				if = {
					limit = {
						NOT = {
							e_mongol_empire = {
								holder_scope = {
									always = yes
								}
							}
						}
					}
					log = "Real Temujin didn't recieve title"
					create_character = {
						random_traits = yes
						dynasty = random
						religion = tengri_pagan
						culture = mongol
						female = no
						age = 24
						attributes = {
							martial = 12
						}
						trait = brilliant_strategist
						trait = ambitious
						trait = diligent
						trait = brave
					}
					new_character = {
						if = {
							limit = {
								has_dlc = "Holy Fury"
								NOT = {
									any_owned_bloodline = {
										has_bloodline_flag = genghis_khan_line
									}
								}
							}
							create_bloodline = {
								type = genghis_khan
							}
						}
						e_mongol_empire = {
							set_title_landless = { title = THIS status = yes }
							set_title_flag = temporary_landless_title
							grant_title = PREV
						}
						set_defacto_liege = THIS
						if = {
							limit = {
								has_dlc = "Horse Lords"
							}
							set_government_type = nomadic_government
						}
						if = {
							limit = {
								NOT = { has_dlc = "Horse Lords" }
							}
							set_government_type = tribal_government
						}
						wealth = 12000
						prestige = 10000
						set_character_flag = horde_invader
						character_event = { id = 60509 } # Spawn courtiers
						character_event = { id = 60510 } # Spawn troops
						character_event = { id = 60515 days = 1 } # Spawn population
						save_event_target_as = mongol_china_invader
					}
				}
			}
			if = {
				limit = {
					NOT = {
						e_mongol_empire = {
							holder_scope = { always = yes }
						}
					}
				}
				log = "Spawning Temujin for invasion"
				create_character = {
					name="Temujin"
					# AKA: Genghis Khan
					dynasty=1051210
					dna="bfimkolbecc"
					properties="ge0af0000000"
					age = 43
					attributes = {
						martial=10
						diplomacy=8
						intrigue=8
						stewardship=9
					}
					health = 6
					fertility = 0.7
					religion="tengri_pagan"
					culture="mongol"
					trait="brave"
					trait="ambitious"
					trait="diligent"
					trait="cruel"
					trait="hunter"
					trait="cavalry_leader"
					trait="brilliant_strategist"
				}
				new_character = {
					set_character_flag = is_temujin
					if = {
						limit = {
							has_dlc = "Holy Fury"
							NOT = {
								any_owned_bloodline = {
									has_bloodline_flag = genghis_khan_line
								}
							}
						}
						create_bloodline = {
							type = genghis_khan
						}
					}
					e_mongol_empire = {
						set_title_landless = { title = THIS status = yes }
						set_title_flag = temporary_landless_title
						grant_title = PREV
					}
					set_defacto_liege = THIS
					if = {
						limit = {
							has_dlc = "Horse Lords"
						}
						set_government_type = nomadic_government
					}
					if = {
						limit = {
							NOT = { has_dlc = "Horse Lords" }
						}
						set_government_type = tribal_government
					}
					wealth = 12000
					prestige = 10000
					set_character_flag = horde_invader
					character_event = { id = 60505 } # Spawn Temujins generals
					character_event = { id = 60509 } # Spawn courtiers
					character_event = { id = 60510 } # Spawn troops
					character_event = { id = 60515 days = 1 } # Spawn population
					save_event_target_as = mongol_china_invader
					save_event_target_as = genghis_khan_temujin_himself
				}
			}
			if = {
				limit = {
					has_dlc = "Horse Lords"
				}				
				1925 = { # Tuul
					kingdom = {
						e_mongol_empire = {
							holder_scope = {
								war = {
									casus_belli = nomad_invasion
									target = PREVPREVPREV # The top liege of the owner of the province
									thirdparty_title = PREVPREV # The de jure kingdom
								}
							}
						}
					}
				}
			}
			if = {
				limit = {
					NOT = { has_dlc = "Horse Lords" }
				}				
				1925 = { # Tuul
					kingdom = {
						e_mongol_empire = {
							holder_scope = {
								war = {
									casus_belli = tribal_invasion
									target = PREVPREVPREV # The top liege of the owner of the province
									thirdparty_title = PREVPREV # The de jure kingdom
								}
							}
						}
					}
				}
			}
			if = {
				limit = {
					has_dlc = "Jade Dragon"
					offmap_china = {
						OR = {
							NOT = { has_offmap_flag = china_invaded_player_dynasty }
							had_offmap_tmp_flag = {
								flag = china_invaded_player_dynasty
								years = 200
							}
						}
					}
				}
				event_target:mongol_china_invader = {
					character_event = { id = 60531 days = 100 random = 100 }
				}
			}
		}
		if = {
			limit = {
				OR = {
					has_power_omen_modifier_trigger = yes
					has_battle_omen_modifier_trigger = yes
				}
			}
			set_character_flag = negative_event_flag # For the scrying outcome calculation...
		}
	}
	
	option = {
		name = "EVTOPTA60500"
		trigger = {
			OR = {
				religion_group = christian
				religion_group = muslim
				religion_group = pagan_group
			}
			NOT = { government = nomadic_government }
			has_power_omen_modifier_trigger = no
			has_battle_omen_modifier_trigger = no
		}
	}
	
	option = {
		name = "EVTOPTB60500"
		trigger = {
			NOT = { religion_group = christian }
			NOT = { religion_group = muslim }
			NOT = { religion_group = pagan_group }
			NOT = { government = nomadic_government }
			has_power_omen_modifier_trigger = no
			has_battle_omen_modifier_trigger = no
		}
	}
	
	option = {
		name = "EVTOPTC60500"
		trigger = {
			government = nomadic_government
			has_power_omen_modifier_trigger = no
			has_battle_omen_modifier_trigger = no
		}
	}

	option = { # scrying omen included
		name = "EVTOPTA60500"

		calculate_scrying_outcome_effect = yes
		remove_scrying_omen_modifiers_effect = yes
		tooltip_info = yes

		trigger = {
			OR = {
				religion_group = christian
				religion_group = muslim
				religion_group = pagan_group
			}
			NOT = { government = nomadic_government }
			OR = {
				has_power_omen_modifier_trigger = yes
				has_battle_omen_modifier_trigger = yes
			}
		}
	}
	
	option = { # scrying omen included
		name = "EVTOPTB60500"
		
		calculate_scrying_outcome_effect = yes
		remove_scrying_omen_modifiers_effect = yes
		tooltip_info = yes

		trigger = {
			NOT = { religion_group = christian }
			NOT = { religion_group = muslim }
			NOT = { religion_group = pagan_group }
			NOT = { government = nomadic_government }
			OR = {
				has_power_omen_modifier_trigger = yes
				has_battle_omen_modifier_trigger = yes
			}
		}
	}
	
	option = { # scrying omen included
		name = "EVTOPTC60500"

		calculate_scrying_outcome_effect = yes
		remove_scrying_omen_modifiers_effect = yes
		tooltip_info = yes

		trigger = {
			government = nomadic_government
			OR = {
				has_power_omen_modifier_trigger = yes
				has_battle_omen_modifier_trigger = yes
			}
		}
	}
}
# Remove landless status fired from on_action
character_event = {
	id = 60504
	hide_window = yes
	is_triggered_only = yes
	
	trigger = {
		FROM = {
			tier = COUNT
		}
		primary_title = { 
			has_title_flag = temporary_landless_title
			is_landless_type_title = yes
		}
	}
	
	immediate = {
		any_demesne_title = {
			limit = {
				has_title_flag = temporary_landless_title
			}
			set_title_landless = { title = THIS status = no }
		}
	}
}
# Spawn mongol leaders
character_event = {
	id = 60505
	hide_window = yes
	is_triggered_only = yes
	
	immediate = {
				# Yesugei, Temujin's father
		create_character = {
			name = "Yesugei"
			age = 68
			dynasty=1051210
			religion="tengri_pagan"
			culture="mongol"
			female = no
			trait = skilled_tactician
			random_traits = yes
		}
		new_character = {
			save_event_target_as = temujin_father
			ROOT = { set_father = PREV }
		}
		
		event_target:temujin_father = { death = { death_reason = death_battle } }

		# Hoelun, Temujin's mother
		create_character = {
			name = "Hoelun"
			age = 54
			dynasty = 101946
			religion="tengri_pagan"
			culture="mongol"
			female = yes
			health = 7.5
			random_traits = yes
		}
		new_character = {
			save_event_target_as = temujin_mother
			ROOT = { set_mother = PREV }
			add_spouse = event_target:temujin_father
			opinion = { who = ROOT modifier = opinion_loyal_servant }
		}

		# Hasar, Temujin's brother
		create_character = {
			random_traits = yes
			name = "Hasar"
			age = 38
			female = no
			dynasty=1051210
			religion="tengri_pagan"
			culture="mongol"
			attributes = {
				martial = 8
			}
			trait = skilled_tactician
		}
		new_character = {
			dynasty = 1051210
			set_father = event_target:temujin_father
			set_mother = event_target:temujin_mother
			opinion = { who = ROOT modifier = opinion_loyal_servant }
			ROOT = {
				create_character = {
					name = "Yesungge"
					random_traits = yes
					dynasty=1051210
					religion="tengri_pagan"
					culture="mongol"
					female = no
					age = 0
				}
				new_character = {
					set_father = PREVPREV
					opinion = { who = ROOT modifier = opinion_loyal_servant }
				}
			}
		}

		# Hachiun, Temujin's second brother
		create_character = {
			random_traits = yes
			name = "Hachiun"
			age = 36
			female = no
			dynasty=1051210
			religion="tengri_pagan"
			culture="mongol"
			attributes = {
				martial = 8
			}
			trait = skilled_tactician
		}
		new_character = {
			dynasty = 1051210
			set_father = event_target:temujin_father
			set_mother = event_target:temujin_mother
			opinion = { who = ROOT modifier = opinion_loyal_servant }
		}

		# Temuge, Temujin's youngest brother
		create_character = {
			random_traits = yes
			name = "Temuge"
			age = 33
			female = no
			dynasty=1051210
			religion="tengri_pagan"
			culture="mongol"
			health = 7.0
			trait = slothful
		}
		new_character = {
			dynasty = 1051210
			
			set_father = event_target:temujin_father
			set_mother = event_target:temujin_mother
			opinion = { who = ROOT modifier = opinion_loyal_servant }
			ROOT = {
				create_character = {
					name = "Jibugan"
					random_traits = yes
					dynasty=1051210
					religion="tengri_pagan"
					culture="mongol"
					female = no
					age = 9
				}
				new_character = {
					dynasty = 1051210
					set_father = PREVPREV
					opinion = { who = ROOT modifier = opinion_loyal_servant }
				}
			}
		}

		# Belgutei, Temujin's half-brother
		create_character = {
			random_traits = yes
			name = "Belgutei"
			age = 33
			dynasty=1051210
			religion="tengri_pagan"
			culture="mongol"
			attributes = {
				diplomacy = 8
			}
			trait = charismatic_negotiator
			trait = child_of_consort
		}
		new_character = {
			set_father = event_target:temujin_father
			opinion = { who = ROOT modifier = opinion_loyal_servant }
		}

		# Borte, Temujin's wife
		create_character = {
			name = "Borte"
			age = 45
			dynasty = 1041000
			religion="tengri_pagan"
			culture="mongol"
			female = yes
			random_traits = yes
		}
		new_character = {
			save_event_target_as = borte
			add_spouse = ROOT
			opinion = { who = ROOT modifier = opinion_loyal_servant }
		}

		# Subutai, Temujin's primary general
		create_character = {
			name = "Subutai"
			age = 31
			dynasty = 172001
			religion="tengri_pagan"
			culture="mongol"
			attributes = {
				martial = 10
				diplomacy = 4
				intrigue = 6
				stewardship = 6
			}
			trait = brave
			trait = strong
			trait = quick
			trait = diligent
			trait = brilliant_strategist
			trait = trickster
		}
		new_character = {
			opinion = { who = ROOT modifier = opinion_loyal_servant }
		}

		# Chepe, Temujin's secondary general
		create_character = {
			name="Jebe"
			dynasty = 7317
			age = 46
			religion="tengri_pagan"
			culture="mongol"
			attributes = {
				martial = 10
				diplomacy = 5
				intrigue = 5
				stewardship = 4
			}
			trait = skilled_tactician
			trait = brave
		}
		new_character = {
			opinion = { who = ROOT modifier = opinion_loyal_servant }
		}

		# Jochi, eldest son
		create_character = {
			random_traits = no
			name = "Jochi"
			age = 24
			dynasty=1051210
			religion="tengri_pagan"
			culture="mongol"
			attributes = {
				martial = 8
			}
			trait = skilled_tactician
			trait = hunter
			trait = kind
			trait = patient
		}
		new_character = {
			prestige = 500
			
			set_father = ROOT
			set_mother = event_target:borte
			opinion = { who = ROOT modifier = opinion_loyal_servant }
			save_event_target_as = jochi_son_temujin
			set_character_flag = line_of_jochi
			event_target:chagatai_son_temujin = {
				add_rival = PREV
			}
			ROOT = {
				create_character = {
					name = "Sarkan"
					random_traits = yes
					dynasty = 1041002
					religion="tengri_pagan"
					culture="mongol"
					female = yes
					age = 16
				}
				new_character = {
					
					add_spouse = PREVPREV
					opinion = { who = ROOT modifier = opinion_loyal_servant }
					ROOT = {
						create_character = {
							name = "Batu"
							random_traits = yes
							dynasty=1051210
							religion="tengri_pagan"
							culture="mongol"
							female = no
							age = 1
							attributes = {
								martial = 4
							}
						}
						new_character = {
							set_father = PREVPREVPREVPREV
							set_mother = PREVPREV
							opinion = { who = ROOT modifier = opinion_loyal_servant }
						}
					}
				}
			}
		}

		# Chagatai, second son
		create_character = {
			random_traits = no
			name = "Chagatai"
			dynasty=1051210
			religion="tengri_pagan"
			culture="mongol"
			age = 22
			trait = skilled_tactician
			trait = wroth
			trait = just
			trait = drunkard
		}
		new_character = {
			prestige = 500
			set_father = ROOT
			set_mother = event_target:borte
			set_character_flag = line_of_chagatai
			opinion = { who = ROOT modifier = opinion_loyal_servant }
			save_event_target_as = chagatai_son_temujin
			event_target:jochi_son_temujin = {
				add_rival = PREV
			}
			ROOT = {
				create_character = {
					name = "Ebuskun"
					random_traits = yes
					dynasty = 1041001
					religion="tengri_pagan"
					culture="mongol"
					female = yes
					age = 17
					trait = quick
				}
				new_character = {
					
					add_spouse = PREVPREV
					opinion = { who = ROOT modifier = opinion_loyal_servant }
					ROOT = {
						create_character = {
							name = "Moetuken"
							random_traits = yes
							dynasty=1051210
							religion="tengri_pagan"
							culture="mongol"
							female = no
							trait = conscientious
							attributes = {
								martial = 6
								intrigue = 3
							}
							age = 2
						}
						new_character = {
							set_mother = PREVPREV
							set_father = PREVPREVPREVPREV
							opinion = { who = ROOT modifier = opinion_loyal_servant }
						}
						create_character = {
							name = "Yesu Mongke"
							random_traits = yes
							dynasty=1051210
							religion="tengri_pagan"
							culture="mongol"
							female = no
							age = 1
							trait = rowdy
							trait = quick
							attributes = {
								martial = 4
								diplomacy = 3
							}
						}
						new_character = {
							set_mother = PREVPREV
							set_father = PREVPREVPREVPREV
							opinion = { who = ROOT modifier = opinion_loyal_servant }
						}
						
						create_character = {
							name = "Baidar"
							random_traits = yes
							dynasty=1051210
							religion="tengri_pagan"
							culture="mongol"
							female = no
							age = 0
							attributes = {
								martial = 4
								diplomacy = 3
							}
						}
						new_character = {
							set_mother = PREVPREV
							set_father = PREVPREVPREVPREV
							opinion = { who = ROOT modifier = opinion_loyal_servant }
						}
					}
				}
			}
		}

		# Ogedei, third son
		create_character = {
			random_traits = no
			name = "Ogedei"
			dynasty=1051210
			religion="tengri_pagan"
			culture="mongol"
			age = 19
			attributes = {
				diplomacy = 8
			}
			trait = skilled_tactician
			trait = gregarious
			trait = just
			trait = hunter
			trait = ambitious
		}
		new_character = {
			prestige = 500
			
			set_father = ROOT
			set_mother = event_target:borte
			set_character_flag = line_of_ogodei
			opinion = { who = ROOT modifier = opinion_loyal_servant }
			save_event_target_as = ogedei_son_temujin
			add_friend = event_target:tolui_son_temujin
			event_target:tolui_son_temujin = {
				add_friend = PREV
			}
			ROOT = {
				create_character = {
					name = "Töregene"
					random_traits = yes
					dynasty = 1041001
					religion="tengri_pagan"
					culture="mongol"
					female = yes
					age = 16
				}
				new_character = {
					
					add_spouse = PREVPREV
					opinion = { who = ROOT modifier = opinion_loyal_servant }
					ROOT = {
						create_character = {
							name = "Guyug"
							random_traits = yes
							dynasty=1051210
							religion="tengri_pagan"
							culture="mongol"
							female = no
							age = 0
							trait = affectionate
						}
						new_character = {
							set_mother = PREVPREV
							set_father = PREVPREVPREVPREV
							opinion = { who = ROOT modifier = opinion_loyal_servant }
						}
					}
				}
			}
		}

		# Tolui, fourth son
		create_character = {
			name = "Tolui"
			random_traits = yes
			dynasty=1051210
			religion="tengri_pagan"
			culture="mongol"
			attributes = {
				martial = 4
				stewardship = 8
			}
			age = 15
			trait = conscientious
			trait = timid
		}
		new_character = {
			set_father = ROOT
			set_mother = event_target:borte
			set_character_flag = line_of_tolui
			opinion = { who = ROOT modifier = opinion_loyal_servant }
			save_event_target_as = tolui_son_temujin
			event_target:ogedei_son_temujin = {
				add_friend = PREV
			}
		}

		# Daughters
		create_character = {
			name = "Khochen"
			random_traits = yes
			female = yes
			dynasty=1051210
			religion="tengri_pagan"
			culture="mongol"
			age = 20
		}
		new_character = {
			set_father = ROOT
			set_mother = event_target:borte
			opinion = { who = ROOT modifier = opinion_loyal_servant }
		}
		create_character = {
			name = "Alakhai"
			random_traits = yes
			female = yes
			dynasty=1051210
			religion="tengri_pagan"
			culture="mongol"
			age = 14
			trait = strong
			trait = fair
			attributes = {
				martial = 4
				diplomacy = 6
				stewardship = 6
			}
		}
		new_character = {
			set_father = ROOT
			set_mother = event_target:borte
			opinion = { who = ROOT modifier = opinion_loyal_servant }
		}
	}
}
# Spawn extra courtiers
character_event = {
	id = 60509
	hide_window = yes
	is_triggered_only = yes
	
	immediate = {
		create_character = {
			random_traits = yes
			dynasty = none
			religion = tengri_pagan
			culture = ROOT
			female = no
			age = 16
		}
		create_character = {
			random_traits = yes
			dynasty = none
			religion = tengri_pagan
			culture = ROOT
			female = no
			age = 18
		}
		create_character = {
			random_traits = yes
			dynasty = none
			religion = tengri_pagan
			culture = ROOT
			female = no
			age = 18
		}
		create_character = {
			random_traits = yes
			dynasty = none
			religion = tengri_pagan
			culture = ROOT
			female = no
			age = 20
		}
		create_character = {
			random_traits = yes
			dynasty = none
			religion = tengri_pagan
			culture = ROOT
			female = no
			age = 25
		}
		create_character = {
			random_traits = yes
			dynasty = none
			religion = tengri_pagan
			culture = ROOT
			female = no
			age = 26
		}
		create_character = {
			random_traits = yes
			dynasty = none
			religion = tengri_pagan
			culture = ROOT
			female = no
			age = 28
		}
		create_character = {
			random_traits = yes
			dynasty = none
			religion = tengri_pagan
			culture = ROOT
			female = yes
			age = 16
		}
		create_character = {
			random_traits = yes
			dynasty = none
			religion = tengri_pagan
			culture = ROOT
			female = yes
			age = 17
		}
		create_character = {
			random_traits = yes
			dynasty = none
			religion = tengri_pagan
			culture = ROOT
			female = yes
			age = 18
		}
		create_character = {
			random_traits = yes
			dynasty = none
			religion = tengri_pagan
			culture = ROOT
			female = yes
			age = 18
		}
		create_character = {
			random_traits = yes
			dynasty = none
			religion = tengri_pagan
			culture = ROOT
			female = yes
			age = 20
		}
		create_character = {
			random_traits = yes
			dynasty = none
			religion = tengri_pagan
			culture = ROOT
			female = no
			age = 27
			attributes = {
				martial = 12
			}
			trait = brilliant_strategist
		}
		create_character = {
			random_traits = yes
			dynasty = none
			religion = tengri_pagan
			culture = ROOT
			female = no
			age = 51
			attributes = {
				martial = 12
			}
			trait = brilliant_strategist
		}
		create_character = {
			random_traits = yes
			dynasty = none
			religion = tengri_pagan
			culture = ROOT
			female = no
			age = 44
			attributes = {
				martial = 12
			}
			trait = brilliant_strategist
		}
		create_character = {
			random_traits = yes
			dynasty = none
			religion = tengri_pagan
			culture = ROOT
			female = no
			age = 24
			attributes = {
				martial = 12
			}
			trait = brilliant_strategist
		}
	}
}
# Spawn mongol troops
character_event = {
	id = 60510
	hide_window = yes
	is_triggered_only = yes
	
	immediate = {
		spawn_unit = {
			province = 1925 # Tuul
			troops =
			{
				light_cavalry = { 2750 2750 }
				horse_archers = { 2250 2250 }
				knights = { 500 500 }
			}
		}
		spawn_unit = {
			province = 1925 # Tuul
			troops =
			{
				light_cavalry = { 2750 2750 }
				horse_archers = { 2250 2250 }
				knights = { 500 500 }
			}
		}
		spawn_unit = {
			province = 1925 # Tuul
			troops =
			{
				light_cavalry = { 2750 2750 }
				horse_archers = { 2250 2250 }
				knights = { 500 500 }
			}
		}
		spawn_unit = {
			province = 1925 # Tuul
			troops =
			{
				light_cavalry = { 2750 2750 }
				horse_archers = { 2250 2250 }
				knights = { 500 500 }
			}
		}
		spawn_unit = {
			province = 1925 # Tuul
			troops =
			{
				light_cavalry = { 2750 2750 }
				horse_archers = { 2250 2250 }
				knights = { 500 500 }
			}
		}
		spawn_unit = {
			province = 1925 # Tuul
			troops =
			{
				light_cavalry = { 2750 2750 }
				horse_archers = { 2250 2250 }
				knights = { 500 500 }
			}
		}
		spawn_unit = {
			province = 1925 # Tuul
			troops =
			{
				light_cavalry = { 2750 2750 }
				horse_archers = { 2250 2250 }
				knights = { 500 500 }
			}
		}
		spawn_unit = {
			province = 1925 # Tuul
			troops =
			{
				light_cavalry = { 2750 2750 }
				horse_archers = { 2250 2250 }
				knights = { 500 500 }
			}
		}
		spawn_unit = {
			province = 1925 # Tuul
			troops =
			{
				light_cavalry = { 2750 2750 }
				horse_archers = { 2250 2250 }
				knights = { 500 500 }
			}
		}
		spawn_unit = {
			province = 1923 # Khilok
			troops =
			{
				light_cavalry = { 2750 2750 }
				horse_archers = { 2250 2250 }
				knights = { 500 500 }
			}
		}
		spawn_unit = {
			province = 1923 # Khilok
			troops =
			{
				light_cavalry = { 2750 2750 }
				horse_archers = { 2250 2250 }
				knights = { 500 500 }
			}
		}
		spawn_unit = {
			province = 1923 # Khilok
			troops =
			{
				light_cavalry = { 2750 2750 }
				horse_archers = { 2250 2250 }
				knights = { 500 500 }
			}
		}
		spawn_unit = {
			province = 1923 # Khilok
			troops =
			{
				light_cavalry = { 2750 2750 }
				horse_archers = { 2250 2250 }
				knights = { 500 500 }
			}
		}
		spawn_unit = {
			province = 1923 # Khilok
			troops =
			{
				light_cavalry = { 2750 2750 }
				horse_archers = { 2250 2250 }
				knights = { 500 500 }
			}
		}
		spawn_unit = {
			province = 1923 # Khilok
			troops =
			{
				light_cavalry = { 2750 2750 }
				horse_archers = { 2250 2250 }
				knights = { 500 500 }
			}
		}
		random = {
			chance = 50
			spawn_unit = {
				province = 1408 # Gobi
				troops =
				{
					light_cavalry = { 2750 2750 }
					horse_archers = { 2250 2250 }
					knights = { 500 500 }
				}
			}
			spawn_unit = {
				province = 1408 # Gobi
				troops =
				{
					light_cavalry = { 2750 2750 }
					horse_archers = { 2250 2250 }
					knights = { 500 500 }
				}
			}
			spawn_unit = {
				province = 1408 # Gobi
				troops =
				{
					light_cavalry = { 2750 2750 }
					horse_archers = { 2250 2250 }
					knights = { 500 500 }
				}
			}
		}
		random = {
			chance = 50
			spawn_unit = {
				province = 1408 # Gobi
				troops =
				{
					light_cavalry = { 2750 2750 }
					horse_archers = { 2250 2250 }
					knights = { 500 500 }
				}
			}
			spawn_unit = {
				province = 1408 # Gobi
				troops =
				{
					light_cavalry = { 2750 2750 }
					horse_archers = { 2250 2250 }
					knights = { 500 500 }
				}
			}
			spawn_unit = {
				province = 1408 # Gobi
				troops =
				{
					light_cavalry = { 2750 2750 }
					horse_archers = { 2250 2250 }
					knights = { 500 500 }
				}
			}
		}
		
		spawn_unit = {
			province = 1925 # Tuul
			troops =
			{
				light_cavalry = { 2750 2750 }
				horse_archers = { 2250 2250 }
				knights = { 500 500 }
			}
		}
		spawn_unit = {
			province = 1925 # Tuul
			troops =
			{
				light_cavalry = { 2750 2750 }
				horse_archers = { 2250 2250 }
				knights = { 500 500 }
			}
		}
		spawn_unit = {
			province = 1925 # Tuul
			troops =
			{
				light_cavalry = { 2750 2750 }
				horse_archers = { 2250 2250 }
				knights = { 500 500 }
			}
		}
		spawn_unit = {
			province = 1925 # Tuul
			troops =
			{
				light_cavalry = { 2750 2750 }
				horse_archers = { 2250 2250 }
				knights = { 500 500 }
			}
		}
		spawn_unit = {
			province = 1925 # Tuul
			troops =
			{
				light_cavalry = { 2750 2750 }
				horse_archers = { 2250 2250 }
				knights = { 500 500 }
			}
		}
		spawn_unit = {
			province = 1925 # Tuul
			troops =
			{
				light_cavalry = { 2750 2750 }
				horse_archers = { 2250 2250 }
				knights = { 500 500 }
			}
		}
		spawn_unit = {
			province = 1925 # Tuul
			troops =
			{
				light_cavalry = { 2750 2750 }
				horse_archers = { 2250 2250 }
				knights = { 500 500 }
			}
		}
		spawn_unit = {
			province = 1925 # Tuul
			troops =
			{
				light_cavalry = { 2750 2750 }
				horse_archers = { 2250 2250 }
				knights = { 500 500 }
			}
		}
		spawn_unit = {
			province = 1925 # Tuul
			troops =
			{
				light_cavalry = { 2750 2750 }
				horse_archers = { 2250 2250 }
				knights = { 500 500 }
			}
		}
		spawn_unit = {
			province = 1923 # Khilok
			troops =
			{
				light_cavalry = { 2750 2750 }
				horse_archers = { 2250 2250 }
				knights = { 500 500 }
			}
		}
		spawn_unit = {
			province = 1923 # Khilok
			troops =
			{
				light_cavalry = { 2750 2750 }
				horse_archers = { 2250 2250 }
				knights = { 500 500 }
			}
		}
		spawn_unit = {
			province = 1923 # Khilok
			troops =
			{
				light_cavalry = { 2750 2750 }
				horse_archers = { 2250 2250 }
				knights = { 500 500 }
			}
		}
		spawn_unit = {
			province = 1923 # Khilok
			troops =
			{
				light_cavalry = { 2750 2750 }
				horse_archers = { 2250 2250 }
				knights = { 500 500 }
			}
		}
		spawn_unit = {
			province = 1923 # Khilok
			troops =
			{
				light_cavalry = { 2750 2750 }
				horse_archers = { 2250 2250 }
				knights = { 500 500 }
			}
		}
		spawn_unit = {
			province = 1923 # Khilok
			troops =
			{
				light_cavalry = { 2750 2750 }
				horse_archers = { 2250 2250 }
				knights = { 500 500 }
			}
		}
		random = {
			chance = 50
			spawn_unit = {
				province = 1408 # Gobi
				troops =
				{
					light_cavalry = { 2750 2750 }
					horse_archers = { 2250 2250 }
					knights = { 500 500 }
				}
			}
			spawn_unit = {
				province = 1408 # Gobi
				troops =
				{
					light_cavalry = { 2750 2750 }
					horse_archers = { 2250 2250 }
					knights = { 500 500 }
				}
			}
			spawn_unit = {
				province = 1408 # Gobi
				troops =
				{
					light_cavalry = { 2750 2750 }
					horse_archers = { 2250 2250 }
					knights = { 500 500 }
				}
			}
		}
		random = {
			chance = 50
			spawn_unit = {
				province = 1408 # Gobi
				troops =
				{
					light_cavalry = { 2750 2750 }
					horse_archers = { 2250 2250 }
					knights = { 500 500 }
				}
			}
			spawn_unit = {
				province = 1408 # Gobi
				troops =
				{
					light_cavalry = { 2750 2750 }
					horse_archers = { 2250 2250 }
					knights = { 500 500 }
				}
			}
			spawn_unit = {
				province = 1408 # Gobi
				troops =
				{
					light_cavalry = { 2750 2750 }
					horse_archers = { 2250 2250 }
					knights = { 500 500 }
				}
			}
		}
	}
}

character_event = {
	id = 60515
	hide_window = yes
	
	is_triggered_only = yes
	
	immediate = {
		population = 120000
		add_character_modifier = {
			modifier = invading_population_halt
			duration = 10950
			hidden = yes
		}
		character_event = {
			id = 60516
			days = 365
		}
	}
}

character_event = {
	id = 60516
	hide_window = yes
	
	is_triggered_only = yes
	
	immediate = {
		if = {
			limit = {
				NOT = { government = nomadic_government }
				NOT = { has_character_modifier = invading_population_halt }
			}
			remove_character_modifier = invading_population_halt
			break = yes
		}
		if = {
			limit = {
				NOT = { population_factor = 1 }
			}
			population = 80000
			if = {
				limit = {
					population = 350000
				}
				character_event = {
					id = 60517
					days = 365
				}
				break = yes
			}
		}
		repeat_event = { 
			id = 60516
			days = 365
		}
	}
}

character_event = {
	id = 60517
	hide_window = yes
	
	is_triggered_only = yes
	
	immediate = {
		if = {
			limit = {
				NOT = { government = nomadic_government }
				NOT = { has_character_modifier = invading_population_halt }
			}
			remove_character_modifier = invading_population_halt
			break = yes
		}
		if = {
			limit = {
				NOT = { population_factor = 1 }
			}
			remove_character_modifier = invading_population_halt
			break = yes
		}
		repeat_event = {
			id = 60517
			days = 365
		}
	}
}

# Notify world about the greatest of Khans
narrative_event = {
	id = 60520
	title = EVTNAME60520
	desc = EVTDESC60520
	is_triggered_only = yes
	
	picture = GFX_evt_mongols
	border = GFX_event_narrative_frame_war


	immediate = {
		if = {
			limit = {
				OR = {
					has_power_omen_modifier_trigger = yes
					has_battle_omen_modifier_trigger = yes
				}
			}
			set_character_flag = negative_event_flag # For the scrying outcome calculation...
		}
	}
	
	option = {
		name = EVTOPTA_60520
		trigger = {
			primary_title = {
				title = e_mongol_empire
			}
			has_power_omen_modifier_trigger = no
			has_battle_omen_modifier_trigger = no
		}
	}
	
	option = {
		name = EVTOPTB_60520
		trigger = {
			NOT = {
				primary_title = {
					title = e_mongol_empire
				}
			}
			NOT = {
				any_liege = {
					primary_title = {
						title = e_mongol_empire
					}
				}
			}
			has_power_omen_modifier_trigger = no
			has_battle_omen_modifier_trigger = no
		}
	}
	
	option = {
		name = EVTOPTC_60520
		trigger = {
			any_liege = {
				primary_title = {
					title = e_mongol_empire
				}
			}
			has_power_omen_modifier_trigger = no
			has_battle_omen_modifier_trigger = no
		}
	}

	option = { # scrying omen included
		name = EVTOPTA_60520

		calculate_scrying_outcome_effect = yes
		remove_scrying_omen_modifiers_effect = yes
		tooltip_info = yes

		trigger = {
			primary_title = {
				title = e_mongol_empire
			}
			OR = {
				has_power_omen_modifier_trigger = yes
				has_battle_omen_modifier_trigger = yes
			}
		}
	}
	
	option = { # scrying omen included
		name = EVTOPTB_60520

		calculate_scrying_outcome_effect = yes
		remove_scrying_omen_modifiers_effect = yes
		tooltip_info = yes

		trigger = {
			NOT = {
				primary_title = {
					title = e_mongol_empire
				}
			}
			NOT = {
				any_liege = {
					primary_title = {
						title = e_mongol_empire
					}
				}
			}
			OR = {
				has_power_omen_modifier_trigger = yes
				has_battle_omen_modifier_trigger = yes
			}
		}
	}
	
	option = { # scrying omen included
		name = EVTOPTC_60520

		calculate_scrying_outcome_effect = yes
		remove_scrying_omen_modifiers_effect = yes
		tooltip_info = yes

		trigger = {
			any_liege = {
				primary_title = {
					title = e_mongol_empire
				}
			}
			OR = {
				has_power_omen_modifier_trigger = yes
				has_battle_omen_modifier_trigger = yes
			}
		}
	}
}
# Ai - reinforcement event for Genghis decision
character_event = {
	id = 60530
	hide_window = yes
	is_triggered_only = yes
	
	immediate = {
		capital_scope = {
			ROOT = {
				spawn_unit = {
					province = PREV
					troops =
					{
						light_cavalry = { 2750 2750 }
						horse_archers = { 2250 2250 }
						knights = { 500 500 }
					}
				}
				spawn_unit = {
					province = PREV
					troops =
					{
						light_cavalry = { 2750 2750 }
						horse_archers = { 2250 2250 }
						knights = { 500 500 }
					}
				}
				spawn_unit = {
					province = PREV
					troops =
					{
						light_cavalry = { 2750 2750 }
						horse_archers = { 2250 2250 }
						knights = { 500 500 }
					}
				}
				spawn_unit = {
					province = PREV
					troops =
					{
						light_cavalry = { 2750 2750 }
						horse_archers = { 2250 2250 }
						knights = { 500 500 }
					}
				}
			}
		}
	}
}

character_event = {
	id = 60531
	hide_window = yes
	
	is_triggered_only = yes
	
	immediate = {
		if = { # If China exists - Invade it!
			limit = {
				offmap_china = {
					NOT = {
						has_status = china_mongol_invasion
					}
					offmap_ruler = {
						NOT = {
							dynasty = event_target:mongol_china_invader
						}
					}
				}
			}
			offmap_china = {
				if = {
					limit = { # Mongols take presedence over Jurchens/Civil War
						OR = {
							has_status = china_jurchen_invasion
							has_status = china_civil_war
						}
					}
					set_offmap_flag = no_status_news
					set_status = china_unrest
					set_offmap_flag = china_had_unrest
					clr_offmap_flag = no_status_news
				}
				governor = {
					offmap_china = {
						set_offmap_flag = no_status_news
						set_status = china_mongol_invasion
						set_offmap_flag = china_mongol_invasion
						clr_offmap_flag = no_status_news
					}
					any_player = {
						limit = {
							has_offmap_news_enabled = offmap_china
							is_within_diplo_range = PREV
						}
						narrative_event = { id = JD.50141 }
					}
				}
			}
		}
	}
}


##################################
# Rise of the Sultanate of Rum
##################################

# A Turkic character wants a foothold in Armenia
character_event = {
	id = 60600
	
	hide_window = yes # Only fires for unplayable landless characters
	
	min_age = 16
	max_age = 50
	only_men = yes
	capable_only = yes
	prisoner = no
	
	culture_group = altaic
	religion_group = muslim
	
	is_triggered_only = yes
		
	trigger = {
		OR = { # Pacing mechanic, we don't want too many adventurers to spawn at once
			had_global_flag = { flag = rum_invader_spawned years = 10 }
			NOT = {
				has_global_flag = rum_invader_spawned
			}
		}
		
		top_liege = {
			NOT = {
				is_close_relative = PREV
			}
		}
	
		OR = {
			AND = {
				martial = 7
			}
			has_character_flag = demon_child_non_pagan
		}
		
		father_even_if_dead = { # Is of a noble house
			always = yes
		}
		
		NOT = { trait = craven }
		
		NOT = {
			has_game_rule = {
				name = turkic_invasions
				value = off
			}
		}
		OR = {
			AND = {
				has_game_rule = {
					name = turkic_invasions
					value = historical
				}
				year = 1000
				NOT = { year = 1200 }
			}
			AND = {
				has_game_rule = {
					name = turkic_invasions
					value = random
				}
				year = 809
				NOT = { year = 1200 }
			}
		}
		
		NOT = { has_global_flag = rum_spawned }
		OR = {
			NOT = { has_global_flag = rum_spawning }
			had_global_flag = { flag = rum_spawning days = 1460 }
		}
		
		is_ruler = no
		NOT = { any_spouse = { is_ruler = yes } }
		
		NOT = { # Somewhat clunky way of checking that the character does not stand to inherit any titles
			any_heir_title = {
				always = yes
			}
		}
		
		liege = {
			culture_group = altaic
			capital_scope = {
				OR = {
					empire = {
						OR ={
							title = e_seljuk_turks
							title = e_persia
						}
					}
					kingdom = {
						OR ={
							title = k_daylam
							title = k_iraq
							title = k_mesopotamia
							title = k_persia
							title = k_syria
							title = k_armenia
						}
					}
				}
			}
		}
	}
	
	mean_time_to_happen = {
		months = 120
		modifier = {
			factor = 0.01
			dynasty = 613 # Seljuk 
		}
		modifier = {
			factor = 20
			NOT = { dynasty = 613 } # Seljuk 
		}
		modifier = {
			factor = 0.5
			culture = turkish
		}
		modifier = {
			factor = 0.5
			has_character_flag = flag_denied_title
		}
		modifier = {
			factor = 0.01
			has_character_flag = demon_child_non_pagan
		}
		modifier = {
			factor = 3.0
			trait = slothful
		}
		modifier = {
			factor = 3.0
			trait = humble
		}
		modifier = {
			factor = 3.0
			trait = kind
		}
	}
	
	immediate = {
		set_global_flag = rum_invader_spawned
		random_independent_ruler = {
			limit = {
				is_landed = yes
				independent = yes
				OR = {
					tier = duke
					tier = king
					tier = emperor
				}
				ROOT = {
					liege = {
						NOT = {
							war_with = PREVPREV
						}
					}
				}
				NOT = { same_realm = ROOT }
				NOT = { religion_group = muslim }
				any_realm_province = {
					OR = {
						kingdom = {
							title = k_armenia
						}
						duchy = {
							title = d_azerbaijan
						}
						duchy = {
							title = d_charsianon
						}
						duchy = {
							title = d_cappadocia
						}
						duchy = {
							title = d_anatolia
						}
						duchy = {
							title = d_armenia_minor
						}
					}
				}
			}
			
			random_realm_province = {
				limit = {
					OR = {
						kingdom = {
							title = k_armenia
						}
						duchy = {
							title = d_azerbaijan
						}
						duchy = {
							title = d_charsianon
						}
						duchy = {
							title = d_cappadocia
						}
						duchy = {
							title = d_anatolia
						}
						duchy = {
							title = d_armenia_minor
						}
					}
				}
				
				save_event_target_as = target_province
				
				ROOT = {
					opinion = {
						who = PREVPREV
						years = 3
						modifier = opinion_duchy_adventure_target
					}
					add_character_modifier = {
						name = planning_duchy_adventure
						hidden = yes
						days = 730
					}
					character_event = {
						id = 60603 # Fire the attack
						days = 730
					}
					
					end_inaccessibility_effect = yes #removes in hiding or in_seclusion
					set_character_flag = do_not_disturb
					character_event = { id = 60602 days = 730 } # Safety clear of DND
					set_global_flag = rum_spawning
				}
				PREV = {
					character_event = {
						id = 60601 # Warn the target
					}
				}
			}
		}
	}
}

# Warn the target
character_event = {
	id = 60601
	desc = EVTDESC_TOG_1211
	picture = GFX_evt_mongols
	border = GFX_event_normal_frame_war
	
	is_triggered_only = yes
	
	immediate = {
		opinion = {
			who = FROM
			modifier = opinion_targeted_by_adventurer
			months = 24
		}
	}
	
	option = {
		name = EVTOPTA_TOG_1211
	}
}

# Safety clear of DND
character_event = {
	id = 60602
	
	is_triggered_only = yes
	
	hide_window = yes
	
	immediate = {
		clr_character_flag = do_not_disturb
	}
}

# Launch the attack!
character_event = {
	id = 60603
	
	hide_window = yes 
	
	is_triggered_only = yes

	prisoner = no
	only_capable = yes
	
	trigger = {
		is_ruler = no
		NOT = { any_spouse = { is_ruler = yes } }
		
		NOT = {
			any_heir_title = {
				always = yes
			}
		}
		
		event_target:target_province = {
			owner = {
				top_liege = {
					is_landed = yes
					independent = yes
					NOT = { same_realm = ROOT }
					NOT = { religion_group = muslim }
				}
			}
		}
	}
	
	immediate = {
		wealth = 500
		clr_character_flag = do_not_disturb
		
		set_character_flag = rum_creator
		
		liege = {
			character_event = {
				id = 60604
				days = 1
			}
		}
		
		liege = {
			capital_scope = {
				event_target:target_province = {
					top_liege = {
						ROOT = {
							set_defacto_liege = ROOT
							create_title = {
								tier = DUKE
								landless = yes
								temporary = yes
								adventurer = yes
								culture = ROOT
								name = "CLAIMANT_ADVENTURE"
								holder = ROOT
							}
							
							set_character_flag = duchy_adventurer
						
							spawn_unit = {
								province = PREVPREVPREV
								home = PREVPREVPREV
								owner = THIS
								match_character = PREV
								match_mult = 0.33
								match_min = 2000
								match_max = 10000
								attrition = 0.25
							}
							spawn_unit = {
								province = PREVPREVPREV
								home = PREVPREVPREV
								owner = THIS
								match_character = PREV
								match_mult = 0.33
								match_min = 2000
								match_max = 10000
								attrition = 0.25
							}
							spawn_unit = {
								province = PREVPREVPREV
								home = PREVPREVPREV
								owner = THIS
								match_character = PREV
								match_mult = 0.33
								match_min = 2000
								match_max = 10000
								attrition = 0.25
							}
							spawn_unit = {
								province = PREVPREVPREV
								home = PREVPREVPREV
								owner = THIS
								match_character = PREV
								match_mult = 0.33
								match_min = 2000
								match_max = 10000
								attrition = 0.25
								cannot_inherit = yes
							}
							spawn_unit = {
								province = PREVPREVPREV
								home = PREVPREVPREV
								owner = THIS
								match_character = PREV
								match_mult = 0.33
								match_min = 2000
								match_max = 10000
								attrition = 0.25
								cannot_inherit = yes
							}
							spawn_unit = {
								province = PREVPREVPREV
								home = PREVPREVPREV
								owner = THIS
								match_character = PREV
								match_mult = 0.33
								match_min = 2000
								match_max = 10000
								attrition = 0.25
								cannot_inherit = yes
							}
							spawn_unit = {
								province = PREVPREVPREV
								home = PREVPREVPREV
								owner = THIS
								match_character = PREV
								match_mult = 0.33
								match_min = 2000
								match_max = 10000
								attrition = 0.25
							}
							spawn_unit = {
								province = PREVPREVPREV
								home = PREVPREVPREV
								owner = THIS
								match_character = PREV
								match_mult = 0.33
								match_min = 2000
								match_max = 10000
								attrition = 0.25
								cannot_inherit = yes
							}
							spawn_unit = {
								province = PREVPREVPREV
								home = PREVPREVPREV
								owner = THIS
								match_character = PREV
								match_mult = 0.33
								match_min = 2000
								match_max = 10000
								attrition = 0.25
								cannot_inherit = yes
							}
							spawn_unit = {
								province = PREVPREVPREV
								home = PREVPREVPREV
								owner = THIS
								match_character = PREV
								match_mult = 0.33
								match_min = 2000
								match_max = 10000
								attrition = 0.25
								cannot_inherit = yes
							}
							war = {
								target = PREV
								casus_belli = duchy_adventure
								thirdparty_title = PREVPREV
								tier = DUKE
							}
							remove_opinion = {
								who = PREV
								modifier = opinion_duchy_adventure_target
							}
						}
					}
				}
			}
		}
		
		# Create some decent commander characters
		create_random_soldier = {
			random_traits = yes
			dynasty = none
			religion = ROOT
			culture = ROOT
			female = no
			age = 30
		}
		create_random_soldier = {
			random_traits = yes
			dynasty = none
			religion = ROOT
			culture = ROOT
			female = no
			age = 25
		}
		create_random_soldier = {
			random_traits = yes
			dynasty = none
			religion = ROOT
			culture = ROOT
			female = no
			age = 19
		}
		create_random_soldier = {
			random_traits = yes
			dynasty = none
			religion = ROOT
			culture = ROOT
			female = no
			age = 23
		}
		
		clr_global_flag = rum_spawning
		set_global_flag = rum_spawned
	}
}


character_event = {
	id = 60604
	desc = EVTDESC_TOG_1213
	picture = GFX_evt_mongols
	border = GFX_event_normal_frame_war
	
	is_triggered_only = yes
	
	trigger = {
		FROM = { is_ruler = yes } # The DoW worked and the adventurer has a temporary title
	}
	
	immediate = {
		FROM = {
			add_trait = adventurer
		}
		any_liege = {
			character_event = {
				id = 60605
			}
		}
	}
	
	option = {
		name = EVTOPTA_TOG_1203
	}
}

character_event = {
	id = 60605
	desc = EVTDESC_TOG_1214
	picture = GFX_evt_mongols
	border = GFX_event_normal_frame_war
	
	show_from_from = yes
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_TOG_1203
	}
}

#######################################
# Stage 2 (Armenia) and 3 (Anatolia)
# Fired from CB 'duchy_adventure' or 'kingdom_adventure'
#######################################
character_event = {
	id = 60610
	
	is_triggered_only = yes
	hide_window = yes
	ai = yes
	
	immediate = {
		if = {
			limit = {
				war = no
				independent = yes
			}
			random_independent_ruler = {
				limit = {
					ROOT = {
						any_realm_province = {
							kingdom = {
								title = k_armenia
							}
						}
					}
					is_landed = yes
					independent = yes
					in_revolt = no
					NOT = { reverse_has_truce = ROOT }
					NOT = { religion_group = muslim }
					any_realm_province = {
						kingdom = {
							title = k_armenia
						}
					}
				}
				random_realm_province = {
					limit = {
						kingdom = {
							title = k_armenia
						}
					}
					ROOT = {
						capital_scope = {
							ROOT = {
								spawn_unit = {
									province = PREV
									home = PREV
									owner = THIS
									match_character = PREVPREVPREVPREV
									match_mult = 0.33
									match_min = 2000
									match_max = 10000
									attrition = 0.25
								}
								spawn_unit = {
									province = PREV
									home = PREV
									owner = THIS
									match_character = PREVPREVPREVPREV
									match_mult = 0.33
									match_min = 2000
									match_max = 10000
									attrition = 0.25
								}
								spawn_unit = {
									province = PREV
									home = PREV
									owner = THIS
									match_character = PREVPREVPREVPREV
									match_mult = 0.33
									match_min = 2000
									match_max = 10000
									attrition = 0.25
								}
							}
						}
						war = {
							target = PREVPREV
							casus_belli = kingdom_adventure
							thirdparty_title = PREV
							tier = KING
						}
						break = yes
					}
				}
			}
			e_byzantium = {
				holder_scope = {
					if = {
						limit = {
							NOT = { religion_group = muslim }
							NOT = { reverse_has_truce = ROOT }
							any_realm_province = {
								kingdom = {
									title = k_anatolia
								}
							}
						}
						random_realm_province = {
							limit = {
								kingdom = {
									title = k_anatolia
								}
							}
							ROOT = {
								capital_scope = {
									ROOT = {
										spawn_unit = {
											province = PREV
											home = PREV
											owner = THIS
											match_character = PREVPREVPREVPREV
											match_mult = 0.25
											match_min = 2000
											match_max = 10000
											attrition = 0.25
										}
										spawn_unit = {
											province = PREV
											home = PREV
											owner = THIS
											match_character = PREVPREVPREVPREV
											match_mult = 0.25
											match_min = 2000
											match_max = 10000
											attrition = 0.25
										}
										spawn_unit = {
											province = PREV
											home = PREV
											owner = THIS
											match_character = PREVPREVPREVPREV
											match_mult = 0.25
											match_min = 2000
											match_max = 10000
											attrition = 0.25
										}
									}
								}
								war = {
									target = PREVPREV
									casus_belli = kingdom_adventure
									thirdparty_title = PREV
									tier = KING
								}
								break = yes
							}
						}
					}
				}
			}
		}
		
		repeat_event = { 
			id = 60610
			days = 30
		}
	}
}
