decisions = {

	form_avar_khaganate = {
		only_playable = yes
		is_high_prio = yes
		potential = {
			NOT = { tier = EMPEROR }
			culture = avar
			e_avar = {
				has_holder = no
			}
		}
		allow = {
			realm_size = 70
			war = no
			is_adult = yes
			prisoner = no
			NOT = { trait = incapable }
		}
		effect = {
			e_avar = {
				activate_title = { title = THIS status = yes } # Otherwise grant_title doesn't work
				grant_title = ROOT
			}
		}
			
		
		ai_will_do = {
			factor = 1
		}
	}

	form_frankish_kingdom = {
		only_playable = yes
		is_high_prio = yes
		potential = {
			culture = old_frankish
			NOT = { has_global_flag = frankish_kingdom }
			k_franks = {
				has_holder = no
			}
		}
		allow = {
			94 = { # Hainaut
				owner = {
					OR = {
						is_liege_or_above = ROOT
						character = ROOT
					}
				}
			}
			129 = { # Verdun
				owner = {
					OR = {
						is_liege_or_above = ROOT
						character = ROOT
					}
				}
			}
			prestige = 500
			war = no
			is_adult = yes
			prisoner = no
			NOT = { trait = incapable }
			independent = yes
		}
		effect = {
			set_global_flag = frankish_kingdom
			primary_title = {
				k_franks = {
					activate_title = { title = THIS status = yes } # Otherwise grant_title doesn't work
					grant_title = ROOT
					copy_title_laws = PREV
					make_primary_title = yes # Automatic for AI, but more friendly/visible for the player
				}
			}
			add_claim = e_gaul #Encourages a united Frankish kingdom to expand through Gaul instead of Germania
			hidden_tooltip = {
				any_child = {
					limit = {
						is_female = no
					}
					add_claim = e_gaul
				}
				any_playable_ruler = {
					limit = {
						ai = no
						NOT = { has_landed_title = k_franks }
					}
					narrative_event = { id = hist.21 }
				}
			}
		}
			
		
		ai_will_do = {
			factor = 1
		}
	}

	form_assyrian_empire = {
		only_playable = yes
		is_high_prio = yes
		potential = {
			religion = assyrian_pagan
			NOT = { has_global_flag = assyria_reborn }
			e_assyria = {
				has_holder = no
			}
		}
		allow = {
			war = no
			is_adult = yes
			prisoner = no
			NOT = { trait = incapable }
			completely_controls = c_sinjar
			completely_controls = k_asoristan
			independent = yes
			piety = 500
		}
		effect = {
			set_global_flag = assyria_reborn
			primary_title = {
				e_assyria = {
					activate_title = { title = THIS status = yes } # Otherwise grant_title doesn't work
					grant_title = PREVPREV
					copy_title_laws = PREV
				}
			}
			any_playable_ruler = {
				limit = {
					NOT = { has_landed_title = e_assyria }
					ai = no
				}
				narrative_event = { id = zusk_event.19 } 
			}
		}
			
		
		ai_will_do = {
			factor = 1
		}
	}

	form_cuman_khaganate = {
		only_playable = yes
		is_high_prio = yes
		potential = {
			NOT = { tier = EMPEROR }
			culture = cuman
			e_cuman = {
				has_holder = no
			}
		}
		allow = {
			realm_size = 70
			war = no
			is_adult = yes
			prisoner = no
			NOT = { trait = incapable }
		}
		effect = {	 
			primary_title = {
				e_cuman = {
					activate_title = { title = THIS status = yes } # Otherwise grant_title doesn't work
					grant_title = PREVPREV
					copy_title_laws = PREV
				}
			}
		}
			
		
		ai_will_do = {
			factor = 1
		}
	}

	form_bolghar_khaganate = {
		only_playable = yes
		is_high_prio = yes
		potential = {
			NOT = { tier = EMPEROR }
			culture = bolghar
			e_bolghar = {
				has_holder = no
			}
		}
		allow = {
			realm_size = 70
			war = no
			is_adult = yes
			prisoner = no
			NOT = { trait = incapable }

		}
		effect = {
			primary_title = {
				e_bolghar = {
					activate_title = { title = THIS status = yes } # Otherwise grant_title doesn't work
					grant_title = PREVPREV
					copy_title_laws = PREV
				}
			}
		}
			
		
		ai_will_do = {
			factor = 1
		}
	}

	form_karluk_khaganate = {
		only_playable = yes
		is_high_prio = yes
		potential = {
			NOT = { tier = EMPEROR }
			culture = karluk
			e_karluk = {
				has_holder = no
			}
		}
		allow = {
			realm_size = 70
			war = no
			is_adult = yes
			prisoner = no
			NOT = { trait = incapable }
		}
		effect = {
		  primary_title = {
			  e_karluk = {
				  activate_title = { title = THIS status = yes } # Otherwise grant_title doesn't work
				  grant_title = PREVPREV
				  copy_title_laws = PREV
					}
						}
			}
			
		
		ai_will_do = {
			factor = 1
		}
	}

	form_khazar_khaganate = {
		only_playable = yes
		is_high_prio = yes
		potential = {
			NOT = { tier = EMPEROR }
			culture = khazar
			e_khazar = {
				has_holder = no
			}
		}
		allow = {
			realm_size = 70
			war = no
			is_adult = yes
			prisoner = no
			NOT = { trait = incapable }
		}
		effect = {
			primary_title = {
				e_khazar = {
					activate_title = { title = THIS status = yes } # Otherwise grant_title doesn't work
					grant_title = PREVPREV
					copy_title_laws = PREV
				}
			}
		}
		ai_will_do = {
			factor = 1
		}
	}
 
	form_kirghiz_khaganate = {
		only_playable = yes
		is_high_prio = yes
		potential = {
			NOT = { tier = EMPEROR }
			culture = kirghiz
			e_kirghiz = {
				has_holder = no
			}
		}
		allow = {
			realm_size = 70
			war = no
			is_adult = yes
			prisoner = no
			NOT = { trait = incapable }
		}
		effect = {
		  primary_title = {
				e_kirghiz = {
					activate_title = { title = THIS status = yes } # Otherwise grant_title doesn't work
					grant_title = PREVPREV
					copy_title_laws = PREV
					}
			}
		}
		ai_will_do = {
			factor = 1
		}
	}
	form_pecheneg_khaganate = {
		only_playable = yes
		is_high_prio = yes
		potential = {
			NOT = { tier = EMPEROR }
			culture = pecheneg
			e_pecheneg = {
				has_holder = no
			}
		}
		allow = {
			realm_size = 70
			war = no
			is_adult = yes
			prisoner = no
			NOT = { trait = incapable }
		}
		effect = {
		  primary_title = {
				e_pecheneg = {
					activate_title = { title = THIS status = yes } # Otherwise grant_title doesn't work
					grant_title = PREVPREV
					copy_title_laws = PREV
				}
			}
		}
		ai_will_do = {
			factor = 1
		}
	}

	form_turkestan = {
		only_playable = yes
		is_high_prio = yes
		potential = {
			NOT = { tier = EMPEROR }
			culture = turkish
			religion_group = pagan_group
			e_turkestan = {
				has_holder = no
			}
		}
		allow = {
			realm_size = 70
			war = no
			is_adult = yes
			prisoner = no
			NOT = { trait = incapable }
		}
		effect = {
			primary_title = {
				e_turkestan = {
					activate_title = { title = THIS status = yes } # Otherwise grant_title doesn't work
					grant_title = PREVPREV
					copy_title_laws = PREV
				}
			}
		}
		ai_will_do = {
			factor = 1
		}
	}

	elevate_oriens = {
		only_playable = yes
		is_high_prio = yes
		potential = {
			has_landed_title = k_oriens
			NOT = { tier = EMPEROR }
			e_oriens = {
				has_holder = no
			}
		}
		allow = {
			independent = yes
			prestige = 5000
			wealth = 300
			war = no
			is_adult = yes
			prisoner = no
			NOT = { trait = incapable }
		}
		effect = {
			primary_title = {
			 	e_oriens = {
					activate_title = { title = THIS status = yes } # Otherwise grant_title doesn't work
					grant_title = PREVPREV
					copy_title_laws = PREV
				}
			}
			wealth = -300
			prestige = 1000
		}
		ai_will_do = {
			factor = 1
		}
	}

	form_spania = {
		only_playable = yes
		is_high_prio = yes
		potential = {
		    has_landed_title = e_byzantium
			NOT = { has_global_flag = spania_created }
			completely_controls = k_baetica
			k_spania = {
				has_holder = no
			}
		}
		allow = {
			prestige = 500
			war = no
			is_adult = yes
			prisoner = no
			is_incapable = no
		}
		effect = {
			set_global_flag = spania_created
			
			k_spania = {
				activate_title = { title = THIS status = yes } # Otherwise grant_title doesn't work
				grant_title = ROOT
			}
			ROOT = {
				primary_title = {
					k_spania = {
						copy_title_laws = PREV
					}
				}
				narrative_event = { id = hist.29 }
			}
		}
	}
	unite_england = {
		only_independent = yes
		is_high_prio = yes
		potential = {
			capital_scope = {
				region = world_europe_west_brittania
			}
			OR = {
				culture = anglo
				culture = old_saxon
				culture = jute
				culture = saxon
				culture = english
			}
			tier = king
			NOT = { has_global_flag = england_united }
		}
		allow = {
			independent = yes
			has_landed_title = k_england
			completely_controls = k_england
			# k_britannia_secunda
			completely_controls = d_northumberland
			completely_controls = d_lancaster
			OR = {
				completely_controls = d_galloway
				completely_controls = d_lothian
				completely_controls = d_york
			}
			# k_britannia_prima
			completely_controls = d_somerset
			completely_controls = d_hereford
			OR = {
				completely_controls = d_cornwall
				completely_controls = d_gloucester
				completely_controls = d_gwynedd
				completely_controls = d_deheubarth
			}
			NOT = { # No rival Anglo-Saxon king
				any_independent_ruler = {
					region = world_europe_west_brittania
					NOT = { has_landed_title = k_england } # Exclude uniter
					tier = king
					OR = {
						culture = anglo
						culture = old_saxon
						culture = jute
						culture = saxon
						culture = english
					}
				}
			}
			piety = 200
			prestige = 1000
		}
		effect = {
			set_global_flag = england_united
			hidden_tooltip = {
				narrative_event = { 
					id = hist.30
				}
			}
		}
		ai_will_do = {
			factor = 1
		}
	}
}