code:
# IDEAS/TODO

List any ideas here, for others to do or just to remind yourself!

Current Ideas:

- Read Regula Magistri
    - Instead of having the Regula settings menu decision, have a more lore-friendly "Read Regula book" decision
    - Should have sections for:
        1. Regula powers    - Details for each power/interaction you have, what they do and what piety level you need
        2. Objectives       - Tells you your current objective, eg freeing the keeper of souls, achieving bloodline goals (to earn dynasty traits) etc
        3. Regula Settings          - Has subpages for:
            - Holy Site locations   - Change the locations of your Holy sites
            - Ward settings         - Change how your children are given guardians
            - Notification Settings - Change your notification settings for Fascinare/Ward charming etc
    - Should help players understand what powers they have or dont have, what they can do with them and how to get them

- The Ultimate Ritual
    - Have a final, climatic ritual that requires a Goddess of each type (Diplomacy, Martial, Stewardship, Intrigue and Learning)
    - Makes you immortal? Gives big Dyansty bloodline bonus? Allows you to write code that runs first time? Who knows?
    - Should make other nations hate your guts and force crusades/holy wars/something
    - Should act as a nice late game challenge

- Magistri Culture
    - Custom Innovations?
    - More MAA regiment types?

- Remove Vassal non-Dynasty heirs/children:
    - Given a Female Vassal Mulsa/Paleax/Domina with kids not of your Dynasty, get rid of them with piety cost of 100 per child, then you get a choice:
        - Make males into monks and females into holy warriors (Need holy order first?)
        - Force them into wanderers
        - Give them random baronies but remove their claims (disinherit?)
        - Kill them (need certain trait? eg sadistic/wrathful/callous)
Maybe add Skill checks/more costs, or maybe just keep it simple with piety cost

- Force change culture interaction
    - Change the culture of a vassal and their domain (including vassals underneath them etc)
    - Cost depending on realm size and court size

- Famuli Warriors - Enslavement
    - Adds an event that can trigger when finishing siege/raid on a settlement
    - Capture female courtiers or generate new ones?

- Random Events: Events that are Magistri themed, should enable after becoming the Magister
    - By the River
        - You encounter two young women near the riverside, hijinks ensue
    - Daughterswap
        - A Male Vassal in your land / Male Ruler abroad with a young daughter (18-25) proposes to swap his daughter with one of yours
            - Can allow it, force him to hand over his daughter, or just decline
            - Would allow you to get land into your domain as the "swap" would be matrilineal for the vassal but patrilineal for you
    - Examine Famuli Regiment
        - Examine one of your new Famuli Regiments on parade, random things can happen
            - Duel their officer to establish dominance
            - Start an orgy with the women
    - Foreign Vassal/Council Member meeting
        - A "Bonus" chance to Fascinare either the spouse of a foreign Vassal/Ruler or council member
        - Should Segway into either a Fascinare Scheme with bonus progress or the Fascinare event itself (assuming you pass a check of some kind)


code:
activity_regula_orgy = {
	expiration_days = 50
	days_until_auto_start = 60
	color = { 0.853906 0.867188 0.105469 1 }
#	activity_show_accepted = yes  ### Obsolete?

	valid = {
		OR = {
			activity_owner = { #If the host dies or is imprisoned before the orgy, invalidate
				is_alive = yes
				is_imprisoned = no
				has_trait = magister_trait_group
			}
			activity_has_been_activated = yes #If the orgy has started, it will not be interrupted
		}
	}

	on_spawn = {
		invite_character_to_activity = activity_owner
		accept_invitation_for_character = activity_owner

		activity_owner = {
			save_scope_as = host
			#Start by setting the "host spouse" (the domina)  ### Not used
			# if = {
			# 	limit = {
			# 		any_spouse = {
			# 			is_available_adult = yes
			# 			has_trait = domina
			# 		}
			# 	}
			# 	save_temporary_scope_as = tmp_host
			# 	random_spouse = {
			# 		limit = {
			# 			this = scope:tmp_host.primary_spouse
			# 			is_landed = no
			# 			is_available_adult = yes
			# 		}
			# 		alternative_limit = {
			# 			is_landed = no
			# 			is_available_adult = yes
			# 		}
			# 		save_scope_as = spouse
			# 	}
			# }
			every_consort = {
				limit = {
					is_available_for_activity_trigger = yes
					is_adult = yes
					age >= 18
				}
				add_to_temporary_list = concubine_guests
			}

			# Mulsa traits in realm, spouse, family, relations
			every_vassal = {
				limit = {
					has_trait = mulsa
					is_available_for_activity_trigger = yes
					is_concubine = no
					age >= 18
				}
				add_to_temporary_list = potential_guests
			}
			every_close_or_extended_family_member = {
				limit = {
					has_trait = mulsa
					is_available_for_activity_trigger = yes
					is_concubine = no
					age >= 18
				}
				add_to_temporary_list = potential_guests
			}
			every_spouse = {
				limit = {
					is_available_for_activity_trigger = yes
					age >= 18
					OR = {
						has_trait = paelex
						has_trait = domina
					}
				}
				add_to_temporary_list = concubine_guests
			}
			every_concubine = {
				limit = {
					NOT = { has_trait = devoted_trait_group }
					age >= 18
				}
				add_to_temporary_list = potential_guests
			}
			every_relation = {
				type = lover
				limit = {
					is_available_for_activity_trigger = yes
					has_trait = mulsa
					is_concubine = no
					age >= 18
				}
				add_to_temporary_list = potential_guests
			}
			every_relation = {
				type = friend
				limit = {
					is_available_for_activity_trigger = yes
					has_trait = mulsa
					is_concubine = no
					age >= 18
				}
				add_to_temporary_list = potential_guests
			}

			every_in_list = {
				list = concubine_guests
				scope:activity = {
					invite_character_to_activity = prev
				}
				trigger_event = {
					id = regula_orgy.1000
				}
			}
			every_in_list = {
				list = potential_guests
				scope:activity = {
					invite_character_to_activity = prev
				}
				trigger_event = {
					id = regula_orgy.1001
				}
			}
		}
	}

	on_activate = {
		# Check that there are guests apart from the orgy host.
		if = {
			limit = {
				NOT = {
					any_participant = {
						NOT = {	this = scope:activity.activity_owner }
					}
				}
			}
			# If there are no other guests, throw this event.
			activity_owner = {
				trigger_event =  regula_orgy.1002
			}
		}
		# If there are guests present
		else = {

			activity_owner = {
				play_music_cue = "mx_cue_touching_moment"

				#New guest?
				random = {
					chance = 50
					trigger_event = {
						id = regula_orgy.1003
						days = 1
					}
				}

				#Start the orgy.
				##After the orgy startsthe magister has a choice of partner.
				trigger_event = {
					id = regula_orgy.1010
					days = 7
				}

				#End event
				trigger_event = {
					id = regula_orgy.1098
					days = 14
				}

			}
		}
	}

	on_complete = {

	}

	on_expire = {

	}

	on_invalidated = {

	}
}

license: mit


code:
regula_claim_vassal_war = {
	group = de_jure

	allowed_for_character = {
		scope:attacker = {
			has_trait = magister_trait_group
		}
	}

	# Root is the title
	# scope:attacker is the attacker
	# scope:defender is the defender

	allowed_for_character_display_regardless = {
		custom_description = {
			text = magister_trait_4_required_trigger
			has_trait_rank = {
				trait = magister_trait_group
				rank >= 4
			}
		}
	}

	allowed_against_character = {
		scope:defender = {
			is_independent_ruler = yes
			any_vassal_or_below = {
				has_trait = devoted_trait_group
			}
			trigger_if = {
				limit = { scope:attacker = { is_ai = no } } # Already pre-filtered by the AI due to ai_only_against_neighbors = yes. any_neighboring_top_liege_realm_owner is expensive
			}
			NOR = { # Can't vassalize holy orders or Heads of Faith
				any_held_title = {
					is_holy_order = yes
				}
			}
		}
		scope:attacker.primary_title.tier >= scope:defender.primary_title.tier # Must be lower tier or equal (so the vassals are lower)
	}

	cost = {
		piety = {
			value = 250
		}

		prestige = {
			value = 0
			desc = REGULA_CLAIM_VASSAL_COST
			scope:defender = {
				every_vassal_or_below = {
					limit = {
						has_trait = devoted_trait_group
						highest_held_title_tier = tier_kingdom
					}
					add = 500
				}
				every_vassal_or_below = {
					limit = {
						has_trait = devoted_trait_group
						highest_held_title_tier = tier_duchy
					}
					add = 250
				}
				every_vassal_or_below = {
					limit = {
						has_trait = devoted_trait_group
						highest_held_title_tier = tier_county
					}
					add = 125
				}
			}

			# Vassal contract in-realm cost reduction
			if = {
				limit = {
					scope:attacker = {
						is_independent_ruler = no
						vassal_contract_has_flag = vassal_contract_war_override
						liege = scope:defender.liege
					}
				}
				multiply = {
					value = war_declaration_rights_allowed_cost_reduction
					desc = "CB_ATTACKER_VASSAL_CONTRACT"
				}
			}

			if = {
				limit = {
					has_game_rule = no_cost_casus_belli_costs
				}
				multiply = {
					value = 0
					desc = CB_GAME_RULE_NO_COST
				}
			}
		}
	}

	should_invalidate = {
		OR = {
			scope:defender = {
				OR = {
					is_independent_ruler = no
					NOT = {
						any_vassal_or_below = {
							has_trait = devoted_trait_group
						}
					}
				}
			}
			scope:defender.primary_title.tier > scope:attacker.primary_title.tier
		}
	}

	on_declaration = {
		on_declared_war = yes
	}

	on_invalidated_desc = msg_regula_claim_vassal_war_invalidated_message

	on_invalidated = {
	}

	on_victory_desc = {
		first_valid = {
			triggered_desc = {
				trigger = { scope:attacker = { is_local_player = yes } }
				desc = regula_claim_vassal_war_victory_desc_attacker
			}
			triggered_desc = {
				trigger = { scope:defender = { is_local_player = yes } }
				desc = regula_claim_vassal_war_victory_desc_defender
			}
			desc = regula_claim_vassal_war_victory_desc
		}
	}

	on_victory = {
		scope:attacker = { show_pow_release_message_effect = yes }
		create_title_and_vassal_change = {
			type = swear_fealty
			save_scope_as = change
			add_claim_on_loss = no
		}
		scope:defender = {
			every_vassal_or_below = {
				limit ={
					has_trait = devoted_trait_group
				}
				change_liege = {
					liege = scope:attacker
					change = scope:change
				}
			}
			resolve_title_and_vassal_change = scope:change
		}

		# Iterate the Domination War Tally
		change_global_variable = {
			name = regula_domination_war_tally
			add = 1
		}

		# Prestige level progress for the attacker
		scope:attacker = {
			add_prestige_experience = {
				value = medium_prestige_value
			}
		}

		# Prestige loss for the defender
		scope:defender = {
			add_prestige = {
				value = medium_prestige_value
				multiply = -1.0
			}
		}

		# Prestige for the attacker's war allies
		add_from_contribution_attackers = {
			prestige = {
				value = major_prestige_value
			}
			opinion = {
				modifier = contributed_in_war
			}
		}

		# Prestige for the defender's war allies
		add_from_contribution_defenders = {
			prestige = {
				value = major_prestige_value
			}
			opinion = {
				modifier = contributed_in_war
			}
		}

		# Truce
		add_truce_attacker_victory_effect = yes

	}

	on_white_peace_desc = {
		first_valid = {
			triggered_desc = {
				trigger = { scope:defender = { is_local_player = yes } }
				desc = regula_claim_vassal_war_white_peace_desc_defender
			}
			desc = regula_claim_vassal_war_white_peace_desc
		}
	}

	on_white_peace = {
		scope:attacker = { show_pow_release_message_effect = yes }
		# Prestige loss for the attacker
		scope:attacker = {
			add_prestige = {
				value = minor_prestige_value
				multiply = -1.0
			}
		}

		# Prestige for the attacker's war allies
		add_from_contribution_attackers = {
			prestige = minor_prestige_value
			opinion = {
				modifier = contributed_in_war
			}
		}

		# Prestige for the defender's war allies
		add_from_contribution_defenders = {
			prestige = minor_prestige_value
			opinion = {
				modifier = contributed_in_war
			}
		}

		# Truce
		add_truce_white_peace_effect = yes
	}

	on_defeat_desc = {
		first_valid = {
			triggered_desc = {
				trigger = { scope:defender = { is_local_player = yes } }
				desc = regula_claim_vassal_war_white_peace_desc_defender
			}
			triggered_desc = {
				trigger = {
					scope:attacker = {
						is_local_player = yes
						has_targeting_faction = yes
					}
				}
				desc = regula_claim_vassal_war_defeat_desc_attacker
			}
			desc = regula_claim_vassal_war_white_peace_desc
		}
	}

	on_defeat = {
		scope:attacker = { show_pow_release_message_effect = yes }

		# Prestige loss for the attacker
		scope:attacker = {
			pay_short_term_gold = {
				gold = 3
				target = scope:defender
				yearly_income = yes
			}
			add_prestige = {
				value = major_prestige_value
				multiply = -1.0
			}
		}

		# Prestige for the defender
		scope:defender = {
			add_prestige = {
				value = medium_prestige_value
			}
		}

		# Prestige for the attacker's war allies
		add_from_contribution_attackers = {
			prestige = major_prestige_value
			opinion = {
				modifier = contributed_in_war
			}
		}

		# Prestige for the defender's war allies
		add_from_contribution_defenders = {
			prestige = major_prestige_value
			opinion = {
				modifier = contributed_in_war
			}
		}

		scope:attacker = {
			save_temporary_scope_as = loser
		}

		# Truce
		add_truce_attacker_defeat_effect = yes

		on_lost_aggression_war_discontent_loss = yes
	}

	on_primary_attacker_death = inherit
	on_primary_defender_death = inherit

	attacker_allies_inherit = yes
	defender_allies_inherit = yes

	war_name = "REGULA_CLAIM_VASSAL_WAR_NAME"
	war_name_base = "REGULA_CLAIM_VASSAL_WAR_NAME_BASE"
	cb_name = "REGULA_CLAIM_VASSAL_CB_NAME"
	interface_priority = 59

	ticking_war_score_targets_entire_realm = yes
	max_defender_score_from_occupation = 150
	max_attacker_score_from_occupation = 150
	attacker_ticking_warscore = 0
	attacker_wargoal_percentage = 0.8

	max_ai_diplo_distance_to_title = 500

}

regula_dominate_female_ruler_war = {
	group = de_jure
	ai_only_against_neighbors = yes

	allowed_for_character = {
		has_trait = magister_trait_group
	}

	# Root is the title
	# scope:attacker is the attacker
	# scope:defender is the defender

	allowed_for_character_display_regardless = {
		custom_description = {
			text = magister_trait_3_required_trigger
			has_trait_rank = {
				trait = magister_trait_group
				rank >= 3
			}
		}
	}

	allowed_against_character = {
		scope:defender = {
			OR = {
				is_independent_ruler = yes
				scope:defender.liege = scope:attacker.liege
			}
			is_adult = yes
			is_female = yes
			trigger_if = {
				limit = { scope:attacker = { is_ai = no } } # Already pre-filtered by the AI due to ai_only_against_neighbors = yes. any_neighboring_top_liege_realm_owner is expensive
				scope:attacker = {
					any_neighboring_top_liege_realm_owner = {
						this = scope:defender
					}
				}
			}
			NOR = { # Can't vassalize holy orders or Heads of Faith
				any_held_title = {
					is_holy_order = yes
				}
				AND = {
					exists = faith.religious_head
					faith.religious_head = root
				}
			}
		}

		scope:attacker.primary_title.tier > scope:defender.primary_title.tier # Must be lower tier

	}

	cost = {
		piety = {
			value = 250
			if = {
				limit = {
					scope:defender.primary_title = {
						tier = tier_kingdom
					}
				}
				multiply = {
					value = 2
					desc = CB_VASSALIZING_KING
				}
			}
			if = {
				limit = {
					scope:attacker.faith = scope:defender.faith
					scope:defender = {
						has_government = theocracy_government
					}
				}
				add = {
					value = medium_piety_value
					desc = CB_ATTACKER_THEOCRACY
				}
			}
			if = {
				limit = {
					has_game_rule = no_cost_casus_belli_costs
				}
				multiply = {
					value = 0
					desc = CB_GAME_RULE_NO_COST
				}
			}
		}
		prestige = {
			value = 0
			add = {
				desc = CB_SIZE_OF_TARGET_REALM_COST
				value = regula_domination_war_cost
			}

			#Innovation Prestige Discounts
			if = {
				limit = {
					scope:attacker = {
						culture = {
							has_innovation = innovation_chronicle_writing
							has_innovation = innovation_land_grants
							has_innovation = innovation_rightful_ownership
						}
					}
				}
				multiply = {
					value = 0.7
					desc = CB_ATTACKER_INNOVATIONS
				}
			}
			else_if = {
				limit = {
					scope:attacker = {
						culture = {
							OR = {
								has_innovation = innovation_chronicle_writing
								has_innovation = innovation_land_grants
							}
							OR = {
								has_innovation = innovation_land_grants
								has_innovation = innovation_rightful_ownership
							}
							OR = {
								has_innovation = innovation_chronicle_writing
								has_innovation = innovation_rightful_ownership
							}
						}
					}
				}
				multiply = {
					value = 0.8
					desc = CB_ATTACKER_INNOVATIONS
				}
			}
			else_if = {
				limit = {
					scope:attacker = {
						culture = {
							OR = {
								has_innovation = innovation_chronicle_writing
								has_innovation = innovation_land_grants
								has_innovation = innovation_rightful_ownership
							}
						}
					}
				}
				multiply = {
					value = 0.9
					desc = CB_ATTACKER_INNOVATIONS
				}
			}

			# Bellum Justum Perk
			if = {
				limit = {
					scope:attacker = {
						has_perk = bellum_justum_perk
					}
				}
				multiply = {
					add = bellum_justum_discount_percentage
					divide = 100
					desc = CB_ATTACKER_BELLUM_JUSTUM
				}
			}

			# Dynasty Warfare Perk
			if = {
				limit = {
					scope:attacker = {
						has_dynasty = yes
						dynasty = {
							has_dynasty_perk = warfare_legacy_2
						}
					}
				}
				multiply = {
					value = warfare_legacy_2_discount
					desc = CB_ATTACKER_DYNASTY_WARFARE
				}
			}

			# Vassal contract in-realm cost reduction
			if = {
				limit = {
					scope:attacker = {
						is_independent_ruler = no
						vassal_contract_has_flag = vassal_contract_war_override
						liege = scope:defender.liege
					}
				}
				multiply = {
					value = war_declaration_rights_allowed_cost_reduction
					desc = "CB_ATTACKER_VASSAL_CONTRACT"
				}
			}

			if = {
				limit = {
					has_game_rule = no_cost_casus_belli_costs
				}
				multiply = {
					value = 0
					desc = CB_GAME_RULE_NO_COST
				}
			}
		}
	}

	should_invalidate = {
		OR = {
			scope:defender = {
				NOR = {
					is_independent_ruler = yes
					scope:defender.liege = scope:attacker.liege
				}
			}
			scope:defender.primary_title.tier >= scope:attacker.primary_title.tier
		}
	}

	on_declaration = {
		on_declared_war = yes
	}

	on_invalidated_desc = msg_regula_dominate_female_ruler_war_invalidated_message

	on_invalidated = {}

	on_victory_desc = {
		first_valid = {
			triggered_desc = {
				trigger = { scope:attacker = { is_local_player = yes } }
				desc = regula_dominate_female_ruler_war_victory_desc_attacker
			}
			triggered_desc = {
				trigger = { scope:defender = { is_local_player = yes } }
				desc = regula_dominate_female_ruler_war_victory_desc_defender
			}
			desc = regula_dominate_female_ruler_war_victory_desc
		}
	}

	on_victory = {
		scope:attacker = { show_pow_release_message_effect = yes }
		create_title_and_vassal_change = {
			type = swear_fealty
			save_scope_as = change
			add_claim_on_loss = no
		}
		scope:defender = {
			change_liege = {
				liege = scope:attacker
				change = scope:change
			}
			resolve_title_and_vassal_change = scope:change
		}

		# Prestige level progress for the attacker
		scope:attacker = {
			add_prestige_experience = {
				value = medium_prestige_value
			}
		}

		# Prestige loss for the defender
		scope:defender = {
			add_prestige = {
				value = medium_prestige_value
				multiply = -1.0
			}
		}

		# Prestige for the attacker's war allies
		add_from_contribution_attackers = {
			prestige = {
				value = major_prestige_value
			}
			opinion = {
				modifier = contributed_in_war
			}
		}

		# Prestige for the defender's war allies
		add_from_contribution_defenders = {
			prestige = {
				value = major_prestige_value
			}
			opinion = {
				modifier = contributed_in_war
			}
		}

		# Domination Effects
		# Iterate the Domitans Tribunal and Domination War counters
		change_global_variable = {
			name = regula_domitans_tally
			add = 1
		}
		change_global_variable = {
			name = regula_domination_war_tally
			add = 1
		}
		scope:defender = {
			# Domitans pregnancy trigger.
			if = {
				limit = {
					is_pregnant = yes
				}
				random = {
					chance = 25
					trigger_event = regula_paelex_event.1040
				}
			}
			# Spouses, if any exist, are removed.
			if = {
				limit = {
					is_married = yes
				}
				if = {
					limit = {
						NOT = {
							is_consort_of = scope:attacker
						}
					}
					every_spouse = {
						if = {
							limit = {
								is_spouse_of = scope:defender
							}
							add_opinion = {
								target = scope:attacker
								modifier = forced_spouse_concubine_marriage_opinion
							}
							scope:defender = {
								divorce = prev # no opinion hit, no scripted effect
							}
						}
						else_if = {
							limit = {
								scope:defender = {
									is_concubine_of = prev
								}
							}
							add_opinion = {
								target = scope:attacker
								modifier = stole_concubine_opinion
							}
							remove_concubine = scope:defender
						}
					}
				}
			}

			# Stealing concubines pisses the former concubinist off.
			if = {
				limit = {
					is_concubine = yes
					NOT = { is_concubine_of = scope:attacker }
				}
				this.concubinist = {
					if = {
						limit = {
							is_spouse_of = scope:defender
						}
						add_opinion = {
							target = scope:attacker
							modifier = forced_spouse_concubine_marriage_opinion
						}
						scope:defender = {
							divorce = prev # no opinion hit, no scripted effect
						}
					}
					else_if = {
						limit = {
							scope:defender = {
								is_concubine_of = prev
							}
						}
						add_opinion = {
							target = scope:attacker
							modifier = stole_concubine_opinion
						}
						remove_concubine = scope:defender
					}
				}
			}

			# Break any betrothals which may exist (without additional opinion penalties).
			if = {
				limit = { exists = betrothed }
				betrothed = {
					if = {
						limit = {
							is_spouse_of = scope:defender
						}
						add_opinion = {
							target = scope:attacker
							modifier = forced_spouse_concubine_marriage_opinion
						}
						scope:defender = {
							divorce = prev # no opinion hit, no scripted effect
						}
					}
				}
				break_betrothal = betrothed
			}
		}
		if = { # Redirect towards domina events. UPDATE - Non-functional
			limit = {
				OR = {
					scope:attacker.primary_spouse = scope:defender
					scope:attacker = {
						is_married = no
					}
				}
			}
			scope:attacker = {
				marry = scope:defender
				hidden_effect = {
					every_spouse = {
						remove_opinion = {
							modifier = polygamous_marriage_opinion
							target = scope:attacker
						}
					}
				}
				trigger_event = {
					id = regula_paelex_event.1009
					days = 7
				}
			}
		}
		else = { # Paelex events.
			scope:attacker = {
				marry = scope:defender
				hidden_effect = {
					every_spouse = {
						remove_opinion = {
							modifier = polygamous_marriage_opinion
							target = scope:attacker
						}
					}
				}
				trigger_event = {
					id = regula_paelex_event.1009
					days = 7
				}
			}
		}

		# Truce
		add_truce_attacker_victory_effect = yes

	}

	on_white_peace_desc = {
		first_valid = {
			triggered_desc = {
				trigger = { scope:defender = { is_local_player = yes } }
				desc = regula_dominate_female_ruler_war_white_peace_desc_defender
			}
			desc = regula_dominate_female_ruler_war_white_peace_desc
		}
	}

	on_white_peace = {
		scope:attacker = { show_pow_release_message_effect = yes }
		# Prestige loss for the attacker
		scope:attacker = {
			add_prestige = {
				value = minor_prestige_value
				multiply = -1.0
			}
		}

		# Prestige for the attacker's war allies
		add_from_contribution_attackers = {
			prestige = minor_prestige_value
			opinion = {
				modifier = contributed_in_war
			}
		}

		# Prestige for the defender's war allies
		add_from_contribution_defenders = {
			prestige = minor_prestige_value
			opinion = {
				modifier = contributed_in_war
			}
		}

		# Truce
		add_truce_white_peace_effect = yes
	}

	on_defeat_desc = {
		first_valid = {
			triggered_desc = {
				trigger = { scope:defender = { is_local_player = yes } }
				desc = regula_dominate_female_ruler_war_white_peace_desc_defender
			}
			triggered_desc = {
				trigger = {
					scope:attacker = {
						is_local_player = yes
						has_targeting_faction = yes
					}
				}
				desc = regula_dominate_female_ruler_war_defeat_desc_attacker
			}
			desc = regula_dominate_female_ruler_war_white_peace_desc
		}
	}

	on_defeat = {
		scope:attacker = { show_pow_release_message_effect = yes }

		# Prestige loss for the attacker
		scope:attacker = {
			pay_short_term_gold = {
				gold = 3
				target = scope:defender
				yearly_income = yes
			}
			add_prestige = {
				value = major_prestige_value
				multiply = -1.0
			}
		}

		# Prestige for the defender
		scope:defender = {
			add_prestige = {
				value = medium_prestige_value
			}
		}

		# Prestige for the attacker's war allies
		add_from_contribution_attackers = {
			prestige = major_prestige_value
			opinion = {
				modifier = contributed_in_war
			}
		}

		# Prestige for the defender's war allies
		add_from_contribution_defenders = {
			prestige = major_prestige_value
			opinion = {
				modifier = contributed_in_war
			}
		}

		scope:attacker = {
			save_temporary_scope_as = loser
		}

		# Truce
		add_truce_attacker_defeat_effect = yes

		on_lost_aggression_war_discontent_loss = yes
	}

	on_primary_attacker_death = inherit
	on_primary_defender_death = inherit

	attacker_allies_inherit = yes
	defender_allies_inherit = yes

	war_name = "REGULA_DOMINATION_WAR_NAME"
	war_name_base = "REGULA_DOMINATION_WAR_NAME_BASE"
	cb_name = "REGULA_DOMINATION_CB_NAME"
	interface_priority = 59

	ticking_war_score_targets_entire_realm = yes
	max_defender_score_from_occupation = 150
	max_attacker_score_from_occupation = 150
	attacker_ticking_warscore = 0
	attacker_wargoal_percentage = 0.8

	max_ai_diplo_distance_to_title = 500
}

regula_servitude_faction_war = {
	group = civil_war
	ai_only_against_liege = yes
	target_titles = independence_domain
	allowed_for_character = {
		scope:attacker = {
			is_leading_faction_type = regula_servitude_faction
		}
	}

	allowed_against_character = {
		scope:attacker = {
			liege = scope:defender
			scope:defender = {
				NOT = { has_trait = magister_trait_group }
				NOT = {
					any_ally = {
						has_trait = magister_trait_group
					}
				}
				NOT = {
					faith = {
						religion_tag = regula_religion
					}
				}
				NOT = {
					any_character_war = {
						is_attacker = global_var:magister_character
						using_cb = regula_dominate_female_ruler_war
					}
				}
				NOT = {
					any_character_war = {
						is_attacker = global_var:magister_character
						using_cb = regula_claim_vassal_war
					}
				}
			}
		}
	}

	target_de_jure_regions_above = yes

	valid_to_start = {

	}

	on_declaration = {
		#on_declared_war = yes
	}

	on_victory_desc = {  # Should be visible to AI only.
		first_valid = {
			triggered_desc = {
				trigger = { # Desc for only one player attacker
					scope:attacker = {
						is_local_player = yes
						joined_faction = {
							any_faction_member = {
								count = 1
							}
						}
					}
				}
				desc = independence_war_victory_desc_local_player_attacker_alone
			}
			triggered_desc = { # Desc for only one attacker, player defender
				trigger = {
					scope:defender = {
						is_local_player = yes
					}
					scope:attacker = {
						joined_faction = {
							any_faction_member = {
								count = 1
							}
						}
					}
				}
				desc = independence_war_victory_desc_local_player_defender_attacker_alone
			}
			triggered_desc = { # Desc for player attacker
				trigger = {
					scope:attacker.joined_faction = {
						any_faction_member = { is_local_player = yes }
					}
				}
				desc = regula_servitude_war_victory_desc_local_player_attacker
			}
			triggered_desc = { # Desc for player defender
				trigger = { scope:defender = { is_local_player = yes } }
				desc = independence_war_victory_desc_local_player_defender
			}
			desc = regula_servitude_war_victory_desc # Desc for a third party involved
		}

	}

	on_victory = {
		scope:attacker = { show_pow_release_message_effect = yes }
		create_title_and_vassal_change = {
			type = swear_fealty
			save_scope_as = change
			add_claim_on_loss = no
		}
		scope:attacker.joined_faction = {
			every_faction_member = {
				change_liege = {
					liege = global_var:magister_character
					CHANGE = scope:change
				}
			}
		}
		scope:attacker = {
			if = {
				limit = {
					is_ai = yes
				}
				add_prestige = medium_prestige_value
				add_piety = medium_piety_value
			}
		}
		# Iterate the servitude war counter
		change_global_variable = {
			name = regula_servitude_war_tally
			add = 1
		}
		global_var:magister_character = {
			send_interface_message = {  # Let the MC know the war is won.
				type = event_war_good
				title = regula_servitude_faction_victory_notification.t
				desc = regula_servitude_faction_victory_notification_desc
				right_icon = scope:attacker
				left_icon = scope:defender
			}
			add_prestige = major_prestige_value
		}

		scope:defender = {
			add_prestige = {
				value = medium_prestige_value
				multiply = -1
			}
			if = {
				limit = { has_realm_law = crown_authority_1 }
				add_realm_law = crown_authority_0
			}
			if = {
				limit = { has_realm_law = crown_authority_2 }
				add_realm_law = crown_authority_1
			}
			if = {
				limit = { has_realm_law = crown_authority_3 }
				add_realm_law = crown_authority_2
			}
		}
		resolve_title_and_vassal_change = scope:change
	}

	on_white_peace_desc = {
		first_valid = {
			triggered_desc = {
				trigger = { scope:defender = { is_local_player = yes } }
				desc = regula_servitude_war_white_peace_defender_desc
			}
			triggered_desc = {
				trigger = {
					scope:attacker.joined_faction = {
						any_faction_member = { is_local_player = yes }
					}
				}
				desc = regula_servitude_war_white_peace_attacker_desc
			}
			desc = regula_servitude_war_white_peace_desc
		}
		desc = regula_servitude_war_white_peace_end_desc

	}

	on_white_peace = {
		scope:attacker = { show_pow_release_message_effect = yes }
		hidden_effect = {
			scope:attacker = {
				if = {
					limit = { is_ai = yes }
					add_truce_both_ways = {
						character = scope:defender
						days = 1825
						war = root.war
						result = white_peace
					}
					joined_faction = {
						add_faction_discontent = -200
					}
				}
			}
		}

		scope:defender = {
			add_character_flag = {
				flag = recent_regula_servitude_faction_war
				years = faction_war_white_peace_cooldown
			}
			add_prestige = minor_prestige_value
		}
		global_var:magister_character = {
			send_interface_message = {  # Let the MC know the war is lost.
				type = event_war_bad
				title = regula_servitude_faction_defeat_notification.t
				right_icon = scope:attacker
				left_icon = scope:defender
				desc = regula_servitude_faction_defeat_notification_desc
			}
			add_prestige = major_prestige_value
		}
		on_white_peace_faction_revolt_war = yes
	}

	on_defeat_desc = {
		first_valid = {
			triggered_desc = {
				trigger = { scope:defender = { is_local_player = yes } }
				desc = independence_defeat_defender_desc
			}
			triggered_desc = {
				trigger = {
					scope:attacker.joined_faction = {
						any_faction_member = { is_local_player = yes }
					}
				}
				desc = regula_servitude_war_defeat_attacker_desc
			}
			desc = regula_servitude_war_player_defeat_desc #same loc as for player
		}
		desc = regula_servitude_war_defeat_end_desc

	}

	on_defeat = {
		scope:attacker = { show_pow_release_message_effect = yes }
		scope:defender = {
			add_character_flag = {
				flag = recent_regula_servitude_faction_war
				years = faction_war_defeat_cooldown
			}
			add_dread = medium_dread_gain
			# Prestige for Defender
			add_prestige = medium_prestige_value
		}
		global_var:magister_character = {
			send_interface_message = {  # Let the MC know the war is lost.
				type = event_war_bad
				title = regula_servitude_faction_defeat_notification.t
				right_icon = scope:attacker
				left_icon = scope:defender
				desc = regula_servitude_faction_defeat_notification_desc
			}
			add_prestige = major_prestige_value
		}
		on_lost_faction_revolt_war = yes
	}

	on_invalidated_desc = msg_invalidate_war_title

	check_defender_inheritance_validity = yes

	on_primary_attacker_death = inherit_faction
	on_primary_defender_death = inherit

	transfer_behavior = transfer

	attacker_allies_inherit = no
	defender_allies_inherit = yes

	war_name = "REGULA_SERVITUDE_WAR_NAME"

	interface_priority = 80

	use_de_jure_wargoal_only = yes

	attacker_wargoal_percentage = 1.0
	defender_wargoal_percentage = 0.0 # A single occupation will do
	defender_ticking_warscore_delay = { days = 0 } # No need for a delay here since the defender actually needs to occupy something rather than starting in control

	max_attacker_score_from_battles = 100
	max_defender_score_from_battles = 50

	max_ai_diplo_distance_to_title = 500
}


code:
# Wife takes husbands titles.  NOTE: As the game doesn't look at non-landed characters this is written inverted, with the husband as the actor.
regula_abice_maritus = {
	interface_priority = 69
	category = interaction_category_religion

	common_interaction = yes
	use_diplomatic_range = no
	ignores_pending_interaction_block = yes

	is_shown = {
		scope:recipient = {
			is_imprisoned = no
			is_landed = no
			scope:recipient.faith = {
				controls_holy_site_with_flag = regula_abice_maritus_active
			}
			piety >= 500
		}
		scope:actor = {
			is_ai = yes
			is_at_war = no
			is_spouse_of = scope:recipient
			is_male = yes
			is_ruler = yes
			NOT = { # Can't become head of a holy order. Mercenary company OK.
				any_held_title = {
					is_holy_order = yes
				}
			}
			NOT = { has_trait = magister_trait_group }
		}
	}

	is_valid_showing_failures_only = { # Not seen by player, but a custom_descriptor should be here.

	}

	cost = {
	}

	auto_accept = yes

	on_accept = {
		scope:actor = {
			create_title_and_vassal_change = {
				type = conquest
				save_scope_as = change
				add_claim_on_loss = no
			}
			every_held_title = {
				change_title_holder_include_vassals = {
					holder = scope:recipient
					change = scope:change
				}
			}
			resolve_title_and_vassal_change = scope:change
		}

		scope:actor = {
			scope:recipient = {
				add_piety = -500
				if = {
					limit = {
						scope:recipient.top_liege = { # This is going to be of limited utility for foreign Mulsa.
							any_vassal_or_below = {
								has_government = theocracy_government
								primary_title.tier > tier_barony
								faith = scope:recipient.faith
							}
						}
					}
					scope:recipient.top_liege = {
						random_vassal_or_below = {
							limit = {
								has_government = theocracy_government
								primary_title.tier > tier_barony
								faith = scope:recipient.faith
							}
							save_scope_as = theocratic_travel_target
						}
					}
					visit_court_of = scope:theocratic_travel_target
				}
				else_if = {
					limit = {
						exists = scope:recipient.capital_province
					}
					move_to_pool_at = scope:recipient.capital_province
				}
				kick_from_court_interaction_warning_tooltip_effect = yes
			}
			scope:actor = {
				add_opinion = {
					modifier = demanded_taking_vows
					target = scope:recipient
				}
				if = {
					limit = { gold > 0 }
					pay_short_term_gold = {
						target = scope:recipient
						gold = scope:actor.gold
					}
				}
				add_trait = devoted
				add_piety_level = 1
				if = {
					limit = { is_ruler = yes }
					depose = yes
				}
				if = {
					limit = {
						is_married = yes
					}
					every_spouse = {
						divorce = scope:actor
					}
				}
				if = {
					limit = {
						exists = betrothed
					}
					break_betrothal = betrothed
				}
				if = {
					limit = {
						is_concubine = yes
					}
					this.concubinist = {
						remove_concubine = scope:actor
					}
				}
				if = {
					limit = {
						number_of_concubines > 0
					}
					every_concubine = {
						scope:recipient = {
							remove_concubine = prev
						}
					}
				}
			}
		}
		if = { # Notify the player if this is particularly relevant.
			limit = {
				OR = {
					scope:recipient = {
						OR = {
							is_independent_ruler = yes
							top_liege = global_var:magister_character
						}
					}
					scope:actor = { # Fallback
						OR = {
							is_independent_ruler = yes
							top_liege = global_var:magister_character
						}
					}
				}
			}
			if = {
				limit = {
					global_var:magister_character.faith = {
						controls_holy_site = reg_alexandria
					}
				}
				global_var:magister_character = {
					send_interface_message = {  # Tells the player the outcome.
						type = event_spouse_task_good
						title = regula_abice_maritus_effect_title
						desc = regula_abice_maritus_effect.desc_mediterranean
						right_icon = scope:actor
						left_icon = scope:recipient
					}
				}
			}
			if = {
				limit = {
					global_var:magister_character.faith = {
						controls_holy_site = reg_toulouse
					}
				}
				global_var:magister_character = {
					send_interface_message = {  # Tells the player the outcome.
						type = event_spouse_task_good
						title = regula_abice_maritus_effect_title
						desc = regula_abice_maritus_effect.desc_european
						right_icon = scope:actor
						left_icon = scope:recipient
					}
				}
			}
			if = {
				limit = {
					global_var:magister_character.faith = {
						controls_holy_site = reg_tyre
					}
				}
				global_var:magister_character = {
					send_interface_message = {  # Tells the player the outcome.
						type = event_spouse_task_good
						title = regula_abice_maritus_effect_title
						desc = regula_abice_maritus_effect.desc_alexandrian
						right_icon = scope:actor
						left_icon = scope:recipient
					}
				}
			}
			if = {
				limit = {
					global_var:magister_character.faith = {
						controls_holy_site = reg_daura
					}
				}
				global_var:magister_character = {
					send_interface_message = {  # Tells the player the outcome.
						type = event_spouse_task_good
						title = regula_abice_maritus_effect_title
						desc = regula_abice_maritus_effect.desc_west_africa
						right_icon = scope:actor
						left_icon = scope:recipient
					}
				}
			}
		}
	}

	ai_targets = {
		ai_recipients = spouses
	}

	ai_targets = {
		ai_recipients = liege
	}

	ai_potential = {
		is_adult = yes
	}

	ai_frequency = 6

	ai_will_do = { # Better to link the effect to ai's piety than traits.  Way less balancing required.
		base = 100
	}
}

regula_fascinare_ai_interaction = {
	category = interaction_debug_main
	common_interaction = yes
	use_diplomatic_range = no
	ignores_pending_interaction_block = yes
	cooldown = { months = 48 }# Every 4 years

	is_shown = {
		scope:actor = {
			AND = {
				OR = {
					has_trait = paelex
#					has_trait = mulsa  ### Update - Too much?
					has_trait = domina
				}
				scope:actor.faith = {
					controls_holy_site_with_flag = holy_site_reg_mulsa_fascinare_flag
				}
			}
		}
		scope:recipient = {
			is_adult = yes
			is_male = no
			NOR = {
				has_trait = paelex
				has_trait = mulsa
				has_trait = domina
				has_trait = contubernalis
				has_trait = orba
			}
			is_imprisoned = no
		}
	}

	is_valid = {
		NOT = { scope:recipient = scope:actor }
		scope:actor = {
			OR = {
				has_trait = magister_trait_group
				has_trait = devoted_trait_group
			}
		}
	}

	ai_frequency = 24

	# ai_targets = {
	# 	ai_recipients = realm_characters # limited by is_shown to members of their court.
	# 	max = 10
	# }
	ai_targets = {
		ai_recipients = guests
		ai_recipients = courtiers
		ai_recipients = vassals ### UPDATE - Is this appropriate code?
	}

	ai_targets = {
		ai_recipients = dynasty
	}

	ai_target_quick_trigger = {
		adult = yes
		attracted_to_owner = yes
		owner_attracted = yes
	}

	on_accept = {
		scope:recipient = {
			add_trait = mulsa
			set_character_faith = global_var:magister_character.faith
		}
	}

	auto_accept = yes

	ai_will_do = {
		base = 100
	}
}

regula_instiga_discordia = {
	category = interaction_category_religion
	common_interaction = yes
	use_diplomatic_range = no
	ignores_pending_interaction_block = yes
	interface_priority = 71

	cooldown_against_recipient = { years = 2 } # Can run through all mulsa, but can't just repeatedly run the event against one mulsa.

	cost = {
		piety = {
			value = 50
		}
	}

	is_shown = {
		scope:actor = { has_trait = magister_trait_group }
		scope:recipient = { # Mulsa must be foreign.
			has_trait = devoted_trait_group
			is_independent_ruler = no
			OR = {
				is_ruler = yes
				is_married = yes
			}
			NOT = { is_spouse_of = scope:actor }
			NOT = { is_in_the_same_court_as_or_guest = scope:actor }
		}
		NOR = {
			scope:recipient.top_liege = scope:actor
			scope:recipient.liege = scope:actor
			scope:recipient = scope:actor
			scope:recipient = { is_imprisoned = yes }
		}
	}

	is_valid_showing_failures_only = {
		scope:actor = {
			custom_description = {
				text = magister_trait_3_required_trigger
				has_trait_rank = {
					trait = magister_trait_group
					rank >= 3
				}
			}
		}
		scope:recipient = {
			custom_description = {
				text = regula_instiga_discordia_in_progress_trigger
				can_start_scheme = {
					type = regula_instiga_discordia
					target = scope:recipient.primary_spouse
				}
			}
		}
	}

	desc = regula_instiga_discordia_interaction_desc

	auto_accept = yes

	on_accept = {
		scope:recipient = {
			if = {
				limit = {
					NOT = { has_trait = regula_gossip }
				}
				add_trait = regula_gossip
			}
			if = {
				limit = {
					is_ruler = no
					is_married = yes
				}
				scope:recipient.primary_spouse = {
					save_scope_as = target
				}
			}
			else = {
				scope:recipient.liege = {
					save_scope_as = target
				}
			}
		}

		scope:actor = {
			send_interface_toast = {
				title = start_regula_instiga_discordia_notification

				left_icon = scope:recipient
				right_icon = scope:target

				scope:recipient = {
					start_scheme = {
						type = regula_instiga_discordia
						target = scope:target
					}
				}
			}
		}
	}
	ai_will_do = {
		base = 100
	}
}

start_rapta_maritus = {
	interface_priority = 65
	category = interaction_category_religion
	common_interaction = yes

	send_name = START_SCHEME

	scheme = rapta_maritus
	ignores_pending_interaction_block = yes

	cooldown = { years = 3 }

	is_shown = {
		scope:actor = { has_trait = magister_trait_group }
		scope:recipient = {
			has_trait = devoted_trait_group
			is_married = yes
			NOT = { is_spouse_of = scope:actor }
			NOT = { is_vassal_or_below_of = scope:actor }
		}
		NOR = {
			scope:recipient = scope:actor
#			scope:recipient.primary_spouse = { is_imprisoned = no }
			scope:recipient = { is_imprisoned = yes }
		}
	}

	is_valid_showing_failures_only = {  # UPDATE - Need to add explanatory text. And a something that states they're still working.
		scope:actor = {
			custom_description = {
				text = magister_trait_4_required_trigger
				has_trait_rank = {
					trait = magister_trait_group
					rank >= 4
				}
			}
		}
		scope:recipient = {
			custom_description = {
				text = rapta_maritus_in_progress_trigger
				can_start_scheme = {
					type = rapta_maritus
					target = scope:recipient.primary_spouse
				}
			}
		}
	}

	cost = {
		piety = 75
	}

	desc = {
		triggered_desc = {
			trigger = {
				scope:actor = {
					can_start_scheme = {
						type = rapta_maritus
						target = scope:recipient.primary_spouse
					}
				}
			}
			desc = scheme_interaction_tt_rapta_maritus_approved
		}
	}

	on_accept = {
		custom_tooltip = rapta_maritus_tooltip
		scope:recipient = {
			stress_impact = {
				compassionate = medium_stress_impact_gain
				honest = minor_stress_impact_gain
				just = minor_stress_impact_gain
			}
			add_intrigue_skill = 3
			if = {
				limit = {
					NOR = {
						has_trait = sadistic
						has_trait = callous
					}
				}
				add_trait = callous
			}
			if = {
				limit = {
					NOT = { has_trait = cynical }
				}
				add_trait = cynical
			}
		}
		hidden_effect = {
			scope:actor = {
				send_interface_toast = {
					title = start_rapta_maritus_notification

					left_icon = scope:recipient
					right_icon = scope:recipient.primary_spouse

					scope:recipient = {
						start_scheme = {
							type = rapta_maritus
							target = scope:recipient.primary_spouse
						}
					}
				}
			}
		}
	}

	auto_accept = yes
}

revela_secretum = {
	category = interaction_category_religion
	common_interaction = yes
	use_diplomatic_range = no
	ignores_pending_interaction_block = yes
	interface_priority = 60

#	icon = "gfx/interface/icons/character_interactions/regula_character_interaction.dds"

	cooldown_against_recipient = { years = 2 } # Can run through all mulsa, but can't just repeatedly run the event against one mulsa.

	cost = {
		piety = {
			value = 50
		}
	}

	is_shown = {
		scope:actor = { has_trait = magister_trait_group }
		scope:recipient = { # Mulsa must be foreign.
			has_trait = devoted_trait_group
			is_independent_ruler = no
			NOT = { is_spouse_of = scope:actor }
			NOT = { is_in_the_same_court_as_or_guest = scope:actor }
		}
		NOR = {
			scope:recipient.top_liege = scope:actor
			scope:recipient.liege = scope:actor
			scope:recipient = scope:actor
			scope:recipient = { is_imprisoned = yes }
		}
	}

	is_valid_showing_failures_only = {
		scope:actor = {
			custom_description = {
				text = magister_trait_2_required_trigger
				has_trait_rank = {
					trait = magister_trait_group
					rank >= 2
				}
			}
		}
	}

	desc = revela_secretum_interaction_desc

	on_accept = {
		custom_tooltip = revela_secretum_interaction_tooltip
		scope:recipient = {
			save_scope_as = revela_recipient
			if = {
				limit = {
					any_secret = { # There's something to discover
						NOR = {
							is_known_by = scope:actor
							secret_target = scope:recipient
						}
					}
				}
				random_secret = {
					limit = {
						NOR = {
							is_known_by = scope:actor
							secret_target = scope:recipient
						} # Hilarious as it is, they shouldn't be revealing their own secrets.
					}
					weight = {
						base = -1
						modifier = {
							add = 5
							is_criminal_for = secret_owner
						}
					}
					save_scope_as = secret_to_reveal
				}
			}
		}
		if = {
			limit = {
				exists = scope:secret_to_reveal
			}
			scope:actor = {
				trigger_event = {
					id = revela_secretum.0001 # Move to decision
					days = { 2 10 }
				}
			}
		}
		else = {
			if = {
				limit = {
					scope:recipient = {
						has_perk = truth_is_relative_perk # Mulsa is inventive
					}
				}
				scope:recipient = {
					hidden_effect = {
						# Start by adding everyone that this character could trick to a list
						add_to_list = secret_setup
						every_spouse = {
							add_to_list = secret_setup
						}
						every_vassal_or_below = {
							add_to_list = secret_setup
						}
						every_close_family_member = {
							add_to_list = secret_setup
						}
						every_relation = {
							add_to_list = secret_setup
						}
						random_in_list = { # Target a vassal or liege. They must be of age.
							list = secret_setup
							limit = {
								NOR = {
									has_trait = devoted_trait_group
									is_adult = no
								}
							}
							save_scope_as = revela_target
							random = {
								chance = 20
								save_scope_value_as = {
									name = strong_hook_against_ruler
									value = yes
								}
							}
						}
					}
				}
				scope:actor = {
					trigger_event = {
						on_action = revela_secretum_fabricate_effect
						days = { 10 30 }
					}
				}
			}
			else = {
				scope:recipient = {
					hidden_effect = {
						# Start by adding everyone that this character could trick to a list
						add_to_list = secret_setup
						every_spouse = {
							add_to_list = secret_setup
						}
						every_vassal_or_below = {
							add_to_list = secret_setup
						}
						every_close_family_member = {
							add_to_list = secret_setup
						}
						every_relation = {
							add_to_list = secret_setup
						}
					random_in_list = { # Target a vassal or liege
						list = secret_setup
						limit = {
							NOR = {
								has_trait = devoted_trait_group
								is_adult = no
							}
						}
						save_scope_as = revela_target
							random = {
								chance = 20
								save_scope_value_as = {
									name = strong_hook_against_ruler
									value = yes
								}
							}
						}
					}
				}
				scope:actor = {
					trigger_event = {
						id = revela_secretum.0002 # Take nothing or alter mulsa.
						days = { 10 30 }
					}
				}
			}
		}
	}
	auto_accept = yes
}