#######################################
#
# Kingdom Formation Events
#
#######################################

# Written by Charlemagne1428

namespace = CaK

# Kingdom of Gallia Formed
narrative_event = {
	id = CaK.1
	title = EVTNAMECaK.1
	desc =EVTDESCCaK.1
	
	picture = GFX_evt_stone_church
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTACaK.1
		give_nickname = nick_the_great
		k_gallia = {
			grant_title = ROOT
			copy_title_laws = yes
		}
	}
	
	immediate = {
		any_demesne_title = {
			limit = {
				empire = {
					title = e_britannia
				}
			}
			destroy_landed_title = THIS
		
		}
		any_realm_province = {
			limit = {
				OR = {
					empire = {
						title = e_britannia
					}
				}
				owner = {
					# Human vassals get to keep their stuff
					OR = {
						ai = yes
						character = ROOT
					}
				}
			}
			county = {
				create_character = {
					random_traits = yes
					dynasty = none
					religion = PREV
					culture = PREV
					female = no
					age = 25
					trait = peasant_leader
				}
				new_character = {
					usurp_title_plus_barony_if_unlanded = PREV
					set_defacto_liege = THIS
				}
			}
		}
	
	}
}

# Kingdom of Belgica Formed
narrative_event = {
	id = CaK.2
	title = EVTNAMECaK.2
	desc =EVTDESCCaK.2
	
	picture = GFX_evt_stone_church
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTACaK.2
		give_nickname = nick_the_great
		k_belgica = {
			grant_title = ROOT
			copy_title_laws = yes
		}
	}
	
	immediate = {
		any_demesne_title = {
			limit = {
				empire = {
					title = e_britannia
				}
			}
			destroy_landed_title = THIS
		
		}
		any_realm_province = {
			limit = {
				OR = {
					empire = {
						title = e_britannia
					}
				}
				owner = {
					# Human vassals get to keep their stuff
					OR = {
						ai = yes
						character = ROOT
					}
				}
			}
			county = {
				create_character = {
					random_traits = yes
					dynasty = none
					religion = PREV
					culture = PREV
					female = no
					age = 25
					trait = peasant_leader
				}
				new_character = {
					usurp_title_plus_barony_if_unlanded = PREV
					set_defacto_liege = THIS
				}
			}
		}
	
	}
}

# Kingdom of Brittonia Formed
narrative_event = {
	id = CaK.3
	title = EVTNAMECaK.3
	desc =EVTDESCCaK.3
	
	picture = GFX_evt_stone_church
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTACaK.3
		give_nickname = nick_the_great
		k_brittonia = {
			grant_title = ROOT
			copy_title_laws = yes
		}
	}
}

# Kingdom of Cantabria Formed
narrative_event = {
	id = CaK.4
	title = EVTNAMECaK.4
	desc =EVTDESCCaK.4
	
	picture = GFX_evt_stone_church
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTACaK.4
		give_nickname = nick_the_great
		k_cantabria = {
			grant_title = ROOT
			copy_title_laws = yes
		}
	}
	
	immediate = {
		any_demesne_title = {
			limit = {
				empire = {
					title = e_britannia
				}
			}
			destroy_landed_title = THIS
		
		}
		any_realm_province = {
			limit = {
				OR = {
					empire = {
						title = e_britannia
					}
				}
				owner = {
					# Human vassals get to keep their stuff
					OR = {
						ai = yes
						character = ROOT
					}
				}
			}
			county = {
				create_character = {
					random_traits = yes
					dynasty = none
					religion = PREV
					culture = PREV
					female = no
					age = 25
					trait = peasant_leader
				}
				new_character = {
					usurp_title_plus_barony_if_unlanded = PREV
					set_defacto_liege = THIS
				}
			}
		}
	
	}
}

# Kingdom of Galicia Formed
narrative_event = {
	id = CaK.5
	title = EVTNAMECaK.5
	desc =EVTDESCCaK.5
	
	picture = GFX_evt_stone_church
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTACaK.5
		give_nickname = nick_the_great
		k_galicia = {
			grant_title = ROOT
			copy_title_laws = yes
		}
	}
	
	immediate = {
		any_demesne_title = {
			limit = {
				empire = {
					title = e_britannia
				}
			}
			destroy_landed_title = THIS
		
		}
		any_realm_province = {
			limit = {
				OR = {
					empire = {
						title = e_britannia
					}
				}
				owner = {
					# Human vassals get to keep their stuff
					OR = {
						ai = yes
						character = ROOT
					}
				}
			}
			county = {
				create_character = {
					random_traits = yes
					dynasty = none
					religion = PREV
					culture = PREV
					female = no
					age = 25
					trait = peasant_leader
				}
				new_character = {
					usurp_title_plus_barony_if_unlanded = PREV
					set_defacto_liege = THIS
				}
			}
		}
	
	}
}

# Kingdom of Lusitania Formed
narrative_event = {
	id = CaK.6
	title = EVTNAMECaK.6
	desc =EVTDESCCaK.6
	
	picture = GFX_evt_stone_church
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTACaK.6
		give_nickname = nick_the_great
		k_lusitani = {
			grant_title = ROOT
			copy_title_laws = yes
		}
	}
	
	immediate = {
		any_demesne_title = {
			limit = {
				empire = {
					title = e_britannia
				}
			}
			destroy_landed_title = THIS
		
		}
		any_realm_province = {
			limit = {
				OR = {
					empire = {
						title = e_britannia
					}
				}
				owner = {
					# Human vassals get to keep their stuff
					OR = {
						ai = yes
						character = ROOT
					}
				}
			}
			county = {
				create_character = {
					random_traits = yes
					dynasty = none
					religion = PREV
					culture = PREV
					female = no
					age = 25
					trait = peasant_leader
				}
				new_character = {
					usurp_title_plus_barony_if_unlanded = PREV
					set_defacto_liege = THIS
				}
			}
		}
	
	}
}

# Kingdom of Celtiberia Formed
narrative_event = {
	id = CaK.7
	title = EVTNAMECaK.7
	desc =EVTDESCCaK.7
	
	picture = GFX_evt_stone_church
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTACaK.7
		give_nickname = nick_the_great
		k_celtiberia = {
			grant_title = ROOT
			copy_title_laws = yes
		}
	}
	
	immediate = {
		any_demesne_title = {
			limit = {
				empire = {
					title = e_britannia
				}
			}
			destroy_landed_title = THIS
		
		}
		any_realm_province = {
			limit = {
				OR = {
					empire = {
						title = e_britannia
					}
				}
				owner = {
					# Human vassals get to keep their stuff
					OR = {
						ai = yes
						character = ROOT
					}
				}
			}
			county = {
				create_character = {
					random_traits = yes
					dynasty = none
					religion = PREV
					culture = PREV
					female = no
					age = 25
					trait = peasant_leader
				}
				new_character = {
					usurp_title_plus_barony_if_unlanded = PREV
					set_defacto_liege = THIS
				}
			}
		}
	
	}
}

# French Culture Break-Up
narrative_event = {
	id = CaK.8
	title = EVTNAMECaK.8
	desc =EVTDESCCaK.8
	
	picture = GFX_evt_french_flag
	
	trigger = {
		NOT = { has_global_flag = french_culture_breakup }
	}
	
	mean_time_to_happen = {
		months = 600
	}
	
	option = {
		name = EVTOPTACaK.8
		set_global_flag = french_culture_breakup
	}
}