# DO NOT ALTER THE NAME OR NUMBER OF THESE!

succession_laws = {

#	succ_my_test_law = {
#		child_opinion = 15
#		dynasty_opinion = 5
#	
#		potential = {
#			holder_scope = {
#				is_nomadic = no
#				OR = {
#					independent = yes
#					NOT = {
#						any_liege = {
#							holy_order = yes
#						}
#					}
#				}
#				NOT = { religion_group = muslim }
#				is_merchant_republic = no
#				is_patrician = no
#				OR = {
#					independent = yes
#					NOT = {
#						any_demesne_title = {
#							is_vice_royalty = yes
#						}
#					}
#				}
#			}
#			OR = {
#				is_landless_type_title = no
#				is_tribal_type_title = yes
#				temporary = yes
#			}
#			
#			rebel = no
#			
#			OR = {
#				holder_scope = { is_feudal = yes }
#				holder_scope = { is_tribal = yes }
#			}
#			is_primary_type_title = no
#			NOT = { holder_scope = { government = confucian_bureaucracy } }
#			NOT = { holder_scope = { government = chinese_imperial_government } }
#		}
#		allow = {
#			conditional_tooltip = {
#				trigger = {
#					has_dlc = "Conclave"
#				}
#				custom_tooltip = {
#					text = forced_elective_tt
#					hidden_tooltip = {
#						NAND = { 
#							has_law = succession_voting_power_1
#							has_law = succ_feudal_elective
#						}
#					}
#				}
#			}
#			holder_scope = {
#				show_scope_change = no
#				in_revolt = no
#			}
#		}
#		effect = {
#			succession = {
#				base_type = feudal_elective 
#				voting_rules = my_test_law #Definded in common/00_succession_voting
#			}
#			elective_voting_rules = my_test_law
#		}
#		revoke_allowed = {
#			always = no
#		}			
#	}

	succ_gavelkind = {
		oldest_child_opinion = -5
		child_opinion = 15
		dynasty_opinion = 5
		vassal_opinion = 5
	
		potential = {
			NAND = { 
				has_law = succ_confederacy_elective
				OR = { 
					has_flag = confederacy
				}
			}
			NOR = {
				title = e_cyrodiil
				title = e_tamriel
			}
			NAND = {
				OR = {
					title = k_skyrim
					title = e_nordic
				}
				holder_scope = {
					OR = {
						culture = nord
						culture = skaal
						culture = atmoran
					}
				}
			}
			NOT = { has_law = succ_imperial_commune_elective }
			holder_scope = {
				OR = {
					independent = yes
					NOT = {
						any_liege = {
							holy_order = yes
						}
					}
				}
				is_merchant_republic = no
				is_patrician = no
				NOT = { culture = orsimer }
				NOT = { culture = kamal }
				NOT = { culture = tsaesci }
				NOT = { culture = tangmo }
				NOR = { 
					government = orsimer_government
					government = confederacy_government
					government = matriarchy_government
					government = imperial_commune_government
					government = reformed_imperial_commune_government
					government = confucian_bureaucracy
					government = chinese_imperial_government
				}
				NOT = { AND = { has_landed_title = d_riddle trait = mane } }
				OR = {
					independent = yes
					NOT = {
						any_demesne_title = {
							is_vice_royalty = yes
						}
					}
				}
			}
			OR = {
				is_landless_type_title = no
				is_tribal_type_title = yes
				temporary = yes
			}
			
			rebel = no
			
			OR = {
				holder_scope = { is_feudal = yes }
				holder_scope = { is_tribal = yes }
			}
			is_primary_type_title = no
			NOT = { holder_scope = { government = confucian_bureaucracy } }
			is_dunmer_great_house_title = no
		}
		allow = {
			holder_scope = {
				show_scope_change = no
				in_revolt = no
			}
			conditional_tooltip = {
				trigger = {
					has_dlc = "Conclave"
				}
				custom_tooltip = {
					text = forced_elective_tt
					hidden_tooltip = {
						NAND = { 
							has_law = succession_voting_power_1
							has_law = succ_feudal_elective
						}
					}
				}
			}
		}
		effect = {
			succession = gavelkind
		}
		revoke_allowed = {
			always = no
		}			
	}
	
	succ_elective_gavelkind = {
		child_opinion = 15
		dynasty_opinion = 5
	
		potential = {
			NAND = { 
				has_law = succ_confederacy_elective 
				OR = { 
					has_flag = confederacy
				}
			}
			NOR = {
				title = e_cyrodiil
				title = e_tamriel
			}
			NAND = {
				OR = {
					title = k_skyrim
					title = e_nordic
				}
				holder_scope = {
					OR = {
						culture = nord
						culture = skaal
						culture = atmoran
					}
				}
			}
			NOT = { has_law = succ_imperial_commune_elective }
			holder_scope = {
				is_nomadic = no
				OR = {
					independent = yes
					NOT = {
						any_liege = {
							holy_order = yes
						}
					}
				}
				is_merchant_republic = no
				is_patrician = no
				NOR = { 
					government = orsimer_government
					government = confederacy_government
					government = matriarchy_government
					government = imperial_commune_government
					government = reformed_imperial_commune_government
					government = confucian_bureaucracy
					government = chinese_imperial_government
				}
				NOT = { AND = { has_landed_title = d_riddle trait = mane } }
				OR = {
					independent = yes
					NOT = {
						any_demesne_title = {
							is_vice_royalty = yes
						}
					}
				}
			}
			OR = {
				is_landless_type_title = no
				is_tribal_type_title = yes
				temporary = yes
			}
			
			rebel = no
			
			holder_scope = { is_tribal = yes }
			is_primary_type_title = no
			is_dunmer_great_house_title = no
		}
		allow = {
			conditional_tooltip = {
				trigger = {
					has_dlc = "Conclave"
				}
				custom_tooltip = {
					text = forced_elective_tt
					hidden_tooltip = {
						NAND = { 
							has_law = succession_voting_power_1
							has_law = succ_feudal_elective
						}
					}
				}
			}
			holder_scope = {
				show_scope_change = no
				in_revolt = no
			}
		}
		effect = {
			succession = {
				base_type = elective_gavelkind
				voting_rules = elective_gavelkind
			}
		}
		revoke_allowed = {
			always = no
		}			
	}
	
	succ_eldership = {
		dynasty_opinion = 5
	
		potential = {
			holder_scope = {
				always = no
			}
			NAND = { 
				has_law = succ_confederacy_elective 
				OR = { 
					has_flag = confederacy
				}
			}
			NOR = {
				title = e_cyrodiil
				title = e_tamriel
			}
			NAND = {
				OR = {
					title = k_skyrim
					title = e_nordic
				}
				holder_scope = {
					OR = {
						culture = nord
						culture = skaal
						culture = atmoran
					}
				}
			}
			NOT = { has_law = succ_imperial_commune_elective }
			holder_scope = {
				has_dlc = "Holy Fury"
				is_nomadic = no
				OR = {
					independent = yes
					NOT = {
						any_liege = {
							holy_order = yes
						}
					}
				}
				is_merchant_republic = no
				is_patrician = no
				OR = {
					independent = yes
					NOT = {
						any_demesne_title = {
							is_vice_royalty = yes
						}
					}
				}
			}
			OR = {
				is_landless_type_title = no
				is_tribal_type_title = yes
				temporary = yes
			}
			
			rebel = no
			
			OR = {
				holder_scope = { is_feudal = yes }
				holder_scope = { is_tribal = yes }
			}
			is_primary_type_title = no
			NOT = { holder_scope = { government = confucian_bureaucracy } }
			NOT = { holder_scope = { government = chinese_imperial_government } }
			is_dunmer_great_house_title = no
		}
		allow = {
			conditional_tooltip = {
				trigger = {
					has_dlc = "Holy Fury"
				}
				holder_scope = {
					always = no
				}
				custom_tooltip = {
					text = forced_elective_tt
					hidden_tooltip = {
						NAND = { 
							has_law = succession_voting_power_1
							has_law = succ_feudal_elective
						}
					}
				}
			}
			holder_scope = {
				show_scope_change = no
				in_revolt = no
			}
		}
		effect = {
			succession = {
				base_type = tanistry
				voting_rules = eldership_rules
			}
			elective_voting_rules = eldership_rules
		}
		revoke_allowed = {
			always = no
		}			
	}
	
	succ_seniority = {
		vassal_opinion = -5
		oldest_child_opinion = -15
		child_opinion = -10
		dynasty_opinion = 5
	
		potential = {
			NAND = { 
				has_law = succ_confederacy_elective 
				OR = { 
					has_flag = confederacy
				}
			}
			NOT = { has_law = succ_imperial_commune_elective }
			NOR = {
				title = e_cyrodiil
				title = e_tamriel
			}
			NAND = {
				OR = {
					title = k_skyrim
					title = e_nordic
				}
				holder_scope = {
					OR = {
						culture = nord
						culture = skaal
						culture = atmoran
					}
				}
			}
			holder_scope = {
				OR = {
					independent = yes
					NOT = {
						any_liege = {
							holy_order = yes
						}
					}
				}
				OR = {
					is_merchant_republic = no
					primary_title = {
						NOT = { title = PREVPREV }
					}
				}
				
				NOT = { AND = { has_landed_title = d_riddle trait = mane } }
				OR = {
					NOR = { 
						government = orsimer_government
						government = confederacy_government
						government = matriarchy_government
						government = imperial_commune_government
						government = reformed_imperial_commune_government
						government = confucian_bureaucracy
						government = chinese_imperial_government
					}
					is_patrician = yes
				}
				
				OR = {
					is_republic = no
					is_patrician = yes
				}
				OR = {
					independent = yes
					NOT = {
						any_demesne_title = {
							is_vice_royalty = yes
						}
					}
				}
			}
			OR = {
				is_landless_type_title = no
				is_tribal_type_title = yes
				temporary = yes
			}
			OR = {
				AND = {
					tier = baron
					is_feudal = yes
				}
				holder_scope = { is_feudal = yes }
				holder_scope = { is_patrician = yes }
			}
			
			is_primary_type_title = no
			
			OR = {
				NOT = { tier = baron }
				holder_scope = { is_patrician = yes }
			}
			
			NOT = { holder_scope = { government = confucian_bureaucracy } }
			is_dunmer_great_house_title = no
		}
		
		allow = {
			
			conditional_tooltip = {
				trigger = {
					NOT = { has_dlc = "Conclave" }
				}
				OR = {
					hidden_tooltip = {
						has_crown_law_title = no
					}
					holder_scope = {
						show_scope_change = no
						is_patrician = yes 
						OR = {
							is_merchant_republic = no
							PREV = {
								is_primary_holder_title = no
							}
							NOT = {
								in_revolt = yes
								succ_law_title = {
									title = PREVPREV
								}
							}
						}
					}
					crownlaw_title = {
						OR = {
							has_law = crown_authority_2
							has_law = crown_authority_3
							has_law = crown_authority_4
						}
					}
				}
			}
			custom_tooltip = {
				text = not_forced_tt
				hidden_tooltip = {
					holder_scope = { NOT = { has_character_flag = liege_forced_succ_law } }
				}
			}
			conditional_tooltip = {
				trigger = {
					has_dlc = "Conclave"
				}
				custom_tooltip = {
					text = forced_elective_tt
					hidden_tooltip = {
						NAND = { 
							has_law = succession_voting_power_1
							has_law = succ_feudal_elective
						}
					}
				}
			}
		}
		
		effect = {
			succession = seniority
		}
		revoke_allowed = {
			always = no
		}			
	}
	
	succ_primogeniture = {
		oldest_child_opinion = 10
		youngest_child_opinion = -15
		child_opinion = -10
		dynasty_opinion = -5
		potential = {
			NAND = { 
				has_law = succ_confederacy_elective 
				OR = { 
					has_flag = confederacy
				}
			}
			NOT = { has_law = succ_imperial_commune_elective }
			NOR = {
				title = e_cyrodiil
				title = e_tamriel
			}
			NAND = {
				OR = {
					title = k_skyrim
					title = e_nordic
				}
				holder_scope = {
					OR = {
						culture = nord
						culture = skaal
						culture = atmoran
					}
				}
			}
			holder_scope = {
				is_merchant_republic = no
				is_patrician = no
				NOR = {
					culture = orsimer
					culture = reachmen
					culture = kamal
					culture = tangmo
					
					government = orsimer_government
					government = confederacy_government
					government = imperial_commune_government
					government = reformed_imperial_commune_government
					government = confucian_bureaucracy
					government = chinese_imperial_government
					AND = { has_landed_title = d_riddle trait = mane }
				}
			}
			OR = {
				holder_scope = { # Viceroyalties can always have primogeniture if not muslim
					any_demesne_title = {
						is_vice_royalty = yes
					}
				}
				AND = {
					holder_scope = {
						OR = {
							independent = yes
							NOT = {
								any_liege = {
									holy_order = yes
								}
							}
						}
					}
					OR = {
						is_landless_type_title = no
						is_tribal_type_title = yes
						temporary = yes
					}
					is_primary_type_title = no
					OR = {
						AND = {
							tier = baron
							is_feudal = yes
						}
						holder_scope = { is_feudal = yes }
						holder_scope = { is_tribal = yes }
					}
				}
			}
			is_dunmer_great_house_title = no
		}
		allow = {
			conditional_tooltip = {
				trigger = {
					has_dlc = "Conclave"
				}
				OR = {
					holder_scope = { # Viceroyalties can always have primogeniture if not muslim
						show_scope_change = no
						any_demesne_title = {
							is_vice_royalty = yes
						}
					}
					AND = {
						holder_scope = {
							show_scope_change = no
							primary_title = {
								show_scope_change = no
								OR = {
									has_law = ze_administration_laws_1
									has_law = ze_administration_laws_2
								}
							}
						}
					}
				}
			}
			conditional_tooltip = {
				trigger = {
					NOT = { has_dlc = "Conclave" }
				}
				OR = {
					holder_scope = { # Viceroyalties can always have primogeniture if not muslim
						show_scope_change = no
						any_demesne_title = {
							is_vice_royalty = yes
						}
					}
					hidden_tooltip = {
						has_crown_law_title = no
					}
					crownlaw_title = {
						OR = {
							has_law = crown_authority_3
							has_law = crown_authority_4
						}
					}
				}
			}
			custom_tooltip = {
				text = not_forced_tt
				hidden_tooltip = {
					holder_scope = { NOT = { has_character_flag = liege_forced_succ_law } }
				}
			}
			conditional_tooltip = {
				trigger = {
					has_dlc = "Conclave"
				}
				custom_tooltip = {
					text = forced_elective_tt
					hidden_tooltip = {
						NAND = { 
							has_law = succession_voting_power_1
							has_law = succ_feudal_elective
						}
					}
				}
			}
		}
		
		effect = {
			succession = primogeniture
		}
		revoke_allowed = {
			always = no
		}
	}
	
	succ_feudal_elective = {
		oldest_child_opinion = -15
		child_opinion = -5
		dynasty_opinion = -5
		vassal_opinion = 10
		potential = {
			NOT = { 
				has_law = succ_confederacy_elective 
				OR = { 
					has_flag = confederacy
				}
			}
			NOR = {
				title = e_cyrodiil
				title = e_tamriel
			}
			NAND = {
				OR = {
					title = k_skyrim
					title = e_nordic
				}
				holder_scope = {
					OR = {
						culture = nord
						culture = skaal
						culture = atmoran
					}
				}
			}
			holder_scope = {
				OR = {
					independent = yes
					NOT = {
						any_liege = {
							holy_order = yes
						}
					}
				}
				is_merchant_republic = no
				is_patrician = no
				NOR = {
					culture = orsimer
					government = orsimer_government
					government = matriarchy_government
					government = imperial_commune_government
					government = reformed_imperial_commune_government
					government = confucian_bureaucracy
					government = chinese_imperial_government
					AND = { has_landed_title = d_riddle trait = mane }
				}
				OR = {
					independent = yes
					NOT = {
						any_demesne_title = {
							is_vice_royalty = yes
						}
					}
				}
			}
			OR = {
				is_landless_type_title = no
				is_tribal_type_title = yes
				temporary = yes
			}
			is_primary_type_title = no
			NOT = { tier = baron }
			holder_scope = {
				OR = {
					is_feudal = yes
					has_law = succession_voting_power_1
					OR = { 
						has_law = succ_feudal_elective # Keep it even if you revoke Full Council Authority
						#has_law = succ_hre_elective
					}
				}
			}
			is_dunmer_great_house_title = no
		}
		allow = {
			custom_tooltip = {
				text = not_forced_tt
				hidden_tooltip = {
					holder_scope = { NOT = { has_character_flag = liege_forced_succ_law } }
				}
			}
		}
		effect = {
			succession = {
				base_type = feudal_elective
				voting_rules = feudal_elective
			}
		}
		revoke_allowed = {
			always = no
		}			
	}
	succ_hre_elective = {
		oldest_child_opinion = -15
		child_opinion = -5
		dynasty_opinion = -5
		vassal_opinion = 15
		vassal_limit = 20
		potential = {
			always = no
		}
		allow = {
			always = no
		}
		effect = {
			succession = {
				base_type = feudal_elective
				voting_rules = feudal_confirmation
			}
		}
		revoke_allowed = {
			always = no
		}			
	}
	
	succ_byzantine_elective = {
		oldest_child_opinion = -5
		child_opinion = -5
		dynasty_opinion = -5
		feudal_opinion = -5
		potential = {
			always = no
		}
		allow = {
			always = no
		}
		effect = {
			succession = {
				base_type = feudal_elective
				voting_rules = feudal_confirmation
			}
		}
		revoke_allowed = {
			always = no
		}			
	}

	succ_tanistry = {
		oldest_child_opinion = -20
		child_opinion = -10
		dynasty_opinion = 5
		vassal_opinion = 5
		potential = {
			NAND = { 
				has_law = succ_confederacy_elective 
				OR = { 
					has_flag = confederacy
				}
			}
			NOT = { has_law = succ_imperial_commune_elective }
			OR = {
				holder_scope = {
					culture = tangmo
				}
				higher_tier_than = BARON
			}
			NOR = {
				title = e_cyrodiil
				title = e_tamriel
			}
			NAND = {
				OR = {
					title = k_skyrim
					title = e_nordic
				}
				holder_scope = {
					OR = {
						culture = nord
						culture = skaal
						culture = atmoran
					}
				}
			}
			holder_scope = {
				OR = {
					independent = yes
					NOT = {
						any_liege = {
							holy_order = yes
						}
					}
				}
				#NOT = { religion_group = muslim }
				is_merchant_republic = no
				is_patrician = no
				NOT = { culture = orsimer }
				NOR = { 
					government = orsimer_government
					government = confederacy_government
					government = matriarchy_government
					government = imperial_commune_government
					government = reformed_imperial_commune_government
					government = confucian_bureaucracy
					government = chinese_imperial_government
				}
				NOT = { AND = { has_landed_title = d_riddle trait = mane } }
				OR = {
					independent = yes
					NOT = {
						any_demesne_title = {
							is_vice_royalty = yes
						}
					}
				}
			}
			OR = {
				is_landless_type_title = no
				is_tribal_type_title = yes
				temporary = yes
			}
			is_primary_type_title = no
			NOT = { tier = baron }
			OR = {
				AND = {
					tier = baron
					is_feudal = yes
				}
				holder_scope = { is_feudal = yes }
			}
			NOT = { holder_scope = { government = confucian_bureaucracy } }
			NOT = { holder_scope = { government = chinese_imperial_government } }
			holder_scope = { government = technocratic_feudal }
			is_dunmer_great_house_title = no
		}
		allow = {
			OR = {
				holder_scope = { is_feudal = yes }
				holder_scope = { is_tribal = yes }
			}
			custom_tooltip = {
				text = not_forced_tt
				hidden_tooltip = {
					holder_scope = { NOT = { has_character_flag = liege_forced_succ_law } }
				}
			}
			conditional_tooltip = {
				trigger = {
					has_dlc = "Conclave"
				}
				custom_tooltip = {
					text = forced_elective_tt
					hidden_tooltip = {
						NAND = { 
							has_law = succession_voting_power_1
							has_law = succ_feudal_elective
						}
					}
				}
			}
		}
		effect = {
			succession = {
				base_type = tanistry
				voting_rules = tanistry
			}
		}
		revoke_allowed = {
			always = no
		}			
	}
	
	succ_ultimogeniture = {
		youngest_child_opinion = 10
		oldest_child_opinion = -15
		child_opinion = -10
		dynasty_opinion = -5
		potential = {
			NAND = { 
				has_law = succ_confederacy_elective 
				OR = { 
					has_flag = confederacy
				}
			}
			NOT = { has_law = succ_imperial_commune_elective }
			higher_tier_than = DUKE
			NOR = {
				title = e_cyrodiil
				title = e_tamriel
			}
			NAND = {
				OR = {
					title = k_skyrim
					title = e_nordic
				}
				holder_scope = {
					OR = {
						culture = nord
						culture = skaal
						culture = atmoran
					}
				}
			}
			holder_scope = {
				OR = {
					independent = yes
					NOT = {
						any_liege = {
							holy_order = yes
						}
					}
				}
				NOT = { culture = orsimer }
				NOT = { culture = reachmen }
				NOT = { culture = kamal }
				NOT = { culture = tangmo }
				NOR = { 
					government = orsimer_government
					government = confederacy_government
					government = matriarchy_government
					government = imperial_commune_government
					government = reformed_imperial_commune_government
					government = confucian_bureaucracy
					government = chinese_imperial_government
				}
				NOT = { AND = { has_landed_title = d_riddle trait = mane } }
				
				#NOT = { religion_group = muslim }
				is_merchant_republic = no
				is_patrician = no
				OR = {
					independent = yes
					NOT = {
						any_demesne_title = {
							is_vice_royalty = yes
						}
					}
				}
			}
			OR = {
				is_landless_type_title = no
				is_tribal_type_title = yes
				temporary = yes
			}
			is_primary_type_title = no
			OR = {
				AND = {
					tier = baron
					is_feudal = yes
				}
				holder_scope = { is_feudal = yes }
			}
			NOT = { holder_scope = { government = confucian_bureaucracy } }
			is_dunmer_great_house_title = no
		}
		allow = {
			conditional_tooltip = {
				trigger = {
					has_dlc = "Conclave"
				}
				holder_scope = {
					show_scope_change = no
					primary_title = {
						show_scope_change = no
						OR = {
							has_law = ze_administration_laws_1
							has_law = ze_administration_laws_2
						}
					}
				}
			}
			conditional_tooltip = {
				trigger = {
					NOT = { has_dlc = "Conclave" }
				}
				OR = {
					hidden_tooltip = {
						has_crown_law_title = no
					}
					crownlaw_title = {
						OR = { 
							has_law = crown_authority_1
							has_law = crown_authority_2
							has_law = crown_authority_3
							has_law = crown_authority_4
						}
					}
				}
			}
			custom_tooltip = {
				text = not_forced_tt
				hidden_tooltip = {
					holder_scope = { NOT = { has_character_flag = liege_forced_succ_law } }
				}
			}
			conditional_tooltip = {
				trigger = {
					has_dlc = "Conclave"
				}
				custom_tooltip = {
					text = forced_elective_tt
					hidden_tooltip = {
						NAND = { 
							has_law = succession_voting_power_1
							has_law = succ_feudal_elective
						}
					}
				}
			}
		}
		
		effect = {
			succession = ultimogeniture
		}
		revoke_allowed = {
			always = no
		}
	}

	succ_turkish_succession = {
		oldest_child_opinion = -5
#		child_opinion = 30
#		dynasty_opinion = 10
		potential = {
			NAND = { 
				has_law = succ_confederacy_elective 
				OR = { 
					has_flag = confederacy
				}
			}
			NOT = { has_law = succ_imperial_commune_elective }
			NOR = {
				title = e_cyrodiil
				title = e_tamriel
			}
			NAND = {
				OR = {
					title = k_skyrim
					title = e_nordic
				}
				holder_scope = {
					OR = {
						culture = nord
						culture = skaal
						culture = atmoran
					}
				}
			}
			holder_scope = {
				#religion_group = muslim
				is_republic = no
				is_merchant_republic = no
				is_nomadic = no
				OR = {
					culture = orsimer
					culture = reachmen
					culture = skaal
					culture = kamal
					culture = tangmo
					government = orsimer_government
				}
				NOT = { government = confederacy_government }
				OR = {
					is_theocracy = no
					religion = satakal
					religion_group = daedra
					religion_group = khajiit_pantheon
					religion = dragon_cult
				}
				NOR = {
					government = confederacy_government
					government = matriarchy_government
					government = imperial_commune_government
					government = reformed_imperial_commune_government
					government = confucian_bureaucracy
					government = chinese_imperial_government
				}
				NOT = { AND = { has_landed_title = d_riddle trait = mane } }
			}
			OR = {
				holder_scope = { # Viceroyalties can always have turkish succession if muslim
					any_demesne_title = {
						is_vice_royalty = yes
					}
				}
				AND = {
					OR = {
						is_landless_type_title = no
						is_tribal_type_title = yes
						temporary = yes
					}
					holder_scope = {
						OR = {
							independent = yes
							NOT = {
								any_liege = {
									holy_order = yes
								}
							}
						}
					}
					is_primary_type_title = no
				}
			}
			NAND = { 
				has_law = succession_voting_power_1
				has_law = succ_feudal_elective
			}
			NOT = { holder_scope = { government = confucian_bureaucracy } }
			is_dunmer_great_house_title = no
		}
		effect = {
			succession = turkish_succession
		}
		revoke_allowed = {
			always = no
		}			
	}
	succ_papal_succession = {
		potential = {
			OR = {
				title = k_almsivi
				title = d_alessianorder
			}
		}
		
		effect = {
			succession = papal_succession
		}
		revoke_allowed = {
			always = no
		}		
	}
	
	# Titles revert back to the liege on death
	succ_appointment = {
		potential = {
			holder_scope = {
				is_feudal = yes
				independent = no
				any_liege = {
					holy_order = yes
				}
				is_merchant_republic = no
			}
			NOT = { holder_scope = { government = confucian_bureaucracy } }
			NOT = { holder_scope = { government = chinese_imperial_government } }
		}
		effect = {
			succession = appointment
		}
		revoke_allowed = {
			always = no
		}		
	}
	
	succ_open_elective = {
		potential = {
			NOT = { title = k_almsivi  }
			NOT = { title = d_alessianorder }
			temporary = no
			OR = {
				is_primary_type_title = yes
				holy_order = yes
				AND = {
					tier = baron
					OR = {
						is_republic = yes
						AND = {
							is_theocracy = yes
							#NOT = { holder_scope = { religion_group = muslim } }
						}
					}
				}
				holder_scope = {
					OR = {
						is_republic = yes
						is_theocracy = yes
						AND = { has_landed_title = d_riddle trait = mane }
					}
				}
			}
			OR = {
				is_landless_type_title = yes
				holder_scope = { is_theocracy = no }
				holder_scope = { 
					NOT = { religion = almsivi }
					NOT = { religion = maruhkati }
				}
			}
			holder_scope = { 
				is_patrician = no
				is_merchant_republic = no
				OR = {
					independent = yes
					is_feudal = no
					NOT = {
						any_liege = {
							holy_order = yes
						}
					}
					AND = { has_landed_title = d_riddle trait = mane }
				}
			}
			NAND = { 
				has_law = succession_voting_power_1
				has_law = succ_feudal_elective
			}
			NOT = { holder_scope = { government = confucian_bureaucracy } }
			NOT = { holder_scope = { government = chinese_imperial_government } }
		}
		
		effect = {
			succession = open_elective
		}
		revoke_allowed = {
			always = no
		}
	}
	succ_catholic_bishopric = {
		potential = {
			is_landless_type_title = no
			OR = {
				AND = {
					tier = baron
					is_theocracy = yes
				}
				holder_scope = { is_theocracy = yes }
			}
			
			holder_scope = {
				holder_scope = { 
					OR = { 
						religion = almsivi
						religion = maruhkati 
					}
				}
				is_merchant_republic = no
				OR = {
					independent = yes
					is_feudal = no
					NOT = {
						any_liege = {
							holy_order = yes
						}
					}
				}
			}
			is_primary_type_title = no
			NOT = { holder_scope = { government = confucian_bureaucracy } }
			NOT = { holder_scope = { government = chinese_imperial_government } }
		}
		effect = {
			succession = catholic_bishopric
		}
		revoke_allowed = {
			always = no
		}			
	}
	
	succ_patrician_elective = {
		potential = {
			OR = {
				is_primary_holder_title = yes
				holder_scope = {
					in_revolt = yes
					succ_law_title = {
						title = PREVPREV
					}
				}
			}
			holder_scope = {
				is_merchant_republic = yes
			}
			NOT = { holder_scope = { government = confucian_bureaucracy } }
			NOT = { holder_scope = { government = chinese_imperial_government } }
		}
		effect = {
			succession = patrician_elective
		}
		revoke_allowed = {
			always = no
		}			
	}

	succ_nomad_succession = {
		potential = {
			holder_scope = {
				is_nomadic = yes
			}
		}
		effect = {
			succession = nomad_succession
		}
		revoke_allowed = {
			always = no
		}			
	}
	
	succ_offmap_succession = {
		potential = {
			holder_scope = {
				top_liege = { is_offmap_governor = yes }
				government = confucian_bureaucracy # To use this with future offmap powers, use an OR clause here with the new government types
			}
		}
		effect = {
			succession = offmap_succession
			# This succession type generates a character of China's culture and religion
			# They have decent (4-10) stats, and good (7-11) stewardship, and will always have a Stewardship education
			# The offmap power defined in the top liege's government is used to determine the culture and religion. Will not function if this isn't defined
		}
		revoke_allowed = {
			always = no
		}			
	}
}

gender_laws = {
	cognatic_succession = {
		male_dynasty_opinion = 5
		female_dynasty_opinion = -5
	
		potential = {
			holder_scope = {
				OR = {
					independent = yes
					NOT = {
						any_liege = {
							holy_order = yes
						}
					}
					is_merchant_republic = yes
				}
				NOT = { culture = orsimer }
				NOT = { culture = tangmo }
				NAND = {
					culture = tsaesci 
					religion = five_courts
				}
				NOT = { AND = { has_landed_title = d_riddle trait = mane } }
				has_horde_culture = no
				is_nomadic = no
			}
			
			is_landless_type_title = no
			
			OR = {
				AND = {
					tier = baron
					is_theocracy = no
				}
				holder_scope = {
					is_theocracy = no
				}
			}
			
			is_primary_type_title = no
		}
		
		effect = {
			gender_succ = cognatic
			set_allows_matrilineal_marriage = yes
		}
		revoke_allowed = {
			always = no
		}			
		default = yes
		default_selection = {
			factor = 1
			modifier = {
				factor = 0
				holder_scope = {
					OR = {
						government = matriarchy_government
						government = orsimer_government
						culture_group = aldmeris
						culture = atmoran
						culture = nord
						culture = skaal
						culture = reachmen
						culture = dunmer
						culture = tangmo
					}
				}
			}
		}
	}
	agnatic_succession = {
		male_dynasty_opinion = 10
		female_dynasty_opinion = -10
	
		potential = {
			OR = {
				AND = {
					holder_scope = {
						NOT = { religion_group = tribunal }
						NOT = { religion_group = mer_pantheon }
						NOT = { religion_group = hist_group }
						NOT = { culture = potun }
						NOT = { culture = tsaesci }
						NOT = { religion_group = khajiit_pantheon }
					}
				}
				holder_scope = { AND = { has_landed_title = d_riddle trait = mane } }
			}
		}
		effect = {
			gender_succ = agnatic
		}
		revoke_allowed = {
			always = no
		}			
		default = yes
		default_selection = {
			factor = 1
			
			modifier = {
				factor = 0
				holder_scope = {
					OR = {
						government = matriarchy_government
						culture_group = aldmeris
						culture_group = nedic
						culture = dunmer
						culture = kamal
					}
				}
			}
			
			modifier = {
				factor = 100
				holder_scope = {
					OR = {
						culture = orsimer
						culture = tangmo
					}
				}
			}
		}
	}
	
	true_cognatic_succession = {
		
		potential = {
			holder_scope = { 
				NOT = { culture = orsimer }
				NOT = { culture = tangmo }
				NOT = { culture = kamal }
				NOT = { religion = five_courts }
				NOT = { AND = { has_landed_title = d_riddle trait = mane } }
				has_horde_culture = no
				is_nomadic = no
			}
			
			is_landless_type_title = no
			
			OR = {
				AND = {
					tier = baron
					is_theocracy = no
				}
				holder_scope = {
					is_theocracy = no
				}
			}
			
			is_primary_type_title = no
		}
		allow = {
			always = yes
		}
		effect = {
			gender_succ = true_cognatic
			set_allows_matrilineal_marriage = yes
		}
		revoke_allowed = {
			always = no
		}
		default = yes
		default_selection = {
			factor = 10
			
			modifier = {
				factor = 0
				holder_scope = {
					OR = {
						government = matriarchy_government
						government = orsimer_government
						culture = tangmo
					}
				}
			}
			
			modifier = {
				factor = 50
				holder_scope = {
					OR = {
						culture_group = aldmeris
						culture = atmoran
						culture = nord
						culture = skaal
						culture = reachmen
						culture = dunmer
					}
				}
			}
		}
	}
	
	enatic_succession = {
		male_dynasty_opinion = -10
		female_dynasty_opinion = 10
		
		potential = {
			holder_scope = {
				OR = {
					religion = green_pact
					religion = daedra_azura
					religion = daedra_mephala
					religion = daedra_meridia
					religion = daedra_namira
					religion = daedra_nocturnal
					religion = daedra_sanguine
					religion = daedra_sheogorath
					religion = daedra_vaermina
					religion = alkosh
					religion = forsworn_heresy
					religion = five_courts
				}
				NOT = { AND = { has_landed_title = d_riddle trait = mane } }
				NOT = { culture = orsimer }
				NOT = { culture = tangmo }
				NOT = { culture = kamal }
				has_horde_culture = no
				is_nomadic = no
			}
			
			is_landless_type_title = no
			
			OR = {
				AND = {
					tier = baron
					is_theocracy = no
				}
				holder_scope = {
					is_theocracy = no
				}
			}
			
			is_primary_type_title = no
		}
		allow = {
			always=yes
		}
		effect = {
			gender_succ = enatic
			set_allows_matrilineal_marriage = yes
		}
		revoke_allowed = {
			always = no
		}
		default = yes
		default_selection = {
			factor = 1
			
			modifier = {
				factor = 0
				holder_scope = {
					NOT = { government = matriarchy_government }
				}
			}
			
			modifier = {
				factor = 100
				holder_scope = {
					government = matriarchy_government
				}
			}
		}
	}
	
	enatic_cognatic_succession = {
		male_dynasty_opinion = -5
		female_dynasty_opinion = 5
		
		potential = {
			holder_scope = {
				NOT = { religion_group = tribunal }
				NOT = { culture = orsimer }
				NOT = { culture = tangmo }
				NOT = { culture = kamal }
				NOT = { AND = { has_landed_title = d_riddle trait = mane } }
				NOT = { government = matriarchy_government }
				has_horde_culture = no

			}
			
			is_landless_type_title = no
			
			OR = {
				AND = {
					tier = baron
					is_theocracy = no
				}
				holder_scope = {
					is_theocracy = no
				}
			}
			
			is_primary_type_title = no
		}
		allow = {
			always=yes
		}
		effect = {
			gender_succ = enatic_cognatic
			set_allows_matrilineal_marriage = yes
		}
		revoke_allowed = {
			always = no
		}			
	}
	
}
