# Demesne type (de facto) laws (set for the PRIMARY title in a demesne but affects the whole demesne)

law_groups = {
	tribal_organization = {
		law_type = realm
		allowed_for_councillors = yes
	}
	administration = {
		law_type = realm
		allowed_for_councillors = no
	}
	revoke_title_law = {
		law_type = realm
		allowed_for_councillors = yes
	}
	vice_royalty = {
		law_type = realm
		allowed_for_councillors = no
	}
	female_council_law_group = {
		law_type = realm
		allowed_for_councillors = yes
	}
	culture_conversion_group = {
		law_type = realm
		allowed_for_councillors = no
	}
}

laws = {

	# TRIBAL ORGANIZATION
	##############################
	
	tribal_organization_0 = {
		group = tribal_organization
		default = yes
		
		unreformed_tribal_opinion = 5
		
		potential = {
			holder_scope = {
				is_tribal = yes
				higher_tier_than = count
			}
		}
		allow = {
			OR = {
				has_law = tribal_organization_1
				NOR = {
					has_law = tribal_organization_0
					has_law = tribal_organization_1
					has_law = tribal_organization_2
					has_law = tribal_organization_3
					has_law = tribal_organization_4
				}
			}
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0
				has_law = tribal_organization_1
				holder_scope = {
					NOT = {
						any_vassal = {
							is_tribal = yes
							dislike_tribal_organization = yes
							NOT = { opinion = { who = liege value = 0 } }
						}
					}
				}
			}
			modifier = {
				factor = 0.5
				has_law = tribal_organization_1
				holder_scope = { dislike_tribal_organization = no }
			}
		}
		effect = {
			set_tribal_vassal_levy_control = no
			set_tribal_vassal_tax_income = no
			hidden_tooltip = {
				if = {
					limit = { has_dlc = "Zeus" }
					revoke_law = law_voting_power_1
					revoke_law = war_voting_power_1
					disable_council_voting_on_issue = laws
					disable_council_voting_on_issue = enforce_peace
					disable_council_voting_on_issue = declare_war_interaction
					revoke_law = revoke_title_voting_power_1
					revoke_law = grant_title_voting_power_1
					disable_council_voting_on_issue = revoke_title_interaction
					disable_council_voting_on_issue = grant_landed_title_interaction
					revoke_law = imprison_voting_power_1
					revoke_law = banish_voting_power_1
					revoke_law = execution_voting_power_1
					disable_council_voting_on_issue = imprison_character_interaction
					disable_council_voting_on_issue = exile_imprisoned_interaction
					disable_council_voting_on_issue = execute_imprisoned_interaction
				}
			}
			if = {
				limit = {
					OR = {
						has_law = tribal_organization_3
						has_law = tribal_organization_4
					}
				}
				custom_tooltip = {
					text = disables_tribal_levy_laws
				}
				custom_tooltip = {
					text = disables_tribal_tax_laws
				}
			}
			if = {
				limit = { has_law = tribal_organization_4 }
				custom_tooltip = {
					text = disallows_change_government
				}
			}
			hidden_tooltip = {
				revoke_law = tribal_organization_0
				revoke_law = tribal_organization_1
				revoke_law = tribal_organization_2
				revoke_law = tribal_organization_3
				revoke_law = tribal_organization_4
				revoke_law = tribal_obligations_0
				revoke_law = tribal_obligations_1
				revoke_law = tribal_obligations_2
				revoke_law = tribal_obligations_3
				revoke_law = tribal_obligations_4
				revoke_law = tribal_slider_0
				revoke_law = tribal_slider_1
				revoke_law = tribal_slider_2
				revoke_law = tribal_slider_3
				revoke_law = tribal_slider_4
			}
		}
	}
	
	tribal_organization_1 = {
		group = tribal_organization
		
		unreformed_tribal_opinion = -5
		
		potential = {
			holder_scope = {
				is_tribal = yes
				higher_tier_than = count
			}
		}
		allow = {
			OR = {
				has_law = tribal_organization_0
				has_law = tribal_organization_2
			}
			OR = {
				has_law = tribal_organization_2
				holder_scope = { prestige = 250 }
			}
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				has_law = tribal_organization_0
				holder_scope = {
					any_vassal = {
						is_tribal = yes
						dislike_tribal_organization = yes
						NOT = { opinion = { who = liege value = 10 } }
					}
				}
			}
			modifier = {
				factor = 0
				has_law = tribal_organization_2
				holder_scope = {
					NOT = {
						any_vassal = {
							is_tribal = yes
							dislike_tribal_organization = yes
							NOT = { opinion = { who = liege value = 0 } }
						}
					}
				}
			}
			modifier = {
				factor = 2
				has_law = tribal_organization_0
				holder_scope = { dislike_tribal_organization = no }
			}
			modifier = {
				factor = 0.5
				has_law = tribal_organization_2
				holder_scope = { dislike_tribal_organization = no }
			}
		}
		pass_effect = {
			hidden_tooltip = {
				if = { 
					limit = { has_law = tribal_organization_0 }
					holder_scope = {
						prestige = -250
						any_vassal = {
							limit = {
								is_tribal = yes
								dislike_tribal_organization = yes
							}
							opinion = {
								who = ROOT
								modifier = opinion_increased_tribal_organization
								months = 60
							}
						}
					}
				}
			}
		}
		effect = {
			set_tribal_vassal_levy_control = no
			set_tribal_vassal_tax_income = no
			if = {
				limit = { has_dlc = "Zeus" }
				add_law = law_voting_power_1
				add_law = war_voting_power_1
			}
			if = {
				limit = {
					OR = {
						has_law = tribal_organization_3
						has_law = tribal_organization_4
					}
				}
				custom_tooltip = {
					text = disables_tribal_levy_laws
				}
				custom_tooltip = {
					text = disables_tribal_tax_laws
				}
			}
			if = {
				limit = { has_law = tribal_organization_4 }
				custom_tooltip = {
					text = disallows_change_government
				}
			}
			hidden_tooltip = {
				if = { 
					limit = { has_dlc = "Zeus" } 
					revoke_law = revoke_title_voting_power_1
					revoke_law = grant_title_voting_power_1
					disable_council_voting_on_issue = revoke_title_interaction
					disable_council_voting_on_issue = grant_landed_title_interaction
					revoke_law = imprison_voting_power_1
					revoke_law = banish_voting_power_1
					revoke_law = execution_voting_power_1
					disable_council_voting_on_issue = imprison_character_interaction
					disable_council_voting_on_issue = exile_imprisoned_interaction
					disable_council_voting_on_issue = execute_imprisoned_interaction
				}
				revoke_law = tribal_organization_0
				revoke_law = tribal_organization_2
				revoke_law = tribal_organization_3
				revoke_law = tribal_organization_4
				revoke_law = tribal_obligations_0
				revoke_law = tribal_obligations_1
				revoke_law = tribal_obligations_2
				revoke_law = tribal_obligations_3
				revoke_law = tribal_obligations_4
				revoke_law = tribal_slider_0
				revoke_law = tribal_slider_1
				revoke_law = tribal_slider_2
				revoke_law = tribal_slider_3
				revoke_law = tribal_slider_4				
			}
		}

		vassal_limit = 2
	}
	
	tribal_organization_2 = {
		group = tribal_organization
		
		unreformed_tribal_opinion = -10
		
		potential = {
			holder_scope = {
				is_tribal = yes
				higher_tier_than = count
			}
		}
		allow = {
			OR = {
				has_law = tribal_organization_1
				has_law = tribal_organization_3
			}
			OR = {
				has_law = tribal_organization_3
				holder_scope = { prestige = 500 }
			}
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				has_law = tribal_organization_1
				holder_scope = {
					any_vassal = {
						is_tribal = yes
						dislike_tribal_organization = yes
						NOT = { opinion = { who = liege value = 10 } }
					}
				}
			}
			modifier = {
				factor = 0
				has_law = tribal_organization_3
				holder_scope = {
					NOT = {
						any_vassal = {
							is_tribal = yes
							dislike_tribal_organization = yes
							NOT = { opinion = { who = liege value = 0 } }
						}
					}
				}
			}
			modifier = {
				factor = 2
				has_law = tribal_organization_1
				holder_scope = { dislike_tribal_organization = no }
			}
			modifier = {
				factor = 0.5
				has_law = tribal_organization_3
				holder_scope = { dislike_tribal_organization = no }
			}
		}
		pass_effect = {
			hidden_tooltip = {
				if = { 
					limit = { has_law = tribal_organization_1 }
					holder_scope = {
						prestige = -500
						any_vassal = {
							limit = {
								is_tribal = yes
								dislike_tribal_organization = yes
							}
							opinion = {
								who = ROOT
								modifier = opinion_increased_tribal_organization
								months = 60
							}
						}
					}
				}
				if = { 
					limit = { has_law = tribal_organization_3 }
					holder_scope = {
						any_vassal = {
							limit = {
								is_tribal = yes
								dislike_tribal_organization = yes
							}
							opinion = {
								who = ROOT
								modifier = opinion_lowered_tribal_organization
								months = 60
							}
						}
					}
				}
			}
		}
		effect = {
			set_tribal_vassal_levy_control = no
			set_tribal_vassal_tax_income = no
			if = {
				limit = { has_dlc = "Zeus" }
				add_law = revoke_title_voting_power_1
				add_law = grant_title_voting_power_1
				hidden_tooltip = {
					add_law = law_voting_power_1
					add_law = war_voting_power_1
				}
			}
			if = {
				limit = { 
					OR = {
						has_law = tribal_organization_3
						has_law = tribal_organization_4
					}
				}				
				custom_tooltip = {
					text = disables_tribal_levy_laws
				}
				custom_tooltip = {
					text = disables_tribal_tax_laws
				}
			}
			if = {
				limit = { has_law = tribal_organization_4 }
				custom_tooltip = {
					text = disallows_change_government
				}
			}
			hidden_tooltip = {
				if = {
					limit = { has_dlc = "Zeus" }
					revoke_law = imprison_voting_power_1
					revoke_law = banish_voting_power_1
					revoke_law = execution_voting_power_1
					disable_council_voting_on_issue = imprison_character_interaction
					disable_council_voting_on_issue = exile_imprisoned_interaction
					disable_council_voting_on_issue = execute_imprisoned_interaction
				}
				revoke_law = tribal_organization_0
				revoke_law = tribal_organization_1
				revoke_law = tribal_organization_3
				revoke_law = tribal_organization_4
				revoke_law = tribal_obligations_0
				revoke_law = tribal_obligations_1
				revoke_law = tribal_obligations_2
				revoke_law = tribal_obligations_3
				revoke_law = tribal_obligations_4
				revoke_law = tribal_slider_0
				revoke_law = tribal_slider_1
				revoke_law = tribal_slider_2
				revoke_law = tribal_slider_3
				revoke_law = tribal_slider_4				
			}
		}

		vassal_limit = 4
	}
	
	tribal_organization_3 = {
		group = tribal_organization
		
		unreformed_tribal_opinion = -15

		potential = {
			holder_scope = {
				is_tribal = yes
				higher_tier_than = count
			}
		}		
		allow = {
			OR = {
				has_law = tribal_organization_2
				has_law = tribal_organization_4
			}
			OR = {
				has_law = tribal_organization_4
				holder_scope = { prestige = 1000 }
			}
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				has_law = tribal_organization_2
				holder_scope = {
					any_vassal = {
						is_tribal = yes
						dislike_tribal_organization = yes
						NOT = { opinion = { who = liege value = 10 } }
					}
				}
			}
			modifier = {
				factor = 0
				has_law = tribal_organization_4
				holder_scope = {
					NOT = {
						any_vassal = {
							is_tribal = yes
							dislike_tribal_organization = yes
							NOT = { opinion = { who = liege value = 0 } }
						}
					}
				}
			}
			modifier = {
				factor = 2
				has_law = tribal_organization_2
				holder_scope = { dislike_tribal_organization = no }
			}
			modifier = {
				factor = 0.5
				has_law = tribal_organization_4
				holder_scope = { dislike_tribal_organization = no }
			}
		}
		pass_effect = {
			hidden_tooltip = {
				if = { 
					limit = { has_law = tribal_organization_2 }
					holder_scope = {
						prestige = -1000
						any_vassal = {
							limit = {
								is_tribal = yes
								dislike_tribal_organization = yes
							}
							opinion = {
								who = ROOT
								modifier = opinion_increased_tribal_organization
								months = 60
							}
						}
					}
				}
				if = { 
					limit = { has_law = tribal_organization_4 }
					holder_scope = {
						any_vassal = {
							limit = {
								is_tribal = yes
								dislike_tribal_organization = yes
							}
							opinion = {
								who = ROOT
								modifier = opinion_lowered_tribal_organization
								months = 60
							}
						}
					}
				}
			}
		}
		effect = {
			set_tribal_vassal_levy_control = yes
			set_tribal_vassal_tax_income = yes
			if = {
				limit = { has_dlc = "Zeus" }
				add_law = imprison_voting_power_1
				add_law = banish_voting_power_1
				add_law = execution_voting_power_1
				hidden_tooltip = {
					add_law = law_voting_power_1
					add_law = war_voting_power_1
					add_law = revoke_title_voting_power_1
					add_law = grant_title_voting_power_1
				}
			}
			if = {
				limit = { has_law = tribal_organization_4 }
				custom_tooltip = {
					text = disallows_change_government
				}
			}
			if = {
				limit = { 
					OR = {
						has_law = tribal_organization_0
						has_law = tribal_organization_1
						has_law = tribal_organization_2
					}
				}
				custom_tooltip = {
					text = enables_tribal_levy_laws
				}
				custom_tooltip = {
					text = enables_tribal_tax_laws
				}
				hidden_tooltip = {
					add_law = tribal_obligations_0
					add_law = tribal_slider_0
				}				
			}
			hidden_tooltip = {
				revoke_law = tribal_organization_0
				revoke_law = tribal_organization_1
				revoke_law = tribal_organization_2
				revoke_law = tribal_organization_4
			}
		}

		vassal_limit = 6
	}
	
	tribal_organization_4 = {
		group = tribal_organization
		
		unreformed_tribal_opinion = -20
		
		potential = {
			holder_scope = {
				is_tribal = yes
				higher_tier_than = count
			}
		}
		allow = {
			has_law = tribal_organization_3
			holder_scope = { prestige = 2000 }
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.5
				holder_scope = {
					any_vassal = {
						is_tribal = yes
						dislike_tribal_organization = yes
						NOT = { opinion = { who = liege value = 10 } }
					}
				}
			}
			modifier = {
				factor = 2
				holder_scope = { dislike_tribal_organization = no }
			}
		}
		pass_effect = {
			hidden_tooltip = {
				holder_scope = {
					prestige = -2000
					any_vassal = {
						limit = {
							is_tribal = yes
							dislike_tribal_organization = yes
						}
						opinion = {
							who = ROOT
							modifier = opinion_increased_tribal_organization
							months = 60
						}
					}
				}
			}
		}
		effect = {
			custom_tooltip = {
				text = allows_change_government
			}
			set_tribal_vassal_levy_control = yes
			set_tribal_vassal_tax_income = yes
			if = {
				limit = { has_dlc = "Zeus" }
				hidden_tooltip = {
					add_law = law_voting_power_1
					add_law = war_voting_power_1
					add_law = revoke_title_voting_power_1
					add_law = grant_title_voting_power_1
					add_law = imprison_voting_power_1
					add_law = banish_voting_power_1
					add_law = execution_voting_power_1
				}
			}
			if = {
				limit = { 
					OR = {
						has_law = tribal_organization_0
						has_law = tribal_organization_1
						has_law = tribal_organization_2
					}
				}
				custom_tooltip = {
					text = enables_tribal_levy_laws
				}
				custom_tooltip = {
					text = enables_tribal_tax_laws
				}
				hidden_tooltip = {
					add_law = tribal_obligations_0
					add_law = tribal_slider_0
				}
			}
			hidden_tooltip = {
				revoke_law = tribal_organization_0
				revoke_law = tribal_organization_1
				revoke_law = tribal_organization_2
				revoke_law = tribal_organization_3
			}
		}
		
		vassal_limit = 8
	}


	# ADMINISTRATION
	##############################	
	
	feudal_administration = {
		group = administration
		default = yes
		
		potential = {
			holder_scope = {
				is_tribal = no
				is_nomadic = no
			}
		}
		allow = {
			has_law = late_feudal_administration
		}
		ai_will_do = { factor = 0 }
		pass_effect = {
			if = {
				limit = { has_law = imperial_administration }
				clr_title_flag = has_imperial_administration
				holder_scope = {
					if = {
						limit = { has_imperial_government_trigger = yes }
						switch_to_feudal_effect = yes
						hidden_tooltip = {
							any_realm_lord = { character_event = { id = Plus.3299 } }
						}
					}
				}
			}
		}
		effect = {
			custom_tooltip = {
				text = TOOLTIP_DISALLOW_ADDITIONAL_SUCCESSION_LAWS
			}
			if = {
				limit = { 
					NOT = { has_dlc = "Charlemagne" } 
				}
				set_allow_free_duchy_revokation = no
			}
			if = {
				limit = { 
					has_dlc = "Charlemagne" 
				}
				set_allow_free_vice_royalty_revokation = no
			}
			hidden_tooltip = {
				revoke_law = late_feudal_administration
				revoke_law = imperial_administration
			}
		}
	}

	late_feudal_administration = {
		group = administration
		
		potential = {
			holder_scope = {
				is_tribal = no
				is_nomadic = no
			}
		}
		allow = {
			OR = {
				has_law = feudal_administration
				has_law = imperial_administration
			}
			crownlaw_title = {
				OR = {
					has_law = crown_authority_1
					has_law = crown_authority_2
					has_law = crown_authority_3
					has_law = crown_authority_4
				}
			}
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.2
				always = yes
			}
			modifier = {
				factor = 0
				has_law = imperial_administration
			}
		}
		pass_effect = {
			if = {
				limit = { has_law = imperial_administration }
				clr_title_flag = has_imperial_administration
				holder_scope = {
					if = {
						limit = { has_imperial_government_trigger = yes }
						switch_to_feudal_effect = yes
						hidden_tooltip = {
							any_realm_lord = { character_event = { id = Plus.3299 } }
						}
					}
				}
			}
		}
		effect = {
			if = {
				limit = { has_law = feudal_administration }
				custom_tooltip = {
					text = TOOLTIP_ALLOW_ADDITIONAL_SUCCESSION_LAWS
				}
			}
			if = {
				limit = { NOT = { has_dlc = "Charlemagne" } }
				set_allow_free_duchy_revokation = no
			}
			if = {
				limit = { has_dlc = "Charlemagne" }
				set_allow_free_vice_royalty_revokation = no
			}
			hidden_tooltip = {
				revoke_law = feudal_administration
				revoke_law = imperial_administration
			}
		}
	}

	imperial_administration = {
		group = administration
		
		potential = {
			holder_scope = {
				is_tribal = no
				is_nomadic = no
			}
		}
		allow = {
			tier = EMPEROR
			has_law = late_feudal_administration
			has_law = revoke_title_law_2
			has_law = out_of_realm_inheritance_law_1
			OR = {
				AND = {
					NOT = { has_dlc = "Zeus" }
					has_law = crown_authority_4
				}
				AND = {
					has_dlc = "Zeus"
					has_law = law_voting_power_0
					has_law = war_voting_power_0
					has_law = revoke_title_voting_power_0
					has_law = imprison_voting_power_0
					has_law = grant_title_voting_power_0
					has_law = banish_voting_power_0
					has_law = execution_voting_power_0
				}
			}
			is_titular = no
		}
		ai_will_do = {
			factor = 10
		}
		pass_effect = {
			if = {
				limit = {
					has_game_started = yes
					holder_scope = {
						is_feudal = yes
						has_imperial_government_trigger = no
						NAND = {
							controls_religion = yes
							NOT = { religion_group = muslim }
							is_pagan_religion = no
							NOT = { religion = paulician }
						}
					}
				}
				holder_scope = {
					switch_to_imperial_effect = yes
					hidden_tooltip = {
						any_realm_lord = {
							limit = {
								is_liege_or_above = ROOT
								is_feudal = yes
								has_imperial_government_trigger = no
								NAND = {
									controls_religion = yes
									NOT = { religion_group = muslim }
									is_pagan_religion = no
									NOT = { religion = paulician }
								}
								in_revolt = no
								NOT = { any_liege = { in_revolt = yes } }
							}
							switch_to_imperial_effect = yes
						}
					}
				}
			}
		}
		effect = {
			set_title_flag = has_imperial_administration
			if = {
				limit = { has_law = feudal_administration }
				custom_tooltip = {
					text = TOOLTIP_ALLOW_ADDITIONAL_SUCCESSION_LAWS
				}
			}
			if = {
				limit = { 
					NOT = { has_dlc = "Charlemagne" } 
					holder_scope = {
						OR = {
							is_feudal = no
							has_imperial_government_trigger = yes
							AND = {
								controls_religion = yes
								NOT = { religion_group = muslim }
								is_pagan_religion = no
								NOT = { religion = paulician }
							}
						}
					}
				}
				set_allow_free_duchy_revokation = yes
			}
			hidden_tooltip = {
				revoke_law = feudal_administration
				revoke_law = late_feudal_administration
			}
		}
		
		vassal_limit = 10
		castle_vassal_tax_modifier = 0.1
		city_vassal_tax_modifier = 0.1
		temple_vassal_tax_modifier = 0.1
		feudal_opinion = -10
	}

	
	# TITLE REVOCATION
	##############################	

	revoke_title_law_0 = {
		group = revoke_title_law
		default = yes
		
		potential = {
			always = yes
		}
		allow = { 
			has_law = revoke_title_law_1
			holder_scope = {
				is_tribal = no
				is_nomadic = no
			}
		}
		ai_will_do = { factor = 0 }
		pass_effect = { }
		effect = {
			set_allow_title_revokation = no
			set_allow_free_infidel_revokation = no
			hidden_tooltip = {
				revoke_law = revoke_title_law_1
				revoke_law = revoke_title_law_2
			}
		}
	}

	revoke_title_law_1 = {
		group = revoke_title_law
		
		potential = {
			always = yes
		}
		allow = {
			holder_scope = {
				is_tribal = no
				is_nomadic = no
			}
			OR = {
				has_law = revoke_title_law_2
				AND = {
					has_law = revoke_title_law_0
					custom_tooltip = {
						text = HAS_NO_CROWNLAW_TITLE
						hidden_tooltip = { NOT = { crownlaw_title = { always = yes } } }
					}
				}
				AND = {
					has_law = revoke_title_law_0
					crownlaw_title = {
						OR = {
							has_law = crown_authority_1
							has_law = crown_authority_2
							has_law = crown_authority_3
							has_law = crown_authority_4
						}
					}
				}
			}
		}
		ai_will_do = { 
			factor = 1
			modifier = {
				factor = 0.05
				has_law = revoke_title_law_0
			}
			modifier = {
				factor = 0
				has_law = revoke_title_law_2
			}
		}
		pass_effect = { }
		effect = {
			set_allow_title_revokation = yes
			set_allow_free_infidel_revokation = no
			hidden_tooltip = {
				revoke_law = revoke_title_law_0
				revoke_law = revoke_title_law_2
			}
		}
	}

	revoke_title_law_2 = {
		group = revoke_title_law

		potential = {
			always = yes
		}
		allow = {
			has_law = revoke_title_law_1
			holder_scope = {
				is_tribal = no
				is_nomadic = no
			}
			OR = {
				custom_tooltip = {
					text = HAS_NO_CROWNLAW_TITLE
					hidden_tooltip = { NOT = { crownlaw_title = { always = yes } } }
				}
				crownlaw_title = {
					OR = {
						has_law = crown_authority_2
						has_law = crown_authority_3
						has_law = crown_authority_4
					}
				}
			}
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.01
			}
			modifier = {
				factor = 10
				holder_scope = { trait = zealous }
			}
		}
		pass_effect = { }
		effect = {
			set_allow_title_revokation = yes
			set_allow_free_infidel_revokation = yes
			hidden_tooltip = {
				revoke_law = revoke_title_law_0
				revoke_law = revoke_title_law_1
			}
		}
	}
	
	
	# VICE ROYALTY LAWS
	##############################
	
	vice_royalty_0 = {
		group = vice_royalty
		default = yes
		
		potential = {
			always = no
			higher_tier_than = king
			holder_scope = {
				independent = yes
				is_feudal = yes
			}
			has_dlc = "Charlemagne"
		}
		ai_will_do = {
			factor = 0
		}
		effect = {
			hidden_tooltip = {
				revoke_law = vice_royalty_0
				revoke_law = vice_royalty_1
				revoke_law = vice_royalty_2
			}
			set_allow_vice_royalties = no
		}
	}

	vice_royalty_1 = {
		group = vice_royalty
		
		potential = {
			always = no
			higher_tier_than = king
			holder_scope = {
				independent = yes
				is_feudal = yes
			}
			has_dlc = "Charlemagne"
		}
		ai_will_do = {
			factor = 0
		}
		effect = {
			hidden_tooltip = {
				revoke_law = vice_royalty_0
				revoke_law = vice_royalty_1
				revoke_law = vice_royalty_2
			}
			set_allow_vice_royalties = king
		}
		
		vassal_limit = -5
	}
	
	vice_royalty_2 = {
		group = vice_royalty
		
		potential = {
			always = no
			higher_tier_than = king
			holder_scope = {
				independent = yes
				is_feudal = yes
			}
			has_dlc = "Charlemagne"
		}
		ai_will_do = {
			factor = 0
		}
		effect = {
			hidden_tooltip = {
				revoke_law = vice_royalty_0
				revoke_law = vice_royalty_1
				revoke_law = vice_royalty_2
			}
			set_allow_vice_royalties = duke
		}
		
		vassal_limit = -10
	}

	
	# FEMALE COUNCILLOR LAWS
	##############################
	female_council_law_0 = {
		group = female_council_law_group
		potential = {
			NOR = { 
				has_global_flag = gender_equality
				has_game_rule = {
					name = gender
					value = historical
				}				
				has_game_rule = {
					name = gender
					value = all
				}
			}
		}
		allow = {
			has_law = female_council_law_1
		}
		ai_will_do = {
			factor = 0
		}
		pass_effect = {
			
		}
		effect = {
			if = {
				limit = {
					has_law = female_council_law_1
				}
				custom_tooltip = {
					text = TOOLTIP_DISALLOW_FEMALE_SPYMASTER
				}
			}
			if = {
				limit = {
					has_dlc = "Zeus"
					has_law = female_council_law_1
					has_law = law_voting_power_1
				}
				custom_tooltip = {
					text = TOOLTIP_DISALLOW_FEMALE_ADVISOR
				}
			}
			if = {
				limit = {
					holder_scope = {
						OR = {
							is_theocracy = yes
							is_republic = yes
						}
					}
				}
				set_allows_matrilineal_marriage = no
			}
			hidden_tooltip = {
				revoke_law = female_council_law_1
				revoke_law = female_council_law_2
				revoke_law = female_council_law_3
				revoke_law = female_council_law_4
			}
			set_allow_feminism = no
			set_allow_gender_laws = no
		}

		default = yes
		default_selection = {
			factor = 1
		}
	}

	female_council_law_1 = {
		group = female_council_law_group
		potential = {
			NOR = { 
				has_global_flag = gender_equality 
				has_game_rule = {
					name = gender
					value = historical
				}
				has_game_rule = {
					name = gender
					value = all
				}
			}
		}		
		allow = {
			OR = {
				has_law = female_council_law_0
				has_law = female_council_law_2
			}
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0
				has_law = female_council_law_2
			}
			modifier = {
				factor = 0
				holder_scope = {
					trait = zealous
					is_feminist_trigger = no
				}
			}
			modifier = {
				factor = 0
				holder_scope = {
					OR = {
						trait = slothful
						trait = content
						trait = humble
					}
				}
			}
			modifier = {
				factor = 0
				holder_scope = {
					NOR = {
						is_female = yes
						is_feminist_trigger = yes
						culture = basque
						any_vassal = {
							is_female = yes
							is_voter = no
							NOT = { is_married = PREV }
							NOT = { is_mother = PREV }
							intrigue = 15
						}
						any_dynasty_member = {
							is_female = yes
							is_voter = no
							liege = { character = PREVPREV }
							NOT = { is_married = PREV }
							NOT = { is_mother = PREV }
							intrigue = 15
						}
					}
				}
			}
		}
		pass_effect = {
			
		}
		effect = {
			if = {
				limit = {
					has_law = female_council_law_0
				}
				custom_tooltip = {
					text = TOOLTIP_ALLOW_FEMALE_SPYMASTER
				}
			}
			if = {
				limit = {
					has_dlc = "Zeus"
					has_law = female_council_law_0
					has_law = law_voting_power_1
				}
				custom_tooltip = {
					text = TOOLTIP_ALLOW_FEMALE_ADVISOR
				}
			}
			if = {
				limit = {
					has_law = female_council_law_2
				}
				custom_tooltip = {
					text = TOOLTIP_DISALLOW_FEMALE_CHANCELLOR
				}
				custom_tooltip = {
					text = TOOLTIP_DISALLOW_FEMALE_TREASURER
				}
			}
			if = {
				limit = {
					holder_scope = {
						OR = {
							is_theocracy = yes
							is_republic = yes
						}
					}
				}
				set_allows_matrilineal_marriage = no
			}
			hidden_tooltip = {
				revoke_law = female_council_law_0
				revoke_law = female_council_law_2
				revoke_law = female_council_law_3
				revoke_law = female_council_law_4
			}
			set_allow_feminism = no
			set_allow_gender_laws = no
		}
		default = yes
		default_selection = {
			factor = 0
			additive_modifier = {
				value = 10
				OR = {
					AND = {
						has_law = cognatic_succession
						year = 1000
					}
					holder_scope = { is_pagan_religion = yes }
					holder_scope = { is_female = yes }
				}
			}
		}
	}

	female_council_law_2 = {
		group = female_council_law_group
		potential = {
			NOR = { 
				has_global_flag = gender_equality 
				has_game_rule = {
					name = gender
					value = historical
				}
				has_game_rule = {
					name = gender
					value = all
				}
			}
		}
		allow = {
			OR = {
				has_law = female_council_law_3
				AND = {
					has_law = female_council_law_1
					OR = {
						NOT = { has_law = agnatic_succession }
						holder_scope = { is_theocracy = yes }
						holder_scope = { is_republic = yes }
					}
				}
			}
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0
				has_law = female_council_law_3
			}
			modifier = {
				factor = 0
				holder_scope = {
					trait = zealous
					is_feminist_trigger = no
				}
			}
			modifier = {
				factor = 0
				holder_scope = {
					OR = {
						trait = slothful
						trait = content
						trait = humble
					}
				}
			}
			modifier = {
				factor = 0
				has_law = female_council_law_1
				holder_scope = {
					NOR = {
						is_female = yes
						is_feminist_trigger = yes
						culture = basque
						any_vassal = {
							is_female = yes
							is_voter = no
							NOT = { is_married = PREV }
							NOT = { is_mother = PREV }
							OR = {
								diplomacy = 15
								stewardship = 15
							}
						}
						any_dynasty_member = {
							is_female = yes
							is_voter = no
							liege = { character = PREVPREV }
							NOT = { is_married = PREV }
							NOT = { is_mother = PREV }
							OR = {
								diplomacy = 15
								stewardship = 15
							}
						}
					}
				}
			}
		}
		pass_effect = {
			
		}
		effect = {
			if = {
				limit = {
					has_law = female_council_law_1
				}
				custom_tooltip = {
					text = TOOLTIP_ALLOW_FEMALE_TREASURER
				}
				custom_tooltip = {
					text = TOOLTIP_ALLOW_FEMALE_CHANCELLOR
				}
			}
			if = {
				limit = {
					holder_scope = {
						OR = {
							is_theocracy = yes
							is_republic = yes
						}
					}
				}
				set_allows_matrilineal_marriage = yes
			}
			if = {
				limit = {
					has_law = female_council_law_3
				}
				custom_tooltip = {
					text = TOOLTIP_DISALLOW_FEMALE_MARSHAL
				}
			}
			hidden_tooltip = {
				revoke_law = female_council_law_0
				revoke_law = female_council_law_1
				revoke_law = female_council_law_3
				revoke_law = female_council_law_4
			}
			set_allow_feminism = no
			set_allow_gender_laws = no
		}
		default = yes
		default_selection = {
			factor = 0
			additive_modifier = {
				value = 10
				culture = basque
			}
		}
	}

	female_council_law_3 = {
		group = female_council_law_group
		potential = {
			NOR = { 
				has_global_flag = gender_equality 
				has_game_rule = {
					name = gender
					value = historical
				}
				has_game_rule = {
					name = gender
					value = all
				}
			}
		}
		allow = {
			OR = {
				has_law = female_council_law_4
				AND = {
					has_law = female_council_law_2
					OR = {
						NOT = { has_law = agnatic_succession }
						holder_scope = { is_theocracy = yes }
						holder_scope = { is_republic = yes }
					}
				}
			}
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0
				holder_scope = {
					trait = zealous
					is_feminist_trigger = no
				}
			}
			modifier = {
				factor = 0
				holder_scope = {
					OR = {
						trait = slothful
						trait = content
						trait = humble
					}
				}
			}
			modifier = {
				factor = 0
				has_law = female_council_law_1
				holder_scope = {
					NOR = {
						is_female = yes
						is_feminist_trigger = yes
						culture = basque
						any_vassal = {
							is_female = yes
							is_voter = no
							NOT = { is_married = PREV }
							NOT = { is_mother = PREV }
							martial = 15
						}
						any_dynasty_member = {
							is_female = yes
							is_voter = no
							liege = { character = PREVPREV }
							NOT = { is_married = PREV }
							NOT = { is_mother = PREV }
							martial = 15
						}
					}
				}
			}
		}
		pass_effect = {
			
		}
		effect = {
			if = {
				limit = {
					holder_scope = {
						OR = {
							is_theocracy = yes
							is_republic = yes
						}
					}
				}
				set_allows_matrilineal_marriage = yes
			}
			if = {
				limit = {
					has_law = female_council_law_2
				}
				custom_tooltip = {
					text = TOOLTIP_ALLOW_FEMALE_MARSHAL
				}
			}
			if = {
				limit = {
					has_law = female_council_law_4
				}
				custom_tooltip = {
					text = TOOLTIP_DISALLOW_TRUE_COGNATIC
				}
			}
			if = {
				limit = {
					has_law = female_council_law_2
					OR = {
						has_law = true_cognatic_succession
						has_law = enatic_cognatic_succession
						has_law = enatic_succession
					}
					holder_scope = {
						NOR = {
							is_theocracy = yes
							is_republic = yes
						}
					}
				}
				add_law = cognatic_succession
			}
			hidden_tooltip = {
				revoke_law = female_council_law_0
				revoke_law = female_council_law_1
				revoke_law = female_council_law_2
				revoke_law = female_council_law_4
			}
			set_allow_feminism = no
			set_allow_gender_laws = yes
		}
		default = yes
		default_selection = {
			factor = 0
		}
	}

	female_council_law_4 = {
		group = female_council_law_group
		allow = {
			has_law = female_council_law_3
			OR = {				
				has_game_rule = {
					name = gender
					value = all
				}			
				NOT = { has_law = agnatic_succession }
				holder_scope = { is_theocracy = yes }
				holder_scope = { is_republic = yes }
			}
		}
		potential = {
			always = yes
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0
				has_law = female_council_law_4
			}
			modifier = {
				factor = 0
				holder_scope = {
					trait = zealous
					is_feminist_trigger = no
				}
			}
			modifier = {
				factor = 0
				holder_scope = {
					OR = {
						trait = slothful
						trait = content
						trait = humble
					}
				}
			}
			modifier = {
				factor = 0
				has_law = female_council_law_1
				holder_scope = {
					NOR = {
						is_female = yes
						culture = basque
						is_feminist_trigger = yes
					}
				}
			}
		}
		pass_effect = {
			
		}
		effect = {
			if = {
				limit = {
					holder_scope = {
						OR = {
							is_theocracy = yes
							is_republic = yes
						}
					}
				}
				set_allows_matrilineal_marriage = yes
			}
			custom_tooltip = {
				text = TOOLTIP_ALLOW_TRUE_COGNATIC
			}
			hidden_tooltip = {
				revoke_law = female_council_law_0
				revoke_law = female_council_law_1
				revoke_law = female_council_law_2
				revoke_law = female_council_law_3
			}
			set_allow_feminism = yes
			set_allow_gender_laws = yes
		}
		default = yes
		default_selection = {
			factor = 0
			additive_modifier = {
				value = 10
				holder_scope = { is_feminist_trigger = yes }
			}
			additive_modifier = {
				value = 100
				has_law = true_cognatic_succession
			}
			additive_modifier = {
				value = 1000
				has_game_rule = {
					name = gender
					value = all
				}				
			}
		}
	}
	
	# CULTURE CONVERSION LAWS
	##############################
	
	# None
	culture_conversion_0 = {
		group = culture_conversion_group
		
		potential = {
			higher_tier_than = duke
			holder_scope = {
				independent = yes
				is_feudal = yes
			}
		}
		allow = {
			has_law = culture_conversion_1
		}
		ai_will_do = {
			factor = 0
		}
		effect = {
			hidden_tooltip = {
				revoke_law = culture_conversion_1
				revoke_law = culture_conversion_2
			}
		}
	}

	# PASSIVE
	culture_conversion_1 = {
		group = culture_conversion_group
		default = yes
		
		potential = {
			higher_tier_than = duke
			holder_scope = {
				independent = yes
				is_feudal = yes
			}
		}
		allow = {
			OR = {
				has_law = culture_conversion_0
				has_law = culture_conversion_2
				NOR = {
					has_law = culture_conversion_0
					has_law = culture_conversion_1
					has_law = culture_conversion_2
				}
			}
		}
		ai_will_do = {
			factor = 0
		}
		effect = {
			hidden_tooltip = {
				revoke_law = culture_conversion_0
				revoke_law = culture_conversion_2
			}
		}
	}

	# ACTIVE/FORCED
	culture_conversion_2 = {
		group = culture_conversion_group
		
		potential = {
			higher_tier_than = duke
			holder_scope = {
				independent = yes
				is_feudal = yes
			}
		}
		allow = {
			has_law = culture_conversion_1
			OR = {
				has_law = crown_authority_2
				has_law = crown_authority_3
				has_law = crown_authority_4
			}
		}
		ai_will_do = {
			factor = 0
		}
		effect = {
			hidden_tooltip = {
				revoke_law = culture_conversion_0
				revoke_law = culture_conversion_1
			}
		}
	}
}

