﻿# Regula Lewd Contracts
# Marriage Dispute events

# Script values
@regula_laamp_marriage_dispute_contract_skill_threshold_value = extremely_high_skill_rating
@regula_laamp_marriage_dispute_contract_skill_threshold_high_value = monumentally_high_skill_rating

namespace = regula_laamp_marriage_dispute_contract

##################################################
# Contract Schemes (Marriage Dispute)
# 0001 - 0100	Marriage Dispute
# 0100 - 0109 - Dowry Dispute		(Stewardship | Diplomacy)
# 0110 - 0119 - Incompatible		(Diplomacy | Learning)
# 0120 - 0129 - Witch				(Learning | Martial)
# 0130 - 0139 - Trial by Combat		(Martial | Intrigue)
# 0140 - 0149 - Forced Marriage		(Intrigue | Martial)
# 0150 - 0159 - Runaway Bride		(Stewardship | Intrigue)
# 0160 - 0170 - The Blood Price		(Diplomacy | Learning)
##################################################

##################################################
# SCRIPTED TRIGGERS & EFFECTS
# Mostly same as search_for_women_set_cost_effect / 1033_set_cost_effect
# Good approximate "cost" for bride
scripted_effect bride_set_cost_effect = {
	save_scope_value_as = {
		name = $VALUE_NAME$_sum_skills
		value = {
			add = $CHARACTER$.diplomacy
			add = $CHARACTER$.martial
			add = $CHARACTER$.stewardship
			add = $CHARACTER$.intrigue
			add = $CHARACTER$.learning
			add = $CHARACTER$.prowess
		}
	}
	save_scope_value_as = {
        name = $VALUE_NAME$
        value = {
            integer_range = {
                min = medium_gold_laamps_value
                max = major_gold_laamps_value
            }
            #Cheaper out in the wilds
            if = {
                limit = { 
                    scope:current_location = {
						OR = {
							has_holding_type = nomad_holding
							has_holding_type = tribal_holding 
						}
					}
                }
                multiply = 0.6
            }
            if = { #They're stellar? More expensive.
                limit = { scope:$VALUE_NAME$_sum_skills >= 120 } #Good in all skills?
                multiply = 8 #20 in all skills
            }
            else_if = {
                limit = { scope:$VALUE_NAME$_sum_skills >= 100 } #Good in four skills?
                multiply = 5
            }
            else_if = {
                limit = { scope:$VALUE_NAME$_sum_skills >= 80 } #Good in three skills?
                multiply = 4
            }
            else_if = {
                limit = { scope:$VALUE_NAME$_sum_skills >= 60 } #Good in two skills?
                multiply = 3
            }
            else_if = {
                limit = { scope:$VALUE_NAME$_sum_skills >= 40 } #Good in one-and-a-half skill? Should be roughly 90-110 gold
                multiply = 2.5
            }
            else_if = {
                limit = { scope:$VALUE_NAME$_sum_skills >= 20 } #Good in one skill?
                multiply = 1.5
            }
            #Add perk discounts and other things here.
        }
    }
}

# Stress solve the contract
scripted_effect regula_laamp_marriage_dispute_contract_stress_fallback_option_effect = {
	stress_impact = {
		base = major_stress_gain
		diligent = minor_stress_loss
		lazy = medium_stress_gain
	}
}

# Standard victory
scripted_effect regula_laamp_marriage_dispute_contract_standard_effect = {
	scope:task_contract = { complete_task_contract = success_standard }

	stress_impact = {
		diligent = minor_stress_loss
		lazy = minor_stress_gain
	}
}

# Recruitment victory
# We have to run this in event due to scopes
scripted_effect regula_laamp_marriage_dispute_contract_recruitment_effect = {
	scope:task_contract = { complete_task_contract = success_recruitment }

	hidden_effect = {
		if = {
			limit = { exists = scope:bride }
			if = {
				limit = { 
					exists = scope:groom
					scope:bride = {
						exists = betrothed
						betrothed = scope:groom
					}
				}
				scope:bride = { break_betrothal = scope:groom }
			}
			add_courtier = scope:bride
		}
	}
	stress_impact = {
		lustful = minor_stress_loss
		shy = minor_stress_gain
	}
}

# Standard Loss
scripted_effect regula_laamp_marriage_dispute_contract_loss_effect = {
	scope:task_contract = { complete_task_contract = failure_standard }
}

# Syncs stress gained from failing a non-criminal contract scheme.
scripted_effect regula_laamp_marriage_dispute_contract_acknowledge_failure_stress_effect = {
	if = {
		limit = { scope:task_contract_tier >= 2 }
		stress_impact = {
			base = miniscule_stress_impact_gain
			humble = minor_stress_impact_loss
			arrogant = minor_stress_impact_gain
		}
	}
}

# Check if the employer has a courtier or guest that can be a "Groom"
# This makes it super unlikely that we need to create a random groom character
scripted_trigger regula_laamp_marriage_dispute_employer_has_possible_groom_courtier_or_guest_trigger = {
	scope:employer = {
		any_courtier_or_guest = {
			is_ai = yes
			is_married = no
			is_betrothed = no
			is_male = yes
			is_adult = yes
			age <= 45
		}
	}
}

# Find a groom from our employers court, either a courtier or guest
# Better then creating random characters everywhere, Still have fallback created character just in case
scripted_effect regula_laamp_marriage_dispute_get_random_courtier_or_guest_groom_effect = {
	scope:employer = {
		random_courtier_or_guest = {
			limit = {
				is_ai = yes
				is_married = no
				is_betrothed = no
				is_male = yes
				is_adult = yes
				age <= 45
			}
			save_scope_as = groom
		}
	}

	# Fallback
	if = {
		limit = { NOT = { exists = scope:groom } }
		create_character = {
			template = generic_peasant_character
			gender = male
			location = scope:current_location
			culture = scope:current_location.culture
			faith = scope:current_location.faith
			dynasty = none
			save_scope_as = groom
			age = { 20 35 }
		}
	}
}

# Create a "default" bride, with quality ranging from fantastic to bad
# Quality depends on the employers highest title tier
# Also creates a prestige_bribe value
scripted_effect regula_laamp_marriage_dispute_create_random_bride_effect = {

	# Quality depends on Employer title tier
	# Bride tiers are:
	# 	Fantastic/Great/Good/Okay/Terrible
	# County 	- 5/10/30/55/10
	# Duchy		- 10/15/40/30/5
	# Kingdom 	- 20/25/50/5/0
	# Empire 	- 30/45/25/0/0

	random_list = {
		# Fantastic!
		0 = {
			modifier = { scope:employer.highest_held_title_tier = tier_county 	add = 5 }
			modifier = { scope:employer.highest_held_title_tier = tier_duchy 	add = 10 }
			modifier = { scope:employer.highest_held_title_tier = tier_kingdom 	add = 20 }
			modifier = { scope:employer.highest_held_title_tier = tier_empire 	add = 30 }
			save_scope_value_as = {
				name = bride_quality
				value = flag:fantastic
			}
			save_scope_value_as = {
				name = prestige_bribe
				value = massive_prestige_loss
			}
			create_recruit_from_template_with_location = { SAVE_SCOPE = bride TEMPLATE = regula_generated_castle_princess_character LOCATION = scope:current_location } 
		}

		# Great
		0 = {
			modifier = { scope:employer.highest_held_title_tier = tier_county 	add = 10 }
			modifier = { scope:employer.highest_held_title_tier = tier_duchy 	add = 15 }
			modifier = { scope:employer.highest_held_title_tier = tier_kingdom 	add = 25 }
			modifier = { scope:employer.highest_held_title_tier = tier_empire 	add = 45 }
			save_scope_value_as = {
				name = bride_quality
				value = flag:great
			}
			save_scope_value_as = {
				name = prestige_bribe
				value = major_prestige_loss
			}
			random_list = {
				5 = { create_recruit_from_template_with_location = { SAVE_SCOPE = bride TEMPLATE = regula_orgy_invitee_character LOCATION = scope:current_location } }
				5 = { create_recruit_from_template_with_location = { SAVE_SCOPE = bride TEMPLATE = regula_cultist_maiden_character LOCATION = scope:current_location } }
			}
		}

		# Good
		0 = {
			modifier = { scope:employer.highest_held_title_tier = tier_county 	add = 55 }
			modifier = { scope:employer.highest_held_title_tier = tier_duchy 	add = 30 }
			modifier = { scope:employer.highest_held_title_tier = tier_kingdom 	add = 5 }
			save_scope_value_as = {
				name = bride_quality
				value = flag:good
			}
			save_scope_value_as = {
				name = prestige_bribe
				value = major_prestige_loss
			}
			random_list = {
				5 = { create_recruit_from_template_with_location = { SAVE_SCOPE = bride TEMPLATE = regula_generated_generic_farmgirl_character LOCATION = scope:current_location } }
				5 = { create_recruit_from_template_with_location = { SAVE_SCOPE = bride TEMPLATE = regula_generated_temple_gardener_character LOCATION = scope:current_location } }
				5 = { create_recruit_from_template_with_location = { SAVE_SCOPE = bride TEMPLATE = regula_generated_tribal_submissive_character LOCATION = scope:current_location } }
				5 = { create_recruit_from_template_with_location = { SAVE_SCOPE = bride TEMPLATE = regula_generous_welcome_lustful_indulgence_beauty_attendee LOCATION = scope:current_location } }
				5 = { create_recruit_from_template_with_location = { SAVE_SCOPE = bride TEMPLATE = regula_generous_welcome_lustful_indulgence_strong_attendee LOCATION = scope:current_location } }
				5 = { create_recruit_from_template_with_location = { SAVE_SCOPE = bride TEMPLATE = regula_generous_welcome_lustful_indulgence_smart_attendee LOCATION = scope:current_location } }
			}
		}

		# Okay
		0 = {
			modifier = { scope:employer.highest_held_title_tier = tier_county 	add = 10 }
			modifier = { scope:employer.highest_held_title_tier = tier_duchy 	add = 5 }
			save_scope_value_as = {
				name = bride_quality
				value = flag:okay
			}
			save_scope_value_as = {
				name = prestige_bribe
				value = medium_prestige_loss
			}
			create_recruit_from_template_with_location = { SAVE_SCOPE = bride TEMPLATE = regula_generated_generic_peasant_character LOCATION = scope:current_location } 
		}

		# Terrible
		0 = {
			modifier = { scope:employer.highest_held_title_tier = tier_county 	add = 5 }
			modifier = { scope:employer.highest_held_title_tier = tier_duchy 	add = 10 }
			modifier = { scope:employer.highest_held_title_tier = tier_kingdom 	add = 20 }
			modifier = { scope:employer.highest_held_title_tier = tier_empire 	add = 30 }
			save_scope_value_as = {
				name = bride_quality
				value = flag:bad
			}
			save_scope_value_as = {
				name = prestige_bribe
				value = minor_prestige_loss
			}
			create_recruit_from_template_with_location = { SAVE_SCOPE = bride TEMPLATE = regula_generated_generic_idiot_character LOCATION = scope:current_location }
		}
	}

	# Fallback
	if = {
		limit = { NOT = { exists = scope:bride }}
			save_scope_value_as = {
				name = bride_quality
				value = flag:okay
			}
			save_scope_value_as = {
				name = prestige_bribe
				value = medium_prestige_loss
			}
			create_recruit_from_template_with_location = { SAVE_SCOPE = bride TEMPLATE = regula_generated_generic_peasant_character LOCATION = scope:current_location } 
	}
}

##################################################
# SETUP — Marriage Dispute
##################################################
# Arbitrate a Marriage Dispute (setup)
# by Ban10
# 0001 - 0009
##################################################

#	Roll our marriage dispute event
regula_laamp_marriage_dispute_contract.0001 = {
	hidden = yes

	immediate = {
		random_list = {
			# Dowry
			100 = {
				modifier = {
					has_lifestyle = stewardship_lifestyle
					add = 100
				}
				trigger = {
					regula_laamp_marriage_dispute_employer_has_possible_groom_courtier_or_guest_trigger = yes
				}
				trigger_event = regula_laamp_marriage_dispute_contract.0100 
			}

			# Bad Match
			100 = {
				modifier = {
					has_lifestyle = diplomacy_lifestyle
					add = 100
				}
				trigger = {
					regula_laamp_marriage_dispute_employer_has_possible_groom_courtier_or_guest_trigger = yes
				}
				trigger_event = regula_laamp_marriage_dispute_contract.0110 
			}

			# Witch
			100 = {
				modifier = {
					has_lifestyle = learning_lifestyle
					add = 100
				}
				trigger_event = regula_laamp_marriage_dispute_contract.0120 
			}

			# Trial by Combat
			100 = {
				modifier = {
					has_lifestyle = martial_lifestyle
					add = 100
				}
				trigger_event = regula_laamp_marriage_dispute_contract.0130 
			}

			# Forced Marriage - TODO
			#100 = { trigger_event = regula_laamp_marriage_dispute_contract.0140 }

			# Runaway Bride
			100 = {
				modifier = {
					has_lifestyle = stewardship_lifestyle
					add = 100
				}
				trigger = {
					regula_laamp_marriage_dispute_employer_has_possible_groom_courtier_or_guest_trigger = yes
				}
				trigger_event = regula_laamp_marriage_dispute_contract.0150 
			}

			# Blood Price
			100 = {
				modifier = {
					location = {
						OR = {
							has_holding_type = tribal_holding
							has_holding_type = nomad_holding
						}
					}
					add = 100
				}
				modifier = {
					location = {
						NAND = {
							has_holding_type = tribal_holding
							has_holding_type = nomad_holding
						}
					}
					subtract = 75
				}
				trigger_event = regula_laamp_marriage_dispute_contract.0160 
			}
		}
	}
}

################################################
# Dowry Dispute -  Marriage Dispute
# 0100 - 0109
# The Groom demands a dowry, But the bride cannot pay!
# Stewardship (Standard) | Diplomacy (Recruitment) challenge
# Also can:
# 1. Use Diplomat/Administrator/Scholar trait - Standard
# 2. Pay dowry (half cost of recruitment, plus gives bonus prestige) - Recruitment
# 3. Stress solve - Standard
################################################

regula_laamp_marriage_dispute_contract.0100 = {
	type = character_event
	theme = stewardship
	title = regula_laamp_marriage_dispute_contract.0100.t
	desc = {
		desc = regula_laamp_marriage_dispute_contract.0100.desc
		first_valid = {
			triggered_desc = {
				trigger = {
					scope:bride_quality = flag:fantastic
				}
				desc = regula_laamp_marriage_dispute_contract.recruit_quality.fantastic
			}
			triggered_desc = {
				trigger = {
					scope:bride_quality = flag:great
				}
				desc = regula_laamp_marriage_dispute_contract.recruit_quality.great
			}
			triggered_desc = {
				trigger = {
					scope:bride_quality = flag:good
				}
				desc = regula_laamp_marriage_dispute_contract.recruit_quality.good
			}
			triggered_desc = {
				trigger = {
					scope:bride_quality = flag:okay
				}
				desc = regula_laamp_marriage_dispute_contract.recruit_quality.okay
			}
			triggered_desc = {
				trigger = {
					scope:bride_quality = flag:bad
				}
				desc = regula_laamp_marriage_dispute_contract.recruit_quality.bad
			}
		}
	}

	left_portrait = {
		character = scope:groom
		animation = rage
	}
	right_portrait = {
		character = scope:bride
		animation = crying
	}
	lower_right_portrait = scope:employer
	override_background = { reference = temple_scope }

	immediate = {
		scope:employer = {
			save_scope_as = background_temple_scope
		}
		location = {
			save_scope_as = current_location
		}
		# Create the Bride & find a Groom
		# Bride
		regula_laamp_marriage_dispute_create_random_bride_effect = yes

		# Groom, first try and find a "mean" courtier/guest
		scope:employer = {
			random_courtier_or_guest = {
				limit = {
					is_ai = yes
					is_married = no
					is_betrothed = no
					is_male = yes
					is_adult = yes
					age <= 45

					# Make sure personality is mean
					OR = {
						has_trait = vengeful
						has_trait = sadistic
						has_trait = callous
						has_trait = wrathful
						has_trait = greedy
						ai_vengefulness >= 30
						ai_compassion <= -30
					}
				}
				save_scope_as = groom
			}
		}

		# Otherwise just use a normal courtier/guest
		if = {
			limit = { NOT = { exists = scope:groom } }
			regula_laamp_marriage_dispute_get_random_courtier_or_guest_groom_effect = yes
		}

		# Set relationships
		hidden_effect = {
			scope:bride = {
				create_betrothal = scope:groom
			}
		}

		# Set "dowry" cost
		bride_set_cost_effect = { CHARACTER = scope:bride VALUE_NAME = dowry }
		set_variable = {
			name = dowryVal
			value = scope:dowry
		}

		# Divide by 2 to make a bit cheaper
		change_variable = {
			name = dowryVal
			divide = 2
		}
	}

	# Sort out the Dowry (Standard)
	# Stewardship auto-win
	option = {
		name = regula_laamp_marriage_dispute_contract.0100.stewardship.auto_win
		trigger = { stewardship >= @regula_laamp_marriage_dispute_contract_skill_threshold_value }
		skill = stewardship

		save_scope_value_as = {
			name = resolution_type
			value = flag:stewardship
		}

		show_as_tooltip = { regula_laamp_marriage_dispute_contract_standard_effect = yes }
		trigger_event = regula_laamp_marriage_dispute_contract.0101

		ai_chance = {
			# If you can auto-win, do it.
			base = 10000
		}
	}

	# Stewardship duel
	option = {
		name = regula_laamp_marriage_dispute_contract.0100.stewardship.duel
		trigger = { stewardship < @regula_laamp_marriage_dispute_contract_skill_threshold_value }

		save_scope_value_as = {
			name = resolution_type
			value = flag:stewardship
		}
		
		duel = {
			skill = stewardship
			value = decent_skill_rating
			# Victory!
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 5
					min = -49
				}
				min = 5
				desc = regula_laamp_marriage_dispute_contract.generic.duel.tt.success
				show_as_tooltip = { regula_laamp_marriage_dispute_contract_standard_effect = yes }
				trigger_event = regula_laamp_marriage_dispute_contract.0101
			}
			# Defeat.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -5
					min = -49
				}
				min = 5
				desc = regula_laamp_marriage_dispute_contract.generic.duel.tt.failure
				show_as_tooltip = { regula_laamp_marriage_dispute_contract_loss_effect = yes }
				trigger_event = regula_laamp_marriage_dispute_contract.0103
			}
		}

		ai_chance = {
			base = 1
			ai_value_modifier = { ai_energy = 2 }
		}
	}

	# Convince them to cancel marriage (Recruitment)
	# Diplomacy auto-win
	option = {
		name = regula_laamp_marriage_dispute_contract.0100.diplomacy.auto_win
		trigger = { diplomacy >= @regula_laamp_marriage_dispute_contract_skill_threshold_high_value }
		skill = diplomacy

		save_scope_value_as = {
			name = resolution_type
			value = flag:diplomacy
		}

		show_as_tooltip = { regula_laamp_marriage_dispute_contract_recruitment_effect = yes }
		trigger_event = regula_laamp_marriage_dispute_contract.0102

		ai_chance = {
			# If you can auto-win, do it.
			base = 10000
		}
	}
	
	# Diplomacy duel
	option = {
		name = regula_laamp_marriage_dispute_contract.0100.diplomacy.duel
		trigger = { diplomacy < @regula_laamp_marriage_dispute_contract_skill_threshold_high_value }

		save_scope_value_as = {
			name = resolution_type
			value = flag:diplomacy
		}
		duel = {
			skill = diplomacy
			value = decent_skill_rating
			# Victory!
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 5
					min = -49
				}
				min = 5
				desc = regula_laamp_marriage_dispute_contract.generic.duel.tt.success
				show_as_tooltip = { regula_laamp_marriage_dispute_contract_recruitment_effect = yes }
				trigger_event = regula_laamp_marriage_dispute_contract.0102
			}
			# Defeat.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -5
					min = -49
				}
				min = 5
				desc = regula_laamp_marriage_dispute_contract.generic.duel.tt.failure
				show_as_tooltip = { regula_laamp_marriage_dispute_contract_loss_effect = yes }
				trigger_event = regula_laamp_marriage_dispute_contract.0103
			}
		}

		ai_chance = {
			base = 1
			ai_value_modifier = { ai_energy = 2 }
		}
	}

	# Skilled dispute handler (Standard)
	option = {
		name = regula_laamp_marriage_dispute_contract.0100.skilled

		trigger = {
			OR = {
				has_trait = diplomat
				has_trait = administrator
				has_trait = scholar
			}
		}
		
		trait = diplomat
		trait = administrator
		trait = scholar

		save_scope_value_as = {
			name = resolution_type
			value = flag:skilled
		}

		show_as_tooltip = { regula_laamp_marriage_dispute_contract_standard_effect = yes }
		trigger_event = regula_laamp_marriage_dispute_contract.0101

		regula_laamp_marriage_dispute_contract_stress_fallback_option_effect = yes
		ai_chance = {
			# AI should try to take any other option.
			base = 0
		}
	}

	# Dowry Bribe (Recruitment)
	option = {
		name = regula_laamp_marriage_dispute_contract.0100.gold_payment
		trigger = { gold >= var:dowryVal }
		show_as_unavailable = {
			always = yes
		}

		remove_short_term_gold = var:dowryVal

		save_scope_value_as = {
			name = resolution_type
			value = flag:bribe
		}

		show_as_tooltip = { regula_laamp_marriage_dispute_contract_recruitment_effect = yes }
		trigger_event = regula_laamp_marriage_dispute_contract.0102

		ai_chance = {
			base = 1
		}
	}
	
	# Stress solve it.
	option = {
		name = regula_laamp_marriage_dispute_contract.0100.stress

		save_scope_value_as = {
			name = resolution_type
			value = flag:stress
		}

		show_as_tooltip = { regula_laamp_marriage_dispute_contract_standard_effect = yes }
		trigger_event = regula_laamp_marriage_dispute_contract.0101

		regula_laamp_marriage_dispute_contract_stress_fallback_option_effect = yes
		ai_chance = {
			# AI should try to take any other option.
			base = 0
		}
	}
}

# Victory event - Standard
regula_laamp_marriage_dispute_contract.0101 = {
	type = character_event
	title = regula_laamp_marriage_dispute_contract.0101.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = { scope:resolution_type = flag:stewardship }
				desc = regula_laamp_marriage_dispute_contract.0101.desc.resolution_type.stewardship
			}
			triggered_desc = {
				trigger = { scope:resolution_type = flag:skilled }
				desc = regula_laamp_marriage_dispute_contract.0101.desc.resolution_type.skilled
			}
			triggered_desc = {
				trigger = { scope:resolution_type = flag:stress }
				desc = regula_laamp_marriage_dispute_contract.0101.desc.resolution_type.stress
			}
		}
		desc = regula_laamp_marriage_dispute_contract.0101.desc.outro
	}
	theme = stewardship
	left_portrait = {
		character = root
		animation = personality_bold
	}
	right_portrait = {
		character = scope:employer
		animation = admiration
	}
	override_background = { reference = temple_scope }

	immediate = {
		regula_laamp_marriage_dispute_contract_standard_effect = yes
	}

	# Congratulations!
	option = {
		name = regula_laamp_marriage_dispute_contract.0101.a

		return_home = yes
	}
}

# Victory event - Recruitment
regula_laamp_marriage_dispute_contract.0102 = {
	type = character_event
	title = regula_laamp_marriage_dispute_contract.0102.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = { scope:resolution_type = flag:diplomacy}
				desc = regula_laamp_marriage_dispute_contract.0102.desc.resolution_type.diplomacy
			}
			triggered_desc = {
				trigger = { scope:resolution_type = flag:bribe }
				desc = regula_laamp_marriage_dispute_contract.0102.desc.resolution_type.bribe
			}
		}
		desc = regula_laamp_marriage_dispute_contract.0102.desc.outro
	}
	theme = stewardship
	left_portrait = {
		character = root
		animation = flirtation
	}
	right_portrait = {
		character = scope:bride
		animation = love
	}
	lower_center_portrait = scope:employer
	override_background = { reference = temple_scope }

	immediate = {
		regula_laamp_marriage_dispute_contract_recruitment_effect = yes
	}

	# Congratulations!
	option = {
		name = regula_laamp_marriage_dispute_contract.0102.a

		return_home = yes
	}
}

# Defeat event.
regula_laamp_marriage_dispute_contract.0103 = {
	type = character_event
	title = regula_laamp_marriage_dispute_contract.0103.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = { scope:resolution_type = flag:stewardship }
				desc = regula_laamp_marriage_dispute_contract.0103.desc.stewardship
			}
			triggered_desc = {
				trigger = { scope:resolution_type = flag:diplomacy}
				desc = regula_laamp_marriage_dispute_contract.0103.desc.diplomacy
			}
		}
		desc = regula_laamp_marriage_dispute_contract.0103.desc.outro
	}
	theme = stewardship
	left_portrait = {
		character = root
		animation = shame
	}
	right_portrait = {
		character = scope:groom
		animation = rage
	}
	lower_center_portrait = scope:employer
	override_background = { reference = temple_scope }

	immediate = {
		regula_laamp_marriage_dispute_contract_loss_effect = yes

		hidden_effect = {
			# Disappear the bride because no longer needed
			scope:bride = {
				death = {
					death_reason = death_disappearance
				}
			}
		}
	}

	# RIP.
	option = {
		name = regula_laamp_marriage_dispute_contract.0103.a

		return_home = yes
	}
}

################################################
# Bad Match -  Marriage Dispute
# 0110 - 0119
# The groom and bride have opposite personalties
# Diplomacy (Standard) | Learning (Recruitment) challenge
# Also can:
# 1. Pay prestige (based on bride quality) - Standard
# 2. Similar matching personality (Use player personality match) - Recruitment
# 3. Stress solve - Standard
################################################
regula_laamp_marriage_dispute_contract.0110 = {
	type = character_event
	title = regula_laamp_marriage_dispute_contract.0110.t
	desc = {
		desc = regula_laamp_marriage_dispute_contract.0110.desc
		first_valid = {
			triggered_desc = {
				trigger = {
					scope:bride_quality = flag:fantastic
				}
				desc = regula_laamp_marriage_dispute_contract.recruit_quality.fantastic
			}
			triggered_desc = {
				trigger = {
					scope:bride_quality = flag:great
				}
				desc = regula_laamp_marriage_dispute_contract.recruit_quality.great
			}
			triggered_desc = {
				trigger = {
					scope:bride_quality = flag:good
				}
				desc = regula_laamp_marriage_dispute_contract.recruit_quality.good
			}
			triggered_desc = {
				trigger = {
					scope:bride_quality = flag:okay
				}
				desc = regula_laamp_marriage_dispute_contract.recruit_quality.okay
			}
			triggered_desc = {
				trigger = {
					scope:bride_quality = flag:bad
				}
				desc = regula_laamp_marriage_dispute_contract.recruit_quality.bad
			}
		}
	}
	theme = diplomacy

	left_portrait = {
		character = scope:groom
		animation = stress
	}
	right_portrait = {
		character = scope:bride
		animation = eyeroll
	}
	lower_right_portrait = scope:employer

	override_background = { reference = temple_scope }

	immediate = {
		scope:employer = {
			save_scope_as = background_temple_scope
		}
		location = {
			save_scope_as = current_location
		}
		# Create the Bride and Groom as characters
		# Groom, find one from courtiers or guests
		regula_laamp_marriage_dispute_get_random_courtier_or_guest_groom_effect = yes

		# Bride
		regula_laamp_marriage_dispute_create_random_bride_effect = yes

		# Now make sure Bride has opposite personality to Groom
		# And set relationships
		hidden_effect = {
			scope:bride = {
				regula_add_opposite_personality_traits = {
					TARGET = scope:groom
				}
				create_betrothal = scope:groom
			}
		}
	}

	# Annul Marriage
	# Diplomacy auto-win - Standard
	option = {
		name = regula_laamp_marriage_dispute_contract.0110.diplomacy.auto_win
		trigger = { diplomacy >= @regula_laamp_marriage_dispute_contract_skill_threshold_value }
		skill = learning

		save_scope_value_as = {
			name = resolution_type
			value = flag:diplomacy
		}

		show_as_tooltip = { regula_laamp_marriage_dispute_contract_standard_effect = yes }
		trigger_event = regula_laamp_marriage_dispute_contract.0111

		ai_chance = {
			# If you can auto-win, do it.
			base = 10000
		}
	}

	# Diplomacy duel - Standard
	option = {
		name = regula_laamp_marriage_dispute_contract.0110.diplomacy.duel
		trigger = { diplomacy < @regula_laamp_marriage_dispute_contract_skill_threshold_value }

		save_scope_value_as = {
			name = resolution_type
			value = flag:diplomacy
		}

		duel = {
			skill = diplomacy
			value = decent_skill_rating
			# Victory!
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 5
					min = -49
				}
				min = 5
				desc = regula_laamp_marriage_dispute_contract.generic.duel.tt.success
				show_as_tooltip = { regula_laamp_marriage_dispute_contract_standard_effect = yes }
				trigger_event = regula_laamp_marriage_dispute_contract.0111
			}
			# Defeat.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -5
					min = -49
				}
				min = 5
				desc = regula_laamp_marriage_dispute_contract.generic.duel.tt.failure
				show_as_tooltip = { regula_laamp_marriage_dispute_contract_loss_effect = yes }
				trigger_event = regula_laamp_marriage_dispute_contract.0113
			}
		}

		ai_chance = {
			base = 1
			ai_value_modifier = { ai_energy = 2 }
		}
	}

	# Convince the locals that you should get the bride instead!
	# Learning auto-win - Recruitment
	option = {
		name = regula_laamp_marriage_dispute_contract.0110.learning.auto_win
		trigger = { learning >= @regula_laamp_marriage_dispute_contract_skill_threshold_high_value }
		skill = learning

		save_scope_value_as = {
			name = resolution_type
			value = flag:learning
		}

		show_as_tooltip = { regula_laamp_marriage_dispute_contract_recruitment_effect = yes }
		trigger_event = regula_laamp_marriage_dispute_contract.0112

		ai_chance = {
			# If you can auto-win, do it.
			base = 10000
		}
	}
	
	# Learning duel - Recruitment
	option = {
		name = regula_laamp_marriage_dispute_contract.0110.learning.duel
		trigger = { learning < @regula_laamp_marriage_dispute_contract_skill_threshold_high_value }

		save_scope_value_as = {
			name = resolution_type
			value = flag:learning
		}

		duel = {
			skill = learning
			value = high_skill_rating
			# Victory!
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 5
					min = -49
				}
				min = 5
				desc = regula_laamp_marriage_dispute_contract.generic.duel.tt.success
		
				show_as_tooltip = { regula_laamp_marriage_dispute_contract_recruitment_effect = yes }
				trigger_event = regula_laamp_marriage_dispute_contract.0112
			}
			# Defeat.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -5
					min = -49
				}
				min = 5
				desc = regula_laamp_marriage_dispute_contract.generic.duel.tt.failure

				show_as_tooltip = { regula_laamp_marriage_dispute_contract_loss_effect = yes }
				trigger_event = regula_laamp_marriage_dispute_contract.0113
			}
		}

		ai_chance = {
			base = 1
			ai_value_modifier = { ai_energy = 2 }
		}
	}

	# Prestige Bribe - Standard
	option = {
		name = regula_laamp_marriage_dispute_contract.0110.prestige
		trigger = { prestige >= scope:prestige_bribe }
		show_as_unavailable = {
			always = yes
		}

		# Should be a negative value
		add_prestige = scope:prestige_bribe

		save_scope_value_as = {
			name = resolution_type
			value = flag:prestige
		}

		show_as_tooltip = { regula_laamp_marriage_dispute_contract_standard_effect = yes }
		trigger_event = regula_laamp_marriage_dispute_contract.0111

		ai_chance = {
			base = 1
		}
	}

	# Similar Personality - Recruitment
	# At least two shared traits and no opposing traits
	option = {
		name = regula_laamp_marriage_dispute_contract.0110.personality
		trigger = { 
			number_of_personality_traits_in_common = {
				target = scope:bride
				value >= 2
			}
			number_of_opposing_personality_traits = {
				target = scope:bride
				value = 0
			}
		}

		save_scope_value_as = {
			name = resolution_type
			value = flag:personality
		}

		show_as_tooltip = { regula_laamp_marriage_dispute_contract_recruitment_effect = yes }
		trigger_event = regula_laamp_marriage_dispute_contract.0112

		ai_chance = {
			base = 1
		}
	}
	
	# Stress solve it.
	option = {
		name = regula_laamp_marriage_dispute_contract.0110.stress

		save_scope_value_as = {
			name = resolution_type
			value = flag:stress
		}

		show_as_tooltip = { regula_laamp_marriage_dispute_contract_standard_effect = yes }
		trigger_event = regula_laamp_marriage_dispute_contract.0111

		regula_laamp_marriage_dispute_contract_stress_fallback_option_effect = yes
		ai_chance = {
			# AI should try to take any other option.
			base = 0
		}
	}
}

# Victory event - Standard
regula_laamp_marriage_dispute_contract.0111 = {
	type = character_event
	title = regula_laamp_marriage_dispute_contract.0111.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = { scope:resolution_type = flag:diplomacy }
				desc = regula_laamp_marriage_dispute_contract.0111.desc.resolution_type.diplomacy
			}
			triggered_desc = {
				trigger = { scope:resolution_type = flag:prestige }
				desc = regula_laamp_marriage_dispute_contract.0111.desc.resolution_type.prestige
			}
			triggered_desc = {
				trigger = { scope:resolution_type = flag:stress }
				desc = regula_laamp_marriage_dispute_contract.0111.desc.resolution_type.stress
			}
		}
		desc = regula_laamp_marriage_dispute_contract.0111.desc.outro
	}
	theme = diplomacy
	left_portrait = {
		character = root
		animation = personality_bold
	}
	right_portrait = {
		character = scope:employer
		animation = admiration
	}
	override_background = { reference = temple_scope }

	immediate = {
		regula_laamp_marriage_dispute_contract_standard_effect = yes

		hidden_effect = {
			# Disappear the bride because no longer needed
			# And the assumption is that this marriage is now over
			scope:bride = {
				death = {
					death_reason = death_disappearance
				}
			}
		}
	}

	# Congratulations!
	option = {
		name = regula_laamp_marriage_dispute_contract.0111.a

		return_home = yes
	}
}

# Victory event - Recruitment
regula_laamp_marriage_dispute_contract.0112 = {
	type = character_event
	title = regula_laamp_marriage_dispute_contract.0112.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = { scope:resolution_type = flag:learning }
				desc = regula_laamp_marriage_dispute_contract.0112.desc.resolution_type.learning
			}
			triggered_desc = {
				trigger = { scope:resolution_type = flag:personality }
				desc = regula_laamp_marriage_dispute_contract.0112.desc.resolution_type.personality
			}
		}
		desc = regula_laamp_marriage_dispute_contract.0112.desc.outro
	}
	theme = learning
	left_portrait = {
		character = root
		animation = flirtation
	}
	right_portrait = {
		character = scope:bride
		animation = love
	}
	lower_center_portrait = scope:employer
	override_background = { reference = temple_scope }

	immediate = {
		regula_laamp_marriage_dispute_contract_recruitment_effect = yes
	}

	# Congratulations!
	option = {
		name = regula_laamp_marriage_dispute_contract.0112.a

		return_home = yes

		# No stress here.
		# Single option, so no AI chance.
	}
}

# Defeat event.
regula_laamp_marriage_dispute_contract.0113 = {
	type = character_event
	title = regula_laamp_marriage_dispute_contract.0113.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = { scope:resolution_type = flag:diplomacy }
				desc = regula_laamp_marriage_dispute_contract.0113.desc.diplomacy
			}
			triggered_desc = {
				trigger = { scope:resolution_type = flag:learning }
				desc = regula_laamp_marriage_dispute_contract.0113.desc.learning
			}
		}
		desc = regula_laamp_marriage_dispute_contract.0113.desc.outro
	}
	theme = learning
	left_portrait = {
		character = root
		animation = shame
	}
	right_portrait = {
		character = scope:employer
		animation = anger
	}
	lower_center_portrait = scope:groom
	override_background = { reference = temple_scope }

	immediate = {
		regula_laamp_marriage_dispute_contract_loss_effect = yes

		hidden_effect = {
			# Disappear the bride because no longer needed
			# Assume this is sorted out after we leave
			scope:bride = {
				death = {
					death_reason = death_disappearance
				}
			}
		}
	}

	# RIP.
	option = {
		name = regula_laamp_marriage_dispute_contract.0113.a

		return_home = yes
	}
}

################################################
# Witchcraft Accusation -  Marriage Dispute
# 0120 - 0129
# The bride has been accused of being a witch!
# Learning (Standard) | Martial (Recruitment) challenge
# Also can:
# 1. Use Camp priest to help - Standard
# 2. Use troops to help her escape - Recruitment
# 3. Stress solve - Standard
################################################
regula_laamp_marriage_dispute_contract.0120 = {
	type = character_event
	title = regula_laamp_marriage_dispute_contract.0120.t
	desc = {
		desc = regula_laamp_marriage_dispute_contract.0120.desc
	}
	theme = learning

	left_portrait = {
		character = root
		animation = worry
	}
	right_portrait = {
		character = scope:bride
		animation = prisondungeon
	}
	lower_right_portrait = scope:employer
	lower_left_portrait = {
		trigger = { exists = scope:camp_priest }
		character = scope:camp_priest
	}

	override_background = { reference = gallows }

	immediate = {
		location = {
			save_scope_as = current_location
		}
		# Create the "Witch"
		create_recruit_from_template_with_location = { SAVE_SCOPE = bride TEMPLATE = regula_generated_generic_witch_character LOCATION = scope:current_location }
		# Don't need a groom here

		# Got a supportive priest?
		court_position:camp_priest_camp_officer ?= {
			if = {
				limit = {
					is_available_allow_travelling = yes
					location = root.location
				}
				save_scope_as = camp_priest
			}
		}
	}

	# Convince the crowd she is innocent
	# Learning auto-win - Standard
	option = {
		name = regula_laamp_marriage_dispute_contract.0120.learning.auto_win
		trigger = { learning >= @regula_laamp_marriage_dispute_contract_skill_threshold_value }
		skill = learning

		save_scope_value_as = {
			name = resolution_type
			value = flag:learning
		}

		show_as_tooltip = { regula_laamp_marriage_dispute_contract_standard_effect = yes }
		trigger_event = regula_laamp_marriage_dispute_contract.0121

		ai_chance = {
			# If you can auto-win, do it.
			base = 10000
		}
	}

	# Learning duel - Standard
	option = {
		name = regula_laamp_marriage_dispute_contract.0120.learning.duel
		trigger = { learning < @regula_laamp_marriage_dispute_contract_skill_threshold_value }

		save_scope_value_as = {
			name = resolution_type
			value = flag:learning
		}

		duel = {
			skill = learning
			value = decent_skill_rating
			# Victory!
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 5
					min = -49
				}
				min = 5
				desc = regula_laamp_marriage_dispute_contract.0120.duel.tt.standard.success
				show_as_tooltip = { regula_laamp_marriage_dispute_contract_standard_effect = yes }
				trigger_event = regula_laamp_marriage_dispute_contract.0121
			}
			# Defeat.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -5
					min = -49
				}
				min = 5
				desc = regula_laamp_marriage_dispute_contract.0120.duel.tt.standard.failure
				show_as_tooltip = { 
					regula_laamp_marriage_dispute_contract_loss_effect = yes
					scope:bride = {
						death = {
							death_reason = death_burned_by_mob
						}
					}
				}
				trigger_event = regula_laamp_marriage_dispute_contract.0123
			}
		}

		ai_chance = {
			base = 1
			ai_value_modifier = { ai_energy = 2 }
		}
	}

	# Martial auto-win - Recruitment
	option = {
		name = regula_laamp_marriage_dispute_contract.0120.martial.auto_win
		trigger = { martial >= @regula_laamp_marriage_dispute_contract_skill_threshold_value }
		skill = martial

		save_scope_value_as = {
			name = resolution_type
			value = flag:martial
		}

		show_as_tooltip = { regula_laamp_marriage_dispute_contract_recruitment_effect = yes }
		trigger_event = regula_laamp_marriage_dispute_contract.0122

		ai_chance = {
			# If you can auto-win, do it.
			base = 10000
		}
	}

	# Martial duel - Recruitment
	option = {
		name = regula_laamp_marriage_dispute_contract.0120.martial.duel
		trigger = { martial < @regula_laamp_marriage_dispute_contract_skill_threshold_value }

		save_scope_value_as = {
			name = resolution_type
			value = flag:martial
		}

		duel = {
			skill = martial
			value = decent_skill_rating
			# Victory!
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 5
					min = -49
				}
				min = 5
				desc = regula_laamp_marriage_dispute_contract.0120.duel.tt.recruitment.success
				show_as_tooltip = { regula_laamp_marriage_dispute_contract_recruitment_effect = yes }
				trigger_event = regula_laamp_marriage_dispute_contract.0122
			}
			# Defeat.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -5
					min = -49
				}
				min = 5
				desc = regula_laamp_marriage_dispute_contract.0120.duel.tt.recruitment.failure
				show_as_tooltip = {
					regula_laamp_marriage_dispute_contract_loss_effect = yes
					scope:bride = {
						death = {
							death_reason = death_burned_by_mob
						}
					}
				}
				trigger_event = regula_laamp_marriage_dispute_contract.0123
			}
		}

		ai_chance = {
			base = 1
			ai_value_modifier = { ai_energy = 2 }
		}
	}

	# Camp Priest - Standard
	option = {
		name = regula_laamp_marriage_dispute_contract.0120.priest
		trigger = { exists = scope:camp_priest }
		reason = have_camp_priest

		save_scope_value_as = {
			name = resolution_type
			value = flag:priest
		}

		random_list = {
			0 = {
				modifier = {
					add = {
						scope:camp_priest ?= { add = "aptitude(camp_priest_camp_officer)" }
						multiply = 20
					}
					always = yes
				}

				# Victory!
				desc = regula_laamp_marriage_dispute_contract.0120.duel.tt.standard.success
				show_as_tooltip = { regula_laamp_marriage_dispute_contract_standard_effect = yes }
				trigger_event = regula_laamp_marriage_dispute_contract.0121

				# Camp priest gains
				scope:camp_priest = {
					if = {
						limit = { has_lifestyle = learning_lifestyle }
						add_learning_lifestyle_xp = medium_lifestyle_xp
					}
					else = {
						add_piety = miniscule_piety_gain
					}
				}
			}
			15 = {
				# Defeat
				desc = regula_laamp_marriage_dispute_contract.0120.duel.tt.standard.failure
				show_as_tooltip = { 
					regula_laamp_marriage_dispute_contract_loss_effect = yes
					scope:bride = {
						death = {
							death_reason = death_burned_by_mob
						}
					}
				}
				trigger_event = regula_laamp_marriage_dispute_contract.0123
			}
		}

		# The AI always plays it risky.
		ai_chance = { base = 0 }
	}

	# Use Troops - Recruitment
	option = {
		name = regula_laamp_marriage_dispute_contract.0120.army

		trigger = {
			current_military_strength >= 750
		}
		show_as_unavailable = {
			always = yes
		}

		save_scope_value_as = {
			name = resolution_type
			value = flag:army
		}

		show_as_tooltip = { regula_laamp_marriage_dispute_contract_recruitment_effect = yes }
		trigger_event = regula_laamp_marriage_dispute_contract.0122

		ai_chance = {
			# If you can auto-win, do it.
			base = 10000
		}
	}
	
	# Stress solve it.
	option = {
		name = regula_laamp_marriage_dispute_contract.0120.stress

		save_scope_value_as = {
			name = resolution_type
			value = flag:stress
		}

		show_as_tooltip = { regula_laamp_marriage_dispute_contract_standard_effect = yes }
		trigger_event = regula_laamp_marriage_dispute_contract.0121

		regula_laamp_marriage_dispute_contract_stress_fallback_option_effect = yes
		ai_chance = {
			# AI should try to take any other option.
			base = 0
		}
	}
}

# Victory event - Standard
regula_laamp_marriage_dispute_contract.0121 = {
	type = character_event
	title = regula_laamp_marriage_dispute_contract.0121.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = { scope:resolution_type = flag:learning }
				desc = regula_laamp_marriage_dispute_contract.0121.desc.resolution_type.learning
			}
			triggered_desc = {
				trigger = { scope:resolution_type = flag:priest }
				desc = regula_laamp_marriage_dispute_contract.0121.desc.resolution_type.priest
			}
			triggered_desc = {
				trigger = { scope:resolution_type = flag:stress }
				desc = regula_laamp_marriage_dispute_contract.0121.desc.resolution_type.stress
			}
		}
		desc = regula_laamp_marriage_dispute_contract.0121.desc.outro
	}
	theme = learning
	left_portrait = {
		character = root
		animation = personality_bold
	}
	right_portrait = {
		character = scope:employer
		animation = admiration
	}
	lower_center_portrait = {
		trigger = { scope:resolution_type = flag:priest }
		character = scope:camp_priest
	}
	override_background = { reference = temple }

	immediate = {
		regula_laamp_marriage_dispute_contract_standard_effect = yes

		hidden_effect = {
			# Disappear the bride because no longer needed
			scope:bride = {
				death = {
					death_reason = death_disappearance
				}
			}
		}
	}

	# Congratulations!
	option = {
		name = regula_laamp_marriage_dispute_contract.0121.a

		return_home = yes

		# No stress here.
		# Single option, so no AI chance.
	}
}

# Victory event - Recruitment
regula_laamp_marriage_dispute_contract.0122 = {
	type = character_event
	title = regula_laamp_marriage_dispute_contract.0122.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = { scope:resolution_type = flag:martial }
				desc = regula_laamp_marriage_dispute_contract.0122.desc.resolution_type.martial
			}
			triggered_desc = {
				trigger = { scope:resolution_type = flag:army }
				desc = regula_laamp_marriage_dispute_contract.0122.desc.resolution_type.army
			}
		}
		desc = regula_laamp_marriage_dispute_contract.0122.desc.outro
	}
	theme = learning
	left_portrait = {
		character = root
		animation = flirtation
	}
	right_portrait = {
		character = scope:bride
		animation = love
	}
	lower_center_portrait = scope:employer
	override_background = { reference = wilderness }

	immediate = {
		regula_laamp_marriage_dispute_contract_recruitment_effect = yes
	}

	# Congratulations!
	option = {
		name = regula_laamp_marriage_dispute_contract.0122.a

		return_home = yes
	}
}

# Defeat event.
regula_laamp_marriage_dispute_contract.0123 = {
	type = character_event
	title = regula_laamp_marriage_dispute_contract.0123.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = { scope:resolution_type = flag:learning }
				desc = regula_laamp_marriage_dispute_contract.0123.desc.learning
			}
			triggered_desc = {
				trigger = { scope:resolution_type = flag:martial }
				desc = regula_laamp_marriage_dispute_contract.0123.desc.martial
			}
			triggered_desc = {
				trigger = { scope:resolution_type = flag:priest }
				desc = regula_laamp_marriage_dispute_contract.0123.desc.priest
			}
		}
		desc = regula_laamp_marriage_dispute_contract.0123.desc.outro
	}
	theme = learning
	left_portrait = {
		character = root
		animation = shame
	}
	right_portrait = {
		character = scope:bride
		animation = dead
	}
	lower_left_portrait = {
		trigger = { scope:resolution_type = flag:priest }
		character = scope:camp_priest
	}
	override_background = { reference = bp1_bonfire }

	immediate = {
		regula_laamp_marriage_dispute_contract_loss_effect = yes

		# Show this for flavour
		scope:bride = {
			death = {
				death_reason = death_burned_by_mob
			}
		}
	}

	# RIP.
	option = {
		name = regula_laamp_marriage_dispute_contract.0123.a

		return_home = yes
	}
}

################################################
# Trial by Combat -  Marriage Dispute
# 0130 - 0139
# The bride is a Shieldmaiden/warrior
# Challenges men to combat for the right to marry her
# Has an extra recruitment option using the impress with traits
# Diplomacy (Standard) | Intrigue (Recruitment) challenge
# Also can:
# 1. Impress her with commander traits / scars / martial education - Recruitment
# 2. Duel - Recruitment
# 3. Stress solve - Standard
################################################
regula_laamp_marriage_dispute_contract.0130 = {
	type = character_event
	title = regula_laamp_marriage_dispute_contract.0130.t
	desc = {
		desc = regula_laamp_marriage_dispute_contract.0130.desc
	}
	theme = diplomacy
	left_portrait = {
		character = root
		animation = admiration
	}
	right_portrait = {
		character = scope:bride
		animation = hero_flex
	}
	lower_right_portrait = scope:employer

	override_background = { reference = contest_bg_melee }

	immediate = {
		location = {
			save_scope_as = current_location
		}

		random_list = {
			# Fantastic
			0 = {
				modifier = { scope:employer.highest_held_title_tier = tier_county 	add = 5 }
				modifier = { scope:employer.highest_held_title_tier = tier_duchy 	add = 15 }
				modifier = { scope:employer.highest_held_title_tier = tier_kingdom 	add = 30 }
				modifier = { scope:employer.highest_held_title_tier = tier_empire 	add = 50 }
				save_scope_value_as = {
					name = bride_quality
					value = flag:fantastic
				}
				create_recruit_from_template_with_location = { SAVE_SCOPE = bride TEMPLATE = regula_initiate_solider_royal_character LOCATION = scope:current_location } 
			}

			# Great
			0 = {
				modifier = { scope:employer.highest_held_title_tier = tier_county 	add = 25 }
				modifier = { scope:employer.highest_held_title_tier = tier_duchy 	add = 35 }
				modifier = { scope:employer.highest_held_title_tier = tier_kingdom 	add = 45 }
				modifier = { scope:employer.highest_held_title_tier = tier_empire 	add = 50 }
				save_scope_value_as = {
					name = bride_quality
					value = flag:great
				}
				random_list = {
					5 = { create_recruit_from_template_with_location = { SAVE_SCOPE = bride TEMPLATE = regula_initiate_solider_noble_character LOCATION = scope:current_location } }
					5 = { create_recruit_from_template_with_location = { SAVE_SCOPE = bride TEMPLATE = regula_cultist_warrior_character LOCATION = scope:current_location } }
					5 = { create_recruit_from_template_with_location = { SAVE_SCOPE = bride TEMPLATE = regula_generated_castle_knight_character LOCATION = scope:current_location } }
					5 = { create_recruit_from_template_with_location = { SAVE_SCOPE = bride TEMPLATE = regula_champion_giant_character LOCATION = scope:current_location } }
				}
			}

			# Good/Okay
			0 = {
				modifier = { scope:employer.highest_held_title_tier = tier_county 	add = 70 }
				modifier = { scope:employer.highest_held_title_tier = tier_duchy 	add = 50 }
				modifier = { scope:employer.highest_held_title_tier = tier_kingdom 	add = 25 }
				save_scope_value_as = {
					name = bride_quality
					value = flag:good
				}
				random_list = {
					5 = { create_recruit_from_template_with_location = { SAVE_SCOPE = bride TEMPLATE = regula_initiate_solider_common_character LOCATION = scope:current_location } }
					5 = { create_recruit_from_template_with_location = { SAVE_SCOPE = bride TEMPLATE = regula_generated_city_guard_character LOCATION = scope:current_location } }
					5 = { create_recruit_from_template_with_location = { SAVE_SCOPE = bride TEMPLATE = regula_generated_generic_farmgirl_character LOCATION = scope:current_location } }
					5 = { create_recruit_from_template_with_location = { SAVE_SCOPE = bride TEMPLATE = regula_generated_tribal_feisty_character LOCATION = scope:current_location } }
				}
			}
		}

		hidden_effect = {
			scope:bride = {
				add_trait = shieldmaiden
			}
		}
	}

	# Diplomacy - Standard
	# Talk her down
	# Automatic win
	option = {
		name = regula_laamp_marriage_dispute_contract.0130.diplomacy.auto_win
		trigger = { diplomacy >= @regula_laamp_marriage_dispute_contract_skill_threshold_value }
		skill = diplomacy

		save_scope_value_as = {
			name = resolution_type
			value = flag:diplomacy
		}

		show_as_tooltip = { regula_laamp_marriage_dispute_contract_standard_effect = yes }
		trigger_event = regula_laamp_marriage_dispute_contract.0131

		ai_chance = {
			# If you can auto-win, do it.
			base = 10000
		}
	}

	# Duel
	option = {
		name = regula_laamp_marriage_dispute_contract.0130.diplomacy.duel
		trigger = { diplomacy < @regula_laamp_marriage_dispute_contract_skill_threshold_value }

		save_scope_value_as = {
			name = resolution_type
			value = flag:diplomacy
		}

		duel = {
			skill = diplomacy
			value = decent_skill_rating
			# Victory!
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 5
					min = -49
				}
				min = 5
				desc = regula_laamp_marriage_dispute_contract.generic.duel.tt.success
				show_as_tooltip = { regula_laamp_marriage_dispute_contract_standard_effect = yes }
				trigger_event = regula_laamp_marriage_dispute_contract.0131
			}
			# Defeat.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -5
					min = -49
				}
				min = 5
				desc = regula_laamp_marriage_dispute_contract.generic.duel.tt.failure
				show_as_tooltip = { regula_laamp_marriage_dispute_contract_loss_effect = yes }
				trigger_event = regula_laamp_marriage_dispute_contract.0133
			}
		}

		ai_chance = {
			base = 1
			ai_value_modifier = { ai_energy = 2 }
		}
	}

	# Intrigue - Recruitment
	# Seduce her into becoming a follower
	# Automatic win
	option = {
		name = regula_laamp_marriage_dispute_contract.0130.intrigue.auto_win
		trigger = { intrigue >= @regula_laamp_marriage_dispute_contract_skill_threshold_value }
		skill = intrigue

		save_scope_value_as = {
			name = resolution_type
			value = flag:intrigue
		}

		show_as_tooltip = { regula_laamp_marriage_dispute_contract_recruitment_effect = yes }
		trigger_event = regula_laamp_marriage_dispute_contract.0132

		ai_chance = {
			# If you can auto-win, do it.
			base = 10000
		}
	}

	# Duel
	option = {
		name = regula_laamp_marriage_dispute_contract.0130.intrigue.duel
		trigger = { intrigue < @regula_laamp_marriage_dispute_contract_skill_threshold_value }

		save_scope_value_as = {
			name = resolution_type
			value = flag:intrigue
		}

		duel = {
			skill = intrigue
			value = decent_skill_rating
			# Victory!
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 5
					min = -49
				}
				min = 5
				desc = regula_laamp_marriage_dispute_contract.generic.duel.tt.success
				show_as_tooltip = { regula_laamp_marriage_dispute_contract_recruitment_effect = yes }
				trigger_event = regula_laamp_marriage_dispute_contract.0132
			}
			# Defeat.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -5
					min = -49
				}
				min = 5
				desc = regula_laamp_marriage_dispute_contract.generic.duel.tt.failure
				show_as_tooltip = { regula_laamp_marriage_dispute_contract_loss_effect = yes }
				trigger_event = regula_laamp_marriage_dispute_contract.0133
			}
		}

		ai_chance = {
			base = 1
			ai_value_modifier = { ai_energy = 2 }
		}
	}

	# Impress with traits - Recruitment
	option = {
		name = regula_laamp_marriage_dispute_contract.0130.impress

		trigger = {
			OR = {
				number_of_commander_traits >= 2
				has_trait = scarred
				has_trait = strong
				has_trait = physique_good_3
				has_trait = lifestyle_blademaster
				has_trait = gallant
				has_trait = greatest_of_khans
				has_trait = conqueror
				has_trait = reaver
				has_trait = shieldmaiden
			}
		}

		# To show them to player
		trait = scarred
		trait = strong
		trait = physique_good_3
		trait = lifestyle_blademaster
		trait = gallant
		trait = greatest_of_khans
		trait = conqueror
		trait = reaver
		trait = shieldmaiden


		save_scope_value_as = {
			name = resolution_type
			value = flag:impress
		}

		show_as_tooltip = { regula_laamp_marriage_dispute_contract_recruitment_effect = yes }
		trigger_event = regula_laamp_marriage_dispute_contract.0132

		ai_chance = {
			# AI should try to take any other option.
			base = 0
		}
	}

	# An actual duel (non-lethal fight) - Recruitment
	option = {
		name = regula_laamp_marriage_dispute_contract.0130.duel


		save_scope_value_as = {
			name = resolution_type
			value = flag:duel
		}

		configure_start_single_combat_effect = {
			SC_INITIATOR = root
			SC_ATTACKER = root
			SC_DEFENDER = scope:bride
			FATALITY = no
			FIXED = no
			LOCALE = terrain_scope
			OUTPUT_EVENT = regula_laamp_marriage_dispute_contract.0134
			INVALIDATION_EVENT = fp1_tbc.0102
		}

		show_as_tooltip = { regula_laamp_marriage_dispute_contract_recruitment_effect = yes }

		ai_chance = {
			# AI should try to take any other option.
			base = 0
		}
	}

	# Stress solve it - Standard
	option = {
		name = regula_laamp_marriage_dispute_contract.0130.stress

		save_scope_value_as = {
			name = resolution_type
			value = flag:stress
		}

		show_as_tooltip = { regula_laamp_marriage_dispute_contract_standard_effect = yes }
		trigger_event = regula_laamp_marriage_dispute_contract.0131

		regula_laamp_marriage_dispute_contract_stress_fallback_option_effect = yes
		ai_chance = {
			# AI should try to take any other option.
			base = 0
		}
	}
}

# Victory event - Standard
regula_laamp_marriage_dispute_contract.0131 = {
	type = character_event
	title = regula_laamp_marriage_dispute_contract.0131.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = { scope:resolution_type = flag:diplomacy }
				desc = regula_laamp_marriage_dispute_contract.0131.desc.resolution_type.diplomacy
			}
			triggered_desc = {
				trigger = { scope:resolution_type = flag:stress }
				desc = regula_laamp_marriage_dispute_contract.0131.desc.resolution_type.stress
			}
		}
		desc = regula_laamp_marriage_dispute_contract.0131.desc.outro
	}
	theme = diplomacy
	left_portrait = {
		character = root
		animation = personality_bold
	}
	right_portrait = {
		character = scope:employer
		animation = admiration
	}
	override_background = { reference = contest_bg_melee }

	immediate = {
		regula_laamp_marriage_dispute_contract_standard_effect = yes

		hidden_effect = {
			# Disappear the bride because no longer needed
			scope:bride = {
				death = {
					death_reason = death_disappearance
				}
			}
		}
	}

	# Congratulations!
	option = {
		name = regula_laamp_marriage_dispute_contract.0131.a

		return_home = yes
	}
}

# Victory event - Recruitment
regula_laamp_marriage_dispute_contract.0132 = {
	type = character_event
	title = regula_laamp_marriage_dispute_contract.0132.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = { scope:resolution_type = flag:intrigue }
				desc = regula_laamp_marriage_dispute_contract.0132.desc.resolution_type.intrigue
			}
			triggered_desc = {
				trigger = { scope:resolution_type = flag:impress }
				desc = regula_laamp_marriage_dispute_contract.0132.desc.resolution_type.impress
			}
			triggered_desc = {
				trigger = { scope:resolution_type = flag:duel }
				desc = regula_laamp_marriage_dispute_contract.0132.desc.resolution_type.duel
			}
		}
		desc = regula_laamp_marriage_dispute_contract.0132.desc.outro
	}
	theme = learning
	left_portrait = {
		character = root
		animation = flirtation
	}
	right_portrait = {
		character = scope:bride
		animation = love
	}
	lower_center_portrait = scope:employer
	override_background = { reference = contest_bg_melee }

	immediate = {
		regula_laamp_marriage_dispute_contract_recruitment_effect = yes
	}

	# Congratulations!
	option = {
		name = regula_laamp_marriage_dispute_contract.0132.a

		return_home = yes
	}
}

# Defeat event.
regula_laamp_marriage_dispute_contract.0133 = {
	type = character_event
	title = regula_laamp_marriage_dispute_contract.0133.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = { scope:resolution_type = flag:diplomacy }
				desc = regula_laamp_marriage_dispute_contract.0133.desc.diplomacy
			}
		}
		desc = regula_laamp_marriage_dispute_contract.0133.desc.outro
	}
	theme = learning
	left_portrait = {
		character = root
		animation = worry
	}
	right_portrait = {
		character = scope:employer
		animation = anger
	}
	lower_center_portrait = scope:groom
	override_background = { reference = contest_bg_melee }

	immediate = {
		regula_laamp_marriage_dispute_contract_loss_effect = yes
	}

	# RIP.
	option = {
		name = regula_laamp_marriage_dispute_contract.0133.a

		return_home = yes
	}

	after = {
		hidden_effect = {
			# Disappear the bride because no longer needed
			scope:bride = {
				death = {
					death_reason = death_disappearance
				}
			}
		}
	}
}

# Duel event
regula_laamp_marriage_dispute_contract.0134 = {
	hidden = yes

	immediate = {		
		# Check who won and send to victory/defeat event
		if = {
			limit = {
				# This means the player won
				scope:sc_victor = scope:sc_initiator
			}
			scope:sc_victor = {
				trigger_event = regula_laamp_marriage_dispute_contract.0132
			}
		}
		else = {
			scope:sc_initiator = {
				trigger_event = regula_laamp_marriage_dispute_contract.0133
			}
		}
	}
}

################################################
# Forced Marriage -  Marriage Dispute
# 0140 - 0149
# The bride was kidnapped to be here, causes an uproar
# Manage the guests or sneak her away
# Martial (Standard) | Intrigue (Recruitment) challenge
# Also can:
# 1. Diplomacy Duel against groom - Standard
# 2. Bribe guards - Recruitment
# 3. Stress solve - Standard
################################################
regula_laamp_marriage_dispute_contract.0140 = {
	type = character_event
	title = regula_laamp_marriage_dispute_contract.0140.t
	desc = {
		desc = regula_laamp_marriage_dispute_contract.0140.desc
				first_valid = {
			triggered_desc = {
				trigger = {
					scope:bride_quality = flag:fantastic
				}
				desc = regula_laamp_marriage_dispute_contract.recruit_quality.fantastic
			}
			triggered_desc = {
				trigger = {
					scope:bride_quality = flag:great
				}
				desc = regula_laamp_marriage_dispute_contract.recruit_quality.great
			}
			triggered_desc = {
				trigger = {
					scope:bride_quality = flag:good
				}
				desc = regula_laamp_marriage_dispute_contract.recruit_quality.good
			}
			triggered_desc = {
				trigger = {
					scope:bride_quality = flag:okay
				}
				desc = regula_laamp_marriage_dispute_contract.recruit_quality.okay
			}
			triggered_desc = {
				trigger = {
					scope:bride_quality = flag:bad
				}
				desc = regula_laamp_marriage_dispute_contract.recruit_quality.bad
			}
		}
	}
	theme = intrigue
	left_portrait = {
		character = root
		animation = worry
	}
	right_portrait = {
		character = scope:bride
		animation = beg
	}
	lower_right_portrait = scope:employer

	override_background = { reference = temple_scope }

	immediate = {
		scope:employer = {
			save_scope_as = background_temple_scope
		}
		location = {
			save_scope_as = current_location
		}
		# Create the Bride & find a Groom
		# Bride
		regula_laamp_marriage_dispute_create_random_bride_effect = yes

		# Groom, find one from courtiers or guests
		regula_laamp_marriage_dispute_get_random_courtier_or_guest_groom_effect = yes

		# Set "bribe" cost
		bride_set_cost_effect = { CHARACTER = scope:bride VALUE_NAME = bribe }
		set_variable = {
			name = bribeVal
			value = scope:bribe
		}

		# Divide by 2 to make a bit cheaper
		change_variable = {
			name = bribeVal
			divide = 2
		}

		# Set relationships
		hidden_effect = {
			scope:bride = {
				create_betrothal = scope:groom
			}
		}
	}

	# Keep her safe
	# Martial auto-win - Standard
	option = {
		name = regula_laamp_marriage_dispute_contract.0140.martial.auto_win
		trigger = { martial >= @regula_laamp_marriage_dispute_contract_skill_threshold_value }
		skill = martial

		save_scope_value_as = {
			name = resolution_type
			value = flag:martial
		}

		show_as_tooltip = { regula_laamp_marriage_dispute_contract_standard_effect = yes }
		trigger_event = regula_laamp_marriage_dispute_contract.0121

		ai_chance = {
			# If you can auto-win, do it.
			base = 10000
		}
	}

	# Martial duel - Standard
	option = {
		name = regula_laamp_marriage_dispute_contract.0140.martial.duel
		trigger = { martial < @regula_laamp_marriage_dispute_contract_skill_threshold_value }

		save_scope_value_as = {
			name = resolution_type
			value = flag:martial
		}

		duel = {
			skill = martial
			value = decent_skill_rating
			# Victory!
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 5
					min = -49
				}
				min = 5
				desc = regula_laamp_marriage_dispute_contract.generic.duel.tt.success
				show_as_tooltip = { regula_laamp_marriage_dispute_contract_standard_effect = yes }
				trigger_event = regula_laamp_marriage_dispute_contract.0141
			}
			# Defeat.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -5
					min = -49
				}
				min = 5
				desc = regula_laamp_marriage_dispute_contract.generic.duel.tt.failure
				show_as_tooltip = { regula_laamp_marriage_dispute_contract_loss_effect = yes }
				trigger_event = regula_laamp_marriage_dispute_contract.0143
			}
		}

		ai_chance = {
			base = 1
			ai_value_modifier = { ai_energy = 2 }
		}
	}

	# Escape with her
	# Intrigue auto-win - Recruitment
	option = {
		name = regula_laamp_marriage_dispute_contract.0140.intrigue.auto_win
		trigger = { intrigue >= @regula_laamp_marriage_dispute_contract_skill_threshold_high_value }
		skill = intrigue

		save_scope_value_as = {
			name = resolution_type
			value = flag:intrigue
		}

		show_as_tooltip = { regula_laamp_marriage_dispute_contract_recruitment_effect = yes }
		trigger_event = regula_laamp_marriage_dispute_contract.0142

		ai_chance = {
			# If you can auto-win, do it.
			base = 10000
		}
	}
	
	# Intrigue duel - Recruitment
	option = {
		name = regula_laamp_marriage_dispute_contract.0140.intrigue.duel
		trigger = { intrigue < @regula_laamp_marriage_dispute_contract_skill_threshold_high_value }

		save_scope_value_as = {
			name = resolution_type
			value = flag:intrigue
		}

		duel = {
			skill = intrigue
			value = high_skill_rating
			# Victory!
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 5
					min = -49
				}
				min = 5
				desc = regula_laamp_marriage_dispute_contract.generic.duel.tt.success
		
				show_as_tooltip = { regula_laamp_marriage_dispute_contract_recruitment_effect = yes }
				trigger_event = regula_laamp_marriage_dispute_contract.0142
			}
			# Defeat.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -5
					min = -49
				}
				min = 5
				desc = regula_laamp_marriage_dispute_contract.generic.duel.tt.failure

				show_as_tooltip = { regula_laamp_marriage_dispute_contract_loss_effect = yes }
				trigger_event = regula_laamp_marriage_dispute_contract.0143
			}
		}

		ai_chance = {
			base = 1
			ai_value_modifier = { ai_energy = 2 }
		}
	}

	# Diplomacy duel against groom - Standard
	option = {
		name = regula_laamp_marriage_dispute_contract.0140.diplomacy

		save_scope_value_as = {
			name = resolution_type
			value = flag:diplomacy
		}

		duel = {
			skill = diplomacy
			value = scope:groom.diplomacy
			# Victory!
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 5
					min = -49
				}
				min = 5
				desc = regula_laamp_marriage_dispute_contract.generic.duel.tt.success
		
				show_as_tooltip = { regula_laamp_marriage_dispute_contract_standard_effect = yes }
				trigger_event = regula_laamp_marriage_dispute_contract.0141
			}
			# Defeat.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -5
					min = -49
				}
				min = 5
				desc = regula_laamp_marriage_dispute_contract.generic.duel.tt.failure

				show_as_tooltip = { regula_laamp_marriage_dispute_contract_loss_effect = yes }
				trigger_event = regula_laamp_marriage_dispute_contract.0143
			}
		}

		ai_chance = {
			base = 1
			ai_value_modifier = { ai_energy = 2 }
		}
	}

	# Bribe Guards - Recruitment
	option = {
		name = regula_laamp_marriage_dispute_contract.0140.bribe
		trigger = { gold >= var:bribeVal }
		show_as_unavailable = {
			always = yes
		}

		remove_short_term_gold = var:bribeVal

		save_scope_value_as = {
			name = resolution_type
			value = flag:bribe
		}

		show_as_tooltip = { regula_laamp_marriage_dispute_contract_recruitment_effect = yes }
		trigger_event = regula_laamp_marriage_dispute_contract.0142

		ai_chance = {
			base = 1
		}
	}

	# Stress solve it - Standard
	option = {
		name = regula_laamp_marriage_dispute_contract.0140.stress

		save_scope_value_as = {
			name = resolution_type
			value = flag:stress
		}

		show_as_tooltip = { regula_laamp_marriage_dispute_contract_standard_effect = yes }
		trigger_event = regula_laamp_marriage_dispute_contract.0141

		regula_laamp_marriage_dispute_contract_stress_fallback_option_effect = yes
		ai_chance = {
			# AI should try to take any other option.
			base = 0
		}
	}
}

# Victory event - Standard
regula_laamp_marriage_dispute_contract.0141 = {
	type = character_event
	title = regula_laamp_marriage_dispute_contract.0141.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = { scope:resolution_type = flag:martial }
				desc = regula_laamp_marriage_dispute_contract.0141.desc.resolution_type.martial
			}
			triggered_desc = {
				trigger = { scope:resolution_type = flag:stress }
				desc = regula_laamp_marriage_dispute_contract.0141.desc.resolution_type.stress
			}
		}
		desc = regula_laamp_marriage_dispute_contract.0141.desc.outro
	}
	theme = learning
	left_portrait = {
		character = root
		animation = personality_bold
	}
	right_portrait = {
		character = scope:employer
		animation = admiration
	}
	override_background = { reference = temple }

	immediate = {
		regula_laamp_marriage_dispute_contract_standard_effect = yes

		hidden_effect = {
			# Disappear the bride because no longer needed
			scope:bride = {
				death = {
					death_reason = death_disappearance
				}
			}
		}
	}

	# Congratulations!
	option = {
		name = regula_laamp_marriage_dispute_contract.0141.a

		return_home = yes
	}
}

# Victory event - Recruitment
regula_laamp_marriage_dispute_contract.0142 = {
	type = character_event
	title = regula_laamp_marriage_dispute_contract.0142.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = { scope:resolution_type = flag:intrigue }
				desc = regula_laamp_marriage_dispute_contract.0142.desc.resolution_type.intrigue
			}
			triggered_desc = {
				trigger = { scope:resolution_type = flag:bribe }
				desc = regula_laamp_marriage_dispute_contract.0142.desc.resolution_type.bribe
			}
		}
		desc = regula_laamp_marriage_dispute_contract.0142.desc.outro
	}
	theme = intrigue
	left_portrait = {
		character = root
		animation = flirtation
	}
	right_portrait = {
		character = scope:bride
		animation = admiration
	}
	lower_center_portrait = scope:employer
	override_background = { reference = temple }

	immediate = {
		regula_laamp_marriage_dispute_contract_recruitment_effect = yes
	}

	# Congratulations!
	option = {
		name = regula_laamp_marriage_dispute_contract.0142.a

		return_home = yes
	}
}

# Defeat event.
regula_laamp_marriage_dispute_contract.0143 = {
	type = character_event
	title = regula_laamp_marriage_dispute_contract.0113.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = { scope:resolution_type = flag:learning }
				desc = regula_laamp_marriage_dispute_contract.0113.desc.learning
			}
		}
		desc = regula_laamp_marriage_dispute_contract.0113.desc.outro
	}
	theme = learning
	left_portrait = {
		character = root
		animation = worry
	}
	right_portrait = {
		character = scope:employer
		animation = anger
	}
	lower_center_portrait = scope:groom
	override_background = { reference = temple }

	immediate = {
		regula_laamp_marriage_dispute_contract_loss_effect = yes

		hidden_effect = {
			# Disappear the bride because no longer needed
			scope:bride = {
				death = {
					death_reason = death_disappearance
				}
			}
		}
	}

	# RIP.
	option = {
		name = regula_laamp_marriage_dispute_contract.0113.a

		return_home = yes
	}
}

################################################
# Runaway Bride -  Marriage Dispute
# 0150 - 0159
# Help search for bride:
# Stewardship (Standard) | Intrigue (Recruitment) challenge
# Also can:
# 1. Have 1000 troops and decent martial or stewardship - Standard
# 2. Have enough hunt / travel experience (aka tracking) - Recruitment
# 3. Stress solve - Standard
################################################
regula_laamp_marriage_dispute_contract.0150 = {
	type = character_event
	title = regula_laamp_marriage_dispute_contract.0150.t
	desc = {
		desc = regula_laamp_marriage_dispute_contract.0150.desc
		first_valid = {
			triggered_desc = {
				trigger = {
					scope:bride_quality = flag:fantastic
				}
				desc = regula_laamp_marriage_dispute_contract.recruit_quality.fantastic
			}
			triggered_desc = {
				trigger = {
					scope:bride_quality = flag:great
				}
				desc = regula_laamp_marriage_dispute_contract.recruit_quality.great
			}
			triggered_desc = {
				trigger = {
					scope:bride_quality = flag:good
				}
				desc = regula_laamp_marriage_dispute_contract.recruit_quality.good
			}
			triggered_desc = {
				trigger = {
					scope:bride_quality = flag:okay
				}
				desc = regula_laamp_marriage_dispute_contract.recruit_quality.okay
			}
			triggered_desc = {
				trigger = {
					scope:bride_quality = flag:bad
				}
				desc = regula_laamp_marriage_dispute_contract.recruit_quality.bad
			}
		}
	}
	theme = stewardship
	left_portrait = {
		character = root
		animation = worry
	}
	right_portrait = {
		character = scope:groom
		animation = shame
	}
	lower_right_portrait = scope:employer
	lower_left_portrait = scope:bride

	override_background = { reference = temple_scope }

	immediate = {
		scope:employer = {
			save_scope_as = background_temple_scope
		}
		location = {
			save_scope_as = current_location
		}
		# Create the Bride & find a Groom
		# Bride
		regula_laamp_marriage_dispute_create_random_bride_effect = yes

		# Groom, find one from courtiers or guests
		regula_laamp_marriage_dispute_get_random_courtier_or_guest_groom_effect = yes

		# Set relationships
		hidden_effect = {
			scope:bride = {
				create_betrothal = scope:groom
				set_relation_rival = scope:groom
			}
		}
	}

	# Find Bride
	# Steward auto-win - Standard
	option = {
		name = regula_laamp_marriage_dispute_contract.0150.stewardship.auto_win
		trigger = { stewardship >= @regula_laamp_marriage_dispute_contract_skill_threshold_value }
		skill = stewardship

		save_scope_value_as = {
			name = resolution_type
			value = flag:stewardship
		}

		show_as_tooltip = { regula_laamp_marriage_dispute_contract_standard_effect = yes }
		trigger_event = regula_laamp_marriage_dispute_contract.0151

		ai_chance = {
			# If you can auto-win, do it.
			base = 10000
		}
	}

	# Steward duel - Standard
	option = {
		name = regula_laamp_marriage_dispute_contract.0150.stewardship.duel
		trigger = { stewardship < @regula_laamp_marriage_dispute_contract_skill_threshold_value }

		save_scope_value_as = {
			name = resolution_type
			value = flag:stewardship
		}

		duel = {
			skill = stewardship
			value = decent_skill_rating
			# Victory!
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 5
					min = -49
				}
				min = 5
				desc = regula_laamp_marriage_dispute_contract.generic.duel.tt.success
				show_as_tooltip = { regula_laamp_marriage_dispute_contract_standard_effect = yes }
				trigger_event = regula_laamp_marriage_dispute_contract.0151
			}
			# Defeat.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -5
					min = -49
				}
				min = 5
				desc = regula_laamp_marriage_dispute_contract.generic.duel.tt.failure
				show_as_tooltip = { regula_laamp_marriage_dispute_contract_loss_effect = yes }
				trigger_event = regula_laamp_marriage_dispute_contract.0153
			}
		}

		ai_chance = {
			base = 1
			ai_value_modifier = { ai_energy = 2 }
		}
	}

	# Find Bride
	# Intrigue auto-win - Recruitment
	option = {
		name = regula_laamp_marriage_dispute_contract.0150.intrigue.auto_win
		trigger = { intrigue >= @regula_laamp_marriage_dispute_contract_skill_threshold_value }
		skill = intrigue

		save_scope_value_as = {
			name = resolution_type
			value = flag:intrigue
		}

		show_as_tooltip = { regula_laamp_marriage_dispute_contract_recruitment_effect = yes }
		trigger_event = regula_laamp_marriage_dispute_contract.0152

		ai_chance = {
			# If you can auto-win, do it.
			base = 10000
		}
	}

	# Intrigue duel - Recruitment
	option = {
		name = regula_laamp_marriage_dispute_contract.0150.intrigue.duel
		trigger = { intrigue < @regula_laamp_marriage_dispute_contract_skill_threshold_value }

		save_scope_value_as = {
			name = resolution_type
			value = flag:intrigue
		}

		duel = {
			skill = intrigue
			value = decent_skill_rating
			# Victory!
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 5
					min = -49
				}
				min = 5
				desc = regula_laamp_marriage_dispute_contract.generic.duel.tt.success
				show_as_tooltip = { regula_laamp_marriage_dispute_contract_recruitment_effect = yes }
				trigger_event = regula_laamp_marriage_dispute_contract.0152
			}
			# Defeat.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -5
					min = -49
				}
				min = 5
				desc = regula_laamp_marriage_dispute_contract.generic.duel.tt.failure
				show_as_tooltip = { regula_laamp_marriage_dispute_contract_loss_effect = yes }
				trigger_event = regula_laamp_marriage_dispute_contract.0153
			}
		}

		ai_chance = {
			base = 1
			ai_value_modifier = { ai_energy = 2 }
		}
	}

	# Troops - Standard
	option = {
		name = regula_laamp_marriage_dispute_contract.0150.army

		trigger = {
			current_military_strength >= 750
			OR = {
				martial >= 12
				stewardship >= 12
			}
		}
		show_as_unavailable = {
			always = yes
		}

		save_scope_value_as = {
			name = resolution_type
			value = flag:army
		}

		show_as_tooltip = { regula_laamp_marriage_dispute_contract_standard_effect = yes }
		trigger_event = regula_laamp_marriage_dispute_contract.0151

		ai_chance = {
			# If you can auto-win, do it.
			base = 10000
		}
	}

	# Hunt (aka tracking) Experience - Recruitment
	option = {
		name = regula_laamp_marriage_dispute_contract.0150.track

		trait = lifestyle_traveler
		trait = lifestyle_hunter

		trigger = {
			OR = {
				AND = {
					has_trait = lifestyle_hunter
					has_trait_xp = {
						trait = lifestyle_hunter
						track = hunter
						value >= 75
					}
				}
				AND = {
					has_trait = lifestyle_traveler
					OR = {
						has_trait_xp = {
							trait = lifestyle_traveler
							track = travel
							value >= 50
						}
						has_trait_xp = {
							trait = lifestyle_traveler
							track = danger
							value >= 50
						}
					}
				}
			}
		}
		show_as_unavailable = {
			always = yes
		}

		save_scope_value_as = {
			name = resolution_type
			value = flag:track
		}

		show_as_tooltip = { regula_laamp_marriage_dispute_contract_recruitment_effect = yes }
		trigger_event = regula_laamp_marriage_dispute_contract.0152

		ai_chance = {
			# If you can auto-win, do it.
			base = 10000
		}
	}

	# Stress solve it - Standard
	option = {
		name = regula_laamp_marriage_dispute_contract.0150.stress

		save_scope_value_as = {
			name = resolution_type
			value = flag:stress
		}

		show_as_tooltip = { regula_laamp_marriage_dispute_contract_standard_effect = yes }
		trigger_event = regula_laamp_marriage_dispute_contract.0111

		regula_laamp_marriage_dispute_contract_stress_fallback_option_effect = yes
		ai_chance = {
			# AI should try to take any other option.
			base = 0
		}
	}
}

# Victory event - Standard
regula_laamp_marriage_dispute_contract.0151 = {
	type = character_event
	title = regula_laamp_marriage_dispute_contract.0151.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = { scope:resolution_type = flag:stewardship}
				desc = regula_laamp_marriage_dispute_contract.0151.desc.resolution_type.stewardship
			}
			triggered_desc = {
				trigger = { scope:resolution_type = flag:army }
				desc = regula_laamp_marriage_dispute_contract.0151.desc.resolution_type.army
			}
			triggered_desc = {
				trigger = { scope:resolution_type = flag:stress }
				desc = regula_laamp_marriage_dispute_contract.0151.desc.resolution_type.stress
			}
		}
		desc = regula_laamp_marriage_dispute_contract.0151.desc.outro
	}
	theme = stewardship
	left_portrait = {
		character = root
		animation = personality_bold
	}
	right_portrait = {
		character = scope:employer
		animation = admiration
	}
	override_background = { reference = temple_scope }

	immediate = {
		regula_laamp_marriage_dispute_contract_standard_effect = yes
	}

	# Congratulations!
	option = {
		name = regula_laamp_marriage_dispute_contract.0151.a

		return_home = yes
	}
}

# Victory event - Recruitment
regula_laamp_marriage_dispute_contract.0152 = {
	type = character_event
	title = regula_laamp_marriage_dispute_contract.0152.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = { scope:resolution_type = flag:intrigue }
				desc = regula_laamp_marriage_dispute_contract.0152.desc.resolution_type.intrigue
			}
			triggered_desc = {
				trigger = { scope:resolution_type = flag:track }
				desc = regula_laamp_marriage_dispute_contract.0152.desc.resolution_type.track
			}
		}
		desc = regula_laamp_marriage_dispute_contract.0152.desc.outro
	}
	theme = intrigue
	left_portrait = {
		character = root
		animation = flirtation
	}
	right_portrait = {
		character = scope:bride
		animation = love
	}
	lower_center_portrait = scope:employer
	override_background = { reference = wilderness_scope }

	immediate = {
		regula_laamp_marriage_dispute_contract_recruitment_effect = yes
	}

	# Congratulations!
	option = {
		name = regula_laamp_marriage_dispute_contract.0152.a

		return_home = yes
	}
}

# Defeat event.
regula_laamp_marriage_dispute_contract.0153 = {
	type = character_event
	title = regula_laamp_marriage_dispute_contract.0153.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = { scope:resolution_type = flag:stewardship }
				desc = regula_laamp_marriage_dispute_contract.0153.desc.stewardship
			}
			triggered_desc = {
				trigger = { scope:resolution_type = flag:intrigue }
				desc = regula_laamp_marriage_dispute_contract.0153.desc.intrigue
			}
		}
		desc = regula_laamp_marriage_dispute_contract.0153.desc.outro
	}
	theme = stewardship
	left_portrait = {
		character = root
		animation = worry
	}
	right_portrait = {
		character = scope:employer
		animation = anger
	}
	lower_center_portrait = scope:groom
	override_background = { reference = temple_scope }

	immediate = {
		regula_laamp_marriage_dispute_contract_loss_effect = yes

		hidden_effect = {
			# Disappear the bride because no longer needed
			scope:bride = {
				death = {
					death_reason = death_disappearance
				}
			}
		}
	}

	# RIP.
	option = {
		name = regula_laamp_marriage_dispute_contract.0153.a

		return_home = yes
	}
}

################################################
# The Blood Price -  Marriage Dispute
# 0160 - 0169
# A Woman has killed her husband in self defence
# Diplomacy / Learning challenge
# Also can:
# 1. Spend health (injure self) - Standard
# 2. Forgiving/Compassionate/Calm Or Vengeful/Callous/Sadistic/Wrathful special options (Recruitment or standard) also costs prestige
# 3. Stress solve - Standard
################################################
regula_laamp_marriage_dispute_contract.0160 = {
	type = character_event
	title = regula_laamp_marriage_dispute_contract.0160.t
	desc = {
		desc = regula_laamp_marriage_dispute_contract.0160.desc
		first_valid = {
			triggered_desc = {
				trigger = {
					scope:bride_quality = flag:fantastic
				}
				desc = regula_laamp_marriage_dispute_contract.recruit_quality.fantastic
			}
			triggered_desc = {
				trigger = {
					scope:bride_quality = flag:great
				}
				desc = regula_laamp_marriage_dispute_contract.recruit_quality.great
			}
			triggered_desc = {
				trigger = {
					scope:bride_quality = flag:good
				}
				desc = regula_laamp_marriage_dispute_contract.recruit_quality.good
			}
			triggered_desc = {
				trigger = {
					scope:bride_quality = flag:okay
				}
				desc = regula_laamp_marriage_dispute_contract.recruit_quality.okay
			}
			triggered_desc = {
				trigger = {
					scope:bride_quality = flag:bad
				}
				desc = regula_laamp_marriage_dispute_contract.recruit_quality.bad
			}
		}
	}
	theme = skull
	left_portrait = {
		character = root
		animation = worry
	}
	right_portrait = {
		character = scope:bride
		animation = pain
	}
	lower_right_portrait = scope:employer

	override_background = { reference = throne_room_scope }

	immediate = {
		scope:employer = {
			save_scope_as = background_throne_room_scope
		}
		location = {
			save_scope_as = current_location
		}

		# Bride
		regula_laamp_marriage_dispute_create_random_bride_effect = yes

		# Don't bother creating Groom, because he's already "dead"
	}

	# Arrange blood price
	# Diplomacy auto-win - Standard
	option = {
		name = regula_laamp_marriage_dispute_contract.0160.diplomacy.auto_win
		trigger = { diplomacy >= @regula_laamp_marriage_dispute_contract_skill_threshold_value }
		skill = diplomacy

		save_scope_value_as = {
			name = resolution_type
			value = flag:diplomacy
		}

		show_as_tooltip = { regula_laamp_marriage_dispute_contract_standard_effect = yes }
		trigger_event = regula_laamp_marriage_dispute_contract.0161

		ai_chance = {
			# If you can auto-win, do it.
			base = 10000
		}
	}

	# Diplomacy duel - Standard
	option = {
		name = regula_laamp_marriage_dispute_contract.0160.diplomacy.duel
		trigger = { diplomacy < @regula_laamp_marriage_dispute_contract_skill_threshold_value }

		save_scope_value_as = {
			name = resolution_type
			value = flag:diplomacy
		}

		duel = {
			skill = diplomacy
			value = decent_skill_rating
			# Victory!
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 5
					min = -49
				}
				min = 5
				desc = regula_laamp_marriage_dispute_contract.generic.duel.tt.success
				show_as_tooltip = { regula_laamp_marriage_dispute_contract_standard_effect = yes }
				trigger_event = regula_laamp_marriage_dispute_contract.0161
			}
			# Defeat.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -5
					min = -49
				}
				min = 5
				desc = regula_laamp_marriage_dispute_contract.generic.duel.tt.failure
				show_as_tooltip = { regula_laamp_marriage_dispute_contract_loss_effect = yes }
				trigger_event = regula_laamp_marriage_dispute_contract.0163
			}
		}

		ai_chance = {
			base = 1
			ai_value_modifier = { ai_energy = 2 }
		}
	}

	# Convince Exile
	# Learning auto-win - Recruitment
	option = {
		name = regula_laamp_marriage_dispute_contract.0160.learning.auto_win
		trigger = { learning >= @regula_laamp_marriage_dispute_contract_skill_threshold_value }
		skill = learning

		save_scope_value_as = {
			name = resolution_type
			value = flag:learning
		}

		show_as_tooltip = { regula_laamp_marriage_dispute_contract_recruitment_effect = yes }
		trigger_event = regula_laamp_marriage_dispute_contract.0162

		ai_chance = {
			# If you can auto-win, do it.
			base = 10000
		}
	}

	# Learning duel - Recruitment
	option = {
		name = regula_laamp_marriage_dispute_contract.0160.learning.duel
		trigger = { learning < @regula_laamp_marriage_dispute_contract_skill_threshold_value }

		save_scope_value_as = {
			name = resolution_type
			value = flag:learning
		}

		duel = {
			skill = learning
			value = decent_skill_rating
			# Victory!
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 5
					min = -49
				}
				min = 5
				desc = regula_laamp_marriage_dispute_contract.generic.duel.tt.success
				show_as_tooltip = { regula_laamp_marriage_dispute_contract_recruitment_effect = yes }
				trigger_event = regula_laamp_marriage_dispute_contract.0162
			}
			# Defeat.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -5
					min = -49
				}
				min = 5
				desc = regula_laamp_marriage_dispute_contract.generic.duel.tt.failure
				show_as_tooltip = { regula_laamp_marriage_dispute_contract_loss_effect = yes }
				trigger_event = regula_laamp_marriage_dispute_contract.0163
			}
		}

		ai_chance = {
			base = 1
			ai_value_modifier = { ai_energy = 2 }
		}
	}

	# Spend Health - Standard
	option = {
		name = regula_laamp_marriage_dispute_contract.0160.blood
		trigger = {
			is_healthy = yes
		}

		increase_wounds_no_death_effect = { REASON = wounds }

		save_scope_value_as = {
			name = resolution_type
			value = flag:blood
		}

		show_as_tooltip = { regula_laamp_marriage_dispute_contract_standard_effect = yes }
		trigger_event = regula_laamp_marriage_dispute_contract.0161

		ai_chance = {
			# If you can auto-win, do it.
			base = 10000
		}
	}
	
	# Forgiving - Recruitment
	option = {
		name = regula_laamp_marriage_dispute_contract.0160.forgiving
		trigger = {
			OR = {
				has_trait = forgiving
				has_trait = compassionate
				has_trait = calm
			}
			prestige >= scope:prestige_bribe
		}
		trait = forgiving
		trait = compassionate
		trait = calm

		save_scope_value_as = {
			name = resolution_type
			value = flag:forgiving
		}

		# Should be a negative value
		add_prestige = scope:prestige_bribe

		show_as_tooltip = { regula_laamp_marriage_dispute_contract_recruitment_effect = yes }
		trigger_event = regula_laamp_marriage_dispute_contract.0162

		ai_chance = {
			# If you can auto-win, do it.
			base = 10000
		}
	}

	# Vengeful - Standard
	option = {
		name = regula_laamp_marriage_dispute_contract.0160.vengeful
		trigger = {
			OR = {
				has_trait = vengeful
				has_trait = sadistic
				has_trait = callous
				has_trait = wrathful
			}
			prestige >= scope:prestige_bribe
		}
		trait = vengeful
		trait = sadistic
		trait = callous
		trait = wrathful
		show_as_unavailable = {
			always = yes
		}

		save_scope_value_as = {
			name = resolution_type
			value = flag:vengeful
		}

		# Should be a negative value
		add_prestige = scope:prestige_bribe

		show_as_tooltip = { regula_laamp_marriage_dispute_contract_standard_effect = yes }
		trigger_event = regula_laamp_marriage_dispute_contract.0161

		ai_chance = {
			# If you can auto-win, do it.
			base = 10000
		}
	}

	# Stress solve it.
	option = {
		name = regula_laamp_marriage_dispute_contract.0160.stress

		save_scope_value_as = {
			name = resolution_type
			value = flag:stress
		}

		show_as_tooltip = { regula_laamp_marriage_dispute_contract_standard_effect = yes }
		trigger_event = regula_laamp_marriage_dispute_contract.0161

		regula_laamp_marriage_dispute_contract_stress_fallback_option_effect = yes
		ai_chance = {
			# AI should try to take any other option.
			base = 0
		}
	}
}

# Victory event - Standard
regula_laamp_marriage_dispute_contract.0161 = {
	type = character_event
	title = regula_laamp_marriage_dispute_contract.0161.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = { scope:resolution_type = flag:diplomacy }
				desc = regula_laamp_marriage_dispute_contract.0161.desc.resolution_type.diplomacy
			}
			triggered_desc = {
				trigger = { scope:resolution_type = flag:blood }
				desc = regula_laamp_marriage_dispute_contract.0161.desc.resolution_type.blood
			}
			triggered_desc = {
				trigger = { scope:resolution_type = flag:vengeful }
				desc = regula_laamp_marriage_dispute_contract.0161.desc.resolution_type.diplomacy
			}
			triggered_desc = {
				trigger = { scope:resolution_type = flag:stress }
				desc = regula_laamp_marriage_dispute_contract.0161.desc.resolution_type.stress
			}
		}
		desc = regula_laamp_marriage_dispute_contract.0161.desc.outro
	}
	theme = learning
	left_portrait = {
		character = root
		animation = personality_forgiving
	}
	right_portrait = {
		character = scope:employer
		animation = admiration
	}
	override_background = { reference = throne_room_scope }

	immediate = {
		regula_laamp_marriage_dispute_contract_standard_effect = yes

		hidden_effect = {
			# Disappear the bride because no longer needed
			scope:bride = {
				death = {
					death_reason = death_disappearance
				}
			}
		}
	}

	# Congratulations!
	option = {
		name = regula_laamp_marriage_dispute_contract.0161.a

		return_home = yes
	}
}

# Victory event - Recruitment
regula_laamp_marriage_dispute_contract.0162 = {
	type = character_event
	title = regula_laamp_marriage_dispute_contract.0162.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = { scope:resolution_type = flag:learning }
				desc = regula_laamp_marriage_dispute_contract.0162.desc.resolution_type.learning
			}
			triggered_desc = {
				trigger = { scope:resolution_type = flag:forgiving }
				desc = regula_laamp_marriage_dispute_contract.0162.desc.resolution_type.forgiving
			}
		}
		desc = regula_laamp_marriage_dispute_contract.0162.desc.outro
	}
	theme = learning
	left_portrait = {
		character = root
		animation = flirtation
	}
	right_portrait = {
		character = scope:bride
		animation = love
	}
	lower_center_portrait = scope:employer
	override_background = { reference = throne_room_scope }

	immediate = {
		regula_laamp_marriage_dispute_contract_recruitment_effect = yes
	}

	# Congratulations!
	option = {
		name = regula_laamp_marriage_dispute_contract.0162.a

		return_home = yes
	}
}

# Defeat event.
regula_laamp_marriage_dispute_contract.0163 = {
	type = character_event
	title = regula_laamp_marriage_dispute_contract.0163.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = { scope:resolution_type = flag:diplomacy }
				desc = regula_laamp_marriage_dispute_contract.0163.desc.diplomacy
			}
			triggered_desc = {
				trigger = { scope:resolution_type = flag:learning }
				desc = regula_laamp_marriage_dispute_contract.0163.desc.learning
			}
		}
		desc = regula_laamp_marriage_dispute_contract.0163.desc.outro
	}
	theme = learning
	left_portrait = {
		character = root
		animation = shame
	}
	right_portrait = {
		character = scope:bride
		animation = dead
	}
	lower_center_portrait = scope:employer
	override_background = { reference = physicians_study }

	immediate = {
		regula_laamp_marriage_dispute_contract_loss_effect = yes

		hidden_effect = {
			# Disappear the bride because no longer needed
			scope:bride = {
				death = {
					death_reason = death_bleeder
				}
			}
		}
	}

	# RIP.
	option = {
		name = regula_laamp_marriage_dispute_contract.0163.a

		return_home = yes
	}
}