# 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_byzantine_elective 
				OR = { 
					title = e_byzantium
					title = e_roman_empire
				}
			}
			holder_scope = {
				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 } }
		}
		allow = {
			holder_scope = {
				show_scope_change = no
				OR = {
					is_tribal = no
					custom_tooltip = { 
						text = TT_NOT_UNREFORMED_PAGAN
						hidden_tooltip = {
							NOR = { 
								religion = norse_pagan
								religion = slavic_pagan
								religion = baltic_pagan
								religion = finnish_pagan
								religion = zun_pagan
								religion = tengri_pagan
								religion = west_african_pagan
								religion = aztec
								religion = pagan
							}
						}
					}
				}
				in_revolt = no
			}
			conditional_tooltip = {
				trigger = {
					has_law = succ_hre_elective
					has_dlc = "Conclave"
				}
				has_law = law_voting_power_0
			}
			conditional_tooltip = {
				trigger = {
					has_law = succ_hre_elective
					NOT = { has_dlc = "Conclave" }
				}
				has_law = crown_authority_4
			}
			conditional_tooltip = {
				trigger = {
					has_law = succ_hre_elective
				}
				has_law = centralization_4
			}
			conditional_tooltip = {
				trigger = {
					has_dlc = "Conclave"
				}
				custom_tooltip = {
					text = forced_elective_tt
					hidden_tooltip = {
						NAND = { 
							has_law = succession_voting_power_1
							OR = { 
								has_law = succ_feudal_elective
								has_law = succ_hre_elective
							}
						}
					}
				}
			}
		}
		effect = {
			succession = gavelkind
		}
		revoke_allowed = {
			always = no
		}			
	}
	
	succ_elective_gavelkind = {
		child_opinion = 15
		dynasty_opinion = 5
	
		potential = {
			NAND = { 
				has_law = succ_byzantine_elective 
				OR = { 
					title = e_byzantium
					title = e_roman_empire
				}
			}
			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
							OR = { 
								has_law = succ_feudal_elective
								has_law = succ_hre_elective
							}
						}
					}
				}
			}
			holder_scope = {
				show_scope_change = no
				in_revolt = no
			}
			conditional_tooltip = {
				trigger = {
					has_law = succ_hre_elective
					has_dlc = "Conclave"
				}
				has_law = law_voting_power_0
			}
			conditional_tooltip = {
				trigger = {
					has_law = succ_hre_elective
					NOT = { has_dlc = "Conclave" }
				}
				has_law = crown_authority_4
			}
			conditional_tooltip = {
				trigger = {
					has_law = succ_hre_elective
				}
				has_law = centralization_4
			}
		}
		effect = {
			succession = {
				base_type = elective_gavelkind
				voting_rules = elective_gavelkind
			}
		}
		revoke_allowed = {
			always = no
		}			
	}
	succ_eldership = {
		dynasty_opinion = 5
	
		potential = {
			NAND = { 
				has_law = succ_byzantine_elective 
				OR = { 
					title = e_byzantium
					title = e_roman_empire
				}
			}
			holder_scope = {
				OR = {
					AND = {
						is_tribal = yes
						religion = baltic_pagan
					}
					AND = {
						is_tribal = yes
						religion = west_african_pagan
					}
					has_religion_feature = religion_beatification
					has_religion_feature = religion_feature_baltic
					has_religion_feature = religion_feature_west_african
				}
			}
			holder_scope = {
				has_dlc = "Holy Fury"
				is_nomadic = no
				OR = {
					independent = yes
					NOT = {
						any_liege = {
							holy_order = yes
						}
					}
				}
				NOR = { 
					religion_group = muslim 
					has_religion_feature = religion_matriarchal
					has_religion_feature = religion_patriarchal
				}
				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 = "Holy Fury"
				}
				holder_scope = {
					OR = {
						AND = {
							is_tribal = yes
							religion = baltic_pagan
						}
						AND = {
							is_tribal = yes
							religion = west_african_pagan
						}
						has_religion_feature = religion_beatification
						has_religion_feature = religion_feature_baltic
						has_religion_feature = religion_feature_west_african
					}
				}
				custom_tooltip = {
					text = forced_elective_tt
					hidden_tooltip = {
						NAND = { 
							has_law = succession_voting_power_1
							OR = { 
								has_law = succ_feudal_elective
								has_law = succ_hre_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_byzantine_elective 
				OR = { 
					title = e_byzantium
					title = e_roman_empire
				}
			}
			holder_scope = {
				OR = {
					independent = yes
					NOT = {
						any_liege = {
							holy_order = yes
						}
					}
				}
				OR = {
					is_merchant_republic = no
					primary_title = {
						NOT = { title = PREVPREV }
					}
				}
				
                OR = {
                    NOR = {
						religion_group = muslim
						religion_group = indian_group 
					}
                    is_patrician = yes
                }
				
				OR = {
					NOT = { religion_group = pagan_group }
					is_reformed_religion = yes
					religion = hellenic_pagan
					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 } }
		}
		
		allow = {
			
			conditional_tooltip = {
				trigger = {
					NOT = { has_dlc = "Conclave" }
					NOT = { has_law = succ_hre_elective }
				}
				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
							OR = { 
								has_law = succ_feudal_elective
								has_law = succ_hre_elective
							}
						}
					}
				}
			}
			conditional_tooltip = {
				trigger = {
					has_law = succ_hre_elective
					has_dlc = "Conclave"
				}
				has_law = law_voting_power_0
			}
			conditional_tooltip = {
				trigger = {
					has_law = succ_hre_elective
					NOT = { has_dlc = "Conclave" }
				}
				has_law = crown_authority_4
			}
			conditional_tooltip = {
				trigger = {
					has_law = succ_hre_elective
				}
				has_law = centralization_4
			}
		}
		
		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_byzantine_elective 
				OR = { 
					title = e_byzantium
					title = e_roman_empire
				}
			}
			holder_scope = {
				NOT = { religion_group = muslim }
				is_merchant_republic = no
				is_patrician = no
			}
			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 = {
							NOT = { religion_group = pagan_group }
							religion = bon
							religion = bon_reformed
							is_reformed_religion = yes
							religion = hellenic_pagan
						}
					}
					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 }
					}
				}
				has_title_flag = alternate_byz
			}
			NOT = { holder_scope = { government = confucian_bureaucracy } }
		}
		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" }
					NOT = { has_law = succ_hre_elective }
				}
				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
							OR = { 
								has_law = succ_feudal_elective 
								has_law = succ_hre_elective
							}
						}
					}
				}
			}
			conditional_tooltip = {
				trigger = {
					has_law = succ_hre_elective
					has_dlc = "Conclave"
				}
				has_law = law_voting_power_0
			}
			conditional_tooltip = {
				trigger = {
					has_law = succ_hre_elective
					NOT = { has_dlc = "Conclave" }
				}
				has_law = crown_authority_4
			}
			conditional_tooltip = {
				trigger = {
					has_law = succ_hre_elective
				}
				has_law = centralization_4
			}
		}
		
		effect = {
			succession = primogeniture
		}
		revoke_allowed = {
			always = no
		}			
	}
	
	succ_feudal_elective = {
		oldest_child_opinion = -15
		child_opinion = -5
		dynasty_opinion = -5
		vassal_opinion = 10
		potential = {
			NAND = { 
				has_law = succ_byzantine_elective 
				OR = { 
					title = e_byzantium
					title = e_roman_empire
				}
			}
			holder_scope = {
				OR = {
					independent = yes
					NOT = {
						any_liege = {
							holy_order = yes
						}
					}
				}
				OR = {
					NOR = { 
						religion_group = muslim
						religion_group = indian_group
					}
					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
					} 
					ROOT = {
						has_title_flag = alternate_hre
					}
				}
				is_merchant_republic = no
				is_patrician = no
				
				OR = {
					NOT = { religion_group = pagan_group }
					is_reformed_religion = yes
					religion = hellenic_pagan
					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
					} 
					ROOT = {
						has_title_flag = alternate_hre
					}
				}
				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
					}
					ROOT = {
						has_title_flag = alternate_hre
					}
				}
			}
			NOT = { holder_scope = { government = confucian_bureaucracy } }
			NOT = { holder_scope = { government = chinese_imperial_government } }
			NOR = {  #Special Elective.
				title = e_hre 
				has_title_flag = alternate_hre
			}
		}
		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 = {
			NAND = { 
				has_law = succ_byzantine_elective 
				OR = { 
					title = e_byzantium
					title = e_roman_empire
				}
			}
			OR = {
				title = e_hre #Title-bound.
				ROOT = {
					has_title_flag = alternate_hre
				}
			}
			holder_scope = {
				OR = {
					independent = yes
					NOT = {
						any_liege = {
							holy_order = yes
						}
					}
				}
				OR = {
					NOR = { 
						religion_group = muslim
						religion_group = indian_group
					}
					has_law = succession_voting_power_1
					has_law = succ_feudal_elective # Keep it even if you revoke Full Council Authority
					has_law = succ_hre_elective
					ROOT = {
						has_title_flag = alternate_hre
					}
				}
				is_merchant_republic = no
				is_patrician = no
				
				OR = {
					NOT = { religion_group = pagan_group }
					is_reformed_religion = yes
					religion = hellenic_pagan
					has_law = succession_voting_power_1
					has_law = succ_feudal_elective # Keep it even if you revoke Full Council Authority
					has_law = succ_hre_elective
					ROOT = {
						has_title_flag = alternate_hre
					}
				}
				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
					has_law = succ_feudal_elective # Keep it even if you revoke Full Council Authority
					has_law = succ_hre_elective
					ROOT = {
						has_title_flag = alternate_hre
					}
				}
			}
			NOT = { holder_scope = { government = confucian_bureaucracy } }
			NOT = { holder_scope = { government = chinese_imperial_government } }
		}
		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 = hre_feudal_elective
			}
		}
		revoke_allowed = {
			always = no
		}			
	}
	
	succ_byzantine_elective = {
		oldest_child_opinion = -5
		child_opinion = -5
		dynasty_opinion = -5
		feudal_opinion = -5
		potential = {
			holder_scope = {
				OR = {
					has_landed_title = e_byzantium
					has_landed_title = e_roman_empire
				}
				NOT = { religion_group = muslim }
				is_nomadic = no
				is_merchant_republic = no
				is_patrician = no
			#	OR = {
			#		culture_group = byzantine
			#		culture = roman
			#		religion = orthodox
			#		religion = hellenic_pagan
			#		religion = hellenic_pagan_reformed
			#	}
			#	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 = { holder_scope = { government = confucian_bureaucracy } }
			NOT = { holder_scope = { government = chinese_imperial_government } }

		}
		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 = byzantine_elective
			}
		}
		revoke_allowed = {
			always = no
		}			
	}

	succ_tanistry = {
		oldest_child_opinion = -20
		child_opinion = -10
		dynasty_opinion = 5
		vassal_opinion = 5
		potential = {
			NAND = { 
				has_law = succ_byzantine_elective 
				OR = { 
					title = e_byzantium
					title = e_roman_empire
				}
			}
			holder_scope = {
				OR = {
					independent = yes
					NOT = {
						any_liege = {
							holy_order = yes
						}
					}
				}
				NOT = { religion_group = muslim }
				is_merchant_republic = no
				is_patrician = no
				OR = {
					culture_group = celtic
					any_owned_bloodline = {
						has_bloodline_flag = bloodline_tanistry
					}
				}
				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 = {
				holder_scope = {
					OR = {
						culture_group = celtic
						any_owned_bloodline = {
							has_bloodline_flag = bloodline_tanistry
						}
					}
				}
				AND = {
					tier = baron
					is_feudal = yes
				}
				holder_scope = { is_feudal = yes }
			}
			NOT = { holder_scope = { government = confucian_bureaucracy } }
			NOT = { holder_scope = { government = chinese_imperial_government } }

		}
		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
							OR = { 
								has_law = succ_feudal_elective 
								has_law = succ_hre_elective
							}
						}
					}
				}
			}
			conditional_tooltip = {
				trigger = {
					has_law = succ_hre_elective
					has_dlc = "Conclave"
				}
				has_law = law_voting_power_0
			}
			conditional_tooltip = {
				trigger = {
					has_law = succ_hre_elective
					NOT = { has_dlc = "Conclave" }
				}
				has_law = crown_authority_4
			}
			conditional_tooltip = {
				trigger = {
					has_law = succ_hre_elective
				}
				has_law = centralization_4
			}
		}
		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_byzantine_elective 
				OR = { 
					title = e_byzantium
					title = e_roman_empire
				}
			}
			holder_scope = {
				OR = {
					independent = yes
					NOT = {
						any_liege = {
							holy_order = yes
						}
					}
				}
				OR = {
					culture = mongol
					religion = bon
					religion = bon_reformed
					AND = {
						NOT = { religion = norse_pagan }
						NOT = { religion = tengri_pagan }
						NOT = { religion = baltic_pagan }
						NOT = { religion = finnish_pagan }
						NOT = { religion = aztec }
						NOT = { religion = pagan }
						NOT = { religion = slavic_pagan }
						NOT = { religion = west_african_pagan }
					}
				}
				
				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
				AND = {
					is_nomadic = no
					OR = {
						title = e_mongol_empire
						title = e_golden_horde
						title = e_il-khanate
					}
				}
			}
			is_primary_type_title = no
			OR = {
				AND = {
					tier = baron
					is_feudal = yes
				}
				holder_scope = { is_feudal = yes }
				AND = {
					is_nomadic = no
					OR = {
						title = e_mongol_empire
						title = e_golden_horde
						title = e_il-khanate
					}
				}
			}
			NOT = { holder_scope = { government = confucian_bureaucracy } }
		}
		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" }
					NOT = { has_law = succ_hre_elective }
				}
				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
							OR = { 
								has_law = succ_feudal_elective 
								has_law = succ_hre_elective
							}
						}
					}
				}
			}
			conditional_tooltip = {
				trigger = {
					has_law = succ_hre_elective
					has_dlc = "Conclave"
				}
				has_law = law_voting_power_0
			}
			conditional_tooltip = {
				trigger = {
					has_law = succ_hre_elective
					NOT = { has_dlc = "Conclave" }
				}
				has_law = crown_authority_4
			}
			conditional_tooltip = {
				trigger = {
					has_law = succ_hre_elective
				}
				has_law = centralization_4
			}
		}
		
		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_byzantine_elective 
				OR = { 
					title = e_byzantium
					title = e_roman_empire
				}
			}
			holder_scope = {
				OR = {
					religion_group = muslim
					AND = {
						has_religion_feature = religion_patriarchal
						is_theocracy = no
					}
					AND = {
						has_religion_feature = religion_matriarchal
						is_theocracy = no
					}
				}
				is_republic = no
				is_merchant_republic = no
				is_nomadic = no
			}
			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
				OR = { 
					has_law = succ_feudal_elective 
					has_law = succ_hre_elective
				}
			}
			NOT = { holder_scope = { government = confucian_bureaucracy } }
		}
		effect = {
			succession = turkish_succession
		}
		revoke_allowed = {
			always = no
		}			
	}
	succ_papal_succession = {
		potential = {
			title = k_papal_state
		}
		
		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 = {
			NAND = { 
				has_law = succ_byzantine_elective 
				OR = { 
					title = e_byzantium
					title = e_roman_empire
				}
			}
			NOT = { title = k_papal_state }
			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
						AND = {
							is_theocracy = yes
							NOT = { religion_group = muslim }
						}
					}
				}
			}
			OR = {
				is_landless_type_title = yes
				holder_scope = { is_theocracy = no }
				holder_scope = { 
					NOT = { religion = catholic }
					NOT = { religion = fraticelli }
				}
			}
			holder_scope = { 
				is_patrician = no
				is_merchant_republic = no
				OR = {
					independent = yes
					is_feudal = no
					NOT = {
						any_liege = {
							holy_order = yes
						}
					}
				}
			}
			NAND = { 
				has_law = succession_voting_power_1
				OR = { 
					has_law = succ_feudal_elective 
					has_law = succ_hre_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 = {
				OR = {
					religion = catholic
					religion = fraticelli
				}
				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 = {
		potential = {
			holder_scope = {
				NOT = { has_religion_feature = religion_matriarchal }
				NOT = { has_religion_feature = religion_equal }
				OR = {
					NOT = { tier = baron }
					is_theocracy = yes
					is_republic = yes
				}
				OR = {
					independent = yes
					NOT = {
						any_liege = {
							holy_order = yes
						}
					}
					is_merchant_republic = yes
				}
				OR = {
					AND = {
						NOT = { religion_group = muslim }
						NOT = { religion = aztec }
						has_horde_culture = no
						#is_tribal = no
						is_nomadic = no
						is_merchant_republic = no
						is_patrician = no
					}
					AND = {
						has_dlc = "Zeus"
						OR = {
							ROOT = { holder_scope = { primary_title = { has_law = status_of_women_3 } } }
							ROOT = { holder_scope = { primary_title = { has_law = status_of_women_4 } } }
							has_game_rule = {
								name = gender
								value = all
							}
						}
						OR = {
							is_patrician = no
							liege = {
								primary_title = {
									OR = {
										has_law = cognatic_succession
										has_law = true_cognatic_succession
										has_law = enatic_cognatic_succession
										has_law = enatic_succession
									}
								}
							}
						}
					}
				}
			}
			
			is_landless_type_title = no
			
			OR = {
				AND = {
					tier = baron
					is_theocracy = no
					is_republic = no
				}
				holder_scope = {
					is_theocracy = no
					is_republic = no
				}
			}
			
			is_primary_type_title = no
		}
		
		effect = {
			gender_succ = cognatic
			law_set_allow_matrilineal_marriage = yes
		}
		revoke_allowed = {
			always = no
		}			
		default = yes
		default_selection = {
			factor = 10
		}
	}
	agnatic_succession = {
		female_dynasty_opinion = -5
	
		potential = {
			holder_scope = { 
				NOT = { has_religion_feature = religion_matriarchal } 
				NOT = { has_religion_feature = religion_equal }
			}
		}
		effect = {
			gender_succ = agnatic
		}
		revoke_allowed = {
			always = no
		}			
		default = yes
		default_selection = {
			factor = 1
			
			modifier = {
				factor = 0
				has_game_rule = {
					name = gender
					value = all
				}
			}
			
			modifier = {
				factor = 100
				holder_scope = {
					NOR = {
						religion_group = christian
						religion = west_african_pagan
						religion = west_african_pagan_reformed
						AND = {
							culture_group = tibetan_group
							NOT = { religion = taoist }
							NOT = { culture = tangut }
						}
					}
					primary_title = {
						NOT = { has_law = status_of_women_3 }
						NOT = { has_law = status_of_women_4 }
					}
				}
			}
		}
	}
	
	true_cognatic_succession = {
		male_dynasty_opinion = -5
		
		potential = { 
			holder_scope = { NOT = { has_religion_feature = religion_matriarchal } }
			holder_scope = { NOT = { has_religion_feature = religion_patriarchal } }
			OR = {
				AND = {
					has_dlc = "Zeus"
					has_game_rule = {
						name = gender
						value = all
					}
					#is_patrician = no
				}
				holder_scope = {
					OR = {
						AND = {
							NOT = { religion_group = muslim }
							NOT = { religion = aztec }
							has_horde_culture = no
							#is_tribal = no
							is_nomadic = no
							#is_merchant_republic = no
							#is_patrician = no
						}
						has_religion_feature = religion_equal
						has_religion_feature = religion_feature_bon
						AND = {
							has_dlc = "Zeus"
							ROOT = { holder_scope = { primary_title = { has_law = status_of_women_4 } } }
							OR = {
								is_patrician = no
								liege = {
									primary_title = {
										OR = {
											has_law = cognatic_succession
											has_law = true_cognatic_succession
											has_law = enatic_cognatic_succession
											has_law = enatic_succession
										}
									}
								}
							}
						}
					}
				}
			}
			
			is_landless_type_title = no
			
			OR = {
				AND = {
					tier = baron
					is_theocracy = no
					is_republic = no
				}
				holder_scope = {
					is_theocracy = no
					OR = {
						is_republic = no
						is_patrician = yes
					}
				}
				holder_scope = {
					has_religion_feature = religion_equal
				}
			}
			
			is_primary_type_title = no
		}
		allow = {
			OR = {
				holder_scope = {
					OR = {
						culture = basque
						culture = zhangzhung
						culture = sumpa
#						religion = cathar
						religion = messalian
						religion = mazdaki
						has_religion_feature = religion_equal
					}
				}
				OR = {
					ROOT = { holder_scope = { primary_title = { has_law = status_of_women_4 } } }
					has_game_rule = {
						name = gender
						value = all
					}
				}
			}
		}
		effect = {
			gender_succ = true_cognatic
			law_set_allow_matrilineal_marriage = yes
		}
		revoke_allowed = {
			always = no
		}	
		default_selection = {
			factor = 1
			
			modifier = {
				factor = 0.1
				NOT = {
					holder_scope = {
						has_religion_feature = religion_equal
					}
				}
			}
			
			modifier = {
				factor = 100
				holder_scope = {
					has_religion_feature = religion_equal
				}
			}
		}
	}
	
	enatic_succession = {
		male_dynasty_opinion = -10
		female_dynasty_opinion = 10
		
		potential = {
			OR = {
				holder_scope = { has_religion_feature = religion_matriarchal }
				AND = {
					holder_scope = { NOT = { has_religion_feature = religion_matriarchal } }
					holder_scope = { NOT = { has_religion_feature = religion_patriarchal } }
					OR = {
						AND = {
							has_dlc = "Zeus"
							has_game_rule = {
								name = gender
								value = all
							}
							#is_patrician = no
						}
						holder_scope = {
							OR = {
								AND = {
									NOT = { religion_group = muslim }
									NOT = { religion = aztec }
									has_horde_culture = no
									#is_tribal = no
									is_nomadic = no
									#is_merchant_republic = no
									#is_patrician = no
								}
								has_religion_feature = religion_equal
								has_religion_feature = religion_feature_bon
								AND = {
									has_dlc = "Zeus"
									ROOT = { holder_scope = { primary_title = { has_law = status_of_women_4 } } }
									OR = {
										is_patrician = no
										liege = {
											primary_title = {
												OR = {
													has_law = cognatic_succession
													has_law = true_cognatic_succession
													has_law = enatic_cognatic_succession
													has_law = enatic_succession
												}
											}
										}
									}
								}
							}
						}
					}
				
					is_landless_type_title = no
					
					OR = {
						AND = {
							tier = baron
							is_theocracy = no
							is_republic = no
						}
						holder_scope = {
							is_theocracy = no
							OR = {
								is_republic = no
								is_patrician = yes
							}
						}
						holder_scope = {
							has_religion_feature = religion_equal
						}
					}
					
					is_primary_type_title = no
				}
			}
		}
		allow = {
			OR = {
				holder_scope = {
					OR = {
						culture = basque
						culture = zhangzhung
						culture = sumpa
						religion = cathar
						religion = messalian
						religion = mazdaki
						has_religion_feature = religion_equal
					}
				}
				OR = {
					ROOT = { holder_scope = { primary_title = { has_law = status_of_women_4 } } }
					has_game_rule = {
						name = gender
						value = all
					}
				}
			}
		}
		effect = {
			gender_succ = enatic
			law_set_allow_matrilineal_marriage = yes
		}
		revoke_allowed = {
			always = no
		}
		default_selection = {
			factor = 1
			
			modifier = {
				factor = 0.1
				NOT = {
					holder_scope = {
						has_religion_feature = religion_equal
					}
				}
			}
			
			modifier = {
				factor = 100
				holder_scope = {
					has_religion_feature = religion_equal
				}
			}
		}
	}
	
	enatic_cognatic_succession = {
		male_dynasty_opinion = -10
		female_dynasty_opinion = 5
		
		potential = {
			OR = {
				holder_scope = {
					OR = {
						has_religion_feature = religion_matriarchal
						any_owned_bloodline = {
							has_bloodline_flag = bloodline_enatic_cognatic 
						}
					}
				}
				AND = {
					holder_scope = { NOT = { has_religion_feature = religion_matriarchal } }
					holder_scope = { NOT = { has_religion_feature = religion_patriarchal } }
					OR = {
						AND = {
							has_dlc = "Zeus"
							has_game_rule = {
								name = gender
								value = all
							}
							#is_patrician = no
						}
						holder_scope = {
							OR = {
								AND = {
									NOT = { religion_group = muslim }
									NOT = { religion = aztec }
									has_horde_culture = no
									#is_tribal = no
									is_nomadic = no
									#is_merchant_republic = no
									#is_patrician = no
								}
								has_religion_feature = religion_equal
								has_religion_feature = religion_feature_bon
								AND = {
									has_dlc = "Zeus"
									ROOT = { holder_scope = { primary_title = { has_law = status_of_women_4 } } }
									OR = {
										is_patrician = no
										liege = {
											primary_title = {
												OR = {
													has_law = cognatic_succession
													has_law = true_cognatic_succession
													has_law = enatic_cognatic_succession
													has_law = enatic_succession
												}
											}
										}
									}
								}
							}
						}
					}
					
					is_landless_type_title = no
					
					OR = {
						AND = {
							tier = baron
							is_theocracy = no
							is_republic = no
						}
						holder_scope = {
							is_theocracy = no
							OR = {
								is_republic = no
								is_patrician = yes
							}
						}
						holder_scope = {
							has_religion_feature = religion_equal
						}
					}
					
					is_primary_type_title = no
				}
			}
		}
		allow = {
			OR = {
				holder_scope = {
					OR = {
						culture = basque
						culture = zhangzhung
						culture = sumpa
						religion = cathar
						religion = messalian
						religion = mazdaki
						has_religion_feature = religion_equal
					}
				}
				OR = {
					ROOT = { holder_scope = { primary_title = { has_law = status_of_women_4 } } }
					has_game_rule = {
						name = gender
						value = all
					}
				}
			}
		}
		effect = {
			gender_succ = enatic_cognatic
			law_set_allow_matrilineal_marriage = yes
		}
		revoke_allowed = {
			always = no
		}	
		default_selection = {
			factor = 1
			
			modifier = {
				factor = 0.1
				NOT = {
					holder_scope = {
						has_religion_feature = religion_equal
					}
				}
			}
			
			modifier = {
				factor = 100
				holder_scope = {
					has_religion_feature = religion_equal
				}
			}
			
			modifier = {
				factor = 0
				NOT = {
					holder_scope = {
						OR = {
							has_religion_feature = religion_matriarchal
							any_owned_bloodline = {
								has_bloodline_flag = bloodline_enatic_cognatic 
							}
						}
					}
				}
			}
			
			modifier = {
				factor = 100
				holder_scope = {
					OR = {
						has_religion_feature = religion_matriarchal
						any_owned_bloodline = {
							has_bloodline_flag = bloodline_enatic_cognatic 
						}
					}
				}
			}
		}		
	}	
}
