code:
### Castle Alcove
regula_alcove = {
	background = {
		reference = "gfx/interface/illustrations/event_scenes/regula_alcove.dds"
		environment = "environment_event_corridor_day"
		ambience = "event:/SFX/Events/Backgrounds/castle_corridor_day"
	}
}

### Holy Order - Exterior Castle
regula_holy_order = {
	background = {
		reference = "gfx/interface/illustrations/event_scenes/regula_holy_order.dds"
		environment = "environment_event_courtyard"
		ambience = "event:/SFX/Events/Backgrounds/castle_courtyard_western"
	}
}

### Holy Order - Castle Interior
regula_holy_order_interior = {
	background = {
		reference = "gfx/interface/illustrations/event_scenes/regula_holy_order_interior.dds"
		environment = "environment_event_corridor_day"
		ambience = "event:/SFX/Events/Backgrounds/castle_corridor_day"
	}
}

### House arrest chamber
regula_house_arrest = {
	background = {
		reference = "gfx/interface/illustrations/event_scenes/regula_house_arrest.dds"
		environment = "environment_event_bedchamber"
		ambience = "event:/SFX/Events/Backgrounds/office_workplace"
	}
}

### Initiation ritual site
regula_workshop_night = {
	background = {
		reference = "gfx/interface/illustrations/event_scenes/regula_workshop_night.dds"
		environment = "environment_event_corridor"
		ambience = "event:/SFX/Events/Backgrounds/temple_christian"
	}
}

### Paelex ritual site
godless_shrine = {
	background = {
		reference = "gfx/interface/illustrations/event_scenes/godless_shrine.dds"
		environment = "environment_event_corridor_day"
		ambience = "event:/SFX/Events/Backgrounds/temple_christian"
	}
}

### Sanctifica Serva ritual site
regula_ritual_site = {
	background = {
		reference = "gfx/interface/illustrations/event_scenes/regula_ritual_site.dds"
		environment = "environment_event_corridor"
		ambience = "event:/SFX/Events/Backgrounds/temple_pagan"
	}
}

### Sanctifica serva goddesses
regula_goddess_diplomacy = {
	background = {
		reference = "gfx/interface/illustrations/event_scenes/regula_goddess_diplomacy.dds"
		environment = "environment_event_corridor"
		ambience = "event:/SFX/Events/Backgrounds/temple_generic"
	}
}

regula_goddess_martial = {
	background = {
		reference = "gfx/interface/illustrations/event_scenes/regula_goddess_martial.dds"
		environment = "environment_event_corridor"
		ambience = "event:/SFX/Events/Backgrounds/temple_generic"
	}
}

regula_goddess_stewardship = {
	background = {
		reference = "gfx/interface/illustrations/event_scenes/regula_goddess_stewardship.dds"
		environment = "environment_event_corridor"
		ambience = "event:/SFX/Events/Backgrounds/temple_generic"
	}
}

regula_goddess_intrigue = {
	background = {
		reference = "gfx/interface/illustrations/event_scenes/regula_goddess_intrigue.dds"
		environment = "environment_event_corridor"
		ambience = "event:/SFX/Events/Backgrounds/temple_generic"
	}
}

regula_goddess_learning = {
	background = {
		reference = "gfx/interface/illustrations/event_scenes/regula_goddess_learning.dds"
		environment = "environment_event_corridor"
		ambience = "event:/SFX/Events/Backgrounds/temple_generic"
	}
}

### Bedchamber at night.
regula_bedchamber = {
	background = {
		reference = "gfx/interface/illustrations/event_scenes/regula_bedchamber_threshold.dds"
		environment = "environment_event_bedchamber"
		ambience = "event:/SFX/Events/Backgrounds/office_workplace"
	}
}

### Keeper of Souls Reborn
regula_kos_reborn = {
	background = {
		reference = "gfx/interface/illustrations/event_scenes/regula_kos_reborn.dds"
		environment = "environment_event_corridor"
		ambience = "event:/SFX/Events/Backgrounds/temple_generic"
	}
}

### Orgy main room.
regula_orgy = {
	background = {
		reference = "gfx/interface/illustrations/event_scenes/regula_orgy.dds"
		environment = "environment_event_bedchamber"
		ambience = "event:/SFX/Events/Backgrounds/temple_generic"
	}
}

### Stables
regula_stables = {
	background = {
		reference = "gfx/interface/illustrations/event_scenes/regula_stables.dds"
		environment = "environment_event_gallows"
		ambience = "event:/SFX/Events/Backgrounds/gallows_execution_platform"
	}
}

### Fancy prison, for deviant actions.
regula_cell = {
	background = {
		reference = "gfx/interface/illustrations/event_scenes/regula_cell.dds"
		environment = "environment_event_bedchamber"
		ambience = "event:/SFX/Events/Backgrounds/temple_generic"
	}
}


code:
regula_theme = {
	icon = {
		reference = "gfx/interface/icons/event_types/regula_frame.dds"
	}
	sound = {
		reference = "event:/SFX/Events/Themes/sfx_event_theme_type_faith"
	}
	background = {
		event_background = godless_shrine
	}
}

license: mit


code:
regula_servitude_faction = {
	casus_belli = regula_servitude_faction_war

	short_effect_desc = regula_servitude_faction_short_effect_desc

	sort_order = 10

	discontent_progress = {
		base = 0

		# We use a modifier as our base progress in order to take advantage of script values.
		modifier = {
			add = base_discontent_progress
			desc = "BASE_COLON"
		}

		# The higher above the power threshold the faction is, the faster discontent increases.
		modifier = {
			faction_power > faction_power_threshold
			add = faction_discontent_for_extra_power
			desc = "FACTION_DISCONTENT_POWER_ABOVE_THRESHOLD"
		}

		# Discontent slowly decays if power is under the threshold.
		modifier = {
			faction_power < faction_power_threshold
			add = {
				add = base_discontent_progress
				multiply = -2
			}
			desc = "FACTION_DISCONTENT_POWER_BELOW_THRESHOLD"
		}
	}

	power_threshold = {
		base = 80

		modifier = {
			add = 20
			faction_target = {
				has_perk = hard_rule_perk
			}
			desc = "FACTION_POWER_HARD_RULE"
		}
	}

	is_character_valid = {
		NOR = { #No prince-bishop can ever join
			has_government = theocracy_government
			AND = {
				exists = cp:councillor_court_chaplain
				this = cp:councillor_court_chaplain
			}
		}

		scope:faction.faction_target = liege
		highest_held_title_tier > tier_barony

		has_trait = devoted_trait_group

		#Not blocked through events
		custom_description = {
			text = character_blocked_from_joining
			NOT = {
				has_character_flag = joining_faction_block
			}
		}
	}

	demand = {
		save_scope_as = faction

		faction_leader = {
			save_scope_as = faction_leader
		}

		faction_target = {
			save_scope_as = faction_target
		}

		# Let the human players in the faction know that the demand will be sent
		every_faction_member = {
			limit = {
				is_ai = no
				NOT = { this = scope:faction.faction_leader }
			}
			trigger_event = regula_faction_demand.0005
		}

		global_var:magister_character = { # Inform the player.
			trigger_event = regula_faction_demand.0006
		}

		# Send the actual demand in 5 days
		faction_target = {
			trigger_event = {
				id = regula_faction_demand.0001
				days = 5
			}
		}
	}

	ai_create_score = {
		base = 0 # Base reluctance value we must overcome to start a Servitude Faction.

		############
		# BLOCKERS #

		# Refuses to make if there was a recent servitude faction revolt.
		modifier = {
			add = -2000
			scope:target = {
				has_character_flag = recent_regula_servitude_faction_war
			}
		}
		# Can't fight this war if already serving the Magister.
		modifier = {
			add = -2000
			scope:target = {
				has_trait = magister_trait_group
				any_ally = {
					has_trait = magister_trait_group
				}
			}
		}

		# Do not join a new faction if I am already at war.
		modifier = {
			add = -2000
			is_at_war = yes
		}

		# If a suitable Servitude Faction already exists, join it instead
		modifier = {
			add = -2000
			scope:target = {
				any_targeting_faction = {
	  				faction_is_type = regula_servitude_faction
				}
		  	}
		}

		#######################
		# Standard AI Weights #

		# Very high base create chance.
		modifier = {
			add = 1000
			has_trait = devoted_trait_group
		}

		# Can't create if title is higher than Magister's
		modifier = {
			highest_held_title_tier >= global_var:magister_character.highest_held_title_tier
			add = -2000
		}
	}

	ai_join_score = {
		base = 0 # Base reluctance value we must overcome to start an Independence Faction.

		############
		# BLOCKERS #

		# Do not join a new faction if I am already at war.
		modifier = {
			add = -2000
			AND = {
				is_at_war = yes
				trigger_if = {
					limit = {
						exists = joined_faction
					}
					NOT = { joined_faction = scope:faction }
				}
			}
		}

		#######################
		# Standard AI Weights #

		# Very high base join chance.
		modifier = {
			add = 1000
			has_trait = devoted_trait_group
		}

		# Can't join if title is higher than Magister's
		modifier = {
			highest_held_title_tier >= global_var:magister_character.highest_held_title_tier
			add = -2000
		}

		# Won't join if Magister is allied to target.
		modifier = {
			any_ally = {
				has_trait = magister_trait_group
			}
			add = -2000
		}

		##########################
		# Faction 'Stacking' Factors, attempts to cluster AI rulers into several powerful factions instead of many weak ones.
		modifier = {
			scope:faction.faction_power >= scope:faction.faction_power_halfway_threshold
			factor = faction_weight_factor_power_halfway_threshold
		}
		modifier = {
			scope:faction.faction_power >= scope:faction.faction_power_pushing_threshold
			factor = faction_weight_factor_power_pushing_threshold
		}
		modifier = {
			scope:faction.faction_power >= scope:faction.faction_power_threshold
			factor = faction_weight_factor_power_exceeds_threshold
		}
	}

	ai_demand_chance = {
		base = 0

		# 40% base chance at minimum power (80%), increasing linearly
		compare_modifier = {
			value = faction_power
			multiplier = 0.5
		}

		# Once the faction has a good chance to win (10% stronger than liege) demand chance increases much more rapidly.
		compare_modifier = {
			trigger = {	faction_power > 110 }
			value = faction_power
			multiplier = 1
		}

		modifier = {
			add = 100
			faction_target = {
				is_at_war = yes # Independence Factions are opportunistic bastards!
			}
		}
	}

	can_character_join = {
		NOT = { is_allied_to = scope:faction.faction_target }
		scope:faction.faction_target = {
			NOT = { has_strong_hook = root }
		}

		has_trait = devoted_trait_group
		global_var:magister_character = {
			is_alive = yes
		}

		scope:faction.faction_target.highest_held_title_tier > tier_county

		custom_description = {
			text = character_has_faction_disabling_modifier
			character_has_faction_disabling_modifier_trigger = yes
		}
	}

	can_character_create = {
		NOR = { #No prince-bishop can ever join
			has_government = theocracy_government
			AND = {
				exists = liege.cp:councillor_court_chaplain
				this = liege.cp:councillor_court_chaplain
			}
		}
		liege = {
			is_independent_ruler = yes
			NOT = { has_trait = magister_trait_group }
		}
		AND = {
			exists = global_var:magister_character
			global_var:magister_character = { # Hilarious as a bunch of Paelices campaigning for a dead ruler is, it causes a few too many problems.
				is_alive = yes
			}
		}
		has_trait = devoted_trait_group
		NOT = { is_allied_to = scope:target }
		NOT = { has_truce = scope:target }
		scope:target = {
			NOT = { has_strong_hook = root }
		}

		scope:target.highest_held_title_tier > tier_county
		highest_held_title_tier > tier_barony

		####
		# BLOCKERS
		####
		# General Faction immunity
		custom_description = {
			text = character_is_immune_to_factions
			subject = scope:target
			NOT = { scope:target = { immune_to_factions_trigger = yes } }
		}

		custom_description = {
			text = character_has_faction_disabling_modifier
			character_has_faction_disabling_modifier_trigger = yes
		}
	}
	player_can_join = no
	inherit_membership = no
	county_allow_join = yes
	county_allow_create = yes
}


code:
compedita = {
    texture = "gfx/interface/icons/message_feed/regula_religion.dds"
}

compeditae = {
    texture = "gfx/interface/icons/message_feed/regula_religion.dds"
}

famuli = {
    texture = "gfx/interface/icons/message_feed/regula_religion.dds"
}

famulus = {
    texture = "gfx/interface/icons/message_feed/regula_religion.dds"
}

regula_fascinare_scheme = {
    texture = "gfx/interface/icons/message_feed/regula_religion.dds"
    alias = { fascinare regula_fascinare regula_fascinare_interaction }
    parent = scheme
}

regula_servitude_faction = {
    texture = "gfx/interface/icons/message_feed/regula_religion.dds"
    parent = faction
}

regula_covert_conversion = {
	texture = "gfx/interface/icons/message_feed/regula_book.dds"
    alias = { spellbound }
}


code:
regula_naked_compeditae = {
    default = regula_naked_compeditae_disabled
    regula_naked_compeditae_disabled = {}
    regula_naked_compeditae_all_enabled = {}
    regula_naked_compeditae_limited_enabled = {}
}

regula_portraits_compeditae = {
    default = regula_portraits_compeditae_enabled
    regula_portraits_compeditae_enabled = {}
    regula_portraits_compeditae_disabled = {}
}

regula_portraits_revealing_clothing = {
    default = regula_portraits_revealing_clothing_disabled
    regula_portraits_revealing_clothing_enabled = {}
    regula_portraits_revealing_clothing_disabled = {}
}

regula_bloodline_tally_goals = {
    default = regula_bloodline_tally_goals_single_life
    regula_bloodline_tally_goals_single_life = {}
    regula_bloodline_tally_goals_cumulative = {}
}


code:
accessory_genes = {
#####################################
#									#
# 		   EYE ACCESSORY 			#
#									#
#####################################

	eye_accessory = {
		inheritable = no

		normal_eyes = {
			index = 0
			male = {	1 = "male_eyes_normal"		}
			female = {	1 = "female_eyes_normal"	}
			boy = male
			girl = female
		}
		normal_eyes_no_shadow = {
			index = 1
			male = {    1 = "male_eyes_normal_no_shadow"      }
			female = {  1 = "female_eyes_normal_no_shadow"    }
			boy = male
			girl = female
		}
		normal_eyes_dark_iris = {
			index = 2
			male = {    1 = "male_eyes_normal_dark_iris"      }
			female = {  1 = "female_eyes_normal_dark_iris"    }
			boy = male
			girl = female
		}
		normal_eyes_asian = {
			index = 3
			male = {    1 = "male_eyes_normal_asian"      }
			female = {  1 = "female_eyes_normal_asian"    }
			boy = male
			girl = female
		}
		bloodshot_eyes = {
			index = 4
			male = {	1 = "male_eyes_bloodshot"		}
			female = {	1 = "female_eyes_bloodshot"	}
			boy = male
			girl = female
		}
		blind_eyes = {
			index = 5
			male = {	1 = "male_eyes_blind"		}
			female = {	1 = "female_eyes_blind"	}
			boy = male
			girl = female
		}
		no_eyes = {
			index = 6
			male = {}
			female = {}
			boy = {}
			girl = {}
		}
		regula_pink_eyes = {
			index = 7

			male = { 1 = "male_eyes_normal" }
			female = { 1 = "regula_female_eyes_pink" }
			boy = male
			girl = female
		}
		regula_violet_eyes = {
			index = 8

			male = { 1 = "male_eyes_normal" }
			female = { 1 = "regula_female_eyes_violet" }
			boy = male
			girl = female
		}
		regula_sclera_pink = {
			index = 9

			male = { 1 = "male_eyes_normal" }
			female = { 1 = "regula_female_sclera_pink" }
			boy = male
			girl = female
		}
	}
}


code:
regula_sigillum_hook = {
    strong = yes
}


code:
action_regula_make_paelex = {
    combine_into_one = yes
    priority = 700

    check_create_action = {
        if = {
            limit = {
                has_trait = magister_trait_group
                has_trait_rank = {
                    trait = magister_trait_group
                    rank >= 2
                }
            }
        }
        every_vassal = {
            limit = {
                has_trait = mulsa
                is_imprisoned = no
                highest_held_title_tier >= tier_county
            }
            try_create_important_action = {
                important_action_type = action_regula_make_paelex
                actor = global_var:magister_character
                recipient = this
            }
        }
    }

    effect = {
        open_interaction_window = {
            interaction = regula_make_paelex_interaction
            actor = scope:actor
            recipient = scope:recipient
        }
    }
}

action_can_fascinare_vassal = {
    combine_into_one = yes
    priority = 800

    check_create_action = {
        if = {
            limit = {
                has_trait = magister_trait_group
            }
        }
        every_vassal = {
            limit = {
                NOT = { has_trait = devoted_trait_group }
                is_imprisoned = no
                highest_held_title_tier >= tier_county
                is_female = yes
                age >= 16
            }
            try_create_important_action = {
                important_action_type = action_can_fascinare_vassal
                actor = global_var:magister_character
                recipient = this
            }
        }
    }

    effect = {
        open_interaction_window = {
            interaction = regula_fascinare_interaction
            actor = scope:actor
            recipient = scope:recipient
        }
    }
}

action_regula_take_orba = {
    combine_into_one = yes
    priority = 600

    check_create_action = {
        if = {
            limit = {
                has_trait = magister_trait_group
                has_trait_rank = {
                    trait = magister_trait_group
                    rank >= 2
                }
            }
        }
        every_vassal_or_below = {
            limit = {
                has_trait = orba
                is_imprisoned = no
            }
            try_create_important_action = {
                important_action_type = action_regula_take_orba
                actor = root
                recipient = this
            }
        }
    }

    effect = {
        open_interaction_window = {
            interaction = regula_take_orba_interaction
            actor = scope:actor
            recipient = scope:recipient
        }
    }
}

action_regula_potestas_non_transfunde = {
    combine_into_one = yes
    priority = 950

    check_create_action = {
        if = {
            limit = {
                is_ai = no
                exists = faith.religious_head
                root = faith.religious_head
                faith = {
                    has_doctrine = tenet_regula_devoted
                }
                has_trait = magister_trait_group
                has_trait_rank = {
                    trait = magister_trait_group
                    rank >= 2
                }
            }
            every_neighboring_and_across_water_top_liege_realm_owner = {
                limit = {
                    faith = root.faith
                    is_independent_ruler = yes
                    is_male = no
                    age >= 16
                    highest_held_title_tier < root.highest_held_title_tier
                    is_available = yes
                    # TODO check piety cost, the check below causes errors as the scopes are incorrect
                    # save_temporary_scope_as = transfunde_target
                    # root = {
                    #     prestige >= scope:transfunde_target.regula_potestas_non_transfunde_cost
                    # }
                }
                try_create_important_action = {
                    important_action_type = action_regula_potestas_non_transfunde
                    actor = root
                    recipient = this
                }
            }
        }
    }

    effect = {
        open_interaction_window = {
            interaction = regula_potestas_non_transfunde_interaction
            actor = scope:actor
            recipient = scope:recipient
        }
    }
}

action_can_mutare_corpus_paelex_or_domina = {
    combine_into_one = yes
    priority = 600

    check_create_action = {
        if = {
            limit = {
                has_trait = magister_trait_group
                piety >= regula_mutare_corpus_interaction_piety_cost
            }
            every_vassal = {
                limit = {
                    save_temporary_scope_as = temp_vassal # There probally is a variable for this but I dont know what the name is
                    global_var:magister_character = {
                            is_character_interaction_valid = {
                            recipient = scope:temp_vassal
                            interaction = regula_mutare_corpus_interaction
                        }
                    }
                    OR = {
                        has_trait = paelex
                        has_trait = domina
                    }
                }
            try_create_important_action = {
                    important_action_type = action_can_mutare_corpus_paelex_or_domina
                    actor = global_var:magister_character
                    recipient = this
                }
            }
        }
    }

    effect = {
        open_interaction_window = {
            interaction = regula_mutare_corpus_interaction
            actor = scope:actor
            recipient = scope:recipient
        }
    }
}


code:
title_succession_laws = {
	compeditae_elective_succession_law = {
		can_keep = {
			is_male = yes
		}
		can_have = {
			highest_held_title_tier = tier_empire
			# has_trait = magister_trait_group
		}
		can_pass = {
			can_change_title_law_trigger = yes
			custom_description = {
				text = magister_trait_4_required_trigger
				has_trait_rank = {
					trait = magister_trait_group
					rank >= 4
				}
			}
			custom_description = {
				text = regula_compeditae_election_concubine_pass_minimum_trigger
				regula_num_landed_concubines >= 6
			}
		}
		can_title_have = {
			tier = tier_empire
		}
		should_show_for_title = { # Never show this in the UI, just apply it through script
			always = no
		}
		succession = {
			order_of_succession = election
			election_type = compeditae_elective
		}
		flag = elective_succession_law
		modifier = {
		}
		revoke_cost = {
			prestige = change_title_succession_law_prestige_cost
		}
		on_revoke = {
			remove_character_modifier = regula_compeditae_succession_modifier
		}
		pass_cost = {
			piety = 400
		}
	}
	#Linker for Compeditae Elective law.
	compeditae_lower_title_succession_law = {
		can_title_have = {
			OR = {
				tier = tier_barony
				tier = tier_county
				tier = tier_duchy
				tier = tier_kingdom
				tier = tier_empire
			}
		}
		can_keep = {
			is_male = yes
			any_held_title = {
				has_title_law = compeditae_elective_succession_law
			}
		}
		should_show_for_title = { # Never show this in the UI, just apply it through script
			always = no
		}
		succession = {
			order_of_succession = player_heir
		}
		revoke_cost = {
			piety = 400
		}
	}

	#Default Feudal Elective
	feudal_elective_succession_law = {
		can_have = {
			has_government = feudal_government
			highest_held_title_tier >= tier_duchy
			NOR = { #Cultures have their special flavor.
				culture = { has_cultural_parameter = witenagemot_succession_enabled }
				culture = { has_cultural_parameter = scandinavian_elective_enabled }
			}
		}
		can_pass = {
			can_change_title_law_trigger = yes
		}
		can_title_have = {
			can_title_have_law_general_trigger = yes
		}
		succession = {
			order_of_succession = election
			election_type = feudal_elective
		}
		flag = elective_succession_law
		title_allegiance_opinion = 10
		revoke_cost = {
			prestige = change_title_succession_law_prestige_cost
		}
		pass_cost = {
			prestige = change_title_succession_law_prestige_cost
		}
	}

	#HRE Succession
	princely_elective_succession_law = {
		can_have = {
			OR = {
				has_government = feudal_government
				has_government = clan_government
			}
			highest_held_title_tier = tier_empire
		}
		can_pass = {
			can_change_title_law_trigger = yes
		}
		can_title_have = {
			this = title:e_hre
			can_title_have_law_general_trigger = yes
		}
		succession = {
			order_of_succession = election
			election_type = princely_elective
		}
		flag = elective_succession_law
		title_allegiance_opinion = 10
		modifier = {
			vassal_limit = 20
		}
		revoke_cost = {
			prestige = change_hre_title_succession_law_prestige_cost
		}
		pass_cost = {
			prestige = change_title_succession_law_prestige_cost
		}
	}

	#Witenagemot
	saxon_elective_succession_law = {
		can_have = {
			OR = {
				has_government = feudal_government
				has_government = clan_government
				has_government = tribal_government
			}
			highest_held_title_tier >= tier_kingdom
		}
		can_pass = {
			can_change_title_law_trigger = yes
			culture = { has_cultural_parameter = witenagemot_succession_enabled }
		}
		can_title_have = {
			can_title_have_law_general_trigger = yes
		}
		succession = {
			order_of_succession = election
			election_type = saxon_elective
		}
		flag = elective_succession_law
		title_allegiance_opinion = 5
		revoke_cost = {
			prestige = change_title_succession_law_prestige_cost
		}
		pass_cost = {
			prestige = change_title_succession_law_prestige_cost
		}
	}
	#Thing
	scandinavian_elective_succession_law = {
		can_have = {
			OR = {
				has_government = feudal_government
				has_government = clan_government
				has_government = tribal_government
			}
			highest_held_title_tier >= tier_duchy
		}
		can_pass = {
			can_change_title_law_trigger = yes
			culture = { has_cultural_parameter = scandinavian_elective_enabled }
		}
		can_title_have = {
			can_title_have_law_general_trigger = yes
		}
		succession = {
			order_of_succession = election
			election_type = scandinavian_elective
		}
		flag = elective_succession_law
		title_allegiance_opinion = 5
		revoke_cost = {
			prestige = change_title_succession_law_prestige_cost
		}
		pass_cost = {
			prestige = change_title_succession_law_prestige_cost
		}
	}
	#Tanistry
	gaelic_elective_succession_law = {
		can_have = {
			OR = {
				has_government = feudal_government
				has_government = clan_government
				has_government = tribal_government
			}
			highest_held_title_tier >= tier_duchy
		}
		can_pass = {
			can_change_title_law_trigger = yes
			custom_description = {
				OR = {
					culture = { has_cultural_pillar = heritage_brythonic }
					culture = { has_cultural_pillar = heritage_goidelic }
				}
				text = succession_laws_must_have_valid_tanistry_culture
			}
		}
		can_title_have = {
			can_title_have_law_general_trigger = yes
		}
		succession = {
			order_of_succession = election
			election_type = gaelic_elective
		}
		flag = elective_succession_law
		title_allegiance_opinion = 5
		revoke_cost = {
			prestige = change_title_succession_law_prestige_cost
		}
		pass_cost = {
			prestige = change_title_succession_law_prestige_cost
		}
	}

	#Player Heir
	temporal_head_of_faith_succession_law = {
		can_title_have = {
			is_temporal_head_of_faith_trigger = yes
		}
		should_show_for_title = { # Never show this in the UI, just apply it through script
			always = no
		}
		can_remove_from_title = {
			custom_description = {
				text = succession_laws_must_not_be_temporal
				is_temporal_head_of_faith_trigger = no
			}
		}
		succession = {
			order_of_succession = player_heir
		}
	}
}


code:
succession_gender_laws = {
	default = male_preference_law
	flag = succession_gender_laws

		#Regula gender succession law for the player. Male only inheritance, consorts allowed.
		regula_magister_gender_law = {
			can_title_have = {
				can_title_have_law_general_trigger = yes
			}
			can_keep = {
				# is_independent_ruler = yes
				has_trait = magister_trait_group
				faith = {
					has_doctrine = tenet_regula_devoted
					religion_tag = regula_religion
				}
			}

			can_pass = { #UPDATE - figure out what this does.
				can_change_succession_law_trigger = yes
			}
			should_start_with = {

			}
			succession = {
				gender_law = male_only
			}
			flag = men_can_have_multiple_spouses
			# flag = elective_succession_law
			flag = no_male_commanders

			pass_cost = {
				prestige = change_succession_law_prestige_cost
			}
			revoke_cost = {
				prestige = change_succession_law_prestige_cost
			}
		}
		#Regula gender succession law for the vassals.  Female inheritance only.
		regula_vassal_succession_law = {
			can_title_have = {
				can_title_have_law_general_trigger = yes
			}
			### Update - Are the can_keep and can_have sections really necessary here?
			can_keep = {
				OR = {
					faith = {
						has_doctrine = tenet_regula_devoted
						religion_tag = regula_religion
					}
					root.top_liege = {
						has_realm_law = regula_magister_gender_law
					}
					liege = {
						OR = {
							has_realm_law = regula_magister_gender_law
							has_realm_law = regula_vassal_succession_law
						}
					}
				}
			}

			can_have = {
			}
			can_pass = {
				can_change_succession_law_trigger = yes
				is_independent_ruler = no
			}
			should_start_with = {
				# root.top_liege = {
				# 	has_realm_law = regula_magister_gender_law
				# }
			}
			succession = {
				gender_law = female_only
			}
			pass_cost = {
				prestige = change_succession_law_prestige_cost
			}
			revoke_cost = {
				prestige = change_succession_law_prestige_cost
			}
		}
		# Regula covert gender succession law for vassals. Female preference.
		regula_covert_vassal_succession_law = {
			can_title_have = {
				can_title_have_law_general_trigger = yes
			}
			### Update - Are the can_keep and can_have sections really necessary here?
			can_keep = {
			}

			can_have = {
			}
			can_pass = {
				always = no
			}
			should_start_with = {
				# root.top_liege = {
				# 	has_realm_law = regula_magister_gender_law
				# }
			}
			succession = {
				gender_law = female_preference
			}
			# Pass and revoke costs aren't achievable.
			pass_cost = {
				prestige = 10000
			}
			revoke_cost = {
				prestige = 10000
			}
		}

	male_only_law = {
		can_title_have = {
			can_title_have_law_general_trigger = yes
		}
		should_show_for_title = { # Never show this in the UI, just apply it through script
			always = no
		}
		can_keep = {
			custom_tooltip = {
				text = culture_not_female_only_tt
				OR = {
					faith = { has_doctrine = doctrine_gender_male_dominated }
					NOT = {
						culture = { has_cultural_parameter = female_only_inheritance }
					}
				}
			}
		}
		can_pass = {
			can_change_succession_law_trigger = yes
		}
		should_start_with = {
			faith = {
				has_doctrine = doctrine_gender_male_dominated
				religion_tag = islam_religion
			}
		}
		succession = {
			gender_law = male_only
		}
		flag = men_can_have_multiple_spouses
		flag = men_can_have_consorts
		flag = no_female_commanders

		pass_cost = {
			prestige = change_succession_law_prestige_cost
		}
		revoke_cost = {
			prestige = change_succession_law_prestige_cost
		}
	}

	male_preference_law = {
		can_title_have = {
			can_title_have_law_general_trigger = yes
		}
		should_show_for_title = { # Never show this in the UI, just apply it through script
			always = no
		}
		can_keep = {
			custom_description = {
				text = change_law_male_preference_faith_requirement
				faith = {
					NOT = { has_doctrine = doctrine_gender_female_dominated }
				}
			}
			custom_tooltip = {
				text = culture_not_female_only_tt
				OR = {
					faith = { has_doctrine = doctrine_gender_male_dominated }
					NOT = {
						culture = { has_cultural_parameter = female_only_inheritance }
					}
				}
			}
		}
		can_pass = {
			can_change_succession_law_trigger = yes
		}
		should_start_with = {
			NOT = {
				culture = { has_cultural_parameter = female_preference_inheritance }
			}
			OR = {
				faith = {
					NOT = {
						religion_tag = islam_religion
					}
					has_doctrine = doctrine_gender_male_dominated
				}
				has_realm_law = male_only_law # For when male_only_law ceases to be a legal option
			}
		}
		succession = {
			gender_law = male_preference
		}
		flag = men_can_have_multiple_spouses
		flag = men_can_have_consorts
		flag = no_female_commanders

		pass_cost = {
			prestige = change_succession_law_prestige_cost
		}
		revoke_cost = {
			prestige = change_succession_law_prestige_cost
		}
	}

	equal_law = {
		can_title_have = {
			can_title_have_law_general_trigger = yes
		}
		should_show_for_title = { # Never show this in the UI, just apply it through script
			always = no
		}
		can_keep = {
			custom_tooltip = {
				text = equal_law_culture_faith_or_innovation_trigger
				OR = {
					culture = { has_cultural_parameter = gender_equal_inheritance }
					#culture = { has_innovation = innovation_visigothic_codes }
					faith = { has_doctrine = doctrine_gender_equal }
					AND = { #Culture is female dominated but religion is male dominated
						faith = { has_doctrine = doctrine_gender_male_dominated }
						culture = { has_cultural_parameter = female_only_inheritance }
					}
					AND = { #Culture is male dominated but faith is female dominated
						faith = { has_doctrine = doctrine_gender_female_dominated }
						NOT = { culture = { has_cultural_parameter = female_only_inheritance } }
					}
				}
			}
		}
		can_pass = {
			#can_change_to_equal_succession_law_trigger = yes
			can_change_succession_law_trigger = yes
		}
		should_start_with = {
			NOR = {
				culture = { has_cultural_parameter = female_preference_inheritance }
				culture = { has_cultural_tradition = tradition_nubian_warrior_queens }
			}
			faith = {
				has_doctrine = doctrine_gender_equal
			}
			NOT = { has_realm_law = female_only_law } # For when female_only_law ceases to be valid
		}
		succession = {
			gender_law = equal
		}
		flag = men_can_have_multiple_spouses
		flag = men_can_have_consorts
		flag = women_can_have_multiple_spouses
		flag = women_can_have_consorts

		pass_cost = {
			prestige = change_succession_law_prestige_cost
		}
		revoke_cost = {
			prestige = change_succession_law_prestige_cost
		}

		ai_will_do = {
			if = {
				limit = {
					primary_title.tier > tier_county
					faith = {
						NOT = {
							has_dominant_ruling_gender = prev
						}
					}
				}
				value = 2
			}
		}
	}

	female_preference_law = {
		can_title_have = {
			can_title_have_law_general_trigger = yes
		}
		should_show_for_title = { # Never show this in the UI, just apply it through script
			always = no
		}
		can_keep = {
			custom_tooltip = {
				text = female_preference_law_faith_or_culture_trigger
				OR = {
					faith = {
						NOT = { has_doctrine = doctrine_gender_male_dominated }
					}
					culture = { has_cultural_parameter = female_preference_inheritance }
				}
			}
		}
		should_start_with = {
			OR = {
				culture = { has_cultural_parameter = female_preference_inheritance }
				faith = {
					has_doctrine = doctrine_gender_female_dominated
				}
				has_realm_law = female_only_law # For when male_only_law ceases to be a legal option
			}
		}
		can_pass = {
			can_change_succession_law_trigger = yes
		}
		succession = {
			gender_law = female_preference
		}
		flag = women_can_have_multiple_spouses
		flag = women_can_have_consorts

		pass_cost = {
			prestige = change_succession_law_prestige_cost
		}
		revoke_cost = {
			prestige = change_succession_law_prestige_cost
		}
	}

	female_only_law = {
		can_title_have = {
			can_title_have_law_general_trigger = yes
		}
		should_show_for_title = { # Never show this in the UI, just apply it through script
			always = no
		}
		can_keep = {
			custom_tooltip = {
				text = female_only_law_faith_or_culture_trigger
				OR = {
					faith = { has_doctrine = doctrine_gender_female_dominated }
					culture = { has_cultural_parameter = female_only_inheritance }
				}
			}
		}
		can_pass = {
			can_change_succession_law_trigger = yes
		}
		succession = {
			gender_law = female_only
		}
		flag = women_can_have_multiple_spouses
		flag = women_can_have_consorts

		pass_cost = {
			prestige = change_succession_law_prestige_cost
		}
		revoke_cost = {
			prestige = change_succession_law_prestige_cost
		}

		should_start_with = {
			OR = {
				culture = { has_cultural_parameter = female_only_inheritance }
			}
		}
	}
}

succession_faith = {
	same_faith_only_law = {
		can_keep = {
			should_have_same_faith_succession_trigger = yes
		}
		can_pass = {
			should_have_same_faith_succession_trigger = yes
		}
		should_start_with = {
			should_have_same_faith_succession_trigger = yes
		}
		succession = {
			faith = same_faith
		}
	}
}

succession_rel_head = {
	same_faith_theocratic_succession_law = {
		can_keep = {
			faith = {
				religious_head = root
				has_doctrine = doctrine_spiritual_head
			}
		}
		succession = {
			order_of_succession = theocratic
			faith = same_faith
			pool_character_config = pool_theocratic_succession
		}
	}
	same_faith_succession_law = {
		shown_in_encyclopedia = no
		can_keep = {
			faith = {
				religious_head = root
				has_doctrine = doctrine_temporal_head
			}
		}
		succession = {
			faith = same_faith
		}
	}
}


code:
# Regula MAA Regiments

pedites = { # Light Infantry
	type = skirmishers
	icon = pedites

	can_recruit = {
			trigger_if = {
				limit = {
					exists = global_var:magister_character
				}
				global_var:magister_character = {
					culture = { has_cultural_parameter = unlock_maa_famuli }
				}
				faith = global_var:magister_character.faith
			}
			trigger_else = {
				always = no
			}
	}

	damage = 8
	toughness = 12
	pursuit = 10
	screen = 16

	terrain_bonus = {
		forest = { damage = 4 toughness = 6 }
		taiga = { damage = 4 toughness = 6 }
		jungle = { damage = 4 toughness = 6 }
	}

	counters = {
		heavy_infantry = 1
		pikemen = 1
	}

	buy_cost = { gold = pedites_recruitment_cost }
	low_maintenance_cost = { gold = pedites_low_maint_cost }
	high_maintenance_cost = { gold = pedites_high_maint_cost }

	stack = 150
	ai_quality = { value = 300 }
	allowed_in_hired_troops = yes
}

sagittarius = { # Archers
	type = archers
	icon = sagittarius

	can_recruit = {
		trigger_if = {
			limit = {
				exists = global_var:magister_character
			}
			global_var:magister_character = {
				culture = { has_cultural_parameter = unlock_maa_famuli }
			}
			faith = global_var:magister_character.faith
		}
		trigger_else = {
			always = no
		}
}

	damage = 20
	toughness = 8
	pursuit = 0
	screen = 0

	terrain_bonus = {
		hills = { damage = 10 toughness = 4 }
		forest = { toughness = 4 screen = 4 }
		taiga = { toughness = 4 screen = 4 }
	}

	counters = {
		skirmishers = 1
		pikemen = 1
	}

	buy_cost = { gold = sagittarius_recruitment_cost }
	low_maintenance_cost = { gold = sagittarius_low_maint_cost }
	high_maintenance_cost = { gold = sagittarius_high_maint_cost }

	stack = 150
	ai_quality = { value = 300 }
	allowed_in_hired_troops = yes
}

equitatus = { # Light Cavalry
	type = light_cavalry
	icon = equitatus

	can_recruit = {
		trigger_if = {
			limit = {
				exists = global_var:magister_character
			}
			global_var:magister_character = {
				culture = { has_cultural_parameter = unlock_maa_famuli }
			}
			faith = global_var:magister_character.faith
		}
		trigger_else = {
			always = no
		}
}

	damage = 18
	toughness = 12
	pursuit = 30
	screen = 30

	terrain_bonus = {
		plains = { damage = 15 }
		drylands = { damage = 15 }
		hills = { damage = -5 }
		mountains = { damage = -10 pursuit = -20 }
		desert_mountains = { damage = -15 pursuit = -20 }
		wetlands = { damage = -15 toughness = -10 pursuit = -30 screen = -30 }
	}

	counters = {
		archers = 1
		skirmishers = 1
	}

	winter_bonus = {
		harsh_winter = { damage = -5 toughness = -2 }
	}

	buy_cost = { gold = equitatus_recruitment_cost }
	low_maintenance_cost = { gold = equitatus_low_maint_cost }
	high_maintenance_cost = { gold = equitatus_high_maint_cost }

	stack = 150
	ai_quality = { value = 300 }
	allowed_in_hired_troops = yes
}

sacerdos = { # Heavy Infantry (Used by Regula Holy Order)
	type = heavy_infantry
	icon = sacerdos

	can_recruit = {
		trigger_if = {
			limit = {
				exists = global_var:magister_character
			}
			global_var:magister_character = {
				culture = { has_cultural_parameter = unlock_maa_famuli }
			}
			faith = global_var:magister_character.faith
		}
		trigger_else = {
			always = no
		}
}

	damage = 28
	toughness = 18
	pursuit = 0
	screen = 0

	buy_cost = { gold = sacerdos_recruitment_cost }
	low_maintenance_cost = { gold = sacerdos_low_maint_cost }
	high_maintenance_cost = { gold = sacerdos_high_maint_cost }

	counters = {
		pikemen = 1
	}

	stack = 150
	ai_quality = { value = 300 }
	allowed_in_hired_troops = yes
}


code:
martial_custom_regula_implemented = {
	icon = martial_positive
	men_at_arms_recruitment_cost = -0.20
}

regula_initial_spellbound = {
	icon = health_positive
	health = 2
	fertility = 0.2
}

regula_orgy_health = {
	icon = love_positive
	hostile_scheme_resistance_add = 10
	hostile_scheme_power_add = 10
	health = 1.5
	fertility = 0.5
}

regula_orgy_health_vassal = {
	icon = love_positive
	health = 2.0
	fertility = 0.2
	prowess = 4
}

regula_orgy_lifestyle = {
	icon = prestige_positive
	monthly_prestige_gain_mult = 0.25
	monthly_lifestyle_xp_gain_mult = 0.5
	dread_baseline_add = 20
	levy_size = 0.15
}

regula_orgy_lifestyle_vassal = {
	icon = prestige_positive
	monthly_lifestyle_xp_gain_mult = 0.75
}

regula_orgy_piety = {
	icon = learning_positive
	vassal_tax_mult = 0.15
	monthly_piety = 10
}

regula_orgy_piety_vassal = {
	icon = learning_positive
	tax_mult = 0.2
	army_maintenance_mult = -0.1
}


code:
regula_compeditae_succession_modifier = {
	icon = letter_positive
	domain_limit	= 1
	intimidated_vassal_tax_contribution_mult = 0.5
	intimidated_vassal_levy_contribution_mult = 0.5
	vassal_limit = 10
}


code:
paelex_realm_benefits = {
	icon = paelex_positive
	stacking = yes
	domain_tax_mult = 0.05
	development_growth_factor = 0.05
	monthly_dynasty_prestige = 0.1
	monthly_piety = 0.25
}

regula_sanctifica_serva_penalty = {
	icon = health_negative
	stacking = yes
	health = -2
}

regula_mutare_corpus_small_boost = {
	icon = health_positive
	stacking = yes
	health = 1
}

regula_mutare_corpus_medium_boost = {
	icon = health_positive
	stacking = yes
	health = 2
}

regula_mutare_corpus_large_boost = {
	icon = health_positive
	stacking = yes
	health = 3
}

regula_unlanded_consort_penalty = {
	icon = paelex_negative
	stacking = yes
	levy_reinforcement_rate = -0.10
	same_faith_opinion = -5
	monthly_piety = -0.25
}

# No longer used, but retained for savegame compatibility.
paelex_realm_benefits1 = {
	icon = paelex_positive
	domain_tax_mult = 0.05
	development_growth_factor = 0.05
}
paelex_realm_benefits2 = {
	icon = paelex_positive
	domain_tax_mult = 0.10
	development_growth_factor = 0.10
}
paelex_realm_benefits3 = {
	icon = paelex_positive
	domain_tax_mult = 0.15
	development_growth_factor = 0.15
}
paelex_realm_benefits4 = {
	icon = paelex_positive
	domain_tax_mult = 0.20
	development_growth_factor = 0.20
}
paelex_realm_benefits5 = {
	icon = paelex_positive
	domain_tax_mult = 0.25
	development_growth_factor = 0.25
}
paelex_realm_benefits6 = {
	icon = paelex_positive
	domain_tax_mult = 0.30
	development_growth_factor = 0.30
}
paelex_realm_benefits7 = {
	icon = paelex_positive
	domain_tax_mult = 0.35
	development_growth_factor = 0.35
}
paelex_realm_benefits8 = {
	icon = paelex_positive
	domain_tax_mult = 0.40
	development_growth_factor = 0.40
}
paelex_realm_benefits9 = {
	icon = paelex_positive
	domain_tax_mult = 0.45
	development_growth_factor = 0.45
}
paelex_realm_benefits10 = {
	icon = paelex_positive
	domain_tax_mult = 0.50
	development_growth_factor = 0.50
}


code:
# Sanctifica Serva nicknames
regula_nickname_avatar_diplomacy = {}
regula_nickname_avatar_martial = {}
regula_nickname_avatar_stewardship = {}
regula_nickname_avatar_intrigue = {}
regula_nickname_avatar_learning = {}


code:
regula_initialize_start_response = {
	events = {
		regula_initialize_event.0002
	}
}

regula_initialize_complete_response = {
	events = {
		faith_conversion.0002 #Removes obsolte character modifiers (excommunicated, etc.)
		faith_conversion.0005 # Update marriage opinions
		great_holy_war.0025 # Replace Recipient for ongoing GHW
		great_holy_war.0029 # Beneficiary converted, remove and replace.
		great_holy_war.0059 # Clear Crusader traits on conversion.
		great_holy_war.0084 # Replace fallback ghw recipient
		great_holy_war.0085 # Remove pledged vassals upon conversion of their liege.
		war_event.3100		# Handles invalidation of religious wars
	}
}

regula_undying_response = {

}


code:
# Events converted to random yearly events.
# regula_orgy_petitions = {
# 	first_valid = {

# 	}
# 	fallback = regula_orgy_generic_events
# }

# regula_orgy_generic_events = {
# 	random_events = {
# 		200 = 0
# 		100 = regula_orgy.2001
# 		50 = regula_orgy.2002
# 	}
# }


code:
regula_paelex_event_on_action = {
	random_events = {
		200 = regula_paelex_event.1000
		100 = regula_paelex_event.1001
		100 = regula_paelex_event.1002
	}
}

regula_vassal_paelex_mind_repair = {
	effect = {
		scope:recipient = {
			if = {
				limit = { has_trait = dull }
				remove_trait = dull
			}
			if = {
				limit = { has_trait = depressed_1 }
				remove_trait = depressed_1
			}
			if = {
				limit = { has_trait = depressed_genetic }
				remove_trait = depressed_genetic
			}
			if = {
				limit = { has_trait = lunatic_1 }
				remove_trait = lunatic_1
			}
			if = {
				limit = { has_trait = lunatic_genetic }
				remove_trait = lunatic_genetic
			}
			if = {
				limit = { has_trait = possessed_1 }
				remove_trait = possessed_1
			}
			if = {
				limit = { has_trait = possessed_genetic }
				remove_trait = possessed_genetic
			}
			if = {
				limit = { has_trait = early_great_pox }
				remove_trait = early_great_pox
			}
			if = {
				limit = { has_trait = lovers_pox }
				remove_trait = lovers_pox
			}
			if = {
				limit = { has_trait = drunkard}
				remove_trait = drunkard
			}
			if = {
				limit = { has_trait =  hashishiyah }
				remove_trait = hashishiyah
			}
			if = {
				limit = { has_trait = reclusive }
				remove_trait = reclusive
			}
			if = {
				limit = { has_trait = irritable }
				remove_trait = irritable
			}
			if = {
				limit = { has_trait = flagellant }
				remove_trait = flagellant
			}
			if = {
				limit = { has_trait = profligate }
				remove_trait = profligate
			}
			if = {
				limit = { has_trait = contrite }
				remove_trait = contrite
			}
			if = {
				limit = { has_trait = inappetetic }
				remove_trait = inappetetic
			}
		}
	}
}


code:
regula_stress_loss_sex = {
    first_valid = {
        regula_stress_loss_sex_event.0002 # Mulsa
        regula_stress_loss_sex_event.0001 # Paelex
    }
}


code:
# Setup Regula notification settings

on_game_start = {
	on_actions = {
		regula_set_notifcation_settings
		regula_set_bloodline_tally_goals
	}
}

regula_set_notifcation_settings = {
    effect = {
		# Notification Settings
		set_global_variable = {
			name = fascinare_events_enabled
			value = yes
		}

		set_global_variable = {
			name = ward_enslavement_events_enabled
			value = yes
		}
    }
}

# Setup our bloodline tally goal variables
# This tally is the amount of each objective we have completed
# The bools are to see if we have achieved the goal yet, they start as false/no
regula_set_bloodline_tally_goals = {
	effect = {
		set_global_variable = {
			name = regula_fascinare_tally
			value = 0
		}
		set_global_variable = {
			name = regula_domitans_tally
			value = 0
		}
		set_global_variable = {
			name = regula_contubernalis_tally
			value = 0
		}
		set_global_variable = {
			name = regula_domination_war_tally
			value = 0
		}
		set_global_variable = {
			name = regula_servitude_war_tally
			value = 0
		}
		set_global_variable = {
			name = regula_potestas_queen_tally
			value = 0
		}
		set_global_variable = {
			name = regula_obedience_tally
			value = 0
		}

		set_global_variable = {
			name = regula_potestas_queen_bloodline_active
			value = no
		}
		set_global_variable = {
			name = regula_servitude_war_bloodline_active
			value = no
		}
		set_global_variable = {
			name = regula_domination_war_bloodline_active
			value = no
		}
		set_global_variable = {
			name = regula_contubernalis_bloodline_active
			value = no
		}
		set_global_variable = {
			name = regula_domitans_bloodline_active
			value = no
		}
		set_global_variable = {
			name = regula_fascinare_bloodline_active
			value = no
		}
		set_global_variable = {
			name = regula_obedience_bloodline_active
			value = no
		}
	}
}


code:
on_piety_level_gain = {
	effect = {
		if = {
			limit = {
				has_trait = magister_trait_group
			}
			hidden_effect = { # Hidden to cut down on the toast gore. UPDATE - Ineffective.
				remove_trait = magister_1
				remove_trait = magister_2
				remove_trait = magister_3
				remove_trait = magister_4
				remove_trait = magister_5
			}
			if = {
				limit = {
					piety_level = 1
				}
				add_trait = magister_2
			}
			if = {
				limit = {
					piety_level = 2
				}
				add_trait = magister_3
			}
			if = {
				limit = {
					piety_level = 3
				}
				add_trait = magister_4
			}
			if = {
				limit = {
					piety_level = 4
				}
				add_trait = magister_5
			}
			if = {
				limit = {
					piety_level = 5
				}
				add_trait = magister_6
			}
		}
	}
}

on_piety_level_loss = {
	effect = {
		if = {
			limit = {
				has_trait = magister_trait_group
			}
			remove_trait = magister_2
			remove_trait = magister_3
			remove_trait = magister_4
			remove_trait = magister_5
			remove_trait = magister_6
			hidden_effect = { #Hidden to cut down on the toast gore.
				if = {
					limit = {
						piety_level = 0
					}
					add_trait = magister_1
				}
				if = {
					limit = {
						piety_level = 1
					}
					add_trait = magister_2
				}
				if = {
					limit = {
						piety_level = 2
					}
					add_trait = magister_3
				}
				if = {
					limit = {
						piety_level = 3
					}
					add_trait = magister_4
				}
				if = {
					limit = {
						piety_level = 4
					}
					add_trait = magister_5
				}
				if = {
					limit = {
						piety_level = 5
					}
					add_trait = magister_6
				}
			}
		}
	}
}


code:
on_birth_mother = {
	events = {
		regula_paelex_event.1041 # Domitans pregnancy event chain
	}
}


code:
on_15th_birthday = {
	events = { # Add Mulsa trait to wards.
		delay = { days = 364 } # Has to trigger while they still have a guardian.
		fascinare_outcome.2500
	}
}

on_3rd_birthday = {
	events = {
		regula_childhood_event.0011
		regula_childhood_event.0012
		regula_childhood_event.0013
		regula_bloodline.1000 # Passes on bloodlines that have skipped a generation.
	}
}


code:
on_death = {
	on_actions = {
		on_death_magister ### Deals with paelex, sets up heir.
		on_death_magister_bloodlines
	}
}
on_death_magister = {
	trigger = {
		is_ai = no
		has_trait = magister_trait_group
	}
	effect = {
		every_spouse = {
			if = {
				limit = {
					has_trait = paelex
				}
				remove_trait = paelex
				add_trait = orba
			}
		}
		every_spouse = {
			if = {
				limit = {
					has_trait = domina
				}
				remove_trait = domina
				add_trait = orba
			}
		}
		every_concubine = {
			if = {
				limit = {
					has_trait = paelex
				}
				remove_trait = paelex
				add_trait = orba
			}
		}
		every_concubine = {
			if = {
				limit = {
					has_trait = domina
				}
				remove_trait = domina
				add_trait = orba
			}
		}
		root.primary_heir = {
			trigger_event = {
				id = regula_initialize_event.0010
				days = { 7 28 }
			}
		}
	}
}

on_death_magister_bloodlines = {
	trigger = {
		is_ai = no
		has_trait = magister_trait_group
	}

	# Trigger all bloodline events that are relevent
	events = {
		regula_bloodline.0001
		regula_bloodline.0002
		regula_bloodline.0003
		regula_bloodline.0004
		regula_bloodline.0005
		regula_bloodline.0006
		regula_bloodline.0007
	}
}


code:
quarterly_playable_pulse = {
	events = {
		regula_initialize_event.0009 # Maintains Covert Inheritance Laws
		regula_initialize_event.0010 # Passes on the Magister traits.
		regula_initialize_event.0012 # Removes traits from the unworthy.
		regula_initialize_event.0013 # Keeps the Compeditae Election humming.
	}
}

# Maintenance pulses.
quarterly_playable_pulse = {
	events = {
		regula_paelex_event.0996  # Keeps Domina/Paelex traits up to date.
		regula_paelex_event.0998  # Adds landed spouse bonuses/maluses.
		regula_paelex_event.0999  # Sets inheritance laws.
	}
}

# Events affecting ALL characters (not just landed rulers) need to be on a global pulse, not a playable
yearly_global_pulse = {
		regula_orba_event.0001    # Converts adrift paelices to e.
		regula_paelex_event.0997  # Fixes HOF issues.
}


code:
on_pregnancy_mother = {
        events = {
                regula_holy_site_event.2000 # Sets gender of newborns.
#               regula_holy_site_event.2001 # Cancels the pregnancy if max number of children reached.
                regula_bloodline.0021 # Check for Multitasker trigger.
                regula_bloodline.0022 # Check for Bun in the Oven
                regula_bloodline.0023 # Applies Bun in the Oven bonus.

        }
}


code:
random_yearly_playable_pulse = {
	on_actions = {
		yearly_on_action_events_magister
	}
}

yearly_on_action_events_magister = {
	trigger = {
		is_ai = no
		has_trait = magister_trait_group
	}

	random_events = {
		chance_to_happen = 40

		200 = 0						# To prevent 1 eligible event from constantly firing.
		100 = regula_yearly.1000 	# Vassal offers liege a gift.
		200 = regula_yearly.1100 	# A group of vassals collectively wish to contribute to your war effort against a female ruler.
		50 = regula_yearly.1300		# Vassal offers to start a holy order. Has a high likelihood modifier, based on vassal personality traits.
		100 = regula_yearly.2101 	# Catching Lover and Spouse fighting.
		100 = regula_yearly.2200	# Paelex tries to displace Domina.

		#'Nice' events (positive effects)
		# 100 = yearly.8100 	# The peasantry of a Domain province gives you a gift
		# 100 = yearly.8200 	# Your realm priest offers you part of a large donation
		# 100 = stress_trait_ongoing.1501 # Rake fantasizes about courtier.

		# 100 = clan.1011 #A vassal asks for a perk

		# 100 = yearly_saharan.0031 # Local slave raids intensify (aggressor).
		# 100 = yearly_saharan.0032 # Local slave raids intensify (defender).
	}
}


code:
###########################
# ONGOING EVENTS
###########################

####################################################################
# OUTCOME ON ACTIONS
####################################################################

############################
# Fire Success event
############################

fascinare_success = {
	first_valid = {
		fascinare_outcome.2311 # Automatic
		fascinare_outcome.2308 # Seduce close family member
		fascinare_outcome.2306 # Primary spouse seduction
	}
	fallback = fascinare_generic_success
}

fascinare_generic_success = {
	random_events = {
		100 = fascinare_outcome.2301 # Default
		100 = fascinare_outcome.2302 # Talkative
		100 = fascinare_outcome.2303 # Diligent
		50 = fascinare_outcome.2304 # Insane
		100 = fascinare_outcome.2305 # Local
		100 = fascinare_outcome.2307 # Seduce rival/someone you dislike a lot
		150 = fascinare_outcome.2309 # Zealous compeditae.
		100 = fascinare_outcome.2310 # Spousal seduction: Dance.
#		150 = seduce_outcome.2302 # Sneak into target's court (long distance)
	}
}

############################
# Fire Failure event
############################
fascinare_failure = {
	first_valid = {
		fascinare_outcome.4006 # Automatic Failure
	}
	fallback = fascinare_failure_generic
}

fascinare_failure_generic = {
	random_events = {
		200 = fascinare_outcome.4001 # Standard rejection event, no discovery (kind rejection)
		50 = fascinare_outcome.4005 # Standard rejection with reveal
		# 50 = seduce_outcome.4003 # Hard reject & reveal (Disabled by Graceful Recovery)
	}
}


code:
rapta_maritus_setup = {
	first_valid_on_action = {
		standard_rapta_maritus_method_setup
	}
}

standard_rapta_maritus_method_setup = {
	random_events = {
		100 = rapta_maritus_outcome.1001 # Seize from the roadside
	}
}

rapta_maritus_succeeded = {
	# Picks out the correct success event depending on setup.
	trigger = {
		exists = scope:scheme
	}
	events = {
		rapta_maritus_outcome.2001 #Seized Roadside
	}
}

rapta_maritus_failed = {
	# Picks out the correct failure event depending on setup/save.
	trigger = {
		exists = scope:scheme
	}
	events = {
		rapta_maritus_outcome.4001 #Seized Roadside
	}
}

rapta_maritus_ongoing = {
	# Events that can happen while planning to rapta_maritus someone. (shared with murder)
    ### Only the AI will ever see these, but I see no reason to change them.
	trigger = {
		exists = scope:scheme
	}

	random_events = {
		chance_to_happen = 10
		300 = 0
		#############
		# Generic Intrigue Scheme events
		#############
		#Agents:
		200 = intrigue_scheme_ongoing.1001 	# Pay gold for Scheme Progress
		200 = intrigue_scheme_ongoing.1002 	# Zealous agent promotes your agenda
		200 = intrigue_scheme_ongoing.1004 	# A Gregarious agent is a little too loose-lipped
		200 = intrigue_scheme_ongoing.1006 	# A Lazy agent is a little careless
		30 = intrigue_scheme_ongoing.1007 	# Caring agent wants you to stop
		100 = intrigue_scheme_ongoing.1008 	# Agent close to being discovered
		100 = intrigue_scheme_ongoing.1009 	# Close relation is willing to join your scheme after all
		100 = intrigue_scheme_ongoing.5019 	# Find old architectural papers

		#Target:
		200 = intrigue_scheme_ongoing.2001 	# Trusting target
		200 = intrigue_scheme_ongoing.2002 	# Drunkard target
		50 = intrigue_scheme_ongoing.2003 	# Discover a secret about someone else than your target

		#Child target:
		300 = intrigue_scheme_ongoing.4001 	# Agent is put in charge of a group of children
		300 = intrigue_scheme_ongoing.4002 	# Child is gullible
		200 = intrigue_scheme_ongoing.4003 	# Agent has second thoughts

		#Other
		100 = intrigue_scheme_ongoing.3003 	# Mapping the local surroundings
		100 = intrigue_scheme_ongoing.3005  # Messenger pigeon
		100 = intrigue_scheme_ongoing.5001 	# Distract guards with itching powder
		100 = intrigue_scheme_ongoing.5009 	# "Friend of Animals" gets some help

		#############
		# Lifestyle events
		#############
		200 = intrigue_scheme_lifestyle.1001 	# Opportunity for a general to set up a soldier spy ring
		100 = intrigue_scheme_lifestyle.1002 	# Your soldier spy ring has been compromised!
		200 = intrigue_scheme_lifestyle.3001 	# Study the targets habits
		200 = intrigue_scheme_lifestyle.3101 	# Convert informants in target´s court
		100 = intrigue_scheme_lifestyle.3102 	# Informants are revealed!
		200 = intrigue_scheme_lifestyle.3201 	# Intercept communication
		200 = intrigue_scheme_lifestyle.3301 	# Possible to gain hook - ends the scheme
		200 = intrigue_scheme_lifestyle.3401 	# Convince courtier at target's court to inform on them
	}
}


code:
############################
# Fire Success event
############################

regula_instiga_discordia_success = {
	random_events = {
		100 = regula_instiga_discordia_outcome.1001 # Default success
	}
}

############################
# Fire Failure event
############################

regula_instiga_discordia_failure = {
	random_events = {
		100 = regula_instiga_discordia_outcome.2001 # Default failure
	}
}


code:
revela_secretum_fabricate_effect = {
    random_events = {
        100 = revela_secretum.1001 # Honeypot (Attraction)
        100 = revela_secretum.1002 # Fabricate trips to a brothel. (Stewardship)
        100 = revela_secretum.1003 # Flood with arousal. (Default)
    }
}


code:
regula_contubernalis_close_family_opinion = {
    opinion = -60
	imprisonment_reason = yes
}

regula_contubernalis_close_family_crime_opinion = {
	opinion = -60
	imprisonment_reason = yes
	execute_reason = yes
	banish_reason = yes
}

regula_contubernalis_dynasty_member_opinion = {
	opinion = -20
	years = 25
	decaying = yes
}

regula_contubernalis_close_relation_opinion = {
	opinion = -30
	imprisonment_reason = yes
}


code:
#OPINIONS SET BY THE fascinare Scheme
fascinare_bad_time_opinion = {
	monthly_change = 1.5
	decaying = yes
}

fascinare_loss_of_trust_opinion = {
	opinion = -15
	years = 10
	decaying = yes
}

fascinare_regular_cooldown_opinion = {
	years = 5
	decaying = yes
	opinion = -10
}

fascinare_permanent_blocker_opinion = {
	opinion = -50
}

fascinare_discovered_cooldown_opinion = {
	years = 10
	decaying = yes
	opinion = -25
}

#Opinions set by the "Show book" Proto-fascinare interaction
regula_covert_conversion_interaction_failure_opinion = {
	years = 2
	decaying = yes
	opinion = -5
}


code:
demoted_domina_opinion = {
    opinion = -20
    decaying = yes
    years = 5
}

domina_supported_opinion = {
    opinion = 25
    decaying = yes
    years = 5
}

regula_bdsm_negative = {
    opinion = -20
    decaying = yes
    years = 2
}

regula_bdsm_positive = {
    opinion = 20
    decaying = yes
    years = 4
}

regula_recently_fucked = {
    opinion = 20
    decaying = yes
    years = 2
}


code:
doctrine_regula_core_tenets = {
	group = "core_tenets"
	number_of_picks = 2

	tenet_regula_magister = {
		icon = core_tenet_regula_magister
		name = tenet_regula_magister
		desc = tenet_regula_magister_desc

		piety_cost = {
			value = faith_tenet_cost_mid
		}

		is_shown = {
			religion_tag = regula_religion
		}

		can_pick = {
			OR = {
				custom_description = {
					text = doctrine_concubine_regula_can_pick_trigger
					OR = {
						flag:doctrine_concubine_regula = { is_in_list = selected_doctrines }
					}
				}
			}
		}
		character_modifier = {
			fertility = 0.25
		}

		parameters = {
			magister_tenet_traits = yes
			no_unfaithfulness_penalty_active = yes
		}
	}

	tenet_regula_devoted = {
		icon = core_tenet_regula_devoted
		name = tenet_regula_devoted
		desc = tenet_regula_devoted_desc

		piety_cost = {
			value = faith_tenet_cost_mid
		}

		is_shown = {
			religion_tag = regula_religion
		}

		can_pick = {
			custom_description = {
				text = doctrine_concubine_regula_can_pick_trigger
				OR = {
					flag:doctrine_concubine_regula = { is_in_list = selected_doctrines }
				}
			}
		}

		character_modifier = {
		}
		parameters = {
			paelex_realm_benefits = yes
			paelex_realm_benefits2 = yes
			tenet_adaptive_conversion_resistance = yes
		}
	}
}


code:
doctrine_regula_marriage_type = {
	group = "marriage"

	doctrine_concubine_regula = {
		piety_cost = {
			value = faith_doctrine_cost_mid
			if = {
				limit = { has_doctrine = doctrine_concubine_regula }
				multiply = faith_unchanged_doctrine_cost_mult
			}
		}

		is_shown = {
			religion_tag = regula_religion
		}

		parameters = {
			number_of_spouses = 999
		}

		character_modifier = {
			name = doctrine_concubine_regula_modifier
		 	opinion_of_male_rulers = 20
		}
	}
}


code:
### Regula Magistri Holy Sites
#Flags
# flag = holy_site_regula_virus_flag
# flag = holy_site_reg_offspring_flag
# flag = regula_abice_maritus_active
# flag = holy_site_reg_sanctifica_serva_flag
# flag = holy_site_reg_mulsa_fascinare_flag

#Default/Mediterranean
reg_jerusalem = {
	county = c_jerusalem
	is_active = no

	flag = holy_site_regula_virus_flag

	character_modifier = {
		name = holy_site_reg_jerusalem_effect_name
		vassal_tax_mult = 0.2
	}
}

reg_lesbos = {
	county = c_lesbos
	barony = b_mytilene
	is_active = no

	flag = holy_site_reg_offspring_flag

	character_modifier = {
		name = holy_site_lesbos_effect_name
		prowess = 4
		health = 0.25
	}
}

reg_alexandria = {
	county = c_alexandria
	is_active = no

	flag = regula_abice_maritus_active

	character_modifier = {
		name = holy_site_reg_alexandria_effect_name
		monthly_lifestyle_xp_gain_mult = 0.1
		learning_per_piety_level = 2
	}
}

reg_carthage = {
	county = c_tunis
	is_active = no

	flag = holy_site_reg_sanctifica_serva_flag

	character_modifier = {
		name = holy_site_reg_carthage_effect_name
		monthly_piety_gain_per_knight_mult = 0.02
		levy_size = 0.1
	}
}

reg_brescia = {
	county = c_brescia
	is_active = no

	flag = holy_site_reg_mulsa_fascinare_flag

	character_modifier = {
		name = holy_site_reg_brescia_effect_name
		intrigue_per_piety_level = 2
		development_growth_factor = 0.1
	}
}

# Nordic
reg_rome = {
	county = c_roma
	is_active = no

	flag = holy_site_regula_virus_flag

	character_modifier = {
		name = holy_site_reg_rome_effect_name
		attacker_advantage = 10
		tolerance_advantage_mod = 10
	}
}

reg_toulouse = {
	county = c_toulouse
	barony = b_toulouse
	is_active = no

	flag = holy_site_reg_offspring_flag

	character_modifier = {
		name = holy_site_toulouse_effect_name
		monthly_county_control_change_add = 0.25
		general_opinion = 10
	}
}

reg_krakow = {
	county = c_krakowska
	is_active = no

	flag = regula_abice_maritus_active

	character_modifier = {
		name = holy_site_reg_krakowska_effect_name
		attraction_opinion = 20
	}
}

reg_gotland = { # More captives during siege?
	county = c_gutland
	is_active = no

	flag = holy_site_reg_sanctifica_serva_flag

	character_modifier = {
		name = holy_site_reg_gotland_effect_name
		raid_speed = 0.25
		siege_phase_time = -0.1
	}
}

reg_zeeland = {
	county = c_zeeland
	is_active = no

	flag = holy_site_reg_mulsa_fascinare_flag

	character_modifier = {
		name = holy_site_reg_zeeland_effect_name
		naval_movement_speed_mult = 0.15
		development_growth_factor = 0.05
	}
}

#Alexandrian

reg_baghdad = {
	county = c_baghdad
	is_active = no

	flag = holy_site_regula_virus_flag

	character_modifier = {
	 	name = holy_site_reg_baghdad_effect_name
		 desert_advantage = 10
		 desert_mountains_advantage = 10
		 oasis_advantage = 10
		 movement_speed = 0.20
	}
}

reg_veria = {
	county = c_veria
	is_active = no

	flag = holy_site_reg_offspring_flag

	character_modifier = {
	 	name = holy_site_reg_veria_effect_name
		happy_powerful_vassal_tax_contribution_mult = 0.15
		levy_size = 0.1
	}
}

reg_tyre = {
	county = c_acre
	barony = b_tyre
	is_active = no

	flag = regula_abice_maritus_active

	character_modifier = {
	 	name = holy_site_reg_tyre_effect_name
		enemy_hard_casualty_modifier = 0.15
		fertility = 0.15
	}
}

reg_yazd = {
	county = c_yazd
	is_active = no

	flag = holy_site_reg_sanctifica_serva_flag

	character_modifier = {
		name = holy_site_reg_yazd_effect_name
		enemy_hostile_scheme_success_chance_add = -15
		owned_personal_scheme_success_chance_add = 15
	}
}

reg_lahur = {
	county = c_lahur
	is_active = no

	flag = holy_site_reg_mulsa_fascinare_flag

	character_modifier = {
		name = holy_site_reg_lahur_effect_name
		cultural_head_fascination_mult = 0.2
		development_growth_factor = 0.10
	}
}

#West Africa
reg_djenne = {
	county = c_jenne
	barony = b_jenne-jeno
	is_active = no

	flag = holy_site_regula_virus_flag

	character_modifier = {
	 	name = holy_site_reg_djenne_effect_name
		owned_personal_scheme_success_chance_add = 20
		tax_mult = 0.20
	}
}

reg_wenyon = {
	county = c_wenyon
	is_active = no

	flag = holy_site_reg_offspring_flag

	character_modifier = {
	 	name = holy_site_reg_wenyon_effect_name
		enemy_hard_casualty_modifier = 0.1
		fertility = 0.1
		knight_effectiveness_mult = 0.2
#		men_at_arms_maintenance = -0.2
	}
}

reg_daura = {
	county = c_daura
	is_active = no

	flag = regula_abice_maritus_active

	character_modifier = {
	 	name = holy_site_reg_daura_effect_name
	 	monthly_lifestyle_xp_gain_mult = 0.2
	 	stewardship_per_piety_level = 2
	}
}

reg_jara = {
	county = c_jara
	is_active = no

	flag = holy_site_reg_sanctifica_serva_flag

	character_modifier = {
		name = holy_site_reg_jara_effect_name
		monthly_dynasty_prestige_mult = 0.01
		cultural_head_fascination_mult = 0.25
	}
}

reg_oyo = {
	county = c_oyo
	is_active = no

	flag = holy_site_reg_mulsa_fascinare_flag

	character_modifier = {
		name = holy_site_reg_oyo_effect_name
		development_growth_factor = 0.15
		holding_build_gold_cost = -0.2
	}
}


code:
### Regula Magistri Holy Sites
# These sites are grouped into empires
# Flags
# flag = holy_site_regula_virus_flag
# flag = holy_site_reg_offspring_flag
# flag = regula_abice_maritus_active
# flag = holy_site_reg_sanctifica_serva_flag
# flag = holy_site_reg_mulsa_fascinare_flag

# Three effects each
# +1 stat per piety level
# 2 effects related to the overall "attribute" of that holy site

# Empire Holy Sites
# Great Britain
reg_britain_middlesex = {
	county = c_middlesex
	is_active = no

	flag = holy_site_reg_offspring_flag

	character_modifier = {
		name = holy_site_reg_britain_gowrie_effect_name
		stewardship_per_piety_level = 1
		build_speed = -0.3
		domain_limit = 1
	}

}

reg_britain_gowrie = {
	county = c_gowrie
	is_active = no

	flag = regula_abice_maritus_active

	character_modifier = {
		name = holy_site_reg_britain_glamorgan_effect_name
		martial_per_piety_level = 1
		prowess_per_piety_level = 2
		monthly_county_control_change_add = 0.2
	}
}

reg_britain_glamorgan = {
	county = c_glamorgan
	is_active = no

	flag = holy_site_regula_virus_flag

	character_modifier = {
		name = holy_site_reg_britain_middlesex_effect_name
		intrigue_per_piety_level = 1
		personal_scheme_power_add = 20
		max_personal_schemes_add = 1
	}
}

reg_britain_west_riding = {
	county = c_west_riding
	is_active = no

	flag = holy_site_reg_sanctifica_serva_flag

	character_modifier = {
		name = holy_site_reg_britain_west_riding_effect_name
		learning_per_piety_level = 1
		monthly_lifestyle_xp_gain_mult = 0.2
		development_growth_factor = 0.2
	}
}

reg_britain_dublin = {
	county = c_dublin
	is_active = no

	flag = holy_site_reg_mulsa_fascinare_flag

	character_modifier = {
		name = holy_site_reg_britain_dublin_effect_name
		diplomacy_per_piety_level = 1
		general_opinion = 20
		county_opinion_add = 30
	}
}


code:
rf_regula = {
	graphical_faith = "catholic_gfx"
	hostility_doctrine = eastern_hostility_doctrine
	doctrine_background_icon = core_tenet_banner_christian.dds #UPDATE
}


code:
regula_religion = {
	family = rf_regula
	# alternate_start = { always = no } #UPDATE Should prevent seeding of the religion at start. Not sure if needed.
	doctrine_background_icon = core_tenet_banner_eastern.dds
	doctrine = pagan_hostility_doctrine # Could be regula_hostility_doctrine, but that would require overwriting the hostility doctrine file, impact compatibility.

	#Main Group
	doctrine = doctrine_temporal_head
	doctrine = doctrine_gender_female_dominated
	doctrine = doctrine_pluralism_fundamentalist
	doctrine = doctrine_theocracy_lay_clergy

	#Marriage
	doctrine = doctrine_concubine_regula
	doctrine = doctrine_polygamy
	doctrine = doctrine_divorce_allowed
	doctrine = doctrine_bastardry_none
	doctrine = doctrine_consanguinity_unrestricted

	#Crimes
	doctrine = doctrine_homosexuality_accepted
	doctrine = doctrine_adultery_men_accepted
	doctrine = doctrine_adultery_women_accepted
	doctrine = doctrine_kinslaying_shunned
	doctrine = doctrine_deviancy_accepted
	doctrine = doctrine_witchcraft_accepted

	#Clerical Functions
	doctrine = doctrine_clerical_function_recruitment
	doctrine = doctrine_clerical_gender_female_only
	doctrine = doctrine_clerical_marriage_allowed
	doctrine = doctrine_clerical_succession_temporal_appointment

	#Carnalitas
	doctrine = carn_doctrine_prostitution_accepted
	doctrine = carn_doctrine_other_slavery_accepted
	doctrine = carn_doctrine_same_slavery_accepted

	traits = {
		virtues = { lustful zealous diligent zealous humble fecund }
		sins = { chaste cynical vengeful sadistic celibate lovers_pox }
	}

	reserved_male_names = {
		Alaric Alexander Andronikos Brutus Caligula Changsheng Crassus Cylon
		Elagabalus Empedocles Ephialtes Godfrey Herod Minos
		Mithridates Mordred Nero Phintias Tereus Theron
	}

	reserved_female_names = {
		Aelia Agrippina Antonina Aspasia Bathsheba Boudicca Cynane Delilah
		Didda Drusilla Enheduanna Fausta Fulvia Godiva Helen Hypatia Irene Jezebel Joan
		Karina Lilith Locusta Medea Messalina Nefertiti Nell Olympias Pandora
		Pasiphae Phryne Rahab Salome Sappho Thais Theodora Tomyris Valeria
		Zenobia Zetian
	}

	custom_faith_icons = {
		custom_faith_1 custom_faith_2 custom_faith_3 custom_faith_4 custom_faith_5 custom_faith_6 custom_faith_7 custom_faith_8 custom_faith_9 custom_faith_10 dualism_custom_1 zoroastrian_custom_1 zoroastrian_custom_2 buddhism_custom_1 buddhism_custom_2 buddhism_custom_3 buddhism_custom_4 taoism_custom_1 yazidi_custom_1 sunni_custom_2 sunni_custom_3 sunni_custom_4 ibadi_custom muhakkima_1 muhakkima_2 muhakkima_4 muhakkima_5 muhakkima_6 judaism_custom_1
	}

	holy_order_names = {
		{ name = "holy_order_order_of_the_subservient" }
		{ name = "holy_order_slaves_to_lust" }
		{ name = "holy_order_sisterhood_of_chains" }
		{ name = "holy_order_order_of_the_shackle" }
		{ name = "holy_order_knights_of_masters_will" }
		{ name = "holy_order_sisters_of_perversion" }
		{ name = "holy_order_defilers_of_the_holy_virgin" }
		{ name = "holy_order_daughters_of_the_desecrated" }
		{ name = "holy_order_harbingers_of_corruption" }
	}
	holy_order_maa = { sacerdos }

	localization = {
		HighGodName = regula_high_god_name
		HighGodName2 = regula_high_god_name
		HighGodNamePossessive = regula_high_god_name_possessive
		HighGodNameSheHe = CHARACTER_SHEHE_HE
		HighGodHerselfHimself = CHARACTER_HIMSELF
		HighGodHerHis = CHARACTER_HERHIS_HIS
		HighGodNameAlternate = regula_high_god_name_alternate
		HighGodNameAlternatePossessive = regula_high_god_name_alternate_possessive

		#Creator
		CreatorName = regula_creator_god_name
		CreatorNamePossessive = regula_creator_god_name_possessive
		CreatorSheHe = CHARACTER_SHEHE_HE
		CreatorHerHis = CHARACTER_HERHIS_HIS
		CreatorHerHim = CHARACTER_HERHIM_HIM

		#HealthGod
		HealthGodName = regula_health_god_name
		HealthGodNamePossessive = regula_health_god_name_possessive
		HealthGodSheHe = CHARACTER_SHEHE_SHE
		HealthGodHerHis = CHARACTER_HERHIS_HER
		HealthGodHerHim = CHARACTER_HERHIM_HER

		#FertilityGod
		FertilityGodName = regula_fertility_god_name
		FertilityGodNamePossessive = regula_fertility_god_name_possessive
		FertilityGodSheHe = CHARACTER_SHEHE_SHE
		FertilityGodHerHis = CHARACTER_HERHIS_HER
		FertilityGodHerHim = CHARACTER_HERHIM_HER

		#WealthGod
		WealthGodName = regula_wealth_god_name
		WealthGodNamePossessive = regula_wealth_god_name_possessive
		WealthGodSheHe = CHARACTER_SHEHE_SHE
		WealthGodHerHis = CHARACTER_HERHIS_HER
		WealthGodHerHim = CHARACTER_HERHIM_HER

		#HouseholdGod
		HouseholdGodName = regula_household_god_name
		HouseholdGodNamePossessive = regula_household_god_name_possessive
		HouseholdGodSheHe = CHARACTER_SHEHE_SHE
		HouseholdGodHerHis = CHARACTER_HERHIS_HER
		HouseholdGodHerHim = CHARACTER_HERHIM_HER

		#FateGod
		FateGodName = regula_fate_god_name
		FateGodNamePossessive = regula_fate_god_name_possessive
		FateGodSheHe = CHARACTER_SHEHE_SHE
		FateGodHerHis = CHARACTER_HERHIS_HER
		FateGodHerHim = CHARACTER_HERHIM_HER

		#KnowledgeGod
		KnowledgeGodName = regula_knowledge_god_name
		KnowledgeGodNamePossessive = regula_knowledge_god_name_possessive
		KnowledgeGodSheHe = CHARACTER_SHEHE_SHE
		KnowledgeGodHerHis = CHARACTER_HERHIS_HER
		KnowledgeGodHerHim = CHARACTER_HERHIM_HER

		#WarGod
		WarGodName = regula_war_god_name
		WarGodNamePossessive = regula_war_god_name_possessive
		WarGodSheHe = CHARACTER_SHEHE_SHE
		WarGodHerHis = CHARACTER_HERHIS_HER
		WarGodHerHim = CHARACTER_HERHIM_HER

		#TricksterGod
		TricksterGodName = regula_trickster_god_name
		TricksterGodNamePossessive = regula_trickster_god_name_possessive
		TricksterGodSheHe = CHARACTER_SHEHE_SHE
		TricksterGodHerHis = CHARACTER_HERHIS_HER
		TricksterGodHerHim = CHARACTER_HERHIM_HER

		#NightGod
		NightGodName = regula_night_god_name
		NightGodNamePossessive = regula_night_god_name_possessive
		NightGodSheHe = CHARACTER_SHEHE_SHE
		NightGodHerHis = CHARACTER_HERHIS_HER
		NightGodHerHim = CHARACTER_HERHIM_HER

		#WaterGod
		WaterGodName = regula_water_god_name
		WaterGodNamePossessive = regula_water_god_name_possessive
		WaterGodSheHe = CHARACTER_SHEHE_SHE
		WaterGodHerHis = CHARACTER_HERHIS_HER
		WaterGodHerHim = CHARACTER_HERHIM_HER

		PantheonTerm = regula_high_god_name ### UPDATE - Refer to the Keeper of Souls' Harem?
		PantheonTerm2 = regula_high_god_name
		PantheonTerm3 = regula_high_god_name
		PantheonTermHasHave = pantheon_term_has
		GoodGodNames = {
			regula_high_god_name
			regula_high_god_name_alternate
			chistianity_good_god_jesus
			chistianity_good_god_christ
		}
		DevilName = christianity_devil_name
		DevilNamePossessive = christianity_devil_name_possessive
		DevilSheHe = CHARACTER_SHEHE_SHE
		DevilHerHis = CHARACTER_HERHIS_HER
		DevilHerHis = CHARACTER_HERHIS_HER
		DevilHerselfHimself = CHARACTER_HERSELF
		EvilGodNames = {
			christianity_devil_name
			christianity_evil_god_lucifer
			christianity_evil_god_beelzebub
			christianity_evil_god_mephistopheles
		}
		HouseOfWorship = christianity_house_of_worship
		HouseOfWorship2 = christianity_house_of_worship
		HouseOfWorship3 = christianity_house_of_worship
		HouseOfWorshipPlural = christianity_house_of_worship_plural
		ReligiousSymbol = regula_religious_symbol
		ReligiousSymbol2 = regula_religious_symbol
		ReligiousSymbol3 = regula_religious_symbol
		ReligiousText = regula_religious_text
		ReligiousText2 = regula_religious_text
		ReligiousText3 = regula_religious_text
		ReligiousHeadName = regula_religious_head_title
		ReligiousHeadTitleName = regula_religious_head_title_name
		DevoteeMale = regula_devotee_male
		DevoteeMalePlural = regula_devotee_male_plural
		DevoteeFemale = regula_devotee_female
		DevoteeFemalePlural = regula_devotee_female_plural
		DevoteeNeuter = regula_devotee_neuter
		DevoteeNeuterPlural = regula_devotee_neuter_plural
		PriestMale = regula_priest_male
		PriestMalePlural = regula_priest_male_plural
		PriestFemale = regula_priest_male
		PriestFemalePlural = regula_priest_male_plural
		PriestNeuter = regula_priest_male
		PriestNeuterPlural = regula_priest_male_plural
		AltPriestTermPlural = regula_priest_alternate_plural
		BishopMale = regula_bishop
		BishopMalePlural = regula_bishop_plural
		BishopFemale = regula_bishop
		BishopFemalePlural = regula_bishop_plural
		BishopNeuter = regula_bishop
		BishopNeuterPlural = regula_bishop_plural
		DivineRealm = christianity_positive_afterlife
		DivineRealm2 = christianity_positive_afterlife
		DivineRealm3 = christianity_positive_afterlife
		PositiveAfterLife = christianity_positive_afterlife
		PositiveAfterLife2 = christianity_positive_afterlife
		PositiveAfterLife3 = christianity_positive_afterlife
		NegativeAfterLife = christianity_negative_afterlife
		NegativeAfterLife2 = christianity_negative_afterlife
		NegativeAfterLife3 = christianity_negative_afterlife
		DeathDeityName = christianity_death_deity_name
		DeathDeityNamePossessive = christianity_death_deity_name_possessive
		DeathDeitySheHe = CHARACTER_SHEHE_SHE
		DeathDeityHerHis = CHARACTER_HERHIS_HER
		WitchGodName = christianity_witchgodname_the_horned_god
		WitchGodNamePossessive = christianity_witchgodname_the_horned_god_possessive
		WitchGodHerHis = CHARACTER_HERHIS_HIS
		WitchGodSheHe = CHARACTER_SHEHE_HE
		WitchGodHerHim = CHARACTER_HERHIM_HIM
		WitchGodMistressMaster = master
		WitchGodMotherFather = father

		GHWName = ghw_crusade
		GHWNamePlural = ghw_crusades
	}

	piety_icon_group = "pagan"
	graphical_faith = "pagan_gfx"

	faiths = {
		regula_default = {
			color = { 0.5 0.0 0.5 }
			# icon = "gfx/interface/icons/religion/regula_faith.dds"

			# Continent Holy Sites
			holy_site = reg_jerusalem
			holy_site = reg_brescia
			holy_site = reg_alexandria
			holy_site = reg_carthage
			holy_site = reg_lesbos
			holy_site = reg_rome
			holy_site = reg_toulouse
			holy_site = reg_krakow
			holy_site = reg_gotland
			holy_site = reg_zeeland
			holy_site = reg_baghdad
			holy_site = reg_tyre
			holy_site = reg_veria
			holy_site = reg_yazd
			holy_site = reg_lahur
			holy_site = reg_djenne
			holy_site = reg_wenyon
			holy_site = reg_daura
			holy_site = reg_jara
			holy_site = reg_oyo

			# Empire Holy Sites
			# Britian
			holy_site = reg_britain_dublin
			holy_site = reg_britain_glamorgan
			holy_site = reg_britain_gowrie
			holy_site = reg_britain_middlesex
			holy_site = reg_britain_west_riding

			doctrine = tenet_sacred_childbirth
			doctrine = tenet_regula_magister
			doctrine = tenet_regula_devoted
		}
		# regula_mediterranean = {
		# 	color = { 0.6 0.0 0.0 }
		# 	graphical_faith = "orthodox_gfx"
		# 	icon = "gfx/interface/icons/religion/regula_faith.dds"

		# 	holy_site = reg_jerusalem
		# 	holy_site = reg_brescia
		# 	holy_site = reg_alexandria
		# 	holy_site = reg_carthage
		# 	holy_site = reg_lesbos

		# 	#Tenets
		# 	doctrine = tenet_regula_magister
		# 	doctrine = tenet_regula_devoted
		# 	doctrine = tenet_sacred_shadows
		# }

		# regula_european = {
		# 	color = { 0.6 0.0 0.0 }
		# 	graphical_faith = "catholic_gfx"
		# 	icon = "gfx/interface/icons/religion/regula_faith.dds"

		# 	holy_site = reg_rome
		# 	holy_site = reg_toulouse
		# 	holy_site = reg_krakow
		# 	holy_site = reg_gotland
		# 	holy_site = reg_zeeland

		# 	#Tenets
		# 	doctrine = tenet_regula_magister
		# 	doctrine = tenet_regula_devoted
		# 	doctrine = tenet_warmonger
		# }
	}
}