# DO NOT ALTER THE NAME OR NUMBER OF THESE!

succession_laws = {

	succ_dynastic_elective = {
		child_opinion = 10				#They are happy as they are more likely to become ruler
		dynasty_opinion = 25			#They are valid candidates for the throne
		oldest_child_opinion = -15		#They'd prefer Primogeniture
		youngest_child_opinion = -15	#They'd prefer Ultimogeniture
	
		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
						}
					}
				}
				OR = {
					NOT = { religion_group = pagan_group }
					religion = bon
					religion = bon_reformed
					is_reformed_religion = yes
					religion = hellenic_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
			}
			
			rebel = no
		
			holder_scope = { is_feudal = 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
			}
			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
						}
					}
				}
			}
		}
		effect = {
			succession = {
				base_type = feudal_elective
				voting_rules = dynastic_elective #Definded in common/00_succession_voting
			}
			elective_voting_rules = dynastic_elective
		}
		revoke_allowed = {
			always = no
		}			
	}
	
}