decisions = {
	form_france = {
		is_high_prio = yes
		only_independent = yes
		potential = {
			year = 860
			higher_tier_than = DUKE
			
			OR = {
				has_landed_title = k_france
				has_landed_title = k_aquitaine
			}
			NOT = { has_global_flag = west_francia_renamed }
		}

		allow = {
			war = no
			has_regent = no
			OR = {
				AND = {
					has_landed_title = k_france
					has_landed_title = k_aquitaine
				}
				AND = {
					has_landed_title = k_france
					k_aquitaine = {
						has_holder = no
					}
				}
			}
		}
		effect = {
			k_aquitaine = {
				k_france = {
					copy_title_history = PREV
				}
				hidden_tooltip = {
					any_direct_de_jure_vassal_title = {
						de_jure_liege = k_france
					}
					destroy_landed_title = THIS
				}
			}
			activate_title = { title = k_aquitaine status = no }
			k_france = {
				set_name=""
				adjective=""
				succession_w_cooldown = feudal_elective
			}
			set_global_flag = west_francia_renamed
			hidden_tooltip = {
				if = {
					limit = {
						NOT = { dynasty = 25061 } # Karling dynasty
					}
					character_event = {id = 62930}
				}
			}
			
			
		}
		ai_will_do = {
			factor = 1
		}
	}

	form_germany = {
		is_high_prio = yes
		only_independent = yes
		potential = {
			year = 860
			higher_tier_than = DUKE
			OR = {
				has_landed_title = k_lotharingia
				has_landed_title = k_germany
			}
			NOT = { has_global_flag = east_francia_renamed }
		}

		allow = {
			war = no
			has_regent = no
			OR = {
				AND = {
					has_landed_title = k_germany
					has_landed_title = k_lotharingia
				}
				AND = {
					has_landed_title = k_germany
					k_lotharingia = {
						has_holder = no
					}
				}
			}
		}
		effect = {
			k_lotharingia = {
				k_germany = {
					copy_title_history = PREV
				}
				hidden_tooltip = {
					any_direct_de_jure_vassal_title = {
						de_jure_liege = k_germany
					}
					destroy_landed_title = THIS
				}
			}
			activate_title = { title = k_lotharingia status = no }
			k_germany = {
				set_name=""
				adjective=""
				succession_w_cooldown = feudal_elective
			}
			set_global_flag = east_francia_renamed
			hidden_tooltip = {
				if = {
					limit = {
						NOT = { dynasty = 25061 } # Karling dynasty
					}
					character_event = {id = 62931}
				}
			}
			
			
		}
		ai_will_do = {
			factor = 1
		}
	}
	
	form_east_francia = {
		is_high_prio = yes
		only_independent = yes
		potential = {
			NOT = {year = 860}
			has_landed_title = k_saxony
			NOT = { culture = old_saxon}
			NOT = { has_global_flag = east_francia_combined }
		}

		allow = {
			war = no
			has_regent = no
			has_landed_title = k_saxony
			OR = {
				has_landed_title = k_germany
				completely_controls = k_germany
			}
		}
		effect = {
			k_saxony = {
				hidden_tooltip = {
					any_direct_de_jure_vassal_title = {
						de_jure_liege = k_germany
					}
					
					destroy_landed_title = THIS
				}
			}
			activate_title = { title = k_saxony status = no }
			if = {
				limit = {NOT = {has_landed_title = k_germany}}
				k_germany = {
					grant_title = ROOT
				}
			}
			set_global_flag = east_francia_combined
		}
		ai_will_do = {
			factor = 1
		}
	}
	
	
	form_lotharingia = {
		is_high_prio = yes
		only_independent = yes
		potential = {
			NOT = {year = 860}
			has_landed_title = k_lotharingia
			dynasty = 25061
			NOT = { has_global_flag = middle_francia_renamed }
		}

		allow = {
			war = no
			has_regent = no
			has_landed_title = k_lotharingia
			OR = {
				has_landed_title = k_france
				completely_controls = k_france
			}
		}
		effect = {
			d_champagne = {
				de_jure_liege = k_france
			}
			d_burgundy = {
				de_jure_liege = k_france
			}
			d_poitou = {
				de_jure_liege = k_aquitaine
			}
			k_lotharingia = {
				set_name=AUSTRASIA
				adjective="AUSTRASIA_ADJ"
			}
			if = {
				limit = {NOT = {has_landed_title = k_france}}
				k_france = {
					grant_title = ROOT
				}
			}
			set_global_flag = middle_francia_renamed
		}
		ai_will_do = {
			factor = 1
		}
	}
	
	# form_danelaw = {
		# is_high_prio = yes
		
		# potential = {
			# year = 800
			# NOT = {year = 900}
			# independent = yes
			# lower_tier_than = KING
			# culture = norse
			# religion = norse_pagan
			# capital_holding = {
				# kingdom = {
					# title = k_england
				# }
			# }
			# NOT = { has_global_flag = danelaw }
		# }

		# allow = {
			# realm_size = 20
			# war = no
			# has_regent = no
		# }
		# effect = {
			# k_danelaw = {
				# grant_title = ROOT
			# }
			# hidden_tooltip = {
				# set_global_flag = danelaw
				# any_playable_ruler = {
					# limit = {
						# ai = no
					# }
					# narrative_event = {
						# id = TRB.3000
					# }
				# }
			# }
		# }
		
		# ai_will_do = {
			# factor = 1
		# }
	# }
	
	form_west_mercia = {
		is_high_prio = yes
		only_independent = yes
		potential = {
			year = 800
			NOT = {year = 900}
			culture = norse
			higher_tier_than = COUNT
			completely_controls = d_hereford
			NOT = {has_global_flag = west_mercia}
			c_warwick = {
				holder_scope = {
					OR = {
						ai = yes
						character = ROOT
					}
				}
			}
			
		}

		allow = {
			
			war = no
			has_regent = no
		}
		effect = {
			if = {
				limit = {
					completely_controls = c_leicester
					c_leicester =  {
						holder_scope = {
							ai = yes
							NOT = {culture = ROOT}
						}
					}
				}
				c_leicester =  {
					grant_title = ROOT
				}
			}
			if = {
				limit = {
					completely_controls = c_lincoln
					c_lincoln =  {
						holder_scope = {
							ai = yes
							NOT = {culture = ROOT}
						}
					}
				}
				c_lincoln =  {
					grant_title = ROOT
				}
			}
			if = {
				limit = {
					completely_controls = c_northampton
					c_northampton =  {
						holder_scope = {
							ai = yes
							NOT = {culture = ROOT}
						}
					}
				}
				c_northampton =  {
					grant_title = ROOT
				}
			}
			if = {
				limit = {
					completely_controls = c_bedford
					c_bedford = {
						holder_scope = {
							ai = yes
							NOT = {culture = ROOT}
						}
					}
				}
				c_bedford =  {
					grant_title = ROOT
				}
			}
			ROOT = {
				spawn_unit = {
					province = 62
					owner = THIS
					#leader = ROOT
					troops = {
						heavy_infantry = { 896 896 }
						light_infantry = { 228 228 }
					}
					attrition = 0.5
					reinforce_rate_multiplier = 0.05
				}

			}
			hidden_tooltip = {
				any_playable_ruler = {
					limit = {
						any_courtier = {
							character = 205112
						}
						NOT = {character = ROOT}
					}
					any_courtier = {
						limit = {character = 205112}
						add_trait = sympathy_pagans
						move_character = ROOT
					}
				}
				if = {
					limit = {
						NOT = {
							any_courtier = {
								character = 205112
							}
						}
					}
					create_character = {
						name = "Ceolwulf"
						random_traits = yes
						dynasty = random
						religion = catholic
						culture = saxon
						female = no
						age = 35
						attributes = {
							diplomacy = 1
							martial = 1
							stewardship = 1
							intrigue = 1
							learning = 1
						}
						trait = naive_appeaser
						
					}
					new_character = {
						add_trait = sympathy_pagans
						set_character_flag = puppet
					}
				}
				
				random_courtier = {
					limit = {
						OR = {
							character = 205112
							has_character_flag = puppet
						}
					}
					c_warwick = {
						grant_title = PREV
					}
					d_hereford = {
						grant_title = PREV
						add_law = ze_administration_laws_witan
					}
					set_government_type = feudal_government
					set_defacto_liege = THIS
					
					if = {
						limit = {
							c_chester = {
								holder_scope = {
									character = ROOT
								}
							}
						}
						c_chester = {
							grant_title = PREV
						}
					}
					
					if = {
						limit = {
							ROOT = {completely_controls = c_chester}
							c_chester = {
								holder_scope = {
									lower_tier_than = DUKE
								}
							}
						}
						c_chester = {
							holder_scope = {
								set_defacto_liege = PREVPREV
							}
						}
					}
					
					if = {
						limit = {
							c_derby = {
								holder_scope = {
									character = ROOT
								}
							}
						}
						c_derby = {
							grant_title = PREV
						}
					}
					if = {
						limit = {
							ROOT = {completely_controls = c_derby}
							c_derby = {
								holder_scope = {
									lower_tier_than = DUKE
								}
							}
						}
						c_derby = {
							holder_scope = {
								set_defacto_liege = PREVPREV
							}
						}
					}
					
					if = {
						limit = {
							c_worcester = {
								holder_scope = {
									character = ROOT
								}
							}
						}
						c_worcester = {
							grant_title = PREV
						}
					}
					if = {
						limit = {
							c_worcester = {
								holder_scope = {
									lower_tier_than = DUKE
								}
							}
						}
						c_worcester = {
							holder_scope = {
								set_defacto_liege = PREVPREV
							}
						}
					}
					
					if = {
						limit = {
							c_shrewsbury = {
								holder_scope = {
									character = ROOT
								}
							}
						}
						c_shrewsbury = {
							grant_title = PREV
						}
					}
					if = {
						limit = {
							c_shrewsbury = {
								holder_scope = {
									lower_tier_than = DUKE
								}
							}
						}
						c_shrewsbury = {
							holder_scope = {
								set_defacto_liege = PREVPREV
							}
						}
					}
					
					if = {
						limit = {
							c_hereford = {
								holder_scope = {
									character = ROOT
								}
							}
						}
						c_hereford = {
							grant_title = PREV
						}
					}
					if = {
						limit = {
							c_hereford = {
								holder_scope = {
									lower_tier_than = DUKE
								}
							}
						}
						c_hereford = {
							holder_scope = {
								set_defacto_liege = PREVPREV
							}
						}
					}
					 
					
					add_friend = ROOT
					ROOT = {
						make_tributary = { who = PREV percentage = 0.8 }
					}
					opinion = {
						modifier = in_non_aggression_pact
						who = ROOT
						years = 10
					}
					reverse_opinion = {
						modifier = in_non_aggression_pact
						who = ROOT
						years = 10
					}
					add_alliance = { who = ROOT years = 30 }
					spawn_unit = {
						province = 67
						owner = THIS
						#leader = ROOT
						troops = {
							light_infantry = { 1344 1344 }
						}
						attrition = 0.5
						reinforce_rate_multiplier = 1
						cannot_inherit = yes
					}
					
					character_event = {
						id = TRB.4100
						days = 1
					}
				}
			}


		}
		
		ai_will_do = {
			factor = 1
		}
	}

}